Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/27/2023 in all areas

  1. Version v1.3.3

    243 downloads

    Create / Test / Learn JSON Processing jqPlayground is an interactive, jq-based, tool created using AutoIt. The purpose of the tool is to help in the creation, testing, and understanding of JSON filters/queries used in the processing of JSON datasets. Internally, it uses the jq UDF for all JSON processing. The dot and bracket notation access in jq are similar to other existing AutoIt JSON parsing UDFs and tools. Therefore, jqPlayground can be used as a general purpose testing & learning tool, regardless of the ultimate UDF or utility you choose to use. jqPlayground comes with numerous examples to help you see and understand how it can be used for simple parsing and much more advanced JSON processing. You can modify and play with the example filters or you can create and test your own. CONFIGURATION The only requirement needed to run jqPlayground is that it can find a jq executable. JQ executables can be found on the JQ website on the home page, its download section, or as a part of my JQ UDF in the AutoIt Downloads section. The latest jq executables have been included in the zip file. jqPlayground will look for the jq executable in the following order of precedence: 1. If a jqPlayground.ini file exists in the script directory, it will get the path to the jq executable under to following section and key: [CONFIG] JqExePath=<full path to jq exe> 2. A jq-win32.exe or jq-win64.exe, depending on the OS, in the script directory. 3. A jq.exe in the script directory. USAGE The interface is pretty simple and straight forward. Paste, load or write whatever JSON you want to play with in the INPUT section. Paste or write whatever parsing or processing filter(s) you want to test in the FILTER section. If necessary, you can select or enter any jq-specific flags you want. Then, either press the RUN button, F5 or CTRL+ENTER to execute your filter. You will see the output in the OUTPUT section. If your command was not successful, you will see the error message generated by JQ in the output section. There are also numerous examples that can be selected from EXAMPLES dropdown list. Upon selecting an example, it populates the filter, flags, and input as necessary. It then executes the example, showing the output in the OUTPUT section. The examples use one of 2 JSON datasets. BOOKS is a small, simple, JSON dataset that contains a catalog of book information. The NFL JSON dataset is much larger and complex. It is a snapshot of NFL game information during week 1 of the 2018 regular season. Some of the NFL JSON dataset examples really show off the speed and processing capabilities of JQ. If you want to dump the full path of every scalar JSON value in your JSON dataset, you can type "dump" in the FILTER section and press F5, CTRL+ENTER or the RUN button. The output is the same as the jqDump() function in the jq UDF. "Dump" is not a jq filter command. It is a special command that I added to help those new to JSON understand how to access a given JSON value using dot-notation. Lastly, right below the output section, you will see the time it took to execute your filter. This can be useful to those in which timimg is a major concern. jqPlayground HotKeys -------------------- Open the online jq manual - F1 Run the jq filter - F5 or Ctrl+Enter Clear/reset all fields - Alt+C Load a JSON from a file - Alt+L Save your current session - Ctrl+S Load a saved session - Ctrl+L Special Commands (Enter and run in filter) ------------------------------------------ dump - List full path of every scalar JSON value clear - Clear/reset all fields (same as Alt+C) USEFUL LINKS jq Home Page: https://jqlang.github.io/jq/ jq Manual: https://jqlang.github.io/jq/manual/ jq Downloads: https://jqlang.github.io/jq/download/ jq Tutorial: https://jqlang.github.io/jq/tutorial/ jq Wiki: https://github.com/jqlang/jq/wiki
    1 point
  2. @TheDcoder, Thanks for the reply. Well, I am cooking something interesting for AutoIt. A gui library fpr AutoIt. All heavy works are happening inside the dll. So after creating a window class, I need to transfer the necessary properties from the dll function to autoit. Currently map is in my radar. I am planning to use Scripting.Dictionary also. There are more than 20-25 properties and event name indexes to transfer. Anyhow, I am searching for new ways to do it.
    1 point
  3. Melba23

    Clamp function.

    kevinalberts, Welcome to the AutoIt forums. Here is my take on a "clamp" function: - @extended shows whether the passed value has been "clamped": For $i = 1 To 20 ConsoleWrite(_Clamp($i, 5, 15) & " - " & @extended & @CRLF) Next Func _Clamp($iValue, $iMin, $iMax) Local $fClamp = False If $iValue < $iMin Then $iValue = $iMin $fClamp = True ElseIf $iValue > $iMax Then $iValue = $iMax $fClamp = True EndIf Return SetError(0, $fClamp, $iValue) EndFunc I have left @error alone so you can do some initial checking on the passed value to see if it meets your requirements. M23
    1 point
  4. jchd

    Kobo Cover Fixer

    Missing images you should be able to recreate. Examine the case where all 3 formats exist, look at image parameters (color depth, size, ..., exif data) and resize existing images to the required missing format. I don't get the folder/subfolder logic either.
    0 points
×
×
  • Create New...