Sample Development Process Cheat Sheet

    Project Initiation:
  • Informal business need/problem discussions.
  • Project kickoff.
  • Define problem statement (for example, essential use cases or shall statements).
    Exploration Phase:
  • Explore business domain concepts (develop domain model).
  • Develop basic prototypes and storyboard (for user interface applications).
  • Define scope (what included/deferred in nest release).
  • Define user stories for next release.
  • Do informal whiteboarding of architecture and so on.
    Planning:
  • Develop release plan for next release/version of system.
  • Define glossary of common business terms.
  • Develop iteration plan for next iteration.
  • Define system conventions (naming, code check-in/integration, and more).
    Incrementally Build Software in Iterations:
  • Develop software in increments using 2-week iterations; use iteration 0 (or cycle, 0) for environment setup and proof of concept.
  • Have an iteration planning meeting before each iteration to pick the user the user stories that will be developed in the next iteration.
  • User provide acceptance tests as detailed requirements; developer implement these as unit tests.
  • Let developers design and develop the system with user available for Q&A, as needed.
  • Deploy production-ready code every two weeks after it has passed the user acceptance tests.

rounddown

/**
* flooring 0.5
* @param d
* @param places
* @return
*/
public static final double roundDown(double d, int places) {
return Math.round((d * Math.pow(10,(double)places))-(d<0?-0.1d:0.1d))>double) places);
}

Reset auto_increment tabel MySQL

Pada tabel InnoDB yang memakai auto increment sebagai id-nya, jika sering terjadi operasi insert dan delete sekaligus banyak akan ada banyak nilai integer yang tidak terpakai atau istilahnya bolong-bolong karena setelah delete banyak, insert berikutnya memakai id sebelum delete.

Contoh dari hal ini ada tabel saldo_awal_barang yang menyimpan jumlah tiap barang per gudang per tanggal 1 pada bulan aktif, tabel ini di-insert ketika tutup pencatatan bulan sebelumnya, dan akan delete ketika periode yang sudah ditutup tersebut dibuka lagi. Untuk itu gunakan perintah SQL berikut tiap selesai delete untuk mereset id ke nilai terakhir setelah delete.
ALTER TABLE `item` AUTO_INCREMENT = 1;
Cara ini akan mereset field auto_increment ke nilai terbesar, maka nilai berikutnya yg akan dihasilkan adalah max(id) + 1. dimana fk adalah primary key dengan opsi auto_increment.

CATATAN :
Pada MySQL/MariaDB versi 5.5 jika isi tabel tersebut cukup banyak maka akan berjalan cukup lambat karena proses ini melibatkan penyalinan semua isi tabel bahkan dalam beberapa kasus akan membuat aplikasi hang dan harus direstart service databasenya agar bisa dipakai lagi. Namun masalah ini hilang ketika dicoba pada MariaDB versi 10.3.

Merubah Engine Tabel MySQL

Script berikut digunakan untuk merubah engine table ke InnoDB

ALTER TABLE `nama_table` ENGINE = InnoDB;