Archive for the ‘Programming’ Category
A Windows Programming Funny: GetTickCount
In my old office, a few times we tried to crash-test-run the application we were building, only to discover that it crashes every 49.7 days. The application, though were designed for portability, had been “poisoned” by one of our colleagues, so it had been full of Windows functions and we had no time to devise a fix for it.
“Nobody would run the application for 49.7 days anyway, right?” – we have been tempted to say. Unfortunately, some people (notably people who hibernate their Windows computers instead of shutting them down, like me, or Windows systems designed for public use or server purposes) do run their systems for more than 49.7 days.
Well, not that people would play Poker games at a location so public as a bus station ticket dispenser, but you never know, right?
-
This magic number, 49.7 days, came from the Windows GetTickCount() function. The function returns the number of milliseconds a computer has been running. Unfortunately, up to Windows XP this function returns a 32-bit integer. In 49.7 days, that 32-bit integer would have overflowed and many things can go wrong, if the application is not designed to take care of this behaviour. Unfortunately, some people don’t seem to be apt enough to read documents, since this behaviour is well-documented on MSDN.
So, according to Sue Loh in her blog (she’s a Windows CE (a “flavour” of Windows for mobile devices) developer), GetTickCount() is not always appropriate for use. Sadly, some developers don’t know this.
Check out this article:
http://www.techworld.com/opsys/news/index.cfm?NewsID=2275
The next time you use GetTickCount, you should ask yourself if the application is going to roll over 49.7 days. If so, use GetSystemTime or SystemTimeToFileTime instead.
In Vista, you can use GetTickCount64. Unfortunately if you use this function, your application will not run on the older Windows. Read here for explanation: http://en.wikipedia.org/wiki/GetTickCount#Avoiding_rollback_examples
Inauguration of .u (dot-myu)
Looking back a few previous articles, it turns out some of my writings are more review-like than for programming purposes. I have decided to separate these entries and create a new container blog for them.
I therefore present to you .µ (read: dot-myu)!
It is available in Blogspot and WordPress flavours:
http://dotmyu.wordpress.com/
http://dot-u.blogspot.com/
They have different layouts, but their contents are exactly the same. I tend to like Blogspot better because I can manage all of it on one Google dashboard, but Wordpress user interface is simpler and therefore better.
While I’m at it, I might as well mention all my other blogs:
http://dot-y.blogspot.com
Technical notes, intended for those who are in the IT field, particularly programming – it recently earned a rating of 8.1 on Blogged.com! Thank you Blogged.com!
http://dotwhy.wordpress.com
Same entries, just different site, for those who, for some strange reason, can’t access Blogspot
http://yogihw.multiply.com
Manual mirror from .Y and .µ at Blogspot, updated once in a while
http://view-and-project.blogspot.com
My less technical and more personal notes – also mirrored on Facebook notes
http://yogihw.blogs.friendster.com/view_and_project
I don’t write here any more, but some older entries, largely personal, are still archived here
More Offline Technologies
Being a freelancer working at a place where permanent Internet connection is outrageously unaffordable and dial-up is expensive and tedious, I am constantly battling with the availability of offline information. However, a lot of good things can come out of this environment. I run into great free technologies such as HTTrack website copier, and Zoundry Raven offline blog authoring tool, simply by being offline. And I find cool new use for RSS reader (I currently use RSS Bandit; I use Outlook 2007 but its RSS reader is too simple to become an offline news reader).
Being a technologist, ideas spark all the time out of my head. I think offline technology has a lot of potential for development. And living in a region where Internet access is scarce and only slightly better and less expensive than Inmarsat service, makes me I already have a dozen ideas in my head.
It hurts me, though, that even though I have ideas to try, real life complies less with them. There’s this thing called ‘money’ and I, being a normal human being, and along with everyone else in the world, am forced to make some. So the natural tendency is to spend more time on matters that actually make money, instead of exploring new ideas.
Installing Windows XP SP2 on SATA Hard Drives: The Hidden Option
I’m not going to pretend that I know everything and didn’t look elsewhere but my own experience. But this time I managed to discover something that has potential to simplify the lives of system administrators out there.
I ran into a problem this morning as a client asked to install Windows XP on a brand-new laptop. As you may already know, newer PCs often come with Serial ATA (SATA) interface instead of the usual IDE. This is a problem for Windows XP since it was made in the bygone-era of IDE hard drives.
I went online and ran into these articles:
http://news.softpedia.com/news/Install-Windows-XP-On-SATA-Without-a-Floppy-F6-47807.shtml
http://paparadit.blogspot.com/2007/06/installing-sata-hard-drive-with-windows.html
So I followed the steps of these articles (they describe one-and-the-same method). But to my surprise, when popping in the driver of the new MSI V-series laptop into my working machine, I couldn’t find the Windows XP driver for the SATA interface! For some strange reason, there is only one driver for Vista, and after building an “enhanced-by-nLite” Windows XP installation CD containing this driver and trying it on, I know it doesn’t work.
Great, now what, I thought. Dead end. I was in Singaraja at that time (a remote small town 100Km north of Denpasar, Bali), a place where no high-speed Internet has gone and I have to make do with a GPRS connection, so downloading a new device driver is definitely a no-go. I would have to get in touch with the client and ask if he would be willing to go for either Vista or a Linux distro. I personally don’t like the idea of having to install Vista on low-end laptops, and I doubt Linux will appeal, although I am a big-time advocate of open-source software and Ubuntu has made a significant progress towards making Linux more accessible to general audience. And worse, the client wanted the computer that same evening.
So, refusing to give up, I looked around again, and presto! There is an option on the BIOS of the laptop that allows detection of SATA as an IDE interface! (You can usually find it in “IDE Configuration”). Well it is actually forcing the SATA interface to behave like the old IDE, instead of the great new AHCI that features things like hot-plugging. Read more about AHCI here.
So, if you run into this kind of problem, please do yourself a favour and try this method first.
The only drawback to this approach is you will then have to find the appropriate driver for Windows XP to later activate the AHCI. Otherwise you’re stuck with the slower and less capable IDE. Not that it’s bad or anything, but it means not using your hardware to its best potential. Simply installing your chipset driver should actually resolve this issue (according to the Wikipedia article, although your mileage may vary – the laptop I was working on was still producing Blue Screen of Death 0×7B when AHCI is enabled, even though I have installed the chipset driver).
P.S. I am officially a programmer and not a system administrator, but sometimes work demands that I become both, and sometimes even more!
A Drive for Wikipedia Article Writing
I have been researching for a method that allows Wikipedia to be deployed locally and offline. Many people in this remote region (and I’m sure there are many other less developed regions) of the world still don’t have regular access to Internet.
As I searched on the Internet, I found the Encyclopodia project (for iPod) and the Kiwix project. However, these projects have decided to select only a small subset of Wikipedia articles, a fact I find somewhat unacceptable.
I agree that an encyclopedia should contain as many pictures as it possibly can. However, more important than the accompanying pictures, in my opinion, is the amount of detailed information available. If one is forced to only have a handful subset of the articles, then it wouldn’t be much of an encyclopedia.
Thanassis Tsiodras (a fellow software engineer, though 10+ years my senior), on his Google pages, highlighted bzip2recovery as a way to “break up” the bzip dump file to thousands of smaller files for on-demand article decompression, rather than the conventional method of reinserting the dump file back into MySQL database, a process that takes DAYS of full computer operation AND a 20GB+ available storage space. His approach is clean and simple, but no such luck if you are a Windows user.
Why don’t we build an integrated tool that does this automatically, I thought, and Windows-based for mass accessibility. It will make his approach accessible to more people who prefer to have “the complete knowledge of mankind” on a single DVD. Specifically, it must have the ability to:
- Read, browse, and search Wikipedia contents in a quick and timely fashion
- View ALL current articles of Wikipedia (up to the day the dump file was generated)
- Use a GUI to allow access to less technically-inclined users
- Run directly on the medium without having to be installed
- Not use a server software or any kind of software requiring socket connection
- Option to install and update the program and the contents using Internet – requiring a download manager of some kind
That was how the Wikipedia reader project was thought of. It doesn’t have a name yet. Care to suggest one? (Perhaps “T.T.” after the engineer who first described the method would be appropriate… and it’s got that catchy ring to it)
-
There is, moreover, another problem I need to think about, one that will require a little engineering on the social side. In the midst of preparing for Wikipedia reader project, I can’t help but wonder if an Indonesian version is at all feasible for distribution.
The English Wikipedia dump is 3GB in size, consisting of millions of articles on a variety of subjects. The same is not so for its Indonesian counterpart. So, to be able to effectively educate local people in large numbers, a large number of articles must either be translated to Indonesian, or rewritten from scratch.
The question is… WHO can be involved to translate or write articles on Wikipedia?
In an ideal situation, if we can set up a “mega-project” and get local university students to translate and contribute to Wikipedia, then assuming a student will write one or two articles, as many as 100,000 articles can be generated, perhaps more.
There are two main problems with this approach, however:
- Only a small percentage of people in Indonesia are educated enough to contribute to such a project. And even then, there is even smaller percentage of them who have enough resources to go online and/or write articles. I will need to find access to the people belonging in this demography.
- Most educated Indonesians will not find any motivation in contributing to such a project, without getting paid. Unfortunately in developing countries (more so than in developed countries, in my opinion), the love for money seems to be above all else. As a result, people are somewhat less inclined to make money on innovations and knowledge gathering, than simply selling stuff. It’s more “instant” income, in their opinion. I know I am probably generalizing quite a bit, but I don’t think my opinion is too far-fetched.
-
Then I thought, hey, why not start with my friends on Facebook and Friendster? Many of these people were educated in foreign lands, so they certainly qualify to either translate articles or write from scratch. They may be busy, but at least they have constant access to Internet, an unthought-of luxury on this region of the world.
That’s why this post, which I would normally consider as part of my “.Y” (dot-why) Project, is also posted on my old blog, which will subsequently be imported to Facebook.
If you read this, thank you for reading so far, and let me implore you to start writing Wikipedia articles in Indonesian. Ask your friends, too. Propagate my message. You may not get any more reward than a pat on the back, but it’s probably much more worthy of attention than sending money through AusAid, OxFam or whatever else out there. Money only lasts for a little while, but if you plant knowledge in people, it will do them good for good.
If you know of any better approach to making Wikipedia articles even more comprehensive (especially for Indonesians), by all means please let me know. I’m not a good social engineer, I acknowledge that. That’s why I need all of your inputs and comments.
I believe that this is achievable. I believe that everyone should have access to such precious knowledge, including people whom the communications corporates think are not worth connecting to. As a hacker once said, knowledge should be open source!
-
My end goal is to be able to distribute this Wikipedia reader, along with the full Wikipedia content (except the pictures), for less than Rp 20.000,- (about US$2.25) per DVD, and to have an Indonesian version of Wikipedia on DVD. Yes, that’s significantly cheaper than copied DVD’s of pirated software. From business perspective, it may not be a profitable operation (or so I think), but it will be a charity project worth the pain and the hurt.
-
If such project can be made successful, perhaps the next thing to distribute is, if not one or more of other MediaWiki contents, then HowStuffWorks.com.
e-Bible for PC/PalmOS/Symbian/Windows Mobile: The Criteria / Kriteria Software Alkitab
Before we begin with any reviews, let us define the criteria at which we will judge the Bible software packages.
Sebelum membuat evaluasi, saya akan definisikan syarat-syarat yang akan kita gunakan untuk menilai program-program Alkitab yang sudah saya post di sini kemarin.
Because we are trying to achieve the easiest penetration, the software has to be, in order of importance:
Karena kita akan fokuskan program untuk penggunaan sebanyak-banyaknya, software yang dipakai harus, dari yang paling penting:
- Simple and not overwhelming for beginners and/or non-technophiles. This includes:
Mudah digunakan untuk pemula atau orang-orang yang tidak terbiasa menggunakan komputer. Ini termasuk:
-
- Facility to find specific verse
Fasilitas mencari ayat
- Clean user interface, unriddled with unnecessary buttons and other GUI widgets
Tampilan yang bersih, tidak dipenuhi tombol-tombol dan yang lain-lain yang tidak diperlukan
- Facility to find specific verse
- Offer advanced features for more experienced bible readers and/or those who need to refer to the Bible often (but keeping in mind of the criterion #1 above).
Menawarkan fitur-fitur tambahan untuk pembaca yang lebih berpengalaman, dan/atau yang sering memerlukan referensi Alkitab (dengan mengingat syarat #1 di atas).
- Multi-language capable, especially in Bahasa Indonesia. And not just the content of the Bible itself; the whole software must be able to switch language. Many existing reader softwares still hardcode the book names, making it hard for someone unfamiliar with English book abbreviations to navigate through the e-Bible and the software in other languages. (For example, “Acts” book should switch to “Kis” or Kisah Para Rasul when opening the Bible in Bahasa Indonesia).
Bisa multi-bahasa, terutama dalam Bahasa Indonesia. Dan bukan hanya isi Alkitab saja, tetapi juga seluruh software-nya. Banyak program yang masih meng-hardcode nama-nama kitab. Ini membuat seseorang yang tidak terbiasa membuka Alkitab dalam Bahasa Inggris sulit untuk memakai software tersebut. (Contoh: Seharusnya, tulisan kitab “Acts” seharusnya dapat berubah menjadi “Kis” atau “Kisah Para Rasul” bila sedang membuka Alkitab Bahasa Indonesia).
Other criteria that I, as a software engineer, would endorse and support in the online Bible community:
Kriteria-kriteria lain yang saya, sebagai software engineer, ingin dukung keberadaannya di komunitas-komunitas Alkitab di seluruh dunia:
- Free of charge.
Gratis.
The Words and wisdom of God should not be inhibited by financial restrictions of any kind.
Penyebaran Firman Tuhan dan kebenaran tidak boleh dibatasi oleh keterbatasan dana.
- Conforming to a back-end standard of some kind.
Mengikuti sebuah standard back-end.
There seems to be a classic computer software problem ridding the Bible software productions around the world: the differing and somewhat competing proprietary data formats. At the moment the PalmBible PDB format seems to be the dominant book format, but other developers are still developing their own. This indicates that the PDB format may still be insufficient or not mature enough in terms of development.
Sepertinya pembuatan software Alkitab diliputi oleh sebuah masalah software yang klasik, yaitu adanya pembuatan banyak standard data oleh orang-orang yang berbeda. Saat ini, sepertinya format PDB PalmBible mendominasi dunia Alkitab elektronik, tapi banyak software developer yang masih membuat format mereka sendiri. Ini menunjukkan bahwa format PDB mungkin belum mencukupi kebutuhan.
- Open source.
Because this kind of software has very little financial incentive for the developers, but is useful for many, then open-sourcing it is the way to go. This way, community of developers can contribute patches without having to become individually responsible for the development of the software. This will greatly speed up software improvements and bug fixes.
Karena software jenis ini tidak memberikan insentif secara finansial untuk developer, tetapi berguna untuk banyak orang, maka open-source sangat tepat untuk diterapkan. Dengan cara ini, developer-developer dapat terus menambahkan dan/atau membetulkan software tanpa harus menunggu satu orang untuk melakukan hal yang sama, dengan model development lain. Ini akan mempercepat proses bug-fixing dan penambahan-penambahan lainnya.
- Cross platform.
This is somewhat overlapping with #2 above; if a back-end standard is achieved, then no matter what application you use and on what platform, any new version of the Bible can then be installed easily (say, from phone to phone with Bluetooth).
Ini terpaut dari #2 di atas; kalau sebuah standard back-end sudah didapat, maka tidak jadi soal software dan alat apa yang dipakai untuk membaca. Alkitab versi baru dapat di-install dengan mudah (contoh, dikirimkan dari HP ke HP lain lewat Bluetooth).
With these criteria set for the Bible softwares, let us begin our study. Wait for the next post!
Dengan kriteria-kriteria di atas, mari kita mulai pelajari software-software Alkitab ini. Tunggu tulisan saya selanjutnya!
A Blog of Ingenuities
Check out all the contraptions the engineers in Africa have come up with!
Indeed, a little (or a lot of) constraint is a great source of creativity!
Testing Picture Loading
Just testing picture loading … please ignore this post.
The Truth about e-Bibles
As a Christian, it is part of my daily routine to read and meditate (or in simpler terms, to think about) what God said through the bible. Considering that I spend probably 16 hours of any day in front of the screen, why not add a Bible application to the desktop? After all, wouldn’t it be better if I don’t have to lug around another one-inch-thick book if I have to go somewhere for an extended period (say, like, going to a remote site for a project)?
Hey, if I don’t happen to have my laptop with me, I still want access to a Bible. How about my mobile phone? I can probably dig the potential of my Nokia 6600. After all, the device is like a micro-computer on its own, and using the right software, it can definitely enrich one’s life in ways people never thought of.
There is a wealth of Bible readers on the Internet. I find it very perplexing to go through the web and try them one by one – some are easier to get because there are individuals, companies or organizations behind them; others are posted on free software sites that are somewhat dubious. I am going to write reviews on some of them, and I will focus my reports on Indonesian bible-capable readers (i.e. those readers which are capable of displaying Indonesian bible version “Terjemahan Baru”, with or without additional downloading).
It took me several days of searching around the Internet to gather all of these software sites. It will also take several more days (or weeks, or months, or years even!) to try them, because I have a software development business to run, and a foundation to take care of. In the meantime, here are all the links. Feel free to try them yourself, and please stay tuned for my reviews.
For your information, these are all free to download and use. After all, they are words from our God.
PC
http://www.bibledatabase.com/free_bible_software.htm
http://www.kristenonline.com/alkitab/download.htm (mirror dmedia.or.id)
http://www.kristenonline.com/download/alkitab/
http://www.e-sword.net/bibles.html
http://www.crosswire.org/jsword/
http://www.crosswire.org/bibledesktop/download.html
PocketPC
http://www.e-sword.net/pocketpc/downloads.html
http://alkitab.or.id/informasi/alkitab-PDA.htm
http://www.getjar.com/products/8961/DMBBibleIdBibleInjilAlkitabBahasaIndonesia
Palm OS
http://palmbibleplus.sourceforge.net/ + http://www.fica.org/PembacaAlkitab/
Smart Phone
http://www.getjar.com/products/13710/AlkitabGoBible
http://manado-indonesia.com/about/
http://www.compactbyte.com/s60bible/install.id.html
Symbian
http://sourceforge.net/projects/symbianbible/ + http://www.fica.org/PembacaAlkitab/