Saturday, November 11, 2006

[NP.Eye] Nayna

sp : np
French     :     oeil
Chinese     :             眼睛 (yǎnjīng)
Kirat                       :                              Muk
Greek: óma
Tibetan  : ག་ (mig)
Russian          :           glaz
Italian                                                   :                                        occhio
Korean                 : 눈 (nun)
German                                      :                               Auge
Japanese  :目 (me)
Spanish: ojo
Nepali/Hindi             :             aankha
Sanskrit : नयनम् (nayanam)
Indonesian : mata
English : Eye


--What they call Nayna (Eye) in different languages.

Tuesday, October 17, 2006

[Color.of.Mind] Cowboy bebop theme song for me

  my cowboy bebop theme song is blue

what's your cowboy bebop theme song?

Monday, September 18, 2006

[Color.of.Mind] I was wondering

I was wondering..
and I just kept on wondering...
I wonder a lot. Not only on Einstein’s dream or the cycle of fifth or the single-threadedness. Why there should exist a sense of attachment if it is to always end in pain (if not you then the other one). I always believed logic should be the guide not emotion. Emotion blinds you from simple and obvious truth. Again it was me who wrote in his diary with color painted words.
“What is the strongest thing in the universe? The Strength of the Emotion”

On Sunday the 17th Sept 2K6, I returned to Dhilung’s paradise again, n I was not alone. She was with me. Reflection in that window glass was telling us something. A notice board reads “….silence …, Please kindly respect this environment.”

Dhilung’s paradise

Didn’t know from where to start but it has already begun…

Never cared much about my gaps between the fingers, now its filled up and I didn’t even know when …

When u r overwhelmed by floods of thoughts u really can’t n dont have time to write it down because you just love to flow like that.
Did it rain today?
Am I listening to Marty’s Arrival?
I'm still wondering

Wednesday, August 02, 2006

[Tech.Notepad] Facts behind "Bush hid the facts"

Do it:
  1. Open Notepad and type "Bush hid the facts" without quotation marks
  2. Save it and reopen it.
  3. Can you read it back?
When I first heard about this from Abhi yesterday, I was surprised. It worked in old NT workstation to new XP. Why is this not fixed yet?

Googling "Bush hid the facts" revealed a lot of interesting blog posts and forum threads promoting anti-bush conspiracy but I could not find any satisfactory answer.

I thought of doing my own analysis. Here is what I found.

First of all, Hex Viewer showed that content of the file was not modified … something happens after reading those bytes. Displayed characters were giving hint that there is some problem in character encoding. While trying to re save that file encoding was changed to Unicode. How did notepad determine that the file is Unicode? It must have used IsTextUnicode() win32 API. In a debugger I set a breakpoint at advapi32.dll ! IsTextUnicode(). Stack trace along with the disassembly showed that:
int __stdcall IsInputTextUnicode(LPVOID lpBuffer,int cb) function of Notepad calls
the advapi32.dll's IsTextUnicode(); This ultimately calls ntdll.dll's RtlIsTextUnicode().
This Undocumented Native API function holds the logic which “determines whether a buffer is likely to contain a form of Unicode text”.

010070B1 >/$ 8BFF MOV EDI,EDI
010070B3 |. 55 PUSH EBP
010070B4 |. 8BEC MOV EBP,ESP
010070B6 |. 51 PUSH ECX
010070BB |. 8D45 FC LEA EAX,DWORD PTR SS:[EBP-4]
010070BE |. 50 PUSH EAX
010070C2 |. FF75 08 PUSH DWORD PTR SS:[EBP+8]
010070C5 |. FF15 0C100001 CALL DWORD PTR DS:[77DFD5FD] ; <&ADVAPI32.IsTextUnicode>
010070CB |. C9 LEAVE
010070CC \. C2 0800 RETN 8

