<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WimHaanstra.com</title>
	<atom:link href="http://www.wimhaanstra.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wimhaanstra.com</link>
	<description>WimHaanstra.com Corporate Website</description>
	<lastBuildDate>Thu, 02 Sep 2010 05:32:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Putting a UIPickerView on a UIActionSheet</title>
		<link>http://www.wimhaanstra.com/2010/09/01/putting-a-uipickerview-on-a-uiactionsheet/</link>
		<comments>http://www.wimhaanstra.com/2010/09/01/putting-a-uipickerview-on-a-uiactionsheet/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 20:24:50 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[uiactionsheet]]></category>
		<category><![CDATA[uipickerview]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=1002</guid>
		<description><![CDATA[Basically there are no really good (and now working) guides on how to put a UIPickerView on a UIActionSheet. Mainly because some things changed with the latest firmware updates made by Apple. Well after some fiddling around, I got it working. Here is how: Step 1: Adding the right delegates Make sure your current class [...]]]></description>
			<content:encoded><![CDATA[<p>Basically there are no really good (and now working) guides on how to put a UIPickerView on a UIActionSheet. Mainly because some things changed with the latest firmware updates made by Apple. Well after some fiddling around, I got it working. Here is how:</p>
<p><strong>Step 1: Adding the right delegates</strong><br />
Make sure your current class (probably a ViewController) uses the following delegates:<br />
</p>
<ul class="itemlist">
<li>UIActionSheetDelegate</li>
<li>UINavigationControllerDelegate</li>
<li>UIPickerViewDelegate</li>
<li>UIPickerViewDataSource</li>
</ul>
<p></p>
<p><span id="more-1002"></span></p>
<p><strong>Step 2: Trigger the UIActionSheet</strong><br />
Go to the method where you want to make the UIPickerView appear. In my case it is when I select a row from a table, but of course it could also be when you push a button or anything you want.</p>
<pre class="syntax c">
/* first create a UIActionSheet, where you define a title, delegate and a button to close the sheet again */
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@&quot;Select position&quot; delegate:self cancelButtonTitle:@&quot;Done&quot; destructiveButtonTitle:nil otherButtonTitles:nil];
/* I always give my controls a tag, to make sure I can work with multiple actionsheets in one View (to identify them when an event triggers */
actionSheet.tag = POSITION_ROW;
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;

/* Initialize a UIPickerView with 100px space above it, for the button of the UIActionSheet. */
UIPickerView* positionPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(0,100, 320, 216)];
positionPicker.dataSource = self;
positionPicker.delegate = self;

/* another unique tag for this UIPicker */
positionPicker.tag = POSITION_ROW;

/* Add the UIPickerView to the UIActionSheet */
[actionSheet addSubview:positionPicker];

/* Select the previous selected value, which for me is stored in 'currentPosition' */
[positionPicker selectRow:currentPosition inComponent:0 animated:NO];

/* clean up */
[positionPicker release];

/* Add the UIActionSheet to the view */
[actionSheet showInView:self.view];

/* Make sure the UIActionSheet is big enough to fit your UIPickerView and it's buttons */
[actionSheet setBounds:CGRectMake(0,0, 320, 411)];

/* clean up */
[actionSheet release];
</pre>
<p><strong>Step 3: Implementing the datasource and delegates for the UIPickerView</strong><br />
Now, the triggering of the UIActionSheet is now working, but you would also like to have some items in your UIPickerView. Well, take a look at the following code and read the comments.</p>
<pre class="syntax c">
/* Defines the total number of Components (like groups in a UITableView) in a UIPickerView */
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView;
{
    return 1;
}

/* What to do when a row from a UIPickerView is selected. This will trigger each time you scroll the UIPickerView, so only lightweight stuff. */
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
	overlayPosition = row;
	[tableSettings reloadData];
}

/* For me the number of items in the UIPickerView is known on compile time. So here I just return 3 */
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;
{
    return 3;
}

