<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Notes To Self</title>
	<atom:link href="http://saltsoft.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://saltsoft.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 01 May 2009 15:46:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='saltsoft.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/ddd8dd873390f436e2eb0fa84ad3383d?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Notes To Self</title>
		<link>http://saltsoft.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://saltsoft.wordpress.com/osd.xml" title="Notes To Self" />
	<atom:link rel='hub' href='http://saltsoft.wordpress.com/?pushpress=hub'/>
		<item>
		<title>FCK Editor &#8211; page break</title>
		<link>http://saltsoft.wordpress.com/2009/05/01/fck-editor-page-break/</link>
		<comments>http://saltsoft.wordpress.com/2009/05/01/fck-editor-page-break/#comments</comments>
		<pubDate>Fri, 01 May 2009 15:39:51 +0000</pubDate>
		<dc:creator>Saltmeister</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[FCKEditor]]></category>
		<category><![CDATA[Word]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[page-break]]></category>

		<guid isPermaLink="false">http://saltsoft.wordpress.com/?p=34</guid>
		<description><![CDATA[FCK editor is a great open source HTML rich text editor. I use it in a project that  allows users to create documents within the browser (with additional server side logic) and then have the result streamed to Word on the client. This is done very cheaply by streaming the actual HTML to Word forcing a .doc [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=34&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>FCK editor is a great open source HTML rich text editor. I use it in a project that  allows users to create documents within the browser (with additional server side logic) and then have the result streamed to Word on the client. This is done very cheaply by streaming the actual HTML to Word forcing a .doc extension. The hack works well apart from page breaks.</p>
<p>FCK editor adds the following HTML tags for a page break &#8230;</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:7px;width:1px;height:1px;">        const string fckePageBreak = &#8220;&lt;div style=\&#8221;page-break-after: always\&#8221;&gt;&lt;span style=\&#8221;display: none\&#8221;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&#8221;;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:7px;width:1px;height:1px;">        const string wordPageBreak = &#8220;&lt;div&gt;&lt;br clear=\&#8221;all\&#8221; style=\&#8221;page-break-before:always\&#8221; /&gt;&amp;nbsp;&lt;/div&gt;&#8221;;</div>
<p>&lt;div style=&#8221;page-break-after: always&#8221;&gt;&lt;span style=&#8221;display: none&#8221;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;</p>
<p>&#8230; which Word completely ignores.</p>
<p>Replace the default FCK tags above with the tags below before streaming to see your page breaks in Word &#8230;</p>
<p>&lt;div&gt;&lt;br clear=&#8221;all&#8221; style=&#8221;page-break-before:always&#8221; /&gt;&amp;nbsp;&lt;/div&gt;</p>
<div><a href="http://www.fckeditor.net/">http://www.fckeditor.net/</a></div>
<div><a href="http://www.fckeditor.net/"></a></div>
<p><a href="http://www.fckeditor.net/"></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/saltsoft.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/saltsoft.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/saltsoft.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/saltsoft.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/saltsoft.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/saltsoft.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/saltsoft.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/saltsoft.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/saltsoft.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/saltsoft.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/saltsoft.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/saltsoft.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/saltsoft.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/saltsoft.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=34&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://saltsoft.wordpress.com/2009/05/01/fck-editor-page-break/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1be931cb314389b42d4939dd75c72139?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richardsalt</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET DataGrid &#8211; Live Long &amp; Prosper!</title>
		<link>http://saltsoft.wordpress.com/2009/03/12/aspnet-datagrid-live-long-prosper/</link>
		<comments>http://saltsoft.wordpress.com/2009/03/12/aspnet-datagrid-live-long-prosper/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 11:00:29 +0000</pubDate>
		<dc:creator>Saltmeister</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[datagrid]]></category>

		<guid isPermaLink="false">http://saltsoft.wordpress.com/?p=19</guid>
		<description><![CDATA[  Ok, they are out of favour since the DataView came along in dotnet 2.0 but, if like me, you are still maintaining a project that has evolved since the dotnet 1.1 days, the DataGrid may still be a major part of your coding life. One day I&#8217;ll migrate to a new grid, maybe even [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=19&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>Ok, they are out of favour since the DataView came along in dotnet 2.0 but, if like me, you are still maintaining a project that has evolved since the dotnet 1.1 days, the DataGrid may still be a major part of your coding life. One day I&#8217;ll migrate to a new grid, maybe even a third party vendor, but that seems a lot of work for little gain when the current code is humming along quite happily.</p>
<p>There are some occasions where the DataGrid is lacking features though. For example, you may want to display a potentially large notes field per row, but adding it as a column can make the grid layout look ridiculous and waste browser real estate displaying the other columns.</p>
<p>For a recent enhancement to on of our projects, I needed a kind of expandable/collapsible &#8220;preview&#8221; row &#8211; the likes of which dev express grid fans might have come across on winform or delphi apps &#8211; where you can optionally display a large notes field, or additional address info per row. Another good example is MS Outlook with its &#8220;Auto Preview&#8221; mode.</p>
<p>So, I went about adding my own preview row to the trusty old DataGrid. It works by hacking some html table tags onto the end of the last column for each row.</p>
<p>In the code forward, I added a template column to the DataGrids Columns element and also added my over-sized notes as a hidden column. </p>
<pre>&lt;asp:TemplateColumn HeaderText="Click me"&gt;
&lt;ItemTemplate&gt;
  &lt;img id="iExpand" name="iExpand" runat="server" src="/images/info.gif" /&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateColumn&gt;
&lt;asp:BoundColumn DataField="notes" Visible="false"  HeaderText="notes"/&gt;</pre>
<p>The main part of the hack is in the code behind dg_ItemDataBound method:</p>
<pre>private void dg_ItemDataBound(object sender, DataGridItemEventArgs e)
{
  if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
  {
    DataRowView drv = (DataRowView)e.Item.DataItem;
    if (drv == null) return;
    //hack a preview row
    HtmlImage iExpand = (HtmlImage)e.Item.FindControl("iExpand");
    iExpand.Attributes.Add("onClick", "TogglePreview('" + e.Item.ClientID.ToString() + "_salt', this);");
    e.Item.Cells[e.Item.Cells.Count - 1].Text +=
String.Format("&lt;/td&gt;&lt;tr&gt;&lt;td id='{0}' colspan='20' style='visibility:hidden; display:none;&gt;{2}",
e.Item.ClientID.ToString() + "_salt", (e.Item.Cells.Count).ToString().Trim(),
Convert.ToString(drv["notes"]).Trim());
  }
}</pre>
<p>You may have spotted the hard-coded colspan value. Ideally we should use colspan=&#8217;0&#8242; (zero) to span all columns. But not all browsers support this, so a well known hack is to pass a number  greater than your number of columns.</p>
<p> Back in the code forward between the &lt;head&gt;&lt;/head&gt; tags, I added this javascript:</p>
<pre>&lt;script type="text/javascript"&gt;
IE6 = (navigator.appVersion.indexOf("MSIE 6.")==-1) ? false : true;
IE7 = (navigator.appVersion.indexOf("MSIE 7.")==-1) ? false : true;function TogglePreview(obj1, obj2){
 var e = document.getElementById(obj1);
 //quirksmode: IE doesn't support display:table-cell <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   %&gt;
 var salthack='table-cell';
 if (IE6 || IE7) salthack='block';
 if (e != null){
 if (e.style.display == 'none'){
   e.style.display = salthack;
   e.style.visibility = 'visible';
  } else {
   e.style.display = 'none';
   e.style.visibility = 'hidden';
  }}}   

&lt;/script&gt;</pre>
<p>Note the hacks for the CSS &#8221;display&#8221; property. Firefox and Chrome both correctly support the table-cell selector but IE does not.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/saltsoft.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/saltsoft.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/saltsoft.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/saltsoft.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/saltsoft.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/saltsoft.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/saltsoft.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/saltsoft.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/saltsoft.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/saltsoft.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/saltsoft.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/saltsoft.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/saltsoft.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/saltsoft.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=19&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://saltsoft.wordpress.com/2009/03/12/aspnet-datagrid-live-long-prosper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1be931cb314389b42d4939dd75c72139?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richardsalt</media:title>
		</media:content>
	</item>
		<item>
		<title>Bash syntax reminder #2</title>
		<link>http://saltsoft.wordpress.com/2009/03/02/bash-syntax-reminder-2/</link>
		<comments>http://saltsoft.wordpress.com/2009/03/02/bash-syntax-reminder-2/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 10:40:13 +0000</pubDate>
		<dc:creator>Saltmeister</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://saltsoft.wordpress.com/?p=11</guid>
		<description><![CDATA[If your scripts mount other drives in order to backup or mirror data, it is good practice (if not essential) to check whether the mount is successful before copying the data to it. #example Bash syntax mounting a windows share &#38; checking if the mount was successful mount -t cifs //server/share /mnt/mymount -o username=x,password=y if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=11&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If your scripts mount other drives in order to backup or mirror data, it is good practice (if not essential) to check whether the mount is successful before copying the data to it.</p>
<p>#example Bash syntax mounting a windows share &amp; checking if the mount was successful</p>
<p>mount -t cifs //server/share /mnt/mymount -o username=x,password=y<br />
if [ $? != 0 ]; then<br />
echo &#8220;cannot mount share&#8221;<br />
exit 1<br />
fi<br />
#otherwise continue script &#8230;</p>
<p>Failure to do this can result in a rogue script filling up /mnt/whatever with real data until the partition is full, which then can wreak havoc with other applications.</p>
<p>For example: Firebird was reporting: &#8221;cannot start transaction for password database&#8221;.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/saltsoft.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/saltsoft.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/saltsoft.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/saltsoft.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/saltsoft.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/saltsoft.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/saltsoft.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/saltsoft.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/saltsoft.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/saltsoft.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/saltsoft.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/saltsoft.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/saltsoft.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/saltsoft.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=11&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://saltsoft.wordpress.com/2009/03/02/bash-syntax-reminder-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1be931cb314389b42d4939dd75c72139?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richardsalt</media:title>
		</media:content>
	</item>
		<item>
		<title>Excel formula to calculate age</title>
		<link>http://saltsoft.wordpress.com/2009/03/02/excel-formula-to-calculate-age/</link>
		<comments>http://saltsoft.wordpress.com/2009/03/02/excel-formula-to-calculate-age/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 10:35:52 +0000</pubDate>
		<dc:creator>Saltmeister</dc:creator>
				<category><![CDATA[excel]]></category>
		<category><![CDATA[formula]]></category>

		<guid isPermaLink="false">http://saltsoft.wordpress.com/?p=9</guid>
		<description><![CDATA[This excel formula calculates the difference between two dates. Useful for a persons age, or years of employment service etc. Assuming cell A1 = your date (date of birth for example) =DATEDIF(A1,NOW(),&#8221;y&#8221;)&#38;&#8221; years &#8220;&#38;DATEDIF(A1,NOW(),&#8221;ym&#8221;)&#38;&#8221; months &#8220;&#38;DATEDIF(A1,NOW(),&#8221;md&#8221;)&#38;&#8221; days&#8221;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=9&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 class="post-title entry-title"><span style="font-weight:normal;">This excel formula calculates the difference between two dates. Useful for a persons age, or years of employment service etc.</span></h3>
<div class="post-body entry-content">
<div>Assuming cell A1 = your date (date of birth for example)</div>
<div>=DATEDIF(A1,NOW(),&#8221;y&#8221;)&amp;&#8221; years &#8220;&amp;DATEDIF(A1,NOW(),&#8221;ym&#8221;)&amp;&#8221; months &#8220;&amp;DATEDIF(A1,NOW(),&#8221;md&#8221;)&amp;&#8221; days&#8221;</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/saltsoft.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/saltsoft.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/saltsoft.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/saltsoft.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/saltsoft.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/saltsoft.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/saltsoft.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/saltsoft.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/saltsoft.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/saltsoft.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/saltsoft.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/saltsoft.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/saltsoft.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/saltsoft.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=9&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://saltsoft.wordpress.com/2009/03/02/excel-formula-to-calculate-age/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1be931cb314389b42d4939dd75c72139?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richardsalt</media:title>
		</media:content>
	</item>
		<item>
		<title>Bash syntax reminder #1</title>
		<link>http://saltsoft.wordpress.com/2009/03/02/bash-syntax-reminder-1/</link>
		<comments>http://saltsoft.wordpress.com/2009/03/02/bash-syntax-reminder-1/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 10:34:52 +0000</pubDate>
		<dc:creator>Saltmeister</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://saltsoft.wordpress.com/?p=7</guid>
		<description><![CDATA[Locate some files, iterate thru the list and manipulate file &#38; folder strings #!/bin/bash locate /home/myfolder/*today.zip &#62;/tmp/salt for file in $(&#60; /tmp/salt) do   #separate folder from file   filename=`basename $file`   folder=`dirname $file`   mkdir -p $folder  #create parent folders if needed &#38; don&#8217;t error if exists  #substrings   substr1=${folder:0:8} # gets first 8 chars   substr2=${folder:9} # gets from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=7&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>Locate some files, iterate thru the list and manipulate file &amp; folder strings</div>
<div>#!/bin/bash</div>
<div>locate /home/myfolder/*today.zip &gt;/tmp/salt</div>
<div>for file in $(&lt; /tmp/salt)</div>
<div>do</div>
<div>  #separate folder from file</div>
<div>  filename=`basename $file`</div>
<div>  folder=`dirname $file`</div>
<div>  mkdir -p $folder  #create parent folders if needed &amp; don&#8217;t error if exists</div>
<div>
<div> #substrings</div>
<div>  substr1=${folder:0:8} # gets first 8 chars</div>
<div>  substr2=${folder:9} # gets from char 9 to end of string</div>
</div>
<div>
<div>#strip  </div>
<div>  parentfolder=${folder%/backup} #strips /backup from the end of the string</div>
<div>  childfolder=${folder#/home} #strips /home from the start of the string</div>
</div>
<div>done</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/saltsoft.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/saltsoft.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/saltsoft.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/saltsoft.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/saltsoft.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/saltsoft.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/saltsoft.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/saltsoft.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/saltsoft.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/saltsoft.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/saltsoft.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/saltsoft.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/saltsoft.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/saltsoft.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=7&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://saltsoft.wordpress.com/2009/03/02/bash-syntax-reminder-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1be931cb314389b42d4939dd75c72139?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richardsalt</media:title>
		</media:content>
	</item>
		<item>
		<title>Firebird Superserver versus Classic &amp; VMware</title>
		<link>http://saltsoft.wordpress.com/2009/03/02/firebird-superserver-versus-classic-vmware/</link>
		<comments>http://saltsoft.wordpress.com/2009/03/02/firebird-superserver-versus-classic-vmware/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 10:25:55 +0000</pubDate>
		<dc:creator>Saltmeister</dc:creator>
				<category><![CDATA[firebird]]></category>
		<category><![CDATA[classic]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[superserver]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[xinetd]]></category>

		<guid isPermaLink="false">http://saltsoft.wordpress.com/?p=3</guid>
		<description><![CDATA[Firebird Superserver versus Classic  - running on Fedora 8 under VMware Firebird superserver, with its shared cache always seemed to suit our many-databases &#38; many-client requirements. But when we moved from physical servers to virtual servers, we hit a major performance problem. Using a bash script that simultaneously queried several different large-ish databases, we found that performance [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=3&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Firebird Superserver versus Classic  - running on Fedora 8 under VMware</h3>
<p>Firebird superserver, with its shared cache always seemed to suit our many-databases &amp; many-client requirements. But when we moved from physical servers to virtual servers, we hit a major performance problem.</p>
<p>Using a bash script that simultaneously queried several different large-ish databases, we found that performance was 3 times slower in the virtual environment than in the physical environment. But running the same script using Firebird Classic on Fedora-8 under VMware gave us the same performance as Superserver on our physical hardware.</p>
<p>Tip 1: in a typical installation, Classic is spawned from xinetd. On our Fedora 8 install, xinetd had a fairly low instance limit and began to prevent connections once the load increased, so check your xinetd.conf file&#8217;s access restriction defaults. If you have tons of headroom, the quick hack is:</p>
<p>instances = UNLIMITED<br />
per_source = UNLIMITED<br />
cps = 1000 10</p>
<p>Tip 2: lower the page &amp; buffer sizes of your databases because with classic, cache is not shared per database. There is a separate cache for each connection.</p>
<p><em>Versions used at the time of writing this article: Firebird 1.5.5, Fedora 8, VMWare ESX 3.5</em></p>
<p class="MsoNormal">Further Info: <a href="http://www.firebirdsql.org/manual/ufb-about-arch.html">Classic and Superserver Architectures Article</a></p>
<p class="MsoNormal">Firebird Support Group :<a href="http://tech.groups.yahoo.com/group/firebird-support/">http://tech.groups.yahoo.com/group/firebird-support/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/saltsoft.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/saltsoft.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/saltsoft.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/saltsoft.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/saltsoft.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/saltsoft.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/saltsoft.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/saltsoft.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/saltsoft.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/saltsoft.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/saltsoft.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/saltsoft.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/saltsoft.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/saltsoft.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=saltsoft.wordpress.com&amp;blog=6793272&amp;post=3&amp;subd=saltsoft&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://saltsoft.wordpress.com/2009/03/02/firebird-superserver-versus-classic-vmware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1be931cb314389b42d4939dd75c72139?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richardsalt</media:title>
		</media:content>
	</item>
	</channel>
</rss>
