The online racing simulator
Joy is spending your Saturday afternoon trying to get around the fact that wxGlade is so buggy it won't even import its own export files. :/
Quote from DarkTimes :Joy is spending your Saturday afternoon trying to get around the fact that wxGlade is so buggy it won't even import its own export files. :/

I had an issue like that with a version of C#, I would include a lib and that was it, I would recompile with no changes to the code other then the lib ... the compile fails based on the contents of the lib being programmed in a previous version of C# and it not working with the newer version. But, it was a standard lib that comes with Visual Studio, from that point on, I did not bother with C#.

I just want to throw this out there, I'm not cut out to be a C# programmer, I did not look to fix the problem that proped up from this simple adding of a lib, but it hit a road block for me as I was looking for a quick and dirty way to handle something and I really don't think C# is cut out for that kind of work.
-
(DarkTimes) DELETED by DarkTimes
Quote from Dygear :Hey, guys, I need a C++ or Java programmer that is willing to make a replica of the Formula 1 Java Live Timming Thingy. It would be for SimFIA . . . So any one up for the job?

What's really crazy is that I ended up programming this for myself using Filur's lurLFSd in PHP. Crazy how far we come as programmers in such a short amount of time.

Anyway, speaking of how far we have come, I'm in need of some help with some SQL.

I'm trying to get data from 3 different tables in a database. I want to get the address of the device(s) based on id of the device(s), as connected to the member's account, that will give me a full return address for each device connected to the account.

SELECT
members.*, devices.*, smtp.*
FROM
`members`, `devices`, `smtp`
WHERE
(members.devices = devices.id)
AND
(devices.service = smtp.id);

And, gosh, there is nothing wrong with that code, it works! ... by explaining it 'out loud' I fixed my problem! Well one problem anyway, my next problem is that members.devices can work like a csv file of sorts, how do I handle that in SQL?
As a random note... isn't SQL supposed to be pronounced like "Sequel"... so it's My-"Sequel"...

Swore I read somewhere that that is correct.
Quote from dawesdust_12 :As a random note... isn't SQL supposed to be pronounced like "Sequel"... so it's My-"Sequel"...

Swore I read somewhere that that is correct.

Quote from http://en.wikipedia.org/wiki/SQL :The first version of SQL was developed at IBM by Andrew Richardson, Donald C. Messerly and Raymond F. Boyce in the early 1970s. This version, initially called SEQUEL,

The first version was pronunced 'sequel' for this reason. While it can still be used, the modern SQL (afaik) isn't an actual concatenation of SEQUEL and therefore pronuncing SQL as 'sequel' in my view, even if de facto (which I don't think it is) is technically incorrect.
they can call it "sequel" all they want, and i will always reply "what?"... everyone i know calls it S-Q-L.

same goes for daemon... it's not "demon"... it's "day-mon".
SELECT *, `Total` AS (`Training` + `Meeting` + `Detail` + `Crew` + `Additional`) FROM `Hours` ORDER BY `Total` DESC;

I'm sure you all know what I'm trying to do, but the implementation is just not working for me. Anyone have any suggestions?

(It should be noted that the rows `Training`, `Meeting`, `Detail`, & `Crew` are FLOATs and the row `Additional` is a TINYINT.)
Now here's my question... What difference does setting the correct types in MySQL make?

Not that I don't do it (out of being told to use the correct types always), but what bearing does it have on anything?
Quote from Dygear :
SELECT *, `Total` AS (`Training` + `Meeting` + `Detail` + `Crew` + `Additional`) FROM `Hours` ORDER BY `Total` DESC;

I'm sure you all know what I'm trying to do, but the implementation is just not working for me. Anyone have any suggestions?

(It should be noted that the rows `Training`, `Meeting`, `Detail`, & `Crew` are FLOATs and the row `Additional` is a TINYINT.)

What Database are you using?

Normally you write the table rows first and then the name you want the "result" to be named...
e.g. SELECT CONCAT(last_name,', ',first_name) AS full_name FROM mytable ORDER BY full_name;
Quote from Dygear :
SELECT *, `Total` AS (`Training` + `Meeting` + `Detail` + `Crew` + `Additional`) FROM `Hours` ORDER BY `Total` DESC;

I'm sure you all know what I'm trying to do, but the implementation is just not working for me. Anyone have any suggestions?

(It should be noted that the rows `Training`, `Meeting`, `Detail`, & `Crew` are FLOATs and the row `Additional` is a TINYINT.)

Shouldn't the alias come after the AS, not before?
SELECT *, (lots of stuff) AS 'Total' FROM...

