27 December 2010

Playing MIDI with Gstreamer

Yay this is cool! I finally understand how to use wildmidi.cfg :lol and playing pachelbel canon midi.


This is GPL Gravis Ultra Sound pats: http://freepats.zenvoid.org/ (download freepats-20060219.zip)
edit: and someone will release CC-BY 3.0 GM set here
for reference the original wildmidi binary can be found here

gstwildmidi (already patched, see update)

Now take a look at ".wildmidirc" inside wildmidi.7z for a while, this is a modified wildmidi.cfg from freepats which contain standard instrument channel assignment with optional tweak (amplification, sound panning etc.) at the top you'll find "dir C:\Users\Public\APPLIC~1\WildMidi" which told wildmidi where you put GUS pat (the freepats). This path by default is "C:\Documents And Settings\All Users\Application Data\WildMidi" in english Windows XP. This file need to be placed in C:\Documents And Settings\[username] a.k.a %USERPROFILE% or %HOME% or what whatever equal in your Windows.

Making a self contained PyGTK installation

Tired of figuring out dependencies? Me too
PyGTK *could* be easier to install if they adopted the way WxPython or PySide installed, which sadly this is inherently impossible. However I think there is a trick for this!

Look at pygtk.pth under [Python]\lib\site-packages folder, a pth (stand for path?) is read by python interpreter as initialization before user start importing stuff. The idea is inject PATH insertion in pygtk.pth. Note that unlike py file pth file accept only oneliner script like in "python -c" command.

Here is my modified pygtk.pth:
for python 2.7:

