Jumat, 29 Januari 2016

Highlight a syntax or code on blogger with syntaxhighlighter

Hi guys,
if you're developer and want to share your code on your blog with some highlight on it, you can use syntaxhighlighter. To use the syntaxhighlighter, follow these step below:
1. Backup your current template : go to template menu → backup/restore → download full template
2. import the plugin : go to edit html, search then paste these code above it:
 
 

done. with those plugin, you can highlighting code: css, javascript, php, and xml. if you want to highlight another code see:
cdnjs SyntaxHighlighter
3. post your code between:
########### your code ###########
example your code:
	var name="john";
	function sayHello(){
		alert("Hello ,"+name);
	}
display:
	var name="john";
	function sayHello(){
		alert("Hello ,"+name);
	}

Kamis, 14 Mei 2015

[error] Couldn't find mex-file.

I'm working on a project using matlab version R2009b and using isptoolbox that required mex, it solved by installing mingw and gnumex to running the isptoolbox.
I got this error while i upgrade my windows7 from 32bit to 64bit










Error:
mex -v isp_ifptrack_helper.c
 This is mex, Copyright 1984-2007 The MathWorks, Inc. 
 
-> Default options filename found in C:\Users\DELL\AppData\Roaming\MathWorks\MATLAB\R2009b 
---------------------------------------------------------------- 
->    Options file           = C:\Users\DELL\AppData\Roaming\MathWorks\MATLAB\R2009b\mexopts.bat 
      MATLAB                 = C:\PROGRA~1\MATLAB\R2009b 
->    COMPILER               = gcc 
->    Compiler flags: 
         COMPFLAGS           = -c -DMATLAB_MEX_FILE 
         OPTIMFLAGS          = -O3 
         DEBUGFLAGS          = -g 
         arguments           =  
         Name switch         = -o 
->    Pre-linking commands   =  
->    LINKER                 = C:\PROGRA~1\MATLAB\R2009b\sys\perl\win32\bin\perl.exe C:\users\dell\DOCUME~1\matlab\trunk\linkmex.pl 
->    Link directives: 
         LINKFLAGS           =  -LC:\Users\DELL\AppData\Roaming\MATHWO~1\MATLAB\R2009b\gnumex 
         LINKDEBUGFLAGS      = -g  -Wl,--image-base,0x28000000\n 
         LINKFLAGSPOST       =  
         Name directive      = -o isp_ifptrack_helper.mexw64 
         File link directive =  
         Lib. link directive =  
         Rsp file indicator  =  
