Posts

Showing posts from January, 2020

Oracle SQL JSON nested loop

This is a very cool way to do a depth first traversal of JSON that I have test in the Oracle 19c version of the database So the cool part is col3 clob format json with wrapper path '$.col3[*]' that stores a JSON objects for col3 so that the outer loop does not care what the object contents are the inner loop then parses this JSON. This is a very compact and readable way of traversing all of your JSON begin for rec1 in ( select col1, col2, col3 from json_table( '{"col1": 1, "col2" : 2, col3 : {"col3foo1" :4, "col3foo2": 5}}' , '$[*]' columns col1 varchar2 ( 200 ) path '$.col1' , col2 varchar2 ( 200 ) path '$.col2' , col3 clob format json with wrapper path '$.col3[*]' ) ) loop dbms_output.put_line( 'col1=' ...

Dictionary for Algorithms and Data Structures

I bumped into this CS dictionary while I was looking up DoubleMetaphone for Fuzzy Search of Text. Dictionary of Algorithms and Data Structures 

Web Local Storage IndexedDB using Dexie.js

Image
If you go to cnn.com and open the Chrome Browser Developer Tools. You can see that cnn.is storing data locally in an IndexedDB Dexie.js is a wrapper over IndexedDB. It makes it easy to do CRUD. Note that all Dexie operations are asynchronous. Belows is a simple example of setting up a new "FriendsAndPetsDB" IndexedDB. The ++id is the primary key. You can also version your database and let Dexie upgrade it. var db = new Dexie("FriendsAndPetsDB"); db.version(1).stores({ friends: "++id,name,isCloseFriend", pets: "++id,name,kind" }); db.open(); db.friends.add({name: "Ingemar Bergman", isCloseFriend: 0}); db.pets.add({name: "Josephina", kind: "dog", fur: "too long right now"})