We can see that IsInputTextUnicode is passing 0xFFFF in options flag which means test procedure includes all the flags including 'IS_TEXT_UNICODE_STATISTICS'. As there is no Unicode signature bytes 0xFF, 0xFE [ÿþ] (or 0xFE, 0xFF [þÿ] for big Endian) in file header, it tries to predict buffer type using byte statistics (This might include deviation of double byte values as each Unicode codepage is range constrained).This is a problem of classifying linearly separable set of inputs. Statistical analysis inherently demands large set of data (here large file) and fails to give satisfactory result in case of small set. In case of “Bush hid the facts” IsTextUnicode() returns 2 that is the value of 'IS_TEXT_UNICODE_STATISTICS'. According to MSDN this returned value means “The text is probably Unicode, with the determination made by applying statistical analysis. Absolute certainty is not guaranteed.”.


This is neither an anti-bush conspiracy nor a notepad specific bug. Any application using IsTextUnicode() API with IS_TEXT_UNICODE_STATISTICS flag set are vulnerable to this problem. MSDN clearly states this API is sort of guessing call when 'IS_TEXT_UNICODE_STATISTICS' flag is set in option parameter. A wrong guess of IsTextUnicode() tells Notepad to show non-unicode text as Unicode and the result is what you saw (If a Chinese language pack was installed in your system you probably saw a beautiful Chinese quote, alas .. u couldn’t read it).

The ultimate solution is improving the analysis algorithm. I made a quick patch(12KB) just for fun. You can make yours or directly patch using any hex editor with following file comparison info.

C:\windows\system32>fc /b notepad.exe notepad_patched.exe
000064BA: FF FD

Bush facts are now public!
This patch simply tells notepad to call IsTextUnicode() including all tests except 'IS_TEXT_UNICODE_STATISTICS'.
Probably MS developers were tempted to leave it as it is to make notepad kinda auto-localized app. Text editors like PsPad n UltraEdit which don't use IsTextUnicode() ,don't allow Bush to hide facts but they don't handle signature bytes missing Unicode file properly.

Enjoy Reverse Engineering Statistical Analysis and find your won ‘bush facts’.


"Matrix can not lie"


"What are you doing"


“Osamabin laden leading all terrorist”

or even

“Einstein's thought regarding mathematics motivated Dhilung Kirat thinkin mathematics wonderfully amazing languagez”

(Tips for making your own bush facts) ;-)

When the text is grouped in double character set in sequence, make sure that SPACE is always the first character. i.e first word always even characters length and all other odd characters length. Also keep the ACSII value of the characters as dispersed as possible in each word.

Got some interesting bush facts?

Monday, July 17, 2006

[Art.Past] PaintBrush

Recently one of my friends Tina from Germany sent me some of her paintings. She said there is one canvas in her room still left incomplete for months. Looking at those art pieces, I was compelling her to finish that one but silently asking myself, “what about u? u too have an incomplete canvas waiting in ur room.”. It's been a while since I haven't got time to involve myself into paintings. In fact it has been almost 6 years! I discovered when I counted those years.

Here is a collection of snapshots from the purgatory with a time-lapse camera.

Mother (1992) --what a 9yrs old boy(me) thinks of a mother

Lenin (1996) --I used to enjoy making portraits

Death (1998) --I've been in to this place

Mary (1999) --Copied From NatGeo

Basanti (2003) --Cover of my Dad's book

In those 6 years I was always busy with my pet projects and college projects. I was more into programming, guitar and gaming rather than paintings. Influence of Satch, Marty(megadeth) and Batio seems to outweight Van Gaugh , Picasso and Bangdel. Wait! It just "seems to" but not exactly. I continued my artwork in digital space. Few commercial graphic designs and animations. Actually my first paid job was an animation project.

But the most pure digital form of art I'm involved is programming.Art is about exploring, finding and expressing. I consider programming as a  medium of expression -- another form of art. For a software company each line of code is just another company secret but for us it’s the line of creation. If it gives some sense to you then I have done a lot of paintings using the palette of logic in different mediums, C++ being the most frequent. Programming is like writing a poem. You don’t care whether it will be read carefully by someone or not but its wonderful enough to give you the different level of [self-]satisfaction that you won’t get anywhere. If you fall in this genre you already know you are not alone.

