EExcel 丞燕快速查詢2

EExcel 丞燕快速查詢2
EExcel 丞燕快速查詢2 https://sandk.ffbizs.com/

vps

http://zhaofuli.org/10675.html

http://amh.sh/


Hostsailor 再加上折扣碼,一年才$22.87 USD........真是

OpenVZ
512 MB RAM
512 MB VSwap
50 GB HDD
1 Core
1 Gbit Port
512 GB Bandwidth
1 IPV4 address
Unlimited IPV6
Hosted in Netherlands


--------------------
AlphaRacks,13年开办的一家国外VPS主机商,母机应该是洛杉矶PR机房的。现在有一款套餐年付价格10美元,




CPU:2 cores

内存:256MB

vSWAP:512MB

硬盘:25G/RAID10

月流量:500GB/1000Mbps

虚拟架构:OPENVZ

IP/面板:1个/SolusVM



--------------------

HostUS 年付10美元
https://my.hostus.us/cart.php?a=add&pid=103
1 CPU Core
768MB RAM
Swap 768MB
20GB HDD
2048 GB

drupal bootstrap i ckeditor removing

use this
<i class="icon glyphicon glyphicon-search" aria-hidden="true"></i>

in drupal bootstrap theme ckeditor 4, usually remove
check follow
https://www.drupal.org/node/2369415
https://www.drupal.org/node/1908696

this way is ok, on
site/all/modules/ckeditor/ckeditor.config.js

put


config.protectedSource.push( /<i[^>]*><\/i>/g );

in CKEDITOR.editorConfig = function(config) { OOXXOO }


then ckeditor can put <i> on source mode, but can not show on edit, change source again, code not remove.


so save, then show on page...... I think it ...ok


just try

LANMP 指的是 Linux + Apache + Nginx + MySQL + PHP

https://github.com/wangyan/lanmp

druapl 有興趣的model


http://www.drupalla.com/project/


http://www.drupalla.com/project/transliteration
上傳時的檔名非英數問題

http://www.drupalla.com/project/menu_block它可以很轻松的实现菜单分离,通过配置,就完全可以实现学员把Drupal主菜单的子菜单项下面的菜单项,显示到左边栏

http://www.drupalla.com/project/l10n_update这个模块可以自动下载并更新你安装的模块的翻译文件,省的你一个一个去下载导入了

http://www.drupalla.com/project/lightbox2
图片或相片时会跳出一个对话框

http://www.drupalla.com/project/webform
除了会寄送一封Email到指定信箱外

========
https://www.drupal.org/project/ajaxblocks
可以用ajax 載入 block

[轉][Javascript] 自定義Google地圖標誌及參數

http://hsw00.com/x2/forum.php?mod=viewthread&tid=5478


<div id="vat_canvas" style="width:100%;height:100%;"></div>
<script type="text/javascript">
<!--//
 var script = document.createElement('script') ;
 script.type = 'text/javascript' ;
 script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&'
  + 'callback=initialize&'
  + 'language=zh-TW' ;
 document.body.appendChild(script) ;
 var map = null ;
 var geoCoder = null ;
 var hide_address = '0' ;
 function initialize() {
  var latlng = new google.maps.LatLng(25.033663, 121.564644) ;
  var mapOptions = {
   zoom : 16 ,
   panControl : false ,
   zoomControl : true ,
   mapTypeControl : true ,
   scaleControl : true ,
   streetViewControl : true ,
   overviewMapControl : true ,
   rotateControl : true ,
   center : latlng
  };
  map = new google.maps.Map(document.getElementById('vat_canvas'), mapOptions) ;
  var html = '<div style="width:212px;height:55px;">'
   + '<font color="red">性感小野貓股份有限公司</font><BR>'
   + '<font color="green">統編:12345678</font><BR>'
   + '<font color="blue">地址:台北101性感路野貓巷520號</font></div>' ;
  var infowindow = new google.maps.InfoWindow({
   content : html
  });
  var marker = new google.maps.Marker({
   map : map ,
   position : latlng ,
   title : '性感小野貓股份有限公司'
  });
  infowindow.open(map,marker) ;
 }
//-->
</script>

1. var latlng = new google.maps.LatLng(25.033663, 121.564644) ;
須調整裡面的經緯度,可利用Google地圖直接查你要標誌位置的經緯度然後填入.
2. zoom : 16 ,
這數值為地圖的縮放程度,依照需求自己做調整吧.
3. var html = '<div style="width:212px;height:55px;">'
   + '<font color="red">性感小野貓股份有限公司</font><BR>'
   + '<font color="green">統編:12345678</font><BR>'
   + '<font color="blue">地址:台北101性感路野貓巷520號</font></div>' ;
調整自定義標誌的框架寬及高,內容文字跟文字顏色等,視需求自行調整.
4. title : '性感小野貓股份有限公司'
這是滑鼠移到標誌時會顯示的名稱,視需求自行調整吧.

難得不錯的火鍋文 [轉]毒物吃到飽?無毒專家教你6原則健康吃鍋





毒物吃到飽?無毒專家教你6原則健康吃鍋

https://tw.news.yahoo.com/%E6%AF%92%E7%89%A9%E5%90%83%E5%88%B0%E9%A3%BD-%E7%84%A1%E6%AF%92%E5%B0%88%E5%AE%B6%E6%95%99%E4%BD%A06%E5%8E%9F%E5%89%87%E5%81%A5%E5%BA%B7%E5%90%83%E9%8D%8B-050000596.html





吃到飽 從不是我的選擇


天氣冷的時候,孩子有時會想吃火鍋,我們偶爾也會去解解饞,但從不光顧吃到飽的火鍋店,因為這和我的飲食原則有許多地方相違背。火鍋店會附贈飲料、冰淇淋或甜點,這些東西我們幾乎不吃外面的。例如飲料,絕大多數是用果汁粉、紅茶粉泡的,至於冰淇淋有乳化劑、香料和色素,孩子也知道不該吃。


至於可無限取用的火鍋料,儘管冰櫃裡琳瑯滿目,我卻無從下手,找不出新鮮安心的食材,那些丸子、魚餃、熱狗,姑且不論原料的好壞,光是製作過程就摻入很多食品添加物。相比之下,我寧可帶孩子去單點的火鍋店,想吃什麼、想吃多少自己點。


湯底 我習慣這樣子點


火鍋店的花樣越來越多,尤其是涮涮鍋,番茄、香茅、咖哩、起士、甘蔗、昆布、麻辣……多不勝數,光看完就要不少時間。我尊重孩子的口味,但教他們如何吃得健康一點,所以我們會各自選擇喜歡的湯底,請服務人員上鍋時將湯底減半,另外給我們一壺白水,自己加水稀釋。


肉類 我會做這些觀察


因為我不吃餃類和丸子,吃火鍋時一定會吃肉片。服務人員上菜時,我會立刻檢查肉片是否冷凍著,如果已是半退冰狀態,我會要求更換。此外,肉的顏色太紅或太白,我就不吃了。我還會觀察肉的紋理走向,如果很奇怪,就會放一片進鍋子涮涮看,若一涮就分解,那就是組合肉。


這些東西 我絕對不吃


吃火鍋很容易吃入太多調味料,所以基本上我和家人都不沾沙茶醬,只沾少量的和風醬,吃得清爽些。考量到雞蛋的問題很多,我幾乎不在外頭吃,更遑論雞蛋很容易受沙門氏桿菌污染,絕不會拿生蛋黃沾肉吃。


