-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afd1806
commit 61015eb
Showing
83 changed files
with
4,628 additions
and
188 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Comment | ||
/* | ||
Multi | ||
Line | ||
Comment | ||
*/ | ||
[1,2,3,45 /*TODO: should be 42, obviously*/, 2016-04-21T08:10:46Z, 2016-04-21T08:10:46-08:00, 2016-04-21, 2016, 0x5, 0b0110] | ||
(5 7 1 3 [ | ||
'a', 'b', | ||
null, null.int, null.bool, null.list | ||
true, false, | ||
nan, -inf, +inf, | ||
"str", | ||
"str with embedded \" ", | ||
'''str with embedded \''' ''', | ||
{{"clob content"}}, | ||
{{ AB/ }} | ||
]) | ||
|
||
''' | ||
|
||
multi | ||
line | ||
string | ||
|
||
''' | ||
|
||
states::{ | ||
// https://amzn.github.io/ion-docs/docs/spec.html | ||
root: rules::[ | ||
include::'value' | ||
], | ||
|
||
// https://amzn.github.io/ion-docs/docs/spec.html#string | ||
string: rules::[ | ||
match::{ | ||
regex: "(\\\")((?:\\\\\"|[^\"])*)(\\\")", | ||
token: ['string.dblq.punc.start', 'string.dblq', 'string.dblq.punc.end'] | ||
}, | ||
push::{ | ||
regex: "\'{3}", | ||
token: 'string.trpq.punc.start', | ||
states: rules::[ | ||
pop::{ | ||
regex: "\'{3}", | ||
token: 'string.trpq.punc.end', | ||
}, | ||
match::{ | ||
regex: "(?:\\\\'*|.|[^']*)", | ||
token: 'string.trpq' | ||
} | ||
] | ||
}, | ||
], | ||
|
||
/* | ||
... | ||
*/ | ||
} | ||
{ | ||
"json": { | ||
"compatibility": true, | ||
"open sourced": "2016-04-21T08:10:46Z", | ||
"foo": 9, | ||
"bar": 1.1, | ||
"baz": [{"id": 1}, {"id":2}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
-- comment | ||
/* multi | ||
line | ||
comment */ | ||
|
||
SELECT a, b, c FROM stuff s INNER CROSS JOIN @s WHERE f(s) -- comment | ||
-- comment | ||
SELECT "a", b FROM stuff s, @s WHERE f(s) | ||
|
||
SELECT VALUE {'sensor': s.sensor, | ||
'readings': (SELECT VALUE l.co | ||
FROM logs as l | ||
WHERE l.sensor = s.sensor | ||
) | ||
} | ||
FROM sensors AS s | ||
|
||
SELECT VALUE (PIVOT v AT g | ||
FROM UNPIVOT r as v At g | ||
WHERE g LIKE 'co%') | ||
FROM sensors AS r | ||
|
||
|
||
SELECT x.* | ||
FROM [{'a':1, 'b':1}, {'a':2}, 'foo'] AS x | ||
|
||
-- NOTE: the embedded ion values parse as ion (inside the backticks "`") | ||
SELECT x.* | ||
FROM `[{'a':1, 'b':1}, {'a':2}, "foo"]` AS x | ||
|
||
SELECT VALUE {v.a: v.b, v.c: v.d} | ||
FROM <<{'a':'same', 'b':1, 'c':'same', 'd':2}>> AS v | ||
|
||
SELECT u.id, feedbackId, commentId, upvoteId | ||
FROM users as u, u.feedbacks as feedback at feedbackId | ||
LEFT CROSS JOIN feedback.comments as comment AT commentId | ||
LEFT CROSS JOIN UNPIVOT comment.upvotes as upvote at upvoteId | ||
|
||
|
||
SELECT ( | ||
SELECT numRec, tabulated | ||
FROM committed.changes changes, | ||
(SELECT u.id, feedbackId, commentId, upvoteId | ||
FROM changes.tabulated as u, | ||
u.feedbacks as feedback at feedbackId LEFT CROSS JOIN feedback.comments as comment AT commentId | ||
LEFT CROSS JOIN UNPIVOT comment.upvotes as upvote at upvoteId | ||
) as tabulated, | ||
changes.numRec as numRec | ||
) | ||
AS changes | ||
FROM incoming_committed committed | ||
|
||
SELECT SUM(AVG(n)) FROM <<numbers, numbers>> AS n | ||
|
||
SELECT VALUES v.a | ||
FROM [{'a':1, 'b':true}, {'a':2, 'b':null}, {'a':3}] v | ||
WHERE v.b | ||
|
||
SELECT attributeId, COUNT(*) as the_count | ||
FROM repeating_things | ||
GROUP BY attributeId GROUP AS g | ||
HAVING 1 = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/***************************************************************************** | ||
* | ||
* SAC demo program | ||
* | ||
* This SAC demo program implements 2-dimensional relaxation on double | ||
* precision floating point numbers applying a 4-point stencil and fixed | ||
* boundary conditions. | ||
* | ||
* The vertical (SIZE1) and the horizontal (SIZE2) array size as well as | ||
* the number of iterations to be performed (LOOP) may be set at compile | ||
* time. | ||
* | ||
*****************************************************************************/ | ||
|
||
#ifndef LOOP | ||
#define LOOP 100 | ||
#endif | ||
|
||
#ifndef SIZE1 | ||
#define SIZE1 1000 | ||
#endif | ||
|
||
#ifndef SIZE2 | ||
#define SIZE2 1000 | ||
#endif | ||
|
||
use Array: all; | ||
use StdIO: all; | ||
|
||
inline | ||
double[+] onestep(double[+] B) | ||
{ | ||
A = with { | ||
( . < x < . ) : 0.25*(B[x+[1,0]] | ||
+ B[x-[1,0]] | ||
+ B[x+[0,1]] | ||
+ B[x-[0,1]]); | ||
} : modarray( B ); | ||
|
||
return(A); | ||
} | ||
|
||
inline | ||
double[+] relax(double[+] A, int steps) | ||
{ | ||
for (k=0; k<steps; k++) { | ||
A = onestep(A); | ||
} | ||
|
||
return(A); | ||
} | ||
|
||
int main () | ||
{ | ||
A = with { | ||
( . <= x <= . ) : 0.0d; | ||
} : genarray( [SIZE1,SIZE2] ); | ||
|
||
A = modarray(A, [0,1], 500.0d); | ||
A = relax( A, LOOP); | ||
|
||
z = with { | ||
( 0*shape(A) <= x < shape(A) ) : A[x]; | ||
} : fold( +, 0d ); | ||
|
||
#if 0 | ||
printf("%.10g\n", z); | ||
return(0); | ||
#else | ||
print( z); | ||
return( 0); | ||
#endif | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
<meta name="author" content="Fabian Jakobs"> | ||
<!-- | ||
Ace | ||
version 1.4.14 | ||
version 1.5.0 | ||
commit | ||
--> | ||
|
||
|
Oops, something went wrong.