Rabu, 23 Disember 2009

C

its been a long time since I did programming. Back then I used to learn and program Java. As now, currently, I decided not to waste my time watching to much movie and do nothing so I decided that maybe I should learn C. Here's my first program:

/*******************************
this is a simple calculator
________________________________
created by Ma.D iftitah
********************************/

#include <stdio.h>
#include <stdbool.h>

int main()
{

float xFirstValue, ySecondValue;
char xOperation;
bool xCondition;

//when xCondition is a boolean, 1 = True, 0 = False

xCondition = 0;

//the while-loop

while (xCondition != 1) {

//program will ask user to enter the value of x

printf("please enter first value: \n");
scanf("%f", &xFirstValue);
fpurge(stdin);

//program will ask user to select the operation here ( +, -, x, / )

printf("\nplease select an Operation: \n");
scanf("%c", &xOperation);
fpurge(stdin);

//program will ask user to enter the value of y

printf("please enter second value: \n");
scanf("%f", &ySecondValue);
fpurge(stdin);

//program will check and calculate based on operation that user selected
//for example x + y = z

if (xOperation == '+') {
printf("\n%f + %f = %f\n", xFirstValue, ySecondValue, xFirstValue + ySecondValue);
}

else if (xOperation =='-'){
printf("\n%f - %f = %f\n", xFirstValue, ySecondValue, xFirstValue - ySecondValue);
}
else if (xOperation =='*'){
printf("\n%f * %f = %f\n", xFirstValue, ySecondValue, xFirstValue * ySecondValue);
}
else if (xOperation == '/'){
printf("\n%f / %f = %f\n", xFirstValue, ySecondValue, xFirstValue / ySecondValue);
}

else {
xCondition = 1;
}


}

//tell the user that the operation selected not valid and program will terminate
printf("\n\nOPERATION NOT VALID. PROGRAM TERMINATED\n\n");

//end of program
return 0;

}



well that is it. simple calculator. please do comment on the codes as this is my first time programmed in C.


p/s: help yourself if you need to steal my codes for your college assignment. lol. 

Selasa, 22 Disember 2009

liverfool



no offense bro.. lol!!



Isnin, 21 Disember 2009

my (mac)chines

zam comment on my last post led me to his blog. its seems that he blogged about his mac mini already and i shall not resist the temptation to blog about my (mac)hines either. so let me bring you down the memory lane on how did i end up with an apple product.


i can't barely remember my first machine, but i can tell you it ran DOS. i can't recall much about that machine as i own it about a year long and after that my mom let it go. i can't recall how the moment but its like i woke up the next day the machine wasn't there. after that as we couldn't afford to have one, i normally use my uncle's windows 98 just to play command&conquer red alert.


like any other teenagers, my affectionados with computers mostly began because of the internet, and of course during that old school netscape time there still not much one can do so most of the time was spent on IRC channel. after high-school, i went to matriculation college, failed there, move to MMU and it was there i bought my first machine and it was Acer Travelmate, running on Intel Celeron. to be honest, that machine did well and right until now it is still kicking(except for the power adapter) while many of my friend's laptop already kicked the bucket.


it wasn't my intention to buy that Acer as i was planning to buy and Apple's iBook. the only problem i had back then was that it is very hard to find an Apple reseller where i was studying and to buy it, i need to travel like 300 kilometer just to go to the nearest store. as i really in need of a computer, the only choice was to go with a windows machine and the Travelmate was the only one that suits my dollar and cents (that time Apple was still using PowerPC, Intel Pentium for laptop was expensive and i ended up getting a Celeron). the Travelmate costs a bit lesser than iBook.


fast forward to next four years after that, i got a job as technical support and i got to hold a Compaq given by the company and i gave my Acer to my mom. after i jump to my current company at first my boss gave me another Compaq and after using it for a while it was replaced by a Toshiba M200. the Toshiba gave me the luxury of running hackintosh after so long i resist the temptation to use a Mac.


lucky enough, i was able to convinced my boss to replace my 8 months old toshiba with a macbook (actually i do need a Mac since we mostly rely on window machine, to test a network you'll need to test it on different platform so you can justify to the client it can run on multiple platform). that was how lucky i am to ended up getting a Mac.







laying lazily on sofa watchin tv



tv's boring.. how about we play a strip poker



the mac lost.. stripping it slowly



undo nicely~




hey what's that?





hi sexy~





tempting.. tempting





osX!!!!! tadaa~





settling down with the family: hp external monitor pinjam-unlimited-from-errR..office, logitech mx700 pinjam-unlimited-from zam, apple wireless keyboard

Selasa, 15 Disember 2009

sunday

that day was our first anniversary of 'going out' together. we started seeing out each other back that day one year ago. i was always a secret fan of her back then in school and to be honest i didn't have the guts to tell her during that time. time passed by and soon it became 7 years. how we ended up being together? i don't know. maybe it's just 'fate'.


she invited me to have breakfast that sunday. the menu was a simple 'cucur udang' and hot nescafe 'o'. we had our breakfast by the pond and it was truly romantic. we talked, laughed, share stories and i was really happy so was she. the weather was very fine with the sun shone brightly with the blue skies as the background, it couldn't been any better. its like the morning was just made for us.


by noon, we went shopping for few things. she bought me a very nice green tshirt and i love the design. i bought few stuff for my office and some for home. for lunch, we had our usual sushi time and we had it served with some pianist playing love song as background music. soon we went to another store. the shopping was nothing, but shopping with her was something.


the evening we spent our time by the lake. we walked along and have a good conversation. the weather a little bit gloomy with clouds covering the blue skies and the sun. maybe it indicates the sadness of our parting time. even then, inside i was really happy and seeing her happy really make my sunday. i sent her home and we wish each other a sweet goodbye.


back at home, i kept playing my sunday repeatedly inside my head and suddenly i realized i was writing this on a piece of paper. last time we had a fight and she complained that i didn't wrote anything about her here. this time she deserved an entry and this post is just dedicated for her.


i am not writing this to impress her nor to brag. i am writing this because this post will act as a reminder for myself. a reminder of how i love her so much. it will someday trigger my emotion and maybe by reading this post back in the future i can recall how a happy person i was that day and i really was. i do love you a lot, i really do.


thank you for made up my sunday. i really appreciate it.