<?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>David Smeringe weblog &#187; Development</title>
	<atom:link href="http://people.merea.se/david/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://people.merea.se/david</link>
	<description>programming and web design centric weblog</description>
	<lastBuildDate>Mon, 28 Feb 2011 08:59:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Speed up your basic work for new sites</title>
		<link>http://people.merea.se/david/2011/02/24/speed-up-your-basic-work-for-new-sites/</link>
		<comments>http://people.merea.se/david/2011/02/24/speed-up-your-basic-work-for-new-sites/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 08:24:57 +0000</pubDate>
		<dc:creator>David Smeringe</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Markups and javascripts]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[web life]]></category>
		<category><![CDATA[boilertemplate]]></category>
		<category><![CDATA[efficiency]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[grid960]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=101</guid>
		<description><![CDATA[From time to time I create a new site (actually, that&#8217;s kind of what my job is all about.. ). Such job is usually quite similar from one site to another. In order to simplify this process and &#8211; perhaps even more valuable &#8211; increase the production quality, I use frameworks and boiler templates. Currently [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time I create a new site (actually, that&#8217;s kind of what my job is all about.. <img src='http://people.merea.se/david/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). Such job is usually quite similar from one site to another. In order to simplify this process and &#8211; perhaps even more valuable &#8211; increase the production quality, I use frameworks and boiler templates. Currently my favourite setup is the HTML5 Boilertemplate together with grid960. </p>
<p>Let me introduce the two of them for you.</p>
<p>HTML5 Boilerplate:</p>
<p>This is what it sounds like. A basic proof-of-concept foundation for any website what so ever. No need to invent the wheel all over again. It&#8217;s important to notice though that it&#8217;s not a framework, but a ready made template setup which you then can (usually) scale down safely as well as add on to, to fit your needs. </p>
<p>That&#8217;s where the nice CSS Framework grid960 comes in! <img src='http://people.merea.se/david/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The Grid960 is much more of a framework (as far as you can speak of frameworks in CSS). It gives you ready made CSS classes for a grid-splitted layout with a set width (960). Quoting their site;</p>
<blockquote><p>&#8220;All modern monitors support at least 1024 × 768 pixel resolution. 960 is divisible by 2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 20, 24, 30, 32, 40, 48, 60, 64, 80, 96, 120, 160, 192, 240, 320 and 480. This makes it a highly flexible base number to work with.&#8221;</p>
</blockquote>
<p>There are really nice plugins for Photoshop/AI/Fireworks/Dreamweaver that makes life even easier. </p>
<p>Applying the 960 grid to your boiler template is just a matter of adding the 960.css right after the boilerplates style.css link-tag (Ignore the reset and text css).</p>
<p>Read more about these two at</p>
<p><a href="http://mashable.com/2010/09/02/html5-boilerplate-guide/">http://mashable.com/2010/09/02/html5-boilerplate-guide/</a> &#8211; Short intro</p>
<p><a href="http://html5boilerplate.com/">http://html5boilerplate.com/</a>- Home of the boilerplate</p>
<p><a href="http://960.gs/">http://960.gs/</a> &#8211; Home of the CSS grid</p>
<p>..and Some <a href="https://github.com/paulirish/html5-boilerplate/issues/50/#issue/50">QA for boilertemplate @github</a></p>
<p>Next up will be chopping it upp all again to fit the CMS or whatever system it needs to fit into <img src='http://people.merea.se/david/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  (TYPO3 maybe?!)</p>
<p>Updates 24 feb 2011:</p>
<p>Here are some adjustments or additions when working with boilerplate and TYPO3:</p>
<p><code lang="ts"></p>
<p>config.doctype = &lt;!doctype html&gt;</p>
<p>config.renderCharset = utf-8</p>
<p>config.htmlTag_langKey = sv</p>
<p>config.htmlTag_setParams = class='no-js.js'</p>
<p>[browser = msie] &#038;&#038; [version = <7]</p>
<p>config.htmlTag_setParams = class='no-js.js ie6'</p>
<p>[global]</p>
<p>[browser = msie] &#038;&#038; [version = 7]</p>
<p>config.htmlTag_setParams = class='no-js.js ie7'</p>
<p>[global]</p>
<p>[browser = msie] &#038;&#038; [version = 8]</p>
<p>config.htmlTag_setParams = class='no-js.js ie8'</p>
<p>[global]</p>
<p>[browser = msie] &#038;&#038; [version = 9]</p>
<p>config.htmlTag_setParams = class='no-js.js ie9'</p>
<p>[global]</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2011/02/24/speed-up-your-basic-work-for-new-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skywriter or Bespin as bookmarklet</title>
		<link>http://people.merea.se/david/2010/11/16/skywriter-bookmarklet/</link>
		<comments>http://people.merea.se/david/2010/11/16/skywriter-bookmarklet/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 13:06:25 +0000</pubDate>
		<dc:creator>David Smeringe</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[editors/ides/rads]]></category>
		<category><![CDATA[web life]]></category>
		<category><![CDATA[bespin]]></category>
		<category><![CDATA[mozilla labs]]></category>
		<category><![CDATA[skywriter]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=95</guid>
		<description><![CDATA[Skywriter (Bespin) is an on line pure web standards code editor from the Mozilla ppl.. It&#8217;s also available as a bookmarklet (apart from an embedded release). The bookmarklet is pritty cool, allowing you to click the bookmarklet when visiting any site with a textarea in it and then transform them into code editors with highlightning [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mozillalabs.com/skywriter/">Skywriter (Bespin)</a> is an on line pure web standards code editor from the Mozilla ppl.. It&#8217;s also available <a href="https://bespin.mozillalabs.com/bookmarklet/">as a bookmarklet</a> (apart from an embedded release). The bookmarklet is pritty cool, allowing you to click the bookmarklet when visiting any site with a textarea in it and then transform them into code editors with highlightning etc..</p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2010/11/16/skywriter-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Render cObj RECORDS fully or slimmed</title>
		<link>http://people.merea.se/david/2010/05/24/render-cobj-records-fully-or-slimmed/</link>
		<comments>http://people.merea.se/david/2010/05/24/render-cobj-records-fully-or-slimmed/#comments</comments>
		<pubDate>Mon, 24 May 2010 07:21:14 +0000</pubDate>
		<dc:creator>David Smeringe</dc:creator>
				<category><![CDATA[Typo3]]></category>
		<category><![CDATA[Typoscript snippets]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[typoscript]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=77</guid>
		<description><![CDATA[Short share of TypoScript know-how.. TYPO3 comes with a handfull different cObjects, such as TEXT, IMAGE etc.. (see the tsref) and then there are the more general cObjects for content rendering; CONTENT and RECORDS. The CONTENTS object focuses on a more widely rendering process, where you find your data with a select property, and a [...]]]></description>
			<content:encoded><![CDATA[<p>Short share of TypoScript know-how..</p>
<p>TYPO3 comes with a handfull different cObjects, such as TEXT, IMAGE etc.. (see the tsref) and then there are the more general cObjects for content rendering; CONTENT and RECORDS. The CONTENTS object focuses on a more widely rendering process, where you find your data with a select property, and a renderObj output.. ..then there is the little bit simpler variant RECORDS that allows you to find and output records from one or more tables in a bit more raw way thant CONTENT allows you to.. anyway.. what I wanted to share today was this difference when outputing a RECORDS object..</p>
<p>Take this TypoScript:</p>
<div class="dean_ch" style="white-space: nowrap;">
<ol>
<li class="li1">
<div class="de1">lib.addressline = RECORDS
</div>
</li>
<li class="li1">
<div class="de1">lib.addressline.source = 47
</div>
</li>
<li class="li1">
<div class="de1">lib.addressline.tables = tt_content</div>
</li>
</ol>
</div>
<p>It outputs a tt_content record with uid 47 like this:</p>
<div class="dean_ch" style="white-space: nowrap;">
<ol>
<li class="li1">
<div class="de1">&lt;div id=&quot;c47&quot;&gt;&lt;p&gt;My content with uid 47&lt;/p&gt;&lt;/div&gt;</div>
</li>
</ol>
</div>
<p>Quite often you might want it a bit more trimmed.. (especially when you map it with typoscript object path in templavoila into a predifend position in a template). Then you can do like this</p>
<div class="dean_ch" style="white-space: nowrap;">
<ol>
<li class="li1">
<div class="de1">lib.addressline = RECORDS
</div>
</li>
<li class="li1">
<div class="de1">lib.addressline.source = 47
</div>
</li>
<li class="li1">
<div class="de1">lib.addressline.tables = tt_content
</div>
</li>
<li class="li1">
<div class="de1">lib.addressline.conf.tt_content = TEXT
</div>
</li>
<li class="li2">
<div class="de2">lib.addressline.conf.tt_content.field = bodytext</div>
</li>
</ol>
</div>
<p>Which renders this instead:</p>
<div class="dean_ch" style="white-space: nowrap;">
<ol>
<li class="li1">
<div class="de1">My content with uid 47</div>
</li>
</ol>
</div>
<p>The basic thing is &#8211; define what you want in your output, and ignore the rest. The same could be done with a logotype image or similar (mapping an image content outputs a lot of extra wrappings by default..)</p>
<p>Another small notice; If you map a ts object from templavoila and get HTML output as text, then edit DS/TO and uncheck &#8220;as content through htmlSpecialChars (HSC)&#8221; for that field&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2010/05/24/render-cobj-records-fully-or-slimmed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate page as PDF from TYPO3 with the webkitpdf extension</title>
		<link>http://people.merea.se/david/2010/02/24/generate-page-as-pdf-from-typo3-with-the-webkitpdf-extension/</link>
		<comments>http://people.merea.se/david/2010/02/24/generate-page-as-pdf-from-typo3-with-the-webkitpdf-extension/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 09:08:45 +0000</pubDate>
		<dc:creator>David Smeringe</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Typo3]]></category>
		<category><![CDATA[Typoscript snippets]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[typoscript]]></category>
		<category><![CDATA[webkitpdf]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=64</guid>
		<description><![CDATA[I&#8217;ve been digging quite a lot into this thing about generating a TYPO3 page as a PDF file. There are a few extensions in TER that does this in various ways. The two best shots I came up with after some fiddeling was PDF Generator 2 (pdf_generator2) WebkitPDF (webkitpdf) There are some others but, afaik [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been digging quite a lot into this thing about generating a TYPO3 page as a PDF file. There are a few extensions in TER that does this in various ways. The two best shots I came up with after some fiddeling was</p>
<ul>
<li>PDF Generator 2 (pdf_generator2)</li>
<li>WebkitPDF (webkitpdf)</li>
</ul>
<p>There are some others but, afaik they lack CSS support.</p>
<p>I started out with the first one, which was really  easy to set up and use, but when I launched it on my production server it throw memory errors, so I started to play with <a title="TYPO3 extension WebkitPDF" href="http://typo3.org/extensions/repository/view/webkitpdf/current/">WebkitPDF</a> instead. This extension is a simple but powerfull wrapping around the Wkhtmltopdf project (<a title="Wkhtmltopdf" href="http://code.google.com/p/wkhtmltopdf/">http://code.google.com/p/wkhtmltopdf/</a>) which basically takes the <a title="Webkit engine" href="http://webkit.org/">Webkit HTML engine</a> and generates a print out from that.</p>
<p>The documentation instructs you put the FE plugin on a new page, and  then add a short TS into you TS Setup. I thought I&#8217;d post my TS setup here for example on how to use it slightly different (mostly since I wanted to have the current page title as filename). Note that I&#8217;m forwarding the PDF link to a ts object &#8211; lib.pdfLink. I&#8217;ve mapped that in an FCE with links in my case. Instead of adding the FE plugin on a separate page I include it on all pages (last row in TS) &#8211; since I need the ouput possibility on most pages anyway.</p>
<div class="dean_ch" style="white-space: nowrap;">
<ol>
<li class="li1">
<div class="de1">plugin.tx_webkitpdf_pi1.scriptParams {
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; print-media-type =
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; margin-top = 0mm
</div>
</li>
<li class="li1">
<div class="de1">}
</div>
</li>
<li class="li2">
<div class="de2">//set current page title as output filename
</div>
</li>
<li class="li1">
<div class="de1">plugin.tx_webkitpdf_pi1.staticFileName = TEXT
</div>
</li>
<li class="li1">
<div class="de1">plugin.tx_webkitpdf_pi1.staticFileName.data = page : title
</div>
</li>
<li class="li1">
<div class="de1">//generate link
</div>
</li>
<li class="li1">
<div class="de1">includeLibs.webkit = EXT:webkitpdf/res/user_webkitpdf.php
</div>
</li>
<li class="li2">
<div class="de2">lib.pdf = USER
</div>
</li>
<li class="li1">
<div class="de1">lib.pdf.userFunc = user_webkitpdf-&gt;user_getPDFLink
</div>
</li>
<li class="li1">
<div class="de1">lib.pdf {
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; //pid =
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; linkText = produktblad i pdf-format
</div>
</li>
<li class="li2">
<div class="de2">}
</div>
</li>
<li class="li1">
<div class="de1">lib.pdfLink &lt; lib.pdf
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">//include the renderer. we do this on the same page, since we want to fetch the correct page title as filename
</div>
</li>
<li class="li1">
<div class="de1">page.100 &lt; plugin.tx_webkitpdf_pi1</div>
</li>
</ol>
</div>
<p><strong>Additional notes:</strong></p>
<p>I just realized that the CSS attribute page-break-after/before is a bit kinky with the pdf converter (actually it&#8217;s the webkit engine, and Firefox has the same problem. I didn&#8217;t bother to check if IE suffers from the same, but I guess it does&#8230;).<br />
If you want to break a page somewhere, then make sure the page break doesn&#8217;t reside in floated elements. This is a bit tricky since a modern HTML template normally consists of floated divs and by that there is no natural position for such page break. This was fairly easy to solve for me in my current case since I really didn&#8217;t need the other columns in my output. Therefore I could first set the divs like:</p>
<div class="dean_ch" style="white-space: nowrap;">
<ol>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>.<span class="re1">.general</span> CSS layout setup..<span class="br0">&#93;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">@media screen {</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">.leftColumn</span> <span class="br0">&#123;</span> <span class="kw1">float</span>: <span class="kw1">left</span>; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="re1">.rightColumn</span> <span class="br0">&#123;</span> <span class="kw1">float</span>: <span class="kw1">right</span>; <span class="br0">&#125;</span> <span class="coMULTI">/*or whatever*/</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">.pagebreak</span> <span class="br0">&#123;</span> <span class="kw1">visibility</span>: <span class="kw2">hidden</span>; <span class="br0">&#125;</span> <span class="coMULTI">/*pagebreak elements should not show up in browser*/</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">@media print {</span></div>
</li>
<li class="li2">
<div class="de2"><span class="re1">.rightColum</span> <span class="br0">&#123;</span> <span class="kw1">visibility</span>: <span class="kw2">hidden</span>; <span class="br0">&#125;</span><span class="coMULTI">/*dont want it in print mode*/</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">.pagebreak</span> <span class="br0">&#123;</span> <span class="kw1">visibility</span>: <span class="kw2">show</span>; <span class="kw1">page-break-after</span>: <span class="kw2">always</span>; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>I made a small FCE in TYPO3 containing a div with class .pagebreak, which I could insert anywhere on a page. It&#8217;s hidden in media screen, but breaks the page when printing. Pritty nifty if you ask me <img src='http://people.merea.se/david/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2010/02/24/generate-page-as-pdf-from-typo3-with-the-webkitpdf-extension/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Finally a decent MessageBox!</title>
		<link>http://people.merea.se/david/2009/12/08/finally-a-decent-messagebox/</link>
		<comments>http://people.merea.se/david/2009/12/08/finally-a-decent-messagebox/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 20:46:05 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JEditorPane]]></category>
		<category><![CDATA[JOptionPane]]></category>
		<category><![CDATA[MessageBox]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=58</guid>
		<description><![CDATA[by Josef from Eden Foundation. There is one frustration every Swing programmer shares: The message box system. The class JOptionPane, that comes with the Java Runtime Environment, is indeed versatile &#8211; but at the same time agonizing because of a very basic problem. Long messages don&#8217;t wrap&#8230; (click on the image to see what I [...]]]></description>
			<content:encoded><![CDATA[<p>by Josef from <a href="http://www.edenfoundation.org/">Eden Foundation</a>.</p>
<p>There is one frustration every Swing programmer shares: The message box system. The class JOptionPane, that comes with the Java Runtime Environment, is indeed versatile &#8211; but at the same time agonizing because of a very basic problem. Long messages don&#8217;t wrap&#8230; (click on the image to see what I mean)</p>
<p><a href="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane1.png"><img class="alignnone size-full wp-image-59" title="How JOptionPane can frustrate" src="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane1.png" alt="a far too wide message dialog" width="500" height="34" /></a></p>
<p>This is the default behavior. There are various workarounds, the best that I&#8217;ve read about being to override the getMaxCharactersPerLineCount() method through a subclass. It&#8217;s a decent solution.</p>
<p>But once you start thinking about a bad class, you start getting wishful. And my wishlist came to include:</p>
<ul>
<li>HTML-formatting for my messages (so some things can be written in bold or italic).</li>
<li>Possibility for the user to select and copy parts of the message, or it&#8217;s entirety, for sending in chats or emails when communicating with support.</li>
<li>Support for really, really long messages, the ones that are as long as License agreement! for the cases where this actually is desirable. If so, the message box should not disappear partly outside the screen. Instead, the message should be scrollable.</li>
</ul>
<p>As I couldn&#8217;t find my dreambox anywhere on the net, I finally took the time to fix my own. I found it especially challenging because of the LayoutManagers that just didn&#8217;t seem to want to do what I want, but in the end, a tip from Stanislav Lapitsky helped me sort it out. He had a quick-and-dirty on how to figure out the height of a JEditorPane if you are locking it&#8217;s width:</p>
<p><a href="http://java-sl.com/tip_text_height_measuring.html">http://java-sl.com/tip_text_height_measuring.html</a></p>
<p>So I&#8217;ve made a wrapper class that I call instead of JOptionPane, that wraps my message strings into a JEditorPane before displaying them. The key part of the code was to embed the text messages in a nice component.</p>
<div class="dean_ch" style="white-space: nowrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp; <span class="kw2">public</span> <span class="kw2">static</span> <span class="kw4">void</span> error<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AComponent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Component</span></a> owner, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> message, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> title<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJOptionPane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JOptionPane</span></a>.<span class="me1">showMessageDialog</span><span class="br0">&#40;</span>owner, wrap<span class="br0">&#40;</span>message, <span class="st0">&quot;Error Encountered:&quot;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; title == <span class="kw2">null</span> ? <span class="st0">&quot;Error&quot;</span> : title, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJOptionPane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JOptionPane</span></a>.<span class="me1">ERROR_MESSAGE</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw2">private</span> <span class="kw2">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJComponent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JComponent</span></a> wrap<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> message, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> shortTitle<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw4">int</span> maxWidth = <span class="nu0">400</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw4">int</span> maxHeight = <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AToolkit+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Toolkit</span></a>.<span class="me1">getDefaultToolkit</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getScreenSize</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">height</span> * <span class="nu0">2</span> / <span class="nu0">3</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> htmlizedMessage = <span class="kw2">null</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>message.<span class="me1">contains</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;p&gt;&quot;</span><span class="br0">&#41;</span> || message.<span class="me1">contains</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;P&gt;&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; || message.<span class="me1">contains</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;br&gt;&quot;</span><span class="br0">&#41;</span> || message.<span class="me1">contains</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;BR&gt;&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; || message.<span class="me1">contains</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;Br&gt;&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; htmlizedMessage = message;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; htmlizedMessage = message.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot;<span class="es0">\n</span>&quot;</span>, <span class="st0">&quot;&lt;BR&gt;&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw4">int</span> h = getContentHeight<span class="br0">&#40;</span>htmlizedMessage, maxWidth<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJPanel+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JPanel</span></a> pnl = <span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJPanel+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JPanel</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; pnl.<span class="me1">setLayout</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ABorderLayout+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">BorderLayout</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJEditorPane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JEditorPane</span></a> text = <span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJEditorPane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JEditorPane</span></a><span class="br0">&#40;</span><span class="st0">&quot;text/html&quot;</span>, htmlizedMessage<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; text.<span class="me1">setBorder</span><span class="br0">&#40;</span><span class="kw2">null</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; text.<span class="me1">setBackground</span><span class="br0">&#40;</span><span class="kw2">null</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; text.<span class="me1">setEditable</span><span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw4">int</span> titleHeight = <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>shortTitle != <span class="kw2">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJLabel+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JLabel</span></a> lblTitle = <span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJLabel+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JLabel</span></a><span class="br0">&#40;</span>shortTitle<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; lblTitle.<span class="me1">setFont</span><span class="br0">&#40;</span>lblTitle.<span class="me1">getFont</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">deriveFont</span><span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lblTitle.<span class="me1">getFont</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getSize</span><span class="br0">&#40;</span><span class="br0">&#41;</span> * <span class="nu0">1</span>.5f<span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; lblTitle.<span class="me1">setBorder</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AEmptyBorder+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">EmptyBorder</span></a><span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">10</span>, <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; lblTitle.<span class="me1">setMaximumSize</span><span class="br0">&#40;</span>lblTitle.<span class="me1">getPreferredSize</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; titleHeight = lblTitle.<span class="me1">getPreferredSize</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">height</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; pnl.<span class="me1">add</span><span class="br0">&#40;</span>lblTitle, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ABorderLayout+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">BorderLayout</span></a>.<span class="me1">PAGE_START</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJScrollPane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JScrollPane</span></a> scroll = <span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AJScrollPane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JScrollPane</span></a><span class="br0">&#40;</span>text<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; scroll.<span class="me1">setBorder</span><span class="br0">&#40;</span><span class="kw2">null</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; scroll.<span class="me1">setMaximumSize</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ADimension+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Dimension</span></a><span class="br0">&#40;</span>maxWidth, maxHeight<span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; scroll.<span class="me1">setPreferredSize</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ADimension+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Dimension</span></a><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AMath+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Math</span></a>.<span class="me1">min</span><span class="br0">&#40;</span>maxWidth, text</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; .<span class="me1">getPreferredSize</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">width</span><span class="br0">&#41;</span>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AMath+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Math</span></a>.<span class="me1">min</span><span class="br0">&#40;</span>maxHeight, getContentHeight<span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; htmlizedMessage, maxWidth<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; pnl.<span class="me1">add</span><span class="br0">&#40;</span>scroll, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ABorderLayout+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">BorderLayout</span></a>.<span class="me1">CENTER</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">return</span> pnl;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>The result looks like this:</p>
<p><a href="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane2.png"><img class="alignnone size-full wp-image-60" title="joptionpane2" src="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane2.png" alt="" width="473" height="407" /></a></p>
<p>&#8230;like this&#8230;</p>
<p><a href="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane3.png"><img class="alignnone size-full wp-image-61" title="joptionpane3" src="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane3.png" alt="" width="473" height="164" /></a></p>
<p>&#8230;or this&#8230;</p>
<p><a href="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane4.png"><img class="alignnone size-full wp-image-62" title="joptionpane4" src="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane4.png" alt="" width="268" height="141" /></a></p>
<p>&#8230;or if the message is really, really long and almost qualifies to be an End User License Agreement (as if any end users ever have the time and legal knowledge to understand those), like this:</p>
<p><a href="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane6.png"><img class="alignnone size-full wp-image-63" title="joptionpane6" src="http://people.merea.se/david/wp-content/uploads/2009/12/joptionpane6.png" alt="" width="473" height="614" /></a></p>
<p>You can find the full source here:</p>
<p><a title="http://www.edenfoundation.org/products/code/MsgDlg.java" href="http://www.edenfoundation.org/products/code/MsgDlg.java">http://www.edenfoundation.org/products/code/MsgDlg.java</a></p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2009/12/08/finally-a-decent-messagebox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>svn over ssh with another port than 22</title>
		<link>http://people.merea.se/david/2009/12/02/svn-over-ssh-with-another-port-than-22/</link>
		<comments>http://people.merea.se/david/2009/12/02/svn-over-ssh-with-another-port-than-22/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 13:04:34 +0000</pubDate>
		<dc:creator>David Smeringe</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[editors/ides/rads]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=57</guid>
		<description><![CDATA[A client of mine has their own SVN repository and they where running ssh over another port than the normal 22. Doing this can be a bit tricky since svn doesn&#8217;t really like the common host:port style when using svn+ssh protocoll (or whatever you call that combo). I&#8217;m using NetBeans (6.7.1) in Ubuntu, so was [...]]]></description>
			<content:encoded><![CDATA[<p>A client of mine has their own SVN repository and they where running ssh over another port than the normal 22. Doing this can be a bit tricky since svn doesn&#8217;t really like the common host:port style when using svn+ssh protocoll (or whatever you call that combo).</p>
<p>I&#8217;m using NetBeans (6.7.1) in Ubuntu, so was eager to get svn working directly from there. Since svn itself doesn&#8217;t like special ports, neither did NB. But after a simple search on &#8220;netbeans svn ssh port number&#8221; I surfed into (not stumbled &#8211; you know &#8211; I surf the web..) a subject in the <a title="Subversion mail archive" href="http://svn.haxx.se/users/archive-2004-09/0574.shtml">subversion mailing list</a> which reviled a simple solution. With ssh you can add some kind of alias for hosts for which you also can define a port etc, then it&#8217;s as simple as one two three to use custom ports with svn+ssh. I&#8217;m taking the liberty to sum the mail archive post here:</p>
<p>create (if not already there) a file in you home folder ~/.ssh/config</p>
<p>Adopt the following to your needs and add them to that file</p>
<p><code><br />
host mysvnhost<br />
Hostname svn.onthehost.tld<br />
Port 80<br />
ForwardAgent no<br />
ForwardX11 no</code></p>
<p>Then just use svn+ssh://mysvnhost/path/to/repo with svn.</p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2009/12/02/svn-over-ssh-with-another-port-than-22/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nominate FLOW3 and TYPO3 for SF community awards</title>
		<link>http://people.merea.se/david/2009/05/19/nominate-flow3-and-typo3-for-sf-community-awards/</link>
		<comments>http://people.merea.se/david/2009/05/19/nominate-flow3-and-typo3-for-sf-community-awards/#comments</comments>
		<pubDate>Tue, 19 May 2009 21:26:12 +0000</pubDate>
		<dc:creator>David Smeringe</dc:creator>
				<category><![CDATA[Typo3]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[award]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=55</guid>
		<description><![CDATA[Show your support for TYPO3 and the upcoming framework FLOW3 and nominate them for a soure forge community award. Hit this image to nominate FLOW3 for &#8220;Best New Project&#8221; and &#8220;Most Likely to Change the Way You Do Everything&#8221; ..or, hit this button to nominate TYPO3 for &#8220;Best Project&#8221; and &#8220;Best Project for the Enterprise&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Show your support for TYPO3 and the upcoming framework FLOW3 and nominate them for a <a title="SF community award" href="http://ir.corp.sourceforge.com/phoenix.zhtml?c=82629&amp;p=irol-newsArticle&amp;ID=1285349">soure forge community award</a>.</p>
<p>Hit this image to nominate FLOW3 for &#8220;Best New Project&#8221; and &#8220;Most Likely to Change the Way You Do Everything&#8221;<br />
<a href="http://sourceforge.net/community/cca09/nominate/?project_name=FLOW3&amp;project_url=http://flow3.typo3.org/"> <img src="http://sourceforge.net/images/cca/cca_nominate.png" border="0" alt="" /></a></p>
<p>..or, hit this button to nominate TYPO3 for &#8220;Best Project&#8221; and &#8220;Best Project for the Enterprise&#8221;<a href="http://sourceforge.net/community/cca09/nominate/?project_name=TYPO3&amp;project_url=http://typo3.org/"><br />
<img src="http://sourceforge.net/images/cca/cca_nominate.png" border="0" alt="" /></a></p>
<p>There aint much more to say about that <img src='http://people.merea.se/david/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2009/05/19/nominate-flow3-and-typo3-for-sf-community-awards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stels-MDB, a pure-java ms-access engine</title>
		<link>http://people.merea.se/david/2009/03/06/stels-mdb-a-pure-java-ms-access-engine/</link>
		<comments>http://people.merea.se/david/2009/03/06/stels-mdb-a-pure-java-ms-access-engine/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 22:37:40 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ado]]></category>
		<category><![CDATA[jackcess]]></category>
		<category><![CDATA[microsoft access]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[stels-mdb]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=49</guid>
		<description><![CDATA[by Josef from Eden Foundation. Having an old MS Access database full of important data can be a real nuisance for cross-platform strategies. Lately, I&#8217;ve been evaluating what approach to use for making a Java desktop app run on Linux. The tricky thing is that the database it interfaces with is in the Microsoft Access [...]]]></description>
			<content:encoded><![CDATA[<p>by Josef from <a href="http://www.edenfoundation.org">Eden Foundation</a>.</p>
<p style="margin-bottom: 0cm;" lang="en-GB">Having an old MS Access database full of important data can be a real nuisance for cross-platform strategies. Lately, I&#8217;ve been evaluating what approach to use for making a Java desktop app run on Linux. The tricky thing is that the database it interfaces with is in the Microsoft Access format, developed at the time when that product was new and cutting edge (yes, that was in version 1.1). Now Access&#8217; engine library ADO won&#8217;t run natively on Linux, so this far, my program has been limited to Windows by making use of the jdbc:odbc-bridge. Today, with Linux desktops quickly gaining importance, this needs to change. Migrating the database to another system like MySQL is a bit of a job, so I searched for less draconian alternatives. I found a promising library, <a href="http://www.csv-jdbc.com/stels_mdb_jdbc.htm">Stels-MDB</a>, that claims to handle Access&#8217; MDB files through native Java code. I downloaded the trial version and gave it a run. Here is a summary of my experiences:</p>
<p style="margin-bottom: 0cm;" lang="en-GB">Switching the <span style="color: #000000;">database driver from jdbc:odbc to Stels-MDB was very easy. It was just to adjust the two connection strings for the driver name and parameters, and voilà. I could run my app. But Stels does not behave identically to Microsoft&#8217;s ODBC driver, so there were some issues to look at.</span></p>
<h3 class="western" lang="en-GB"><span style="color: #000000;">Case sensitivity</span></h3>
<p style="margin-bottom: 0cm;" lang="en-GB"><span style="color: #000000;">Stels-MDB was case sensitive. This meant that a search criteria of “DALLI” used in a query would not detect records containing the value “Dalli”&#8230; A major issue in my eyes. Fortunately, support at <a href="http://www.csv-jdbc.com/">J-Stels Software</a> seems to be very good. Within a day or two, they had recompiled a new version of the driver with an option that removes case-sensitivity. I think SQL searches should be case-insensitive by default, but anyway, their solution was satisfactory as it only required me to make a trivial modification to the JDBC connection string. Great guys!</span></p>
<h3 class="western" lang="en-GB"><span style="color: #000000;">Different SQL syntax</span></h3>
<p style="margin-bottom: 0cm;" lang="en-GB"><span style="color: #000000;">Stels-MDB does not use the same SQL syntax as MS Access. Access, in fact, deviates from the Ansi SQL92 standard, and that&#8217;s a pity, because Access&#8217; unique traits (such as using brackets for quoting fields) adds nothing of value compared to the standard syntax. So Stels could choose two smart ways here, either run the ugly MS syntax for compatibility with legacy Access-based apps, or they could follow the ANSI standard so that the Stels engine can be seamlessly plugged in and out of vendor-independent database apps that don&#8217;t care which underlying database you are using, only that you have a valid JDBC driver. Unfortunately, Stels have opted for a syntax that has some quirks of its own, probably to simplify coding and to keep the style with their other query engines (for CSV files and more). The most basic things work well; quoting fields can be done both through double quotes and backticks. But other ordinary stuff has to be done through special functions. A date value for instance, has to be wrapped into the function “to_date()” to be recognised. So as a developer, you easily risk embedding “Stels-only” sql into your program code. Or, you&#8217;ll have to create your statements through an sql-generating library[link], where you add a subclass to cover Stel&#8217;s peculiarities, which is what I did.</span></p>
<blockquote><p><strong>Syntax of AnsiSQLFormatter:</strong><br />
<code>SELECT "Order ID", "Product ID", "Order Date" FROM "Orders" WHERE "Order Date"='25-Nov-2008 21:24:15'</code><br />
<strong>Syntax of MsaccessSQLFormatter:</strong><br />
<code>SELECT [Order ID], [Product ID], [Order Date] FROM [Orders] WHERE [Order Date]=#25-Nov-2008 21:24:15#</code><br />
<strong>Syntax of StelsSQLFormatter:</strong><br />
<code>SELECT `Order ID`, `Product ID`, `Order Date` FROM `Orders` WHERE `Order Date`=to_date('2008-11-25 21:24:15','yyyy-MM-dd HH:mm:ss')</code></p></blockquote>
<h3 class="western" lang="en-GB"><span style="color: #000000;">Limited SQL features</span></h3>
<p lang="en-GB"><span style="color: #000000;">Another problem I ran into with my queries, was that they were too complex for the subset of features currently supported by Stels. Subqueries, in particular, were not popular, they provided me with messages like this:</span></p>
<blockquote><p><code>java.sql.SQLException: [StelsMDB JDBC driver] Can't parse SQL query: [SQL Engine API] Incorrect syntax near the word 'FROM' (position: 39). See realized SQL specification in the driver documentation. SQL query was: 'SELECT MAX(`Time`) AS `MaxTime` FROM (`Microplots` INNER JOIN `MicroplotInfo` ON `Microplots`.`Plot`=`MicroplotInfo`.`Plot` AND `Microplots`.`Bar`=`MicroplotInfo`.`Bar`) WHERE `Microplots`.`Year`=2008'</code></p></blockquote>
<p style="margin-bottom: 0cm;" lang="en-GB"><span style="color: #000000;">I also missed some common functions like Day(), Month() and Year(). But I could probably easily have added these to Stels myself, because it provides an extension mechanism for custom-made functions.</span></p>
<h3 class="western" lang="en-GB">Jackcess under the hood</h3>
<p style="margin-bottom: 0cm;" lang="en-GB"><span style="color: #000000;">A</span>lthough Stels-MDB is closed-source, it is based on the open-source library <a href="http://jackcess.sourceforge.net/">Jackcess</a>. From what I understand, it basically wraps Jackcess&#8217; non sql-based api into a query engine so you can use it in more normal ways, and, well, run queries on your data. Unfortunately, just as Stels&#8217; query engine is not fully mature, Jackcess&#8217; table handling doesn&#8217;t seem to be yet either. My tables were certainly of the more demanding type – developed over the years through basically every past version of Access, with lots of indexes and foreign keys (referential integrity in MS Access terms). They&#8217;re actually a headache in relationships. <img src='http://people.merea.se/david/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Knowing that the mdb format is cryptic and undocumented (I haven&#8217;t seen MS make any effort to help the developer community access this format, despite the product&#8217;s name&#8230;), I was not surprised that Jackcess had some hiccups. I couldn&#8217;t figure out what the root causes were, or didn&#8217;t spend enough time searching. Some problems were solved by compacting my database and removing obsolete indexes, whilst others wouldn&#8217;t go away. Here&#8217;s one error that stuck:</p>
<blockquote><p><code>[StelsMDB JDBC driver] Error executing sql: [StelsMDB JDBC driver] Can't write 'Seeds' on the disk. Error was: Can't insert a record in the table 'Seeds' [Jackcess] FIXME cannot write indexes of this type yet.</code></p></blockquote>
<p style="margin-bottom: 0cm;" lang="en-GB">I couldn&#8217;t reproduce this problem in a simpler, test database that I built from scratch, but then again, I did not invest the necessary time to make a full inquiry into the matter. But it&#8217;s clear from the FIXME that some features have not been implemented in Jackcess yet.</p>
<h3 class="western" lang="en-GB">Performance</h3>
<p style="margin-bottom: 0cm;" lang="en-GB">A little use of a stopwatch when running my code through Stels gave me a rough comparison of its speed to that of the ADO engine running through the jdbc:odbc layer. Stels is slow. The operations I timed took 6 – 10 times longer with Stels than with Access&#8217; engine. This would have been ok if I was plundering mdb files for data in a series of one-time jobs. But it was too slow for running an ambitious desktop app with high demands on its database back-end.</p>
<h3 class="western" lang="en-GB">Conclusion</h3>
<p style="margin-bottom: 0cm;" lang="en-GB">All in all, Stels-MDB is a brave effort that really had my hopes up. But it isn&#8217;t mature enough for more high-end needs. I am very glad to see that there are people trying to provide solutions to us Java programmers sitting around with important mdb-files and wanting to take full advantage of the potentials of platform independence. I hope that both J-Stel Software and the Jackcess project make steady progress until that dream comes true. Figuring out the mdb format without official documentation from its software house is a formidable challenge&#8230; I also hope that Stels-MDB moves towards standard ANSI sql syntax, and still wonder why MS Access did not do so more than a decade ago. For now, we&#8217;ll have to look for something else here at <a href="http://www.edenfoundation.org">Eden Foundation</a>. Perhaps outright migration to MySQL? We&#8217;ll see&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2009/03/06/stels-mdb-a-pure-java-ms-access-engine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Having a midnight laughter &#8211; rebranded TYPO3 newsthread</title>
		<link>http://people.merea.se/david/2009/02/24/having-a-midnight-laughter/</link>
		<comments>http://people.merea.se/david/2009/02/24/having-a-midnight-laughter/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 06:30:09 +0000</pubDate>
		<dc:creator>David Smeringe</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Typo3]]></category>
		<category><![CDATA[web life]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[gpl]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=54</guid>
		<description><![CDATA[Stuck in work process I launched Thunderbird to skim through the TYPO3 newslists. Apparently I haven&#8217;t checked that one for some time since Thunderbird suggested me to get the latest 500 posts Anyway. There was a really funny, or should I say sad, posting about a Russian rebrand/fork of TYPO3. First he uses a pseudonym [...]]]></description>
			<content:encoded><![CDATA[<p>Stuck in work process I launched Thunderbird to skim through the TYPO3 newslists. Apparently I haven&#8217;t checked that one for some time since Thunderbird suggested me to get the latest 500 posts <img src='http://people.merea.se/david/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Anyway. There was a really funny, or should I say sad, <a title="TYPO3 fork in the newslist" href="http://lists.netfielders.de/pipermail/typo3-english/2009-February/058312.html">posting about a Russian rebrand/fork of TYPO3</a>. First he uses a pseudonym posting news about a fork, then he denies &#8216;borrowing&#8217; TYPO3 code and icons, finaly changing into admiting having to change a few lines of code and some icons.. doh.. &#8211; <a title="Telenok TYPO3 fork" href="http://telenok.org/en/possibilities/#video">check out the site</a> and judge for yourself.</p>
<p>It&#8217;s really sad that people just can&#8217;t see the fundamental philosophy of TYPO3 and the intentions of it&#8217;s original inventor Kasper Skårhöj, releasing his work as GPL:d open source software &#8211; Inspire people to share!</p>
<p>I few days earlier I stumbled upon a swedish fork/overlay work of TYPO3 called <a title="TYPO3 Magenta" href="http://www.typo3magenta.com/om-systemet/">TYPO3 magenta</a>. I got the similar feelings over this one as with that Russian guys fork. Though this is a bit more balancing on the edge. The TYPO3 name is still there but with a suffix. It&#8217;s open stated to be built on TYPO3. From the website (freely translated from Swedish using google..):</p>
<blockquote><p>&#8220;TYPO3 Magenta is a web-based system to manage, organize and publish content on websites. TYPO3 Magenta is a further development of the publishing tool TYPO3. TYPO3 is based on open source which means significantly lower costs compared with commercial counterparts. TYPO3 Magenta has developed with the user in focus. The primary user group is Swedish small-and medium-sized enterprises.&#8221;</p></blockquote>
<p>It&#8217;s sold in a license form with system, hosting and support.</p>
<p>But as I said, I find this solution better &#8211; while not good. I&#8217;m guessing it&#8217;s mostly about a nifty back end skinn. Refactoring TYPO3 this way is like saying &#8220;TYPO3 is good but old school. We make it modern and better with our own version&#8221;. And the main issue is still &#8211; what would a company loose going 100% TYPO3 and sharing improvements rather then trying to be so special?</p>
<p>I will be honest. We started our business with two CMS solutions. CMS made simple and TYPO3. One simple CMS for the simple sites and one advanced for the larger ones. We promoted them as simple and advanced cms. However during time I realized that both we and the solutions themselves would benefit much more exposing TYPO3 as it is, with it&#8217;s huge community and existing brand name rather then trying to make it seem more like our own, and so far it&#8217;s just been true. I think that the more credibility and reward the community gets for it&#8217;s efforts the better TYPO3 will be.</p>
<p>After all, the community is a vital part of TYPO3 together with it&#8217;s open source base. Alongside with that TYPO3 is also a very strong brand and should be promoted and empowered so.</p>
<p>Inspire people to share! &#8211; it will get us so much further</p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2009/02/24/having-a-midnight-laughter/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Typoscript code completion in TYPO3 version 4.3a1</title>
		<link>http://people.merea.se/david/2009/02/10/typoscript-code-completion-in-typo3-version-43a1/</link>
		<comments>http://people.merea.se/david/2009/02/10/typoscript-code-completion-in-typo3-version-43a1/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 13:29:32 +0000</pubDate>
		<dc:creator>David Smeringe</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Typo3]]></category>
		<category><![CDATA[web life]]></category>
		<category><![CDATA[typoscript]]></category>

		<guid isPermaLink="false">http://people.merea.se/david/?p=50</guid>
		<description><![CDATA[Finally I took a quick test of TYPO3 version 4.3 alpha 1. Read the link for a detailed release info. However I&#8217;d like to highlight one update a bit extra for you. The TypoScript editing extension that made life prittier highlightning and helping out with the indentation for the TS code when editing has now [...]]]></description>
			<content:encoded><![CDATA[<p>Finally I took a quick test of <a title="Release notes for TYPO3 4.3a1" href="http://news.typo3.org/news/article/typo3-43-alpha-1/">TYPO3 version 4.3 alpha 1</a>. Read the link for a detailed release info. However I&#8217;d like to highlight one update a bit extra for you. The TypoScript editing extension that made life prittier highlightning and helping out with the indentation for the TS code when editing has now got itself a usefull and very nicely implemented code completion function. Look at the image below.</p>
<p>It&#8217;s perfect for people like me that just cant get all those object and attribute names to stick in memory.</p>
<p><a href="http://people.merea.se/david/wp-content/uploads/2009/02/t3v43a_ts_codecompletion.png"><img class="alignnone size-medium wp-image-51" title="code completion in TYPO3 v 4.3" src="http://people.merea.se/david/wp-content/uploads/2009/02/t3v43a_ts_codecompletion-240x300.png" alt="Code completion in TYPO3 v 4.3" width="240" height="300" /></a></p>
<p>Now, I&#8217;m having a hard time waiting for next alpha or maybe beta so I can test the new front end editing fuzz which at least seems awsome!. <a title="Jeff Segars blogg about the new front end editing in TYPO3 v 4.3" href="http://jeffsegars.com/2008/10/19/frontend-editing-for-typo3-43/">Check it out at Jeff Segars blogg</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://people.merea.se/david/2009/02/10/typoscript-code-completion-in-typo3-version-43a1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

