Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • CG 11:14 pm on July 27, 2013 Permalink | Reply
    Tags: macbook pro, ,   

    Snow Leopard vs Mountain Lion 


    I owned a White Macbook for more than 5 years, and feeling very happy using Leopard and then upgrading to Snow Leopard. After enduring a phd saga for 5 years, the Macbook’s casing started to crack here and there, and then I decided to give it to cadet#1 so that it can stay at home and hopefully will stop cracking.

    I got myself a new MacBook Pro with Mountain Lion (Mac OS X 10.8.4), 2.5GHz Intel Core i5, 4GB 1600MHz DDR3. At first I was astonished with new things that Mountain Lion offers like more finger gestures, mission control, side notifications etc. But after a few days I started to realize that Mountain Lion is not as snappy and as responsive as Snow Leopard.

    Mountain Lion takes several seconds after hibernation to be ready to accept password while Snow Leopard will accept it right away as I open the lid. After several days without restarting the OS, Mountain Lion will acting so slow while Snow Leopard works fine for weeks without being restarted. And when I open lots of tabs on the browser, or firing up web and database server, Mountain Lion sluggishness will acting up again.

    Lots of people have been complaining about Mountain Lion, and they also say that Snow Leopard is the best Mac OS. So what to do? Downgrading?

    This link gives 12 reasons why Mac runs slow with Mountain Lion, and one thing I definitely would do is upgrading the RAM. There are more tips here. I will write some report after I find more ways on how to deal with the sluggish Mountain Lion.

    *Update: Everybody is suggesting to upgrade to SSD and highest possible RAM. Ok will do it. This is a useful link about how to install and additional SSD drive.

    • Wildan 1:14 am on July 28, 2013 Permalink | Reply

      My old MBP Core 2 Duo with SSD still fast on Mavericks DP 🙂
      Upgrade to SSD and 16 GB RAM 😀

    • waskita 5:26 am on July 28, 2013 Permalink | Reply

      This is 2012. Please use SSD and maximum possible RAM.

    • CG 9:39 am on July 28, 2013 Permalink | Reply

      have just updated the post and saved a link about upgrading to SSD. thx all.

    • aya 9:58 pm on August 27, 2013 Permalink | Reply

      Can you help mee with this lease ?? Use Verilog HDL to design a 2-bit comparator using 2×4 decoders and any gates required.

    • aya 1:19 am on August 28, 2013 Permalink | Reply

      Can you help me with this please ?? Use Verilog HDL to design a 2-bit comparator using 2×4 decoders and any gates required.

  • CG 12:27 pm on July 19, 2013 Permalink | Reply
    Tags: CodeIgniter, MAMP,   

    Installing MAMP and CodeIgniter on Mountain Lion 

    Installing MAMP:

    1. Download MAMP at Once the .dmg file is downloaded, double click on it if it did not unzip itself. Than drag the MAMP folder into Applications folder.
    2. From Application folder, double click MAMP program and click “Start Servers”. At this point the web server, database server and application server has been activated on your Mac.Screen Shot 2013-07-18 at 1.47.28 PM
    3. If you click Open Start Page, MAMP will show you the MAMP Page on your local webserver (http://localhost:8888/MAMP)
    4. For more details on installing and MAMP setting up, read more here.

    Installing CodeIgniter:

    1. Download CodeIgniter here.
    2. Unzip CodeIgniter by double-clicking it.
    3. Rename CodeIgniter folder into “ci” (this is the common practice).
    4. Copy the folder to the PHP and mySQL enabled server, which is, in this case is in Applications/MAMP/htdocs
    5. Configure system/application/config/config.php by adding $config[‘base_url’] = “http://localhost/ci/”;
    6. Go to http://localhost/ci/Screen Shot 2013-07-18 at 1.47.09 PM
    7. More about getting started with CodeIgniter here
    • aya 9:58 pm on August 27, 2013 Permalink | Reply

      Can you help me with this lease ?? Use Verilog HDL to design a 2-bit comparator using 2×4 decoders and any gates required.

    • aya 1:19 am on August 28, 2013 Permalink | Reply

      Can you help me with this please ?? Use Verilog HDL to design a 2-bit comparator using 2×4 decoders and any gates required.

    • Victor 3:16 am on May 20, 2014 Permalink | Reply

      Above it says to add $config[‘base_url’] = “http://localhost/ci/”; are there suppose to be 2 semicolons?

    • Victor 3:24 am on May 20, 2014 Permalink | Reply

      I received and error after following your instructions and adding:
      $config[‘base_url’] = “http://localhost/ci/&#8221”;

      The error reads..

      Not Found

      The requested URL /CI was not found on this server.

    • akmalfikri 10:25 am on March 28, 2015 Permalink | Reply

      @Victor : Remove &#8221 in your $config[‘base_url’]

  • CG 10:24 pm on May 24, 2013 Permalink | Reply
    Tags: BCH code, cyclic code, digital system, , hamming code, , linear block code, , quad tree, reed muller   

    Principles and Analogies of Error Correction Codes 

    I use a very abstract visual way to explain about different error correction algorithms. Here I will over-simplify every algorithm and then use visualizations instead, just to get the principle of how they works, and why.

    Linear Block Code

    In linear block code, every codewords will have n-k bits of redundant checkin part, and k-bits of message.

    Linear Block Code

    The generator matrix would look like this, where there is some identity matrix in it, that later will be used to generate syndrome to identify errors.

    Linear Block Code Table

    Hamming Code
    The picture below shows how to identify error with even parity bits. The bits in black is the message, the bits in green is the parity to make sure that the number of 1 in a circle is even, the bit in red is the error, that later can be identified because the overlapping circle area will show where the error occur.

    Hamming Code Diagram

    The Hamming Code works like shown by the table below, the parity bits (unlike the previous method) are inserted in certain positions (2^0, 2^1, 2^2 and 2^3) to make sure that each of every 4 bits of message is being screened so that later the error can be tracked.

    Hamming Code Table

    Cyclic Code

    This is my favorite. This method use the characteristic of polynomial in GF(2^n). So that identifying errors can be done by divide the codeword with the generator g(x). If the result is not 0, there is an error. Another thing that I like from this method is that every codeword is a shift from previous codeword (that’s why this method called “cyclic”) . So the implementation will be very easy, just shifting here and there (using LFSR), which in hardware implementation, is “costless”.

    Cyclic Code Table

    BCH Code

    This method is a little bit complicated but the point is, to make a matrix H so that this matrix can screen out every bits (that’s why there are 2 rows that are linearly redundant).

    BCH Code
    Reed Muller

    This one is interesting. This method has orders to identify different number of errors. Look at the matrix below. R(1,3) means that the order is 1 and the message length is 3. In Reed Muller, the pattern is obvious. Each vector in the matrix (x1, x2, x3) are used to search the location of error in convergence. Each row will direct the algorithm to a smaller space of error possibility location.
    Reed Muller 1
    For R(2, 3), we have the same number bits of message, which is three, but this time in order 2. Means that the matrix will be expanded and thus, more error can be detected. The part of matrix in yellow is the “basic” vectors, while the green shows the “additional” vectors to help allocating more errors.

    Now look at R(3,3). More rows of the matrix, and more errors to be detected.

    Reed Muller 3

    So oversimplifyingly, I can say that error correction code, in principle, how to encode a message (to be a codeword) to get through a channel (error correction code is in domain channel coding, while data compression is in domain source coding) so that we would be able to make the message reliable (while in source coding, the target is not reliability but efficiency), by making sure that we can locate error and fix it. And the way to decode is like the illustration of quadtree below. The methods will generate matrix, or equations, or mathematical characteristic (polynomial groups etc) to help to narrow down the search space.


    Hopefully this article can be useful, I will teach Reed Solomon Code next week, and let’s see if I can add up more things here, or publish a new blogpost.

  • CG 7:07 pm on April 30, 2013 Permalink | Reply
    Tags: Erlang   

    Hello World – Erlang 

    The easiest way to install Erlang on MacOS is by downloading the .dmg of Erlang here. And then you will get Erlang installed.

    Screen shot 2013-04-30 at 3.23.01 PM

    And here’s the example of Hello World using Erlang.

    Screen shot 2013-04-30 at 6.56.01 PM

    Useful Links:

  • CG 9:17 pm on March 30, 2013 Permalink | Reply
    Tags: arithmetic, , , reduction,   

    Polynomial Basis Squaring 

    Finally have successfully found some spare time to do coding to solve this polynomial squaring:


    And this is the result, x^5 + x + 1 :

    Screen shot 2013-03-30 at 8.58.52 PM

    • rudi 9:37 pm on May 30, 2013 Permalink | Reply

      bu, akan lebih cantik kalo nulis polinomnya pake latex,
      x^5 + x+1

      • CG 11:00 am on May 31, 2013 Permalink | Reply

        iya belum sempet dirapihin 😀 biasanya saya pake latex for wordpress

    • Akshay 11:18 pm on July 26, 2013 Permalink | Reply

      Hey please mail me this complete C code. sorry I’m not execute this ….please help me…please ..

  • CG 2:07 pm on March 15, 2013 Permalink | Reply  

    Why Python? 

    Our research group is developing a library for finite field operations on very long bits, so we start gathering information about the performance of Python on scientific programming, big numbers especially for cryptography.
    Here are some important links related to Python for scientific and cryptography implementation:

    1. – about Python number representations
    2. – a module for implementing Elliptic Curve Cryptography
    3. – Python compared to C
    4. – the use of Python for scientific computing
    5. – Python Scientific Lecture Notes
    6. – Scientific Computing with Python
    7. – list of modules and tools for various implementation in Python
    8. – Python power for large numbers
    9. – handling big numbers with Python
    10. – library for big numbers in Python
    11. – Python can handle very big numbers
    12. – Elliptic Curve Cryptography implementation on S60 using Python
    13. – Elliptic Curve Cryptography implementation in Python
    • Tafta 5:08 pm on March 16, 2013 Permalink | Reply

      The title doesn’t match the content, please dech (pake helm biar ga ditampar)

      • CG 7:27 pm on March 16, 2013 Permalink | Reply

        *tempiling sampe kepalanya lepas*

  • CG 12:40 pm on March 8, 2013 Permalink | Reply  

    Python: Converting String to Binary 

    A simple code on how to convert string to binary, accessing array string and performing shift operation on binary


    a_str = ‘10110011’
    b_str = “00101010”
    a_bin = int(a_str, 2)
    b_bin = int(b_str, 2)

    print “a “, int(a_bin), a_str
    print “b “, int(b_bin), b_str
    print “a[0] “, a_str[0]
    print “b[0:3]”, b_str[0:3]

    #print “c “, c, bin(c)[2:]

    print “a << 2 “, a_bin << 2, bin(a_bin << 2)[2:]
    print “b >> 2 “, b_bin >> 2, bin(b_bin >> 2)[2:]

    The result:

    Screen shot 2013-03-08 at 12.37.48 PM

    • tinykuya 3:02 pm on March 15, 2013 Permalink | Reply

      ternyata dari string diconvert dulu ke int, terus diconvert lagi ke binary.. ya ya ya.. saya sempat berpikir operasi binernya dalam bentuk array 😀 kalau seperti ini, masuk akal.

      terima kasih bu.

      • CG 3:55 pm on March 15, 2013 Permalink | Reply

        sip mudah2an berguna 😉

  • CG 3:32 pm on March 7, 2013 Permalink | Reply
    Tags: bit operations,   

    Python: Bit Operations 

    Basic bit operations in Python:

    a = 60            # 60 = 0011 1100 
    b = 13            # 13 = 0000 1101 
    c = 0
    print "a = ", (bin(a)[2:]);
    print "b = ", (bin(b)[2:]);
    c = a & b;        # 12 = 0000 1100
    print "a & b = ", (bin(c)[2:]);
    c = a | b;        # 61 = 0011 1101 
    print "a | b = ", (bin(c)[2:]);
    c = a ^ b;        # 49 = 0011 0001
    print "a ^ b = ", (bin(c)[2:]);
    c = ~a;           # -61 = 1100 0011
    print "~a = ", (bin(c)[2:]);
    c = a << 2;       # 240 = 1111 0000
    print "a <> 2;       # 15 = 0000 1111
    print "a >> 2 = ", (bin(c)[2:]);

    Screen shot 2013-03-07 at 3.28.10 PM

    An interesting link about bit operation algorithm implementation in Python is here.

  • CG 2:15 pm on February 26, 2013 Permalink | Reply
    Tags: coding theory,   

    Crypto vs Code 

    Cryptography is the study of mathematical techniques related to aspects of information security such as confidentiality, data integrity, entity authentication, and data origin authentication. [Handbook of Applied Cryptography – Alfred J. Menezes Paul C. van Oorschot Scott A. Vanstone]

    crypto block diagram

    Coding is needed for efficient reliable digital transmission and storage. [Error Control Coding – Shu Lin, Daniel J. Costello]. Coding theory is is the study of the properties of codes and their fitness for a specific application. Codes are used for data compression, cryptography, error-correction and more recently also for network coding. Codes are studied by various scientific disciplines—such as information theory, electrical engineering, mathematics, and computer science—for the purpose of designing efficient and reliable data transmission methods. This typically involves the removal of redundancy and the correction (or detection) of errors in the transmitted data. [Wikipedia]

    coding block diagram

  • CG 5:41 pm on January 8, 2013 Permalink | Reply
    Tags: review   

    2012 in review 

    The stats helper monkeys prepared a 2012 annual report for this blog.

    Here’s an excerpt:

    4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 18,000 views in 2012. If each view were a film, this blog would power 4 Film Festivals

    Click here to see the complete report.

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc