Layout Test

This is a sticky post!!! Make sure it sticks!

This should then split into other pages with layout, images, HTML tags, and other things.

 

Fort Lauderdale’s dawn

今天早晨我在海滩上等日出。海上多云,虽然太阳已经在海上了却被云遮住了。看沙滩上自己的脚印,感触良多。上次在软软的沙上走是多少年前了?岁月如梭。一转眼我也快三十了。怀念少年的天真无邪。好多事都没有开始,满脑子幻想,满心期望。如今还是有很多幻想和期望但多了怀念。偶尔回首,时过境迁。

 

Good humor, bad ads

2 female Boston Terrier puppies, 7 wks old, Perfect markings, 524-0960. Leave mess.

Lost: small apricot poodle. Reward. Neutered. Like one of the family.

A superb and inexpensive restaurant.

Fine food expertly served by waitresses in appetizing forms.
Dinner Special — Turkey $2.35; Chicken or Beef $2.25; Children $2.00.

For sale: an antique desk suitable for lady with thick legs and large drawers.

Four-poster bed, 101 years old. Perfect for antique lover.

Now is your chance to have your ears pierced and get an extra pair to take home, too.

Wanted: 50 girls for stripping machine operators in factory.

Wanted: Unmarried girls to pick fresh fruit and produce at night.

We do not tear your clothing with machinery. We do it carefully by hand.

For Sale. Three canaries of undermined sex.

For Sale — Eight puppies from a German Shepherd and an Alaskan Hussy.

Great Dames for sale.

Have several very old dresses from grandmother in beautiful condition.

Tired of cleaning yourself? Let me do it.

Dog for sale: eats anything and is fond of children.

Vacation Special: have your home exterminated.

Mt. Kilimanjaro, the breathtaking backdrop for the Serena Lodge.
Swim in the lovely pool while you drink it all in.

Get rid of aunts: Zap does the job in 24 hours.

Toaster: A gift that every member of the family appreciates.
Automatically burns toast.

Sheer stockings. Designed for fancy dress,
but so serviceable that lots of women wear nothing else.

Stock up and save. Limit: one.

For Rent: 6-room hated apartment.

Man, honest. Will take anything.

Wanted: chambermaid in rectory. Love in, $200 a month. References required.

Man wanted to work in dynamite factory. Must be willing to travel.

Used Cars: Why go elsewhere to be cheated? Come here first!

Christmas tag-sale. Handmade gifts for the hard-to-find person.

Wanted: Hair-cutter. Excellent growth potential.

Wanted. Man to take care of cow that does not smoke or drink.

3-year-old teacher need for pre-school. Experience preferred.

Our experienced Mom will care of your child.

Fenced yard, meals, and smacks included.

Our bikinis are exciting. They are simply the tops.

Auto Repair Service. Free pick-up and delivery.

Try us once, you’ll never go anywhere again.

Illiterate? Write today for free help.

Girl wanted to assist magician in cutting-off-head illusion. Blue Cross and salary.

Wanted. Widower with school-age children requires person to assume general housekeeping duties.
Must be capable of contributing to growth of family.

And now, the Superstore–unequaled in size, unmatched in variety, unrivaled inconvenience.

We will oil your sewing machine and adjust tension in your home for $1.00.

 

Reasons to go to work naked

  • Your boss is always yelling, “I wanna see your butt in here by 8:00!”
  • Can take advantage of computer monitor radiation to work on your tan.
  • Inventive way to finally meet that hunk in Human Resources.
  • “I’d love to chip in, but I left my wallet in my pants.”
  • To stop those creepy guys in Marketing from looking down your blouse.
  • You want to see if it’s like the dream.
  • So that, with a little help from Muzak, you can add “Exotic Dancer” to your exaggerated resumé.
  • People stop stealing your pens after they’ve seen where you keep them.
  • Diverts attention from the fact that you also came to work drunk.
  • Gives “bad hair day” a whole new meaning.
  • No one steals your chair.
 

itext page number (page x of y)

I was looking for a complete example of how to dynamically generate the page numbers when you create the pdf using iText and I couldn’t find one. This is based on the example in the iText in Action book but I added my “refactoring” if you will.

I hope this helps someone. If not, it will definitely help myself in the future :)

>> Download << the complete code example (eclipse project) along with jUnit tests where you can actually generate the PDF file.

 

Java instaniate an abstract class… sort of…

