Giter Club home page Giter Club logo

aqutw.github.io's People

Contributors

aqutw avatar

Watchers

 avatar  avatar

aqutw.github.io's Issues

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

重編成功!

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 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})

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.