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.
Thursday, August 12, 2010
Java: Pass by Reference or Value?
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.
Image via WikipediaAnyway, 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!
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 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.
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:
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:
- Bloggers Get More Content with Zemanta (asktheblogster.blogspot.com)
- Zemanta Gets Blog Love From Blogger (centernetworks.com)
- CMOR Weekender #2 - A rising industry, how 2 speel good, and a great source of links. (codemyownroad.com)
- Google's Blogger and Zemanta Team Up on Gadget for Blogger (webpronews.com)
- Blogger Welcomes Zemanta Assistant (webconsuls.com)
- Zemanta Now Native on Blogger.com! (techparade.blogspot.com)
Also, all the in-text links in this post were automatically inserted (disclaimer: I had to click "apply all"). Several settings are changeable, including image alignment (left or right), HTML code style (default HTML or clean xHTML), and which signature image (read: Zemanta icon) is placed at the end of the post (including an invisible image for those who don't desire it's presence). Apparently, more advanced options are made available by registering with a Zemanta account (appears to be free since the FAQ doesn't list a "how much does it cost?" question).
Overall, I think I'll keep it around as it seems like it could be a useful little tool, although I'll probably choose to use the invisible Zemanta icon!
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!
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?
Subscribe to:
Posts (Atom)