Monthly Archives: ตุลาคม 2013

sort array multiple field by select field sort

[cc lang = “php”] $tmp = Array(); foreach($result[“data”] as &$ma) $tmp[] = &$ma[“app_id”]; array_multisort($tmp,SORT_ASC,$result[“data”]); [/cc] In above example $result[“data”] is an array multiple field and sort by app_id field asc(SORT_ASC) or you want sort by desc(SORT_DESC)

Posted in knowledge, php | Leave a comment

json pretty printing

PHP 5.4 offers the JSON_PRETTY_PRINT option for use with the json_encode() call. normal json [cc] {“a”:”apple”,”b”:”banana”,”c”:”catnip”} [/cc] pretty json [cc] { “a”: “apple”, “b”: “banana”, “c”: “catnip” } [/cc] [cc lang=”php”] $json_pretty = print_r(json_encode($data, JSON_PRETTY_PRINT),true); echo “ “; echo … Continue reading

Posted in knowledge, php, เกร็ดความรู้ | Leave a comment

new project cocos2d-x v2.1.4 c++

Step by step download cocos2d-x from cocos2d-x v2.1.4 extract to someplace such as drive d Go to [COCOS_PATH]/tools and run command [cc]project-creator -project [PROJECT_NAME] -package [PACKAGE_NAME] -language cpp  [/cc] the location of new project is [COCOSPATH]/projects/[PROJECT_NAME] you can run [COCOSPATH]/projects/[PROJECT_NAME]/proj.win32/HelloCpp.sln on … Continue reading

Posted in cocos2d-x | Leave a comment

Google app engine datastore GQL

GQL is a SQL-like language for retrieving entities or keys from the App Engine scalable datastore. While GQL’s features are different from those of a query language for a traditional relational database, the GQL syntax is similar to that of … Continue reading

Posted in google app engine | Leave a comment

Google app engine free datastore quota limit

Limit search query request ~ 1000 query per days deploy limit ~ 1000 times per days index limit ~ 100 index Restrictions on queries(ข้อจำกัดในการใช้คิวรี่) โค้ดตัวอย่างเป็นภาษา python คิวรี่ที่ใช้ Inequality filters (>,>=,<,<=,!=) จะใช้ได้เพียงฟิลด์เดียวต่อ 1 query เช่น [cc lang=”python”] files = files.filter(‘eventStart >=’, … Continue reading

Posted in google app engine | Leave a comment