Friday, October 22, 2004

RE: Printing dates on digital camera pictures

A very useful free software that adds the date. And it can be run in
batchmode so you don't have to manually process every single file.

Here is the link.

http://www.friedemann-schmidt.com/software/exifer/

Thursday, October 14, 2004

Slurping Kho Ping Ho's Novel Books

Are you one of many Indonesians who love reading classical martial art novels of Kho Ping Ho? If yes, you might have probably known that www.detik.com online has been providing online edition of his novels. At the time I am writing this blog, it is publishing "Harta Karun Jenghis Khan".

Unfortunately, the site provides only a few pages of the current novel every day (although the past novels are achived there), but one album might takes hundreds of these pages. I am a very lazy person in term of reading this site everyday. If you are like me, I have developed two simple scripts to download the whole album therefore becomes readable offline. One thing you need to know that, in order to get a complete set of the novel, you have to wait until the last episod gets published. Currently, the default link for the site you need to pass to geturl.tcl script is http://jkt.detik.com/khopingho/ [ name of the album ] /episode1.shtml

To run the script:

- do: geturl.tcl http://jkt.detik.com/khopingho/[albumname]/episode1.shtml. For example: geturl.tcl http://jkt.detik.com/khopingho/hartakarunjenghiskhan/episode1.shtml
- type: merge.tcl
- Enter the number of episodes (the number of episod*.shtml files you just downloaded, or any number that quite big such as 5000)
- The result will be: albumname.html, and there will be a directory called "images" which will contain all the pictures (if any).

Ok, enough talking, now save the following script as geturl:


#----------- geturl.tcl -------------------
#!/bin/sh -e
# exec tclsh "$0" ${1+"$@"}

if {[lindex $argv 0] == "" } {
puts "$argv0 "
exit
}

set url [lindex $argv 0]
set urlpath [file dirname $url]
set logfile "[file tail $urlpath]\.log"

puts "Getting $url ..."
puts "log file: $logfile"
puts "You can see the progress by typing \"tail -F $logfile\""

set par "-nv --force-html --tries=0 --cache=on --convert-links --recursive --accept=shtml --domains=detik.com --no-direct
ories --glob=on -L -p -m --page-requisites -np -nd -o [file tail $urlpath]\.log $url"

set res [ exec sh -c "wget $par" ]

#----------------------- end of geturl.tcl -----------------------


and the following as "merge":


#----------------------- start of erge.tcl ----------------------
#!/usr/bin/tclsh

proc AskAndGet { msg }
puts -nonewline $msg
flush stdout
return [gets stdin]
}

set n [AskAndGet "Number of files: "]
set title [string range [pwd] [string last "/" [pwd]] end]

puts "Title = $title"
set fho [open "merged.html" w]
puts $fho ""
puts $fho ""
puts $fho "\n\n"
puts $fho ""

for {set i 1} {$i <= $n} {incr i} { set fn "episode${i}.shtml" if {[file exists $fn]} { puts "File $fn exists...wait while I merge it ...." set fhi [open $fn r] set line [gets $fhi] set line [ string trim $line ] set line "$line\n" while {![eof $fhi] & ![regexp -nocase {} $line]} { set line [gets $fhi] set line [string trim $line] set line "$line\n" } ## found the start point, now read it until we find while {![eof $fhi] & !([regexp -nocase { } $line] || [regexp -nocase { } $line]) } { set line [gets $fhi] if {[regexp -nocase {Episode belum ada atau sudah habis} $line ] } { continue } if {[regsub -all {\xC2} $line "" line]} { puts "0xC2 found and been removed" #exit } if {[regsub -all {[\x93]} $line {"} line]} { #puts "OPENQUOTE: \{$line\}" } if {[regsub -all "\x94" $line {"} line]} { #puts "CLOSEQUOTE: \{$line\}" } if {[regexp -nocase {http://jkt.detik.com/khopingho/images/(.*).jpg} $line dummy imgname]} { if {![file exists "./images"]} { file mkdir "./images" } set imgname "${imgname}.jpg" if {![file exists "./images/$imgname"]} { puts "Downloading picture: $imgname" set imgurl "http://jkt.detik.com/khopingho/images/$imgname" eval { exec wget -q $imgurl } if {[file exists $imgname]} { exec mv $imgname "./images" } } else { puts "$imgname exists in ./images; not downloaded" } regsub -nocase {http://jkt.detik.com/khopingho/images/(.*).jpg} $line "./images/${imgname }" line } puts $fho $line #puts $line if {[regexp -nocase {} $line] || [regexp -nocase {.*>[ ]*[ ]*TAMAT[ ]*} $line]} {
puts "End of episode $fn"
break
}
}
close $fhi
} else {
; #puts "File $fn does not exists"
}
}

