Thursday, 9 April 2009

Syntax Highlighter Check

I installed SyntaxHighlighter by Alex Gorbatchev.
Since it uses javascript so to be able to see syntax highlighted code make sure that javascript is enabled for your browser e.g if you have Firefox with noscript, then add this site to whitelist.

Let's test some test code for python

#Sum n numbers
def sum_n(n):
return n*(n+1)/2

print sum_n(10)


and some test code for c


/* Calculates sum of n numbers */

int sum_n(int n)
{
return n*(n+1)/2;
}

int main()
{
int n;
printf("Enter n:");
scanf("%d",&n);
printf("\nSum : %d",sum_n(n));
return 0;
}


Let's see if it works.

Wednesday, 8 April 2009

Project Euler Solutions

I am thinking about posting solutions and strategies about problems from Project Euler. Since there are lots of persons who have solved the starting problems so I think it's fair enough to share my ideas and code as the solutions forums were already closed for some of the problems.

Well if you like to have fun then try to first solve the problem yourself.

Wednesday, 1 April 2009

PSEB 5th class Result out

Today result of 5th class of Punjab School Education Board was made available online. One of my nephew is studying in 5th class so i thought to check it out. But what a pity, after trying a lot i was unable to get the result as I was told that the roll no. couldn't be found. There site is so lame. They need to have some good coders. They expect everybody to read there mind? They gave no hint whatsoever how to enter your roll number. What to include and what not to. After few tries i asked my nephew to give his roll number and he told me the same with area code that is i guess specific to area where he wrote the exams. But the problem again persisted. The roll number was given in format 100-08-123456. I entered it but still no luck. Then after some more tries i thought to remove the hyphens and try it. And guess what it worked!

Now isn't this the responsibility of the staff to tell the students how to enter the roll number. They are not the mind readers. They must be told what to do and how.

Anyways i think there will be many other frustrated souls out there trying to know there future. So i hope this could help you a bit.

And if you don't want to Google then you can find the result at www.ssapunjab.org

Btw my nephew passed with good marks.

Good luck to all!