煮鍋 我按照這個順序


就像在家烹調一樣,燙過蔬菜的水不宜拿來喝,而且我習慣先吃肉再吃菜,最後吃飯,在外吃火鍋時,同樣遵循這些原則,衍生出一套煮鍋的順序──先煮白色青菜→加入可久煮的玉米、番茄、豆腐→喝湯,撈出豆腐吃→涮肉吃,再吃鍋裡的青菜,並喝湯→煮綠色青菜吃,吃點白飯。在綠色青菜下鍋之後,我就絕不喝湯。


火鍋久煮 不營養也不科學


我知道很多朋友嫌煮鍋麻煩,就用大鍋煮的方式,一口氣把菜盤全倒入火鍋,把火開至最大,久煮、慢吃。我覺得這並不理想,所有的食物混在一起,很難吃出原味,而不斷煮沸也將營養素破壞;更何況像酸菜白肉鍋、泡菜鍋、海鮮鍋再久煮之後,亞硝酸鹽會大量增加,建議不要這麼做。


(本文摘自/真食物這樣選!這樣吃!/蘋果屋出版)

freenas CIFS IPv6關掉

http://www.mobile01.com/topicdetail.php?f=174&t=4178075

multiple language druapl site model 多語言

基本上使用下列的model就夠了,之後抓一個版型來用。

1、有個問題在版型上,有的版型會用自做的Main Menu,所以這點要注意,最好是版面有留Main Menu的區塊,這樣就可以放上superfish for Main Menu,但用這個又有一個問題,是css套上去的顏色不太合的情況,所以要先試這塊,先看合不合。

2、之後才進行多語言的測試,基本上,多語言切換完全沒有問題,有介面沒翻譯到的,也可以自行翻譯。

3、另外建議把 使用者登入區塊 關了,因為好看多了,那怎麼登入,直接在根路徑打/user就可以登入。

4、版型後面有版權宣告,記得去template.php改一下。

5、footer區塊,建議自己建一個新的區塊,連接到一個page,這樣就行放很多資訊,不要用原本的footer區塊。

=======設定==========
對應模組功能要打開,記得
架構-內容類型-裡面要多語的類型,在“發佈選項“,要選“已啟用翻譯功能“

架構-選單-編輯選單 要選 Translate and Localize. Menu items with language will allow translations. Menu items without language will be localized.


====備份/還原========  不要用那個什麼備份軟體....太浪費時間了!
備份:
1、請直接進phpmyadmin,選 資料庫->匯出->自訂->輸出zip,然後注意一下,blob要HEX輸出。
2、直接把整個drupal目錄copy下來。

還原:
1、先把整個drupal目錄還原到主機上;最後是zip上去,server上解壓最快。
2、直接進 資料庫,用phpmyadmin還 (!!sql檔太大)。

所以請記得,任何安裝後的model,不要用,請砍了,libary也是。別留一堆垃圾,另外將來後續備份,如果只變更site目錄下的檔案,就只備份site目錄。

如果有更新drupal版本,或任何版本,請直接再備份整個drupal目錄。

相信這是最完整的方式.....
============
https://www.drupal.org/project/module_filter

** language tw **
https://localize.drupal.org/translate/languages/zh-hant
drupal-7.33.zh-hant.po

** language **
https://www.drupal.org/project/i18n
i18n-7.x-1.11.zip

https://www.drupal.org/project/variable
variable-7.x-2.5.zip
languageicons-7.x-1.1.zip

** imce & upload & multiple insert **
imce-7.x-1.9.zip
imce_filefield-7.x-1.0.zip
imce_uploader-7.x-1.3.zip
plupload-1.5.8.zip          
plupload-7.x-1.7.zip
insert-7.x-1.3.zip

** Menu **
superfish-7.x-1.9.zip
Superfish-for-Drupal-master.zip
gdsmith-jquery.easing-1.3.1-0-g82496a9.zip

** other **
ckeditor-7.x-1.16.zip
filefield_sources-7.x-1.9.zip
jquery_update-7.x-2.4.zip
libraries-7.x-2.2.zip
Flex Slider
FlexSlider Views Slideshow




http://www.devsaran.com/drupal-module


durpal menu 多語言

http://blog.csdn.net/ejc2001/article/details/26246723

Structure -> Menu s -> Main menu :

1. click edit menu  2. MULTILINGUAL OPTIONS: Translate and Localize. Menu
items with language will allow translations. Menu items without language will be localized.

Structure -> Menu s -> Main menu :
1. click list links  2. add link or edit menu

***** "path"  set <front> or node   is different.

<front>:every page show menu
node: only language show language menu

joomla T3 framework multiple language

http://www.t3-framework.org/documentation/bs3-customization#multiple-language

but new t3,  have some step have different




Step 4: Assign menu for Megamenu

--> just change MENU , change to your wnat language, then can use.

[轉]網站設計師必須知道的15個工具網站

http://des13.pixnet.net/blog/post/57498609






ColorCombos

配色是Web 設計的首要大事,Color Combos 幫你預備了數千種配色方案,可以根據色調瀏覽選取。

LIpsum

Lipsum.com是 Lorem Ipsum Text 縮寫的自創詞,字典中不存在的單詞,是在演示頁面結構的時候,需要加文字的地方使用Lorem Ipsum Text 填充可以避免用戶因關注文字的意思而分神。Lipsum.com 可以幫你生成製定數目的Lorem Ipsum 單詞。

What the font?

有時候你對某個Logo 感興趣,想知道是圖片的LOGO是什麼字體做的,可以將Logo 圖片上傳到這個網站,結果之準確會讓你難以置信。

ConvertIcon

Favicon 越來越受歡迎,尤其隨著Firefox 的流行,Firefox 會將你站點的Favicon 標誌顯示在標籤上,也會顯示於書籤,Favicon 支持多種圖形格式,比如png,但IE 並不支持png,該站點可以幫助你將png 等圖片格式的Favicon 轉換成IE 支持的ico 格式。

BgPatterns

背景線上產生器。現代Web設計的趨勢之一包括使用背景圖案,BgPatterns.com可以幫你設計背景圖案,他們有大量可選的圖案,可以按不同方式接合,還可以設置透明度。

HTML Encoder

如果你要在網站中顯示Web代碼,那將是非常煩人的事,你必須將諸如<一類的符號用編碼表示,這個網站可以幫你做這些事情,只需將你的代碼複製進去,他們會幫你生成可以直接使用的代碼。還有HTML Decoder 幫你做相反的事。

Xenocode Browsers

該網站非常有用,可以直接模擬預覽你的網站在IE6, IE7, IE8,Firefox 2, Firefox 3, Google Chrome 以及Opera 中的樣子。唯一的不足是,不支持Mac 和Linux 環境下的瀏覽器。

Test Everything

測試任何你想得到的東西。

這個網站包含了超過100 中工具幫你測試幾乎所有東西,如跨瀏覽器兼容,查PR 值,甚至幫你驗證代碼。

Sprite Generator

CSS Sprites在顯著降低HTTP請求方面功不可沒,但CSS sprite可不是個簡單的技術,Sprite generator 可以幫你做這些繁複的工作,將你的圖片打包成zip上傳上去,他們會把你的圖片組合成sprite,還幫你生成CSS代碼。

Buttonator

線上按鈕產生站,這個網站可以幫你設計漂亮的按鈕。

Load Impact

網站壓力測試站,讓你測試同時上線人數流量等等。