“Weekends were made for programming.”
-- Karl Lehenbauer

"After three days without programming, life becomes meaningless."
-- Geoffrey James, "The Tao of Programming"

"Life begins when you can spend your spare time programming instead of watching television."
-- Cal Keegan

"Add yours in comment :-)"

Friday, July 07, 2006

[Tech.AOL] A confrontation with AOL

It all started with this Messagebox. I’m not trying that hideous trick with live link on messagebox screenshot. I got this real messagebox after downloading and running the AOL (America Online) setup. I was already annoyed by those useless clicks and redirections to find the actual download link. I wonder why they don’t place a direct download link at the homepage or download section (thirst for click count?). Now after about 50MB download (small KAZZA like installer (downloader) hides it at “Documents and Settings \All Users\Application Data\AOL Downloads” and does not let the user know. I had to use the FileMon) what installer wants is to close all my conversations, shutdown servers, stop other downloads …. to let its work done … so called installation. What if I choose not now? … No use of already downloaded installation, with Resume, installer downloads (rechecks) that 50 MB download to start off real installation process. BTW, Did you noticed the stupid instruction

To exit an application, click on the application’s name on the taskbar at the bottom of your screen, then click the X (Close button) at the far right of the title bar.

If someone doesn’t know how to close an app, probably he/she won’t be downloading this installation.

I strongly support Mark’s philosophy, avoid installations as far as possible, and always opt for portables. I feel ridiculed when I see huge MSI package installalers to install notepad.exe like software (for those who don’t know: MSI package takes two huge snapshots of system before and after manual installation and creates an installation script taking that delta change which is executed in later installations). At least after using psexec.exe, procexp.exe and the like which in true sense installs itself beautifully (installs service (even across network), driver) silently, yet handles every installation environments. Installers are likely to leave registry junks and possibly file junks, making system more and more junkyard-like. Most frightenings are those installers which don’t even ask for minimum installation options and directly injects itself into your system.

