Upgrading iPhone to iOS 4 via VirtualBox Failed!??

You tried to upgrade your iPhone to iOS 4 via a virtual Windows machine running on VirtualBox, you then saw an error message said upgrading failed! What to do now???

Don’t panic! Take a look at the “USB” device icon on the bottom right corner, has your iPhone connected to the virtual machine? Yea, that’s the problem! You have to connect your iPhone several times during the while process. Just pay attention to that tiny icon, that’s it!

Posted in Troubleshooting | Tagged , , | Leave a comment

Number to Word

10 = deca

100 = hecto

1,000 = kilo

1,000,000 = mega

1,000,000,000 = giga

1,000,000,000,000 = tera

1,000,000,000,000,000 = peta

1,000,000,000,000,000,000 = exa

1,000,000,000,000,000,000,000 = zetta

1,000,000,000,000,000,000,000,000 = yotta

via

Posted in Fun | Tagged | 1 Comment

Disable Bell in VIM

" Disable both beep and visual flash
set visualbell t_vb=

via

Posted in Linux, Programming | Tagged | Leave a comment

Nothing Could Fail in C

Best comment of the C programming language ever!

via:reddit

Here is the whole story:

Going back to C
by buddhabrot

When I was 12 someone gave me a Metrowerks IDE to learn programming on my mac. I learned a lot with it, and got programming in C. I never really wrote a large program in it, only things like ROM hacks that extracted levels and models from snes/psx games I liked. Later, I got a windows PC and messed around with MFC in C++. That was the end for me, programming UI’s was too much work in C++ and I couldn’t handle the encyclopedic knowledge needed to program the Microsoft framework.

Later, I learned Java, which was also the language most commonly in my college. Making UI’s was a blast with it, I could factorize anything and really loved making as generic code as possible with it, even for small projects. Everything I made was made in Java.

Later in uni, I started learning functional languages, we used Haskell in one class. I got intrigued with Haskell and started solving Euler problems, up to this day I still have not written anything useful in Haskell but I love using it.

In the mean time I did some jobs for writing web sites. I used perl and php. After a while I only used php and used it more frequently.

After working for a while as a programmer I started to love higher-level languages, most of all Ruby. I became convinced that higher-level interpreted languages were the future because the slower execution times were to become meaningless. For any web projects I started using Ruby on Rails and to this day it still is my favourite framework.

Then, I learned Erlang because everyone was talking about it, and it showed me how to unleash parallellization, in whole new ways. I still think Erlang is the most amazing language I have ever seen. But then I found out it was also rather slow for the things I had in mind with it. I just didn’t find any use for it and never completely learned the language.

Last week I wanted to make a big poster of a fractal. I wanted to compute it on a friend’s octocore, and write a fast parallellized program. At first, I used Ruby, thinking it would perform better than I thought. And I quickly abandoned the idea because it was too slow.

Then I rewrote the same single-threaded algorithm in Haskell and saw that it was much, much quicker. But when I tried to parallallize it, I couldn’t fathom how to do it in Haskell and abandoned the idea. I tried to write a parallellized version in Erlang, and while it spreak across the machine nicely, each individual process was way too slow, the parallellized algorithm was hundreds of times slower than the single-threaded haskell.

Because I really wanted that poster, I decided to switch to C because I had this idea that nothing could fail in C. And I started to code in a language I hadn’t used for years, even a decade. And suddenly it hit me, everything made sense. Sure, I was writing so much boilerplate but it didn’t bother me. I suddenly realized that everything I wrote would be inside the program’s code, and that nothing more would. It was a great feeling.
I used simple pthreads to do the parallellization, and I used libgd to output my data to a png file. I started learning about mutex lock hierarchies to make the parallellizations overlap without endangering thread safety, it was all ugly code and the API’s felt horrible compared to what I was used to.. but it all worked out. The resulting program was thousands of times faster than anything I had written.

And now, I am seriously wondering where I have been all this time. Sure, I still think C is incredibly clunky. But now I got the dust off of my old course on writing compilers (Modern compiler implementation in C), and I want to write a compiler in C for a small programming language. I want to get down to earth again, and write things that are efficient and just run very quickly. I want to write lots and lots of code and know exactly what every line does.

Has anyone else had this feeling, this evolution? Am I going mad? Do you think C will last, and there are intersting jobs left for pure C developers?

I have the same question: Are there intersting jobs left for pure C developers?

Posted in Programming | Tagged | Leave a comment

“–” (Double-hyphen) in Bash

$cat out
if [ $# -eq 0 ]
    then
        echo "Usage: out [-v] filenames..." 1>&2
        exit 1
fi
if [ "$1" = "-v" ]
    then
        shift
        less -- "$@"
    else
        cat -- "$@"
fi

In out the -- arguments to cat and less tells these utilities that no more options follow on the command line and not to consider leading hyphen (-) in the following list as indicating options. Thus -- allows you to view a file with a name that starts with a hyphen… -- argument works with all Linux utilities that use the getopts builtin… This argument is particularly useful when used in conjunction with rm to remove a file whose name starts with a hyphen (rm -- -fname)…

A Practical Guide to Linux Commands, Editors and Shell Programming (p. 442)

Posted in Notes, Programming | Tagged | Leave a comment