The online racing simulator
Quote from Dygear :I have no idea how it happened, but I think I've finally become a real programmer. I understand this does not make me a good programmer, but I find it interesting that I'm answering more questions that I'm asking for the first time. Has anyone else had a moment, where they stepped back, and realized they where getting good at this?

I've never felt like a good or confident programmer. I think part of the problem was that I didn't start using PCs until I was about 12/13 and I didn't start programming until I went to uni to study computer science. It was a steep learning curve which put me off to an extent. I did about 3 years of Java and about 6 months of C at uni and I've had some good and bad moments from when I started up to today.

Good moments:
  • Writing your first "Hello World!" application (well, it's got to be there, doesn't it...).
  • Writing your first recursive method...that works!
  • Writing your first abstract data type implementation from scratch (e.g. Linked List, Stack, Queue, Priority Queue, Binary Search Tree).
  • Writing your first GUI (even if it does use absolute positioning...yuck!).
  • Writing little utility applications for yourself that make your life slightly easier.
  • The first time a friend asks you for help trying to do something and you not only understand the question but can actually help them.
  • Writing your first 'game' (minesweeper for me).
  • Understanding how ActionListeners work in Java (it took me a bit of time)
  • The first time you get paid for being a programmer.
Bad moments:
  • Writing your first recursive method...that doesn't seem to work no matter what you try.
  • The first time you get a compiler error that you just cannot understand. You spend 5 minutes convinced there's a bug in the compiler only to finally realise there's a misplaced bracket, semi-colon, a colon that should be a semi-colon (or vice versa) etc.
  • The first time you ask someone else (friend, colleague, boss (!)) to test an application that you have thoroughly tested and not been able to break that they can break instantly by doing something you hadn't thought about.
  • The first time you get a bug report in production code that you wrote.
Quote from amp88 :I've never felt like a good or confident programmer. I think part of the problem was that I didn't start using PCs until I was about 12/13 and I didn't start programming until I went to uni to study computer science. It was a steep learning curve which put me off to an extent. I did about 3 years of Java and about 6 months of C at uni and I've had some good and bad moments from when I started up to today.

