Thursday, August 12, 2010

Java: Pass by Reference or Value?

Java (programming language)Image via Wikipedia
This article explains in clear detail why I've been feeling a trifle bit confused when writing certain Java methods.  Sometimes changes made to an object within a method are retained (or maintained) in the calling method as if Java passes by reference, but sometimes the changes are lost as if Java passes by value.  I've had this question before, and thought that I understood that Java passes by reference.

However, the situation is not as straightforward as that, and this article explains why!  Java does pass by reference, but the reference inside a method is a copy of the reference in the calling method.  Thus changes to the object referenced by the reference will "stick," but try to swap the objects inside a method and nothing is retained outside of the method!  It's because only the references are swapped, but the references are only copies of the original references; thus the original references are unchanged.

Runge Kutta for Game Physics

So I'm working on building a physics simulator in Java.  I did well in the AP physics class back in high school, and aced the algebra-based physics classes at Georgia State, but implementing them into a program was a little different (due to the need to know and update all properties at any time, as opposed to calculating one or two unknowns from a set of known values).  So, of course, I started searching the internet for solutions.

Runge-Kutta methods for the function y'=sin(t)^2*yImage via Wikipedia
Anyway, while researching I stumbled across a really neat article on something called Runge Kutta order 4, or simply RK4.  It's a method of approximating the solutions to differential equations, and was invented (or developed, if you rather) around the start of the 1900s by, you guessed it, two mathematicians name Runge and Kutta.  So here is the full article for those of you interested in game physics; check it out!

The article does a wonderful job of explaining how RK4 works by stripping away all of the mathematics that might scare potential learners out there, so if you feel as though you might be in that group, check it out anyway!

Friday, July 30, 2010

Watch Out for Sketchy Apps!

Android and iPhoneImage by quinn.anya via Flickr
Android and iPhone users may be inadvertently downloading apps that access private information on their phones without good reason! Lookout's App Genome Project warns about sketchy apps you may have already downloaded.
Enhanced by Zemanta

Zemanta

While trying to link Google Blogger and Google Buzz together so that posts to one automatically post to the other, I came across Zemanta!  Zemanta seems to be quite a handy little "assistant" that provides content related to the text of your Blogger post.  This post is serving not only as an informative one, but also a Zemanta test.  As I'm typing this, Zemanta is off to the right suggesting pictures, related articles, and in-text links!

So far, I'm pretty pleased.  Some of the pictures, however, seem rather unrelated, such as a few faces of well-known bloggers about whom I'm not directly writing and one abstract oil painting (okay, other than the fact that the picture exists on a blog, that's not related at all!).  The related articles seem on-point. I'll list a few:
Enhanced by Zemanta

Froyo for You?

After upgrading to the myTouch Slide from my old G1, I was a tad bit disappointed to see that Froyo, codename for the newest release of the Android OS (version 2.2), wasn't available for it yet.

So, like any good techie consumer, I went searching for an answer... would my new phone be receiving the Froyo update? If so, when?

While the former question seems to have a definitive answer (yes), the latter question remains largely unanswered. Intomobile reports T-Mobile as saying "coming soon" for both the myTouch 3G and the myTouch slide, while PCWorld reports that it should arrive by the end of 2010.

Unlike pure Android phones, the myTouch slide uses a blend of Android 2.1 and HTC's Sense (Wikipedia link... best I could quickly find, but it's a lowly rated article), which gives it a more unique feel, but probably explains the lack of immediate implementation.

Got an Android phone that hasn't received the Froyo update yet? Check out Android 2.2 Upgrade List: Is Your Phone Getting Froyo? and find out if Froyo is in your phone's future!

Scam Alert!

My lovely wife just received an email informing her that she had just won $800,000.00 as some sort of compensation for Facebook's six year mark... do they think we are daft? I mean, all they wanted was a ton of personal information that Facebook.com would have already, and what company shells out almost a million dollars to someone in the name of annaversaries and compensation?

Anyway, if you get the email, just delete it. DON'T send them any personal or contact information!

Now That's Using Your Resources!

Reading through an ACM TechNews from July 23, 2010 I saw a very interesting research story regarding the use of Twitter.  Read the entire article when you get a chance, but basically, researchers used public Twitter updates to map the mood of America!  How awesome is that?