[Browse] [Tag cloud]

Log on:
Powered by Elgg

Chris :: Blog :: Archives

October 2007

October 01, 2007

Hi everyone

 

Just a quick post this one, to say I arrived nice and early yesterday and am all set and ready to go now! Staying on Bulmershe and have to go to Whiteknights this afternoon (for the Cybernetics welcome talk thingy) but not looking forward to the bike ride because it's currently chucking it down with rain...

 

See you all around some time I guess! 

Keywords: arrived, bulmershe, freshers

Posted by Chris | 0 comment(s) | Share

October 11, 2007

Well here I am to suggest a better first program!

To be honest I think that the one demonstrated is pretty effective; it is simple enough for even beginners to do (and hopefully understand) and should give people who have worked with other languages but not necessarily C (like myself) at least some information about how the language works - I found it pretty good. I guess the experienced programmers (who have worked in C) will find it pretty easy, but then that's to be expected.

What could be done is to include more functions so that more experienced users can be sure how to call different functions in the language, which would be cool. Then the beginners can see that this is actually possible, the more experienced users can see that this is how it works, and the experts will have slightly less grounds to complain! One other thing which would be good for the people doing the practical before the lecture, is some comments explaining what each part of the code does or signifies, because I found the lecture yesterday really useful for getting a good basis to build on.

Other than that, I must confess it's a pretty good first program.

Keywords: c, practical, programming, se1sa5

Posted by Chris | 0 comment(s) | Share

October 18, 2007

Here I am to help (yet again) fill up the Redgloo homepage with posts relating to practicals! Sorry :P

Before my programming experience was limited to web languages only - HTML, CSS, Javascript, PHP and a very little bit of Perl. Today I've learnt that trying to put quote marks "" around integer variable declarations or the numbers come out quite large (and wrong), so that's one major difference to PHP. Also I've learnt that once you have a program working, it's very hard to break it and not make it obvious for the quiz question! Coming up with alternative answers was tricky too.

Overall I've gained a better knowledge of C and how it differs from everything else I've done, so that's a good thing!

Keywords: SE1SA5 perl php c

Posted by Chris | 0 comment(s) | Share

The latest version of the Ubuntu Linux operating system has been released, 7.10 codenamed Gutsy Gibbon. Anyone who has used linux before, uses it already or just wants to give it a shot can get it from the official Ubuntu download page at http://www.ubuntu.com/getubuntu/download. Despite the fact that bittorrent use on the University's network is forbidden, the download is one of the few things legally available on that platform (although not recommended or ITS will be on you). 

Keywords: ubuntu linux 7.10 gutsy gibbon

Posted by Chris | 6 comment(s) | Share

October 25, 2007

Well I've been busy and have managed to produce this piece of code for Practical 3. I put an explaination below :-)

#include <stdio.h>

int checkTrees (int number);

int askAgain (int value);

int main() {

int num1, num2, ctRes, sum;printf(

"Please enter the number of trees you have planted: ");scanf("%d", &num1);

num1 = checkTrees (num1);

printf("Please enter the probable absorption per tree (kg): ");scanf(

"%d", &num2);

sum = num1 * num2;

printf("Your planting scheme will absorb %d kilogrammes of Carbon Dioxide.\n", sum);

if (num2<750) {printf(

"Your trees are absorbing very little carbon dioxide each,\nyour overall absorption would be higher if you used better trees.\n");

}

if (sum>100000) {printf("Your carbon dioxide absorption is making a significant impact\non the world's environment! :)");

}

return 0;

}

int checkTrees (int number) {if (number < 1) {

askAgain(1);

} else {

return number;

}

}

int askAgain (int value) {

int num1;printf(

"Please enter a number of trees greater than 0: ");scanf("%d", &num1);

checkTrees (num1);

}

 

Basically, it checks with function checkTrees, then if it's less than 1 it asks again with the askAgain function, then passes the value back to checkTrees which checks again. If it's 1 or more this time, it passes the inputted value back into num1. As a bit of an extra, if you have less than 750kg absorption on each tree it recommends you get better trees, and if you absorb loads of carbon dioxide (more than 100 000 kg) it congratulates you for making a significant contribution to saving the planet. Fun!

Keywords: SE1SA5, trees

Posted by Chris | 3 comment(s) | Share

October 29, 2007

So building on the really enjoyable CoP3D meeting last week, I decided to try second life on my computer - again. It's quite an old piece of hardware so it's not so great (integrated Intel graphics, yummy!) and i never really got it to run satisfactorially several months ago. Well with the help of the super-fast net here... it still fails. Well, mostly. It runs nice and smoothly at about 120 x 100 resolution. Which is great if you want to walk around with 4 pixels as your head :S

Maybe a new computer is required at some point! 

Keywords: cop3d, hardware, second life

Posted by Chris | 6 comment(s) | Share

/