Check If Date Is Within Supplied Range Using Joda Time

Supposed you need to know if certain date is within a given range of dates, here is how you do it using JodaTime:

//initialize a start & end time variable
DateTime start = new DateTime(1434931200000);
DateTime end = new DateTime(1435276800000);

//supply the start and end to an interval object
Interval interval = new Interval(start, end);

//this is the time that we need to check
DateTime timeToTest = new DateTime(1435046200000);

//now, check if the time is indeed within out specified start and end range
if(interval.contains(timeToTest)){
    System.out.println("Time is within range.");
} else {
    System.out.println("Time is outside the defined range.");    
}

Share

Fixing SmartLocation Doesn’t Work On Devices Without Google Play Services

Hi, me again in this quick tips. Stumbled upon a problem where SmartLocation library doesn’t work on devices without google play services. Apparently, you need to change the location provider and LocationParams config. Below is gist I created:

Continue reading “Fixing SmartLocation Doesn’t Work On Devices Without Google Play Services”

Share

Experience In Developing And Installing Application For Firefox OS

A couple weeks ago, when I was bored in the office due to too many deadline, I procrastinate myself and throw away few good hours on cloning an android game using html + js. You guys can see the result here.

Continue reading “Experience In Developing And Installing Application For Firefox OS”

Share

Bermain-Main Dengan Javascript Console Di Google Chrome

Barusan, teman saya ngebuzz, tanya apa bisa akses JSON dari URL berikut dengan menggunakan AJAX jQuery. Sebab, kata ybs, selalu error saat diproses:

http://www.blibli.com/webapp/wcs/stores/servlet/EMarketingSpotJSON___NewArrivalsProduct?catalogId=10051

Karena ada tantangan, ya saya terima saja:D.

Continue reading “Bermain-Main Dengan Javascript Console Di Google Chrome”

Share

Trik Pemrograman Penggunaan array_map

Free Image Hosting at www.ImageShack.us

Hai, lama juga ya ndak nulis teknis di blog ini. Beberapa minggu ini saya cukup sibuk dengan kegiatan yang sangat jauh dari ngoding. Untuk refreshing, saya mau coba menggali beberapa trik pemrograman yang berhubungan dengan array dan penggunaan array_map.

Continue reading “Trik Pemrograman Penggunaan array_map”

Share

Cek Struktur JSON Secara Visual

Sedang mengerjakan tugas yang berhubungan dengan API yang menghasilkan JSON. Tapi sayang, informasi yang diberikan, hanya cara menghasilkan JSON itu. Tanpa ada penjelasan apa saja isi JSON-nya. Untung ada fasilitas online untuk melakukan pengecekan data JSON secara lebih manusiawi.

Continue reading “Cek Struktur JSON Secara Visual”

Share