Kamis, 01 Desember 2016

STNK Mobil Hilang (Surabaya)

Share pengalaman pribadi.

Hal yang pada umumnya dilakukan oleh pemilik kendaraan adalah memberi gantungan kunci berbentuk tas kecil untuk menyimpan STNK pada kunci kendaraannya. Nah apesnya nih, kalau kunci tersebut jatuh, jadi jatuh se STNKnya juga.

Kejadian yang menimpa penulis adalah Kunci dan STNK mobil CRV tahun pembuatan 2015 jatuh entah dimana. Hal ini sangat rawan, karena penemu kunci tersebut memiliki kunci beserta STNKnya. Hal terburuk yang bisa terjadi, jika si penemu berniat jahat, dia bisa saja menunggu mobil saya bawa keluar. Alamat lengkap ada di STNK, tinggal di tungguin saja kan. Ketika mobil saya parkir, dia juga punya kuncinya. Itu hal terburuk yang bisa terjadi.

Disini sy ingin share apa yang telah saya lakukan dan berapa biaya yang telah keluar.

1. Ganti Kunci Mobil
Perlu diketahui, kunci mobil CRV dilengkapi dengan immobilizer, artinya kalau kunci itu hilang, kunci penggantinya MAHAL dan ada prosedur-prosedur yang harus diikuti untuk mendapatkan kunci pengganti di dealer resminya. Ok lanjut masalah ke penggantian kunci, alasan kunci harus diganti karena ada resiko jika si penemu kunci bermaksud jahat. Untuk penggantian kunci secara total, berarti saya harus mengganti "rumahan" kunci yang ada di mobil. Melalui teman yang bekerja di dealer Honda informasi yang saya dapat, untuk rumahnya saja harganya Rp. 7.000.000.

Akhirnya yang saya lakukan:

  • Menghubungi penyedia jasa duplikat kunci yang bisa immobilizer. Info bisa dicari di google
  • Memodifikasi gigi kunci pada "rumahan" kunci yang ada dipintu
  • Membeli duplikat kunci pada penyedia jasa. Perlu dicatat, saya masih punya kunci serepnya.
Si penyedia jasa bisa memberi layanan datang kerumah. Karena gigi kunci pada pintu dirubah, jadi kunci mobil yang digunakan untuk starter mobil sudah tidak bisa digunakan untuk membuka pintu. Kemudian si penyedia jasa mereset ECU mobil, sehingga kunci yang hilang sudah tidak teregistrasi lagi pada mobil CRV saya yang hasilnya kunci tersebut sudah tidak bisa digunakan lagi. Kunci duplikat dan serep kemudian di registrasikan ulang ke mobil saya. 

Harga untuk layanan jasa tersebut adalah Rp. 3.000.000. Dengan harga segitu saya mendapatkan sebuah kunci duplikat KW (tidak semulus yang ori) dan 2 kunci untuk pintunya. Setelah saya pikir-pikir, harga resmi duplikat kunci mobil tersebut dari dealer bisa jadi juga segitu dan kita mendapatkan kunci yang original (Info ini belum dikonfirmasi, mohon ada yang share). Baru nanti ganti gigi kunci untuk rumahan yang dipintu kita panggil layanan duplikat kunci. Ketika menghapus register kunci mobil, penyedia jasa akan mereset ECU mobil. Saya merasa penggunaan bahan bakar mobil menjadi tetap boros walaupun ECO Mode-nya digunakan. Hal ini juga masih harus saya konfirmasi lagi nanti ketika servis mobil.

2. Urus Duplikat STNK
Syarat untuk urus duplikat STNK adalah:
  • BPKB (Asli dan Fotokopi)
  • KTP pemilik (Asli dan Fotokopi)
  • Surat kehilangan dari polres / polsek terdekat
  • BAP dari polres / polsek terdekat
  • Kwitansi dan kliping iklan kehilangan STNK di surat kabar
  • Surat keterangan tidak terlibat laka
  • Surat rekomendasi duplikat STNK dari POLDA
  • Surat keterangan pelunasan pajak 
Saran yang ingin saya sampaikan terkait kepengurusan syarat-syarat diatas agar dapat menghemat waktu dan tenaga seperti ini.

Pertama: Fotokopi KTP dan BPKB
Kedua: Bawa Fotokopi tersebut ke polres terdekat dan sampaikan kalau kehilangan STNK dan mau urus duplikat STNK. Kalau pas polisinya berbaik hati, kita bisa langsung dapat Surat kehilangan dan surat BAP. Nah disini kemarin ada biaya sebesar Rp. 50.000. Alasannya karena BAPnya, entah itu resmi atau tidak.
Ketiga: Ke POLDA untuk mendapatkan surat rekomendasi duplikat STNK. Disini petugas hanya minta biaya admin tetapi tidak menyebut besarnya uang. Mungkin Rp 20.000 sudah cukup.
Keempat: Ke samsat yang bisa memberikan surat keterangan tidak terlibat laka. Tidak semua SAMSAT bisa memberikan surat ini, di Surabaya hanya SAMSAT manyar yang bisa mengeluarkan surat tersebut. Alhamdulillah untuk surat ini saya tidak diminta uang administrasi, tapi ada pengalaman teman yang diminta uang admin sebesar Rp. 10.000 - Rp. 20.000. Mumpung sudah disamsat, sekalian aja cari info ke salah satu petugas di SAMSAT tentang penyedia jasa iklan koran. Biaya yang saya keluarkan untuk iklan sebesar Rp. 25.000. Kipling iklan bisa diambil di penyedia jasa esok harinya.
Kelima: Setelah ambil kliping koran, baru kita ke SAMSAT untuk pengurusan duplikat STNK. Syarat sudah lengkap semua, tinggal ikuti prosedur yang ada. Di samsat prosedur sangat jelas dan teratur. Biaya resmi untuk cetak Duplikat STNK untuk mobil Rp. 75.000.

Jadi total biaya:

  • BAP dan surat hilang Rp. 50.000
  • surat rekomendasi duplikat STNK : Rp. 20.000
  • Keterangan bebas laka : Gratis - Rp. 20.000
  • Iklan Koran  : Rp. 25.000
  • Duplikat STNK : Rp. 75.000
  • Total: Rp. 170.000 - Rp. 190.000
Nilai ini jauh lebih rendah dibandingkan cerita-cerita yang saya dapat, katanya untuk kepengurusan duplikat STNK hingga Rp. 500.000. Mungkin karena yang cerita calo kali ya....

Rabu, 19 Oktober 2016

SQL join 4 Tables

Once again, a posting that will help me recalling how to join more than 2 tables in sql. In this case, I had to join 4 tables to fetch the data that I needed.

Table 1 : member

id_memberid_cityid_majorid_facultynamephone
mbr0001111Rafi Hajid0812234586
mbr0002122Almira08775123495

Table 2:City

id_cityname
1Surabaya
2Kediri

Table 3: Major

id_majorname
1S1 SI
2D3 SI

Table 4: Faculty

id_facultyname
1Science and Technology
2Vocational

The Information that I needed from those tables were name of the member, phone's Nr., City's name, Major's name and Faculty's name.

This is the SQL to retrieve those information:

select m.name, m.phone, c.name as city, mj.name as major, f.name as faculty
from member as m 
join city as c on m.id_city = c.id_city
join major as mj on m.id_major = mj.id_major
join faculty as f on m.id_faculty = f.id_faculty

The result of the query would be:

namephonecitymajorfaculty
Rafi Hajid0812234586SurabayaS1 SIScience and Technology
Almira08775123495SurabayaD3 SIVocational


Hope this can help you, somehow....

Selasa, 27 September 2016

HTML5 Server Sent Event in Codeigniter

There are many sources describing about SSE in HTML5 and also with the code that can be downloaded. One source that I can recommend to read is this. W3school also describes SSE in a short, simple and clear explanation.

But, there are not many websites that gives tutorial using SSE in Codeigniter. I'm working on a project using Codeigniter that requires SSE to display a dynamic data. It was quite difficult for me at the beginning to implement SSE in MVC-way, since all the codes that I got from some tutorials are not programmed in MVC-way. 

Maybe it is not the best way to implement SSE in Codeigniter, but at least it works. 

At the client side I have a javascript code shown below that allows client to "subscribe" a stream of data from the server. I send JSON data from server.

var source = new EventSource("❬?php echo site_url('c_sse/loaddata');?❭");
    
  source.addEventListener("message", function(e) {
   document.getElementById("status").innerHTML = "MESSAGE";showdata(e);
   }, false);
   
  source.addEventListener("open", function(e) {
   document.getElementById("status").innerHTML = "OPENED";
   }, false);

  source.addEventListener("error", function(e) {
   document.getElementById("status").innerHTML = e.readyState;
   if (e.readyState == EventSource.CLOSED) {
    document.getElementById("status").innerHTML = "CLOSED";
     }
   }, false);
 } else {
  document.getElementById("notSupported").innerHTML = "SSE not Supported";
 }
}
  
function showdata(Jdat)
{
 var data = JSON.parse(Jdat);
   
 document.getElementById("result").innerHTML = data.name;
}
 

The MVC style code is already seen in there. Check the EventSource above, that is the way I call the function "loaddata" inside controller c_sse.php.

At the server side, I started to code from the controller. The function that is responsible for sending the data (for example) called "loaddata". The most important thing of SSE in server side are the first three line with "header" in the code. Those should be placed in this function and they will cause Error if I put those in the Viewer. So, here is how the function "loaddata" looks like.


function loaddata()
{
 header("Content-Type: text/event-stream");
 header("Cache-Control: no-cache");
 header("Connection: keep-alive");
  
 $this-❭load-❭model('m_sse');
 while(true)
 {
  $data['mydata']=$this-❭m_sse-❭compute_dashboard_data();
  $this-❭load-❭view('sse_view_fast',$data);
  sleep(1);
 }
}


m_sse is the model for computing the data. In my case the return's value of the function 'compute_dashboard_data( )' is JSON data.

The one who is responsible to flush the data to Client is the viewer. Wrongly coded in the viewer can make the performance of SSE much slower. Firstly, I'll show the code resulting slow SSE. Oh ya, I forgot to mention the syntax. The real data should be put behind the "data:".

the source code for sse_view_slow.php:

print "data:".$mydata;
ob_flush();
flush();

If you implement that code, you'll have to wait couple seconds or maybe even couple minutes until the data shown.

Better use this code:

sse_view_fast.php

print "data:".$mydata.PHP_EOL;
print PHP_EOL;

ob_end_flush();
flush();

Actually, that is it for the programming. That is how I implement SSE in Codeigniter.


PHP: echo with " vs '

A simple thing about php echo that maybe I'm not the only one who hasn't realized the difference between echo using ".." and using '..'.  Again, its a note for me in case I forget about this later.

echo "hali";
echo "halo";

The output of those commands will be:

hali
halo

If your php code like this:

echo 'hali';
echo 'halo';

your output would be:

halihalo

see the difference?

Rabu, 20 April 2016

Lenovo Ideapad Z400 brightness problem

It happened to my lenovo z400, I couldn't adjust my screen's brightness. I've browsed and found many alternatives to solve this problem. The best solution of them all is just by executing the 'setup.exe' that can be found in c:/drivers/Intel Video Driver/9.17.10.3223. Execute setup.exe as administrator (right click and run as administrator), thats all and let it do the magic.