Selasa, 28 Desember 2010

Year of Video Games - 2010

Just like last year, a list of games I finished in 2010.

This is the year of Assassin's Creed and Zelda, since there are six of them on the list and what I sunk most of my time into.

A buddy at work who lent me Assassin's Creed II, which got it's hooks into immediately since it took place in Renaissance Italy and had this great virtual reality conspiracy thing going for it. I quickly finished AC II and immediately picked up AC I, which while a bit duller than the second was still a joy to play with all the historical references and it fleshed out the story better knowing the beginnings. When AC: Brotherhood came out I was excited enough to get the collectors edition box set.

Zelda was another big player this year as I was ramping up to finish them all before my 30th birthday in April. While I had completed Ocarina of Time right at the end of 2009 I didn't start Majora's Mask until the Spring. The mechanics of the game were similar to Ocarina, but I just couldn't get into the whole three day time thing until well into the end of the summer. Finally after picking it up and 3-4 hours intervals I finally got the hang of things and was able to power through it in August. Overall I enjoyed the game at the end, collecting every mask was actually fun and the reward of the Fierce Deity Mask made the end boss ridiculously easy. Shortly after completing it the Haunted Majora's Mask story "You Shouldn't Have Done That" appeared and playing it all the way through made it even more creepy. I even went so far as finding an original N64 cartridge at a local game shop and it's sitting on my desk along with an original N64 copy of Golden Eye.

After finishing Majora's Mask I dove right into Twilight Princess. While I had twice tried to start it in the past, I started all the way over with a new game and finished it up. I don't know if it was anxiety that kept me from playing Twilight Princess knowing that it would be the last game in the series until Skyward Sword comes out or what, but I was a bit apprehensive about finishing it. The game itself is beautiful, with many of the locations and dungeons building off of the original formula and fleshing it out in 3D nicely. Some of the ancient landmarks and ruins (Bridge of Eldin) seemed like they were pulled from my seven year old selfs imagination while flipping through the original Zelda instruction manual and map. From some of the boss fights I was fully expecting the Ganon fights at the end to have more challenge. While a sword fight for the final encounter was cool, it was a bit too easy. I was hoping to use some of the more powerful items (magic armor and fairy tears) as a boost if I ran out of fairies and potions, but I made it through with only losing a few hearts. Still, it was a good way to end and overall the game was satisfying.

Another surprise this year was Alan Wake, which was the first Xbox 360 game to go onto a list. This is mainly because my buddy Bren let me borrow is 360 which gave me the opportunity to play it. While I haven't finished the second DLC package it opened me up to watching Twin Peaks and reading more Stephen King novels.

Since Zelda is out of the way and I own a majority of the Metroid games already, I'm going to set a new goal of completing all the Metroid games before I turn 40. It's a good chunk of time, but you never know what's going to come up.

Finished Games for 2010

Gameboy
Metroid II: Return of Samus

PS3
Call of Duty 4: Modern Warfare
Heavy Rain
Assassin's Creed
Assassin's Creed II
Assassin's Creed: Brotherhood

Xbox 360
Alan Wake

DS
Chrono Trigger (this is actually from 2009 but forgot it last year)
Professor Layton and the Diabolical Box
Legend of Zelda: Spirit Tracks
Grand Theft Auto: Chinatown Wars

Wii
Legend of Zelda: Twilight Princess

Virtual Console
Legend of Zelda: Majora's Mask

iPhone
Beneath a Steel Sky
Civilization Revolution

Android
Angry Birds

Goals for 2011
Legend of Zelda: Skyward Sword
Metroid: Other M
Call of Duty: Black Ops
Metroid Prime Trilogy
inFamous
Prince of Persia: The Sands of Time
No More Heroes
StarCraft II
GoldenEye 007 (Wii)

Selasa, 14 Desember 2010

Why My Laptop Fails To Recognize Built-in Microphone

Q: Why Does My Laptop Fail To Recognize the Built-in Microphone?

A: My laptop is an ASUS model with i5 CPU core. It's got a built in microphone as the spec says. However when I use Skype for some reason it does not recognize the built-in microphone. If I use an external microphone then it works.

After some tweaking and searching I finally found that the microphone setting in Control Panel -> Sound -> Microphone is "not enabled". After I set it to "enabled" it works!

If not let me know!

Senin, 13 Desember 2010

Why The Projector Fails To Recognize My Computer

I tried to connect my laptop to the projector but it keeps failing to recognize it. Why? My colleague's laptop is the same model and it works.

Answer: If your computer does not automatically recognize the projector when they are connected, make sure you set your PC's resolution correctly. In other words you need to set your PC's resolution to one that's supported by the projector. If you don't know what resolutions your projector supports simply try several resolutions until it works.

Solution #1: Set your PC's resolution to one that's supported by the projector.

Another possibility is that your computer has a setting that prevents it from recognizing external device automatically. In that case you need to manually switch to the projector view which is usually done via some hot keys.

Solution #2: Manually switch to the projector view which is usually done via some hot keys!

If none of the above works let me know!

Q: What should I drink when I have a stomach ache?

I almost never had a stomach ache, but last week when I was on the airplane bound for China I had a serious stomach ache. I started wondering what I could eat to relieve the pain. I thought to myself "Just tell me what I should eat and I'll eat it!" The feeling that nobody could give me an authoritative answer is outright frustrating.

