Sunday, December 5, 2010

Converting Wordpress Blog to Blogger / Blogspot

Today I am trying to consolidate my Java blog posts and separate some of my posts on Python, and also other stuffs here. All were previously in my Wordpress blog sites.
When I search in Google, there is a hope in wordpress2blogger tool. It is a hosted tool at Google App Engine. Google App Engine put the limitation of the upload to 1Mb, so you can only upload blog less than 1Mb in size. Of course we can work around the limitation by importing the blog bit by bit.
For my case, I divided into 4 chunks.

This is how I did it:

1. Login to your Wordpress account, and navigate to the Dashboard for the blog that you want to transfer to Blogger/Blogspot. I was using Wordpress 3.0 which had slightly different configuration and menu from the one described on the appengine hosted tool.
2. Click on Tools (left accordion menu section) > Export (link)
3. Download the Wordpress XML file.
4. Upload to the wordpress2blogger.appspot.com website, click [Convert] (button).
5. You will automatically download from the site, a new format that is importable by blogger. The file normally will be named blogger-export.xml
6. Open your Blogger account, create a blog if you haven't got one, or you can import to your existing blog. Go to this link: Dashboard > Settings (tab) > Basic (tab) > Import blog (link). Choose the file.

That's it! Done.

Saturday, December 4, 2010

Installing Go language on Mac OS X

I have tried the Go language from Google on Ubuntu few months ago. Now I tried it on my Mac OS X box and see whether it works on machines other than Linux box. Mac OS X is based on BSD, so I guess the difference won't be that much. Mac OS X runs on intel x86_64 architecture, and Go language supports that.
Go supposes to run well on machine with GCC, Mercurial, and Bash. Mac OS X has them all. To my surprise, I already have Mercurial on my Mac OS X box!

I created the /swdevel/golang/hgco. Then checkout from the Mercurial repository from Google Code.

I am following the instruction given here http://golang.org/doc/install.html

$ hg clone -r release https://go.googlecode.com/hg/ go
requesting all changes
adding changesets
adding manifests
adding file changes
added 6822 changesets with 26893 changes to 3944 files
updating to branch default
2435 fles updated, 0 files merged, 0 files removed, 0 files unresolved

It succeeded checking out from the Mercurial repository!

$ cd go/src/
$ ./all.bash
...
...
--- cd ../test
1 known bugs; 0 unexpected bugs

---
Installed Go for darwin/amd64 in /swdevel/golang/hgco/go.
Installed command in /swdevel/golang/hgco/go/bin.
*** You need to add /swdevel/golang/hgco/go/bin to your $PATH. ***
The compiler is 6g.

On OS X the debuggers must be installed setgrp procmod.
Read and run ./sudo.bash to install the debuggers.

Well, they warned me for a known bug!
The system doesn't seem to get the processor correctly, AFAIK my Mac Mini supposed to be Intel Core2 Duo while it detects amd64?!?

It displays a bunch of compilation messages. It took somewhere around 8 minutes on my Mac OS X box.
The 6g denotes that your architectures is x64, while 8g is for x86.

Then I need to do this:
$ echo 'export PATH=/swdevel/golang/hgco/go/bin:$PATH'>> ~/.profile

$ cat ~/.profile
Check whether you have exactly code below in the last line of your ~/.profile
export PATH=/swdevel/golang/hgco/go/bin:$PATH

Close your shell window, and open a new one (this is an important step so that your ~/.profile will be executed!).

Test on the new shell window:
$ 6g
It should displays something like this:
gc: usage: 6g [flags] file.go...
flags:
-I DIR search for packages in DIR
-d print declarations
...
...
-x print lex tokens

Done installation!
Next post will be showing the hello.go (hello world of Go language) on the Mac OS X box.

Wednesday, November 24, 2010

Back to go -blog

(reminds me of this picture below)

[caption id="" align="aligncenter" width="450" caption="Guru Go Blog"]Guru GO Blog[/caption]

For those who don't understand Bahasa Indonesia, "goblog" means "stupid". "guru" here means "teacher". A university or academy tried to increase the awareness of impact of blogging, and spread through the national seminar and workshop for teachers. But the title "guru go blog" means "stupid teacher". They should (as teachers should) pay attention to the English grammar. "Guru go blogging" instead of "Guru go blog" (which may also reflect the truth, by the way).