->    Resource Compiler      = C:\PROGRA~1\MATLAB\R2009b\sys\perl\win32\bin\perl.exe C:\users\dell\DOCUME~1\matlab\trunk\rccompile.pl  -o mexversion.res 
->    Resource Linker        =  
---------------------------------------------------------------- 
 
 
--> gcc  -c -DMATLAB_MEX_FILE -oC:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj -IC:\PROGRA~1\MATLAB\R2009b\extern\include -IC:\PROGRA~1\MATLAB\R2009b\simulink\include -O3 -DMX_COMPAT_32 isp_ifptrack_helper.c 
 
 
--> C:\PROGRA~1\MATLAB\R2009b\sys\perl\win32\bin\perl.exe C:\users\dell\DOCUME~1\matlab\trunk\linkmex.pl -o isp_ifptrack_helper.mexw64  -LC:\Users\DELL\AppData\Roaming\MATHWO~1\MATLAB\R2009b\gnumex -s  C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj   
 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x37a): undefined reference to `mexErrMsgTxt' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x390): undefined reference to `mexErrMsgTxt' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x39a): undefined reference to `mxGetPr' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x3a8): undefined reference to `mxGetM' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x3b4): undefined reference to `mxGetN' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x3c1): undefined reference to `mxGetPr' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x3d0): undefined reference to `mxGetPi' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x3df): undefined reference to `mxGetM' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x3f3): undefined reference to `mexErrMsgTxt' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x3fe): undefined reference to `mxGetScalar' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x40d): undefined reference to `mxGetScalar' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x41c): undefined reference to `mxGetScalar' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x42b): undefined reference to `mxGetScalar' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x43a): undefined reference to `mxGetScalar' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x452): undefined reference to `mxCreateDoubleMatrix_700' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x468): undefined reference to `mxCreateDoubleMatrix_700' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x475): undefined reference to `mxGetPr' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x482): undefined reference to `mxGetPr' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x4fd): undefined reference to `mxGetN' 
C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj:isp_ifptrack_helper.c:(.text+0x520): undefined reference to `mexErrMsgTxt' 
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj: bad reloc address 0x20 in section `.eh_frame' 
collect2.exe: error: ld returned 1 exit status 
link command: gcc -shared C:\Users\DELL\AppData\Roaming\MATHWO~1\MATLAB\R2009b\gnumex\mex.def -o isp_ifptrack_helper.mexw64 -LC:\Users\DELL\AppData\Roaming\MATHWO~1\MATLAB\R2009b\gnumex -s C:\USERS\DELL\APPDATA\LOCAL\TEMP\MEX_18~1\isp_ifptrack_helper.obj -llibmx -llibmex -llibmat 
 
  C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of 'isp_ifptrack_helper.mexw64' failed. 
 
??? Error using ==> mex at 221
Unable to complete successfully.
solution:
  1. Install cygwin, search mingw64 and mark the mingw64 x86_64 gcc core module 
  2. replace mexopt.bat with: https://gist.github.com/1579415
source: https://dgleich.wordpress.com/2012/01/08/compiling-mex-files-with-mingw64/


Selasa, 27 Mei 2014

BOOTABLE USB Tidak bisa Jalan Saat Booting

Bootable usb berguna untuk menginstall operating system(os) tanpa menggunakan CD installer, cocok untuk netbook / laptop / pc yang tidak memiliki optical drive. ada banyak software untuk membuat bootable usb seperti yumi, xboot, universal usb installer, liveusb install, dll.
bagi anda yang menggunakan software yumi, xboot, universal usb installer, liveusb install, dll tetapi tidak berhasil pada saat booting atau hanya muncul blank screen, mungkin masalahnya terletak pada flaskdisknya, karena ada beberapa flaskdisk yang tidak support untuk menjadi bootable usb, coba untuk memformat flaskdisk anda menggunakan diskpart, langkahnya sbb:
buka cmd lalu ketik:
1. diskpart
2. list disk - temukan nomor disk untuk flaskdisk
3. select disk ? - ? = nomor usb drive agan cth: select disk 2 (hati2 jgn smpe salah)
4. clean 
5. create partition primary 
6. select partition 1 
7. active 
8. format fs=fat32
9. assign
10. exit
jalankan software bootable usb seperti biasa, lalu coba booting melalui flaskdisk yang telah terinstall.

Senin, 19 Mei 2014

Multi Label Blogspot Search

untuk kondisi: label1 & label2
[blog url]/search/?q=label:LABEL1+label:LABEL2

untuk kondisi: label1 or label2
[blog url]/search/?q=label:LABEL1|label:LABEL2

semoga bermanfaat

Sabtu, 02 Maret 2013

PHP: Last Three Days Of Month

Kemarin ada temen saya yang menanyakan bagaimana cara mencari 3 hari terakhir pada bulan dari tanggal yang di tentukan, setelah mencoba2 akhirnya ketemu juga solusinya..
- pertama cari dulu batas akhirnya atau first day of next month-nya:
//contoh data bulan dan tahun yang saya ambil dari fungsi time()
$t=explode('/',date('m/Y',time()));
//mencari first day of month menggunakan mktime dan strtotime
$firstDayNextMonth= strtotime("+1month",mktime(0, 0, 0, $t[0], 1, $t[1]));
- setelah itu cari batas awalnya:
//first day of last three days of month
$x = strtotime("-3day",$firstDayNextMonth);
//atau langsung seperti ini
$x= strtotime("+1month -3day",mktime(0, 0, 0, $t[0], 1, $t[1]));
sekian dan terimakasih :)

Selasa, 08 Januari 2013

Mengenal Metode MVC (Model-View-Controller)

MVC adalah Sebuah Metode Pengembangan Aplikasi dengan Membagi aplikasi menjadi 3 layer yaitu layer Model, Layer View, dan Layer Controller

  1. Layer Model adalah layer yang bertugas mengolah data atau memanipulasi data sesuai dari bisnis proses yang terjadi pada data tersebut.
  2. Layer View adalah layer yang merepresentasikan data dalam bentuk tampilan dan menuntun alur interaksi user terhadap aplikasi.
  3. Layer Controller adalah layer yang menghubungkan antara Layer Model dengan Layer View dan bertanggungjawab mengatur alur transisi antar kedua layer tersebut.

Berikut gambaran Metode MVC:


Selasa, 01 Mei 2012

implementasi datatables di codeigniter

menggunakan plugin datatables pada codeigniter kini semakin mudah, karena sudah ada library khusus codeigniter :))

asumsi :
- sudah install xampp
- sudah install codeigniter
-sudah install jquery
- sudah install file2 datatables di codeigniter

file yang dibutuhkan:
- library Datatables: datatables.php

berikut langkah2nya :
- buat database dan tabel beserta isinya. contoh saya membuat tabel obat:
- lalu set database name sesuai dengan nama database yang kamu buat di 'application/config/database.php

- buat file controller dgn nama misal 'testControl' dengan isi sebagai berikut:

<?php
 class testControl extends CI_Controller
 {
    function view_obat()
  {
   $this->load->view('view_obat');
  }
    function ajax_view_obat()
  {
   $this->load->library('Datatables');
   $this->datatables->from('obat');
   $this->datatables->select('kode_obat,nama_obat,kode_satuan,kode_supplier');
   echo $this->datatables->generate();
  }
 }
//end of file testControl


 - buat view dengan nama 'view_obat' dengan isi sbb:
<head>
 <script type="text/javascript" src="<?php echo base_url();?>lib/js/jquery-1.4.4.min.js"></script>
 <script type="text/javascript" src="<?php echo base_url();?>lib/js/jquery.dataTables.js"></script>
  <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>lib/css/demo_table_jui.css"/>
   <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>lib/css/demo_table.css"/>
</head>
<body>
 <h2>data obat</h2>
 <hr>
 <table id="tbl"  cellpadding="0" cellspacing="0" border="0" class="display" >
  <thead>
   <tr>
    <th>kode obat</th>
    <th>nama obat</th>
    <th>kode satuan</th>
    <th>kode supplier</th>
   </tr>
  </thead>
  <tbody>
   <tr>
    <td colspan="5" class="dataTables_empty">Loading data from server</td>
   </tr>
  </tbody>
  <tfoot>
   <tr>
   </tr>
  </tfoot>
 </table>
  <script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
   $('#tbl').dataTable( {
    "bProcessing": true,
    "bServerSide": true,
    'sPaginationType': 'full_numbers',
    "sAjaxSource": "<?=base_url()?>index.php/testControl/ajax_view_obat/",
    "aaSorting": [[ 0, "desc" ]]
   } );
  } );  </script>
 </body>
- dan hasilnya sebagai berikut:

- selesai, selamat mencoba :))