<?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:rssdatehelper="urn:rssdatehelper"><channel><title>Bayshield</title><link>http://www.bayshield.com</link><pubDate></pubDate><generator>umbraco</generator><description>Thoughts, ideas and insight into the latest iPhone, ASP.Net and umbraco developments.</description><language>en</language><item><title>MonoTouch SQLite Performance Tip</title><link>http://www.bayshield.com/2010/6/29/monotouch-sqlite-performance-tip</link><pubDate>Tue, 29 Jun 2010 02:12:56 GMT</pubDate><guid>http://www.bayshield.com/2010/6/29/monotouch-sqlite-performance-tip</guid><description>A simple update to .Net data access code improved data access performance by 60%.</description><content:encoded><![CDATA[ 
<p>DataReaders are the fastest ways to access data in .Net, and
most MonoTouch SQLite tutorials use them to access SQLite
data&nbsp;using the following &nbsp;syntax:</p>

<p>string variable = reader["MyDBField"];</p>

<p>This syntax is very easy to read however it doesn't perform very
well. &nbsp;The data reader has several inbuilt methods for reading
values including:</p>

<ul>
<li>GetInt32()</li>

<li>GetDouble()</li>

<li>GetString()</li>
</ul>

<p>Using these methods improved the performance of my MonoTouch -
SQLite application by a little over 60%. &nbsp;The only downside is
that you need to access the data colums using their ordinal values.
i.e.</p>

<p>string variable = reader.GetString(0);</p>

<p>This can be a little harder to maintain, however provided you
aren't using "select *" syntax, the extra effort will result in a
nice performance increase.</p>

<p>&nbsp;</p>
]]></content:encoded></item><item><title>Recommended social media avatar sizes</title><link>http://www.bayshield.com/2010/6/1/recommended-social-media-avatar-sizes</link><pubDate>Tue, 01 Jun 2010 07:52:03 GMT</pubDate><guid>http://www.bayshield.com/2010/6/1/recommended-social-media-avatar-sizes</guid><description>A guide to the recommended sizes for avatar's on the various social media sites including twitter and facebook.</description><content:encoded><![CDATA[ 
<p>If you are looking to create a new avatar to use for your online
presence, the following list will show you the recommended sizes
for each of the online services. &nbsp;The original source of this
information can be found <a
href="http://www.personalbrandingblog.com/the-2009-personal-avatar-size-reference-guide/">
here</a>. &nbsp;All sizes below are in pixels unless otherwise
stated.</p>

<ul>
<li>Twitter - 73x73</li>

<li>LinkedIn - 80x80</li>

<li>Facebook - 200x200</li>

<li>Skype - 96x96</li>

<li>Google - 96x96</li>

<li>FriendFeed - 75x75</li>

<li>Gravatar - 50x50</li>

<li>MySpace - 158x158</li>

<li>Digg - 120x120</li>

<li>StumbleUpon - 48x48</li>
</ul>
]]></content:encoded></item><item><title>FTP upload with .Net</title><link>http://www.bayshield.com/2010/5/20/ftp-upload-with-net</link><pubDate>Thu, 20 May 2010 10:32:46 GMT</pubDate><guid>http://www.bayshield.com/2010/5/20/ftp-upload-with-net</guid><description>Shows how to write a simple FTP upload client in .Net using c#.</description><content:encoded><![CDATA[ 
<p>If you are looking for a simple way for your application to move
files between remote servers than it is worth considering FTP.
&nbsp;The following code shows how simple it is to upload a file
via FTP with c#.</p>

<!-- code formatted by http://manoli.net/csharpformat/ -->
<pre class="csharpcode">
<span class="rem">// File to be uploaded</span>
<span class="kwrd">string</span> fileName = <span
class="str">@"c:\temp\MyFile.zip"</span>;

<span
class="rem">// URL containg remote location and name of file</span>
<span class="kwrd">string</span> remoteServer = <span
class="str">"ftp://[ServerName]/"</span> + Path.GetFileName(fileName);