edit: yeah, what the camel said.
Quote from Dygear :
SELECT *, `Total` AS (`Training` + `Meeting` + `Detail` + `Crew` + `Additional`) FROM `Hours` ORDER BY `Total` DESC;

I'm sure you all know what I'm trying to do, but the implementation is just not working for me. Anyone have any suggestions?

(It should be noted that the rows `Training`, `Meeting`, `Detail`, & `Crew` are FLOATs and the row `Additional` is a TINYINT.)

Hey Marc, been a long time. How you doing?

Should the SQL code be this way around?

SELECT *, (`Training` + `Meeting` + `Detail` + `Crew` + `Additional`) AS `Total` FROM `Hours` ORDER BY `Total` DESC;

EDIT: See above
Quote from dawesdust_12 :Now here's my question... What difference does setting the correct types in MySQL make?

Not that I don't do it (out of being told to use the correct types always), but what bearing does it have on anything?

I know nothing about this, and will probably be told off for commenting on it, but my understanding is that knowing the type of the column is very important to SQL in order for it to perform such fast queries. In a very simple model, if you have a table with a single column of floats, if you query that table for the 114th row, you can just increment the internal pointer by 114 * 4, and immediately read out that record. If it knows how many bytes each column/row takes up it can do very simple primary school maths to reach a record quickly.
OK - I knew I read about this, it's MY HERO Joel Spolsky.

Quote :How does a relational database implement SELECT author FROM books? In a relational database, every row in a table (e.g. the books table) is exactly the same length in bytes, and every fields is always at a fixed offset from the beginning of the row. So, for example, if each record in the books table is 100 bytes long, and the author field is at offset 23, then there are authors stored at byte 23, 123, 223, 323, etc. What is the code to move to the next record in the result of this query? Basically, it's this:

pointer += 100;

One CPU instruction. Faaaaaaaaaast.

Yes, I ain't no original neither. You should view the source.
Wow, I'm sorry for that stupid question! I should of seen that myself, but I had be programming code all night and it got to the point where I could not see the problem in my own code. Sorry for that. On a side note, I learned something about how SQL reads data so fast, and the only reason why I choose to keep the database data types to the smallest they need to be is because I want the foot print on the server's hard drive to be as small as possible. It had nothing to do with read times, but now I that's another reason for me to use the correct data type.