At work I had to create some test data for a junit test. The function I’m testing expects a super abstract class to be passed in and I need to test the same function for bunch of child classes. I wish I could just pass in the parent class but since it’s abstract I cannot instantiate it. I wonder if there is a way using reflection so I can instantiate the class?? Since I could not find a way, I used the following:

public void testSomeFunction() throws Exception {
	ParentData data1 = populate(ChildDataOne.class);
	//..test..
	
	ParentData data2 = populate(ChildDataTwo.class);
	//..test..
}

private static ParentData populate(Class<? extends ParentData> clazz) throws Exception {
	ParentData data = clazz.newInstance();
	data.setProperty1("1");
	data.setProperty2("2");
	data.setProperty3("3");
	data.setProperty4("4");
	data.setProperty5("5");
	return data;
}
 

Setting private property without setter in Java

Not really a new trick but I had to look for the syntax today to use reflection to set a private property on an object to use it in a junit test.

Class<?> clazz = someFooObject.getClass();
Field f = clazz.getDeclaredField("somePrivateField");
f.setAccessible(true);
f.set(someFooObject, new Integer(50));
 

writing an ajax app for Sequence

Yesterday I attended Ted Neward‘s game design session at nofluff. It inspired me to begin to implement the game sequence in an ajax app. It will be a private app since I only plan to play it with some friends. But it will be hosted somewhere on my website so it can be accessed from anywhere.

Sequence is a board game my husband and I often played with two of our friends. It’s their favorite game. When I started thinking last night about potentially creating a web version so we don’t need to be physically at their house to play, I became very excited. I believe I may create something that will work with the help of php, mysql + jQuery (ajax).

Why this idea excites me

  • Before I started as a professional Java developer, I always coded in php & mysql (somewhat a LAMP developer on the side). However most of my old applications and sites are down. I no longer have the desire to maintain them. Now this is a great opportunity and incentive for me to go back to php & mysql and write something I enjoy.
  • PHP has a special place in my heart. Just a while ago, a coworker asked for my help to create him something to help with the manual text file processing he has to do every month. It only needs to be quick & dirty app. I threw together a php app in half an hour for him. It was super cool. He loved it.
  • jQuery is my favorite javascript library. You don’t have to look far in my blog to find that out. So the more I get to work with it, the happier I am.
  • I can also involve my husband on this project. Even though he’s not a programmer but he knows this game as well as I do. Normally he doesn’t have much of stake in my apps but this time he can be my lab rat :)
  • With this project, I also get to play with UI. I started as a web designer. So CSS & HTML have been my passion. There will be quite a bit of UI involved in the designing of this game.
  • It’s fun because it will be very useful. I very much look forward to the day that I can have our friends joining the game.
  • I can blog about it! I may not share my final product with the public but I will definitely share my progress & experience. Hopefully there will be challenges where I can learn some new stuff.

Last night I started brainstorming with my hushand as how I want the game to work. I started table designing and UI designing. This morning I put together a very prototype version of the UI.
sequence phase 001
I leveraged jQuery’s “redmond” theme. This way I can use all of the cool jQuery UI widgets and benefit from reusing its css for elements I want to style and create a semi prof looking app in no time.

 

ePSXe FF IX chocobo air garden issue

I spent a lot of time last night looking for the chocobo air garden on ePSXe emulator playing the final fantasy IX.

The chocobo air garden is the last location for the chocobo hot and cold game and before you get there for the first time, it could be randomly at one of these five locations.
final fantasy ix chocobo air garden locations
While your flying golden chocobo is above the black dot (shadow), if you feed her a dead pepper, she will go soaring in the air and finds the air garden. I wanted to find the air garden so I could fight the game’s toughest optional boss Ozma.

Everything was in place but I could not find the darn black dot at any of the locations. I finally found some information saying in the ePSXE emulator version of the game there is NO BLACK DOT.

So what I did to find the air garden is to park my chocobo outside of Alexandria. If you look at the location at the lower right of the map, it’s at the Alexandria plateau. Basically I just fly my chocobo at the location where the black dot WOULD HAVE BEEN if it showed, feed her a dead pepper. If the air garden is there, she lands in the garden otherwise she drops back down. If you don’t find it the first time, go back inside of Alexandria. Then come out of Alexandria and repeat the same step. Once I tried this route, I found the air garden on my second try. Who would have known?

Fortunately after you have found the chocobo air garden, it will also be marked on the map. Thank god!

 

FFIX – sharing my save

