skip to Main Content

Laravel – Auto fill object from json

I have a JSON: { "id":1, "name":"John", "firstname":"Doe" } Server side, I do it: $input = $request->json()->all(); $user = new User(); $user->id = $input['id']; $user->name = $input['name']; $user->firstname = $input['firstname']; Does it possible to auto fill my object with a…

VIEW QUESTION

Unpivoting data in SQL from JSON

This is a follow up to this question: Possible to "unpivot" in SQL when ingested from JSON. Let's say I have the following SQL table with data that was incorrectly inserted from a JSON document: X1AB_name X1AB_age Y2AL_name Y2AL_age "Todd"…

VIEW QUESTION

How to Convert cobal statement to Json

i have to convert cobal statement to json import re import json def extract_cursor(cobol_statement): pattern = r"MODIFY MAP (?: CURSOR|TEMP|FOR|PERM|CURSOR)?(?:CURSOR)?(?: AT)?(?: FIELD)?(?: DFLD)?s+([w-]+)(?!()" action_regex = re.compile(pattern, re.IGNORECASE) action_match = action_regex.search(cobol_statement) if action_match: cursor_value = action_match.group(1) if cursor_value.upper() != "FIELD" and…

VIEW QUESTION
Back To Top
Search