Archive

Archive for the ‘Others’ Category

Exiting Application on Android

November 11, 2011 Leave a comment

Warning! Massive technical rant ahead!

Android RantAnyway, a couple hours ago, I just realized that I haven’t implemented an “exit app” functionality on my game. So of course, I fired up Google and searched for how to exit an android application.

finish()

Most of the results said that I should use finish() function that behaves just like using back button (which isn’t available for me since I override the key press). Oh, and usually these stuff are accompanied with some lengthy reasons about why you shouldn’t have an exit functionality on android application XD

Apparently, the function doesn’t really worked well for me. Sure, I got back to the homescreen when I executed it, but the application doesn’t actually got destroyed =/ It usually wouldn’t be a problem, since the activity would still call the onCreate() method where we put most of our initialization stuff. Things are different with singleton classes though, since they AREN’T destroyed, they didn’t get instantiated again when the activity is started. So we are left with the old instance of the class, containing all the old values. I could have added an initialize() method on those classes that will be executed on the onCreate() method, but this would defeat the purpose of singleton classes, where you don’t need to instantiate the class.

So, even with all those articles that say people should be using finish() function, I still found the functions doesn’t work the way I had hoped. What I really want is to destroy the application utterly when the user quits, unfortunately, finish() just doesn’t cut it, and in the end I resort to the killProcess() function to destroy my own application.

Process.killProcess(Process.myPid())

There’s also that System.exit() function, though I don’t really know the difference XD

Smartphones in Bakuman

September 17, 2011 Leave a comment

Eh, I don’t know if this one warrants an actual post or not, since I manage to cram this one inside 2 tweets XD Nevertheless, I posted it on Google+ and the length looks kinda okay for a blog post, so here I am.Anyway, I just read the latest chapter of Bakuman, chapter 147 (Bakuman is an ongoing manga made by the author of Death Note), and both current chapter as well as the previous one features a lot of conversations on cellphone. Note that the manga takes place in today’s japan.

It’s really interesting that most characters in that manga have already used touch-based smartphones instead of those soap bar or clamshell phones found in older manga (older as in, one or two year older). Another interesting point is that none of those smartphones is iPhone, yet I have spotted a Galaxy S used by one of the characters (well, the button layout is definitely Galaxy S). So, does anyone know more about the condition of smartphone marketshare in Japan?

EDIT: After seeing it posted, looks like the size is good enough for a blog post after all =D

Categories: Others Tags: , , , ,

Why Competition is Always Good

August 24, 2011 Leave a comment

So, Facebook just announced several new features which mostly attempts to fix its privacy problem.

See, this is why choices (which leads to competition) is almost always good. Google+ has made facebook starts fixing their privacy problem, much like Android has made Apple starts fixing their iOS notification system.

But well, it still doesn’t solve the problem of seeing some news I couldn’t care less (hey, how about copying Google+ “mute this post” feature, Facebook? In one of my groups there’s a post about some soccer online game, which I have zero interest in, that keeps showing up in the notification =/).

Anyway, the road for these two is still long, Google+ still has a lot of stuff missing and Facebook also still need to learn a thing or two from Google+. The race is just starting, guys =D

On another note, no one can say that Google+ is simply copying Facebook anymore, since now it goes both ways XD

Original post on Google+

Categories: Others Tags: , ,

Installing Services in Ubuntu

June 4, 2010 1 comment

Okay, now we have installed a Ubuntu before, time to move on to services. What are services? Well, in a way, they are like application which you can execute to do something. There are various services ready for Ubuntu, you just need to download and install them, though I don’t know where you can get a list of all services available on Ubuntu.

Installing those services are really easy, which is one of the things I like from a Ubuntu. You just need to type a few words and let the operating system downloads, installs, and configure it for you. All you need to do is open the terminal and type:

sudo apt-get install xxx

with xxx being the services you want to install.

Here, let me walk you through it:

  1. Say we want to install apache service on our Ubuntu. We just need to open up terminal and type sudo apt-get install apache2. Sometimes it will ask for password, so type your password to continue.

    sudo apt-get install

    One of those commands you'll be seeing a lot...

  2. Then the operating system will search for apache2 package and return it’s info, so you can confirmn whether you really want to install it or no.

    Installation Confirmation

    Why is it always y/n?

  3. Type in y if you’re gonna install it, then the terminal will start downloading the needed package to install the service you requested.

    Downloading the Package

    Will it be faster if it have an integrated download manager?

  4. Wait for a bit, then the service will finally be installed.

    Installed Package

    There should be a sound or something to indicate that a package has been installed...

