Monthly Archives: January 2011

Hey there Honey! I exist


It was fall of 2007, an average kid of good height suited in formal clothing entered the premises of his university for the first time , which was then located in a market. That was the day that the world turned upside down for him, well that’s what he thought.

Three and a half years have passed, since then I am the same me that I was on 17th September 2007, alone. Though I have gained some airs and graces to show off but they are as good as dust, you gather plenty of it but its of no use. In the end of fifth semester a thought came to my mind – not for the first time – but I looked back on my two years in university and compared myself with some dorky face boy, who was accompanied by a woman while I was lurking by some table in the café alone.

I absorbed the thought, and hoped that I will have someone by the end, I kept on building on myself, stacked successes, jumped higher and higher just to be more prominent, to show them [the ladies], “Hey There! I exist”, but to no avail. I am currently sitting here ‘alone’ in my bed and writing on my stupid blog, may be someone reads it and her heart melts.. Smile with tongue out BTW if that’s the case, I have my mobile number on Facebook. See in three and a half years I have kept on trying harder and harder, but I am like something that doesn’t exist. If I am standing in a group and some of the boys are talking to the ladies, they ignore me like I don’t exist, I am made of thin air, even air can be felt sometimes.

So that was my story for three years, I will stack up everything I did, just to get attention in this time starting from the morning of 17th September 2007 to 24th January 2011 and 38 minutes.

  1. I have a GPA of 3.44, I have never gotten a C in any subject.
  2. I preside the ACM student Chapter at my university
  3. I have a Car
  4. I have my own bank account
  5. I have work experience in world at reputed places
  6. I play striker in football
  7. I play tennis, I swim, volleyball, cricket, badminton etc etc
  8. I play computer games
  9. I even delivered help session just to get attention, otherwise why would I give a damn if someone fails
  10. I look good, 90 percent of the time
  11. I take bath daily
  12. I shave every third day – normally
  13. I wear branded clothes most of the time
  14. I have tried with unbranded too
  15. I have tried informal and formal for three semesters
  16. I can speak English
  17. I can write like a 10,000 words story
  18. I can even do poetry
  19. I can make beautiful stuff in Photoshop
  20. I tweet 😛
  21. My Dad has served in the Army – Just to let them know that my Family is stable
  22. I was even Teachers assistant to 6 classes
  23. I can do better coding than 90 percent of the class
  24. I am witty
  25. I had a 16 GB Flash drive when even 8 GB drives were scarce
  26. I had a laptop in the age of Desktop computers
  27. I bring lunch from home and eat vegetables, lentils,beans and meat
  28. I have an athletic build and can run very fast
  29. I can trek for 10 hours to a lake at 13,500 feet
  30. I even go trekking on weekends to Islamabad
  31. I tried smoking
  32. I tried sheesha
  33. I tried quitting smoking and I did because I started smoking the day before
  34. I have friends who go out with girls
  35. I tried French cut moustache
  36. I tried gotee, makhee, clan shave , mangal panday style, rouge looking beard nothing worked
  37. I shaved my head
  38. I have ray bans
  39. I danced
  40. I didn’t dance
  41. I joined a research lab
  42. I can cook my own breakfast, can fry an egg and toss it on the pan without breaking it
  43. I can cook food
  44. I drive really really fast, I have tried it slow as well
  45. The size of my foot is 12, I wear 13 number shoes
  46. I sit with and have company of intelligent people
  47. I have some stupid friends as well
  48. I have friends in NUST Business School, Civil School, Mechanical , EME, MCS you name the institution i have people there
  49. On Contrast, 80 percent may deny knowing me, so i have tried both being reserved and outgoing
  50. I have managed to get my own magazine out
  51. I did a pathetic speech at NASTEC, just for the hell of it, i wanted to prove that i could
  52. I try to be prominent by asking difficult questions
  53. I have met DG, Dean, shook hands with important people
  54. I have tried being quiet
  55. I have been loud as well
  56. I have joined all the societies in my university
  57. I support Manchester United & FC Barcelona
  58. I also watch cricket , tennis and every other spot on TV
  59. I watch movies
  60. I pray often
  61. I talk in soft words / have tried brittle ones too
  62. I uploaded my videos on Youtube
  63. I uploaded photos on Facebook
  64. I can do good photography
  65. I can even do spy photography – that was troublesome
  66. I weight a lot less than 70 percent women in the hostel
  67. My waist is less than 40 percent of them
  68. I can do pushups, run for 4 miles consecutively, do skipping rope, lift 50 Kgs of weight, climb on the roofs without anything
  69. I shared assignments, helped in quizzes, came at 08:00 in the morning when the paper was at 11:00
  70. I have a 5.1 surround system
  71. My room is organized like anything, it looks more like an office
  72. My cupboard is always in place, i change my clothes daily

I will continue building the list, but it is evident from this. I am one talented Lad, left to rot to the virus of neglectfulness. I think I will use more tricks to get attention.I will put all my energy to excel in everything, I will not let regrets kill me in 60’s. For now I only hope that I will walk out through the gates of my university with somebody, someday.


