The previous two installments about Warcraft 2 were also very interesting.
The Big Programming Thread - Page 165
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
gravity
Australia1734 Posts
The previous two installments about Warcraft 2 were also very interesting. | ||
3FFA
United States3931 Posts
Any tips for when I start actually learning C? Also, any places I could use to practice this? We will be using only whatever simulator it is that they chose and not porting any code onto real iPods or what not. | ||
tec27
United States3690 Posts
| ||
3FFA
United States3931 Posts
On September 08 2012 12:24 tec27 wrote: Are you sure its not Objective C? Sounds like it'd be more applicable to what you're talking about. Not sure. I'll ask on Monday. She only said 'C' and she also said that she has been programming in quite a few languages for years and has been teaching programming for years. | ||
Mr. Wiggles
Canada5894 Posts
On September 08 2012 12:28 3FFA wrote: Not sure. I'll ask on Monday. She only said 'C' and she also said that she has been programming in quite a few languages for years and has been teaching programming for years. Well, you mentioned programming apps and then running them on an iPod simulator. Objective-C is the language that is mostly used when programming applications for use on OS X and iOS (To my knowledge). http://en.wikipedia.org/wiki/Objective_c | ||
phar
United States1080 Posts
On September 08 2012 10:06 CorsairHero wrote:I agree on that one. A git status on a 1.2 gb source repo takes about 30 seconds, which is a hell of a lot faster than cvs. I dont know what companies have a 10 gb repo. It should have been split up before it got to that size. Imagine how long it would take to build that. That depends entirely on the build tools being used. If it's properly distributed, cached, etc., probably faster than your 30s git status :p git doesn't scale. Other stuff does. That doesn't mean git is bad. It's very useful for smaller amounts of stuff. It just means if, like Facebook, you try to use git with large amounts of code, ![]() User was warned for this post | ||
Voltaire
United States1485 Posts
On September 08 2012 10:34 3FFA wrote: Ok, I started my Programming in C (not C++ , also this is a brand new course to replace the 12 or something year old course that this same teacher previously taught) class at my High School (With brand new Macs installed last Friday) two days ago. There are a bunch of planned projects and we'll also learn programming for apps. Any tips for when I start actually learning C? Also, any places I could use to practice this? We will be using only whatever simulator it is that they chose and not porting any code onto real iPods or what not. This guide is GREAT for getting started with C: http://computer.howstuffworks.com/c.htm and I use CodeBlocks as a compiler. It's a great program. | ||
wherebugsgo
Japan10647 Posts
On September 07 2012 09:20 berated- wrote: Every reason you can come up with for hating and therefore not using any IDE like Eclipse/Netbeans is pretty much erased when you deal with projects that are so large that you can no longer keep all of the code in your head. Call hierarchies and being able to dive through code at a fast rate are imperative when dealing with enterprise type environments. As stated, not a huge deal for when you're in Uni...just wanted to give the disclaimer that your professor's view is skewed because he's in a learning environment and not a get-shit-done environment. well yeah, I knew that going in and reading his reasons as well. He used Eclipse for a long time, and in fact this is the first year that our course uses emacs as the "official" IDE. We're using a proprietary clone of svn for version control basically. At any rate he doesn't like Eclipse for pedagogy though it's probably better for large projects with collaboration. | ||
CorsairHero
Canada9489 Posts
On September 08 2012 15:07 phar wrote: That depends entirely on the build tools being used. If it's properly distributed, cached, etc., probably faster than your 30s git status :p git doesn't scale. Other stuff does. That doesn't mean git is bad. It's very useful for smaller amounts of stuff. It just means if, like Facebook, you try to use git with large amounts of code, Right, I don't know the exact set up of my workspace server (ntfs i think, not sure about raid configuration or cache size) By scaling you mean performs better as the repo gets larger? Which ones do that and approx what point is git more efficient (assuming this is a code base with lots of files and not one for media files). Is clearcase an example of one? | ||
phar
United States1080 Posts
On September 09 2012 00:40 CorsairHero wrote:Right, I don't know the exact set up of my workspace server (ntfs i think, not sure about raid configuration or cache size) By scaling you mean performs better as the repo gets larger? Which ones do that and approx what point is git more efficient (assuming this is a code base with lots of files and not one for media files). Is clearcase an example of one? Yes, as the repo gets larger, as the number of actions gets larger, etc. Perforce scales better, which is apparently what companies on the scale of Facebook, Google, Microsoft, etc. have to use. (Conveniently it's also centralized and controlled, /tinfoilhat) There's a solution: http://kb.perforce.com/article/1417/git-p4 | ||
3FFA
United States3931 Posts
On September 08 2012 15:11 Voltaire wrote: This guide is GREAT for getting started with C: http://computer.howstuffworks.com/c.htm and I use CodeBlocks as a compiler. It's a great program. Thanks for that link! I'll check it out shortly, looks good at first glance though. | ||
Nausea
Sweden807 Posts
Basically, I want to be able to get the keydown state on any key, and if that key is a specific key, I want to time how long it is being held for during the time it is being held, not after it has been released. Any ideas on how to do this? In a game this could be used to start charging up a gun after say 1-2 seconds, and right now I just cant figure out how to go about doing it. Example: if key is pushed and released within 1sec, shoot rank1 shot. if key is pushed for more than 1sec start charup animation. when key is released, how long was it held? more than 2sec? shoot rank2 shot and so on.. Hope it is appropriate to post about SDL in this thread, since it´s about c++ too. | ||
netherh
United Kingdom333 Posts
On September 09 2012 23:55 Nausea wrote: Well, I´m just gonna go for it I guess. Anyone good with SDL with c++? I have had this noob problem for a while now, been banging my head against the wall. Basically, I want to be able to get the keydown state on any key, and if that key is a specific key, I want to time how long it is being held for during the time it is being held, not after it has been released. Any ideas on how to do this? In a game this could be used to start charging up a gun after say 1-2 seconds, and right now I just cant figure out how to go about doing it. Example: if key is pushed and released within 1sec, shoot rank1 shot. if key is pushed for more than 1sec start charup animation. when key is released, how long was it held? more than 2sec? shoot rank2 shot and so on.. Hope it is appropriate to post about SDL in this thread, since it´s about c++ too. This part of the SDL documentation is pretty much what you're looking for: http://www.libsdl.org/cgi/docwiki.cgi/Handling_the_Keyboard Inside the event loop you want to check for SDL_KEYDOWN and SDL_KEYUP events. Check the event information (event.key.keysym.sym) to see if it matches the key you want to monitor. When you get the relevant key down event, start a timer (or set a value with the time the key went down - maybe use SDL_GetTicks() for this). When you get the key up event, check the timer or calculate the amount of time passed from when the key went down. | ||
Nausea
Sweden807 Posts
On September 10 2012 00:18 netherh wrote: This part of the SDL documentation is pretty much what you're looking for: http://www.libsdl.org/cgi/docwiki.cgi/Handling_the_Keyboard Inside the event loop you want to check for SDL_KEYDOWN and SDL_KEYUP events. Check the event information (event.key.keysym.sym) to see if it matches the key you want to monitor. When you get the relevant key down event, start a timer (or set a value with the time the key went down - maybe use SDL_GetTicks() for this). When you get the key up event, check the timer or calculate the amount of time passed from when the key went down. Hey, thanks for answering. But, that part I know and can do already. What my problem is, is the following. I want to be able to update the timer when the key is being held down, and update it during to see what time has passed without getting the keyup event. So i can start an animation when the key has been held for more than 1sec without letting the key up. See my problem? I don´t know how I would go about doing this, i tried using a loop and running in while the keyup event for my specific key is not on the queue but that just puts the program in that loop until i release the key and that is no good. | ||
Zeke50100
United States2220 Posts
On September 10 2012 00:46 Nausea wrote: Hey, thanks for answering. But, that part I know and can do already. What my problem is, is the following. I want to be able to update the timer when the key is being held down, and update it during to see what time has passed without getting the keyup event. So i can start an animation when the key has been held for more than 1sec without letting the key up. See my problem? I don´t know how I would go about doing this, i tried using a loop and running in while the keyup event for my specific key is not on the queue but that just puts the program in that loop until i release the key and that is no good. In your main game loop (or a function that is called in the main loop, like "UpdateKeyTimers()" or something like that), you could always have an if-statement checking for keys that are currently pressed, then increment a variable that corresponds to that key. Just a bit of rough code that demonstrates the idea (although not particularly a good implementation of the idea):
| ||
Nausea
Sweden807 Posts
On September 10 2012 00:55 Zeke50100 wrote: In your main game loop (or a function that is called in the main loop, like "UpdateKeyTimers()" or something like that), you could always have an if-statement checking for keys that are currently pressed, then increment a variable that corresponds to that key. Just a bit of rough code that demonstrates the idea (although not particularly a good implementation of the idea): + Show Spoiler +
Ok, thanks for your time, I will try it out if I understand it correctly. Just a bit worried i wont be able to get real time without using GetTicks, but we´ll see. Edit: Just to update, I actually got it working with 2 booleans and some logic in my Keydown and Keyup functions, with real time from SDL_GetTicks(). It´s amazing with a lot of stuff in programming how easy they look once you solve them. | ||
powerbygood
United States54 Posts
| ||
cowsrule
United States80 Posts
On September 10 2012 15:28 powerbygood wrote: Can anyone help me with class templates? I've googled around for tutorials on it, but I am not grasping the concept fully on it. I keep getting an error that says template not defined even though I defined it in the header file while trying to implement it through the main program. Hope this helps a bit: http://www.parashift.com/c -faq-lite/templates.html. If you can post your code/error and a more specific question it would be possible to give you an exact answer to your problem as well ![]() Edit: Specifically you may be running into this issue http://www.parashift.com/c -faq-lite/separate-template-class-defn-from-decl.html. | ||
holdthephone
United States523 Posts
EDIT: Nevermind, all figured out! + Show Spoiler + Alright, this should be simple. I'm just taking a string argument that looks like "text:text:text", splitting that on ":" and returning a string array of the separated words. In my Windows Form I have this working perfectly using the Split method and iterating through the newly created array, but admittedly, this is for an assignment and we're learning how to incorporate that into a dll file that our Windows Form will reference. So in my Class Library file (the .dll), I'm trying something like this:
then to call the method in my form (showing just a snippet), I use:
is there a reason why that wouldn't work? | ||
DumJumJmyWum
United States75 Posts
this question isn't specifically related to programming, but more of a career choice. I don't have that much experience, only 1 year out of college. I got a call an opportunity from a software consulting services company. They offered to train me for one month. They'll then place me in interview for jobs after i'm done training. I'm wondering if anyone has had any experience with these. Should I just get a regular 9-5 salaried job? Are these places bad? This is in the US. | ||
| ||