Communicating PHP with Android Java using JSON

When you have several variables (data) which you would send to Android using regular text on HTTP, then JSON would become an alternative format to XML. Android has it’s own JSON parser class which able to convert text on JSON format into a JSON Object. Since version 5.2.0, PHP has it’s built in json_encode() and json_decode() function to convert an array into json string and vice versa.

Pemrograman Web PTIIK Genap 2012/2013: Preface

Berikut ini adalah slide presentasi pada pertemuan I: Pendahuluan untuk mata kuliah Pemrograman Web semester Ganjil 2012/2013. Kelas yang diampu adalah kelas: Sistem Informasi A Sistem Informasi B Informatika A Hal-hal yang dibahas dalam pertemuan pertama mata kuliah ini mencakup penjelasan mengenai materi perkuliahan, rencana pembelajaran, referensi yang digunakan, evaluasi dan peniliaian, regulasi perkuliahan, serta tugas pendahuluan sebagai sarana penunjang kegiatan perkuliahan. Halaman Slide presentasi dapat di-download pada link berikut Continue reading Pemrograman Web PTIIK Genap 2012/2013: Preface

Sorting Array of Objects using Ruby and Python

From my previous post, I had explained on how to sort an array consists of objects by object’s attribute using PHP. While on PHP sorting by object’s attribute requires additional function other than sorting itself, Ruby and Python has it’s own array of object sorting syntax. For example in Ruby, the following one line syntax will sort an array named population by comparing it’s objects length property (attribute) ascendingly without Continue reading Sorting Array of Objects using Ruby and Python

Sorting Array of Objects Using PHP

Consider you have an array or list of objects and wanted to sort it based on one attribute of objects. If the array consists of integer, it is very easy to sort it ascendingly using sort() function, otherwise if the array consists of objects, you have to create custom sorting function which is passed to the PHP usort() function. Here is an example on how to manually sort array of Continue reading Sorting Array of Objects Using PHP

PHP Development: A Test-Driven

All Code is Guilty Until Proven Innocent –¬† Even good programmers make mistakes. The difference between a good programmer and a bad programmer is that the good programmer uses tests to detect his mistakes as soon as possible. The sooner you test for a mistake the greater your chance of finding it and the less it will cost to find and fix. This explains why leaving testing until just before Continue reading PHP Development: A Test-Driven