mysql和mongoDB

https://github.com/astaxie/build-web-application-with-golang/blob/master/zh/05.6.md

2017-06-14 · 1 min · word · Me

couchbaselabs mini-hacks

https://github.com/couchbaselabs/mini-hacks Important !! channels-users-roles https://github.com/couchbaselabs/mini-hacks/tree/master/channels-users-roles ===== level-1:未註冊使用者(發文要核準) level-2:註冊使用者(發文不用核準) level-3:版主(可核準或取消) 程式動態新增role 藍線:建立role 綠線:回覆結果 .角色(Roles)和使用者(users) 是可以被授權 而訪問 Channels. 使用者(users) 被附予角色(Roles),則可以 用角色的授權 進而訪問 Channels .channel(channelname) 有讀取權限 access(doc.owner, channelname); 給 寫入權限 requireUser(doc.owner) requireRole(doc.role) 也可以給 寫入權限 document content (using throw) ??? 讀和寫權限是分開的。 寫的權限完全是用sync function控制:除非sync function拒絕……… Write requireUser(username) 是否是該使用者(User) requireRole(rolename) 是否有該角色(Role) requireAccess(channels) 是否有該Channel curl -vX POST -H ‘Content-Type: application/json’ \ –cookie ‘SyncGatewaySession=d007ceb561f0111512c128040c32c02ea9d90234’ \ :4984/db/ \ -d ‘{“type”: “review”, “role”: “level-1”, “owner”: “jens”}’ {“type”: “review”, “role”: “level-1”, “owner”: “jens”} => ...

2016-04-20 · 1 min · 147 words · Me

Can not understand couchbase todolite demo Q1: doucment id p:xxoooxx Q2:facebook login auto add user

http://stackoverflow.com/questions/30905279/can-not-understand-couchbase-todolite-demo/30931841#30931841

2015-06-19 · 1 min · word · Me

[轉]Couchbase Lite stops syncing when an app resumes from background

http://stackoverflow.com/questions/20822285/couchbase-lite-stops-syncing-when-an-app-resumes-from-background answered Dec 30 ‘13 at 12:55 MonkeyBonkey Looks like if I set the replication to “persistent” it resumes on app backgrounding e.g._pull.persistent = YES;

2015-06-18 · 1 min · 25 words · Me

couchbase todolist get database sync part

https://github.com/couchbaselabs/ToDoLite-Android Write ToDoLite database sync guy is very good. OK, take out. android studio:new project then Copy todolist four java : Application.java、BaseActivity.java、Preferences.java、Synchronize.java Edit java : MainActivityjava、AndroidManifes.xml 1、app/src/main/AndroidManifest.xml <application add android:name=“com.sandk.groupaccountbook.Application” 2、app/src/main/java/com/sandk/groupaccountbook/MainActivity.java change public class MainActivity extends ActionBarActivity => public class MainActivity extends BaseActivity { If have new activity, just change extends to BaseActivity, then can use application.getDatabase(). four java : any use facebook just // or delete now database = application.getDatabase() is ok~~ ...

2015-06-16 · 1 min · 116 words · Me

android & couchbase app -- ok, now can share little

1. activity_main.xml => tools:context=".MainActivity" => MainActivity.java …….I try first… is more better then post. ========= ========= ===== suggestion newbie ===== https://github.com/couchbaselabs/CouchbaseLite-DevDay-StarterKit https://github.com/couchbaselabs/GrocerySync-Android https://github.com/couchbaselabs/ToDoLite-Android (Hard Understand) SO see this first: http://sueboy.blogspot.com/2015/06/couchbase-todolist-get-database-sync.html ========= MainActivity.java BuildConfig – 來自 build.gradle ( Module.app ) 目錄app – build.gradle extends ActionBarActivity – http://blog.tonycube.com/2014/02/android-actionbarcompat-1.html Intent – http://www.imyukin.com/?p=183 – http://kezeodsnx.pixnet.net/blog/post/27072894-android-----%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F%E8%87%AA%E6%88%91%E4%BB%8B%E7%B4%B9%E4%B9%8Bintent-resolution startService – http://blog.maxkit.com.tw/2014/01/android-serviceintentservice.html – http://blog.kenyang.net/2012/11/android-startservice-vs-bindservice.html – http://blog.csdn.net/biezhihua/article/details/44439897 context.bindService() <==> context.startService() context.startService() ==> Service <==> IntentService AsyncTask – http://a-can.logdown.com/blog/201623/android-asynctask-asynchronous-functions-are-carefully Observer – http://www.apkbus.com/android-112815-1-1.html runOnUiThread – http://lak4cyut.blogspot.com/2011/03/android-tip-activityrunonuithread.html – http://blog.csdn.net/zhang_yanye/article/details/40794629 getApplication Application.java – http://www.cnblogs.com/duanxz/p/4379800.html Replication 同步local到remote – http://developer.couchbase.com/mobile/develop/references/couchbase-lite/couchbase-lite/replication/index.html ...

