Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
no-JSON : from Curl data to serialized object
06-01-2012, 09:02 PM, (This post was last modified: 06-04-2012, 10:25 PM by RobertShiplett.)
#1
no-JSON : from Curl data to serialized object
In keeping with no-SQL, I couldn't resist no-JSON.

But seriously, once a large data set is in a Curl format - such as the dictionary entries that I use over at kanji.aule-browser.com - the next thing is simply to serialize the input source objects.

What I am looking at for now is to hold my annotations within the live dict as transient fields, but to save them in a universal format such as JSON. I do sometimes modify the dictionary entries by adding words: the entry for "fragrance, smell, perfume" was missing "scent", for example.

In addition, on-line resources such as the edict2 go through routine updates with new entries and other changes. These must pass through at least one iterator and then the object undergo a repeat serialization as a Curl binary resource file.

Serialization is a great strength of the Smalltalk programming environment and it can be as important for a Curl app which is not using SQL tables. There are comparable features in the great PDC dialect of PROLOG.

At http://www.aule-browser.com/kanji/poets/...dexed.html I have an applet loading 980 items from a serialized source. The applet uses the {deserialize } macro and displays a minimum number of columns (the other related information now resides in a second and third serialized source file, hence the indices.)

The serialized output is created using simple calls to a stream, e.g., {strm.write-one my-array} with the serialization protocol left as the default for Curl 8.0 (which is the curl7 protocol.)

This approach will speed up all of the applets for my "learn kanji" pages without the risk of any duplication of the original text data - which itself can be refreshed as needed and the serialized files re-created in batch.

All that was necessary was to declare my two main classes as serializable and to ensure that all text fields were declared using a default of {uninitialized-value-for-type String} to avoid any problematic values for transient fields (those fields get serialized on their own using the index for the parent object.)

Here is the result:

[Image: basho-indexed-small.jpg]

But. To see the real effect just look at the speed of the small daily pages such as http://www.aule-browser.com/kanji/poets/...dexed.html

The new daily page generated fast and it loads very fast. I have already cycled twice through the BIN serialization files as I find minor transcription errors in the principal text resource - but that text resource now does not need to reside on the applet web server !
Robert Shiplett, Curlr
Fredericton NB

Canada


Messages In This Thread
no-JSON : from Curl data to serialized object - by RobertShiplett - 06-01-2012, 09:02 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
Brick Curl macros introduction (part 1) RobertShiplett 4 6,993 04-25-2015, 05:28 PM
Last Post: glennmcgrath
  server-side Curl issue : TocDocument RobertShiplett 3 5,691 02-09-2015, 02:11 PM
Last Post: Sumeraxe
  Curl with HTML widget + CintaNotes RobertShiplett 0 4,444 09-08-2014, 07:42 AM
Last Post: RobertShiplett
  Curl for the new Kodansh kanji books RobertShiplett 0 3,032 09-07-2014, 08:51 PM
Last Post: RobertShiplett
  Curl on Facebook - another page RobertShiplett 0 3,737 02-01-2014, 02:29 AM
Last Post: RobertShiplett
  Curl for CoffeeScript folks RobertShiplett 0 4,758 06-29-2013, 02:52 AM
Last Post: RobertShiplett
  Curl JavaScript bytecodes RobertShiplett 0 4,939 06-19-2013, 10:33 PM
Last Post: RobertShiplett
  jinja2 templates for Curl RobertShiplett 0 4,147 06-14-2013, 08:33 AM
Last Post: RobertShiplett
  Curl and QNX RobertShiplett 0 4,932 04-24-2013, 11:38 PM
Last Post: RobertShiplett
  WikizPad Curl personal wiki RobertShiplett 0 4,115 03-11-2013, 01:09 AM
Last Post: RobertShiplett
Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('514')