PDA

View Full Version : Hey, I'm new here



Shaun32887
06-18-2008, 06:10 PM
Just saying hi, my name's Shaun and 'm a 21 year old engineering student living in Houston Texas. I don't have much experience programming (they taught us Matlab and nothing else) and my job this summer requires me to learn C++, so I figured joining a forum would be a good idea. It's coming along pretty nicely, I've been going through a book word for word and I've written a few pretty decent little programs so far. My work will mainly deal with reading text files, separating by delimiters, and then breaking the strings into fragments for analysis. I think next on my agenda is to learn about these so called "hash tables"...

I also love music, I've played guitar for about nine years now, I like cooking, and I'm a big MMA fan.

That's pretty much it.

BMJ
06-18-2008, 08:27 PM
Hey Shaun, always nice to see new people taking an interest in C/C++. :cool:

BTW what's MMA?

azerej
06-18-2008, 11:15 PM
Mixed Martial Arts, I'm guessing.

Shaun32887
06-19-2008, 07:19 AM
Mixed Martial Arts, I'm guessing.

Yup, UFC, WEC, PRIDE, all that stuff.

DavidP
06-19-2008, 07:29 AM
Hey I'm from the Houston area as well. Nice to have ya.

All I can say is: if you are dealing with lots of string parsing, make sure to use C++ strings and not C strings :)

Elysia
06-19-2008, 08:53 AM
If you are doing lots of parsing, get boost. That's all I can say.
Eh, get boost anyway, no matter what you do - it has loads of useful stuff.

indigo0086
06-19-2008, 08:55 AM
learn about regular expressions that boost uses to be specific.

Shaun32887
06-19-2008, 10:26 AM
Boost, I will look into that.


I wasn't sure if regular expressions would help with the parsing, so some opinions on this subject would be helpful.

As far as I understand, regular expressions are great tools for finding specially formatted strings of text. However, in my project, I won't care what the string is exactly, just how long it is. I'll be breaking it up into one character strings, then two character strings, then 3 and so on up to 5.

Would regular expressions be worth looking into further?

indigo0086
06-19-2008, 10:30 AM
Regular Expressions don't look at specific formats, they allow you to look for patterns in text (allowing you to delimit a string by characters, length, words, or anything you can think of.) If you have strings to break up if you know the specific length, then you probably won't need to, you can just capture a certain amount of characters from a stream and place that as a symbol in your program. But as opposed to programatically doing it in C++, boost regular expressions allow you to do it nearly all at once. significantly reducing code length, and impressing your new bosses.

Elysia
06-19-2008, 11:20 AM
They also allow you to split text into an array, and much much more. I don't think I know even half of what it can do.
There's no harm in trying to learn it, however. By doing it, you can then determine if it's good for the job or not.

indigo0086
06-19-2008, 11:27 AM
We had fun in my unix programming course doing regex using sed,grep,cat, and awk, writing several lines of code, only to be shown up by the professor with his two lines of horrendous regex patterns that do what several lines would do.

Shaun32887
06-19-2008, 11:43 AM
Regular Expressions don't look at specific formats, they allow you to look for patterns in text (allowing you to delimit a string by characters, length, words, or anything you can think of.) If you have strings to break up if you know the specific length, then you probably won't need to, you can just capture a certain amount of characters from a stream and place that as a symbol in your program. But as opposed to programatically doing it in C++, boost regular expressions allow you to do it nearly all at once. significantly reducing code length, and impressing your new bosses.

Yeah, sorry, still getting the jargon down. Patterns was what i meant, not formats.

Everything else there looks promising though, I'll definitely look into it.

Thanks!

Shaun32887
06-19-2008, 11:44 AM
They also allow you to split text into an array, and much much more. I don't think I know even half of what it can do.
There's no harm in trying to learn it, however. By doing it, you can then determine if it's good for the job or not.

Naturally, and I'm sure I'd learn them one day whether I need them for this project or not. However, due to my lack of c++ experience, time is somewhat on short supply, so at least for this summer I need to streamline the amount that I learn.

Elysia
06-19-2008, 11:51 AM
I see.
Well, maybe you should put it to side for now, then :)
Regex can be very complex, and will probably require lots of time and practice to master.

indigo0086
06-19-2008, 12:09 PM
I recommend
http://www.amazon.com/Primer-4th-Stanley-B-Lippman/dp/0201721481

Great book.