ASFRecorder

Just patched the ASFRecorder so that I can use my FreeBSD machine to record some radio programs. The patches are for:
  • Recognizes more mime types
  • Supports -o parameter to stream the output to stdout so that I can pipe it to ffmpeg and convert the stream to MP3


These patches can be found on ASFRecorder homepage. I just made some modifications so that it can compile with VC++ on Windows too.

You can download the source here and the Windows executable here...
(ok... so it might not be a good idea to release such patent-sensitive source code...)

Posted by clarence Thu, 16 Nov 2006 16:45:00 GMT


Swapping Hell: Compiling JDK 1.5 on Freebsd 4.x

In the past few days I was playing with some AJAX + Java codes. As I plan to deploy it to my web site later, I thought it would be a good idea to upgrade the JDK (from 1.3.x to 1.5.x) on the web server. As expected, my antique web server (K6 400MHz with 192MB RAM) took forever to compile the FreeBSD port. After several hours of hard disk crunching, the build process stopped as there was not enough swap space... yuck! The swap partition on the machine is only 128MB. So I used vn to add another 500MB of temporary swap file.

And after 14 hours, 49 minutes and 45.95 seconds later, it finally completed the compilation :P

Posted by clarence Sun, 26 Mar 2006 11:37:00 GMT


Jetspeed 2.0 with Postgresql

Tonight during dinner, my friend mentioned to me that he recently deployed a project using Portlet technology. It reminded me that when I devloped a portal site back in 2002, there was no such standard. I wanted to give Portlet a try since the draft was finalized, but yeah, I was lazy :P. Tonight I finally downloaded Jetspeed 2.

Jetspeed 2 can work with many DBMSs, including my favourite: Postgresql. But after downloading the MultiDb version installer, I found that it won't install as the appropriate SQL scripts were not created. Instead of trying to build it from source (yes, I am very lazy recently and... what the hack, I was just trying to install it on a Windows machine... so I don't want to compile from source :P), I found that similar issue has been reported and you can download the script directly.

Just start the Jetspeed installer, and it will unpack itself to an "antinstall" directory under your temp directory (e.g. C:\Documents and Settings\administrator\Local Settings\Temp). Then, before you proceed with the installer, unpack the Postgresql script package into the database directory under antinstall. Then proceed as usual.


image

Posted by clarence Sun, 12 Mar 2006 18:05:00 GMT


Calling Javascript functions from a Java Applet

Many years ago, my colleagues encountered a problem that at that time there was no generic solution. The problem was to somehow let the Javascript on a web page to verify that an Applet is loaded correctly without using polling mehtods. Out of curiosity, I tried to find out if browsers today provide a general solution and will work with (at least) both IE and Netscape/Mozilla/Firefox.

It seems that there is a valid solution since IE 4 (and yes, I haven't looked at this problem for a very long time :P). There is a way for an Applet to invoke a Javascript function and will work with both IE and Netscape/Mozilla/Firefox.

First, the applet needs to import the class "netscape.javascript.JSObject". Although the name says "netscape", but IE's VM has no problem running the Applet.

(BTW, to compile the Applet, you will need to include plugin.jar in your classpath (e.g. C:\Program Files\Java\jre1.5.0\lib\plugin.jar). It is where the JSObject class is located.)

When defining the Applet in the HTML, you need to add the "MAYSCRIPT" parameter to the <APPLET> tag. e.g.

<APPLET CODE="TestingApplet.class" WIDTH="100" HEIGHT="100" MAYSCRIPT>
<PARAM NAME="initFunction" VALUE="appletLoaded">
</APPLET>

Here, I also pass a string "appletLoaded" as a parameter to the Applet. In my testing HTML page, "appletLoaded" is in fact a Javascript function name. Inside the Applet, when it is loaded, it will call this function in its init() method.

I wrote a little testing program and put the HTML, Applet, and source code here.

On that page, the "Click Me" button was originally disabled. When the applet loads, it will call a Javascript function. And that Javascript function will in turn enable the button.

(Since I sign my own certificate, so when you visit my site using SSL, you will see a warning message. That is normal. Just click OK)

Posted by clarence Thu, 02 Mar 2006 17:00:00 GMT


Low voltage cutoff

Added a low voltage cutoff circuit to my META42 headamp to protect the lithium battery. image

image

more...

Posted by clarence Mon, 27 Feb 2006 11:06:00 GMT


Another headamp - LC-King clone

Found David Lin's LC-King circuit while browsing the web. Tried to build one. To my surprise, its performance is close to (or maybe even better than) my loaded PIMETA. Details about my version of this headamp:
  • Uses LM317 regulator
  • Class A
  • Virtual ground circuit using BUF634. 2 x 220uF rail to rail. 2 x 470uF + 3.3uF from each rail to virtual ground
  • No input capacitors
  • Volume control circuit wired as shunt attenuator
  • Currently using OPA2111BM for U1 and TL072 for U2


image

image

image

image

image

image

image

image

More photos available here

Posted by clarence Sun, 08 Jan 2006 18:00:00 GMT


foo_msn_now_playing: Send song info from foobar2000 to MSN Messenger

Edit 2008-09-17: New version of the plugin is now availabe here. This old version has been removed from the website.

Edit 2008-01-28: New version of the plugin is now availabe here. This old version has been removed from the website.


foobar2000 is a Windows audio player that has excellent sound quality. I had some fun playing with its component (plug-in) API and wrote a little utility. foo_msn_now_playing is a plug-in that sends the song info to MSN Messenger's "What I'm Listening To" function. Tested with foobar2000 v0.8.3 and Messenger 7.0

You can find the plug-in here. Download the DLL and save it under the foobar2000 component directory (e.g. C:\Program Files\foobar2000\components). Restart foobar2000. You can now find a new sub-menu called MSN Now Playing under the Components menu. Select which format to send to Messenger. Also remember to turn on the What I'm Listening To function on Messenger.

Source code is also available. Written in C++ and tested with VC++ 6.0. You will also need the foobar2000 SDK if you want to compile the source.

Have fun!

image
image

BTW, there is already a plug-in called AMIP that can do similar thing. But sadly it doesn't support multibyte characters...

Posted by clarence Mon, 12 Dec 2005 17:25:00 GMT


typo Live Search

Typo, the Ruby-based blog engine that I am using, has a cool "Live Search" feature (i.e. search as you type by using Ajax). However, it doesn't work with multibyte characters. I fixed it with modifying the Javascript from "escape($F('q'))" to "encodeURIComponent($F('q'))"... Then when trying to submit it through Trac, I found it has already been submitted :P

Posted by clarence Sun, 11 Dec 2005 17:25:00 GMT


Ripping audio CD with EAC

So far, I found EAC to be the best CD ripping tools... use it with lame to get the best quality mp3. My personal favourite command-line options: -V 0 --vbr-new -b 128 -h %s %d

Posted by clarence Sun, 11 Dec 2005 09:22:00 GMT


Headamp

Found a nice looking volume knob for my A47 headamp.

Also, the PIMETA is almost done too. Still waiting for the AD843 op-amp. Couldn't find the right volume knob so borrow it from the A47 for photo taking :P

a47
pimeta1   pimeta2

More photos here

Posted by clarence Mon, 05 Dec 2005 15:50:00 GMT


Older posts: 1 ... 16 17 18 19 20 ... 22