• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

Modern Qt (a GUI toolkit) now directly exposes GLSL shaders so you can make custom effects for your user-interface elements.

Moreover OpenGL is where almost all of the interesting work is happening right now in GPU extensions, on both desktop and mobile. DX has really ossified with the dissolution of the working group and it's an IE style level of stagnation right now.
 

Chris R

Member
Decided to make one of my next projects understanding/learning ASP.Net MVC as it seems that it is more in tune with how web development is moving compared to webforms... Just have to stick with it I guess as the previous times I've tried to look at it I just get a few things working and then drop it for another more important project.
 

usea

Member
Decided to make one of my next projects understanding/learning ASP.Net MVC as it seems that it is more in tune with how web development is moving compared to webforms... Just have to stick with it I guess as the previous times I've tried to look at it I just get a few things working and then drop it for another more important project.
Very true.
 
This is probably asked a lot here, but what's a good way to learn java? Is there a site like code academy for java? I want to relearn java and learn data structures(but I need a good grasp in java first) so when I retake that my data structure course, I can pass it easily.
 

cyborg009

Banned
This is probably asked a lot here, but what's a good way to learn java? Is there a site like code academy for java? I want to relearn java and learn data structures(but I need a good grasp in java first) so when I retake that my data structure course, I can pass it easily.

Funny, I came here look for the same answer too. I was looking at the first page and saw some people linked the official Java tutorials.( Not sure if these are right for me)

http://docs.oracle.com/javase/tutorial/

And thenewboston videos on youtube

I going into Java next semester so I really want to get a head start.
 

injurai

Banned
I'm about to set up a Linux partition on my lappy.

So far I have used various versions on Ubuntu and Mint 9 a while back. Trying to figure out what would be best as a CSE student.

I was interested in Arch, though have heard slackware is a good place to start. I don't mind Ubuntu and Unity for everday stuff but I think it would be better to get more hands on with the innards of GNU/Linux. And I'm wondering if Mint has even been too pre-configured.

I guess the second question would be, if Arch is the way to go, where to I go to learn about it?
 

KorrZ

Member
Funny, I came here look for the same answer too. I was looking at the first page and saw some people linked the official Java tutorials.( Not sure if these are right for me)

http://docs.oracle.com/javase/tutorial/

And thenewboston videos on youtube

I going into Java next semester so I really want to get a head start.

Wow, great recommendation with thenewboston. I'm in the middle of Java myself, checked out a few of his videos and they're very informative so far. Thanks!
 
Last year I took a semester of Java and loved it. It was also my first time programming but I really got the basics down. I'm starting a computer science class mid-January that focuses on Java and I want to start getting back into it before then, to prepare and also just because I want to. I have done some programming over the last few months but not as much I would have liked.

Basically what I want to know, is there a good way I can prepare a little before my class begins? I feel that learning in a classroom with others is better for me since we can help each other and it's easier to realize mistakes instead of forming bad habits, but if I can start learning on my own in some way that'd be great. I have watched some tutorials on YouTube (lots of newboston) and followed some Oracle tutorials. Should I begin doing these things again or is there something else you guys would recommend?

Thanks :)
 
Last year I took a semester of Java and loved it. It was also my first time programming but I really got the basics down. I'm starting a computer science class mid-January that focuses on Java and I want to start getting back into it before then, to prepare and also just because I want to. I have done some programming over the last few months but not as much I would have liked.

Basically what I want to know, is there a good way I can prepare a little before my class begins? I feel that learning in a classroom with others is better for me since we can help each other and it's easier to realize mistakes instead of forming bad habits, but if I can start learning on my own in some way that'd be great. I have watched some tutorials on YouTube (lots of newboston) and followed some Oracle tutorials. Should I begin doing these things again or is there something else you guys would recommend?

Thanks :)
I'm having my first semester of Java and I hate it :(
 
Funny, I came here look for the same answer too. I was looking at the first page and saw some people linked the official Java tutorials.( Not sure if these are right for me)

