From 9777798cf7840848db7d34473bdc4b5018f70b41 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 24 Jul 2012 11:10:57 -0500 Subject: Move max json into json samples --- samples/JSON/Hello.maxhelp | 367 ++++++++++++++++++++++++++++++++++++++++++++ samples/JSON/Hello.maxpat | 368 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 735 insertions(+) create mode 100644 samples/JSON/Hello.maxhelp create mode 100644 samples/JSON/Hello.maxpat (limited to 'samples/JSON') diff --git a/samples/JSON/Hello.maxhelp b/samples/JSON/Hello.maxhelp new file mode 100644 index 0000000..537f567 --- /dev/null +++ b/samples/JSON/Hello.maxhelp @@ -0,0 +1,367 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 5, + "minor" : 1, + "revision" : 9 + } +, + "rect" : [ 198.0, 92.0, 365.0, 407.0 ], + "bglocked" : 0, + "defrect" : [ 198.0, 92.0, 365.0, 407.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 0, + "default_fontsize" : 14.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 20.0, 20.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "enablehscroll" : 1, + "enablevscroll" : 1, + "devicewidth" : 0.0, + "boxes" : [ { + "box" : { + "maxclass" : "button", + "patching_rect" : [ 260.0, 260.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "id" : "obj-22" + } + + } +, { + "box" : { + "maxclass" : "button", + "patching_rect" : [ 240.0, 260.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "id" : "obj-20" + } + + } +, { + "box" : { + "maxclass" : "button", + "patching_rect" : [ 220.0, 260.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "id" : "obj-18" + } + + } +, { + "box" : { + "maxclass" : "button", + "patching_rect" : [ 200.0, 260.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "id" : "obj-16" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "route 0 1 2 3", + "patching_rect" : [ 200.0, 220.0, 99.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 5, + "outlettype" : [ "", "", "", "", "" ], + "fontsize" : 14.0, + "id" : "obj-14" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "r jojo", + "patching_rect" : [ 200.0, 180.0, 41.0, 23.0 ], + "numinlets" : 0, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "" ], + "fontsize" : 14.0, + "color" : [ 0.827451, 0.737255, 0.835294, 1.0 ], + "id" : "obj-13" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "s jojo", + "patching_rect" : [ 20.0, 340.0, 43.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 0, + "fontsize" : 14.0, + "color" : [ 0.827451, 0.737255, 0.835294, 1.0 ], + "id" : "obj-12" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "append toto", + "patching_rect" : [ 20.0, 300.0, 84.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "" ], + "fontsize" : 14.0, + "id" : "obj-11" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "% 4", + "patching_rect" : [ 20.0, 260.0, 35.0, 23.0 ], + "numinlets" : 2, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "int" ], + "fontsize" : 14.0, + "id" : "obj-10" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "counter", + "patching_rect" : [ 20.0, 220.0, 73.0, 23.0 ], + "numinlets" : 5, + "fontname" : "Arial", + "numoutlets" : 4, + "outlettype" : [ "int", "", "", "int" ], + "fontsize" : 14.0, + "id" : "obj-9" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "metro 250", + "patching_rect" : [ 20.0, 180.0, 74.0, 23.0 ], + "numinlets" : 2, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "fontsize" : 14.0, + "id" : "obj-8" + } + + } +, { + "box" : { + "maxclass" : "toggle", + "patching_rect" : [ 20.0, 140.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "id" : "obj-7" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "t 0", + "patching_rect" : [ 140.0, 80.0, 26.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "int" ], + "fontsize" : 14.0, + "id" : "obj-5" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "t 1", + "patching_rect" : [ 20.0, 80.0, 26.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "int" ], + "fontsize" : 14.0, + "id" : "obj-4" + } + + } +, { + "box" : { + "maxclass" : "message", + "text" : "Goodbye World !", + "patching_rect" : [ 140.0, 40.0, 115.0, 21.0 ], + "numinlets" : 2, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "" ], + "fontsize" : 14.0, + "id" : "obj-3" + } + + } +, { + "box" : { + "maxclass" : "message", + "text" : "Hello World !", + "patching_rect" : [ 20.0, 40.0, 90.0, 21.0 ], + "numinlets" : 2, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "" ], + "fontsize" : 14.0, + "id" : "obj-2" + } + + } + ], + "lines" : [ { + "patchline" : { + "source" : [ "obj-2", 0 ], + "destination" : [ "obj-4", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-3", 0 ], + "destination" : [ "obj-5", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-4", 0 ], + "destination" : [ "obj-7", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-5", 0 ], + "destination" : [ "obj-7", 0 ], + "hidden" : 0, + "midpoints" : [ 149.5, 121.0, 29.5, 121.0 ] + } + + } +, { + "patchline" : { + "source" : [ "obj-7", 0 ], + "destination" : [ "obj-8", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-8", 0 ], + "destination" : [ "obj-9", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-9", 0 ], + "destination" : [ "obj-10", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-10", 0 ], + "destination" : [ "obj-11", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-11", 0 ], + "destination" : [ "obj-12", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-13", 0 ], + "destination" : [ "obj-14", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-14", 0 ], + "destination" : [ "obj-16", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-14", 1 ], + "destination" : [ "obj-18", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-14", 2 ], + "destination" : [ "obj-20", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-14", 3 ], + "destination" : [ "obj-22", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } + ] + } + +} diff --git a/samples/JSON/Hello.maxpat b/samples/JSON/Hello.maxpat new file mode 100644 index 0000000..7a27dd2 --- /dev/null +++ b/samples/JSON/Hello.maxpat @@ -0,0 +1,368 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 5, + "minor" : 1, + "revision" : 9 + } +, + "rect" : [ 198.0, 92.0, 365.0, 407.0 ], + "bglocked" : 0, + "defrect" : [ 198.0, 92.0, 365.0, 407.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 0, + "default_fontsize" : 14.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 20.0, 20.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "enablehscroll" : 1, + "enablevscroll" : 1, + "devicewidth" : 0.0, + "boxes" : [ { + "box" : { + "maxclass" : "button", + "patching_rect" : [ 260.0, 260.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "id" : "obj-22" + } + + } +, { + "box" : { + "maxclass" : "button", + "patching_rect" : [ 240.0, 260.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "id" : "obj-20" + } + + } +, { + "box" : { + "maxclass" : "button", + "patching_rect" : [ 220.0, 260.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "id" : "obj-18" + } + + } +, { + "box" : { + "maxclass" : "button", + "patching_rect" : [ 200.0, 260.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "id" : "obj-16" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "route 0 1 2 3", + "patching_rect" : [ 200.0, 220.0, 99.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 5, + "outlettype" : [ "", "", "", "", "" ], + "fontsize" : 14.0, + "id" : "obj-14" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "r jojo", + "patching_rect" : [ 200.0, 180.0, 41.0, 23.0 ], + "numinlets" : 0, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "" ], + "fontsize" : 14.0, + "color" : [ 0.827451, 0.737255, 0.835294, 1.0 ], + "id" : "obj-13" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "s jojo", + "patching_rect" : [ 20.0, 340.0, 43.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 0, + "fontsize" : 14.0, + "color" : [ 0.827451, 0.737255, 0.835294, 1.0 ], + "id" : "obj-12" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "append toto", + "patching_rect" : [ 20.0, 300.0, 84.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "" ], + "fontsize" : 14.0, + "id" : "obj-11" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "% 4", + "patching_rect" : [ 20.0, 260.0, 35.0, 23.0 ], + "numinlets" : 2, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "int" ], + "fontsize" : 14.0, + "id" : "obj-10" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "counter", + "patching_rect" : [ 20.0, 220.0, 73.0, 23.0 ], + "numinlets" : 5, + "fontname" : "Arial", + "numoutlets" : 4, + "outlettype" : [ "int", "", "", "int" ], + "fontsize" : 14.0, + "id" : "obj-9" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "metro 250", + "patching_rect" : [ 20.0, 180.0, 74.0, 23.0 ], + "numinlets" : 2, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "fontsize" : 14.0, + "id" : "obj-8" + } + + } +, { + "box" : { + "maxclass" : "toggle", + "patching_rect" : [ 20.0, 140.0, 20.0, 20.0 ], + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "id" : "obj-7" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "t 0", + "patching_rect" : [ 140.0, 80.0, 26.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "int" ], + "fontsize" : 14.0, + "id" : "obj-5" + } + + } +, { + "box" : { + "maxclass" : "newobj", + "text" : "t 1", + "patching_rect" : [ 20.0, 80.0, 26.0, 23.0 ], + "numinlets" : 1, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "int" ], + "fontsize" : 14.0, + "id" : "obj-4" + } + + } +, { + "box" : { + "maxclass" : "message", + "text" : "Goodbye World !", + "patching_rect" : [ 140.0, 40.0, 115.0, 21.0 ], + "numinlets" : 2, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "" ], + "fontsize" : 14.0, + "presentation_rect" : [ 137.0, 42.0, 0.0, 0.0 ], + "id" : "obj-3" + } + + } +, { + "box" : { + "maxclass" : "message", + "text" : "Hello World !", + "patching_rect" : [ 20.0, 40.0, 90.0, 21.0 ], + "numinlets" : 2, + "fontname" : "Arial", + "numoutlets" : 1, + "outlettype" : [ "" ], + "fontsize" : 14.0, + "id" : "obj-2" + } + + } + ], + "lines" : [ { + "patchline" : { + "source" : [ "obj-14", 3 ], + "destination" : [ "obj-22", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-14", 2 ], + "destination" : [ "obj-20", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-14", 1 ], + "destination" : [ "obj-18", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-14", 0 ], + "destination" : [ "obj-16", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-13", 0 ], + "destination" : [ "obj-14", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-11", 0 ], + "destination" : [ "obj-12", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-10", 0 ], + "destination" : [ "obj-11", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-9", 0 ], + "destination" : [ "obj-10", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-8", 0 ], + "destination" : [ "obj-9", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-7", 0 ], + "destination" : [ "obj-8", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-5", 0 ], + "destination" : [ "obj-7", 0 ], + "hidden" : 0, + "midpoints" : [ 149.5, 121.0, 29.5, 121.0 ] + } + + } +, { + "patchline" : { + "source" : [ "obj-4", 0 ], + "destination" : [ "obj-7", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-3", 0 ], + "destination" : [ "obj-5", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } +, { + "patchline" : { + "source" : [ "obj-2", 0 ], + "destination" : [ "obj-4", 0 ], + "hidden" : 0, + "midpoints" : [ ] + } + + } + ] + } + +} -- cgit v1.2.3 From be1340bafc428e35e73461a534607d9cf70e01e3 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 24 Jul 2012 11:12:33 -0500 Subject: Add a few more json samples --- lib/linguist/samples.json | 20 +++++++++++--------- samples/JSON/person.json | 23 +++++++++++++++++++++++ samples/JSON/product.json | 7 +++++++ samples/JSON/schema.json | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 9 deletions(-) create mode 100644 samples/JSON/person.json create mode 100644 samples/JSON/product.json create mode 100644 samples/JSON/schema.json (limited to 'samples/JSON') diff --git a/lib/linguist/samples.json b/lib/linguist/samples.json index 51de62c..09b743d 100644 --- a/lib/linguist/samples.json +++ b/lib/linguist/samples.json @@ -76,7 +76,8 @@ ], "JSON": [ ".maxhelp", - ".maxpat" + ".maxpat", + ".json" ], "Julia": [ ".jl" @@ -234,8 +235,8 @@ "PKGBUILD" ] }, - "tokens_total": 164935, - "languages_total": 247, + "tokens_total": 164972, + "languages_total": 250, "tokens": { "Apex": { "/*": 15, @@ -9901,8 +9902,8 @@ "logger": 2 }, "JSON": { - "{": 30, - "}": 30, + "{": 47, + "}": 47, ".0": 90, "fontsize": 20, "id": 22, @@ -9940,7 +9941,8 @@ "destination": 28, "hidden": 28, "midpoints": 28, - "presentation_rect": 1 + "presentation_rect": 1, + "true": 3 }, "Julia": { "##": 5, @@ -20082,7 +20084,7 @@ "Ioke": 4, "Java": 6032, "JavaScript": 22985, - "JSON": 713, + "JSON": 750, "Julia": 173, "Kotlin": 149, "Logtalk": 23, @@ -20152,7 +20154,7 @@ "Ioke": 1, "Java": 5, "JavaScript": 19, - "JSON": 2, + "JSON": 5, "Julia": 1, "Kotlin": 1, "Logtalk": 1, @@ -20199,5 +20201,5 @@ "XSLT": 1, "YAML": 1 }, - "md5": "dc7a1070676887242211087f4137f22d" + "md5": "bf6ff91ae6d6ba38501cffb762e3b7fa" } \ No newline at end of file diff --git a/samples/JSON/person.json b/samples/JSON/person.json new file mode 100644 index 0000000..2624199 --- /dev/null +++ b/samples/JSON/person.json @@ -0,0 +1,23 @@ +{ + "firstName": "John", + "lastName" : "Smith", + "age" : 25, + "address" : + { + "streetAddress": "21 2nd Street", + "city" : "New York", + "state" : "NY", + "postalCode" : "10021" + }, + "phoneNumber": + [ + { + "type" : "home", + "number": "212 555-1234" + }, + { + "type" : "fax", + "number": "646 555-4567" + } + ] + } \ No newline at end of file diff --git a/samples/JSON/product.json b/samples/JSON/product.json new file mode 100644 index 0000000..2d5611a --- /dev/null +++ b/samples/JSON/product.json @@ -0,0 +1,7 @@ +{ + "id": 1, + "name": "Foo", + "price": 123, + "tags": ["Bar","Eek"], + "stock": { "warehouse":300, "retail":20 } +} \ No newline at end of file diff --git a/samples/JSON/schema.json b/samples/JSON/schema.json new file mode 100644 index 0000000..ee580cc --- /dev/null +++ b/samples/JSON/schema.json @@ -0,0 +1,47 @@ +{ + "name":"Product", + "properties": + { + "id": + { + "type":"number", + "description":"Product identifier", + "required":true + }, + "name": + { + "type":"string", + "description":"Name of the product", + "required":true + }, + "price": + { + "type":"number", + "minimum":0, + "required":true + }, + "tags": + { + "type":"array", + "items": + { + "type":"string" + } + }, + "stock": + { + "type":"object", + "properties": + { + "warehouse": + { + "type":"number" + }, + "retail": + { + "type":"number" + } + } + } + } +} \ No newline at end of file -- cgit v1.2.3