Anything is possible, unless it's not

Wednesday, December 14, 2011

Internet in Indonesia

Hello, world!

Internet connection speeds in Indonesia is ranked lowest in ASEAN, and it's among the lowest in Asia [1]. I'm not lying or exaggerating! Government agencies in Indonesia should be aware of this fact! I also have references to make things clear. Please note that numbers presented in this blog post is taken at the moment this post is written.

If you are not Indonesian, you may feel that your Internet connection is very slow. How slow is your Internet connection? Is that 2 Mbps (while the global average is 9.68 Mbps [1])? Well, it's not that slow, according to Indonesians. According to the statistics at Net Index (by Ookla), average Indonesians are downloading at 1.67 Mbps, ranked 150th among the countries [1]. It's ironic that fast connection in Indonesia is actually terrible connection in other countries [2].

The situation worsened when Google started to endorse cloud computing. According to Forrester analyst James McQuivey, "Every other software solution Google has tries to push you to the web rather than your hard drive. Google’s vision is that in the future everyone will have wireless high-speed access on any mobile or fixed device, so going offline to watch videos is unnecessary since you’re never offline." [3]

This situation is certainly not expected in Indonesia. While you have the convenience of having all of your data online, you cannot get much of it if you use Indonesia's crappy Internet connection. (The word crappy is actually an underestimate. It is even worse than crappy.) According to Sales Director of First Media Indonesia Dicky Mochtar, the ideal connection speed nowadays is at least 3 Mbps [4]. Indonesia's neighbor Malaysia even have attained this speed in their Internet connections [1].

This problem may be related to the number of underwater cables of which Indonesia is connected to. While many countries are connected to many, many cables under the sea, Indonesia connects itself only to a few cables [5]. I hope the government agencies to be well-read and aware of these facts, and fix Indonesia's Internet connection in near future.

References:

Saturday, November 19, 2011

GOTO considered useful

if(it_failed) goto hell;
printf("Hello, world!\n");

I don't understand why people call GOTOs harmful. In forums, typically GOTO-opponents post a Goto-laden (pseudo)code like this.


read(some_input);
if(simon_says_A) goto do_A;
if(simon_says_b) goto do_b;
...
return;
do_A: print("i'm doing A"); goto_C;
do_b:
...

I don't know any programmers in this earth who likes to program like that. That's clearly an ex(goto F)(E:)erated(return)(F:)agg(goto E) spaghetti code, which "modern proponents of Gotos" even don't want to code like that. But, Goto statements aren't always bad! I do believe that there are some good use of Goto, which make development time shorter, algorithms more efficient, and (of course) code more readable. I think the Goto statements should not be deprecated, before structured programming can ace in loop control, like this: ("The MISRA C++ coding standard allows the use of goto to cover this exact kind of situation."--Richard Corden)



//Compare this one
...
for(looping_on_i)
{
for(looping_on_j)
{
for(looping_on_x)
{
for(looping_on_y)
{
for(looping_on_z)
{
do_some_numerical_computation(i,j,x,y,z);
if(it_failed) goto next_item;
}
}
}
next_item:
}
}

//with this one :D

...
for(looping_on_i)
{
for(looping_on_j)
{
flag=0;
for(looping_on_x)
{
for(looping_on_y)
{
for(looping_on_z)
{
do_some_numerical_computation(i,j,x,y,z);
if(it_failed)
{
flag = 1;
break_out_of_loop;
}
}
if(flag)
break_out_of_loop;
}
if(flag)
break_out_of_loop;
}
}
}

Thursday, October 13, 2011

Note for vi fanatics

(print "Hello world,")

