Monday, September 13, 2010

Windows 7 shuts down, but not powers off...

I spent the past weekend upgrading my main home computer from XP Professional to Windows 7 Professional.  The process itself was surprising painless - the Windows Easy Transfer did a good job retaining all settings, files, and preferences (that I can think of) from my old computer through out the "Custom" upgrade process (which is basically a clean install).


As I was marveling at the prospect that, maybe for the first time, Microsoft actually produce a complex OS that is faster, more stable and easier to use than before, I noticed something - the computer would shutdown, but not power off...

Now, this is quite different from the majority of the "Windows 7 shutdown problems" reported all over the web (for which faulty drivers were largely to blame).  In my specific case, the Windows would complete the software/OS shutdown procedure, you would hear the click that generally precedes the powering off of the PC, but no powering off.  When you forcefully off the computer by holding on the power switch and reboot it, Windows 7 reported no problem whatsoever with the previous shutdown (i.e. no complaints at boot-up, and no errors to speak of in any of the event logs).

Very quickly, I suspect it's something to do with the ACPI (Advanced Configuration and Power Interface) and made sure I double check the ACPI settings in my BIOS (and made sure I have the latest BIOS as well) and making sure the appropriate chipset and ACPI drivers are all up to date.  None of those made any difference.

As I resorted to endless Google searches and parsing through a on of non-related, but yet similar cases, I finally came across the following posting by "dandudley" in the Microsoft Answers forum.  http://social.answers.microsoft.com/Forums/en-US/vistawu/thread/bd18fed7-5d39-40f4-bd5a-8acad6b3bd26/#de72d5d1-9da8-4a34-93e9-7b479490c376

Basically, the problem is with Windows 7's inability to power off the IEEE 1394 (i.e. Firewire) controller on the computer - the driver was installed by Windows 7 without the setting for Windows 7 to power it off.  This is got to be one of the goofiest bug one could make in software configuration management (from the vendor's perspective).  :-(   Oh well, I guess it's unreasonable to expect Microsoft to get all of their acts together all at once...

For those who doesn't care to click on that link, the following is quoted from dandudley's posting:
If your motherboard has a firewire port, you will need to check in device manager if it is set to allow the computer to switch off the device, SIMPLE and EASY. You can do this by going to properties of the devices under IEEE1394 Bus host controller and going to power management. After that, make sure the "allow this computer to turn off this device to save power" is ticked.

Step by step for noobs:

"Windows Start Button" >> Control Panel >> Hardware and Sound >> Device Manager >> IEEE1394 Bus host controller (expand) >> double click "VIA 1394 OHCI Compliant Host Controller" (this could be different on your machine) >> Click on "Power Management" tab >> Check the box "Allow the computer to turn off this device to save power" >> click "OK".

Now your computer will shut down normally from here on out :)

Sunday, September 5, 2010

Converting MP3 to DVD-Audio (DVDA) format...

I bought a used 2006 Acura TL about 3 months ago. It's a very nice car - drives great and have all the amenities that one could expect from a car. Well, all but a MP3-capable entertainment system...

For what must have seemed like a good idea at the time, Acura decided to use the ELS DTS sound system that didn't support mp3 format (this was rectified in 2007) - I guess they were betting on the fact all the legal issues with mp3 (and music sharing in general) at the time and DVD-Audio was supposed to the solution to all that. DVD-Audio stores 5.1 DTS audio in looseless format and it's really quite a treat when you listen to it. However, I am left with a situation where I can't enjoy my existing library of mp3 songs in my car...

While there are commercially available high-end sound editing software that would encode audio to the DVDA format, I was hoping I didn't have to get those professional software (with the license tag of several hundred dollars) just so I could continue to listen to my mp3's. With a bit research and some investment of time, I have derived the following open-source solution that would do the job just fine and as painless as it could be. :-)

For those of you who read ahead and are wondering why I chose to (1) not bother converting the MP3s to 5.1 DTA wave files and (2) why I bother to convert the wave files to FLAC files, here are my rationales:
  1. MP3 format stores music in stereo sound format and why BeSweet has the capability to convert it to 5.1 DTS (change the BeSweet parameter of -2ch to -6chwav, if you should choose to do so), I decided to leave that to my sound system and not over-engineer this solution - I tend to think the fancy sound system will do a better job at it.
  2. DVD-Audiofile has reportedly had some issues with wave files and doesn't catch potential problems with the music as well as it would with FLAC files.
What you will need:
  • BeSweet (the latest and most reliable version is v1.5b31, available here)
  • FLAC (the latest version is 1.2.1 and you only need the command line tool, available here)
  • DVD-Audio (the latest version if 0.60, available here)
How to put it together:
  1. Download all the above programs
  2. On your desktop, create a folder called "DVDA Studio"
  3. Extract BeSweet to a folder inside the "DVDA Studio" folder (e.g. BeSweet1.5b31)
  4. Extract FLAC to a folder inside the "DVDA Studio" folder (e.g. flac)
  5. Extract DVD-Audio to a folder inside the "DVDA Studio" folder (e.g. DVD-Audio)
  6. Create a folder called "Output" inside the "DVDA Studio" folder
  7. Inside the "DVDA Studio" folder, create a new text file, copy and past the following into it, and rename it "makedvda.cmd"
