<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <link href="https://friendlybit.com/feed/" rel="self" type="application/atom+xml" />
    <link href="https://friendlybit.com/" rel="alternate" type="text/html" />
    <updated>2009-02-16T18:18:02+01:00</updated>
    <id>https://friendlybit.com</id>
    <title type="html">Friendly Bit - Web development blog</title>
    <subtitle>Friendly Bit is a blog by Emil Stenström, a Swedish web developer that occasionally gets ideas of how to improve the internet.</subtitle>
    
        <entry>
            <title type="html">A couple of sites I’ve launched</title>
            <link href="http://friendlybit.com/css/a-couple-of-sites-ive-launched/" rel="alternate" type="text/html" title="A couple of sites I’ve launched" />
            <published>2009-02-16T18:18:02+01:00</published>
            <updated>2009-02-16T18:18:02+01:00</updated>
            <id>http://friendlybit.com/css/a-couple-of-sites-ive-launched/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Lots of opinions here lately, and very few concrete examples of work I&#39;ve done. I thought I&#39;d take a few minutes of your time and talk about those projects...</summary>
            <content type="html" xml:base="http://friendlybit.com/css/a-couple-of-sites-ive-launched/">
                &lt;p&gt;Lots of opinions here lately, and very few concrete examples of work I&#39;ve done. I thought I&#39;d take a few minutes of your time and talk about those projects here.&lt;/p&gt;
