Wednesday, January 24, 2007
My greatest fears
Here is a list containing my greatest fears.
1. Alien attack - Aliens will come to earth at a time when I will be in
2. World peace – I fear that one day will come when world peace would prevail. Now, I am all for world peace but there will be problems – All the military, navy and air-force persons would be out of their jobs. People will still pay for watching aircrafts and submarines but poor military would become useless and that’s 10 million of them….. Same is true for the arm dealers as well.
3. One day people would be born intelligent and there won’t be any cartoons anymore. (Actually this is a far fetched idea considering you are stupid enough to read this, but this argument could be argued back.)
4. Our dear finance minister would one day start to tax intelligence and considering my case, I will have no options but to file for bankruptcy. (Again I think, by the time this idea would materialize; I will be a P.M. and hence can officially claim no intelligence.J)
5.
6. When I ask the biggest question of my life, the answer would be negative and I will become serious that day.
7. My company would give me a job offer, killing any hope of further enjoyment.
8. I won’t be able to complete the list....................................................
Tell me what are your fears?
Labels: fears
Sunday, December 31, 2006
Thursday, November 30, 2006
How do you know...
-- When some says, "We are back to square 1" and you think - Well, atleast we are not on square 0, the initial one.
How do you know that you are programming too much?
-- Same statement makes you think - Well, square 1 may well be the final state after all.
Monday, November 13, 2006
" Hello World " Programs
{NOTE: For the non programmers, some exegesis may
be necessary: when a programmer starts to learn a new language,
a typical first exercise is to program the computer to display the
message "Hello World".}
---------------
A compilation of *Hello World programs* designed by
various categories of *developer* follows.
High School/Jr.High
===================
10 PRINT "HELLO WORLD"
20 END
First year in College
=====================
program Hello(input, output)
begin
writeln('Hello World')
end.
Senior year in College
======================
(defun hello
(cons 'Hello (list 'World))))
New professional
================
#include
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}
Seasoned professional
=====================
#include
#include
class string
{
private:
int size;
char *ptr;
public:
string() : size(0), ptr(new char('\0')) {}
string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}
~string()
{
delete [] ptr;
}
friend ostream &operator <<(ostream &, const string &);
string &operator=(const char *);
};
ostream &operator<<(ostream &stream, const string &s)
{
return(stream << s.ptr);
}
string &string::operator=(const char *chrs)
{
if (this != &chrs)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
}
return(*this);
}
int main()
{
string str;
str = "Hello World";
cout << str << endl;
return(0);
}
Master Programmer
=================
[
uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
]
library LHello
{
// bring in the master library
importlib("actimp.tlb");
importlib("actexp.tlb");
// bring in my interfaces
#include "pshlo.idl"
[
uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
]
cotype THello
{
interface IHello;
interface IPersistFile;
};
};
[
exe,
uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
]
module CHelloLib
{
// some code related header files
importheader(
importheader(
importheader(
importheader("pshlo.h");
importheader("shlo.hxx");
importheader("mycls.hxx");
// needed typelibs
importlib("actimp.tlb");
importlib("actexp.tlb");
importlib("thlo.tlb");
[
uuid(2573F891-CFEE-101A-9A9F-00AA00342820),
aggregatable
]
coclass CHello
{
cotype THello;
};
};
#include "ipfix.hxx"
extern HANDLE hEvent;
class CHello : public CHelloBase
{
public:
IPFIX(CLSID_CHello);
CHello(IUnknown *pUnk);
~CHello();
HRESULT __stdcall PrintSz(LPWSTR pwszString);
private:
static int cObjRef;
};
#include
#include
#include
#include
#include "thlo.h"
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"
int CHello::cObjRef = 0;
CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk)
{
cObjRef++;
return;
}
HRESULT __stdcall CHello::PrintSz(LPWSTR pwszString)
{
printf("%ws\n", pwszString);
return(ResultFromScode(S_OK));
}
CHello::~CHello(void)
{
// when the object count goes to zero, stop the server
cObjRef--;
if( cObjRef == 0 )
PulseEvent(hEvent);
return;
}
#include
#include
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"
HANDLE hEvent;
int _cdecl main(
int argc,
char * argv[]
) {
ULONG ulRef;
DWORD dwRegistration;
CHelloCF *pCF = new CHelloCF();
hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
// Initialize the OLE libraries
CoInitializeEx(NULL, COINIT_MULTITHREADED);
CoRegisterClassObject(CLSID_CHello, pCF, CLSCTX_LOCAL_SERVER,
REGCLS_MULTIPLEUSE, &dwRegistration);
// wait on an event to stop
WaitForSingleObject(hEvent, INFINITE);
// revoke and release the class object
CoRevokeClassObject(dwRegistration);
ulRef = pCF->Release();
// Tell OLE we are going away.
CoUninitialize();
return(0); }
extern CLSID CLSID_CHello;
extern UUID LIBID_CHelloLib;
CLSID CLSID_CHello = { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */
0x2573F891,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};
UUID LIBID_CHelloLib = { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */
0x2573F890,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};
#include
#include
#include
#include
#include
#include "pshlo.h"
#include "shlo.hxx"
#include "clsid.h"
int _cdecl main(
int argc,
char * argv[]
) {
HRESULT hRslt;
IHello *pHello;
ULONG ulCnt;
IMoniker * pmk;
WCHAR wcsT[_MAX_PATH];
WCHAR wcsPath[2 * _MAX_PATH];
// get object path
wcsPath[0] = '\0';
wcsT[0] = '\0';
if( argc 1) {
mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
wcsupr(wcsPath);
}
else {
fprintf(stderr, "Object path must be specified\n");
return(1);
}
// get print string
if(argc 2)
mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
else
wcscpy(wcsT, L"Hello World");
printf("Linking to object %ws\n", wcsPath);
printf("Text String %ws\n", wcsT);
// Initialize the OLE libraries
hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if(SUCCEEDED(hRslt)) {
hRslt = CreateFileMoniker(wcsPath, &pmk);
if(SUCCEEDED(hRslt))
hRslt = BindMoniker(pmk, 0, IID_IHello, (void **)&pHello);
if(SUCCEEDED(hRslt)) {
// print a string out
pHello->PrintSz(wcsT);
Sleep(2000);
ulCnt = pHello->Release();
}
else
printf("Failure to connect, status: %lx", hRslt);
// Tell OLE we are going away.
CoUninitialize();
}
return(0);
}
Apprentice Hacker
===================
#!/usr/local/bin/perl
$msg="Hello, world.\n";
if ($#ARGV >= 0) {
while(defined($arg=shift(@ARGV))) {
$outfilename = $arg;
open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n";
print (FILE $msg);
close(FILE) || die "Can't close $arg: $!\n";
}
} else {
print ($msg);
}
1;
Experienced Hacker
===================
#include
#define S "Hello, World\n"
main(){exit(printf(S) == strlen(S) ? 0 : 1);}
Seasoned Hacker
===================
% cc -o a.out ~/src/misc/hw/hw.c
% a.out
Guru Hacker
===================
% cat
Hello, world.
^D
New Manager
===================
10 PRINT "HELLO WORLD"
20 END
Middle Manager
===================
mail -s "Hello, world." bob@b12
Bob, could you please write me a program that prints "Hello, world."?
I need it by tomorrow.
^D
Senior Manager
===================
% zmail jim
I need a "Hello, world." program by this afternoon.
Chief Executive
===================
% letter
letter: Command not found.
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout
-----------------
Saturday, November 11, 2006
Linux Source Code gimmicks
This thing is curtsey truehacker, only thing I did was to check whether this really exists and put only those files which I personally saw in the source code. I tried it on Ubuntu and debian source code. (though I think the kernel would be the same).
In your linux source directory goto following files and see yourself that this code exists or take my word for it, “Following lines are actually there.”
net/ipv4/ip_gre.c
----------------------------------------------------------
static void ipgre_err(struct sk_buff *skb, u32 info)
{
#ifndef I_WISH_WORLD_WERE_PERFECT
/* It is not :-( All the routers (except for Linux) return only
8 bytes of packet payload. It means, that precise relaying of
ICMP in the real Internet is absolutely infeasible.
Moreover, Cisco "wise men" put GRE key to the third word
in GRE header. It makes impossible maintaining even soft state for keyed
GRE tunnels with enabled checksum. Tell them "thank you".
Well, I wonder, rfc1812 was written by Cisco employee,
what the hell these idiots break standrads established
by themself???
*/
arch/mips/kernel/sysirix.c
----------------------------------------------------------
/* 2,191 lines of complete and utter shit coming up... */
extern int max_threads;
/* The sysmp commands supported thus far. */
#define MP_NPROCS 1 /* # processor in complex */
#define MP_NAPROCS 2 /* # active processors in complex */
#define MP_PGSIZE 14 /* Return syste
arch/mips/pci/pci-ip27.c
----------------------------------------------------------
/*
* IOC3 is fucked fucked beyond believe ... Don't try to access
* anything but 32-bit words ...
*/
drivers/net/3c59x.c
----------------------------------------------------------
/* Acknowledge the IRQ. */
iowrite16(AckIntr | IntReq | IntLatch, ioaddr + EL3_CMD);
if (vp->cb_fn_base) /* The PCMCIA people are idiots. */
iowrite32(0x8000, vp->cb_fn_base + 4);
} while ((status = ioread16(ioaddr + EL3_STATUS)) & IntLatch);
Monday, November 06, 2006
Priya
My life was boring, but that was before I met Priya.
One day, I was coming from college and suddenly my eyes fell inside a showroom, there she was! It was love at first sight, she was so beautiful, I hesitated- is she within my reach? I decided not and went to home. Afterwards wherever I would go, I saw her only, I talked to my best friend about it and he asked me to go for it (just like “Hitch”).
Finally I decided to give it a try and went to show room again, half hoping that I won’t find her there but she was there as if waiting for me, I pulled myself together and approached her, within no time we became the best friends.
She had so many hidden qualities that I came to know about later. I loved her so much that I didn’t go anywhere without her. Until I saw her atleast twice a day, my day wasn’t complete. She made me a different person altogether, now I became more social - always arriving with her.
When my mom and dad came to visit me, I introduced her to them and they too loved her. My dad didn’t take long to announce that this was my wisest decision. Things were so silky those days.
And then one day, I went to my friend to have dinner together- she was standing outside while I went in. When I returned, there was no sign of her. I tried to call her but in vain. I searched every place I could think of and still she was missing. Finally I filed a police complaint but till now I don’t have a clue of her whereabouts.
If you happen to see her, please tell her – I love you my scooter, Priya.
Monday, September 25, 2006
Gabbar aur Samba
Sambha: Sardar 2
Gabbar: Mujhe ginti nahin aati, 2 kitne hote hain?
Samba: Sardar 2, 1 ke baad aata hai
Gabbar: Aur 2 ke pehle?
Samba: 2 k pehle 1 aata hai.
Gabbar: To beech mein kaun ata hai?
Samba: Beech mein koi nahi aata>
Gabbar:: To phir dono ek saath kyun nahin aate?
Samba: 1 k baad hi 2 aa sakta hai, kyun ki 2, 1 se bada hai.
Gabar: 2, 1 se kitna bada hai?
Samba: 2, 1 se 1 bada hai.
Gabbar: Agar 2, 1 se 1 bada hai to 1, 1 se kitna bada hai?
Samnba: Sardar maine aapka namak khaya hai, mujhe goli maar do.