(I'm going to look this up after I post this, but Joel is the guy who hosts the Stack Overflow Podcast with Jeff right?)
Yes, that's the same Joel Spolsky. I recommend reading his essays as he is a very smart guy. Also, as I said before, he's hilarious.

Back to the off-topic topic, does anyone know of any good idiot guides to using Subversion? I've been trying to setup SVN on my Codeplex project for LFSPoints 3.0, but I find my brain dribbling out of my ears after a few minutes. Yes, I don't know how to use version control, I suck blah blah.
Don't use Subversion, it sucks.

I would suggest Git. It's a lot better and merges... are well... I've never had to do one manually, Git is intelligent and does them automatically unless it runs into something it can't do, where you then only haffto fix that file manually.

http://www.youtube.com/watch?v=4XpnKHJAok8

Go watch that, and from personal experience of trying to use SVN, CVS, and Git (to see which was easier/more efficient), I found git to be a clear winner in ease of use and at actually doing stuff like merges, branches and such.

http://toolmantim.com/articles ... new_remote_git_repository

The only downside is it is only effective on either a SSH-able box, but it is able to set it up over virtually anything. A local directory can be a repository and you clone into a working directory or even FTP/HTTP (WebDAV). It's actually probably the greatest thing I've ever seen.
I am using Codeplex to host my project and I don't believe they use Git. In fact I believe they use Microsoft's proprietary source control system, but it does support Subversion. I have TortoiseSVN installed, and I skimmed the manual, but I find it complicated and I don't really get how I can just add my existing, and rather large, project folder to it. Meh, I know nothing about this.
http://svnbook.red-bean.com/ ?

No sure how this ties into the Codeplex stuff though. I'm sure they've made it more complex than need be somehow.

EDIT: Easiest is probably to just initialise a repository on you local harddrive using TortoiseSVN (right click on folder -> TortoiseSVN -> Create repository here) and experiment on that. Once you get the concepts it's probably easy to figure out the Codeplex stuff.

EDIT2: Oh, and yeah; GIT is indeed much better in a multitude of ways, but it does lack some of the good GUI tools SVN has, as well as integration with things like Codeplex apparently. You'll probably get by fine with SVN though. Just don't rely too heavily on branching and stuff like that as merging code back from a branch is a right pain in the arse.
Quote from DarkTimes :Yes, that's the same Joel Spolsky. I recommend reading his essays as he is a very smart guy. Also, as I said before, he's hilarious.

Back to the off-topic topic, does anyone know of any good idiot guides to using Subversion? I've been trying to setup SVN on my Codeplex project for LFSPoints 3.0, but I find my brain dribbling out of my ears after a few minutes. Yes, I don't know how to use version control, I suck blah blah.

I read the entire post you linked to, it was great, I think I might just do some more reading up on his works. I really need to start reading coding horror again but Medic School is starting soon and I've got to focus on that!
I've started using subversion at home on VHPA, since I've gotten use to it at work over the past 18 months. I too am using Tortoise SVN as my client, and I'm using VisualSVN as my server. I found it a complete breeze to set up a new repository in an empty folder, then just moved all my files in there and added them.

I've heard about git but can't say I've ever tried it. Maybe git is better at dealing with conflicts but it's not often I get then with svn and then the conflict editor usually gets me sorted in no time at all.
Quote from Bob Smith :I've heard about git but can't say I've ever tried it. Maybe git is better at dealing with conflicts but it's not often I get then with svn and then the conflict editor usually gets me sorted in no time at all.

It not so much how it deals with conflicts (which it does about the same as Subversion), but rather how it avoids conflicts in the first place.

I remember having hell of a time trying to maintain two separate branches of development on my 3D framework in Subversion. Merging in changes from trunk to the branch always seemed to create a mess of conflicts all over every piece of changed code. Merging the branch back to trunk was also a real bitch which resulted in me having to manually solve a boatload of conflicts. And if I wanted to cherry-pick one change from one branch to another? More conflicts. And this was with me as the sole developer. Add a few dozen more, and it gets really hairy.

Git on the other hand makes this trivially easy by nature of how it is structured. You just branch and merge at will and it magically Just Works. It really changes the way you work if you're used to Subversion. Doing a small experiment? Branch and do your changes, merge back if it's good. Fixing a bug? Branch, fix and merge. Need one commit from another branch that fixes a problem you're seeing? Cherry-pick it into your current branch, and you're done. Easy.

The few cases where I've actually had to manually resolve a conflict in git it's always been an actual conflicting change and something that needs programmer intervention. Add to that it's distributed nature (which means you have the entire change history in your local working copy, as well as the ability to commit while working offline), and you've got yourself a winner.

If you've got an hour: Linus Torvalds on why you're stupid if you use Subversion.
Quote from wien :It not so much how it deals with conflicts (which it does about the same as Subversion), but rather how it avoids conflicts in the first place.

I remember having hell of a time trying to maintain two separate branches of development on my 3D framework in Subversion. Merging in changes from trunk to the branch always seemed to create a mess of conflicts all over every piece of changed code. Merging the branch back to trunk was also a real bitch which resulted in me having to manually solve a boatload of conflicts. And if I wanted to cherry-pick one change from one branch to another? More conflicts. And this was with me as the sole developer. Add a few dozen more, and it gets really hairy.

Git on the other hand makes this trivially easy by nature of how it is structured. You just branch and merge at will and it magically Just Works. It really changes the way you work if you're used to Subversion. Doing a small experiment? Branch and do your changes, merge back if it's good. Fixing a bug? Branch, fix and merge. Need one commit from another branch that fixes a problem you're seeing? Cherry-pick it into your current branch, and you're done. Easy.

The few cases where I've actually had to manually resolve a conflict in git it's always been an actual conflicting change and something that needs programmer intervention. Add to that it's distributed nature (which means you have the entire change history in your local working copy, as well as the ability to commit while working offline), and you've got yourself a winner.

If you've got an hour: Linus Torvalds on why you're stupid if you use Subversion.

Yeah, in the times I've been using it... The few conflicts I've had is when I was working on a file at the same time with a friend and I decided to do a total restructure of a file... turns out he was doing the same thing so git didn't know what the heck to do with these 2 files that were dramatically different. Other than that, I'll never use anything but git.
As I say I don't see any option for Git on Codeplex, maybe I'm just being dense, as per normal. Anyway, I spent some time on TortoiseSVN this afternoon and managed to get it working. I think one of those situations where I was just looking for more complexity than was there. Still not sure I'm doing it all correctly, but the source now shows up on the Web site. I'm not sure how to make changes to it, so I might need to read the manual for that, but anyway I've made some progress.
Quote from DarkTimes :I'm not sure how to make changes to it, so I might need to read the manual for that, but anyway I've made some progress.

Edit your local working copy, right click on the file(s)/folder(s) you changed, select commit, write a descriptive log message, job done.
I'm in shock right now. Over the past few days I've answered some questions on these forums that I would never even get close to answering a few months ago. 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?

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