Wednesday, 18 April 2012

Google New look is ugly!!!

It is very sad that google forces users to switch the Gmail web interface to "new look". For people have small screen like me.

The "new look" wastes a lot of space, see below two pictures for the comparison. The "new look" have some useless larger floating banner constantly block the top right screen, which makes the actual reading area smaller than the "old look". The compact mode doesn't help this at all.

1. The figure of "new look"
2. The figure of "old look"

Tuesday, 1 December 2009

PortAudio Windows Programming Getting started

Portaudio is a cross platform open source audio API. It supports Linux, Windows and MacOSX. It provides the simple C programming API for audio programming. It seems wrap the low level audio driver such as DirectX and ASIO. Here are some notes when I tried to use it under windows platform.

1. Configure the development environment in windows XP platform:

1) Download the source code of the portaudio and :
http://www.portaudio.com/download.html (there is no platform dependent source code). I used snapshot (latest on the day).

2) For fully supporting low latency Steinberg ASIO audio driver, you will need to download the ASIO SDK:
http://www.steinberg.net/en/company/3rd_party_developer.html
follow the instruction in \portaudio\build\msvc\readme.txt, to copy the files form ASIO SDK source code into the portaudio \portaudio\src\hostapi\asio

3) Also for fully support DirectSound from Microsoft, you will need to download Microsoft DirectX SDK and Microsoft Windows Platform SDK (if you have not installed before, it looks like server SDK) as well. If you have problem with the library path etc, check this link.

4) You can use Visual C++ Express 2008 to compile it which is freely downloadable from Microsoft. The solution file can be converted into new format.

2. compile the sample code:

Double-click the “portaudio\build\msvc\ portaudio.sln” file and compile or build as normal. It should be built successfully. You will find some useful files in the debug directory, portaudio.lib and portaudio_x86.dll.

To compile a test program use portaudio library. You will need to add a new project into current solution, following through the instruction here:

http://msdn.microsoft.com/en-us/library/ms235636%28VS.80%29.aspx

Add new project into portaudio solution

clip_image002

Technorati Tags: ,

Create win32 console application

clip_image004

clip_image006

Change setting by un-checking the “precompiled header”

Remove the other auto generated source code only leave the sinetest.cpp. Right click the sintest project and change the references to add new reference to the portaudio project.

clip_image008

And also modify the c/c++ general property to add portaudio include path.

clip_image010

Copy the content of patest_sine.c into sinetest.cpp (rename to sinetest.c). Add portaudio.h into header files folder in visual stiduo.

Then you can find your first portaudio executable file sinetest.exe at folder:

“portaudio\build\msvc\Debug”.

You may need portaudio_x86.dll at same folder to run the program. Good Luck!

Tips: The DirectX SDK I used (August 2009) did not insert paths information to Visual Studio. The simplest way to solve this problem is to run the “dx_setenv.cmd” script from:

C:\Program Files\Microsoft DirectX SDK (August 2009)\Utilities\bin

Monday, 21 July 2008

ugly gnome setting hits bug

When plugging an usb hard drive into ubuntu 8.04 pc, it is automatically mounted under "/media/something". Right click the mounted media, you can access the properties of the media. Click "Volume" tab, unfold "setting" option, the users seem to be able to setup their own mount parameters such as "mount point", "file system", etc. Naturally, I tried setup my own "mount point" such as "/mnt/name". Then when I plugged out/in media again, the automounter stops working. It gives you an error message: "Cannot mount volume. Unable to mount volume..., mount_point cannot contain the following characters: newline, G_DIR_SEPERATOR (usually /)"!

It turns out that you cannot put full path like "/mnt/mymntpoint" into this field (which is by all means what people think so). You can only put one name in this field for example: "foo", then the gnome-mount will use that name with prefix "/media/" and mount your media under "/media/foo" which is quite annoying for Linux user. The only way to get rid of this error is to use "gconf-editor" under your own login (without sudo). Changing the key "/system/storage/volumes/_org_freedesktop_Hal_devices_voume_uuid_*/mount_point" to "foo" will be fine again. Also you can delete all keys and values of that field, so gnome-mount can use default name and mount points.

The bug is reported here:
https://bugs.launchpad.net/ubuntu/+source/gnome-mount/+bug/107668

At least underneath the "setting" option of "Volume" tab, gnome should give some detailed message or validate the user input before letting gnome-mount messed up!

Wednesday, 16 July 2008

seamonkey 1.1.9 couldn't install Adblock Plus 0.7.5.5

