Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | Programming Challenges?

You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > General IT Discussion
Register FAQ Community Calendar

Programming Challenges?
Reply
 
Thread Tools
Old 18-08-2009, 18:44   #91
Fobic
Inactive
 
Join Date: Dec 2005
Posts: 23
Fobic is a jewel in the roughFobic is a jewel in the roughFobic is a jewel in the roughFobic is a jewel in the roughFobic is a jewel in the rough
Re: Programming Challenges?

Quote:
Originally Posted by punky View Post
Change your Reply To Thread box from HTML WYSIWYG to plain text. You can toggle it by clicking the button in the top right.

That does the trick. Many thanks.

Never noticed the stuff in the top right before. Must be old age
Fobic is offline   Reply With Quote
Advertisement
Old 19-08-2009, 07:18   #92
Waldo Pepper
Inactive
 
Join Date: Jul 2009
Location: In the thick of East Anglia
Posts: 573
Waldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation eraWaldo Pepper has entered a golden reputation era
Re: Programming Challenges?

When I was learning C in the 80's, I used to write programs to prove or disprove if a number is prime. Specifically the Lucas Lehmer test.
Easy to do in C. Re-writing in 8051 assembler will make you a real programmer. Moreso if you then re-write code to get your graphics card to do it using ultrafast VRAM.
Dissassembling programs is also good practise. Compile a program to multiply two numbers, go and look at the generated code and try to work out what's going on.
I personally always find assembly programming more challenging. Getting a floating point divide to work is easy. Not in 128bytes of stack in 512bytes of reserved code space it isn't.
Waldo Pepper is offline   Reply With Quote
Old 19-08-2009, 08:35   #93
Damien
Remoaner
Cable Forum Team
 
Damien's Avatar
 
Join Date: Mar 2004
Posts: 32,719
Damien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver bling
Damien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver bling
Re: Programming Challenges?

Quote:
Originally Posted by Waldo Pepper View Post
I personally always find assembly programming more challenging. Getting a floating point divide to work is easy. Not in 128bytes of stack in 512bytes of reserved code space it isn't.
Thankfully we have better languages to abstract tasks like that away from us
Damien is offline   Reply With Quote
Old 19-08-2009, 12:00   #94
Hugh
laeva recumbens anguis
Cable Forum Team
 
Hugh's Avatar
 
Join Date: Jun 2006
Age: 68
Services: Premiere Collection
Posts: 43,475
Hugh has a golden auraHugh has a golden auraHugh has a golden aura
Hugh has a golden auraHugh has a golden auraHugh has a golden auraHugh has a golden auraHugh has a golden auraHugh has a golden auraHugh has a golden auraHugh has a golden auraHugh has a golden aura
Re: Programming Challenges?

Quote:
Originally Posted by Damien View Post
Thankfully we have better languages to abstract tasks like that away from us
Yup - machine time/hardware cheap, people time expensive (which does not excuse carp/inefficient code).
__________________
Thank you for calling the Abyss.
If you have called to scream, please press 1 to be transferred to the Void, or press 2 to begin your stare.

If my post is in bold and this colour, it's a Moderator Request.
Hugh is online now   Reply With Quote
Old 19-08-2009, 12:33   #95
Damien
Remoaner
Cable Forum Team
 
Damien's Avatar
 
Join Date: Mar 2004
Posts: 32,719
Damien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver bling
Damien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver bling
Re: Programming Challenges?

Quote:
Originally Posted by foreverwar View Post
Yup - machine time/hardware cheap, people time expensive (which does not excuse carp/inefficient code).
Nope for a start others need to maintain it, inefficiency is avoided but I don't think it's as massive a problem as people make out. Often the areas you think a inefficient are not so while other areas may be. Anything web based then bandwidth is probably your most precious resource which you need to optimise.

For example the optimisations we were doing on Month Hall would have no noticeable effect, if you were doing a website and sending too much kb to the client it would be very notable.
Damien is offline   Reply With Quote
Old 20-08-2009, 10:19   #96
Raistlin
Inactive
 
Join Date: Feb 2004
Location: There's no place like 127.0.0.1
Services: Depends on the person and the price they're offering
Posts: 12,384
Raistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered stars
Raistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered stars
Re: Programming Challenges?

What's wrong with this c code?

Code:
#include <stdio.h>
int main()
{
    printf("Hello World\n");
    return 0;
}


---------- Post added at 10:19 ---------- Previous post was at 10:10 ----------

NVM - nothing wrong with the code, something wrong with Ubuntu.

It doesn't include the standard libraries as part of the install, which means that the code above won't compile.

Sorted now.
Raistlin is offline   Reply With Quote
Old 20-08-2009, 17:19   #97
handyman
Permanently Banned
 
Join Date: Jun 2003
Location: Nr Carnforth
Age: 49
Services: M6 Keele
Posts: 5,462
handyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny star
handyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny star
Send a message via MSN to handyman
Re: Programming Challenges?

