A place to breathe

Thursday, February 28, 2013

How to create new project with existing files

This is funny. It should be straightforward right? Anyway, for fun sake, i will include this:

Let's say you have source files at ~/Source/MyFiles

And you want to create a new Eclipse project at ~/Projects/MyFiles. How do you do that?

First, File->New Project -> Select your project type and compiler ->Finish.

And how do we "copy" our files into our new project? Easy.

Right click at the Project Explorer tab (anywhere) and go:
Import-> General ->File System ->  Browse to your source files ~/Source/MyFiles.

Tick files you want to import into your new projects .

And Finish. Done !

Wednesday, February 27, 2013

Learning Git - checking out

Git is a repository system. Like SVN, it stores your file into some server somewhere. Unlike SVN, it is "distributed".

What does "distributed" means? Well, think about if the SVN server fails, where do we pull the source code? It's gone with the server.

With Git, every "checkout" (checkout has a different meaning in Git. Please follow) means you grab the whole repo project. With SVN, usually we just grab sub directory.

So in Git, if the server fails, you still have the entire repo to work with. You can even use your own repo to backup the server, just in case other people didn't checkout the code. That's why the "check out" process is called "clone". So, when you want to checkout a file, you tell Git server that you want to "clone" the whole repo:

git clone "your_repo" .git.

Now, what's next?

In SVN, we usually have trunk, branches and tags. In Git, you also do have trunk, branches and tags (but they call it in slightly different names. We'll see).

It's just that, instead of "checking out" the entire files, you simply "point" the working directory to whatever branches that you want. You can think of having all files in your local.

git branch -a  (this will list all branches in your local and remote) 


To create a new branch, use this:

git branch -b "newfix" 

To checkout to your new branch, simply use: 


git checkout "newfix"

Note that, if your remote has the branch "newfix", checking out the branch "newfix" will create a mirror branch in your local with the exact configuration (files, etc) in your local. Totally cool.



Thursday, February 21, 2013

MVC design

MVC stands for Model View Controller.

in a nutshell:

Model - holds data
View - display data
Controller - modifies data in the Model

E.g When a user click button, it sends the buttonClicked event to Controller.
Controller check what is the button clicked, and decide what to do with the data in the Model.

The Model then gets updated, and thus displayed in the View.

Make sense?

Importing inflation through property prices

The upward pressure on property prices as a result of speculation activities is getting everybody in Malaysia squeezed.

People are rushing to purchase properties for whatever reasons - fear of upward prices, making money from the "investment" (aka speculatory) activities.

Malaysia is a very protective country economically. We try to survive on our own - plant our own rice, build our own car. But following Ricardo's theory that we should do specialization and trade with other countries, we can't move away from increasingly taking part with the rest of the world. In fact, if we don't do that, we are going to suffer.

Now, back to property price. People (esp young like me) wants to purchase house, but some are too greedy and put down deposits at few places with hope to cash in the money when the time comes.

This is a greedy act, and not beneficial to the person. First, you teach yourselves how to gamble in a big way. You're taking loans, hoping that economy picks up and the upward price even more. And when the time comes, you sell. Habit is bad, for the economy is also bad. You don't add values, etc. You simply speculate. The economy is going to suffer from being "inflated" by you.

Second, the economy will bust when the time comes. By that time, all the profit that you selfishly make making the entire place not nice to live. Of course it is advantagous to you because you now have cash to buy even more houses. But what if you own a "portfolio" of houses that you haven't finished paying and you can't cash in now? You're totally screwed because first, the house has no value, and second, because you own ringgit and the value is less, you can't even pay. Bank will confiscate your house. Or you'll be indebted for the rest of your lives, and most likely the debt will be passed on to your children.

So the message here is this - don't purchase house if you can't afford it and don't buy house just for speculative purposes. You might as well be George Soros.

About Me

I'm currently a software engineer. My specific interest is games and networking. I'm running software company called Nusantara Software.