For the past a few weeks, I’ve been replaying final fantasy IX on the playstation emulator epsxe. I really love this game because it’s my very first final fantasy game. Sure you may argue it’s not the best final fantasy game but it definitely has a special place in my heart. While replaying the game, I did not want to start from scratch. I have played the game from scratch on the playstation console and have beat it quite completely before (except for the run for Exculibar II). So I started with an early save from gamefaq.com that has 99 of all items from disc one. Now I have a save I would like to share that is on disc four.

Format
This save is in mcr format and can be used on the epsxe emulator. You may also convert it using MemcardRex.exe. Although it’s on disc four, there is still quite a bit playing potential. I think I took care of most of the tedious work and you may use it to complete much of the side quests in the game.

Placement in the game
It is saved after getting the invincible on disc four prior to lifa tree. The save is outside of chocobo forest on the world map with your golden chocobo and the air ship next to you. Choco’s beak level is at 99. I have acquired all of the chocograph but didn’t finish all of them. I just hunted the ones that upgraded my chocobo. I have just visited the Mognet Central and Alexandria and is ready to deliver Kupo’s letter to Atla in order to start finishing the Mognet Central side quest. I have also finished feeding all of the friendly monsters while I was leveling up so it’s ready for you to fight Ozma – the toughest optional boss in the game.

Characters
This save contains almost 99 of all items. This includes all armors and weapons. Therefore all of the characters have their ultimate weapons. And yes Steiner has Exculibar II.

Zidane
Lvl: 92
Abilities: All learned, all equipped except auto-potion
Skills: All learned
To do: His Thievery magic still only does around 1800 damage because I never used his steal ability much in the game given I’ve already had 99 of all items there wasn’t much incentive. If you wish to work on this, I recommend that you go you Ispen’s castle because you may get up to 6 successful steals against the enemy Gargoyle.

Dagger
Lvl: 86
Abilities: All learned, all equipped except boost, healer, auto-potion (feel free to equip if you wish)
White magic: All learned
Summons: All learned
Note: Summoning Atomos does 9999 damage to all Yans

Steiner
Lvl: 85
Abilities: All learned, all equipped except auto-potion
Sword art: All learned
Note: Climhazzard does 9999 damage to all Yans

Quina
Lvl: 94
Abilities: All learned exception millionaire and healer (does not seem like they are needed), all equipped
Blue magic: Goblin Punch, LV5 Death, LV3 Def-less, Doom, Roulette, Aqua Breath, Mighty Guard, Matra Magic, Bad Breath, Limit Glove, 1,000 Needles, Night, Angel’s Snack, Frog Drop, White Wind, Auto-Life
Note: Frog Drop does around 9200 damage
To do: Continue to raise his level to try to max out his Frog Drop ability. He’s also missing a few blue magic.

Vivi
Lvl: 82
Abilities: All learned, all equipped
Black magic: All learned

Freya
Lvl: 81
Abilities: All learned, all equipped
Dragon abilities: All learned
Note: Dragon’s Crest does a guaranteed 9999 damage.

Eiko
Lvl: 79
Abilities: All learned except healer, all equipped
White magic: All learned
Summons: All learned

Amarant
Lvl: 81
Abilities: All learned, all equipped except healer and auto-potion
Flair Abilities: All learned
Note: Throw great weapons to do 9999 damage.

To Dos
Please check game faq side quest FAQs to see how they can be accomplished.
Finish all chocograph
Revive the Mognet Central
Fight Ozma
Stellazzio: Zodiac Coins
Many more side quests
Obviously finish the game and watch the awesome ending

=== Download the save ====
Added two more saves on the memory card 7/21/2010
1) Right before you may fight Ozma on Alexandria Plateau. Check the map to see where Chocobo Air Garden is. I guarantee you may beat Ozma in less than 2 rounds. Just do Zidane Thievery, Freya Dragon Crest, Amarant Throw Ultimate Weapon, Quina Frog Drop. Enjoy :)
2) Right before the last boss fight. Beat the game and watch the ending.

As a bonus, I’ve been looking around for a screenshot of all of Stellazzio coins labeled in Queen Stella’s house. Since I did not find one, I created my own. Feel free to use it to figure out which coin(s) you are missing.
Stellazzio Coins on Queen Stella's house Final Fantasy IX

 

Oracle number data type

I don’t know why I’m always confused. I need to write this down so the next time I wouldn’t be.

You may optionally specify the precision/length and scale of the number data type in Oracle i.e. number(9,2).

I remembered it as “leading” & “trailing” (the decimal point) which is INCORRECT.

As discussed here:

column_name NUMBER (precision, scale)

Precision = total number of digits and scale = number of digits to the right of the decimal point.