<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7781838276784064381</id><updated>2012-01-25T17:32:50.376-06:00</updated><category term='dual core'/><category term='calendar'/><category term='instrumentation'/><category term='difference engine'/><category term='hash table'/><category term='finance'/><category term='China'/><category term='HTTPS'/><category term='vulnerability'/><category term='loop optimisation'/><category term='A5'/><category term='malware'/><category term='new'/><category term='bank transfer'/><category term='Java 7'/><category term='hosting'/><category term='algorithms'/><category term='Apple'/><category term='hash set'/><category term='native code'/><category term='polynomial'/><category term='Verified by visa'/><category term='threading'/><category term='e-book'/><category term='HTTP'/><category term='encryption'/><category term='libel reform'/><category term='iPhone development'/><category term='ZIP'/><category term='RSS'/><category term='JCA'/><category term='Mac'/><category term='volatile'/><category term='servlet'/><category term='App Store'/><category term='performance'/><category term='maintainability'/><category term='glossary'/><category term='corpus linguistics'/><category term='iOS'/><category term='program design'/><category term='hashing'/><category term='pcAnywhere'/><category term='IBM'/><category term='currency exchange'/><category term='simulation'/><category term='20090132950'/><category term='software patent'/><category term='threads'/><category term='heap'/><category term='Élysée'/><category term='PDF'/><category term='security'/><category term='CyclicBarrier'/><category term='secure hash'/><category term='PIFTS.EXE'/><category term='synchronization'/><category term='CAPTCHA'/><category term='HADOPI'/><category term='XML'/><category term='memory'/><category term='Java Native Interface'/><category term='XORShift'/><category term='trojan'/><category term='regular expression'/><category term='concurrency'/><category term='String CharSequence'/><category term='social security number'/><category term='web security'/><category term='smartphone theft'/><category term='HTML scraping'/><category term='patent'/><category term='memory usage'/><category term='iPhone'/><category term='iTunes'/><category term='fake'/><category term='XPath'/><category term='XML scraping'/><category term='mobile phone crime'/><category term='software'/><category term='Symantec'/><category term='StreamCorruptedException'/><category term='cell phone theft'/><category term='optimization'/><category term='SSN'/><category term='final'/><category term='network'/><category term='tarball'/><category term='blogging'/><category term='codability'/><category term='SOPA'/><category term='computing'/><category term='secure socket'/><category term='password-based encryption'/><category term='Sarkozy'/><category term='estoppel'/><category term='unsigned'/><category term='technology'/><category term='Kindle'/><category term='Norton Antivirus'/><category term='computer security'/><category term='cryptography'/><category term='Windows 8'/><category term='patent abuse'/><category term='tablet'/><category term='wait'/><category term='counterfeiting'/><category term='Big Brother Camera Security'/><category term='Adobe Reader'/><category term='Kindle Fire'/><category term='ngram'/><category term='SCJP'/><category term='hash map'/><category term='Carrier IQ'/><category term='Oracle'/><category term='banking'/><category term='Swing'/><category term='scraping'/><category term='archive'/><category term='patent troll'/><category term='SHA-256'/><category term='Java programming'/><category term='survey'/><category term='user interface'/><category term='Objective-C'/><category term='notify'/><category term='JSSE'/><category term='National Curriculum'/><category term='web programming'/><category term='SSL'/><category term='mobile phone theft'/><category term='GZIP'/><category term='Spanish'/><category term='Android'/><category term='encapsulation'/><category term='search ranking'/><category term='const'/><category term='time zone'/><category term='thread-safety'/><category term='computer science'/><category term='JNI'/><category term='math'/><category term='object orientation'/><category term='feed'/><category term='rip-off'/><category term='Bloom filter'/><category term='iPhone 5'/><category term='programming'/><category term='random'/><category term='tutorial'/><category term='sorting'/><category term='multithreading'/><category term='glosario'/><category term='Ministère de la Culture'/><category term='SecureRandom'/><category term='Oracle patent'/><category term='+1'/><category term='Java'/><category term='Google'/><category term='petition'/><category term='64-bit hash function'/><category term='tar'/><category term='Java security'/><category term='producer-consumer'/><category term='phishing'/><category term='malloc'/><category term='certification'/><category term='copyright'/><category term='antivirus'/><category term='UDID'/><category term='SEO'/><category term='twitter'/><category term='hotspot bug'/><category term='virus'/><category term='parallelism'/><category term='hash code'/><category term='Google vs Oracle'/><category term='article'/><category term='Java patent'/><category term='collections'/><category term='iPad'/><category term='ThreadMXBean'/><category term='TED'/><category term='profiling'/><category term='Applet'/><category term='WiFi'/><category term='scheduling'/><title type='text'>Javamex News and Development</title><subtitle type='html'>Announcements and comments relating to the &lt;a href="http://www.javamex.com/"&gt;Javamex&lt;/a&gt; programming site, containing Java programming and performance related resources and tutorials. Feel free to respond to any of the articles here either by leaving a comment on the blog or by replying to &lt;a href="https://twitter.com/#!/BitterCoffey"&gt;@BitterCoffey&lt;/a&gt; on Twitter.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>83</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-1622967305960506031</id><published>2012-01-25T17:30:00.003-06:00</published><updated>2012-01-25T17:32:50.389-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pcAnywhere'/><category scheme='http://www.blogger.com/atom/ns#' term='Symantec'/><title type='text'>Symantec advise users to disable pcAnywhere</title><content type='html'>According to a &lt;a href="http://www.symantec.com/connect/sites/default/files/pcAnywhere%20Security%20Recommendations%20WP_01_23_Final.pdf" target="_blank"&gt;white paper released by Symantec&lt;/a&gt;, the source code to various of its produces that hacker group Anonymous recently threatened to disclose was stolen in 2006, and users are advised to disable pcAnywhere until further notice. Specifically, the paper states:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"pcAnywhere is a product that allows for direct PC to PC communication and this does expose some risk if the compromised code is actually released."&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This seems to imply that pcAnywhere is based on security through obscurity. (Presumably, the same security risk actually exists, albeit to a lesser extent, whether or not somebody releases the source code: whatever information is in the source code is in &lt;i&gt;principle &lt;/i&gt;available by reverse engineering the compiled code.)&lt;br /&gt;&lt;br /&gt;To me, the event underlines at least two lessons:&lt;br /&gt;&lt;br /&gt;- this is precisely what may happen if you rely on security through obscurity&lt;br /&gt;- if you have some security-sensitive source code stolen, "right now" would be a good time to review the stolen code, rather than 6 years later...&lt;br /&gt;&lt;br /&gt;Or is there something about the content of the white paper and the incident in general that I'm misunderstanding?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-1622967305960506031?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/1622967305960506031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=1622967305960506031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1622967305960506031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1622967305960506031'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2012/01/symantec-advise-users-to-disable.html' title='Symantec advise users to disable pcAnywhere'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-5244657997697286423</id><published>2011-12-29T09:54:00.001-06:00</published><updated>2011-12-29T10:04:18.896-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ministère de la Culture'/><category scheme='http://www.blogger.com/atom/ns#' term='copyright'/><category scheme='http://www.blogger.com/atom/ns#' term='Élysée'/><category scheme='http://www.blogger.com/atom/ns#' term='Sarkozy'/><category scheme='http://www.blogger.com/atom/ns#' term='HADOPI'/><title type='text'>A copyright-obsessed French government gets a taste of its own medicine</title><content type='html'>As you might expect when your president is married to a singer, the French government takes a fairly totalitarian line on copyright. The infamous &lt;a href="http://en.wikipedia.org/wiki/HADOPI_law" target="_blank"&gt;HADOPI&lt;/a&gt; law effectively enables citizens to be prohibited from contracting Internet access with an ISP on the basis of copyright infringement complaints, apparently with such complaints centering around access from a particular IP address.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So it would be slightly embarrassing if it turned out that IP addresses belonging to the president's official residence and a French government ministry turned up in a database of illegal downloads. Unfortunately, this is precisely what appears to have happened: records of apparently "illegal" downloads from the French &lt;a href="http://www.nikopik.com/2011/12/au-tour-du-ministere-de-la-culture-detre-flashe-pour-telechargements-illegaux.html" target="_blank"&gt;Ministère de la Culture&lt;/a&gt; and &lt;a href="http://www.nikopik.com/2011/12/ca-telecharge-aussi-illegalement-a-lelysee.html" target="_blank"&gt;Élysée&lt;/a&gt; (official presidential residence and offices) have turned up in the databases of YouHaveDownloaded.com, a site publishing records from (among other sources) various public BitTorrent servers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, should we conclude that a poverty-stricken Sarkozy has had to resort to using public resources to download illegal copies of his favourite flicks and tracks in these times of austerity? Should we now engage in month-long trial to determine whether we can prove beyond reasonable doubt that Mr Sarkozy did or did not download that dodgy low-quality MP4 of La Cage aux folles? Should the Élysée now spend public money on a lengthy witch-hunt to establish which petty office clerk or work experience temp is responsible for this shocking infringement of some random fat cat's right to stuff his coffers a little fuller?&lt;br /&gt;&lt;br /&gt;Well, I would suggest not-- but that's the point. Hopefully this revelation may help the French government to understand people's concerns about the glib connection that they are insistent to draw between an IP address in a database and the download in question having definitely occurred under the actions of a particular person, and to weigh up the pros and cons of establishing totalitarian means in an attempt to enforce the practically unenforceable with arguable benefit to society.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-5244657997697286423?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/5244657997697286423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=5244657997697286423' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5244657997697286423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5244657997697286423'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/12/copyright-obsessed-french-government.html' title='A copyright-obsessed French government gets a taste of its own medicine'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6900604094084463011</id><published>2011-12-19T23:40:00.002-06:00</published><updated>2011-12-19T23:44:34.038-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOPA'/><category scheme='http://www.blogger.com/atom/ns#' term='copyright'/><title type='text'>Is copyright worth breaking the Internet over?</title><content type='html'>The truth is that for some time now, the Internet can no longer be relied on to fulfil its simple infrastructural purpose of delivering bytes from A to B unhindered when requested to do so. The appetite of the powers that be for intruding on their citizens' privacy on the one hand and for succumbing to capitalist pressures on the other make any Internet connection an increasingly noisy channel.&lt;br /&gt;&lt;br /&gt;Lemley, Levine and Post now outline and give an enlightening critique of some recent and alarming steps being taken in their essay&amp;nbsp;&lt;a href="http://www.stanfordlawreview.org/online/dont-break-internet" target="_blank"&gt;Don't Break the Internet&lt;/a&gt;. As an author, I completely sympathise with concerns about copyright, and I would possibly agree that the current process of having infringing material removed is insufficient-- whilst also suspecting that the impact of the "copyright problem" is massively overexaggerated. But as with traffic shaping measures (among others), it is particularly concerning to see proposals to allow fundamental pieces of infrastructure to be undermined almost on a whim. Is this really the most intelligent counter-measure to copyright infringement that we can think of?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6900604094084463011?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6900604094084463011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6900604094084463011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6900604094084463011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6900604094084463011'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/12/is-copyright-worth-breaking-internet.html' title='Is copyright worth breaking the Internet over?'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-8100823537636892373</id><published>2011-12-04T00:45:00.001-06:00</published><updated>2011-12-04T00:48:39.724-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cell phone theft'/><category scheme='http://www.blogger.com/atom/ns#' term='mobile phone theft'/><category scheme='http://www.blogger.com/atom/ns#' term='mobile phone crime'/><category scheme='http://www.blogger.com/atom/ns#' term='smartphone theft'/><title type='text'>Can more indeed be done to disincentivise smartphone theft?</title><content type='html'>San Francisco Chronicle columnist C.W.Nevius has an interesting article on how &lt;a href="http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2011/12/03/BAHO1M7J9U.DTL"&gt;Australian mobile operators do far more than in the US to block stolen phones&lt;/a&gt;. On the surface, it is intriguing that more governments, manufacturers and operators can't bang their respective heads together to put more measures in place, both technologically and legislatively, to curb mobile phone theft, particularly that of high-end smartphones.&lt;br /&gt;&lt;br /&gt;Direction from governments is probably required. As the aforementioned article mentions, if left to capitalism alone, there is little incentive for mobile operators and manufacturers to put such schemes in place: for them, theft simply equates to more sales.&amp;nbsp;Another interesting thought is that various countries in Latin America do apparently have some measures in place to block the connection of stolen phones. If the US doesn't, then this situation presumably serves to make the US an even more prime target market for the criminals selling stolen devices.&lt;br /&gt;&lt;br /&gt;However, such measures surely aren't a panacea. Any system is only as strong as its weakpoints. What measures would need to be put in place to ensure the accuracy of the database and eliminate "false positives"? Since (presumably) operator staff have the ability to override the system in order to deal with cases of error, how does one prevent them from becoming targets for blackmail, bribery and gang involvement, in effect simply shifting the problem? What methods could criminals fight back with (e.g. replacement of the chip containing the serial number), and what impact would this ultimately have in terms of where new criminal opportunities would spring up? And what more serious crimes would criminals then commit instead of stealing mobile phones?&lt;br /&gt;&lt;br /&gt;Nonetheless, I haven't seen much debate of these issues and it does seem that potential measures at least deserve more consideration from governments and operators and a clearer explanation for why they cannot be put in place if indeed they can't.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-8100823537636892373?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/8100823537636892373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=8100823537636892373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8100823537636892373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8100823537636892373'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/12/can-more-indeed-be-done-to.html' title='Can more indeed be done to disincentivise smartphone theft?'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-1979308954810309921</id><published>2011-12-02T17:46:00.002-06:00</published><updated>2011-12-02T17:47:19.313-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Carrier IQ'/><title type='text'>The Carrier IQ debacle</title><content type='html'>In case you've missed the commotion, concerns have been raised over the last few days about a component produced by a company called Carrier IQ and installed on many smartphones which (a) is set to run by default on some smartphones; (b) may be more covert than other processes running on the system; and (c) seems to have hooks to which it is passed various confidential data such as the identity of keypresses, the content of SMS messages and the cleartext version of data sent over HTTPS.&lt;br /&gt;&lt;br /&gt;Such is the concern that some commentators are already &lt;a href="http://www.zdnet.com/blog/networking/finding-and-cleaning-out-your-smartphones-carrier-iq-poison/1697"&gt;describing the Carrier IQ software as a rootkit&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It is possible that the module in question is entirely innocent, and that the reason for confidential data being passed to its hooks is simply due to some slightly diabolical API design. Be that the case, I would then expect:&lt;br /&gt;&lt;br /&gt;- smartphone manufacturers who have embedded the Carrier IQ component in their OS's to come forward with details about the close scrutiny that the software underwent on their part before being approved;&lt;br /&gt;- Carrier IQ to come forward with some convincing and reassuring details about why this confidential data is apparently being passed to the process without constituting a breach of trust and confidentiality.&lt;br /&gt;&lt;br /&gt;As I say, the Carrier IQ component may be entirely innocent and above board. But the longer the above two actions continue not to occur, the more concerning things appear. And sometimes, it isn't whether there &lt;i&gt;is &lt;/i&gt;anything untoward that matters, but whether there &lt;i&gt;appears &lt;/i&gt;to be...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-1979308954810309921?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/1979308954810309921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=1979308954810309921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1979308954810309921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1979308954810309921'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/12/carrier-iq-debacle.html' title='The Carrier IQ debacle'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3838372826876716834</id><published>2011-10-21T11:28:00.000-05:00</published><updated>2011-10-21T11:28:15.121-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><title type='text'>Apple infuriates iOS 5 beta users by suddenly bricking their phones without warning</title><content type='html'>A huge number of iOS 5 beta users have apparently been infuriated after their phones were &lt;a href="http://www.macgasm.net/2011/10/21/ios-5-beta-users-wake-today-warm-bricks-redsn0w-b7b-saves-day/"&gt;suddenly bricked&lt;/a&gt; yesterday evening US time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3838372826876716834?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3838372826876716834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3838372826876716834' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3838372826876716834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3838372826876716834'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/10/apple-infuriates-ios-5-beta-users-by.html' title='Apple infuriates iOS 5 beta users by suddenly bricking their phones without warning'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-7423775042140568745</id><published>2011-10-19T08:38:00.003-05:00</published><updated>2011-10-19T08:39:26.608-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java security'/><title type='text'>Oracle releases Java patches</title><content type='html'>Oracle has released &lt;a href="http://www.oracle.com/technetwork/topics/security/javacpuoct2011-443431.html"&gt;critical patch&lt;/a&gt;&amp;nbsp;updates&amp;nbsp;for Java runtimes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-7423775042140568745?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/7423775042140568745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=7423775042140568745' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7423775042140568745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7423775042140568745'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/10/oracle-releases-java-patches.html' title='Oracle releases Java patches'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-132898283924653137</id><published>2011-10-18T23:39:00.003-05:00</published><updated>2011-10-18T23:42:22.367-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='secure socket'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTPS'/><category scheme='http://www.blogger.com/atom/ns#' term='web security'/><title type='text'>Not news, but worth emphasising: SSL certificate authorities can be compromised</title><content type='html'>I can't actually spot the piece of news in this &lt;a href="http://www.bbc.co.uk/news/technology-15348821"&gt;"news" item&lt;/a&gt; by the BBC. However, the general point of the article still stands as a universal truth: our secure web communications generally depend, and always have depended, on the assumption that certificate authorities are not compromised. They also depend among other things on the assumption that client machines' certificate stores, software and operating systems are not compromised and don't have bugs. People do sometimes forget this and take the little padlock icon in their web browser as some kind of "guarantee"; it's worth reminding ourselves from time to time that SSL offers a &lt;i&gt;degree &lt;/i&gt;of confidence that a communication is secure, but no absolute guarantee.&lt;br /&gt;&lt;br /&gt;However, I repeat that this isn't really a piece of news to have come to light on 18 October 2011; it has been universally true since the inception of the secure web communications protocols that we so readily rely on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-132898283924653137?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/132898283924653137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=132898283924653137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/132898283924653137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/132898283924653137'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/10/not-news-but-worth-emphasising-ssl.html' title='Not news, but worth emphasising: SSL certificate authorities can be compromised'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-7782048054374577274</id><published>2011-10-01T03:55:00.000-05:00</published><updated>2011-10-01T03:55:58.445-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPad'/><category scheme='http://www.blogger.com/atom/ns#' term='tablet'/><category scheme='http://www.blogger.com/atom/ns#' term='Kindle Fire'/><title type='text'>Amazon's Kindle Fire: does it have something to offer other than cheapness?</title><content type='html'>The latest company to jump on the tablet bandwagon-- in as much as such a bandwagon actually exists-- is Amazon with the launch of its new Android-based Kindle Fire.&lt;br /&gt;&lt;br /&gt;Clearly, the distinguishing feature of buying Amazon's offering is that the device is coupled with Amazon's purchasing ecosystem, as opposed to, say, Apple's if you were to buy an iPad.&lt;br /&gt;&lt;br /&gt;One thing that strikes me is that at present at least, the&lt;a href="http://www.france24.com/en/20110928-book-retailer-amazon-launches-kindle-fire-tablet-computer-ipad"&gt; majority of media focus appears to be on the price&lt;/a&gt;, which at $199 does seem aggressive to the point of being a loss leader. When Apple originally launched the iPad, arguably the spark of the recent tablet frenzy among the rest of the market, it is interesting to compare Apple's approach of offering what they saw as a "fairly priced"-- but by no means "cheap" if you sounded opinion at the time-- marketed essentially on &lt;i&gt;features&lt;/i&gt;.&amp;nbsp;Amazon clearly have their ecosystem on their side compared to the average Miscellaneous Android Tablet Manufacturer X. But they do appear to be buying into the price-focussed strategy of the other manufacturers. It will be interesting to see how this plays out!&lt;br /&gt;&lt;br /&gt;What do you think? I'd love to hear your &lt;a href="https://docs.google.com/spreadsheet/viewform?hl=en_US&amp;amp;formkey=dEZsT1FpVEhKX3hpTWI3QWEwcjNaT2c6MQ#gid=0"&gt;opinion about the Kindle Fire&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-7782048054374577274?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/7782048054374577274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=7782048054374577274' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7782048054374577274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7782048054374577274'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/10/amazons-kindle-fire-does-it-have.html' title='Amazon&apos;s Kindle Fire: does it have something to offer other than cheapness?'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-9062840592334922311</id><published>2011-09-27T09:36:00.003-05:00</published><updated>2011-09-27T10:04:25.077-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='64-bit hash function'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><category scheme='http://www.blogger.com/atom/ns#' term='secure hash'/><category scheme='http://www.blogger.com/atom/ns#' term='UDID'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='iOS'/><category scheme='http://www.blogger.com/atom/ns#' term='SHA-256'/><title type='text'>Even 'random junk' may need encryption</title><content type='html'>There appear to be some interesting &lt;a href="http://www.insidemobileapps.com/2011/06/24/openfeint-lawsuit-gree/"&gt;legal&lt;/a&gt; &lt;a href="http://www.courthousenews.com/2011/06/24/37674.htm"&gt;cases&lt;/a&gt; springing up around the fact that software developers have been taking "raw" Unique Device IDs and using them to store data against a given user 'in the cloud'. UDIDs essentially resemble a long 'random number' rather than directly encoding any user-identifiable information, so you may be forgiven for wondering what the issue is. The problem comes when applications have then stored user-identifiable information (such as social network data) alongside the UDID and make this information available to other applications, thus leading to a 'leaking' of user-identifiable information on the basis of this shared UDID.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The solution is in principle simple: append the UDID to an application-specific code or 'salt' and then encode this combination using a &lt;a href="http://www.javamex.com/tutorials/cryptography/hash_functions_algorithms.shtml"&gt;secure hash&lt;/a&gt; scheme such as &lt;a href="http://www.javamex.com/tutorials/cryptography/hash_functions_algorithms.shtml"&gt;SHA-256&lt;/a&gt;. The application-specific salt doesn't need to be a secret. But doing this means that I cannot compare a hash for user X from one application with a hash for user X from another application and deduce that they are for the same user. Again, in principle.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, this scheme does rely on UDIDs containing sufficient &lt;a href="http://www.javamex.com/tutorials/random_numbers/seeding_entropy.shtml"&gt;entropy&lt;/a&gt;. Since the number of devices of a particular model sold is maybe in the tens or at most hundreds of millions (iOS devices &lt;a href="http://www.eurogamer.net/articles/2011-04-21-total-apple-ios-sales-189-million"&gt;appear to have sold something in the order of 200 million so far&lt;/a&gt;), if it is possible to make a good prediction of which range of the theoretically possible UDIDs has actually been allocated, then I can simply pre-compute all the potential combinations of (allocated hashes, application ID) for two given applications and find all the matches.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I haven't yet looked into all the details, but it appears that iOS 5 will &lt;a href="http://www.macrumors.com/2011/08/19/apple-phasing-out-developer-access-to-udids-in-ios-5/"&gt;remove the ability to read device-wide UDIDs in favour of application-specific UDIDs&lt;/a&gt;, presumably generated using a scheme such as the above. Although this is arguably the scheme that should have been adopted from the outset, if true, it will interesting to see what incompatibilities this throws up.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So why didn't people think of this in the first place? I wonder if one of the issues is that to a human, UDIDs do just look like 'random junk': it's just a string of random numbers, right, so why would you bother encrypting it? It's a good example of how when deciding when and how to employ encryption, we have to think not only about the data itself but also about protocols and practices governing how that data is used and stored.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-9062840592334922311?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/9062840592334922311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=9062840592334922311' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9062840592334922311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9062840592334922311'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/09/even-random-junk-may-need-encryption.html' title='Even &apos;random junk&apos; may need encryption'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-4088255898017709384</id><published>2011-09-17T16:38:00.006-05:00</published><updated>2011-09-17T17:21:59.173-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone development'/><category scheme='http://www.blogger.com/atom/ns#' term='tablet'/><category scheme='http://www.blogger.com/atom/ns#' term='Objective-C'/><category scheme='http://www.blogger.com/atom/ns#' term='iOS'/><title type='text'>Some thoughts in response to Matthew Baxter-Reynolds</title><content type='html'>Matthew Baxter-Reynolds wrote an interesting &lt;a href="http://www.guardian.co.uk/technology/blog/2011/sep/16/ios-android-windows8-programming-choose"&gt;piece for the Guardian&lt;/a&gt; yesterday giving some points of view essentially on what Windows 8 will mean for businesses and IT careers. In particular, he makes the point that writing for a Windows 8 device means a more natural progression from the "C# in Visual Studio" type development that is the bread and butter of most business applications. And he makes the point that this time around, Microsoft will be fostering a tighter coupling of software and hardware platforms to move closer to the model of the iPad, part of whose success relies on it being more of a "self-contained ecosystem".&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;From this point of view, I think Matthew is probably correct: if the thing you want to concentrate on is writing boring old "bread-and-butter" business applications, then a platform that builds on the existing "bread-and-butter" platform of C# in Visual Studio will be a more attractive proposition for businesses to get a footing on the tablet bandwagon. And even it if wasn't more attractive from a &lt;i&gt;development &lt;/i&gt;perspective, "Microsoft Windows tablet" may just sound a bit more 'serious and businessy' on a tender bid.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But, I think Matthew could have included a few other important observations (which don't necessarily contradict his point of view and if anything support it-- but which are nonetheless worth mentioning):&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;the iOS "ecosystem" may still present an attractive market to developers in the sense that Apple have done the job of (a) isolating the 100+ million people with sufficient income to splash out on fancy toy; (b) sold them that toy on the basis of it providing enjoyment: or in other words, persuaded them that it is to their benefit to spend money on this new gadget (and associated apps); and (c) built a system for developers to market fairly effortlessly to that income-to-spare-for-toys-and-apps sector;&lt;/li&gt;&lt;li&gt;games (and, apparently, knocking out games that you can sell for a buck or two a download) remain the predominant iOS market; the iOS development framework allows you to write virtually all of your application in a bog-standard C/OpenGL paradigm which will allow the creation/porting of a huge number of games with a minimal learning curve;&lt;/li&gt;&lt;li&gt;while slightly quirky, in a sense Objective-C is just "another C syntax-based language" and if you stick around in programming long enough, you generally end up learning a new C syntax-based language every 10 years or so; indeed, "Java" as it looks today, and certainly how it will look if currently discussed language features make it into Java 8, is almost a whole new language compared to how Java was when it first materialised back in 1735 (anyone remember when Java didn't have inner classes, let alone generics or closures?);&lt;/li&gt;&lt;li&gt;given that many business applications can and indeed ought to be written as web apps (a point which Matthew himself makes), for as long as HTML5/Javascript remains a standard enough development paradigm, I wonder if the Microsoft tablet will "C# in Visual Studio" actually become the paradigm of choice for tablet business applications anyway?&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;So, while I think Matthew is probably right that we could end up with an 80:20 split in one market versus a 20:80 split in the other, I don't know that that means that the "not-the-boring-bread-and-butter-database-application" market isn't viable.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-4088255898017709384?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/4088255898017709384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=4088255898017709384' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/4088255898017709384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/4088255898017709384'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/09/some-thoughts-in-response-to-matthew.html' title='Some thoughts in response to Matthew Baxter-Reynolds'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-512555841883399741</id><published>2011-09-14T08:01:00.005-05:00</published><updated>2011-09-14T08:16:11.546-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tablet'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 8'/><title type='text'>Windows 8 soon to be upon us</title><content type='html'>&lt;div&gt;It hardly seems 5 minutes since Windows 7 was the Next Big Thing. But apparently &lt;a href="http://www.bbc.co.uk/news/business-14908568"&gt;Windows 8 will soon be upon us&lt;/a&gt;, the principal motivation apparently to allow Microsoft to have another crack at jumping on the tablet bandwagon. It will be interesting to see how many people are actually burning to have Windows on their tablet, in whatever touchy-tabletified guise.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'm quite happy &lt;i&gt;not&lt;/i&gt; to have the following features on my iPad, for example:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;the need to grind the entire system down to the speed of a ZX Spectrum thanks to the latest antivirus software&lt;/li&gt;&lt;li&gt;irritating pop-ups every five seconds requesting permission for applications to do their basic job&lt;/li&gt;&lt;li&gt;having to battle with system that insists on saving documents in fundamentally stupid locations buried somewhere 5 million levels deep in the filing system&lt;/li&gt;&lt;li&gt;the need for every Application That Goes Ping to take up 7 squillion terabytes of disk space, delay startup by half a minute and require at least 2 resets before they will work&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;But of course, I am open minded and eagerly await the first demonstration of the wondrous crop of Windows 8 tablets which will not fail to ensue.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-512555841883399741?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/512555841883399741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=512555841883399741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/512555841883399741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/512555841883399741'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/09/windows-8-soon-to-be-upon-us.html' title='Windows 8 soon to be upon us'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6369341918917326614</id><published>2011-09-12T10:08:00.004-05:00</published><updated>2011-09-12T11:33:39.744-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='National Curriculum'/><category scheme='http://www.blogger.com/atom/ns#' term='petition'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>UK petition to get programming on the curriculum</title><content type='html'>There's an interesting &lt;a href="http://epetitions.direct.gov.uk/petitions/15081"&gt;petition being made to the UK government to teach programming&lt;/a&gt; to children from primary school age rather than waiting until later in their school career. I'm not sure that the rationale specifically given by the petition's initiator-- that there would be "far less of a disparity between the sexes"-- is terribly convincing as it stands. It's not clear to me either that there's really some great barrier, preventing female students from learning program if they choose to, that will be broken down specifically if 9-year-olds are taught programming. And in any case, it's not clear to me that even if it were the case, that it would be the most compelling reason for teaching programming. However, whether that proposition proves true or false, I think there are other valid reasons for teaching programming at this early stage. And so I support the petition itself, even if not the exaggerated gender-gap mantra that seems to be its underlying motivation.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I think a more compelling rationale is to be found in the types of skills that programming develops and simply in the ubiquity of programmable devices. As has been expressed elsewhere, learning to be a good programmer seems to entail making certain problem-solving skills become intuitive. (As &lt;a href="http://blog.jgc.org/2011/09/teach-our-kids-to-code.html"&gt;one fellow blogger has put it&lt;/a&gt;, learning to "algorithmate".) And in today's world where the average iPhone packs computing power that would have classed it as a mainframe not so many years ago, the potential for innovation through programming is practically beyond comprehension. I also suspect-- though I concede that I am also guilty of fluffy argument here and would be hard pushed to substantiate this view-- that the mindset that is made intuitive through learning to program gives people a more intuitive grasp of other concepts crucial to understanding our universe, be it genetics or the syntax of language. But in any case, the computer is now so engrained into our day-to-day devices that I would argue that "understanding our universe" really entails understanding how the microchip and computer work just as much as it does understanding the atom, the laws of thermodynamics etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Or put another way, there's really no reason nowadays to view programming as a uniquely specialist, "nerdy" subject.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, I have some implementational concerns. I worry, if programming was brought earlier on to the curriculum, about how severely it would be dumbed down; educators need to understand that "programming" doesn't mean drawing inane patterns with "turtle graphics" or similar glorified spirograph imitations. I also have &lt;i&gt;mild &lt;/i&gt;concerns-- though from a UK perspective, yes, they are mild-- that having a stronger computing component to the curriculum could widen existing digital divides if, for example, basic computer literacy was sidelined. (However, I do disagree with an apparent over-obsession with "teaching" skills such as browsing the Internet or word processing to those children for who such skills are as intuitive as operating their iPod.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I look forward to seeing what success this and other similar petitions in other countries may have. And if you are based in the UK, I urge you to sign this petition and encourage your friends and colleagues to do likewise.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6369341918917326614?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6369341918917326614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6369341918917326614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6369341918917326614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6369341918917326614'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/09/uk-petition-to-get-programming-on.html' title='UK petition to get programming on the curriculum'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-1721222046914806144</id><published>2011-09-04T11:43:00.002-05:00</published><updated>2011-09-04T11:56:25.085-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dual core'/><category scheme='http://www.blogger.com/atom/ns#' term='A5'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhone 5'/><title type='text'>Speculated iPhone specifications... seem somewhat boring</title><content type='html'>As we approach the predicted launch date of the iPhone 5, we unsurprisingly start to see more of the media speculation machine whirr into action. Key specifications that are pretty much on the cards are the &lt;a href="http://news.cnet.com/8301-13924_3-20101365-64/inside-the-iphone-5/"&gt;dual-core A5 processor and an 8 megapixel camera&lt;/a&gt;. And the new version of iOS isn't a terribly big secret given that any iOS developer can download the beta version.&lt;br /&gt;&lt;br /&gt;Now, perhaps I'm missing something, but it strikes me that if this is the big spec improvement to make a big fuss about, it seems pretty unexciting.&lt;br /&gt;&lt;br /&gt;The dual-core processor will hopefully make, for example, video editing a little less klunky. And it may be put to good use in a few specialist applications such as to allow extra tracks or more complex virtual instruments in some of the excellent music making software that has appeared for iOS over the last couple of years. But for your bog-standard iPhone game, I suspect the extra capacity will go largely unused: the standard game programming paradigm simply doesn't used multithreading, or only to a very minimal extent (e.g. sound playback is handled by background threads). While I'm not sure whether to agree with Don Knuth's take that multi-core processors are essentially a passing gimmick while we work out how to get faster single cores, it's true that what game programmers generally want is a single core that runs as fast as possible.&lt;br /&gt;&lt;br /&gt;As for an 8 megapixel camera instead of a 5 megapixel one. Well, I can't help shrugging my shoulders a little. So maybe we'll get a 2x digital zoom that's just about worthwhile if the extra megapixels actually add resolution rather than just being extra noise. But unless Apple is about to announce that they've just designed a revolutionary new lens, a few extra megapixels don't sound terribly exciting on the face of it.&lt;br /&gt;&lt;br /&gt;Of course, I also eagerly wait to be corrected... :)&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-1721222046914806144?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/1721222046914806144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=1721222046914806144' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1721222046914806144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1721222046914806144'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/09/speculated-iphone-specifications-seem.html' title='Speculated iPhone specifications... seem somewhat boring'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-8783023722840714134</id><published>2011-09-03T01:29:00.003-05:00</published><updated>2011-09-03T01:32:37.702-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='encryption'/><title type='text'>Encryption: it's the protocols that often go wrong</title><content type='html'>Bruche Schneier has an &lt;a href="http://www.schneier.com/blog/archives/2011/09/unredacted_us_d.html"&gt;interesting summary of the recent diplomatic cable disclosure&lt;/a&gt; due to (a) the encrypted file being (surreptitiously but) publicly available, and (b) the decruption key being publicly disclosed on a separate occasion. It's a good example of how what can often go wrong with cryptography is not the core technology or algorithm itself, but a failure in handling associated protocols (be it technical or social).&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-8783023722840714134?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/8783023722840714134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=8783023722840714134' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8783023722840714134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8783023722840714134'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/09/encryption-its-protocols-that-often-go.html' title='Encryption: it&apos;s the protocols that often go wrong'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-507524663541764379</id><published>2011-08-30T08:52:00.002-05:00</published><updated>2011-08-30T09:04:09.129-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><category scheme='http://www.blogger.com/atom/ns#' term='+1'/><category scheme='http://www.blogger.com/atom/ns#' term='search ranking'/><title type='text'>Google's use of the +1 button for search ranking</title><content type='html'>So firstly, a confession: I had always assumed that Google used +1 ratings in some small way for search engine rankings. Perhaps I'm misreading their blurb, but it seemed that they were pretty much advertised as such to web publishers. Clearly the influence would have to be small, as +1 ratings are easily fakable, but I assumed they were used in some way.&lt;br /&gt;&lt;br /&gt;According to a &lt;a href="http://www.wired.com/epicenter/2011/08/google-studying-re-ranking-search-results-using-1-button-data-but-its-touchy/"&gt;recent Wired article&lt;/a&gt;, it seems that this isn't yet the case, but that Google are still in the process of &lt;span style="font-style: italic;"&gt;considering &lt;/span&gt;using tihis nformation.&lt;br /&gt;&lt;br /&gt;A couple of problems I see:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;as Ryan Singel notes, it's easy enough for web site authors to "fraudulently" arrange +1 clicks on their own site, so some kind of filtering would presumably be required, and the degree of influence that +1 ratings had would need to be quite carefully balanced and monitored;&lt;/li&gt;&lt;li&gt;it may be that certain more "socially oriented" sites are more susceptible to the +1 or "Like" concept; just because a site is more focussed on social networking doesn't necessarily mean that its content is more "worthy" or relevant in response to a given search.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-507524663541764379?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/507524663541764379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=507524663541764379' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/507524663541764379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/507524663541764379'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/08/googles-use-of-1-button-for-search.html' title='Google&apos;s use of the +1 button for search ranking'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-451256106079425936</id><published>2011-08-10T13:06:00.004-05:00</published><updated>2011-08-10T13:21:49.326-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virus'/><category scheme='http://www.blogger.com/atom/ns#' term='phishing'/><category scheme='http://www.blogger.com/atom/ns#' term='trojan'/><category scheme='http://www.blogger.com/atom/ns#' term='Verified by visa'/><category scheme='http://www.blogger.com/atom/ns#' term='computer security'/><title type='text'>The problem of spotting scams</title><content type='html'>Ed Bott writes an interesting article on the subject of &lt;a href="http://www.zdnet.com/blog/bott/why-do-people-fall-for-trojans/3715"&gt;Why do people fall for trojans?&lt;/a&gt; As he explains, one of the problems is that the steps that one must go through to make even a legitimate purchase can often resemble the experience of a scam, including false alarms such as Windows warning us that our legitimately purchased item "might harm your computer".&lt;br /&gt;&lt;br /&gt;This is also one reason why I think schemes such as the "verified by Visa" scheme for credit card purchases, in addition to being senselessly irritating, are actually a bad security measure because they imitate during a legitimate procedure precisely a process that an attacked might exploit or which might be the warning sign of an attack. Or in other words, in both this case and the scarey dialogs that can appear in Windows while you are downloading and installing a legitimate program, we are actually risking that what should be warning signs actually become ignored due to being "dulled by familiarity".&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-451256106079425936?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/451256106079425936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=451256106079425936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/451256106079425936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/451256106079425936'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/08/problem-of-spotting-scams.html' title='The problem of spotting scams'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6495466660355895884</id><published>2011-08-07T15:27:00.003-05:00</published><updated>2011-08-07T15:38:30.853-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java patent'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle patent'/><category scheme='http://www.blogger.com/atom/ns#' term='Google vs Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>The Google files</title><content type='html'>The current milestone in the Google-Oracle debacle has been &lt;a href="http://www.appleinsider.com/articles/11/08/06/google_fighting_to_suppress_evidence_android_willfully_infringed_upon_oracles_java.html"&gt;reported this week to hing around two e-mails&lt;/a&gt;, one dating back to 2005 and the other a draft of an e-mail possibly constructed after Oracle's patent claim expressing a need to negotiate a licence for Java.&lt;br /&gt;&lt;br /&gt;Whilst the first of these e-mails discusses strategies for what to do "If Sun doesn't want to work with [Google]", if will be interesting to see how much this weight carries in light of the subsequent 2007 blog posting in which Sun's CEO apparently praises and supports Google for their use of Java technology in Android.&lt;br /&gt;&lt;br /&gt;The scond, apparently only a &lt;span style="font-style: italic;"&gt;draft &lt;/span&gt;of an e-mail, but slightly dammingly indicating "We conclude that we need to negotiate a license for Java under the terms we need." poses other interesting questions. How admissible as evidence is a draft of an e-mail reported to never have actually been sent? And if it is established that this draft was composed &lt;span style="font-style: italic;"&gt;after &lt;/span&gt;Oracle first raised its case (from the reports I've seen, the timing still does not appear clear), how damming is an e-mail saying "we need to negotiate a license" if it effectively in response to Oracle saying "You need a license".&lt;br /&gt;&lt;br /&gt;I'm not a lawyer, but it will be interesting to see how this plays out.&lt;br /&gt;&lt;br /&gt;I would still be interested to see a re-examination of the actual patents in question. As I've expressed before, my opinion of at least some of these is that they appear to essentially be fancy verbiage to describe procedures that are inherently obvious to an expert in the field, with little in the way of an actual invention.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6495466660355895884?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6495466660355895884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6495466660355895884' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6495466660355895884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6495466660355895884'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/08/google-files.html' title='The Google files'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-5752500518031015388</id><published>2011-08-06T10:01:00.002-05:00</published><updated>2011-08-06T10:09:08.908-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>"Lost Programming Skills"</title><content type='html'>All too familiar with that "corporate IT solution" consisting of various inefficient black boxes haphazardly glued together using a plethora of acronyms?&lt;br /&gt;&lt;br /&gt;This article entitled &lt;a href="http://www.itworld.com/print/190213"&gt;Lost Programming Skills&lt;/a&gt; looks at some of the once common knowledge which has not been passed on to generations of programmers. Interestingly, they highlight the inability to appreciate I/O issues (as much as, say, code optimisation).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-5752500518031015388?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/5752500518031015388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=5752500518031015388' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5752500518031015388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5752500518031015388'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/08/lost-programming-skills.html' title='&quot;Lost Programming Skills&quot;'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-2908928158286935952</id><published>2011-08-01T18:45:00.003-05:00</published><updated>2011-08-01T19:21:01.818-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hotspot bug'/><category scheme='http://www.blogger.com/atom/ns#' term='loop optimisation'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Java 7'/><title type='text'>Why Java 7's hotspot bug is a bad bug</title><content type='html'>I'm responding partly to &lt;a href="http://www.infoq.com/news/2011/08/java7-hotspot"&gt;Alex Blewitt's article&lt;/a&gt; in which he downplays the severity of the &lt;a href="http://www.javamex.com/java7/"&gt;Hotspot bug exhibited in Java 7&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;First of all, I think that in principle he may have a good point: previous Java releases have exhibited bugs which are arguably just as severe if not more so, there has been a temporary workaround, and they have been fixed and the world has carried on ticking. It's also true that any critical application upgrading to Java 7, as with any major upgrade of a key system component, would be mad not to have a regression plan should the proverbial shit hit the fan.&lt;br /&gt;&lt;br /&gt;Where I disagree with downplaying this bug is that I believe the problem is largely one of process rather than the substance of the actual bug:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;this is the first major release of Java since Oracle took over stewardship of the Java language: eyes were on them to see how they would handle it;&lt;/li&gt;&lt;li&gt;this is the first major release since the departure of various key ex-Sun employees;&lt;/li&gt;&lt;li&gt;the bug(s) in question were reported before the release and were exhibited by code present in the experimental stage in releases of Java 6 (or to paraphrase: "if the fix for that known serious-sounding bug wasn't tested properly, then what else wasn't tested properly?");&lt;/li&gt;&lt;li&gt;the precise circumstances under which the bug(s) exhibited themselves were not clearly published, let alone by Oracle;&lt;/li&gt;&lt;li&gt;without knowing the details, a vague birds-eye view of the problem (a "bug with JIT-compiling nested loops") sounds like a bug in a fundamental function of the JVM that you would ideally want to work reliably 100% of the time.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Alex Blewitt takes the view that: &lt;span style="font-style: italic;"&gt;"since Java 7 has only just been released it would be unlikely to be used in production environments yet"&lt;/span&gt;. I don't buy this view. If this is an alpha release, then call it an alpha release. But if your position is that you are making a "release", then that quite reasonably means "this is a version that has been through rigorous testing which I believe is suitable for use in production environments". Let's not flannel our way out of this: it was a cock-up.&lt;br /&gt;&lt;br /&gt;If I were using Oracle Database for any critical applications, I would certainly now be looking for some reassurance that they take the testing and release procedure of their database products more seriously than they do Java...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-2908928158286935952?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/2908928158286935952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=2908928158286935952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2908928158286935952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2908928158286935952'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/08/why-java-7s-hotspot-bug-is-bad-bug.html' title='Why Java 7&apos;s hotspot bug is a bad bug'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3602934326959824435</id><published>2011-07-29T09:41:00.002-05:00</published><updated>2011-07-29T10:06:26.814-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software patent'/><category scheme='http://www.blogger.com/atom/ns#' term='patent abuse'/><category scheme='http://www.blogger.com/atom/ns#' term='patent troll'/><title type='text'>Today's spurious software patent is...</title><content type='html'>Sadly, on any random day, we could probably pick a case like this. Today it appears to be Spotify's turn to face a lawsuit for "infringement" of a&lt;a href="http://1.usa.gov/qYyI2B"&gt; spurious patent that should never have been granted in the first place&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The abstract of the patent begins:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"In order to distribute music information from a central memory device (2)      via a communications network (4) to a terminal (6), this information is      organized in a digital music information object."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you can probably guess from this opening line, and sadly like so many other "software" patents, the rest is pure flannel: a very broad overview of the blindingly obvious steps that one would take in designing an application, but without having actually invented any non-obvious implementational details. Pretty much every line of the patent leaves you coming away thinking "Sure, that's obviously true, but what's your actual invention?". It's another example of how the patent system urgently needs to be reformed with at least:&lt;br /&gt;&lt;br /&gt;- patent examination which goes beyond the intelligence of a chimpanzee on hallucinogenics (or as a next best thing, to paraphrase Donald Knuth slightly: if you would expect a 1st year software engineering student to be able to solve a problem as a homework assignment, you shouldn't be able to patent the solution as an "invention");&lt;br /&gt;- severe punishment for companies that attempt to file spurious patents;&lt;br /&gt;- more severe punishment for false claims of infringement (such measures do already exist to discourage large companies from bullying small developers, but they clearly don't go far enough).&lt;br /&gt;&lt;br /&gt;There's also an interesting article in this week's Pod Delusion on the subject of &lt;a href="http://poddelusion.co.uk/blog/2011/07/29/episode-95-29th-july-2011/"&gt;patent trolls&lt;/a&gt;, looking at another recent case of patent abuse (Lodsys-Apple).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3602934326959824435?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3602934326959824435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3602934326959824435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3602934326959824435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3602934326959824435'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/07/todays-spurious-software-patent-is.html' title='Today&apos;s spurious software patent is...'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6587236865597367343</id><published>2011-07-28T23:32:00.003-05:00</published><updated>2011-07-28T23:42:26.655-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='corpus linguistics'/><category scheme='http://www.blogger.com/atom/ns#' term='ngram'/><title type='text'>There's no hiding from ngram analysis</title><content type='html'>It's not often that a corpus linguistics paper makes it to Slashdot. A notable exception today came in the form of Burger et al's paper on &lt;a href="http://www.mitre.org/work/tech_papers/2011/11_0170/11_0170.pdf"&gt;Discriminating Gender on Twitter&lt;/a&gt;. Using surprisingly simple techniques, they present data suggesting that a machine algorithm can determine a tweeter's gender more reliably than human judges.&lt;br /&gt;&lt;br /&gt;As far as I can see, their measure of reliability is of the % of correctly attributed tweets over the data set as a whole. It would be interesting to see more analysis on the nature of tweets that the system can't judge reliably vs human judges (and vice versa). To what extent do typical tweets fall into polarised categories of "readily categorisable" vs "highly ambiguous", or is there more gradience? And it will be interesting to see what other demographic data can be gleaned using similar techniques.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6587236865597367343?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6587236865597367343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6587236865597367343' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6587236865597367343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6587236865597367343'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/07/theres-no-hiding-from-ngram-analysis.html' title='There&apos;s no hiding from ngram analysis'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-9094233176506483957</id><published>2011-07-26T13:09:00.002-05:00</published><updated>2011-07-26T13:15:21.542-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='estoppel'/><category scheme='http://www.blogger.com/atom/ns#' term='Google vs Oracle'/><title type='text'>Estoppel</title><content type='html'>Following on from my post yesterday about how a statement in &lt;a href="http://javamex.blogspot.com/2011/07/will-schwartz-blog-post-finally-persude.html"&gt;Jonathan Schwartz's blog post indicated that Sun approved Google's use of Java in Android&lt;/a&gt;, I should perhaps have pointed out-- as others reporting on this have-- that there is indeed a judicial basis for Schwartz's statement being used in Google's defense. The principle is &lt;span style="font-weight: bold;"&gt;estoppel&lt;/span&gt;, defined by Black's Law Dictionary as:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"An affirmative defense alleging good-faith reliance on a misleading representation and an injury or detrimental change in position resulting from that reliance."&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-9094233176506483957?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/9094233176506483957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=9094233176506483957' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9094233176506483957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9094233176506483957'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/07/estoppel.html' title='Estoppel'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-1012783025253905413</id><published>2011-07-25T11:19:00.009-05:00</published><updated>2011-07-25T12:36:04.811-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software patent'/><category scheme='http://www.blogger.com/atom/ns#' term='Google vs Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Will Jonathan Schwartz's blog post finally persuade Oracle to pick its toys up and put them back in the pram?</title><content type='html'>In case you've missed all the commotion, or just found it a little bit dull, I remind you that in August 2010, Oracle filed suit against Google, claiming that their Android operating system violates various patents held by Oracle after they acquired Sun Microsystems.&lt;br /&gt;&lt;br /&gt;The extent of damages that they can actually claim for appears to be in some doubt. After an initial claim of several billion dollars, and a judge effectively ruling "&lt;a href="http://www.eweek.com/c/a/Linux-and-Open-Source/Oracle-Must-Curb-Android-Damages-Claim-Vs-Google-302741/"&gt;don't be so silly&lt;/a&gt;" last week, the claim may be reduced to as "little" as 100 million dollars. If I had 100 million dollars, I wouldn't be sitting round writing silly blog posts. But to Google, that's petty cash.&lt;br /&gt;&lt;br /&gt;Now, to naive bystanding programmers such as myself who are not lawyers, a few things always seemed a little bit odd about this case:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;would a company the size of Google with the legal resources it can afford really just go ahead and commit billions of dollars worth of patent infringement and hope that "nobody would notice"?&lt;/li&gt;&lt;li&gt;if there was a big problem with Android's use of Java technology, why didn't Sun raise this at the time?&lt;/li&gt;&lt;li&gt;some of the patents in question really boil down to some quite small, specific points of implementation (e.g. specific details of implementation of protection domains, the "pre-processing and packaging of class files", and some implementational details of the virtual machine), many of which could probably be worked around by using alternative implementations or (and hence) a reasonable licence fee negotiated with Sun if need be.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Or put another way, the whole case smells of somebody scratting around through their recently acquired arsenal of patents looking for an excuse to sue. Rather than learning to play happily with all the other children in the classroom, Oracle seems intent on shouting "But Miss, the red crayons are mine!".&lt;br /&gt;&lt;br /&gt;Meanwhile, commentators had noticed the curious deletion of blog posts of previous Sun CEO Jonathan Schwartz. Unfortunately, such Orwellian attempts to rewrite history don't tend to work on the Internet. Thanks to nothing more sophisticated than a search in The Way Back Machine, a key &lt;a href="http://www.groklaw.net/article.php?story=20110723095928839"&gt;post from "Jonathan's Blog" has been restored to its former glory&lt;/a&gt;. And in this post, Schwartz states: &lt;span style="font-weight: bold;"&gt;"I just wanted to add my voice to the chorus of others from Sun in offering my heartfelt congratulations to Google on the ennouncement of their new Java/Linux phone platform, Android"&lt;/span&gt;. As commentator Steven Vaughan-Nichols has also pointed out, this doesn't exactly sound like Sun were saying "We disapprove of Android because it violates our patents and will be suing Google for billions of dollars".&lt;br /&gt;&lt;br /&gt;It will be interesting to see if this evidence can persuade the two parties to finally bang their heads together and get on with more interesting things. Like it or lump it, Android is a key market for Java technology, with Android accounting for a &lt;a href="http://news.cnet.com/8301-13924_3-20082707-64/did-the-ipad-really-lose-a-big-chunk-of-share-to-android/"&gt;30% share of tablet shipments&lt;/a&gt; in April-June 2011, for example. I can't help feeling that it would be more conducive to the platform's development for Oracle and Google to have a more sensible working relationship.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-1012783025253905413?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/1012783025253905413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=1012783025253905413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1012783025253905413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1012783025253905413'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/07/will-schwartz-blog-post-finally-persude.html' title='Will Jonathan Schwartz&apos;s blog post finally persuade Oracle to pick its toys up and put them back in the pram?'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6848850036998484385</id><published>2011-07-24T21:24:00.002-05:00</published><updated>2011-07-24T21:29:38.459-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='antivirus'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google's malware warning</title><content type='html'>Google have given more details of the &lt;a href="http://googleonlinesecurity.blogspot.com/2011/07/using-data-to-protect-people-from.html"&gt;malware warning&lt;/a&gt; that they will be issuing at the top of their search engine. They have been able to identify around 2,000,000 infected machines on the basis of traffic sent to their servers.&lt;br /&gt;&lt;br /&gt;A couple of things strike me about this:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I wonder how applicable this technique could be to other servers in general? Could we see other sites performing a similar civic duty of warning users about potential malware.&lt;/li&gt;&lt;li&gt;Given that one route of infection (which Google blames specifically as the culprit in this case) are those fake "Your computer has been infected" popups already littering the Internet, how do we give out a message to users that these popups should generally be ignored because they're likely to be fake, whilst at the same time issuing genuine warnings in an ostensibly similar manner?&lt;/li&gt;&lt;/ul&gt;I'm interested to hear your thoughts either here, or by tweeting to BitterCoffey.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6848850036998484385?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6848850036998484385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6848850036998484385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6848850036998484385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6848850036998484385'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/07/googles-malware-warning.html' title='Google&apos;s malware warning'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3980494315986048083</id><published>2011-07-22T05:35:00.004-05:00</published><updated>2011-07-22T05:52:40.444-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='synchronization'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><category scheme='http://www.blogger.com/atom/ns#' term='iPad'/><category scheme='http://www.blogger.com/atom/ns#' term='time zone'/><category scheme='http://www.blogger.com/atom/ns#' term='calendar'/><category scheme='http://www.blogger.com/atom/ns#' term='user interface'/><title type='text'>Dear universe: please make your default settings sensible</title><content type='html'>I'd occasionally noticed that alerts for my calendar events would sometimes go off at odd times on my iPad. For example, I'd wake up in the morning to find that the "5 minute" alert for a mid-morning meeting had already gone off. I suppose the first couple of times, I just assumed I must have entered something wrong when setting up the event. But, being the aspiring cross between Columbo and Paddington Bear that I am, gradually my suspicions were aroused.&lt;br /&gt;&lt;br /&gt;Luckily, some other people more patient than I am with spuriously designed user interfaces were able to come to the rescue. In case you haven't found it, the offending setting is an option burried in the "Mail, Contacts, Calendars" section of your iPhone/iPad settings curiously entitled "Time Zone Support". With this set to a particular Time Zone (rathr than simply being switched off), then your device will &lt;span style="font-style: italic;"&gt;not&lt;/span&gt; adjust calendar events to match your current time zone.&lt;br /&gt;&lt;br /&gt;So you might be thinking "hey, what's your beef, this is a great feature to have, no?". Well, yes, it's a great optional feature. But the things that strike me are:&lt;br /&gt;&lt;br /&gt;(a) to say that the iPhone/iPad are supposed to be the holy grail of PDAs (aren't they?), it doesn't seem like a terribly fine-grained feature, particular as there is a "Location" field in calendar events, and that thanks to the miracles of GPS, the device knows where you are at any given moment (or at least, knows where you are to within an approximation of a couple of skyscrapers/underground bunkers-- usually good enough to tell what time zone you're in);&lt;br /&gt;(b) why give this option a silly, non-intuitive name and then turn it on by default? why by default would I tend to want events not to be in synch with where I am at the moment, given that the whole &lt;span style="font-style: italic;"&gt;raison d'être&lt;/span&gt; of these devices is for travelling...?&lt;br /&gt;&lt;br /&gt;Well, I'm sort of happy now I've discovered the option. But on the other hand, grrrrrr.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3980494315986048083?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3980494315986048083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3980494315986048083' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3980494315986048083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3980494315986048083'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/07/dear-universe-please-make-your-default.html' title='Dear universe: please make your default settings sensible'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3736587705308639966</id><published>2011-07-21T14:18:00.004-05:00</published><updated>2011-07-21T14:33:36.538-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='China'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><category scheme='http://www.blogger.com/atom/ns#' term='fake'/><category scheme='http://www.blogger.com/atom/ns#' term='counterfeiting'/><category scheme='http://www.blogger.com/atom/ns#' term='rip-off'/><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><title type='text'>Rip-off for rip-off's sake</title><content type='html'>In response to crackpot loon conspiracy theories that instead of landing on the moon in 1969, Nasa played a hoax that has then been kept under wraps for the past 40 odd years, my argument has always been that rather than stage and hide such an elaborate hoax, it's probably easier just to go to the moon. (The other main evidence for the falsity of the moon landing hoax being that Fox TV made a documentary about it...)&lt;br /&gt;&lt;br /&gt;Well, my grip on reality may have been overturned today by reports and pictures of &lt;a href="http://birdabroad.wordpress.com/"&gt;fake Apple stores&lt;/a&gt; in China. Somebody who can actually be bothered to go to these lengths of counterfeiting and then sustain the momentum of preventing the relevant authorities from finding out must be doing it out of some bizarre sense of national pride. I'm really not convinced it isn't easier to just franchise a genuine Apple store...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3736587705308639966?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3736587705308639966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3736587705308639966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3736587705308639966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3736587705308639966'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/07/rip-off-for-rip-offs-sake.html' title='Rip-off for rip-off&apos;s sake'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-33552735274234665</id><published>2011-07-21T12:45:00.003-05:00</published><updated>2011-07-21T12:52:03.703-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='TED'/><category scheme='http://www.blogger.com/atom/ns#' term='finance'/><category scheme='http://www.blogger.com/atom/ns#' term='computing'/><title type='text'>On the dangers of our reliance on opaque algorithms</title><content type='html'>Kevin Slavin offers an illuminating TED presentation on the implications of our reliance on computer &lt;a href="http://www.ted.com/index.php/talks/kevin_slavin_how_algorithms_shape_our_world.html"&gt;algorithms&lt;/a&gt; whose complexity has reached the point of being opaque to human understanding.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-33552735274234665?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/33552735274234665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=33552735274234665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/33552735274234665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/33552735274234665'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/07/on-dangers-of-our-reliance-on-opaque.html' title='On the dangers of our reliance on opaque algorithms'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-5333940927192670368</id><published>2011-07-02T22:01:00.004-05:00</published><updated>2011-07-03T10:20:20.243-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Big Brother Camera Security'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><category scheme='http://www.blogger.com/atom/ns#' term='App Store'/><title type='text'>The fine lines of iPhone app rules</title><content type='html'>"It's not whether there is anything wrong. It's whether or not there appears to be."&lt;br /&gt;&lt;br /&gt;It appears that app developer Daniel Amitay has been finding out recently about the finely shaded grey areas of Apple's rules on what you can and can't do from an iPhone app.&lt;br /&gt;&lt;br /&gt;One of Daniel's apps, &lt;span style="font-style: italic;"&gt;Big Brother Camera Security&lt;/span&gt;, is designed to mimic the iPhone passcode screen and then photograph any user making an incorrect attempt to enter the passcode. He also decided to collect statistics on the most common passcodes chosen by users by having the app anonymously send those passcodes. Apple have since removed the app from the App Store.&lt;br /&gt;&lt;br /&gt;Daniel &lt;a href="http://amitay.us/blog/files/big_brother_removed_from_app_store.php"&gt;argues on his blog&lt;/a&gt; that this data collection was legitimate, as the purpose was to warn users against choosing frequently chosen passcodes in a future update to the app, and the the App Store EULA informs users that apps may collect diagnostic data. Apple, on the other hand, appear to be arguing that application was "surreptitiously harvesting user paasswords".&lt;br /&gt;&lt;br /&gt;It seems that whether that is strictly the case depends at least on one's interpretation of what "harvesting" constitutes, and how one defines the nature of the separation between the app's lock code and the actual iPhone passcode, given that the app is designed to simulate the iPhone lockup screen. A potentially complicating factor is that the data has also been used as the basis for a (somewhat interesting) &lt;a href="http://amitay.us/blog/files/most_common_iphone_passcodes.php"&gt;article&lt;/a&gt; that Daniel has published giving an overview of the statistics obtained for the most common passcodes and most common digits in different positions. Publishing this article, though of interest to the security community, may be deemed to make the data something other than for diagnostic purposes of "facilitat[ing] the provision of software updates, product support and other services [...] related to the Licensed Application" as set out in the &lt;a href="http://www.apple.com/legal/itunes/appstore/dev/stdeula/"&gt;App Store EULA&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Some interesting questions to consider:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;if secure hashes of the passcodes, rather than the actual passcodes, had been sent, would that have constituted "harvesting"? (Even though with only 1000 possibilities, the actual codes could of course be resolved from the hashes.)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;which &lt;span style="font-style: italic;"&gt;precise &lt;/span&gt;conditions would need to be changed to allow Apple to approve the app? (Is it ultimately the data itself or the surreptitiousness that is the problem? or the publishing of the data in an article not strictly necessary to updating and supporting the app?)&lt;/li&gt;&lt;/ul&gt;It will be ineteresting to see how this case evolves over the coming days/weeks and whether Daniel is ultimately successful in getting the app reinstated, and what changes are necessary for this to happen.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-5333940927192670368?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/5333940927192670368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=5333940927192670368' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5333940927192670368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5333940927192670368'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/07/fine-lines-of-iphone-app-rules.html' title='The fine lines of iPhone app rules'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-2162842756336967341</id><published>2011-06-21T07:02:00.004-05:00</published><updated>2011-06-21T07:14:26.699-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CAPTCHA'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Have CAPTCHAs gone slightly too far...?</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-hyybdLfR0Ms/TgCImshNQfI/AAAAAAAAADI/NyF1-DiTiY0/s1600/RidiculousCaptcha.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 165px;" src="http://2.bp.blogspot.com/-hyybdLfR0Ms/TgCImshNQfI/AAAAAAAAADI/NyF1-DiTiY0/s320/RidiculousCaptcha.JPG" alt="" id="BLOGGER_PHOTO_ID_5620642533325226482" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I like a bit of security just like the next man. But I wonder if this piece of "security" is going slightly too far. It appears that in order to make a posting on Facebook, we are now required to fill in a CAPTCHA consisting of words in &lt;span style="font-style: italic;"&gt;two different alphabets&lt;/span&gt;...?&lt;br /&gt;&lt;br /&gt;Now, I was trying to decide if this was some kind of perverse general knowledge test, or the latest CIA "initiative" to track down terrorists. Mention the wrong keyword and show an ability to type Arabic, and you're suddenly on the list of America's most wanted...?&lt;br /&gt;&lt;br /&gt;(Oh, and even if I could have read Arabic, I would have still got stuck with the mysterious blob on the left. Answers to that one a postcard...)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-2162842756336967341?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/2162842756336967341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=2162842756336967341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2162842756336967341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2162842756336967341'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/06/have-captchas-gone-slightly-too-far.html' title='Have CAPTCHAs gone slightly too far...?'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-hyybdLfR0Ms/TgCImshNQfI/AAAAAAAAADI/NyF1-DiTiY0/s72-c/RidiculousCaptcha.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-1962247772970086040</id><published>2011-06-16T23:55:00.005-05:00</published><updated>2011-06-17T00:11:20.176-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='copyright'/><title type='text'>Why lawmakers' ignorance matters</title><content type='html'>The other day I blogged on the apparent ignorance shown towards what is now basic technology infrastructure by members of a committee hearing in the current UK libel law reform case.&lt;br /&gt;&lt;br /&gt;It appears that our lawmakers, possibly with similar knowledge of Internet infrastructure to those on the libel reform committee, have now allowed us to reach a stage where putting a link on a web site is an &lt;a href="http://www.metro.co.uk/news/866363-extradition-bid-over-film-row-student-is-madness-says-mum"&gt;extraditable offence&lt;/a&gt;. I'm just going by what I've read in the media and cannot confirm any of the details. And the aforementioned article doesn't appear to mention What Law Has Actually Been Broken. But if true, I am slightly curious as to why the focus of the Powers That Be is on removing sites &lt;span style="font-style: italic;"&gt;linking &lt;/span&gt;to the offending material rather than just removing that material from the sites hosting it. If I put a note on my web site saying "There's illegal stuff on the Internet and if you do a Google search for it you might find it", is that also illegal...?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-1962247772970086040?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/1962247772970086040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=1962247772970086040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1962247772970086040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1962247772970086040'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/06/why-lawmakers-ignorance-matters.html' title='Why lawmakers&apos; ignorance matters'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-8004401757599577915</id><published>2011-06-14T14:49:00.008-05:00</published><updated>2011-06-14T16:41:00.529-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><category scheme='http://www.blogger.com/atom/ns#' term='libel reform'/><category scheme='http://www.blogger.com/atom/ns#' term='blogging'/><title type='text'>The lawmaking process and technology</title><content type='html'>A process is currently underway in the UK to reform the libel law. Before people outside the UK click their "back" button thniking this is just a piece of local trivia, I'd like to suggest that the procedure highlights some more general symptoms of how the Internet may be understood (or not) by those involved in the lawmaking process which are probably applicable in many countries.&lt;br /&gt;&lt;br /&gt;In this session, various members of the science community who have in one way or another been on the receiving end of libel cases (notably Simon Singh and Ben Goldacre for their attempts to alert the public to instances of bogus medicine) &lt;a href="http://www.badscience.net/2011/06/nerds-at-the-parliamentary-committee-on-the-draft-defamation-bill/"&gt;give their opinion&lt;/a&gt; on changes that they believe should be included in the reform. Very telling are several instances where they appear to be educating the panel on some basic concepts about the Internet, blogs and ISPs. Some key points to look out for:&lt;br /&gt;&lt;br /&gt;- at 17'50, where Simon Singh is practically describing what the Internet is&lt;br /&gt;- at 18'10, where Ben Goldacre is pretty much explaining what a blog is, and making some very fundamental statements about how basic and prevalent they are to the Internet&lt;br /&gt;- at 18'27, where it is asked what the witnesses think of a "Prior system whereby a claimant could write to a web host ... and the web host would be under the obligation to put up a notice alongside the story", and Ben is forced to explain some extremely basic information about the relationship between ISPs and their clients.&lt;br /&gt;&lt;br /&gt;Now on the one hand, I should emphasise that I don't begrudge this level of transparency in a world where not all citizens are so fortunate in seeing their lawmaking process in action. On the other hand... I worry about how this demonstration of an apparent oblivion to basic technology and "social infrastructure" is going to be translated into a new law that truly fulfils the wishes of those calling for reform.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-8004401757599577915?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/8004401757599577915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=8004401757599577915' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8004401757599577915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8004401757599577915'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/06/lawmaking-process-and-technology.html' title='The lawmaking process and technology'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-2509602688302946075</id><published>2011-06-14T09:35:00.004-05:00</published><updated>2011-06-14T09:51:16.840-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='polynomial'/><category scheme='http://www.blogger.com/atom/ns#' term='banking'/><category scheme='http://www.blogger.com/atom/ns#' term='difference engine'/><category scheme='http://www.blogger.com/atom/ns#' term='bank transfer'/><title type='text'>Making the difference with lego</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-kw6io-ZPrlg/TfdzlNBnb0I/AAAAAAAAADA/CjDKbDwMN5Y/s1600/DifferenceEngine.jpg"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 233px; height: 179px;" src="http://1.bp.blogspot.com/-kw6io-ZPrlg/TfdzlNBnb0I/AAAAAAAAADA/CjDKbDwMN5Y/s320/DifferenceEngine.jpg" alt="" id="BLOGGER_PHOTO_ID_5618086143156776770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;There are various methods for evaluating a polynomial. But perhaps one that may not have occurred to you is to &lt;a href="http://www.wired.com/magazine/2011/05/st_legos_computer/?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+wired%2Findex+%28Wired%3A+Index+3+%28Top+Stories+2%29%29&amp;amp;utm_content=Google+Feedfetcher"&gt;build a difference engine out of lego&lt;/a&gt;. According to this story in Wired, that's the approach that Andrew Carol decided to take.&lt;br /&gt;&lt;br /&gt;Whether further lego difference engines will be built is not yet clear. A difference engine is currently &lt;a href="http://www.stuffexplained.org/banking-charges/"&gt;used in the banking sector&lt;/a&gt; as part of the processing of international transfers as, despite adding several days on to the time taken for transfers to complete in some cases, difference engines are deemed to be more reliable than conventional microprocessors. However, banking officials openly admit that the decision to use a solid gold difference engine has prohibited rolling out similar machines across Europe to speed up transactions. Now that this cheaper, lego version is available, industry leaders may be looking to see whether it has the reliability required to allow the rolling out of these cheaper machines and hence enable banks to speed up the processing of international transfers. However, it is unlikely that a decision will be reached before 2012. For the time being, those of us transferring money between accounts in different countries will have to continue to wait up to 5 days for transfers to complete.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-2509602688302946075?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/2509602688302946075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=2509602688302946075' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2509602688302946075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2509602688302946075'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/06/making-difference-with-lego.html' title='Making the difference with lego'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-kw6io-ZPrlg/TfdzlNBnb0I/AAAAAAAAADA/CjDKbDwMN5Y/s72-c/DifferenceEngine.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-133318138315333480</id><published>2011-05-23T07:46:00.002-05:00</published><updated>2011-05-23T08:00:11.948-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iTunes'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='antivirus'/><category scheme='http://www.blogger.com/atom/ns#' term='user interface'/><title type='text'>Irritation, irritation, irritation...</title><content type='html'>Over 1,000 users of the Javamex have responded to the site's survey in which they were asked to vote for their most irritating software. It seems that the topic has struck a nerve...&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have a put up an initial &lt;a href="http://www.javamex.com/irritating-software/"&gt;hit parade of irritating software&lt;/a&gt; based on the first 100 repsonses (a more in-depth analysis of all results to be published shortly).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In first place, perhaps unsurprisingly, are antivirus programs. I've used practically every major antivirus program on the market, and have found every single one to be completely infuriating. Whether it's popping up irritating paranoic messages every few milliseconds, making it difficult to access certain web sites properly or slowing down your eight-core CPU to the speed of a ZX Spectrum on tranquilizers, every single antivirus product appears to be designed to make you want to throw your PC off a very high balcony.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I was somewhat reassured to find iTunes in second place. Especially under Windows, I have also personally found it to be one of the most buggy and infuriating pieces of software ever written. But whether it's freezing every five seconds, launching into a lengthy "sync" process just because I accidentally wanted to upload an extra song or thinking at random intervals that my iPhone has mysteriously transformed into a new one never seen before in the history of humanity, I now feel less alone in the universe knowing that other users share my view.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-133318138315333480?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/133318138315333480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=133318138315333480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/133318138315333480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/133318138315333480'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/05/irritation-irritation-irritation.html' title='Irritation, irritation, irritation...'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-381156635602065937</id><published>2011-03-10T10:16:00.002-06:00</published><updated>2011-03-10T10:20:18.304-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java programming'/><title type='text'>Suggestions for new programming articles</title><content type='html'>The Javamex site is open to suggestions! Please make a&lt;a href="http://www.javamex.com/"&gt; suggestion for a new programming topic&lt;/a&gt; at the top of the home page!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-381156635602065937?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/381156635602065937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=381156635602065937' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/381156635602065937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/381156635602065937'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/03/suggestions-for-new-programming.html' title='Suggestions for new programming articles'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-5342965993781141722</id><published>2011-03-04T11:28:00.004-06:00</published><updated>2011-03-04T11:31:04.831-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='currency exchange'/><category scheme='http://www.blogger.com/atom/ns#' term='finance'/><title type='text'>Update to Currency Quoter utility</title><content type='html'>The latest update to the &lt;a href="http://www.javamex.com/software/currency_quoter/"&gt;Currency Quoter&lt;/a&gt; utility available on this site, version 0.04a, fixes an issue which prevented currency data from being downloaded under some circumstances. It also introduces a parameter allowing you to control the number of months' worth of data that are taken in producing the forecast value of a given currency exchange. You can currently configure this between 1 and 12 months. The default is 3 months, which appears to be suitable in most cases. However, you may wish to take a greater period, for example when looking at a longer-range forecats of the value of a currency that has had a particular trend over a longer time.&lt;br /&gt;&lt;br /&gt;Please report any issues with this program bugs@javamex.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-5342965993781141722?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/5342965993781141722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=5342965993781141722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5342965993781141722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5342965993781141722'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/03/update-to-currency-quoter-utility.html' title='Update to Currency Quoter utility'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-8915873575282132999</id><published>2011-02-17T20:36:00.003-06:00</published><updated>2011-02-17T20:42:21.742-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='final'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Additional information on the 'final' keyword</title><content type='html'>The section on the &lt;a href="http://www.javamex.com/tutorials/java_final.shtml"&gt;Java final keyword&lt;/a&gt; has been expanded. Previously, we concentrated on the use of &lt;a href="http://www.javamex.com/tutorials/synchronization_final.shtml"&gt;'final' for thread-safety&lt;/a&gt; but did not give much information about a separate use of 'final' to indicate that a class or method cannot be overridden. The new material expands upon this use with a look at the &lt;a href="http://www.javamex.com/tutorials/java_final_performance.shtml"&gt;performance implications of the 'final' keyword&lt;/a&gt; as a class or method modifier.&lt;br /&gt;&lt;br /&gt;A common view that I have both heard among colleagues and seen in various Java textbooks is that 'final' is as much a performance hint to the compiler as a specification of design. In the new section, I present some data showing that this view is probably misguided: the &lt;a href="http://www.javamex.com/tutorials/java_final_performance_vs_non_final_timings.shtml"&gt;timing of calls to methods to final vs non-final classes&lt;/a&gt; comes down to whether the JIT compiler can determine at runtime the precise subclass of an object rather than whether or not the class in question is or may be overridden.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-8915873575282132999?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/8915873575282132999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=8915873575282132999' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8915873575282132999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8915873575282132999'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/02/additional-information-on-final-keyword.html' title='Additional information on the &apos;final&apos; keyword'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3119668063104669596</id><published>2011-02-16T16:06:00.003-06:00</published><updated>2011-02-16T16:10:38.564-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='currency exchange'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><title type='text'>Initial release of "Currency Quoter" utility</title><content type='html'>A very initial release of a currency conversion tool is available from the Javamex site. The &lt;a href="http://www.javamex.com/software/currency_quoter/"&gt;Currency Quoter&lt;/a&gt; utility allows you to exchange between various currencies using exchange rate data reported by the IMF, and also allows you to forecast the likely range of values that a particular exchange will have on future dates.&lt;br /&gt;&lt;br /&gt;For news and updates, you may also wish to subscribe to the &lt;a href="http://freshmeat.net/projects/currency-quoter"&gt;Currency Quoter project page&lt;/a&gt; on Freshmeat. You can report bugs at bugs@javamex.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3119668063104669596?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3119668063104669596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3119668063104669596' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3119668063104669596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3119668063104669596'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/02/initial-release-of-currency-quoter.html' title='Initial release of &quot;Currency Quoter&quot; utility'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6842206697221089926</id><published>2011-02-16T15:59:00.002-06:00</published><updated>2011-02-16T16:04:42.304-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='math'/><title type='text'>New material: doing maths in Java</title><content type='html'>The section on&lt;a href="http://www.javamex.com/tutorials/math/"&gt; mathematical operations in Java&lt;/a&gt; has been expanded over the last few days to include some new material that will be useful to those writing maths-related applications in Java. Notable inclusions include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The section on the &lt;a href="http://www.javamex.com/tutorials/math/java_util_math.shtml"&gt;performance of java.util.Math&lt;/a&gt; methods has been expanded somewhat to include more information about the timing and implementation of certain operations.&lt;/li&gt;&lt;li&gt;A new section on &lt;a href="http://www.javamex.com/tutorials/math/BigDecimal_BigInteger.shtml"&gt;BigDecimal and BigInteger&lt;/a&gt; looks at how to manipulate arbitrarily large numbers (or numbers of arbitrary precision) in Java. We include an analysis of the &lt;a href="http://www.javamex.com/tutorials/math/BigDecimal_BigInteger_performance_multiply.shtml"&gt;performance of multiplication&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;As usual, suggestions for improvements to this section or suggestions for new material are always welcome, either on this blog or on the &lt;a href="http://javamex.ning.com/"&gt;Javamex forum&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6842206697221089926?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6842206697221089926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6842206697221089926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6842206697221089926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6842206697221089926'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/02/new-material-doing-maths-in-java.html' title='New material: doing maths in Java'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6198080918976122544</id><published>2011-02-04T08:49:00.002-06:00</published><updated>2011-02-04T09:03:44.176-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTTP'/><category scheme='http://www.blogger.com/atom/ns#' term='web security'/><title type='text'></title><content type='html'>I thought this was interesting, although the actual security impact is hard to assess. Various sites "leak" information not through the payload returned by a particular HTTP request, but simply by the response code. Thus, as &lt;a href="https://grepular.com/Abusing_HTTP_Status_Codes_to_Expose_Private_Information"&gt;this article&lt;/a&gt; illustrates, we can find out, for example, whether a user is logged on to sites like Facebook as follows:&lt;br /&gt;&lt;br /&gt;- find a particular page that responds with an error code or not depending on whether or not the user is logged on;&lt;br /&gt;- using a "script" tag, ask the browser to load that page as though it were a script;&lt;br /&gt;- in the onload() and onerror() handlers, take action that assumes the user is logged on in the first place and not in the second.&lt;br /&gt;&lt;br /&gt;The fact that a user is logged into, say, Facebook or GMail probably isn't a very exciting discovery: half the Internet population probably are at any given moment. But more controversial sites may want to think about what kind of information they accidentally leak in this way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6198080918976122544?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6198080918976122544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6198080918976122544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6198080918976122544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6198080918976122544'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/02/i-thought-this-was-interesting-although.html' title=''/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-5579113956181114285</id><published>2011-01-15T20:30:00.002-06:00</published><updated>2011-01-15T20:38:54.615-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hash table'/><category scheme='http://www.blogger.com/atom/ns#' term='64-bit hash function'/><category scheme='http://www.blogger.com/atom/ns#' term='Bloom filter'/><title type='text'>New articles in the 'Java collections' section</title><content type='html'>Readers are invited to explore some new material that has been added to the &lt;a href="http://www.javamex.com/tutorials/collections/"&gt;Java collections&lt;/a&gt; section of the web site. By rights, this material would probably belong in a "Java algorithms" section, as they don't use the collections framework as such, but rather look at structures closely related to those used in the standard collections classes.&lt;br /&gt;&lt;br /&gt;In the section on &lt;a href="http://www.javamex.com/tutorials/collections/hash_codes_advanced.shtml"&gt;Advanced use of hash codes&lt;/a&gt;, some new material firstly looks at how we can implement a &lt;a href="http://www.javamex.com/tutorials/collections/strong_hash_code.shtml"&gt;strong, 64-bit hash code&lt;/a&gt; in Java, and how we can use this to create a &lt;a href="http://www.javamex.com/tutorials/collections/64_bit_hash_map_implementation.shtml"&gt;Java hash map implementation&lt;/a&gt; that saves memory by storing only the keys.&lt;br /&gt;&lt;br /&gt;A further section on &lt;a href="http://www.javamex.com/tutorials/collections/bloom_filter.shtml"&gt;Bloom filters&lt;/a&gt; builds on this strong hash function further, allowing a set of objects to be represented very compactly in memory in return for a certain "false positive rate". This tradeoff is useful in certain situations where we want to "weed out" certain items that require further, resource-intensive processing from those that don't (for example, when wanting to reduce database hits), but where it doesn't matter too much if a small percentage of items "slip through the net". We look more closely at how the initialisation parameters of the Bloom filter can be configured to tune the &lt;a href="http://www.javamex.com/tutorials/collections/bloom_filter_false_positives.shtml"&gt;false positive rate&lt;/a&gt; in return for more or less memory space being required.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-5579113956181114285?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/5579113956181114285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=5579113956181114285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5579113956181114285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5579113956181114285'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2011/01/new-articles-in-java-collections.html' title='New articles in the &apos;Java collections&apos; section'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6646402779823698873</id><published>2010-12-27T12:19:00.002-06:00</published><updated>2010-12-27T12:21:08.232-06:00</updated><title type='text'>Javamex moved to a new server</title><content type='html'>The Javamex web site has been moved to a new server. Hopefully the move was fairly transparent to readers, but I of course welcome any feedback in case of any gremlins you may spot...!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6646402779823698873?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6646402779823698873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6646402779823698873' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6646402779823698873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6646402779823698873'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2010/12/javamex-moved-to-new-server.html' title='Javamex moved to a new server'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6669208766169243837</id><published>2010-11-28T10:18:00.003-06:00</published><updated>2010-11-28T10:21:31.359-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPad'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>iPad for programmers: new section and survey</title><content type='html'>In preparation for a new section of the site dedicated to &lt;a href="http://www.javamex.com/ipad/"&gt;programming tools for iPad users&lt;/a&gt;, the site contains a survey to find out which tools people are currently using. If you have a few seconds to spare, you are invited to &lt;a href="http://www.javamex.com/ipad/"&gt;fill in this very quick survey&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;What kind of tools are we interested in? Well, essentially any iPad app that you consider to be "programming-related" in some way: for example, code editors, tools to run scripts, calculators that ease with programming-related tasks etc. Even general tools such as VNC clients are also welcome if you use them for programming-related tasks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6669208766169243837?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6669208766169243837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6669208766169243837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6669208766169243837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6669208766169243837'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2010/11/ipad-for-programmers-new-section-and.html' title='iPad for programmers: new section and survey'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-7348250710039492090</id><published>2010-08-26T13:30:00.002-05:00</published><updated>2010-08-26T13:32:45.267-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java programming'/><category scheme='http://www.blogger.com/atom/ns#' term='survey'/><title type='text'>Javamex survey</title><content type='html'>Readers are invited to take 5 minutes out to answer the site's &lt;a href="http://www.surveymonkey.com/s/ZQ8RK9F"&gt;Java programmer survey&lt;/a&gt;. The survey asks you your opinion about various aspects of Java programming: how difficult or easy do you consider aspects of Java such as threading, the 'volatile' keyword, using databases in Java etc. The survey is completely anonymous and the results will be used to improve the focus of future articles published on the Javamex web site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-7348250710039492090?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/7348250710039492090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=7348250710039492090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7348250710039492090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7348250710039492090'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2010/08/javamex-survey.html' title='Javamex survey'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3717697114580011978</id><published>2010-07-09T15:35:00.003-05:00</published><updated>2010-07-09T15:39:09.384-05:00</updated><title type='text'>The cost of object orientation: an update</title><content type='html'>Back in March, an article was added to the site on the &lt;a href="http://www.javamex.com/performance/cost_of_object_orientation.shtml"&gt;performance cost of object orientation&lt;/a&gt; which showed that on a test system, "hand-cranking" computationally expensive complex number calculations to avoid the use of encapsulating objects gave a notable performance benefit. The results also showed, however, that the benefit of using mutable objects was limited.&lt;br /&gt;&lt;br /&gt;In some work I've been doing more recently on a wider range of test machines and versions of Hotspot, at appears that this effect is not universal: on at least some systems, there is a benefit from using mutable rather than immutable objects. More details will be posted to the site in due course.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3717697114580011978?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3717697114580011978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3717697114580011978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3717697114580011978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3717697114580011978'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2010/07/cost-of-object-orientation-update.html' title='The cost of object orientation: an update'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3592582020676972469</id><published>2010-02-28T11:37:00.006-06:00</published><updated>2010-02-28T11:49:07.226-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='maintainability'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='program design'/><category scheme='http://www.blogger.com/atom/ns#' term='encapsulation'/><category scheme='http://www.blogger.com/atom/ns#' term='codability'/><category scheme='http://www.blogger.com/atom/ns#' term='object orientation'/><title type='text'>The performance impact of object orientation</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_jybCClDO3ws/S4qsOt25aiI/AAAAAAAAACc/HY5oUca5BcE/s1600-h/NewtonsMethod.jpg"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 160px; height: 128px;" src="http://4.bp.blogspot.com/_jybCClDO3ws/S4qsOt25aiI/AAAAAAAAACc/HY5oUca5BcE/s320/NewtonsMethod.jpg" alt="" id="BLOGGER_PHOTO_ID_5443352468458662434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Today's new Javamex article looks at the &lt;a href="http://www.javamex.com/performance/cost_of_object_orientation.shtml"&gt;performance impact of using an object-oriented approach&lt;/a&gt; vs an optimised, non-object-oriented approach in a case where the OO approach requires high object throughput. Specifically, we look at the case of calculations with complex numbers.&lt;br /&gt;&lt;br /&gt;The basic tenet is that the most intuitive program design is to have a complex number encapsulated as a Java object, and furthermore, as an &lt;span style="font-style: italic;"&gt;immutable&lt;/span&gt; object. This means that at each individual step in a calculation, a brand new object is created. However, &lt;a href="http://www.javamex.com/performance/cost_of_object_orientation_7.shtml"&gt;performance measurements&lt;/a&gt; suggest that using immutable objects is only around 28% slower than using mutable objects, whilst the codability and maintainability impact (threading issues; bugs introduced by forgetting to copy objects and hence making accidental modifications to an obejct) may be considerable.&lt;br /&gt;&lt;br /&gt;In our example, a version of the algorithm that does away with encapsulation and "inlines" its calculations on raw double primitives is more than twice as fast, as perhaps might be expected. On the other hand, "only" being between twice and three times as fast means that a comparable improvement will be possible in some applications by making use of more processors, or potentially making other algorithm improvements, whilst the codability and maintainability implications of not using encapsulation become more severe for more complex applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3592582020676972469?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3592582020676972469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3592582020676972469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3592582020676972469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3592582020676972469'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2010/02/performance-impact-of-object.html' title='The performance impact of object orientation'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_jybCClDO3ws/S4qsOt25aiI/AAAAAAAAACc/HY5oUca5BcE/s72-c/NewtonsMethod.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-7592930779164018952</id><published>2009-11-04T21:56:00.000-06:00</published><updated>2009-11-04T21:57:33.546-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='antivirus'/><title type='text'>When your antivirus nags you worse than your mother: the power of bloatware</title><content type='html'>If you're looking to rub salt into that wound we call life, few things can top the mighty blue screen of death followed by the severe ticking off that comes from allowing thy computer to be shut down in an improper fashion.&lt;br /&gt;&lt;br /&gt;But if there's one thing that comes close, it's got to be Antivirus software. Few other inventions succeed in reducing a squillion-gigahertz processor to the power of a ZX Spectrum. And on the scale of severe tickings off, little can beat the scolding that I received today from the antivirus I had trustily installed not four score and ten days ago.&lt;br /&gt;&lt;br /&gt;- "For the last 90 days thou hast willingly deterred from scanning thy device for evil malware," quoth ye antivirus.&lt;br /&gt;- "Evil what?", quoth I.&lt;br /&gt;- "You know-- bad stuff like cookies and worms and shit.".&lt;br /&gt;- "But isn't that your job?"&lt;br /&gt;&lt;br /&gt;Alas, my assumptions regarding the autonomy of the antivirus software had proven false. Despite years of research into artificial intelligence and the inordinate number of clock cycles that said software consumed, it would transpire that scanning for evil malware was a task upon which it preferred not to take the initiative.&lt;br /&gt;&lt;br /&gt;Thanks be to pointless bloatware.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-7592930779164018952?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/7592930779164018952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=7592930779164018952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7592930779164018952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7592930779164018952'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/11/when-your-antivirus-nags-you-worse-than.html' title='When your antivirus nags you worse than your mother: the power of bloatware'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-4194102196813771438</id><published>2009-10-20T21:04:00.002-05:00</published><updated>2009-10-20T21:08:13.602-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Native Interface'/><category scheme='http://www.blogger.com/atom/ns#' term='native code'/><category scheme='http://www.blogger.com/atom/ns#' term='JNI'/><title type='text'>New Section: JNI (Java Native Interface)</title><content type='html'>The new section on the &lt;a href="http://www.javamex.com/tutorials/jni/"&gt;Java Native Interface&lt;/a&gt; will be expanded over the next few weeks. For those not familiar, JNI is the standard framework for calling native code from Java. Thus, JNI effectively allows you to call Windows API functions from Java (or API calls from the operating system in general).&lt;br /&gt;&lt;br /&gt;As explained in the section, one caveat of using native code is that the &lt;a href="http://www.javamex.com/tutorials/jni/overhead.shtml"&gt;JNI overhead&lt;/a&gt; means that writing your code natively may not be as beneficial as anticipated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-4194102196813771438?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/4194102196813771438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=4194102196813771438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/4194102196813771438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/4194102196813771438'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/10/new-section-jni-java-native-interface.html' title='New Section: JNI (Java Native Interface)'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6106070559980404009</id><published>2009-10-20T21:01:00.003-05:00</published><updated>2009-10-20T21:03:58.386-05:00</updated><title type='text'>Fragmentation</title><content type='html'>Disk layout:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Blue: MyDocuments&lt;/li&gt;&lt;li&gt;Red: MS Office (Program Files)&lt;/li&gt;&lt;li&gt;Green: Windows\System32&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jybCClDO3ws/St5rmjYnI5I/AAAAAAAAACQ/RxuuUn-BMME/s1600-h/DiskMapBeforeWinDefrag.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 40px;" src="http://2.bp.blogspot.com/_jybCClDO3ws/St5rmjYnI5I/AAAAAAAAACQ/RxuuUn-BMME/s320/DiskMapBeforeWinDefrag.png" alt="" id="BLOGGER_PHOTO_ID_5394867713714103186" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6106070559980404009?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6106070559980404009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6106070559980404009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6106070559980404009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6106070559980404009'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/10/fragmentation.html' title='Fragmentation'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_jybCClDO3ws/St5rmjYnI5I/AAAAAAAAACQ/RxuuUn-BMME/s72-c/DiskMapBeforeWinDefrag.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6965032464449958530</id><published>2009-10-06T17:46:00.004-05:00</published><updated>2009-10-06T18:02:05.756-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Applet'/><category scheme='http://www.blogger.com/atom/ns#' term='XPath'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>When the simple gets complicated: XPath from applets</title><content type='html'>Those who have read my &lt;a href="http://www.javamex.com/tutorials/xml/"&gt;introduction to XML&lt;/a&gt; will be familiar with my mixed feelings on this "technology". In principle, the idea of a standardised, human-readable data format is a handy one. Just in practice, the XML frameworks that are supposed to take the work out of reading this data end up being fundamentally infuriating for some reason.&lt;br /&gt;&lt;br /&gt;Of the irritating options available, the &lt;a href="http://www.javamex.com/tutorials/xml/parsing_xpath.shtml"&gt;XPath API&lt;/a&gt; is about the least tedious. Essentially, the idea is that you can call an evaluate() method, passing in a "path" into the XML document by which you refer to elements (data) in the document. Java's standard implementation is stupidly faffy, making you mess around with document builders and configuration exceptions and god knows what other nonesense that you really shouldn't have to care about. But as I say, of the various frustrating options available, it's still about the least frustrating.&lt;br /&gt;&lt;br /&gt;At least, until you come to use it in an applet. Picture the scene: my beautiful XML-consuming applet nearing completion and tested locally, I excitedly gmail my colleague to let him know I'll have it up on the web for testing shortly. Then imagine my dismay when the selfsame applet uploaded to the web fails to initialise. Half an hour or so of frustrating debuggery later, it turns out that the culprit is the XPath.evaluate() method, inside whose gubbinery a network fetch is being made for some spurious property on every single attempt to read a piece of data from an XML document. Vive la pluggable architecture.&lt;br /&gt;&lt;br /&gt;As I explain on the page, the workaround I found for this was to explicitly set the system property being looked for to its default value via a call to System.setProperty(). For this, alas, the jar must be signed. But I decided that even signing the jar would be less frustrating than re-writing my code to avoid the XPath API. That's how desperate I was by that stage.&lt;br /&gt;&lt;br /&gt;With the jar signed, my colleague is now free to accept the warning message about the apocalyptic consequences of running my applet and proceed with testing. Ginger programmer 1, frustrating API nil. For now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6965032464449958530?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6965032464449958530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6965032464449958530' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6965032464449958530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6965032464449958530'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/10/when-simple-gets-complicated-xpath-from.html' title='When the simple gets complicated: XPath from applets'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-5988242607591748645</id><published>2009-07-10T23:53:00.003-05:00</published><updated>2009-07-11T00:13:17.054-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='WiFi'/><title type='text'>Security and public wireless networks</title><content type='html'>The other day I wrote of the problem with Social Security Numbers being used as the basis of authentication. I mentioned that the underlying problem was an assumption that security lay somewhere that it didn't.&lt;br /&gt;&lt;br /&gt;A recent Fox News article about &lt;a href="http://www.foxnews.com/story/0,2933,531380,00.html"&gt;rogue wireless networks&lt;/a&gt; set up by criminals in airports and other public places demonstrates a similar failure to understand where security lies. As pointed out in the article, criminals can easily set up "trojan" networks in places where we would expect a legitimate one to exist.&lt;br /&gt;&lt;br /&gt;But from a security point of view, worrying exclusively about these fake networks kind of misses the point. In attempting to make your computer and computer use secure, you should &lt;span style="font-weight: bold;"&gt;always assume that &lt;span style="font-style: italic;"&gt;any&lt;/span&gt; network is inherently insecure&lt;/span&gt;. It should not matter whether you're connecting via the "official" JFK Airport network or its fake counterpart. The problem isn't that you need to avoid sending confidential details encrypted over the hacker's network, or update your antivirus specifically for connecting to that network. You should &lt;span style="font-style: italic;"&gt;always &lt;/span&gt;be taking such measures for &lt;span style="font-style: italic;"&gt;any &lt;/span&gt;network.&lt;span style="font-weight: bold;"&gt; If you've got your security policy right, then connecting via the hacker's network should be completely safe!&lt;/span&gt; You're security should not be relying on a particular network being "safe"; no network carries such a guarantee-- and especially no publicly accessible network (note that even if you had to type in a password to access the airport's network, it's still a public network!).&lt;br /&gt;&lt;br /&gt;As well as having a paid-for firewall and antivirus that you keep up to date, you should be taking measures such as always accessing e-mail via an encrypted service, ensuring any financial transactions are made via an encrypted service, heeding warnings from your browser about problems with certifiates, not installing software from untrusted web sites, making sure you e-mail service has built in antivirus, and in any case not opening e-mails from suspicious recipients.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-5988242607591748645?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/5988242607591748645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=5988242607591748645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5988242607591748645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5988242607591748645'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/07/security-and-public-wireless-networks.html' title='Security and public wireless networks'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-9049543136319684388</id><published>2009-07-07T03:02:00.003-05:00</published><updated>2009-07-07T03:32:35.563-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='social security number'/><category scheme='http://www.blogger.com/atom/ns#' term='SSN'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Social Security Numbers and "security": a case of misguided assumption</title><content type='html'>The research on &lt;a href="http://www.heinz.cmu.edu/%7Eacquisti/ssnstudy/"&gt;predicting social security numbers&lt;/a&gt; published today by Alessandro Acquisti and Ralph Gross from Carnegie Mellon University unfortunately highlights a fairly classic case of something we do all too often: basing security on something that was never secure-- and never really intended to be secure-- in the first place.&lt;br /&gt;&lt;br /&gt;Much of the information that we readily pretend is a valid authentication key (such as &lt;span style="font-style: italic;"&gt;Mother's Maiden Name&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;Date of Birth and Post Code--&lt;/span&gt; and indeed Social Security Number) has really always been publicly available information. The parameter that has changed is how financially viable it is for a criminal to access the public records necessary to deduce this "secret" information. The &lt;a href="http://www.ssa.gov./history/ssn/geocard.html"&gt;SSN allocation scheme&lt;/a&gt; is perfectly well documented, public information, and the scheme clearly has no element of security built into it whatsoever.  The historical origins of the scheme are also documented: the scheme has no security now, never did and was never intended to.&lt;br /&gt;&lt;br /&gt;So what do we need to do about this? We need to understand where security actually lies, and not pretend that it exists in places where it doesn't. In most cases, the "security" does not currently lie in whether somebody can guess your PIN number, forge your signature, find out your mother's maiden name or guess the last couple of digits of your SSN. Our measures for preventing discovery of these largely unsecret "secrets" are predictably diabolical, and they are thus extremely weak forms of authentication. A transaction that is "authenticated" by an SSN or signature is essentially &lt;span style="font-style: italic;"&gt;unauthenticated &lt;/span&gt;and the security of that transaction relies on it being quickly reversed in the event of fraud. So long as users, banks and lawmakers all understand this, the situation isn't so dire. The big danger comes when we pretend that there is security and authentication where there really isn't.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-9049543136319684388?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/9049543136319684388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=9049543136319684388' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9049543136319684388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9049543136319684388'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/07/social-security-numbers-and-security.html' title='Social Security Numbers and &quot;security&quot;: a case of misguided assumption'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-1078882678830734395</id><published>2009-07-03T14:10:00.003-05:00</published><updated>2009-07-03T14:12:17.275-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XPath'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>Java, XML and XPath</title><content type='html'>The Javamex site now includes a basic introduction to using &lt;a href="http://www.javamex.com/tutorials/xml/"&gt;XML and XPath in Java&lt;/a&gt;. Java provides various means to read XML, but XPath is generally the most practical for moderately-sized XML documents. XPath effectively allows you to treat a document as a file system and refer to elements by their "path" within the document.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-1078882678830734395?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/1078882678830734395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=1078882678830734395' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1078882678830734395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1078882678830734395'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/07/java-xml-and-xpath.html' title='Java, XML and XPath'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6810262210457814495</id><published>2009-05-31T13:10:00.004-05:00</published><updated>2009-05-31T13:31:29.228-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='random'/><category scheme='http://www.blogger.com/atom/ns#' term='SecureRandom'/><category scheme='http://www.blogger.com/atom/ns#' term='XORShift'/><title type='text'>Random numbers in Java</title><content type='html'>A few updates have been made to the site's section on generating &lt;a href="http://www.javamex.com/tutorials/random_numbers/"&gt;random numbers in Java&lt;/a&gt;. Random numbers can crop up in all sorts of applications, and it's worth having a good understanding of them.&lt;br /&gt;&lt;br /&gt;Traditionally, the bread-and-butter means of random number generation has been the java.util.Ranom class. The technique it uses (see the section on the &lt;a href="http://www.javamex.com/tutorials/random_numbers/java_util_random_algorithm.shtml"&gt;java.util.Random algorithm&lt;/a&gt; for more details) is still suitable for some very casual applications of random number generation, such as some simple games. But in many cases, you should probably be thinking of moving away from java.util.Random towards a higher quality generator. As discussed in the section, problems with java.util.Random include its low period, biases in the different bits of the numbers generated, and its unsuitability for generating &lt;span style="font-style: italic;"&gt;combinations&lt;/span&gt; of values. Using a weak random generator can have side effects such as the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;it can skew the results of a test harness that introduces subtle biases in the code path due to the random number generator;&lt;/li&gt;&lt;li&gt;when testing the performance of data structures, and in various &lt;span style="font-style: italic;"&gt;simulations&lt;/span&gt;, a generator such as java.util.Random will not produce a good range of possible combinations of values, giving false results;&lt;/li&gt;&lt;li&gt;the series of numbers can be predictable, leading to disasterous results if used as the basis for security (e.g. generating a random encryption key, nonce or session ID).&lt;/li&gt;&lt;/ul&gt;One interesting technique, published in 2003 by Goerge Marsaglia, is the &lt;a href="http://www.javamex.com/tutorials/random_numbers/xorshift.shtml"&gt;XORShift generator&lt;/a&gt;. This generates &lt;span style="font-style: italic;"&gt;medium&lt;/span&gt;-quality random numbers in a few simple machine instructions. For example, given a Java long, x, we can generate the next random number as simply as follows (in fact, various combinations of shift values are possible, as discussed in Marsaglia's paper):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  x ^= (x &amp;lt;&amp;lt; 21);&lt;br /&gt;  x ^= (x &amp;gt;&amp;gt;&amp;gt; 35);&lt;br /&gt;  x ^= (x &amp;lt;&amp;lt; 4);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;continually executing these three lines will cycle through all (2^64)-1 possible values of x (i.e. all values of a long except zero) in pseudorandom order. Initialising x with the value of System.nanoTime(), or some other "random" seed, gives us a fast, medium-quality generator suitable for, say, generating random game data. It will make an excellent choice in many J2ME games, for example.&lt;br /&gt;&lt;br /&gt;We also consider a Java implementation of the &lt;a href="http://www.javamex.com/tutorials/random_numbers/numerical_recipes.shtml"&gt;combined generator&lt;/a&gt; suggested by the Numerical Recipes authors, which generates numbers within a similar order of execution time as java.util.Random, but with a higher period and quality.&lt;br /&gt;&lt;br /&gt;For applications where &lt;span style="font-style: italic;"&gt;security &lt;/span&gt;depends on the quality and unpredictability of the random numbers generated, Java's &lt;a href="http://www.javamex.com/tutorials/random_numbers/securerandom.shtml"&gt;SecureRandom&lt;/a&gt; class provides cryptographic strength random numbers, though is some 20-30 times slower than the other techniques.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6810262210457814495?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6810262210457814495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6810262210457814495' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6810262210457814495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6810262210457814495'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/05/random-numbers-in-java.html' title='Random numbers in Java'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-9160099257784867947</id><published>2009-05-30T10:24:00.002-05:00</published><updated>2009-05-30T10:38:57.404-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='collections'/><title type='text'>New article: how to choose a Java collection</title><content type='html'>A new addition to the &lt;a href="http://www.javamex.com/tutorials/collections/"&gt;Java Collections&lt;/a&gt; section of the Javamex site looks at a question that, perhaps unsurprisingly, crops up fairly frequently: &lt;a href="http://www.javamex.com/tutorials/collections/how_to_choose.shtml"&gt;which collections class should you use&lt;/a&gt; for a given task? The various collection classes provide a powerful means of managing objects and data in memory, but they're so powerful that choosing between them can sometimes be a bit daunting.&lt;br /&gt;&lt;br /&gt;The approach that I take is to split the question firstly into two sub-questions. Firstly, what is the &lt;span style="font-style: italic;"&gt;general &lt;/span&gt;type of structure that you need? That is, how is the data basically going to be organised? Usually, there is not too much confusion between a &lt;span style="font-style: italic;"&gt;list &lt;/span&gt;and a &lt;span style="font-style: italic;"&gt;map&lt;/span&gt;, especially if you consider whether or not you need to answer the question "for a given X, what is the Y"? But the difference between a &lt;span style="font-style: italic;"&gt;set &lt;/span&gt;and a list is sometimes not well understood, or at least, not considered. With a little bit of thought, it is usually possible to decide in advance whether the purpose of your collection is to decide "is something there or not"? The trick is for programmers to remember to ask that question in the first place, and not simply plump for a list regardless.&lt;br /&gt;&lt;br /&gt;Then, having decided on a list, map, set or queue, the next subquestion is obviously which particular flavour is required. In the case of a list, the cases where you wouldn't plump for an ArrayList are relatively uncommon and it should be clear in your head if you do choose something else that you have a "special case".&lt;br /&gt;&lt;br /&gt;But in the case of maps, sets and queues, there are definitely more "horses for courses". But, especially in the first two, there are essentially two factors to consider: &lt;span style="font-style: italic;"&gt;concurrency &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;ordering&lt;/span&gt;. As in the article, when the various choices are presented in tabular form according to these criteria, things become a little easier. As mentioned, a key rule of thumb is to choose the class that provides the &lt;span style="font-weight: bold;"&gt;minimum features that you require&lt;/span&gt;. If you don't need ordering, don't pay for it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.javamex.com/tutorials/synchronization_concurrency_8_queues_2.shtml"&gt;Java queues&lt;/a&gt; present a slightly complex set of choices, but in at least some cases-- especially a DelayQueue or SynchronousQueue-- it should be really clear that you need that class for a special case scenario. It should also be borne in mind that the executors framework means that in many common producer-consumer scenarios, you don't explicitly have to deal with the underlying job queue.&lt;br /&gt;&lt;br /&gt;As usual, further questions and comments to any of the articles on Javamex are welcome on either this blog or the associated &lt;a href="http://javamex.ning.com/"&gt;Java forum&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-9160099257784867947?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/9160099257784867947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=9160099257784867947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9160099257784867947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9160099257784867947'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/05/new-article-how-to-choose-java.html' title='New article: how to choose a Java collection'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-2183611468231572571</id><published>2009-05-27T00:01:00.003-05:00</published><updated>2009-05-27T00:55:02.599-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IBM'/><category scheme='http://www.blogger.com/atom/ns#' term='20090132950'/><category scheme='http://www.blogger.com/atom/ns#' term='patent'/><title type='text'>Patently stupid...</title><content type='html'>Like anyone, I have my fair share of stop-the-world-I-want-to-get-off moments. But I really did have to check the calendar to make sure it wasn't April 1st today when I read through IBM's patent application for their "solution for providing real-time validation of text input fields using regular expression evaluation during text entry" (20090132950). Wading through all the verbiage, it really does appear that IBM think they have "invented" evaluating a regular expression inside an onChange event handler.&lt;br /&gt;&lt;br /&gt;In terms of this specific patent application, I don't think many programmers are too worried that they're suddenly going to be prosecuted for calling RegExp in the wrong place-- needless to say, plenty of prior art is being cited, in case it were needed.&lt;br /&gt;&lt;br /&gt;But the case does leave some other more interesting questions. Why does IBM of all companies think it needs to stoop this low? And how can it help us ditinguish the "bleeding obvious" from the "possibly patentable"?&lt;br /&gt;&lt;br /&gt;I'm really at a loss to answer the first question. Possibly we're simply looking at a clerical error on the part of an overenthusiastic junior employee. But for a company that is supposedly at the forefront of computing research and invention, claiming patent rights on what amounts to a chain of JavaScript API calls doesn't really help them uphold their reputation.&lt;br /&gt;&lt;br /&gt;In answer to the second question, I'm reminded of a comment by Donald Knuth, that he regularly sees patents granted to "solutions" to problems that he sets as undergraduate homework questions. If "how do you validate input as the user types into a web form?" had been posted as a question on one of the various Internet programming forums (and probably it has...), it would almost certainly have been tagged as "smells like homework". Few programmers, I suspect, would have tagged it as "goodness me how novel-- I think we should patent this".&lt;br /&gt;&lt;br /&gt;I really have no idea how in the field of software patents you can concretely separate "significant invention" from "doing the bleeding obvious" (though, as in this case, I can sometimes recognise the latter when I see it!). But in order for a software solution to be patentable, I would at least expect to see:&lt;br /&gt;&lt;br /&gt;- evidence of significant empirical research necessary to find the solution&lt;br /&gt;- an invention of an actual algorithm, with perhaps some guage of number of API calls per other instructions/lines of code in order to determine if a new algorithm had actually been invented.&lt;br /&gt;&lt;br /&gt;I would also like to see severe financial penalities for cases such as this, where a company is clearly attempting to use its abundant resources to abuse the system. The small developers that the patent system was originally designed to protect really have to think twice before committing to the thousands of dollars per year that it costs to keep a patent going. A company such as IBM really has nothing to loose by continually paying for nonesensical patent applications out of petty cash on the off-chance that at some point, one of them will sucessfully fly over the cuckoo's nest.&lt;br /&gt;&lt;br /&gt;In the case of this particular patent application, I really really hope for the sake of human sanity that common sense fianlly prevails...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-2183611468231572571?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/2183611468231572571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=2183611468231572571' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2183611468231572571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2183611468231572571'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/05/patently-stupid.html' title='Patently stupid...'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-1652288695299569808</id><published>2009-05-23T21:31:00.003-05:00</published><updated>2009-05-23T21:50:57.350-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='e-book'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Kindle'/><title type='text'>Java on your Kindle</title><content type='html'>It's excellent to see an array of Java programming books now available on the Kindle. Various of these books, which you may not have considered buying due to their cost, are available at a sometimes significantly reduced price on the Kindle.&lt;br /&gt;&lt;br /&gt;Of notable interest to &lt;span style="font-style: italic;"&gt;Javamex &lt;/span&gt;readers will be Brian Goetz's venerable &lt;a href="http://www.javamex.com/kindle/java_concurrency_in_practice.shtml"&gt;Java Concurrency in Practice&lt;/a&gt;, which is really something of a bible for information on the Java Memory Model and the Java 5 concurrency library. As I say in the review, I can pretty much guarantee that if you're writing concurrent code (as many of us either are or will soon have to, not just on the server, but increasingly client-side), then &lt;span style="font-style: italic;"&gt;Java Concurrency in Practice&lt;/span&gt; will allow you to fix various bugs in your code that you were possibly unaware of (it certainly fixed some in mine!), as well as help you make decisions about how to architecture your program around the Java 5 concurrency utilities.&lt;br /&gt;&lt;br /&gt;For a more light-hearted read, but still an extremely enlightening one, &lt;a href="http://www.amazon.com/gp/product/B001U5VJVS?ie=UTF8&amp;amp;tag=frenchlingui-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B001U5VJVS"&gt;Java Puzzlers&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=frenchlingui-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=B001U5VJVS" alt="" style="border: medium none  ! important; margin: 0px ! important;" border="0" width="1" height="1" /&gt; remains excellent as ever. Josh Bloch's &lt;span style="font-style: italic;"&gt;Effective Java&lt;/span&gt; got a whole new lease of life when its second edition was published, and its addition to the Kindle repertoire is most welcome.&lt;br /&gt;&lt;br /&gt;Also worthy of note are the &lt;a href="http://www.amazon.com/gp/product/B000OZ0N44?ie=UTF8&amp;amp;tag=frenchlingui-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B000OZ0N44"&gt;Core Java&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=frenchlingui-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=B000OZ0N44" alt="" style="border: medium none  ! important; margin: 0px ! important;" border="0" width="1" height="1" /&gt; books. These, and in particular the second volume of &lt;span style="font-style: italic;"&gt;Advanced Features&lt;/span&gt;, is not the most succinct of works, but covers various Java topics that you don't readily see explained in detail in other books.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-1652288695299569808?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/1652288695299569808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=1652288695299569808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1652288695299569808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1652288695299569808'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/05/java-on-your-kindle.html' title='Java on your Kindle'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6761209222757091983</id><published>2009-05-23T19:40:00.002-05:00</published><updated>2009-05-23T19:43:24.634-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Java for beginners turorial: what would you like to see?</title><content type='html'>Readers of the Javamex web site may or may not have seen the first pages of the site's &lt;a href="http://www.javamex.com/tutorials/java/"&gt;Java for beginners&lt;/a&gt; tutorial, which covers a number of very basic Java topics such as variables, control structures (for loops, if/else), plus information on &lt;a href="http://www.javamex.com/tutorials/java/arrays.shtml"&gt;Java arrays&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Various topics are going to be added to the tutorial over the coming weeks. But how do &lt;span style="font-style: italic;"&gt;you &lt;/span&gt;think it should be expanded? Are you just starting out in Java and having trouble with a particular topic? Or are you an experienced Java programmer, but remember having particular trouble with some aspect of learning Java with the tutorials that you used? Any feedback is welcome on this blog entry.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6761209222757091983?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6761209222757091983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6761209222757091983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6761209222757091983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6761209222757091983'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/05/java-for-beginners-turorial-what-would.html' title='Java for beginners turorial: what would you like to see?'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-16573227530922325</id><published>2009-05-12T14:57:00.004-05:00</published><updated>2009-05-12T15:24:18.854-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='final'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='thread-safety'/><category scheme='http://www.blogger.com/atom/ns#' term='concurrency'/><title type='text'>The secret life of the Java 'final' keyword</title><content type='html'>I'll freely admit that an omission that the Javamex site should have addressed sooner is a more explicit discussion of the &lt;a href="http://www.javamex.com/tutorials/synchronization_final.shtml"&gt;Java final keyword&lt;/a&gt;. Its use for guaranteeing thread-safety is hinted at in some of the articles, but some more explicit information has been long overdue.&lt;br /&gt;&lt;br /&gt;As a step towards addressing this gap, the aforementioned article looks at how, as of Java 5, the &lt;span style="font-style: italic;"&gt;final &lt;/span&gt;keyword has acquired a very important characteristic for thread-safe programming. Most programmers think of &lt;span style="font-style: italic;"&gt;final &lt;/span&gt;in terms of its impact on program design or presumed optimisation (which, as I'll mention in a moment, is probably a red herring). But its thread-safety guarantee is far more significant: any field declared as &lt;span style="font-style: italic;"&gt;final &lt;/span&gt;can be safely accessed by another thread once the constructor completes, whereas, subtly, without this or any other thread-safety mechanism, that guarantee does not hold.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The &lt;span style="font-style: italic;"&gt;final &lt;/span&gt;keyword and optimisation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An issue with the Java final keyword, also criticised by Josh Bloch and Neal Gafter in their excellent &lt;a href="http://www.amazon.com/gp/product/032133678X?ie=UTF8&amp;amp;tag=frenchlingui-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=032133678X"&gt;Java Puzzlers&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=frenchlingui-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=032133678X" alt="" style="border: medium none  ! important; margin: 0px ! important;" border="0" width="1" height="1" /&gt; book, is that it means different things in different places. When applied to a &lt;span style="font-style: italic;"&gt;class or method&lt;/span&gt;, it means that that class or method cannot be extended or overridden. This has led to a general (false) conception that "&lt;span style="font-style: italic;"&gt;final &lt;/span&gt;is to do with optimisation", and its importance in thread-safety has been overlooked.&lt;br /&gt;&lt;br /&gt;Even when applied to classes and methods, the notion that &lt;span style="font-style: italic;"&gt;final &lt;/span&gt;is about optimisation is probably false in most cases. The argument appears to stem from languages such as C++, where "compilation" is a one-off process. In such languages, there are optimisations that you can make to method calls and field accesses if you know that the classes and fields in question will never be overridden. But when you're running in a VM, whether a class or method might "potentially" be overridden doens't really matter. What counts is whether it &lt;span style="font-style: italic;"&gt;has &lt;/span&gt;been overridden at a given moment. It it hasn't at the point of JIT-compilation, and the JVM makes certain optimisations based on that observation, but then later the class/method is overridden, the JVM generally has the luxury (which a C++ compiler or linker generally doesn't) of being able to re-compile.&lt;br /&gt;&lt;br /&gt;So when applied to classes and methods (and in fact, local variables inside methods), &lt;span style="font-style: italic;"&gt;final &lt;/span&gt;is essentially a program design feature. When applied to instance and class variables, &lt;span style="font-style: italic;"&gt;final &lt;/span&gt;is an important thread-safety mechanism.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-16573227530922325?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/16573227530922325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=16573227530922325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/16573227530922325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/16573227530922325'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/05/secret-life-of-java-final-keyword.html' title='The secret life of the Java &apos;final&apos; keyword'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3376168608626584708</id><published>2009-05-11T23:23:00.002-05:00</published><updated>2009-05-11T23:33:09.180-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='parallelism'/><category scheme='http://www.blogger.com/atom/ns#' term='CyclicBarrier'/><category scheme='http://www.blogger.com/atom/ns#' term='concurrency'/><title type='text'>CyclicBarrier</title><content type='html'>A new section of the Javamex web site looks at the &lt;a href="http://www.javamex.com/tutorials/threads/CyclicBarrier.shtml"&gt;CyclicBarrier&lt;/a&gt; class. In case you haven't come across it, CyclicBarrier is a construct that makes coordinating threads easier. Unlike CountDownLatch, which is designed for "one-off" coordinated actions, &lt;span style="font-weight: bold;"&gt;CyclicBarrier is designed to be re-used&lt;/span&gt;, so that it is suitable for iterative processes where the participating threads need to repeatedly perform a parallel operation, but periodically "converge" so that their results can be amalgamated.&lt;br /&gt;&lt;br /&gt;In the article, we discuss the example of using a CyclicBarrier to coordinate a &lt;a href="http://www.javamex.com/tutorials/threads/CyclicBarrier_parallel_sort.shtml"&gt;parallel sort algorithm&lt;/a&gt;. Essentially, the sort takes place in three stages. Each of the stages occurs in parallel, but at the end of each stage, a small single-threaded step must take place to amalgamate the results of the previous parallel operation.&lt;br /&gt;&lt;br /&gt;Essentially, the code for a worker thread involved in the operation repeatedly carries out an operation and then calls the barrier's &lt;span style="font-style: italic;"&gt;await()&lt;/span&gt; method. The latter method blocks until all participating threads have also called &lt;span style="font-style: italic;"&gt;await()&lt;/span&gt; (we sometimes call this "arriving at the barrier"). At that point, CyclicBarrier executes our pre-determined "amalgamation" routine on one of the threads (the last one to arrive at the barrier, in fact), and &lt;span style="font-style: italic;"&gt;then &lt;/span&gt;relases all the threads to move on to the next stage. Overall, the class takes out a lot of the actual thread coordination work, although, as we discuss in the article, we must still think about regular concurrency issues such as data synchronization and lock contention.&lt;br /&gt;&lt;br /&gt;An additional feature of CyclicBarrier which we discuss is that it handles propagation of interruptions to all participating threads. In other words, if any thread involved in the operation is interrupted, then the whole operation will cease once all threads have called the &lt;span style="font-style: italic;"&gt;await()&lt;/span&gt; method.&lt;br /&gt;&lt;br /&gt;Whilst definitely one of the lesser used of the Java 5 concurrency utilities, CyclicBarrier is definitely a useful class that should not be overlooked.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3376168608626584708?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3376168608626584708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3376168608626584708' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3376168608626584708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3376168608626584708'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/05/cyclicbarrier.html' title='CyclicBarrier'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6738647475798555838</id><published>2009-04-29T15:02:00.002-05:00</published><updated>2009-04-29T15:20:15.741-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PDF'/><category scheme='http://www.blogger.com/atom/ns#' term='Adobe Reader'/><category scheme='http://www.blogger.com/atom/ns#' term='vulnerability'/><title type='text'>Security issue with Adobe Reader</title><content type='html'>You may not even have realised it, but for some reason, Adobe Reader can run JavaScript. Why on earth is that?, you might be asking. Isn't the point of a PDF file to store a printable document, not to run programs? Well, you'd have thought so.&lt;br /&gt;&lt;br /&gt;But it turns out that, for whatever reason, Adobe Reader &lt;span style="font-style: italic;"&gt;can &lt;/span&gt;run JavaScript. Not only that, but it can run it really badly. So badly, in fact, that is has a vulnerability whereby "an attacker can exploit this issue to execute arbitrary code the the privileges of the user running the application or crash the application, denying service to legitimate users" (&lt;a href="http://www.securityfocus.com/bid/34736/discuss"&gt;SecurityFocus&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;To get round this vulnerability, load Adobe Reader (ideally, don't load it by double-clicking on a PDF file that has been sent to you in an e-mail from an unknown person in South Korea...). Then, go to the Edit menu and to the Preferences option. The option you need is hidden away in the section marked "Javascript". Click on this in the list on the left hand side of the preferences menu, then make sure that the option &lt;span style="font-style: italic;"&gt;Enable Acrobat JavaScript&lt;/span&gt; is not enabled.&lt;br /&gt;&lt;br /&gt;Finally,&lt;span style="font-weight: bold;"&gt; never re-enable JavaScript in Adobe Reader&lt;/span&gt; or any other PDF reader application. There are certain features that are necessary in a printable text document reader application such as, well, text and the ability to print. But you really don't need JavaScript in PDF documents!!!!&lt;br /&gt;&lt;br /&gt;On a related note, Microsoft have just announced a vulnerability in Notepad which allows a maliciously formatted txt document to accelerate the mutation of swine flu. Users are advised to paint a white cross on their door before launching any text document more than 4 characters in length.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6738647475798555838?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6738647475798555838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6738647475798555838' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6738647475798555838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6738647475798555838'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/04/security-issue-with-adobe-reader.html' title='Security issue with Adobe Reader'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-7246820757139829925</id><published>2009-04-19T00:04:00.003-05:00</published><updated>2009-04-19T00:10:10.593-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='password-based encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='cryptography'/><category scheme='http://www.blogger.com/atom/ns#' term='Swing'/><category scheme='http://www.blogger.com/atom/ns#' term='user interface'/><title type='text'>New content</title><content type='html'>A few new pages have been added to the site that you may be interested in:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The section on &lt;a href="http://www.javamex.com/tutorials/cryptography/index.shtml"&gt;Java cryptography&lt;/a&gt; now considers &lt;a href="http://www.javamex.com/tutorials/cryptography/password_based_encryption.shtml"&gt;password-based encryption&lt;/a&gt;, which we not too surprisingly conclude is fraught with difficulties! At present, we look at the PBE algorithms provided as standard in Sun's Java 6 implementation, although we unfortunately conclude that none of them are terribly great!&lt;/li&gt;&lt;li&gt;The section on &lt;a href="http://www.javamex.com/tutorials/swing/"&gt;Swing User interfaces&lt;/a&gt; covers various common topics, including a "rogue's gallery" of common &lt;a href="http://www.javamex.com/tutorials/swing/components.shtml"&gt;Swing components&lt;/a&gt;, with a list of common constructors and listeners for those components, plus some hints on adding listeners to your code.&lt;/li&gt;&lt;/ul&gt;Further pages are planned for both of these sections very shortly. Watch this space!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-7246820757139829925?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/7246820757139829925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=7246820757139829925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7246820757139829925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7246820757139829925'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/04/new-content.html' title='New content'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3625385239925629052</id><published>2009-04-16T16:50:00.004-05:00</published><updated>2009-04-18T23:17:23.890-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tar'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='archive'/><category scheme='http://www.blogger.com/atom/ns#' term='tarball'/><category scheme='http://www.blogger.com/atom/ns#' term='ZIP'/><category scheme='http://www.blogger.com/atom/ns#' term='GZIP'/><title type='text'>Arcmexer: a library for reading archive files in Java</title><content type='html'>A beta version of the &lt;a href="http://www.javamex.com/arcmexer/"&gt;Arcmexer library&lt;/a&gt; is now available from the Javamex site. Arcmexer is a library that allows you to read the contents of various types of archive file from Java. The idea is that the library could be useful in various data conversion and data recovery operations.&lt;br /&gt;&lt;br /&gt;At present, the following are supported:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;ZIP files, including those with files encrypted with 128-bit AES encryption or the traditional (but insecure) PKZIP encryption scheme. Note that other encryption algorithms (including 256-bit AES) currently aren't supported but may be in the future if I'm told that people need them. (See the page on &lt;a href="http://www.javamex.com/arcmexer/reading_encrypted_archives.shtml"&gt;reading encrypted ZIP files&lt;/a&gt;.)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Tar files, commonly used on UNIX platforms. Tar files may come directly off a tape drive (usually via the UNIX dd command), or are created on disk via the tar command and used to transport bundles of files.&lt;/li&gt;&lt;li&gt;GZIP-compressed tar files, commonly with the ending .tar.gz or .tgz.&lt;/li&gt;&lt;/ul&gt;Other archive formats are likely to be added to future versions if people nag me about them. (That means, leave a comment on this blog entry asking for it!)&lt;br /&gt;&lt;br /&gt;As well as reading files from the archive, a method is provided that can aid in &lt;a href="http://www.javamex.com/arcmexer/zip_password_recovery.shtml"&gt;ZIP file password recovery&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Please bear in mind that this should very much be considered a beta version. I've found it the routines it contains useful and thought they could be useful for other people. If you encounter problems, please let me know! Comments can be left on this blog post, or on the site's &lt;a href="http://javamex.ning.com/"&gt;Java discussion forum&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3625385239925629052?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3625385239925629052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3625385239925629052' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3625385239925629052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3625385239925629052'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/04/arcmexer-library-for-reading-archive.html' title='Arcmexer: a library for reading archive files in Java'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-4176564064327601473</id><published>2009-04-15T13:25:00.002-05:00</published><updated>2009-04-15T13:29:56.992-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='StreamCorruptedException'/><title type='text'>StreamCorruptedException</title><content type='html'>The &lt;span style="font-style: italic;"&gt;How to fix... &lt;/span&gt;section, looking at &lt;a href="http://www.javamex.com/how_to_fix.html"&gt;common Java bugs and problems&lt;/a&gt;, has an additional section on a couple of common causes of &lt;a href="http://www.javamex.com/tutorials/io/StreamCorruptedException.shtml"&gt;StreamCorruptedException&lt;/a&gt;. This is a serialisation error that often occurs when the streams reading and writing serialised data get "out of kilter". It's surprisingly common for this to occur accidentally.&lt;br /&gt;&lt;br /&gt;If you haven't seen the &lt;span style="font-style: italic;"&gt;How to fix...&lt;/span&gt; section yet, then it's worth a look, as it deals with a couple of other common headaches such as OutOfMemoryError and StackOverflowError. If you've got another Java bête noir that you'd like to see covered there, please let us know by posting to the &lt;a href="http://javamex.ning.com/"&gt;Javamex forum&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-4176564064327601473?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/4176564064327601473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=4176564064327601473' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/4176564064327601473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/4176564064327601473'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/04/streamcorruptedexception.html' title='StreamCorruptedException'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-2306247925117024758</id><published>2009-04-11T13:49:00.003-05:00</published><updated>2009-04-11T13:52:31.237-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String CharSequence'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Using strings in Java</title><content type='html'>Various questions and problems commonly arise with &lt;a href="http://www.javamex.com/tutorials/strings.shtml"&gt;Java Strings&lt;/a&gt;. Especially for C programmers, strings in Java have certain quirks, notably the fact that they're immutable (once you've created a String object, you can't change its contents; if you need a mutable string, then you generally have to use some other CharSequence class such as StringBuilder).&lt;br /&gt;&lt;br /&gt;At the aforementioned link, I show code examples of some common string functions in Java. Surely, there'll be things I've missed out/forgotton. So please let me know if there's some thing you find yourself needing to do with strings in Java that I haven't mentioned!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-2306247925117024758?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/2306247925117024758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=2306247925117024758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2306247925117024758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2306247925117024758'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/04/using-strings-in-java.html' title='Using strings in Java'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-9186427491304149306</id><published>2009-04-11T00:33:00.008-05:00</published><updated>2009-04-19T00:12:22.134-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='cryptography'/><category scheme='http://www.blogger.com/atom/ns#' term='JSSE'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='JCA'/><title type='text'>New section: Java cryptography</title><content type='html'>Several pages of the new section on &lt;a href="http://www.javamex.com/tutorials/cryptography/index.shtml"&gt;Java Cryptography&lt;/a&gt; are now available for review and general criticism. Topics currently covered include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.javamex.com/tutorials/cryptography/symmetric.shtml"&gt;how to encrypt data in Java&lt;/a&gt;, looking at encryption with symmetric &lt;a href="http://www.javamex.com/tutorials/cryptography/aes_block_ciphers.shtml"&gt;block ciphers&lt;/a&gt; as well as the &lt;a href="http://www.javamex.com/tutorials/cryptography/rsa_encryption.shtml"&gt;RSA encryption&lt;/a&gt; scheme commonly used for passing session keys;&lt;/li&gt;&lt;li&gt;different &lt;a href="http://www.javamex.com/tutorials/cryptography/block_modes.shtml"&gt;block modes&lt;/a&gt;, and how to use &lt;a href="http://www.javamex.com/tutorials/cryptography/block_modes_java.shtml"&gt;block modes in Java&lt;/a&gt; (including how to set an initialisation vector necessary in many cases via the &lt;span style="font-weight: bold;"&gt;IvParameterSpec&lt;/span&gt; class);&lt;/li&gt;&lt;li&gt;how to choose and set the &lt;a href="http://www.javamex.com/tutorials/cryptography/key_size.shtml"&gt;key size&lt;/a&gt; to use with encryption, and how to &lt;a href="http://www.javamex.com/tutorials/cryptography/unrestricted_policy_files.shtml"&gt;remove the key length restriction&lt;/a&gt; which is imposed by current versions of Sun's JDK by default.&lt;/li&gt;&lt;/ul&gt;Topics &lt;span style="font-style: italic;"&gt;not&lt;/span&gt; currently covered, but planned for the near future include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;comparison of block cipher algorithms: performance and security considerations;&lt;/li&gt;&lt;li&gt;secure hash functions and authentication;&lt;/li&gt;&lt;li&gt;cryptographic protocols;&lt;/li&gt;&lt;li&gt;secure random number generation (note that the &lt;a href="http://www.javamex.com/tutorials/random_numbers/securerandom.shtml"&gt;Java SecureRandom&lt;/a&gt; class &lt;span style="font-style: italic;"&gt;is&lt;/span&gt; currently discussed in the site's section on &lt;a href="http://www.javamex.com/tutorials/random_numbers/"&gt;random numbers in Java&lt;/a&gt;);&lt;br /&gt;&lt;/li&gt;&lt;li&gt;digital signatures.&lt;/li&gt;&lt;/ul&gt;As usual, comments about the currently published sections are always welcome, as are suggestions for future additions to the cryptography section or to any other section of the web site. Please leave comments either on this blog or in the &lt;a href="http://javamex.ning.com/forum/categories/java-cryptography/listForCategory"&gt;Java cryptography section of the Javamex discussion forum&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Update 12/04/09:&lt;/span&gt; The section now contains some information on &lt;a href="http://www.javamex.com/tutorials/cryptography/hash_functions.shtml"&gt;secure hash functions in Java&lt;/a&gt;, plus a &lt;a href="http://www.javamex.com/tutorials/cryptography/ciphers.shtml"&gt;comparison of encryption algorithms&lt;/a&gt;.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;19/04/09&lt;/span&gt; As discussed in a separate blog entry, some information on&lt;a href="http://www.javamex.com/tutorials/cryptography/password_based_encryption.shtml"&gt; password-based encryption&lt;/a&gt; is now included.&lt;br /&gt;&lt;br /&gt;Enjoy...!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-9186427491304149306?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/9186427491304149306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=9186427491304149306' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9186427491304149306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9186427491304149306'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/04/new-section-java-cryptography.html' title='New section: Java cryptography'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-3811004901166112965</id><published>2009-03-10T16:12:00.007-05:00</published><updated>2009-03-10T16:20:48.508-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PIFTS.EXE'/><category scheme='http://www.blogger.com/atom/ns#' term='Norton Antivirus'/><category scheme='http://www.blogger.com/atom/ns#' term='Symantec'/><title type='text'>PIFTS.EXE: Symantec finally own up</title><content type='html'>So, the world can rest easy in their beds. A &lt;a href="http://community.norton.com/norton/board/message?board.id=nis_feedback&amp;amp;thread.id=39119"&gt;message tucked away on Symantec's forums&lt;/a&gt;-- the same forums from which all communication about the issue was previously banned-- in which they have finally owned up to what happened:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;they released a patch to do some boring things that any old patch might have done&lt;/li&gt;&lt;li&gt;but they released the patch unsigned, causing it to hit the firewall when it otherwise wouldn't have done&lt;/li&gt;&lt;li&gt;because some of the posts on the Symantec forum were judged to be abusive, all posts were pulled down.&lt;/li&gt;&lt;/ul&gt;Whilst this seems to be an astonishing example of customer relations, and has brought the world's attention to the kind of behaviour that such patches may be conducting on a routine basis, it does at least appear that the Feds are not about to plunder our computers for illicit chocolate chip cookie recipes. We were spared... &lt;span style="font-style: italic;"&gt;this &lt;/span&gt;time.&lt;br /&gt;&lt;br /&gt;(And yes, I did back up my recipe collection... &lt;span style="font-style: italic;"&gt;just &lt;/span&gt;in case.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-3811004901166112965?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/3811004901166112965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=3811004901166112965' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3811004901166112965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/3811004901166112965'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/03/piftsexe-symantec-finally-own-up.html' title='PIFTS.EXE: Symantec finally own up'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-248884858396275761</id><published>2009-03-10T00:04:00.006-05:00</published><updated>2009-03-10T12:51:23.474-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virus'/><category scheme='http://www.blogger.com/atom/ns#' term='PIFTS.EXE'/><title type='text'>What is the mysterious PIFTS.EXE?</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Update 10/03/09&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;11:50am&lt;/span&gt; Luckily, it does appear that &lt;a href="http://www.scmagazineuk.com/Norton-users-have-raised-concern-over-an-executable-file/article/128525/"&gt;PIFTS.EXE is just a storm in a teacup&lt;/a&gt;. Symantec still appear to be saying about as much as the Queen did after Diana died.&lt;br /&gt;&lt;br /&gt;So after a mysterious PIFTS.EXE program hits the Kaspersky firewall asking to connect out from one of our machines, I hit the Internet to find that nobody knows, but the world is wondering. According to &lt;a href="http://www.google.com/trends/hottrends?q=pifts.exe&amp;amp;date=2009-3-9&amp;amp;sa=X"&gt;Google Trends&lt;/a&gt;, it has been hovering between the 15th and 25th most frequent search for the last couple of hours. Various &lt;a href="http://www.javamex.com/pifts_exe.html"&gt;theories about PIFTS.EXE&lt;/a&gt; appear to be emerging: was it some component of Norton Antivirus that went wrong? Is it some mad terrorist plot to wipe the Internet off the face of the earth and thus prevent people from finding out about why Lil' Kim went to jail?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Update 10/03/09&lt;/span&gt; Reading things so far, and just possibly maybe having had a quick look at a disassembly of the exe in IDAPro, the consensus seems to be that the file is essentially harmless, but was an attempt by Symantec to gather some statistics from users' machines about installed antivirus components. A user posting to Reddit also suggests that a &lt;a href="http://www.reddit.com/r/reddit.com/comments/83hjr/symantec_covering_up_the_piftsexe_file_and/c0857t5"&gt;code review of PIFTS.EXE&lt;/a&gt; does not reveal anything too nafarious, and that automated code analysers such as &lt;a href="http://www.threatexpert.com/report.aspx?md5=91b564d825a3487ae5b5fafe57260810"&gt;ThreatExpert&lt;/a&gt; don't pull anything up either (then again, a "well written" virus wouldn't do, would it?).&lt;br /&gt;&lt;br /&gt;Sometimes in cases like this, it's not so much whether there &lt;span style="font-style: italic;"&gt;is &lt;/span&gt;anything wrong but whether there &lt;span style="font-style: italic;"&gt;appears &lt;/span&gt;to be. Pulling down all forum posts about the file when there is clear user anxiety without then making an official statement doesn't making it look as though everything's hunky-dory...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-248884858396275761?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/248884858396275761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=248884858396275761' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/248884858396275761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/248884858396275761'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/03/what-is-mysterious-piftsexe.html' title='What is the mysterious PIFTS.EXE?'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6728082064044871787</id><published>2009-01-22T20:05:00.004-06:00</published><updated>2009-01-22T20:11:03.739-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SCJP'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='certification'/><title type='text'>Java Certification Tips</title><content type='html'>A new page of &lt;a href="http://www.javamex.com/java-certification/"&gt;Java Certification Tips&lt;/a&gt; gives a "cribsheet" of some of the "syntactic niggles" and other commonly overlooked features of Java that could trip up an otherwise moderately experienced programmer when taking the Sun Certified Java Programmer (SCJP) exam. Did you know, for example that:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;this is invalid Java syntax?&lt;span style="font-style: italic;"&gt;&lt;br /&gt;float f = 2.5;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;goto &lt;/span&gt;is a Java keyword?&lt;/li&gt;&lt;li&gt;this line does &lt;span style="font-style: italic;"&gt;not&lt;/span&gt; assign the value 13 to the variable?:&lt;span style="font-style: italic;"&gt;&lt;br /&gt;int i = 013;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;See the page of tips for more information on these and other niggles.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6728082064044871787?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6728082064044871787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6728082064044871787' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6728082064044871787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6728082064044871787'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/01/java-certification-tips.html' title='Java Certification Tips'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-7102532556985168843</id><published>2009-01-21T16:25:00.002-06:00</published><updated>2009-01-21T16:42:19.562-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='scraping'/><category scheme='http://www.blogger.com/atom/ns#' term='regular expression'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML scraping'/><category scheme='http://www.blogger.com/atom/ns#' term='XML scraping'/><title type='text'>Regular expression tutorial: new example</title><content type='html'>The &lt;a href="http://www.javamex.com/tutorials/regular_expressions/index.shtml"&gt;Java regular expression tutorial&lt;/a&gt; section has been updated with a new example of using regular expressions. In this example, we look at how to perform what is sometimes referred to as &lt;span style="font-weight: bold;"&gt;HTML scraping&lt;/span&gt;: pulling out data from an HTML page (or indeed XML document).&lt;br /&gt;&lt;br /&gt;The example is located here: &lt;a href="http://www.javamex.com/tutorials/regular_expressions/example_scraping_html.shtml"&gt;HTML scraping with Java regular expressions&lt;/a&gt;. As explained in this tutorial, regular expressions are a good candidate for data scraping because they are &lt;span style="font-weight: bold;"&gt;flexible&lt;/span&gt;. Various libraries exist to parse an HTML or XML document and return an object representation of that document. But such libraries are often "too fussy": many if not most web pages actually do not conform strictly to HTML standards. Similarly, many XML parsing libraries are too fussy for real-life RSS feeds, which are often malformed, strictly speaking. Using regular expressions cuts through the fuss.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;When should you scrape web pages?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note that the article focusses on how &lt;span style="font-style: italic;"&gt;technically&lt;/span&gt; to scrape HTML pages in Java. It doesn't deal with the "political" issue of whether the site in question wants its content scraped in the first place. In general, it is good practice to do the following:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;find out if he web site in question has an API to provide the data in a more convenient format (and in a format that it would prefer to provide it to you in!)&lt;/li&gt;&lt;li&gt;be open about what you're doing: if the web site administrator things you're trying to "hide" something, they may block your IP address&lt;/li&gt;&lt;li&gt;respect server resources: if you are retrieving multiple pages, consider putting a &lt;a href="http://www.javamex.com/tutorials/threads/sleep.shtml"&gt;thread sleep&lt;/a&gt; between fetches&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-7102532556985168843?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/7102532556985168843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=7102532556985168843' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7102532556985168843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7102532556985168843'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2009/01/regular-expression-tutorial-new-example.html' title='Regular expression tutorial: new example'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-9220896505055761830</id><published>2008-12-30T22:43:00.003-06:00</published><updated>2008-12-30T22:46:00.372-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='glosario'/><category scheme='http://www.blogger.com/atom/ns#' term='glossary'/><category scheme='http://www.blogger.com/atom/ns#' term='Spanish'/><title type='text'>Updates to the Spanish-English glossary</title><content type='html'>Various new entries have been added to the Javamex site's &lt;a href="http://www.javamex.com/spanish-glossary/A.shtml"&gt;Spanish-English glossary of computing terms&lt;/a&gt;. For those not familiar with the glossary, it contains English translations of various Spanish computing terms, covering various IT topics such as programming, networking, the Internet, software and hardware, GUIs etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-9220896505055761830?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/9220896505055761830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=9220896505055761830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9220896505055761830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/9220896505055761830'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/12/updates-to-spanish-english-glossary.html' title='Updates to the Spanish-English glossary'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-57879353606890349</id><published>2008-12-29T19:04:00.003-06:00</published><updated>2008-12-29T19:15:28.280-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String CharSequence'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='memory usage'/><category scheme='http://www.blogger.com/atom/ns#' term='heap'/><title type='text'>Information on memory usage of objects</title><content type='html'>The section on Java memory usage now contains the following additional articles:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;information on how to &lt;span style="font-style: italic;"&gt;calculate &lt;/span&gt;the &lt;a href="http://www.javamex.com/tutorials/memory/object_memory_usage.shtml"&gt;memory usage of a Java object&lt;/a&gt; in general, considering the memory used for "housekeeping" by the JVM&lt;/li&gt;&lt;li&gt;calculating the &lt;a href="http://www.javamex.com/tutorials/memory/string_memory_usage.shtml"&gt;memory usage of Strings&lt;/a&gt;, which can often the type of object to use up the biggest proportion of space in a Java application: this section actually considers the memory use of string-related objects such as StringBuffers and StringBuilders&lt;/li&gt;&lt;/ul&gt;A section on &lt;a href="http://www.javamex.com/tutorials/memory/string_saving_memory.shtml"&gt;reducing the memory taken up by Strings&lt;/a&gt; looks at string canonicalisation, a fairly standard approach (but one which requires certain caveats), plus introduces the example of a CompactCharSequence class, that &lt;a href="http://www.javamex.com/tutorials/memory/ascii_charsequence.shtml"&gt;stores strings as 1 byte per character&lt;/a&gt;, thus taking up around half othe memory taken up by a regular Java String (at the expense of not supporting Unicode).&lt;br /&gt;&lt;br /&gt;Comments on these articles welcome as usual.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-57879353606890349?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/57879353606890349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=57879353606890349' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/57879353606890349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/57879353606890349'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/12/information-on-memory-usage-of-objects.html' title='Information on memory usage of objects'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-5795665261647869077</id><published>2008-12-27T22:57:00.003-06:00</published><updated>2008-12-27T23:04:44.804-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='instrumentation'/><category scheme='http://www.blogger.com/atom/ns#' term='profiling'/><category scheme='http://www.blogger.com/atom/ns#' term='memory usage'/><category scheme='http://www.blogger.com/atom/ns#' term='heap'/><title type='text'>Beta: Classmexer agent</title><content type='html'>The beta version of a simple instrumentation tool is available for download from the Javamex site. The &lt;a href="http://www.javamex.com/classmexer/"&gt;Classmexer&lt;/a&gt; jar provides various calls for querying the memory usage of Java objects. Via the provided MemoryUtil class.deepMemoryUsageOf() method, it is possible to get an estimate from the JVM of the number of bytes taken up by an object and its "subobjects" (objects referred to by a non-public reference, or by references with other visibility criteria). The memory usage of subobjects is combined &lt;span style="font-style: italic;"&gt;recursively&lt;/span&gt; (so subobjects of subobjects are considered etc), but without counting the same object more than once.&lt;br /&gt;&lt;br /&gt;A variant of the call is also provided which gives the total memory usage of &lt;span style="font-style: italic;"&gt;several&lt;/span&gt; objects at a time, without counting as duplicates objects referenced by more than one of the objects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-5795665261647869077?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/5795665261647869077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=5795665261647869077' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5795665261647869077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5795665261647869077'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/12/beta-classmexer-agent.html' title='Beta: Classmexer agent'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-7884740350446109846</id><published>2008-12-25T23:18:00.002-06:00</published><updated>2008-12-25T23:26:07.226-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='ThreadMXBean'/><category scheme='http://www.blogger.com/atom/ns#' term='instrumentation'/><category scheme='http://www.blogger.com/atom/ns#' term='profiling'/><title type='text'>Updates to profiling section</title><content type='html'>Firstly, some minor corrections and additions to the &lt;a href="http://www.javamex.com/tutorials/profiling/profiling_java5.shtml"&gt;Java profiling&lt;/a&gt; section. The corrections mainly concern a couple of typos that crept into the variable names of the examples. Readers should be reassured that the code, like that of the site in general, is copied and pasted from working, live profiling code. But things such as variable names are occasionally changed or shortened for the purposes of making it clearer on the site, and that seems to be where the errors crept in. I've also taken the opportunity to add a few links to other sections of the site (such as the section on threading, sleep() and yield()) that were added since the profiling tutorial was written.&lt;br /&gt;&lt;br /&gt;Readers interested in Java profiling may also be interested in the first page of an upcoming section on Java and memory. This first page looks at how to &lt;a href="http://www.javamex.com/tutorials/memory/instrumentation.shtml"&gt;find out the memory usage of a Java object&lt;/a&gt;. The technique involves using the Java Instrumentation framework introduced in version 5 of the language to query the JVM directly for the size of an object. Although slightly fiddly to set up, the technique has the advantage that there's less guesswork involved than if we were to just estimate an object's size (although future pages in the section will nonetheless look at estimation).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-7884740350446109846?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/7884740350446109846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=7884740350446109846' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7884740350446109846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7884740350446109846'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/12/updates-to-profiling-section.html' title='Updates to profiling section'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-1629575741824472321</id><published>2008-12-10T22:13:00.002-06:00</published><updated>2008-12-10T22:24:05.918-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='RSS'/><category scheme='http://www.blogger.com/atom/ns#' term='article'/><category scheme='http://www.blogger.com/atom/ns#' term='feed'/><title type='text'>RSS feeds of Java tutorials</title><content type='html'>The Javamex web site now publishes various RSS feeds containing links to articles published recently or on particular topics of frequent interest. The available feeds are as follows:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Main RSS feed&lt;/span&gt;: all &lt;a href="http://www.javamex.com/rssmain.xml"&gt;Java programming articles&lt;/a&gt; published in the past 3 months&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.javamex.com/rssthreading.xml"&gt;Java threading&lt;/a&gt; feed: recent articles on multithreading and concurrency (including both "classical" thread programming and the Java 5+ concurrency libraries)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.javamex.com/rssweb.xml"&gt;Java Web programming&lt;/a&gt; feed: articles on topics such as Servlets and AJAX programming&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.javamex.com/rsscollections.xml"&gt;Java collections and algorithms&lt;/a&gt; feed: articles covering the Java collections framework itself, plus other algorithm-related frameworks such as compression&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.javamex.com/rssperf.xml"&gt;Java performance feed&lt;/a&gt;: performance and profiling-related articles&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.javamex.com/rssregex.xml"&gt;Java Regular expressions&lt;/a&gt; feed&lt;/li&gt;&lt;/ul&gt;Suggestions are welcome if you think there's a feed on another theme that you think would be useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-1629575741824472321?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/1629575741824472321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=1629575741824472321' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1629575741824472321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1629575741824472321'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/12/rss-feeds-of-java-tutorials.html' title='RSS feeds of Java tutorials'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-7307351889147399195</id><published>2008-12-05T17:47:00.005-06:00</published><updated>2008-12-05T18:01:15.762-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='parallelism'/><category scheme='http://www.blogger.com/atom/ns#' term='threads'/><category scheme='http://www.blogger.com/atom/ns#' term='multithreading'/><category scheme='http://www.blogger.com/atom/ns#' term='scheduling'/><category scheme='http://www.blogger.com/atom/ns#' term='threading'/><title type='text'>New section: using threads in Java</title><content type='html'>The first articles in this new section look primarily at how to use "raw" threads in Java. As well as the basics such as &lt;a href="http://www.javamex.com/tutorials/threads/"&gt;how to create a thread&lt;/a&gt; and stop or interrupt it, the section looks at more advanced threading topics such as:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a style="font-weight: bold;" href="http://www.javamex.com/tutorials/threads/how_threads_work.shtml"&gt;How threads work&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A look at threads "under the hood": an examination of some of the details of &lt;a href="http://www.javamex.com/tutorials/threads/thread_scheduling.shtml"&gt;thread scheduling&lt;/a&gt;, and the implications of different scheduling algorithms for Java threads and the methods that control them.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a style="font-weight: bold;" href="http://www.javamex.com/tutorials/threads/priority.shtml"&gt;Thread priorities&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;How they work (or rather, how they &lt;span style="font-style: italic;"&gt;don't&lt;/span&gt; work...) on specific operating systems. Did you know, for example:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;on Linux, setPriority() has &lt;span style="font-weight: bold;"&gt;no effect pre Java 6&lt;/span&gt;, and that even then you need to &lt;span style="font-weight: bold;"&gt;run as root&lt;/span&gt;and use a special command-line flag?&lt;/li&gt;&lt;li&gt;on Windows, the implementation of setPriority() changed between Sun's Java 5 and Java 6 implementations?&lt;/li&gt;&lt;li&gt;on Windows, thread priorities have little effect on threads competing for CPU?&lt;/li&gt;&lt;/ul&gt; See the article for more information.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://www.javamex.com/tutorials/threads/sleep.shtml"&gt;sleep()&lt;/a&gt; and &lt;a href="http://www.javamex.com/tutorials/threads/yield.shtml"&gt;yield()&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Information on the limitations and behaviour of &lt;span style="font-weight: bold;"&gt;sleep()&lt;/span&gt; under different load, sleep granularity, and bugs in the Windows implementation. And finally, find out what &lt;span style="font-weight: bold;"&gt;yield()&lt;/span&gt; actually &lt;span style="font-style: italic;"&gt;does&lt;/span&gt;...!&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Suggestions welcome!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As with all sections of the Javamex site, suggestions are very welcome here for new topics or specific questions you'd like to see answered. Updates and additions will be added periodically. Corrections are also very welcome since, particularly in the case of the some of the threading topics, I have tried to pull together information which is elusive or described in contradictory ways in different sources!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-7307351889147399195?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/7307351889147399195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=7307351889147399195' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7307351889147399195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/7307351889147399195'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/12/new-section-using-threads-in-java.html' title='New section: using threads in Java'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-4264754269701794651</id><published>2008-11-19T22:29:00.004-06:00</published><updated>2008-11-19T22:43:44.622-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unsigned'/><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='malloc'/><category scheme='http://www.blogger.com/atom/ns#' term='new'/><category scheme='http://www.blogger.com/atom/ns#' term='const'/><category scheme='http://www.blogger.com/atom/ns#' term='memory'/><title type='text'>What is the Java equivalent of...?</title><content type='html'>If you're a C/C++ programmer who has more recently moved into Java, you may welcome a new section of the Javamex site loosely entitled &lt;span style="font-style: italic;"&gt;What is the Java equivalent of...?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;The section aims to examine Java equivalents of some of those awkward little features of C/C++ that people tend to miss or not know how to achieve when they migrate to Java. For example:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.javamex.com/java_equivalents/unsigned.shtml"&gt;What is the Java equivalent of &lt;span style="font-weight: bold;"&gt;unsigned&lt;/span&gt;?&lt;/a&gt; In C/C++, you can tell the compiler to treat an integer variable as unsigned by adding the &lt;span style="font-weight: bold;"&gt;unsigned&lt;/span&gt; modifier to its declaration. In Java, integer primitives are generally unsigned. But as we see, &lt;span style="font-style: italic;"&gt;bitwise&lt;/span&gt; operations generally only require the right shift operator to be modified (so that Java uses &gt;&gt;&gt; where C/C++ uses &gt;&gt; to operate on unsigned values). And for &lt;span style="font-style: italic;"&gt;arithmetic&lt;/span&gt; operations, judicious use of the AND operator can often get us round the problem.&lt;br /&gt;&lt;a href="http://www.javamex.com/java_equivalents/const.shtml"&gt;&lt;br /&gt;What is the Java equivalent of &lt;span style="font-weight: bold;"&gt;const?&lt;/span&gt;&lt;/a&gt; In C/C++, this operator tells the compiler not to allow the variable in question (or the value it points to) to be modified. We discuss the nearest Java equivalents, which actually depend on the circumstances.&lt;br /&gt;&lt;br /&gt;The section on &lt;a href="http://www.javamex.com/java_equivalents/memory_management.shtml"&gt;memory management in Java vs C/C++&lt;/a&gt; looks at equivalents of operators such as &lt;span style="font-weight: bold;"&gt;new&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;malloc()&lt;/span&gt;, and their opposites. We see that in general, C/C++ puts more burden on the programmer to deal with memory management issues. Possible C/C++ bugs relating to memory management include allocating memory on the stack and then letting it "escape" the function; such bugs are not possible in Java. But there are issues that do crop up in Java that we sometimes need to be aware of, such as how garbage collection object finalization works, or how to deal with a "raw" block of memory (one typical use of &lt;span style="font-weight: bold;"&gt;malloc()&lt;/span&gt; in C/C++).&lt;br /&gt;&lt;br /&gt;If you have a suggestion for a new topic in the &lt;span style="font-style: italic;"&gt;Java equivalents&lt;/span&gt; section, please leave an appropriate comment on this blog. Corrections or suggestions for the existing articles are always welcome too!&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-4264754269701794651?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/4264754269701794651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=4264754269701794651' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/4264754269701794651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/4264754269701794651'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/11/what-is-java-equivalent-of.html' title='What is the Java equivalent of...?'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-8149979527831215609</id><published>2008-10-28T14:06:00.003-05:00</published><updated>2008-10-28T14:12:56.914-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTP'/><category scheme='http://www.blogger.com/atom/ns#' term='servlet'/><category scheme='http://www.blogger.com/atom/ns#' term='hosting'/><title type='text'>Section on Java Servlets</title><content type='html'>The newly updated section on &lt;a href="http://www.javamex.com/tutorials/servlets/index.shtml"&gt;writing Java Servlets&lt;/a&gt;, looks at issues such as the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;some of the "mechanics" of getting start with Servlets, such as getting the appropriate version of the JDK and some &lt;a href="http://www.javamex.com/tutorials/servlets/servlet_hosting_choosing.shtml"&gt;Servlet hosting tips&lt;/a&gt; such as the features and quotas that you should be looking out for in a Servlet hosting package&lt;/li&gt;&lt;li&gt;the anatomy of an &lt;a href="http://www.javamex.com/tutorials/servlets/introduction.shtml"&gt;example Servlet&lt;/a&gt;&lt;/li&gt;&lt;li&gt;dealing with &lt;a href="http://www.javamex.com/tutorials/servlets/sessions.shtml"&gt;HTTP sessions&lt;/a&gt;, and why you should use the Java Session API to handle them;&lt;/li&gt;&lt;li&gt;dealing with "raw" &lt;a href="http://www.javamex.com/tutorials/servlets/cookies.shtml"&gt;cookies&lt;/a&gt; when you need them;&lt;/li&gt;&lt;li&gt;deciding if you need to modify your Servlet to work with &lt;a href="http://www.javamex.com/tutorials/servlets/keep_alive.shtml"&gt;keep-alive connections&lt;/a&gt;: in some configurations, you may be beneficial to add some code to set the Content-Length header; we discuss how to find out if this is necessary.&lt;/li&gt;&lt;/ul&gt;Web programmers may also be interested in the section on &lt;a href="http://www.javamex.com/tutorials/ajax/index.shtml"&gt;Java AJAX programming&lt;/a&gt; currently in development.&lt;br /&gt;&lt;br /&gt;Comments and suggestions for extra material are always welcome, of course!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-8149979527831215609?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/8149979527831215609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=8149979527831215609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8149979527831215609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8149979527831215609'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/10/section-on-java-servlets.html' title='Section on Java Servlets'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-1370088923837886755</id><published>2008-08-12T17:46:00.002-05:00</published><updated>2008-08-12T17:55:11.200-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='synchronization'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='volatile'/><title type='text'>Improvements to section on 'volatile'</title><content type='html'>The site's section on the &lt;a href="http://www.javamex.com/tutorials/synchronization_volatile.shtml"&gt;Java volatile keywor&lt;/a&gt;d has been expanded to include information such as:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;a tabular comparison of volatile and synchronized&lt;/li&gt;&lt;li&gt;the &lt;a href="http://www.javamex.com/tutorials/synchronization_volatile_java_5.shtml"&gt;definition of volatile&lt;/a&gt; and its significante under Java 5&lt;/li&gt;&lt;li&gt;clearer guidance on &lt;a href="http://www.javamex.com/tutorials/synchronization_volatile_when.shtml"&gt;when to use volatile&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-1370088923837886755?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/1370088923837886755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=1370088923837886755' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1370088923837886755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/1370088923837886755'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/08/improvements-to-section-on-volatile.html' title='Improvements to section on &apos;volatile&apos;'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-6416102007379737881</id><published>2008-08-09T11:35:00.002-05:00</published><updated>2008-08-09T11:42:28.098-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='collections'/><category scheme='http://www.blogger.com/atom/ns#' term='sorting'/><title type='text'>New section on sorting</title><content type='html'>A new section on &lt;span style="font-weight: bold;"&gt;sorting&lt;/span&gt; has been added to the &lt;a href="http://www.javamex.com/tutorials/collections/index.shtml"&gt;Java Collections&lt;/a&gt; section of the web site. The section currently contains information on:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intrudction on sorting&lt;/li&gt;&lt;li&gt;Simple &lt;a href="http://www.javamex.com/tutorials/collections/sorting_simple_cases.shtml"&gt;sorting of strings&lt;/a&gt; (sorting a list or array of "naturally sortable" objects)&lt;/li&gt;&lt;li&gt;The &lt;a href="http://www.javamex.com/tutorials/collections/sorting_comparable_interface.shtml"&gt;Comparable interface&lt;/a&gt;, used to dictate the "natural sort order" of objects&lt;/li&gt;&lt;li&gt;The false economy of &lt;a href="http://www.javamex.com/tutorials/collections/sorting_comparable_compareto.shtml"&gt;compreTo optimisations&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.javamex.com/tutorials/collections/sorting_comparator.shtml"&gt;Comparators&lt;/a&gt;, used to dicate the sort order for a particular sort, or for classes whose sort order can't otherwise be specified.&lt;/li&gt;&lt;li&gt;An analysis of &lt;a href="http://www.javamex.com/tutorials/collections/sorting_java_algorithm_performance.shtml"&gt;Java's sort algorithm&lt;/a&gt;, including a look at its &lt;a href="http://www.javamex.com/tutorials/collections/sorting_java_algorithm_performance_2.shtml"&gt;performance&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;The latter section shows that, if your application makes repeated sorts of very small data sets, an alternative sort algorithm may be beneficial.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-6416102007379737881?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/6416102007379737881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=6416102007379737881' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6416102007379737881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/6416102007379737881'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/08/new-section-on-sorting.html' title='New section on sorting'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-2351598294111590397</id><published>2008-07-16T17:18:00.003-05:00</published><updated>2008-07-16T17:33:28.062-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hash table'/><category scheme='http://www.blogger.com/atom/ns#' term='hashing'/><category scheme='http://www.blogger.com/atom/ns#' term='hash code'/><category scheme='http://www.blogger.com/atom/ns#' term='hash set'/><category scheme='http://www.blogger.com/atom/ns#' term='hash map'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><title type='text'>Advanced use of hash codes</title><content type='html'>For many purposes, the plain old &lt;a href="http://www.javamex.com/tutorials/collections/using_4.shtml"&gt;HashMap&lt;/a&gt; and related &lt;a href="http://www.javamex.com/tutorials/collections/index.shtml"&gt;collections&lt;/a&gt; serve their purpose well and you don't need to worry too much about their gory details.&lt;br /&gt;&lt;br /&gt;But in some cases, some more advanced hashing-related techniques can help us save memory. In a new section on &lt;a href="http://www.javamex.com/tutorials/collections/hash_codes_advanced.shtml"&gt;advanced hashing techniques&lt;/a&gt;, we discuss using a &lt;a href="http://www.javamex.com/tutorials/collections/hash_codes_advanced_duplicate_elimination.shtml"&gt;BitSet to perform duplicate elimination&lt;/a&gt; with a certain degree of error but a significant memory saving. Knowing a little about the &lt;a href="http://www.javamex.com/tutorials/collections/hash_codes_advanced_statistics.shtml"&gt;statistics of hash codes&lt;/a&gt; helps us work out the degree of error involved. For example, with a BitSet taking up around 120K, we can perform duplicate elimination on tens of thousands of strings with a 'false positive' rate of around 2%. This is a technique that I use, for example, in gathering web site statistics, and in similar cases where I want the functionality of a hash map or hash set but can accept a certain degree of error. The technique allows what would otherwise be quite a large amount of data to be 'held in memory', thus significantly reducing database hits, for example.&lt;br /&gt;&lt;br /&gt;Have you been using hash codes in an interesting way that I haven't mentioned? If so, I'd be interested to hear.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-2351598294111590397?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/2351598294111590397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=2351598294111590397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2351598294111590397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/2351598294111590397'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/07/advanced-use-of-hash-codes.html' title='Advanced use of hash codes'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-5561000284429367166</id><published>2008-07-06T10:11:00.002-05:00</published><updated>2008-07-06T10:18:55.280-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='synchronization'/><category scheme='http://www.blogger.com/atom/ns#' term='threads'/><category scheme='http://www.blogger.com/atom/ns#' term='wait'/><category scheme='http://www.blogger.com/atom/ns#' term='producer-consumer'/><category scheme='http://www.blogger.com/atom/ns#' term='notify'/><title type='text'>The wait/notify mechanism in Java</title><content type='html'>One of the most commonly viewed articles on the Javamex site is our discussion of the &lt;a href="http://www.javamex.com/tutorials/synchronization_wait_notify.shtml"&gt;wait/notify mechanism&lt;/a&gt;. It appears that this is a particular topic of doubt among developers.&lt;br /&gt;&lt;br /&gt;The wait/notify mechanism is essentially used for one thread to "signal" or pass information to another thread. As of Java 5, the new concurrency classes provide more convenient alternatives to many common uses of wait() and notify(). See in particular:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The CountDownLatch class used to &lt;a href="http://www.javamex.com/tutorials/synchronization_wait_notify_4.shtml"&gt;co-ordinate threads&lt;/a&gt;;&lt;/li&gt;&lt;li&gt;The BlockingQueue classes uesd to implement a &lt;a href="http://www.javamex.com/tutorials/synchronization_producer_consumer_2.shtml"&gt;producer-consumer pattern&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;Suggested additions to these discussions are welcome (on this blog), as well as feedback on how well these articles helped you solve your problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-5561000284429367166?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/5561000284429367166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=5561000284429367166' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5561000284429367166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/5561000284429367166'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/07/waitnotify-mechanism-in-java.html' title='The wait/notify mechanism in Java'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7781838276784064381.post-8644095409834294606</id><published>2008-07-06T00:03:00.000-05:00</published><updated>2008-07-06T00:07:14.798-05:00</updated><title type='text'>Welcome!</title><content type='html'>Welcome to the news and development blog for the &lt;a href="http://www.javamex.com/"&gt;Javamex web site&lt;/a&gt;. The site contains various resources for new and experienced Java developers.&lt;br /&gt;&lt;br /&gt;Announcements about new and upcoming content will be posted to this blog. The blog also serves as a placeholder for comments about particular pages on the site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7781838276784064381-8644095409834294606?l=javamex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javamex.blogspot.com/feeds/8644095409834294606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7781838276784064381&amp;postID=8644095409834294606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8644095409834294606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7781838276784064381/posts/default/8644095409834294606'/><link rel='alternate' type='text/html' href='http://javamex.blogspot.com/2008/07/welcome.html' title='Welcome!'/><author><name>Neil Coffey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