&lt;p&gt;All of the sites I&#39;ve built are in &lt;strong&gt;Swedish&lt;/strong&gt;. The reason for Swedish is just that they are so much easier to write for. Since English is not my native language, everything takes a little bit longer when having to struggle with vocabulary.&lt;/p&gt;
&lt;p&gt;All of the sites are built with &lt;strong&gt;Django&lt;/strong&gt;, a framework I&#39;ve had great success with, which feels both well architectured and easy to get started with (a very unusual combination). Django also lets me write the HTML I want, without getting in the way.&lt;/p&gt;
&lt;p&gt;(By the way: there&#39;s a &lt;a href=&#34;http://groups.google.com/group/django-stockholm&#34;&gt;Django User Group&lt;/a&gt; forming in Stockholm if you&#39;re interested. First meeting this friday)&lt;/p&gt;
&lt;h2 id=&#34;uttrakadse&#34;&gt;Uttråkad.se&lt;a href=&#34;#uttrakadse&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first one to launch was &lt;a href=&#34;http://www.uttr%C3%A5kad.se&#34;&gt;Uttråkad.se - hitta saker att göra&lt;/a&gt;, a site for everyone that have too much time on their hands. I guess the english version would be &amp;quot;bored.com&amp;quot;, which kinda tells you what the site is about, right? :) Anyway, we&#39;ve played around with having the site very open, with no registration needed at all.&lt;/p&gt;
&lt;p&gt;I would say the launch has been a good one, with an &lt;a href=&#34;http://www.metro.se/se/article/2008/12/16/19/0353-45/index.xml&#34;&gt;article in metro&lt;/a&gt; the first week of launch, 153 activities posted, and about 70 daily unique visitors. It has been a fun project to be a part of, and it&#39;s been developed together with three friends in a group we call &lt;a href=&#34;http://openworks.se&#34;&gt;openworks&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Are you bored? Then play around with Uttråkad a bit :)&lt;/p&gt;
&lt;h2 id=&#34;kundose&#34;&gt;Kundo.se&lt;a href=&#34;#kundose&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;With our first project barely launched we decided to join an even called 24 hour business camp. The idea was simple: prepare a business idea, and build and launch it in 24 hours. Said and done: 92 entrepreneurs gathered at a luxurious conference center and presented 52 new sites 24 hours later. It was simply the best conference I&#39;ve been to, and an extreme energy boost to be in a group of doers like that.&lt;/p&gt;
&lt;p&gt;Anyway, we launched &lt;a href=&#34;http://kundo.se&#34;&gt;Kundo - kundtjänst på nätet&lt;/a&gt; after 24 hours, a site that companies can use to embed a feedback-widget on their site. Translates to something like &amp;quot;CustomerO.com&amp;quot;, it&#39;s clearly influenced from &lt;a href=&#34;http://getsatisfaction.com/&#34;&gt;Getsatisfaction&lt;/a&gt; but in Swedish.  There&#39;s clearly a need for better ways for companies to communicate with their customers in Sweden too.&lt;/p&gt;
&lt;p&gt;After the camp we still had some bugs and important features missing, so yesterday me and Björn sat down and squashed all the major ones. So, do you know of a company that needs to take better care of their customers? For free. Send them a link to &lt;a href=&#34;http://kundo.se&#34;&gt;Kundo&lt;/a&gt;. Thanks! :)&lt;/p&gt;
&lt;h2 id=&#34;samhallsentreprenorse&#34;&gt;Samhallsentreprenor.se&lt;a href=&#34;#samhallsentreprenorse&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I&#39;ve also been busy with Django at work. &lt;a href=&#34;http://www.samhallsentreprenor.se/&#34;&gt;Samhallsentreprenor.se&lt;/a&gt; is a meeting place for people that work in projects that somehow help their local (or global) community. These are people that are incredibly motivated to do good, a group that&#39;s of course great to work for.&lt;/p&gt;
&lt;p&gt;We&#39;ve released new versions of the site about every 10 days, so development is fast, and through the development blog people can directly influence future features.&lt;/p&gt;
&lt;p&gt;So, do you have ideas for projects that can help people around you? &lt;a href=&#34;http://samhallsentreprenor.se/&#34;&gt;Sign up on the site and start talking to people&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;two-more-projects&#34;&gt;Two more projects…&lt;a href=&#34;#two-more-projects&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;… are under development and will be announced when they are done. There&#39;s no lack of things to do in my world :)&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">HTML includes</title>
            <link href="http://friendlybit.com/html/html-includes/" rel="alternate" type="text/html" title="HTML includes" />
            <published>2008-11-29T15:18:49+01:00</published>
            <updated>2008-11-29T15:18:49+01:00</updated>
            <id>http://friendlybit.com/html/html-includes/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">One of the first questions beginners ask when starting to learn HTML is how to do includes. They seldom know that includes is what they are asking about,...</summary>
            <content type="html" xml:base="http://friendlybit.com/html/html-includes/">
                &lt;p&gt;One of the first questions beginners ask when starting to learn HTML is &lt;a href=&#34;http://www.google.com/search?q=include+html&#34;&gt;how to do includes&lt;/a&gt;. They seldom know that includes is what they are asking about, but instead feels bad when having to copy and paste that same menu HTML each time they want a new page. &amp;quot;Do I have to type the same thing over and over?&amp;quot;.&lt;/p&gt;
&lt;p&gt;After asking friends how to solve the problem they get the answer that they now have to learn PHP. Or ASP. Or JSP. Or some other strange language they don&#39;t need. And install this thing here, and that thing there. What does your server host support? Oh, no, you need to configure stuff better. No, that setting is insecure… You know the drill, I&#39;m sure you&#39;ve walked someone through it sometime.&lt;/p&gt;
&lt;p&gt;So, a way to include a piece of HTML into a random page would clearly benefit beginners learning HTML. But that&#39;s not all:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Browsers would be able to cache&lt;/strong&gt; components of a page, and therefor load new pages using common components faster.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Less work learning new template languages&lt;/strong&gt; just to find that language X does not have a way to include things.&lt;/li&gt;
&lt;li&gt;Possible to learn componentization by &lt;strong&gt;looking at existing sites&lt;/strong&gt; and learn from them. This is an area we need to be better in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Easy to make fallbacks&lt;/strong&gt; by linking directly to the corresponding HTML snippet.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, how would this be implemented? We need a tag that acts as a kind of include, so what about &lt;code&gt;&amp;lt;object&amp;gt;&lt;/code&gt;? Just point to the HTML file you want and voilá, it gets included. Since this is HTML it would work exactly the same across all server-side languages.&lt;/p&gt;
&lt;p&gt;Luckily, this is already in the HTML5 spec. At the &lt;a href=&#34;http://www.whatwg.org/specs/web-apps/current-work/#the-object-element&#34;&gt;bottom of the object specification&lt;/a&gt;. Interestingly, I found it &lt;strong&gt;after&lt;/strong&gt; writing this article… Great minds think alike :)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this example, an HTML page is embedded in another using the &lt;a href=&#34;http://www.whatwg.org/specs/web-apps/current-work/#the-object-element&#34;&gt;object&lt;/a&gt; element.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;HTML&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;figure&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;clock.html&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;figcaption&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;My HTML Clock&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;figcaption&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;figure&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Good! And it even seems to work in current browsers (&lt;a href=&#34;#comment-31225&#34;&gt;Thanks Siegfried&lt;/a&gt;). I&#39;ve tested it in Firefox, Opera, and Safari, and it works the same in all of them. Internet Explorer 6, 7, 8 (beta 2) just ignores it altogether.&lt;/p&gt;
&lt;p&gt;The problem is, the current implementation is to handle them just like iframes. And there&#39;s of course lots of problems with that approach:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Currently, an object element without a height and width gets rendered as a &lt;strong&gt;300 x 150 pixel block&lt;/strong&gt;. There is no reason whatsoever to do this when including HTML. This must change for this to be usable.&lt;/li&gt;
&lt;li&gt;The included HTML needs to be &lt;strong&gt;stylable&lt;/strong&gt; with the CSS rules on the page it&#39;s included from. Currently, this does not work, included HTML is treated as an iframe. Must be changed if this is to be usable.&lt;/li&gt;
&lt;li&gt;Are HTML components full HTML pages? Do they include a doctype and a &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, and do those get included? I assume only HTML &lt;strong&gt;inside &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; gets included&lt;/strong&gt; in the new page. No CSS. No JS linked to in &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Clicking links inside included HTML should be handled as if the HTML was on the current page. This follows the same concept as if the HTML was included in the server side, and is needed if this is ever going to be used for a menu.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, what do you think, is this a good idea? Personally, I&#39;m hoping more concepts from template languages start to move into HTML.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Thanks to the comments (thanks zcorpan) I now have found exactly the above in HTML5. It&#39;s called &lt;code&gt;&amp;lt;iframe seamless&amp;gt;&lt;/code&gt;. It meets all the points in my list, and I&#39;m now really looking forward to the first implementation.&lt;/p&gt;
&lt;/blockquote&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Install MySQL-python on Mac OS X (leopard)</title>
            <link href="http://friendlybit.com/tutorial/install-mysql-python-on-mac-os-x-leopard/" rel="alternate" type="text/html" title="Install MySQL-python on Mac OS X (leopard)" />
            <published>2008-10-31T18:37:18+01:00</published>
            <updated>2008-10-31T18:37:18+01:00</updated>
            <id>http://friendlybit.com/tutorial/install-mysql-python-on-mac-os-x-leopard/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">What a pain. Getting mysql to work with python is the single most annoying step in getting Django up and running (if you choose MySQL as the database). You...</summary>
            <content type="html" xml:base="http://friendlybit.com/tutorial/install-mysql-python-on-mac-os-x-leopard/">
                &lt;p&gt;What a pain. Getting mysql to work with python is the single most annoying step in getting Django up and running (if you choose MySQL as the database). You see, python requires drivers to be able to talk to MySQL, and you have to compile those yourself. I just devoted several hours last night to help friends do what I did some months ago. This time, I thought I document it right here.&lt;/p&gt;
&lt;h2 id=&#34;how-to-install-mysql-python-on-mac-os-x&#34;&gt;How to install MySQL-python on Mac OS X&lt;a href=&#34;#how-to-install-mysql-python-on-mac-os-x&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: &lt;strong&gt;Brace yourself&lt;/strong&gt;, this proccess is really really annoying.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;: &lt;a href=&#34;http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg&#34;&gt;&lt;strong&gt;Download MySQL&lt;/strong&gt; for Mac&lt;/a&gt; (Skip registration by clicking the link below the login form). You probably want &amp;quot;&lt;a href=&#34;http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.67-osx10.5-x86.dmg/from/http://mysql.mirror.kangaroot.net/&#34;&gt;Mac OS X 10.5 (x86)&lt;/a&gt;&amp;quot;. Is it possible to use some other version of MySQL? Yes, as long as you have a version that includes the source code (&lt;a href=&#34;http://www.mamp.info/en/mamp.html&#34;&gt;MAMP&lt;/a&gt; does not include them, so it won&#39;t work). You&#39;ll need the source later on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;: &lt;strong&gt;Install MySQL&lt;/strong&gt; by mounting the image you just downloaded, and double-clicking the package file for MySQL. Also install the prefPane that&#39;s included in the package. That adds an icon the system admin that lets you start and stop MySQL, very convenient.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;: &lt;strong&gt;Make the mysql command accessible from anywhere&lt;/strong&gt; by adding it to your PATH (a variable that holds all directories the terminal looks in to find the command you&#39;re trying to execute). The below just adds mysql&#39;s bin directory (it&#39;s probably the one I&#39;m using below) to the PATH you currently are using:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;BASH&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PATH&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;/usr/local/mysql/bin:&lt;span class=&#34;nv&#34;&gt;$PATH&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You probably want to add this line to a file called &lt;strong&gt;.bash_profile&lt;/strong&gt; (yes, it starts with a dot), that is situated in your home directory (which you get to by just typing &amp;quot;cd&amp;quot;). This file gets run each time you start a new terminal, so it makes sure the mysql command is always accessible, no matter where you are.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt;: &lt;strong&gt;&lt;a href=&#34;https://sourceforge.net/project/showfiles.php?group_id=22307&amp;amp;package_id=15775&#34;&gt;Download MySQL-python&lt;/a&gt;&lt;/strong&gt;, you probably want the file that ends with .&lt;strong&gt;tar.gz&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 6&lt;/strong&gt;: &lt;strong&gt;Unpack the file&lt;/strong&gt; you just downloaded in an empty directory (anywhere)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 7&lt;/strong&gt;: &lt;strong&gt;&lt;a href=&#34;http://developer.apple.com/technology/xcode.html&#34;&gt;Download XCode&lt;/a&gt;&lt;/strong&gt; from Apple. The reason you need this is because XCode includes a C++ compiler you will use when installing MySQL-python soon. The download is huge (1 Gb), and to be able to download you first need to fill in a long form. The registration process for Apple Developer Connection is about the worst things Apple has ever created, so after completing it, you will either laugh or be really annoyed, just pick and choose. You do need XCode however.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 8&lt;/strong&gt;: &lt;strong&gt;Install the XCode Tools&lt;/strong&gt; &lt;strong&gt;package&lt;/strong&gt; by first mounting the file you just downloaded, and then double-clicking on the &lt;strong&gt;XCode Tools&lt;/strong&gt; package. It&#39;s the only one you need from the huge set of junk you just downloaded.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 9&lt;/strong&gt;: Try installing MySQL-python by going to the directory where you unpacked it and typing:&lt;/p&gt;
&lt;div class=&#34;highlight&#34; data-language=&#34;BASH&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;python&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;setup.py&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;install
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will attempt to install the drivers, but &lt;strong&gt;will fail&lt;/strong&gt;. This is because the coders behind MySQL-python have failed to fix a very simple bug in types.h (&lt;a href=&#34;https://sourceforge.net/tracker/?func=detail&amp;amp;aid=1808476&amp;amp;group_id=22307&amp;amp;atid=374932&#34;&gt;1808476&lt;/a&gt; - &amp;quot;#define of uint breaks compiling on Mac OS X 10.5&amp;quot;). However, you can easily fix it yourself: Look for a reference to types.h in the terminal. When you find it, open that file in your favorite text editor and comment out line 92, which should say something about &lt;code&gt;#define&lt;/code&gt; and &lt;code&gt;uint&lt;/code&gt; (comments in C++ are double forward slashes: //).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 10&lt;/strong&gt;: Now, &lt;strong&gt;try the above command again&lt;/strong&gt;. It should install fine. If it doesn&#39;t, you will probably find out why by looking in the terminal for errors while compiling.&lt;/p&gt;
&lt;p&gt;What did I say, isn&#39;t this process about 7 steps to long? Well, I hope this little guide helps someone.&lt;/p&gt;

            </content>
        </entry>
    
        <entry>
            <title type="html">Django – the fun framework (presentation)</title>
            <link href="http://friendlybit.com/other/django-the-fun-framework-presentation/" rel="alternate" type="text/html" title="Django – the fun framework (presentation)" />
            <published>2008-09-26T17:07:14+02:00</published>
            <updated>2008-09-26T17:07:14+02:00</updated>
            <id>http://friendlybit.com/other/django-the-fun-framework-presentation/</id>
            <author>
                <name>Emil Stenström</name>
            </author>
            <summary type="text">Yesterday I attended the excellent Geek Meet hosted by Robert Nyman at the Creuna office. I held a presentation about the Django web framework, and took...</summary>
            <content type="html" xml:base="http://friendlybit.com/other/django-the-fun-framework-presentation/">
                &lt;p&gt;Yesterday I attended the excellent &lt;a href=&#34;http://robertnyman.com/geekmeet/&#34;&gt;Geek Meet&lt;/a&gt; hosted by Robert Nyman at the Creuna office. I held a presentation about the Django web framework, and took some time today to add some comments in english and make a PDF-file of the presentation. Would you like to know why Django is more fun than what you&#39;re using right now?&lt;/p&gt;
&lt;p&gt;So go ahead and have a look at the presentation: &lt;strong&gt;&lt;a href=&#34;/files/Django%20-%20the%20fun%20framework.pdf&#34; data-no-instant&gt;Django - the fun framework&lt;/a&gt;&lt;/strong&gt; (11 Mb, PDF with english comments)&lt;/p&gt;

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