The lost of my blog settings in this domain, coupled with the coming of our newborn baby 2 months ago, has made me too lazy to post something on my blog. I did wrote some half completed blog entries, but didn't manage to finish it.

Now I began to realize that it was too long. This is not what I really want. I want to be able to update my blog regularly!

I managed to get my blog up again 3 months ago, and now the baby has been sleeping more and more regularly. I think it's time to come back to my blog.

Currently I am trying to compose a mini site on IT Career, and it is bilingual, in English and Bahasa Indonesia. The target market is of course the people beginning to enter career in IT and people in the middle of IT career (which is just like me).

Saturday, July 10, 2010

Again about Google DevFest 2010

Yesterday I had to leave an hour earlier from the Google DevFest 2010 event, as I have to  catch up with my wife, she was waiting for me for the second Antenatal Class. I missed the Code Lab, the Maps and Buzz T-shirts. Ouch. 5:30pm I had to leave while they ended the event on 6:30pm.

Flash back: After lunch time, there were some presentations on Google Apps, by Patrick Chanezon, followed by success story of people who developed applications for Google Apps. One from creately.com (http://www.creately.com). Another round from SingPath (http://singpath.appspot.com).

One thing that was missed a lot is the power points (aka power plugs). It was awful so many people carrying laptop and no power plug on the Connexis Theater. Almost everyone were running out of battery.

I just don't know why the crowd was kinda lacking enthusiasm to verbally respond to the speaker on stage with 'ooo's, 'aaaa's, 'yeah's, 'alright's and stuffs. Most of the time the crowd was silent.

Nevertheless it was a must-attend event of this year. I will attend the next event for sure.

 

Friday, July 9, 2010

In Google DevFest 2010

Currently I am attending the Google DevFest 2010. Timothy Jordan and Bob Aman in their presentation on Open Social.

Today the registration was pretty crowded, and they differentiate based on the first letter of your first name. I was in the "A-F queue". The queue was long and the registration process was draggy.

They changed the schedule a bit, Daniel Lee presented the Google Maps as opposed to the initial schedule on the web site: Google DevFest 2010 in Singapore. He showed us how to create a coffee shop location based informative web site as an example.

After the first session, Jeremy Orlow, an engineer working on the Chrome team, explained the HTML5 and the Chrome. They skipped the Q&A for HTML5 and Chrome. May be they pushed forward because we're late because of the registration, so in order to finish during the lunch time, the organizer advised to ask in person to Jeremy during lunch time for anyone who want to ask questions.

Then here comes the third session, and its about  Open Social.  Tim was of more lively presenter than others I think. More like MC may be? Google Buzz API stuffs, atom, OAuth, Salmon, Pubsubhubbub etc.

Wednesday, June 23, 2010

Chicken Pau Objective-C

Just like local saying: "If you can't buy a Big Mac, you may still settle with Chicken Pau".

Or we might as well call it "Objective C para gente pobre" (Spanish, thanks to Claudio) above title translates to "poor man's Objective-C".

What I mean by poor man's Objective-C is the development using the language which pre-dominantly using the Apple hardware and the latest Apple compiler. That the rich man's version of Objective-C.

But if you are just like me, who is still saving to buy an Apple hardware, may be this approach will be a short term cure for your addiction. We will start with something as simple as an Ubuntu 10.04 Lucid Lynx Linux box, which is far more affordable than Mac boxes. My objective was to be able to have a hands on experience with the Objective-C language, before moving to the platform where you need to invest more bucks. Practically I decided to learn the language using "poor man's Objective-C" (it's "Objective C para gente pobre" -- thanks to Claudio).

Luckily enough, the Objective-C compiler that we use are from the GNU family of compilers (gcc, cc10bj), which by far the most widely used and widely ported compiler family. It's available everywhere for free. Those guys at Apple also uses GNU compilers, which make it easier for us -- that we don't have to install another proprietary tools.

One sad thing though, the GNU compiler set doesn't fully support the Objective-C version 2 which is the case with latest Cocoa platform. But as I said, my objective was to have a hands on experience on the language, you get the feel, familiarize with it, then you can move one when you piggy bank accumulate enough to produce a bang on the fruity stuff.

Let's start. I assume you already have your Ubuntu box installed.

[sourcecode lang="shell"]
$ sudo apt-get install gcc
$ sudo apt-get install gnustep-base-runtime
$ sudo apt-get install gnustep-core-devel
$ sudo apt-get install gobjc
$ sudo apt-get install gnustep-gui-runtime
$ sudo apt-get install libgnustep-gui-dev
[/sourcecode]

Most of the time you just need to answer "Y" for the questions raised.

Let's make it official by writing a hello world application.
[sourcecode lang="c"]
#import <stdio.h>

int main(int argc, char** argv) {
printf("Hello, world!\n\n");
}
[/sourcecode]
Save the file as hello.m

Compile it using our gcc tool:
[sourcecode lang="shell"]
$ gcc hello.m -o test.out
[/sourcecode]

If it compiles successfully, try to run ti.
[sourcecode lang="shell"]
$ ./test.out
Hello, world!

[/sourcecode]

Here we go, a hello world in Objective-C!
Ok, it's a bit cheating, the only difference from the C language in the source code was only the use of import instead of the usual include

[sourcecode lang="c"]
#import <Foundation/Foundation.h>

int main(int argc, char** argv) {
NSLog(@"Hello, world!\n\n");
}
[/sourcecode]

Now, it's a bit hairy to set the compile right, but for now, just follow this:
Compile it using our gcc tool:
[sourcecode lang="shell"]
$ gcc hello.m -I /usr/include/GNUstep -fconstant-string-class=NSConstantString -lobjc -lgnustep-base -o test.out
[/sourcecode]

If it compiles successfully, try to run it.
[sourcecode lang="shell"]
$ ./test.out
2010-06-23 18:25:06.816 test.out[4981] Hello, world!
[/sourcecode]

Hooray, now we have the development environment that runs the Cocoa Foundation framework!

A glimpse of the Objective-C langauge

The Objective-C language has had history almost as long as C++. The languages was developed in roughly the same time (Stroustrup came with the C++ idea first, but the first implementation roughly emerged at the same period). The Objective-C has long seemed to be hidden somewhere in the secluded community while its cousin has made it to a whole bunch of commercial compilers and IDEs.

Only until recently the Objective-C shows back its teeth. Now with Apple Macbooks, Macbook Pros, Mac Minis, iMacs, iPhones, iPads, iPods devices around everywhere, the Objective-C is enjoying popularity as it has never before -- to the extent that now Apple is the largest technology company in term of market cap.

The language has been with the NeXT, a company founded by Steve Jobs after leaving Apple, and the company that brought back Steve Jobs to Apple. Having its popularity at its peak, it brought about the whole tools it's been using all those time.

I have always wanted to learn this language. I remembered it's been there for very long. I saw things comp.lang.objective-c group in the Usenet. But those day when my campus' bandwidth was still very limited, and the only few NeXT workstations are out of reach, it's difficult to get access to this language and platform.

A short look at the code revealed that it is a derivative of C language that one to make sure that the message passing between objects are very clear. I heard this was an influenced by Smalltalk, which I think make senses. I often encounter a lot with people who started learning and developing C++ applications; when they talk about object's "methods", they still call them "functions". They still ask "how to call this object's function" when the correct question is "how to invoke this object's method". That's not the case when you learn the Objective-C language. "invoking a method" also called "sending message" in Object Oriented paradigm (I think it's from Message Sequence Chart, the predecessor of UML's Sequence Diagram). The Objective-C is stressing more on the latter. It must also has been influenced by Mach micro kernel design and MPI which uses message passing instead of passing a shared memory location.

The good thing about thinking in a way of "sending message" or "passing message" from one object to another is, it applies well to a fine degree of parallelism. When you are running on a lot of core (as it is now), it's good to see the objects as sending messages to each other, and not invoking methods. "sending message" across objects are safe meanwhile "invoking object's methods" must consider all the thread related stuffs.

I know that in order to become a good Cocoa (the framework for Mac OS X and iPhone apps) application developers, we'll need to learn the language well. The language is used by most of the GUI frameworks in Apple platforms. While some of the syntax is just resemble what we have in C language, the Objective-C has also departed from C language in so many ways. Some of the syntax looks very weird, especially when you are from C++ and Java background like me.
It must also has been influenced by Mach microkernel design which uses message passing instead of passing a shared memory location.


[sourcecode lang="c"]
NSString *myStr = [[NSString alloc] init];
[/sourcecode]

I don't know how weird it is for you, but this is the syntax of allocating memory for the NSString object (simply by sending "alloc" message), then sending "init" message to the newly allocated object.