[BeagleBone Black] Launch Python Script at Boot like Arduino Sketch

In order to use the BealgeBone Black as a flight computer or embedded system in a product, it must be able to launch programs we wrote on start up without having to manually start it after logging in via ssh. Something sweet and simple like an Arduino, when it start, it run the program you put on it. I spent days looking for ways to do this, editing init.d and all, none of them work. And finally, I came across this blog for Raspberry Pi and work perfectly!

So to be sure that the script is running without logging in through the computer, I decided to do a “blink” loop like what we do when we first started Arduino.

SAMSUNG

Continue reading

[Java] Variable Types

If you are currently like WTF, then you’ve done it. Didn’t I tell you not to try division? To put everyone on the same page, let’s edit in the following.


public class Calc {

    public static void main(String[] args) {

       int a = 3;
       int b = 2;
       int result = a/b;

        System.out.print("3/2 = ");
        System.out.println(result);

    }

}

And you will be surprised to find the result to be:

3/2 = 1

Continue reading