Archive

Archive for August, 2006

Brain’s Filing System Uncovered !

August 28, 2006 2 comments

An amazing and fascinating discovery by Harvard Medical School (HMS), is realted to those neurons in Brain which assist in categorizing visual stimuli. Important development mentioned as is:

While much is known about how the brain processes simple visual features such as colors, angles, and motion-directions, less is known about how the brain learns and recognizes the meaning of stimuli. The process of grouping related visual images into categories allows the brain to organize stimuli according to their meaning and makes it possible for us to quickly make sense of our surroundings.”

This is again an amazing development as I have interests in Artificial Intelligence and such things attract me a lot, and such news and development is always a sense of intrinsic stimuli and fill an urge to know more. Read the details at here.

Advertisements

Pluto removed from Solar System !

August 28, 2006 5 comments

I am quite late now, initially I was composing this post on 14th August and the initial draft was like,

Science keep’s moving, that’s what came to my mind when I heard that our Solar System will most probably be reduced to 8 planets and Pluto will be removed from the list. It will be considered as a Dwarf Planet, when some other round heavenly bodies like 2003 UB313 (of same size of Pluto) and some others were discovered. However Pluto’s fate will finally be decided, when a new “scientific and simple” proposal to define the word “planet” will be released on this Wednesday and astronomers will vote on it next week by The International Astronomical Union (IAU). Details can be read at here.

But when I finally got the time to post this, we all have missed Pluto :D. Yes according to the latest development on planet definitions by International Astronomical Union, Pluto has been removed from the planet list and is recognized as “Swarm of Small Things” beyond Neptune. Details can be viewed at here and also at here.

Categories: General, Space Science

Mathematical Genius ‘Grigori Perelman’ wins Fields Medal

August 23, 2006 2 comments

I just read that Mathematical Genius “Grigori Perelman” has shunned off the “Fields Medal” – an equivalent of Nobel Prize for Mathematics offered to him in August 2006. He claims to have solved one of seven, Millennium Prize Problems, known as Poincaré Conjecture. His claim has been severely scrutinized by a panel of extra ordinary mathematicians which includes Sir Andrew Wiles who solved the famous and toughest problem in mathematical history, “Fermats Last Theorem” and became famous world wide. Now this shows what a real humble and great human Grigori is, no charm for fame and publicity. The problem has been nominated by Clay Institute Mathematics as one of toughest problem of millennium to be solved. Grigory is a brilliant and most extra ordinary mathematician of Russia having great works in Geometric Topology and Reimannian Geometry. I am not an expert on topology or the subjects related but I have read about them and they are literally too tough, and having them solved is by far a great, great achievement. I hope I am able to reach such heights in Computer Science, one day 🙂.

Categories: General, Mathematics

Windows Live Writer !

August 15, 2006 1 comment

I wrote this post using Windows Live Writer. Yes the Windows Live Writer has been released and can be used to publish posts for any blogging service. Have a look at here for further details.

Categories: General, Microsoft Related

Farhan Bhatti passed away !

August 12, 2006 7 comments

One of my batch mates at university, and an old acquanted friend since SSC Examination, Farhan Bhatti passed on Friday 11th August, 2006.

I came along him with his brother Kamran Bhatti just after my SSC examination. He was mad about body building since then. He had a great muscular body and superb physique. He just left the Computer Science field and joined Pakistan Army, and was under training at PMA. Though I am still unable to know about the exact reason of his death, but this untimely death has imprinted strong impact on me. Attending a funeral of person of same age as of yours, specially at the age when one is at prime of his/her life is sadest and desperate experience of life. Though I never had a chance to be very close to him, but he sounded a jolly and agressive guy. He once said to me, “As reaching top in Computer Science field is your passion, reaching top in body building is my passion.” :(. This line has come to my mind so much in the past 2 days. I cant write any longer.

May his soul rest in piece, and he has eternal bliss !

Categories: General, Uncategorized

Interop – Managed C++ and C#

August 11, 2006 5 comments

I mentioned about writing some basic stuff for Managed C++ so here I am writing it.

I had to send C# strings to Managed C++ dll(class library). In MC++ the managed reference is represented by ‘^’, in MC++ function’s prototype will be;

String^ foo(String ^ pInputString);

and call from C# will be normal like, Console.WriteLine(foo(str));

for sending array of strings;

void foo(array<String ^>^ pInputAStrings); // yeah looks weird

for sending a string as reference;

void foo(String ^ % pInputRString);

Similarly XmlDocument xdoc = new XmlDocument(); in C# is equivalent to

XmlDocument ^ xdoc = gcnew XmlDocument(); when we initiliaze with ‘gcnew’ the garbage collector will run even if we have enabled mixed types option in Managed C++ in .NET 2005.

The magical API that helped me through out is,

Marshal.Copy Method (IntPtr, Byte[], Int32, Int32) which have a total of 16 overloads and is in,

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)

So using this method I convert a Base 64 Encoded string in bytes to native char * as follows.

array<Byte> ^ byteConvertedFromBase64 = nullptr;

String ^ string64bit = String::Empty;

byteConvertedFromBase64 = Convert::FromBase64String( string64bit );

char * bData = 0;

bData = new char[length];

Marshal::Copy(byteConvertedFromBase64, 0, IntPtr(bData), length);

It is a magical API which always worked when ever I needed to convert types from native char * to strings and vice versa and with other types.

Besides that I had to suppress the security checks that are incurred when calling native dlls from managed code, to save performance losses using PInvoke or COM Interop. This is done by SuppressUnmanagedCodeSecurityAttribute Class and applying /CLRUNMANAGEDCODECHECK in the linker settings. You can view MSDN for specific details.

The Coding King – Coding Master # 2

August 9, 2006 12 comments

In July 2006, I took part in an online programming competition conducted by MSN Search team and recruiting people. Fortunately, I have won it. The contest is named as “Coding Master 2” for 2006. You can view a brief biography and a photograph of mine at “The Coding Master results”.

Haroon