這個壓力測試站點可以幫你測試你的站點的抗壓能力,如果你的某篇文章曾經上過Digg 或StumbleUpon 等網站的首頁,你就會知道抗壓測試多麼重要。

IconFinder

這個網站收藏了大量來自網絡的免費圖標。

TypeTester

可以幫你測試不同字體的顯示效果。

CSS Tidy

這個站點可以幫你檢查CSS 代碼,並修正其中的錯誤,比如,它可以發現你的CSS 代碼中最常見到重複設置問題。

Contact Forms Generators

表單產生站,可以幫助你實現和瀏覽者的互動,無需編程,就能快速生成訪客反饋表單,甚至幫你生成郵件發送PHP, ASP, Perl代碼。

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/

[轉]ubuntu gimp save to web

http://tutorialforlinux.com/2014/06/26/how-to-save-images-for-the-web-on-ubuntu-linux-by-the-gimp-easy-visual-guide/




sudo su -c "apt-get install gimp-plugin-registry"

[轉]Finding Great Images for your Website -- free pictures

https://computing.artsci.wustl.edu/finding-great-images-your-website


Unsplash truly beautiful photos that are completely free to do anything you want with. 10 new photos every 10 days.

LittleVisuals is similar to Unsplash, but they aim to publish new photos every 7 days. These guys also allow you to download their photos in handy .zip packs!

Function. 100% free to do whatever you want with.

GratisPhotography is a project run by Ryan McGuire, which features new photos added each week. All pictures are completely free of any copyright!

PicJumo recently launched and provides one quality free photo every day! Totally free photos for your commercial & personal work. Make sure you subscribe to get the new ones sent to you daily!

firebase offline-online somethings

Now try to use firebase for design app. But get somethings about :

1. At offline, you can read, but add, delete, edit can not, this "can not" is snapshot that need to online sync, then get data.

2. So firebase example is use models or objects to keep data, but you change activeity or clearn app, then objects data loss. maybe can use Serialization, but not good idea.

3. Can't control local database. This is fun, maybe firebase no local database or other methods for offline. Some app need offline, for  counting data, CURD data, keep then sync, counting age.

mm, I think my java, android app and firebase knowledge, I don't real understand or think error. So just writer this message for keep.

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:

sudo /etc/init.d/couchbase-server start

=======================
If can't not, maybe reinstall. just delete 
/opt/couchbase/var/lib/couchbase/config/config.dat

then server stop, restart. then can resetup.

[轉]本月精選:怎樣成為一個見錢眼開的真正有錢

http://gn00116743.pixnet.net/blog/post/59054284-%E6%9C%AC%E6%9C%88%E7%B2%BE%E9%81%B8%EF%BC%9A%E6%80%8E%E6%A8%A3%E6%88%90%E7%82%BA%E4%B8%80%E5%80%8B%E8%A6%8B%E9%8C%A2%E7%9C%BC%E9%96%8B%E7%9A%84%E7%9C%9F%E6%AD%A3%E6%9C%89%E9%8C%A2

open source erp


http://bbs.erp100.com/thread-266848-1-1.html

http://www.douban.com/review/5816038/
上述开源ERP软件,曾经势头最劲的是Compiere,两年前是OpenBravo,从今年的InforWorld最佳开源ERP评奖来看,OpenERP似乎开始引领风骚了。从中文化及中文资料翻译的程度来说,Compiere最为完全,其次是OpenERP。但Compiere已经基本淡出了开源ERP的世界。从Google趋势看,2010年前后,OpenBravo排名第一。不过,最近两年,OpenERP的关注度上升很快,已经超过了OpenBravo,排名第一。

pc control android

webkey
http://webkey.cc/



How to Control an Android Device From Your PC
http://blog.laptopmag.com/control-android-from-pc





How to control your Android via PC
http://www.cnet.com/how-to/how-to-control-your-android-via-pc/


aten tap CS533http://www.aten.com/Mobility-&-USB/Tap--USB-to-Bluetooth-KM-Switch/Tap-(USB-to-Bluetooth-KM-Switch)-Tap-your-desktop-keyboard-into-an-iPhone%C2%AE-or-iPad%C2%AE!~CS533.html

安裝應用程式的過程中產生不明的錯誤代碼: "-24"

整個無言...google play store 問題...

網路上最多的是root,砍 對應錯誤程式的資料夾....手機現在不見得會root了



所以建議,把android的同步開到最大,先同步備份一次,然後把手機還原吧!


記得一個小問題,本人碰到的,因為一開始有插sd卡,結果還原時,android把程式還原到sd卡上,所以先把sd拔了,還原完,再插sd卡.............我覺得可能是我搞錯,.....但懶得查了...反正就這樣做

voip

VykeZone 打台灣市話,一小時只有us 15C....



rebtel
twlilo
airtime
line2
bababoo
plogur

http://buzzorange.com/techorange/wp-content/uploads/2014/09/Mobile-lumascape.jpg

firebase auth SimpleLogin when offline auth check

>>  firebase response
Great question. We are actually putting the finishing touches on login v2 and I think you will be happy with the offline improvements it brings. Ultimately, you are running into issues with what you are trying to do because it cannot be done with the current API. However, with our upcoming login refresh, we will persist session tokens on the client, allowing you to authenticate via custom or simple login without any internet connection. We are still a couple weeks out from finishing this project and making it production-ready, but keep an eye out on this group for announcements.

=================
https://www.firebase.com/docs/web/guide/user-auth.html

Storing User Data

Internally, Simple Login generates JWT auth tokens after authenticating against the appropriate provider. It then calls Firebase.auth() with those tokens. It does not store profile or state information in Firebase. In order to persist user data we'll have to save it to our Firebase.

=================
 Firebase.auth() in firebase-client-jvm-1.0.18.jar/com/firebase/client/Firebase.class

can not decomplier, for understand how to save data. ....

mikrotik qos connection timeout (Established)and limit connection

Now P2P is too good, so use QOS can't stop. So

1、 setup  limit connection:in Firewall, Filter Rule add

Action: drop  Protocol: TCP UDP  Extra-Connection Limit: xx


2、set connection timeout: in Firewall, Connections, Tracking-TCP Established Timeout: 00:05:00  (5mins by your want)

then......p2p......can use, but.....you know

github 刪除

http://www.douban.com/group/topic/32935166/

>>芽衣

git rm --cached filename
git commit -m "hehe"
git push origin branch


>>cloudaice


上面的一些解法只是保持以后不会跟踪了,要想彻底删除的方法如下:

git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch path/to/your/file' HEAD

git push origin master --force

rm -rf .git/refs/original/

git reflog expire --expire=now --all

git gc --prune=now

git gc --aggressive --prune=now

android crosswalk intel XDK codova

剛用intel XDK 做crosswalk,用codova,做純網頁 app,非常慢.....慢到極點了


crosswalk是把最新的chorme的核心,包在apk中,只有4.4才是內建chorme新的核心,所以crosswalk就是把apk包了chorme,讓apk走html5架構暴快

如果單純crosswalk比cocoonjs還快,目前看有人測試,所以是慢在codova.....

codova太慢了,如果用android studio 做原生的webview,連網頁超快,但我現在手機,雖然是4.2,但底層已換chorme,所以我測很快,所以現在兩種情況:

一、以後走4.4後,chorme為底層broswer時,html5暴快,

二、等android studio可以包crosswalk時,就算4.x的都暴快,4.0以下不能用crosswalk,但包了crosswalk會胖20 MB