My annoyance started doubling-up when I found that most of the MBs of download were for the animated installation wizard. After installation of the product I was amazed by the number of AOL processes running in MY system. List goes like this
  • Two services with 3 processes (AOL Connectivity Service (AOLAcsd.exe), AOL TopSpeed Monitor (aoltsmon.exe & aoltpspd.exe)
  • Six autostart configured process (AOLSP Scheduler.exe , AOLDial.exe, AOLSoftware.exe, IPHSend.exe, PortAOL.exe" –Run, AOL.EXE" –b)
  • Two explorer extensions (AOL IE toolbar and AOL deskbar)
  • AOL engineers know well how expensive is a process for the OS, all those context switches, resource allocations and the like. They also know that it doesn’t require a battalion of processes to do what they are doing. They simply think user doesn’t know it. Another AOL product AIM Triton leaves a continuously running hidden process (aolsoftware.exe) even after exiting the visible one keeping communication with the server alive.

    After all this, a quick google (“Worst+software+AOL”) gave this page. Now I figured out why it TOPPED the Worlds WORST software chart with perfect first position.

    “Once people realized what content was available elsewhere on the Net, they started wondering why they were paying AOL -- it has never overcome the stigma of being the online service for people who don't know any better”
    But the surprising fact is there are lots of people in US who uses only the AOL product line in its kind. It’s ok for the stories of 90s when AOL was synonymous to Internet for US citizens, but its 21st century. I was amazed when Pramod Dai from support told me that he recently encountered a client from US who was completely unaware of other IMs (Yahoo, googletalk ..) and always used AOL’s IM (Instant Messager). (Think of it, user of AOL’s IM has to pay a monthly bill!! So Weird business plan still working …). This shows how a company’s marketing policy can blindfold its users. It’s not that hard to find a Windows user who thinks “Every OS should have a Start button”.

    Let’s leave AOL products, but why others are also following its foot steps and continuously eating up PC resources much more than they really deserve? How can we expect efficiency form an app (Yahoo Messenger) with 42+ private dll dependencies? MSN live uses 40+MB ram with normal run. I’m only talking about IMs coz I think at least they should be efficient, small and resource friendly as they are most likely to be executed continuously in background. (May be you are using it right now :-)

    That's the thing about people who think they hate computers. What they
    really hate is lousy software.
    -- Larry Niven and Jerry Pournelle in "Oath of Fealty"

  • Wednesday, May 24, 2006

    [Color.of.Mind] Knowledge Base?

    At home, I was playing with my newly written program fortune, concept ported from linux, passing -m argument with "einstein" pattern. I thought that I must recall those past quotations frequently. The level of acquaintance over the philosophical reasoning, and the amount of knowledge that I have is constantly changing ( I hesitated to use the phrase "constantly increasing") as a consequence, different level of understanding. Reviewing those words I'm finding entirely new meanings, or just getting some sense of what the words are trying to point, or in some places completely clueless, otherwise.
    After sensing the complexity of NP complete problems, still un-proved problem of convergence of multilayered Neural Networks, another un-proved problem of the discrete half of seemingly quite obvious histogram equalization in digital image processing , also the perfectness and beauty of the value 'e' the 2.7182... , the pi, and phi, I realized the lines from Einstein in greater level then I used to in my school days. I know this is still far from the complete absorption of the sense Albert has implied.

    "As far as the laws of mathematics refer to reality, they are not
    certain, and as far as they are certain, they do not refer to reality.
    -- Albert Einstein
    (famous mandelbrot(z=z^2+c) fractal from GNU Xaos)

    Mathematics is the written form of the universe, but if we don't see mathematics , may be we haven't sharpen our eyes to see it all. The transcendental eyes that see codes running inside TheMatrix. You may, but someone might not see the single-threadedness in all these blinking cursor,windows, buttoms,MSword,explore, winamp.. bunch of hidden processes (services) and the Operating System itself in a PC. Each has to submit there machine codes to the majestic CPU one at a time. Even in the multi CPU the implementation of Spinlocks in kernel level, forces some level of single-threadedness. For instance, lets take a game, a single process with handful of pseudo-threads, so many things happening at the same time! Who is willing to see the single threadedness? perhaps only the developers, the game gods, specially the Physics engine developers, who are suffered by this inevitable single-threadedness most.

    Why I'm writing so much about the single-threadedness is to show that how simply we take things for granted and make our judgments that later transforms to strong beliefs. Considering today’s considerably simple Computer System as the universe, who knows, one day it might evolve to an extent that there will be computer subjects at higher abstraction comparable to psychology and social studies. Think of this single-threadedness at that time, buried deep inside. Actually it wont, because it's a creation of human, already well documented and everyone knowingly or unknowingly knows that computer works in 1, 0.

    Taking this analogy little further, how hard it would be to find out this simple fact if the previous knowledge is cut off from everyone. This would be the situation of present the universe. Everything lost at the time of big bang, the singularity. If somebody supposebly finds out the single-threadedness, would it be accepted by every one? People are so much reluctant to contradiction that simple alternate view presented in The Da Vinci Code , just as a fiction novel, receives so much protest, considering the fact that nobody knows the exact truth. Now we know feelings and emotions are completely the processing of mind, nothing to do with heart. Still it is considered too silly to say "from the bottom of my mind". May be the mathematics is always referring to reality but we are not able to perceive it with our cognitive functions, possibly because of this reluctances that we develop along with our age. Some loves to call it common sense.

    Friday, March 31, 2006


    I can initialize an array as
    char my_array[9];

    but can't have the element my_array[9].

    Isn't it funny/ridiculous?.
    If not ->
    you r a good programmer. U know the counting of programming world.
    i.e. '0' (Zero) is NOT nothing.

    Abhi taught me this great lession in programming!!

    In contrary, someday I'll write about this 'Zero' thing, "The Nothingness" that I see everywhere. Sunyabad? Nihilism? Postmodern?

    Friday, March 10, 2006

    Buddha is not a god.

    Last Saturday I was dabbling around with fundamental philosophies of different religions with my friends. What I believe is god itself is a creation of human mind. Concept stimulated by the deep seated sense of insecurity and catalyzed by the sense of defeat against thousands of unsolved questions. God has been a perfect scapegoat. Most of the religions are based on superstition. They actually promote sin. Someone will come and protect you from your sin if you worship him. Isn’t that a violation of the entire cause and effect construct? What I like most about Buddhism is it reminds you to be good. That is all. Faith on ourselves is what it teaches us not to depend on the Someone special. If you cause a sin then prepare for its effect and the repercussion.

    One man from behind, questioned me about the source of information, whether it was Tripitak or Veda. He ridiculously started to claim that Buddhism is just a branch of Hinduism. Buddha is the 5th incarnation of Vishnu etc.
    Maybe I had generalized things too much but I’m not ready to accept that Buddhism as a branch of Hinduism.

    First of Buddhism is not actually a religion at all. It’s a system of education. Shakyamuni Buddha can’t be the incarnation of Visnu as he is not a so called God at all. He was not able to perform amazing magic’s like god/goddess, Christ or Sai baba. He was unable to conjure up life into dead man. He didn’t claim any divine status for himself. He is merely a teacher who was enlightened.

    Today people visit the Hall of Dharma Protectors to burn incense, prostrate and offer flowers and fruit praying for protection and safety. This is superstition, directly influenced by Hindu rituals. Images and statue of Buddha and Bodhisattvas were teaching tools designed to inspire our mind and wisdom not to worship them. There is academic Buddhism taught in universities where Buddhism is treated purely as philosophy, especially in Japan. Its truths are so distinct from the primary concerns of other faiths that some western observers see Buddhism not only as philosophy but even psychology. We can see this aspect in Wachobsky brothers The Matrix or hear it in Sandman’s house trance lyrics fills between euphoric upliftings. This is not exactly Buddha’s education either.
    I liked the true Buddhism. It doesn’t impose blind beliefs, rather it teaches us and let us experiment the truth for ourselves. This is probably the most scientific aspect of Buddhism, the cosmic religion as Einstein said.


    Sunday, March 05, 2006


    Today we (Puspak,Dinesh,Nikhil and me) had a Gummba tour near Uttarkhel. I met Puspak after a long time (about 3yrs).

    First stop (Dinesh n me)
    dinesh n me

    We reached here though gummba was already closed. Special permission ! Actually Our senses were actively searching for a presence of a huge dog, which was supposed to stop us !

    Can u hear the voice of silence?
    how low can you go?

    This is where Dinesh guaranteed that scientist will not find out how human brain becomes mind in this century. The basic problem he figured out was: we engineers can isolate a system, generalize it, and study it, but brain cannot be treated that way.

    it's the time to return.
    it's time to return

    Let's have something to eat.
    it's time to returnWe happened to discuss about the true existance of god here. Nikhil believed in some thing outside nature who is more powerful. Me n Dinesh strongly argued that Nothing is outside the Nature. May be there is something outside this universe, may be there r certain phenomenon and facts still unknown to us (actually we estimated it to be 99% that is unknown to us), but all these are Under the laws of Nature.

    I believe God is something the creation of our mind (the human mind which is so extraordinary and exceptionally creative, again ironically the creation of nature).
    When we don't find solution, when something is unexplained then we put God as the answer, just to recover from the sense of defeat (for me), for others to recover from the sense of insecurity. I once read a print where sense of insecurity (to be specific 9/11 attack) was used to promote Christianity, that is, Christ is the only one to protect u from Bin Laden. Let's stop here.Back at Puspaks home (The library) I saw a 5 volumes (each with thousands of pages) of Ophthalmology (Puspak is in his last semester of MBBS). So many facts just about an eye! Even Nature herself had to do so much development (evolution?) to handle ElectroMagnetic waves, what about us?

    Returning form Attarkhel in a microbus we were discussing about the fundamental philosophies of different religions. Weird right?
    Some thing unexpected happened !
    More about this in next post.