puts $fho "\n"
close $fho

#------------------------ end of merge.tcl -----------------------

Tuesday, October 12, 2004

Fermat's Last Theorem

Have you known that Fermat's last Theorem has been proven in 1994 by Andrew Wiles, a british mathematician working at University of Princeton, USA. He got his Ph.D from Univesity of Cambridge, UK. See http://www-gap.dcs.st-and.ac.uk/~history/HistTopics/Fermat's_last_theorem.html

Pierre de Fermat (1601 - 1665) is a french lawyer (yes, a lawyer!) who pursued maths in his spare time. He is most famous for scribbling a note in the margin of a book by Diophantus that he had discovered a proof that the equation xn+yn = zn has no integer solutions for n>2. He stated "I have discovered a truly marvelous proof of this, which however the margin is not large enough to contain." The proposition, which came to be known as Fermat's last theorem, baffled all attempts to prove it until A. Wiles succeeded in 1995.

For detail, see http://mathworld.wolfram.com/FermatsLastTheorem.html

Monday, October 11, 2004

Quantum Computing

Interesting articel!. As it says, the future computer will not be based on tiny semiconductor gates, but will be using atoms' spins as its logic. It forecasts that around year 2030, the width of a single wire in a microprocessor will reach the width of single atom and this is the limit, if scientists do not find other ways for computer technologies.

Computers built using this physics of quantum mechanics will be 1 BILLION faster than a Pentium-III PC. So for applications such as decryptography (cracking up secured code) can be made in minutes instead of months or years. Amazing!

In August 2000, researchers at IBM-Almaden Research Center developed what they claimed was the most advanced quantum computer developed to date. The 5-qubit quantum computer was designed to allow the nuclei of five fluorine atoms to interact with each other as qubits, be programmed by radio frequency pulses and be detected by nuclear magnetic resonance (NMR) instruments similar to those used in hospitals (see How Magnetic Resonance Imaging Works for details). Led by Dr. Isaac Chuang, the IBM team was able to solve in one step a mathematical problem that would take conventional computers repeated cycles. The problem, called order-finding, involves finding the period of a particular function, a typical aspect of many mathematical problems involved in cryptography.

Full article can be read at:
http://computer.howstuffworks.com/framed.htm?parent=quantum-computer.htm&url=http://www.amd1.com/quantum_computers.html

Friday, October 8, 2004

Today's Faster ever-made PC in the world?

Recently, I was browsing to the Internet and google "fastest PC" and got to a site called "Michael's SuperComputers" @ http://www.michaelscomputers.com/. They said it outperforms it's nearest competition 12X faster than Apple's G5 Dual 2.5GHz.

According to the site, the computer is horsepowered with Pentium4 3.6 GHz Extreme edition (I wonder how much this processor cost? In Apr-Jun 2004, I checked the price some online stores it was above $1000 bucks!). The other thing is that they say it uses SATA-X Hyperdrives. I never hear about this SATA-X, but I guess it's a modification of SATA, or the next version of SATA.

For multimedia outputs, they use the top-end VGA card either from NVidia 6800 Ultra or ATI X800E 256 MB and SoundBlaster's Platinum Audigy ZX soundcard for the audio.

I doubt it is the fastest PC now as it lacks PCI-X slots, no information about Firewire2 (800+ Mbps transfer rate), support for dual or multi-core processor (a processor with dual/multiprocessor on single die, which I believe it will be faster than current processor) but you better check it out.

Saturday, October 2, 2004

Internet Radio

Have you tried Shoutcast? It is very interesting plug-in for Winamp. Using the plug-in, you can broadcast the MP3 files being player by Winamp to the Internet. Unfortunately, the method it uses is unicast, meaning that every user that is connected to your server will double the bandwidth usage unlike multicast-based servers. If you know any free MP3 multicast server for Linux, please let me know.

I like it when I tried with my Linux, it is very efficient although for Linux there is command line only (well, according to www.shoutcast.com, you can use XMMS player but I tried it with no success). For every user connected to the server, it opens a thread/worker to give service. The listener itself listens at port 8001, while port 8000 is used to give a website that you can see what song is playing, song history, and statistics (for the admin only - you can set the password for this).

If you are interested, you can try it or pay a visit to my experimental site: mlutfi.homelinux.org