<?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</title>
	<atom:link href="https://kinsey.no/blog/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>https://kinsey.no/blog</link>
	<description>Because I want to be like the cool kids too</description>
	<lastBuildDate>Mon, 21 Jun 2021 22:49:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.19</generator>
	<item>
		<title>Moving to San Francisco, and feeling great.</title>
		<link>https://kinsey.no/blog/index.php/2011/10/03/moving-to-san-francisco-and-feeling-great/</link>
		<comments>https://kinsey.no/blog/index.php/2011/10/03/moving-to-san-francisco-and-feeling-great/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 21:40:48 +0000</pubDate>
		<dc:creator><![CDATA[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). And a few weeks ago, a friend of mine told me about The last six years spent with BRIK has been wonderful and I&#8217;ve grown [&#8230;]]]></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). And a few weeks ago, a friend of mine told me about</p>
<p>The last six years spent with <a href="http://brik.no" target="_blank" rel="noopener">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>https://kinsey.no/blog/index.php/2011/10/03/moving-to-san-francisco-and-feeling-great/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Get a Loan for a Software Startup</title>
		<link>https://kinsey.no/blog/index.php/2010/08/27/how-to-get-a-loan-for-a-software-startup/</link>
		<comments>https://kinsey.no/blog/index.php/2010/08/27/how-to-get-a-loan-for-a-software-startup/#respond</comments>
		<pubDate>Fri, 27 Aug 2010 20:16:01 +0000</pubDate>
		<dc:creator><![CDATA[oyvind.kinsey]]></dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[Finance]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=377</guid>
		<description><![CDATA[Software as a service startups are popping up everywhere these days, and for good reason. The monthly recurring revenue business model is certainly desirable because it is predictable and profitable. Traditionally, ѕоftwаrе ѕtаrtuрѕ secure fundіng frоm investors оr friends аnd family, but it is роѕѕіblе tо ѕесurе a loan fоr a ѕоftwаrе ѕtаrtuр. Sо tоdау [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Software as a service startups are popping up everywhere these days, and for good reason. The monthly recurring revenue business model is certainly desirable because it is predictable and profitable. Traditionally, ѕоftwаrе ѕtаrtuрѕ secure fundіng frоm investors оr friends аnd family, but it is роѕѕіblе tо ѕесurе a loan fоr a ѕоftwаrе ѕtаrtuр. Sо tоdау I wаntеd to provide 3 tірѕ оn hоw tо secure a small lоаn fоr software dеvеlорmеnt.</p>
<p><strong>Have a Backup Plаn</strong> – I think thе mоѕt іmроrtаnt fасtоr іn your lоаn аррlісаtіоn іѕ a ѕесtіоn whеrе уоu оutlіnе уоur bасkuр рlаn. Prоvіdіng a loan to hеlр fund ѕоftwаrе dеvеlорmеnt іѕ incredibly rіѕkу. Whаt іf уоu ѕреnd аll оf thе lоаn mоnеу, buіld the ѕоftwаrе product and find out that уоur роtеntіаl customers are nоt willing tо pay for thе рrоduсt? Sіnсе уоu hаvе nо рrоvеn ѕаlеѕ, you are gоіng to need to dеmоnѕtrаtе a backup рlаn to thе lenders.</p>
<p>If you аrе a ѕоftwаrе dеvеlореr іn 2012, I аm ѕurе you аrе аblе tо find wоrk. You mау have a dау jоb now, оr wоrk оn a рrоjесt bу рrоjесt bаѕіѕ as a freelance developer, but ultіmаtеlу уоu ѕhоuld bе аblе to find wоrk if your ѕtаrtuр fаіlѕ. If уоu саn prove thаt уоu have gеnеrаtеd еnоugh реrѕоnаl іnсоmе in thе раѕt tо mаkе thе lоаn рауmеntѕ, аnd ѕhоw that you аrе willing to gо back tо a day jоb іf thе business fаіlѕ, уоu ѕhоuld bе аblе tо рut thе lеndеr аt еаѕе.</p>
<p><strong>Prove the Market</strong> – This is some advice from experts at QVcredit, <a href="https://qvcredit.sg/">qvcredit is one of the best money lender in singapore</a> involved with tech start ups: You need tо рrоvе, аѕ best you саn, thаt thеrе іѕ a mаrkеt for уоur рrоduсt. Thеrе аrе a number оf wауѕ tо do thіѕ:</p>
<ul>
<li>Competitors аrе Prоfіtаblе – Mауbе thе software уоu аrе dеvеlоріng is a direct competitor tо a соmраnу who іѕ already profitable.</li>
<li>Gооglе Adwоrdѕ Keyword Tool – Yоu can uѕе the Google Adwords Keyword Tооl tо find оut how mаnу реорlе are ѕеаrсhіng for kеуwоrd рhrаѕеѕ related tо уоur рrоduсt. For example, the PrоjесtіоnHub ѕоftwаrе hеlрѕ entrepreneurs сrеаtе fіnаnсіаl рrоjесtіоnѕ, аnd we knоw thаt еасh mоnth thеrе аrе аррrоxіmаtеlу 15,000 ѕеаrсhеѕ оn Gооglе alone fоr the kеуwоrd рhrаѕе “Fіnаnсіаl Projections”</li>
<li>List of Interested Customers – Mауbе уоu ѕеt uр a 1 page website wіth a fоrm fоr potential customers tо fіll оut if thеу аrе interested іn уоur ѕоftwаrе whеn іt lаunсhеѕ. If уоu аrе аblе tо gеnеrаtе significant interest frоm уоur pre-launch раgе, then there is probably a market.</li>
</ul>
<p><strong>Pre-sales</strong> – You might bе аblе tо talk to potential сuѕtоmеrѕ and асtuаllу have them ѕіgn a lеttеr of intent thаt ѕtаtеѕ they plan tо рurсhаѕе ассеѕѕ to your software once іt іѕ соmрlеtеd. Thеѕе lеttеrѕ wіll immediately prove the market tо thе lеndеr, аnd hеlр them run ѕоmе рrеlіmіnаrу numbers to dеtеrmіnе whеthеr or not you wіll bе able to pay bасk thе loan bаѕеd оn those рrоjесtеd ѕаlеѕ.</p>
<p><strong>Mісrоlоаnѕ</strong> – Trаdіtіоnаl bаnkѕ аrе ѕсаrеd of software, they аrе scared оf thіѕ tуре оf recurring rеvеnuе business mоdеl in thе early days of thе buѕіnеѕѕ bесаuѕе еvеrу tіmе you grow you need mоrе саѕh. That ѕсаrеѕ thе trаdіtіоnаl bаnk, but thеrе іѕ аnоthеr орtіоn, <a href="https://xn--norgeln-jxa.com/">lån på minuttet uten kredittsjekk</a>. The SBA has a рrоgrаm called thе Mісrоlоаn Prоgrаm. There аrе SBA mісrоlеndеrѕ аll around the соuntrу whо work tо fill a lеndіng gар. Thеу lend where trаdіtіоnаl bаnkѕ dо not. Yоu wоn’t bе able tо run fоrеvеr оn a mісrоlоаn, but іt mау hеlр уоu gеt сlоѕеr tо ѕесurіng that large іnvеѕtmеnt оr line оf сrеdіt from the bаnk.</p>
<p>&nbsp;</p>
<p>Gеttіng a lоаn fоr a ѕоftwаrе ѕtаrtuр is nоt еаѕу, but іt is possible if уоu роѕіtіоn yourself thе rіght wау.</p>
]]></content:encoded>
			<wfw:commentRss>https://kinsey.no/blog/index.php/2010/08/27/how-to-get-a-loan-for-a-software-startup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set up an AD backed OpenID Provider without direct communication</title>
		<link>https://kinsey.no/blog/index.php/2010/07/09/how-to-set-up-an-ad-backed-openid-provider-without-direct-communication/</link>
		<comments>https://kinsey.no/blog/index.php/2010/07/09/how-to-set-up-an-ad-backed-openid-provider-without-direct-communication/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 17:11:41 +0000</pubDate>
		<dc:creator><![CDATA[oyvind.kinsey]]></dc:creator>
				<category><![CDATA[easyXDM]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[active-directory]]></category>
		<category><![CDATA[ad]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=290</guid>
		<description><![CDATA[I&#8217;ve currently got a project where I need to provide an OpenID Provider (OP) to authenticate users using Active Directory (AD), something that shouldn&#8217;t be to much of a hassle. But there is a catch: the OP needs to be outside the firewall in order to talk to the Relying Parties (RP) and is unable [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve currently got a project where I need to provide an <a href="http://openid.net/specs/openid-authentication-2_0.html#terminology" target="_blank">OpenID Provider</a> (OP) to authenticate users using Active Directory (AD), something that shouldn&#8217;t be to much of a hassle.<br />
<b>But there is a catch:</b> the OP needs to be <i>outside</i> the firewall in order to talk to the <a href="http://openid.net/specs/openid-authentication-2_0.html#terminology" target="_blank">Relying Parties</a> (RP) and is unable to communicate directly with AD. <b>So what can you do?</b><br />
<span id="more-290"></span><br />
<img class="size-medium wp-image-292 alignright" title="easyxdm-openid" src="http://kinsey.no/blog/wp-content/uploads/2010/07/easyxdm-openid-300x225.png" alt="" width="300" height="225" srcset="https://kinsey.no/blog/wp-content/uploads/2010/07/easyxdm-openid-300x225.png 300w, https://kinsey.no/blog/wp-content/uploads/2010/07/easyxdm-openid.png 695w" sizes="(max-width: 300px) 100vw, 300px" />Well, in this case the OP is only going to be used by users that are sitting <i>behind</i> the firewall, and who have access to both internal resources and external resources over port 80, and what this means is that we can use the client (the browser) to relay messages between the OP and the asserting party. In order to make the communication going via the browser trusted, we can use a challenge combined with symmetric encryption to verify authenticity.</p>
<p>This means that the chain of trust needed for the identity assertion looks like the following</p>
<ul>
<li>The RP trust the assertion from the OP
<ul>
<li>The RP and the OP shares can communicate directly and uses a shared secret to verify the authenticity of the message passed through the browser</li>
</ul>
</li>
<li>The RP trusts the assertion from the Internal Webserver (IW)
<ul>
<li>The RP and the IW has a pre-shared encryption key that together with a challenge serves to verify the authenticity of the messages passed through the browser</li>
</ul>
</li>
</ul>
<p><b>In the following code <a href="dotnetopenauth.net/" target="_blank">DotNetOpenAuth </a>is used to provide support for OpenID, and <a href="http://easyxdm.net/" target="_blank">easyXDM</a> is used to provide the Cross-Document Communication.</b><br />
Codewise, it all starts once the OpenID request hits the OP, and at this point we only store away the request and render a blank page containing the following JavaScript</p>
<pre class="brush: jscript; title: ; notranslate">
// server.aspx
// This is called by ASP.NET Ajax once the page is ready
function pageLoad() {
    // Set up a new easyXDM.Rpc object
    var rpc = new easyXDM.Rpc({
        remote: &quot;http://localhost:55192/Endpoint.aspx&quot;
    }, {
        remote: {
            authenticate: {}
        }
    });

    // Retrieve a challenge from the server 
    PageMethods.GetChallenge(function (challenge) {
        // Relay the challenge to the internal webserver
        rpc.authenticate(challenge, function (response) {
            // Relay the response back to the server
            PageMethods.VerifyResponse(response, function (verified) {
                // If the response was verified, we redirect to the page that will complete the OpenID assertion
                if (verified) {
                    location.href = &quot;complete.aspx&quot;;
                } else {
                    alert(&quot;not authenticated&quot;);
                }
            });
        });
    });
}
</pre>
<p>As you can see this uses PageMethods to talk to the server side code for retrieving the challenge, and for delivering the response</p>
<pre class="brush: vb; title: ; notranslate">
'server.aspx
&lt;WebMethod()&gt; _
Public Shared Function GetChallenge() As Utilities.Challenge
    ' This method is called to create a challenge, and to get access to the claimed identifier that the internal webserver will have to verify
    ' Create and store away a challenge
    Dim challenge As New Utilities.Challenge
    challenge.Guid = System.Guid.NewGuid().ToString()
    HttpContext.Current.Session(&quot;guid&quot;) = challenge.Guid

    If providerEndpoint.PendingAuthenticationRequest IsNot Nothing Then
        challenge.Identifier = providerEndpoint.PendingAuthenticationRequest.ClaimedIdentifier.OriginalString
    End If
    ' Return a Plain Old CRL Object (POCO). This will be serialized into JSON
    Return challenge
End Function

&lt;WebMethod()&gt; _
Public Shared Function VerifyResponse(ByVal response As String) As Boolean
    ' This method will be called after the response returns from the internal webserver
    If providerEndpoint.PendingAuthenticationRequest IsNot Nothing Then
        Dim enc = New Utilities.SymmetricEncryption(&quot;my secret&quot;)
        ' Encrypt the claimed identity and the stored challenge, and see if it matches the response from the internal server
        If enc.Encrypt(providerEndpoint.PendingAuthenticationRequest.ClaimedIdentifier.OriginalString &amp; &quot;_&quot; &amp; HttpContext.Current.Session(&quot;guid&quot;)) = response Then
            ' If it matches we issue an authentication token
            FormsAuthentication.SetAuthCookie(providerEndpoint.PendingAuthenticationRequest.ClaimedIdentifier, False)
            Return True
        End If
    End If
    Return False
End Function
</pre>
<p>On the internal server the setup is similar, we accept the claimed identity, verify it against the identity of the authenticated user, and return a signed response.<br />
Here we expose a method whose only purpose is to relay the challenge back to the serverside code</p>
<pre class="brush: jscript; title: ; notranslate">
// Endpoint.aspx
// This is called by ASP.NET Ajax once the page is ready
function pageLoad() {
    // Set up a new easyXDM.Rpc object
    var rpc = new easyXDM.Rpc({}, {
        local: {
            authenticate: function (challenge, fn) {
                // Relay the challenge to the serverside code
                PageMethods.Authenticate(challenge, function (response) {
                    // Relay the response back to the OP
                    fn(response);
                });
            }
        }
    });
}
</pre>
<p>Here we extract the username from the claimed identifier and compare it to the known one. If it matches we return an encrypted response </p>
<pre class="brush: vb; title: ; notranslate">
'Endpoint.aspx
&lt;WebMethod()&gt; _
Public Shared Function Authenticate(ByVal challenge As Utilities.Challenge) As String
    ' This is called to check wether the claimed identifier matches the known one
    Dim claimedUserName As String = New Uri(challenge.Identifier).Query.Substring(4)

    If HttpContext.Current.User.Identity.IsAuthenticated Then
        Dim username As String = HttpContext.Current.User.Identity.Name
        username = username.Substring(username.IndexOf(&quot;\&quot;) + 1)
        If username = claimedUserName Then
            ' If it matches we encrypt the identifier and the challenge, and return the result as the response
            Dim enc = New Utilities.SymmetricEncryption(&quot;my secret&quot;)
            Return enc.Encrypt(challenge.Identifier &amp; &quot;_&quot; &amp; challenge.Guid)
        End If
    End If

    Return String.Empty
End Function
</pre>
<p>One of the interesting things here is how the instances of <code>Utilities.Challenge</code> is serialized and deserialized going from the OP&#8217;s server side code to the client side code, and again serialized and deserialized going from the internal webservers client side code to the internal webservers server side code. Like magic right?</p>
<p>(Of course, we could easily have used a couple of redirects instead of the server-client-client-server communication, but that wouldn&#8217;t have been as fun now would it <img src="https://s.w.org/images/core/emoji/11/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
			<wfw:commentRss>https://kinsey.no/blog/index.php/2010/07/09/how-to-set-up-an-ad-backed-openid-provider-without-direct-communication/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>easyXDM 2.0 out, now with a proper website!</title>
		<link>https://kinsey.no/blog/index.php/2010/03/19/easyxdm-2-0-out-now-with-a-proper-website/</link>
		<comments>https://kinsey.no/blog/index.php/2010/03/19/easyxdm-2-0-out-now-with-a-proper-website/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 11:50:59 +0000</pubDate>
		<dc:creator><![CDATA[oyvind.kinsey]]></dc:creator>
				<category><![CDATA[easyXDM]]></category>
		<category><![CDATA[easyxdm]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=285</guid>
		<description><![CDATA[See http://easyxdm.net/wp/2010/03/17/easyxdm-2-0-now-even-with-a-new-website for more information!]]></description>
				<content:encoded><![CDATA[<p>See <a href="http://easyxdm.net/wp/2010/03/17/easyxdm-2-0-now-even-with-a-new-website">http://easyxdm.net/wp/2010/03/17/easyxdm-2-0-now-even-with-a-new-website</a> for more information!</p>
]]></content:encoded>
			<wfw:commentRss>https://kinsey.no/blog/index.php/2010/03/19/easyxdm-2-0-out-now-with-a-proper-website/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The upcoming release of easyXDM v2.0</title>
		<link>https://kinsey.no/blog/index.php/2010/03/16/the-upcoming-release-of-easyxdm-v2-0/</link>
		<comments>https://kinsey.no/blog/index.php/2010/03/16/the-upcoming-release-of-easyxdm-v2-0/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 22:48:55 +0000</pubDate>
		<dc:creator><![CDATA[oyvind.kinsey]]></dc:creator>
				<category><![CDATA[easyXDM]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[cross-domain]]></category>
		<category><![CDATA[easyxdm]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[rpc]]></category>
		<category><![CDATA[xdm]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=276</guid>
		<description><![CDATA[Major improvements has been added to the project and I am proud to soon be able to release version 2.0, a release that features a new and simpler API, and a stack approach that is highly customizable when it comes to adding new features. I would really love to get some feedback on the current state before releasing the new [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Major improvements has been added to the project and I am proud to soon be able to release version 2.0, a release that features a new and simpler API, and a stack approach that is highly customizable when it comes to adding new features.</p>
<p>I would really love to get some feedback on the current state before releasing the new version, so as to make it as successful as possible, and so I turn to you.</p>
<p>Please, take a look at the repository at <a href="http://github.com/oyvindkinsey/easyXDM" target="_blank">http://github.com/oyvindkinsey/easyXDM/</a>, view the new documentation at <a href="http://easyxdm.net/v2.0.0/docs/" target="_blank">http://easyxdm.net/v2.0.0/docs/</a>, run the tests at <a href="http://easyxdm.net/v2.0.0/tests/" target="_blank">http://easyxdm.net/v2.0.0/tests/</a> or download the code at <a href="http://easyxdm.net/v2.0.0/source.zip" target="_blank">http://easyxdm.net/v2.0.0/source.zip</a>, and if you feel like it, give me some feedback either on this mailing list, or as an <a href="http://github.com/oyvindkinsey/easyXDM/issues">Issue at Github</a>.<br />
Some of the new features planned can be viewed at <a href=" http://wiki.github.com/oyvindkinsey/easyXDM/planned-features">http://wiki.github.com/oyvindkinsey/easyXDM/planned-features</a>, and I&#8217;ll continue to update this list as new ideas show up.</p>
<p>By the way, moving to the new API is really simple and only requires a few small changes &#8211; this is all shown in the examples.</p>
<p>And to show one of them, here is the new <a href="http://easyxdm.net/v2.0.0/example/xhr.html">xhr.html sample</a>, which shows how to use the easyXDM.Rpc (the old Interface class) together with the bundled <a href="http://easyxdm.net/v2.0.0/xhr.html">xhr.html</a> document.</p>
<p><span id="more-276"></span></p>
<pre class="brush: jscript; title: ; notranslate">
var xhr = new easyXDM.Rpc({
    local: &quot;../hash.html&quot;,
    remote: remoteUrl + &quot;/../xhr.html&quot;,
    remoteHelper: remoteUrl + &quot;/../hash.html&quot;
}, {
    remote: {
        post: {}
    }
});
</pre>
<p>This will give you an instance of <a href="http://easyxdm.net/v2.0.0/docs/?class=easyXDM.Rpc">easyXDM.Rpc</a> that exposes a method quite similar to the one many frameworks use for doing AJAX calls&#8230;</p>
<pre class="brush: jscript; title: ; notranslate">
xhr.post(&quot;example/glossary.php&quot;, {
    param1: &quot;a&quot;,
    param2: &quot;b&quot;
}, function(json){
    alert(json.glossary.title);
});
</pre>
<p>.. and hey presto, you have cross-domain AJAX without the inherent security issues that other approaches like JSONP has.<br />
By the way, if anybody wants to contribute (as some has started to) feel free to do so!<br />
What the project needs the most is a decent logo, a proper website (maybe something like <a href="http://www.dotnetopenauth.net/" target="_blank">http://www.dotnetopenauth.net/</a>) and to have the documentation extended with samples etc like the ones at <a href="http://www.extjs.com/deploy/dev/docs/?class=Ext.form.ComboBox">http://www.extjs.com/deploy/dev/docs/?class=Ext.form.ComboBox</a> .</p>
<p>Also, if you want to stay up to date on new releases, ask questions  etc. then there is now a new google group created for this at <a href="http://groups.google.com/group/easyxdm">http://groups.google.com/group/easyxdm</a></p>
]]></content:encoded>
			<wfw:commentRss>https://kinsey.no/blog/index.php/2010/03/16/the-upcoming-release-of-easyxdm-v2-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>easyXDM v1.8.0 relased</title>
		<link>https://kinsey.no/blog/index.php/2010/02/27/easyxdm-v1-8-0-relased/</link>
		<comments>https://kinsey.no/blog/index.php/2010/02/27/easyxdm-v1-8-0-relased/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 19:19:12 +0000</pubDate>
		<dc:creator><![CDATA[oyvind.kinsey]]></dc:creator>
				<category><![CDATA[easyXDM]]></category>
		<category><![CDATA[cross-domain]]></category>
		<category><![CDATA[cross-site]]></category>
		<category><![CDATA[easyxdm]]></category>
		<category><![CDATA[fragmenting]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[rpc]]></category>
		<category><![CDATA[xdm]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=269</guid>
		<description><![CDATA[A lot has been going on with easyXDM over the past week, and I am proud to finally be able to release a version where all transport types, even the ones for IE6, deliver the same set of features. From now on all the transports (and all the relying classes) supports Reliability, &#8216;guaranteed&#8217; delivery of [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>A lot has been going on with easyXDM over the past week, and I am proud to finally be able to release a version where all transport types, even the ones for IE6, deliver the same set of features.</p>
<p>From now on all the transports (and all the relying classes) supports</p>
<ul>
<li>Reliability, &#8216;guaranteed&#8217; delivery of messages<br />
The new ReliableBehavior adds this to the HashTransport</li>
<li>Sender-verification,  verifying that the message originates from the original sender. This removes the risk of malicious sites spoofing the sender<br />
This is added to the HashTransport and NameTransport by the VerifyBehavior</li>
<li>Queueing, you can now send multiple messages in the same js thread<br />
This is added to the HashTransport and NameTransport by the QueueBehavior</li>
</ul>
<p><span id="more-269"></span></p>
<h2>Behaviors</h2>
<p>So what are these behaviors mentioned? Well, a behavior modifies the way a transport works, and it works by sending all events and messages through a pipeline of behaviors, where each one can let it pass, inspect it, modify it, block it etc. Each behavior is automatically chained with the others so that they form a stack, where in principal, each layer talks to the corresponding layer on the other end.</p>
<p>One example of this in action is the fragmentation. When the QueueBehavior receives an <strong>outgoing </strong>message that is larger than the max fragment size, then instead of queueing only one message, it will queue each fragment with a fragment identifier. The QueueBehaviors dispatcher will then send each message as fast as it can (it gets a callback from the next Behavior in he line when the message is delivered).</p>
<p>On the other end multiple <strong>ingoing</strong> messages will received at the QueueBehavior, but the message won&#8217;t be passed on until all fragments has arrived.</p>
<p>Using behaviors instead of applying the functionality directly to the classes adds a lot to the table</p>
<ul>
<li>Re-usability, the same behavior can be applied to all transports that accepts these.</li>
<li>Separation, each new feature is contained in a separate class, and since the pipeline is layered, you can safely introduce e.g sender-verification without risking breaking the code that handles the sending/receiving.</li>
<li>Structure, the code is a lot easier to <a href="http://easyxdm.net/v1.8.0/docs/source/easyXDM.transport.html" target="_blank">read</a> and understand, and adding new behaviors is a breeze.</li>
</ul>
<p>This is a sample from the <a href="http://easyxdm.net/v1.8.0/docs/?class=easyXDM.transport.HashTransport" target="_blank">HashTransport </a>and shows how behaviors are applied internally</p>
<pre class="brush: jscript; title: ; notranslate">
easyXDM.applyBehaviors(this, [
    new easyXDM.transport.behaviors.ReliableBehavior({
        timeout: ((useResize ? 50 : pollInterval * 1.5) + (usePolling ? pollInterval * 1.5 : 50))
    }),
    new easyXDM.transport.behaviors.QueueBehavior({
        maxLength: 4000 - _remoteUrl.length
    }),
    new easyXDM.transport.behaviors.VerifyBehavior({
        initiate: isHost
    })
]);
</pre>
<p>In the future these will be overridable, and you will be able to inject your own if you want to.</p>
<h2>Conclusion</h2>
<p>If you haven&#8217;t already, go <a href="https://www.ohloh.net/p/easyXDM/packages" target="_blank">download the newest version</a> and enjoy the new features!</p>
]]></content:encoded>
			<wfw:commentRss>https://kinsey.no/blog/index.php/2010/02/27/easyxdm-v1-8-0-relased/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>easyXDM &#8211; finally with queuing and fragmenting!</title>
		<link>https://kinsey.no/blog/index.php/2010/02/22/easyxdm_and_queuing/</link>
		<comments>https://kinsey.no/blog/index.php/2010/02/22/easyxdm_and_queuing/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 18:11:43 +0000</pubDate>
		<dc:creator><![CDATA[oyvind.kinsey]]></dc:creator>
				<category><![CDATA[easyXDM]]></category>
		<category><![CDATA[cross-domain]]></category>
		<category><![CDATA[easyxdm]]></category>
		<category><![CDATA[fragmenting]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[queue]]></category>
		<category><![CDATA[rpc]]></category>
		<category><![CDATA[xdm]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=261</guid>
		<description><![CDATA[With the newest release, 1.7.4 (see the commits here), we have added two important features, fragmenting for the HashTransport, and queing for both the HashTransport and NameTransport Fragmenting The first is definitely something that many has been waiting for, until now the HashTransport class just didn&#8217;t cope with messages that would create URLs longer than [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>With the newest release, <a href="https://www.ohloh.net/p/easyXDM/download?package=easyXDM" target="_blank">1.7.4 </a>(see the commits <a href="http://github.com/oyvindkinsey/easyXDM/commits/v1.7.4" target="_blank">here</a>), we have added two important features, <strong>fragmenting </strong>for the HashTransport, and <strong>queing </strong>for both the HashTransport and NameTransport</p>
<p><span id="more-261"></span></p>
<h2>Fragmenting</h2>
<p>The first is definitely something that many has been waiting for, until now the HashTransport class just didn&#8217;t cope with messages that would create URLs longer than 4095 character (the maximum size allowed by IE6). If a longer message was send (something that could easily happen when using the Interface class), the transport would just fail. But not anymore, you are now able to send however long messages you&#8217;d like, and of course, this was all made possible with the new queuing feature.</p>
<h2>Queuing</h2>
<p>Until now, when you tried to rapidly send messages, if you were so unfortunate to do so before the message had been read, it would be overwritten. This was especially easy to do when the HashTransport was in polling mode, as it then only checks for new messages every 300ms.</p>
<p>Both the HashTransport and the NameTransport has now been extended with a <a style="color: rgb(68, 68, 68); text-decoration:none; font-weight: normal" href="https://livecasinogo.ca/">live casino sites</a> queuing feature, meaning that all messages will first go into a queue, which will then be emptied in a LIFO fashion.</p>
<h2>Conclusion</h2>
<p>easyXDM just got even better, thats about it. The only known feature request as it is now is message receipts, making the transport completely reliable, but I&#8217;m think this probably belongs in the Channel class..</p>
<p>By the way, the Continual Integration system has now been set up so that the test suite for the current head from GitHub will always be available at <a href="http://easyxdm.net/dev/tests/" target="_blank">http://easyxdm.net/dev/tests/</a>.</p>
<p>And one final thing: The project has finally got its first contributors!</p>
]]></content:encoded>
			<wfw:commentRss>https://kinsey.no/blog/index.php/2010/02/22/easyxdm_and_queuing/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Resizing iframes using easyXDM</title>
		<link>https://kinsey.no/blog/index.php/2010/02/19/resizing-iframes-using-easyxdm/</link>
		<comments>https://kinsey.no/blog/index.php/2010/02/19/resizing-iframes-using-easyxdm/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 16:52:35 +0000</pubDate>
		<dc:creator><![CDATA[oyvind.kinsey]]></dc:creator>
				<category><![CDATA[easyXDM]]></category>
		<category><![CDATA[easyxdm]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[resize]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=252</guid>
		<description><![CDATA[One thing that many are using easyXDM (and other cross-domain hacks) for, is to dynamically change the size of embedded iframes based on the contents size, so as to avoid the scrollbars. To make it easier to do this using easyXDM, I have now published an example how how to do this here. It really [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>One thing that many are using easyXDM (and other cross-domain hacks) for, is to dynamically change the size of embedded iframes based on the contents size, so as to avoid the scrollbars.</p>
<p>To make it easier to do this using easyXDM, I have now published an example how how to do this <a href="http://easyxdm.net/example/resize_iframe.html">here</a>.</p>
<p>It really is easy, on the page hosting the iframe you use the following to load the iframe</p>
<pre class="brush: jscript; title: ; notranslate">
var transport = new easyXDM.transport.BestAvailableTransport({
    local: &quot;../hash.html&quot;,
    remote: &quot;http://provider.easyxdm.net/example/resized_iframe.html&quot;,
    container: document.getElementById(&quot;element_that_should_contain_the_frame&quot;),
    onMessage: function(message, origin){
        this.container.getElementsByTagName(&quot;iframe&quot;)[0].style.height = message + &quot;px&quot;;
    }
});
</pre>
<p>And then you put the following in the iframes body after the content</p>
<pre class="brush: jscript; title: ; notranslate">
var transport = new easyXDM.transport.BestAvailableTransport({}, function(){
    transport.postMessage(document.body.scrollHeight);
});
</pre>
<p>Thats it!<br />
Again, the sample can be viewed <a href="http://easyxdm.net/example/resize_iframe.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://kinsey.no/blog/index.php/2010/02/19/resizing-iframes-using-easyxdm/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>jsContract &#8211; Code contracts for Javascript</title>
		<link>https://kinsey.no/blog/index.php/2010/02/03/jscontract-code-contracts-for-javascript/</link>
		<comments>https://kinsey.no/blog/index.php/2010/02/03/jscontract-code-contracts-for-javascript/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 21:01:10 +0000</pubDate>
		<dc:creator><![CDATA[oyvind.kinsey]]></dc:creator>
				<category><![CDATA[jsContract]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[code contracts]]></category>
		<category><![CDATA[design by contract]]></category>
		<category><![CDATA[instrumentation]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=214</guid>
		<description><![CDATA[I have recently started using code contracts in one of my .net projects and I came to think that since most of the code I produce these days are in Javascript, why don&#8217;t I try it there to! Well, easier said than done &#8211; there just is no decent frameworks for this. During my searching [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I have recently started using <a href="http://en.wikipedia.org/wiki/Design_by_contract" target="_blank">code contract</a>s in one of my .net projects and I came to think that since most of the code I produce these days are in Javascript, why don&#8217;t I try it there to!</p>
<p>Well, easier said than done &#8211; there just is no decent frameworks for this.</p>
<p>During my searching I found some references to libraries such as <a href="http://www.cerny-online.com/cerny.js/documentation/guides/contracts" target="_blank">Cerny.js</a> and <a href="http://weblogs.mozillazine.org/weirdal/archives/016921.html" target="_blank">ecmaDebug</a>, but these just didn&#8217;t make the cut  &#8211; they all required heavy (and hard to follow) restructuring of your code to make them work.</p>
<p>So what did I do? Well I made <a href="http://kinsey.no/projects/jsContract/" target="_blank">jsContract</a>, a library that is clean and .. wait for it .. extremely easy to use!<span id="more-214"></span></p>
<p style="padding-left: 30px;"><strong>If you want a quick view on what Code Contracts can give you, take a look at </strong><a href="http://kinsey.no/projects/jsContract/test2.html" target="_blank"><strong>this example</strong></a><strong>!</strong></p>
<p>The following method comes from the sample code in the link above</p>
<pre class="brush: jscript; title: ; notranslate">    function _internalMethod(a, b){
        Contract.expectNumber(a);
        Contract.expectNumber(b);
        Contract.expectWhen(config.mode === &quot;divide&quot;, b &gt; 0, &quot;Divisor cannot be 0&quot;);
        Contract.expectWhen(config.mode === &quot;multiply&quot;, a &gt; 0 &amp;&amp; b &gt; 0, &quot;The multiplicands cannot be 0&quot;);
        Contract.guaranteesNumber();
        Contract.guarantees(function(result){
            return result &gt; 0;
        }, &quot;Result must be &gt; 0&quot;);

        if (config.mode == &quot;divide&quot;) {
            return a / b;
        }
        // At this point config.mode must be &quot;multiply&quot;
        return a * b;
    }
</pre>
<p>As you can see, the contract statements does not ruin the flow of the code, rather, it helps to document it.<br />
By looking at the contract at the start of the method, you can instantly see what the method expects and what it will return.<br />
This also helps you reduce code since you do not need to check for conditions that are not allowed according to the contract.</p>
<h2>Postconditions</h2>
<p>So, you might be wondering about how the <code>Contract.guarantees</code> methods work? How can a statement placed in the head of the method possibly check the return value of the method?<br />
Well, the above code will actually not check the return value when run, but by running it through  <code>Contract.instrument</code> we can get code that will!<br />
This is the output created by <code>Contract.instrument </code>for the above code</p>
<pre class="brush: jscript; title: ; notranslate">
    function _internalMethod(a, b){
        arguments.callee.isInstrumented = true;
        /*preconditions*/
        Contract.expectNumber(a);
        Contract.expectNumber(b);
        Contract.expectWhen(config.mode === &quot;divide&quot;, b &gt; 0, &quot;Divisor cannot be 0&quot;);
        Contract.expectWhen(config.mode === &quot;multiply&quot;, a &gt; 0 &amp;&amp; b &gt; 0, &quot;The multiplicands cannot be 0&quot;);
        var __return = (function(a, b){
            if (config.mode == &quot;divide&quot;) {
                return a / b;
            }
            // At this point config.mode must be &quot;multiply&quot;
            return a * b;
        }(a, b));
        /*postconditions*/
        Contract.guaranteesNumber(__return);
        Contract.guarantees(__return, function(result){
            return result &gt; 0;
        }, &quot;Result must be &gt; 0&quot;);
        return __return;
    }
</pre>
<p>As you can see the code block has been wrapped in an anonymous function, the postconditions has been moved below this and has been rewritten so that they take the result as an argument.</p>
<p><strong>We now have both pre- and postconditions checking our code!</strong></p>
<p>The framework handles nested functions just as you would expect it to and the only real change to your code is the extra anonymous function that is inserted when the parser finds a postcondition in use.</p>
<p>But now you might be wondering, how do we get the instrumented code in to our applications?</p>
<p>For this you have several options</p>
<ul>
<li>Use tools like <a href="http://kinsey.no/projects/jsContract/" target="_blank">this</a> to convert the code for you before pasting it into a js file</li>
<li>Use it as a part of you build process for automated generation
<ul>
<li>a commandline tool will be available shortly</li>
</ul>
</li>
<li>Use dynamic loading and instrumentation at runtime</li>
</ul>
<p>The last option is only viable for development scenarios, but that is mainly when code contracts are needed anyways.<br />
To load scripts dynamically you can either use your own AJAX code, or use the built in Contract.load method</p>
<p>The following code is taken from the  <a href="http://kinsey.no/projects/jsContract/test.html" target="_blank">example </a>available with the framework</p>
<pre class="brush: jscript; title: ; notranslate">
var instrument = (location.search &amp;&amp; location.search.indexOf(&quot;instrument=true&quot;) !== -1);
Contract.load(&quot;MyClass.js&quot;, instrument, function(){
    try {
        var myClass = new MyClass({
            mode: &quot;multiply&quot;
        });

        var result = myClass.publicMethod(34, 5, 3);
    }
    catch (ex) {
        alert(ex.message);
    }
});
</pre>
<p>This code loads regular or instrumented code depending on the query string.</p>
<p>Doesn&#8217;t it look cool?</p>
<p>Its available at <a href="http://github.com/oyvindkinsey/jsContract" target="_blank">github</a> and will most likely be licensed with an MIT style license.</p>
<p>Anybody want to join in, maybe help with some documentation etc?</p>
<p>Drop me a note if so!</p>
<p><strong>Note:</strong> This is the first draft, I started this project today.</p>
<p>The parser is quite naive and strings matching &#8216;function(&#8216; etc and unmatched { and } in comments  will break it. But this is a work in progress <img src="https://s.w.org/images/core/emoji/11/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><strong>Update 1 04.02:</strong> { and } in comments are now safely handled, and several small issues has been corrected.</p>
<p>Now I only need to validate that the functions the parser finds are not part of a comment.</p>
<p><strong>Update 2 04.02:</strong> The parser has now been fixed, it now completely ignores anything in the comments. As far as I know this means that as long as the code validates the parser should be solid as a rock!</p>
]]></content:encoded>
			<wfw:commentRss>https://kinsey.no/blog/index.php/2010/02/03/jscontract-code-contracts-for-javascript/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>easyXDM just became even easier to use!</title>
		<link>https://kinsey.no/blog/index.php/2010/01/02/easyxdm-just-became-even-easier-to-use/</link>
		<comments>https://kinsey.no/blog/index.php/2010/01/02/easyxdm-just-became-even-easier-to-use/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 19:56:04 +0000</pubDate>
		<dc:creator><![CDATA[oyvind.kinsey]]></dc:creator>
				<category><![CDATA[easyXDM]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[cross-domain]]></category>
		<category><![CDATA[easyxdm]]></category>
		<category><![CDATA[rpc]]></category>

		<guid isPermaLink="false">http://kinsey.no/blog/?p=201</guid>
		<description><![CDATA[To accommodate older browsers that does not implement the postMessage interface, easyXDM is able to fall back to using the URI fragment trick, and until now this has meant that the provided hash.html file had to be uploaded to the local domain (the &#8216;calling&#8217; domain). This seems to be a dealbreaker for many as they [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>To accommodate older browsers that does not implement the postMessage interface, easyXDM is able to fall back to using the URI fragment trick, and until now this has meant that the provided hash.html file had to be uploaded to the local domain (the &#8216;calling&#8217; domain).</p>
<p>This seems to be a dealbreaker for many as they are unable to upload files to the server, either due to special systems, or because they just want to present an API in the form of &#8216;just include this javascript file&#8217; etc..</p>
<p>With the new <a href="https://www.ohloh.net/p/easyXDM/packages" target="_blank">1.5.5</a> release, this has all changed.</p>
<p>For scenarios where you do not want to upload the hash.html file, you can now point the local attribute to any file present on the local domain, like robots.txt or favicon.ico, and supply a readyAfter attribute with the number of milliseconds to wait before assuming the local file to be loaded and the library to be ready for interaction.</p>
<pre class="brush: jscript; title: ; notranslate">
{
local: &quot;/robots.txt&quot;,
readyAfter: 1000,
remote: &quot;http://.........&quot;,
...
}
</pre>
<p><strong>Update</strong>: Just released <a href="https://www.ohloh.net/p/easyXDM/packages" target="_blank">1.6.0</a> which makes it possible to utilize the current document instead of loading a new one from the local domain. This makes it very easy to integrate, but does mean that you will be modifying the documents location when falling back to the HashTransport &#8211; and this might interfere with for instance history managers etc.</p>
<pre class="brush: jscript; title: ; notranslate">
{
local: window,
remote: &quot;http://.........&quot;,
...
}
</pre>
<p>The hash.html file is still the recommended approach for stable<br />
implementations as it is unobtrusive and it guarantees that the library is indeed ready<br />
when transitioning into a ready state.<br />
Using hash.html also shortens the time needed to initialize easyXDM<br />
as there is no need for the delay to give the local file time to<br />
properly load.</p>
<p>All the different ways to set up easyXDM can now be viewed at <a href="http://easyxdm.net/wiki/Documentation.ashx">http://easyxdm.net/wiki/Documentation.ashx</a></p>
]]></content:encoded>
			<wfw:commentRss>https://kinsey.no/blog/index.php/2010/01/02/easyxdm-just-became-even-easier-to-use/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
