-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathNOTES
More file actions
200 lines (137 loc) · 9.93 KB
/
NOTES
File metadata and controls
200 lines (137 loc) · 9.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
recordString = recordString.replace(/\s{2,}/g, ' ');
if(/^COMMENT/.test(recordString)){
record.comment = recordString.replace(/^COMMENT/,'');
return record;
}
recordString = recordString.split(/ \/ /);
if(recordString.length > 2){
console.log("Malformed record");
return;
}
// Trim spaces at beggining and end
if(!/\s*/.test(recordString[1])){
record.comment = recordString[1].trim();
}
recordString = recordString[0].split(/=/);
if(recordString.length != 2){
console.log("Malformed record");
return;
}
// Remove spaces from id and value
recordString[0] = recordString[0].replace(/\s*/g,'');
recordString[1] = recordString[1].replace(/\s*/g,'');
record.value = recordString[1].replace(/^[\'|\"](\S*)[\'|\"]$/,'$1');
libxmljs requires Pythton scons
$ wget http://sourceforge.net/projects/scons/files/scons/2.0.1/scons-2.0.1.tar.gz
$ tar xvf scons-2.0.1.tar.gz
$ cd scons-2.0.1
$ sudo python setup.py install --standalone-lib
wget query
----------
wget -O result "http://cas.sdss.org/public/en/tools/search/x_sql.asp?format=xml&cmd=SELECT%20TOP%20500%20objid%2C%20ra%2C%20dec%2C%20modelMag_u%2C%20modelMag_g%2C%20modelMag_r%2C%20modelMag_i%2C%20modelMag_z%2C%20(modelMag_u%20-%20modelMag_g)%20as%20u_g%2C%20(modelMag_g%20-%20modelMag_r)%20as%20g_r%2C%20(modelMag_r%20-%20modelMag_i)%20as%20r_i%2C%20(modelMag_i%20-%20modelMag_z)%20as%20i_z%20from%20Star%20where%20ra%20between%20132.765666%20and%20132.884334%20and%20dec%20between%2011.755657%20and%2011.844343%20and%20modelMag_g%20%3E%20-9999%20ORDER%20BY%20modelMag_g%20ASC"
Testing API from console
------------------------
- Creating dashboard by providing records
curl -v -H "Content-Type: application/json" -X POST -d '{ "gadgets": {"skyView": {"number": 1}, "plotView": {"number" : 1}}, "dataSets": [{ "name": "Stars", "records": [{"objid":"1237671262272290970","ra":"132.82279455","dec":"11.75623274","modelMag_u":"16.483011","modelMag_g":"13.697638","modelMag_r":"8.793903","modelMag_i":"8.776305","modelMag_z":"11.774291","u_g":"2.785374","g_r":"4.903734","r_i":"0.017598","i_z":"-2.997986"}, {"objid":"1237671262272290962","ra":"132.84498644","dec":"11.80053042","modelMag_u":"15.75631","modelMag_g":"13.703258","modelMag_r":"13.506081","modelMag_i":"12.478303","modelMag_z":"12.25265","u_g":"2.053052","g_r":"0.197177","r_i":"1.027778","i_z":"0.225653"}]}]}' http://localhost/dashboard/
- Creating dashboard by providing query
curl -v -H "Content-Type: application/json" -X POST -d '{ "gadgets": {"skyView": {"number": 1}, "plotView": {"number" : 1}}, "dataSets": [{"name": "Stars", "source": "sdss", "query":"SELECT TOP 500 objid, ra, dec, modelMag_u, modelMag_g, modelMag_r, modelMag_i, modelMag_z, (modelMag_u - modelMag_g) as u_g, (modelMag_g - modelMag_r) as g_r, (modelMag_r - modelMag_i) as r_i, (modelMag_i - modelMag_z) as i_z from Star where ra between 132.765732 and 132.884267 and dec between 11.756152 and 11.843848 and modelMag_g > -9999 ORDER BY modelMag_g ASC"}]}' http://localhost/dashboard/
- Create data set by providing records
curl -v -H "Content-Type: application/json" -X POST -d '{"name": "Stars", "records": [{"objid":"1237671262272290970","ra":"132.82279455","dec":"11.75623274","modelMag_u":"16.483011","modelMag_g":"13.697638","modelMag_r":"8.793903","modelMag_i":"8.776305","modelMag_z":"11.774291","u_g":"2.785374","g_r":"4.903734","r_i":"0.017598","i_z":"-2.997986"},
{"objid":"1237671262272290962","ra":"132.84498644","dec":"11.80053042","modelMag_u":"15.75631","modelMag_g":"13.703258","modelMag_r":"13.506081","modelMag_i":"12.478303","modelMag_z":"12.25265","u_g":"2.053052","g_r":"0.197177","r_i":"1.027778","i_z":"0.225653"}]}' http://localhost/dataSet/
- Create data set by providing queryx
Delicious AJAX library that works on both node.js server and browser. In the browser it detects cross domain requests and then it falls back into iframe proxy method.
Count word in file. Including multiple ocurrencies in one line
grep -o string * | wc -l
Count words in file. One per line
cat * | grep -c string
Node friendly Hosting services
------------------------------
EC2, heroku, joyent
Keep in mind.
-------------
Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes.
The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them.
About the only thing you can’t do is ignore them. Because they change things. They invent. They imagine. They heal. They explore. They create. They inspire. They push the human race forward.
Maybe they have to be crazy. How else can you stare at an empty canvas and see a work of art? Or sit in silence and hear a song that’s never been written?
Or gaze at a red planet and see a laboratory on wheels? We make tools for these kinds of people.
While some see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.
It's often the same with any new, revolutionary thing.
People get stuck as they get older. Our minds are sort of electrochemical computers.
Your thoughts construct patterns like scaffolding in your mind. You are really etching chemical patterns.
In most cases, people get stuck in those patterns, just like grooves in a record, and they never get out of them.
It's a rare person who etches grooves that are other than a specific way of looking at things, a specific way of questioning things.
It's rare that you see an artist in his 30s or 40s able to really contribute something amazing.
Of course, there are some people who are innately curious, forever little kids in their awe of life, but they're rare.
Well, my favorite things in life are books, sushi and.... My favorite things in life don't cost any money.
It's really clear that the most precious resource we all have is time.
And what computer programming can do is to capture the underlying principles, the underlying essence, and then facilitate thousands of
experiences based on that perception of the underlying principles. Now, what if we could capture Aristotle's world view the
underlying principles of his world view? Then you could actually ask Aristotle a question.
SJ
Trim in Javascript
------------------
if (typeof String.prototype.trim !== 'function'){
String.prototype.trim = function (){
return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
};
}
Supplant in Javascript (templating)
------------------------------------
if (typeof String.prototype.supplant !== 'function'){
String.prototype.supplant = function(o){
return this.replace(/{{[^{}]*}})/g,
function(a,b){
var r = o[b];
return typeof r === 'string' ? r : a;
});
};
}
ADASS Presentation Idea
------------------------
Exercise of web purism
Building on the root concept of the web. Resource linking
Every piece of information has its own Url. Cache, bookmark, index and link...
Front ends on top of the API. Show off concept with iPad application interacting with desktop browser
Google Sky View Production Server Key
--------------------------------------
ABQIAAAAVGHgv2pouycqhAw5tCmtChRUEqzWmCBjYYhr3pAAB1-qbxF2ORS71VNJWPXhtTrP99ACOXUleuYOBg
Reasons iframes
----------------
Sandboxing: No global state leak
Gadget developers get to pick whatever libraries they prefer.
Gadgets defined in pure and standard HTML + JavaScript
ASCOT Data Core Concept
------------------------
Contributory database: User provides their own data in exchange for receiving a more robust set of aggregated data back that provides insight into the broader domain, or provides a vehicle for expressing a view. Give a little, get a lot back in return
Web based data processing platform: Pull data from a wide array of sources, integrate it into a unified stream, make it consumable via a dashboard or through an API
Lazy data modeling: Instead of trying to guess the future we store data "as-is" and deal with transformation when a necessary use case arises.
Ascot enables users to receive immediate feedback for any contributions. It reduces the feedback loop.
ASCOT Usability Philosophy
--------------------------
Rule of fifteen minutes: For each new API, language, or format a person of reasonable ability should be able to get from zero to ‘Hello World’ in fifteen minutes
We will provide support with existing XML based systems but we don't support it
-------------------------------------------------------------------------------
XML = Data bureaucracy. We don't want to spend time formalizing, serializing, parsing and translating data. We want to use data. We want to be flexible and iterate fast. XML is not agile.
XML is verbose. We plan to deal with big data sets. XML introduce an overhead in memory, storage and CPU costs.
XML is ugly and complex for programmers. Reading and writing XML is unpleasant.
Communications Libraries
------------------------
NowJS - Current. Loss of messages, disconnections and slow with big pieces of data.
Faye - Bayeux Protocol
Juggernaut - Separated Server
pubsub.io - No channels. Subscribers provide queries and receive data satisfying those queries. Interesting concept.
I would like to get hard numbers to compare performance of the different solutions.
Post Message Support
--------------------
FF3+, IE8+, Chrome, Safari 4+, Opera10+
Cross domain techniques
-----------------------
Proxy server - Works fine but introduces latency + All data goes through our server using our resources. ASCOT queries can be big. Several MB.
postMessage iframe - No control of the source.
iframe URL fragments - URL characters limited
JSONP - No control of the source. Only GET requests. URL size limited (2083 characters in IE)
Flash - No control of the source.
Google Earth Key
----------------
Secondary EC2 machine. ec2-50-17-98-131.compute-1.amazonaws.com
ABQIAAAAVGHgv2pouycqhAw5tCmtChSgAW_Zt7dsPQTqtLFPmEWfUKVcTxSnMle1Pk2GBy6c6kC9S7RhiNUm3Q