aqutw.github.io's People
aqutw.github.io's Issues
20160406read
javascript recursive example
window.s='';
window.record = {};
function f(o, parentKey){
for(var k in o){
if(!o.hasOwnProperty(k)){continue;}
var suffix = record[k] ? (record[k]+'') : '';
var k_and_suffix = k+suffix;
window.s+="r.db('work_genius').table('assignment_categories').insert({id:'"+k_and_suffix+"',name:'"+k+"',parentId:'"+parentKey+"'});" + "\r\n";
if (record.hasOwnProperty(k)){
record[k]++;
} else {
record[k] = 1;
}
if(typeof o[k]==='object'){
f(o[k], k_and_suffix);
}
}
}
f(o, 'root');
console.log(s);
C# 編譯失敗:錯誤 1 Files 有無效的值 "U�����R1}3ʼnE�SVW�u�}쥥��٥������M��{ �u쥥��_^� "0}�C�"0}��3�[�o
發生在舊projects(private repo)
Console顯示:
錯誤 1 Files 有無效的值 "U������R1}3ʼnE�SVW�u��}쥥��٥������M��{ �u쥥��_^�� "0}�C��"0}��3�[�o
沒有行數。。。
解法:
打開 YOUR_PROJECT.exe.manifest YOUR_PROJECT.exe.config 到 Notepad++ ,並convert to UTF-8 without BOM
↓
saving files
↓
重編成功!
[SOLVED] ./crontab_start_diff.sh: 1: ./crontab_start_diff.sh: /usr/lib/python2.7: Permission denied
change to /usr/bin/python
https://medium.com/@Rich_Harris/small-modules-it-s-not-quite-that-simple-3ca532d65de4#.cpfhb987q
[WorkAround] go to the topest(oldest) message at one of slack channel
var t = setInterval(function(){
try{document.querySelectorAll('.ts_icon_chevron_circle_right')[0].click();}
catch(e){clearInterval(t);}
}, 800);
[SOLVED] npm install tarball.destroy is not a function
If your Temp folder on window is full,
please remove some files for more space so that you can npm install -g XXXXX
RethinkDB command
rethinkdb command
r.db('mydb').tableList()
r.db('mydb').tableCreate('mytbl')
r.db('mydb').table('mytbl')
r.db('mydb').table('mytbl').delete()
r.db('mydb').table('mytbl').get(1).delete()
will raise an error
r.db('mydb').table('mytbl').insert() // empty insert
r.db('mydb').table('not_existed_tbl') // wrong table name
rethinkDB 取 createdAt!=1466053870000
r.db('work_genius').table('tbl').filter(r.row('createdAt').eq(1466053870000).not())
rethinkDB hasFields
r.db('DB').table('TABLE').filter(function (doc) {
return doc.hasFields('FIELD');
})
rethinkdb snippet 0622
r.db('work_genius').table('REPORTS_TBL_NAME')
//.filter({isSuccess:false})
.filter({'createdAt':1466585510000}).delete()
//.filter({'createdAt':1466053870000})
//.filter(r.row('createdAt').eq(1466053870000).not()).filter(r.row('errorMessage').eq('').not())
execSync
var execSync = require('child_process').execSync
console.log(execSync('cat execSync.js', {encoding:'utf8'}));
console.log(__dirname);
saga guessing
function* fetchProducts(dispatch)
const products = yield call(Api.fetch, '/products')
dispatch({ type: 'PRODUCTS_RECEIVED', products })
}
↓
a = fetchProducts(dispatch)
b = a.next() // Promise
b.then && b.then(products => {
a.next(products)
})
//dispatch({type:'PRODUCTS_RECEIVED', products})
sudo chown -R "${USER:-$(id -un)}" .
RethinkDB 跟 MySQL REPLACE 類似 的 執行語法
栗子如下
r.db('mydb').table('mytable').insert({"id":123456});
r.db('mydb').table('mytable').get(123456).update({"syncfield1":"value1", "syncfield2":"value2"});
存在則 update;不存在則 insert。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.