Monthly Archives: ตุลาคม 2013

sort array multiple field by select field sort

$tmp = Array(); foreach($result["data"] as &$ma)       $tmp[] = &$ma["app_id"]; array_multisort($tmp,SORT_ASC,$result["data"]); 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) http://uk.php.net/manual/en/function.array-multisort.php

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. http://php.net/manual/en/function.json-encode.php normal json {"a":"apple","b":"banana","c":"catnip"} pretty json { "a": "apple", "b": "banana", "c": "catnip" } $json_pretty = print_r(json_encode($data, JSON_PRETTY_PRINT),true); echo "<pre>"; echo $json_pretty; echo "</pre>";

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 project-creator -project [PROJECT_NAME] -package [PACKAGE_NAME] -language cpp   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 เช่น files = files.filter(’eventStart  >=’, start) files … Continue reading

Posted in google app engine | Leave a comment