The flight attendant began to serve in flight meals which is pork rice which looked delicious. Too bad the pain was too big for me to eat anything. I began drinking lots of water but it didn't help at all. When the flight attendant was serving coffee I thought I should give it a try, and I drank a cup of black coffee with no sugar and no cream, and GUESS WHAT? The pain was totally gone within 5 minutes!

Answer: Drink a cup of black coffee with no cream and no sugar and nothing in it!

Minggu, 07 November 2010

Cutting the Cord

Sometime in the mid summer of this year my brother and I spoke briefly about canceling cable TV and going to an Internet only feed. The idea quickly faded since the alternatives, while there, just weren't up to meeting our entertainment requirements. A few weeks ago with an deal between Time Warner and ESPN (more on this later) and the new media server I built it was time to cut the cord. With broadcast HDTV, a PS3, and Linux based media server here's how we did it and ended up saving a ton of $.

Movies

We had the movie option in our cable TV package, with Encore, Starz, and a few other channels excluding the more premium ones like HBO and Showtime. This was by far the easiest to check off by using Netflix. The PS3 is capable of streaming all of the on-demand Netflix catalog, as well as play blu-ray and DVDs with the 10$ one-at-a-time plan. Netflix is only expanding their streaming library in addition to making more HD streams available. I also have many movies ripped to the linux media server and pushed out to the PS3 via a UPnP server software called fuppes for streaming of my movie collection.

Network TV

With cable we had a DVR package to record and replay shows back later on in the week. Time Warner also had a nice On-Demand feature to play a majority of network and cable channels shows anytime even if it wasn't recorded on the DVR. Since HDTV came about a few years ago network TV looks just as good, if not better, than it's HD cable counterpart. By purchasing a HD antenna and putting it over the bookcase we're able to get the local SD network channels in 1080i. Now this isn't as ideal as having the DVR or On-Demand on TW, but the biggest piece in this puzzle was the software called playon.tv.

Playon.tv runs on a Windows computer and scrapes streaming websites like hulu.com, cbs.com, tv.com, etc. It transcodes the streams on the fly and then presents them as a UPnP media server to various devices such as the Wii or PS3. It also has a mobile feature, and devices like an iPad or iPhone can connect to the media server over a remote 3G connection for playback anywhere. The one downside is the streams are not in HD, although HD support is promised by the developers soon. Total cost is 40$ a month with 20$ a month renewal and it more than makes up for the lack of DVR. On a technical note, playon.tv will run just fine in a Windows XP KVM guest on my linux media server with 2 vCPUs and 4GB of memory dedicated to it.

Sports

By far the most asked question I get when talking to people about this is "what about sports?". There's almost this myth that you NEED cable to get live sports, which is absolutely not true. With the advent of espn3.com almost any live sporting even can be watched via a web browser. There's even sports on there I've never heard of. The only downside here is that in order to get espn3.com your ISP needs to have inked a deal with ESPN3. Up until a week ago Time Warner had not done this but now is available, in addition to a new TW only website called espnnetworks.com which adds even more live sports content. Time Warner unfortunately requires you have ESPN as part of your video cable package, which we do not. Logging into another TW customers account however gets around this. Right now playon.tv supports ESPN3 for non-login ISPs, so for TW customers you still need to go through the web browser. With a media server connected to the same TV this isn't much of an issue. HDTV sports broadcasts look even better than cable since they're still in 1080i but don't suffer from the compression artifacts that most cable channels seem to add. Finally, if you really want to see a live sports even and you can't get it at home, it's probably time to leave the living room.

Notes

While we own all three major gaming systems the PS3 was chosen since it can do everything we need and we have a nice bluetooth remote that looks like it belongs in the living room.

We tried out Hulu+ for streaming over the PS3, and even though it had excellent HD output, it was lacking many of the shows available on the website. Strange since it's 10$ a month and you're paying to get less content... In the future if Hulu decides to do things different I'll revisit it.

Since a lot of this is network dependent, I upgraded our router to one capable of 802.11n and gigabit ethernet speeds so the media server and PS3 aren't laggy when talking to one another.

Time Warner is still in use for the Internet connection, but Verizon is planning on rolling out their LTE network to San Diego before the end of 2010. Hopefully they start offering service as an ISP and we can replace the cable connection completely.

Update


I switched from Windows XP to Windows 7 due to XP seeming to crash daily. Along with improved stability,Win 7 is also 64-bit and can handle all 4 cores when Playon moves to HD streams. The only issue was the AC97' sound card that KVM emulates doesn't have 64-bit Win 7 drivers, and other sound card options don't work either. Playon ships with a virtual audio device that takes care of transcoding the audio to work around this.

Senin, 01 November 2010

Jezebel 7.0

This fall I decided it was time to update my Atom based media server to a more power version.This was driven mainly by the want to rip and encode blu-ray disks and run KVM for virtualization. While the Atom setup was great for power efficiency (using about 40 watts at peak load) there were other tweaks I wanted to make. Below is my new system specs for Jezebel 7.0:

All of the parts were new except the case and blu-ray drive since they integrated without a problem. I originally purchased a micro-ATX motherboard which had more PCI, memory, and SATA slots, but the majority of the SATA connections went right up against the drive bay wall. The smaller board had less expansion space but fit better into the case and didn't limit any of the other components I purchased.

