<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Faux&#039;s Blog &#187; Faux</title>
	<atom:link href="http://blog.prelode.com/author/faux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.prelode.com</link>
	<description>On Prelode&#039;s development.. once it begins, anyway..</description>
	<lastBuildDate>Wed, 04 Aug 2010 22:13:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Java&#8217;s ZipFile performance</title>
		<link>http://blog.prelode.com/2010/08/java-zipfile-performance/</link>
		<comments>http://blog.prelode.com/2010/08/java-zipfile-performance/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 21:40:48 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=127</guid>
		<description><![CDATA[I have an application that scales well up to around five threads a core, due to the mix of IO and CPU that it does.
That is, you give it more threads, and the throughput increases; the overall time goes down.
The following graph shows, in blue, the Sun&#8217;s java.util.zip.ZipFile time to complete a set of unzips [...]]]></description>
			<content:encoded><![CDATA[<p>I have an application that scales well up to around five threads a core, due to the mix of IO and CPU that it does.</p>
<p>That is, you give it more threads, and the throughput increases; the overall time goes down.</p>
<p>The following graph shows, in blue, the Sun&#8217;s java.util.zip.ZipFile time to complete a set of unzips on an increasing number of threads:</p>
<p><img src="http://b.goeswhere.com/zf-perf.png"/></p>
<p>Wait, what the cocking shit.</p>
<p><span id="more-127"></span></p>
<hr />
<p>The red line shows a pure Java implementation of ZipFile that scales expectedly well.  It&#8217;s slower on one thread, unfortunately, but faster than the synchronised Sun ZipFile with two threads.</p>
<p>As expected, the performance of Sun&#8217;s implementation massively increases (for large number of threads) if you manually synchronise on a global monitor around the ZipFile uses.  Red line unchanged:</p>
<p><img src="http://b.goeswhere.com/zf-sync-perf.png"/></p>
<hr />
<p>Y-axis: Seconds.<br />
X-axis: 2^(n-1) threads (i.e. levelling out at 3 due to it being tested on a quad-core machine and being entirely CPU bound).</p>
<p>Test: Opening rt.jar and summing all the bytes in files who&#8217;s path contains an &#8216;e&#8217;.<br />
File entirely cached by the file-system.  JIT warmed.  Heap significantly larger than required.</p>
<p>Vista x64, Sun Java 1.6u20 x64 (i.e. server vm).</p>
<p>java -cp <a href="http://jazzlib.sf.net/">jazzlib-binary-0.07.zip</a>:. <a href="http://b.goeswhere.com/ZipFileTester.java">ZipFileTester</a> somefile.zip</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2010/08/java-zipfile-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java/C++ polyglot</title>
		<link>http://blog.prelode.com/2010/04/java-cpp-polyglot/</link>
		<comments>http://blog.prelode.com/2010/04/java-cpp-polyglot/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 20:14:08 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=100</guid>
		<description><![CDATA[Today I discovered Java&#8217;s &#8220;inline C++&#8221; keyword, //\u000a/*, which makes a Java/C++ polyglot pretty easy:

//\u000a/*
#include &#60;iostream&#62;
#define private
#define public
#define static
#define void int
struct {
&#160;&#160;std::ostream &#038;println(const char *c) {
&#160;&#160;&#160;&#160;return std::cout &#60;&#60; c < < std::endl;
&#160;&#160;}
} out;
//*/
/*\u002a/
import static java.lang.System.out;
public class Polyglot {
//*/
&#160;&#160;public static void main(/*\u002a/String[] args//*/
&#160;&#160;&#160;&#160;&#160;&#160;) {
&#160;&#160;&#160;&#160;out.println("Hello from whatever language this is!");
&#160;&#160;}
/*\u002a/
}
// */

Eclipse deals.. okay.  The red-underlining in [...]]]></description>
			<content:encoded><![CDATA[<p>Today I discovered Java&#8217;s &#8220;inline C++&#8221; keyword, //\u000a/*, which makes a Java/C++ <a href="http://en.wikipedia.org/wiki/Polyglot_(computing)">polyglot</a> pretty easy:</p>
<p><code><br />
//\u000a/*<br />
#include &lt;iostream&gt;</p>
<p>#define private<br />
#define public<br />
#define static<br />
#define void int<br />
struct {<br />
&nbsp;&nbsp;std::ostream &#038;println(const char *c) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;return std::cout &lt;&lt; c < < std::endl;<br />
&nbsp;&nbsp;}<br />
} out;</p>
<p>//*/<br />
/*\u002a/<br />
import static java.lang.System.out;</p>
<p>public class Polyglot {<br />
//*/<br />
&nbsp;&nbsp;public static void main(/*\u002a/String[] args//*/<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;out.println("Hello from whatever language this is!");<br />
&nbsp;&nbsp;}</p>
<p>/*\u002a/<br />
}<br />
// */<br />
</code></p>
<p>Eclipse deals.. <a href="http://faux.uwcs.co.uk/eclipse-polyglot.png">okay</a>.  The red-underlining in the commented sections is for the spelling. &lt;3<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2010/04/java-cpp-polyglot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>InstallShield unpacker</title>
		<link>http://blog.prelode.com/2010/04/installshield-unpacker/</link>
		<comments>http://blog.prelode.com/2010/04/installshield-unpacker/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 13:53:07 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=97</guid>
		<description><![CDATA[I couldn&#8217;t find anything that would unpack the (entirely unnecessary) Nokia map loader set-up application, which is some InstallShield 7 nastiness.
deshield can.  Given the number of magic numbers in it, I fully expect it not to work with other installers.
Why do they bother?  The data isn&#8217;t even compressed; it&#8217;s just bit-twiddled a little [...]]]></description>
			<content:encoded><![CDATA[<p>I couldn&#8217;t find anything that would unpack the (<a href="http://handphone-solution.blogspot.com/2009/07/direct-download-for-ovi-maps-30-without.html">entirely unnecessary</a>) <a href="http://maps.nokia.com/ovi-services-and-apps/ovi-maps/downloads">Nokia map loader</a> set-up application, which is some InstallShield 7 nastiness.</p>
<p><a href="http://git.goeswhere.com/?p=deshield.git;a=blob;f=src/Deshield.java;h=8a74acececdb237829b9f2f694740bd47ec25ac5;hb=HEAD">deshield</a> can.  Given the number of magic numbers in it, I fully expect it not to work with other installers.</p>
<p>Why do they bother?  The data isn&#8217;t even compressed; it&#8217;s just bit-twiddled a little with the file-name, and this magic number: [ 0x13, 0x35, 0x86, 0x07 ].</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2010/04/installshield-unpacker/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tro^WMicrobenchmarks!</title>
		<link>http://blog.prelode.com/2010/04/trowmicrobenchmarks/</link>
		<comments>http://blog.prelode.com/2010/04/trowmicrobenchmarks/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 18:51:41 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=91</guid>
		<description><![CDATA[This blog is far too low in trolling.  As a start, everyone knows that git is fast and svn is slow, but I wasn&#8217;t aware quite how shocking the difference was.
The test: committing a file that slowly increases in size, and a new file, 200 times.
git: 2 seconds.
darcs: 10 seconds.
bzr: 70 seconds.
svn: 200 seconds.
No [...]]]></description>
			<content:encoded><![CDATA[<p>This blog is far too low in trolling.  As a start, everyone knows that git is fast and svn is slow, but I wasn&#8217;t aware quite how shocking the difference was.</p>
<p>The test: committing a file that slowly increases in size, and a new file, 200 times.</p>
<p><strong>git</strong>: 2 seconds.<br />
<strong>darcs</strong>: 10 seconds.<br />
<strong>bzr</strong>: 70 seconds.<br />
<strong>svn</strong>: 200 seconds.</p>
<p>No comment.</p>
<p>Reproduction steps follow.<br />
<span id="more-91"></span></p>
<p>bzr 2.0.3 and git 1.5.6.5:<br />
<code>time ($CMD init &amp;&amp; for i in $(seq 200); do echo $i &gt;&gt; foo &#038;&#038; touch bar$i &amp;&amp; $CMD add * &&gt;/dev/null &amp;&amp; $CMD commit -m "Whoosh"; done)</code></p>
<p>darcs (which, admittedly, took about 200 seconds to work out how to commit to) 2.0.2:<br />
<code>time ($CMD init &amp;&amp; for i in $(seq 200); do echo $i &gt;&gt; foo &amp;&amp; touch bar$i &amp;&amp; $CMD add * &amp;&gt;/dev/null &amp;&amp; $CMD record -a -Aa -m "Whoosh"; done)</code></p>
<p>svn 1.5.1:<br />
<code>rm -rf ../repo; svnadmin create ../repo &#038;&#038; svn co file:///var/tmp/repo . &#038;&#038; time (for i in $(seq 200); do echo $i &gt;&gt; foo &#038;&#038; touch bar$i &#038;&#038; $CMD add * &amp;&amp; $CMD commit -m "Whoosh"; done)</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2010/04/trowmicrobenchmarks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>But Java /can/ do that!</title>
		<link>http://blog.prelode.com/2010/03/but-java-can-do-that/</link>
		<comments>http://blog.prelode.com/2010/03/but-java-can-do-that/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 09:05:25 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=87</guid>
		<description><![CDATA[I recently attended a talk at FOSDEM by Miguel de Icaza, a fellow enemy of &#8220;Free&#8221; software.
He, like most .NET users, is desperately seeking features to differentiate his second-rate platform from the wonderfulnessness of Java.
He showed .NET expressions, a wonderful feature whereby the actual nature of a predicate can be retrieved at runtime and optimal, [...]]]></description>
			<content:encoded><![CDATA[<p>I recently attended a talk at FOSDEM by <a href="http://tirania.org/blog/">Miguel de Icaza</a>, a fellow enemy of &#8220;Free&#8221; software.</p>
<p>He, like most .NET users, is desperately seeking features to differentiate his second-rate platform from the wonderfulnessness of Java.</p>
<p>He showed .NET expressions, a wonderful feature whereby the actual nature of a predicate can be retrieved at runtime and optimal, say, SQL can be built to match it.  </p>
<p>He, however, claimed that Java lacks this feature.  This is not the case.</p>
<p><a href="http://git.goeswhere.com/?p=dmnp.git;a=blob;f=expr/src/test/java/com/goeswhere/dmnp/expr/ExpressionTest.java">ExpressionTest</a> shows various uses of this in Java; basically:</p>
<p><code>Expression.toSQL(new Predicate<foodto>() { @Override public boolean matches(FooDTO t) { t.a == 7; } });</foodto></code></p>
<p>will return:</p>
<p><code>(a = 7)</code></p>
<p>Obviously this remains slightly more verbose while the Java lambda proposals are finalised, but the feature is hardly missing!</p>
<p>Similarily,<br />
<code>return (t.a == 7 || t.a == 8 || t.a == 9) &#038;&#038; "pony".equals(t.b);</code></p>
<p>becomes:</p>
<p><code>(a = 7 AND b = 'pony') OR<br />
(a = 8 AND b = 'pony') OR<br />
(a = 9 AND b = 'pony')</code></p>
<p>And, etc.</p>
<p><a href="http://git.goeswhere.com/?p=dmnp.git;a=tree;f=expr/src/main/java/com/goeswhere/dmnp/expr">The implementation</a>, if the devil compels you to look.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2010/03/but-java-can-do-that/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Catchlogger</title>
		<link>http://blog.prelode.com/2010/02/catchlogger/</link>
		<comments>http://blog.prelode.com/2010/02/catchlogger/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 11:06:36 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=84</guid>
		<description><![CDATA[Post seriousness: 70%.
Catchlogger [jar] [git src] checks that exceptions are being logged properly.
It&#8217;s entirely fallible, but, if your codebase is prone to catching and ignoring exception, and you use log4j, it&#8217;s Very Helpful.
For example:
try {
  foo();
} catch (IOException e) {
  logger.error("bar: failed to foo", e);
}
This is fine; an error has occurred and it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Post seriousness: 70%.</p>
<p><a href="http://b.goeswhere.com/catchlogger-ea10174865343dc2b75eee69cc40b319f5981555.jar">Catchlogger [jar]</a> [<a href="http://git.goeswhere.com/?p=dmnp.git;a=tree;f=ue/src/main/java/com/goeswhere/dmnp/ue;h=3b46444faa5c388b625e9ad8c98c0cd851686a79;hb=HEAD">git src</a>] checks that exceptions are being logged properly.</p>
<p>It&#8217;s entirely fallible, but, if your codebase is prone to catching and ignoring exception, and you use log4j, it&#8217;s Very Helpful.</p>
<p>For example:</p>
<pre>try {
  foo();
} catch (IOException e) {
  logger.error("bar: failed to foo", e);
}</pre>
<p>This is fine; an error has occurred and it&#8217;s full stacktrace will be placed in the log4j configured log.</p>
<pre>try {
  foo();
} catch (IOException e) {
  logger.error(e);
  logger.info("oh noes", e);
  e.printStackTrace();
}</pre>
<p>None of these, however, will do anything useful.  The first logs just the toString() to the error log, info is too low-level to log exceptions at, and printStackTrace() doesn&#8217;t necessarily go anywhere at all.</p>
<p>For this block, catchlogger will issue:<br />
<code>IOException e unused at (Test.java:15) in public main(String[] args) in path.</code></p>
<p>The JAR is huge as it pulls in the entire Eclipse compiler to parse the source.  BSD/MIT licensed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2010/02/catchlogger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Free Software Definition</title>
		<link>http://blog.prelode.com/2009/04/the-free-software-definition/</link>
		<comments>http://blog.prelode.com/2009/04/the-free-software-definition/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 15:58:33 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=83</guid>
		<description><![CDATA[The GNU project publishes a list of four Freedoms and recommend a single license*, the GPL.
They claim the word &#8220;Free&#8221; for software available under the GPL.
Let us consider some developer freedoms, and some alternative licenses for blocks of code:

  td { text-align: center }
  th { padding: .5em }
  td { padding: [...]]]></description>
			<content:encoded><![CDATA[<p>The GNU project publishes a <a href="http://www.gnu.org/philosophy/free-sw.html">list of four Freedoms</a> and recommend a single license*, the <a href="http://www.gnu.org/licenses/licenses.html#GPL">GPL</a>.</p>
<p>They claim the word &#8220;Free&#8221; for software available under the GPL.</p>
<p>Let us consider some developer freedoms, and some alternative licenses for blocks of code:</p>
<style type="text/css">
  td { text-align: center }
  th { padding: .5em }
  td { padding: .2em }
  td,th { border: 1px solid black }
  .tick { background-color: #dfd }
</style>
<table>
<tr>
<th />
<th>Link / Use</th>
<th>Four boring freedoms</th>
<th>Reuse the code</th>
<th>Sue author</th>
</tr>
<tr>
<td>Proprietary</td>
<td></td>
<td></td>
<td></td>
<td class="tick">✓</td>
</tr>
<tr>
<td>GPL</td>
<td></td>
<td class="tick">✓</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Freeware**</td>
<td class="tick">✓</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>LGPL</td>
<td class="tick">✓</td>
<td class="tick">✓</td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/BSD_license">BSD</a>/<a href="http://en.wikipedia.org/wiki/MIT_license">MIT</a>/<a href="http://en.wikipedia.org/wiki/ISC_license">ISC</a>/etc.</td>
<td class="tick">✓</td>
<td class="tick">✓</td>
<td class="tick">✓</td>
<td></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Public_domain">PD</a>/<a href="http://sam.zoy.org/wtfpl/">WTFPL</a>***/etc.</td>
<td class="tick">✓</td>
<td class="tick">✓</td>
<td class="tick">✓</td>
<td class="tick">✓</td>
</tr>
</table>
<p>
Looking at this, it&#8217;s reasonably obvious to me which licenses offer the most Freedom to the developer; that being the BSD/MIT/ISC family.</p>
<p>These are the licenses I use personally, and the licenses I use to define Free Software; I don&#8217;t see how it can be taken any other way.</p>
<p><span id="more-83"></span></p>
<p>&#8211;</p>
<ul>
<li><strong>Link / use</strong>: The license allows you to use the software as a whole, <strong>for any purpose</strong> (i.e. it&#8217;s free for use in assisting proprietary software and terrorism) (like freedom 0, but applicable to libraries).</li>
<li><strong>Four boring freedoms</strong>: Follows the four freedoms outlined by the GNU project.</li>
<li><strong>Reuse the code</strong>: The freedom to study and reuse the code, <strong>for any purpose****</strong> (especially for terroism).</li>
<li><strong>Sue the author</strong>: Generally, with proprietary software and with non-software licenses, you have the right to hold the author responsible for their work, at least, up to a certain value. The author may want to disown this responsibility.</li>
</ul>
<p>&#8211;</p>
<p>* The <a href="http://www.gnu.org/licenses/why-not-lgpl.html">LGPL is discouraged</a>, the GDFL is not for software (<a href="http://wiki.debian.org/DFSGLicenses#LicensesthatareDFSG-incompatible" title="List of licenses which are not DFSG compliant">and generally considered non-free anyway</a>), the <a title="GNU Affero General Public License" href="http://www.gnu.org/licenses/licenses.html#AGPL">AGPL</a> is an extension of the GPL.</p>
<p>** I can&#8217;t think of nearly any prominent Freeware libraries, either.  <a href="http://www.foobar2000.org/">Foobar2000</a>&#8217;s SDK?</p>
<p>*** The WTFPL&#8217;s FAQ covers &#8220;Why is there no “no warranty” clause?&#8221;, and also why Public Domain isn&#8217;t really a license.</p>
<p>**** Apparently there&#8217;s some confusion as to what I mean by &#8220;for any purpose&#8221;. I include using the code inside other applications, regardless of their license, as a purpose.  That is, the GPL does not allow code reuse <strong>for any purpose</strong>, because it does not allow code reuse in proprietary applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2009/04/the-free-software-definition/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Finalizers considered harmful</title>
		<link>http://blog.prelode.com/2009/04/finalizers-considered-harmful/</link>
		<comments>http://blog.prelode.com/2009/04/finalizers-considered-harmful/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 14:24:23 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=82</guid>
		<description><![CDATA[I diagnosed an interesting problem at work recently; our application, when running on some enterprise platforms was eventually (over a number of days) running out of memory, grinding to a halt then fatally OutOfMemoryErroring, regardless of how much heap it was given.
Eclipse Memory Analysis Tool (via. DTFJ for the IBM heapdumps) is rather resource hungry, [...]]]></description>
			<content:encoded><![CDATA[<p>I diagnosed an interesting problem at work recently; our application, when running on some enterprise platforms was eventually (over a number of days) running out of memory, grinding to a halt then fatally OutOfMemoryErroring, regardless of how much heap it was given.</p>
<p><a href="http://www.eclipse.org/mat/">Eclipse Memory Analysis Tool</a> (via. <a href="http://www.ibm.com/developerworks/java/jdk/tools/mat.html">DTFJ</a> for the IBM heapdumps) is rather resource hungry, needing massively increased the heap (~7gb, i.e. can&#8217;t be run on an 32-bit machine) and stack size (~8mb).  However, once the heap dump had been loaded (1h+), it was reasonably obvious (after <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=266231" title="Eclipse bug #266231 (resolved: fixed)">#266231</a>) what was happening:</p>
<p>The finalizers wern&#8217;t being processed fast enough.</p>
<p>The finalization thread is run at a lower priority, and, seemingly, on the configurations on these machines/OS/JVM combinations, it was getting no time at all.</p>
<p>For historical reasons, quite a few large classes in our codebase have:</p>
<p><code>void finalize() {}</code></p>
<p>..in, that is, finalizers that do nothing at all.  These empty finalizers still have to be run before the object can be collected, however, so they simply wern&#8217;t, quickly leaking memory. The more that was leaked, the slower the JVM was running, so the less time the finalization thread had, a vicious cycle.</p>
<p>I couldn&#8217;t find many other people experiencing this on the internet, I can only assume that people simply don&#8217;t use finalizers, which can only be a good thing.</p>
<p>One guy had a rather more interesting solution:<br />
<code><br />
public static void main(String[] args)<br />
{<br />
&nbsp;&nbsp;new Object()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;@Override protected void finalize() throws Throwable<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super.finalize();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thread.currentThread().setPriority(Thread.MAX_PRIORITY);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;};<br />
&nbsp;&nbsp;// ...<br />
}<br />
</code></p>
<p>The worst thing is, I can&#8217;t really see any disadvantages to this&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2009/04/finalizers-considered-harmful/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Earth &#8220;offline installer&#8221;</title>
		<link>http://blog.prelode.com/2009/04/google-earth-offline-installer/</link>
		<comments>http://blog.prelode.com/2009/04/google-earth-offline-installer/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 13:28:17 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=81</guid>
		<description><![CDATA[Google seem to be of the incorrect opion that you want your machine infected with Google Update.
The Google Earth download is actually just a cunningly disguised Google Update installer, and it seems to think it needs elevation.
It extracts %TEMP%\GUXXXXX.tmp\GoogleUpdate.exe, then tries to run:
GoogleUpdate.exe /install "appguid={74AF07D8-FB8F-4d51-8AC7-927721D56EBB}&#038;appname=Google%20Earth&#038;needsadmin=true" /installelevated
Instead of this,
GoogleUpdate.exe /install "appguid={74AF07D8-FB8F-4d51-8AC7-927721D56EBB}&#038;appname=Google%20Earth"
..will happily download and extract Google [...]]]></description>
			<content:encoded><![CDATA[<p>Google seem to be of the incorrect opion that you want your machine infected with Google Update.</p>
<p>The <a href="http://earth.google.com/download-earth.html">Google Earth download</a> is actually just a cunningly disguised Google Update installer, and it seems to think it needs elevation.</p>
<p>It extracts %TEMP%\GUXXXXX.tmp\GoogleUpdate.exe, then tries to run:</p>
<p><code>GoogleUpdate.exe /install "appguid={74AF07D8-FB8F-4d51-8AC7-927721D56EBB}&#038;appname=Google%20Earth&#038;needsadmin=true" /installelevated</code></p>
<p>Instead of this,</p>
<p><code>GoogleUpdate.exe /install "<strong>appguid={74AF07D8-FB8F-4d51-8AC7-927721D56EBB}&#038;appname=Google%20Earth</strong>"</code></p>
<p>..will happily download and extract Google Earth to %TEMP%\7ZipSfx.XXX.  This is the unpacked offline installer, but the installer itself still attempts to elevate.  Luckily, it&#8217;s already unpacked, in:</p>
<p><code>%TEMP%\7ZipSfx.XXX\program files\Google\Google Earth</code></p>
<p>Just copy this folder to somewhere convenient and run googleearth.exe.</p>
<p>&#8211;</p>
<p>For reference for other apps, the quoted argument to GoogleUpdate.exe is the last &#8220;line&#8221; in the downloaded GoogleEarthSetup.exe.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2009/04/google-earth-offline-installer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Noelevate</title>
		<link>http://blog.prelode.com/2008/12/noelevate/</link>
		<comments>http://blog.prelode.com/2008/12/noelevate/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 00:17:37 +0000</pubDate>
		<dc:creator>Faux</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.prelode.com/?p=79</guid>
		<description><![CDATA[In Windows Vista, Microsoft added manifests, a way for developers to require that their applications run as administrator, or not at all. This takes control away from the user, me, who I trust, and gives it to some developer (who I might not). While it&#8217;s possible to edit the file to remove these manifests, this [...]]]></description>
			<content:encoded><![CDATA[<p>In Windows Vista, Microsoft added manifests, a way for developers to <strong>require</strong> that their applications run as administrator, or not at all. This takes control away from the user, me, who I trust, and gives it to some developer (who I might not). While it&#8217;s possible to edit the file to remove these manifests, this is hard to do safely and automatically.</p>
<p>I thought it&#8217;d be fun to directly fix the problem.</p>
<p>It seems that, like <a href="http://blog.prelode.com/?p=69"><em>some other things</em></a>, as far as I can see, there&#8217;s no support for this.</p>
<p>Luckily, it&#8217;s an even smaller patch than last time. I won&#8217;t show it, it&#8217;s simply erasure of a <code>jmp</code>. It&#8217;s a terrible solution to the problem, and the binary only contains fixes for <code>kernel32.dll</code> as seen on x64 SP1 and x32 SP1 as of now, it could break at any point. I implore nobody to use this utility seriously.</p>
<p><a href="http://b.goeswhere.com/noelev.exe">noelev</a> (<a href="http://b.goeswhere.com/noelev.exe.asc">asc</a>) (<a href="http://b.goeswhere.com/noelev.cpp">cpp</a>) (<a href="http://b.goeswhere.com/noelev.pdb.7z">pdb</a>) works much like the reverse of the unix &#8220;sudo&#8221; command, running a command via. it makes it run <strong>without</strong> elevation.</p>
<p>It&#8217;s not infectious, so it won&#8217;t work for all applications (like some setup applications that unpack other installers), and, of course, some applications actually don&#8217;t work without elevation.</p>
<p>A lot of Windows components actually appear to cope relatively gracefully with the unexpected lack of permissions, unlike, say, the nVidia components. I was hoping to find an entertaining failure to screenshot, but they&#8217;re all boring. <img src='http://blog.prelode.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prelode.com/2008/12/noelevate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
