<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Sebastien Lachance]]></title>
  <link href="http://sebastienlachance.com/atom.xml" rel="self"/>
  <link href="http://sebastienlachance.com/"/>
  <updated>2012-02-22T07:54:30-05:00</updated>
  <id>http://sebastienlachance.com/</id>
  <author>
    <name><![CDATA[Sebastien Lachance]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Converting a BlogEngine.Net blog to Octopress]]></title>
    <link href="http://sebastienlachance.com/blog/converting-a-blogengine-dot-net-blog-to-octopress/"/>
    <updated>2012-02-21T12:52:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/converting-a-blogengine-dot-net-blog-to-octopress</id>
    <content type="html"><![CDATA[<p>Some months ago, I moved my BlogEngine.net blog (hosted on GoDaddy) to Octopress hosted on Heroku. I needed a tool to migrate all my posts and found nothing that could apply to my case (I&#8217;m pretty sure there is something out there, but I didn&#8217;t look very far and wanted to code the tool myself anyway).</p>

<p>Octopress blog post format look like this:</p>

<pre><code>---
layout: post
title: "Setting ComVisible"
date: 2005-01-19 14:46:00
comments: true
categories: 
---

** This is my post using Markdown**
</code></pre>

<p>My BlogEngine.Net was configured to use xml files to store posts. Which look like this:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
&lt;post&gt;
  &lt;author&gt;SebastienLachance&lt;/author&gt;
  &lt;title&gt;Building a new app - Introduction&lt;/title&gt;
  &lt;description&gt;The introduction&lt;/description&gt;
  &lt;content&gt;This is ...
</code></pre>

<p>At first, I wanted to move each post individually whenever I could. After a week and pretty much nothing converted, I created a little .Net tool to make the conversion/migration much easier.</p>

<p>It&#8217;s a pretty basic windows form application that takes a path and output a bundle of simili-markdown (because the original posts are html, but, since markdown accept html, it&#8217;s fine) files that are compatible with the Octopress format.</p>

<p>It&#8217;s also generating a <strong>redirection.rb</strong> file that contains necessary code to be used by rack-rewrite to make necessary 301 redirection. It can be useful if you don&#8217;t want to write it all manually.</p>

<pre><code>use Rack::Rewrite do

    r301 %r{^/post/The-surprising-science-of-motivation-by-Dan-Pink.aspx?$}, '/blog/the-surprising-science-of-motivation-by-dan-pink'
    r301 %r{^/post/Building-a-new-application-Introduction.aspx?$}, '/blog/building-a-new-application-introduction'
    r301 %r{^/post/tight-deadlines.aspx?$}, '/blog/tight-deadlines'
    r301 %r{^/post/no-such-file-to-load-cucumberrailsactive_record-(LoadError).aspx?$}, '/blog/no-such-file-to-load-cucumberrailsactive_record-(loaderror)'
    r301 %r{^/post/Buying-games-on-Steam.aspx?$}, '/blog/buying-games-on-steam'
    r301 %r{^/post/AlternativeToNet-review.aspx?$}, '/blog/alternativetonet-review'
    r301 %r{^/post/Excellent-post-by-Uncle-Bob.aspx?$}, '/blog/excellent-post-by-uncle-bob'
</code></pre>

<p>You can grab the source here : <a href="https://github.com/sebastienlachance/BlogEngineToOctopress">BlogEngineToOctopres</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[My starting Gemfile]]></title>
    <link href="http://sebastienlachance.com/blog/my-starting-gemfile/"/>
    <updated>2012-02-17T15:08:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/my-starting-gemfile</id>
    <content type="html"><![CDATA[<p>This is how my Gemfile looks like at the moment. Continuous feedback with Guard and metrics to keep track on defects and best practices not used.</p>

<div><script src='https://gist.github.com/1855201.js?file='></script>
<noscript><pre><code>source 'https://rubygems.org'

gem 'rails', '3.2.1'
gem 'pg'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2'
gem 'omniauth-identity'

group :assets do
  gem 'sass-rails',   '~&gt; 3.2.3'
  gem 'coffee-rails', '~&gt; 3.2.1'
  gem 'uglifier',     '&gt;= 1.0.3'
end

gem 'jquery-rails'
gem 'skeleton-rails'
gem 'rails-backbone'
gem 'jasminerice'

gem 'rspec-rails', :group =&gt; [:development, :test]

group :development do 
  gem 'heroku'
  gem 'guard'
  gem 'guard-rspec'
  gem 'guard-jasmine'
  gem 'growl'
  gem 'metrical'
  gem 'fattr'         # for Metric_fu
  gem 'arrayfields'   # for Metric_fu
  gem 'map'           # for Metric_fu
  gem 'annotate', :git =&gt; 'git://github.com/ctran/annotate_models.git'
end

group :test do
  gem 'database_cleaner', :group =&gt; :test
  gem 'factory_girl_rails', :group =&gt; :test
end

gem 'bcrypt-ruby', '~&gt; 3.0.0'</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Startup Camp Quebec]]></title>
    <link href="http://sebastienlachance.com/blog/startup-camp-quebec/"/>
    <updated>2012-02-13T12:11:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/startup-camp-quebec</id>
    <content type="html"><![CDATA[<p><img class="left" src="http://sebastienlachance.com/images/startupcampquebec.jpg" title="Startup Camp Québec" ></p>

<p>Jeudi dernier, avait lieu l&#8217;événement <a href="http://www.startupcampquebec.com">Startup Camp Québec</a>.</p>

<p>Je ne suis pas un habitué de ces événements même si j&#8217;ai <a href="http://www.guidedescommercesdebeauce.com">ma propre compagnie</a> et ait participé à quelques coktails et diners aux homards (j&#8217;aime pas le homard). C&#8217;était quand un monde nouveau avec de nouvelles personnes.</p>

<p>Il y avait 8 startups qui présentaient leur produits. J&#8217;ai bien aimé les présentations, et j&#8217;ai beaucoup accroché sur quelques projets. Particulièrement le projet Trapèze École de <a href="http://mx4.yolasite.com/">MX4</a>. Ils ont créer une manière de gérer les horaires dans les écoles, et ca, c&#8217;est ce que j&#8217;appelle trouver des solutions à un problème.</p>

<p>Mais le grand gagnant de cette édition est <a href="http://theriansaga.fatecraft.com/">FateCraft</a>, qui développe des jeux sociaux.</p>

<p>Je n&#8217;ai malheureusement pu rester jusqu&#8217;à la fin et voir la remise des prix. Mais je souhaite quand même bonne chance à toutes ces jeunes entreprises et puissent-elles continuer malgré toutes les embuches qui peuvent se présenter devant elles.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Mastering Backbone - Day 1 impressions and basic concepts]]></title>
    <link href="http://sebastienlachance.com/blog/mastering-backbone-day-1-impressions/"/>
    <updated>2012-02-03T10:24:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/mastering-backbone-day-1-impressions</id>
    <content type="html"><![CDATA[<p><img src="http://sebastienlachance.com/images/backbone.png" title="backbone.js" ></p>

<h2>Basics</h2>

<p>Previous experience:</p>

<p>I have no real hands-on experience. Only watched some screencasts.</p>

<p>I decided to create a little Todo app with Rails to make sure I understand the basics concepts correctly.</p>

<pre><code>gem 'rails-backbone'
gem 'jasminerice'

bundle install

rails g backbone:install
</code></pre>

<p>In the spec/javascripts/spec.js.coffee, add the following:</p>

<pre><code>#= require jquery
#= require underscore
#= require backbone
#= require backbone_rails_sync
#= require backbone_datalink
</code></pre>

<h1>Creating a model</h1>

<p>I created a todo.js file in the app/assets/javascript/backbone/models directory.</p>

<pre><code>window.Todo = Backbone.Model.extend({});
</code></pre>

<p>Pretty straightforward.</p>

<h1>Creating a collection</h1>

<pre><code>window.TodoList = Backbone.Collection.extend({
    model: Todo 
});
</code></pre>

<h1>Testing to ensure everything is fine</h1>

<p>To use <strong>jasminerice</strong>, start the rails server.</p>

<pre><code>rails s
</code></pre>

<p>Go to localhost:3000/jasmine.</p>

<div><script src='https://gist.github.com/1751477.js?file='></script>
<noscript><pre><code>describe(&quot;Todo Model&quot;, function() {
  it(&quot;can be instantiated&quot;, function() {
    var todo = new Todo();
    expect(todo).toBeTruthy();
  });

  it(&quot;has the description property&quot;, function() {
    var todo = new Todo();
    todo.set({ description: &quot;this is a description&quot;});
    expect(todo.get('description')).toEqual(&quot;this is a description&quot;);
  });

  it(&quot;has the done property&quot;,function() {
    var todo = new Todo();
    todo.set({ done: true});
    expect(todo.get('done')).toBeTruthy();
  })
});

describe(&quot;Todo List&quot;, function() {
  it(&quot;starts out empty&quot;, function() {
    var todoList = new TodoList();
    var todo = new Todo();
    expect(todoList.length).toEqual(0);
  });
  it(&quot;add elements as expected&quot;, function() {
    var todoList = new TodoList();
    var todo = new Todo();
    todoList.add(todo);
    expect(todoList.length).toEqual(1);
  });
  it(&quot;should be able to retrieve elements by index&quot;, function() {
    var todoList = new TodoList();
    var todo = new Todo();
    todoList.add(todo);
    var retrievedTodo = todoList.at(0);
    expect(retrievedTodo).toBe(todo);
  });
  it(&quot;should be able to remove elements&quot;, function() {
    var todoList = new TodoList();
    var todo = new Todo();
    todoList.add(todo);
    todoList.remove(todo);
    expect(todoList.length).toEqual(0);
  });

});</code></pre></noscript></div>


<h1>Creating a view</h1>

<p>To define a view, you call the extend method on Backbone.View.</p>

<pre><code>window.TodoList = Backbone.View.extend({});
</code></pre>

<p>A view is used ot render a model so we need to override the <strong>render</strong> method.</p>

<pre><code>window.TodoList = Backbone.View.extend({
    render: function() {
      //the interesting part happens here.
    }
});
</code></pre>

<p>The view is represented by an html element, I believe it&#8217;s a div you don&#8217;t specify it explicitely like this:</p>

<pre><code>window.TodoList = Backbone.View.extend({
    tagName: "section" //use a &lt;section&gt; tag
});
</code></pre>

<p>And a test to make sure it behave like I want:</p>

<pre><code>it("should be a section tag", function() {
  var view = new TodoListView();
  expect(view.el.nodeName).toEqual("SECTION");
});
</code></pre>

<p><strong>el</strong> represent the current view element.</p>

<p>In the render method, this is where you build the view markup, by appending one or more elements to the <strong>el</strong>.</p>

<pre><code>render: function() {
  $(el).html('&lt;h2&gt;Todos&lt;/h2&gt;');
}

//test

it("should render an h2 title', function() {
  var view = new TodoListView();
  view.render(); 
  expect(view.el.innerHTML).toEqual('&lt;h2&gt;Todos&lt;/h2&gt;');
}); 
</code></pre>

<p>But this is not really doing anything really exciting. I would like to display each todo in this view. We will need a view for individual Todo model.</p>

<pre><code>window.TodoView = Backbone.View.extend({
  tagName: 'li',
  render: function() {

  }
});
</code></pre>

<p>But how do we get a model into this view?</p>

<p>When you create an instance of the view you can pass a the model you will want to display. It will automagically added to the model property on the view.</p>

<pre><code>describe("TodoView", function() {
  it("initialization accept a model", function() {
    var todo = new Todo();
    var view = new TodoView({ model: todo });
    expect(view.model).toEqual(todo);
  });
});
</code></pre>

<p>Now I&#8217;m pretty sure I can render something in my TodoView render method.</p>

<pre><code>window.TodoView = Backbone.View.extend({ 
  tagName: 'li',
  render: function() {
    $(this.el).append(this.model.get('description'));
    return this;
  }
});
</code></pre>

<p>Now in my TodoListView I will loop through each Todo, render a view for each and appending them to the root element.</p>

<pre><code>window.TodoListView = Backbone.View.extend({
  tagName: 'section',
  render: function() {
    $(this.el).html('&lt;h2&gt;Todos&lt;/h2&gt;&lt;ul class="todo-items"&gt;&lt;/ul&gt;');
    var listContainer = $(this.el).find('.todo-items'); 
    this.collection.each(function(todo) {
      var view = new TodoView({model:todo}); 
      listContainer.append(view.render().el);
    });
    return this;
  }
});
</code></pre>

<p>Next post: Adding and removing todos.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Mastering Backbone - Day 0]]></title>
    <link href="http://sebastienlachance.com/blog/mastering-backbone-day-0/"/>
    <updated>2012-02-02T19:42:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/mastering-backbone-day-0</id>
    <content type="html"><![CDATA[<p><img src="http://sebastienlachance.com/images/backbone.png" title="backbone.js" ></p>

<p>I have now officially started the development for my new web application. I will not go into details right now, since everything is to be made, and a lot of very important decisions are to be made.</p>

<p>What I can say is that it will be a Web Application running on Rails. I&#8217;m still struggling on whether to use PostgresSQL, MySQL or MongoDB.</p>

<p>One of the big design decision was the choice of the client-side framework. I know I wanted a rich and fast user experience and to use Javascript heavily. So, I decided to go with <a href="http://documentcloud.github.com/backbone/" title="Backbone.js">Backbone</a>. And I have no experience with it apart from the <a href="http://peepcode.com/products/backbone-js" title="Backbone.js on Peepcode">Peepcode screencasts</a>.</p>

<p>I have no idea how to apply it to my application domain. It will be hard, but worth it.</p>

<h2>What is Backbone?</h2>

<p><strong>Backbone is a framework to create data-driven application in Javascript.</strong></p>

<p>As much as I love CoffeeScript, I will not use it to learn Backbone.</p>

<p>I will use Jasmine for testing.</p>

<h2>Why Backbone and not Knockout or any other javascript framework?</h2>

<p>From what I heard, Backbone is hard to learn, but from those who use it, it&#8217;s totally worth a try. And I heard so much great things from a lot of different developers. They couldn&#8217;t be all wrong.</p>

<p>So let&#8217;s get coding. Expect another blog post later for the first impressions.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Reponsive and Mobile-Friendly Design with Skeleton]]></title>
    <link href="http://sebastienlachance.com/blog/reponsive-and-mobile-friendly-design/"/>
    <updated>2012-01-13T10:16:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/reponsive-and-mobile-friendly-design</id>
    <content type="html"><![CDATA[<p><img class="left" src="http://sebastienlachance.com/images/skeleton.jpg" title="skeleton" ></p>

<p>When we first made the <a href="http://www.guidedescommercesdebeauce.com" title="Guide des Commerces">Guide des Commerces</a>, we didn&#8217;t anticipated we would need to adapt to other devices so soon. In fact, it we know it was for this year but we though it would be a completely different application for iPhone, Android or a new website.</p>

<p>A month ago we had a discussion with a Facebook expert and talked about adding the Guide to our existing <a href="http://www.facebook.com/pages/Guide-des-Commerces-de-Beauce/190606624290004">page</a> (just an iframe with the app). The problem is that we use fixed width everywhere and Facebook iframe has only 520px. It would not be wise to develop another site only for Facebook and another one only for mobile device. We needed another solution.</p>

<p>It occured to me that we could hit three birds with one stone (a lot more actually). We only have to use a responsive desig&lt;</p>

<p>I tried various css framework and settled down for <a href="getskeleton.com" title="Skeleton framework">Skeleton</a>. It provided me with everything I needed and I can almost use it as-is without any modification. It use Media Queries (link here) to adapt to various screen size (tablet, mobile, iOS, etc.).</p>

<p>If you don&#8217;t know Skeleton, it&#8217;s basically a grid framework with sixteen column totally a width of 960 pixel.</p>

<p>Suppose you have a div that you want to take 100% of the page.</p>

<pre><code>&lt;div class="sixteen columns"&gt;
&lt;/div&gt;
</code></pre>

<p>You can also have a three column layout very easily:</p>

<pre><code>&lt;div class="one-third column"&gt;
&lt;/div&gt;

&lt;div class="one-third column"&gt;
&lt;/div&gt;

&lt;div class="one-third column"&gt;
&lt;/div&gt;
</code></pre>

<p>When you resize your browser, everything just resize nicely.</p>

<p>I am almost 5 hours in now, and I&#8217;ve struggled a little but the result is amazing. And I frankly don&#8217;t regret the framework choice at all.</p>

<p>Stay tuned for more&#8230;</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Couldn't Parse YAML at Line X Column X (Psych::SyntaxError)]]></title>
    <link href="http://sebastienlachance.com/blog/couldnt-parse-yaml-at-line-x-column-x-psych-syntaxerror/"/>
    <updated>2011-09-14T07:50:00-04:00</updated>
    <id>http://sebastienlachance.com/blog/couldnt-parse-yaml-at-line-x-column-x-psych-syntaxerror</id>
    <content type="html"><![CDATA[<p>I am using Rails 3.0.3 and got this error :</p>

<pre><code>couldn't parse YAML at line 182 column 9 (Psych::SyntaxError)
</code></pre>

<p>As I understand it, there is an issue with the locale file (locale/en.yml) of ActiveSupport.</p>

<p>Just by adding</p>

<pre><code>require 'yaml'
YAML::ENGINE.yamler= 'syck'
</code></pre>

<p>at the beginning of the boot.rb file should take care of this issue.</p>

<p><a href="https://rails.lighthouseapp.com/projects/8994/tickets/6354-psych-does-not-handle-symbols-in-yaml-used-in-activesupport">More info here</a> <a href="http://stackoverflow.com/questions/4980877/rails-error-couldnt-parse-yaml">and here</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[A Circular Reference Was Detected While Serializing an Object to Type Code.Models.Category]]></title>
    <link href="http://sebastienlachance.com/blog/a-circular-reference-was-detected-while-serializing-an-object-to-type-code-dot-models-dot-category/"/>
    <updated>2011-09-12T10:38:00-04:00</updated>
    <id>http://sebastienlachance.com/blog/a-circular-reference-was-detected-while-serializing-an-object-to-type-code-dot-models-dot-category</id>
    <content type="html"><![CDATA[<p>I have an NHibernate class with the following properties :</p>

<pre><code>public class Category
{
    public virtual int Id { get; set; }
    public virtual string Name { get;set; }
    public virtual Category Parent { get;set; }
    public virtual IList&lt;Category&gt; Childs { get;set; }
}
</code></pre>

<p>And an action that return a list of categories as JSON :</p>

<pre><code>public JsonResult Categories 
{
    return Json(GetCategories(), JsonRequestBehavior.AllowGet);
}
</code></pre>

<p>I know that it&#8217;s not pefect to use an NHibernate class instead of a view model, but it&#8217;s a very very small application and I&#8217;m trying to keep things clean.</p>

<p><strong>Solution : </strong></p>

<pre><code>return Json(GetCategories().Select(c =&gt; new { c.Id, c.Name }), JsonRequestBehavior.AllowGet);
</code></pre>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[FluentHibernate - How to Deal With a Reserved Word Column]]></title>
    <link href="http://sebastienlachance.com/blog/fluenthibernate-how-to-deal-with-a-reserved-word-column/"/>
    <updated>2011-09-09T16:06:00-04:00</updated>
    <id>http://sebastienlachance.com/blog/fluenthibernate-how-to-deal-with-a-reserved-word-column</id>
    <content type="html"><![CDATA[<p>Suppose you have a class with an Order property. Any sql operation will throw an error because Order is a reserved word. To prevent this from happening, specify the column name yourself and enclose it with back ticks.</p>

<pre><code>public class MessageMap : ClassMap&lt;Message&gt;
{
    public MessageMap()
    {
        Table("messages");
        Id(x =&gt; x.Id);
        ...
        Map(x =&gt; x.Order, "`Order`");
        ...
    }
}
</code></pre>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[no such file to load -- cucumber/rails/active_record (LoadError)]]></title>
    <link href="http://sebastienlachance.com/blog/no-such-file-to-load-cucumberrailsactive_record-%28loaderror%29/"/>
    <updated>2011-06-14T13:06:00-04:00</updated>
    <id>http://sebastienlachance.com/blog/no-such-file-to-load-cucumberrailsactive_record-(loaderror)</id>
    <content type="html"><![CDATA[<p>This morning I have updated cucumber on my rails application and I have been greeted by this error message :&nbsp;</p>


<pre>no such file to load -- cucumber/rails/active_record (LoadError)
</pre>


<p>A simple fix is to simply reinstall cucumber :</p>


<pre>rails generate cucumber:install
</pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[(parseFloat || parseInt) && NaN]]></title>
    <link href="http://sebastienlachance.com/blog/parsefloat%28e28098e28099%29-3d3d-nan/"/>
    <updated>2011-06-06T06:31:58-04:00</updated>
    <id>http://sebastienlachance.com/blog/parsefloat(e28098e28099)-3d3d-nan</id>
    <content type="html"><![CDATA[<p>Little reminder for later :&#160; </p>


<p>  <pre>parseInt(‘’) == NaN //return false</pre></p>

<pre>isNaN(parseInt(‘’)) //return true</pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Learning Rails : Using jQuery instead of Prototype]]></title>
    <link href="http://sebastienlachance.com/blog/learning-rails-using-jquery-instead-of-prototype/"/>
    <updated>2011-05-02T05:20:00-04:00</updated>
    <id>http://sebastienlachance.com/blog/learning-rails-using-jquery-instead-of-prototype</id>
    <content type="html"><![CDATA[<p>gem &#8220;jquery-rails&#8221;</p>


<p>bundle install</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[SQL Server Error : failed to retrieve text for this error. Reason 1815]]></title>
    <link href="http://sebastienlachance.com/blog/sql-server-error-failed-to-retrieve-text-for-this-error-reason-1815/"/>
    <updated>2011-05-02T03:15:00-04:00</updated>
    <id>http://sebastienlachance.com/blog/sql-server-error-failed-to-retrieve-text-for-this-error-reason-1815</id>
    <content type="html"><![CDATA[<p>[No text]</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Learning Rails : SanitizeHelper]]></title>
    <link href="http://sebastienlachance.com/blog/learning-rails-sanitizehelper/"/>
    <updated>2011-05-02T01:36:00-04:00</updated>
    <id>http://sebastienlachance.com/blog/learning-rails-sanitizehelper</id>
    <content type="html"><![CDATA[<h2>SanitizeHelper&nbsp;</h2>


<p>I need to start somewhere and while it may not be the most informative post ever, I&#8217;ll try to cover this feature as much as I can. Everything here is already described in the Rails Api so it should be a great idea to keep it as a reference. I&#8217;ll also try to add what I have learned&nbsp;</p>


<p>There are 4 methods in the sanitize helper.</p>


<h3>strip_tags</h3>


<p>Remove any html tags from your the input provided. If you truncate, you may see &lt;a. strip_tags before you truncate.</p>


<h3>strip_links</h3>


<p>Remove any links from your markup and return only the text of the link</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Problem Downloading files using GeckoFX and XULRunner]]></title>
    <link href="http://sebastienlachance.com/blog/problem-downloading-files-using-geckofx-and-xulrunner/"/>
    <updated>2010-12-06T02:50:04-05:00</updated>
    <id>http://sebastienlachance.com/blog/problem-downloading-files-using-geckofx-and-xulrunner</id>
    <content type="html"><![CDATA[<p><a title="GeckoFX Homepage" href="http://geckofx.org/">GeckoFX</a> is a component to reduce the complexity of embedding Firefox (XULRunner)onto a Windows Forms application to replace the default WebBrowser control.</p>


<p>  <p>But while trying to download a file though it, I have encountered this error : </p>  <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:9f3b8763-e6ca-4e78-81bd-7da63413577c" class="wlWriterEditableSmartContent"><pre style="background-color:White;overflow: auto;"><span style="color: #000000;">XML Parsing Error: undefined entity
Location: chrome://mozapps/content/downloads/unknownContentType.xul
Line Number </span><span style="color: #000000;">30</span><span style="color: #000000;">,</span><span style="color: #000000;"> Column </span><span style="color: #000000;">18</span><span style="color: #000000;">:    &lt;description&gt;&amp;intro.label</span><span style="color: #008000;">;</span><span style="color: #008000;">&lt;/description</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div></p>

<p>After a lot of googling I have managed to resolve this issue. This is what I have done : </p>




<h3>1. Use XULRunner 1.9.0.4 or newer</h3>




<p>If you’ve followed some tutorials you may have ended up using 1.9.0.0. Use <a title="XULRunner 1.9.0.4 download location" href="ftp://ftp.mozilla.org/pub/xulrunner/releases/1.9.0.4/runtimes/xulrunner-1.9.0.4.en-US.win32.zip">1.9.0.4</a></p>




<h3>2. Use the Profile Directory</h3>




<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:eab0600a-7232-4ad0-afbf-b7e03b970933" class="wlWriterEditableSmartContent"><pre style="background-color:#FFFFFF;overflow: auto;"><span style="color: #000000;">var profileDirectory </span><span style="color: #000000;">=</span><span style="color: #000000;"> Application.StartupPath </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">@"</span><span style="color: #800000;">\EmbeddedFirefoxProfile</span><span style="color: #800000;">"</span><span style="color: #000000;">;
</span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;">Directory.Exists(profileDirectory))
{
    Directory.CreateDirectory(profileDirectory);
}
Skybound.Gecko.Xpcom.ProfileDirectory </span><span style="color: #000000;">=</span><span style="color: #000000;"> profileDirectory;</span></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>




<h3>3. Copy the chrome folder from the GeckoFX package into the chrome directory of XULRunner.</h3>




<p>This will add 2 files to the existing chrome folder.</p>




<h3>4. Add a bunch of preferences to greprefs/all.js</h3>




<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:DFDE9937-D816-47f4-A306-7B60D5CE5AC0:b65e1539-3745-4255-a994-a429d654c4ee" class="wlWriterEditableSmartContent"><pre class="brush: jscript; gutter: false; first-line: 1; tab-size: 4;  toolbar: true; ">pref(&quot;browser.download.useDownloadDir&quot;, true);
pref(&quot;browser.download.folderList&quot;, 0);
pref(&quot;browser.download.manager.showAlertOnComplete&quot;, true);
pref(&quot;browser.download.manager.showAlertInterval&quot;, 2000);
pref(&quot;browser.download.manager.retention&quot;, 2);
pref(&quot;browser.download.manager.showWhenStarting&quot;, true);
pref(&quot;browser.download.manager.useWindow&quot;, true);
pref(&quot;browser.download.manager.closeWhenDone&quot;, true);
pref(&quot;browser.download.manager.openDelay&quot;, 0);
pref(&quot;browser.download.manager.focusWhenStarting&quot;, false);
pref(&quot;browser.download.manager.flashCount&quot;, 2);
//
pref(&quot;alerts.slideIncrement&quot;, 1);
pref(&quot;alerts.slideIncrementTime&quot;, 10);
pref(&quot;alerts.totalOpenTime&quot;, 4000);
pref(&quot;alerts.height&quot;, 50);</pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>




<h3>Conclusion</h3>




<p>I hope it works for you. Happy GeckoFX programming!</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[APPSUMO and The Bad Ass Developer Bundle]]></title>
    <link href="http://sebastienlachance.com/blog/appsumo-and-the-bad-ass-developer-bundle/"/>
    <updated>2010-11-11T01:24:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/appsumo-and-the-bad-ass-developer-bundle</id>
    <content type="html"><![CDATA[<p>In case you don&#8217;t know APPSUMO, subscribe to their notifications. They offers deals that are pretty hard to beat&#8230; Look at this one :&#160; </p>


<p>  <p>For $47 you get : </p>  <ul>   <li>60$ at Heroku </li>    <li>30$ at twilio </li>    <li>6 months of SendGrid&#8217;s Silver package (479$) </li>    <li>75$ credit at Recurly </li>    <li>4 months at HopToad </li>    <li>2 month at New Relic (400$) </li>    <li>60$ credit at MongoHQ </li>    <li>20 free hours of testing at SauceLabs </li>    <li>4 months at Infochimps </li>    <li>And the best one : 60$ credit at Linode (which I buyed a subscription 2 days ago) </li> </ul>  <div><a title="APPSUMO - Great deals on web apps" href="http://www.appsumo.com/">More details</a></div></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[My Clojure tutorial failure]]></title>
    <link href="http://sebastienlachance.com/blog/my-clojure-tutorial-failure/"/>
    <updated>2010-11-10T06:26:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/my-clojure-tutorial-failure</id>
    <content type="html"><![CDATA[<p>I intended to write a full series of posts to help learn Clojure. While I was really enthusiasm about this, my recent change of plans has left me no choice but to abandon the idea of mastering this language. I didn&#8217;t knew at that time that I&#8217;ll had to learn Ruby for my new project and I have no more time to learn anything else right now. <strong>So, goodbye Clojure!</strong></p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Evernote 4 is better than ever]]></title>
    <link href="http://sebastienlachance.com/blog/evernote-4-is-better-than-ever/"/>
    <updated>2010-11-10T06:11:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/evernote-4-is-better-than-ever</id>
    <content type="html"><![CDATA[<p>
<p>I am a big fan of <strong><a title="Evernote's website" href="http://www.evernote.com/">Evernote</a></strong>. I used to put everything from personal notes to ebook in it. But, it became so slow it was a pain to open it just to add a little something.</p>
<p>But they released version 4 with a very BIG performance improvement. I will now be able to resume my Evernote&#8217;s normal usage.</p>
<div><br /></div>
</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Linode is my new VPS]]></title>
    <link href="http://sebastienlachance.com/blog/linode-is-my-new-vps/"/>
    <updated>2010-11-09T07:03:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/linode-is-my-new-vps</id>
    <content type="html"><![CDATA[<p>I needed to find an hosting company for our new product, and after a lot of though and hard decisions, we decided to go with <a href="http://www.linode.com/index.cfm">Linode</a>.&nbsp;</p>


<p>I choose a Linode 512 (with Ubuntu 10.04 LTS) because we are not ready for full-scale deployment yet and did not wanted to pay for something we will not use fully for some time. The beautiful things is that we will be able to upgrade with no problems later on.</p>


<p>Installing everything and got everything running in less than 2 hours. And I was pretty new to deploying a Rails application with mysql on linux.</p>


<p>&nbsp;</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Searching for specific text in PHP files]]></title>
    <link href="http://sebastienlachance.com/blog/find-in-php-files/"/>
    <updated>2010-11-08T09:53:00-05:00</updated>
    <id>http://sebastienlachance.com/blog/find-in-php-files</id>
    <content type="html"><![CDATA[<p>While working on a <a title="Drupal's website" href="http://drupal.org/">Drupal</a> project, I had to search for a specific string contained in one of a lots of PHP code files. My first search led me to no result. I assumed that the little something I searched for might be embedded in a dynamic web page (Drupal allows this). I spent some time searching and found nothing. Today, as I worked on another feature, I came across the exact thing I searched for. Humm what could I have done wrong?&nbsp;</p>


<p>XP has a known issue when you are searching for text contained in files. Hopefully, there is a solution:&nbsp;<a href="http://support.microsoft.com/default.aspx?scid=KB;EN-US;309173">http://support.microsoft.com/default.aspx?scid=KB;EN-US;309173</a></p>

]]></content>
  </entry>
  
</feed>