I went through about 4 graphics cards before landing on the GT430. Two were too large, and one was passively cooled but used a ton of power and put out a lot of heat. The GT430 has a fan on it that is a bit louder than I would have liked, but it can underclock itself when not in use to 50MHz to save power and heat. The GT430 is a bit overpowered for what I wanted to do, but it's CUDA support has me hoping for encoding programs like ffmpeg to use it for faster blu-ray encoding.

By far the biggest improvement is the quad-core processor, with two cores and 4 gigs of memory dedicated to KVM for a Windows XP guest install. I haven't tested it for video encoding yet but it has turbo-boost to go to 3.0GHz if needed. I also enabled an on-demand CPU governor and it runs at 1.2GHz while idle.


The drive setup was a big improvement as well. Before it was running the OS off a compact-flash card plugged into a parallel IDE connection, two 1TB drives on the onboard SATA, and the blu-ray into a SATA PCI card. This was less than ideal from an IO perspective and was still running on legacy technology. The new board has 4 SATA connections and I swapped the two drives for one 2TB disk. The SSD has shown a huge IO boost and the OS boots in less than 10 seconds. The 2TB drive is actually slow at 5900 RPMs, but it makes it quieter and is very power efficient.

The system setup is 64-bit Debian Squeeze installed onto the SSD, with /home all on the large disk. I also installed Windows XP into a KVM guest which resides on the SSD as well. GNOME is setup and running off the video card. HDMI out works for video and looks great, however I kept getting stumped on trying to pass sound through it and settled on a 1/8 audio connection from the line out.

The main use of the system is for pushing out content to our LCD TV via a variety of methods which I'll explain in a different post, and ripping/encoding DVD and blu-rays. It's also hooked up to our LCD TV and the wireless Apple keyboard and mouse is great for a living room setup with a range of approximately 10 meters.

Overall the system uses more power than the Atom setup, but the performance ratio makes up for this exponentially due to the advances in efficiency of the other components over the last few years. I'm looking forward to seeing what this system can do with it's virtualization capabilities and performance capabilities.

On some future notes, the next Intel architecture Sandy Bridge is looking to integrate video directly into the CPU. I looked into the on-die graphics available now since this motherboard can support them, but unfortunately the only Core i series CPUs that have it are dual core. Sandy Bridge will have 4 and 6 core CPUs to use it, but it will use a different socket, making this board unsuitable for it. Soon though we'll have HTPC systems like this that don't require any additional peripherals, increasing performance while at the same time driving down power usage even more.

Rabu, 13 Oktober 2010

Hibernate Self Join - Test Java Code

MenuHow to Do Self Join Many-To-Many Mapping In Hibernate
Hibernate Self Join - Create DB Tables
Hibernate Self Join - Create Java Class
Hibernate Self Join - Create Hibernate Configuration
Hibernate Self Join - Test Java Code
So we've created a database table to embody the concept of a Keyword, a table to join a Keyword to itself, the actual Java class that embodies the Keyword, the corresponding Hibernate configuration. Now you should be able to test our code.

'manager' is our manager whose job is to do CRUD (create, read, update, delete) operations on a Hibernate aware entity. Suppose we already have Keywords with keyword_id 243, 250, 260. Here's how we add a couple of keywords to another keyword as its children:

Keyword keyword1 = (Keyword)manager.getKeywordById(243);
Keyword keyword2 = (Keyword)manager.getKeywordById(250);
Keyword keyword3 = (Keyword)manager.getKeywordById(260);
Set children=new HashSet();
children.add(keyword2);
children.add(keyword3);
keyword1.setChildren(children);
manager.createOrUpdate(keyword1);


With any luck you'll run the code without an error and see that the corresponding rows created in the database correctly. Congratulations! Questions? Let me know! Otherwise enjoying Java and Hibernate!

◀ Create Hibernate Configuration

Hibernate Self Join - Create Hibernate Configuration

MenuHow to Do Self Join Many-To-Many Mapping In Hibernate
Hibernate Self Join - Create DB Tables
Hibernate Self Join - Create Java Class
Hibernate Self Join - Create Hibernate Configuration
Hibernate Self Join - Test Java Code
Now that we have database tables and Java class down, we have to tell Hibernate that we are doing self joins on Keyword. We can do this with XML configuration or Annotation. Here's the XML configuration. You can easily adapt it to Annotation if you are using Annotation. Questions?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping default-lazy="false">
<class name="entity.Keyword" table="keyword">
<id name="keywordId" column="keyword_id">
<generator class="increment" />
</id>
<property name="title" column="title" />
<property name="body" column="body" />
<property name="lastModifiedTime" column="last_modified_time" />
<property name="createTime" column="create_time" />
<set name="parents" table="keyword_to_keyword" cascade="none" lazy="false">
<key column="child_id"/>
<many-to-many column="parent_id" class="entity.Keyword" />
</set>
<set name="children" table="keyword_to_keyword" cascade="none" lazy="false">
<key column="parent_id"/>
<many-to-many column="child_id" class="entity.Keyword" />
</set>
</class>
</hibernate-mapping>


We simply tell Hibernate that keyword_to_keyword has a column 'parent_id' that refers to another Keyword, joined by keyword_id column, as the parent. and it has a column 'child_id' that refers to another Keyword as the child. Since a keyword can have many parents and/or children this is a many-to-many mapping! Questions? Let me know!

◀ Create Java ClassTest Java Code ▶

Hibernate Self Join - Create Java Class

