Thursday, August 30, 2007

Using arrays for passing by reference

A very common thing you learn when learning a new language specifically C or C++; passing an array name as an argument leads to passing by reference.
What you can do with it:
Supposedly you want to pass a large amount of similar data ( eg. lots of variables concerning a rocket's trajectory) then you can store all data in an array and send it off. Obviously all data must be of same data-type.

Wednesday, August 29, 2007

Can't open registry editor or task manager?

If you aren't able to open your registry editor or task manager even though you are the administrator then you have got a problem.
Probably you have a virus or a malware attack. Now better to scan and find the infected files and stuff.
But even after doing a check up you still can't solve the problem then following are some registry solutions.

If you can't open the registry editor then go to START->RUN and paste the following command:

REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f

Hopefully this should solve the problem.

For enabling the task manager:

REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 0 /f

Hope this solves your problem.

Tuesday, August 7, 2007

Handling big numbers in c or c++

When i say big numbers i mean very big numbers. Numbers with digits near or in excess of 100.
We know that the greatest number you can enter is by using long double.
But there is a way to handle the biggest numbers : lets say the factorial of 100.
The solution is strings. You can use strings to input numbers and even create functions to perform operations on them just like on normal numbers. I am in the process of creating theses functions. Will post them as soon as they are ready.

Saturday, August 4, 2007

www.spoj.pl

www.spoj.pl
A fantastic site for all budding programmers.
Has a huge collection of problems to solve and the solutions can be submitted in your choice of language. Is an online judge which tells you whether the solution you submitted was correct or not.

Every problem asks for a specific format for input and output and your program should adhere to it. It should also be run within the specified time and memory limit.
Once you have submitted your program, just go to the status option and check your program's status. If its still running then wait for a while and reload the page. once it has been compiled it will either accept it or give and error. Errors range from time limit/memory limit exceeded to compilation errors to runtime errors.

Some errors which i encountered in programs written in C:

1.Compilation error
Do not include conio.h and call getch(). When testing on your own computer you can call check but when submitting do not call them.
2.Runtime error(NZEC)
your main() should return int and at the end of main be sure to include return 0.
NZEC = non zero exit code. it comes when a program doesn't have any exit code like return 0 or exit(0).

The easiest program to start from is life,universe and everything.
So sharpen your skills. They are the only things you can count on.

Why this blog is on the net

I learn something everyday and i want to share it with anyone interested in it.
I have spent a lot of time on Google searching for some information which later on i came to find on an obscure site.
I want to make a blog which works something like that obscure site. It gives that specific information to that specific guy who was specifically looking for that specific something. o_0

I would be posting anything that i learn and which i am able to remember to post.
This space will be multi-topic.