但,很妙的是,如果走codova crosswalk XDK,放到手機中,吃的記憶體不多,5x~8x MB,但會自動掛掉 .......

android webview performance crosswalk

Now HAHA!!

https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/
https://crosswalk-project.org/documentation/embedding_crosswalk/crosswalk_aar.html
=====================================

https://www.timroes.de/2013/11/23/old-webview-vs-chromium-webview/


Have you looked at crosswalk? https://crosswalk-project.org/ It’s a chromium web runtime that can be packaged with the app, so you get a benefit on 4.x devices, not just kitkat. It has more features (like webrtc) and sometimes outperforms chromium webview.

https://crosswalk-project.org/

==============
https://gist.github.com/butelo/9365587

1:R.layout.activity_xwalk_embed_lib -> R.layout.xxxxx
2: R.menu.xwalk_embed_lib -> R.menu.xxxx
3: AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE">

==============
use this
https://groups.google.com/forum/#!msg/adt-dev/nQobKd2Gl_8/Z5yWAvCh4h4J

problem:libxwalkcore.so can be soft.

just do armeabi-v7a.jar is have lib/armeabi-v7a/libxwalkcore.so and jar put in libs
==============
test for this, use android studio, have big problem:libxwalkcore.so

can't load libxwalkcore.so

http://comments.gmane.org/gmane.comp.web.crosswalk.help/250

find this and follow, then can understand....: There are different between android studio and ADT in so library. We must edit build.gradle file to copy libs into build/native-libs dir. for example,

use ver 7.xxxxx
libs already put xwalk_core_library_java.jar and armeabi-v7a/libxwalkcore.so

and

AndroidManifest.xml need to put

<uses-permission android:name="android.permission.INTERNET">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE">

this is for load libxwalkcore.so success, need to put

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE">


=====================================
Finialy, I can't use this.

If really want to use , please use verion for Cordova + Crosswalk backend. it's easy success.
or use Intel XDK



android 自動版本更新

http://blog.csdn.net/xjanker2/article/details/6303937

有非常重要的重點:

*****請先下載Config.java和NetworkTool.java兩個程式,放到對應的java目錄下。
https://code.google.com/p/androidex/source/browse/trunk/jtapp-12-updateapksamples/#jtapp-12-updateapksamples%2Fsrc%2Fjtapp%2Fupdateapksamples

*****UpdateActivity.java 是主程式,把對應的程式碼改到你的程式,其中要注意的是,程式碼中的UpdateActivity請記得要換成你自己的名稱....我也是被搞了一下~~哈

*****為什麼在模擬器中,更新會不能安裝,找到的文章解釋
http://stackoverflow.com/questions/19959890/android-app-not-install-an-existing-package-by-the-same-name-with-a-conflicting

the APK installed in the Emulator is signed with your debug-key(usually installed in ~/.android/debug.keystore)
因為key不同,但實際上,如果建置完畢的話,更新是不會有這問題。目前確實成功。
===========================
發生錯誤:
NetworkTool.java 中
HttpResponse response = client.execute(new HttpGet(url));
會發生
ERROR : android.os.NetworkOnMainThreadException

解決方式:
方法一:/*設定可以讓Thread運行在Android主要Thread*/
http://stackoverflow.com/questions/16439587/android-os-networkonmainthreadexception-with-android-4-2

在 HttpResponse response = client.execute(new HttpGet(url)); 之前放上
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}

import android.os.StrictMode;

方法二:
etwork problem的問題我試了,是HTTPClient的部份不能在UI Thread做,寫一個extend AsyncTask的class讓HTTPClient的部份在background做就可以了

http://givemepass.blogspot.com/2011/12/http-server.html

===========================




第二個問題:寫檔在sd上
1. 在AVD建的時候要加上SD卡的容量
2. 在 AndroidManifest.xml 補上

android studio

http://save-coco.blogspot.com/2014/07/maven-eclipseandroid-app.html


Maven 據說很難用...功能強大,很難用
http://blog.csdn.net/wangwei_cq/article/details/17070307


Gradle 現在用這個
http://www.codedata.com.tw/java/understanding-gradle-3-getting-started/
http://ithelp.ithome.com.tw/question/10129873

---------------
http://jdev.tw/blog/3513/learning-android-studio


=====================
setup 1: onclick
http://www.youtube.com/watch?v=RCyuqMVGl4g

TextView mytv = (TextView)findViewById(R.id.textView);
mytv.setText("change textView!");

=====================
setup 2: export apk
builder-> apk

ruby sinatra admin login rack--two way

1.

http://www.sinatrarb.com/faq.html

require 'sinatra'

helpers do
  def protected!
    return if authorized?
    headers['WWW-Authenticate'] = 'Basic realm="Restricted Area"'
    halt 401, "Not authorized\n"
  end

  def authorized?
    @auth ||=  Rack::Auth::Basic::Request.new(request.env)
    @auth.provided? and @auth.basic? and @auth.credentials and @auth.credentials == ['admin', 'admin']
  end
end

get '/' do
  "Everybody can see this page"
end

get '/protected' do
  protected!
  "Welcome, authenticated client"
end



2.
http://www.highdots.com/forums/ruby-rails-talk/logging-out-rake-auth-basic-284054.html


LOGIN FORM (GET LOGIN METHOD)

<form method="post" action="/login">
<p><label>Username</label><input name="post[username]" /></p>
<p><label>Password</label><input name="post[password]" 
type="password"/></p>
<p><button type="submit">Login</button></p>
</form>


POST LOGIN METHOD

post '/login' do

if authenticate(params["post"]["username"], Digest::MD5.hexdigest(params["post"]["password"]))
    session[:user] = params["post"]["username"]
    flash[:notice] = "Login succeeded!"
    redirect '/admin'
else
    flash[:error] = "Login failed!"
    redirect '/login'
end

end


HELPER METHODS

# Authentication is hard-coded as there will only 1-3 users
def authenticate(username, password)

    if username == 'admin' and password == '[admin_password_in_MD5]'
        return true
    else
        return false
    end

end

# Protect pages
def login_required
    if session[:user]
        return true
    else
        redirect '/login'
        return false
    end
end

# Get the username of the logged in user
def current_user
    if session[:user]
        session[:user]
    end
end

# Verify if a user is logged in
def logged_in?
    !!session[:user]
end



jQuery Mobile and AngularJS Working Together

1. http://simonguest.com/2013/04/08/jquery-mobile-and-angularjs-working-together/

2. http://0not.net/index.php/using-angularjs-and-jquery-mobile/

  • At the bottom of body, load AngularJS and then jQM
  • Use jQM for routing (which is the default, as long as you don’t include ngRoute)

StrongLoop begin

1. http://docs.strongloop.com/display/LB/LoopBack+2.0+release+notes

2. http://docs.strongloop.com/display/LB/Project+layout+reference

3. http://docs.strongloop.com/pages/viewpage.action?pageId=3836281

4. https://github.com/strongloop/loopback-example-app  this is new loopback example,  need to look at this example, can understand how to work loopback.

if see "slc lb", the mean is old loopback 1.0, so don't need to see.

5. https://github.com/strongloop/loopback-example-passport
 http://passportjs.org/guide/oauth/

I try many, so now I think loopback 2.0....is too new,   many docs is not correct. Maybe furture is good or ok, but now for develpoer is no good....

StrongLoop Access Control

http://docs.strongloop.com/display/LB/Controlling+data+access
x  can't use old...https://github.com/strongloop/loopback-example-access-contro

.................l