I started using computers when I was, 6 (Back in 1995). Then I started programming for AMX Mod, AMX Mod is a plugin system for the original Half Life engine primarily used in Counter Strike 1.5 / 1.6 Servers, where it's plugins are made in SmallC as it was called then, but is now known as PAWN. That was 2003, from there I started programming in PHP (2004), did some work in C, C#, C++ (all 2005), and recently I started branching out into JavaScript (2008). I've been programming for 7 years now, and I am only now starting to fell confident with the materiel I've covered. It would seem that Peter Norvig is right, why is everyone in such a rush, Teach Yourself Programming, In Ten Years (I would like to point out that I read this article when I was around the 3 year mark, and I'm so glad I remembered it, it's a great read.).
I start out by learning HTML back in about 2000-ish, when I first got the internet. One day I was just browsing and I wondered how web sites were made (I'd never had an inclination to do this kind of thing before). I got a book and started learning HTML, then CSS and Javascript. So I guess you could say Javascript was the first language I learned. After that I began to wonder how big database-driven sites were made, and started to find out about this PHP thing. I programmed PHP for a couple of years, but I got frustrated as I realised I would rather be writing desktop apps.

I first of all started to learn Java, but quickly got put off by its GUI API, which at that time was pretty bad, and also the language itself kind of annoyed me (and still does if I'm honest, although nowhere near as much as PHP ). I gave up on Java and tried C#, and was just blown away by the .NET Framework, Visual Studio and the way Microsoft supports programmers. After spending a long time getting to grips with .NET, I decided to go lower level and learned C (never did much with C++, I liked the simplicity of C, and still do). Then I made the move into dynamic languages, such as Python and Ruby. Which kinda takes me to where I am today. My next step is to learn a functional programming language, such as F#.

I would say the biggest moments for me where:
  • Learning about the stack and heap, and pointers (especially how arrays were just pointers)
  • Learning about OOP, inheritance, abstract classes, and interfaces
  • Learning .NET things such as generics, delegates, events and asynchronous programming
  • Learning about socket programming with InSim, streams and packets and all that stuff
  • Learning that publishing your source code makes you a better programmer
  • Learning how to read source-code, so I can download the source to a program like SharpDevelop and make a decent attempt at understanding it
  • Learning that programming isn't actually that hard, it just takes time!
But the question, "Do I feel like a good programmer?" Well no, the more I've learned the more I realise I don't actually know anything. I find the world of programming incredibly large and daunting, and I feel very, very small.
I think it's time for my to give it a try.

At this moment, I'm only 17 years old. I started working with a computer about 10 years ago. Well, working is a big word. It was more like driving around with a handcart and collecting apples and avoiding bombs.

When I became 12-year old I discovered an old "Webdesign" (read HTML) book from my auntie. I started to make some simple websites and after a few months I could make my own, but still simple site in HTML, working with Notepad.

At a moment sites became too easy so I learned JavaScript, PHP and MySQL and started to configure my own criminal game.

Until then, I never followed any lessons on (night)school. Then the moment came, I think it was 2 years ago, I followed the basics of VB.Net and eventually I started playing LFS with my clan. I came up with the idea of creating a Ranking System so I started with almost no knowledge of Visual Basic. After some weeks the first version was online and it ran fine.

Again 1 - 2 years later the system had allot of updates and I'm trying to learn C# with recoding the system into C# language.

Good moments:
  • My first site
  • Now the system is (almost) completed in VB.Net we have a server continuously running full 24/24 7/7. It's great to see all those users having fun.
  • I make sites on regular basis for factories, stores, restaurants, ... It's great to earn something with your knowledge!
  • It's also great when you start to understand the new language and the notation of it. Programming is not Chinese. It has something logical and that's great to discover.
Bad moments:
  • Hours of testing, more testing and even more testing always result into new bugs and failures and errors... At some point you'll get enough of those bug-fixing and you don't see it anymore. If you encounter this moment, I suggest you take a shower and go to bed. The morning after, when you have fresh energy, it will all go allot better.
  • It always annoys me that when people have a problem and they post it on a forum they expect you to write their program. It's like, I can't do it, so you do it for me! But at this way they'll never learn it.
To answer on your question:
No, not really. The world of programming languages is growing as we speak. There still is so much to learn but indeed, if you get better at something it's nice to see the progress you made in a relative short time.
I basically have the biggest self confidence issue of maybe any developer ever. Every idea I ever have to get something to work, I second and triple guess myself. I ask several people I trust to be smart with this stuff about what I'm gonna do, and then I'm extremely self conscious that the code I'm writing isn't complete crap.

Then when it works, I am convinced it doesn't actually work, so I test it like mad. Then I think I'm done so I move on but then realize that I've forgotten something when I need to use it.
Add to bad moments:
- When you have to work with huuuge software projects which are poorly documented... ^^
fgrep
One thing's been bugging me for a while. I want to do a fgrep for all .php files in 'all' directories.
But doing "fgrep -r searchstring *.php" doesn't work because it will not go into any folders, due to the *.php restriction (unless there's a folder name ending in .php).
Doing a "fgrep -r searchstring *" will search through the sub dirs, but it will also search in every single file of all dirs, which is undesirable.
So how to search through subdirs but only .php files?
Just a shot in the dark.. couldn't you just pipe that into another grep (or fgrep) that searches for the .php?

(Not too sure if that will work, but worth a shot?)
i'd still have to be able to somehow look in all subdirs and pipe only the .php files' contents to grep. Don't know how to do that.
This nasty trick seemed to work for me. I used "grep -r -v * | grep -F moose" which found all lines containing "moose" in all files and subdirs. Note that the "-v" switch makes grep to find anything that does not contain the given string, here the asterisk. So change the asterisk to a char that is definitely not any of your .php files and give it a shot.


madcat@Ath3000 ~/fgtest $ ls -R
.:
aaa a.php a.php~ xxx yyy

./aaa:
b.php b.php~ c.php c.php~

./xxx:
a.php a.php~ mm.php mm.php~

./yyy:
a.php~ e.php
madcat@Ath3000 ~/fgtest $ grep -r -v * | grep -F moose
a.php:root moose
a.php~:x moose
xxx/a.php~:x moose
xxx/mm.php~:x moose
xxx/mm.php:digital moose
yyy/a.php~:x moose
madcat@Ath3000 ~/fgtest $

EDIT: Just found out that it does not filter out files without .php extension, so it still needs some polishing...

EDIT2: I got it, "grep -r -v * | grep -F .php | grep -F moose" does the trick.


madcat@Ath3000 ~/fgtest $ ls -R
.:
aaa a.php a.php~ test.txt xxx yyy

./aaa:
b.php b.php~ c.php c.php~ test.txt

./xxx:
a.php a.php~ mm.php mm.php~

./yyy:
a.php~ e.php
madcat@Ath3000 ~/fgtest $ grep -r -v * | grep -F .php | grep -F moose
a.php:root moose
a.php~:x moose
xxx/a.php~:x moose
xxx/mm.php~:x moose
xxx/mm.php:digital moose
yyy/a.php~:x moose
madcat@Ath3000 ~/fgtest $

Uhm...

man fgrep:
Quote :fgrep is the same as `grep -F'
all other options are the same as grep

man grep:
Quote : --include=PATTERN
Recurse in directories only searching file matching PATTERN.

shouldn't that work? :o

-> grep -rF --include="*.php" searchstring .
works ;p
Kinda weird, GeForzes trick doesn't work for me, but "grep searchstring * -Fr --include=*.php" does...
Quote from GeForz :Uhm...

man fgrep:


man grep:


shouldn't that work? :o

-> grep -rF --include="*.php" searchstring .
works ;p

sweeet! (using : fgrep -ir --include="*.php" searchstring .)
find . -name '*.php' -print | xargs grep string

also works
#165 - Woz
regex is my pet hate, like others here

I have a problem. I know I will use regex... Now I have two problems
Hi, I've been dabbling with various VS 08 Express versions, but I've encountered an annoying problem. I want to show the current time in an "hh:mm" format like 18:22. In VC# it works, but I can't get my head around what is the VC++ equivalent of
aLabel.Text = DateTime.Now.ToShortTimeString();

Any hints?

Edit: actually nevermind.
aLabel->Text = DateTime::Now.ToShortTimeString();

*facepalm*
Quote from NotAnIllusion :Edit: actually nevermind.
aLabel->Text = DateTime::Now.ToShortTimeString();

*facepalm*

Yeah, we all know how that is. You ask for help, you search some more, and find the answer. Then you fell like an idiot, I do that twice, three times a day.
Well, I got my first multi-threaded socket app working the way I wanted (in vb.net though, but I'm eventually going to port it to c# for practice), so I don't mind looking like an idiot today
I'm back, oh joy! I'm currently having a problem getting custom CSS working in FireFox, using userContent.css located in \users\<user>\appdata\roaming\mozilla\firefox\profiles\<random>.default\chrome.

I have the following code in the file, but the links are still blue. Any idea how to get LFSF links to be red using this method?
@-moz-document url-prefix(http://www.lfsforum.net/)
{
a:link {color:red}
a:visited {color:red}
a:active {color:red}
a:hover {color:red}
}

Most likely your new CSS rules have the same or lower specificity than the forum CSS rules. That means they get overridden by the forum's own rules. Try adding the body tag to your selectors and see if that helps. You may need to be even more specific depending on how the forum rules are constructed. Something like so:
body a:link {color:red}

EDIT: According to my web-developer toolbar, the links are styled by the following rules:

a:link, body_alink
{
color: #22229C;
}

a:visited, body_avisited
{
color: #22229c;
}

a:hover, a:active, body_ahover
{
color: #ff4400;
}

Adding the body tag in front of these rules should do the trick.
Quote from wien :Adding the body tag in front of these rules should do the trick.

This appears to have an effect. Got to be really careful selecting elements under a bunch of other tags. Red links really hurt my eyes now

Thanks

edit: actually, it also required appending !important to override cascade rules.
body a:link, .body_alink { color: red !important;}

Quote from NotAnIllusion :edit: actually, it also required appending !important to override cascade rules.
body a:link, .body_alink { color: red !important;}


!important should work with out having a higher specificity.
A (My)SQL Question for you all.

Does anyone know of a way of making one field's SET / ENUM datatype depend on another tables values?

For example, if I have one table `members` that has another field in it called `status`, I want the status to be built off and cross checked against the table `status`.

CREATE TABLE `members` (
`id` TINYINT UNSIGNED NOT NULL COMMENT 'Members Unique Id',
`name_first` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'Members First Name',
`name_last` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'Members Last Name',
`status` TINYINT UNSIGNED NOT NULL COMMENT 'Members Status Flags',
PRIMARY KEY (`id`)
) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_bin COMMENT = 'Members Root (Id in this table links to ALL other Root Tables).'

CREATE TABLE `status` (
`id` TINYINT UNSIGNED NOT NULL COMMENT 'Members Unique Id',
`class` VARCHAR ( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'Members First Name',
`display` TINYINT( 1) NULL COMMENT 'Is this a required field to maintain status?'
PRIMARY KEY (`id`)
) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_bin COMMENT = 'Status Root Connects to `members`.`status`.'

INSERT INTO `status` (
`id`, `class`, `display`
) VALUES (
1, 'Active', TRUE,
2, 'Class 1', TRUE,
4, 'Class 2', TRUE,
8, 'Student', FALSE,
16, 'Medical', FALSE,
32, 'Military', FALSE,
64, 'Leave of Absence', FALSE,
128, 'Disvowed', FALSE
);

Sounds like you're after Foreign Keys Only works with innodb under MySQL tho.
Quote from the_angry_angel :Sounds like you're after Foreign Keys Only works with innodb under MySQL tho.

It's funny, I was looking at this, and there examples don't work.

CREATE TABLE product (
category INT NOT NULL,
id INT NOT NULL,
price DECIMAL,
PRIMARY KEY(category, id)
) ENGINE=INNODB;

CREATE TABLE customer (
id INT NOT NULL,
PRIMARY KEY (id)
) ENGINE=INNODB;

CREATE TABLE product_order (
no INT NOT NULL AUTO_INCREMENT,
product_category INT NOT NULL,
product_id INT NOT NULL,
customer_id INT NOT NULL,
PRIMARY KEY(no),
INDEX (product_category, product_id),
FOREIGN KEY (product_category, product_id)
REFERENCES product(category, id)
ON UPDATE CASCADE ON DELETE RESTRICT,
INDEX (customer_id),
FOREIGN KEY (customer_id)
REFERENCES customer(id)
) ENGINE=INNODB;

It's on that very paged that you linked to, and as far as I can tell, it does not work. I try to insert a value into customer and it balks. I try to insert something into product and it has no baring WHAT SO ever on anything else. I don't see the point of this, or I don't see any point of why I just can't get something that really in retrospect be very simple.

The Off Topic Programming Thread!
(309 posts, started )
FGED GREDG RDFGDR GSFDG