@echo off
SET BESWEET="BeSweetv1.5b31\BeSweet.exe"
SET FLAC="FLAC\flac.exe"
SET DVDAUDIOFILE="DVD-Audiofile 0.60\DVD-Audiofile.exe"
SET SOURCE="WHERE YOUR MP3 MUSIC ARE"
SET OUTPUT="Output"

For %%T in (%SOURCE%\*.mp3) do call :2WAVE "%%T"
For %%T in (*.wav) do call :2FLAC "%%T"
For %%T in (%OUTPUT%\*.flac) do call :2SYNC "%%T"
%DVDAUDIOFILE%
PAUSE
GOTO :EOF

:2WAVE
REM Check if either the .wav or the .flac exists, if so, don't repeat the work
SET T=%1
SET TT="%T:~26,-5%.flac"
SET T="%T:~26,-5%.wav"
IF not exist %T% IF not exist %OUTPUT%\%TT% %BESWEET% -core( -input %1 -output %T% -2ch ) -ota( -hybridgain )
GOTO :EOF

:2FLAC
SET T=%1
SET T="%T:~1,-5%.flac"
IF not exist %OUTPUT%\%T% (
echo Encoding %1 to %OUTPUT%\%T%
%FLAC% -s --delete-input-file %1
move %T% %OUTPUT% )
GOTO :EOF

:2SYNC
REM Check if the .mp3 has been removed from Source, if so, remove the .flac
SET T=%1
SET T="%T:~8,-6%.mp3"
IF not exist %SOURCE%\%T% (
echo Removing %1
del %1 )
GOTO :EOF

  1. Open up the "makedvda.cmd" file for editing by right-clicking on the file and select "Edit".
  2. Replace the string "WHERE YOUR MP3 MUSIC ARE" with the actual path to the folder where your mp3 musics are stored (e.g. C:\Documents and Settings\Christopher Lee\My Documents\My Music). Make sure you kept the quotation marks before and after your directory path, or the script won't produce the correct results.
  3. Replace the number "26" with the actual length of the string you entered in step 9 (include the quotation marks in your count). There are two places for this replacements - at the following two lines:
SET TT="%T:~26,-5%.flac"
SET T="%T:~26,-5%.wav"

  1. Backup your mp3 collection (just in case we run into unexpected bugs with the script). Just make a copy of the folder and put it elsewhere.
  2. Double-click on the "makedvda.cmd" file and it should go through all the steps to convert mp3 file to wave files (while adjusting the volume automatically to avoid "clipping"), and then to flac files.
  3. If all goes well, the conversion is completed without errors and the DVD-Audiofile program is launched.
  4. Open up the "Output" sub-folder, drag and drop all the .flac files into the DVD-Audiofile program, and Click "Make ISO". An ISO image of the DVDA disc is then created.
  5. You can then burn this ISO image onto a DVD disc using your favourite DVD Authoring software. If you don't have one, I recommend ImgBurn (highly functional and free, available here)
  6. Now go enjoy your mp3 collection in your DVDA player. ;-)
Troubleshooting:
If you run into problems with the file conversions, chances are the mp3 file(s) have some defects that BeSweet and/or Flac doesn't know what to do with. In those cases, you will likely notice .wav files left inside the "DVDA Studio" folder in addition to some error message in the command prompt box. Please erase those .wav files and/or corresponding .flac files in the "Output" folder (sometimes a partial .flac files are generated by Flac before it encounters an error).

I would either re-create the mp3 from the original media or re-download it from the original source, and try again. If you no longer have access to the original media/source, I would use a decent mp3 encoder to try remediate the problem by en-encoding the mp3 file(s). "Sound Switch File Converter" is a nice free tool for this and it's available here. The script is smart enough to not re-encode those that have been converted successfully.


Sunday, June 20, 2010

Revisiting "Mizu no Ko-Koro"

As I progressed into the senior belts portion of my karate training, I started to learn about this concept of “mind like water” (in Japanese, “Mizu no Ko-Koro”). Like most ancient Zen proverbs, the true meaning behind this concept did not come easy in the beginning. I immediately picked up the “calm” attribute of still water where the mind remain in perfect harmony with its surrounding and is reflective (like a mirror) of those around it.

However, it was not until earlier this year that I came to realization of the “dynamic” attribute of water – it reacts to disturbance or provocation but return to still immediately after. This came to me one class as I had to fend off seemingly never-ending series of classmates in continuous sparring and self-defence drills. I had to go from calm and relax (so I could quickly identify and respond to an attack) to performing proper techniques with the appropriate level of intensity and conviction to counter the attack (i.e. the ripple and/or the waves of the water as it is disturbed/provoked) and return to the original state of calm. I then realized that water is both the most yielding thing in natural (it remains still when undisturbed and go around those in its way) and the most ferocious force in natural (it can cut through rocks and destroy anything in its way) and it switches between the two almost instantaneously.