Ok  http://docs.strongloop.com/display/LB/Creating+and+authenticating+users

1. http://xxx-xxx.rhcloud.com/explorer/#!/Users

2. New User
2.1. Click   POST /Users
2.2. Click to set as parameter value
2.3. Change value:  username 'tt', email 'tt@tt.com' .   Add new "password": "xxx",
2.4. Try it out!      if Response Code = 200 then success.

3. Login User
3.1. before login, try to Click Get /Users/{id} ,  put id = 1, Try it out! get error msg: 401 Authorization Required..... now can sure, not login.
3.2. Click POST /Users/login
3.3.  credentials value input {"username":"tt", "password":"xxx"}
3.4.  if see id , ttl, created, userid then success. id = access token
3.5. copy id value, put access token on page top. click Set Access Token.
3.6. now go back 3.1, try again. now success. login user only can use by self fun.

StrongLoop OpenShift offine-sync TEST

1. https://developers.openshift.com/en/getting-started-client-tools.html#ubuntu

2. http://docs.strongloop.com/display/SL/OpenShift

3.http://xxxx-xxxxx.rhcloud.com/
  http://xxxx-xxxxx.rhcloud.com/explorer/

http://strongloop.com/strongblog/node-js-rest-api-openshift-redhat/?utm_source=tuicool

old : loopback :http://loopback.io/
new : http://strongloop.com/
===========
rhc create-app sl https://raw.github.com/strongloop/openshift-cartridge-strongloop/master/metadata/manifest.yml

rhc show-app xxxxx 查相關資訊
rhc show-app xxxxx --gears quota    查空間
===========
update to openshift, need to install local npm and strongloop
*ubuntu *
1. curl -sL https://deb.nodesource.com/setup | sudo bash -
2. sudo apt-get install nodejs  https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
3. npm install -g strongloop
===========
ALL in LOCAL:
slc loopback:datasource myMongoDB    this is local, not on openshift

if local no file, use rhc git-clone to get file in local. *ps.1

use mongodb : sudo npm install loopback-connector-mongodb --save

** mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/    ......this can't use, please login openshit, then command line:
>echo $OPENSHIFT_MONGODB_DB_HOST
>echo $OPENSHIFT_MONGODB_DB_PORT


  • git mothod  : in local app directory

>git init
>git add -A
>git commit -a -m "Initial Commit"

>git commit -a -m "msg about commit"
>git remote add openshift <remote_git_url>
>git push --force openshift master


ps:
1. if local file failed, use command: rhc git-clone xxx   :: xxx -> app name
2. http://www.codeproject.com/Articles/746155/Deploying-MongoDB-and-Node-js-application-on-OpenS
3. http://docs.mongodb.org/ecosystem/platforms/red-hat-openshift/
-------------
http://strongloop.com/node-js/studio-beta/

CouchDB 免費使用(有限制金額) iris

iris
http://www.iriscouch.com/service

但基本上,如果小型專案就夠用了。

ssh logini openshift

use puttygen to product .ppk , need product openssh key (menu conversions)

command line:ssh -i "openssh key" xxxxx@xx-xxxx.rhcloud.com

then can login, use linux ssh ~~~

推送 訊息

http://pusher.com/
Connections:20 MAX ,Channels:UNLIMITED , Messages / day:100,000

要REST ful 介面 後端連資料庫

dreamfactory  最好

http://www.28.io/  有免費方案,看起來還不錯

dreamfactory realtime

http://community.dreamfactory.com/t/realtime-integration-firebase-socket-io/178

http://blog.dreamfactory.com/blog/bid/300138/Mobile-App-Development-with-CORs-and-Pub-Sub3

*vm   https://bitnami.com/stack/dreamfactory/virtual-machine

http://faye.jcoglan.com/

[轉]程式開發者談Facebook上的授權以及帳號被盜的觀念

http://www.cool3c.com/article/65408

https://www.facebook.com/settings?tab=applications

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

but add line : "adminInterface":":4985", 
change line or add : "server": "http://127.0.0.1:8091/",

this json use databases: todos , so sync_gateway need setup this.

***ps:setup 2, if create bucket todos, use passwoard. need add in config file.
      "username": "todos",
      "password": "xxxxxxxxxx",

--------------
4、Then > sync_gateway xxxxx 

connect to   http://127.0.0.1:4985/_admin/ (http://xxx.xxx.compute.amazonaws.com:4985/_admin/) 

if see Welcome to Couchbase Sync Gateway. , success. and check it about have a link : todos,if have, all ok!

--------------

5、Try to download https://github.com/couchbaselabs/ToDoLite-Android

Cahngeapp/src/main/java/com/couchbase/todolite/Application.java
Application.java  SYNC_URL = "127.0.0.1:4984"
"xxx.xxx.compute.amazonaws.com:4984"

port: 4985 for admin, 4984 for user


***ps: 2014/10/28 SYNC_URL = "http://xxx.xxx.amazonaws.com:4984/todos/";

if use this way is ok, can use.

--------------
after all, follow step for 

https://github.com/couchbaselabs/ToDoLite-Android/
--------------
then play app with your server~~~~  

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

Couchbase vs. Apache CouchDB :: A comparison of two open source NoSQL database technologies
http://www.couchbase.com/couchbase-vs-couchdb


Couchbase Server for ubuntu   free download    V2.5.1 Released March 31, 2014
http://www.couchbase.com/couchbase-server/overview

如果是自建,還真的這個比較適當。
中文相關 http://hhtucode.blogspot.com/search/label/Couchbase

**********
Build always-available apps that work both online & offline.
http://developer.couchbase.com/mobile/

1. Couchbase Server:JSON database  放資料(db)server
2. Sync Gateway:synchronize on-device Couchbase Lite - Couchbase Sever,and Authentication, Access Control, Validation
3. Couchbase lite: on-device JSON database, full function (sync), all platom

Downloads for both community and enterprise editions are free. Support and updates are different between them, and not necessarily free.
所以是全部免費,除了支援...要付錢,那基本上採用這架構是沒問題的了!!
*********
-----
***couchbase-sync-gateway 深入簡報

http://www.slideshare.net/Couchbase/webinar-couchbase-mobile-sync-gateway-configuration-and-management-webinar-mobile-advanced-couchbase-sync-gateway1

記得裝完後,用config檔啟動,補上這個設定:
"adminInterface":":4985",

然後在 http://xxx.xxx.xx/_admin/  可以簡單的做db管理........官方沒這個,好佳在有人摸出來...
-----
Setting up couchbase-sync-gateway (1.0.2-9) ...

You have successfully installed Couchbase Sync Gateway.

You can start Couchbase Sync Gateway by using the following command:

/opt/couchbase-sync-gateway/bin/sync_gateway

That's it! This command starts Sync Gateway on port 4984, connects to a limited in-memory database
 that lives on Sync Gateway called "walrus", and starts the admin server on port 4985.

The command-line options are:

  -adminInterface=":4985": Address to bind admin interface to
  -bucket="sync_gateway": Name of bucket
  -dbname="": Name of CouchDB database (defaults to name of bucket)
  -interface=":4984": Address to bind to
  -log="": Log keywords, comma separated
  -personaOrigin="": Base URL that clients use to connect to the server
  -pool="default": Name of pool
  -pretty=false: Pretty-print JSON responses
  -url="walrus:": Address of Couchbase server
  -verbose=false: Log more info about requests


By using this software you agree to the End User License Agreement.
See /opt/couchbase-sync-gateway/LICENSE.txt.