2015-06-16 · 2 min · 292 words · Me

couchbase basic auth basicAuth startReplicationSyncWithBasicAuth --- How To Do

突然想到,他的basic auth,其實不是用來給系統用的,是給app用的 也就是app每一支都是用同樣的basicAuth id/pwd登入,區分 管理者和一般使用者 而一般使用者註冊後,帳密是另外開一個doucment,之後所有的文件管理是自己要控制的 跟mysql的一樣,不會給每個人有basic auth,權限管理,也是在sql下的時候,抓出資料做判斷 所以才會在 add user時,用restful curd,使用者代表不同的專案 ========== This is my think: couchbase basic auth is not for every body login. It is app connect to sync_gateway for auth. Example is have normal user and Admin user. Maybe login sync_gateway, that get different document、channel、sync. Normal user registered. The register data put in document, Maybe document name is “members” then system programmer need to control document show or not by permit. Like sql not everybody register, then get login mysql account. Only one account connect. After login, everythings is by program control. ...

2015-06-16 · 2 min · 331 words · Me

graphical http client restful

https://code.google.com/p/im-only-resting/ http://www.swensensoftware.com/im-only-resting https://github.com/wiztools/rest-client

2015-06-15 · 1 min · 3 words · Me

RecyclerView onclick

RecyclerView step 3 step1 public class xxxxxxxx extends RecyclerView.Adapter<MyAdapter.ViewHolder> implements View.OnClickListener { step2 public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position viewHolder.textView.setOnClickListener(this); textView is findViewById(R.id.xxxxxxxxx) step3 @Override public void onClick(View view) { int viewId = view.getId(); if (viewId == R.id.xxxxxxxxx) { //which item click if (onItemClickListener != null) { onItemClickListener.onItemClick(view, (Integer) view.getTag()); } } } view.getTag() maybe null

2015-06-14 · 1 min · 56 words · Me

about RecyclerView error: android.widget.LinearLayout cannot be cast to android.widget.TextView

https://developer.android.com/training/material/lists-cards.html I think many people, try to do this demo. But this demo is not good, because some things no show. like: RecyclerView .xml to a layout:…….only little, but ok, this not import. MyAdapter .xml no layout: this is bad. Get error in here. so, follow this do is better http://stackoverflow.com/questions/28407768/android-widget-linearlayout-cannot-be-cast-to-android-widget-textview-in-recycle Gorcyn is good guy~~ ^ ^ But what different with android demo (fxxxxxxxxxxxxxx) android: public ViewHolder(TextView v) { mTextView = v; good guy: ...

2015-06-14 · 1 min · 148 words · Me

sometime have couchbase.lite error, how to do

change build.gradle use old couchbase.lite then ok compile ‘com.couchbase.lite:couchbase-lite-android:1.1.0-516’ use 1.3.0 1.4.0 but get error, some method go away~

2015-06-08 · 1 min · 19 words · Me

couchbase sync gateway Edit data save

http://xxx.xxx.xxx.xx:4985/admin/ click Documents click left documents, then show data on top. then can see two button “Save Doc” “Revert DOC” Now you can change data in { …………….. } Changed finish, click “Save Doc”, now document be change. I think sync to app right now.

2015-06-05 · 1 min · 45 words · Me

[轉]Svetlin Stanchev: Couchbase Lite, Sync Gateway and Server 1-2

https://www.youtube.com/watch?v=hzeeENTRjlc https://www.youtube.com/watch?v=3Zl7bJXqYJU 6:10 start demo ====== ……….don’t show import.

2015-06-05 · 1 min · 9 words · Me

錯誤 TDCollateJSON Can't find SQLiteConnection.mConnectionPtr

這問題是因為模擬器版本的問題,改build.gradle dependencies { compile ‘com.couchbase.lite:couchbase-lite-android:x.x.x’ } 要變更版本x.x.x.x部份,找版本 http://files.couchbase.com/maven2/com/couchbase/lite/couchbase-lite-android/

2015-05-09 · 1 min · 8 words · Me

couchbase youtube demo

http://www.couchbase.com/connect/ http://www.couchbase.com/connect/agenda/keynote-demo-couchbase-server-3-0/ http://www.couchbase.com/connect/agenda/building-always-available-mobile-applications/ http://www.couchbase.com/connect/agenda/general-session-welcome-keynote/ http://www.couchbase.com/connect/agenda/integrating-with-hadoop/

2014-11-03 · 1 min · 5 words · Me

couchbase change domain

http://docs.couchbase.com/couchbase-manual-2.5/cb-install/#couchbase-getting-started-hostnames 1、sudo /etc/init.d/couchbase-server stop or Linux 2.0 this is /opt/couchbase/var/lib/couchbase/ip. This file contains the identified IP address of the node once it is part of a cluster. Open the file, and add a single line containing the hostname, as configured in the previous step. For Linux 2.0.1. You update the ip_start file with the hostname. The file is at this location: /opt/couchbase/var/lib/couchbase/ip_start. Delete the files under: /opt/couchbase/var/lib/couchbase/data/* /opt/couchbase/var/lib/couchbase/mnesia/* /opt/couchbase/var/lib/couchbase/config/config.dat Execute: ...

2014-10-28 · 1 min · 89 words · Me

3 4 way couchbase couchbase lite sync_gateway :: online - offline - sync

This is OK! Sure! 1、use aws install ubuntu 14 (8GB),install http://www.couchbase.com/download **Couchbase Server “3.0 b2” **Sync Gateway lates.. sudo dpkg -i install finish! 2、Setup Couchbase Server http://127.0.0.1:8091 (http://xxx.xxx.compute.amazonaws.com:8091) ** default bucket, ram set 100MB (now just for test), why, because aws ram less. ** create bucket : todos (for mobile app use) 3、Set Sync Gateway ** edit .bashrc, add => export PATH="$PATH:/opt/couchbase-sync-gateway/bin/" ** create config file, name: xxxxx xxxx :https://github.com/couchbaselabs/ToDoLite-Android/ use this sync-gateway-config.json ...

2014-09-11 · 1 min · 184 words · Me

4 way, 3 way data binding offline data synchronization in angularjs

http://fitc.ca/presentation/4-way-data-binding-offline-data-synchronization-in-angularjs/ http://fitc.ca/presentation/mobile-offline-data-synchronization-in-angularjs/ watch ppt firest, http://www.youtube.com/watch?v=6ecuA-pOev0&feature=youtu.be&t=14m9s then see this youtube, begin time:14:45 start demo v6 time:29:17 CouchDB online synchronization to CouchDB time: 31:26 have ios emu Sync multiple AngularJS apps without server via PouchDB http://www.mircozeiss.com/sync-multiple-angularjs-apps-without-server-via-pouchdb/ http://www.youtube.com/watch?v=QSC1fnfUlU0 this easy simple to try sync Building offline applications with AngularJS and PouchDB 13 Jun 2013 http://www.mircozeiss.com/building-offline-applications-with-angularjs-and-pouchdb/ A standalone REST interface server for PouchDB. https://github.com/pouchdb/pouchdb-server —–Couchbase Lite Couchbase Sync Gateway http://www.couchbase.com/mobile#sync-gateway Install on premise http://www.couchbase.com/download#cb-mobile Install on Amazon Web Services https://aws.amazon.com/marketplace/seller-profile/ref=dtl_pcp_sold_by?ie=UTF8&id=1a064a14-5ac2-4980-9167-15746aabde72 ...

2014-09-08 · 2 min · 306 words · Me