<?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>Lab49 Blog</title>
	<atom:link href="http://blog.lab49.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.lab49.com</link>
	<description>Technology and industry insights from Lab49, Inc.</description>
	<lastBuildDate>Mon, 08 Feb 2010 22:27:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Standing up at your scrum</title>
		<link>http://martinaharris.com/2010/02/standing-up-and-be-counted/</link>
		<comments>http://martinaharris.com/2010/02/standing-up-and-be-counted/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 22:27:56 +0000</pubDate>
		<dc:creator>Martin Harris</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>

		<guid isPermaLink="false">http://martinaharris.com/?p=808</guid>
		<description><![CDATA[The scrum stand up meeting, is sometimes renamed to &#8220;the scrum&#8221;.  This is fine but remember you are supposed to stand up.  The reasoning behind this is it keeps the meeting short.  People do not become too comfortable.  The idea is very simple.  Quickly broadcast any information from the scrum master, then whizz around the [...]]]></description>
			<content:encoded><![CDATA[<p>The scrum stand up meeting, is sometimes renamed to &#8220;the scrum&#8221;.  This is fine but remember you are supposed to stand up.  The reasoning behind this is it keeps the meeting short.  People do not become too comfortable.  The idea is very simple.  Quickly broadcast any information from the scrum master, then whizz around the [...]</p>
]]></content:encoded>
			<wfw:commentRss>http://martinaharris.com/2010/02/standing-up-and-be-counted/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Estimates are not commitments!</title>
		<link>http://martinaharris.com/2010/02/esti-no-commit/</link>
		<comments>http://martinaharris.com/2010/02/esti-no-commit/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 05:00:28 +0000</pubDate>
		<dc:creator>Martin Harris</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>

		<guid isPermaLink="false">http://martinaharris.com/?p=752</guid>
		<description><![CDATA[Probably one of the most common mistakes in Software Development is to allow Estimates to become Commitments.  This article looks at story point estimation in scrum, and how velocity is a better tool for monitoring progress through to delivery.  If your interested in the arguments that can be presented to the business for velocity metrics over estimation for setting delivery dates, read on. ]]></description>
			<content:encoded><![CDATA[<p>Probably one of the most common mistakes in Software Development is to allow Estimates to become Commitments.  This article looks at story point estimation in scrum, and how velocity is a better tool for monitoring progress through to delivery.  If your interested in the arguments that can be presented to the business for velocity metrics over estimation for setting delivery dates, read on. </p>
]]></content:encoded>
			<wfw:commentRss>http://martinaharris.com/2010/02/esti-no-commit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto-scaling in Azure with PowerShell Cmdlets</title>
		<link>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/bOVLX9xG_58/</link>
		<comments>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/bOVLX9xG_58/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 02:48:45 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://dougfinke.com/blog/index.php/2010/02/07/auto-scaling-in-azure-with-powershell-cmdlets/</guid>
		<description><![CDATA[This post Auto-scaling in Azure shows a proof of concept for auto-scaling an Azure Solution and the different options that you have for implementing a similar solution.
At the end, the author provides a PowerShell example using the Windows Azure Service Management CmdLets
Add-PSSnapin AzureManagementToolsSnapIn            

Get-HostedService [...]]]></description>
			<content:encoded><![CDATA[<p>This post <a href="http://blogs.msdn.com/gonzalorc/archive/2010/02/07/auto-scaling-in-azure.aspx">Auto-scaling in Azure</a> shows a proof of concept for auto-scaling an Azure Solution and the different options that you have for implementing a similar solution.</p>
<p>At the end, the author provides a PowerShell example using the <a href="http://code.msdn.microsoft.com/azurecmdlets">Windows Azure Service Management CmdLets</a></p>
<pre class="PowerShellColorizedScript"><span style="color: #0000ff">Add-PSSnapin</span> <span style="color: #8a2be2">AzureManagementToolsSnapIn</span>            

<span style="color: #0000ff">Get-HostedService</span> <span style="color: #ff4500">$serviceName</span> <span style="color: #000080">-Certificate</span> <span style="color: #ff4500">$cert</span> <span style="color: #000080">-SubscriptionId</span> <span style="color: #ff4500">$subId</span> <span style="color: #a9a9a9">|</span>
<span style="color: #0000ff">Get-Deployment</span> <span style="color: #000080">-Slot</span> <span style="color: #8a2be2">Production</span> <span style="color: #a9a9a9">|</span>
<span style="color: #0000ff">Set-DeploymentConfiguration</span> <span style="color: #000000">`
</span>  <span style="color: #000000">{</span><span style="color: #ff4500">$_</span><span style="color: #a9a9a9">.</span><span style="color: #000000">RolesConfiguration</span><span style="color: #a9a9a9">[</span><span style="color: #ff4500">$roleName</span><span style="color: #a9a9a9">]</span><span style="color: #a9a9a9">.</span><span style="color: #000000">InstancesCount</span><span style="color: #a9a9a9">+=</span><span style="color: #800080">1</span><span style="color: #000000">}</span>
            </pre>
<p><img src="http://feeds.feedburner.com/~r/DevelopmentInABlink/~4/bOVLX9xG_58" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/bOVLX9xG_58/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FlatFrog gets $18m – challenges the MS surface</title>
		<link>http://martinaharris.com/2010/02/flatfrog-gets-18m-challenges-the-surface/</link>
		<comments>http://martinaharris.com/2010/02/flatfrog-gets-18m-challenges-the-surface/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 22:54:14 +0000</pubDate>
		<dc:creator>Martin Harris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://martinaharris.com/?p=803</guid>
		<description><![CDATA[Its great to see some competition finally in the surface race.  FlatFrog have got a siseable funding according to this gear crunch article.  I can see all kinds of uses for this technology, but currently its very expensive.  I wish FlatFrog luck in producing a cheaper alternative.
]]></description>
			<content:encoded><![CDATA[<p>Its great to see some competition finally in the surface race.  FlatFrog have got a siseable funding according to this gear crunch article.  I can see all kinds of uses for this technology, but currently its very expensive.  I wish FlatFrog luck in producing a cheaper alternative.</p>
]]></content:encoded>
			<wfw:commentRss>http://martinaharris.com/2010/02/flatfrog-gets-18m-challenges-the-surface/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creation, dynamic loading and instrumentation with javaagents</title>
		<link>http://feedproxy.google.com/~r/dhruba/lab49/~3/kALD_maFmvU/</link>
		<comments>http://feedproxy.google.com/~r/dhruba/lab49/~3/kALD_maFmvU/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 22:26:17 +0000</pubDate>
		<dc:creator>Dhruba Bandopadhyay</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Lab49]]></category>

		<guid isPermaLink="false">http://dhruba.name/?p=1516</guid>
		<description><![CDATA[Sometime back I had to delve into the depths of how one could dynamically and programmatically load a javaagent at runtime &#8211; in other words how a javaagent could be attached to a running process. Since then I&#8217;ve been meaning to blog my findings. Finally, after quite some time, I&#8217;ve got around to it but [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>Sometime back I had to delve into the depths of how one could dynamically and programmatically load a javaagent at runtime &#8211; in other words how a javaagent could be attached to a running process. Since then I&#8217;ve been meaning to blog my findings. Finally, after quite some time, I&#8217;ve got around to it but here I take the opportunity to expand the scope of the article to a complete treatment of how to create a javaagent, load it statically at startup or dynamically at runtime and also how to perform instrumentation of a simple class. As always the code will reside in an eclipse maven project that will be made available for <a href="http://dhruba.name/mint/pepper/tillkruess/downloads/tracker.php?url=/static/javaagent-examples.tgz">download</a>.</p>
<h3>Introduction</h3>
<p>Java agents are self contained components through which application classes pass at the level of byte code instructions in the form of byte arrays. They were introduced in java5 along with the powerful java.lang.instrument package. Java agents can be loaded statically at startup or dynamically (programmatically) at runtime to attach to a running process in a fail-safe fashion.</p>
<h3>Lifecycle of a javaagent</h3>
<p>The most important thing to understand is the lifecycle of a javaagent and its behaviour in relation to the application itself. The lifecycle hook points are as follows.</p>
<ul>
<li>PreMain &#8211; The PreMain method is invoked first prior to running the main method. This is the hookpoint for loading the javaagent statically at startup.</li>
<li>Main &#8211; The main method is always invoked after the PreMain invocation.</li>
<li>AgentMain &#8211; The AgentMain method can be invoked at any time before or after the Main method. This hookpoint is for loading the javaagent dynamically at runtime and attaching to a running process.</li>
</ul>
<h3>Creation of a javaagent</h3>
<p>In order to create a java agent you must first define your chosen hook points from the lifecycle above as below.</p>
<pre>
package name.dhruba.javaagent;

import java.lang.instrument.Instrumentation;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyJavaAgent {

    static final Logger logger = LoggerFactory.getLogger(MyJavaAgent.class);

    private static Instrumentation instrumentation;

    /**
     * JVM hook to statically load the javaagent at startup.
     *
     * After the Java Virtual Machine (JVM) has initialized, the premain method
     * will be called. Then the real application main method will be called.
     *
     * @param args
     * @param inst
     * @throws Exception
     */
    public static void premain(String args, Instrumentation inst) throws Exception {
        logger.info("premain method invoked with args: {} and inst: {}", args, inst);
        instrumentation = inst;
        instrumentation.addTransformer(new MyClassFileTransformer());
    }

    /**
     * JVM hook to dynamically load javaagent at runtime.
     *
     * The agent class may have an agentmain method for use when the agent is
     * started after VM startup.
     *
     * @param args
     * @param inst
     * @throws Exception
     */
    public static void agentmain(String args, Instrumentation inst) throws Exception {
        logger.info("agentmain method invoked with args: {} and inst: {}", args, inst);
        instrumentation = inst;
        instrumentation.addTransformer(new MyClassFileTransformer());
    }

    /**
     * Programmatic hook to dynamically load javaagent at runtime.
     */
    public static void initialize() {
        if (instrumentation == null) {
            MyJavaAgentLoader.loadAgent();
        }
    }

}
</pre>
<p>Once you&#8217;ve defined your hook points you must make the JVM aware by putting them in a manifest file.</p>
<pre>
Main-Class: name.dhruba.javaagent.MyMainClass
Agent-Class: name.dhruba.javaagent.MyJavaAgent
Can-Redefine-Classes: true
Can-Retransform-Classes: true
Premain-Class: name.dhruba.javaagent.MyJavaAgent
</pre>
<p>In the example project I&#8217;m doing so using maven and the maven assembly plugin which also packages the project as a single all inclusive uber executable jar for ease of testing.</p>
<pre>
&lt;plugin&gt;
  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
  &lt;executions&gt;
    &lt;execution&gt;
      &lt;goals&gt;
        &lt;goal&gt;attached&lt;/goal&gt;
      &lt;/goals&gt;
      &lt;phase&gt;package&lt;/phase&gt;
      &lt;configuration&gt;
        &lt;descriptorRefs&gt;
          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
        &lt;/descriptorRefs&gt;
        &lt;archive&gt;
          &lt;manifest&gt;
            &lt;mainClass&gt;name.dhruba.javaagent.MyMainClass&lt;/mainClass&gt;
          &lt;/manifest&gt;
          &lt;manifestEntries&gt;
            &lt;Premain-Class&gt;name.dhruba.javaagent.MyJavaAgent&lt;/Premain-Class&gt;
            &lt;Agent-Class&gt;name.dhruba.javaagent.MyJavaAgent&lt;/Agent-Class&gt;
            &lt;Can-Redefine-Classes&gt;true&lt;/Can-Redefine-Classes&gt;
            &lt;Can-Retransform-Classes&gt;true&lt;/Can-Retransform-Classes&gt;
          &lt;/manifestEntries&gt;
        &lt;/archive&gt;
      &lt;/configuration&gt;
    &lt;/execution&gt;
  &lt;/executions&gt;
&lt;/plugin&gt;
</pre>
<h3>Instrumenting classes</h3>
<p>Within the javaagent hook points one can define <code>java.lang.instrument.ClassFileTransformer</code> implementations that are invoked for all classes being loaded within an application. These receive classes as byte arrays and have the option of redefining them also in terms of byte arrays. Here I provide an example class file transformation.</p>
<p>The following User pojo returns &#8216;foo&#8217; as its name.</p>
<pre>
package name.dhruba.user;

public class MyUser {

    public String getName() {
        return "foo";
    }

}
</pre>
<p>The following class file transformer (using ASM) redefines the User pojo to return &#8216;bar&#8217; instead.</p>
<pre>
package name.dhruba.javaagent;

import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
import java.security.ProtectionDomain;

import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyClassFileTransformer implements ClassFileTransformer, Opcodes {

    static final Logger logger = LoggerFactory.getLogger(MyClassFileTransformer.class);

    @Override
    public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined,
            ProtectionDomain protectionDomain, byte[] classfileBuffer)
            throws IllegalClassFormatException {
        logger.info("class file transformer invoked for className: {}", className);

        if (className.equals("name/dhruba/user/MyUser")) {

            ClassWriter cw = new ClassWriter(0);
            MethodVisitor mv;

            cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, "name/dhruba/user/MyUser", null,
                    "java/lang/Object", null);

            cw.visitSource(null, null);

            {
                mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
                mv.visitCode();
                Label l0 = new Label();
                mv.visitLabel(l0);
                mv.visitLineNumber(3, l0);
                mv.visitVarInsn(ALOAD, 0);
                mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
                mv.visitInsn(RETURN);
                Label l1 = new Label();
                mv.visitLabel(l1);
                mv.visitLocalVariable("this", "Lname/dhruba/user/MyUser;", null, l0, l1, 0);
                mv.visitMaxs(1, 1);
                mv.visitEnd();
            }
            {
                mv = cw.visitMethod(ACC_PUBLIC, "getName", "()Ljava/lang/String;", null, null);
                mv.visitCode();
                Label l0 = new Label();
                mv.visitLabel(l0);
                mv.visitLineNumber(6, l0);
                mv.visitLdcInsn("bar");
                mv.visitInsn(ARETURN);
                Label l1 = new Label();
                mv.visitLabel(l1);
                mv.visitLocalVariable("this", "Lname/dhruba/user/MyUser;", null, l0, l1, 0);
                mv.visitMaxs(1, 1);
                mv.visitEnd();
            }
            cw.visitEnd();

            return cw.toByteArray();
        }

        return classfileBuffer;
    }

}
</pre>
<p>Note that this is not standard AOP or proxy logic. The class file transformer is literally redefining the bytecode instructions incrementally in the form of byte arrays.</p>
<h3>Static loading of a javaagent at startup</h3>
<p>Static loading of a javaagent is done by using the <code>-javaagent=/path/to/file.jar=options</code> command line option to the java executable as below.</p>
<pre>
$ java -javaagent:target/javaagent-examples-jar-with-dependencies.jar=foobarbaz name.dhruba.javaagent.MyMainClass foo bar baz
21:37:50.783 [main] INFO  name.dhruba.javaagent.MyJavaAgent - premain method invoked with args: foobarbaz and inst: sun.instrument.InstrumentationImpl@1786e64
21:37:50.789 [main] INFO  n.d.javaagent.MyClassFileTransformer - class file transformer invoked for className: name/dhruba/javaagent/MyMainClass
21:37:50.789 [main] INFO  name.dhruba.javaagent.MyMainClass - main method invoked with args: [foo, bar, baz]
21:37:50.789 [main] INFO  n.d.javaagent.MyClassFileTransformer - class file transformer invoked for className: name/dhruba/user/MyUser
21:37:50.800 [main] INFO  name.dhruba.javaagent.MyMainClass - userName: bar
21:37:50.801 [DestroyJavaVM] INFO  n.d.javaagent.MyClassFileTransformer - class file transformer invoked for className: java/lang/Shutdown
21:37:50.801 [DestroyJavaVM] INFO  n.d.javaagent.MyClassFileTransformer - class file transformer invoked for className: java/lang/Shutdown$Lock
</pre>
<p>Above, the javaagent lifecycle is clearly visible. The premain (and not the agentmain) method is invoked first. The class file transformer is passed classes as they are loaded. The transformer chooses to redefine the User object prior to its use. Subsequently the classes loaded at shutdown also pass through the transformer.</p>
<h3>Dynamic loading of a javaagent at runtime</h3>
<p>Dynamic loading of a javaagent at runtime can be done quite easily in a programmatic fashion but requires the sun tools jar to be present on the classpath. Certain libraries like jmockit have avoided this by opting to absorb the relevant classes from the sun tools jar into its library under the same package names. In Maven the tools jar can be added to the classpath very easily.</p>
<pre>
&lt;dependency&gt;
  &lt;groupId&gt;com.sun&lt;/groupId&gt;
  &lt;artifactId&gt;tools&lt;/artifactId&gt;
  &lt;version&gt;1.6.0&lt;/version&gt;
  &lt;scope&gt;system&lt;/scope&gt;
  &lt;systemPath&gt;${java.home}/../lib/tools.jar&lt;/systemPath&gt;
&lt;/dependency&gt;
</pre>
<p>The sun tools jar api can then be used to load the java agent simply by provided the path to the jar file as follows.</p>
<pre>
package name.dhruba.javaagent;

import java.lang.management.ManagementFactory;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sun.tools.attach.VirtualMachine;

public class MyJavaAgentLoader {

    static final Logger logger = LoggerFactory.getLogger(MyJavaAgentLoader.class);

    private static final String jarFilePath = "/home/dhruba/.m2/repository/"
            + "javaagent-examples/javaagent-examples/1.0/"
            + "javaagent-examples-1.0-jar-with-dependencies.jar";

    public static void loadAgent() {
        logger.info("dynamically loading javaagent");
        String nameOfRunningVM = ManagementFactory.getRuntimeMXBean().getName();
        int p = nameOfRunningVM.indexOf('@');
        String pid = nameOfRunningVM.substring(0, p);

        try {
            VirtualMachine vm = VirtualMachine.attach(pid);
            vm.loadAgent(jarFilePath, "");
            vm.detach();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

}
</pre>
<p>As you can see &#8211; the code above is querying the pid of the running process and attaching the javaagent to the process. If any kind of failure occurs at this point it is ignored silently whereas if an agent is loaded on startup failures result in termination of startup.</p>
<p>We can now initialise the java agent prior to invoking our main method using the <code>MyJavaAgent.initialize()</code> hookpoint we declared earlier.</p>
<pre>
package name.dhruba.javaagent;

import java.util.Arrays;

import name.dhruba.user.MyUser;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyMainClass {

    static final Logger logger = LoggerFactory.getLogger(MyMainClass.class);

    static {
        MyJavaAgent.initialize();
    }

    /**
     * Main method.
     *
     * @param args
     */
    public static void main(String[] args) {
        logger.info("main method invoked with args: {}", Arrays.asList(args));
        logger.info("userName: {}", new MyUser().getName());
    }

}
</pre>
<p>The output is very similar but with a subtely different path through the code.</p>
<pre>
20:58:50.923 [main] INFO  n.dhruba.javaagent.MyJavaAgentLoader - dynamically loading javaagent
20:58:51.249 [Attach Listener] INFO  name.dhruba.javaagent.MyJavaAgent - agentmain method invoked with args:  and inst: sun.instrument.InstrumentationImpl@c2ff5
20:58:51.266 [main] INFO  name.dhruba.javaagent.MyMainClass - main method invoked with args: []
20:58:51.267 [main] INFO  n.d.javaagent.MyClassFileTransformer - class file transformer invoked for className: name/dhruba/user/MyUser
20:58:51.276 [main] INFO  name.dhruba.javaagent.MyMainClass - userName: bar
20:58:51.276 [DestroyJavaVM] INFO  n.d.javaagent.MyClassFileTransformer - class file transformer invoked for className: java/lang/Shutdown
20:58:51.276 [DestroyJavaVM] INFO  n.d.javaagent.MyClassFileTransformer - class file transformer invoked for className: java/lang/Shutdown$Lock
</pre>
<p>Note that this time the agentmain method was invoked instead of the premain method. The rest of the output is the same.</p>
<h3>Conclusion</h3>
<p>Javaagents along with the java.lang.instrument package are a powerful feature set of the Java language that allow you complete control over the classes of any given application. Instrumentation also has far more liberty with its capabilities than proxying or pointcut weaving. This gives complete dynamic capability to an otherwise very static language. It has allowed development of powerful non-intrusive tools like JMockit which immediately gains numerous <a href="http://dhruba.name/2009/11/08/jmockit-no-holds-barred-testing-with-instrumentation-over-mocking/">advantages</a> over other mocking tools largely because it is based on instrumentation. I look forward to further exploring the possibilities going forward.</p>
<h3>Resources</h3>
<p><a href="http://asm.ow2.org/">ASM</a>, <a href="http://asm.ow2.org/eclipse/index.html">ByteCodeOutline Plugin for Eclipse</a> (Eclipse 3.5 <a href="http://andrei.gmxhome.de/eclipse/">update site</a>),<a href="http://java.sun.com/javase/6/docs/api/java/lang/instrument/package-summary.html"> java.lang.instrument</a>, <a href="http://code.google.com/p/jmockit/">JMockit</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fdhruba.name%2F2010%2F02%2F07%2Fcreation-dynamic-loading-and-instrumentation-with-javaagents%2F&amp;linkname=Creation%2C%20dynamic%20loading%20and%20instrumentation%20with%20javaagents"><img src="http://dhruba.name/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a><img src="http://feeds.feedburner.com/~r/dhruba/lab49/~4/kALD_maFmvU" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/dhruba/lab49/~3/kALD_maFmvU/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gesture Cube</title>
		<link>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/9a7C347SwZI/</link>
		<comments>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/9a7C347SwZI/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 14:03:14 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dougfinke.com/blog/index.php/2010/02/07/gesture-cube/</guid>
		<description><![CDATA[A portable Microsoft Surface? No need to touch – just give it a wave! 

]]></description>
			<content:encoded><![CDATA[<p>A portable <a href="http://www.microsoft.com/surface/">Microsoft Surface</a>? <a href="http://www.gesture-cube.com/">No need to touch – just give it a wave!</a> </p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/ieolCZBvKPQ&amp;hl=en_US&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ieolCZBvKPQ&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p><img src="http://feeds.feedburner.com/~r/DevelopmentInABlink/~4/9a7C347SwZI" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/9a7C347SwZI/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JMockit jar loading from remote file systems enabled</title>
		<link>http://feedproxy.google.com/~r/dhruba/lab49/~3/TRHcftP7VTU/</link>
		<comments>http://feedproxy.google.com/~r/dhruba/lab49/~3/TRHcftP7VTU/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 13:48:37 +0000</pubDate>
		<dc:creator>Dhruba Bandopadhyay</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Lab49]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://dhruba.name/?p=1489</guid>
		<description><![CDATA[Over the past few months we&#8217;ve faced significant hurdles integrating jmockit into our development environment at a client-site primarily but not entirely because it is not a conventional development environment. The most noteable of these has been the inability to load the jmockit jar file from a mounted drive which is a remote file system. [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>Over the past few months we&#8217;ve faced significant hurdles integrating <a href="http://code.google.com/p/jmockit/">jmockit</a> into our development environment at a client-site primarily but not entirely because it is not a conventional development environment. The most noteable of these has been the inability to load the jmockit jar file from a mounted drive which is a remote file system. Having remote paths in the classpath such as <code>//foo/bar/baz/jmockit.jar</code> would result in a <code>java.net.URI</code> being constructed with that remote path and the URI being passed to the following <code>java.io.File</code> constructor.</p>
<pre>
public File(URI uri) {
    if (!uri.isAbsolute())
        throw new IllegalArgumentException("URI is not absolute");
    if (uri.isOpaque())
        throw new IllegalArgumentException("URI is not hierarchical");
    String scheme = uri.getScheme();
    if ((scheme == null) || !scheme.equalsIgnoreCase("file"))
        throw new IllegalArgumentException("URI scheme is not \"file\"");
    if (uri.getAuthority() != null)
        throw new IllegalArgumentException("URI has an authority component");
    if (uri.getFragment() != null)
        throw new IllegalArgumentException("URI has a fragment component");
    if (uri.getQuery() != null)
        throw new IllegalArgumentException("URI has a query component");
    String p = uri.getPath();
    if (p.equals(""))
        throw new IllegalArgumentException("URI path component is empty");
    p = fs.fromURIPath(p);
    if (File.separatorChar != '/')
        p = p.replace('/', File.separatorChar);
    this.path = fs.normalize(p);
    this.prefixLength = fs.prefixLength(this.path);
}
</pre>
<p>The following snippet in the above code would then result in an <code>IllegalArgumentException</code> being thrown with the message <code>URI has an authority component</code> and of course the authority component would be <code>//foo</code>.</p>
<pre>
if (uri.getAuthority() != null)
    throw new IllegalArgumentException("URI has an authority component");
</pre>
<p>This morning, however, I happened to notice the following extract in the jmockit <a href="http://jmockit.googlecode.com/svn/trunk/www/changes.html">changelog</a> for the latest preview version &#8211; 0.997 although I&#8217;m not sure how long ago this was done.</p>
<blockquote><p>A few fixes and enhancements to JMockit&#8217;s internal auto-initialization mechanisms: <code>jmockit.jar</code> (or a versioned jar name) can now be loaded from a remote file system without triggering a security-related exception</p>
</blockquote>
<p>I wonder if this was in response to Shankar&#8217;s <a href="http://www.vshank77.com/2010/02/jmockit-javaagent-enterprise.html">post</a> on the obstacles we faced.  It remains to be seen whether this indeed refers to the above issue and whether it resolves it. I&#8217;ll try it out once this version is finally released.  Just for the record, to place renewed emphasis on the points made in Shankar&#8217;s article, the changes outlined in the following changelog entry under version 0.993 have caused us integration difficulties also.</p>
<blockquote><p>Enhancement: to make JMockit easier to use when running under JDK 1.6+ without the -javaagent JVM parameter, two simplifications were introduced:</p>
<ul>
<li>The <jdkDir>/lib/tools.jar file no longer needs to be added to classpath.</li>
<li>Test classes no longer need to be annotated with @RunWith(JMockit.class) (for JUnit 4 tests), nor extend a JUnit/TestNG integration base class (JMockitTest, JMockitTestCase, JMockitTestNG).</li>
</ul>
<p>There is a requirement for the second item when using JUnit, though: jmockit.jar needs to come before junit-4.x.jar in the classpath.</p>
</blockquote>
<p>The above changes placed a constraint on classpath ordering and, by default, loaded all tests using the jmockit junit runner rather than the original junit runner and if jmockit wasn&#8217;t properly initialised then all tests would fail as long as jmockit was on the classpath. It&#8217;s a tricky problem to approach for jmockit. Making life easier for certain environments makes it more difficult in others. I would say that jmockit should allow the user to define how they would like their agent loaded and also have jmockit enabled explicitly only and not behind the scenes. Once integrated, however, it is a fine mocking library with a <a href="http://dhruba.name/2009/11/08/jmockit-no-holds-barred-testing-with-instrumentation-over-mocking/">unique feature set</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fdhruba.name%2F2010%2F02%2F07%2Fjmockit-jar-loading-from-remote-file-systems-enabled%2F&amp;linkname=JMockit%20jar%20loading%20from%20remote%20file%20systems%20enabled"><img src="http://dhruba.name/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a><img src="http://feeds.feedburner.com/~r/dhruba/lab49/~4/TRHcftP7VTU" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/dhruba/lab49/~3/TRHcftP7VTU/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>There clearly needs to be a successor to Java</title>
		<link>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/rWaby4jbPLo/</link>
		<comments>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/rWaby4jbPLo/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 13:02:27 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://dougfinke.com/blog/index.php/2010/02/07/there-clearly-needs-to-be-a-successor-to-java/</guid>
		<description><![CDATA[Will Groovy++ spell the end of Scala?
As much as we all &#34;try to be friends&#34;, the successor to Java (and there clearly needs to be one) &#34;battle&#34; continues

via blue train software
Groovy++ adds to Groovy static typing with very little in terms of trade off (meta programming)

Allowing mixing of static and dynamic code in the same [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bluetrainsoftware.blogspot.com/2010/02/will-groovy-spell-end-of-scala.html">Will Groovy++ spell the end of Scala?</a></p>
<blockquote><p>As much as we all &quot;try to be friends&quot;, the successor to Java (and there clearly needs to be one) &quot;battle&quot; continues</p>
</blockquote>
<p>via <a href="http://bluetrainsoftware.blogspot.com/">blue train software</a></p>
<p>Groovy++ adds to Groovy static typing with very little in terms of trade off (meta programming)</p>
<ul>
<li>Allowing mixing of static and dynamic code in the same application. </li>
<li>Same speed as Java &#8211; sometimes faster, sometimes slower depending on how the problem is expressed. </li>
<li>Groovy++ is really Java ++ and is thus a natural and easy path for the millions of Java programmers. </li>
<li>Groovy not being controlled by the boffins at Snoracle hopefully means innovation in the platform can happen much faster and address real developer needs.</li>
</ul>
<p>Others in the community counter that <a href="http://www.scala-lang.org/">Scala</a> is ~50 times faster than Groovy++.</p>
<p><img src="http://feeds.feedburner.com/~r/DevelopmentInABlink/~4/rWaby4jbPLo" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/rWaby4jbPLo/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Week @Lab 2/6/10</title>
		<link>http://goldmanalpha.wordpress.com/2010/02/06/week-lab-2/</link>
		<comments>http://goldmanalpha.wordpress.com/2010/02/06/week-lab-2/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 04:00:32 +0000</pubDate>
		<dc:creator>Aaron Goldman</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://goldmanalpha.wordpress.com/?p=471</guid>
		<description><![CDATA[Seminar @Lab is Back
There’s going to be more seminars @Lab.  I’m looking forward to a 2 part series on high frequency trading and I’m gearing up to give some presentations myself.
Very Agile
This is not the place to ask for Agile or Scrum advice if you’re not serious about it.  A book inquiry got about 30 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=goldmanalpha.wordpress.com&#38;blog=9682964&#38;post=471&#38;subd=goldmanalpha&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<h2>Seminar <a href="http://www.lab49.com/" >@Lab</a> is Back</h2>
<p>There’s going to be more seminars @Lab.  I’m looking forward to a 2 part series on high frequency trading and I’m gearing up to give some presentations myself.</p>
<h2>Very Agile</h2>
<p>This is not the place to ask for <a href="http://agilemanifesto.org/" >Agile</a> or Scrum advice if you’re not serious about it.  A book inquiry got about 30 responses in no time flat.</p>
<h2>Hosting</h2>
<p>Lots of Labbers have advice on which hosting company to choose.  The most intriguing choice was <a href="http://www.microsoft.com/windowsazure/">Windows Azure</a>.</p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/goldmanalpha.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/goldmanalpha.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/goldmanalpha.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/goldmanalpha.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/goldmanalpha.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/goldmanalpha.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/goldmanalpha.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/goldmanalpha.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/goldmanalpha.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/goldmanalpha.wordpress.com/471/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=goldmanalpha.wordpress.com&#038;blog=9682964&#038;post=471&#038;subd=goldmanalpha&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://goldmanalpha.wordpress.com/2010/02/06/week-lab-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Condition constraints using Spring’s new expression language</title>
		<link>http://intivism.com/blog/?p=29</link>
		<comments>http://intivism.com/blog/?p=29#comments</comments>
		<pubDate>Fri, 05 Feb 2010 20:52:08 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://intivism.com/blog/?p=29</guid>
		<description><![CDATA[After being exposed to Spring Expression Language, I thought it could be useful to harness its power to describe condition constraints on methods, as part of a growing focus on test driven development.
The idea is to describe expectations from the object&#8217;s state prior to the method&#8217;s invocation, expectation from the input and expectation from state [...]]]></description>
			<content:encoded><![CDATA[<p>After being exposed to Spring Expression Language, I thought it could be useful to harness its power to describe condition constraints on methods, as part of a growing focus on test driven development.</p>
<p>The idea is to describe expectations from the object&#8217;s state prior to the method&#8217;s invocation, expectation from the input and expectation from state following the method&#8217;s invocation.<br />
Since spring expression language exposes public methods, its interesting to see how we can verify correctness using other public methods.</p>
<p>For this purpose I will introduce 3 simple annotations:</p>
<p>@ConditionContext- a spring expression to be evaluated prior to any condition checks<br />
@Precondition &#8211; a spring expression to be evaluated prior to the method invocation and after the latter<br />
@Postcondition &#8211; a spring expression to be evaluated after the method invocation</p>
<p>All of these annotations are of the same code structure:</p>
<pre class="brush: java;">
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Postcondition {
String value();
}
</pre>
<p>I&#8217;ve written a very simple service that just manages a list of products.<br />
The service supports the following operations:</p>
<pre class="brush: java;">
public interface FooService {

public Set&lt;Product&gt; getProducts();

public Product getProduct(int id);

public void insertProduct(Product product);

public void updateProduct(Product product);

public void deleteProduct(Product product);

}
</pre>
<p>Where a Product just contains an ID and price.</p>
<p>Before I show the behind the scenes, I would like to show the final outcome which is what I described above:</p>
<pre class="brush: java;">
@ConditionContext(&quot;#ctx.put('sizeBefore', #self.Products.size())&quot;)
@Precondition(&quot;#arg0 != null and #arg0.Id &amp;gt; 0&quot;)
@Postcondition(&quot;#sizeBefore + 1 == #self.Products.size() and &quot; +
&quot;#self.Products.?[Id == 1].size() == 1 and &quot; +
&quot;#self.getProduct(#arg0.Id).equals(#arg0)&quot;)
public voidinsertProduct(Product product) {
products.add(product);
}
</pre>
<p>Here are my expectations from the insertProduct method as described in the constraint (just as an example, i know there many other possible constraints which can be expressed):</p>
<p>As a precondition I want the input to be valid which means the product argument (arg0) is not and has a positive ID.<br />
I can also express conditions about the service&#8217;s state prior to insert, I will show that in the post condition.<br />
Following the insert the number of products should be incremented by 1, and I shall be able to find the added product.<br />
The latter is expressed in two different ways:<br />
1) the obvious one of invoking getProduct() on the Id and making sure the objects are equal.<br />
2) getting the entire collection and finding it in the collection. I have also wanted to demonstrate SpEL, so I used the collection selection syntax it provides.<br />
The condition context is simply a way to store information prior to method invocation.<br />
Since you cant set variables outside the SpEL context, I used a map to store the data and I later introduce the map&#8217;s keys as variable in the SpEL context.<br />
This is why in @Postcondition you see #sizeBefore.<br />
How does this work?</p>
<p>I started by creating a small driver code:</p>
<pre class="brush: java;">
ApplicationContext ctx = newClassPathXmlApplicationContext(newString[]{&quot;beans.xml&quot;});
FooService fooService = (FooService) ctx.getBean(&quot;fooService&quot;);
Product product1 = new Product();
product1.setId(1);
product1.setPrice(1);
fooService.insertProduct(product1);
</pre>
<p>Adding my AOP and bean definitions in beans.xml file:</p>
<pre class="brush: xml;">
&lt;!-- Enabling aspect support --&gt;
&lt;aop:aspectj-autoproxy/&gt;
&lt;bean id=&quot;product&quot; class=&quot;com.lab49.spelaspecttest.domain.Product&quot;/&gt;
&lt;bean id=&quot;fooService&quot; class=&quot;com.lab49.spelaspecttest.service.DefaultFooService&quot;/&gt;
&lt;bean id=&quot;aspectBean&quot; class=&quot;com.lab49.spelaspecttest.aspect.PointCuts&quot;/&gt;
</pre>
<p> </p>
<p>I created an aspect with the following:</p>
<ol>
<li><span style="font-family: Consolas;">A Pointcut for any public method.</span></li>
<li><span style="font-family: Consolas;">An Around advice (such that I can control method invocation) to handle the pre and post condition logic.<br />
The logic is quite simple, evaluate the preconditions, if they are met execute the method, if not throw an IllegalStateException.<br />
Following the method execution, evaluate the post conditions and do the same.</span></li>
</ol>
<p><span style="font-family: Consolas;">The real magic occurs in the aspect code as follows (see documentation in code):</span></p>
<pre class="brush: java;">
@Aspect
public class PointCuts {

	@Pointcut(&quot;execution(public * *(..))&quot;)
	private void anyPublicOperation() {}

	@Pointcut(&quot;within(com.lab49.spelaspecttest..*)&quot;)
	private void inServiceLayer() { }

	/**
	 * Just for debugging, print methods executed in service layer
	 * @param jp
	 */
	@Before(&quot;inServiceLayer()&quot;)
	public void logServiceMethodExecution(JoinPoint jp) {
		System.out.println(&quot;Executing: &quot; + jp.getSignature().getName());
	}	

	/**
	 * I use the public pointcut and add target and annotation to statically type the annotation variables and targen object (the service).
	 *
	 */
	@Around(value = &quot;anyPublicOperation() &amp;&amp; target(bean) &amp;&amp; @annotation(conditionContext) &amp;&amp; @annotation(precondition) &amp;&amp; @annotation(postcondition)&quot;, argNames=&quot;bean, conditionContext, precondition, postcondition&quot;)
	public Object checkConditionConstraints(ProceedingJoinPoint pjp, Object bean, ConditionContext conditionContext, Precondition precondition, Postcondition postcondition) throws Throwable {
		System.out.println(&quot;Condition context: &quot; + conditionContext.value());
		System.out.println(&quot;Precondition: &quot; + precondition.value());
		System.out.println(&quot;Postcondition: &quot; + postcondition.value());

		// SPeL action begins
		EvaluationContext context = new StandardEvaluationContext(bean);
		// I add a #self variable because the implicit this SPeL evaluates properties
		// with no object against can be confusing or inconsistent.
		context.setVariable(&quot;self&quot;, bean);
		// Add all the #arg* variables to the context, the method inputs.
		addArgumentsToContext(pjp, context);

		ExpressionParser parser = new SpelExpressionParser();
		Expression preConditionExp = parser.parseExpression(precondition.value());

		// a little syntactic sugar - we turn the keys in the map in the condition context
		// to variables in evaluating the precondition and postcondition expressions
		updateConditionContext(conditionContext, parser, context);

		// SPeL uses the class&lt;T&gt; generics to ease on casting return values
		boolean preconditionValue = preConditionExp.getValue(context, Boolean.class);
		System.out.println(&quot;Precondition value: &quot; + preconditionValue);

		if(!preconditionValue) {
			throw new IllegalStateException(&quot;Precondition &quot; + precondition.value() + &quot; failed&quot;);
		}

		// use the JoinPoint to actually execute the underlying method
		Object retval = pjp.proceed();

		Expression postConditionExp = parser.parseExpression(postcondition.value());
		boolean postConditionValue = postConditionExp.getValue(context, Boolean.class);
		System.out.println(&quot;Postcondition value: &quot; + postConditionValue);

		if(!postConditionValue) {
			throw new IllegalStateException(&quot;Postcondition &quot; + postcondition.value() + &quot; failed&quot;);
		}

		//if the postcondition is met, return the method's original return value
		return retval;
	}

	private void updateConditionContext(ConditionContext conditionContext, ExpressionParser parser, EvaluationContext context) {
		Map&lt;String,Object&gt; map = new HashMap&lt;String, Object&gt;();
		context.setVariable(&quot;ctx&quot;, map);
		Expression contextExpression = parser.parseExpression(conditionContext.value());
		contextExpression.getValue(context);

		for(Entry&lt;String, Object&gt; entry : map.entrySet()) {
			context.setVariable(entry.getKey(), entry.getValue());
		}
	}

	private void addArgumentsToContext(ProceedingJoinPoint pjp, EvaluationContext context) {
		Object[] args = pjp.getArgs();
		for(int i = 0; i &lt; args.length; i++) {
			context.setVariable(&quot;arg&quot; + i, args[i]);
		}
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://intivism.com/blog/?p=29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taxing infographics</title>
		<link>http://www.usablemarkets.com/2010/02/05/taxing-infographics/</link>
		<comments>http://www.usablemarkets.com/2010/02/05/taxing-infographics/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 16:17:33 +0000</pubDate>
		<dc:creator>Alex Kirtland</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.usablemarkets.com/?p=1657</guid>
		<description><![CDATA[Visualizing Economics has been on something of a binge lately on tax related infographics.  There is, of course, interesting stuff to be seen here (but perhaps not terribly new), about how the wealthiest Americans are paying out less of their income in taxes now than in years past.  
Also of interest, for those [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52aXN1YWxpemluZ2Vjb25vbWljcy5jb20v">Visualizing Economics</a> has been on <a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52aXN1YWxpemluZ2Vjb25vbWljcy5jb20vMjAxMC8wMi8wNC9oaXN0b3JpY2FsLW1hcmdpbmFsLWluY29tZS10YXgtcmF0ZXMv">something of a binge lately on tax related infographics</a>.  There is, of course, interesting stuff to be seen here (but perhaps <a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jvb2tzLmdvb2dsZS5jb20vYm9va3M/aWQ9aWJIOWpQZEhhOVFD">not terribly new</a>), about how the wealthiest Americans are paying out less of their income in taxes now than in years past.  </p>
<p>Also of interest, for those can get themselves to care about this most mundane (yet somehow fascinating) of topics, is the market at InTrade for future tax rates.  Perhaps the most interesting finding here is that the prediction for <a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9JbmNvbWVfdGF4X2luX3RoZV9Vbml0ZWRfU3RhdGVz">Highest Marginal Single-Filer Fed Income Tax Rate</a> to be greater than 38% dramatically rises from 2010 to 2011.  This is the expiration of the Bush tax cuts, and the traders&#8217; beliefs that these cuts will not be extended at their current levels.</p>
<p><img src="http://www.usablemarkets.com/wp-content/uploads/2010/02/intrade-taxes.jpg" alt="intrade taxes" width="500px"></p>
<p><a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5taW50LmNvbS8=">Mint</a>, on the other hand, provides this rather fascinating infographic about where the money comes from to fund our federal government.  This breaks down the share of the tax burden by income level.</p>
<p><a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5taW50LmNvbS9ibG9nL3RyZW5kcy93aG8taXMtcGF5aW5nLXRheGVzLz9kaXNwbGF5PXdpZGU="><img src="http://www.mint.com/blog/wp-content/uploads/2009/11/MINT-TAXES-R4.png" alt="who pays taxes" width="500px"></a></p>
<p>~alex</p>
<p> <img src="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?view=1&#038;post_id=1657" width="1" height="1" style="display: none;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.usablemarkets.com/2010/02/05/taxing-infographics/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arrange-Act-Assert: MSpec and SpecFlow</title>
		<link>http://mdavey.wordpress.com/2010/02/05/arrange-act-assert-mspec-and-specflow/</link>
		<comments>http://mdavey.wordpress.com/2010/02/05/arrange-act-assert-mspec-and-specflow/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 08:16:10 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mdavey.wordpress.com/?p=2751</guid>
		<description><![CDATA[Interested in BDD?  Then check out MSpec, SpecFlow and SpecUnit.net
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#38;blog=18454&#38;post=2751&#38;subd=mdavey&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<p>Interested <a href="http://blogs.msdn.com/elee/archive/2009/01/25/bdd-specification-extensions.aspx">in</a> BDD?  Then check out <a href="http://github.com/machine/machine.specifications">MSpec</a>, <a href="http://ryanlanciaux.com/ryanlanciaux/post/Gherkin-style-BDD-testing-in-NET.aspx">SpecFlow</a> and <a href="http://code.google.com/p/specunit-net/">SpecUnit.net</a></p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mdavey.wordpress.com/2751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mdavey.wordpress.com/2751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mdavey.wordpress.com/2751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mdavey.wordpress.com/2751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mdavey.wordpress.com/2751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mdavey.wordpress.com/2751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mdavey.wordpress.com/2751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mdavey.wordpress.com/2751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mdavey.wordpress.com/2751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mdavey.wordpress.com/2751/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#038;blog=18454&#038;post=2751&#038;subd=mdavey&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mdavey.wordpress.com/2010/02/05/arrange-act-assert-mspec-and-specflow/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft’s Creative Destruction</title>
		<link>http://mdavey.wordpress.com/2010/02/05/microsoft%e2%80%99s-creative-destruction/</link>
		<comments>http://mdavey.wordpress.com/2010/02/05/microsoft%e2%80%99s-creative-destruction/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 07:43:41 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mdavey.wordpress.com/?p=2749</guid>
		<description><![CDATA[Maybe this article explains Microsoft&#8217;s lack of product in the real-time/streaming space?  Microsoft has been somewhat late (again) to the game with their StreamInsight offering &#8211; especially now with the Sybase RAP + Aleri deal.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#38;blog=18454&#38;post=2749&#38;subd=mdavey&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<p>Maybe this <a href="http://www.nytimes.com/2010/02/04/opinion/04brass.html?pagewanted=1&amp;ref=opinion">article</a> explains Microsoft&#8217;s lack of product in the real-time/streaming space?  Microsoft has been somewhat late (again) to the game with their StreamInsight offering &#8211; especially now with the <a href="http://www.sybase.co.uk/products/financialservicessolutions/rap-thetradingedition">Sybase RAP</a> + Aleri deal.</p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mdavey.wordpress.com/2749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mdavey.wordpress.com/2749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mdavey.wordpress.com/2749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mdavey.wordpress.com/2749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mdavey.wordpress.com/2749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mdavey.wordpress.com/2749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mdavey.wordpress.com/2749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mdavey.wordpress.com/2749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mdavey.wordpress.com/2749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mdavey.wordpress.com/2749/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#038;blog=18454&#038;post=2749&#038;subd=mdavey&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mdavey.wordpress.com/2010/02/05/microsoft%e2%80%99s-creative-destruction/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DryadLinq for Finance?</title>
		<link>http://mdavey.wordpress.com/2010/02/04/dryadlinq-for-finance/</link>
		<comments>http://mdavey.wordpress.com/2010/02/04/dryadlinq-for-finance/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 20:41:42 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[.Net]]></category>

		<guid isPermaLink="false">http://mdavey.wordpress.com/?p=2747</guid>
		<description><![CDATA[This announcement means that I can finally use DryadLinq for financial applications    I was getting a little bored of StreamInsight anyway  
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#38;blog=18454&#38;post=2747&#38;subd=mdavey&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<p>This announcement means that I can finally use <a href="http://blogs.msdn.com/pfxteam/archive/2010/02/04/9958404.aspx">DryadLinq</a> for financial applications <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   I was getting a little bored of StreamInsight anyway <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mdavey.wordpress.com/2747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mdavey.wordpress.com/2747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mdavey.wordpress.com/2747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mdavey.wordpress.com/2747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mdavey.wordpress.com/2747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mdavey.wordpress.com/2747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mdavey.wordpress.com/2747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mdavey.wordpress.com/2747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mdavey.wordpress.com/2747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mdavey.wordpress.com/2747/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#038;blog=18454&#038;post=2747&#038;subd=mdavey&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mdavey.wordpress.com/2010/02/04/dryadlinq-for-finance/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Videos: SQL Server Modeling aka Oslo</title>
		<link>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/5XYAdpVvmMk/</link>
		<comments>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/5XYAdpVvmMk/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 01:55:52 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dougfinke.com/blog/index.php/2010/02/03/videos-sql-server-modeling-aka-oslo/</guid>
		<description><![CDATA[Rockford Lhotka has a three part series here discussing the benefits and usage of the SQL Server Modeling technologies in the context of his CSLA .NET framework. It is a framework for building the business logic layer in your applications.
He demonstrates modeling, a DSL (domain specific language), code savings, reduced testing burden, and consistency of [...]]]></description>
			<content:encoded><![CDATA[<p>Rockford Lhotka has a three part series <a href="http://msdn.microsoft.com/en-us/data/ff381673.aspx">here</a> discussing the benefits and usage of the SQL Server Modeling technologies in the context of his <a href="http://www.lhotka.net/cslanet/">CSLA .NET framework</a>. It is a framework for building the business logic layer in your applications.</p>
<p>He demonstrates modeling, a DSL (domain specific language), code savings, reduced testing burden, and consistency of the user experience.</p>
<p><img src="http://feeds.feedburner.com/~r/DevelopmentInABlink/~4/5XYAdpVvmMk" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/5XYAdpVvmMk/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10% at 75%</title>
		<link>http://www.usablemarkets.com/2010/02/03/10-at-75/</link>
		<comments>http://www.usablemarkets.com/2010/02/03/10-at-75/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 14:32:44 +0000</pubDate>
		<dc:creator>Alex Kirtland</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.usablemarkets.com/?p=1648</guid>
		<description><![CDATA[From the NYTimes, some pretty astonishing numbers.  10% of all homes are valued at 75% or less of their purchase price mortgage.  
One word: Yowza.
The relevant bit from the article:

New research suggests that when a home’s value falls below 75 percent of the amount owed on the mortgage, the owner starts to think [...]]]></description>
			<content:encoded><![CDATA[<p>From the <a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5ueXRpbWVzLmNvbS8yMDEwLzAyLzAzL2J1c2luZXNzLzAzd2Fsay5odG1sP2hw">NYTimes, some pretty astonishing numbers</a>.  10% of all homes are valued at 75% or less of their <del datetime="2010-02-03T16:57:08+00:00">purchase price</del> mortgage.  </p>
<p>One word: Yowza.</p>
<p>The relevant bit from the article:</p>
<blockquote>
<p>New research suggests that when a home’s value falls below 75 percent of the amount owed on the mortgage, the owner starts to think hard about walking away, even if he or she has the money to keep paying.</p>
<p>In a situation without precedent in the modern era, millions of Americans are in this bleak position &#8230;</p>
<p>&#8230; The number of Americans who owed more than their homes were worth was virtually nil when the real estate collapse began in mid-2006, but by the third quarter of 2009, an estimated 4.5 million homeowners had reached the critical threshold, with their home’s value dropping below 75 percent of the mortgage balance &#8230;  </p>
<p>&#8230;  With figures released last week showing that the real estate market was stalling again, their numbers are now projected to climb to a peak of 5.1 million by June — about 10 percent of all Americans with mortgages.
</p>
</blockquote>
<p>~alex</p>
<p> <img src="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?view=1&#038;post_id=1648" width="1" height="1" style="display: none;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.usablemarkets.com/2010/02/03/10-at-75/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Interesting Stuff From MSR: Moles</title>
		<link>http://mdavey.wordpress.com/2010/02/03/more-interesting-stuff-from-msr-moles/</link>
		<comments>http://mdavey.wordpress.com/2010/02/03/more-interesting-stuff-from-msr-moles/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 08:07:48 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[.Net]]></category>

		<guid isPermaLink="false">http://mdavey.wordpress.com/?p=2743</guid>
		<description><![CDATA[Moles &#8211; Isolation framework for .NET
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#38;blog=18454&#38;post=2743&#38;subd=mdavey&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<p><a href="http://research.microsoft.com/en-us/projects/moles/">Moles</a> &#8211; <a href="http://channel9.msdn.com/posts/Peli/Moles-Replace-any-NET-method-with-a-delegate/">Isolation</a> framework for .NET</p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mdavey.wordpress.com/2743/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mdavey.wordpress.com/2743/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mdavey.wordpress.com/2743/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mdavey.wordpress.com/2743/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mdavey.wordpress.com/2743/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mdavey.wordpress.com/2743/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mdavey.wordpress.com/2743/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mdavey.wordpress.com/2743/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mdavey.wordpress.com/2743/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mdavey.wordpress.com/2743/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#038;blog=18454&#038;post=2743&#038;subd=mdavey&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mdavey.wordpress.com/2010/02/03/more-interesting-stuff-from-msr-moles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Reading On The Train</title>
		<link>http://mdavey.wordpress.com/2010/02/02/random-reading-on-the-train/</link>
		<comments>http://mdavey.wordpress.com/2010/02/02/random-reading-on-the-train/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 23:45:05 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mdavey.wordpress.com/?p=2745</guid>
		<description><![CDATA[
.NET Framework 4.0: Comparing LINQ and PLINQ performance
F# for Parallel and Asynchronous Programming &#8211; PDC 2009
Steve Jobs and Control
Tracing and Caching for Entity Framework available on MSDN Code Gallery &#8211; hopefully we&#8217;ll see Velocity (AppFabric) integration with other Microsoft products soon
NDepend v3 is now 100% integrated in Visual Studio &#8211; Must Have VS Plugin?
Are you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#38;blog=18454&#38;post=2745&#38;subd=mdavey&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<ul>
<li>.NET Framework 4.0: Comparing LINQ and PLINQ <a href="http://weblogs.asp.net/gunnarpeipman/archive/2010/01/31/net-framework-4-0-comparing-linq-and-plinq-performance.aspx">performance</a></li>
<li>F# for Parallel and Asynchronous <a href="http://blogs.msdn.com/lukeh/archive/2010/02/01/f-for-parallel-and-asynchronous-programming-pdc-2009.aspx">Programming</a> &#8211; PDC 2009</li>
<li>Steve Jobs and <a href="http://community.winsupersite.com/blogs/paul/archive/2010/02/01/steve-jobs-and-control.aspx">Control</a></li>
<li>Tracing and Caching for Entity Framework <a href="http://blogs.msdn.com/jkowalski/archive/2009/06/11/tracing-and-caching-in-entity-framework-available-on-msdn-code-gallery.aspx">available</a> on MSDN Code Gallery &#8211; hopefully we&#8217;ll see Velocity (AppFabric) integration with other Microsoft products soon</li>
<li>NDepend <a href="http://codebetter.com/blogs/patricksmacchia/archive/2010/01/28/ndepend-v3-is-now-100-integrated-in-visual-studio.aspx">v3</a> is now 100% integrated in Visual Studio &#8211; Must Have VS Plugin?</li>
<li>Are you using the <a href="http://blogs.msdn.com/pfxteam/archive/2010/01/29/9955613.aspx">CCR</a>? &#8211; One runtime I just haven&#8217;t managed spend enough time with <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </li>
<li>CLR V4: Stuff That May <a href="http://blogs.msdn.com/davbr/archive/2010/01/07/clr-v4-stuff-that-may-break-your-profiler.aspx">Break</a> Your Profiler + Profiler Attach <a href="http://blogs.msdn.com/davbr/archive/2010/01/18/clr-v4-profiler-attach-part-2-ok-now-what.aspx">Part</a> 2: Ok, now what?</li>
<li>Much Ado About Monads – Creating Extended <a href="http://codebetter.com/blogs/matthew.podwysocki/archive/2010/01/18/much-ado-about-monads-creating-extended-builders.aspx?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed:+CodeBetter+(CodeBetter.Com)">Builders</a></li>
<li>An Insurgency of <a href="http://www.cooper.com/journal/insurgency_of_quality/insurgency-of-quality.pdf">Quality</a></li>
<li>WPF Unit <a href="http://marlongrech.wordpress.com/2007/10/14/wpf-unit-testing/">Testing</a></li>
<li>Line Charts with Data <a href="http://msdn.microsoft.com/en-gb/magazine/ee291567.aspx">Templates</a> &#8211; missed this one when I last looked at the MSDN Magazine site</li>
</ul>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mdavey.wordpress.com/2745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mdavey.wordpress.com/2745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mdavey.wordpress.com/2745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mdavey.wordpress.com/2745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mdavey.wordpress.com/2745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mdavey.wordpress.com/2745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mdavey.wordpress.com/2745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mdavey.wordpress.com/2745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mdavey.wordpress.com/2745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mdavey.wordpress.com/2745/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#038;blog=18454&#038;post=2745&#038;subd=mdavey&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mdavey.wordpress.com/2010/02/02/random-reading-on-the-train/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StreamInsight: CepStream.Create and the ConfigInfo Parameter</title>
		<link>http://mdavey.wordpress.com/2010/02/02/streaminsight-cepstream-create-and-the-configinfo-parameter/</link>
		<comments>http://mdavey.wordpress.com/2010/02/02/streaminsight-cepstream-create-and-the-configinfo-parameter/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 22:55:10 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mdavey.wordpress.com/?p=2737</guid>
		<description><![CDATA[For some reason I still seem to be in StreamInsight world.  Not sure if that is a good thing or a bad thing.  My Strategy Pricer POC is complete as far as I&#8217;m concerned, but another POC is bugging me.  The problem I&#8217;ve walked into in the last few days is around [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#38;blog=18454&#38;post=2737&#38;subd=mdavey&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<p>For some reason I still seem to be in StreamInsight world.  Not sure if that is a good thing or a bad thing.  My Strategy Pricer POC is complete as far as I&#8217;m concerned, but another POC is bugging me.  The problem I&#8217;ve walked into in the last few days is around <a href="http://msdn.microsoft.com/en-us/library/ee842862(SQL.105).aspx">ConfigInfo</a>.  In the StreamInsight samples that are supplied by Microsoft, the ConfigInfo parameter passed to CepStream.Create is a constructed object that passes configuration information to the input/output adapter.  Now I was expecting this object to simply be passed to the adapter.  However it appears I either have a very silly bug or for some reason I am seeing new instanced of my ConfigInfo class constructed by StreamInsight and passed to the adapters when the ConfigInfo class is more than the basic string property struct as per the StreamInsight samples.  </p>
<p>Confused?  Very <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   </p>
<p>The problem is all centred around the queries being complied, and the ConfigInfo object being serialised.  Here the stack trace that invokes the constructor of my ConfigInfo class:</p>
<p><code> 	System.Runtime.Serialization.dll!System.Runtime.Serialization.ClassDataContract.ReadXmlValue(System.Runtime.Serialization.XmlReaderDelegator xmlReader = {System.Runtime.Serialization.XmlReaderDelegator}, System.Runtime.Serialization.XmlObjectSerializerReadContext context) + 0x30 bytes<br />
 	System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(System.Runtime.Serialization.DataContract dataContract, System.Runtime.Serialization.XmlReaderDelegator reader) + 0x10 bytes<br />
 	System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator reader, string name, string ns, ref System.Runtime.Serialization.DataContract dataContract) + 0x81 bytes<br />
 	System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator xmlReader, System.Type declaredType, System.Runtime.Serialization.DataContract dataContract, string name, string ns) + 0x28 bytes<br />
 	System.Runtime.Serialization.dll!System.Runtime.Serialization.DataContractSerializer.InternalReadObject(System.Runtime.Serialization.XmlReaderDelegator xmlReader, bool verifyObjectName) + 0xa8 bytes<br />
 	System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(System.Runtime.Serialization.XmlReaderDelegator reader, bool verifyObjectName) + 0x63 bytes<br />
 	System.Runtime.Serialization.dll!System.Runtime.Serialization.DataContractSerializer.ReadObject(System.Xml.XmlReader reader) + 0x2a bytes<br />
</code></p>
<p>Sidebar:  Maybe I should hook StreamInsight to <a href="http://www.automatedtrader.net/news/data-news/30233/thomson-reuters-launches-new-service-for-faster-access-to-machine-readable-news">NewsScope</a> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mdavey.wordpress.com/2737/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mdavey.wordpress.com/2737/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mdavey.wordpress.com/2737/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mdavey.wordpress.com/2737/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mdavey.wordpress.com/2737/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mdavey.wordpress.com/2737/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mdavey.wordpress.com/2737/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mdavey.wordpress.com/2737/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mdavey.wordpress.com/2737/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mdavey.wordpress.com/2737/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#038;blog=18454&#038;post=2737&#038;subd=mdavey&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mdavey.wordpress.com/2010/02/02/streaminsight-cepstream-create-and-the-configinfo-parameter/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CEP: Microsoft vs Sybase?</title>
		<link>http://mdavey.wordpress.com/2010/02/02/cep-microsoft-vs-sybase/</link>
		<comments>http://mdavey.wordpress.com/2010/02/02/cep-microsoft-vs-sybase/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 21:54:17 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mdavey.wordpress.com/?p=2735</guid>
		<description><![CDATA[It comes as no surprise that CEP vendors are getting acquired &#8211; Sybase Expected To Announce Acquisition of Aleri.  As I&#8217;ve blogged about before, I expect the same thing to happen in the streaming real-time web space.  With Sybase expected announcement, it should only help in forcing Microsoft to bring StreamInsight 2.0 to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#38;blog=18454&#38;post=2735&#38;subd=mdavey&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<p>It comes as no surprise that CEP vendors are getting acquired &#8211; Sybase Expected To Announce <a href="http://www.securitiesindustry.com/news/-24611-1.html">Acquisition</a> of Aleri.  As I&#8217;ve blogged about before, I expect the same thing to happen in the streaming real-time web space.  With Sybase expected announcement, it should only help in forcing Microsoft to bring <a href="http://www.microsoft.com/sqlserver/2008/en/us/R2-complex-event.aspx">StreamInsight</a> 2.0 to the table sooner rather than later &#8211; I know 1.0 isn&#8217;t out yet but 2.0 is always more interesting than 1.0 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mdavey.wordpress.com/2735/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mdavey.wordpress.com/2735/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mdavey.wordpress.com/2735/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mdavey.wordpress.com/2735/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mdavey.wordpress.com/2735/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mdavey.wordpress.com/2735/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mdavey.wordpress.com/2735/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mdavey.wordpress.com/2735/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mdavey.wordpress.com/2735/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mdavey.wordpress.com/2735/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mdavey.wordpress.com&#038;blog=18454&#038;post=2735&#038;subd=mdavey&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mdavey.wordpress.com/2010/02/02/cep-microsoft-vs-sybase/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sybase acquiring Aleri?</title>
		<link>http://devrandom1.wordpress.com/2010/02/02/sybase-acquiring-aleri/</link>
		<comments>http://devrandom1.wordpress.com/2010/02/02/sybase-acquiring-aleri/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 19:28:06 +0000</pubDate>
		<dc:creator>Dev Ashish</dc:creator>
				<category><![CDATA[Finance]]></category>

		<guid isPermaLink="false">http://devrandom1.wordpress.com/?p=337</guid>
		<description><![CDATA[Looks like Sybase is in the process of acquiring Aleri.
It&#8217;ll be interesting to see how Sybase manages Aleri and Coral8 products, in both development and deployment (licensing).
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devrandom1.wordpress.com&#38;blog=8864275&#38;post=337&#38;subd=devrandom1&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<p>Looks like Sybase is in the process of <a href="http://www.securitiesindustry.com/news/-24611-1.html" >acquiring Aleri</a>.</p>
<p>It&#8217;ll be interesting to see how Sybase manages Aleri and Coral8 products, in both development and deployment (licensing).</p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devrandom1.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devrandom1.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devrandom1.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devrandom1.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devrandom1.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devrandom1.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devrandom1.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devrandom1.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devrandom1.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devrandom1.wordpress.com/337/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devrandom1.wordpress.com&#038;blog=8864275&#038;post=337&#038;subd=devrandom1&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://devrandom1.wordpress.com/2010/02/02/sybase-acquiring-aleri/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conventional Retail Computing Market Fading (into iPad-like devices)</title>
		<link>http://blog.lab49.com/archives/4046</link>
		<comments>http://blog.lab49.com/archives/4046#comments</comments>
		<pubDate>Tue, 02 Feb 2010 17:34:49 +0000</pubDate>
		<dc:creator>Asser Moustafa</dc:creator>
				<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://blog.lab49.com/?p=4046</guid>
		<description><![CDATA[I think the iPad’s release was yet another sign that the retail computer market has largely been merged into the market of internet-enabled devices. Now what matters more is how well a home computer can surf the web. CPU-speed has been substituted in importance with the network(s) supported (wifi, wimax, att, verizon, etc.)...]]></description>
			<content:encoded><![CDATA[<p>It used to be that a cpu’s speed, amount of memory, and harddisk space were among the key factors that differentiated computers in the retail market. I think the iPad’s release was yet another sign that the retail computer market has largely been merged into the market of internet-enabled devices. Now what matters more is how well a home computer can surf the web. CPU-speed has been substituted in importance with the network(s) supported (wifi, wimax, att, verizon, etc.) ; more focus is given toward how nice the display (size, weight, touchscreen, etc.). The software, however, continues to be a crucial factor as indicated by the flurry of complaints that the iPad does not support Flash.</p>
<p>Having said all of that, I think the iPad is a real disappointment as a home computer and internet-enabled device. Apple should un-invent it and release something worthwhile a year from now. I predict there will be many who feel similarly disappointed by the iPad, but will still buy it with the hope that support for the iPad today will enable Apple to bring something to market that is not a disappointment. I wish them good luck. Some others will probably get it because, if nothing else, it&#8217;s a cool touchscreen-toy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lab49.com/archives/4046/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bottom up research and investing</title>
		<link>http://www.usablemarkets.com/2010/02/02/bottom-up-research-and-investing/</link>
		<comments>http://www.usablemarkets.com/2010/02/02/bottom-up-research-and-investing/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 14:16:03 +0000</pubDate>
		<dc:creator>Alex Kirtland</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.usablemarkets.com/?p=1632</guid>
		<description><![CDATA[I&#8217;m in the middle of reading When Markets Collide by Mohamed A. El-Erian, and, although it&#8217;s a rather ho-hum book, I did find this interesting sentence:
PIMCO &#8220;looked closely at the way the housing market actually functioned at the microlevel.  Their research included participating in &#8220;ride alongs&#8221; with local real estate and mortgage agents.  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the middle of reading <i><a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jvb2tzLmdvb2dsZS5jb20vYm9va3M/aWQ9c21aNGE4VHowbG9D">When Markets Collide</a></i> by <a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Nb2hhbWVkX0EuX0VsLUVyaWFu">Mohamed A. El-Erian</a>, and, although it&#8217;s a rather ho-hum book, I did find this interesting sentence:</p>
<blockquote><p>PIMCO &#8220;looked closely at the way the housing market actually functioned at the microlevel.  Their research included participating in &#8220;ride alongs&#8221; with local real estate and mortgage agents.  Their findings &#8230; spoke clearly to the excesses taking place.</p>
</blockquote>
<p>In and of itself perhaps not too astounding, but it&#8217;s implications are a bit astonishing.</p>
<p><b>1.</b> During the housing bubble many investors were not doing the leg work to understand the very thing they were investing in.  </p>
<p><b>2.</b> And, (and perhaps more important from my perspective) how important doing the basic, almost ethnographic, research was to informing how PIMCO invested.</p>
<p>~alex</p>
<p> <img src="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?view=1&#038;post_id=1632" width="1" height="1" style="display: none;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.usablemarkets.com/2010/02/02/bottom-up-research-and-investing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JMockit &amp; JavaAgent &#8211; Enterprise integration woes</title>
		<link>http://feedproxy.google.com/~r/vshank77/~3/er91ScKi2nQ/jmockit-javaagent-enterprise.html</link>
		<comments>http://feedproxy.google.com/~r/vshank77/~3/er91ScKi2nQ/jmockit-javaagent-enterprise.html#comments</comments>
		<pubDate>Mon, 01 Feb 2010 21:46:00 +0000</pubDate>
		<dc:creator>Shankar Vasudevan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Lab49]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-3821115221571460038.post-9038156402701573604</guid>
		<description><![CDATA[We've been using JMockit as the preferred mocking utility at a large Bank that I'm consulting at. While generally the product and its non-intrusive mocking features are commendable, some of the under-the-hood mechanisms have caused us a nightmare with ...]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been using <a href="http://code.google.com/p/jmockit/" >JMockit</a> as the preferred mocking utility at a large Bank that I&#8217;m consulting at. While generally the product and its <a href="http://dhruba.name/2009/11/08/jmockit-no-holds-barred-testing-with-instrumentation-over-mocking/" >non-intrusive mocking</a> features are commendable, some of the under-the-hood mechanisms have caused us a nightmare with our continuous integration.</p>
<p>After upgrading to latest version of JMockit, version 0.996.0, we had ALL our unit tests failing with the following spurious error<br />
</p>
<pre class="brush: java">java.lang.NoClassDefFoundError: org.junit.runner.Runner
 at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
 at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:29)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
</init></init></pre>
<p>While my colleague who had been advocating the use of the utility asked me for a way to change the order of libraries in the classpath, we smelt rot and started debugging under the hood. After quite a bit of digging around, we found that the actual error was caused by the failure to load the JMockit agent dynamically. The following code is the sequence of calls which JMockit makes to load the agent.<br />
</p>
<pre class="brush: java"> public class Startup {

   // other code omitted
   public static void verifyInitialization()
   {
      if (instrumentation == null) {
         new AgentInitialization().initializeAccordingToJDKVersion();
      }
   }
}

public final class AgentInitialization
{
   public void initializeAccordingToJDKVersion()
   {
      String jarFilePath = discoverPathToJarFile();
      if (Startup.jdk6OrLater) {
         new JDK6AgentLoader(jarFilePath).loadAgent();
      }
      else if ("1.5".equals(Startup.javaSpecVersion)) {
         throw new IllegalStateException(
            "JMockit has not been initialized. Check that your Java 5 VM has been started " +
            "with the -javaagent:" + jarFilePath + " command line option.");
      }
      else {
         throw new IllegalStateException("JMockit requires a Java 5 VM or later.");
      }
   }
   private String discoverPathToJarFile()
   {
      CodeSource codeSource = AgentInitialization.class.getProtectionDomain().getCodeSource();
      if (codeSource == null) {
         return findPathToJarFileFromClasspath();
      }

      URI jarFileURI; // URI is needed to deal with spaces and non-ASCII characters
      try {
         jarFileURI = codeSource.getLocation().toURI();
      }
      catch (URISyntaxException e) {
         throw new RuntimeException(e);
      }

      return new File(jarFileURI).getPath();
   }

   private String findPathToJarFileFromClasspath()
   {
      String[] classPath = System.getProperty("java.class.path").split(File.pathSeparator);
      for (String cpEntry : classPath) {
         if (cpEntry.matches(".*jmockit[-.\\d]*.jar")) {
            return cpEntry;
         }
      }
      return null;
   }
}</pre>
<p>While this approach is non-intrusive and works out of the box in most cases, in large enterprise organisations, you are often limited extensively and work in a confined environment. My current environment loads files from a network file system and the following lines from the <i>discoverPathToJarFile()</i> cause the class initialization error<br />
</p>
<pre class="brush: java"> jarFileURI = codeSource.getLocation().toURI(); </pre>
<p>returns<br />
</p>
<pre class="brush: java"> CodeSource
file://remoterepository/libraries/jmockit/0.996.0/install/common/lib/jmockit.jar </pre>
<p>and </p>
<pre class="brush: java"> return new File(jarFileURI).getPath(); </pre>
<p>returns </p>
<pre class="brush: java"> IllegalArgumentException: URI has an authority component </pre>
<p>We had been using JMockit for a while now since 0.991.0 version and the agent loading had always been a problem. In our original usage, we had to do two things. We had to create our own version of the <a href="http://code.google.com/p/jmockit/source/browse/trunk/main/src/mockit/internal/startup/JDK6AgentLoader.java" >JDK6AgentLoader</a> as this class has package level scope and create our own JUnit4 runner which loaded the agent from a hard-coded location, as below<br />
</p>
<pre class="brush: java">public final class MyJMockitRunner extends BlockJUnit4ClassRunner
{
   static
   {
      MyJDK6AgentLoader.loadAgent(hardCodedPathtoAgentJar);
   }

   public JMockit(Class testClass) throws InitializationError
   {
      super(testClass);
   }
}
</pre>
<p>
<b>Why the problem now?</b></p>
<p>What changed majorly between the two versions was, Shadowing the org.junit.runner.Runner class which in the modified version loaded the java agent before initialization of the class. </p>
<pre class="brush: java">public abstract class Runner implements Describable
{
   static
   {
      Startup.initializeIfNeeded();
   }

   public abstract Description getDescription();

   public abstract void run(RunNotifier notifier);

   public int testCount()
   {
      return getDescription().testCount();
   }
}</pre>
<p>So even though we are trying to load the agent in our custom Runner, the loading of the Runner class itself preceding the sequence and aggressively loads the agent in its own strategy.</p>
<p>While this is a possible approach, I would highly criticize the usage of class shadowing for the following reasons</p>
<ol>
<li>Open source API generally provide certain basic guarantees, and is generally tested extensively by the commnuity in different enviroments to ensure they work in the way they are designed. By shadowing a public class, you override this guarantee and for most common developers, the fact that they are using a modified class is oblivious. This can lead to late night debugging sessions and nightmares when things go wrong.</li>
<li>In this particular case, while only the tests that used JMockit should have failed, thousands of test cases across multiple projects failed at once. As a programmer, I always believe to lazily load resources and only when they are needed. But there is a necessity for mocking or not, the agent is going to be loaded whenever a Unit test is run. This is fundamentally wrong.</li>
<li>Any workarounds that had been applied to the library fail miserably with this aggressive approach to force your library to behave in a specific way.</li>
<li>While I agree that the owner cannot foresee all the environments his library would be used, trying to perform gimmicks under the hood on an open library could have been avoided.</li>
</ol>
<p>
<b>Solution</b> </p>
<p>While I&#8217;ve criticized the usage of shadowing a class, unfortunately the only solution that worked for us was to shadow the JMockit class that loaded the agent as below.<br />
</p>
<pre class="brush: java">public final class AgentInitialization
{
   public void initializeAccordingToJDKVersion()
   {
 MyJDK6AgentLoader.loadAgent(hardCodedPathtoAgentJar);
   }
}</pre>
<p><b>Better approach</b></p>
<p>There are a couple of suggestions for the JMockit API to overcome the shortcomings described above</p>
<ol>
<li>Please do remove the shadowed JUnit class and make the agent loading explicit. This is already the case when you use the JMockit.class as the runner.</li>
<li>While the auto detection of the agent is brilliant, there could be some hooking mechanism which allowed the developers to extend it with their own strategies.</li>
</ol>
<p>Last but not least, there definitely was an obvious solution to the problem, which was to explicitly specify the agent path in the VM arguments. The issue we had in that was there were too many OS, at least a few IDE, a shared continuous integration server and many many ant build scripts that need to be updated. It would have been a far more involved effort to get all this modified and maintained than applying a code fix which worked &#8220;under the hood&#8221;
<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3821115221571460038-9038156402701573604?l=www.vshank77.com' alt='' /></div>
<p><img src="http://feeds.feedburner.com/~r/vshank77/~4/er91ScKi2nQ" height="1" width="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/vshank77/~3/er91ScKi2nQ/jmockit-javaagent-enterprise.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to integrate .Net 4.0 Tasks with WPF</title>
		<link>http://blog.lab49.com/archives/4034</link>
		<comments>http://blog.lab49.com/archives/4034#comments</comments>
		<pubDate>Mon, 01 Feb 2010 19:01:00 +0000</pubDate>
		<dc:creator>David Barnhill</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[4.0]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://blog.lab49.com/archives/4034</guid>
		<description><![CDATA[
When using the new System.Threading.Tasks.Task class in a WPF application, it’s not obvious how to make Tasks work well with the WPF UI thread.&#160; DependencyProperty’s in .Net must be accessed from the UI thread.&#160; Normally you would use Dispatcher.Invoke() or Dispatcher.BeginInvoke() to make sure an operation occurs on the correct thread.&#160; The correct way to [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>When using the new <a href="http://msdn.microsoft.com/en-us/library/system.threading.tasks.task(VS.100).aspx">System.Threading.Tasks.Task</a> class in a WPF application, it’s not obvious how to make Tasks work well with the WPF UI thread.&#160; DependencyProperty’s in .Net must be accessed from the UI thread.&#160; Normally you would use Dispatcher.Invoke() or Dispatcher.BeginInvoke() to make sure an operation occurs on the correct thread.&#160; The correct way to do this with Tasks is with TaskScheduler.FromCurrentSyncrhonizationContext() as the task scheduler for a Task.&#160; You specify the scheduler when either creating a task or as part of a ContinueWith call on an existing Task.</p>
<p> The other piece of the puzzle is error handling with tasks.&#160; If an exception is thrown inside a task, then that task catches the exception internally, stores it in Task.Exception and sets Task.IsFaulted = true.&#160; When you continue from one task to the next using Task.ContinueWith() the error context is passed along with it.&#160; This allows you to handle any background exception on the foreground thread in a central place instead of putting a try/catch block in the background Task.&#160; If you do not check for the Task.Exception before the last chained task completes, and an exception was thrown in any of the chained tasks, then the exception will throw inside of the finalizer of the last Task in the chain! This feature is only for debugging purposes, so you MUST check for exceptions inside your last Task or catch all exceptions inside each Task.&#160;
</p>
<p>The following code snippet shows how it all works together:</p>
<p> <a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a>
<pre class="code">QueryDone = <span style="color: blue">false</span>;
<span style="color: blue">string </span>arguments = <span style="color: #a31515">&quot;&quot;</span>;
<span style="color: #2b91af">Task</span>.Factory.StartNew(() =&gt;
        <span style="color: green">//do work on background task
        </span>DoDatabaseQuery(arguments)
    )
    <span style="color: green">//schedule this task on the UI thread after the
    //background task completes
    </span>.ContinueWith(
        (task) =&gt;
        {
            <span style="color: green">//must check for task fault so that exceptions
            //are handled correctly.
            //If task.Exception is not checked, then any
            //exceptions from a background task will be
            // rethrown in the task's finalizer
            </span><span style="color: blue">if </span>(task.IsFaulted)
            {
                <span style="color: #2b91af">MessageBox</span>.Show(task.Exception.ToString());
            }

            QueryDone = task.IsCompleted;
        },
            <span style="color: green">//use the current synchronization context
            //as the task scheduler so that
            //continuation occurs on UI thread
            </span><span style="color: #2b91af">TaskScheduler</span>.FromCurrentSynchronizationContext());</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lab49.com/archives/4034/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsley Scope Example</title>
		<link>http://www.sammur.com/?p=16</link>
		<comments>http://www.sammur.com/?p=16#comments</comments>
		<pubDate>Mon, 01 Feb 2010 17:00:31 +0000</pubDate>
		<dc:creator>fsammur</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.lab49.com/?p=4033</guid>
		<description><![CDATA[An example that explains and demonstrates contexts and scopes.]]></description>
			<content:encoded><![CDATA[<p>An example that explains and demonstrates contexts and scopes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sammur.com/?p=16/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FIXatdl v1.1 Release Candidate</title>
		<link>http://devrandom1.wordpress.com/2010/02/01/fixatdl-v1-1-release-candidate/</link>
		<comments>http://devrandom1.wordpress.com/2010/02/01/fixatdl-v1-1-release-candidate/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 12:54:57 +0000</pubDate>
		<dc:creator>Dev Ashish</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Finance]]></category>

		<guid isPermaLink="false">http://devrandom1.wordpress.com/?p=329</guid>
		<description><![CDATA[The Algoithmic Trading Working Group uploaded the v1.1 Release Candidate (internal build v2.7.0) for FIXatdl recently. You&#8217;ll need to register in order to download the files.
So start coding up those algo UIs already!
Here&#8217;s an earlier post that highlights some of the breaking changes with previous builds.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devrandom1.wordpress.com&#38;blog=8864275&#38;post=329&#38;subd=devrandom1&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<p>The <a href="http://www.fixprotocol.org/working_groups/algowg" >Algoithmic Trading Working Group</a> uploaded the <a href="http://www.fixprotocol.org/FIXatdl" >v1.1 Release Candidate</a> (internal build v2.7.0) for FIXatdl recently. You&#8217;ll need to register in order to download the files.</p>
<p>So start coding up those algo UIs already!</p>
<p>Here&#8217;s an <a href="http://devrandom1.wordpress.com/2009/11/06/fixatdl-breaking-changes-in-v1-1/" >earlier post</a> that highlights some of the breaking changes with previous builds.</p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devrandom1.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devrandom1.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devrandom1.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devrandom1.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devrandom1.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devrandom1.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devrandom1.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devrandom1.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devrandom1.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devrandom1.wordpress.com/329/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devrandom1.wordpress.com&#038;blog=8864275&#038;post=329&#038;subd=devrandom1&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://devrandom1.wordpress.com/2010/02/01/fixatdl-v1-1-release-candidate/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leveraging Eclipse for TDD</title>
		<link>http://martinaharris.com/2010/02/leveraging-eclipse-for-tdd/</link>
		<comments>http://martinaharris.com/2010/02/leveraging-eclipse-for-tdd/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 05:00:03 +0000</pubDate>
		<dc:creator>Martin Harris</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://martinaharris.com/?p=722</guid>
		<description><![CDATA[I have found that quite a few programmers struggle to work in a completely test driven fashion.  I myself whilst writing tests for many years, took a long time to move over to writing the test first.  I think one of my problems was that I always wanted to do my thinking in [...]]]></description>
			<content:encoded><![CDATA[<p>I have found that quite a few programmers struggle to work in a completely test driven fashion.  I myself whilst writing tests for many years, took a long time to move over to writing the test first.  I think one of my problems was that I always wanted to do my thinking in [...]</p>
]]></content:encoded>
			<wfw:commentRss>http://martinaharris.com/2010/02/leveraging-eclipse-for-tdd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clever design fights corruption in India</title>
		<link>http://www.usablemarkets.com/2010/01/31/clever-design-fights-corruption-in-india/</link>
		<comments>http://www.usablemarkets.com/2010/01/31/clever-design-fights-corruption-in-india/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 14:53:43 +0000</pubDate>
		<dc:creator>Alex Kirtland</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.usablemarkets.com/?p=1625</guid>
		<description><![CDATA[What can design do to fight corruption?  It can provide a tool for people who want to stand up to it.  Handing this zero rupee note to corrupt officials in India had this effect:
One official in Tamil Nadu was so stunned to receive the note that he handed back all the bribes he [...]]]></description>
			<content:encoded><![CDATA[<p>What can design do to fight corruption?  It can provide a tool for people who want to stand up to it.  Handing this zero rupee note to corrupt officials in India had this effect:</p>
<blockquote><p>One official in Tamil Nadu was so stunned to receive the note that he handed back all the bribes he had solicited for providing electricity to a village. Another stood up, offered tea to the old lady from whom he was trying to extort money and approved a loan so her granddaughter could go to college.</p>
</blockquote>
<p><img style="border: 1px solid ;" alt="0-rupees" src="http://www.usablemarkets.com/images/0-rupees.jpg"></p>
<p><a href="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5lY29ub21pc3QuY29tL3dvcmxkL2FzaWEvZGlzcGxheXN0b3J5LmNmbT9zdG9yeV9pZD0xNTM5MzcxNA==">The full story at the economist.</a></p>
<p>~alex</p>
<p> <img src="http://www.usablemarkets.com/wp-content/plugins/feed-statistics.php?view=1&#038;post_id=1625" width="1" height="1" style="display: none;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.usablemarkets.com/2010/01/31/clever-design-fights-corruption-in-india/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Week @Lab Jan 30, 2010</title>
		<link>http://goldmanalpha.wordpress.com/2010/01/31/week-lab-jan-30-2010/</link>
		<comments>http://goldmanalpha.wordpress.com/2010/01/31/week-lab-jan-30-2010/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 05:01:31 +0000</pubDate>
		<dc:creator>Aaron Goldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://goldmanalpha.wordpress.com/2010/01/30/week-lab-jan-30-2010/</guid>
		<description><![CDATA[Where Everybody Knows Your Name
“I saw Alvin and The Chipmunks this weekend” – and they all laughed.
Some UXers were interested in
this color picker and this musical toy.
IPad
Lots of Lab Buzz around the IPad announcement, though we already knew this. More information about Apple&#8217;s design process, direct from Apple here and here. Overhyped? Underwhelming? Overpriced? Beautiful? [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=goldmanalpha.wordpress.com&#38;blog=9682964&#38;post=456&#38;subd=goldmanalpha&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>
<h2>Where Everybody Knows Your Name</h2>
<p>“I saw Alvin and The Chipmunks this weekend” – and they all laughed.</p>
<h2>Some UXers were interested in</h2>
<p><a href="http://www.core77.com/blog/object_culture/jinsun_parks_awesome_color_picker_concept_15796.asp">this color picker</a> and <a href="http://www.thepixelplant.net/dmf/dmf4.html">this musical toy</a>.</p>
<h2>IPad</h2>
<p>Lots of Lab Buzz around the <a href="http://www.apple.com/ipad/features/" >IPad</a> announcement, though we already knew <a href="http://9gag.com/gag/17569" >this</a>. More information about Apple&#8217;s design process, direct from Apple <a href="http://developer.apple.com/Mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGDesignProcess/XHIGDesignProcess.html">here</a> and <a href="http://developer.apple.com/Mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIntro/XHIGIntro.html">here</a>. Overhyped? <a href="http://finance.yahoo.com/news/Apple-Unveils-the-Sadly-minyanville-1177128906.html?x=0" >Underwhelming</a>? Overpriced? Beautiful? Must have? Oh Yea.</p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/goldmanalpha.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/goldmanalpha.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/goldmanalpha.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/goldmanalpha.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/goldmanalpha.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/goldmanalpha.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/goldmanalpha.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/goldmanalpha.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/goldmanalpha.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/goldmanalpha.wordpress.com/456/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=goldmanalpha.wordpress.com&#038;blog=9682964&#038;post=456&#038;subd=goldmanalpha&#038;ref=&#038;feed=1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://goldmanalpha.wordpress.com/2010/01/31/week-lab-jan-30-2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