For those of you who hates the command-line interface, Ubuntu provides a nice GUI for installing services (though I prefer using the simple apt-get install command). You can locate this nice application in System > Administration > Synaptic Package Manager and simply launch it to install stuff.

Here’s how it works:

  1. Okay, let’s say we want to install emacs package on our operating system. The list would show packages available, which would help if you know where emacs is located. Instead, you could just choose all packages and search for emacs.

    Synaptic Package Manager

    Well, we still have GUI, don't worry.

  2. Clicking on emacs, you would have the option to mark it for installation. Do so, and press the Apply button. The package manager would soon start downloading the needed package, and installs it after it’s finished downloading. Then you can simply call emacs anywhere in the terminal to launch it.

    Downloading Package with Package Manager

    Better GUI doesn't mean better download speed.

There are various services available, some of them that I installed are:

  • Apache (apache2) – Used for having some kind of a web/http server on your computer. Mainly used for testing PHP scripts and for hosting a database (with MySQL for example) on local server.
  • SSH (openssh-server) – Secure Shell protocol. Mainly used for logging into remote computer by providing a secure communication between the two computers.
  • OpenVPN (openvpn) – Virtual Private Network. Mainly used for accessing remote networks by tunneling them through a single port.
  • Squid (squid & squid-common) – Used for proxy-caching.
Categories: Others Tags: , , ,

Installing Ubuntu on VirtualBox

June 4, 2010 Leave a comment

Wow, seems like ages since I was last here, wonder if I will ever get back, hmm…

Anyway, a few months ago, I have an assignment that must be done in Linux environment, so I installed one on VirtualBox. Now I’ve got another assignment to documents the process of installing a Unix operating system, so I suppose I’ll just reinstall this Ubuntu I’ve got, and since I’ve done it before, it shouldn’t be that hard, right? And well, I’ve been debating whether to simply reinstall Ubuntu or try Fedora, which I haven’t used before, but in the end I opted for the easy one.

Anyway, let’s begin. I suppose I’ll just make this article some kind of tutorial, to help people out there trying to use VirtualBox too.

What I used:

  • Ubuntu 9.10, get it here!
  • Sun VirtualBox v3.1.6, get it here!
  • Windows Vista SP2 as host machine.

