<?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>Rantings in the dark &#187; Uncategorized</title>
	<atom:link href="http://kinsey.no/blog/index.php/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://kinsey.no/blog</link>
	<description>Because I want to be like the cool kids too</description>
	<lastBuildDate>Mon, 03 Oct 2011 22:01:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Moving to San Francisco</title>
		<link>http://kinsey.no/blog/index.php/2011/10/03/moving-to-san-francisco/</link>
		<comments>http://kinsey.no/blog/index.php/2011/10/03/moving-to-san-francisco/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 21:40:48 +0000</pubDate>
		<dc:creator>oyvind.kinsey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[san francisco]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=336</guid>
		<description><![CDATA[So, it turns out I&#8217;ve accepted a position with Facebook and will be moving to San Francisco as soon as my H1-B clears (should be in not too many weeks). The last six years spent with BRIK has been wonderful and I&#8217;ve grown both as a human and as a developer. I&#8217;ve worked on a [...]]]></description>
			<content:encoded><![CDATA[<p>So, it turns out I&#8217;ve accepted a position with Facebook and will be moving to San Francisco as soon as my H1-B clears (should be in not too many weeks).</p>
<p>The last six years spent with <a href="http://brik.no" target="_blank">BRIK</a> has been wonderful and I&#8217;ve grown both as a human and as a developer. I&#8217;ve worked on a lot of fun projects, some of which has grown quite large, and some not so fun ones. I&#8217;ve worked with every aspect of development, from working with clients to drawing technical flowcharts only to throw them away moments later. I&#8217;ve worked solo and I&#8217;ve acted as CTO for my own, and other companies. I&#8217;ll still have an interest in the company as member of the Board, and as an owner, but if everything goes as planned, the company will carry on, and continue to grow even without me as we&#8217;ve got some great people on board, and hopefully more will join us (<a href="http://brik.no/jobb_i_brik/page41.html">want in on the action?</a>).</p>
<p>Time will tell what I&#8217;ll be doing at Facebook, but with the people I&#8217;ve met there, the atmosphere and the culture, I can promise you it&#8217;s going to be awesome! I have great expectations, to the company as a whole, but most to Facebook as a platform for a new generation of socially enabled (and driven) applications.</p>
<p>As you can probably understand, I&#8217;m really thrilled about joining the company, and to add to that, it has caused some publicity here in Norway in both regional and nation wide newspaper (printed and online).<br />
Although most of the content is correct, and as expected, some of it comes across a bit out of context and without reference, which really isn&#8217;t to my liking. But I guess that is to be expected..<br />
Anyway&#8217;s, just to make it clear; statements such as &#8220;I&#8217;m the best in the world&#8221; are taken completely out of context (and proportions) (I am <em>one </em>of the best on my specific field), and I did not make comments about certain people not knowing what they were doing, rather that they weren&#8217;t <em>fully</em> in control of that specific field.</p>
<p>But it&#8217;s getting late now, and in about 5 hours, I&#8217;ll be on my way to the airport to spend two weeks in San Francisco doing som RnR and some apartment scouting &#8211; if you know something suitable in the Mission are, do give me a shout!</p>
]]></content:encoded>
			<wfw:commentRss>http://kinsey.no/blog/index.php/2011/10/03/moving-to-san-francisco/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using WCF/svc&#8217;s automatically generated javascript proxies _without_ ASP.NET AJAX</title>
		<link>http://kinsey.no/blog/index.php/2009/10/28/using-wcfsvcs-automatically-generated-javascript-proxies-_without_-asp-net-ajax/</link>
		<comments>http://kinsey.no/blog/index.php/2009/10/28/using-wcfsvcs-automatically-generated-javascript-proxies-_without_-asp-net-ajax/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 17:11:05 +0000</pubDate>
		<dc:creator>oyvind.kinsey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net ajax]]></category>
		<category><![CDATA[Ext Js]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[svc]]></category>
		<category><![CDATA[wcf]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=133</guid>
		<description><![CDATA[Most of my web based projects consist of WCF driven webservices at the backend and a javascript UI using ExtJS, and for access to the WCF webservice I like to use its automatically generated proxies as this abstracts away the feeling of working with XMLHttpRequests, actually it abstracts it to a level where you can [...]]]></description>
			<content:encoded><![CDATA[<p>Most of my web based projects consist of WCF driven webservices at the backend and a javascript UI using <a href="http://extjs.com" target="_blank">ExtJS</a>, and for access to the WCF webservice I like to use its automatically generated proxies as this abstracts away the feeling of working with XMLHttpRequests, actually it abstracts it to a level where you can call the server side method &#8216;directly&#8217;, specifying only a callback function that should receive the response. These proxies are dynamically generated and will always reflect the serverside methods signature.<br />
<span id="more-133"></span><br />
To use the proxies all you need to do is (as long as the correct bindings are in place) access the .svc file with either &#8216;/js&#8217; or &#8216;/jsdebug&#8217; appended, and you will get the generated proxies.<br />
By the way, if you use any objects, either as an argument or as a return type, these will also be created as javascript &#8216;classes&#8217;, the same with any enumerations &#8211; its all wery nice.</p>
<p>Using both <a href="http://www.asp.net/ajax/" target="_blank">ASP.NET AJAX</a> and <a href="http://extjs.com" target="_blank">ExtJS </a>on the same page does not create any serious problems (I think there might be a couple of collisions on the Date object), but it does mean that you have quite a bit of overhead.</p>
<p>Removing the ASP.NET AJAX framework does not work initially as the generated proxy code needs this to work, so if we remove the ASP.NET AJAX framework, well, then we are going to need to replace it with something that caters to the proxy codes needs without the extra overhead of loading the entire ASP.NET AJAX framework. And here it is &#8211; this is the minimum of code needed to bootstrap the automatically generated proxy code, and to tie it into the ExtJs framework. If you want to use it with a different framework then it should not be a difficult task to exchange the Ext dependencies.</p>
<pre class="brush: jscript; smart-tabs: true; tab-size: 4; title: ; notranslate">
// Extend Functions prototype
Function.prototype.initializeBase = function(instance, baseArguments){
};
Function.prototype.registerClass = function(typeName, baseType, interfaceTypes){
    if (baseType) {
        for (var name in baseType.prototype) {
            this.prototype[name] = baseType.prototype[name];
        }
    }
};
Function.prototype.registerEnum = function(name, flags){
};

// Add Type and Type.registerNamespace
var Type = {
    registerNamespace: function(ns){
        var va = window;
        ns = ns.split(&quot;.&quot;);
        for (var i = 0, len = ns.length; i &lt; len; i++) {
            va = va[ns[i]] = {};
        }
    }
};

// Create the Sys.Net.WebServiceProxy object
Type.registerNamespace(&quot;Sys.Net&quot;);

Sys.Net.WebServiceProxy = function(){
    //empty constructor
};

Sys.Net.WebServiceProxy._generateTypedConstructor = function(type){
    return function(properties){
        if (properties) {
            for (var name in properties) {
                this[name] = properties[name];
            }
        }
        this.__type = type;
    };
};

Sys.Net.WebServiceProxy.prototype._invoke = function(path, action, useGet, params, onSuccess, onFailure, userContext){
    // Use Ext.Ajax to perform the xhr call
    Ext.Ajax.request({
        url: path + &quot;/&quot; + action,
        method: useGet ? &quot;get&quot; : &quot;post&quot;,
        jsonData: params,
        success: function(data){
            onSuccess(Ext.decode(data.responseText).d);
        },
        failure: function(data){
            onFailure(Ext.decode(data.responseText).d);
        },
        scope: userContext
    });
};
Sys.Net.WebServiceProxy.prototype.set_path = function(path){
    this._path = path;
};
Sys.Net.WebServiceProxy.prototype.get_path = function(){
    return this._path;
};
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kinsey.no/blog/index.php/2009/10/28/using-wcfsvcs-automatically-generated-javascript-proxies-_without_-asp-net-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running NokiaSoftwareUpdaterSetup on Windows 7</title>
		<link>http://kinsey.no/blog/index.php/2009/10/27/running-nokiasoftwareupdatersetup-on-windows-7/</link>
		<comments>http://kinsey.no/blog/index.php/2009/10/27/running-nokiasoftwareupdatersetup-on-windows-7/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 21:05:57 +0000</pubDate>
		<dc:creator>oyvind.kinsey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[n97]]></category>
		<category><![CDATA[nokia]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=128</guid>
		<description><![CDATA[Today I needed to upgrade the software on my Nokia N97, and was prompted by the Nokia software to download and run NokiaSoftwareUpdaterSetup_en.exe. The only thing was, this just exited with a message saying unsupported platform or something. I quickly tested if the exe file was an archive and discovered I could unpack it with [...]]]></description>
			<content:encoded><![CDATA[<p>Today I needed to upgrade the software on my Nokia N97, and was prompted by the Nokia software to download and run NokiaSoftwareUpdaterSetup_en.exe.</p>
<p>The only thing was, this just exited with a message saying unsupported platform or something. I quickly tested if the exe file was an archive and discovered I could unpack it with 7-Zip. Inside the resulting directory, in a folder named Installer, I found a file called Configuration.icf, and in this a line with the string</p>
<pre class="brush: plain; title: ; notranslate">
TargetOSs=winXP,winVista
</pre>
<p>I added &#8216;,win7&#8242; on a hunch and ran Installer.exe, and what do you know, it worked <img src='http://kinsey.no/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://kinsey.no/blog/index.php/2009/10/27/running-nokiasoftwareupdatersetup-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>easyXSS</title>
		<link>http://kinsey.no/blog/index.php/2009/06/24/easyxss/</link>
		<comments>http://kinsey.no/blog/index.php/2009/06/24/easyxss/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:39:38 +0000</pubDate>
		<dc:creator>oyvind.kinsey</dc:creator>
				<category><![CDATA[easyXDM]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cross-site]]></category>
		<category><![CDATA[easyxss]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=44</guid>
		<description><![CDATA[Please see easyXDM for updated info! I&#8217;ve just completed the first version of my cross-site scripting library easyXSS. It is available at http://code.google.com/p/easyxss/ under a MIT-license. As it is now it supports simple messaging between windows of different domains, but it also supports proxying method calls and results between them making it well-suited for creating [...]]]></description>
			<content:encoded><![CDATA[<p>Please see <a href="http://kinsey.no/blog/index.php/2009/08/20/easyxdm/">easyXDM </a>for updated info!</p>
<p>I&#8217;ve just completed the first version of my cross-site scripting library easyXSS. It is available at <a href="http://code.google.com/p/easyxss/">http://code.google.com/p/easyxss/</a> under a MIT-license.</p>
<p>As it is now it supports simple messaging between windows of different domains, but it also supports proxying method calls and results between them making it well-suited for creating API&#8217;s.</p>
<p>I&#8217;ve prepared several examples and demo&#8217;s at <a href="http://code.google.com/p/easyxss/">http://code.google.com/p/easyxss/</a> and look forward to getting feedback!<br />
<span id="more-44"></span><br />
To show you a quick example, here is the code needed to have a method &#8216;doMagic&#8217; that is located on domainA available in a window from domainB.</p>
<p>This is placed in the document api.html at domainA</p>
<pre class="brush: jscript; smart-tabs: true; tab-size: 4; title: ; notranslate">
var channel = easyXSS.createChannel({
onReady: function(){
remote = easyXSS.createInterface(channel, {
local: {
doMagic: _privateMethodDoingMagic
}
});
}
});
</pre>
<p>and this is placed in the document at domainB</p>
<pre class="brush: jscript; smart-tabs: true; tab-size: 4; title: ; notranslate">
var remote;
var channel = easyXSS.createChannel({
local: &amp;quot;/hash.html&amp;quot;,
remote: &amp;quot;http://domaina.com/api.html&amp;quot;,
onReady: function(){
remote = easyXSS.createInterface(channel, {
remote: {
doMagic: {}
}
});
}
});
</pre>
<p>The medhod doMagic can now be called from domainB using</p>
<pre class="brush: jscript; smart-tabs: true; tab-size: 4; title: ; notranslate">
remote.doMagic('argument1',2,'three',function(result){
// Consume the result
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kinsey.no/blog/index.php/2009/06/24/easyxss/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Ext Calendar</title>
		<link>http://kinsey.no/blog/index.php/2009/02/27/ext-calendar/</link>
		<comments>http://kinsey.no/blog/index.php/2009/02/27/ext-calendar/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 14:39:31 +0000</pubDate>
		<dc:creator>oyvind.kinsey</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Calendar]]></category>
		<category><![CDATA[Ext Js]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=42</guid>
		<description><![CDATA[I just remembered that I had made a decent Ext based calendar (extending Ext.Panel). You can view a demo of it here. The calendar supports loading data through a Ext.data.Store, d&#8217;n'd of timespans, events for handling d&#8217;n'd, editing etc.]]></description>
			<content:encoded><![CDATA[<p>I just remembered that I had made a decent Ext based calendar (extending Ext.Panel).</p>
<p>You can view a demo of it <a href="http://kinsey.no/examples/calendar/">here</a>.</p>
<p>The calendar supports loading data through a Ext.data.Store, d&#8217;n'd of timespans, events for handling d&#8217;n'd, editing etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://kinsey.no/blog/index.php/2009/02/27/ext-calendar/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Microsoft Chart Controls for the .Net Framework &#8211; rendering using a httpHandler</title>
		<link>http://kinsey.no/blog/index.php/2008/11/13/microsoft-chart-controls-for-the-net-framework-rendering-using-a-httphandler/</link>
		<comments>http://kinsey.no/blog/index.php/2008/11/13/microsoft-chart-controls-for-the-net-framework-rendering-using-a-httphandler/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 14:51:13 +0000</pubDate>
		<dc:creator>oyvind.kinsey</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[Chart Controls]]></category>

		<guid isPermaLink="false">http://kinsey.no/wp/?p=34</guid>
		<description><![CDATA[Those of you who have taken a look at the new chart controls might have seen that there are multiple ways of rendering these in ASP.NET. Since my apps (ajax based, no updatepanels etc) use generic httpHandlers for these kind of things, I went looking for the &#8216;httphandler way&#8217; of rendering the chart controls &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Those of you who have taken a look at the new chart controls might have seen that there are multiple ways of rendering these in ASP.NET.</p>
<p>Since my apps (ajax based, no updatepanels etc) use generic httpHandlers for these kind of things, I went looking for the &#8216;httphandler way&#8217; of rendering the chart controls &#8211; but it does not exist..</p>
<p>So I whipped out reflector and took a look at the chart class, and found the three lines needed for doing this<br />
<span id="more-34"></span></p>
<pre class="brush: vb; title: ; notranslate">

Imports System.Web
Imports System.Web.Services
Imports System.Web.UI.DataVisualization.Charting
Imports System.IO

Public Class chart
Implements System.Web.IHttpHandler

Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
'create the chart
Dim ch As New System.Web.UI.DataVisualization.Charting.Chart
ch.ID = &amp;quot;chart&amp;quot;
ch.Height = 296
ch.Width = 412
ch.ImageType = DataVisualization.Charting.ChartImageType.Png
ch.Palette = DataVisualization.Charting.ChartColorPalette.BrightPastel
ch.BackColor = Drawing.Color.Azure
ch.RenderType = DataVisualization.Charting.RenderType.BinaryStreaming
ch.BorderlineDashStyle = DataVisualization.Charting.ChartDashStyle.Solid
ch.BackGradientStyle = DataVisualization.Charting.GradientStyle.TopBottom
ch.BorderlineWidth = 2
ch.BorderlineColor = Drawing.Color.Blue
ch.BorderSkin.SkinStyle = BorderSkinStyle.Emboss

Dim ser As System.Web.UI.DataVisualization.Charting.Series = ch.Series.Add(&amp;quot;Series1&amp;quot;)
ser.ChartType = DataVisualization.Charting.SeriesChartType.SplineArea
ser.BorderColor = Drawing.Color.CadetBlue
ser.ShadowOffset = 2

ser.Points.Add(New DataPoint() With {.YValues = New Double() {6}})
ser.Points.Add(New DataPoint() With {.YValues = New Double() {9}})
ser.Points.Add(New DataPoint() With {.YValues = New Double() {3}})
ser.Points.Add(New DataPoint() With {.YValues = New Double() {5}})
ser.Points.Add(New DataPoint() With {.YValues = New Double() {2}})
ser.Points.Add(New DataPoint() With {.YValues = New Double() {7}})
ser.Points.Add(New DataPoint() With {.YValues = New Double() {8}})
ser.Points.Add(New DataPoint() With {.YValues = New Double() {1}})

Dim ca = ch.ChartAreas.Add(&amp;quot;Default&amp;quot;)
ca.BackColor = Drawing.Color.Transparent
ca.BorderColor = Drawing.Color.Red
ca.AxisX.IsMarginVisible = False

context.Response.ContentType = &amp;quot;image/png&amp;quot;
context.Response.Charset = &amp;quot;&amp;quot;

'here comes the magic
Dim imageStream As New MemoryStream
ch.SaveImage(imageStream)
context.Response.BinaryWrite(imageStream.GetBuffer)

End Sub

ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property

End Class
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kinsey.no/blog/index.php/2008/11/13/microsoft-chart-controls-for-the-net-framework-rendering-using-a-httphandler/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A simple reorder list in Ext JS</title>
		<link>http://kinsey.no/blog/index.php/2008/07/29/a-simple-reorder-list-in-ext-js/</link>
		<comments>http://kinsey.no/blog/index.php/2008/07/29/a-simple-reorder-list-in-ext-js/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 14:12:26 +0000</pubDate>
		<dc:creator>oyvind.kinsey</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Ext Js]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Reordering]]></category>

		<guid isPermaLink="false">http://kinsey.no/wp/?p=20</guid>
		<description><![CDATA[I&#8217;ve been using Ext JS for quite some time now, and I must say, I love it. There is quite good support for drag&#8217;n'drop here, but it lacks one thing; the precious reorder list. An example of such can be found here Since doing the google didn&#8217;t return anything like this I ended up implementing [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://extjs.com/">Ext JS</a> for quite some time now, and I must say, I love it.</p>
<p>There is quite good support for drag&#8217;n'drop here, but it lacks one thing; the precious reorder list.<br />
An example of such can be found <a href="http://tool-man.org/examples/sorting.html">here</a></p>
<p>Since doing the google didn&#8217;t return anything like this I ended up implementing it my self.<br />
<span id="more-20"></span><br />
I started out with the example given <a href="http://extjs.com/learn/Tutorial:Custom_Drag_and_Drop_Part_1">here</a>, but this only implements basic d&#8217;n'd of elements, not the reordering.<br />
So with the following html:</p>
<pre class="brush: xml; title: ; notranslate">
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot;&amp;gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;../lib/ext/resources/css/ext-all.css&amp;quot; temp_href=&amp;quot;../lib/ext/resources/css/ext-all.css&amp;quot;&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;../lib/ext/adapter/ext/ext-base.js&amp;quot; temp_src=&amp;quot;../lib/ext/adapter/ext/ext-base.js&amp;quot;&amp;gt;
&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;../lib/ext/ext-all-debug.js&amp;quot; temp_src=&amp;quot;../lib/ext/ext-all-debug.js&amp;quot;&amp;gt;
&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;custom.js&amp;quot; temp_src=&amp;quot;custom.js&amp;quot;&amp;gt;
&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;Ext.onReady(Tutorial.dd.init, Tutorial.dd);
&amp;lt;/script&amp;gt;
&amp;lt;title&amp;gt;Custom Drag &amp;amp;amp;amp;amp;amp; Drop Tutorial&amp;lt;/title&amp;gt;
&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;

.dd-item {
height: 18px;
border: 1px solid #a0a0a0;
background-color: #c4d0ff;
vertical-align: middle;
cursor: move;
padding: 2px;
z-index: 1000;
}

.dd-ct .dd-item {
margin: 2px;
width:200px;
}

.dd-proxy {
opacity: 0.4;
-moz-opacity: 0.4;
filter: alpha( opacity = 40 );
}
&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;div class=&amp;quot;dd-ct&amp;quot; id=&amp;quot;dd1-ct&amp;quot;&amp;gt;
&amp;lt;div class=&amp;quot;dd-item&amp;quot; id=&amp;quot;dd1-item1&amp;quot;&amp;gt;
Item 1.1
&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;dd-item&amp;quot; id=&amp;quot;dd1-item2&amp;quot;&amp;gt;
Item 1.2
&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;dd-item&amp;quot; id=&amp;quot;dd1-item3&amp;quot;&amp;gt;
Item 1.3
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
</pre>
<p>and the following Javascript in index.js:</p>
<pre class="brush: jscript; title: ; notranslate">Ext.BLANK_IMAGE_URL = '../lib/ext/resources/images/default/s.gif';
Ext.namespace('Tutorial');
Ext.override(Ext.dd.DDProxy, {
startDrag: function(x, y){
var dragEl = Ext.get(this.getDragEl());
var el = Ext.get(this.getEl());
dragEl.applyStyles({
border: '',
'z-index': 2000
});
dragEl.update(el.dom.innerHTML);
dragEl.addClass(el.dom.className + ' dd-proxy');
},
onDragEnter: function(e, targetId){
var target = Ext.get(targetId);

if (target.dd instanceof Ext.dd.DDProxy) {
this._target = target;
this.updateTargetPosition();
}
},
updateTargetPosition: function(){
var _box = this._target.getBox();
this._crossOver = {
x: (this._target.getLeft() + (_box.width / 2)),
y: (this._target.getTop() + (_box.height / 2))
}
},
onDragOver: function(e, targetId){
if (this._target) {
var el = Ext.get(this.getEl());
if (el.id != this._target.id) {
if (this._placement == &amp;quot;before&amp;quot;) {
el.insertBefore(this._target);
}
else {
el.insertAfter(this._target);
}
this.updateTargetPosition();
var xy = e.getXY();
this._placement = (xy[1] &amp;lt; this._crossOver.y) ? &amp;quot;before&amp;quot; : &amp;quot;after&amp;quot;;
}
}
},
endDrag: function(){
var el = Ext.get(this.getEl());
el.applyStyles({
position: '',
width: ''
});
this._target = null;
this._placement = null;
this._crossOver = null;
}
});

Tutorial.dd = function(){
return {

init: function(){
var dz1 = new Ext.dd.DropZone('dd1-ct', {
ddGroup: 'group'
});

var dd11 = Ext.get('dd1-item1');
dd11.dd = new Ext.dd.DDProxy('dd1-item1', 'group');
var dd12 = Ext.get('dd1-item2');
dd12.dd = new Ext.dd.DDProxy('dd1-item2', 'group');
var dd13 = Ext.get('dd1-item3');
dd13.dd = new Ext.dd.DDProxy('dd1-item3', 'group');

}
};
}
();
</pre>
<p>we suddenly have what we need.<br />
For now this only supports non-floating block elements, but I will extend it to also support floats.</p>
<p><strong>UPDATE 1</strong><br />
This demo is now available at <a href="http://kinsey.no/examples/reorderlist/">http://kinsey.no/examples/reorderlist/</a></p>
<p><strong>UPDATE 2<br />
</strong>I now have a version supporting float ready and will publish this when I have the time.<br />
There is also a reorderview available using a reading and updating from a standard datastore.</p>
]]></content:encoded>
			<wfw:commentRss>http://kinsey.no/blog/index.php/2008/07/29/a-simple-reorder-list-in-ext-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>&#8220;This page contains both secure and nonsecure items.&#8221;</title>
		<link>http://kinsey.no/blog/index.php/2008/05/26/this-page-contains-both-secure-and-nonsecure-items/</link>
		<comments>http://kinsey.no/blog/index.php/2008/05/26/this-page-contains-both-secure-and-nonsecure-items/#comments</comments>
		<pubDate>Mon, 26 May 2008 13:51:55 +0000</pubDate>
		<dc:creator>oyvind.kinsey</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://kinsey.no/wp/?p=15</guid>
		<description><![CDATA[With one of my larger webapps I have recently been struggling with the following Security Information message in Internet Explorer: This page contains both secure and nonsecure items. Do you want to display the nonsecure items? This, in general, has to do with mixing of content from different security zones in IE, for example Internet [...]]]></description>
			<content:encoded><![CDATA[<p>With one of my larger webapps I have recently been struggling with the following Security Information message in Internet Explorer:</p>
<p>This page contains both secure and nonsecure items.</p>
<p>Do you want to display the nonsecure items?</p>
<p>This, in general, has to do with mixing of content from different security zones in IE, for example Internet and Local, or http and https.<br />
<span id="more-15"></span><br />
I&#8217;ve had my go at Google and there are indeed loads of sites where this, and solutions to it has been brought up, but none of these applied to my application.<br />
To sum it up, most solutions consists of checking the following</p>
<ul>
<li> That all URL&#8217;s are either consistent (http or https, not a mix) or relative URL&#8217;s</li>
<li>That all iframes or frames written in markup has a src set</li>
<li>That all iframes or frames created with javascript and added to the DOM has a src set prior to adding</li>
<li>That all resources resolve and do not generate a 404, (the 404 page is considered local zone)</li>
</ul>
<p>After checking all of these off, my application was still throwing the same error, and something I had read a long time a go bubbled up.<br />
IE will treat all images that has a relative src set through the DOM as an insecure element!<br />
Therefor my solution was to create a resourceBase variable that I use to prefix all the previously relative paths with.<br />
The simplest way to do this is by:</p>
<pre class="brush: jscript; title: ; notranslate">var resourceBase=window.location.protocol + &amp;quot;//&amp;quot; + window.location.host +&amp;quot;/resources/&amp;quot;;</pre>
<p>Following is a quick example of a function converting a relative path to an absolute one:</p>
<pre class="brush: jscript; title: ; notranslate">function relativeToAbsolute(_urlToResolve){
if (_urlToResolve.substring(0, 1) == &amp;quot;/&amp;quot;) {
_urlToResolve = _urlToResolve.substring(1);
}
var _documentURI = document.location.href.substring(window.location.protocol.length + 2, document.location.href.lastIndexOf(&amp;quot;/&amp;quot;));
var _lastIndexOf = null;
while (_urlToResolve.substring(0, 2) == &amp;quot;..&amp;quot;) {
_urlToResolve = _urlToResolve.substring(3);
if ((_lastIndexOf = _documentURI.lastIndexOf(&amp;quot;/&amp;quot;)) != -1) {
_documentURI = _documentURI.substring(0, _lastIndexOf);
}
}
return window.location.protocol + &amp;quot;//&amp;quot; + _documentURI + &amp;quot;/&amp;quot; + _urlToResolve;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://kinsey.no/blog/index.php/2008/05/26/this-page-contains-both-secure-and-nonsecure-items/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript function overloading</title>
		<link>http://kinsey.no/blog/index.php/2007/11/15/javascript-function-overloading/</link>
		<comments>http://kinsey.no/blog/index.php/2007/11/15/javascript-function-overloading/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 08:00:18 +0000</pubDate>
		<dc:creator>oyvind.kinsey</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Function overloading]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://kinsey.no/wp/?p=11</guid>
		<description><![CDATA[I was reading a post yesterday about function overloading in javascript, and the suggested solution had quite a performance overhead when used with multiple signatures. In addition, it only used the number of arguments, and not their types and order to distinguish between the signatures. For some reason I woke up early this morning with [...]]]></description>
			<content:encoded><![CDATA[<p>I was reading a post yesterday about function overloading in javascript, and the suggested solution had quite a performance overhead when used with multiple signatures.<br />
In addition, it only used the number of arguments, and not their types and order to distinguish between the signatures.</p>
<p>For some reason I woke up early this morning with a solution to this.<br />
The following code will do all of the above and has the same overhead for all number of signatures.</p>
<pre class="brush: jscript; title: ; notranslate">
//returns an overloadable method
Function.CreateOverloaded = function(){
    var overloads = [];
    //creates the overloaded method
    var func = function(){
        var sign = [];
        for (var i=0;i &lt; arguments.length; i++) {
            sign.push(typeof arguments[i]);
        }
        sign = sign.join();
        var func = overloads[&quot;(&quot; + sign + &quot;)&quot;];
        if (!func) {throw &quot;No matching signature&quot;;}
        return func.apply(this, arguments);
    };

    //method for adding a function with a spesific signature
    func.AddSignature = function(func, sign){
        if (overloads[&quot;(&quot; + sign + &quot;)&quot;]){throw &quot;Duplicate signature&quot;};
        overloads[&quot;(&quot; + sign + &quot;)&quot;] = func;
    };
    return func;
}
</pre>
<p>To test it you can use the following code</p>
<pre class="brush: jscript; title: ; notranslate">
var myFunc = Function.CreateOverloaded();
myFunc.AddSignature(function(){
    alert(&quot;test1&quot;);
}, &quot;&quot;);
myFunc.AddSignature(function(var){
    alert(var);
}, &quot;string&quot;);
myFunc.AddSignature(function(integer){
    alert(integer + &quot;x 5 = &quot; + (integer * 5));
}, &quot;number&quot;);
myFunc.AddSignature(function(int1, int2){
    alert(int1 * int2);
}, &quot;number,number&quot;);
myFunc.AddSignature(function(string, int){
    alert(string + &quot; equals &quot; + int);
}, &quot;string,number&quot;);

myFunct();
myFunc(&quot;test2&quot;)
myFunc(3);
myFunc(3, 5);
myFunc(&quot;five&quot;, 5);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kinsey.no/blog/index.php/2007/11/15/javascript-function-overloading/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

