The Big Programming Thread - Page 228
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. | ||
DEN1ED
United States1087 Posts
| ||
nunez
Norway4003 Posts
On January 09 2013 08:51 NukeTheBunnys wrote: Im looking to do some c++\openGL game related programming. Does anyone have any suggestions for a cross platform library (or libraries) that can do windowing, input, and sound. And before someone says I should use an engine like Unity, or a different language - half the point of doing this is I'm interested in the low level game systems like managing the input/threading/audio streams Windows APIs (not multi-platform, but oh well - I can encapsulate the code anddeal with porting the code if I ever want to port it) SDL - started working with it but had some troubles getting it set up on windows and visual studio, but otherwise it looks like it would meet all my desires. Allegro - can be used with openGL, but the documentation of using allegro with openGL (2d or 3d) is pretty sparse I have also considered using openAL for 3d positional sound, but that will likely come after I get some of the other systems working Anyone have other suggestions, or experience with the mentioned libraries. i know Qt provides what you are looking for. | ||
Craton
United States17250 Posts
On January 09 2013 12:29 DEN1ED wrote: Just had my first day of my first programming class today. Loved it and already did the assignment that is due next week and I kinda want to keep going and doing more. It was just the most basic assignment to print text. Is there a good place that has tutorials and stuff to keep learning more? A lot of the links of the front page seem broken. Learning java fyi. System.out.println("Hello World"); Pick something you want to accomplish and keep throwing code at it till you figure it out. Then look up how to do it better. I don't keep track of tutorial sites for Java. | ||
Pigsquirrel
United States615 Posts
Not quite. Qt is a widget framework (and a lot of other crap). It's really meant for developing desktop applications. Skype, for example, was done in Qt, and Every Kapplication in KDE uses QT. If developing desktop apps is your goal, then a widget framework is for you, though I'd recommend GTK2 because it's the One True Framework. Back to game development. I just started a project in C++ using SDL to teach myself 2D graphics in SDL. I'm on Linux using Eclipse and Autotools, but the philosophy is much the same with Visual Studio - All you need are the SDL libraries and headers and you're good to go. Raw, straight-up, unadulterated SDL really seems like what you want right now. It's very basic - it just gives you access to a screen to draw on and input sources. Everything else - threading, object management, datastructs - is up to you. I'd recommend starting with 2D at first. As a note, I'm using normal C SDL not SDLmm, which is a C++ified glue. It works perfectly fine. I'm using http://lazyfoo.net/SDL_tutorials/index.php as my main guide and the official SDL docs for reference. | ||
DumJumJmyWum
United States75 Posts
On January 09 2013 12:29 DEN1ED wrote: Just had my first day of my first programming class today. Loved it and already did the assignment that is due next week and I kinda want to keep going and doing more. It was just the most basic assignment to print text. Is there a good place that has tutorials and stuff to keep learning more? A lot of the links of the front page seem broken. Learning java fyi. Glad to hear you're loving programming. Go through the java tutorials and start with the "getting started" - http://docs.oracle.com/javase/tutorial/. I would just recommend doing the stuff in the trails covering the basics. The rest depend if you want to work in the java Enterprise Edition version for large corporations. Also, I would recommend reading "Java a Beginner's Guide Fifth Edition" by Herbert Schildt. I've gone through it myself recently to refresh my Java a while ago and I think it does a good job especially since it covers Java 1.7. In addition, www.udacity.com has a good introductory classes to programming that you can do at your own pace even though they use python. | ||
tec27
United States3701 Posts
On January 09 2013 13:32 Pigsquirrel wrote: Not quite. Qt is a widget framework (and a lot of other crap). It's really meant for developing desktop applications. Skype, for example, was done in Qt, and Every Kapplication in KDE uses QT. If developing desktop apps is your goal, then a widget framework is for you, though I'd recommend GTK2 because it's the One True Framework. That's not really true any more. The version of Qt that just came out (5.0) is very intended for embedded and mobile application development, and has very heavy integration with OpenGL to accomplish that. The widget framework in it is only a very small part (and a quickly diminishing part) of the library. It could definitely accomplish what NukeTheBunnys wants, but I think it might abstract too many of the lower level details that he'd like to work on himself. | ||
nunez
Norway4003 Posts
On January 09 2013 14:06 tec27 wrote: That's not really true any more. The version of Qt that just came out (5.0) is very intended for embedded and mobile application development, and has very heavy integration with OpenGL to accomplish that. The widget framework in it is only a very small part (and a quickly diminishing part) of the library. It could definitely accomplish what NukeTheBunnys wants, but I think it might abstract too many of the lower level details that he'd like to work on himself. i worded myself sparsely because it has been a while since i worked with it, but i felt it was worthy of a mention (even though the level of abstraction might be too high for what he's looking for, but i couldn't tell) and it definitely covers what he is looking for. in addition i would think that cross platform is ambiguous in this context unless i missed something, not that it matters in relation to Qt. | ||
fabiano
Brazil4644 Posts
[1] Leave all the PHP processing code before the <html> and postpone the print/echo of the results of that processing + Show Spoiler + ![]() or [2] Leave the PHP processing entangled in the html as needed + Show Spoiler + ![]() Note that the example code is simple, but I mean what would be preffered when we are dealing with much larger scripts? Personally I find [1] to be much more readable, while theorically [2] should be more efficient. Is there a coding standard or do programmers just code as they please? R1CH, by your wizardry powers, if you are reading this, what do you recommend? | ||
![]()
tofucake
Hyrule19083 Posts
Second, neither. PHP should be in its own place and you should use a templating system (like Smarty) to spit out all of your HTML. | ||
AmericanUmlaut
Germany2577 Posts
Fabiano, I strongly suggest that you use variant 1. Separating logic from display is a very common best practice. You can read up on MVC (model view control) for more information on the philosophy behind that, but basically you end up with much more readable and maintainable code if you don't mix business logic in with your layout. It's very common to do logic in a different file and then inject the results as variables into a template, though I worked at a big company for a few years where the standard was for template-specific logic to come in a block at the beginning of the template file. I actually find that system quite nice, but it's less flexible. | ||
waxypants
United States479 Posts
On January 09 2013 12:29 DEN1ED wrote: Just had my first day of my first programming class today. Loved it and already did the assignment that is due next week and I kinda want to keep going and doing more. It was just the most basic assignment to print text. Is there a good place that has tutorials and stuff to keep learning more? A lot of the links of the front page seem broken. Learning java fyi. You can look for or ask your TAs/professors for previous semesters' assignment or more practice problems. | ||
uZr
20 Posts
On January 09 2013 13:32 Pigsquirrel wrote: Raw, straight-up, unadulterated SDL really seems like what you want right now. It's very basic - it just gives you access to a screen to draw on and input sources. Everything else - threading, object management, datastructs - is up to you. I'd recommend starting with 2D at first. If you really want lower access to inputs/… you might also take a look at GLUT (http://www.opengl.org/resources/libraries/glut/) or its free software counterpart freeglut (http://freeglut.sourceforge.net/) The library in itself is much smaller than sdl and does … well less than sdl. Both are different and in the end don't matter that much: as soon as your window context is done you're nearly only playing with your own structures, logics, … (and OpenGL calls) than with those libs anyway. | ||
Zeke50100
United States2220 Posts
On January 09 2013 14:06 tec27 wrote: That's not really true any more. The version of Qt that just came out (5.0) is very intended for embedded and mobile application development, and has very heavy integration with OpenGL to accomplish that. The widget framework in it is only a very small part (and a quickly diminishing part) of the library. It could definitely accomplish what NukeTheBunnys wants, but I think it might abstract too many of the lower level details that he'd like to work on himself. Please, PLEASE do not use Qt to create games. Qt has a ridiculously heavy overhead for anything that requires frame-by-frame logic updating and rendering such as a game - not to mention, your game now has a reliance on all kinds of structures provided by Qt, and it's likely that you wouldn't even use Qt for too much besides the signals and slots and OpenGL integration. Signals and slots is a fantastic mechanism for static user interfaces, but it is much less suited for the frame-by-frame polling games generally imply (in games, you generally want to pass a pointer to your input subsystem so you can quickly access input calls that will end up effecting imperative aspects of your game; a messaging system is overkill and actually worse for such a thing), You can write games using any kind of GUI framework, but you shouldn't. Qt should primarily be used for applications outside the realm of games (for example, a toolset written using Qt is a great idea). If you're writing a game, using something that has much less of a heavy overhead (in terms of games) like SDL is much more well-advised. | ||
FFGenerations
7088 Posts
I was really close at one point but now it just looks royally screwed and I don't know why. I have a Person table and 3 separate MobileNumber, HomeNumber and Email tables. It should be a One to Many relationship between Person and those other tables. There is a primary PersonID autonumber in Person table and I put a PersonID number field in each of the other 3 tables. But when I add data using my Input form, the PersonID fields in the other tables simply remain blank, like they're not connected. I had it working at one point seemingly but now its not. Infact I royally fucked everything up somehow and my Main form was just complete blank, so I've gone back to a backup copy and putting it here... It looks like whatever I done in my first table fields worked (and is displayed on the Main form fine) but the rest is broke.. I'll keep trying. It looks weird when I look at how the Association lookup/table is joined to Person, as its joined using AssociationID, but its a Many to One lookup type thing and I done that bit a few weeks ago so don't quite remember what I done there but its not menna be the same. access file: http://www.sendspace.com/file/g5xney ps remember you have to Enable Content (the warning) for stuff to work afaik Edit: Okay I might have figured it out... PersonID in the Email, Mobile, Home tables needs to be updated automatically with a correct PersonID when we input a new person in the New Person Form. Otherwise nothing works, forms are just invisible without this value in those tables. So I need to find how to capture the automated new person ID that is created when a new person is added to the database and insert that Is there a code for that? Maybe something like "insert (number of records in database +1)"... IDK why it doesnt do it automatically if its set in a relationships... Edit: I got lucky and found this http://stackoverflow.com/questions/4320183/ms-access-why-isnt-this-relationship-not-working | ||
enigmaticcam
United States280 Posts
Is there a code for that? Maybe something like "insert (number of records in database +1)"... IDK why it doesnt do it automatically if its set in a relationships... Relationship or not, it won't automatically ascribe the primary key value to the child tables. The simplest way to do what you want would be to return the max value of the PersonID field and set it for each child table insert you perform. Assuming it's an auto increment, and assuming it's not accessing a shared table where other people might be inserting rows at the same time, it will return the id of the last person you entered in the table. You can do this just after inserting the Person. Dim PersonID As Integer | ||
FFGenerations
7088 Posts
http://stackoverflow.com/questions/4320183/ms-access-why-isnt-this-relationship-not-working Man, will that work!? I'll try it out. If not, subform. If not, I'm not even supposed to bother with a relational database anyway -_- Thanks so much Ahahaha well it works! Just I have to have an entry already existing in the database otherwise it won't accept NULL. And the first entry accepted has the same ID as the previous initial one. but maybe i can add a +1 somewhere | ||
enigmaticcam
United States280 Posts
?DMax("[PersonID]", "Person") | ||
enigmaticcam
United States280 Posts
Ahahaha well it works! Just I have to have an entry already existing in the database otherwise it won't accept NULL. And the first entry accepted has the same ID as the previous initial one. but maybe i can add a +1 somewhere It sounds like you're grabbing the max value before you're inserting the new Person. If that's not the case, then there's something you're doing wrong that you'll want to try to find. You don't want to do a +1, because should you delete the latest Person and add another, the PersonID will be +2 more than the last. Here's an example of how your code would look using this logic: + Show Spoiler +
| ||
FFGenerations
7088 Posts
![]() Now I just have to get the other 85% of grade which involves making it look pretty, some design documents, and a letter to the end user explaining the important decisions that I made (posting on TLnet?). Oh, college.. Ps I didnt have to do a relational database in the first place (since apparently no1 knows how to make a relational one here) so I kinda dug my own grave | ||
enigmaticcam
United States280 Posts
![]() | ||
| ||