Sunday, April 27, 2008
Mortals: Alia Sabur
People in this world are amazing, as if mother nature itself wasn't fascinating enough. Alia Sabur is the world's youngest professor.
Labels:
mortals
Saturday, March 22, 2008
Book Review: The Tipping Point
I just finished reading "The Tipping Point" and I definitely classify it as a thought-provoking book, which has some very useful insights into the way we live our life. The book by Malcom Gladwell basically takes the idea of epidemics and maps it to social trends and fads, and how we can use the lessons learned to diffuse something of our own interest for the betterment of all. The only criticism I have of the book is what I usually have for almost all the books I read: the size of the book could easily be reduced to 3/4th by omitting repetitive content and stuff which is too obvious.
The book is organized as follows:
Overall, I rate it as an 8 out of 10 book!
The book is organized as follows:
- The Three Rules of Epidemics: The rules as mentioned by the author are the Law of the Few, the Stickiness Factor, and the Power of Context. Malcolm Gladwell analyzes how epidemics actually start out from a few who are socially quite active. He also finds that an epidemic must be "sticky" to cause widespread effects, and the context must be relevant for that as well.
- The Law of the Few: Malcom finds three types of personalities which are very affective in making something contagious. These are Connectors (people who have lots of contacts), Mavens (people who are an expert and looked for advice in some particular field) and Salesmen (people who are quite good at convincing others). Malcolm argues that not only the "content" of the message must be interesting/ important for widespread awakening but also the "carrier" of the message holds importance. He exemplifies with the help of Paul Revere's mid night ride during American Civil War. Paul Revere being a Maven as well as a Connector was more successful than William Dawes in alerting the militia about the British attack during American Civil War. Both of them rode rode all night on 18th/19th April 1775 in opposite directions but the results were very different.
- The Stickiness Factor: A message shouldn't just be "exciting" or "informative" to be contagious. It must also get stuck in the minds of the listeners. Malcolm gives the example of Sesame Street and Blue's Clues, and what went into their making.
- The Power of Context: There are two chapters on this which deal with various case studies relating how the context/ environment effects the spreading of the same message across masses. The author narrates an experiment which involved thousands of students required to grade their own answer sheets. Similarly, another experiment involved telling people to move from one building to another where somebody along the passage acted to be in desperate help. The results show that "character" isn't a simple set of traits; it behaves depending on the context.
- Case Study: Rumors, Sneakers, and the Power of Translation: The last few chapters present case studies. Rumors first "level" the details and then "sharpen" some of them according to the context or understanding of the individuals. Such "translation" is also done by "cool people" who make messages more sticky.
- Case Study: Suicide, Smoking, and the Search for Unsticky Cigarette: Malcolm tries to find out why the anti-smoking campaigns are not successful. He compares it with the suicide trend amongst young boys of Micronesia. He talks of "permission givers" and why people smoke despite knowing that smoking is injurious. He concludes that smoking is not cool; it's the smoker who is cool and acts as a salesman/ permission giver. He further concludes that nicotine is sticky (depending on your genes) and instead of spreading awareness, we should find how to make cigarettes unsticky.
- Conclusion: Focus, Test, and Believe: There isn't much to learn here.
- Tipping Point Lessons from the Real World: The author praises his work in this chapter :) I don't think you need to read this one.
Overall, I rate it as an 8 out of 10 book!
Labels:
book review,
life
Tuesday, March 18, 2008
Calling Sybase Stored Procedures through ADO
A few days ago I downloaded evaluation version of Sybase Adaptive Server Enterprise. The database is popularly known as Sybase. Here is some brief history of the database, and here is another very interesting thread on how Microsoft adapted Sybase as SQL Server.
Coming back to the topic intended for this post, below is a very small stored procedure which does almost nothing interesting (this, however, requires you to create a table named Test_Account with at least two integer columns, namely AccountId and Balance):
Calling this from Visual Basic is very simple. Below code has been tested with Sybase ASE OLEDB Provider:
The same can be coded (without exception handling) in VC++ as follows:
Years ago, I wrote a similar article on calling Oracle Stored Procedures through ADO from both Visual Basic 6 and VC++ 6. That page became quite popular with the passage of time.
Coming back to the topic intended for this post, below is a very small stored procedure which does almost nothing interesting (this, however, requires you to create a table named Test_Account with at least two integer columns, namely AccountId and Balance):
create procedure dbo.sp_getBalance
@pAccountId integer,
@oBalance integer output
as
begin
select @oBalance = Balance
from Test_Account where AccountId = @pAccountId
end
Calling this from Visual Basic is very simple. Below code has been tested with Sybase ASE OLEDB Provider:
Set Connect = New ADODB.Connection
Connect.CursorLocation = adUseServer
Connect.Provider = "ASEOLEDB"
Connect.ConnectionString = "Data Source=jaywalker:5000;Database=SybaseSPs;UID=sa;PWD=;"
Connect.Open
sqlString = "sp_getBalance"
Dim cmd As New ADODB.Command
cmd.CommandText = sqlString
cmd.CommandType = adCmdStoredProc
Set cmd.ActiveConnection = Connect
Call cmd.Parameters.Append(cmd.CreateParameter("@pAccountId", adInteger, adParamInput, 4, 3))
Call cmd.Parameters.Append(cmd.CreateParameter("@oBalance", adInteger, adParamOutput))
cmd.Execute
MsgBox cmd.Parameters("@oBalance").Value
The same can be coded (without exception handling) in VC++ as follows:
CoInitialize(NULL);
_CommandPtr sybCmd ("ADODB.Command");
_ConnectionPtr sybConn ("ADODB.Connection");
sybConn->CursorLocation = adUseServer;
sybConn->Provider = "ASEOLEDB";
_bstr_t connString = "Data Source=jaywalker:5000;Database=SybaseSPs;UID=sa;PWD=;";
sybConn->Open (connString, "", "", adConnectUnspecified);
bstr_t sql = "sp_getBalance";
sybCmd->ActiveConnection = sybConn;
sybCmd->CommandType = adCmdStoredProc;
sybCmd->CommandText = sql;
sybCmd->Parameters->Append (sybCmd->CreateParameter ("@pAccountId", adInteger, adParamInput, sizeof(int), 3));
sybCmd->Parameters->Append (sybCmd->CreateParameter ("@oBalance", adInteger, adParamOutput, sizeof(int)));
sybCmd->Execute(NULL, NULL, adExecuteNoRecords);
long val = sybCmd->Parameters->Item["@oBalance"]->Value;
CoUninitialize();
Years ago, I wrote a similar article on calling Oracle Stored Procedures through ADO from both Visual Basic 6 and VC++ 6. That page became quite popular with the passage of time.
Friday, February 29, 2008
Imam Ali (alayhis salam)'s Advice to His Son
Nahjul Balagha (The Peak of Eloquence) was translated into Urdu by Mufti Jaffer Hussain. In Pakistan, it's published by Imamia Publications, Lahore. However, the Urdu print is still handwritten and not typed. I am thankful to Faeza Rizvi for helping me out in typing Imam Ali (alayehis salam)'s wasiyat in Unicode. The same can be found in English here. I am putting an initial part of the advice below. Please install Nafees Web Naskh for better rendering of the text. You can also get the complete document from here.
صفین سے پلٹتے ہوئے جب مقام حاظرین میں منزل کی تو امام حسن علیہ السلام کے لیے یہ وصیّت نامہ تحریر فرمایا:
یہ وصیّت ہے اس باپ کی جو فنا ہونے والا، اور زمانہ کی چیرہ دستیوں کا اقرار کرنے والا ہے۔ جس کی عمر پیٹھ پھرائے ہوئے ہے- اور جو زمانہ کی سختیوں سے لاچار ہے اور دنیا کی برائیوں کو محسوس کرچکا ہے، اور مرنے والوں کے گھروں میں مقیم اور کل کو یہاں سے رخت سفر باندھ لینے والا ہے- اس بیٹے کے نام جو نہ ملنے والی بات کا آرزو مند، جادہ عدم کا راہ سپار، بیماریوں کا ہدف، زمانہ کے ہاتھ گروی، مصیبتوں کا نشانہ، دنیا کا پابند، اور اس کی فریب کاریوں کا تاجر، موت کا قرض دار، اجل کا قیدی، غموں کا حلیف، حزن و ملال کا ساتھی، آفتوں میں مبتلا، نفس سے عاجز اور مرنے والوں کا جانشین ہے۔
بعدہ، تمھیں معلوم ہونا چاہیے کہ میں نے دنیا کی رو گردانی، زمانہ کی منہ زوری اور آخرت کی پیش قدمی سے جو حقیقت پہچانی ہے وہ اس امر کے لیے کافی ہے کہ مجھے دوسرے تذکروں اور اپنی فکر کے علاوہ دوسری کوئی فکر نہ ہو مگر اسی وقت جب کہ دوسروں کے فکرواندیشہ کو چھوڑ کر میں اپنی ہی دھن میں کھویا ہوا تھا اور میری عقل و بصیرت نے مجھے خواہشوں سے منحرف و روگردان کر دیا اور میرا معاملہ کھل کر میرے سامنے آ گیا، اور مجھے واقعی حقیقت اور بےلاگ صداقت تک پہنچا دیا۔
میں نے دیکھا کہ تم میرا ہی ایک ٹکڑا ھو، بلکہ جو میں ہوں وہی تم ہو، یہاں تک کہ اگر تم پر کوئی آفت آئے تو گویا مجھ پر آئی ہے۔اور تمہیں موت آئے تو گویا مجھے آئی ہے۔ اس سے مجھے تمہارا اتنا ہی خیال ہوا، جتنا اپنا ہو سکتا ہے۔ لہذا میں نے یہ وصیّت نامہ تمہاری رہنمائی میں اسے معیّن سمجھتے ہوئے تحریر کیا ہے خواہ اس کے بعد میں زندہ رہوں، یا دنیا سے اٹھ جاوں۔
صفین سے پلٹتے ہوئے جب مقام حاظرین میں منزل کی تو امام حسن علیہ السلام کے لیے یہ وصیّت نامہ تحریر فرمایا:
یہ وصیّت ہے اس باپ کی جو فنا ہونے والا، اور زمانہ کی چیرہ دستیوں کا اقرار کرنے والا ہے۔ جس کی عمر پیٹھ پھرائے ہوئے ہے- اور جو زمانہ کی سختیوں سے لاچار ہے اور دنیا کی برائیوں کو محسوس کرچکا ہے، اور مرنے والوں کے گھروں میں مقیم اور کل کو یہاں سے رخت سفر باندھ لینے والا ہے- اس بیٹے کے نام جو نہ ملنے والی بات کا آرزو مند، جادہ عدم کا راہ سپار، بیماریوں کا ہدف، زمانہ کے ہاتھ گروی، مصیبتوں کا نشانہ، دنیا کا پابند، اور اس کی فریب کاریوں کا تاجر، موت کا قرض دار، اجل کا قیدی، غموں کا حلیف، حزن و ملال کا ساتھی، آفتوں میں مبتلا، نفس سے عاجز اور مرنے والوں کا جانشین ہے۔
بعدہ، تمھیں معلوم ہونا چاہیے کہ میں نے دنیا کی رو گردانی، زمانہ کی منہ زوری اور آخرت کی پیش قدمی سے جو حقیقت پہچانی ہے وہ اس امر کے لیے کافی ہے کہ مجھے دوسرے تذکروں اور اپنی فکر کے علاوہ دوسری کوئی فکر نہ ہو مگر اسی وقت جب کہ دوسروں کے فکرواندیشہ کو چھوڑ کر میں اپنی ہی دھن میں کھویا ہوا تھا اور میری عقل و بصیرت نے مجھے خواہشوں سے منحرف و روگردان کر دیا اور میرا معاملہ کھل کر میرے سامنے آ گیا، اور مجھے واقعی حقیقت اور بےلاگ صداقت تک پہنچا دیا۔
میں نے دیکھا کہ تم میرا ہی ایک ٹکڑا ھو، بلکہ جو میں ہوں وہی تم ہو، یہاں تک کہ اگر تم پر کوئی آفت آئے تو گویا مجھ پر آئی ہے۔اور تمہیں موت آئے تو گویا مجھے آئی ہے۔ اس سے مجھے تمہارا اتنا ہی خیال ہوا، جتنا اپنا ہو سکتا ہے۔ لہذا میں نے یہ وصیّت نامہ تمہاری رہنمائی میں اسے معیّن سمجھتے ہوئے تحریر کیا ہے خواہ اس کے بعد میں زندہ رہوں، یا دنیا سے اٹھ جاوں۔
Saturday, February 23, 2008
Updating Device Drivers on Windows
It's relatively easy to find device drivers of branded Wintel machines: usually you can visit the vendor's site and get a list of drivers for your model. However, it's not always that easy because the same model may come up with with different graphics cards, for example. More importantly, you never know when a newer version of one of your device drivers comes out.
Wait no more, Driver Max is here. This highly acclaimed freeware tool for Windows can extract all your installed drivers for you to take a backup. It can also tell you which of your drivers should be updated by connecting to the Driver Max website. The only downside right now is that the website doesn't give you links to download those updated drivers.

Just for the sake of completion, Driver Detective is a similar (and perhaps, more complete program). It's not freeware, though.
Wait no more, Driver Max is here. This highly acclaimed freeware tool for Windows can extract all your installed drivers for you to take a backup. It can also tell you which of your drivers should be updated by connecting to the Driver Max website. The only downside right now is that the website doesn't give you links to download those updated drivers.
Just for the sake of completion, Driver Detective is a similar (and perhaps, more complete program). It's not freeware, though.
Labels:
tools
Subscribe to:
Posts (Atom)