Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • CG 6:32 pm on March 22, 2015 Permalink | Reply  

    Fixing Java that cannot be re-installed after being uninstalled 

    One of our computer,  on 64-bit Windows 7,  being used for Minecraft programming using CanaryMod and Scriptcraft so the coding can be done in JavaScript, having troubles after we did so much modding so we had to uninstall the (32-bit) Java.

    The problem was that Java could not be reinstalled because the uninstalling process was not clean so that Java files were still in the registry, made the Java installer thought that Java was already installed.

    We have download like ten registry cleaner software, tried 3 or 4 of them but the problem remained. Until we find a very useful ilnk that finally made the installation work.

    The trick is to type <pre><code>regedit</code/</pre> on Windows start menu and then find any folder contains Java on the folder under <pre><code>HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INSTALLER\PRODUCTS</code></pre>. This is a bit tedious but it is totally worth it :D

    After that delete these to folder:

    <pre><code>HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment</code></pre>

    <pre><code>HKEY_LOCAL_MACHINE\SOFTWARE\wow6432node\JavaSoft\Java Runtime Environment</code></pre>

    and then all will be set and the installation will be done just fine.

     
  • CG 1:39 pm on February 26, 2015 Permalink | Reply
    Tags: , queue, rabbitmq   

    Installing RabbitMQ on MacOS 

    1. Download RabbitMQ for Mac here
    2. Download Java AMQP client library here
    3. Start RabbitMQ server by running ./rabbitmq-serverBildschirmfoto 2015-02-26 um 11.10.15 vorm.
    4. Check that the server is running properly with ./rabbitmqctl statusBildschirmfoto 2015-02-26 um 11.10.51 vorm.
    5. Compile and run a HelloWorld testing program from the tutorial here. Compile the Send.java and Recv.java files with javac -cp rabbitmq-client.jar Send.java Recv.java. Run Send.java with java -cp .:commons-io-1.2.jar:commons-cli-1.1.jar:rabbitmq-client.jar Send. This will send the message (in this case the message is “Hello World!”) to the queue. And then run Recv.java with java -cp .:commons-io-1.2.jar:commons-cli-1.1.jar:rabbitmq-client.jar Recv to pop out the message on the queue.Bildschirmfoto 2015-02-26 um 11.08.05 vorm.
    6. The server and the queues can also be checked via browser http://localhost:15672/Bildschirmfoto 2015-02-26 um 11.09.31 vorm. Bildschirmfoto 2015-02-26 um 11.08.41 vorm.

    Now the queue is ready.

     
    • Budi Rahardjo 8:20 am on February 28, 2015 Permalink | Reply

      On Linux (I know, it’s not Mac OS X :) ) there’s “amqp-tools”. Install it with “apt-get install amqp-tools”. You’ll get five (5) command line tools. For example if you want to publish something:

      amqp-publish -e exchange_name -b “your message”

      To get a message from a queue:

      amqp-get -q queue_name
      or
      amqp-consume -q queue_name

      I believe these tools are built with rabbitmq-c library. Having said that, I looked at the newer version of rabbitmq-c library in here:
      http://alanxz.github.io/rabbitmq-c/docs/0.5.0/index.html

      It has a number of different tools. Perhaps they changed (upgraded?) the library? I have not looked deeper into it. Basically, it is a C library that you can use to create command line tools. I looked at one of the code, and hardcoded the userid dan password in it so I can use something like this.

      amqp_sendstring localhost 5672 amq.direct test “hello world”

      I have tested amqp-tools and this rabbitmq-c library agains locally installed rabbitmq server. They work!

    • Budi Rahardjo 8:37 am on February 28, 2015 Permalink | Reply

      And now for some clients. I have tested Perl Net::RabbitMQ. Getting it running is easy.

      Publishing message(s) works perfectly, but I am still having problems getting one (1) message from the queue. For some reasons, I got *all* the messages from the queue. ie. get and consume behave the same. I need to tinker some more with the get.

      I haven’t had time to play with Python and Java clients.

  • CG 7:55 pm on January 3, 2015 Permalink | Reply
    Tags: ant, canarymod, , minecraft, mods, scriptcraft, yosemite   

    How to run Minecraft on Mac OS X Yosemite 10.10.1 

    I got this message when running Minecraft on Yosemite, and when I googled I found that this is common problems.

    Bildschirmfoto 2015-01-03 um 7.27.35 nachm.

    Some references say that the latest JDK should be installed while the earlier ones should be uninstalled. I have uninstalled the earlier and installed the latest JDK but the problem persisted.

    So I followed this reference to make it work.

    These are the steps:Install ant

    1. Download Java Application Bundler
    2. Download Minecraft.jar from here *after clicking “Show all platforms” and choose that one under “Linux and Other
    3. Create a file named build.xml and type this code in
      Bildschirmfoto 2015-01-03 um 7.22.29 nachm.
    4. Organize my file like this
      Bildschirmfoto 2015-01-03 um 7.21.13 nachm.
      *Notes: at this point, the dist folder is empty, it will contain Minecraft.app after I run ant command*
    5. Open terminal and run ant like this
      Bildschirmfoto 2015-01-03 um 7.21.56 nachm.
    6. Now the dist folder will contain Minecraft.app in it. Move it to Applications folder

    And it works!

    Bildschirmfoto 2015-01-03 um 7.17.19 nachm.

    Bildschirmfoto 2015-01-03 um 7.23.56 nachm.

    Bildschirmfoto 2015-01-03 um 7.24.02 nachm.

    My next step is to make canarymod and scriptcraft work to make mods on Minecraft. Wish me luck.

     
  • CG 11:03 pm on May 24, 2014 Permalink | Reply
    Tags: convolutional code, , , trellis diagram, viterbi   

    Convolutional Code 

    Unlike block codes, convolutional codes does not send the message followed by (or interspersed with) the parity bits. In a convolutional code, the sender sends only the parity bits.

    The encoder uses a a sliding window to calculate r > 1 parity bits by combining various  subsets of bits in the window. The size of the window, in bits, is called the code’s constraint length. the longer the constraint length, the larger to number of parity bits that are influenced by any given message bit. Because the parity bits are the only bits sent over the channel, a larger constraint length generally implies a greater resilience to bit errors. The trade-off is that it will take more time to decode codes for more constraint length.

    If a convolutional code that produces r parity bits per windows and slides the window forward by one bit at a time, its rate is 1/r. The greater the value of r, the higher the resilience of bit errors, but the trade-off is that a proportionally ginger amount of communication bandwidth is devoted to coding overhead. In practice, it is more commen to pick 4 and the constraint length to be as small as possible while providing a low enough resulting probability of a bit error.

    This is an example of a convolutional code with rate 1/2:
    r 1:3

    This is a systematic 1/3 encoder:
    1:3

    And this is a 2/3 encoder:
    trelis-diagram

    To make the convolutional code able to cope with more errors, it is not by changing the k or n (r = k/n). But by adding more memory inside the encoder (the square with D letter). Notes that all the circles with plus symbol (or the xor process) is the generator functions to determine each output. It works just like other generator of other error correction codes.

    This is the Trellis Diagram of the first convolutional code:
    2:3

    Trellis Diagram is a graph whose nodes are ordered into vertical slices (time), and with each node at each time connected to at least one node at an earlier and at least one node at a later time. The earliest and latest times in the trellis have only one node.

    This diagram gives “spatial” and “temporal” information about the code. “Temporally” it shows the state on each t while “spatially” it shows every possible route defined by the encoder design. Later, the decoding would be done by comparing the received “route” with the “most likely route” to track down the error and then correct it.

    Viterbi is a scheme for decoding, using maximum likelihood decoding that set up a threshold to check the “route” with the “deviated route”.

    References:

    1. MIT 6.02 DRAFT Lecture Notes, Fall 2010 (Last update: October 4, 2010)
    2. http://en.wikipedia.org/wiki/Trellis_(graph)
    3. “Error Control Coding”, Shu Lin and Daniel J. Costello
     
  • CG 4:06 pm on January 26, 2014 Permalink | Reply
    Tags: business, , economy, price elasticity   

    Amdahl’s Law and Price Elasticity 

    I have just noticed that Amdahl’s Law used in measuring processor performance is similar with the Price Elasticity Law (I read from the book “Starbucks (Corporations that Changed the World) – Marie Bussing-Burks”) in economic concepts.

    The same principle is that there is a limit in increasing processing performance to get more throughput, or to rephrase it in business language: there is a limit in reducing price of an item to get more revenue.

    Amdahl’s Law says that speedup is how a machine performs after enhancement. A SpeedUp(E) = Performance with E / Performance without E = Execution time without E / Execution time with E. Execution time = Execution time unaffected + (Execution time with E / Amount of improvement).

    (Notes: Examples is taken from EL 2244 Course being taught at ITB this semester. The reference book is John L. Hennessy and  David A. Patterson , Computer Organization and Design: The Software Hardware Interface, Morgan Kaufmann Publishers, 4th Edition, 2009.)

    Ex. 1:

    A program runs in a machine in 10s. 50% of the time is doing multiplications. If we improve the multiplication unit so it runs twice as fast, how big is the speed up?

    Answer:

    Exec_time(E) = (Affected_exec_time/improvement) + unaffected_exec_time

    = (5s/2) + 5s = 7,5 s

    Speed_up(E) = 10s/7,5s = 1,333  which is not 2 times faster

    Ex. 2:

    A program runs for 10s. 70% of the time is doing additions. How much improvement on the additions if we want to reduce the running time to 3s?

    Answer:

    Exec_time(E) = (Affected_exec_time/improvement) + unaffected_exec_time

    3s = (7s/n) + (10-7)s

    3s = (7s/n) + 3s

    0 = 7s/n

    No amount of improvement can reduce the running time to 3s.

    Now let’s see the Price Elasticity Law. Price Elasticity (E) = % change in quantity demand / % change in price.

    Ex 1:

    If we reduce the price of 36 inch TV from $450 to $400, the average price would be $425. The absolute value of percentage change = $50/$425 = 0.118. Number of unit sold is increased from 200 to 300 so the average number of unit sold = 250.

    So the percentage  of change in quantity demand is 100/250 x 100% = 40%.

    The price elasticity = 0.4/0.118 = 3.39%

    If the absolute value of price elasticity is between 0 – 0.99, demand is inelastic. Necessity items like coffee, milk, gasoline, prescription drugs are tend to be relatively insensitive to price change.

    Ex 2:

    A store manager drops the price of a gallon of milk from $4 to $3. The average price will be $3.5. The absolute value of % change = $1/$3.5 = 0.29

    Milk sold going from 10 to 11. The average number of gallon sold = 10.5. Percent of change in quantity demand = 1/10.5 = 0.1.

    Price elasticity = 0.1/0.29 = 0.34. The demand is inelastic.

    So if demand is elastic, a price cut will increase total revenue (and an increase in price will mean lower total revenue). If we take Ex 1:

    price x quantity = total revenue

    $450 x 200 = $90,000

    $400 x 300 = $120,000

    While when demand is inelastic, a price cut will decrease total revenue. As in Ex 2:

    $4 x 10 = $40

    $3 x 11 = $33.

    The conclusion is that in terms of machine performance and total revenue, there is a limit to get “improvement”. There is a certain point that we cannot further improve the speed of a machine as well as there is a certain point that we cannot change price to get more total revenue.

     
  • CG 11:44 pm on January 10, 2014 Permalink | Reply
    Tags: channel coding, error correction, , reed solomon   

    Reed Solomon – A Brief Introduction 

    Reed Solomon is one brilliant error correction method that is a non-binary cyclic codes. The codeword looks like the picture below. It has symbols in m-bits. The bit string is treated as a group of bits. The group of bits is treated as non-binary. We will see how it makes this method powerful.

    Reed Solomon

    Let’s take an example of RS(15,11). This means that we have the codeword with length 15 bits that consists of original message 11 bits  and 4 bits for parity. t is how many errors (in symbols or group of bits) that can be corrected.

    p(x) or irreducible polynomial is used to generate the finite field like shown in the table below.

    RS(15,11)

    Now we need a generator to start the encoding process.

    Generator

    RS Encoding Process 1

    RS Encoding Process 2

    RS Encoding Process 3

    The process of decoding includes several steps. Let’s take an example of double-symbol error.

    RS Decoding

    The first process is computing the syndrome to detect the error. For this case will have 4 syndromes: S1, S2, S3 and S4. Each S that is not equal to 0 contains error.

    RS Syndrome Computation

    The second step is locating the error in e(x). This can be done using matrix.

    RS Error Locating

    After the location has been determined, now it is the time to calculate the values of the error so we can correct the error.

    RS Error Values

    Done. We get the message corrected. Do you notice that detecting the errors in symbols (groups of bits) in this method makes it runs faster?

     
  • CG 11:42 am on January 1, 2014 Permalink | Reply  

    2013 in review 

    The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

    Here’s an excerpt:

    The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 17,000 times in 2013. If it were a concert at Sydney Opera House, it would take about 6 sold-out performances for that many people to see it.

    Click here to see the complete report.

     
  • CG 8:51 pm on October 3, 2013 Permalink | Reply
    Tags: xcode phonegap nodejs cordova   

    PhoneGap – Getting Started using Xcode 

    1. Download and install NodeJS and PhoneGap
    2. Type this in Terminal: (make sure you have a stable internet connection because this will affect the generation of the code like missing libraries, invalid structures of directories etc.)
      Screen Shot 2013-10-03 at 7.35.52 PM
      You have to do this project creating and building on command prompt because in later versions of XCode, they do not give you to choose Cordova application or PhoneGap application when you start a new project like shown in this picture:
      Screen Shot 2013-10-03 at 8.55.02 PM
    3. Find the .xcodeproj and run it (it will be opened automatically in XCode)
      Screen Shot 2013-10-03 at 7.39.28 PM
    4. And then Run the project (by pressing the button on the top left) and you will get this
      Screen Shot 2013-10-03 at 7.49.22 PM
      You can modify the index.html or .js scripts and see how they look in simulator.An error usually occurs (the error message would be “index.html not found” when there is no index.html in www directory or the structure of the directory is not like shown below.Screen Shot 2013-10-03 at 7.59.58 PM

    Note:

    1. The version I’m using is Xcode 5.0, iOS Simulator 6.1, PhoneGap 2.9.0 and node.js v0.10.20. Running on Mountain Lion 10.8.5
    2. If you are using different versions in either of one of them, the result might be slightly different
     
    • Ripiu Info 9:29 am on December 5, 2013 Permalink | Reply

      Which one do you recomend, phonegap or native ios for newbie like me ?

    • www.hubmesh.com 11:27 pm on June 25, 2014 Permalink | Reply

      Many thanks for every other useful website. The place altogether different may possibly I receive that kind of information coded in a very perfect means? I’ve got a mission i’m right now operating upon, so i are actually with the be aware of similarly info.

    • Collum 9:22 pm on July 1, 2014 Permalink | Reply

      whoah this web site is usually amazing i like reading your content. Maintain the great work! You know, many men and women want circular with this info, you are able to encourage them to enormously.

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

    Snow Leopard vs Mountain Lion 

    P6150171

    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 :D

    • 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  http://mamp.info/en/. 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/&#8221;;
    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’]

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
Follow

Get every new post delivered to your Inbox.

Join 33 other followers