MenuHow to Do Self Join Many-To-Many Mapping In Hibernate
Hibernate Self Join - Create DB Tables
Hibernate Self Join - Create Java Class
Hibernate Self Join - Create Hibernate Configuration
Hibernate Self Join - Test Java Code
Now we have the database tables to represent our entity Keyword and to join it to itself, let's create a Java class to embody a Keyword and its self-join characteristic. Note that you need to have two Sets of Keywords as the instance variables: one as its parents and one as its children. Then create simple setters and getters of each property. Easy right? Questions?

package entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

@Entity
public class Keyword{

@Id
@GeneratedValue
private Integer keywordId;
private String title;
private String body;
private Set<keyword> parents = new HashSet<keyword>();
private Set<keyword> children = new HashSet<keyword>();
private Date lastModifiedTime;
private Date createTime;
public Integer getKeywordId() {
return keywordId;
}
public void setKeywordId(Integer keywordId) {
this.keywordId = keywordId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public Set<keyword> getParents() {
return parents;
}
public void setParents(Set<keyword> parents) {
this.parents = parents;
}
public Set<keyword> getChildren() {
return children;
}
public void setChildren(Set<keyword> children) {
this.children = children;
}
public Date getLastModifiedTime() {
return lastModifiedTime;
}
public void setLastModifiedTime(Date lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}


Let's create the necessary Hibernate configurations to let Hibernate know all about our little plan to have Keyword able to join itself! Questions? Let me know!

◀ Create DB TablesCreate Hibernate Configuration ▶

Hibernate Self Join - Create Database Tables

MenuHow to Do Self Join Many-To-Many Mapping In Hibernate
Hibernate Self Join - Create Database Tables
Hibernate Self Join - Create Java Class
Hibernate Self Join - Create Hibernate Configuration
Hibernate Self Join - Test Java Code
So our entity is Keyword, and each Keyword can have a set of Keywords as its parents and a set of keywords as its children. This means this mapping is many-to-many and we need a join table to represent the relationships! DON'T WORRY; a join table is simply a table that keeps track of who are whose parents and who are whose children. Questions?

# table 'keyword' that's supposed to have a set of children and parents joined by keyword_to_keyword
create table keyword(
keyword_id int not null auto_increment,
title varchar(255) not null,
body text not null,
last_modified_time timestamp not null default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
create_time timestamp not null,

primary key (keyword_id)
) engine=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;

# self join table for keyword
create table keyword_to_keyword(
keyword_to_keyword_id int not null auto_increment,
parent_id int not null,
child_id int not null,
last_modified_time timestamp not null default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
create_time timestamp not null,

primary key(keyword_to_keyword_id),
unique key mffl_keyword_to_keyword_ids (parent_id,child_id),
foreign key (parent_id) references keyword(keyword_id),
foreign key (child_id) references keyword(keyword_id)
) engine=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;


As you can see 'keyword_to_keyword' is the table for keyword to join itself. The parent_id in keyword_to_keyword specifies the parent and child_id specifies the child. I included last_modified_time and create_time columns because it's my habit to know when a row was created and when it's last updated, but you don't have to if you don't want to. Questions? Let me know!

Now that we have our table in database let's create the corresponding Java class!

◀ Self Join Mapping in Hibernate Tutorial HomeCreate Java Class ▶

How to Do Self Join Many-To-Many Mapping In Hibernate

MenuHow to Do Self Join Many-To-Many Mapping In Hibernate
Hibernate Self Join - Create DB Tables
Hibernate Self Join - Create Java Class
Hibernate Self Join - Create Hibernate Configuration
Hibernate Self Join - Test Java Code
Q: I'd like to realize the relationship that a table has a set of parents and a set of children which are all members of that table. How do I do that with Java and Hibernate?

Hibernate has been out there for a long time but I am surprised I couldn't find online a comprehensive tutorial on realizing self join relationships in Hibernate. I am sure many out there are wondering the same thing; so I decided to write a post to address this issue.

First of all here are the exact things I'd like to achieve:

* Create a Java entity called Keyword. A Keyword has a title and a body.
* Each Keyword can have a set of keywords as its parents and a set of keywords as its children, and I can easily set and get a keyword's parents and children in Java which when persisted the relationships will be recorded in the database.

Let's first create a database table schema in MySQL! Questions? Let me know!

Create DB Tables ▶

How To Get All Posts of a Blog Via Blogger API

Q: I'd like to get all posts of my blog hosted on Google's Blogger via their Java API. How?

I have a blog that has less than 1000 entries and I'd like to get them all programmatically via Blogger Java API, and I setMaxResults(1000) of my Query object thinking that it would return all entries of my blog. But it DID NOT!! How frustrating! And Blogger API or their documentation or tutorial says nothing about it I find it unreasonable; so I have to address this issue.

Solution
After some tweaking I found that if you setMaxResults() to more than 500 you only get back 500 Entry objects, each representing a feed specified by a Feed URL. Then what do you do? Simple. Get 500 entries at a time and get as many times as you need to retrieve all posts of your blog (or feeds of any Google service). This can be done because the results returned are put in the post date order with more recent entries first. Each time you grab a batch of entries you specify an incremental start index via setStartIndex(). So code wise you'd specify your Blogger's blog's URL, use it to create a Query, set the Query's properties and use BloggerService to retriev the Feed and its list of entries. Here's some code to help you out.

public Collection getAllPostsViaApi() throws ServiceException, IOException {
// Request the feed
URL feedUrl = new URL("http://www.blogger.com/feeds/[your-blog-id]/posts/default");

Collection allEntries = new ArrayList();
Query myQuery = new Query(feedUrl);
int startIndex=1; // one based
BloggerService service = new BloggerService("service-name");
while(true){
myQuery.setStartIndex(startIndex);
myQuery.setMaxResults(500);
Feed resultFeed = service.getFeed(myQuery, Feed.class);
List thisBatch = resultFeed.getEntries();
if(thisBatch.isEmpty()){
break;
}else{
allEntries.addAll(thisBatch);
startIndex+=thisBatch.size();
}
}
return allEntries;
}


Questions? Let me know! It should be straightforward but if there's anything unclear leave me a comment and I'll get back to you as soon as I can!

Selasa, 28 September 2010

Download And Build 0xdroid On Unix

Q: I am trying to download and build 0xlab's Android distribution on Unix but am facing many issues. Please help!

Specifically I am trying to download and build from scratch 0xlab's Android on Ubuntu 10.04. 0xdroid is customized Android that runs on Beagleboard, which is a low-cost fan-less single board computer which features OMAP3530 processor that delivers laptop like performance at handheld power levels. You can find out more at http://beagleboard.org/.

Let's get down to installing 0xdroid on Unix! Keep in mind many issues you face here may occur when you download and build the original Android source. So this post may help those who are building the original Android too! Questions?

Copy the following text to /etc/apt/sources.list

deb http://tw.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://tw.archive.ubuntu.com/ubuntu/ lucid universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid universe
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://tw.archive.ubuntu.com/ubuntu/ lucid multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://cz.archive.ubuntu.com/ubuntu jaunty-updates main multiverse
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse


This sets up necessary packages for downloading and building Android from scratch. Questions?

Update 'apt' and install tools as necessary via 'apt-get'

Execute 'sudo apt-get update' to update apt since you've changed /etc/apt/sources.list. On my unix machine I needed to install 'curl' via 'sudo apt-get install curl' before moving on. If you have curl skip this step. Along the way of following this tutorial if you get a message saying "xxx command not found" then install it via 'sudo apt-get install xxx'.

Install packages to build Android source

- Follow instructions on http://source.android.com/source/download.html (refer to http://www.stata.com/support/faqs/win/64bit.html to find out whether you are 32 bit or 64 bit) to install required packages to build Android source files. MAKE SURE you are following the correct instructions based on whether your Ubuntu Linux is 32-bit x86 or 64-bit x86.

- Follow instructions on http://code.google.com/p/0xdroid/wiki/Source to set up the building environment, how to download 0xdroid source code and how to build it from scratch.

Here are some of the errors you may get and how to resolve them: Questions?

Errors that may occur and how to resolve them

Error #1
============================================
bin/bash: prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc: No such file or directory
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
host C: acp <= build/tools/acp/acp.cIn file included from /usr/include/features.h:378, from /usr/include/stdlib.h:25, from build/tools/acp/acp.c:11:/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directorymake: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1============================================

Solution: Execute 'sudo apt-get install libc6-dev-i386'


Error #2
============================================
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
host C: acp <= build/tools/acp/acp.chost C++: libhost <= build/libs/host/pseudolocalize.cpphost C: libhost <= build/libs/host/CopyFile.chost StaticLib: libhost (out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a)ar crs out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/CopyFile.ohost Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++/usr/bin/ld: cannot find -lstdc++collect2: ld returned 1 exit statusmake: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp] Error 1============================================

Solution: install libraries according to http://source.android.com/source/download.html and you should be good to go. My error was caused by not executing "sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev"


Error #3
============================================
Target system fs image (ubifs): out/target/product/beagleboard/obj/PACKAGING/systemimage_unopt_intermediates/system.img
Making ubifs
/bin/bash: .repo/repo/repo: No such file or directory
/bin/bash: .repo/repo/repo: No such file or directory
make: *** [out/target/product/beagleboard/obj/PACKAGING/systemimage_unopt_intermediates/system.img] Error 127
============================================

Solution: Did you move your beagle source code from their original directory to another directory? for example perhaps you did "repo sync" somewhere you didn't want and realized it later, then you moved them in the correct directory which is beagle-donut/. If so make sure you copy all hidden files as well. Use this command to copy hidden files: 'sudo cp -r .[a-zA-Z0-9]* beagle-donut/'


Hope that resolves any issues you encounter during downloading and building Android source code. Questions? Let me know!

Happy playing with Android!

Eclipse Content Assist Is Not Working In Unix

Q: I CANNOT uses Content Assist in Eclipse while pressing Control + Space. Why?? It's driving me nuts!!

More specifically I installed Eclipse IDE for C/C++ Developers Helios Version on my Linux machine which is running 64 bit Ubuntu 10.04 LTS. Pressing Control + Space in Eclipse should activate content assist so that it helps me finish what I want to type. It works in Eclipse installed on Windows OS and Mac OS. How comes it doesn't work in Eclipse installed on Unix?

There are several possible causes. Here they are in the descending order of probability:

* Make sure your bound keys are Control + Space: As funny as it sounds in Eclipse C/C++ IDE Helios running on 64-bit Unix Ubuntu, the keys bound to activate content assist by default are Alt + / (forward slash) not Control + Space! Therefore simply open Windows -> Preferences window and go to C/C++ -> Editors -> Content Assist -> Advanced and here's the window you should see:

Eclipse Content Assist Advanced Window

Then click on Keys link at the right (or simply go to General -> Keys). Then you'll see a window allowing you to change binding keys of any available command like the following:

Eclipse Command Binding Keys Window

* Make sure Control + Space is not used by another application: The most common one is Windows text input function. If you enable English and another language as input languages make sure they are not using Control + Space to change between them.


That's it! Questions? Let me know!

Selasa, 14 September 2010

COMPLETE Guide To Install IE6 On Windows 7 Home Premium

The need to install Internet Explorer 6 on a PC with Windows 7 Home OS is a common one for web developers as pointed out by Cross Browser Compatibility Tutorial. However you'll face many issues. I've found various guides that solve a part of the problem. Together they solve them all. It's about time someone wrote a post on how to solve this problem from start to finish, with no guesswork and no questions along the way!

The following is a screen shot of Windows Virtual PC running Windows XP SP3 with IE6 installed, our goal for today:
Windows Virtual PC Screenshot

Let's get to each problem you may face and how you can resolve it!

Problem #1: You CANNOT install IE6 directly on Windows 7 Home Premium OS. One way to get around this issue is you need to use some sort of virtual PC to run Windows XP and then run Internet Explorer 6 in that environment.

Problem #2: However, Windows XP Mode and Windows Virtual PC are available ONLY on Windows 7 Professional and Windows 7 Ultimate as this website suggests:

http://www.microsoft.com/windows/virtual-pc/

That's convenient It says nothing about how one can do the same thing with Windows 7 Home edition :-( Lucky you! I've figured it out by myself. To get around this issue install Windows Virtual PC. You can download Virtual PC for Windows 7 at the following URL. If your PC is 64-bit download
Windows6.1-KB958559-x64.msu. If your PC is 32-bit download
Windows6.1-KB958559-x86.msu.

http://www.microsoft.com/downloads/details.aspx?FamilyID=2b6d5c18-1441-47ea-8309-2545b08e11dd

Note: Do NOT install Microsoft Virtual PC. You'll get a compatibility error when you try to run it. Questions?


Problem #3: Your PC needs to support HAV, short for Hardware-assisted virtualization. To know whether your PC supports HAV download the HAV detection tool at

http://go.microsoft.com/fwlink/?LinkId=163321

If your computer does not have hardware-assisted virtualization, you'll get an error while creating a virtual PC. To get around this issue, download and install a hot fix at

http://support.microsoft.com/default.aspx?scid=kb;EN-US;977206

Questions?


Problem #4: You need to have license to a genuine Windows XP image. But nobody would want to shell out hundreds of dollars to get Windows XP just so they can test IE6 right? There's an alternative that costs you NOTHING. There's a place where you can download hard disk images for testing websites with different Internet Explorer versions on Windows XP and Windows Vista. Download IE6-on-XP-SP3.exe at

http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&displaylang=en

Run IE6-on-XP-SP3.exe to get IE6 on XP SP3.vhd. Note where it's installed as you'll need it in the following step.

The problem is that the image has an expiration date of several months. This should be fine. When the disk image expires simply download the same file again at the same website. Questions?


Now you've gone through all the issues and resolutions. Let's create a virtual pc and run it! Go to Start menu and pick 'Windows Virtual PC' from 'All Programs' and you should see the following window.

Windows Virtual PC Window Screenshot

Click on Create virtual machine and fill in 'ie6' in Name field. For Location field fill in the path to the disk image you just downloaded and executed. For example mine is C:\Users\michael\Desktop\software\IE6 on XP SP3.vhd.

Your virtual machine should be up and running. If you don't get Internet in the virtual machine then read on. When you open 'Windows Virtual PC' again you'll see ie6.vmcx in the list like the following:

Windows Virtual PC Window with One Virtual Machine

Right click on it and pick Settings and you should see the following window:

Windows Virtual PC Settings

Click on Networking and select the wireless network adapter installed on your PC in 'Adapter 1' field. If you are not sure simply try each option and start the virtual machine until you get internet in the virtual machine.

TIP: Click on Integration Features and uncheck 'Enable at startup' because I don't find it useful and it takes a long time to run when enabled.

TIP again: Another thing is if you leave the virtual machine on idle you may be prompted to enter the password for the account. If you forgot your password while creating the virtual machine simply restart the virtual machine and create a Guest account in 'User Accounts' in 'Control Panel'. Then use that Guest account! Your purpose is to test IE6 anyway :)