gtk-2.0
import sysconfig; pygtkpath=sysconfig.get_path('platlib')
import os; os.putenv("PATH", os.path.join(pygtkpath,"
gtk-2.17.2") + ";" + os.environ["PATH"])
gtk-2.0
import distutils.sysconfig, os; os.putenv('PATH', os.path.join(distutils.sysconfig.get_python_lib(),'gtk-2.17.2;') + os.getenv('PATH'))




Now put GTK runtime in [Python]\lib\site-packages\gtk-2.17.2 and you're done!
note that if you keep bin folder of GTK (not put it outside) then use "gtk-2.17.2/bin" instead of "gtk-2.17.2"

Therefor a true all-in-one installer is possible by put GTK runtime (just the dlls without redundant C devel files) together, maybe one day I'll make one...

26 December 2010

Better lockup your ftp.exe

The trend of trojan now is to download chain of actual virus (many directed to .cn domain) initiated by short innocent-look batch file then bang a fresh trojan break lose and your AV just unable to detect them :D. The use of ftp.exe (ftp command line tool in C:\Windows\System32) become more prevalent being ftp is part of Windows.

But we could still lock this downloader from being executed by applying deny (execute) rule from security tab to not only all users type but also system (hopefully the virus wont reset the acls :s). For Windows Home Edition users they must use cacls.exe command line tool to provide the same effect. Renaming or deleting it wont helped cause this operation will trigger Windows' protected system files restoration.

16 December 2010

Chrome OS soon to be released?

At least for the first time today Chromium OS reach 0.9.x version which naturally smells like beta/rc to me, visit hexxeh's snapshot build here and try it. Still downloading... this would be my first experience with Chrome/Chromium OS :)

Oh when it fully done I desperately hope SketchUp will get ported there! umm no? oh it's netbook OS not workstation :sigh:

02 December 2010

An optimistic dmraid?

It's great when ubuntu lucid detected my fakeraid several months ago though I have slight suspect it was also broke my one of array disk later. Now for stupid reason I need to move my ubuntu from dedicated OSes disk into one of my storage disks (now non-RAID). Surprise! it can't find root partition... The RAID is gone (from BIOS) but finally after googling a while there is a metadata that written in array disk that need to be cleared.

OK so how I able to type dmraid if I got no accessible Ubuntu? Tell me if I can use Ubuntu rescue mode... but I already use OpenRC liveCD instead. And here is how:

dmraid -r
--> this should show where raid metadata written in the affected disks
dmraid -r /dev/sda -E
--> this should strip metadata on each disks mentioned before

you need sudo if not root already

At first I was scare to enter those commands as I've no backup supply at the moment (what if it erase my partition table / bootloader?) but hey it works! it's totally safe :)

20 November 2010

Good experience with GooCanvas

Today I just finished my client software to design a t-shirt and the likes. Not sure why she don't just buy legal but cheaper general-purpose graphics software rather than hiring me. Anyway I'm back on pygoocanvas to deal with this basically compositing image software, previously I ever tempted to make usable 2D CAD software that way beyond my ability that time.

Pygoocanvas is really a time safer library should you ever make graphics application based on Python and GTK. With basic animation support (not as robust as clutter though) I can imaged a presentation software would benefit from it. And cairo canvas also make PDF generation a snap. Really like this library!

15 November 2010

Django-1.2.3 Docs in CHM

Meet Django

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Developed four years ago by a fast-moving online-news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high-performing, elegant Web applications quickly.

Django focuses on automating as much as possible and adhering to the DRY principle.

They will prepared for version 1.3, right now 1.2.3 is the last stable version. Ning in this site has made a bookmarked and clean chm version (download). Great for windows user!
I decided to made it myself it's plain easy actually: "make htmlhelp" and let Html Help Workshop do the rest!
For Django 1.3:
Djangodoc.chm

12 November 2010

Two monster that beat 7-zip

This is just a remark for my experience way back 5 years ago. That time I just barely heard about 7-zip and found a monster called WinRK (still in version 2.16). I conduct a benchmark (just a little) to my amusement today.

The test file is unfortunately just one: emule.exe (damn that WinRK is too slow for my processor). Here is:

emule 0.50 : 5.49MB
WinRK : 1.25MB
Uharc : 1.65MB
7-zip : 1.68MB
WinRAR : 1.79MB

All set at best (slowest) setting, WinRK did insane deep analysis for an exe file and took 6 min. to complete! (not multi-threaded) while game warez cracker's de-facto choice UHARC is the one that better with a little time overhead. I choose Emule because it is already a composite file, have few megabytes of unicode text, dozens bitmap images and the binary itself. Zip and BZip2 result is more than 2MB.

Analysis did take important part of compressing especially in solid mode. While 7-zip and others separate executable from data file by file extension (not by actual content) then sorted based on similarity (again only by filename) this often lead to inefficiency (in compression not time) due to mis-detection unless you came up with your own filelist. WinRK took this seriously, maybe their compression method isn't much better than LZMA (7zip) but their analysis did! It has some passes where it will chop most file into more edible chunks before compressing like no others. Imagine if I had to compress the whole Gimp with WinRK! probably will take the whole night :)) on my E2160.

If you are someone with obsessive-compulsive personality disorder try WinRK! maybe version 3 have multithreaded support? (note: it's not free)

11 November 2010

Portable GTK theme selector

I modify the old gtk2_prefs.exe (GTK theme selector) to only able to modify host application's gtk (a.k.a per apps setting), for example if you put this on inkscape installation you can only modify theme for inkscape and wont affect other (e.g Gimp). This is great for portable apps? or admin user who have privilege over %programfiles%.

The original version defaulted to current user setting which effectively render all GTK based apps you're installed to obey it. If you already apply this setting you must delete %USERPROFILE%\.gtkrc-2.0 (note: this is a file not folder).

gtk2_prefs.exe  (place this along side main executable e.g gimp.exe, inkscape.exe, mypaint.exe)
Refer to this post to add some themes
Enjoy

New PyGTK for MyPaint?

I've been playing PyGTK 2.22 for a while now, and I think it could make its way into next MyPaint, no more major bugs (of user interface) as far as I know and windows theme bugfixes already there. Finally a real successor of 2.16.x version after skipping 2.18 and 2.20

I'd like to see PyGTK team build this version with Numpy support though, but if not I will uploaded it here. Still waiting official binary...

edit:
Ah and the answer is absolutely NO, it turn out that pressure sensitive tablet has problem

edit:
gtk.Recentdocument assertion failed... my my I'm a bad tester am I? Folks of linux said it has something to do with specific Icon Theme! Well gtk win32 doesn't even have such! what should I do then? :)