n3oplasm

Members
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

132 Neutral

About n3oplasm

  • Rank
    Newbie
  1. [HTML] Good PHP IDE ?

    Check out the PDT Plugin for Eclipse: http://wiki.eclipse.org/index.php/PHP This is what I've used and it supports debugging via [url="http://wiki.eclipse.org/Debugging_using_XDebug"]XDebug[/url] so that you can step through your code while it executes. You'll need to download and install Eclipse before installing the plugin but both are free: http://www.eclipse.org/
  2. NullPointerException on DoubleBuffering

    The call to this.getGraphics() will return null if the component is not visible (i.e. the panel has been added to a JFrame which is not currently set to visible at the time the thread is running). My guess is that finalGraphics is null at the time finalGraphics.drawImage(bfi,0,0,null); is being called. As far as I know, a call to getGraphics (or the preferred createGraphics as TheChubu pointed out) of a BufferedImage object should not return null. Also, unless there's a reason you aren't currently, I'd consider using the BufferStrategy class that the Java library provides for double-buffering. See the links below for examples of usage in an active-rendering loop. Hope that helps! http://docs.oracle.com/javase/tutorial/extra/fullscreen/bufferstrategy.html http://www.gamedev.net/page/resources/_/technical/general-programming/java-games-active-rendering-r2418
  3. Programming Exercises

    Here's a free online book on Java that has exercises at the end of each chapter and their solutions as well. http://math.hws.edu/javanotes/
  4. Check that soundUrl is not null, try debugging with System.out.println(soundUrl). ClassLoader.getResource() will return null without throwing an exception if the file name given is not valid. If the url is null make sure that the file you are referencing does indeed exist and that it is relative to the root of your source. For example, if audioFile was something like "audio/sound.wav", then the class loader expects the file to be in src/audio/sound.wav.
  5. settin enum constants

    According to the Javadoc posted at the link, ValidationStringency enum is an inner enum of SAMFileReader and it contains the value for LENIENT. The code below should work as long as you add import net.sf.samtools.SAMFileReader.ValidationStringency; to your import statements. [source lang="java"]SAMFileReader reader; reader.ValidationStringency(ValidationStringency.LENIENT);[/source] You could also do without the import if you use SAMFileReader.ValidationStringency.LENIENT instead. Either one should work fine.
  6. What this loop is really doing is attempting the call to thread.join() repeatedly until it is successful (if an exception is thrown it is immediately caught, ignored and the loop resumes). However, in the code from your original post there is no way for the loop to exit. It continues looping infinitely even after thread.join() returns. The solution is to add a break; statement just after the call to thread.join() in the try block. This way, the loop terminates once thread.join is successful. [source lang="java"]while(true) { try { thread.join(); break; } catch (InterruptedException e) { // retry } }[/source]
  7. Building Games for Android

    Been working with Android myself lately and this [url="http://www.amazon.com/Beginning-Android-Games-Mario-Zechner/dp/1430230428/ref=sr_1_1?ie=UTF8&qid=1352138632&sr=8-1&keywords=android+game+development"]book[/url] has been an awesome resource so far. Also, as far as engines go, the most promising looking ones I've come across are: libgdx: [url="http://libgdx.badlogicgames.com/"]http://libgdx.badlogicgames.com/[/url] AndEngine (2d only): [url="http://www.andengine.org/"]http://www.andengine.org/[/url] The [url="http://www.youtube.com/user/GoogleDevelopers?feature=watch"]GoogleDevelopers[/url] YouTube channel might also be a good resource... for example here's a good presentation I found a while back on Android game development: [url="http://www.youtube.com/watch?v=U4Bk5rmIpic&feature=relmfu"]Google I/O 2009 - Writing Real-Time Games for Android[/url]