http://docs.oracle.com/javase/tutorial/

And thenewboston videos on youtube

I going into Java next semester so I really want to get a head start.
Thanks for posting this. I'll look into thenewboston videos too. I also ordered head first java but Amazon still hasn't shipped it. I just hope I can get everything I need to know before I take that data structures class in the summer...should be enough time.
 

Toma

Let me show you through these halls, my friend, where treasures of indie gaming await...
Hm, would it be possible to have a function in C# that catches marked text even outside the program window? I want to write a program that gives information for text I am marking on the fly, but I cant copy the text into a program window before. It would need to work in Office text documents or on websites.

Is there any way to do that?
 

usea

Member
Hm, would it be possible to have a function in C# that catches marked text even outside the program window? I want to write a program that gives information for text I am marking on the fly, but I cant copy the text into a program window before. It would need to work in Office text documents or on websites.

Is there any way to do that?
By mark you mean select, right? Like dragging the cursor over text so that it's selected?

It's not possible for something that will work with every single program, since they won't all use the default windows text controls. But you can make it work with many things. It depends on how that program does text.

Here's what I googled: C# capture selected text from other windows

Here's some starting points:
http://stackoverflow.com/a/513913/122396

http://stackoverflow.com/questions/2763563/capture-highlighted-text-from-any-window-using-c-sharp

http://msdn.microsoft.com/en-us/library/ms745158.aspx

Many programs won't work with the UI Automation stuff. You'd have to write special exceptions for each program that doesn't work, which probably includes most browsers.
 

Toma

Let me show you through these halls, my friend, where treasures of indie gaming await...
By mark you mean select, right? Like dragging the cursor over text so that it's selected?

It's not possible for something that will work with every single program, since they won't all use the default windows text controls. But you can make it work with many things. It depends on how that program does text.

Here's what I googled: C# capture selected text from other windows

Here's some starting points:
http://stackoverflow.com/a/513913/122396

http://stackoverflow.com/questions/2763563/capture-highlighted-text-from-any-window-using-c-sharp

http://msdn.microsoft.com/en-us/library/ms745158.aspx

Many programs won't work with the UI Automation stuff. You'd have to write special exceptions for each program that doesn't work, which probably includes most browsers.

I mean that if I highlight/mark/select a text. The most important option would be Open Office atm, guess I just try and see whether it works.

Thanks a lot! Didnt know what to google for.
 

usea

Member
I mean that if I highlight/mark/select a text. The most important option would be Open Office atm, guess I just try and see whether it works.

Thanks a lot! Didnt know what to google for.
If your goal is mainly open office, you might be better off working from the other end. By that I mean: instead of writing a program that in general tries to read highlighted text from other programs, write a program that reads highlighted text specifically from open office. It seems like they have some kind of API for it. You might try this if the UI Automation stuff doesn't pan out.

http://www.openoffice.org/api/

Here's an example where somebody uses the open office API from C# to do something with spreadsheets. http://herbertniemeyerblog.blogspot.com/2011/11/have-to-start-somewhere.html

Keep in mind that open office changed a lot over the years, so some stuff might be out of date. And these days I think most of the open source people moved to another product (libre office?)
 

Toma

Let me show you through these halls, my friend, where treasures of indie gaming await...
Again, thanks a lot. I will try my (messy) hand at your suggestions later :)
 
Best thing about Java is that there are billion people asking for the same "why the fuck do I need to do it like that" questions you are wondering so it's easy to just google the answers
 

injurai

Banned
Best thing about Java is that there are billion people asking for the same "why the fuck do I need to do it like that" questions you are wondering so it's easy to just google the answers

I've had to ask completely original quest on stackoverflow more than once.
 

r1chard

Member
I find the best thing about Java is the portability and API. If thats what you care it about its the best OOP for the job. I also hate pointers so...
Ah yes. I fondly remember my first Java application, developed in Java (and not Python/Qt) because of its portability. Cross-platform GUI running on Solaris and Windows. Except that on Windows the text input boxes all reversed the text being typed into them. Cross-platform my ass. I'm sure it's improved since then...
 