delphi xe6 andorid ios

Android使用分享
http://delphi.ktop.com.tw/board.php?cid=30&fid=1501&tid=105719


delphi XE5/XE6 小型成品展示,小型的 CRM
http://delphi.ktop.com.tw/board.php?cid=31&fid=79&tid=106351

http://jamesjuantw.pixnet.net/blog/post/185758317

使用activerecord注意

** tableize
rails console下,執行"Post".tableize 得到posts,table名稱

----------------------
sinatra 在tux下執行


** singularize 複數變單數
執行上方式同上

** pluralize 單數變複數
執行上方式同上

http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html

T1

...
http://v.youku.com/v_show/id_XNzYyNzAwNjky.html

但現在 榮耀 6...好像比較便宜..哈

ruby on sinatra 正式開發上線 發現問題

基本上,很多人用 rank db:migrate, 看日本的範例是直接開mysql資料庫,那時候不懂,他的做法出乎意外,因為大部份的範例不是這樣,現在才知道為什麼。

rank db:create_migration NAME=xxx   建立後,再改xxx.rb檔,設完後,rank db:migrate就產生大問題了!

在開發環境,用sqlite3, 是的,可以用,但到正式mysql資料庫,能用,但編碼是litaxxxx ....不是UTF8;那在xxx.rb 文件內強制設定option

create_table :tops, options: 'DEFAULT CHARSET=utf8'

當然就不發生錯誤,但回到sqllite3就錯了!因為sqlite3沒支援這語法......那這樣怎麼處理?  寫程式,因為xxx.rb,是ruby語法。

但這樣有比較快嗎?

還是直接把 cretae table schema和insert sql直接另外做文件,進mysql和sqlite3執行sql比較快....

mysql 當然更快是直接把table名稱改掉,新增 新的table;
sqlite3 直接copy一個新的sqlite3,進去刪掉table更快...

也許是我不了解rank db,但目前的了解就是這樣子....

另外有試著把mysql的db,需設成utf8,但租的主機有時候是不能亂改的.....哈,無解



[轉]database.yml &, <<, *

http://stackoverflow.com/questions/6651275/what-do-the-mean-in-this-database-yml-file

The & marks an alias for the node (in your example &defaultaliases the development node as "default")

* references the aliased node with the name "default".

<<: inserts the content of that node.

test: &test <<: *default


default_env:
  <<: *production

sinatra mobile app cordova -- just for note

https://gauntface.com/blog/2014/02/05/cordova-web-best-practices-v2-0

http://spiritmachineblog.tumblr.com/post/41432461669/a-simple-openlayers-app-with-yeoman-sinatra-mongodb

HTML5 Boilerplate
Sass with Compass
Modernizr

http://thibaultdenizet.com/tutorial/cors-with-angular-js-and-sinatra/
=====

簡單說:發現現在要走moble app,要有yoeman的產生的網頁檔,或是 走Angular.js, jquerymobile, bootstrap三個來做。

新增、修改、刪除 走Restful,看上面範例。這樣產出來的網頁能適用 手機和平板。

但要把 程式轉成可以用cordova,要用Compass之類的,把所有的js, css, html5 三個檔。
http://vimeo.com/35998909

https://www.youtube.com/watch?v=e4yUTkva_FM

https://www.youtube.com/watch?v=wVntVkRLR3M

bit.ly/zen-ng-phonegap

Angular UI部份

這看起來有點像官方Angular原生
http://angular-ui.github.io/bootstrap/

這是另一個整合好Bootstrap and Angular JS
http://mobileangularui.com/

這是angular+ionic
http://ionicframework.com/
http://ionicframework.com/docs/overview/#download
http://ionicframework.com/docs/components/

==================
**SASS (Sass)

**require jquery.mobile  21:13

http://demos.jquerymobile.com/1.2.0/
http://demos.jquerymobile.com/1.2.0/docs/pages/page-anatomy.html

css style => data-role


%meta{name: 'viewport', content: 'width=device-width, initial-scal-1')

http://demos.jquerymobile.com/1.2.0/docs/lists/lists-collapsible.html

**haml
http://html2haml.heroku.com/

=====
phonegap 41:01
開一個android專案,但只是把網頁load進來.....真是簡單
www/index.html
1. script include: phonegap-1.3.0.js
2. onBodyLoad(){
  document.addEventListener("dviceready", onDeviceready, false);
  windows.location.href = 'http://localhost:3000'
}

http://mobileangularui.com/demo/#/
http://ionicframework.com/

============
https://www.youtube.com/watch?v=sCnGSOaaZFo

http://jaydata.org/blog/angularjs-with-jaydata%E2%80%93-the-todo-example-with-the-itemstore-api

http://jaydata.org/
=======
Three-way data-binding  sync  同步
AngularJS  model change and view change together
現在只有firebase,要看有沒有別的專案

簡單說,ng會定時去檢查,如果有任何動動作,就會主動去更新
model一改變,view就改變,所以model要綁定remote Restful
大概是這意思,綁定就行了
綁定後,如果model有改變,對應的view就會變

另外就正websocket, WebHooks, PubSubHubbub

http://www.troikatech.com/blog/2014/02/26/websocket-webmachine/
https://github.com/simulacre/sinatra-websocket

http://xh-css.cn/2013/11/watch-how-the-apply-runs-a-digest/

$evalAsync()
Wrap code that depends on ng-init in $scope.$evalAsync(), which forces it to run on the next $digest() phase:

--
http://fitc.ca/presentation/4-way-data-binding-offline-data-synchronization-in-angularjs/

http://fitc.ca/presentation/mobile-offline-data-synchronization-in-angularjs/
--
CouchDB comes with a suite of features, such as on-the-fly document transformation and real-time change notifications, that makes web app development a breeze. It even comes with an easy to use web administration console. You guessed it, served up directly out of CouchDB!
--
The Database that Syncs!

PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

===============
http://deployd.com/
http://remotestorage.io/   https://unhosted.org/
--https://togetherjs.com/
--http://socket.io/
--http://pusher.com/
--https://parse.com/plans    ,but free good

$$ https://backendless.com/
$$ http://www.kinvey.com/pricing


Examples of open source backend systems are usergrid_BaasBoxDreamFactorydeployd,Meteorsockethub, and Hoodie.

Examples which have not yet shut down are KinveyApigee,BackendlessKiibuilt.ioFirebaseEncore.ioAppearIQAnyPresence,FeedHenrySyncanoApstrataFanIgniteCloudMineiKnodeFatFractal,KumulosNetmeraBuddyapiOmatApplicasa (especially for in-app purchases), AppGlu (especially for product catalogs), Flurry (especially for advertising and analytics), Facebook's ParseAppcelerator (includingsingly), Amazon's AWS Mobile Services (including Cognito, analytics, storage, and push notifications), and Apple's CloudKit.

yaml

現在新版的ruby 2.0的ruby,需要rquire 'yaml'嗎?

====
http://reyesyang.info/articles/10

注意在YAML中,字串不一定要用双引号标示。另外,在缩排中空白字符的数目并不是非常重要,只要相同阶层的元素左侧对齐就可以了(不过不能使用TAB字符)。



haml Sass CoffeeScript IaaS Paas SaaS

IaaS  像主機
Paas 設好環境
SaaS 軟體裝好

http://blog.frost.tw/posts/2014/01/15/getting-started-paas-1

haml 處理html

Sass 處理css

CoffeeScript 處理javascript

ruby sinatra activerecord

如果是用
require "sinatra"
require "active_record"

