Friday, October 22, 2004
RE: Printing dates on digital camera pictures
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
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
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
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
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
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
Myth 1: NAND Flash is slower than NOR.
The Reality: The performance characteristics of NAND Flash are: fast write (or program) speed , fast erase speed and medium read speed. This makes NAND Flash ideal for low cost, high density, high speed, program/erase applications. Read More Read More
Although NOR Flash offers a slight advantage in random read access times, NAND offers significantly faster program and erase times. For high performance data storage requirements, such as storing digital photos, downloading music and other advanced features popular in today's cell phones, the write/erase speeds of NAND provide a distinct performance advantage. This high performance is also what has made NAND Flash cards so widely used in data storage applications such as digital cameras.
Comparing the time required to perform a typical program and erase sequence for NOR and NAND Flash, for a 64KB erasable unit of memory, NAND outperforms NOR by a wide margin, at 17 milliseconds for NAND, and 2.4 seconds for NOR. In a system application, this difference is large enough to be easily noticed by the user. For the read function, the NAND performance is sufficient to support the system requirement, without a noticeable delay for the user.
Today, many designers build upon the conventional cell phone memory architecture by increasing density of the NOR and PSRAM, and adding NAND Flash to obtain greater performance and capacity for data storage.
Myth 2: NAND is not reliable
The Reality: Just as a hard disk drive is widely accepted with little concerns about bad sectors, NAND works in a similar way in that the controller maps around bad memory areas and error correction code (ECC) is used to correct bit errors. All controllers for NAND Flash have built-in ECC to automatically correct bit errors. Read More Read More
The industry standard is to correct any bit error to a level comparable to that of hard disk drives, or 10-14, which means one bit uncorrectable error every 1014 bits (12.5 terabytes). System designers have long been aware of the benefits of using ECC to detect and correct errors Historically, memory subsystems have used Hamming codee, ECC and Reed Solomon are common in hard drives and CDROMs.
Myth 3: NAND Flash is hard to integrate into a system.
The Reality: NAND Flash has an indirect or I/O-like access. Therefore, it must be accessed through a command sequence instead of through the direct application of an address to the address linesNAND Flash also has internal command, address and data registers. Today, a wide selection of NAND controllers and software drivers are available, making integration into a system relatively simple. Read More Read More
Although this interface may appear more cumbersome than the direct interface of NOR Flash, a notable advantage is the relative ease in upgrading to a higher density chip. Because of the indirect interface, the external pinout, or connection to the host, does not change with the density of the chip. This is similar to the hard disk drive interface in which different densities of hard disk drives could use the same cable interface.
Myth 4: MLC NOR is close to matching NAND capacities.
The Reality: The maximum available density currently available in MLC NOR Flash is 256Mb. The highest available capacity for MLC NAND Flash is currently 2Gb, and the highest available capacity for SLC NAND Flash is 1Gb. Read More Read More
A common method to increase the capacity of NOR Flash is to store multiple charge levels (typically four) enabling the storage of 2 bits in a memory cell, also known as Multi-level Cell (or MLC) NOR. However, by implementing MLC architecture, the effective speed is further reduced and write/erase endurance is also reduced.
Myth 5: MLC NAND won't hold up under extended use.
The Reality: MLC Flash has a different rating for the number of read/write cycles compared to SLC NAND Flash. Currently, SLC Flash is rated to have approximately 100,000 cycles and MLC Flash is rated to have approximately 10,000 cycles. However, if a 256MB MLC card can typically store 250 pictures from a 4-megapixel camera (a conservative estimate), its 10,000 read/write cycles, combined with wear-leveling algorithms in the controller, will enable the user to store and/or view approximately 2.5 million pictures within the expected useful life of the card. That number is so far beyond the average number of photos taken by the typical user that the difference in endurance is not significant for this application. Read More Read More
For those not familiar with the technology, MLC NAND Flash allows each memory cell to store two bits of information, compared to one bit-per-cell for SLC NAND Flash, resulting in a larger capacity and lower bit cost. While SLC NAND may be more appropriate for some specific applications, the difference will not affect the many common consumer applications, including most digital camera users. MLC NAND provides a very competitive level of performance and makes high density NAND cards more affordable, resulting in its growing popularity among consumers.
Myth 6: MLC NAND does not have the performance or endurance to reliably store your digital photos.
The Reality: MLC NAND is rated to have approximately 10,000 cycles, a level that is lower than SLC NAND, but more than sufficient to meet the needs of the vast majority of consumer users. A significant portion of the NAND Flash-based memory cards on the market today are made from MLC NAND, and the continuing rapid growth of this market can be considered an indication that the performance is meeting consumers' needs. Read More Read More
If a 256MB MLC card can typically store 250 pictures from a 4-megapixel camera (a conservative estimate), its 10,000 read/write cycles, combined with wear-leveling algorithms in the controller, will enable the user to store and/or view approximately 2.5 million pictures within the expected useful life of the card. That number is so far beyond the average number of photos taken by the typical user that the difference in endurance is not significant for this application.
Myth 7: MLC NAND does not have high enough performance for streaming video.
The Reality: The performance of MLC NAND is sufficient to support the 6 to 8 Mbits/second, transfer rate needed to store MPEG2 compressed video on a memory card. This works out to approximately 1MB/second. MLC NAND can transfer and write approximately 1.7MB/second.
Myth 8: SLC NAND is a generation ahead of MLC NAND.
The Reality: On Toshiba's roadmap, SLC development leads MLC by only two to three months. Presently, for each new generation, SLC chips are designed with MLC requirements in mind, so there is little lag-time between the two types of NAND. Read More Read More
The real issue is market acceptance, not actual time-to-market for the next generation. Currently, MLC development is well-timed to match market acceptance, with 512MB and 1GB cards widely available today to meet market demand.
Myth 9: The additional circuitry needed for MLC NAND takes up a significant amount of real estate.
The Reality: The circuitry required for MLC NAND is relatively minimal. A 4Gb MLC NAND Flash chip provides approximately 1.95 times greater density than a 2Gb SLC NAND chip. We believe that the more important question to the user is "what density can you get in a chip today?" Presently, the highest density MLC NAND Flash in production is 4Gb, whereas the highest density SLC NAND in mass production is 2Gb. The market demand for ever-higher densities of removable storage makes the lower-cost, higher density MLC card attractive to users and continues to enable new applications to emerge. Read More Read More
The rated storage capacity of 2Gb SLC NAND is 271MB, compared to 529MB for a 4Gb MLC NAND Flash chip, for a density increase of approximately 1.95 times greater.
Myth 10: NAND Flash is a slow storage technology.
The Reality: NAND Flash offers excellent performance for data storage. As a point of comparison, it can offer significantly faster performance and reliability than a hard disk drive, depending on the number and size of files transferred. For a random access of a 2kB file, a typical hard disk drive might take approximately 10ms to retrieve a file, while NAND Flash would take about 0.13ms to retrieve a similar size file. For a comparable write function with the 2kB file, NAND could be as much as 20 times faster. Because it is a solid state memory with no moving parts, NAND flash features a significantly shorter random access time compared to a mechanical hard disk drive.