I rebuilt machine recently and apt-get installed seamonkey 1.1.9 from ubuntu official repository, though current stable version of seamonkey is 1.1.10. One of the major reason of using mozilla types of browsers are the existing excellent addons. The very first one I always install is Adblock Plus. My my previous experiences, the seamonkey doesn't support installation into local profile of Adblock Plus. When you install it, you will get the error message as following:

"This extension requires write access to the application directory to install properly. currently write access to some of the relevant subdirectories is forbidden, you probably have to log in as root before installing. after installation no elevated privileges will be necessary, read access is sufficient to use Adblock Plus."

The only way is to let Adblock Plus installed into application directory, for example: /usr/lib/seamonkey/. So you will need to:

1. using root privilige mode to start seamonkey, for example: (sudo seamonkey) .
2. install Adblock Plus at privilliged mode.
3. start seamonkey as normal.

However, the above approch doesn't fix the lastest version Adblock Plus 0.7.5.5 along with seamonkey 1.1.9 . As reported in the following link in Adblock Plus forum:

http://adblockplus.org/forum/viewtopic.php?t=2550&start=0&postdays=0&postorder=asc&highlight=


The symptoms are: 1) you installed Adblock Plus at root mode without problem, but when you switch back to normal seamonkey startup. The addon wasn't there. 2) the size of bottom toolbar of seamonkey is larger and ugly than normal. it messed up.

The solution now is to install eariler version of Adblock Plus 0.7.5.4, you can select earilier version option from mozilla addons page. It works fine for me.

Wednesday, 18 June 2008

apt-get behind ISA proxy server

Computer is behind company proxy server running Microsoft ISA. The http proxy address is 192.168.16.6 the port number is 8080. ubuntu 8.04 is installed, though firefox is working by setting up proxy and use domain/username password to get through, the apt-get cannot work properly whatever you try any methods. The solution is ntlm project.

  1. download 0.9.9.0.1 version.
  2. tar -zxvf ntlmaps-0.9.9.0.1
  3. modify the following parameters:
    PARENT_PROXY:192.168.16.6
    PARENT_PROXY_PORT:8080
    NT_DOMAIN:YourDomain
    USER:yourname
    PASSWORD:yourpassword
  4. $ ./ntlmaps-0.9.9.0.1/main.py &
    $ export http_proxy="http://127.0.0.1:5865"
    $ sudo apt-get update
  5. Now you can have built-in package installed
    apt-get install ntlmaps

  6. add proxy into apt configuration file: create
    /etc/apt/apt.conf.d/proxy
    with content:
    Acquire::http::Proxy "http://127.0.0.1:5865/";
  7. modify your general proxy setting and your synaptic proxy setting as well
note: my firefox seems faster to directly use proxy address 192.168.16.6 rather than using NTLM listening address "127.0.0.1:5865"

To reconfigure you ntlmaps using new proxy address:

sudo dpkg-reconfigure ntlmaps


References:

http://michaelcarden.net/blog/?p=58
http://www.lupaworld.com/912/viewspace_2210.html

Thursday, 20 December 2007

Root me in OS2008 for N800

2007-12-18 Nokia released update version OS2008 for N800 and N810. I flashed my N800 with this new image (RX-34_2008SE_2.2007.50-2_PR_COMBINED_MR0_ARM.bin).

The OS2008 for N800 is still developer beta. Some community packages are not mature enough to support it. For example the CJK support is essential for me to read Chinese fonts. However, it currently doesn't support OS2008 for N800. I installed it regardless. Then tablet can read Chinese fonts but the scim actually locked virtual keyboard (the virtual keyboard never pop out) therefore it is useless because you cannot type anything in. The only way I can think about is to ssh login N800 from my pc and kill the process of scim and apt-get remove it. Installed ssh and try to connect it as root but it seems doesn't accept "rootme" as default password for root like OS2007. By searching mailing list, you need to enable R&D mode:
http://maemo.org/community/wiki/rdmode/
At first I saw this document I think you need to reflash image to enable it. But Actually the
"sudo ./flasher-3.0 --enable-rd-mode" command doesn't need to reflash image instead it just enable device to boot into R&D mode.

Ok, now I get root prompt via SSH, killed the processes of scim and apt-get remove the scim packages. And my N800 /OS2008 is perfectly (at least usable for me) to read Chinese fonts based webpages and documents (that's all I need).

UPDATE: The fonts only package from MaemoCJK can be found on the following link:
http://maemocjk.garage.maemo.org/dists/chinook/test/binary-armel/

The Chinese fonts is:
http://maemocjk.garage.maemo.org/dists/chinook/test/binary-armel/ttf-arphic-newsung_1.3.0-1maemo1_all.deb