Update: This post is meant to satirical and has been exaggerated by magnitudes. Any kind of semblance with reality is totally unintentional.

Tagged , , , , , , , , , , ,

2011 ICC Cricket World Cup


World Cup matches and their expected results brought to you by Paul the octopus  Cheeda the match fixer from Sialkot… Open-mouthed smile

 

Match

Date

Teams

Venue

Expected Winner

1

19 Feb

India vs Bangladesh

Dhaka

India

2

20 Feb

New Zealand vs Kenya

Chennai

New Zealand

3

20 Feb

Sri Lanka vs Canada

Hambantota

Sri Lanka

4

21 Feb

Australia vs Zimbabwe

Ahmedabad

Australia

5

22 Feb

England vs Netherlands

Nagpur

England

6

23 Feb

Pakistan vs Kenya

Hambantota

Pakistan

7

24 Feb

South Africa vs West Indies

New Delhi

South Africa

8

25 Feb

Australia vs New Zealand

Nagpur

Australia

9

25 Feb

Bangladesh vs Ireland

Dhaka

Bangladesh

10

26 Feb

Sri Lanka vs Pakistan

Colombo

Sri Lanka

11

27 Feb

India vs England

Kolkata

England

12

28 Feb

West Indies vs Netherlands

New Delhi

West Indies

13

28 Feb

Zimbabwe vs Canada

Nagpur

Zimbabwe

14

1 Mar

Sri Lanka vs Kenya

Colombo

Sri Lanka

15

2 Mar

England vs Ireland

Bangalore

England

16

3 Mar

South Africa vs Netherlands

Mohali

South Africa

17

3 Mar

Pakistan vs Canada

Colombo

Pakistan

18

4 Mar

New Zealand vs Zimbabwe

Ahmedabad

New Zealand

19

4 Mar

Bangladesh vs West Indies

Dhaka

Bangladesh

20

5 Mar

Sri Lanka vs Australia

Colombo

Sri Lanka

21

6 Mar

India vs Ireland

Bangalore

India

22

6 Mar

England vs South Africa

Chennai

England

23

7 Mar

Kenya vs Canada

New Delhi

Kenya

24

8 Mar

Pakistan vs New Zealand

Pallekelle

Pakistan

25

9 Mar

India vs Netherlands

New Delhi

India

26

10 Mar

Sri Lanka vs Zimbabwe

Pallekelle

Sri Lanka

27

11 Mar

West Indies vs Ireland

Mohali

West Indies

28

11 Mar

Bangladesh vs England

Chittagong

England

29

12 Mar

India vs South Africa

Nagpur

India

30

13 Mar

New Zealand vs Canada

Mumbai

New Zealand

31

13 Mar

Australia vs Kenya

Bangalore

Australia

32

14 Mar

Pakistan vs Zimbabwe

Pallekelle

Pakistan

33

14 Mar

Bangladesh vs Netherlands

Chittagong

Bangladesh

34

15 Mar

South Africa vs Ireland

Kolkata

South Africa

35

16 Mar

Australia vs Canada

Bangalore

Australia

36

17 Mar

England vs West Indies

Chennai

England

37

18 Mar

Sri Lanka vs New Zealand

Mumbai

Sri Lanka

38

18 Mar

Ireland vs Netherlands

Kolkata

Ireland

39

19 Mar

Australia vs Pakistan

Colombo

50-50 [Asian Pitch]

40

19 Mar

Bangladesh vs South Africa

Dhaka

South Africa

41

20 Mar

Zimbabwe vs Kenya

Kolkata

Zimbabwe

42

20 Mar

India vs West Indies

Chennai

India

43

23 Mar

First Quarterfinal

Dhaka

44

24 Mar

Second Quarterfinal

Colombo

45

25 Mar

Third Quarterfinal

Dhaka

46

26 Mar

Fourth Quarterfinal

Ahmedabad

47

29 Mar

First Semifinal

Colombo

48

30 Mar

Second Semifinal

Mohali

49

02 Apr

FINAL

Mumbai

Sri Lanka vs England

Tagged , , , , ,

Matrix Multiplication using Pthreads


The following code i wrote to multiply two n x n matrices. it also prints the time taken to perform the multiplication. BTW this is a multithreaded code. Also to run it you have to type the following

$blah@blahsPC~ gcc path/threadfile.c -lpthread

$blah@blahsPC~ ./A.out

The Code

#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>
#include<time.h>

struct Index{
    int LOOP1;
    int LOOP2;  // thread counter and loop multiplier
    };

 //globals for sharing b/w threads
 int** Matrix1;
 int** Matrix2;
 int** ResultMAT;
 int row;

void* multiply(void* _multiplier);

