- request for creating(updating) a project(per store) in karte
- embed js code in html header
[APP_PUBLIC_KEY]&[APP_PRIVATE_KEY]would be sent from karte.io per app.
| var co = function(fn){ | |
| function is_gen(obj) { | |
| return obj && obj.constructor && 'GeneratorFunctionPrototype' == obj.constructor.name; | |
| } | |
| return function(done){ | |
| var gen = fn; | |
| if(typeof gen == 'function') | |
| gen = gen(); |
| var co = function(fn){ | |
| // callback | |
| var done = function(val){ | |
| // yieldに値を流し込む | |
| gen.next(val); | |
| } | |
| // make a generator | |
| var gen = fn(done); | |
| // start | |
| gen.next(); |
| // require co | |
| var co = require('co') | |
| , Gate = require('co-gate') | |
| , fs = require('fs'); | |
| co(function *(){ | |
| // create gate | |
| var gate = new Gate() | |
| , val = undefined; |
I found some modules of component/component (ex: lodash) may cause a problem with AMD module loader like requirejs.
You should delete locally the define property to make a component working nicely with these loaders.
like below..
install: components index.js
component build --standalone app --out . --name app-temp
sed -e "s/;(function(){/;(function(){var define = undefined;/g" app-temp.js > app.js| dnode = require 'dnode' | |
| async = require 'async' | |
| iteration_num = 100 | |
| # setup | |
| server = dnode { | |
| test: (a, b, cb)-> | |
| cb(null, a + b) | |
| } | |
| server.listen(8062) |
| from os.path import realpath | |
| import sys | |
| import numpy as np | |
| from numpy.random import rand | |
| from numpy import matrix | |
| from numpy import multiply | |
| from pyspark import SparkContext | |
| LAMBDA = 0.01 # regularization for als |
| SELECT corpus, word, word_count FROM tbl | |
| WHERE LENGTH(word) > 4 | |
| ORDER BY word_count | |
| DESC LIMIT 5 |
| SELECT corpus, word, SUM(word_count) AS total FROM tbl | |
| WHERE ... | |
| Group By corpus | |
| ORDER BY total | |
| DESC LIMIT 5 |
| SELECT hoge FROM a | |
| JOIN | |
| (SELECT fuga FROM b) AS c | |
| ON a.hoge = c.fuga |