require 'mysql2'
用底下設定比較快
ActiveRecord::Base.configurations = YAML.load_file('database.yml')
ActiveRecord::Base.establish_connection('production')


require "sqlite3"
ActiveRecord::Base.establish_connection(
  :adapter => 'sqlite3',
  :database =>  'blog.db'
)

注意:database.yml 要像底下,關健字不一樣,就不能用

production:
  adapter: mysql2
  database:
  host: localhost
  username:
  password:
  encoding: utf8

ruby php implode

  ostr = '{ "data": ['
articles = Article.order("created_at DESC")

  ostr = ostr + articles.map{|f| ' ["' + f.title.chomp + '", "' + f.file_url + '"] '}.join(', ')
  ostr = ostr + "]}"

map 會把activerecord取出來,設給f
然後組字串,最後加上join

這樣就像implode功能,效果很好~~

ActiveRecord Migration API

http://blackanger.blog.51cto.com/140924/122472/

Migration API

不設定主鍵
create_table :goods, :id => false do |t|
  t.integer :good_id
  t.string :good_desc

改變主鍵
create_table :goods, :id => good_id do |t|
  t.string :good_desc
end

[轉]php list

Awesome PHP

http://briteming.blogspot.tw/2014/04/awesome-php.html

[轉]jQuery file upload maxNumberOfFiles options--無用

http://stackoverflow.com/questions/16723877/jquery-file-upload-maxnumberoffiles-and-getnumberoffiles-options



I believe getNumberOfFiles was only added as an option to a recent version of jquery.fileupload-ui.js (8.2.1).





As an alternative, you can set the option singleFileUploads to false, and in the add callback you can throw errors if more than one file is added.





var maxFiles = 1;

$('#fileupload').fileupload({

singleFileUploads: false,

url: '/uploadUrl'

}).bind('fileuploadadd', function (e, data) {

var fileCount = data.files.length;

if (fileCount > maxFiles) {

alert("The max number of files is "+maxFiles);

return false;

}

});

[轉]jquery file upload 改檔名

https://github.com/blueimp/jQuery-File-Upload/issues/622

看連結最下面
Here is some updated code that works with the most recent version as of July 18, 2014.

class CustomUploadHandler extends UploadHandler {
    /* Converts a filename into a randomized file name */
    private function _generateRandomFileName($name) {
        $ext = pathinfo($name, PATHINFO_EXTENSION);
        return md5(uniqid(rand(), true)).'.'.$ext;
    }

    /* Overrides original functionality */
    protected function trim_file_name($file_path, $name, $size, $type, $error,
                                      $index, $content_range) {
        $name = parent::trim_file_name($file_path, $name, $size, $type, $error,
                                        $index, $content_range);
        return $this->_generateRandomFileName($name);
    }
}

$upload_handler = new CustomUploadHandler();

[轉]圖片超過設定寬高,自動比較縮放 css方法 高手

http://stackoverflow.com/questions/11757537/css-image-size-how-to-fill-not-stretch