Emacs is not that bad.



  • I'm tired of pressing Escape every time. I use laptop keyboard, so it is much easier to reach Alt than Escape.

  • Emacs supports mouse. This suits my (and many programmers') style of making small changes at many places within a document. I'd rather type with one hand and move around with the mouse. This is much faster than vi can do.

  • Emacs is a true real-time editor. Some versions of vi are not.

  • Emacs also support inline images. This makes editing (La)TeX documents easy to do.

  • Contrary to popular belief, metakey chords sometimes much easier to type. Commands such as C-x C-s C-x C-c can be typed effortlessly, especially on my Dvorak keyboard. HJKL are more difficult to remember on Dvorak layout, while W/w, E/e and B/b, they are not so ergonomic, right? Oh. You cannot rub out words quickly while typing. You can do them in Emacs.

  • There is no need to switch between modes. Switching between modes is not so easy in vi, and it can disturb typing rhythm having to press Escape key. Keys such as C-n or C-f (I map them to Super-n and Super-c) do not disturb typing rhythm. Plus you don't have to switch modes.

  • The features do not sit there for nothing. They are valuables especially for programmers, and they are real time-savers. You don't have to switch to Micro$oft Outlook to check your email, calendar, notes, etc. All out of the box. Also, I won't install more games in my computer, they are all in Emacs!

Asian Physics Olympiad preparation

Hello world,

I am currently in preparation for the Asian Physics Olympiad. Along with other activities, they are the reason this is my first time posting in last two months. So don't expect me to post much within next few months. Thanks.

Tuesday, August 16, 2011

Fortran

Hello world,

For easier low-level math-ish programming, I chose to learn Fortran. Actually, it is the free, GFortran implementation of Fortran 90. And it ran very fast! It could calculate the Euler-Mascheroni constant in up to 2,147,483,647 iterations quickly.

Using a simple method, I tried to numerically solve a non-linear second-order ODE... Well, actually it is a pendulum motion with a large amplitude. It solves and produces the time versus angle data in a blink with a fair precision (dt = .01 s)...

Out of the box, GNU Emacs integrates nicely with GFortran, with code highlighting and debugging (I haven't tried the debugging yet).

Thursday, July 14, 2011

It's time to upgrade!

Hello world,

Recently, I chose to upgrade my GNU/Linux distribution from Ubuntu 10.10 (Maverick Meerkat) to Ubuntu 11.04 (Natty Narwhal). It was a pain in the butt, because of my slow Internet connection, here in Indonesia. After hours of downloading updated packages, unfortunately the automated distro upgrade did not work as expected. It freezes after booting.

So I tried to give it one more shot. Fortunately, I have got a copy of Knoppix live CD to rescue my files to an USB stick, reformat the drive, and installed a fresh copy of Ubuntu 11.04. The installation went flawlessly. Also the installation of my wireless network card driver went flawlessly, unlike my previous installation. But there's another pain in the butt to download all the softwares and packages I have installed before... I wonder if there is a way to backup all of the packages...

Oh no! I forgot to backup my .emacs file!

Thursday, June 30, 2011

How to ace Physics and Maths properly

Hello world?

Basically you don't need big eyeglasses, neither being a nerd, nor Asian to ace Math and Physics. Yes, it is possible to ace them, yet still being a cool guy (girl). Just imagine how it feels like, umm, girls waiting in line for you to help doing their homework problems!

Yes, I'm Asian. And (I think) I'm a nerd. I have actual girls (but not many) asking me to `teach' them Physics or Maths, in my real life. When I was graduated from my secondary school, I was voted to be `high quality single' (it's `High Quality Jomblo' in Indonesian. Well, I don't have a girlfriend, and currently don't want one). But I don't think I'm the smartest nor of the best quality. And I think there always a person that's more successful than me in Physics and Maths and in girls (guys)... and s/he can be you!

Contrary to popular belief, you might be more successful at taking these steps if you're already a cool guy (girl), rather than being a nerd.. If you think you're a nerd, just skip to Step two. And if you think you're cool enough, you can skip steps two and three.

Step zero: If you can't do that, study harder, even harder! You cannot be smart if you don't actually learn. Don't ever try to remember any formula if you don't know the reasoning behind them. Simply learning the reasoning really can help the understanding of the formulas, thus you can have easier time before the exam, and you can actually store formulas in your brain and recall them years after, by simply understanding the reasoning behind it. Oh, if you're dealing with definitions, it's best to memorize it, but try to answer "Why is it defined that way? Why not this way?"

"In physics and math, learning by asking `why' is much better than learning by asking `what'."

Learn algebra, if you can't do that properly. This is very crucial.

In maths and physics, the concepts are beautifully interconnected. Pay attention to the classes, and spend a night `playing around' with math and/or physics, and hopefully you will understand it better and better. It's not really as hard as it sounds... And it really works for many students!

"Why W = mg? Hmm. This page states that W is the weight force. What is force, mathematically? F=... erm... F = ma. Ah! I remember my teacher said that all objects in a free fall are accelerating at some acceleration, and it's called g. And the force that drives the object to fall is the weight, then it's reasonable to have W = mg!"

Step one: Do you think Step Zero is too lengthy to be practiced in a month? Then stay ahead of the crowd! Many nerds learn something well before the actual lesson in the school. Nerds browse the Internet for the differentials, Laplace transforms, or multivariable calculus, months before the actual lesson. Fortunately, you don't have to be a nerd to do that! Learning Physics or Maths in your spare time is really fun if you can appreciate it.

It's important to do Steps zero and one, before taking the step two. Steps zero and one hopefully shapes you to be `smart'. Do we lose our `coolness' if we're smart? Fortunately, the answer is no, if you take these following steps.

Step two: Learning how to solve 100x100x100 Rubik's Cube, or memorizing the Pi to the zillions of digits don't help you to be smart, although they may help you to look smart. But, if you want to get a girlfriend (boyfriend) easily enough, just don't look smart! Look cool as usual. Just be yourself. Don't talk mathematical or physical jargons in daily conversations.

Step three: Be helpful. Offer help to someone who can't. Don't forget to smile! And (hopefully) this will attract girls (guys) too.

Hope that helps! In the spirit of freedom, feel free to improve, and redistribute your own versions!