The Joys Of Programming

shoptroll wrote:
1) Can anyone recommend a good Windows based tool for debugging HTML output on an iPhone. I feel there has to be something like Firebug I could use to troubleshoot issues like this more effectively.

There is! It's called JSFiddle. First create an account and get logged in, because mobile/remote debugging requires it. Recreate your HTML/CSS/JS in the various panes, then click the little wireless looking icon next to the run button at the top. Type the displayed URL into your phone and open the debugger link in a new window on your desktop. (requires Safari or Chrome on your desktop)

Cyranix wrote:

Frameworks are also useful for the client-side stuff. The current king of JavaScript is indeed jQuery, and for good reason -- that said, as you become more familiar with jQuery, you'll be more able to understand what its competitors are trying to address. You might even find something like HTML5 Boilerplate useful as a starting point for the presentation layer.

Also worth a look is Twitter's bootstrap.js library
http://twitter.github.com/bootstrap/

It's a really nice alternative to JQuery plus plugins (or JQueryUI). It's been getting a lot of love lately and rather excellently it gracefully degrades/optimises across desktop, tablet and phone displays.

Cyranix wrote:
Yep, definitely gotta get yourself working with a well-known framework. Broaden your horizons and move away from Java; Django (Python) and Rails (Ruby) would be excellent choices, I think.

I'll throw in a plug for Flask, too. Microframeworks are kind of trendy now, and quite useful for a number of applications that don't need a giant framework. (I used Flask on a live-updating big-screen dashboard recently.)