I'm having my first semester of Java and I hate it :(

Same here everything is deprecated in java we joke that java itself is deprecated.
And we are forced to use java for almost everything assignment in our second year no freedom maybe that is why we hate it.

For the basic syntax it has everything all the other C based languages has except most of the time forced exceptions.
 
Flex 4 is the worst. The worst. And I am stuck with it for like 5 more months.

It can't even do fucking properly working scrollbars without 100 lines of code. It's like Java but worse.
 
Flex 4 is the worst. The worst. And I am stuck with it for like 5 more months.

It can't even do fucking properly working scrollbars without 100 lines of code. It's like Java but worse.

Know that feel man.

When i signed up for this internship they said you would do experience in C++ and OpenCL. But the C++ stuff was only for like 4 days getting used to OpenCL, but they had already wrapped most api call in a scripting language. But seeing back i can test a barebone OpenCL kernel within 20 lines instead of 90 lines of c++ code so a big time win.

And now have been working last 3 month doing convolution implementation and optimizing it. I thought concurrent programming with java was hard and shitty with non deterministic behavior. OpenCl has even worse non deterministic behavior its kinda masochistic actually with not a lot of synchronization points / options :).

I think i could have done better optimizations if given the chance to branch to different algorithms instead of focusing on convolution for image processing. Kept stuck in tunnel vision. But im glad i choose for this internship when i watched at the come back day everybody was either doing web development or App development and not even the interesting web stuff. That isn't my thing imo.
 
Is there a simple way to show the 20 most frequent words from a text file, in Java? I've managed to read a file and build a HashMap like this:

Code:
{religieux=5, realphilosophie=1, rallié=1, scientifique=16, efface=1, correspondait=1, nouveaux=5, (...) }

But you can't sort HashMaps, so I must be using the wrong data structure.
 

injurai

Banned
Is there a simple way to show the 20 most frequent words from a text file, in Java? I've managed to read a file and build a HashMap like this:

Code:
{religieux=5, realphilosophie=1, rallié=1, scientifique=16, efface=1, correspondait=1, nouveaux=5, (...) }

But you can't sort HashMaps, so I must be using the wrong data structure.

Use a treemap that implements sortedmap, trick is letting the class sort things for you and then pull things out in order.
 
Anyone have experience publishing on Google Play? I really need to know if I can publish anything privately. I want to publish something but just for test before I release it to the public.
 

Bollocks

Member

r1chard

Member
Anyone have experience publishing on Google Play? I really need to know if I can publish anything privately. I want to publish something but just for test before I release it to the public.
Publish it and don't tell anyone. The Play Store is now big enough that the chances of someone installing your app without explicit promotion is about zero.
 

hitsugi

Member
All right ProgrammingGAF.. here's my scenario:

I'm a Comp Sci major, and my uni's language of choice is C++. So far I've learned basic loops, up to functions, and structs.. but the way we're being taught seems a bit weird, down to the point where before our final in Intermediate C++, the teacher announced that he didn't like how our book taught certain things and wanted us to rely on his power points only.

I was doing fine up until we got into structs, then I kind of just fell flat on my face. The next class is "Object Oriented Programming with C++" and I'm a little iffy about it. I know C++ can be a great language, and sure, I love games and would like to get into game development, but I'm terrible with it.

The two books that seem to be commonly recommended are C++ Primer Plus, and C++ Primer. Any preference between those two? Any tips on how I can get better at utilizing functions and structs, etc.? Maybe my brain just isn't piecing this all together correctly
 

KorrZ

Member
All right ProgrammingGAF.. here's my scenario:

I'm a Comp Sci major, and my uni's language of choice is C++. So far I've learned basic loops, up to functions, and structs.. but the way we're being taught seems a bit weird, down to the point where before our final in Intermediate C++, the teacher announced that he didn't like how our book taught certain things and wanted us to rely on his power points only.

