<?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"
	>

<channel>
	<title>carl</title>
	<atom:link href="http://blogs.splunk.com/carl/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.splunk.com/carl</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Thu, 17 Jan 2008 00:35:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>JavaScript Error Reporting with Splunk</title>
		<link>http://blogs.splunk.com/carl/2008/01/16/javascript-error-logging-with-splunk/</link>
		<comments>http://blogs.splunk.com/carl/2008/01/16/javascript-error-logging-with-splunk/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 00:18:46 +0000</pubDate>
		<dc:creator>carl</dc:creator>
		
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://blogs.splunk.com/carl/2008/01/16/javascript-error-logging-with-splunk/</guid>
		<description><![CDATA[Keeping track of new browser releases these days can be really challenging. It is less than ideal if your payment processor is throwing a JavaScript onsubmit exception effectively canceling all transactions.
Here is a little technique for indexing JavaScript exceptions in your production and development environments using Splunk.
In JavaScript create an onerror event handler that makes [...]]]></description>
			<content:encoded><![CDATA[<p>Keeping track of new browser releases these days can be really challenging. It is less than ideal if your payment processor is throwing a JavaScript onsubmit exception effectively canceling all transactions.</p>
<p>Here is a little technique for indexing JavaScript exceptions in your production and development environments using Splunk.</p>
<p>In JavaScript create an onerror event handler that makes an HTTP request to a server that has access logs indexed by Splunk. </p>
<pre>
<code>
    function JSErrorLogger(httpBeacon){
        var self = this;
        self.handler = function(msg, url, line){
            var log = {
                "date":new Date(),
                "type":"jserror",
                "line":line,
                "msg":msg,
                "url":url
            }
            var logStr = "";
            for(var i in log){
                logStr += i + ":" + log[i] + &#8221; &#8220;;
            }
            var imgObj = new Image();
            imgObj.src = httpBeacon + &#8220;?&#8221; + logStr;
        };
        self.JSErrorLogger = function(){
            window.onerror = self.handler;
        }();
    }
</code>
</pre>
<p>Make sure that this JavaScript is the very first item executed by the interpreter, ensuring all exceptions are caught by the event handler. </p>
<p>Instantiate the class with a URI that points to a beacon on a machine that has Splunk indexing the access log. You may want to set some environment variables in JavaScript that turn logging on for only testing and production machines.</p>
<pre>
<code>
   //if environment test or production
   var splunkJSErrorIndexer = new JSErrorLogger("http://somedomain.com/beacon.gif");
</code>
</pre>
<p>That&#8217;s it, now you can empirically understand JavaScript exceptions being raised, set blackberry alerts and correlate ui stability issues to deploys:) </p>
<p>Happy JavaScript Monitoring!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.splunk.com/carl/2008/01/16/javascript-error-logging-with-splunk/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hey Browser, You&#8217;ve Got Tail!</title>
		<link>http://blogs.splunk.com/carl/2007/12/05/hey-ui-youve-got-tail/</link>
		<comments>http://blogs.splunk.com/carl/2007/12/05/hey-ui-youve-got-tail/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 00:24:41 +0000</pubDate>
		<dc:creator>carl</dc:creator>
		
		<category><![CDATA[dev]]></category>

		<category><![CDATA[preview]]></category>

		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://blogs.splunk.com/carl/2007/12/05/hey-ui-youve-got-tail/</guid>
		<description><![CDATA[For those interested in monitoring real-time data being consumed by Splunk we&#8217;ve introduced a new feature called Live Tail to the latest preview release. Additionally, we&#8217;ve added a nifty new REST endpoint /v3/splunk/tail for your custom application needs.

More information can be found in these videos:

A quick walkthrough of the new preview release feature Live Tail, [...]]]></description>
			<content:encoded><![CDATA[<p>For those interested in monitoring real-time data being consumed by Splunk we&#8217;ve introduced a new feature called Live Tail to the latest <a href="http://www.splunk.com/index.php/preview">preview release</a>. Additionally, we&#8217;ve added a nifty new REST endpoint /v3/splunk/tail for your custom application needs.</p>
<p><a href='http://blogs.splunk.com/devuploads/2007/12/live-tail1.png' title='Live Tail'><img src='http://blogs.splunk.com/devuploads/2007/12/live-tail1.png' alt='Live Tail'  width="600px" /></a></p>
<p>More information can be found in these videos:</p>
<ul>
<li>A quick walkthrough of the new preview release feature Live Tail, its UI, and some sample code - <a href="http://blogs.splunk.com/devuploads/2007/11/carl_livetail.mov">See Video</a></li>
<li>An overview of the architecture used to integrate real-time data from Splunk Live Tail in a web browser. Challenges and workarounds when using JavaScript/Flash hybrids - <a href="http://www.johnleestma.com/video/Carl_Handling_.mov">See Video</a></li>
</ul>
<p>Happy <a href="http://dev.splunk.com/2007/11/16/flashas3-urlstream-memory-leak/">Streams</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.splunk.com/carl/2007/12/05/hey-ui-youve-got-tail/feed/</wfw:commentRss>
<enclosure url="http://www.johnleestma.com/video/Carl_Handling_.mov" length="138104951" type="video/quicktime" />
<enclosure url="http://dev.splunk.com/wp-content/uploads/2007/11/carl_livetail.mov" length="38808273" type="video/quicktime" />
		</item>
		<item>
		<title>Flash/AS3 URLStream Memory Leak</title>
		<link>http://blogs.splunk.com/carl/2007/11/16/flashas3-urlstream-memory-leak/</link>
		<comments>http://blogs.splunk.com/carl/2007/11/16/flashas3-urlstream-memory-leak/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 21:06:15 +0000</pubDate>
		<dc:creator>carl</dc:creator>
		
		<category><![CDATA[dev]]></category>

		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://blogs.splunk.com/carl/2007/11/16/flashas3-urlstream-memory-leak/</guid>
		<description><![CDATA[Lately we have been doing some work with persistent connections. If you are familiar with Comet the Flash/AS3 URLStream class provides an interesting alternative. The URLStream class exposes raw binary data as it is downloaded. 
Unfortunately, this week we ran into a rather tricky memory leak when using this nifty class. An event listener was [...]]]></description>
			<content:encoded><![CDATA[<p>Lately we have been doing some work with persistent connections. If you are familiar with <a href="http://alex.dojotoolkit.org/?p=545">Comet</a> the Flash/AS3 <a href="http://livedocs.adobe.com/flex/2/langref/flash/net/URLStream.html">URLStream</a> class provides an interesting alternative. The URLStream class exposes raw binary data as it is downloaded. </p>
<p>Unfortunately, this week we ran into a rather tricky memory leak when using this nifty class. An event listener was subscribed to the <a href="http://livedocs.adobe.com/flex/2/langref/flash/net/URLStream.html#event:progress">progress</a> event and over time memory usage steadily increased to a point of making the browser inoperable.  </p>
<p>After a little digging we narrowed the problem down to the URLStreams usage of the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/ByteArray.html">ByteArray</a>. It seems as if URLStream was reallocating a buffer for the array and the short turn around time (on the reads) was not giving the garbage collector enough time to throw out the old allocation. </p>
<p>The way the leak could be corrected was by deleting the ByteArray (Set null), forcing garbage collection of the read buffer.</p>
<p>Here is the workaround:</p>
<p><code><br />
	var bytes:ByteArray = new ByteArray();<br />
	this.readBytes(bytes, 0, this.bytesAvailable);<br />
	bytes = null;<br />
</code></p>
<p>Happy Streams!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.splunk.com/carl/2007/11/16/flashas3-urlstream-memory-leak/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript Hybrids (Extending the browser) - Part 1</title>
		<link>http://blogs.splunk.com/carl/2007/10/15/javascript-hybrids-extending-the-browser-part-1/</link>
		<comments>http://blogs.splunk.com/carl/2007/10/15/javascript-hybrids-extending-the-browser-part-1/#comments</comments>
		<pubDate>Mon, 15 Oct 2007 20:33:38 +0000</pubDate>
		<dc:creator>carl</dc:creator>
		
		<category><![CDATA[dev]]></category>

		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://blogs.splunk.com/carl/2007/10/15/javascript-hybrids-extending-the-browser-part-1/</guid>
		<description><![CDATA[I deeply enjoy browser programming, however sometimes I wish it could do more. Things like sockets, streams, audio and improved file system handling would be a real treat. Man would it be fresh if I had access to this functionality in JavaScript.
Now this is going to sound pretty circa 98, but several main stream browser [...]]]></description>
			<content:encoded><![CDATA[<p>I deeply enjoy browser programming, however sometimes I wish it could do more. Things like sockets, streams, audio and improved file system handling would be a real treat. Man would it be fresh if I had access to this functionality in JavaScript.</p>
<p>Now this is going to sound pretty circa 98, but several main stream browser plugins support a JavaScript communication layer. According to the <a href="http://www.adobe.com/products/player_census/flashplayer/">Millward Brown survey</a> plugin installations of Flash (99%) and Java (85%) are pretty ubiquitous. </p>
<p><b>Flash/JavaScript Communication</b><br />
The Flash <a href="http://livedocs.adobe.com/flex/201/langref/flash/external/ExternalInterface.html">ExternalInterface</a> class enables communication between JavaScript and the Flash Player.  ExternalInterface was first introduced in ActionScript 1.0; so Flash Player 8 is the minimum plugin version required.<br />
From JavaScript</p>
<ul>
<li>Call an ActionScript function</li>
<li>Pass arguments</li>
<li>Return a value to the JavaScript callee</li>
</ul>
<p>From ActionScript</p>
<ul>
<li>Call a JavaScript function</li>
<li>Pass arguments</li>
<li>Pass various data types (Boolean, Number, String, etc&#8230;)</li>
</ul>
<p><b>Java Applet/JavaScript Communication</b><br />
The scarcely documented <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:LiveConnect">LiveConnect</a> API provides JavaScript with the ability to call methods of Java classes and vice-versa. Using LiveConnect in applets requires the <a href="http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html#enablingjsobjectsupport">mayscript</a> attribute and the plugin.jar package for newer versions of Java (Howto for <a href="http://developer.apple.com/qa/qa2004/qa1364.html">Mac OS X</a> users). Communication from Java to JavaScript is mitigated through the <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:LiveConnect:JSObject">netscape.javascript.JSObject</a> class. JavaScript exceptions in Java can be handled using the <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:LiveConnect:JSException">netscape.javascript.JSException</a> class. Public methods in an applet can be called using the applet container object followed by the method name and arguments (e.g., document.getElementById(&#8221;myapplet&#8221;).publicAppletMethod(arg1, argN);).</p>
<p>From JavaScript</p>
<ul>
<li>Call a Java method</li>
<li>Pass arguments</li>
<li>Return a value to the JavaScript callee</li>
</ul>
<p>From Java</p>
<ul>
<li>Call a JavaScript function (Note: does not seem to support deep objects obj.foo(arg))</li>
<li>Pass arguments</li>
<li>Pass various data types (Boolean, Number, String, etc&#8230;)</li>
</ul>
<p>It looks like LiveConnect is <a href="http://boomswaggerboom.wordpress.com/2007/04/16/javaplugin-cleanup-for-mozilla-20/">due for an overhaul</a> in the near future, so you may want to keep your eyes out for changes on Mozilla developer <a href="http://boomswaggerboom.wordpress.com/">Josh Aas&#8217;s blog</a>.   </p>
<p><b>What&#8217;s Next</b><br />
With the power of Java and Flash this opens up the arena for creating visually hidden gateways (i.e., width:0px; height:0px; applets or swf movies) that extend the browser. Stay tuned for the next part in this series where we make a sample application. Feel the power!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.splunk.com/carl/2007/10/15/javascript-hybrids-extending-the-browser-part-1/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