If you can, I would highly recommend reading up a bit on website security (OWASP cheat sheets and top 10 are great; also see the Reference section) and performance tuning (use YSlow or Chrome's built-in audits).

Agreed. Bear in mind, too, that the more you use third party frameworks and plugins, the more you're entrusting the security/performance of your application to someone else. For this reason, I usually restrict myself to JQuery's selection and JSON API, the most widely used parts of the framework. I start to get off the bus with custom GUI widgets and whatnot, just to make keep the application simple enough to have a hope of analyzing it. As Peter Neumann might say, complex systems fail in complex ways.

Good call on Twitter Bootstrap -- definitely a strong competitor to jQuery.

pgroce, it seems like there has been an explosion of micro-frameworks for both front-end and back-end web development, but I think for beginners it makes more sense to pick up a more comprehensive framework that a) is more widely used and b) will be more likely to have everything needed [even though it might have more than what's needed]. That said, I have heard good things about Flask too.

psoplayer, I don't think I knew that JSFiddle had that capacity -- awesome! It's a great resource for fledgling web developers, and it reminded me to point out the Mozilla Developer Network web development reference site.

IlleBellus wrote:
Ok, random advice request. I am familiar with Java (I've taken a few courses in Java and my university uses Java as its primary language). I was playing with the idea of learning a little bit about controls for simple games (this is nothing I need for school, just a side curiosity on my part). I want to start by simply controlling a box on the screen using the directional arrows on the keyboard. In the GUI class I took (which, granted was not a computer graphics class) I would make a jlabel the size I wanted, create a buffered image, make the image the image icon for the jlabel, and do all my drawing there refreshing the image however many times a second I needed to in order to get the desired movement. This was well beyond the scope of the class, so I could not really ask the teacher and was pretty much flying solo.

I know there must be a better way to do this. My question is, how can I create a canvas or drawing area that I can refresh with whatever changes I want to make to my image? My end goal is to create a Space Invaders clone just to see if I can do it. I know that I could probably find code to do this online and just dissect that, but I want to struggle my way through it because I think I will learn more. Can anyone either tell me how to do this or point me in the right direction in terms of free online resources about this? I don't want to buy a textbook because a. I'm broke and b. I am less than year from graduating and need to focus my main energies on the classes I have remaining. But I might consider one post graduation.

Any and all suggestions are appreciated as always, you guys/gals have never let me down in the past. Thanks.

ps - I am also somewhat (albeit less) familiar with C# programming using Visual Studio 2010, but don't even know how to program any sort of graphics there, which is why I am inclined to use Java, at least to start. If C# has easier ways to do this, however, I would not be opposed to exploring that route. I am totally unfamiliar with C++ (other than a few classes in vanilla C)

Generally every graphics library ends up being a wrapper around OpenGL or DirectX. There are a few 2D exceptions like SDL but I'm not sure how often those exceptions are even ported to languages like Java. So basically your choices are use one of those wrappers directly or use a library someone else already wrote to make it a little easier for you. I'd recommend the latter. Quick google search found Slick2D to be recommended. Slick2D is just a wrapper around LWJGL. LWJGL actually looks pretty damn good. The Basics section of the tutorial for LWJGL looks like it covers everything you want.

IlleBellus wrote:
Ok, random advice request. I am familiar with Java (I've taken a few courses in Java and my university uses Java as its primary language). I was playing with the idea of learning a little bit about controls for simple games (this is nothing I need for school, just a side curiosity on my part). I want to start by simply controlling a box on the screen using the directional arrows on the keyboard. In the GUI class I took (which, granted was not a computer graphics class) I would make a jlabel the size I wanted, create a buffered image, make the image the image icon for the jlabel, and do all my drawing there refreshing the image however many times a second I needed to in order to get the desired movement. This was well beyond the scope of the class, so I could not really ask the teacher and was pretty much flying solo.

What's your intended focus? If it's more on making an actual game as opposed to bare graphics manipulation, maybe something like Unity or Ogre would be a good start?

complexmath wrote:
IlleBellus wrote:
Ok, random advice request. I am familiar with Java (I've taken a few courses in Java and my university uses Java as its primary language). I was playing with the idea of learning a little bit about controls for simple games (this is nothing I need for school, just a side curiosity on my part). I want to start by simply controlling a box on the screen using the directional arrows on the keyboard. In the GUI class I took (which, granted was not a computer graphics class) I would make a jlabel the size I wanted, create a buffered image, make the image the image icon for the jlabel, and do all my drawing there refreshing the image however many times a second I needed to in order to get the desired movement. This was well beyond the scope of the class, so I could not really ask the teacher and was pretty much flying solo.

What's your intended focus? If it's more on making an actual game as opposed to bare graphics manipulation, maybe something like Unity or Ogre would be a good start?

Also good advice. If you want to stick with Java I'd recommend JMonkeyEngine as an alternative to Ogre though.

The other option if you want to focus on game logic and not worry about graphics would be to try a roguelike. There are a lot of good resources out there for doing line-of-sight calculations in roguelikes and things like that.

complexmath wrote:
The other option if you want to focus on game logic and not worry about graphics would be to try a roguelike. There are a lot of good resources out there for doing line-of-sight calculations in roguelikes and things like that.
Links please.

boogle wrote:
Links please.

I think the site I used to reference is gone now, but I found this one via google and it is pretty comparable in the information it provides. The articles in particular get pretty detailed.

There's also the Procedural Content Generation wiki which has a lot of articles about roguelike maze and terrain generation techniques.

Mixolyde wrote:
There's also the Procedura l Content Generation wiki which has a lot of articles about roguelike maze and terrain generation techniques.

Ooh, that sounds pretty awesome. Definitely have to check that out.

Another Pragmatic Bookshelf sale, but hey, it's for Ruby-based material, so... yeah.

40% Off Ruby/Rails Sale - October 31, 2012

It’s RubyConf time! Whether you can make it to Denver this year or not, help us celebrate Ruby & Rails. We’ve got three events going on:
1. Use coupon code RubyConf2012 and save 40% on select Ruby and Rails titles from PragProg.com, listed below.
2. Over at The Pragmatic Studio, use coupon code RubyConf2012 and save 40% on their comprehensive, online Ruby Programming course. Through a series of high-quality videos and hands-on exercises, you’ll learn how to create a complete Ruby program step-by-step.
3. We’ve arranged with Code School to give you free access to part 1 of Ruby Bits, an intermediate course to solidify your Ruby knowledge. This four-hour course includes an hour of instructional video combined with in-browser coding challenges so you can learn by doing. Visit mktg.codeschool.com/ruby-bits-1-pragmatic to sign up.
The fine print:

  • all offers expire next Wednesday, November 7, 2012.
  • cannot be applied to existing orders
  • cannot be combined with any other coupon
  • you have to enter the coupon code RubyConf2012 when checking out. After you’ve entered all your information, in the Order Summary, click on Apply Coupon to enter the coupon code.

Titles on sale:

Here's a bit of a strange request.

I'm going to start walking in the mornings before my daughter wakes up, to complement my strength training. However, this time has always been reserved for gaming, programming projects, coffee, etc. I'm loathe to lose this precious hour and a half, so I want to find some podcasts that can I can learn something from while I'm walking in the dark.

I have more than enough gaming podcasts on deck, so I really want something programming related. I don't necessarily think I want to focus on a specific language (I currently use C++, PHP, and Python); I'd just like to be able to maximize this time.

Does this exist? Recommendations, please!

Lex Cayman wrote:
Does this exist? Recommendations, please!

Podcasting is a tough medium to do development topics well in. I've only found two that I consider worthwhile, and they're both language specific: Ruby Rogues and JavaScript Jabber, both from the same host.

Most developer podcasts are glorified RSS feeds. Others just can't figure out how to cover development topics in anything other than the shallowest level of detail. Those two above are the first ones I've found that get down to a deep enough level to be interesting, and do so clearly enough to be enjoyable.

Something that might be worthwhile is downloading and listening to past conference talks. There's a lot of good talks out there, and they usually have enough preparation put into them to get into a technical topic efficiently in the span of 30-45 minutes. Weekly podcasts really struggle with that.

*Legion* wrote:
Something that might be worthwhile is downloading and listening to past conference talks. There's a lot of good talks out there, and they usually have enough preparation put into them to get into a technical topic efficiently in the span of 30-45 minutes. Weekly podcasts really struggle with that.

That's a good idea. I always mean to watch/listen to those, but I never have the patience to just sit at my computer for an hour.

I'll give that a shot.

boogle wrote:
complexmath wrote:
The other option if you want to focus on game logic and not worry about graphics would be to try a roguelike. There are a lot of good resources out there for doing line-of-sight calculations in roguelikes and things like that.
Links please.

libtcod is actively developed and tailored specifically to RLs. The stable branch supports C, C#, C++, Lua, and Python.

There's a pretty solid walkthrough available of getting getting a game running in Python.

bandit0013 wrote:
Edwin wrote:
Someone talked about an IT Guild in this thread or another. It sounds similar to that.

Any more info than that? Searching for the word "guild" on a gamer site is going to be futile.

Related: Want To Unionize Developers? Focus On Workplace Democracy

There's been talk of unionization in the past because tech jobs are typically exempt from overtime pay requirements. As for research, data has existed regarding worker productivity since the mid 1930s, if I remember my dates correctly. It's all explained quite clearly in the Mythical Man Month, which was written in the 70s. If you meet a manager who hasn't even heard of this book, run away fast. That article is a good summary, but the link that talks about studies on worker productivity is a bit scary because it seems to suggest that this is a new field of study.

complexmath wrote:
It's all explained quite clearly in the Mythical Man Month, which was written in the 70s. If you meet a manager who hasn't even heard of this book, run away fast.

I haven't read the book myself (though I am not a manager) but have it on my list of must reads. My manager hasn't read the book either (or even heard of it before I told him) and from the synopsis, it is something that my manager can greatly benefit from. I told him to buy the book 4 months ago and read it, but he has yet to do it. How fast should I be running?

Can anyone recommend a JUnit book or web tutorial for me?

S0LIDARITY wrote:
Can anyone recommend a JUnit book or web tutorial for me?

All I can recommend is to use TestNG isntead of JUnit. The TestNG site has a good tutorial of how to use it. As an added suggestion, use hamcrest for assertions.

kazar wrote:
S0LIDARITY wrote:
Can anyone recommend a JUnit book or web tutorial for me?

All I can recommend is to use TestNG isntead of JUnit. The TestNG site has a good tutorial of how to use it. As an added suggestion, use hamcrest for assertions.

Why do you prefer TestNG?

JUnit's ubiquitous integration everywhere makes a compelling case for it.

SixteenBlue wrote:
kazar wrote:
S0LIDARITY wrote:
Can anyone recommend a JUnit book or web tutorial for me?

All I can recommend is to use TestNG isntead of JUnit. The TestNG site has a good tutorial of how to use it. As an added suggestion, use hamcrest for assertions.

Why do you prefer TestNG?

JUnit's ubiquitous integration everywhere makes a compelling case for it.

Most things worthwhile support both. TestNG is a more advanced testing framework. It supports concepts like test groups using annotations, it does data injection into the test better then JUnit. It also has better multithreading support. Actually, almost everything good about JUnit 4 was pulled in some fashion from TestNG, though it is still trying to play catch up.

Edit: I am not bashing JUnit. It is a good tool. Just suggesting to use a better tool.

kazar wrote:
SixteenBlue wrote:
kazar wrote:
S0LIDARITY wrote:
Can anyone recommend a JUnit book or web tutorial for me?

All I can recommend is to use TestNG isntead of JUnit. The TestNG site has a good tutorial of how to use it. As an added suggestion, use hamcrest for assertions.

Why do you prefer TestNG?

JUnit's ubiquitous integration everywhere makes a compelling case for it.

Most things worthwhile support both. TestNG is a more advanced testing framework. It supports concepts like test groups using annotations, it does data injection into the test better then JUnit. It also has better multithreading support. Actually, almost everything good about JUnit 4 was pulled in some fashion from TestNG, though it is still trying to play catch up.

Edit: I am not bashing JUnit. It is a good tool. Just suggesting to use a better tool.

Yeah it sounds good.

kazar wrote:
S0LIDARITY wrote:
Can anyone recommend a JUnit book or web tutorial for me?

All I can recommend is to use TestNG isntead of JUnit. The TestNG site has a good tutorial of how to use it. As an added suggestion, use hamcrest for assertions.


I think I probably need a better background on unit-testing before I can jump into TestNG. To me, it appears that the documentation expects significant JUnit experience from the user. It's times like this that I curse my second-rate education.

S0LIDARITY wrote:
Can anyone recommend a JUnit book or web tutorial for me?

This is quite good (as are almost all PragProg books).
I don't own this but have heard good things about it.
I like this one a lot (not JUnit per se but about TDD).

kazar wrote:
Most things worthwhile support both. TestNG is a more advanced testing framework. It supports concepts like test groups using annotations, it does data injection into the test better then JUnit. It also has better multithreading support. Actually, almost everything good about JUnit 4 was pulled in some fashion from TestNG, though it is still trying to play catch up.

Except that whenever I try to tell TestNG not to do multi-threading it doesn't listen and messes up a bunch of stuff and we have to write weird hacks for it.

Mixolyde wrote:
kazar wrote:
Most things worthwhile support both. TestNG is a more advanced testing framework. It supports concepts like test groups using annotations, it does data injection into the test better then JUnit. It also has better multithreading support. Actually, almost everything good about JUnit 4 was pulled in some fashion from TestNG, though it is still trying to play catch up.

Except that whenever I try to tell TestNG not to do multi-threading it doesn't listen and messes up a bunch of stuff and we have to write weird hacks for it.

I haven't had to turn off multithreaded tests, though if you are using singletons in tests I can see how that would be an issue.

As a different topic of conversation, what are people's opinions on the singleton pattern. I pretty much never use it anymore and when I find one, it usually just causes more problems then it solves.

kazar wrote:
Mixolyde wrote:
kazar wrote:
Most things worthwhile support both. TestNG is a more advanced testing framework. It supports concepts like test groups using annotations, it does data injection into the test better then JUnit. It also has better multithreading support. Actually, almost everything good about JUnit 4 was pulled in some fashion from TestNG, though it is still trying to play catch up.

Except that whenever I try to tell TestNG not to do multi-threading it doesn't listen and messes up a bunch of stuff and we have to write weird hacks for it.

I haven't had to turn off multithreaded tests, though if you are using singletons in tests I can see how that would be an issue.

As a different topic of conversation, what are people's opinions on the singleton pattern. I pretty much never use it anymore and when I find one, it usually just causes more problems then it solves.

I'm generally not a fan but I use it for convenience every once in a while.