Sunday, February 1, 2015

Java: Create executable .jar file with command line

Continue my journey on compiling Java program in command line, I wonder how to create a runnable .jar without an IDE. Turns out it is fairly simple as I'm not dealing with a complex project.

To create an executable .jar:
jar -cvfe <output_name> <entry point> <class file>
e.g. jar -cvfe output.jar HelloWorld *.class

-c  create new archive
-v  generate verbose output on standard output
-f  specify archive file name
-e  specify application entry point for stand-alone application bundled into an executable jar file


Ref:
How to create and execute JAR file in Java – Command line Eclipse Netbeans

Wednesday, January 28, 2015

Java: Compile and run your program in command line

A friend needed some help to debug a Java program. I have JDK installed, but no Java IDE. Instead of installing one, command line come to rescue! ;)


To compile the .java files:
javac *.java

You can use the -d option to specify where to place generated class files, e.g.
javac -d "build" *.java


To run the compiled code:
java <class_name>
e.g. java HelloWorld

You can use the -cp option to specify the class search path, e.g.
java -cp "build" HelloWorld

If you defined a package, you'll need to specify it, e.g.
java -cp "build" MyPackage.HelloWorld

Tuesday, January 20, 2015

Mac: Write .img file to a SD card

1. Use diskutil list to determine the driver identifier of the SD card

2. Unmount the SD card.e.g. diskutil unmount /dev/disk3s1

3. Write the .img file to the SD card, e.g.
sudo dd if=filename.img of=/dev/rdisk3 bs=1m


Ref:
osx - Writing .img file to SD Card from a Mac - Raspberry Pi Stack Exchange

Sunday, January 11, 2015

Android Studio: Project Location

As of Android Studio 1.0.1

Path: .AndroidStudio\config\options\ide.general.xml
Name: lastProjectLocation

Path: .AndroidStudio\config\options\other.xml
Name: recentPaths

If you want to rename your project, you should update the following files within your project:

.idea\.name
.idea\modules.xml
.idea\workspace.xml
<project_name>.iml

Saturday, January 10, 2015

foobar2000: Edit ReplayGain information

As of foobar2000 v1.3.6

To edit the ReplayGain values manually, you need to first enable the context menu option.
1. Navigate to Preferences -> Display -> Context Menu
2. check ReplayGain -> Edit ReplayGain information

Sunday, December 7, 2014

Win7: Event 7026 - boot-start or system-start driver failed to load

Problem:
After installing Windows 7 with an external DVD drive, I noticed there's a system error in event viewer:

The following boot-start or system-start driver(s) failed to load:
cdrom


I was surprised because I don't have an internal DVD drive, and my external DVD drive was no longer connected. I would not expect Windows to attempt booting from a DVD drive.


Solution:

1. Open regedit
2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\cdrom
3. Change the value of Start to 3 (manual) or 4 (disable)


Ref:
Event ID 7000 or 7026 is logged in the System log on a computer that is running Windows 7, Windows Vista, Windows Server 2008 R2, or Windows Server 2008
Nonexisting CDROM keeps failing to load... - Microsoft Community

Tuesday, September 2, 2014

Drakengard 3: Route D tips and tricks

Yesterday I finally beat Drakengard 3. It was bad enough where I had to search online for help. Here is some tips & tricks I found which helped me unlock & finish Route D.

Unlock Route D:
You need to collect all weapons in order to unlock Route D. Meaning you need to collect tons of gold to buy all weapons from the shop, hunt down a bunch of treasure chests, and complete a handful of Accord's missions.

Tips on gold farming:
Use Spear - demise's warning bell (from chest in Route C part 4)
Equip Sword - dark blood blade (37800G from shop), it helps building up the blood gauge faster.

Do the 2nd Accord mission of the Desert 3 times, then do the payday mission. Depends on your performance, repeat this cycle 3 times should get you enough gold to buy all the weapons from the shop.

Treasure chests and Accord's missions:
After purchasing all weapons, I was stuck at 98% completion! Thanks to this walkthrough by DraikTempest, you can refer to the weapon locations and mission list to see which one you are missing.

Final Boss:
The final boss seems impossible to beat, especially the part where the screen went completely dark. Luckily, final boss timing guide come to rescue! I would strongly recommend you to download the video and play it offline to avoid any network latency or video lag.
【DOD3】音ゲー譜面のようなもの - YouTube
Dragon-on Dragoon / Drakengard 3 Route D Last Boss Timing Guide - YouTube

If you're feeling lazy, just watch the walkthrough on YouTube ;)


Ref:
Any tips for collecting money? - Drakengard 3 Message Board for PlayStation 3 - GameFAQs
Gold farm - Drakengard 3 Message Board for PlayStation 3 - GameFAQs