void main(){
    ////////////////////////////////////////
    ////A Little Housekeeping///////////////
    int col,i,j,rc,LoopVAR,L2;
    long TimeVAR,t;
    struct Index *L_StructVAR;
    printf("Enter rows: ");
    scanf("%d",&row);
    printf("Enter Columns: ");
    scanf("%d",&col);
    Matrix1= malloc(row * sizeof(*Matrix1));
    Matrix2= malloc(row * sizeof(*Matrix2));
    ResultMAT= malloc(row * sizeof(*ResultMAT));
    L_StructVAR= malloc(row * sizeof(*L_StructVAR));
    void* status;

    ////////////////////////////////////////
    //// Thread initialization////////////
    pthread_t* threads;
    pthread_attr_t _attrib;
    threads = malloc((row*col) * sizeof(threads));  ///// Square Matrix Rows = Columns
    pthread_attr_init(&_attrib);
   // pthread_attr_setdetachstate(&_attrib, PTHREAD_CREATE_JOINABLE);

    ///////////////////////////////////////////////
    // Populating array matrices
    if(Matrix1 != NULL)
        {
            for(i = 0; i < row; i++)
            {
                Matrix2[i]=malloc (col * sizeof **Matrix2);
                Matrix1[i] = malloc(col * sizeof **Matrix1);
                 ResultMAT[i] = malloc(col * sizeof **ResultMAT);
                if(Matrix1[i] == NULL)
                {
                    printf("Memory allocation failed. Exiting....");

                }
            }

        }
    else printf("Failed");
    for(i=0;i<row;i++)
        {
           for(j=0;j<col;j++)
           {
               Matrix2[i][j]=rand() % 10 +1;
               Matrix1[i][j]=rand() % 15 +1;

           }

        }
//////////////////////////////////////////////////
///////////Printing Facility /////////////////////
/////////////////////////////////////////////////
/*
printf("Matrix 1: \n");
        for(i=0;i<row;i++)
        {
           for(j=0;j<col;j++)
           {
               printf("%d", Matrix1[i][j]);
               printf(" ");
           }
           printf("\n");
        }   */
///////////////////////////////

//////////////////////////////////////////////
///////////// Threading :D ///////////////////
TimeVAR = clock();
printf("%ld",TimeVAR);
printf("\n");
long threadVAR=0;

for(LoopVAR = 0; LoopVAR < row;LoopVAR++){

      for(L2 = 0;L2 < col;L2++){
          L_StructVAR[threadVAR]. LOOP1 = LoopVAR;
          L_StructVAR[threadVAR].LOOP2=L2;
            //  printf("%ld\n",threadVAR);
           pthread_create(&threads[threadVAR], &_attrib, (void*)multiply,(void*) &L_StructVAR[threadVAR]);
           threadVAR++;
        }

}
printf("%ld\n",clock());
printf("%ld",CLOCKS_PER_SEC);
 TimeVAR = clock() - TimeVAR;
//TimeVAR *= 1000;
TimeVAR /= CLOCKS_PER_SEC;
printf("Total time taken in seconds: \n");
printf("%ld",TimeVAR);

////////////////////////////////////
///// Printing Facility ///////////
/*
printf("Matrix 2:"); printf("\n");
for(i=0;i<row;i++)
        {
           for(j=0;j<col;j++)
           {
               printf("%d", Matrix2[i][j]);
               printf(" ");
           }
           printf("\n");
        }

printf("check 0");    */
/////////////////////////////////////////////////
/////////////// Thread join //////////////////////
/*
pthread_attr_destroy(&_attrib);
for(t=0; t<(row*col); t++) {
    printf("%ld\n",t);
      //rc = pthread_join(threads[t], &status);
      if (rc) {
        // printf("ERROR %d\n", rc);
         //exit(-1);
         }
     // printf("Main: completed join with thread %ld having a status"
      //      "of %ld\n",t,(long)status);
      }
      //printf("%ld",clock());

printf("check 12");

*/

////////////////////////////////
// Printing facility
/*
printf("Matrix final"); printf("\n");
for(i=0;i<row;i++)
        {
           for(j=0;j<col;j++)
           {
               printf("%d", ResultMAT[i][j]);
               printf(" ");
           }
           printf("\n");
        }       */
/////////////////////////////

  }

void* multiply(void * _multiplier){
    struct Index * _LVAR;
    _LVAR = (struct Index*) _multiplier;
    int  _LOOP_3, _TEMP=0;
    for(_LOOP_3 = 0; _LOOP_3 <  row; _LOOP_3++){
        _TEMP += Matrix1[_LVAR->LOOP1][_LOOP_3] * Matrix2[_LOOP_3][_LVAR->LOOP2];
       // printf(" %d * %d  +",Matrix1[_LVAR->LOOP1][_LOOP_3], Matrix2[_LOOP_3][_LVAR->LOOP2] );
       }
          //printf("%d\n", _TEMP);
    ResultMAT[_LVAR->LOOP1][_LVAR->LOOP2] = _TEMP;
    pthread_exit((void*) _multiplier);
    }
Tagged , , , , , ,