I was doing fine up until we got into structs, then I kind of just fell flat on my face. The next class is "Object Oriented Programming with C++" and I'm a little iffy about it. I know C++ can be a great language, and sure, I love games and would like to get into game development, but I'm terrible with it.

The two books that seem to be commonly recommended are C++ Primer Plus, and C++ Primer. Any preference between those two? Any tips on how I can get better at utilizing functions and structs, etc.? Maybe my brain just isn't piecing this all together correctly

I can't recommend C++ Primer Plus enough. It's absolutely incredible for pushing home both beginner and intermediate concepts. I'd also seriously look into Effective C++.
 

mooooose

Member
I'm a third year CS major (though basically second year because I wasted two semesters), and though I know how to program well in Java (last 2+ years), and have dabbled in C and MIPS Assembly, I never program for fun. It's too... daunting to come up with my entirely own ideas and having to deal with outdated guides to help me through things.

What would you guys suggest I do? I have the rest of this break.

I have barely taken any elective classes because I had to transfer and I did miserably this semester and it really fucked me up, so I'm pretty far behind now. Feeling pretty pathetic and really want to do some supplemental independent learning.
 

nan0

Member
I'm a third year CS major (though basically second year because I wasted two semesters), and though I know how to program well in Java (last 2+ years), and have dabbled in C and MIPS Assembly, I never program for fun. It's too... daunting to come up with my entirely own ideas and having to deal with outdated guides to help me through things.

What would you guys suggest I do? I have the rest of this break.

I have barely taken any elective classes because I had to transfer and I did miserably this semester and it really fucked me up, so I'm pretty far behind now. Feeling pretty pathetic and really want to do some supplemental independent learning.

It depends on what you would like to do, what topics you're interested in and what probably benefits future classes. I suggest you start something that can be done in plain Java/C/..., with as few external dependencies as possible (which mostly eleminates having to deal with bad API documentations and outdated guides).
Is there some task you have to do on regular basis? Check if you can write a tool that simplifies it, or makes it faster for you. Start with something basic that you can extend by yourself. A personal backup/file sync tool for your university documents for example. Write a personal tool class which contains methods you may regularily use and are not included in the base SDK.
If you can't find anything for yourself, you could try Project Euler which primarily focuses on math problems in a range of difficulties regardless of programming language.
 
Publish it and don't tell anyone. The Play Store is now big enough that the chances of someone installing your app without explicit promotion is about zero.

Guess this is really the only answer. My OCD is kicking in since it can't be pulled out of the Play Store so (I think) the name can't be reused.

I've been practice coding on some other project. I just have 2 characters keep hitting each other, while randomly using spells that depends on various criteria, all text. I have never fully appreciated how complicated a turn-based system can be in terms of class design.
 

Milchjon

Member
Is it realistic to program a Space Invader clone in C?

We're a group of bloody beginners who have to find a project that we can do as a homework. In my imagination it sounds like a reasonable amount of work. We're gonna use SDL for Video/Audio.

I think the thing I'm most afraid of is the set of enemies, and the ability to kill them off one by one. Are we going to run into problems there?
 
Is it realistic to program a Space Invader clone in C?

We're a group of bloody beginners who have to find a project that we can do as a homework. In my imagination it sounds like a reasonable amount of work. We're gonna use SDL for Video/Audio.

I think the thing I'm most afraid of is the set of enemies, and the ability to kill them off one by one. Are we going to run into problems there?

I guess that depends on how "far" you are willing to go. If you just say the enemies are squares arranged in a 10 x 4 grid and your laser instantly kills you just give each sqare a set of coordinates/size:

Player ship shoots laser from (10, 0) and hits everything that is at this x-axis level, enemies behind are safe. So a enemy at (10, 40) gets hit but the one at (10, 60) is safe. Of course your ships are not just 1 pixel so you need to define the size of your ship, the enemy and from where the laser comes. So if your player cube fires it hit everything on a certain x-axis level. This would be a very rudimentary but easy implementation - probably full of errors because I never did something like this. I once coded a chess implementation without an AI in ~3 months that is a lot easier.
 