<span
class="rem">// Please don't store userNames and passwords like this!</span>
<span class="kwrd">string</span> userName = <span
class="str">""</span>;
<span class="kwrd">string</span> pass = <span
class="str">""</span>;

<span class="rem">//Create the request</span>
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(remoteServer);
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = <span
class="kwrd">new</span> NetworkCredential(userName, pass);
request.UsePassive = <span class="kwrd">true</span>;
request.UseBinary = <span class="kwrd">true</span>;
request.KeepAlive = <span class="kwrd">false</span>;

<span
class="rem">// Read the file to be uploaded into a byte array</span>
FileStream stream = File.OpenRead(fileName);
<span class="kwrd">byte</span>[] buffer = <span
class="kwrd">new</span> <span
class="kwrd">byte</span>[stream.Length];
stream.Read(buffer, 0, buffer.Length);
stream.Close();

<span
class="rem">// Get the stream for the request and write the byte array to it</span>
Stream reqStream = request.GetRequestStream();
reqStream.Write(buffer, 0, buffer.Length);
reqStream.Close();
</pre>
]]></content:encoded></item><item><title>Blog4Umbraco database cleanup</title><link>http://www.bayshield.com/2010/5/17/blog4umbraco-database-cleanup</link><pubDate>Mon, 17 May 2010 06:20:05 GMT</pubDate><guid>http://www.bayshield.com/2010/5/17/blog4umbraco-database-cleanup</guid><description>A couple of SQL scripts to remove unused tags and old data from your blog4umbraco installation.</description><content:encoded><![CDATA[ 
<p>I recently set about consolidating the tags I use on my blog
posts to make the category listing and tag cloud smaller and more
user friendly. In addition reducing the the number of tags and
making them more generic means the remaining pages will contain
more content and should rank better on the search engines.</p>

<p>Having completed the cleanup in the umbraco client I then turned
my attention to the database to see what old tag information
remained.</p>

<p>The following SQL Command will show you the unused tags in your
database.</p>

<p><em>select * from cmstags where id not in (select tagid from
cmsTagRelationship)</em></p>

<p><em>select * from cmstags where id not in (select tagid from
cmsTagRelationship)</em></p>

<p>To delete these unused tags simply run:</p>

<p><em>delete from cmstags where id not in (select tagid from
cmsTagRelationship)</em></p>

<p>If you would like to remove a tag that is still associated with
one or more posts simply run:</p>

<p><em>delete from cmsTagRelationship where tagId in (select id
from cmsTags where tag = 'OLDTAG')</em></p>

<p>which will delete the relationship and then:</p>

<p><em>delete from cmsTags where tag = 'OLDTAG'</em></p>

<p>Which will remove the tag itself.</p>

<p><a href="http://twitter.com/ismailmayat">@ismailmayat</a> has
also created an umbraco package for tag management that can be
found at <a href="http://our.umbraco.org/projects/tagmanager"
title="TagManager Project">http://our.umbraco.org/projects/tagmanager</a>.</p>
]]></content:encoded></item><item><title>Google Labs</title><link>http://www.bayshield.com/2010/4/23/google-labs</link><pubDate>Fri, 23 Apr 2010 05:23:57 GMT</pubDate><guid>http://www.bayshield.com/2010/4/23/google-labs</guid><description>Google Labs has an interesting collection of new applications being developed by Google Engineers.</description><content:encoded><![CDATA[ 
<p>Google is constantly developing and testing new ideas, most of
which are made available to the public early during their
development cycle.&nbsp; If you would like to see what is next on
Google's ever expanding horizons, check out <a
href="http://www.googlelabs.com/">http://www.googlelabs.com/</a>.</p>

<p><img src="/media/1624/googlelabs_499x159.jpg"  width="499"  height="159" alt="GoogleLabs"/></p>

<p>As of this post, their most recent tool is <a
href="http://followfinder.googlelabs.com/"
title="Follow Finder">Follow Finder</a>.&nbsp; This tool allows you
to enter a twitter user name and then goes off to analyse the
social graph attached to that name (following/followers) to produce
a recommended list of twitter users for you to follow.</p>