TIP again twice: If you want to set up Internet Explorer 6 simply because you'd like to test your website, refer to How To Install Internet Explorer 6 so You Can Test Your Website On IE6!


Questions? Let me know!

Beautiful Origami Swan Examples

MenuOrigami Swan Tutorial
Making Origami Swan Basic Procedure
Making Origami Swan Basic Part
Beautiful Origami Swan Examples
Here are some origami swan examples I made. The first photo below is the basic swan origami I started off with. After I was done I put a red bow on its neck! This swan is not as detailed as you can see - each round only has 17 pieces. The second and the third swans each has 21 pieces making them appear more detailed and meticulous!

Origami SwanWhite Origami SwanCute Origami Swan

The origami swan is easy to make, but it is quite time-consuming How much time it takes depends on people, but in general I'd say it takes about 10 hours. It also depends on how big and how detailed you want to make it. For example, you can make the girth of the swan larger, but it requires a lot more pieces for each round. To start off each round can consist of 17 pieces. Once you get the hang of it, you can make another swan where each round has 25 to 30 pieces, and the swan will look much more detailed!

You should be able to see from the photo how it's made. Questions? Let me know!

Once you get used to it, you can get creative and make much more complicated models. Sky is the limit! You can add small decorative elements on your work. Here is a more advanced swan origami I made for my aunt who did so much for me. I would never have made it here if it wasn't for her help. I am not sure what a phoenix looks like, but I'll just call this one an origami phoenix. Any objections

Origami Phoenix

Here is a picture of the origami swan and origami phoenix together.

Origami Swan and Phoenix

Aren't they beautiful?

I like taking the time making something for someone important to me, and it really manifests my gratitude in a way that things you buy can't. Of course it really depends on the recipient. If they are materialistic, they probably would feel happier if you bought them something nice. If they are spiritual, a paper swan you made with sweat and blood would make a great gift. But in either case, you can learn how to make it in case the need arises

◀ Making Origami Swan Basic Part

Making Origami Swan Basic Procedure

MenuOrigami Swan Tutorial
Making Origami Swan Basic Procedure
Making Origami Swan Basic Part
Beautiful Origami Swan Examples
Cute Origami SwanHere is the general procedure of making an easy origami swan like the one in the photo:

* Get materials. A swan is white, so white paper is generally enough. If you want to go for a different color you can. The beak of the swan should be of a different color, like red. When you get good at this you can also add bells and whistles to your work. For example, you can add fake eyes and glitter

* Measure and cut paper. The goal here is to cut paper into rectangular pieces that you will be folding into basic parts. You need at least 150 basic parts to make a swan. For each basic part, the proportion of width versus height is 3 : 2. If you want to make a small swan, each part can measure 4.5cm by 3cm. If you want to make a bigger one, you can go 6cm by 4cm or even bigger.

