Facebook Timeline Showcase

My Facebook Profile recently updated with this new feature, called “Facebook Timeline”. It arranged my activities onto Timeline.

It is believed that this feature is now only available to certain group of people, such as Developer, and it will go live next Wednesday. Only Developer can see the other developer’s timeline, when the other people only can see the old profile.

The new thing is that I can set my cover photo in my Facebook Profile. I chose a very wonderful, memorable photo that I taken from Second Life.

I can easily navigated to the activities that I done in last month, last two months, or last last years, when I clicked the link at the top right side, Facebook will take me to the activities posted at that time period automatically using slide animation.

It provides another page to show ‘Activities Logs’, a very simple page showing activities list with the information and the time happened.

Java Certification Question (20111003)

Q1

QUESTION: What happens when you attempt to compile and run these two files in the same directory?

 

//File P1.java

package MyPackage;

class P1{

void afancymethod(){

System.out.println(“What a fancy method”);

}

}

//File P2.java

public class P2 extends P1{

public static void main(String argv[]){

P2 p2 = new P2();

p2.afancymethod();

}

}

 

A. Both compile and P2 outputs “What a fancy method” when run.

B. Neither will compile.

C. Both compile but P2 has an error at run time.

D. P1 compiles cleanly but P2 has an error at compile time.

Answer: D

Noticed that these two files said to be in the same directory, but second file didn’t have package declaration while first file have. Therefore, P2 will prompt error at compile time.

Q2

What will be the output of the following code?

 

public class Sample {

 

public String getCountryName(){

return “USA”;

}

 

public StringBuffer getCountryName(){

StringBuffer sb = new StringBuffer();

sb.append(“UK”);

return sb;

}

 

public static void main(String[] args){

Sample s = new Sample();

System.out.println(s.getCountryName().toString());

}

}

 

A. Compile with error

B. USA

C. UK

D. Runtime Exception

Answer: A.

Java allows overloading method, meant with same method name, but having different parameters. However, Java does not allow overloading method with different returned types if the parameter list is the same. Because you see, it is contradicted themselves.

Q3

What will be the result of attempting to compile and run the following code?

 

abstract class MineBase {

abstract void amethod();

static int i;

}

public class Mine extends MineBase {

public static void main(String argv[]){

int[] ar = new int[5];

for(i=0;i < ar.length;i++)

System.out.println(ar[i]);

}

}

 

A. A sequence of 5 0’s will be printed.

B. Error: ar is used before it is initialized.

C. Error: Mine must be declared abstract.

D. IndexOutOfBoundes Error

Answer: C.

The answer is C, Mine must be declared abstract, or Mine must implements the method abstract void method().

Java 8 geared up to cloud and its feature

Java SE 8 is geared up to the cloud. Multi-tenancy and modularity is featured.

Multi-tenancy is considered as one of the main components characteristics of cloud computing, as single instance of software application runs on the server but served multiple clients.

Modularity is reorganization of JDK into a set of clearly defined though interdependent modules.

Java 8 also decides to include C# / Scala’s Lambda style which worked pretty well in subjective measure. Java 7 should have Lambda but its construct is weird.

JSR TBD is included as language support for collections, where literal expressions for immutable lists, sets, and maps, and indexing-access syntax for lists and maps.

Below codes are possible when define a Set or List.

List<Integer> aListOfNumber = [1,2,3,4,7,2,4,6,7];

Set<Integer> aSetOfNumber = {1,5,34,45645,23};

Map<Integer, String> aHashMap = {5 : “fyhao”, 6 : “bmwjob”, 18 : “Singapore”};

Virtual extension method is included as providing default implementation for interface virtual methods. If you are not afford an implementation of method, one will providing you an implementation with no charge.

Sharing state often introduce complexity in concurrency programming. If the state is not shared, or said immutable state, it will not brought trouble because it has fixed input-output pair. Functional language comes with this benefit, but Java is not going to switch language but just adopt the principle functional language based on, seek to increase immutability and decrease sharing. Fork-join decomposition introduced in Java SE 7 to easily write algorithm that parallelized automatically across wide range of hardware configurations.

Walkaround some Discuz enabled site, and republish my authored plugin

Just now I had found some website built using Discuz, and most of them provide their local platform for Discuz related script download. I had re-published my authored Discuz plugin and posting some tutorials to their Discuz site.

