<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        <title>Versed Solutions</title>
        <link>http://blog.versed.se/</link>
        <description>Perl, Open Source and other stuff from the cold north</description>
        <language>en-US</language>
        <copyright>Copyright 2008</copyright>
        <lastBuildDate>Wed, 30 Jul 2008 18:23:36 +0100</lastBuildDate>
        <generator>http://www.sixapart.com/movabletype/</generator>
        <docs>http://www.rssboard.org/rss-specification</docs>
        
        <item>
            <title>Transliterate in JavaScript</title>
            <description><![CDATA[<p>While chatting with a fellow developer friend today talking about how insanely cool JavaScript actually is he mentioned one function he missed was transliteration (as in the tr operation in Perl).</p>

<p>So I whipped up the following function:</p>

<pre><code>
String.prototype.tr = function(from, to) {  
    var fromChars = from.split("");  
    var toChars = to.split("");  

    var mapTable = {};  

    for(i = 0; i < fromChars.length; i++) {  
        var c = i < toChars.length ? toChars[i] : "";  
        mapTable[fromChars[i]] = c;  
    }  

    var str = this;  

    var re = new RegExp(fromChars.join("|"), "g");  
    str = str.replace(re, function(c) { 
        return mapTable[c]; 
    });  

    return str;  
};
</code></pre>

<p>Maybe not the fastest nor safest but it does the job =)</p>

<p>JavaScript++</p>
]]></description>
            <link>http://blog.versed.se/2008/07/transliterate-in-javascript.html</link>
            <guid>http://blog.versed.se/2008/07/transliterate-in-javascript.html</guid>
            
            
                <category domain="http://www.sixapart.com/ns/types#tag">Hack</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">JavaScript</category>
            
            <pubDate>Wed, 30 Jul 2008 18:23:36 +0100</pubDate>
        </item>
        
        <item>
            <title>JavaScript, not only for client-side web-fu</title>
            <description><![CDATA[To be honest I think JavaScript deserves a lot more credit than it has. Yes - browsers occasionally crash because of it and eat up all your CPU for breakfast but don't blame the language for that - blame the runtime(s). People often associate JavaScript with Java despite the fact they have nothing in common. The naming is purely PR and was conceived at a time where JavaScript was supposed to bridge Java-applets and HTML pages.<div><br /></div><div>Back in 2001 at my old job I was working on a content management system where all entities on the pages were represented as objects and stored in an object-database that we had developed. The database server was developed in Perl and supported a kind of triggers when objects were created, update, deleted etc. Since the CMS targeted web we felt that most developers who would built sites in our system would be more likely to know JavaScript than Perl. Thus I developed a <a href="http://search.cpan.org/dist/JavaScript/">Perl/JavaScript</a> bridge that we released as open-source and I still actively maintain. It links to SpiderMonkey which is the original JavaScript engine by Brendan Eich and that is still used in Firefox. <div><br /></div><div>Now, what's it that so awesome about JavaScript you might ask?</div><div><br /></div><div><span class="Apple-style-span" style="font-weight: bold;">Not very much built-in</span></div><div>At its core JavaScript doesn't contain very much - there's a few built-in classes to do common things with dates, string etc but there's no IO, no low-level interfacing to the system, no databases. All this has to be provided by the host which makes it an excellent language to use an extension language.</div><div><br /></div><div><span class="Apple-style-span" style="font-weight: bold;">Simple unified syntax</span></div><div>The syntax resembles a lot of C and Java which makes it easy for novice programmers to pick it up. </div><div><br /></div><div>For example, say we want to iterate over the contents of an array and print out the results using our print function (which we've supplied the runtime):</div><div><br /></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">function do_something(array) {<br />  for (var i in array) {<br />    print(i + " : " + array[i]);<br />  }<br />}</blockquote><div><div><br /></div><div>Now, the same for-in syntax is used to iterate over the properties of an object and we can address properties in objects using brackets so without change we could pass it an object and we would print key/value pairs instead of index/value.</div><div><br /></div><div><span class="Apple-style-span" style="font-weight: bold;">Almost everything is an object</span></div><div>With a few exceptions everything is an object in JavaScript. You can pass around a function just as any other object which makes dynamic programming very easy.</div><div><br /></div><div><span class="Apple-style-span" style="font-weight: bold;">Dynamic weak typing</span></div><div>There's no need to declare what kind of data your variable will hold nor does it have to stay the same over the lifetime of your script. This means that we can focus on the behavior rather the relations of things.</div><div><br /></div><div><span class="Apple-style-span" style="font-weight: bold;">Regular expressions</span></div><div>One of Perls best features is it's strong support for regular expressions. JavaScripts' support is almost as strong and invaluable when working with validation of external data.</div><div><br /></div><div><br /></div></div>]]></description>
            <link>http://blog.versed.se/2008/05/javascript-not-only-for-client.html</link>
            <guid>http://blog.versed.se/2008/05/javascript-not-only-for-client.html</guid>
            
            
                <category domain="http://www.sixapart.com/ns/types#tag">JavaScript</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">languages</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">tools</category>
            
            <pubDate>Wed, 07 May 2008 19:55:42 +0100</pubDate>
        </item>
        
        <item>
            <title>Tools of the trade</title>
            <description><![CDATA[<p>During my 10+ years I've been doing programming professionally I've been fortunate to work in several languages on both Windows and Unix platforms with very smart, somewhat eccentric programmers who consider programming an art and as well as average programmers who just see it as their job.</p>

<p>I think one of the biggest differences between these groups is in the tools they use and prefer.</p>

<p>The first group (i.e the eccentric programmer group) generally say "hey, let's use the best tool for the job" even if that means they have to learn a new language or technology. These people have often been very specialized in their favorite tools but can see the beauty in others and *borrow* that to their toolset.</p>

<p>The second group almost always never want to learn something new and, I think, doesn't consider themselves to be programmers but rather Java-programmers, C-programmers or Ruby-programmers (or any other random language). My experience is that they will not consider ideas and concepts from other tools and just stick with how they've done things in the past. These people are often also very fond of the concept of software design patterns.</p>

<p>From a customer point of view neither isn't the one true solution. Having a system built from a mix of technologies does impact future maintainability when it comes to hiring staff knowledgeable in the technologies while just sticking to one technology will often result in a inflexible solution that takes time to adapt to changes.</p>

<p>On this blog I will write about what, why and how we use the tools we prefer. Hopefully you'll be able to pick something up.</p>

<p>Happy hacking,<br />
Claes</p>]]></description>
            <link>http://blog.versed.se/2008/05/tools-of-the-trade.html</link>
            <guid>http://blog.versed.se/2008/05/tools-of-the-trade.html</guid>
            
            
                <category domain="http://www.sixapart.com/ns/types#tag">C</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">Java</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">JavaScript</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">Perl</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">languages</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">tools</category>
            
            <pubDate>Wed, 07 May 2008 13:55:32 +0100</pubDate>
        </item>
        
        <item>
            <title>JavaScript 1.07 released</title>
            <description><![CDATA[This release fixes a couple of longtime memory leaks when passing bound objects back and forth between Perl and JavaScript and is recommended to all users.<div><br /></div><div><div>Trying to bind an already existing property either on the global root object or a specific object now throws an exception instead of just ignoring the bind completly as previously. In order to overwrite the property with something new make sure it's unbinded first by using <span class="Apple-style-span" style="font-weight: bold;">unbind_value</span>.</div><div><br /></div><div>The release is as always available for download from <a href="http://search.cpan.org/CPAN/authors/id/C/CL/CLAESJAC/JavaScript-1.07.tar.gz">CPAN</a> or from our subversion reporsitory at <span class="Apple-style-span" style="font-style: italic;">svn://svn.versed.se/public/JavaScript/tags/release-1.07</span></div><div><br /></div></div>]]></description>
            <link>http://blog.versed.se/2008/05/javascript-107-released.html</link>
            <guid>http://blog.versed.se/2008/05/javascript-107-released.html</guid>
            
            
                <category domain="http://www.sixapart.com/ns/types#tag">CPAN</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">JavaScript</category>
            
            <pubDate>Tue, 06 May 2008 19:27:14 +0100</pubDate>
        </item>
        
        <item>
            <title>Moving our services to Slicehost</title>
            <description><![CDATA[In the next few days our email, Subversion and web may be a bit jumpy. We're currently moving our hosted services to a VPS over at Slicehost.<div><br /></div><div>Sorry for any inconvenience</div>]]></description>
            <link>http://blog.versed.se/2008/05/moving-our-services-to-sliceho.html</link>
            <guid>http://blog.versed.se/2008/05/moving-our-services-to-sliceho.html</guid>
            
            
                <category domain="http://www.sixapart.com/ns/types#tag">mail</category>
            
                <category domain="http://www.sixapart.com/ns/types#tag">web</category>
            
            <pubDate>Fri, 02 May 2008 19:12:07 +0100</pubDate>
        </item>
        
    </channel>
</rss>