FerranMG

Member
I can't recommend C++ Primer Plus enough. It's absolutely incredible for pushing home both beginner and intermediate concepts. I'd also seriously look into Effective C++.

I'm looking forward to improving my C++.
I'd say I have an advanced level, but there's still so much more to learn.

Do these books contain solved examples? If not, could anyone recommend one that has?
I want to try practical things, but I also want to be able to find a solution whenever I get stuck.
 

injurai

Banned
All right ProgrammingGAF.. here's my scenario:

I'm a Comp Sci major, and my uni's language of choice is C++. So far I've learned basic loops, up to functions, and structs.. but the way we're being taught seems a bit weird, down to the point where before our final in Intermediate C++, the teacher announced that he didn't like how our book taught certain things and wanted us to rely on his power points only.

I was doing fine up until we got into structs, then I kind of just fell flat on my face. The next class is "Object Oriented Programming with C++" and I'm a little iffy about it. I know C++ can be a great language, and sure, I love games and would like to get into game development, but I'm terrible with it.

The two books that seem to be commonly recommended are C++ Primer Plus, and C++ Primer. Any preference between those two? Any tips on how I can get better at utilizing functions and structs, etc.? Maybe my brain just isn't piecing this all together correctly

Don't be fooled be C++ Primer Plus, It's unrelated to C++ Primer which is a much better book. C++ Primer has much more talent behind it, it I know the newest version is extremely nice to use.
 

dabig2

Member
I'm a third year CS major (though basically second year because I wasted two semesters), and though I know how to program well in Java (last 2+ years), and have dabbled in C and MIPS Assembly, I never program for fun. It's too... daunting to come up with my entirely own ideas and having to deal with outdated guides to help me through things.

What would you guys suggest I do? I have the rest of this break.

I have barely taken any elective classes because I had to transfer and I did miserably this semester and it really fucked me up, so I'm pretty far behind now. Feeling pretty pathetic and really want to do some supplemental independent learning.

Since you're pretty good at Java I'd suggest trying to pick up Android and learn how to code for that. I think you'll find it fairly easy with your programming background. That might help out a little about trying to think up some on-the-side programs on your own.

So maybe come up with an alarm clock program. Or try to create your own online newspaper reader. Create your own bank account program that someone might utilize for real. Or make a program that can look at the metadata of songs you have stored on the drive, and then try to fill out whatever empty information you can by accessing some comprehensive online database. Or come up with a educational flashcard game. Make your own online student exam program. Come up with a program that automatically plans your school schedule out from now till graduation based on a multitude of an individual user's preferences (basically simulate how you yourself would pick out classes - so you'd be creating an "AI" of sorts).

Just keep at it and keep it simple as to not get frustrated. Maybe try to look up advanced student school projects on Google and try to implement them yourself. And if you find yourself struggling with anything (like even how to initially approach the problem), don't be afraid to ask here :)
 
Pick up a copy of Kernighan & Ritchie's The C Programming Language. Read it front to back, and do all the exercises. When you get stuck, come here and post about it and we'll help you.
 

nan0

Member
Is it realistic to program a Space Invader clone in C?

We're a group of bloody beginners who have to find a project that we can do as a homework. In my imagination it sounds like a reasonable amount of work. We're gonna use SDL for Video/Audio.

I think the thing I'm most afraid of is the set of enemies, and the ability to kill them off one by one. Are we going to run into problems there?

How proficient are you in C? It depends on how much time you have and how dedicated you are. It sounds perfectly doable, but I haven't used SDL (only GLUT/OpenGL). Painting simple objects (player, projectile, enemy) and moving them isn't really difficult, and a rudimentary collision detection ("projectile hits enemy", "enemy hits player") is neither, since you basically just check if coordinates overlap.
Start with a bare bones structure, and extend them if the previous step works. Just don't instantly try to implement fancy shaders or effects, if time is scarce it's better to have an ugly, yet working prototype than a cool looking mess that crashes all the time.
 
Top Bottom