This may be a good place to ask this question which is probably too simples to have a thread of it's very own. Working on upgrading our current flat db to a more complex relational db in order to speed things up both in use and data entry. This bit of code is the index of dates.
I have 2 tables - courses and dates and each course can be associated with many dates.

This went well till a 4th date was added now I get an error.
Quote:
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 1 on MySQL result index 9 in /home/purple/public_html/test/date_index.php on line 24

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 1 on MySQL result index 9 in /home/purple/public_html/test/date_index.php on line 25

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 1 on MySQL result index 9 in /home/purple/public_html/test/date_index.php on line 26
Start Date: 22/08/09
Course:
As I understand my code it gets an array of the dates and for each one it uses the course_id to get the course_name from the courses db.

Can anyone explain what I'm doing wrong?

Code:
<?php
include("menu.php");
include("connect.php");
$query="SELECT * FROM date ";
$result=mysql_query($query);
$num = mysql_num_rows ($result);
mysql_close();
if ($num > 0 ) {
$i=0;
while ($i < $num) {
$date_start = mysql_result($result,$i,"date_start");
$course_id = mysql_result($result,$i,"course_id");
$id = mysql_result($result,$i,"id");
$date = date("d/m/y",strtotime($date_start));
include("connect.php");
$query2="SELECT * FROM course WHERE (`id`='$course_id') ";
$result2=mysql_query($query2);
$num2 = mysql_num_rows ($result2);
mysql_close();
$i2=0;
$code = mysql_result($result2,$i2,"code");
$name = mysql_result($result2,$i2,"name");
$id = mysql_result($result2,$i2,"id");
echo "<b>Start Date:</b> $date<br>";
echo "<b>Course:</b> $name<br>";
echo "<a href=\"date_update.php?id=$id\">Update Date</a> - <a href=\"date_delete.php?id=$id\">Delete Date</a>";
echo "<br><br>";
++$i; } } else { echo "The database is empty"; }?>
The Error is
handyman is offline   Reply With Quote
Old 31-08-2009, 09:21   #98
punky
Inactive
 
Join Date: Jun 2003
Age: 44
Posts: 14,750
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
Re: Programming Challenges?

I remember what heero was saying about microprogramming, so I thought this was worth posting. Its an IP stack (sort of) that fits inside a Twitter tweet.

http://www.sics.se/~adam/twip.html

Code:
char b[140];unsigned short *s=b;*l=b;t;main(){while(1){read(0,b,140);b[20]=0;s[11]+=8;t=l[4];l[4]=l[3];l[3]=t;write(1,b,140);}}
punky is offline   Reply With Quote
Old 16-09-2009, 22:20   #99
punky
Inactive
 
Join Date: Jun 2003
Age: 44
Posts: 14,750
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
Re: Programming Challenges?

Bit of a bump, I stumbled on a great programming blog today (well judgng by the latest few articles anyway)

http://cafe.elharo.com/

Its aimed at experienced programmers but novice ones can learn a lot from those more experienced.
punky is offline   Reply With Quote
Old 17-09-2009, 12:28   #100
tweetiepooh
Virgin Media Employee
 
tweetiepooh's Avatar
 
Join Date: Sep 2005
Location: Winchester
Services: Staff MyRates BB: VM 1Gb TV: VM XL Phone : VM XL
Posts: 3,274
tweetiepooh has a bronzed appealtweetiepooh has a bronzed appeal
tweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appealtweetiepooh has a bronzed appeal
Re: Programming Challenges?

Try Perl, nice easy and big following. Head over to Perlmonks for support, help and Perl chat.
__________________
I work for VMO2 but reply here in my own right. Any help or advice is made on a best-effort basis. No comments construe any obligation on VMO2 or its employees.
tweetiepooh is offline   Reply With Quote
Old 17-09-2009, 12:37   #101
Stuart
-
 
Stuart's Avatar
 
Join Date: Jun 2003
Location: Somewhere
Services: Virgin for TV and Internet, BT for phone
Posts: 26,546
Stuart has a lot of silver blingStuart has a lot of silver blingStuart has a lot of silver blingStuart has a lot of silver blingStuart has a lot of silver bling
Stuart has a lot of silver blingStuart has a lot of silver blingStuart has a lot of silver blingStuart has a lot of silver blingStuart has a lot of silver blingStuart has a lot of silver blingStuart has a lot of silver blingStuart has a lot of silver bling
Re: Programming Challenges?

I have to admit, I miss c++ programming. I used to write a lot of little utils for admin stuff in work (restarting machines remotely, monitoring them, that sort of thing) in c++, but the boss had this idea of centralising all our admin stuff on one website.

So, any utils I write now have to be created using ASP, PHP or Perl. Of course, I could write something in c++ that just interfaces with the site using CGI, but I don't think that would be allowed.
Stuart is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:42.


Server: osmium.zmnt.uk
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum