Updates from ibnuyahya RSS Toggle Comment Threads | Keyboard Shortcuts

  • ibnuyahya 3:08 pm on April 25, 2012 Permalink | Reply
    Tags: , optimization   

    MYSQL GROUP BY very slow 

    I had this problem in one of my project. Currently, we have more than 1 million data per user especially for the log file table. This huge data affecting our stats reporting and become slow and take too long to load the stats.

    Anywhere, I manage to overcome this issue and just want to share what I found during the optimization. There is trick you can use to optimize your query with GROUP BY statement.

    We start with normal query as below. Both query do the same objective. I just want to see if there any performance impact when I use MONTH and YEAR function in WHERE clause compared to BETWEEN … AND … for the DATETIME selection.
    (More …)

     
    • ibnuyahya 11:03 am on April 20, 2012 Permalink | Reply  

      php convert stdClass to Array 

      You can use this function to convert stdClass to Array

          function objectToArray($d) {
              if (is_object($d)) {
                  // Gets the properties of the given object
                  // with get_object_vars function
                  $d = get_object_vars($d);
              }
      
              if (is_array($d)) {
                  /*
                  * Return array converted to object
                  * Using __FUNCTION__ (Magic constant)
                  * for recursive call
                  */
                  return array_map(__FUNCTION__, $d);
              }else {
                  // Return array
                  return $d;
              }
          }
       

      and this function to convert Array to stdClass
      (More …)

       
      • Elijah1475 3:43 pm on April 23, 2012 Permalink | Reply

        Hi there would you mind sharing which blog platform you’re working with? I’m planning to start my own blog soon but I’m having a tough time making a decision between BlogEngine/WordPress/B2evolution and Drupal. The reason I ask is because your design and style seems different then most blogs and I’m looking for something completely unique. P.S My apologies for getting off-topic but I had to ask!

        • ibnuyahya 3:53 pm on April 23, 2012 Permalink | Reply

          Hi

          I’m using WordPress with P2 theme. Anywhere, all blog platform you mentioned does support custom theme. You can make your own unique theme.

    • ibnuyahya 12:24 pm on April 3, 2012 Permalink | Reply
      Tags:   

      esolat jakim 

      Memandangkan banyak permintaan untuk dapatkan jadual waktu solat sepanjang tahun, maka saya sediakan class e-solat jakim yang baru yang lebih elegen. Class baru ini membolehkan korang dapatkan jadual waktu solat mengikut hari, bulan dan keseluruhan tahun. Walaubagaimanapun, kod e-solat jakim yang lama masih lagi berfungsi.

      From ibnuyahya.com

      (More …)

       
    • ibnuyahya 5:44 pm on March 29, 2012 Permalink | Reply  

      codeigniter malaysia & fuelphp malaysia 

      saje je..

      codeigniter malaysia

      CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you’re a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you’re tired of ponderously large and thoroughly undocumented frameworks

      Lalalala : codeigniter , malaysia, fuelphp, CI, oil, reactor

      fuelphp malaysia

      FuelPHP is a simple, flexible, community driven PHP 5.3 web framework based on the best ideas of other frameworks with a fresh start

      fuelphp, CI, oil, reactor, codeigniter , malaysia

      (More …)

       
      • ibnuyahya 12:28 pm on March 22, 2012 Permalink | Reply
        Tags: git   

        git : tagging 

        Tagging merupakan salah satu ciri yang penting bagi saya ketika menggunakan source controll seperti subversion atau git. Saya agak baru dengan environment git berbanding subversion. Git kelihatan sangat barguna jika kita bekerja diluar lingkungan akses ke source control server disebabkan kita boleh commit ke local copy/clone sebelum push ke server. Berbeza dengan subversion, kita perlu sentiasa commit ke server. Jika tiada akses ke server, maka kita tidak boleh commit dan create source version pada setiap perubahan pada kod kita.
        (More …)

         
        • ibnuyahya 11:22 pm on March 13, 2012 Permalink | Reply
          Tags: , multiton   

          php design pattern : multiton 

          Sama seperti singleton, tetapi ditambah dengan map nama instance sebagai key-value. Sangat berguna jika anda ingin menyediakan fungsi multi-database connection, sebagai contoh.. anda ingin membuat connection ke mysql dan mongodb didalam satu aplikasi. Dengan multiton, anda boleh membuat instance yang berbeza bagi setiap database.

          (More …)

           
          • ibnuyahya 11:11 pm on March 13, 2012 Permalink | Reply
            Tags: , singleton   

            php design pattern : singleton 

            Singleton memastikan hanya satu instance sahaja dijalan bagi satu class.
            (More …)

             
            • ibnuyahya 9:23 pm on March 4, 2012 Permalink | Reply
              Tags:   

              bukit saga : trek a, ceupac , waterfall dan trek c 

               
              • ibnuyahya 10:30 pm on March 3, 2012 Permalink | Reply
                Tags: cakephp   

                jom belajar cakephp 

                Harini aku join Free Course: Introduction to CakePHP anjuran altfa solution . Really nice course, di ajar oleh dua orang sifu cake iaitu sifu Hizam Mohd dan sifu Jasdy Syarman . Memandangkan tajuk course pun Introduction to CakePHP, memang bersesuaian dengan pembentangan yang disampaikan dan sangat sesuai jika korang nak belajar CakePHP.
                (More …)

                 
                • ibnuyahya 10:28 pm on February 29, 2012 Permalink | Reply  

                  nginx equilvalent of Wamp/Mamp? 

                  If you are looking for equilvalent of wamp or mamp for nginx, you should try mnpp ( Mac + Nginx + Percona + PHP or Python ) . This is the only one-click installer for nginx I ever seen so far. If you found any other one-click installer for nginx, feel free to share with us.
                  (More …)

                   
                  c
                  compose new post
                  j
                  next post/next comment
                  k
                  previous post/previous comment
                  r
                  reply
                  e
                  edit
                  o
                  show/hide comments
                  t
                  go to top
                  l
                  go to login
                  h
                  show/hide help
                  shift + esc
                  cancel