.container {
    width: 150px;
    height: 100px;
    background-image: url("http://i.stack.imgur.com/2OrtT.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% 50%;
}​

http://stackoverflow.com/questions/9883289/set-background-image-css-to-the-featured-image-in-wordpress-using-jquery
這個做了我想做的事,也是高手
$('section img').each(
    function(){
        var src = this.src,
            h = $(this).height(),
            w = $(this).width();
        $(this).closest('div').css({
            'min-width' : w,
            'min-height' : h,
            'background-image' : 'url(' + src + ')',
            'background-repeat' : 'no-repeat',
            'background-position' : '50% 50%'
        });
    }).remove();

=======
'background-image' : 'url(' + src + ')',
記得在加上"" =>
'background-image' : 'url("' + src + '")',

開發心得 php 後台

像最近弄php後台,jquery php css jtable database jqueryfileupload,整個用了一遍

結論  要有好用 快速的framework
真的用ror肯定沒錯,因為開發久了,pg才是真正花時間的,省不下,沒工具就是省不下時間

回頭看java真的是怪物,開發速度暴減

php用framework就像ror一樣,主機是不開放更新framework

datatable row_id

基本上官方的fnGetData和fnGetPosition之類,fnGetPosition拿到是抓出幾筆中第幾筆id和真正的Row_ID不一樣。用fnGetData一直拿到Object,根本解不開,試了官方和網路上的方式,全都不行。
fnrender被拿掉了.....無法判斷Object

最快方式:直接用jquery

$('#datatable tbody').on( 'click', 'tr', function () {
這行會取得tr

底下直接用
row_id = $(this).attr('id').split("_")[1];

$(this).attr('id')會找到tr用的id,得到值:ROW_22
split("_")之後:ROW   22,取[1],就行得到id。



jquery live bind在click

確實搞錯使用方式

正確來說,用id時,如果要多個相同,可能只會綁定第一個
所以最好用 class或是html元素(p href...)之類才能綁住

另外綁住之後,取值要記得用$(this),這樣才會取到 執行綁定的元件

重要:live新版停用,請用on ....這是試了很久才發現,為什麼javascriprt一直錯,才發現沒live這function,才知道新版刪除function,請用on 或bind


=========================
element.click 如果有新增或變更element會失敗
$("#pic_del").click

bind比較沒什麼問題,但也有可能
$("#pic_del").bind('click', function() {

http://stackoverflow.com/questions/7268580/bind-click-and-live-click
live是最好,但不能直接

#pic_del是a href,所以
$("#pic_del").live('click', function() {  會失敗
按連結說明,要找到對應的selector再指定
也許
$("#xxx a").live('click', function() {

但實際上...用bind比較快,live會失效.....也許是我搞錯或用錯方式

DOM traversal methods are not supported for finding elements to send to .live(). Rather, the .live() method should always be called directly after a selector.

jquery file upload 官方範列很爛

官方:
https://github.com/blueimp/jQuery-File-Upload/wiki/PHP-MySQL-database-integration
少一大堆東西,根本看不懂…真的看了兩次,砍了一次放棄...
-----------------------
重點1:
form的用法是把
< input type="file" name="files[]" multiple >
這行放到 form中,記得form要有id,而input裡面id拿掉
-----------------------
另一種方式:是在
  $(function () {
    $('#fileupload').fileupload({
這裡面補上
formData: {example: 'test'}
看了很多很多範列的....的結論,所以form不用button來submit,要用button來做,請看範例了。
-----------------------
-----------------------
重點2:在上傳的.php中,記得
bind_param('sisss',  這個奇怪的東西是對應你傳參數的型能,傳兩個參數是字串,那個只要ss就行了!

還有如果要測試直接設值,請$a="xxx",因為reference,要給變數,不能直接設值。
==================================
http://runnable.com/UZKDAYo3XEw2AACX/how-to-upload-a-file-using-jquery-for-php

這個是過期很久的範列....不適合 現在的版本
底下這個範列簡單多了,看得懂
http://kyokasuigetsu25.wordpress.com/2011/03/29/multiple-file-upload-using-jquery-and-php/

==================================
真心話:如果不堅持,用下面這個可能會比較快,因為下面這個寫的最完整直接,可以控制....
http://www.phpgang.com/how-to-upload-multiple-images-jquery-ajax-using-php_453.html

jquery datatables 大推

當然有幫忙的,現在真的更好了...
http://www.datatables.net/

現在也有編輯,更狠的是,把資料打一打,全都建好了…
https://editor.datatables.net/generator/index

[轉]Launcher

http://www.modaco.com/topic/372741-rom411b209-aosp-mod-22072014/page-42#entry2219923


I want to give he "good"


Today I have test some launcher in terms of Ram usage & features:
- APUS : is the lighter, but it miss every features, no app drawer, no desktop image personalization, some crash, is a new app so is normal... I think is a good idea and in future can be a good alternative, but not at the moment.
- SOLO Launcher: for me is the winner, 32mb usage, complete, app drower included, digital clock & weather included, every setting you are using in nova is present, no ads, free and well developed. Nice features: gestures are included and for free, search included (internet, contact, apps) and available in lockscreen, Clock&Weather included, a Ram cleaner widger included
- MI Launcher aka Miui: a nightmare, heavyyyyy more than 80 mb, crash, too much complicated and rich of crapware
- Holo launcher: not bad but it use 40-45 mb of ram, complete as Nova and lighter but not enough compared to Solo
- KK Launcher: same as Holo just a litle light 36-40 mb, not bad at all and include all Nova features and more, even Clock&Weather is included, good persolazisations, theme, icons.... For me is in second place after Solo
- ADW: too old and a little complicated add icons at he home, 40mega usage. Is a pain s not developed anymore.
- APEX: is the same as nova even in ram usage too heavy for our device.
- NOVA: is the default launcher but easy it pass more than 60 mb with 2 process active the most of the time.

Now I delete Nova and my clock and weather app (Sensee Flick Clock & weather) that use in complex 70 mb and I use SOLO that use only 32mb of ram

無線路由器

http://www.techbang.com/posts/13302-thousands-of-qualified-20-wireless-router-comparison?page=7

sapido BRC76n *!
TP-Link TL-WR841N !
Tenda W309R !


session *
Totolink N302R+   26169  wifi 47.3  xxx
sapido BRC76n

nat !
1、sapido BRC76n
2、TP-Link TL-WR841N
3、Tenda W309R

所以應該是買 sapido BRC76n

Restfull session token OAuth

http://www.btsmth.com/show_topic.php?en_name=Java&gid=342483

[轉]
与其说 REST 是基于 HTTP 协议的,不如反过来说 HTTP 协议本身就是 REST 风格的。

这样就好理解了,WS/SOAP/UUDI/WSDL 是在 HTTP 之上的一层封装,就好比 HTTP 是在
TCP 之上的一层封装。

REST 则不同,它不是往 HTTP 上再套一个信封,而是利用 HTTP 已有的术语来定义自
己的理念。

另外一个关于 OAuth 的问题。OAuth 的应用场景只是open和分布式的环境。

首先,它是open的。
比如说我的一个 BBS 论坛,用户张三要在论坛注册用户名和密码。张三就说了,我在
腾讯QQ、新浪微博都有帐号和密码,我用那边的帐号和密码行不行……

然后,它是分布式的。
比如说我的一个云储存系统,分成授权服务器和资源服务器。
授权服务器上保存了用户名和密码,运行Linux和PHP 5.4,主机放在厦门。
资源服务器上保存了用户存储的文件(照片、日记、Word/PDF文档等),运行Windows
和.NET 4.0,主机放在美国。
资源服务器需要提供一套API。
对一张照片(一个资源)来说,
用户要上传这张照片,就是用HTTP的POST方法请求一个url;
用户要修改这张照片,就是用HTTP的PUT方法请求一个url;
用户要读取这张照片,就是用HTTP的GET方法请求一个url;
用户要删除这张照片,就是用HTTP的DELETE方法请求一个url.
当然,资源服务器要先向授权服务器问一下这个用户是否有权限。




http://stackoverflow.com/questions/6068113/do-sessions-really-violate-restfulness


http://resistor.io/blog/2013/08/07/mimimal-api-authentication-on-rails/


http://coderberry.me/blog/2013/07/08/authentication-with-emberjs-part-1/

linux mint 最新版中的gcin常常失效,換hime

gcin不知道什麼原故,常常一下能用,一下不能用,完全搞不懂!!

一下line(wine)不行,一下chrome不行,一下sheel下不行,重啟也沒用,看設定是完全正確的!本來想去官方問,看了一下,沒有人有這問題,發問要註冊,就懶了…再試用幾天,今天最扯,明明上一分鐘chrome能打嘸蝦米,下一分鐘就不能打,注音也是,按ctrl+space也不行,切來切去,又重啟gcin,進系統砍,反正試到最後…放棄了!

就在找其他輸入法時,切回chrome時,又能輸入嘸蝦米了……注音又能輸入了…到底gcin在搞什麼鬼,所以現在決定換成hime,希望不要再發生這種非常無理頭的事情…

http://itechlogger.blogspot.com/2013/11/linux-mint.html

http://tetralet.luna.com.tw/index.php?op=ViewArticle&articleId=234&blogId=1

http://hime.luna.com.tw/

....Ruby on Rails 目標?? --3--

http://ihower.tw/rails4/environments-and-bundler.html

Rails 啟動與應用程式設定 =>/config/application.rb

....Ruby on Rails 目標?? --2--

basic 終於結束了!往下一個。上一個步驟,最多問題rails3有些指令是rails4不能用,其中route中的match,現在要指定get或post,反正目前搞不清楚,所以只能自己手動加route,先能跑就好,以後比較熟,再好好研究,不然一直卡住,先往下學。

RESTful 應用程式

http://ihower.tw/rails4/restful.html

===== button_to =====
如果用button_to,而產生route跟你要POST,後面補上
:method => :get

<%= button_to 'New event', new_event_path, :method => :get%>
這樣就ok~

解答來自下面連結
http://stackoverflow.com/questions/5221227/rails-button-to-fails-with-path-doesnt-exist-for-a-path-that-exists


ubuntu安装完vbox没有无缝模式 for line.....失敗…因為一定要灌一套windows系統,用win8pe又不行…放棄

http://www.cnblogs.com/telnetning/archive/2013/05/18/3084829.html

底下[轉]
由于linux下的qq实在不给力,今天在ubuntu下安装了virtualbox。
1
apt-get install virtualbox
不晓得上次是怎么装的了,怎么都没装对,这次没想到执行完就可以直接打开了。也许是由于源的问题导致的版本库文件等的问题?
不管这个了先,赶紧装上xp,装上qq。
virtualbox的外观有几种模式:全屏模式,自动缩放模式等等。我最喜欢的就是无缝模式。
在全屏模式下,分辨率稍微调高一点,xp的桌面就跑到屏幕外面去了,真是痛苦。
在自动缩放模式下,xp桌面能根据vbox框框的大小而变化。听着感觉很好,可是丫坑爹的在于这个模式下xp桌面总是不清不楚,显得很模糊。
于是我开始怀念可爱的无缝模式。
无缝模式可以让虚拟机和物理机的桌面重合,具体就是可以不用使用虚拟机的桌面,虚拟机的软件直接就像是承载在物理机的桌面上。再也不
用为了在物理机和虚拟机之间切换而痛苦了。
可是我的vbox居然显示无缝模式是灰色的,即不可用。
看网上的,别人的vbox上面还有菜单选项,回头看我的,找了半天在ubuntu的顶部找到了,但是没有device选项,看来是缺了什么东西。
后来明白了,应该是某些增强包没有装,其实我觉得这个增强包就像是插件。
找到解决方法:
1
apt-get install virtualbox-guest-additions-iso
ok,解决了
方法简单,过程曲折。
学习就是这样,虽然费时间,但是也学到了学多其它的东西。