Its Silver Jubilee Week people. Get ready!!!
1 June 2009
19 May 2009
24 April 2009
Tales From Interviewer’s Desk
Part 1:
How to reverse a string in-place?
Take 1: (Fresh)
string reverse( string str )
{
char ch = str [ 0 ];
foreach( int i = 0 ; i < str.length ; ++i )
Response.RedirectWrite( str [ str.length - i ] ) + ch.tostring( );
}
Take 2: (Big words, no knowledge)
string reverse( object obj )
{
string str = TypeCaste.tostring( obj );
stack< ch > s;
for( int i = 0 ; i < length ; ++i )
s.push( str.charat( i ) );
for( i = 0 ; i < length ; ++i )
str.insertat( 0 , s.pop( ) );
}
Take 3: (2.5 year experience in C#)
string reverse( object obj )
{
if( typeof( obj ) == "string" )
{
for( int i = 0 ; i < obj.length ; ++I )
{
char ch = str [ i ];
str [ i ] = str [ length - i ];
str [ length - i ] = ch;
}
}
return obj.tostring( );
}
Take 4: (Fresh)
string reverse( object obj )
{
if( obj == "string" )
{
char ch = str [ 0 ];
for( int i = 0 ; i < obj.length ; ++I )
str [ i ] = str [ length - i ];
str [ str.length ] = ch;
}
}
12 April 2009
Bilkamism Syndrome :OR: How to Kill a Product
[Edit: Even the genius couldn't catch sarcasm, well perhaps he's sleepy right now.]
[Edit # 2: Correct two typos.]
Symptoms:
-
Oracle locks entire table for a single select. And entire database is unavailable while update/delete happen. You must unplug database server from network for create table to succeed.
-
Create 500 threads in one process to bog down a server, and end up blaming vendor for any resulting slow downs.
-
Get a degree in Physics and end up working as a manager for a software product. :) Isn’t it simply cute?
-
This one’s a bit longer so we’ll have to resort to an analogy. Suppose, a cell phone provider allows you to transfer credit to someone else through some crafted command. Now, there are clearly two types of monetary transactions. One when you recharge your own account, one where someone transfers credit to someone else.You must have two different tables for these transaction types because “I” doubt Oracle will handle such loads. When generalizing, each transaction type must reside in its own table. This concept is spliheritence.
-
Requirements. What heavenly entity is that? Why! Just drag up 50 lines of code to get the job done at its face value and everyone is happy.
-
Edge cases are a Microsoft/Sun/Google conspiracy to kill everyone’s productivity. If it happens in 1 out of 10000000…000 cases, it never happened.
-
Change requirements mid project and later on deny everything till the exact communication is reproduced. :D
-
Users are responsible for any race conditions, it is not our duty to insert locks anywhere. Screw you!
-
Every single class must follow singleton pattern. World ends otherwise and we turn into green Martians.
-
For bonus fun, copy live customer data to test systems without overwriting actual pins and other personal customer information.
-
VSS > SVN. Enough said!
-
Why. Now that is the question. Shakespeare’s “To be or not to be” is ancient. Question everything, even those which are working perfectly and then blame others for their correct functioning. We understand you must appear doing something to justify your existence in the first place. And NO! The answer is NO.
-
log ex != x
Keep checking here, I’ll post more as I remember them.
5 April 2009
Enough!
Facebook is becoming an information disclosure nightmare. People are too stupid to be handed a public social network for their own good. For example, this just crossed my ridiculously crafted homepage few minutes ago.
"Muhammad just added the birthdays of 15 friends to their MyCalendar.
Muhammad has requested to add the following birthdays to their MyCalendar:"[more blah blah blah with actual dates]“
My comment:
Tanveer Badar at 14:31 on 05 April
[noun], you should know better. It is information disclosure, and about other people’s personal information you have no right to publish in public.
Please don’t add mine to this application.
What amuses me is that the guy is supposed to be specializing in networking, and security by implication (I think). I shudder to think whose data rests in the hands of such and likes.
Those who take time to read this blog might have noticed there is very little information about me here. You won’t find much about me online because I don’t want you to. But how are you supposed to prevent others leaking information about you online.
28 March 2009
Work Efficiency
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
109 219 109 219 0 0 438 0 –:–:– –:–:– –:–:— 438
I like this downloader, given how it built redundancy by downloading 109% of a 219 byte long file.
Work Efficiency
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
109 219 109 219 0 0 438 0 –:–:– –:–:– –:–:— 438
I like this downloader, given how it built redundancy by downloading 109% of a 219 byte long file.
26 March 2009
From ntddk.h
//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_FLOATING_POINT.
//FLOATING_SAVE_AREA FloatSave;
//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_SEGMENTS.
//ULONG SegGs;
ULONG SegFs;
ULONG SegEs;
ULONG SegDs;//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_INTEGER.
//ULONG Edi;
ULONG Esi;
ULONG Ebx;
ULONG Edx;
ULONG Ecx;
ULONG Eax;//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_CONTROL.
//ULONG Ebp;
ULONG Eip;
ULONG SegCs; // MUST BE SANITIZED
ULONG EFlags; // MUST BE SANITIZED
ULONG Esp;
ULONG SegSs;
.
.
.
volatile ULONG DismountCount;
//
// This field indicates the status of the 64-bit COM+ package on the
// system. It indicates whether the Itermediate Language (IL) COM+
// images need to use the 64-bit COM+ runtime or the 32-bit COM+ runtime.
//
Bhahaha!
10 March 2009
Life As We Know It
Misery… Hopelessness… Unreliability… Non-dependable… Chaos… Unfairness… Dismay… Mayhem… Sufferings… Retribution… Evils… Accidents
To
Happiness… Trust… Order… Joy… Rewards… Surprises…
We cling to life for dear life.