<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">

<channel>
	<title>Delirious Development Dialysis</title>
	
	<link>http://leefw.wordpress.com</link>
	<description>The ramblings of a software development consultant</description>
	<lastBuildDate>Sat, 27 Dec 2008 09:51:49 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/ce207b3f043e7c464ac083c7c395d8df?s=96&amp;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Delirious Development Dialysis</title>
		<link>http://leefw.wordpress.com</link>
	</image>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/DeliriousDevelopmentDialysis" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Javascript mouseover effects on table rows using jQuery</title>
		<link>http://leefw.wordpress.com/2008/12/27/javascript-mouseover-effects-on-table-rows-using-jquery/</link>
		<comments>http://leefw.wordpress.com/2008/12/27/javascript-mouseover-effects-on-table-rows-using-jquery/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 09:51:49 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[HTML tables]]></category>
		<category><![CDATA[Mouseover effects]]></category>
		<category><![CDATA[Open source software]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=54</guid>
		<description><![CDATA[Introduction
Lately I&#8217;ve been getting into jQuery. On first sight the syntax can look a bit strange, but I get it now &#8211; for the most part, that is. On a related note, for a while now I&#8217;ve been &#8220;wondering&#8221; about how you do the mouseover effects you sometimes see on table rows. I&#8217;m talking about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=54&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Introduction</strong><br />
Lately I&#8217;ve been getting into jQuery. On first sight the syntax can look a bit strange, but I get it now &#8211; for the most part, that is. On a related note, for a while now I&#8217;ve been &#8220;wondering&#8221; about how you do the mouseover effects you sometimes see on table rows. I&#8217;m talking about the effects where you move your mouse over a cell in table row and then the full row&#8217;s background colour changes to give the effect of highlighting the full row for selection. I really haven&#8217;t given it much thought, but I recently came across some code in a company application that got me thinking about it again so I decided time was right for to take a closer look.</p>
<p><strong>Code</strong><br />
Originally, before the use of jQuery, your markup would look something like this:</p>
<pre name="code" class="html">

&lt;html&gt;
&lt;body&gt;
   &lt;table&gt;
      &lt;tbody&gt;
         &lt;tr onclick=&quot;javascript:alert(&#039;info about row 1 here&#039;)&quot;
             onmouseover=&quot;this.style.backgroundColor=&#039;#BBA57A&#039;&quot;
             onmouseout=&quot;this.style.backgroundColor=&#039;#FFFFFF&#039;&quot;
             style=&quot;cursor:pointer;&gt;
            &lt;td&gt;some table cell content here&lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr onclick=&quot;javascript:alert(&#039;info about row 2 here&#039;)&quot;
             onmouseover=&quot;this.style.backgroundColor=&#039;#BBA57A&#039;&quot;
             onmouseout=&quot;this.style.backgroundColor=&#039;#FFFFFF&#039;&quot;
             style=&quot;cursor:pointer;&quot;&gt;
            &lt;td&gt;some table cell content here&lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr ...&gt;
            ...
            more rows and cells containing more of the same here
            ...
         &lt;/tr&gt;
      &lt;/tbody&gt;
   &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>You&#8217;ll notice the obtrusive JavaScript event handling code on lines 5 to 8 and 11 to 14. This code repeats itself on every row of the table which is just annoying. The only difference between the code attached to the individual table rows is the obvious onclick event handler (here a simple alert message) which should simulate some functionality specific to a click on that unique row. As a whole this use of Javascript makes the markup somewhat more difficult to read and generally untidy. Of course it is usually the backend server code creating this kind of code in a for-loop or similar &#8211; nobody writes this stuff by hand, but that&#8217;s not the point.<br />
So how can you use jQuery to replace this mess? The following shows a first attempt of a replacement using jQuery.</p>
<pre name="code" class="html">

&lt;html&gt;
&lt;head&gt;
   &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
   &lt;script type=&quot;text/javascript&quot;&gt;
      $(function() {
         $(&#039;table tbody tr&#039;).mouseover(function() {
            $(this).addClass(&#039;selectedRow&#039;);
         }).mouseout(function() {
            $(this).removeClass(&#039;selectedRow&#039;);
         }).click(function() {
            alert($(&#039;td:first&#039;, this).text());
         });
      });
   &lt;/script&gt;
   &lt;style&gt;
      .selectedRow {
         background-color: blue;
         cursor: pointer;
      }
   &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
   &lt;table border=&quot;1&quot;&gt;
      &lt;thead&gt;
         &lt;tr&gt;
            &lt;th&gt;First column&lt;/th&gt;
            &lt;th&gt;Second column&lt;/th&gt;
            &lt;th&gt;Third column&lt;/th&gt;
         &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
         &lt;tr&gt;
            &lt;td&gt;This&lt;/td&gt;
            &lt;td&gt;That&lt;/td&gt;
            &lt;td&gt;The other&lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr&gt;
            &lt;td&gt;Second&lt;/td&gt;
            &lt;td&gt;line&lt;/td&gt;
            &lt;td&gt;here&lt;/td&gt;
         &lt;/tr&gt;
      &lt;/tbody&gt;
   &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>So &#8211; I guess a brief explanation is in order. You&#8217;ll of course need the jQuery JavaScript library available in the correct location as referred to in the script tag (line 3). Apart from that, all the custom JavaScript jQuery code is happening in the script tag at the top of the page (lines 4 to 14). We are first creating a jQuery selector to select all tr tags inside a tbody tag which itself must reside within a table tag (line 6). When these tag elements are found we bind the &#8216;mouseover&#8217;, &#8216;mouseout&#8217; and &#8216;click&#8217; events to the rows (lines 6,8 and 10 respectively). The mouseover and mouseout event just add or remove a CSS class named &#8217;selectedRow&#8217; dynamically to or from the row which adds the effect. The CSS class itself is defined at the top of the page within the style tags just after the script. The actual mouse click functionality just returns the value of the first cell in the selected row, just as an example. This could be a unique row id or similar.<br />
The jQuery selector makes sure the mouse click event is set to only work on tr tags that are present from within a tbody tag to avoid adding the effect to the thead header row. </p>
<p>So that&#8217;s all there is to it really &#8211; not too bad. It was a lot simpler than I first imagined and the jQuery code makes things nice and tidy once you get used to the chained decorator pattern syntax.</p>
 Tagged: HTML tables, JavaScript, Mouseover effects, Open source software <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=54&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/12/27/javascript-mouseover-effects-on-table-rows-using-jquery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>
	</item>
		<item>
		<title>Long time, no see?</title>
		<link>http://leefw.wordpress.com/2008/12/24/long-time-no-see/</link>
		<comments>http://leefw.wordpress.com/2008/12/24/long-time-no-see/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 12:19:31 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[General rant]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Liferay]]></category>
		<category><![CDATA[Portlets]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[IBM WCM]]></category>
		<category><![CDATA[JSR-286]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Open source software]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=46</guid>
		<description><![CDATA[Introduction
So what gives? It&#8217;s been seven months since my last posting. Have I really been all that busy that I couldn&#8217;t find the time to create a new posting?
Well, I guess it&#8217;s partly true. I have been busy, but I&#8217;m sure I could have found the time if the motivation was there. Rest assured that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=46&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Introduction</strong><br />
So what gives? It&#8217;s been seven months since my last posting. Have I really been all that busy that I couldn&#8217;t find the time to create a new posting?</p>
<p>Well, I guess it&#8217;s partly true. I have been busy, but I&#8217;m sure I could have found the time if the motivation was there. Rest assured that my guilty conscience has been forever weighing me down for not following up my &#8216;promising introduction&#8217; to the bloging world. However, I think it&#8217;s fair to say that the main reason for my absence can be best described as &#8220;self inflicted censorship&#8221; &#8211; if we can call it that. I&#8217;ve been a little uncertain of what to write that would be of interest to others, and also try to avoid pissing off the people I work with. I&#8217;ve also been a little rundown at work at times so my eagerness to share my views has not been at it&#8217;s peek. Now, a few months the wiser, I guess I&#8217;ve gained a little perspective so the picture has become a clearer.</p>
<p><strong>What&#8217;s been going on?</strong><br />
A lot has happened during the past seven months. The department I am working for at work has grown substantially from just two people (my boss and I) to around eleven and I guess I&#8217;ve been a part of that. My new boss sets targets and does her very best to reach them. Although she is a few years my junior, I&#8217;ve learned a lot from her, and for the most part I think she is great to work with. I like her positive attitude and have found it contagious at times. I also take a personal interest in management, good management that is, so I do a little reading on the subject on the side, and have been able to share my views with her on occasion. She is keen to keep everyone in the department happy and find us work that we find interesting. It&#8217;s truly great to have a boss that cares and can relate to what I&#8217;m doing. With her coming from a Java development background herself helps tremendously and means there has been a lot more focus on Java and Open source technology than earlier. As you may have guessed, that suits me fine, and I feel I have grown a lot, both on a personal and professional level. Compared to where I was a year ago, things are looking good, although the business markets have taken a turn for the worst during the last few months, so who knows what may happen in future? Fingers crossed.</p>
<p><strong>Focus change</strong><br />
Everyone at my present workplace seems to think I live and breath for Java, but I&#8217;ve noticed that my main interest actually lies more towards web development based on open source technology than Java development. I haven&#8217;t really been following the Java scene actively for quite some time and feel I have fallen behind on the latest API&#8217;s and frameworks. At present Java just happens to be the vehicle I use to extract content for web development. My main goal is usually the end result which usually portrays itself in the form of a web application or customer website. </p>
<p>For most of my career I&#8217;ve been working behind the scenes on the backend systems, but for a long time I&#8217;ve had an interest in web frontend technology. However, it seems that web frontend technology still isn&#8217;t taken all that seriously. HTML, CSS and JavaScript are considered technologies that you are expected to pick up as you go along and not really use a lot of time learning. To a certain extent this is true, but I still can&#8217;t help but find it odd that this is the case in 2008 considering just how much web development goes on in the world today. Your traditional senior programmer speaks in the language of design patterns and architecture, and although I can appreciate good backend architecture, I sometimes find the frontend a bit more fulfilling and challenging. Maybe because it&#8217;s easier to explain to to family and friends what I do for a living? Easier for them to visualize, I guess. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So, needless to say and according to my current interests, the last few months have been dedicated to working on web applications, creating company web sites and the like. At times it&#8217;s been great fun and I&#8217;ve learned a lot, especially about CSS which was something I always seemed to down prioritize and found &#8220;hard&#8221; to get comfortable with. I&#8217;m not sure what I really mean when I say &#8220;hard&#8221;, but for some reason I never really got in to it &#8211; mostly down to the fact that I had read a lot about it, but never really practiced it. I could never remember all the property names and their values, which is kind of half the point, I guess. This has now changed and within the last half year I have become more fluent in CSS and have grown to like it, and appreciated it&#8217;s power. I&#8217;ve also noticed just how bad it can get when more junior developers mess it all up, or don&#8217;t think in advance. The resulting CSS becomes a nightmare. I feel there is a great deal to be done on this frontier, but a lot of senior developers don&#8217;t want to touch it. Not challenging enough, I presume, which is a shame.</p>
<p><strong>Projects</strong><br />
Just before the summer I got assigned to a project as a backend programmer. We were given the task of creating a company web site for a larger Norwegian gas company. The customer&#8217;s technology of choice was IBM&#8217;s Web Content Management (WCM). WCM, if you are unfamiliar, is a Java portlet based product that sits on top of WebSphere Portal Server. Although I had worked with both WebSphere Portal Server and WebSphere Application Server in the past, this was a different ball game.<br />
We were two developers assigned to the project and luckily for me the other developer was fluent in CSS and other frontend technologies. He was a couple of years my junior, but I learned a lot from him. We both struggled with WCM at first and had to overcome a relatively high learning curve trying to find a good structure and extract our content before styling, but the end result was very good. The site looks beautiful today and the customer is happy. This was a relatively new experience for me in many ways. I don&#8217;t mean to offend anyone, but this was one of the first projects I was a part of where I actually felt I learned something of interest from someone else. Looking back, it was a great experience to follow a project from beginning to end and be part of the entire process. I&#8217;m not saying everything went smooth and we had our problems along the way, but in retrospect we did a good job. It&#8217;s just a shame the the technology, WCM in this case, is not much in use in my neck of the woods. However, HTML, CSS and jQuery parts, on the other hand, are. I also learned a bit about a few other web related things, like browser compatibility and became somewhat bemused that the tools for frontend technology development are still relatively poor. Was there really life before Firefox and Firebug?</p>
<p>The second project I was part of was to help refactor and expand a Java web application that is part of a company service desk for employee support. Although the technology in question was once again something odd, SAP EP using Java and SAP HTMLB in this case, I was happy to be able to introduce jQuery as a frontend alternative to help create some good looking stuff on the frontend. I was also happy to refactor some of the code, which was in dire need of some attention. Parts of it still is, I&#8217;m afraid. Old style JSP code with scriptlets etc. really do suck. </p>
<p>The third and final project I&#8217;ve been working on this autumn (and now nearly completed) is based on the open source Java portal, Liferay. Liferay has been a kind of baby of mine for the last 12 to 15 months. A colleague introduced me to it and ever since it seems I have been associated with the product, or at least that&#8217;s what everyone thinks at the company. In this project we created a web site for a customer to help their end users recycle materials and goods. We created a great deal of Java portlets in the process using Java, JSP and JSTL. We had to use a few of the new features of JSR-286 to get things working. In this project I also introduced jQuery into my frontend code which most certainly made some code a lot easier to both read and maintain. My CSS skills came in handy as well.</p>
<p><strong>Conclusion</strong><br />
So there you have it and that&#8217;s it for now. A brief summary of what I&#8217;ve been up to for the past few months. Hopefully, I&#8217;ll have more for you soon, but don&#8217;t be surprised if it has more to with web development than backend programming, since that&#8217;s where my interests are at present. I&#8217;ve been reading a lot lately so expect a few book reviews soon. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Take care!</p>
 Tagged: IBM WCM, Java, JSR-286, Management, Open source software, Web development <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=46&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/12/24/long-time-no-see/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating tables in MediaWiki</title>
		<link>http://leefw.wordpress.com/2008/05/25/creating-tables-in-mediawiki/</link>
		<comments>http://leefw.wordpress.com/2008/05/25/creating-tables-in-mediawiki/#comments</comments>
		<pubDate>Sun, 25 May 2008 20:14:48 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[Mediawiki tables]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=33</guid>
		<description><![CDATA[Introduction
Tables are another useful feature of MediaWiki and have a simpler, if not a bit more clumsy, syntax than their html equivalent. Personally I think this syntax is a bit strange and think it could have been made easier to use. 
Creating tables
You define a table in MediaWiki by using a combination of the curly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=33&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h4>Introduction</h4>
<p>Tables are another useful feature of MediaWiki and have a simpler, if not a bit more clumsy, syntax than their html equivalent. Personally I think this syntax is a bit strange and think it could have been made easier to use. </p>
<h4>Creating tables</h4>
<p>You define a table in MediaWiki by using a combination of the curly brace and a pipe character, so that is the combination &#8220;{|&#8221; to start the table and &#8220;|}&#8221; to end it. The tables contents lie between these two &#8220;tags&#8221; similar to the html &lt;table&gt; and &lt;/table&gt; tags familiar from html. However, it is important to note that both the starting and ending brace/pipe combination must reside on their own separate line and no other tags apart from any table attributes may exist on those two lines.</p>
<h4>Creating columns</h4>
<p>You start a new column by simply using a single pipe character at the beginning of a new line. You must also remember to do this for the first row after the table definition. You can also define many columns on a single line, but then you will have to use a double pipe character sequence for that. The example later will clear things up.</p>
<h4>Creating rows</h4>
<p>You start a new table row using a combination of the pipe and dash characters &#8220;|-&#8221; at the beginning of a new line. As in html, each row must have the same amount of columns as the last and any empty column cells must be populated with a html space entity tag.</p>
<p>So all of this may sound a bit technical. So lets look at a simple table example using a few of the things we&#8217;ve just mentioned:</p>
<blockquote><p>{|<br />
| 1A<br />
| 1B<br />
| 1C<br />
|-<br />
| 2A<br />
| &amp; nbsp;<br />
| 2C<br />
|-<br />
| 3A || 3B || 3C<br />
|}</p></blockquote>
<p>would give the following output:</p>
<p><a title="Simple wiki table" rel="attachment wp-att-34" href="http://leefw.wordpress.com/2008/05/25/creating-tables-in-mediawiki/simple-wiki-table/"><img src="http://leefw.files.wordpress.com/2008/03/wiki-simple-table.jpg" alt="Simple wiki table" /></a></p>
<p>Pretty basic stuff, but the syntax can get a bit untidy. Unfortunately it actually gets worse.</p>
<h4>Adding a column header</h4>
<p>By replacing the pipe character with an exclamation you define a table column header, so:</p>
<blockquote><p>{|<br />
! col1<br />
! col2<br />
! col3<br />
|-<br />
| 1A<br />
| 1B<br />
| 1C<br />
|-<br />
| 2A<br />
| &amp; nbsp;<br />
| 2C<br />
|-<br />
| 3A || 3B || 3C<br />
|}</p></blockquote>
<p>gives something that should like:</p>
<p><a title="Wiki table with simple column header" rel="attachment wp-att-35" href="http://leefw.wordpress.com/2008/05/25/creating-tables-in-mediawiki/wiki-table-with-simple-column-header/"><img src="http://leefw.files.wordpress.com/2008/03/wiki-simple-columnheader.jpg" alt="Wiki table with simple column header" /></a></p>
<p>Notice the bold header at the top of each column.</p>
<h4>Adding a row header</h4>
<p>You can also do something similar for rows, so</p>
<blockquote><p>{|<br />
! &#8212;<br />
! col1<br />
! col2<br />
! col3<br />
|-<br />
! row1<br />
| 1A<br />
| 1B<br />
| 1C<br />
|-<br />
! row2<br />
| 2A<br />
| &amp; nbsp;<br />
| 2C<br />
|-<br />
! row3<br />
| 3A<br />
| 3B<br />
| 3C<br />
|}</p></blockquote>
<p>gives a row header on each row, like</p>
<p><a title="Wiki table with simple column and row header" rel="attachment wp-att-36" href="http://leefw.wordpress.com/2008/05/25/creating-tables-in-mediawiki/wiki-table-with-simple-column-and-row-header/"><img src="http://leefw.files.wordpress.com/2008/03/wiki-simple-column-row-header.jpg" alt="Wiki table with simple column and row header" /></a></p>
<h4>Adding table attributes</h4>
<p>The table syntax supports most table parameters familiar from html tables using a style tag. However, this is a bit of a mess as we will see in the next example. I am not a fan of mixing CSS styles with wiki syntax, but if you want them to look good then that&#8217;s what you have to do. Since these are not html tags then you can&#8217;t use a general stylesheet, but must style each element using the style attribute.</p>
<blockquote><p>{| style=&#8221;background:red;color:black;width:50%;&#8221; border=&#8221;1&#8243; cellpadding=&#8221;5&#8243; cellspacing=&#8221;0&#8243; |<br />
! &#8212;<br />
! col1<br />
! col2<br />
! col3<br />
|- style=&#8221;background:white; color:blue&#8221;<br />
! row1<br />
| 1A<br />
| 1B<br />
| 1C<br />
|- style=&#8221;background:white; color: blue&#8221;<br />
! row2<br />
| 2A<br />
| &amp; nbsp;<br />
| 2C<br />
|- style=&#8221;background:white; color:blue&#8221;<br />
! row3<br />
| 3A<br />
| 3B<br />
| 3C<br />
|}</p></blockquote>
<p>Gives the following output:</p>
<p><a title="Wiki table with styling" rel="attachment wp-att-37" href="http://leefw.wordpress.com/2008/05/25/creating-tables-in-mediawiki/wiki-table-with-styling/"><img src="http://leefw.files.wordpress.com/2008/03/wiki-simple-table-style.jpg" alt="Wiki table with styling" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/leefw.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/leefw.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=33&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/05/25/creating-tables-in-mediawiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/wiki-simple-table.jpg" medium="image">
			<media:title type="html">Simple wiki table</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/wiki-simple-columnheader.jpg" medium="image">
			<media:title type="html">Wiki table with simple column header</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/wiki-simple-column-row-header.jpg" medium="image">
			<media:title type="html">Wiki table with simple column and row header</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/wiki-simple-table-style.jpg" medium="image">
			<media:title type="html">Wiki table with styling</media:title>
		</media:content>
	</item>
		<item>
		<title>My meeting with a celebrity</title>
		<link>http://leefw.wordpress.com/2008/03/30/my-meeting-with-a-celebrity/</link>
		<comments>http://leefw.wordpress.com/2008/03/30/my-meeting-with-a-celebrity/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 19:32:01 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Portlets]]></category>
		<category><![CDATA[IBM Websphere Portal Server 6.1]]></category>
		<category><![CDATA[JSR-168]]></category>
		<category><![CDATA[JSR-286]]></category>
		<category><![CDATA[portlets]]></category>
		<category><![CDATA[Portlets and Apache Portals]]></category>
		<category><![CDATA[Stefan Hepper]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=38</guid>
		<description><![CDATA[Last week, a colleage and myself were fortunate to participate at a one day GSE  Nordic WebSphere User Group conference held at Bouvet&#8217;s offices in Oslo. One of the conference speakers was Stefan Hepper from IBM Germany. Stefan works as the  WebSphere Portal Programming Model Architect and leads the programming model part of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=38&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Last week, a colleage and myself were fortunate to participate at a one day <a href="http://www.gse-nordic.org/Working%20Groups/WebSphere/events/" target="_blank">GSE  Nordic WebSphere User Group</a> conference held at Bouvet&#8217;s offices in Oslo. One of the conference speakers was Stefan Hepper from IBM Germany. Stefan works as the  <em>WebSphere Portal Programming Model Architect</em> and leads the programming model part of IBM&#8217;s flagship portal product, IBM WebSphere Portal  Server. However, more importantly (at least to me), he had the honorable task of working as specification lead for the  <a href="http://www.jcp.org/en/jsr/detail?id=168" target="_blank">JSR-168 Portlet version 1.0 specification</a>, and is currently working as specification lead on the new  <a href="http://www.jcp.org/en/jsr/detail?id=286" target="_blank">JSR-286  Portlet version 2.0 specification.</a> Naturally, Stefan spoke primarily of the new features in the upcoming WebSphere Portal Server version 6.1 product in the context of JSR-286, but the two aforementioned portlet specifications influence every serious Java based portal server like IBM&#8217;s WebSphere Portal Server, SAP Enterprise Portal, Oracle Portal Server, Liferay and JBoss Portal Server, just to name but a few.</p>
<p><a title="Stefan Hepper and the site author" rel="attachment wp-att-39" href="http://leefw.wordpress.com/2008/03/30/my-meeting-with-a-celebrity/stefan-hepper-and-the-site-author/"><img src="http://leefw.files.wordpress.com/2008/03/photo3.thumbnail.jpg" alt="Stefan Hepper and the site author" hspace="5" align="left" /></a>However, although Stefan answered a lot of question during his talks, oddly enough, for me the highlight was sharing a taxi and a 20 minute train ride from the conference back to Gardermoen airport (main Oslo airport) where we loosely discussed portlets and portals in depth, and Stefan willingly shared his knowledge with us indiscriminately. It goes without saying that this guy really knows his &#8220;stuff&#8221;, but it was also quite fascinating to hear how a <a href="http://www.jcp.org/" target="_blank">Java Community Process</a> expert group works in practice. I admit that I knew little of how the JCP works behind the scenes before our conversation, but I got the impression that Stefan is responsible for a whole lot of the final specification work and seems to carry a &#8220;heavy burden&#8221; by leading the group. However, you won&#8217;t find a nicer guy willing to help you with anything related to Java portlet/portal development should you need to call upon him for help.</p>
<p>As you may know, the JSR-168 specification is implemented and supported on almost every Java based portal  server. The JSR-286 specification is expected to be finished in april 2008 and introduces quite a lot of new features. If memory serves me correctly, Stefan mentioned that the specifcation API has grown by over 100% since version 1.0. IBM WebSphere Portal Server 6.1 is scheduled for release sometime in the second quarter of 2008 and will support portlets complying with either of the portlet standards. It is also possible to communicate between portlets developed on either standard something that was not possible before between the proprietary IBM Portal API and the JSR-168 implementation.</p>
<p>I also mentioned to Stefan that I thought it was odd that there were so few JSR-168 or porlet related books available on the market. It just so happens that he has co-written and almost finalized a Manning book that was never published. It happens to be available for free download from the <a href="http://www.manning.com/hepper/" target="_blank">Manning web site</a>, but requires registration (free). The book is titled &#8220;<em>Portlets and Apache Portals</em>&#8221; and it looks good. It also seems to cover WSRP (Web Services for Remote Portlets, version 1.0) and also portlet development using JSR-127 (Java Server Faces).</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/leefw.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/leefw.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=38&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/03/30/my-meeting-with-a-celebrity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/photo3.thumbnail.jpg" medium="image">
			<media:title type="html">Stefan Hepper and the site author</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding lists in MediaWiki</title>
		<link>http://leefw.wordpress.com/2008/03/12/adding-lists-in-mediawiki/</link>
		<comments>http://leefw.wordpress.com/2008/03/12/adding-lists-in-mediawiki/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 17:18:05 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[Definition list]]></category>
		<category><![CDATA[Ordered list]]></category>
		<category><![CDATA[Unordered list]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=26</guid>
		<description><![CDATA[Introduction
This is a follow up article to the ongoing postings regarding adding content in MediaWiki. The plan is to add more short posting about adding content to MediaWiki. This posting talks about lists.
You can create 3 types of lists in MediaWiki:

Unordered lists
Ordered lists
Definition lists

Unordered lists
Unordered lists are just the normal bullet lists probably familiar from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=26&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h4>Introduction</h4>
<p>This is a follow up article to the ongoing postings regarding adding content in MediaWiki. The plan is to add more short posting about adding content to MediaWiki. This posting talks about lists.</p>
<p>You can create 3 types of lists in MediaWiki:</p>
<ul>
<li>Unordered lists</li>
<li>Ordered lists</li>
<li>Definition lists</li>
</ul>
<h4>Unordered lists</h4>
<p>Unordered lists are just the normal bullet lists probably familiar from word processing software or plain HTML. You create a new list element by using an asterisk (*) at the beginning of each line. It is important that the asterisk is at the beginning of the line for it to work. You can have no whitespace between the line start and the asterisk. The number of asterisk characters indicates the list element level, so for example:</p>
<blockquote><p>* First element<br />
** First subelelement<br />
*** First sub-subelement<br />
** Second subelement<br />
* Second element<br />
etc.</p></blockquote>
<p>Will create an unordered list that gives the following output:</p>
<p><a href="http://leefw.wordpress.com/2008/03/12/adding-lists-in-mediawiki/unordered-list-example-in-mediawiki/" rel="attachment wp-att-27" title="Unordered list example in MediaWiki"><img src="http://leefw.files.wordpress.com/2008/03/wiki-unordered-list.jpg" alt="Unordered list example in MediaWiki" /></a></p>
<h4>Ordered lists</h4>
<p>Ordered lists are pretty much more of the same. However, you use the hash character (#) instead of the asterisk. To restart the automatic numbering you must  insert a blank line within the list, so</p>
<blockquote><p># First element<br />
## First subelement<br />
### First sub-subelement<br />
## Second subelement<br />
# Second element</p></blockquote>
<p>Gives the following output</p>
<p><a href="http://leefw.wordpress.com/2008/03/12/adding-lists-in-mediawiki/an-example-of-an-ordered-list/" rel="attachment wp-att-28" title="An example of an ordered list"><img src="http://leefw.files.wordpress.com/2008/03/wiki-ordered-list.jpg" alt="An example of an ordered list" /></a></p>
<h4>Combining unordered and ordered lists</h4>
<p>It is also possible to combine the two list types to make any kind of crazy combination. Check out the following example:</p>
<blockquote><p># element 1<br />
# element 2<br />
#* element 3<br />
#* element 4<br />
#** element 5<br />
#** element 6<br />
## element 7<br />
##* element 8<br />
##** element 9<br />
# element 10</p></blockquote>
<p>Which gives this result:</p>
<p><a href="http://leefw.wordpress.com/2008/03/12/adding-lists-in-mediawiki/combining-unordered-and-ordered-list-elements-in-a-crazy-partnership/" rel="attachment wp-att-31" title="Combining unordered and ordered list elements in a crazy partnership"><img src="http://leefw.files.wordpress.com/2008/03/wiki-unordered-ordered-list1.jpg" alt="Combining unordered and ordered list elements in a crazy partnership" /></a></p>
<h4>Definition list</h4>
<p>A definition list is a list type you expect to find in a dictionary or a glossary. The syntax is a bit different from it&#8217;s list siblings:</p>
<blockquote><p>;First definition : definition text<br />
;Second definition : definition text</p></blockquote>
<p>So here we have two definition keys with their matching text definition.  The output looks like this:</p>
<p><a href="http://leefw.wordpress.com/2008/03/12/adding-lists-in-mediawiki/example-of-definition-list-output/" rel="attachment wp-att-29" title="Example of definition list output"><img src="http://leefw.files.wordpress.com/2008/03/wiki-definition-list.jpg" alt="Example of definition list output" /></a></p>
<p>The definition text itself can expand over multiple lines and can also contain semicolon (;) characters as part of the text as long as the semicolon is not at the beginning of a new line. Like the other list types it is very important not to type any whitespace between the semicolon and the beginning of the new line. The colon character, however, defining the definition list, can be placed just about anywhere you like.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/leefw.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/leefw.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=26&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/03/12/adding-lists-in-mediawiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/wiki-unordered-list.jpg" medium="image">
			<media:title type="html">Unordered list example in MediaWiki</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/wiki-ordered-list.jpg" medium="image">
			<media:title type="html">An example of an ordered list</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/wiki-unordered-ordered-list1.jpg" medium="image">
			<media:title type="html">Combining unordered and ordered list elements in a crazy partnership</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/wiki-definition-list.jpg" medium="image">
			<media:title type="html">Example of definition list output</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing the logo of your MediaWiki site</title>
		<link>http://leefw.wordpress.com/2008/03/11/changing-the-logo-of-your-mediawiki-site/</link>
		<comments>http://leefw.wordpress.com/2008/03/11/changing-the-logo-of-your-mediawiki-site/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 18:47:23 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[LocalSettings]]></category>
		<category><![CDATA[logo]]></category>
		<category><![CDATA[site image]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=16</guid>
		<description><![CDATA[Introduction
Yes, it looks ugly. It looks a bit better now than it used to in earlier versions of the MediaWiki distribution, but still&#8230; it&#8217;s just begging to be replaced and you would think it would be just a little more straightforward since it is one of the first things you notice on the wiki site. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=16&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h4>Introduction</h4>
<p>Yes, it looks ugly. It looks a bit better now than it used to in earlier versions of the MediaWiki distribution, but still&#8230; it&#8217;s just begging to be replaced and you would think it would be just a little more straightforward since it is one of the first things you notice on the wiki site. Yes, that default MediaWiki logo just has to go!</p>
<h4>Changing the logo</h4>
<p>It&#8217;s not that difficult, but you will need access to the web server&#8217;s file system. Start off by getting hold of a replacement image, preferably something about the same size and shape as the original.</p>
<p>The default logo is of type png and size 135 x 135 pixels. Locate your <i>LocalSettings.php</i> file in your wiki directory. The wiki directory is probably the <i>wiki</i>/ directory in the document root of your web server. When you have found the file then open it for edit.</p>
<p>Search the file for the string <i>$wgScriptPath</i>. It should refer to the URL base path to the directory meaning is is most likely set to the value <i>&#8220;/wiki&#8221;</i> or similar. At the end of the file add the following two lines,</p>
<blockquote><p> $wgStylePath = &#8220;$wgScriptPath/skins&#8221;;<br />
$wgLogo = &#8220;$wgStylePath/common/images/&lt;image&gt;&#8221;;</p></blockquote>
<p>where you replace the text <i>&lt;image&gt;</i> with the filename of your replacement logo image. Then place your new logo file in the directory as referred to by the full path contained in the <i>$wgLogo</i> variable. And that&#8217;s all there is to it, really. The change will take effect immediately after you save the <i>LocalSettings.php</i> file, but make sure you don&#8217;t forget to end the statements with mandaroty semi-colons on each added line and also make sure the lines come before any closing <i>&#8220;?&gt;&#8221;</i> at the end of the file. The file must still be valid PHP code when you are finished, after all.</p>
<h4>Summary</h4>
<p>Your results should look something like in the figure below. I can&#8217;t remember where I found the image I am using for my MediaWiki instance, but it is a gif image of size 84 x 64 pixels. As I mentioned earlier, the original default logo image is of type png and size 135 x 135 pixels.</p>
<p><a href="http://leefw.wordpress.com/2008/03/11/changing-the-logo-of-your-mediawiki-site/changing-the-logo-of-your-mediawiki-instance/" target="_blank" rel="attachment wp-att-19" title="Changing the logo of your MediaWiki instance"><img src="http://leefw.files.wordpress.com/2008/03/wiki-logo.thumbnail.jpg" alt="Changing the logo of your MediaWiki instance" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/leefw.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/leefw.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=16&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/03/11/changing-the-logo-of-your-mediawiki-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/wiki-logo.thumbnail.jpg" medium="image">
			<media:title type="html">Changing the logo of your MediaWiki instance</media:title>
		</media:content>
	</item>
		<item>
		<title>A few good reasons why I prefer open source software</title>
		<link>http://leefw.wordpress.com/2008/03/10/why-i-prefer-open-source-software/</link>
		<comments>http://leefw.wordpress.com/2008/03/10/why-i-prefer-open-source-software/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 21:33:43 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[General rant]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[Open source software]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=25</guid>
		<description><![CDATA[[Ed note: I changed the title of this article from 'Why I prefer open source software' to 'A few good reasons why I prefer open source software'. My boss read my posting and correctly pointed out that there are many other good reasons why someone would prefer an open source model other than just the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=25&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h5>[Ed note: I changed the title of this article from 'Why I prefer open source software' to 'A few good reasons why I prefer open source software'. My boss read my posting and correctly pointed out that there are many other good reasons why someone would prefer an open source model other than just the choice/freedom point I make. In hind site I happen agree with her. Please keep that in mind when reading.]</h5>
<h4>Introduction</h4>
<p>Apparently I&#8217;m seen as a bit of an open source software advocate within my company. I admit that I can&#8217;t say I&#8217;m displeased with that description, but I caught myself asking why that is? And why am I happy as being seen as such?</p>
<p>Sure, I have purchased a &#8220;few&#8221; T-shirts from the <a href="http://intlstore.mozilla.org/" target="_blank">Mozilla foundation</a> and <a href="http://www.cafepress.com/" target="_blank">CafePress </a>that help reinforce an indisputable image of my beliefs among colleagues, but still. Why do I prefer open source software over proprietary alternatives?</p>
<h4>Choice and freedom</h4>
<p>Open source software means different things to different people and there any many other good aspects of adopting an open source software strategy. However, I think one of the main reasons I like it boils down to promoting choice and freedom. In general, I don&#8217;t like being forced to do anything I don&#8217;t want to do. I like to make my own choices.</p>
<h4>Choice is good</h4>
<p>When developing software the goal is usually to create components that have high cohesion and low coupling. Well designed software enables you to react easily to change, and the lower the correlation between components, the easier it is to alter behavior. Choice is good, so when picking the software I want to use in my everyday life, or within the systems I want to build, I want to experience the same kind of freedom. I want the freedom to use a set of software components that match my specific needs, and not ones forced upon me because they coincidently just happen to be the ones my operating system supports. I want the freedom to replace any of these components at a later date, with better alternatives should I wish to do so, for whatever reason. And should the person, project or company, behind a particular software component on which I depend, decide to abandon support or further production then I have the freedom to carry on development on my own merit since I have the source code available. That is my <span class="ital-inline">prerogative</span>. The choice is mine.</p>
<p>You can use the same analogy in other parts of life. If you are a car owner you wouldn&#8217;t accept having to fill petrol at only one brand of petrol station because your car happens to be incompatible with other pumps. Such a car just wouldn&#8217;t hit the market because nobody would buy it. The reason is apparent. No, you want the choice to shop for the best petrol price or just buy the first thing that comes along. You have the freedom to make that choice.</p>
<h4>Paying for software</h4>
<ul></ul>
<p>It&#8217;s not about price. Yes, free sounds great and it&#8217;s beneficial to have the option to try something for free instead of paying for a trial license, but in general I don&#8217;t mind paying for software and have done so many times in the past. However, I&#8217;m finished paying for things I no longer need. For example, I have followed Microsoft Windows since 1991 and have purchased licenses for Windows 3.0, Windows 95, Windows 98 and Windows XP among other things. However, I can state with a high degree of certainty that Microsoft Windows XP will be the last Windows license I will ever buy. My company PC happens to use Microsoft Vista and there is absolutely nothing there that I feel I really need. 98% of my everyday needs are covered by using <a href="http://www.kubuntu.org/" target="_blank">Kubuntu</a> at home. Now, if only Adobe would consider open sourcing some of their products or at least offer their full portfolio on Linux&#8230;</p>
<h4>M$ basher</h4>
<p>So I guess this means I hate Microsoft? I don&#8217;t really. I dislike some of their business methods and the FUD they spread, but Microsoft is a corporation that exists to make money. That is it&#8217;s purpose &#8211; it is not a charity. Many people are unaware that when I left college my idea was to work for a company that developed Microsoft Win32 applications using C. I saw that as a great challenge and something I really wanted to do. I read many books on the subject. However, that never happened for me and I can&#8217;t say I lose sleep over it. I think I have gone on to better things, but I think it&#8217;s fair to say that I can see the view from both sides of the fence.<br />
I don&#8217;t really dislike the Microsoft software portfolio, but I think some of the people using and promoting the software need to take a good, long look at some of the great open source alternatives available out there and assess if the proprietary  software they are recommending is really worth the price. Just what is the total cost of ownership for the paying customer?</p>
<p>One thing that does annoy me is when people can&#8217;t distinguish between a PC, the Microsoft Windows operating system and the Microsoft Office suite. Of course, this is more down to their own ignorance than anything Microsoft has done [can be disputed]. It&#8217;s a shame, but the market for good software alternatives has been so bad for the last 10 years or so that people have become accustomed to seeing these components packaged together that they just see them as one and the same. That&#8217;s a tough nut to crack.</p>
<h4>Moving along</h4>
<p>The open source world is not what it once used to be. It&#8217;s still a movement, a rebellion in a way, but it is definitely growing. Open source software recently reached the boardrooms and more and more companies are reaping the benefits of developing products under an open source license. But let&#8217;s not beat about the bush. There is a lot more money involved in open source development today than ever before. Large corporations like Sun and IBM aren&#8217;t giving away software to be nice. It is clear that the mindset has changed and so have the business models.</p>
<p>As I said earlier, there are many other good reasons why open software is preferable. However, I can only cover so much in one posting. However, I think the steady rise of open source software is good news for developers, corporations and consumers alike. For the first time in many years they now have the freedom to choose between several viable alternatives and more and more of them seem to be breaking free of their shackles.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/leefw.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/leefw.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=25&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/03/10/why-i-prefer-open-source-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>
	</item>
		<item>
		<title>Sending SMTP mail with Java</title>
		<link>http://leefw.wordpress.com/2008/03/09/sending-smtp-mail-with-java/</link>
		<comments>http://leefw.wordpress.com/2008/03/09/sending-smtp-mail-with-java/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 18:15:19 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=20</guid>
		<description><![CDATA[Introduction
So your Java application needs to send a notification mail? Not an uncommon scenario, but how to do it? Luckily this turns out to be pretty easy in it&#8217;s simplest form, but SMTP configuration can be the killer. You are of course dependent on being able to access a SMTP mail server and also possessing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=20&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h4>Introduction</h4>
<p>So your Java application needs to send a notification mail? Not an uncommon scenario, but how to do it? Luckily this turns out to be pretty easy in it&#8217;s simplest form, but SMTP configuration can be the killer. You are of course dependent on being able to access a SMTP mail server and also possessing a little knowledge of the SMTP protocol.</p>
<h4>What you need</h4>
<p>Some years ago, Sun released the Java Mail API. It doesn&#8217;t ship along with the standard Java distribution (yet!) so you will need to download it manually. It can be found <a href="http://java.sun.com/products/javamail/" title="Sun's Java Mail API" target="_blank">here</a> and at the time of writing is at version 1.4.1. The Mail API depends on code from the JavaBeans Activation Framework (JAF) so you&#8217;ll need to download that package also. It can be found <a href="http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp" title="JavaBeans Activation Framework download" target="_blank">at this link</a> and at the time of writing is at version 1.1.1.  Make sure you add the <i>activation.jar</i> file from the JAF distribution to your Java classpath and you will also need both the <i>mail.jar</i> and <i>smtp.jar</i> files from the Mail API distribution to enable you to send SMTP mail.</p>
<h4>The code</h4>
<p>The code itself is straightforward enough, but as I said earlier, it&#8217;s the SMTP mail server configuration that can turn out to be the problem. Specially if the server is configured to not let you use it indiscriminately to avoid SPAM etc. This will depend on the company policy configuration settings of the SMTP server you are trying to connect to.</p>
<p>OK, here&#8217;s a simple example of how it can be done&#8230;</p>
<pre name="code" class="java">

import java.util.Date;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

public class Main {
    public static void main(String[] args) {
        Properties props = new Properties();
        props.put(&quot;mail.smtp.host&quot;, &quot;your SMTP mail server here&quot;);
        props.put(&quot;mail.debug&quot;, &quot;true&quot;);

        Session session = Session.getInstance(props);

        try {
            Message msg = new MimeMessage(session);
            msg.setFrom(new InternetAddress(&quot;from@here.com&quot;));
            InternetAddress[] address = {new InternetAddress(&quot;to@somewhere.com&quot;)};
            msg.setRecipients(Message.RecipientType.TO, address);
            msg.setSubject(&quot;Mail subject title&quot;);
            msg.setSentDate(new Date());
            msg.setText(&quot;Message body string&quot;);

            Transport.send(msg);
        }
        catch (MessagingException e) {}
    }
}
</pre>
<p>So, to summarize, start you of by creating a Java Properties object and populating it with relevant configuration information. You need to specify the SMTP host name or IP address for the key <i>&#8220;mail.smtp.host&#8221;</i>. The <i>&#8220;mail.debug&#8221;</i> property is useful for development and will give you a hint what&#8217;s going wrong should you get into trouble. Proceed on by creating a <i>javax.mail.Session</i> object and passing it your properties object. To create the actual mail message use a <i>javax.mail.internet.MimeMessage</i> object passing along the session instance you just created. Populate the <i>javax.mail.Message</i> object with a valid sender address and receiver address array (mail has only one sender, but can have multiple receivers). Add a mail subject, the timestamp and of course the mail message body. Then all that remains is to actually post the message to the SMTP server. That where the hard part usually begins.<br />
So, not that difficult all in all, but remember to encapsulate the code in a try/catch block and catch the <i>javax.mail.MessagingException</i> exception type for it to compile. Handle errors appropriately, there is a lot that could possibly go wrong here.</p>
<h4>SMTP server authentication</h4>
<p>As I mentioned earlier, configuration can be the killer. These days most SMTP servers don&#8217;t let any old message pass through the system without some kind of policy checking switched on. It is likely that you will need to authenticate your application to the SMTP server when creating the session object. It is also possible that the server will attempt to validate the sender e-mail address your application is using so you need to choose it wisely since it will need to be valid in the mail domain.</p>
<p>To create an authenticated session object you will need to make a few minor adjustments to the code. Create a <i>javax.mail.Authenticator</i> subclass and override the protected method <i>getPasswordAuthentication</i>. By default this method returns null, so you will have to make it return an initialized <i>javax.mail.PasswordAuthentication</i> object containing your username and password.</p>
<p>You also need to tell the session object to use your new authentication class so add the property<i> &#8220;mail.smtp.auth&#8221;</i> to your <i>Properties</i> object and set its to <i>&#8220;true&#8221;</i>. Also change the code that creates the session object by using an overloaded version passing both your <i>Properties</i> object and an instance of your new <i>Authenticator</i> subclass. The new code should look something like this:</p>
<pre name="code" class="java">

import java.util.Date;
import java.util.Properties;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

public class Main {
    public static void main(String[] args) {
        Properties props = new Properties();
        props.put(&quot;mail.smtp.host&quot;, &quot;your SMTP mail server here&quot;);
        props.put(&quot;mail.smtp.auth&quot;, &quot;true&quot;);
        props.put(&quot;mail.debug&quot;, &quot;true&quot;);

        Session session = Session.getInstance(props, new MyAuth());

        try {
            Message msg = new MimeMessage(session);
            msg.setFrom(new InternetAddress(&quot;from@here.com&quot;));
            InternetAddress[] address = {new InternetAddress(&quot;to@somewhere.com&quot;)};
            msg.setRecipients(Message.RecipientType.TO, address);
            msg.setSubject(&quot;&quot;);
            msg.setSentDate(new Date());

            msg.setText(&quot;Message body string&quot;);

            Transport.send(msg);
        }
        catch (MessagingException e) {}
    }
}

class MyAuth extends Authenticator {
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(&quot;your username&quot;,&quot;your password&quot;);
    }
}
</pre>
<p>And that ought to do it! This code worked fine for me when testing with two separately configured Microsoft Exchange servers (ESMTP , version 6.0.3790.1830 and 6.0.3790.3959) in different mail domains as my SMTP server host, but only if clear text authentication (BASIC) was enabled on the Exchange server.</p>
<p>In both cases the Exchange server checked my sender address and also insisted that my application authenticate itself before allowing it to post.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/leefw.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/leefw.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=20&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/03/09/sending-smtp-mail-with-java/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>
	</item>
		<item>
		<title>Achieving readable output with MySQL</title>
		<link>http://leefw.wordpress.com/2008/03/07/the-alternative-way-to-select-readable-data-from-mysql/</link>
		<comments>http://leefw.wordpress.com/2008/03/07/the-alternative-way-to-select-readable-data-from-mysql/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 00:58:35 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[statement terminator alternative]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=13</guid>
		<description><![CDATA[Introduction
Although I like using GUI tools for a lot of things, there are some things I feel you should be able to do without being dependent on a graphical user interface. Using the MySQL console to administer a database is one of them. More than often your only channel of access to a MySQL database [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=13&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h4>Introduction</h4>
<p>Although I like using GUI tools for a lot of things, there are some things I feel you should be able to do without being dependent on a graphical user interface. Using the MySQL console to administer a database is one of them. More than often your only channel of access to a MySQL database server is using a SSL connection to the server host. This is often the case if the database server is configured to disallow connections from any other host than the localhost.</p>
<h4>A useful feature</h4>
<p>Most users associated with MySQL are familiar with a SQL statement of the form <i>&#8220;SELECT * FROM table;&#8221;</i> to retrieve table information. It&#8217;s one of the first things you learn. However, if the table in question has a lot of columns and contains a lot of records, then you are going to find the MySQL console a bit of a pain when reading the data. Check out the familiar SQL output result in the figure below.</p>
<p><a href="http://leefw.wordpress.com/2008/03/07/the-alternative-way-to-select-readable-data-from-mysql/default-output-for-select-from-table/" target="_blank" rel="attachment wp-att-14" title="Default output for “SELECT * FROM table;”"><img src="http://leefw.files.wordpress.com/2008/03/mysql-console-default-listing.thumbnail.jpg" alt="Default output for “SELECT * FROM table;”" /></a></p>
<h4>The alternative</h4>
<p>Of course you can limit the output listing by using a SQL <i>WHERE</i> clause and specifying the exact names of the columns of interest, but that is not the point of this posting and in some cases you may not be aware of column names you need to use (yes, I am aware of  the <i>&#8216;DESCRIBE table;&#8217;</i> command). As you know, you terminate each SQL statement with the default semicolon <i>&#8216;;&#8217;</i> character. Without this character the database server console just waits for you to finish your SQL statement indefinitely, but there is an alternative. By replacing <i>&#8216;;&#8217;</i> with <i>&#8216;\g&#8217;</i> gives the exact same console output as before. OK, I know what you are thinking. Why is that any better? It&#8217;s not, however, replacing <i>&#8216;;&#8217;</i> with the uppercase variant <i>&#8216;\G&#8217;</i> is, and gives an output listing in a different, and often more readable, format listing each table record by it&#8217;s columns:</p>
<blockquote><p><i>SELECT * FROM table \G</i></p></blockquote>
<p>See the figure below showing the end of row number 2, the full row number 3, and the beginning of row number 4 from the same table as earlier:<br />
<a href="http://leefw.wordpress.com/2008/03/07/the-alternative-way-to-select-readable-data-from-mysql/the-alternative-to-using-the-default-sql-statement-terminator/" target="_blank" rel="attachment wp-att-15" title="The alternative to using the default SQL statement terminator"><img src="http://leefw.files.wordpress.com/2008/03/mysql-console-alternative-listing.thumbnail.jpg" alt="The alternative to using the default SQL statement terminator" /></a></p>
<p>It was only recently that I stumbled across this feature, but I have found it useful on many occasions already.</p>
<h4>Summary</h4>
<p>I&#8217;m sure you can see the benefit of using this alternative statement termination character on occasion. As you can see, records with many columns are a lot easier to read without being forced to limit the record column output using a <i>WHERE</i> clause. I&#8217;m pretty sure that using the <i>&#8216;\G&#8217;</i> termination character isn&#8217;t standard SQL, and not something you would want to use when terminating embedded SQL in your application, but a useful feature all the same. It definitely makes reading records easier even if the output may appear to be more verbose at first. You can of course use a <i>WHERE</i> clause or similar as before to narrow down your output further, but using <i>&#8216;\G&#8217;</i> makes the output easier to read in many situations:</p>
<blockquote><p><i>SELECT * FROM table WHERE id = &#8217;something&#8217; \G</i></p></blockquote>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/leefw.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/leefw.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=13&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/03/07/the-alternative-way-to-select-readable-data-from-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/mysql-console-default-listing.thumbnail.jpg" medium="image">
			<media:title type="html">Default output for “SELECT * FROM table;”</media:title>
		</media:content>

		<media:content url="http://leefw.files.wordpress.com/2008/03/mysql-console-alternative-listing.thumbnail.jpg" medium="image">
			<media:title type="html">The alternative to using the default SQL statement terminator</media:title>
		</media:content>
	</item>
		<item>
		<title>Removing default search limitations in MediaWiki and MySQL</title>
		<link>http://leefw.wordpress.com/2008/03/05/getting-past-default-searching-limitations-in-mediawiki-and-mysql/</link>
		<comments>http://leefw.wordpress.com/2008/03/05/getting-past-default-searching-limitations-in-mediawiki-and-mysql/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 00:15:28 +0000</pubDate>
		<dc:creator>Lee Francis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[LocalSettings]]></category>
		<category><![CDATA[Searching]]></category>

		<guid isPermaLink="false">http://leefw.wordpress.com/?p=12</guid>
		<description><![CDATA[Introduction
So let&#8217;s assume you have created a page in your Mediawiki site, named it with an appropriate page title consisting of only 3 characters, say SSL or SQL, only to find that it never shows up when searching for it in the MediaWiki site search. You have tried both uppercase and lowercase search query words, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=12&subd=leefw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h4>Introduction</h4>
<p>So let&#8217;s assume you have created a page in your Mediawiki site, named it with an appropriate page title consisting of only 3 characters, say SSL or SQL, only to find that it never shows up when searching for it in the MediaWiki site search. You have tried both uppercase and lowercase search query words, you haven&#8217;t misspelled the search query (only 3 characters, after all), and you are certain you are searching through the correct MediaWiki namespace. You are also certain that you saved the page, not only previewed it and then made the mistake of closing your browser.</p>
<p>Come to think of it, that page you are 110% certain you read yesterday, referring to the exact same search query word, say <i>&#8216;SSL&#8217;</i>, doesn&#8217;t show up either when searching for either <i>of &#8217;ssl&#8217;</i> or <i>&#8216;SSL&#8217;</i>. How can that be? You didn&#8217;t delete the page by mistake, did you? This is getting annoying, but are you starting to see a pattern?</p>
<p>As we will see this has nothing to do with searching the wrong MediaWiki namespace (although easy enough to do), misspelling the search query word, distinguishing between uppercase or lowercase search query words, failing to save a page edit or deleting a page by mistake. The cause is simple: by default, the MySQL database server does not fulltext index words of 3 characters or below. To make this possible, you will have to change the configuration of both MediaWiki and MySQL to enable it to search for useful words and abbreviations of character length 3, such as apt, ssh, nfs and the like.</p>
<h4>Editing the MediaWiki configuration</h4>
<p>It is simple to correct this problem, but you need access to both the web server file system and administrator privileges to the MySQL database server. Locate the <i>LocalSettings.php</i> file in your MediaWiki installation directory, usually a subdirectory of your web server&#8217;s document root, say <i>/htdocs</i> on Apache. Edit the file and add the variable <i>wgDBminWordLen</i> to it. Set it&#8217;s value to 3, so:</p>
<blockquote><p> $wgDBminWordLen = 3;</p></blockquote>
<h4>Editing the MySQL configuration</h4>
<p>You must also tell the MySQL database server to index 3-letter words in fulltext indexes. This is the core of the problem and this configuration change will also apply to any application using the MySQL database server, not just MediaWiki. Add or edit the <i>[mysqld]</i> heading in your <i>my.conf</i> file with the following configuration line:</p>
<blockquote><p>[mysqld]<br />
ft_min_word_len=3</p></blockquote>
<p>And that&#8217;s really all there is to it!</p>
<h4>Recreate the MySQL table index</h4>
<p>So just one more step to go before you can use it. You now need to restart your MySQL database server to load the new configuration setting, and then recreate the search index. So restart your server process, open a console and proceed to enter the MySQL database you use for your MediaWiki installation. Recreate the  necessary search index by typing:</p>
<blockquote><p> REPAIR TABLE searchindex QUICK;</p></blockquote>
<p>If you prefixed your MediaWiki database tables with a prefix when installing the wiki then the name of your &#8217;searchindex&#8217; table may be <i>wk_searchindex</i> or similar. A simple &#8216;<i>show tables</i>;&#8217; query will give you a hint of the correct table name.</p>
<h4>Summary</h4>
<p>This particular fix took me a little while to find. Not that it was hidden, but I was unsure which component was limiting the search. As you have seen it turns out both MediaWiki and MySQL needed to be tweaked to correct the problem. Remember there is a reason why MySQL sets the index limitation to 3 characters by default. By changing it you will increase your index sizes leading to a performance hit. The default setting is 4 characters and I&#8217;m sure there is a statistical reason for this. Take a closer look at <a href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.html" target="_blank">this page</a> for more information on tuning the fulltext search in MySQL if you are unsure of the impact it might have.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/leefw.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/leefw.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leefw.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leefw.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leefw.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leefw.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leefw.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leefw.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leefw.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leefw.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leefw.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leefw.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leefw.wordpress.com&blog=2763705&post=12&subd=leefw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leefw.wordpress.com/2008/03/05/getting-past-default-searching-limitations-in-mediawiki-and-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/902b6cb1e24c02e89adc670f9649dae9?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">Lee Francis</media:title>
		</media:content>
	</item>
	</channel>
</rss>