* Make basic parts. You fold each piece of paper into the basic part which is the basic construction piece. How many depends on your design and size. I'd say you need at least 150 pieces. If you want to do something elaborate it can go up to 1000 pieces.

* Assemble the basic pieces into a swan. You don't need to glue the body, but you need to glue the neck and maybe the top part of the wings to make them stay. I use white glue, but you can use any glue you want!

* Post process: This is purely personal and depends on your design. You can decorate it by putting some things on the body such as glitter, whistles, fake eyes, etc. If you do be careful not to overdo it because it may look too fancy! A swan should be simple and white shouldn't it?

◀ Origami Swan TutorialMaking Origami Swan Basic Part ▶

Making Origami Swan Basic Part

MenuOrigami Swan Tutorial
Making Origami Swan Basic Procedure
Making Origami Swan Basic Part
Beautiful Origami Swan Examples
Cute Origami SwanHere are step-by-step visual instructions of making a basic piece that you'll use to make the swan origami in the picture:

Lay the piece of paper on the desk (ratio of width to height is 3 : 2).


Fold it in half.


Fold it in half again.


Unfold it and observe the crease.


Fold the left side.


Fold the right side. Note I leave a small split between the two flaps to make the next step easier.


Turn it over.


Fold the left corner. Note I leave a small split to make folding easier.


Fold the right corner. Note I leave a small split to make folding easier.


Fold the bottom part up.


Fold the whole thing in half.


Here is what it looks like from another angle.


That's it! Easy isn't it? If you haven't got it, let me know!

It's easy to make just one, but you gotta make hundreds and hundreds before you can make a swan! Make them while watching TV, listening to music or the radio, waiting for the bus, etc. There are plenty of occasions where you can fold these little pieces while not wasting any time. Go Go Go! You are almost there!

◀ Making Origami Swan Basic ProcedureBeautiful Origami Swan Examples ▶

Sabtu, 04 September 2010

How To Remove Paint From Concrete Floor

Q: I just finished painting my kitchen walls and now I am having a hard time cleaning paint stains off the floor. Any tips?

First of all it's a great idea to duck tape newspaper on the floor before you paint so that you won't get any paint on the floor when you are done. Next time you know

That said if are trying to get paint stains off the floor or any concrete surface, try the following two tools. I've found them especially effective:

Steel sponges: They are EXTREMELY effective in removing random sloshes and strips of paint stains. They look like:

Stainless Steel Sponges for Removing Paint


Steel Scrapers: They are great for removing sizable drops of paint stains. A small stainless steel scraper looks like this:

Steel Scraper

The blade of a steel scraper works wonders when it comes to removing dry, bulging drops of paint! If you can't find one you can use a steel shovel or chisel or treaded spade. A steel chisel looks like:

Steel Chisel for Removing Paint

And a steel treaded spade looks like:

Steel Treaded Spade for Removing Paint

As you can see their blades are GREAT for scraping the paint off any surface! Just scrub and scrape the stains switching between steel sponges and steel scraper and you'll see how effective a team they make


Now you should be able to remove the toughest paint stains from the concrete surface or any hard floor surface! Once you remove the paint stains simply sweep them up and throw them away.

Questions? Let me know!

Selasa, 31 Agustus 2010

jQuery Plugins' Layout Issues In Internet Explorer 6

Q: I am using jQuery Cycle plugin but the element containing a set of photos to rotate through shows up at the wrong place in IE6. HELP!!!!

Okay you need help and YOU GOT IT! Below is a page on my other website www.mensfashionforless.com:

Position Issue With jQuery Cycle Plugin In IE6