The understanding of "Mizu no Ko-Koro" led to my new understanding of self control. Self control is more than just self restraint, it is restraining oneself always and respond with absolute conviction when it is the only way to preserve what is valuable – the well-being of oneself and/or those it endears. And just like water returns to its original stillness after the storm passed through, self control also demand the same level of restraint when the threat ceases.

Friday, June 26, 2009

...about myself...

I'm a Karateka and an Information Security Enthusiast.

Karateka is the Japanese word for "Karate Practitioner". I'm a fan of the philosophy behind the traditional Karate-Do, and enjoy the study of the Kata's, the Kihon's, and their Bunkai's.

Information Security connects with me ever since I started my career in Information Technology in the 90's. I have had the good fortune of doing security infrastructure design/implementation, intrusion analysis (e.g. packet/stream analysis), forensic analysis, policy review, security assessments, course instructions, and manage consulting teams with very good people and organizations.

With my focus on the business aspects these days, the publicly available memories of my hands-on past are those participations with the Honeynet Project’s Scan-of-the-Month (SOM) challenges.
The opinions expressed here are strictly of my own, and are not representative of my employer/association. Hope you find them useful.

Chris

A Short Essay on Budo

Budo (武道, in Kanji characters) is Japanese word for “the Martial Way”. This “martial way” is the philosophy of the ancient samurais.

The word Bu (武) can be deconstructed into two other Kanji characters: 止 (which means “stop” or “prevent”) and 戈 (which means “spear” and carries the connotation of fighting). As the result, Bu carries an esoteric meaning of “to stop/prevent violence” and Budo is better translated as “the way to stop/prevent violence”. This esoteric meaning of Budo is what separates samurais (or honourable warriors) from others who seek violence as a mere mean to other meaningless/selfish gains, such as hired assassins or bandits.

Some people today use Budo interchangeably with Bujutsu (武術,, in Kanji characters), but they are actually fundamentally different from each other. Bujutsu focuses on the combative techniques, as jutsu is the word for techniques or skills, while Budo focuses on the philosophy that provides the self-improvement and self-developments aspects of the honourable warriors’ lifestyles. Effectively, Budo replaces the goal of “training to become a better fighter” with “training to become a better person”.

From the 8th century to the 16th century, Budo was referred as the ethical ideals of the samurais and included such concepts as obedience, loyalty, and respect. Budo, as a fighting system, was developed in the Tokugawa era (1600-1867) when the samurais were transformed from a fighting class to teachers, merchants, and government officials. These social changes, necessitated by the prolonged peace time during the era and the government’s attempt to reduce the potential for violence, spurred a movement to recreate the experience and preserve spiritual and ethical ideas of the past classical warriors in a new form (i.e. Budo) with the new emphasis on serving the individual and the society as a whole. The focus on effectiveness of the techniques to kill an opponent gave way to self-defence (i.e. control/prevent violence) and self-improvement. (Caile)

The teaching of the Budo philosophy is vital as part of any martial arts training. Instead of merely developing the combative technique/skills (i.e. the jutsu), the philosophy instils the moral and the discipline to its practitioners and provide them with the grounding necessary to stay on-course and live honourable lives.

In essence, the philosophical component (i.e. do) of Budo compliments its technical component (i.e. jutsu) and creates that balance necessary for the development of martial artist that could both prevent violence inflicted upon others through their martial skills and prevent themselves from misusing those martial skills for the wrong purposes.



Bibliography
Caile, C. (n.d.). Defining Budo: Evolution of Spirit. Retrieved June 23, 2009, from FightingArts.com: http://www.fightingarts.com/reading/article.php?id=81

Thursday, October 2, 2008

Karate Ni Sente Nashi

“Karate Ni Sente Nashi” (空手に先手なし, in Kanji characters) is the second principle in Sensei Funakoshi’s Twenty Precepts (“Niju Kun”) and is translated as “There is no first attack in Karate”. It is believed this principle goes hand-in-hand with the spirit of Budo (i.e. the way to prevent violence) and the reasoning behind each traditional Kata begins with a block.

Mizu No Ko-Koro

“Mizu No Ko-Koro” (水の心, in Kanji characters) is a Japanese phrase that translates into “Mind like water”. It refers to the state of displaying calmness in the face of adversity, not over/under-reacting to disturbances (i.e. the ripples in the water is merely representative of the disturbance), and return back to the calm once the disturbance is over.

Louis Frederic (Frederic & Crompton, 1998) translated and defined it as:
“A mind (spirit) like water. The perfect calm which the mind or spirit can find, producing a non-aggressive state and a feeling of "passive" resistance. Whoever possesses Mizu-no-Kokoro is thus sensitive to all impressions, just as water is sensitive to the slightest breath of wind, and his or her Ki is in harmony with all beings.”

Bibliography

Frederic, Louis & Crompton, Paul (1998). A Dictionary of Martial Arts. Tuttle Publishing, North Clarendon, VT, USA.