<p>Some of the projects (or experiments as Google likes to call
them), never get out of the Labs, however a lot go on to become
fully fledged Google products.&nbsp; So check it out and be one of
the first to see what the future holds!</p>
]]></content:encoded></item><item><title>mtouch failed with no output solved</title><link>http://www.bayshield.com/2010/4/6/mtouch-failed-with-no-output-solved</link><pubDate>Tue, 06 Apr 2010 15:41:04 GMT</pubDate><guid>http://www.bayshield.com/2010/4/6/mtouch-failed-with-no-output-solved</guid><description>Solution for MonoTouch build error "mtouch failed with no output".</description><content:encoded><![CDATA[ 
<p>Whilst trying to build my latest application I came across a
strange "mtouch failed with no output" error. &nbsp;The error would
only occur when building for the iPhone (not the simulator) and
despite checking all the forums I was unable to find a solution
that would work.</p>

<p>There are a number of forum posts highlighting that spaces in
folder paths will cause MonoTouch builds to fail, however it also
appears that having a space in the Project name will also cause
this to occur.</p>

<p><img src="/media/1555/screen shot 2010-04-06 at 20.39.23_500x410.jpg"  width="500"  height="410" alt="Screen shot 2010-04-06 at 20.39.23"/></p>

<p>When I tried to build my project with a space in the Name (as
shown in the screenshot above) the build would fail. &nbsp;Removing
the space solved the problem.</p>
]]></content:encoded></item><item><title>Finding nearby locations with iPhone GPS and MonoTouch</title><link>http://www.bayshield.com/2010/4/3/finding-nearby-locations-with-iphone-gps-and-monotouch</link><pubDate>Sat, 03 Apr 2010 14:39:31 GMT</pubDate><guid>http://www.bayshield.com/2010/4/3/finding-nearby-locations-with-iphone-gps-and-monotouch</guid><description>Example code to quickly find nearby locations programaticaly.</description><content:encoded><![CDATA[ 
<p>Whilst developing my latest application I was faced with the
issue of finding nearby locations from a SQLite database containing
over 60,000 records. &nbsp;Each record contained a latitude,
longitude and location name.</p>

<p>The problem was how to quickly find the closest locations
without having to calculate the distance between the current
location and target location for every record.</p>

<p>The solution I came up with has two parts. &nbsp;First, I
applied a limit clause to my select statement to only return the
top 100 rows within +/- 1 degree of my current latitude and
longitude.</p>

<p>One degree equals approximately 111km (61 miles) so by filtering
for +/- 1 degree we are effectively selecting the top 100 records
within a 222km radius of the current location.</p>

<p>It is then a relatively simple task to calculate the distance
between the current location and selected locations and order by
distance.</p>
]]></content:encoded></item><item><title>Fake Flash Memory</title><link>http://www.bayshield.com/2010/4/1/fake-flash-memory</link><pubDate>Thu, 01 Apr 2010 14:53:54 GMT</pubDate><guid>http://www.bayshield.com/2010/4/1/fake-flash-memory</guid><description>How to identify fake (counterfeit) flash memory, and what you can do about it.</description><content:encoded><![CDATA[ 
<p>As it is the first of April I thought I would share my recent
experience purchasing a 16GB memory stick on eBay and how I was
fooled into buying a fake product.</p>

<p>The big mistake I made was not <strong><em>reading</em></strong>
the sellers feedback. &nbsp;I did check the seller had 100%
positive feedback (from 100+ sales) however I didn't read the
comments.</p>

<p>After I started experiencing problems with my memory stick I
went back &nbsp;to read the comments from other buyers. &nbsp;It
quickly became obvious that a number of other people had
experienced problems but had still given positive feedback.</p>

<p>Further research into the issue of fake flash memory has shown
that one of the tactics sellers use is threating not to give a
refund if negative feedback is given. &nbsp;The problem of fake
memory is now quite an issue and a number of websites have sprung
up to combat it.</p>

