<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.dbws.net/blog/wp-content/plugins/fedafi/style.xsl" ?>
<!-- This feed is meant to be read using an RSS feed reader. A feed reader connects to this feed automatically and grabs new content. To add this to your desktop reader of choice just copy the URL from the address bar in your browser and paste into your feed reader. You can also add this feed to your online reader such as Pageflakes or Netvibes. We have added some links to this feed to make it easy for you to subscribe to -->

<rss version="2.0">

<channel>
	<title>DBWS.NET</title>
	<link>http://www.dbws.net/blog</link>
	<description>Software development mutterings and maybe something about me.</description>
	<lastBuildDate>Thu, 30 Oct 2008 12:37:34 +0000</lastBuildDate>
	<generator>Wordpress supercharged with http://fedafi.com</generator>
	<language>en</language>
			<item>
		<title>Faxing Simple MAPI and Exchange Server 2003</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2008/10/30/faxing-simple-mapi-and-exchange-server-2003/&amp;id=20</link>
		<comments>http://www.dbws.net/blog/2008/10/30/faxing-simple-mapi-and-exchange-server-2003/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 12:36:17 +0000</pubDate>
		
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2008/10/30/faxing-simple-mapi-and-exchange-server-2003/</guid>
		<description><![CDATA[<p><strong>The Scenario:</strong></p>
<p>You have an application that uses Simple MAPI (from Outlook) to send Faxes.  The I.T. department then introduce SBS / Exchange Server into the company to manage users email accounts. Now Faxing no longer works.You get a NDR everytime you try and send.   Strange though as you can still send directly through outlook so your software gets the blame.</p>
<p>Sample Non Delivery Report:</p>
<pre>  Your message did not reach some or all of the intended recipients.

Subject:  E-MAIL FROM XXXXXXXX
       Sent:     10/25/2008 10:21

The
following recipient(s) could not be reached:

       '0XXXXXXXXXXXX' on
10/25/2008 10:21
The message could not be delivered because the
recipient's
destination email system is unknown or invalid. Please check the
address
and try again, or contact your system administrator to
verify
connectivity to the email system of the recipient.

&lt;sbs.domain #5.1.2&gt;</pre>
<p><strong>The Solution:</strong></p>
<p>The problem is due to Exchange attempting to send the fax BEFORE the Fax transport gets a chance to.</p>
<p>To fix this, you need to make a registry modification on each workstation affected.</p>
<p>So in REGEDIT navigate to <strong>HKEY_CURRENT_USER\Software\Microsoft\Office\Common\MailSettings</strong></p>
<p>and ADD a new DWORD key named <strong>StrictAccountOrder   </strong></p>
<p>Set the value to <strong>1</strong></p>
<p>You may have to restart Outlook for the change to take affect but that should solve the problem.  Outlook will correctly identify the Fax transport before trying to send the Fax via Exchange.</p>
<p>Further reading can be found here <a href="http://support.microsoft.com/kb/319820" target="_blank">http://support.microsoft.com/kb/319820 </a></p>
	

		]]></description>
	</item>
		<item>
		<title>Getting back in control of Spam</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2008/07/09/getting-back-in-control-of-spam/&amp;id=19</link>
		<comments>http://www.dbws.net/blog/2008/07/09/getting-back-in-control-of-spam/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 10:21:18 +0000</pubDate>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2008/07/09/getting-back-in-control-of-spam/</guid>
		<description><![CDATA[<p>Recently I&#8217;ve noticed quite a few new spam messages making through my mail server into my mailbox so time to update Spam Assassin and let it know what its missing:</p>
<p>1. I have a seperate mailbox I access explicitly for the purpose of holding Spam, so when my personal junk email folders have a significant amount of real spam in which dont have the ***SPAM*** mark, I move them over to the Spam mailbox.</p>
<p>2. Logging into my mail server as root, I can then proceed to the mailbox store, and inform spamassassin that everything in there should be treat as spam.   It&#8217;s always a good idea to double check the mail though !</p>
<p>3. Command I use to inform SpamAssassin is the sa-learn command :</p>
<blockquote><p> sa-learn &#8211;spam &#8211;progress &lt;path-to-spam-mailbox&gt;</p></blockquote>
	

		]]></description>
	</item>
		<item>
		<title>Docbook -&gt; WebHelp</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2008/07/09/docbook-webhelp/&amp;id=18</link>
		<comments>http://www.dbws.net/blog/2008/07/09/docbook-webhelp/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 10:15:49 +0000</pubDate>
		
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2008/07/09/docbook-webhelp/</guid>
		<description><![CDATA[<p>Steps to get from docbook to fully interactive webhelp..</p>
<p>1. Generate HTMLHELP via Oxygen.</p>
<p>2. (can compile to CHM) or carryon and import HTMLHelp project (hhp) file into Robohelp.</p>
	

		]]></description>
	</item>
		<item>
		<title>Automated Website Image Resizing</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2008/02/16/automated-website-image-resizing/&amp;id=17</link>
		<comments>http://www.dbws.net/blog/2008/02/16/automated-website-image-resizing/#comments</comments>
		<pubDate>Sat, 16 Feb 2008 14:35:32 +0000</pubDate>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2008/02/16/automated-website-image-resizing/</guid>
		<description><![CDATA[<p>This little snippet is a script I have running via Cron, set to execute every 30 minutes.  If like me, you have maybe running forum software that isnt so great handling image uploads in posts and find that users complain because they themselves arent too sure how to resize images prior to posting then this may be useful.</p>
<p>What it does is scan a specified folder every 30 minutes(as set by cron) for new uploaded jpg&#8217;s that are greater than a specified size.  Using the ImageMagick libraries, it then applies compression and resizes proportionally the image if it exceeds a specified height &amp; width.  Images which have been uploaded as 2Mb originals have been processed and saved as 20k files, thats 1% of the original size without any real noticable difference in quality.  People tend to upload images which are suitable for professional printing and far exceed the quality required for simple website viewing.</p>
<p>This is my code:</p>
<pre>#!/bin/bash
src_dir="/var/www/ukordinance/images/fbfiles/images"
DATETIME=`date +%d-%m-%Y-%H:%M`
echo "Looking for files in : $src_dir on $DATETIME"
#find $src_dir -iname '*.jp*g' -size +100k -mmin -30
for i in `find $src_dir -iname '*.jp*g' -size +256k` ;
do
echo "Processing : "$i
convert -resize 1024x768\&gt; -quality 80 $i $i;
done</pre>
	

		]]></description>
	</item>
		<item>
		<title>Sorting the request Parameters</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2008/01/24/sorting-the-request-parameters/&amp;id=16</link>
		<comments>http://www.dbws.net/blog/2008/01/24/sorting-the-request-parameters/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 14:19:33 +0000</pubDate>
		
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2008/01/24/sorting-the-request-parameters/</guid>
		<description><![CDATA[<p>This snippet is from a servlet which acts as a generic form posting utility used throughout some of my sites.  Irrelevant of the dressing of the JSP, it can be presenting the user a form for any number of reasons, but in each case when submitted the form contents will be emailed to my site admins.    The initial problem I encountered whilst writing was that when you iterate the submitted request parameters, the order they come out will be at random.   So you can either parse the request query itself OR give your form fields names which when alphabetically sorted will make sense.  The latter is the quickest method.. Anyway here is the servlet, It uses collections to first construct a List, which you can then use Collections to sort, and finally use Collections again to create a new Enumeration of the sorted list.  Enough babble heres the code :</p>
<pre>
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException{ 

StringBuffer sb = new StringBuffer();
sb.append("The following information was posted via the website;\n\n");

// Sort the list
List paramList = Collections.list(request.getParameterNames());
Collections.sort(paramList);
Enumeration sortedList = Collections.enumeration(paramList);

// iterate the list and append to a StringBuffer
for (Enumeration e = sortedList; e.hasMoreElements();) {

String paramName = (String) e.nextElement();
String[] values = request.getParameterValues(paramName);
sb.append(paramName + " = " + values[0] + "\n");
sb.append("\n");
}

// Email admin the sorted form contents
Utils.Send_SMTP("mailer@dbws.net", Utils.adminEmails, "Website Form Submission", sb.toString());

request.getRequestDispatcher("thankyou.jsp").forward(request, response);
}</pre>
	

		]]></description>
	</item>
		<item>
		<title>Creating a pocket pc iPhone style picture button for the .NET compact framework</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2007/12/07/creating-a-pocket-pc-iphone-style-picture-button-for-the-net-compact-framework/&amp;id=14</link>
		<comments>http://www.dbws.net/blog/2007/12/07/creating-a-pocket-pc-iphone-style-picture-button-for-the-net-compact-framework/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 10:30:37 +0000</pubDate>
		
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2007/12/07/creating-a-pocket-pc-iphone-style-picture-button-for-the-net-compact-framework/</guid>
		<description><![CDATA[<p>The Compact framework gives you a button control, but with no image  or picture option. It also gives you a PictureBox control which of  course you can assign an onclick event to, but there is no border or  any control over the appearance when it is clicked on. So this article  describes how to create a custom usercontrol with additional appearance  options that can be set at design time such as a Label, a Border and  font specifics. I will also add code so the user can see an obvious  ‘click’ taking place. I will post a link to the entire source code and test application at the end of this article.</p>
<p>I am using Visual Studio 2005, with Compact Framework 2 SDK. I will  target the Pocket PC 2003 platform but this will run on Windows Mobile  5 and 6 with no change to code.</p>
<p>First of all we must setup the development environment.</p>
<p>Start by creating a new project (see figure1).</p>
<p><a href="/blog/images/NewUserControlProject.JPG" target="_blank"><img src="/blog/images/NewUserControlProject.JPG" alt="new User control project" height="353" width="500" /></a><br />
<strong><em>(figure 1)</em></strong></p>
<p>You now have your blank canvas to begin creating your control but  first we should change the name of the control to something more  meaningful.<br />
In the Solution explorer right click the UserControl1.cs and choose  rename, I have renamed my control to PictureButtonControl.cs. You will  be prompted whether you wish to rename all references to UserControl1,  click Yes.</p>
<p>One particular feature I have liked about Visual Studio, from the  early days is the ability to add multiple project types to a solution  and the way the projects are aware of each other. Because of this we  can add a new Device Application project which will allow us to test  the control as we develop it.</p>
<p>So lets add the Test project now, again in Solution explorer right  click the solution and click Add, then “New Project&#8230;”. In the dialog  that appears choose Device Application and give it a meaningful name  (see figure2).</p>
<p><a href="/blog/images/NewDeviceApplication.JPG" target="_blank"><img src="/blog/images/NewDeviceApplication.JPG" alt="New Device Application" height="316" width="500" /></a><br />
<em><strong>(figure 2)</strong></em></p>
<p>Your solution explorer should now show both the UserControl project and the Testing Project(see figure3).</p>
<p><img src="/blog/images/SolutionExplorerAfterAddingDAProject.JPG" alt="solution explorer" /><br />
<strong><em>(figure 3)</em></strong></p>
<p>Now we can begin to add some functionality to our control.</p>
<p>Lets start by adding the most important component of this control  which is the PictureBox. Reselect our user control and drag a  PictureBox control over to the empty control in the designer.  Alternatively double click the PictureBox control and it will also be  added to our control.</p>
<p>I’m going to apply a slight amount of padding around the picturebox  control by setting its location property to 3,3. I have set the size  property to 80, 70. To apply equal padding on the right side of our  control I have set the width of our control to 86. (figure 4).</p>
<p><img src="/blog/images/ControlStage1.JPG" alt="usercontrol with picturebox" /><br />
<em><strong>(figure 4)</strong></em></p>
<p>Next we need to provide a method of getting a picture into our  control for whoever will be using our control in a design environment.  To do this we create a public property within our control which when  set will in turn set the property of the private PictureBox control.</p>
<p>Begin by bring up the code for our PictureButtonControl.cs class.  Not much to see at the moment.</p>
<pre>namespace PictureButton {
	public partial class PictureButtonControl : UserControl
	{
		public PictureButtonControl()
		{
			InitializeComponent();
		}
	}
}</pre>
<p>After the constructor enter the following code;</p>
<pre>public Image ButtonImage{
	get
	{
		return pictureBox1.Image;
	}

	set
	{
		pictureBox1.Image = value;
		this.Refresh();
	}
}</pre>
<p>This code declares a new property ButtonImage which will appear in  the properties inspector at design time and acts as a proxy between our  control and the underlying PictureBox within our control.</p>
<p>We can test this functionality immediately by first building the  solution and then moving to our test application, so first press F6 to  build the solution and then double click Form1.cs in the solution  explorer. You should see an empty PDA image waiting for us to design  our test app.</p>
<p>More importantly if you scan the toolbox you should now see our new custom control(see figure 5);</p>
<p><img src="/blog/images/ControlInToolbox.JPG" alt="image showing our custom control appearing in toolbox" /><br />
<em><strong>(figure 5)</strong></em></p>
<p>Double click our control in the toolbox to place an instance on the  test application form(figure 6). The control should now appear in our  test form and if you look at the properties window, you will see our  custom property – ButtonImage.</p>
<p><a href="http://www.dbws.net/blog/images/ControlOnForm1.JPG" target="_blank"><br />
<img src="http://www.dbws.net/blog/images/ControlOnForm1.JPG" alt="Showing Contontrol on form" height="343" width="500" /><br />
<em><strong>(figure 6)</strong></em></a></p>
<p>Select the ButtonImage property, and click the &#8230; button to select  an image from your computer that you would like to use on the button,  choose a small picture.<br />
Once selected you should see the image you chose appear in the PictureBox of our control(figure 7).</p>
<p><img src="/blog/images/ImageLoadedOntoPicturebox.JPG" alt="Showing first image on control" /><br />
<strong><em>(figure 7)</em></strong></p>
<p>We should think about sizing issues here since at the moment our  user control may and will be resized by users as they design their  forms, so we should capture that resize event and resize our picture  box accordingly. So switching back to our control design and selecting  our control we can look at the events listed in the properties window  and create a ‘resize’ event. This will automatically create the stub  below for you.</p>
<pre>private void PictureButtonControl_Resize(object sender, EventArgs e)</pre>
<p>Edit the code so it reads as below, this will adjust the size of the  picturebox keeping the 3 pixel padding to the size of the user control;</p>
<pre>private void PictureButtonControl_Resize(object sender, EventArgs e){            	pictureBox1.Width = this.Width - 6;	pictureBox1.Height = this.Height -6;}</pre>
<p>Lets quickly test the behavior. First remove the instance of the  existing control we have on our test application form and rebuild the  solution pressing F6. Recreate an instance of the control on the form  and try resizing the control, you should see the picturebox resizing  with our control.</p>
<p>We need to see how that works when we have an image, so using the  properties window, select the ButtonImage and load an image into the  control and retry the resizing.</p>
<p>Notice how the image itself does not resize even though our control  is resizing correctly, this means we should also expose the SizeMode  property of the PictureBox by creating a new custom property. Switching  back to the PictureButtonControl class I will add a new property called  SizeMode.</p>
<p>Add the following code to your user control class.</p>
<pre>// SizeMode - Defines Picturebox image sizing strategy.

public System.Windows.Forms.PictureBoxSizeMode SizeMode
{
	get
	{
		return pictureBox1.SizeMode;
	}

	set
	{
		pictureBox1.SizeMode = value;
		this.Refresh();
	}
}</pre>
<p>This will give us a new property called SizeMode in our usercontrol  which behaves exactly the same as if we are editing the SizeMode  property of the PictureBox directly.</p>
<p>You can try testing this yourself, make sure you first remove the  control from the test application form before rebuilding the solution.</p>
<p>I want to know think about having a label option, so that we can  give the user the opportunity to include a label as well as set its  various cosmetic properties such as font and colour. Begin by resizing  the user control design so we have space at the bottom, the size in my  example is now 86, 100. Next add a label to the control and position it  at the space we created. I have set the anchor to Bottom, Left, Right,  and set the TextAlign property to TopCenter.</p>
<p>I will add a set of properties using the same technique as before for Font, Forecolor, and Text.</p>
<p>We will also need to adjust our resizing event, so that it takes into account the label height when resizing the PictureBox.</p>
<p>The entire code for my user control class is now;</p>
<pre>using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Text;using System.Windows.Forms;

namespace PictureButton{    public partial class PictureButtonControl : UserControl    {        public PictureButtonControl()        {            InitializeComponent();        }        // PictureBox properties        // ButtonImage - Specifys image to be displayed        public Image ButtonImage        {            get            {                return pictureBox1.Image;            }            set            {                pictureBox1.Image = value;                this.Refresh();            }        }        // SizeMode - Defines Picturebox image sizing strategy.

        public System.Windows.Forms.PictureBoxSizeMode SizeMode        {            get            {                return pictureBox1.SizeMode;            }            set            {                pictureBox1.SizeMode = value;                this.Refresh();            }        }

        // Label Properties        // Text - Defines text to show on label        public String LabelText        {            get            {                return label1.Text;            }            set            {                label1.Text = value;                this.Refresh();            }        }

        // Font - Defines label font        public Font LabelFont        {            get            {                return label1.Font;            }            set            {                label1.Font = value;                this.Refresh();            }        }

        // ForeColor - Defines label forecolor        public Color LabelForeColor        {            get            {                return label1.ForeColor;            }

            set            {                label1.ForeColor = value;                this.Refresh();            }        }

        private void PictureButtonControl_Resize(object sender, EventArgs e)        {                        pictureBox1.Width = this.Width - 6;            pictureBox1.Height = this.Height - (label1.Height + 6);        }    }}</pre>
<p>Now I have an image that resizes accordingly, and a customisable  label it would be a good idea to give our control a test, so again  remove the existing control from the test app form, rebuild the  solution and add our control. Now you will be able to change the label  as well as add an image and resize the control to best display the  image.</p>
<p>Figure 8 shows the current control in our designer, and figure 9  shows the same control running within our test app on the emulator.</p>
<p><img src="http://www.dbws.net/blog/images/designmode%20with%20label.JPG" alt="Control in designer" /><em><strong><br />
(figure <img src='http://www.dbws.net/blog/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> </strong></em></p>
<p><em><strong><img src="http://www.dbws.net/blog/images/running%20in%20emulator%20with%20label.JPG" alt="control running in test app on emulator" /></strong></em><br />
<em><strong>(figure 9)</strong></em></p>
<p>The next stage is to add visual indication to show that the button  has been clicked, a common approach is to supply an additional image  that should be shown in place of our standard image when the button is  clicked. Without going into image editing a quick way to produce an  appropriate image is to create a grey scaled version of the original.</p>
<p>Again we will need to add a new property called ButtonImageClick  along with a private variable to hold the reference to the image.</p>
<p>Create</p>
<pre>private Image _ButtonImageClick;
private Image _ButtonImage; // Used for temp holder of main image</pre>
<p>and</p>
<pre>	// MouseDown event for our control
	private void PictureButtonControl_MouseDown(object sender, MouseEventArgs e)
	{
		if (_ButtonImageClick != null)
		{
			_ButtonImage = pictureBox1.Image;
			pictureBox1.Image = _ButtonImageClick;
			Refresh();
		}
	}
	// MouseUp event for our control
	private void PictureButtonControl_MouseUp(object sender, MouseEventArgs e)
	{
		if (_ButtonImage != null)
		{
			pictureBox1.Image = _ButtonImage;
			Refresh();
		}
	}

	private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
	{
		this.OnMouseDown(e);
	}

	private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
	{
		this.OnMouseUp(e);
	}

	private void pictureBox1_Click(object sender, EventArgs e)	{		this.OnClick(e);	}</pre>
<p>This will allow us to specify an image that should be display when the  user clicks a button, however it does not perform and swapping of  images. We have to also capture the mouse down events for the  PictureBox and call the MouseDown/Up event of our control.</p>
<p>Test the control again now, loading both images and you should have a functional custom control that redraws accordingly when clicked.</p>
<p>By now you can see how easy it is to add custom properties to the control and alter the behaviour accordingly, from here it is really up to you how far you want to carry on customising the control.</p>
<p>Other options you can quickly add now are options like whether to change the border state when pressed, or change the background colour of the control, or the color of the label. You could also extract the mouseDown event code and place it in its own method that we can call from the Key Down event as well as the Mouse Down Event. A consideration might be to show an indication when the control has focus, and again when the control loses focus, this may be a border or a background colour change.</p>
<p>A future task  is to draw the original image in grey at runtime on a click event, so the user who is designing with our control does not have to perform the additional step of creating a greyscale image themselves. I would also like to discover a better way of passing the events from the PictureBox up to our usercontrol, otherwise there will be a growing amount of code capturing all the events. This could really get messy if you had to create a usercnotrol that contains many controls, then you&#8217;d have to capture and pass up the chain lots of events. I&#8217;m sure there must be a way to state that I only want our control to register events and none of the controls within our control.</p>
<p>Well thats about the end of this article, I hope someone out there finds it useful.</p>
<p><a href="http://www.dbws.net/blog/attach/entire_picture_button_solution.zip"><img src="http://www.dbws.net/blog/blog/images/download.jpeg" alt="Download source code for this article" align="absmiddle" border="0" height="48" hspace="5" width="48" />Download Entire Source Code &amp; Test Application Solution</a> (75k)</p>
	

		]]></description>
	</item>
		<item>
		<title>How to backup a folder &#038; exclude all images</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2007/06/09/how-to-backup-a-folder-exclude-all-images/&amp;id=13</link>
		<comments>http://www.dbws.net/blog/2007/06/09/how-to-backup-a-folder-exclude-all-images/#comments</comments>
		<pubDate>Sat, 09 Jun 2007 11:40:11 +0000</pubDate>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2007/06/09/how-to-backup-a-folder-exclude-all-images/</guid>
		<description><![CDATA[<p>The code below will first create a file called Exclude containing the paths to all common document files I wish to exclude from my backup, images, documents etc.</p>
<p>Secondly the tar command will be used to create a compressed tgz containing everything in the given folder and recursive folders excluding the files as detected.</p>
<p>&nbsp;<textarea rows="5" cols="55" name="Test">   find ./folderIwantBackingUp/ ! -type d -print | egrep &#8216;/,|%$|~$|\.old$|\.mpg$|\.zip$|\.wmv$|\.mp3$|\.MP3$|\.mp4$|\.MP4$|\.av2$|\.ppt$|\.dir$|\.pps$|\.qt$|SCCS|/core$|\.o$|\.orig$|\.mpeg$|\.mov$|\.doc$|\.xls$|\.pdf$|\.swf$|\.fla$|\.wav$|\.aif$|\.aiff$|\.mp3$|\.jpg$|\.JPG$|\.jpeg$|\.JPEG$|\.gif$|\.GIF$|\.png$|\.PNG$|\.psd$|\.PSD$|\.tar.gz$|\.tgz$|\.TGZ$|\.tif$|\.TIF$|\.tiff$|\.TIFF$|\.tga$|\.TGA$|\.ram$|\.rm$|\.rma$|\.psd$|\.PSD$|\.ai$|\.AI$&#8217; &gt; Exclude     tar czfX ~/myBackup.tgz Exclude ./folderIwantBackingUp/</textarea></p>
	

		]]></description>
	</item>
		<item>
		<title>Superbase &#038; Vista Premium/Bus/Ultimate</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2007/05/23/superbase-vista-premiumbusultimate/&amp;id=12</link>
		<comments>http://www.dbws.net/blog/2007/05/23/superbase-vista-premiumbusultimate/#comments</comments>
		<pubDate>Wed, 23 May 2007 07:59:02 +0000</pubDate>
		
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2007/05/23/superbase-vista-premiumbusultimate/</guid>
		<description><![CDATA[<p>I have discovered an issue relevant to Premium edition upwards. One of my SB  apps uses the Win API call FindWindow to check if an instance of the  application is already running.&nbsp; The FindWindow call takes two  parameters a &#39;class&#39; and the window caption you are looking for. </p>
<p>If you&#39;re not sure of the class you can send a 0 in the class parameter  (There is also a slight change in the REGISTER definition). </p>
<p>Anyway the problem I ran into was when I exited my application and ran  it a second time, It would act as if there is an instance already  running and not allow itself to run.&nbsp; Killing the NTVDM would make no  difference. </p>
<p>So I wrote a little app to go through an enumeration of the available  windows in the system and sure enough there was a window there with the  same caption as my applications, Even though my app is no longer running  and NTVDM was killed. </p>
<p>The thing I noted was the windows class name was &quot;ThumbnailClass&quot; -  Which I&#39;m pretty sure is to do with Vista&#39;s &quot;Desktop Window Manager&quot;  fancy effects it uses for task switching. It shows you a thumbnail image  of your application while you switch tasks. Now why this would still be  present when my application is no longer running is beyond me, perhaps  its a synchronisation problem between the Win16 layer windows  enumeration and the Desktop Window Manager.&nbsp; However the problem is  existant on the Business edition and I presume the Premium edition as  the fancy Aero effects dont come with&nbsp; the Basic edition. </p>
<p>So the solution I used was to find the class of the Superbase  application window and also use that in my call to FindWindow. </p>
<p>So if you&#39;re checking for a class name the REGISTER definition will be: </p>
<p>REGISTER &quot;USER&quot;,&quot;FindWindow&quot;,&quot;HCC&quot; </p>
<p>if you dont know the class name and will pass a 0 instead it will be: </p>
<p>REGISTER &quot;USER&quot;,&quot;FindWindow&quot;,&quot;HJC&quot; </p>
<p>And to get the handle of a window of a SB Application by its caption the  call will be: </p>
<p>hwnd% = CALL (&quot;FindWindow&quot;,&quot;SBV3DATACLASS&quot;,caption$)</p>
	

		]]></description>
	</item>
		<item>
		<title>Sending a fax via email on vista. (MAPI)</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2007/05/19/sending-a-fax-via-email-on-vista-mapi/&amp;id=11</link>
		<comments>http://www.dbws.net/blog/2007/05/19/sending-a-fax-via-email-on-vista-mapi/#comments</comments>
		<pubDate>Sat, 19 May 2007 17:25:13 +0000</pubDate>
		
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2007/05/19/sending-a-fax-via-email-on-vista-mapi/</guid>
		<description><![CDATA[<p>Just a few short notes to remind myself and anyone else how I got faxing working on vista.</p>
<p>Firstly you must have Vista Business or Ultimate edition as they are the only Vista editions that ship with Windows Fax &amp; Scan.</p>
<p>To configure Outlook to treat emails with the recipient format as [FAX:0123123] as faxes correctly, it must first be configured to use Fax Mail Transport.&nbsp;</p>
<p>To do this first make sure you run outlook as an administrator, to do this use explorer to navigate to &quot;/Program files/Microsoft Office/Office12&quot;, right click the Outlook application and select &quot;Run As Administrator&quot;.&nbsp; If you don&#39;t do this you will get errors when trying to add the fax mail transport.</p>
<p>Next when Outlook is loaded, Click Tools | Account Settings | Email tab - New&#8230; | Select Other - and highlight Fax Mail Transport and click Next.&nbsp; You should be prompted to restart outlook and that should be it.</p>
<p>To test, fire up Outlook again (the usual way - not as administrator) , create a new email and address it to [FAX:000] and click send.&nbsp; Once its sending you should see Windows Fax &amp; Scan pop up and attempt to process it.</p>
<p>You will then also be able to send faxes via MAPI. </p>
	

		]]></description>
	</item>
		<item>
		<title>Posting large xml documents from VB6 to a Java servlet.</title>
		<link>http://www.dbws.net/blog/fedclick.php?ref=http://www.dbws.net/blog/2007/05/18/posting-large-xml-documents-from-vb6-to-a-java-servlet/&amp;id=10</link>
		<comments>http://www.dbws.net/blog/2007/05/18/posting-large-xml-documents-from-vb6-to-a-java-servlet/#comments</comments>
		<pubDate>Fri, 18 May 2007 18:21:18 +0000</pubDate>
		
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dbws.net/blog/2007/05/18/posting-large-xml-documents-from-vb6-to-a-java-servlet/</guid>
		<description><![CDATA[<p>Posting XML from Visual Basic 6 is pretty straightforward.&nbsp; One would think.&nbsp; But like many development tasks which you&#39;d expect to take an hour or two, this one turned into a couple of days.</p>
<p>First of all, How are you going to get the XML across the wire ?&nbsp; To answer this the easiest method I discovered was to use the MSXML object, since I have already been using it to create my XML document.</p>
<p>But then which version is best ? There are 6 to choose from ! To answer that I would ask you if plan on distributing your application and dont mind also taking care to include the MSXML msi installer with your deployment. For my purposes I want to make the deployment as easy as possibly. You can pretty much rely on MSXML v3 being present on a target machine. If you dont mind deploying an MSXML msi, then go for version 6.&nbsp; So I went with version 3.</p>
<p>So far so good, I created my VB code to use MSXML3 to create the document and perform a HTTP post to my servlet which read it in without difficulty. </p>
<p>However the document being sent was 20k in length. That size might not be of significance to you but for me, this action maybe repeated up to 30 times, from many different machines so optimising bandwidth use was also a priority.</p>
<p>The immediate solution is to compress the data.&nbsp; Searching the web there are many compression components available for VB. However I dont want to pay for something and really just need to zip the data so I can unzip it from my servlet.&nbsp; I used the ZLIB library from http://www.zlib.net/.&nbsp; Very easy to use, simply reference zlib.dll from your project and you can either compress a string or a byte array which suits us perfectly.&nbsp;&nbsp;</p>
<p>Using ZLIB I took the original XML Documents xml source and first converted it to a byte array. Then using the compressData method from the ZLIB library, compressed the data. This took my 15k document down to 2k.</p>
<p>So now I&#39;ve got the compressed data,&nbsp; I can just post this ? No.&nbsp; It must be encoded first.&nbsp; Without going into why data crossing across the internet must be converted to 7 bit ASCII for succesful transmission, just accept that it does.</p>
<p>What encoding method should we use ? &nbsp;&nbsp; I repeatedly was having problems at this stage. You can specify that a XML node is intended to contain encoded binary by setting its data type to binary.base64.&nbsp; I had problems here because even though I did this, I was trying to insert a string representation of the compressed data into the nodes content.&nbsp; This would raise an error from MSXML.&nbsp; You HAVE to insert a byte array.</p>
<p>These problems led me to trying various other base64 encoding solutions, each giving different results !</p>
<p>So my working solution was to create a New XML Document containing a single element (I called it Data). The data type definition for data is set to binary.base64.&nbsp; As soon as I insert my compressed byte array into the &quot;Data&quot; node, it is automatically encoded to base64 so it can be transmitted successfully.</p>
<p>&nbsp;But not quite. I was still having issues..&nbsp; When my servlet decodes, then decompress the data&#8230; Its all in unicode !&nbsp; So I was unable to recreate an XML document on the servlet side.</p>
<p>&nbsp;It turned out the routine I used to convert the XML data as a String to a Byte array is creating unicode bytes.. Luckily I found an alternative routine which gives the option to use ASCII/Unicode.</p>
<p>&nbsp;Once that was sorted everything works great.. &nbsp; &amp; Also across HTTPS. So my XML transmission is fast and secure. </p>
<p>&nbsp;Source code examples on request.</p>
	

		]]></description>
	</item>
	</channel>
</rss>
