• Enter Slide 1 Title Here

    This is slide 1 description. Go to Edit HTML of your blogger blog. Find these sentences. You can replace these sentences with your own words.

  • Enter Slide 2 Title Here

    This is slide 2 description. Go to Edit HTML of your blogger blog. Find these sentences. You can replace these sentences with your own words.

  • Enter Slide 3 Title Here

    This is slide 3 description. Go to Edit HTML of your blogger blog. Find these sentences. You can replace these sentences with your own words.

February 13, 2017

Best Practice to Increment/Decrement Date in Javascript

I realized that the best way to increment or decrement date in javascript is by adding or reducing miliseconds of the date. Here is the example:


var today = new Date();
var tomorrow = new Date(today.getTime() + (24 * 60 * 60 * 1000));
var yesterday = new Date(today.getTime() - (24 * 60 * 60 * 1000)); 

The output will be like this

Today is
Tomorrow is
Yesterday is

Lets make a function for it.

function incrementOrDecrementDate(date, dayValue) {
    return new Date(date.getTime() + (dayValue * 864e5));
}

If you want to increment the date, pass positive value in dayValue. If you want to decrement the date, pass negative value in it. Let's try to get the date 10 days from today and 10 days before today.


var tenDaysFromNow = incrementorDecrementDate(new Date(), 10);

Here is the result


February 03, 2017

Microsoft Visual Studio 2015 Installation for Apache Cordova Development

It's true that you don't need specific IDE for Apache Cordova development. But using an IDE will let you do anything easier and give you more productivity. So far, Microsoft Visual Studio is currently the best IDE for hybrid app development using Apache Cordova. Especially for a novice like me.

December 13, 2015

Java Application Exercise 1-1: Define Class And Generate Object

Learning points 


In this exercise we will study about:
  1. Defining class in Java.
  2. Constructor.
  3. Setter and Getter.
  4. Generate object.
  5. Call class function.

Summary


A health food manufacturer is on preparation of opening new sales office in Tokyo and Osaka. First, we will show each sales office information. Following information need to be displayed.

Expected result 


[Shop] This is Tokyo Shop. [Tel] 03-1234-5678
[Shop] This is Osaka Shop. [Tel] 06-1234-5678


Now let's create some java application to fulfill the above specification.

October 25, 2015

Scan Barcode With Device Camera from Webapp and Return Result Into Textbox

I am developing a web application that needs to scan barcode to input value in textbox of some forms. Because the web application will be accessed from tablet and smartphones, I want to make use of device camera for reading barcode. And because it is not just one page that need to scan barcode, i want to seperate the scanning page. To summarize it, here is what i want to do;

1. From the main page, which is having a textbox that needs to be input from barcode, i click button to open the barcode-reader page.
2. The barcode reader page is opening in a new window or tab, and access device camera to read the barcode.
3. After reading the barcode, it will send the result to the main page textbox and close itself.

Here is the workaround i did. I am using Quagga.js for reding the barcode.

October 16, 2015

Instalasi Java JDK di Windows 10

Untuk mulai mempelajari bahasa pemrograman Java, kita perlu menginstal Java SDK (Java SE Development Kit) atau biasa disingkat dengan JDK, ke dalam PC kita. Di dalam artikel ini saya akan berbagi tentang bagaimana menginstal JDK di Windows 10 (yup, sistem operasi windows terbaru).

Pertanyaan dasarnya adalah "Apakah Java mendukung Windows 10?". Jawabannya, "Fortunately yes, it is!!". Lihat saja informasi dari situs resminya di sini.

Kalau begitu mari kita mulai install JDK ke dalam windows 10.

October 10, 2015

Tentang Catatan Coder

Blog ini bermaksud untuk berbagi pengalaman serta ilmu yang berhubungan dengan dunia komputer, khususnya dalam hal pembuatan perangkat lunak. Postingan di blog ini umumnya adalah catatan-catatan saya pribadi dalam mempelajari bahasa pemrograman komputer dan beberapa hal yang berhubungan dengan membangun sebuah software/sistem IT.

Saya adalah seorang sarjana ekonomi dan manajemen dari salah satu universitas di Nagoya yang belum pernah bersentuhan dengan pemrograman perangkat lunak sebelumnya. Baru mulai berkenalan dengan pemrograman perangkat lunak ketika diterima bekerja di salah satu perusahaan IT terbesar di Jepang.

Sejak saat itu, saya mulai tertarik dengan dunia pemrograman. Dunia pemrograman merupakan dunia yang sangat menarik sekaligus menantang. Dengan mempraktikannya kita bisa belajar bagaimana komputer dapat memenuhi apa yang kita inginkan. Semakin menggelutinya, saya merasakan suatu keasyikan tersendiri. Saya pun mempunyai sebuah hobi baru, yaitu ngotak-atik komputer sambil belajar bahasa pemrograman.

Dengan blog ini saya ingin berbagi ilmu dan pengalaman saya dalam mempelajari pemrograman. Semoga bermanfaat, baik untuk para pemula yang tertarik untuk belajar programing ataupun para profesional yg bergerak di bidang IT.
buka aplikasi