/* Because the UIPickerView expects a UIView for every row you insert in the UIPickerView, you need to make one. What I do here is really simple. I create a UILabel* and with each row it requests I just change the text in the UILabel. */
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
/* Create a UILabel and set it 40 pixels to the right, to make sure it is put nicely in the UIPickerView */
	UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(40, 0, 280, 25)] autorelease];
	label.textColor = [UIColor blackColor];
	label.backgroundColor = [UIColor clearColor];

	switch (row)
	{
		default:
		case kUnderClock:
			label.text = @&quot;Under clock&quot;;
			break;
		case kAboveSlider:
			label.text = @&quot;Above lock slider&quot;;
			break;
		case kCenter:
			label.text = @&quot;Vertically centered&quot;;
			break;
	}

	return label;
}
</pre>
<p><strong>Step 4: Do stuff when buttons on the UIActionSheet are clicked</strong><br />
Now, the final thing you have to do is make sure you listen to the events of the UIActionSheet also. So here is the code:</p>
<pre class="syntax c">
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
	if (actionSheet.tag == POSITION_ROW)
	{
/* Do stuff here, only intended for the right UIActionSheet. This only applies for when you use multiple UIActionSheets on the same ViewController. Closing it is unnecessary, because you already specified a destructive button. */
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/09/01/putting-a-uipickerview-on-a-uiactionsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Desktop Backgrounds HD</title>
		<link>http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/</link>
		<comments>http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 11:00:57 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[desktop backgrounds hd]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=854</guid>
		<description><![CDATA[For the iPhone 4 release, I started development of Desktop Backgrounds HD. This is a wallpaper application which takes your higher resolution retina screen in account when downloading images from the wallpaper server. The whole purpose was to actually make my application resolution independent. Desktop Backgrounds HD has the following features: Here are some screenshots [...]]]></description>
			<content:encoded><![CDATA[<p>For the iPhone 4 release, I started development of Desktop Backgrounds HD. This is a wallpaper application which takes your higher resolution retina screen in account when downloading images from the wallpaper server. The whole purpose was to actually make my application resolution independent.</p>
<p>Desktop Backgrounds HD has the following features:</p>
</p>
<ul class="itemlist">
<li>Over 14.000+ unique HD backgrounds available</li>
<li>Delivers the backgrounds to your phone in the right resolution (iPhone 3G, iPhone 4 and iPad)</li>
<li>Create an overlay, to show some text over your background (v1.1)</li>
<li>Dim backgrounds for better use behind your icons</li>
<li>Mail your backgrounds to a friend (you need to have a mail account setup on your device) (v1.1)</li>
<li>iOS 4 requirement (is this a feature?)</li>
<li>Intelligent caching system, to keep data-transfers low</li>
<li>Multi-task support</li>
</ul>
<p>
<p>Here are some screenshots for the application:<br />

<a href='http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/screenshot-2010-08-28-12-51-35/' title='Screenshot 2010.08.28 12.51.35'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/08/Screenshot-2010.08.28-12.51.35-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.08.28 12.51.35" title="Screenshot 2010.08.28 12.51.35" /></a>
<a href='http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/screenshot-2010-08-28-12-51-45/' title='Screenshot 2010.08.28 12.51.45'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/08/Screenshot-2010.08.28-12.51.45-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.08.28 12.51.45" title="Screenshot 2010.08.28 12.51.45" /></a>
<a href='http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/screenshot-2010-08-28-12-53-13/' title='Screenshot 2010.08.28 12.53.13'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/08/Screenshot-2010.08.28-12.53.13-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.08.28 12.53.13" title="Screenshot 2010.08.28 12.53.13" /></a>
<a href='http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/screenshot-2010-08-28-12-53-44/' title='Screenshot 2010.08.28 12.53.44'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/08/Screenshot-2010.08.28-12.53.44-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.08.28 12.53.44" title="Screenshot 2010.08.28 12.53.44" /></a>
<a href='http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/screenshot-2010-08-28-12-54-07/' title='Screenshot 2010.08.28 12.54.07'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/08/Screenshot-2010.08.28-12.54.07-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.08.28 12.54.07" title="Screenshot 2010.08.28 12.54.07" /></a>
<a href='http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/screenshot-2010-08-28-12-54-25/' title='Screenshot 2010.08.28 12.54.25'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/08/Screenshot-2010.08.28-12.54.25-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.08.28 12.54.25" title="Screenshot 2010.08.28 12.54.25" /></a>
<a href='http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/screenshot-2010-08-28-12-54-38/' title='Screenshot 2010.08.28 12.54.38'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/08/Screenshot-2010.08.28-12.54.38-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.08.28 12.54.38" title="Screenshot 2010.08.28 12.54.38" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/08/28/desktop-backgrounds-hd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending an email with an attachment from your iPhone</title>
		<link>http://www.wimhaanstra.com/2010/08/28/sending-an-email-with-an-attachment-from-your-iphone/</link>
		<comments>http://www.wimhaanstra.com/2010/08/28/sending-an-email-with-an-attachment-from-your-iphone/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 10:29:48 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[desktop backgrounds hd]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=840</guid>
		<description><![CDATA[For Desktop Backgrounds HD (which is currently in review) I wanted to implement a feature called &#8220;send image by email&#8221;. First I tried to include an image base64 encoded in an URL, with the mailto: protocol, but this resulted in numerous errors. So after a coupe of google searches, I came up with the following [...]]]></description>
			<content:encoded><![CDATA[<p>For Desktop Backgrounds HD (which is currently in review) I wanted to implement a feature called &#8220;send image by email&#8221;. First I tried to include an image base64 encoded in an URL, with the mailto: protocol, but this resulted in numerous errors.</p>
<p>So after a coupe of google searches, I came up with the following solution, follow these steps and you will be sending emails with attachments before you can say &#8220;emails with attachments&#8221; 250 times.</p>
<p><strong>Step 1</strong><br />
First add the MessageUI framework in your application.</p>
<p><strong>Step 2</strong><br />
The class you want to use the functionality in, should get the following 2 imports:</p>
<pre class="syntax c">#import &lt;MessageUI/MessageUI.h&gt;
#import &lt;MessageUI/MFMailComposeViewController.h&gt;</pre>
<p><strong>Step 3</strong><br />
Make sure your class listens to the MFMailComposeViewControllerDelegate.</p>
<p><strong>Step 4</strong><br />
Next up, is to add code to add an attachment to the mail composer and open it up.</p>
<pre class="syntax c">MFMailComposeViewController* composer = [[MFMailComposeViewController alloc] init];
composer.mailComposeDelegate = self;

[composer setSubject:@&quot;The subject of the email&quot;];
NSData *imageData = UIImagePNGRepresentation([UIImage imageNamed:@&quot;test.png&quot;], 1);
[composer addAttachmentData:imageData mimeType:@&quot;image/png&quot; fileName:@&quot;test.png&quot;];
NSString *emailBody = @&quot;Check out this amazing PNG!&quot;;
[composer setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:composer animated:YES];
[composer release];</pre>
<p><strong>Step 5</strong><br />
Add this method, to make sure you get back full control over your view-controller:</p>
<pre class="syntax c">- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
	[self dismissModalViewControllerAnimated:YES];
}</pre>
<p>In this last method you can also perform error checking, which is not included in this example. Hope this helps anyone, and if not&#8230; too bad :D</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/08/28/sending-an-email-with-an-attachment-from-your-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save an UIView to an UIImage in objective-C</title>
		<link>http://www.wimhaanstra.com/2010/08/25/save-an-uiview-to-an-uiimage-in-objective-c/</link>
		<comments>http://www.wimhaanstra.com/2010/08/25/save-an-uiview-to-an-uiimage-in-objective-c/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 14:14:55 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[desktop backgrounds hd]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[uiimage]]></category>
		<category><![CDATA[uiview]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=837</guid>
		<description><![CDATA[For an application I am making, I am making a view where users can configure all kinds of settings, which has direct effect on an UIView I have. I want to grab that UIView and save it as an image. Well there are examples enough about this, most of them are all the same, but [...]]]></description>
			<content:encoded><![CDATA[<p>For an application I am making, I am making a view where users can configure all kinds of settings, which has direct effect on an UIView I have. I want to grab that UIView and save it as an image.</p>
<p>Well there are examples enough about this, most of them are all the same, but there is one annoying thing. It saves the view in the good ol&#8217; resolution. Because I am making all my apps &#8220;retina-aware&#8221;, I wanted to change this.</p>
<p>So here is my code snippet of how I save an UIView to an UIImage:</p>
<pre class="syntax c">
UIGraphicsBeginImageContextWithOptions(myView.bounds.size, NO, [[UIScreen mainScreen] scale]);
[myView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
</pre>
<p>It automaticly takes care of any scaling, if there will be higher resolution iPhones/iPads in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/08/25/save-an-uiview-to-an-uiimage-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Note to self: how to convert hex codes in a NSString</title>
		<link>http://www.wimhaanstra.com/2010/08/10/note-to-self-how-to-convert-hex-codes-in-a-nsstring/</link>
		<comments>http://www.wimhaanstra.com/2010/08/10/note-to-self-how-to-convert-hex-codes-in-a-nsstring/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 07:23:53 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=828</guid>
		<description><![CDATA[I have been working with Freebase lately and they sometimes encode their strings, so that &#8220;special&#8221; characters are encoded in HEX. For example, sometimes you receive a string like this: Terminator_2$003A_Judgment_Day. I wanted to convert the weird encoding they use, so I wrote a piece of code for that. It might be that this could [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working with Freebase lately and they sometimes encode their strings, so that &#8220;special&#8221; characters are encoded in HEX.</p>
<p>For example, sometimes you receive a string like this: <strong>Terminator_2$003A_Judgment_Day</strong>. I wanted to convert the weird encoding they use, so I wrote a piece of code for that. It might be that this could be encoded some other way and then I would like to hear from you, but here is my code:</p>
<pre class="syntax c">
+ (NSString*) replaceHexInString:(NSString*) value
{
	NSRange range = [value rangeOfString:@&quot;$00&quot;];

	while (range.location != NSNotFound)
	{
		if (range.location + 5 &lt;= [value length])
		{
			NSString* hexValue = [value substringFromIndex:range.location];
			hexValue = [hexValue substringToIndex:5];
			NSString* newHexValue = [hexValue stringByReplacingOccurrencesOfString:@&quot;$&quot; withString:@&quot;0x&quot;];

			unsigned int dec;
			NSScanner *scan = [NSScanner scannerWithString:newHexValue];

			if ([scan scanHexInt:&amp;dec])
			{
				NSString* convertedValue = [NSString stringWithFormat:@&quot;%c&quot;, dec];
				value = [value stringByReplacingOccurrencesOfString:hexValue withString:convertedValue];
			}
		}

		range = [value rangeOfString:@&quot;$00&quot;];
	}
	return value;
}
</pre>
<p>I know this probably does not get the UTF-16 characters, but in my case I (hope to) know they won&#8217;t use them.</p>
<p>Well, that&#8217;s about it. Not sure if anyone can use this, but I do :D.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/08/10/note-to-self-how-to-convert-hex-codes-in-a-nsstring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using NLog in your web.config</title>
		<link>http://www.wimhaanstra.com/2010/07/08/using-nlog-in-your-web-config/</link>
		<comments>http://www.wimhaanstra.com/2010/07/08/using-nlog-in-your-web-config/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 07:48:52 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Nlog]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=778</guid>
		<description><![CDATA[I have been working on my YourRid.es project a bit lately and one of the things I wanted to put in place, was a good logging system. Most of the time I just use a custom build (read: my own shit) logger, but this time I found the time to browse the internet for some [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on my YourRid.es project a bit lately and one of the things I wanted to put in place, was a good logging system. Most of the time I just use a custom build (read: my own shit) logger, but this time I found the time to browse the internet for some good loggers.</p>
<p>After comparing a bit, I came to NLog and tried integrating this in my project. My project being build in Visual Studio 2010 has support for those nice web.config&#8217;s that can be transformed/malformed/adjusted while publishing. This was very necessary because my debug (local) build uses a different SQL instance than my production build.</p>
<p>So I just wanted to show you how I configured NLog in my web.config. It might be obvious for some people, but for others it might not.</p>
<p>In my normal web.config I added the following lines. First I added a new <strong>section</strong> row to my <strong>configSections</strong>.</p>
<pre class="syntax html">
&lt;configSections&gt;
	&lt;section name=&quot;nlog&quot; type=&quot;NLog.Config.ConfigSectionHandler, NLog&quot; requirePermission=&quot;false&quot;/&gt;
&lt;/configSection&gt;
</pre>
<p>After that I went and added the normal NLog configuration to my web.config.</p>
<pre class="syntax html">
&lt;nlog&gt;
 &lt;targets&gt;
 &lt;target type=&quot;Database&quot; connectionString=&quot;Data Source=(local)\SQLExpress;Initial Catalog=MyDatabase;Integrated Security=True&quot; dbProvider=&quot;mssql&quot; name=&quot;DatabaseTarget&quot;&gt;
 &lt;commandText&gt;
 insert into Log (TimeStamp, Level, Logger, Message, UserIdentity, CallSite) values(@time_stamp, @level, @logger, @message, @useridentity, @callsite);
 &lt;/commandText&gt;
 &lt;parameter name=&quot;@time_stamp&quot; layout=&quot;${date}&quot;/&gt;
 &lt;parameter name=&quot;@level&quot; layout=&quot;${level}&quot;/&gt;
 &lt;parameter name=&quot;@logger&quot; layout=&quot;${logger}&quot;/&gt;
 &lt;parameter name=&quot;@message&quot; layout=&quot;${message}&quot;/&gt;
 &lt;parameter name=&quot;@useridentity&quot; layout=&quot;${aspnet-user-identity}&quot; /&gt;
 &lt;parameter name=&quot;@callsite&quot; layout=&quot;${callsite}&quot; /&gt;
 &lt;/target&gt;
 &lt;/targets&gt;
 &lt;rules&gt;
 &lt;logger name=&quot;*&quot; minlevel=&quot;Debug&quot; writeTo=&quot;DatabaseTarget&quot; /&gt;
 &lt;/rules&gt;
&lt;/nlog&gt;
</pre>
<p>This is the information for my debug environment. Because my laptop run SQL express, it connects to that instance.</p>
<p>This is my web.config.release :</p>
<pre class="syntax html">
&lt;nlog&gt;
&lt;targets&gt;
		&lt;target xdt:Transform=&quot;SetAttributes&quot;
				xdt:Locator=&quot;Match(name)&quot;&Acirc;&nbsp;name=&quot;DatabaseTarget&quot;
				connectionString=&quot;Data&Acirc;&nbsp;Source=(local);Initial&Acirc;&nbsp;Catalog=MyDatabase;Integrated&Acirc;&nbsp;Security=True&quot;/&gt;
	&lt;/targets&gt;
&lt;/nlog&gt;
</pre>
<p>It changes the connectionstring when I publish my release version. I love that feature of Visual Studio 2010!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/07/08/using-nlog-in-your-web-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YourRides</title>
		<link>http://www.wimhaanstra.com/2010/05/25/yourrides/</link>
		<comments>http://www.wimhaanstra.com/2010/05/25/yourrides/#comments</comments>
		<pubDate>Tue, 25 May 2010 05:09:35 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Personal stuff]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[portfolio]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=771</guid>
		<description><![CDATA[I started the idea of YourRides after I joined a couple of car forums. I read a lot about people wanting to place pictures of their cars on the forum, but not knowing how to resize or host them properly and this is exactly what YourRides does. YourRides enables you to register an account using [...]]]></description>
			<content:encoded><![CDATA[<p>I started the idea of <a href="http://yourrid.es" target="_blank">YourRides</a> after I joined a couple of car forums. I read a lot about people wanting to place pictures of their cars on the forum, but not knowing how to resize or host them properly and this is exactly what <a href="http://yourrid.es" target="_blank">YourRides</a> does.<br/><br />
<a href="http://yourrid.es" target="_blank">YourRides</a> enables you to register an account using account details you already know by heart. You can use your Facebook, MSN, Gmail, Twitter, Yahoo or OpenID account to register and login. This way you dont have to remember what username/password you used for the site and we dont know either ;).<br/><br />
The idea behind YourRides is very simple:<br/></p>
</p>
<ul class="itemlist">
<li>You register for an account</li>
<li>You confirm your email address</li>
<li>You login and add a car, called &#8216;ride&#8217;. You can choose between thousands of different car-models in our database</li>
<li>After that you can start uploading pictures or make &#8216;picture groups&#8217;. These are groups that make it possible for you to categorize the pictures of your car</li>
<li>The pictures show up on our website and the website also provides you HTML or BBCode to easily place the pictures on a different forum</li>
<li>That&#8217;s it</li>
</ul>
<p>
<p>YourRides can host an unlimited amount of pictures for you and it supplies you with short URL&#8217;s to them.<br />
<br />
Currently there are already a lot of features, like commenting, rating and searching. But more features are planned to be added, but these will be revealed later on the site and via the <a href="http://www.twitter.com/YourRides" target="_blank">YourRides twitter account<a/>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/05/25/yourrides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Queueing HTTP requests in objC</title>
		<link>http://www.wimhaanstra.com/2010/04/21/queueing-http-requests-in-objc/</link>
		<comments>http://www.wimhaanstra.com/2010/04/21/queueing-http-requests-in-objc/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 18:55:51 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=742</guid>
		<description><![CDATA[For WallPaper I download numerous thumbnails from my webserver at the same time. This is causing slowing speeds (to many threads at once), and too much memory usage (too much image data cached at once). So I looked in queueing the downloads and tried (ofcourse) writing my own QueueHandler class. After I written and spend [...]]]></description>
			<content:encoded><![CDATA[<p>For WallPaper I download numerous thumbnails from my webserver at the same time. This is causing slowing speeds (to many threads at once), and too much memory usage (too much image data cached at once).</p>
<p>So I looked in queueing the downloads and tried (ofcourse) writing my own QueueHandler class. After I written and spend a couple of hours bughunting/testing my QueueuHandler, I came to the <strong>awesome</strong> idea to see what the iPhone SDK supplies for this kind of jobs :D (you DO read my sarcasm, dont you?).</p>
<p>I am using <a title="ASIHTTPRequest Website" href="http://allseeing-i.com/ASIHTTPRequest/" target="_blank">ASIHTTPRequest</a> for my web-requests in WallPaper. I will just show you how I queue my downloads and when the download finishes, I put the image in a predefined and created UIImageView.</p>
<p>I first declare a couple of variables in my <strong>.h</strong> file.</p>
<pre class="syntax c">NSMutableArray* downloadQueue;
NSOperationQueue* queue;</pre>
<p>I added some UIImageView&#8217;s to a view and I put them and the download URL in a NSMutableDictionary, like this:</p>
<pre class="syntax c">NSMutableDictionary* threadArguments = [[NSMutableDictionary alloc] init];

[threadArguments setObject:myUrl forKey:@&amp;quot;url&amp;quot;];
[threadArguments setObject:myImageView forKey:@&amp;quot;iv&amp;quot;];

[self addToDownloadQueue:threadArguments];</pre>
<p>The <strong>addToDownloadQueue</strong> method does something like this after that (<strong>threadArguments</strong> is the parameter the method is receiving).</p>
<pre class="syntax c">// Add the object to the NSMutableArray I got stored.
[downloadQueue addObject:threadArguments];
if (!queue)
{
	queue = [[NSOperationQueue alloc] init];
	[queue setMaxConcurrentOperationCount:1];
}

NSString* threadUrl = [threadArguments valueForKey:@&amp;quot;url&amp;quot;];
NSURL* downloadUrl = [NSURL URLWithString:threadUrl];
ASIHTTPRequest* request = [ASIHTTPRequest requestWithURL:downloadUrl];
[request setDelegate:self];
[request setDidFinishSelector:@selector(downloadDone:)];
[request setDidFailSelector:@selector(downloadFailed:)];</pre>
<p>I put the <strong>MaxConcurrentOperationCount</strong> on <strong>1</strong> to make sure the application sends the requests for thumbnails one by one (going easy on your bandwidth and on my server).</p>
<p>Now we need to implement the FinishSelector and the FailSelector methods to catch the downloads that are finished and put the downloaded image in the pre-created UIImageView.</p>
<pre class="syntax c">- (void)downloadFailed:(ASIHTTPRequest *)request
{
	NSLog(@&amp;quot;Downloading failed?&amp;quot;);
}

- (void)downloadDone:(ASIHTTPRequest *)request
{
	NSString* downloadUrl = [request.url absoluteString];

	NSMutableDictionary* foundObj = nil;

	for (NSMutableDictionary* dict in downloadQueue)
	{
		NSString* queueUrl = [dict valueForKey:@&amp;quot;url&amp;quot;];

		if ([downloadUrl isEqualToString:queueUrl])
		{
			UIImageView* iv = (UIImageView*)[dict valueForKey:@&amp;quot;iv&amp;quot;];
			NSData* imageData = request.rawResponseData;

			if (iv != nil)
				iv.image = [UIImage imageWithData:imageData];

			foundObj = dict;
		}
	}

	if (foundObj != nil)
		[downloadQueue removeObject:foundObj];
}</pre>
<p>*Ok, somehow my code syntax highlighting screws up the indenting.*</p>
<p>Well, I hope you can use something of my weird code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/04/21/queueing-http-requests-in-objc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WallPaper 3.0</title>
		<link>http://www.wimhaanstra.com/2010/02/20/wallpaper-3-0-submitted/</link>
		<comments>http://www.wimhaanstra.com/2010/02/20/wallpaper-3-0-submitted/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 19:54:58 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[AppStore]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[wallpaper]]></category>

		<guid isPermaLink="false">http://www.depl0y.com/?p=602</guid>
		<description><![CDATA[Finally! WallPaper 3.0 is submitted to the AppStore. When the application is approved, I will update this post, but here is a quick summary of the changes. New features:]]></description>
			<content:encoded><![CDATA[<p>Finally! WallPaper 3.0 is submitted to the AppStore. When the application is approved, I will update this post, but here is a quick summary of the changes.</p>
<p><strong>New features:</strong><br />
</p>
<ul class="itemlist">
<li>Completely new code, more efficient, more stable</li>
<li>Thumbnails look nicer and higher quality than before</li>
<li>Search through wallpapers! Every wallpaper is tagged which makes finding it a lot easier!</li>
<li>WallPapers are VERY high quality, supplied by TheWallpapers.org</li>
<li>Option to choose whether to save the full image, or just a cropped version</li>
<li>WallPaper 3 supports loadbalancing! Get the fastest server for your location!</li>
<li>Support multiple resolutions, good for when a new iPhone comes out with higher resolution screen</li>
<li>Upload your own images in a higher quality, no compression used!</li>
<li>Completely multi-threaded. No more &#8216;stuck&#8217; GUI&#8217;s</li>
<li>Fixed a couple of memory leaks</li>
</ul>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/02/20/wallpaper-3-0-submitted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WallPaper GUI Updated</title>
		<link>http://www.wimhaanstra.com/2010/02/16/wallpaper-gui-updated/</link>
		<comments>http://www.wimhaanstra.com/2010/02/16/wallpaper-gui-updated/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 18:58:25 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[AppStore]]></category>
		<category><![CDATA[wallpaper]]></category>

		<guid isPermaLink="false">http://www.depl0y.com/?p=592</guid>
		<description><![CDATA[Ok just a small update post, to show you that I am not dead, lost, gone crazy or anything else. The GUI of WallPaper is still under heavy development and I am looking for the nicest way to manage this 22.000+ wallpaper library. So here are some screenshots. Not every screen is made yet, but [...]]]></description>
			<content:encoded><![CDATA[<p>Ok just a small update post, to show you that I am not dead, lost, gone crazy or anything else.</p>
<p>The GUI of WallPaper is still under heavy development and I am looking for the nicest way to manage this 22.000+ wallpaper library. So here are some screenshots. Not every screen is made yet, but it will be finished by the end of the week (hopefully).</p>

<a href='http://www.wimhaanstra.com/2010/02/16/wallpaper-gui-updated/screenshot-2010-02-16-19-50-08/' title='Screenshot 2010.02.16 19.50.08'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/02/Screenshot-2010.02.16-19.50.081-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.02.16 19.50.08" title="Screenshot 2010.02.16 19.50.08" /></a>
<a href='http://www.wimhaanstra.com/2010/02/16/wallpaper-gui-updated/screenshot-2010-02-16-19-50-20/' title='Screenshot 2010.02.16 19.50.20'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/02/Screenshot-2010.02.16-19.50.201-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.02.16 19.50.20" title="Screenshot 2010.02.16 19.50.20" /></a>
<a href='http://www.wimhaanstra.com/2010/02/16/wallpaper-gui-updated/screenshot-2010-02-16-19-50-30/' title='Screenshot 2010.02.16 19.50.30'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/02/Screenshot-2010.02.16-19.50.301-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.02.16 19.50.30" title="Screenshot 2010.02.16 19.50.30" /></a>
<a href='http://www.wimhaanstra.com/2010/02/16/wallpaper-gui-updated/screenshot-2010-02-16-19-50-37/' title='Screenshot 2010.02.16 19.50.37'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/02/Screenshot-2010.02.16-19.50.371-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.02.16 19.50.37" title="Screenshot 2010.02.16 19.50.37" /></a>
<a href='http://www.wimhaanstra.com/2010/02/16/wallpaper-gui-updated/screenshot-2010-02-16-19-50-44/' title='Screenshot 2010.02.16 19.50.44'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/02/Screenshot-2010.02.16-19.50.441-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.02.16 19.50.44" title="Screenshot 2010.02.16 19.50.44" /></a>
<a href='http://www.wimhaanstra.com/2010/02/16/wallpaper-gui-updated/screenshot-2010-02-16-19-50-55/' title='Screenshot 2010.02.16 19.50.55'><img width="150" height="150" src="http://www.wimhaanstra.com/wp-content/uploads/2010/02/Screenshot-2010.02.16-19.50.551-150x150.png" class="attachment-thumbnail" alt="Screenshot 2010.02.16 19.50.55" title="Screenshot 2010.02.16 19.50.55" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.wimhaanstra.com/2010/02/16/wallpaper-gui-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