They are Discuz Malaysia (http://discuz.my), Discuz Turkish (http://discuz.eu), Discuz Indonesia (http://discuzindo.net), Discuz International Official (http://msg2me.com), Discuz Thai (http://discuzthai.com)

I had tried to republish my authored Discuz Plugin, the most recommended one, Imgshow Platform For DiscuzX2, and the end of this post is the list of sites that can download this plugin.

English version:

http://discuz.my/thread-19-1-1.html
http://www.msg2me.com/thread-5585-1-1.html
http://discuzindo.net/forum.php?mod=viewthread&tid=73&extra=

Chinese version:

http://bbs.qxinnet.com/thread-42140-1-1.html (Chinese and English)  (Main Publish Site)
http://www.discuz.net/thread-2237589-1-1.html (Chinese and English)

(If you like this Discuz Plugin, or wants support my works, you can help me click on Facebook Share, Like, Google Plus Button, Tweet Button, or any buttons existed on their site…)

Google pinyin for mac

I used Chinese Pinyin which Mac built-in, it sometimes lagging when typing. I used to use Google Pinyin when I used Windows last time. But I couldn’t find the Google official release of Google Pinyin.

However, now I had found it! Here is the downloadable link: Google Pinyin for Mac download link (zip file)

Now I can type Chinese characters faster like a running leopard without lagging.

 

Related posts:

1. http://viewology.net/download-google-pinyin-input-for-mac/926/2/

 

After some tries, my whole macbook crashed because of high ram utilization of Google Pinyin and Google Chrome… So, I could only use back the Mac built in Pinyin.

iPlacePlus Helps you Check in from Second Life

Nowadays people love to check in from their First Life, posting to Foursquare, a very popular Location-based Site, sharing their current location to their friends. Some people may like it, may want to go there, may been there before.

Second Life is a 3D social game, brought in First Life experience into the virtual world, there are many interesting places waiting for us to explore.

A new service, iPlacePlus.com, is another LBS helps you to check in from Second Life. Wherever you go in Second Life, you can use iPlace Tool (a scripted box inside Second Life) to check in, and your current location will be posted to iPlacePlus to be shared to public. There is a Second Life map will be shown in the web page, the other users can see the map, click the “Teleport” button and in case they had opened their Second Life Client program, they are able to be teleported to the location you had been to.

iPlacePlus is currently in alpha release, and I just created for fun, and I will use it for myself or shared to little friends in Second Life. It will have sign up feature for new member, but currently is closed. When you first time using iPlace Tool in Second Life, the tool will help you sign up directly with iPlacePlus as well.

Sharing your iPlacePlus map to your friends is very easy. It will provides various embedding methods in the website. It will supports Facebook Sharing in the future.

The first place in Second Life I would like to share with you is a Second Life English school, a very interesting school with friendly teachers and students from around the world. I joined there almost one year. Really good.

Click this link http://iplaceplus.com/view.php?placeid=1 you will be able to see the Second Life Map of the English school.

Alternatively, I shared the English school to some Discuz! based forum as well, click here http://bbs.qxinnet.com/thread-42272-1-1.html for Chinese, or click here http://warung.my/forum.php?mod=viewthread&tid=1140&extra= for English.

Watch this video if you want to know a little about how to use iPlace Tool inside Second Life. The video is outdated already. The main feature is very similar and there are additional features built-in. I will show out when it is ready.

AD TIME: If you really really interested to this Second Life English class, you can visit their website directly -> http://drive-through-esl.info/.

As you see, the iPlacePlus.com website design is very sucks. Forgive me I have no design and color concepts in my brain, current design is simple. If you are web designer, and you passionate to Second Life like me, and you are very helpful and wants help to contribute design to this website, contact me. If you have comments, you have plan, you have idea, contact me as well. I created this site for fun, and it will be a free community website when it released to public.

I will reserve first ten user accounts to my close friends, even they may not using this service. My lovely angels will be the first, because I super love her.

 

In short, I had introduced a new service, iPlacePlus.com, that helps you check in from Second Life. You can explore beautiful places in Second Life, share to your friends by checking in your current location to the website, or shared to Facebook.

Played Titanium mobile framework

Just played and hello world to Titanium, another mobile apps framework like Phonegap, has the ability to develop iOS and Android apps using Javascript without learning native language Objective-C and Java.

Titanium has over 300 APIs, it bridged more and more native features than Phonegap. Titanium had bridged in native UI widgets and features into its own Titanium framework, while Phonegap only support HTML5 + CSS3 Web View Interface. In this case, Titanium provides API to build UI widget, such as Text Field, Table View, Button, using same and neutral Javascript API, the developers need not to bother the look-and-feel of widgets while Titanium take care of it. It is automatically rendered as iPhone-styled widgets while apps runs on iPhone or rendered as Android-styled widgets while apps runs on Android. Besides native hardware feature support such as Accelerometer, Compass, Camera, supported by both, Titanium has many other built-in API, such as it is able to initiate HTTP Client, or using TCP/IP Socket Stream, File System or Local Database Access and other useful utilities.

Titanium Javascript is compiled into application binaries and it can be run on the speed nearly to native apps. Again, Titanium Javascript is cross-platform over the non cross-platform Objective C and Java.

It has a standalone Eclipse-based IDE, which provides complete and useful hints when you code Titanium, and it is all free and open source. It has built in iPhone and Android simulator to test your apps. But when you need to debug on real iPhone, what I do is open the generated project setup in Xcode, and build there, and the whole process is damn smooth.

 

I’m lovin it.