Posts

Online Booking Is Safe

Mahmoud al-Mabhouh, one of the founders of the Izz ad-Din al-Qassam Brigades, was recently found dead in his hotel room in Dubai. Dubai authorities stated they were ruling the death a homicide and according to BBC : Investigators have also discovered that 14 of the suspects had used credit cards issued by MetaBank - a small bank based in the US state of Iowa - to book hotel rooms and pay for air travel.

In-Memory DB, H2 and Python

Our log data is sent to a log server which then saves it in a PostgreSQL database. To prevent the database from growing too large, we periodically remove data older than 24 hours from the database and save it for future query. However, queries on the remaining data is still not fast enough for realtime monitoring. Besides, the vacuum process of PostgreSQL fails to handle gracefully the large number of deletes and slows down our system significantly when it runs. I'd like to replace the whole logging system with a Hadoop-based system. But right now, I need something that can be up and running in 2 to 3 days and has no or minimal impact on the rest of the system. The log server would save all log data into log files. At the same time, it runs a embedded in-memory database that has the most recently log data for our realtime monitoring applications to query. Of the final choices of in-memory databases in H2 , HSQLDB and Apache Derby , I decide to go with H2. Since our monitor...

Setting up BandLuxe C179 on Karmic

I've recently signed up with Singtel's mobile broadband, which uses a BandLuxe C179 HSDPA USB modem. Hers's how I set it up on Ubuntu 9.10: Download Linux driver from http://www.bandrich.com. The file name of the download "C270-Eee-PC_Linux-driver.zip" suggests it's intended for C270. The product id in bandluxe.fdi is wrong, change it to: <match key="usb.vendor_id" int="0x1a8d"> <match key="usb.product_id" int="0x1009"> The kernel module option.ko that comes with the driver doesn't work with 2.6.31 kernel. And we don't need it anyway, so comment out its installation from eeepc3g.sh: #echo "Backup file option.ko" #cp -v ${MODDIR}/kernel/drivers/usb/serial/option.ko ./option-eeepc.ko #echo "Add support of Bandluxe Data Card" #cp -v option-bandluxe.ko ${MODDIR}/kernel/drivers/usb/serial/option.ko Install the driver: $ sudo ./eeepc3g.sh $ sudo modprobe option Plug in the modem. $ lsusb...

Use Relative Path in Free-form Netbeans Projects

For free-form projects, Netbeans uses absolute path for project directory in project.xml : <properties> <property name="project.dir">/Users/yili/Work/homecamera/WowzaStreaming</property> <property name="ant.script">${project.dir}/build.xml</property> <properties> All paths in project.xml are relative to the project folder, which is the folder that contains the nbproject folder. Thus changing the above to the following makes my project works on all platforms regardless where the project is located: <properties> <property name="project.dir">../../../WowzaStreaming</property> <property name="ant.script">${project.dir}/build.xml</property> <properties>

The Best Farewell

It has always been my ambition to die in harness with my head face down on a keyboard and my nose caught between two of the keys -- Isaac Asimov

Setup Audio for Windows 7 on MacBook Pro 13"

My brand new MacBook Pro 13" dual-boots on Snow Leopard and Windows 7. I used the official Snow Leopard DVD to install device drivers for Windows 7. Everything worked fine except for audio, which had a very low volume for both playback and recording. Here's how I fixed it. Run registry editor as administrator and go to: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentVersionSet\Control\Class\ {4D36E96C-E325-11CE-BFC1-08002BE10318}\0000\cs420x Make sure the following entries are present: Name Type Value ------------------------------------------------------ n0DInAmpCaps REG_DWORD 0x00270301 n02OutAmpCaps REG_DWORD 0x80017f73 n03OutAmpCaps REG_DWORD 0x80017f73 n04OutAmpCaps REG_DWORD 0x80017f73

OpenSSL and Windows Socket

A program I'm working on gives many compilation errors like this: c:\Program Files\...\PlatformSDK\Include\WinSock2.h(108) : error C20011: 'fd_set' : 'struct' type redefinition c:\Program Files\...\PlatformSDK\Include\WinSock.h(54) : see declaration of 'fd_set' This occurs when both WinSock.h and WinSock2.h are included and WinSock.h is included before WinSock2.h . Since WinSock2.h guards against WinSock.h by defining _WINSOCKAPI_ , including WinSock2.h before WinSock.h is not a problem. windows.h also includes WinSock.h , thus windows.h must come after WinSock2.h . In my code, all the platform dependent stuff goes into platform.h , in which WinSock2.h is included before windows.h , so what is the problem? It turns out that my code uses OpenSSL and openssl/rand.h includes windows.h . Putting platform.h in front of openssl/rand.h solves the problem.