<p>If you are interested in finding out more about fake memory and
how to determine if you have got what you paid for check this
site:&nbsp;<a
href="http://sosfakeflash.wordpress.com/">http://sosfakeflash.wordpress.com/</a></p>
]]></content:encoded></item><item><title>Programmatic document creation in umbraco</title><link>http://www.bayshield.com/2010/3/3/programmatic-document-creation-in-umbraco</link><pubDate>Wed, 03 Mar 2010 11:59:32 GMT</pubDate><guid>http://www.bayshield.com/2010/3/3/programmatic-document-creation-in-umbraco</guid><description>Explains how to create and call a web service on your umbraco site to programmaticaly create documents.</description><content:encoded><![CDATA[ 
<p>The umbraco API is extremely powerful and can easily be used to
create content pages via code. &nbsp;Recently I created an umbraco
website where I needed to be able to take data from a genealogy
file and create a page on the site for each individual in the
file.</p>

<p>To create a document via code is fairly simple, first add the
following two references to your code:</p>

<pre>
using umbraco.BusinessLogic;<br />
using umbraco.cms.businesslogic.web;<br />
</pre>

<p>The code to create a document can be seen here:</p>

<!-- code formatted by http://manoli.net/csharpformat/ -->
<pre class="csharpcode">
<span
class="rem">// Get a reference to the docType 'Family' is my docType Alias</span>
DocumentType dt = DocumentType.GetByAlias(<span
class="str">"Family"</span>);
    
<span class="rem">// User 0 is the admin user</span>
User author = umbraco.BusinessLogic.User.GetUser(0);

<span
class="rem">// Create a document with a name, a type, an umbraco user, and the ID of the</span> 
<span class="rem">// document's parent page.</span> 
Document doc = Document.MakeNew(<span
class="str">"New Page Name"</span>, dt, author, 1376);
   
<span class="rem">// Set document properties</span>
doc.getProperty(<span class="str">"pageTitle"</span>).Value = <span
class="str">""</span>;
doc.getProperty(<span
class="str">"metaKeywords"</span>).Value = <span
class="str">""</span>;
doc.getProperty(<span class="str">"bodyText"</span>).Value = <span
class="str">""</span>;

<span class="rem">// Prepare for publishing</span> 
doc.Publish(author);

<span class="rem">// Publish the document</span>
umbraco.library.UpdateDocumentCache(doc.Id);
<span class="kwrd">return</span> doc.Id;
</pre>

<p>This code can then be put into a webservice and copied onto your
umbraco site. &nbsp;It can then be called from any application or
system that needs to create content on your site.</p>
]]></content:encoded></item><item><title>Encoding video for the iPhone</title><link>http://www.bayshield.com/2010/3/2/encoding-video-for-the-iphone</link><pubDate>Tue, 02 Mar 2010 09:27:40 GMT</pubDate><guid>http://www.bayshield.com/2010/3/2/encoding-video-for-the-iphone</guid><description>Short guide to converting video for the iPhone.</description><content:encoded><![CDATA[ 
<p>I have used a number of tools in the past for encoding video in
an iPhone friendly format, however they have all required the user
to know a lot about codecs, bit rates, screen resoloutions
etc...</p>

<p>Whilst encoding some recent holiday footage I went searching for
a new tool and found a free <a
href="http://www.dvdvideosoft.com/products/dvd/Free-Video-to-iPhone-Converter.htm">
Video to iPhone Converter</a> application from
DVDVideoSoft.com.</p>

<p>What makes this tool unique is that all you have to do is select
your source file, the destination folder and the level of quality
you would like (Economy, Standard, High).</p>

<p>Converting a four minute AVI file took around three minutes on
my laptop using the standard settings and the quality is
excellent.</p>

<p>As with most free software these days, the program prompts you
to install a search toolbar as part of the installation process as
well as attempting to get you to change your default search page.
&nbsp;Simply deselect these options however and you have an easy to
use tool for converting video for the iPhone.</p>
]]></content:encoded></item></channel></rss>