Here's the story behind it: While working on my website I needed to rotate through a set of photos on the top left corner of a webpage via some animation. I knew jQuery has this nice plugin called Cycle; so I downloaded and began to use it. When I was done everything worked great in IE7+, Firefox 3+, Chrome, but I saw a layout issue with IE6. The photo at the top left is at the wrong place:

Bad Layout Issue With jQuery Cycle In IE6

In IE6 the container that contains the photos to slide show through shows up at a weird place in the page. At the start of the browser load it's at the right place, but when the animation kicks in the element gets positioned incorrectly, somewhere in the middle of the page. The correct page looks like the first photo.

Solution: This issue actually can be solved via CSS. Simply put all the image tags inside a div tag that has the following CSS property:

position: relative

and try again. This attribute needs to be present for IE6 to work; otherwise the plugin's jQuery UI CSS framework dynamic styling would position the element somewhere unexpected in IE6. The more advanced browsers are tolerant of this issue and therefore you don't see this CSS issue in them.

Q: I am not using jQuery but somehow an element is positioned at a funny place in the page. Any idea what's going on?

If you are floating some elements and some other element's layout is broken, try floating that element as well. For example I have three elements that I am floating, and at the end of them I clear:both, then I put an Adsense block, but the block is showing in the middle of the page which is not where it's supposed to be. After I wrapped the Adsense block in a div and float the div, the problem goes away.

Questions? Let me know!

Jumat, 27 Agustus 2010

Solve 3x3 Rubik's Cube Correct Edges on Last Layer

MenuHow To Solve the Rubik's Cube
Solve 3x3 Rubik's Cube Top Edge Cubies
Solve 3x3 Rubik's Cube Top Corners
Solve 3x3 Rubik's Cube Middle Layer
Solve 3x3 Rubik's Cube Form a Cross on Last Layer
Solve 3x3 Rubik's Cube Correct Corners on Last Layer
Solve 3x3 Rubik's Cube Orient Corners on Last Layer
Solve 3x3 Rubik's Cube Correct Edges on Last Layer
Get a Rubik's cube or a Rubik's cube solving guide on

This is our last step! We move edges to their matching sides on the last layer. You only need to remember the following two algorithms. As you can see, the first algorithm swaps the 3 edge cubies clockwise, and the second one swaps them counter-clockwise.

L2 U B F' L2 B' F U L2L2 U' B F' L2 B' F U' L2






There are actually 4 possible scenarios, but for each scenario you need to use only these two algorithms, at maximum two tries.

Congratulations! You just solved the incredibly challenging game of the Rubik's cube Give yourself a big pat on the back will ya?

I think I covered every detail that any layman can do this. But if you are still confused, let me know!

Happy solving a Rubik's cube

◀ Orient Corners on Last Layer

Solve 3x3 Rubik's Cube Orient Corners on Last Layer

MenuHow To Solve the Rubik's Cube
Solve 3x3 Rubik's Cube Top Edge Cubies
Solve 3x3 Rubik's Cube Top Corners
Solve 3x3 Rubik's Cube Middle Layer
Solve 3x3 Rubik's Cube Form a Cross on Last Layer
Solve 3x3 Rubik's Cube Correct Corners on Last Layer
Solve 3x3 Rubik's Cube Orient Corners on Last Layer
Solve 3x3 Rubik's Cube Correct Edges on Last Layer
Get a Rubik's cube or a Rubik's cube solving guide on

If all corner cubies are oriented correctly, meaning the colors are on the right side, then you can skip this step. Otherwise you need to know the following two algorithms. One orients 3 corner cubies counter-clockwise. The other orients 3 corner cubies clockwise.

F' U' F U' F' U2 F U2F U F' U F U2 F' U2






There are actually 8 possible scenarios, but each can be solved by using only these two algorithms, at maximum two tries. This means that after you perform either algorithm once, you should end up with a state where 3 corner cubies need to be oriented clockwise or counter-clockwise. With some thinking you should be able to figure out what needs to be done in each scenario.

After you are done the Rubik's cube should look like this. Whew~ We are almost there




◀ Correct Corners on Last LayerCorrect Edges on Last Layer ▶

Solve 3x3 Rubik's Cube Correct Corners on Last Layer

MenuHow To Solve the Rubik's Cube
Solve 3x3 Rubik's Cube Top Edge Cubies
Solve 3x3 Rubik's Cube Top Corners
Solve 3x3 Rubik's Cube Middle Layer
Solve 3x3 Rubik's Cube Form a Cross on Last Layer
Solve 3x3 Rubik's Cube Correct Corners on Last Layer
Solve 3x3 Rubik's Cube Orient Corners on Last Layer
Solve 3x3 Rubik's Cube Correct Edges on Last Layer
Get a Rubik's cube or a Rubik's cube solving guide on

In this step we are going to move correct corner cubies on the last layer. By correct I mean that each corner cubie needs to be moved to the corner it's supposed to be, but the colors could be on different sides. First you can rotate the last layer to see if you get lucky. Otherwise, you only need to know one algorithm to swap two corners facing you. As you can see they should be swapped to be in the correct place.

B U' F' U B' U' F U2




As you can see from the result of running the above scenario, the corners are at the right place but the colors are on different sides. This is fine.

This algorithm is enough for every possible scenario, but sometimes you need to perform it more than once. Perform as many times as you need to get this right. If you are confused, write down what needs to be swapped and the solution will come.

◀ Form a Cross on Last LayerOrient Corners on Last Layer ▶
 
support by: infomediaku.com