Step by Step Guide:
(Ignore the text on the screenshot, I forget to turn off the lyrics)

  1. First off, Install VirtualBox, I suppose that won’t be too hard. After getting it installed, launch it, you should have a window like this one here.

    VirtualBox

    See? We start at 11.00 AM

  2. Press the New button on the upper left corner of the window, another window — New Virtual Machine Wizard — should appear like on the screenshot below.

    New Virtual Machine Wizard

    Dorothy and the wizard of OS!

  3. Press Next, the wizard will ask you to give a name for the virtual machine that will be created and specify which OS type you will use. Pick whatever name you want (like Ubuntu 9.10, corresponding to the OS you’re gonna install) and since we’re gonna be installing Ubuntu, specify Linux Ubuntu as your OS type. Then press next to continue.

    Specify Name and OS Type

    Though names like "Sup4 CoMPut4h!!" would work too

  4. Now you will be asked to specify the amount of RAM you’d like to allocate to your virtual machine. Since you’re installing Ubuntu, 384 MB of RAM should suffice, though I go for 512 MB, since I have 3GB of RAM on my computer. Click next after you’ve specified the amount of RAM.

    Specify RAM to be Allocated

    The limit is 1500 MB, is it because I have a 3000 MB RAM?

  5. Next, we will need to create a harddisk for our new Virtual Machine. I prefer to have a unique hard disk for each virtual machine, so go with the option to create a new hard disk, and click Next. Another wizard should appear, get on it by clicking Next.

    Harddisk Wizard

    Huh, so the wizard of OS has a child?

  6. The wizard will ask for the type of hard disk we want to create, a dynamic one or a fixed one. A dynamic one would only use space equal to the amount of data we have stored on the virtual machine, so got with that one and click Next.

    Specify Storage Type

    Shouldn't it be dynamic VS static instead of dynamic VS fixed?

  7. Next you will be asked to specify the location and the size of the hard disk. I go with the default for location, and use the recommended setting for hard disk size, 8 GB. Besides, Ubuntu OS will only use less than 4 GB space, so an additional 4 GB should be enough.Press Next and you will be shown the summary about what kind of hard disk you will create. Check the info, if you’re okay with it, finish the wizard by clicking Finish.

    Specify Storage Size and Location

    Wait, 2 TB? And my external hard disk is only 1 TB...

  8. Another summary will shows up, showing all information about the new Virtual Machine that will be created. Again, if all the information seemed correct, complete the wizard by clicking Finish.

    Virtual Machine Summary

    Not another summary...

  9. There, now you have your own virtual machine. It’s still empty though, so we need to fill it with Ubuntu.

    New Virtual Machine

    It took 30 minutes to write the article, and another 30 to find this kind of comments

  10. We need to mount the Ubuntu disk image first before installing it. Press the Settings button, next to the New button and go to Storage tab. Highlight the Empty text.
    Virtual Machine Settings

    Funnily, most of the stuff you choose before can be changed via settings.

    A virtual media manager should appear, press the Add button at the top to browse for the ubuntu disk image you’ve just downloaded. After you opened it, press select, then return to VirtualBox main window, you have just mounted a Ubuntu disk image.

    Mounting Ubuntu Disk Image

    Yeah, you definitely can't use Daemon Tools for this one.

  11. Okay, it’s time to install the operating system. Start the virtual machine by pressing the Start button next to the setting button. Another window would appear, showing that your virtual machine is running.

    Start Virtual Machine

    Okay, our virtual machine is up and running!

  12. A language choice should appear, choose whatever language you like, I chose english.

    Installation Language Menu

    Honestly, people that choose language other than english are lame.

  13. Then, the boot menu would appear (to be honest, I kinda like this screen, reminds me of some game start menu screen), there are several choices, as you can see. You can choose Try Ubuntu, which should load a Ubuntu enviroment without installing it, but hey, we’re already using virtual box, so we’re already trying Ubuntu. So let’s just install it by choosing Install Ubuntu.

    Ubuntu Boot Menu

    Wait, where's the new game option?

  14. Now, the installation wizard should come up and… we must choose the language again?  Again, I chose english, you can pick whatever language you want. Press forward after you choose the language you want.

    Language Installation Menu

    Deja vu?

  15. Next, we should specify our region so Ubuntu can configure itself to suit your style, and well, I lived in Indonesia, so that what I chose. Click forward again after you’ve chosen your region.

    Region Installation Menu

    It would be kinda cool if we can just click the country on the map.

  16. Now it should be asking for your keyboard type, if you’re like me, unaware of your keyboard layout, just leave it be and choose USA layout. Now go forward again by clicking the forward button.

    Keyboard Installation Menu

    Wait, there are other keyboard layouts?

  17. This time the wizard would ask about how you’d like to partition your disk. This stuff is useful if you’re installing Ubuntu alongside another OS, but again, since we’re using VirtualBox, we will just simply choose to use the whole disk, as we have specified an entire disk for this virtual machine. Press forward again if you have made your choice.

    Disk SPace Installation Menu

    In case you wanna have dual boot (well, boots usually come in pairs afterall)

  18. Now it’s time to create a profile for your operating system, choose the identification and password you like when you log in to Ubuntu, and also specify a name for your operating system. If you have filled them, go on by clicking Forward, the wizard should shows you summary of the operating system you’re gonna install. Make sure you’ve done everything right and finish the wizard.

    Operating System Identification

    Now what should I click if I want to add a Retinal Scan Identification?

  19. Now the wizard starts installing Ubuntu, a series of slideshow will be shown over time, you can either watch them or do other stuff, like writing a Ubuntu installation tutorial.
    Ubuntu Installation Slide Show

    Wait, marketing...?

    Ubuntu Installation Slide Show

    ...on a free product?

  20. Oops, a warning, an internet connection is required as Ubuntu needs to download some language packs. And don’t worry, VirtualBox should be able to detect your internet connection.

    Internet Required

    Where the hell is my 360 kB/s speed?

  21. Anyway, soon, your installation will be finished and you’ll be asked to restart your computer. Before restarting though, you need to unmount your Ubuntu Disk Image by going to Devices > CD/DVD Devices and click on your Ubuntu Disk Image. Then restart your maching by clicking the Restart Now button on the dialog.

    Ubuntu Installation Finished

    So the whole installation took around... 30 minutes.

  22. After restarting, you should find your Ubuntu booting up and showing login menu.

    Log in to your operating system.

    I'm starting to run out of comments here...

  23. So choose a profile and type in the password, you have just logged onto your Ubuntu operating system!

    About Ubuntu 9.10

    Now you have a Ubuntu on your VirtualBox!

Now you have installed your Ubuntu, it’s time to talk about services, but let’s save it for another post, in the meantime, enjoy your newly-installed Ubuntu! ^^

Categories: Others Tags: , , , ,
Follow

Get every new post delivered to your Inbox.

Join 111 other followers