|
|
(One intermediate revision by the same user not shown) |
Line 77: |
Line 77: |
| |- | | |- |
| | | | | |
| {| class="mw-collapsible mw-collapsed wikitable"
| |
| ! String escape formatting across different languages and systems
| |
| |-
| |
| |
| |
| * c++ to JSON: always use nlohmann::json j.dump() to encode, to ensure strings are properly escaped
| |
| * JSON to c++: always use nlohmann::json j.parse() "
| |
| * c++ to Javascript: use raw_to_Javascript() to properly escape
| |
| * c++ to sqlite: use SqliteLocalModel::safestr(), which uses double_doublequotes(str)
| |
| |}
| |
| {| class="mw-collapsible mw-collapsed wikitable" | | {| class="mw-collapsible mw-collapsed wikitable" |
| ! Deleting multiple elements in a collection | | ! Deleting multiple elements in a collection |
Line 585: |
Line 576: |
| |- | | |- |
| | | | | |
| | {| class="mw-collapsible mw-collapsed wikitable" |
| | ! String escape formatting across different languages and systems |
| | |- |
| | | |
| | * c++ to JSON: always use nlohmann::json j.dump() to encode, to ensure strings are properly escaped |
| | * JSON to c++: always use nlohmann::json j.parse() " |
| | * c++ to Javascript: use raw_to_Javascript() to properly escape |
| | * c++ to sqlite: use SqliteLocalModel::safestr(), which uses double_doublequotes(str) |
| | |} |
| [[Postgres]] | | [[Postgres]] |
|
| |
|
Line 656: |
Line 656: |
| --> | | --> |
| {| class="mw-collapsible mw-collapsed wikitable" | | {| class="mw-collapsible mw-collapsed wikitable" |
| ! C/C++ debugging | | ! Debugging |
| |- | | |- |
| | | | | |
| | {| class="mw-collapsible mw-collapsed wikitable" |
| | ! Chrome capture large JSON variable |
| | |- |
| | | This is just pointlessly bizarre: |
| | * hit a breakpoint in the chrome debugger |
| | * right-click a variable and say "copy to global variable" (console will show name, typically "temp1") |
| | * push the variable to the clipboard by typing this in the console: |
| | copy(temp1) |
| | |} |
| | {| class="mw-collapsible mw-collapsed wikitable" |
| | ! Visual Studio Code capture large string variable |
| | |- |
| | | While debugging, you can use the Debug Console to print memory, including the content of strings that are clipped by default in the variables and watch windows. |
| | View > Open View > Debug Console |
| | From there, send gdb a command to print memory – 300 characters of a string in this example: |
| | -exec x/300sb Query.c_str() |
| | |} |
| {| class="mw-collapsible mw-collapsed wikitable" | | {| class="mw-collapsible mw-collapsed wikitable" |
| ! Qt Creator conditional breakpoint | | ! Qt Creator conditional breakpoint |