<?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>Through The Eyes Of A Dreamer &#187; Technical</title>
	<atom:link href="http://heidibrebels.be/blog/archives/category/technical/feed" rel="self" type="application/rss+xml" />
	<link>http://heidibrebels.be</link>
	<description>home of heidi brebels</description>
	<lastBuildDate>Thu, 10 May 2012 08:25:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Custom UIPickerView selectionIndicator</title>
		<link>http://heidibrebels.be/blog/archives/2012/custom-uipickerview-selectionindicator</link>
		<comments>http://heidibrebels.be/blog/archives/2012/custom-uipickerview-selectionindicator#comments</comments>
		<pubDate>Fri, 27 Apr 2012 15:02:49 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[iOS dev]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[custom indicator]]></category>
		<category><![CDATA[objective-C]]></category>
		<category><![CDATA[selectionIndicator]]></category>
		<category><![CDATA[UIPickerView]]></category>

		<guid isPermaLink="false">http://heidibrebels.be/?p=1111</guid>
		<description><![CDATA[For one of my apps, I wanted to change the color of the selectionIndicator on the UIPickerView. Apparently, there isn&#8217;t a simple tintColor available for this (yet). I did look into subclassing the UIPickerView for a moment, but then I decided to go for the easy and simple solution of creating my own selectionIndicator and [...]]]></description>
			<content:encoded><![CDATA[<p>For one of my apps, I wanted to change the color of the selectionIndicator on the UIPickerView. Apparently, there isn&#8217;t a simple tintColor available for this (yet). I did look into subclassing the UIPickerView for a moment, but then I decided to go for the easy and simple solution of creating my own selectionIndicator and placing it on top of the UIPickerView.</p>
<p>&nbsp;</p>
<p><a href="http://heidibrebels.be/wp-content/uploads/2012/04/uiPickerView-Custom-selectionIndicator.jpg" rel="prettyPhoto[1111]"><img class="size-medium wp-image-1132 aligncenter" title="UIPickerView Custom selectionIndicator" src="http://heidibrebels.be/wp-content/uploads/2012/04/uiPickerView-Custom-selectionIndicator-300x191.jpg" alt="UIPickerView Custom selectionIndicator" width="300" height="191" /></a></p>
<p>&nbsp;</p>
<p>Code:<br />
<span style="color: #008000;">// CGRectMake values for the frame we&#8217;d like</span><br />
myPickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0,0, self.view.bounds.size.width, self.view.bounds.size.height)];<br />
<span style="color: #008000;">// add the UIPickerView to your viewcontroller, actionsheet, &#8230;</span><br />
[mainView addSubview:myPickerView];</p>
<p><span style="color: #008000;">// set the selectionindicator to none</span><br />
myPickerView.showsSelectionIndicator = NO;<br />
<span style="color: #008000;">// define the image that we would like to use</span><br />
UIImage *selectorImage = [UIImage imageNamed:@"selectionIndicator.png"];<br />
UIView *customSelector = [[UIImageView alloc] initWithImage:selectorImage];<br />
<span style="color: #008000;">// set the x and y values to the point on the UIPickerView where you want to place the image</span><br />
<span style="color: #008000;"> // set the width and height values to the width and height of your image</span><br />
customSelector.frame = CGRectMake(10,(actionsheetPickerViewTemplates.bounds.size.height / 2) + 16, self.view.bounds.size.width &#8211; 10, 47);<br />
<span style="color: #008000;">// add the custom selectionIndicator also to the same viewcontroller, actionsheet, &#8230;</span><br />
[mainView addSubview:customSelector];</p>
<p>&nbsp;</p>
<p>selectionIndicator.png</p>
<p><a href="http://heidibrebels.be/wp-content/uploads/2012/04/selectionIndicator.png" rel="prettyPhoto[1111]"><img class="size-full wp-image-1118 alignnone" title="UIPickerView custom selectionIndicator image" src="http://heidibrebels.be/wp-content/uploads/2012/04/selectionIndicator.png" alt="UIPickerView custom selectionIndicator image" width="303" height="47" /></a></p>
<p>selectionIndicator@2x.png</p>
<p><a href="http://heidibrebels.be/wp-content/uploads/2012/04/selectionIndicator@2x.png" rel="prettyPhoto[1111]"><img class="size-full wp-image-1119 alignnone" title="UIPickerView custom selectionIndicator image" src="http://heidibrebels.be/wp-content/uploads/2012/04/selectionIndicator@2x.png" alt="UIPickerView custom selectionIndicator image" width="605" height="94" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2012/custom-uipickerview-selectionindicator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5: video</title>
		<link>http://heidibrebels.be/blog/archives/2011/html5-video</link>
		<comments>http://heidibrebels.be/blog/archives/2011/html5-video#comments</comments>
		<pubDate>Wed, 21 Dec 2011 15:49:27 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[firefogg]]></category>
		<category><![CDATA[H.264]]></category>
		<category><![CDATA[handbrake]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Ogg]]></category>
		<category><![CDATA[Theora]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webm]]></category>

		<guid isPermaLink="false">http://www.heidibrebels.be/?p=1041</guid>
		<description><![CDATA[HTML5 promises to make putting a video on a website as easy as placing an image on a it. Say goodbye to plugins like Quicktime and Flash (which is dead anyway ) and get excited about this native way of embedding video&#8217;s! A huge advantage of embedding a video natively is that you can manipulate [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5 promises to make putting a video on a website as easy as placing an image on a it. Say goodbye to plugins like Quicktime and Flash (which is dead anyway <img src='http://heidibrebels.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) and get excited about this native way of embedding video&#8217;s!</p>
<p>A huge advantage of embedding a video natively is that you can manipulate it just a easily.</p>
<p style="text-align: center;"><a href="http://heidibrebels.be/wp-content/uploads/2011/12/finalcut_cinema.png" rel="prettyPhoto[1041]"><img class="aligncenter size-medium wp-image-1051" title="video codecs" src="http://heidibrebels.be/wp-content/uploads/2011/12/finalcut_cinema-288x300.png" alt="video codecs" width="173" height="180" /></a></p>
<p>To embed a video, first it must be in a format that the browser will understand:</p>
<ul>
<li>H.264 &#8211; supported by Safari, Mobile Safari, Chrome and IE9.<br />
H.264 is not an open standard, so there is no promiss that it will remain free. Firefox does not support it.<br />
Use,  for example, <a title="Handbrake - video converter" href="http://handbrake.fr/" target="_blank">HandBrake</a> to convert to an H.264 video.</li>
<li><a title="Ogg Theora - open standard video format" href="http://theora.org/" target="_blank">Ogg Theora</a> &#8211; supported by Firefox and Chrome.<br />
Ogg Theora is an open standard (free forever).<br />
Use, for example, <a title="firefogg - ogg video converter" href="http://firefogg.org/" target="_blank">firefogg</a> to convert to an ogg video.</li>
<li><a title="webm video encoder google" href="http://www.webmproject.org/" target="_blank">webm</a> &#8211; not much support yet<br />
Webm is a video codec from Google, it&#8217;s high quality and open standard.</li>
</ul>
<p>As you can see, we&#8217;ll have to include at least 2 video formats in our website if we want all users to be able to view it.</p>
<p style="text-align: center;"><a href="http://heidibrebels.be/wp-content/uploads/2011/12/tag.jpg" rel="prettyPhoto[1041]"><img class="aligncenter size-thumbnail wp-image-1055" title="tag" src="http://heidibrebels.be/wp-content/uploads/2011/12/tag.jpg" alt="" width="249" height="173" /></a></p>
<p>Using the tag:</p>
<p>Just one video:<br />
<em>&lt;video src=&#8221;videos/myvideo.ogv&#8221; width=&#8221;500&#8243; height=&#8221;500&#8243; controls&gt;&lt;/video&gt;</em></p>
<p>The <em>controls</em> attribute will add basic controls to the video.</p>
<p>Multiple videos:<br />
<em>&lt;video width=&#8221;500&#8243; height=&#8221;500&#8243; controls&gt;</em><br />
<em>&lt;source src=&#8221;videos/myvideo.ogv&#8221; type=&#8217;video/ogg; codecs=&#8221;theora, vorbis&#8221; &#8216;&gt;</em><br />
<em>&lt;source src=&#8221;videos/myvideo.mp4&#8243; type=&#8217;video/mp4; codecs=&#8221;avc1.42E01E, mp4a.40.2&#8243; &#8216;&gt;</em><br />
<em>&lt;/video&gt;</em></p>
<p>The <em>type</em> attribute will tell the browser which codecs are required to play the video. This way, the video will only be downloaded if the browser supports the codec. The codec may vary depending on what software you used to convert the video. If you omit the type attribute, then the browser will try each codec to see if it can play the video, which could result in the use of a lot of unnecessary bandwidth.</p>
<p>Interacting with the video is possible with the use of JQuery. You can have a look at <a title="JQuery UI elements" href="http://jqueryui.com/" target="_blank">JQuery UI</a> elements as a starting point.</p>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2011/html5-video/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5: a few basics</title>
		<link>http://heidibrebels.be/blog/archives/2011/html5-a-few-basics</link>
		<comments>http://heidibrebels.be/blog/archives/2011/html5-a-few-basics#comments</comments>
		<pubDate>Thu, 15 Dec 2011 14:28:50 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Article]]></category>
		<category><![CDATA[aside]]></category>
		<category><![CDATA[basics]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[figcaption]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[hgroup]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[modernizr]]></category>
		<category><![CDATA[section]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.heidibrebels.be/?p=1022</guid>
		<description><![CDATA[Web browsers, generally, only support certain features of HTML5. An easy way to determine which features are supported in a browser, is to use the Modernizr tool. A few general tag changes: Simple doc type: &#60;!DOCTYPE html&#62; Simple encoding scheme: &#60;meta charset=&#8221;utf-8&#8243;&#62; The type attribute is no longer required: &#60;script src=&#8221;js/main.js&#8221;&#62;&#60;/script&#62; &#60;script&#62; var now = new Date(); &#60;/script&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Web browsers, generally, only support certain features of HTML5. An easy way to determine which features are supported in a browser, is to use the <a title="Modernizr" href="http://www.modernizr.com/docs/" target="_blank">Modernizr tool</a>.</p>
<p>A few general tag changes:</p>
<ol>
<li>Simple doc type: <em>&lt;!DOCTYPE html&gt;</em></li>
<li>Simple encoding scheme: <em>&lt;meta charset=&#8221;utf-8&#8243;&gt;</em></li>
<li>The type attribute is no longer required:<br />
<em>&lt;script src=&#8221;js/main.js&#8221;&gt;&lt;/script&gt;</em><br />
<em>&lt;script&gt; var now = new Date(); &lt;/script&gt;</em><br />
<em>&lt;style&gt; body { margin: 0px; } &lt;/style&gt;</em><br />
<em>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;css/main.css&#8221; media=&#8221;screen&#8221;&gt;</em></li>
</ol>
<p>A few new semantic tags:</p>
<ol>
<li><em>&lt;article&gt;</em> = an on-its-own-feet-standing piece of content.<br />
Ask yourself: would this information make sense if I cut it out of the page and pasted it somewhere else completely?</li>
<li><em>&lt;section&gt;</em> = used to divide up content (of an article or page) in a logical way.</li>
<li><em>&lt;aside&gt;</em> = content that is useful, but could be removed while the rest of the content would still make sense.</li>
</ol>
<p>A few new hierarchical tags:</p>
<ol>
<li><em>&lt;hgroup&gt;</em> = used to group multiple &lt;h#&gt; tags into one headline.<br />
<em>&lt;hgroup&gt;</em><br />
<em>&lt;h1&gt;This is my title&lt;/h1&gt;</em><br />
<em>&lt;h2&gt;This is my smart-ass tag line&lt;/h2&gt;</em><br />
<em>&lt;/hgroup&gt; </em><br />
In this case, only the &lt;h1&gt; element will be considered in the page&#8217;s hierarchy. Meaning that everything below this &lt;hgroup&gt; is represented by the &lt;h1&gt;. The information in &lt;h2&gt; is secondary.</li>
<li><em>&lt;figure&gt;</em> and <em>&lt;figcaption&gt;</em> = groups together an image, table, quote, &#8230; and its caption on the page<br />
<em>&lt;figure&gt;</em><br />
<em>&lt;img src=&#8221;images/myimage.php&#8221;&gt;</em><br />
<em>&lt;figcaption&gt;Caption of my image&lt;/figcaption&gt;</em><br />
<em>&lt;/figure&gt; </em></li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2011/html5-a-few-basics/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessible (web app) table: a good table with a bad rep</title>
		<link>http://heidibrebels.be/blog/archives/2011/accessible-web-app-table</link>
		<comments>http://heidibrebels.be/blog/archives/2011/accessible-web-app-table#comments</comments>
		<pubDate>Thu, 04 Aug 2011 21:02:20 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[abbr]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[attributes]]></category>
		<category><![CDATA[caption]]></category>
		<category><![CDATA[Header]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tabular info]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[tbody]]></category>
		<category><![CDATA[tfoot]]></category>
		<category><![CDATA[thead]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Web app]]></category>

		<guid isPermaLink="false">http://www.heidibrebels.be/?p=916</guid>
		<description><![CDATA[Tables are an essential tool for visualizing data in web apps. A good reason to use a table is for displaying tabular information. An example of a good accessible table would the following.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">The table tag &lt;table&gt; has a bad reputation in HTML. This is mainly due to the past. Before CSS took a large role in HTML design, tables were used by many for the markup of the entire web page. Sometimes, this is still the case and that, along with the bad-accessibility-rumor, gives tables a bad rep. When we see a table in HTML, we, immediately and full of prejudice, cringe a bit. Yet, using tables is not always bad practice.</p>
<p style="text-align: center;"><a href="http://heidibrebels.be/wp-content/uploads/2011/08/kamiya-design-table-1.jpg" rel="prettyPhoto[916]"><img class="aligncenter size-medium wp-image-950" title="Accessible web app table" src="http://heidibrebels.be/wp-content/uploads/2011/08/kamiya-design-table-1-300x218.jpg" alt="Accessible web app table" width="300" height="218" /></a></p>
<p>Tables are an essential tool for visualizing data in web apps. A good reason to use a table is for displaying tabular information. An example of a good accessible table would the following:</p>
<blockquote><p>&lt;table <strong>summary=&#8221;</strong>Give a to-the-point summary of the table, but do also give all information that you think will help understand the table better, even if this means a more lengthy summary.<strong>&#8220;</strong>&gt;<br />
<strong>          &lt;caption&gt;</strong>Short description of my table.<strong>&lt;/caption&gt;<br />
<strong>          </strong>&lt;thead&gt;</strong><strong>          </strong><br />
<strong>          <strong>          </strong></strong>&lt;tr&gt;<strong>          </strong><br />
<strong>          <strong>          <strong>          </strong></strong></strong>&lt;td&gt;&lt;/td&gt;<br />
<strong><strong>          <strong>          <strong>          </strong></strong></strong>&lt;th abbr=&#8221;</strong>Column 1<strong>&#8221; id=&#8221;</strong>My_column_title_1<strong>&#8220;&gt;</strong>My column title 1<strong>&lt;/th&gt;</strong><br />
<strong><strong>          <strong>         <strong>          </strong> </strong></strong>&lt;th <strong>abbr=&#8221;</strong></strong>Column 2<strong><strong>&#8220; <strong>id=&#8221;</strong></strong></strong>My_column_title_2<strong><strong><strong>&#8220;</strong></strong>&gt;</strong>My column title 2<strong>&lt;/th&gt;</strong><br />
<strong>          <strong>          </strong></strong>&lt;/tr&gt;<br />
<strong><strong>          <strong>   </strong></strong>&lt;/thead&gt;<br />
<strong>          <strong>   </strong></strong>&lt;tbody&gt;</strong><br />
<strong>         <strong>          </strong> </strong>&lt;tr&gt;<br />
<strong><strong>  <strong> <strong>          </strong>         </strong>        </strong>&lt;th <strong>id=&#8221;</strong></strong>My_row_title_1&#8243;&gt;My row title 1<strong>&lt;/th&gt;</strong><br />
<strong> <strong>          </strong><strong>          </strong>         </strong>&lt;td <strong>header=&#8221;</strong>My_column_title_1 My_row_title_1<strong>&#8220;</strong>&gt;Data 1 for column 1&lt;/td&gt;<br />
<strong> <strong>          </strong><strong>          </strong>         </strong>&lt;td <strong>header=&#8221;</strong>My_column_title_2 My_row_title_1<strong>&#8220;</strong>&gt;Data 1 for column 2&lt;/td&gt;<br />
<strong> <strong>          </strong>        <strong>  </strong></strong>&lt;/tr&gt;<br />
<strong><strong>    <strong><strong>          </strong></strong>      </strong></strong>&lt;tr&gt;<br />
<strong><strong> <strong><strong>  <strong><strong>          </strong></strong>        </strong></strong>         </strong>&lt;th id=&#8221;</strong>My_row_title_2<strong>&#8220;</strong>&gt;My row title 2<strong>&lt;/th&gt;<strong>          </strong></strong><br />
<strong><strong><strong><strong> <strong><strong>          </strong></strong>         </strong></strong>          </strong></strong>&lt;td <strong>header=&#8221;</strong>My_column_title_1 My_row_title_2<strong>&#8220;</strong>&gt;Data 2 for column 1&lt;/td&gt;<br />
<strong><strong> <strong><strong>          </strong></strong><strong><strong>          </strong></strong>         </strong></strong>&lt;td <strong>header=&#8221;</strong>My_column_title_2 My_row_title_2<strong>&#8220;</strong>&gt;Data 2 for column 2&lt;/td&gt;<br />
<strong><strong><strong><strong>          </strong></strong>          </strong></strong>&lt;/tr&gt;<br />
<strong><strong>          </strong>&lt;/tbody&gt;</strong><br />
&lt;/table&gt;</p></blockquote>
<p>And some additional information with that:</p>
<ul>
<li>The <strong>caption</strong> will be displayed above the table and can be easily styled with CSS.</li>
<li>The <strong>summary</strong> won&#8217;t be visible on the web page, but will make the table more accessible for screen readers.</li>
<li>Use table headers <strong>&lt;th&gt; </strong>for all data that is used as a header. Screen readers will be able to see the header that belongs to a table cell. When you have really long headers, then you can imagine that this can be very annoying. In that case, use the <strong>abbreviation</strong> attribute. The screen reader will then read the abbreviated version.</li>
<li><strong>thead</strong> can be nice to have, because you can take the header and easily style it separately. For a small table, though, using <strong>th</strong> will suffice.<br />
<strong>thead</strong>, <strong>tbody </strong>and <strong>tfoot</strong> are not required. For large, multi page tables, especially in web applications, though, the use of thead, tbody and tfoot can provide more structure and meaning to the table. You could easily repeat these sections of the table on multiple pages. Remember that if you use thead or tfoot, you have to use tbody to specify what part of the table is the main body part.</li>
</ul>
<p>Try to avoid too complex tables, because this will make the data hard to understand for users with assistant devices. Sometimes, though, you don&#8217;t have a choice. In that case, these are some of the things that you can do to make the experience for those users a bit better:</p>
<ul>
<li>Add an <strong>id</strong> attribute with the headers (&lt;th&gt;). The screen reader won&#8217;t be able to read the id out, but this way you can associate a particular table cell with a particular header.</li>
<li>Add a <strong>header</strong> attribute with all the regular table cells (&lt;td&gt;). This associates the cells with the appropriated headers. In the header attribute, you should put each id of all the headers where this cell falls under, in the proper order and separated by spaces.  The screen reader will read it then as &#8220;column x row x&#8221; and then the values of the header id&#8217;s in the header attribute, plus the value of the cell itself.<br />
For example: &#8220;Data 1 for column 1&#8243; will be read by the screen reader as: &#8220;column 2 row 2 My column title 1 My row title 1 Data 1 for column 1&#8243;.</li>
<li>When you have more than 2 levels of headers, then also include the <strong>header</strong> attribute in the header tag, stating the name of the id(&#8216;s) of the header(s) where it falls under. Just as you do with the table cells.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2011/accessible-web-app-table/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Office Web apps error in Sharepoint</title>
		<link>http://heidibrebels.be/blog/archives/2011/office-web-apps-error-sharepoint</link>
		<comments>http://heidibrebels.be/blog/archives/2011/office-web-apps-error-sharepoint#comments</comments>
		<pubDate>Fri, 13 May 2011 11:35:07 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Custom user data]]></category>
		<category><![CDATA[Domain Controller]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Header]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Office Web Apps]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Protected View]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[ULS Viewer]]></category>
		<category><![CDATA[Word]]></category>

		<guid isPermaLink="false">http://www.heidibrebels.be/?p=677</guid>
		<description><![CDATA[I’ve been struggling with Sharepoint and the Office web apps to show word and excel files in the browser. If you have too, take this journey with me as we try to solve it.]]></description>
			<content:encoded><![CDATA[<p>I’ve been struggling with Sharepoint and the <a title="Office web apps" href="http://office.microsoft.com/en-us/web-apps/" target="_blank">Office web apps</a> to show word and excel files in the browser. If you have too, take this journey with me as we try to solve it.</p>
<p><a title="Office Web Apps" href="http://office.microsoft.com/en-us/web-apps/" target="_blank"><img class="size-medium wp-image-679 aligncenter" title="Office Web Apps" src="http://heidibrebels.be/wp-content/uploads/2011/05/Office-Web-Apps-300x105.png" alt="Office Web Apps" width="300" height="105" /></a></p>
<h2>Server side solutions</h2>
<p>First of all, take a look at this article: <a title="Deploy Office Web Apps" href="http://technet.microsoft.com/en-us/library/ff431687.aspx" target="_blank">Deploy Office Web Apps</a>.</p>
<p><a title="Microsoft Technet" href="http://technet.microsoft.com/en-us/library/ff431687.aspx" target="_blank"><img class="size-full wp-image-690 aligncenter" title="Microsoft Technet" src="http://heidibrebels.be/wp-content/uploads/2011/05/MicrosoftTechnet.png" alt="Microsoft Technet" width="216" height="39" /></a></p>
<p>In summary, make sure you’ve done these things:</p>
<ul>
<li> Manage services on this server:<br />
1) Click <strong>Start</strong>, point to <strong>All Programs</strong>, <strong>Microsoft SharePoint 2010 Products</strong>, and then <strong>SharePoint 2010 Central Administration</strong>.<br />
2) On the SharePoint Central Administration home page, in <strong>System Settings</strong>, click <strong>Manage services on this server</strong>.<br />
3) On the Services on server:&lt;servername&gt;page, start <strong>Excel Calculation Services</strong>, <strong>Word Viewing Service</strong>, and <strong>PowerPoint Service</strong>. The OneNote Web App does not use a SharePoint service.<br />
.</li>
<li>Manage service applications:<br />
1) Click <strong>Start</strong>, point to <strong>All Programs</strong>, <strong>Microsoft SharePoint 2010 Products</strong>, and then <strong>SharePoint 2010 Central Administration</strong>.<br />
2) On the SharePoint Central Administration home page, in <strong>Application Management</strong>, click <strong>Manage service applications</strong>.<br />
3) On the Service Applications page, click <strong>New</strong>, and then click <strong>Word Viewing Service</strong>.<br />
4) In the Word Viewing Service Application dialog box, in <strong>Name</strong>, type <strong>Word Viewing Service Application</strong>. In <strong>Application Pool</strong>, select <strong>Use existing application pool</strong>, and then in the listbox, select <strong>SharePoint Web Services Default</strong>. In <strong>Add to default proxy list</strong>, verify <strong>Add this service application&#8217;s proxy to the farm&#8217;s default proxy list</strong> is selected (default), and then click <strong>OK</strong>.<br />
5) On the Service Applications page, click <strong>New</strong>, and then click <strong>PowerPoint Service Application</strong>.<br />
6) In the PowerPoint Service Application dialog box, in <strong>Name</strong>, type <strong>PowerPoint Service Application</strong>. In <strong>Application Pool</strong>, select <strong>Use existing application pool</strong>, and then in the listbox, select <strong>SharePoint Web Services Default</strong>. In <strong>Add to default proxy list</strong>, verify <strong>Add this service application&#8217;s proxy to the farm&#8217;s default proxy list</strong> is selected (default), and then click <strong>OK</strong>.<br />
7) On the Service Applications page, click <strong>New</strong>, and then click <strong>Excel Services Application</strong>.<br />
8 ) In the Excel Services Application dialog box, in <strong>Name</strong>, type <strong>Excel Services Application</strong>. In <strong>Application Pool</strong>, select <strong>Use existing application pool</strong>, and then in the listbox, select <strong>SharePoint Web Services Default</strong>. In <strong>Add to default proxy list</strong>, verify <strong>Add this service application&#8217;s proxy to the farm&#8217;s default proxy list</strong> is selected (default), and then click <strong>OK</strong>.</li>
</ul>
<p><strong>Note </strong>here that you have to make sure that there is only one Excel, Powerpoint and Word service application running. When I had for example 2 Excel or Word services (no matter that they had different names), I kept getting errors. There were already Word and Excel services created for me, so I kept them and I just created the Powerpoint service application like stated above.</p>
<ul>
<li>Activate the Office Web Apps Feature:<br />
1) In a browser, in the SharePoint site, click <strong>Site Actions (for example, go to the central administration page)</strong>, and then click <strong>Site Settings</strong>.<br />
2)  On the Site Settings page, in <strong>Site Collection Administration</strong>, click <strong>Site Collection Features</strong>.<br />
3)  On the Features page, for <strong>Office Web Apps</strong>, click <strong>Activate<br />
. </strong></li>
<li><strong><strong>OR with powershell to</strong> activate the Office Web Apps Feature on all site collections:<br />
</strong>Click <strong>Start</strong>, point to <strong>All Programs</strong>, <strong>Microsoft SharePoint 2010 Management Shell</strong>.<br />
<em>$webAppsFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq &#8220;OfficeWebApps&#8221;}).Id</em><br />
<em> Get-SPSite -limit ALL |foreach{Enable-SPFeature $webAppsFeatureId -url $_.URL }</em></li>
</ul>
<p>___________________________________________________________________________________</p>
<p>&nbsp;</p>
<p>If you are running the Office Web Apps on a DC, then take a look at this article: <a title="Installation Notice for Sharepoint 2010 Public Beta" href="http://blogs.msdn.com/b/opal/archive/2009/11/16/installation-notice-for-sharepoint-2010-public-beta.aspx" target="_blank">Installation Notice for SharePoint 2010 Public Beta</a></p>
<p><a title="Powershell" href="http://en.wikipedia.org/wiki/Windows_PowerShell" target="_blank"><img class="size-full wp-image-693 aligncenter" title="Powershell" src="http://heidibrebels.be/wp-content/uploads/2011/05/powershell_2.jpg" alt="Powershell" width="300" height="235" /></a></p>
<p>In summary, make sure you’ve done these things:</p>
<ul>
<li>If you are using SharePoint on DC, the following Windows PowerShell command would need to be run to enable Sandboxed Solutions.<br />
<em>$acl = Get-Acl HKLM:SystemCurrentControlSetControlComputerName<br />
</em><em>$person = [System.Security.Principal.NTAccount]&#8220;Users&#8221;<br />
</em><em>$access = [System.Security.AccessControl.RegistryRights]::FullControl<br />
</em><em>$inheritance = [System.Security.AccessControl.InheritanceFlags]&#8220;ContainerInherit, ObjectInherit&#8221;<br />
</em><em>$propagation = [System.Security.AccessControl.PropagationFlags]::None<br />
</em><em>$type = [System.Security.AccessControl.AccessControlType]::Allow<br />
</em><em>$rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type)<br />
</em><em>$acl.AddAccessRule($rule)<br />
</em><em>Set-Acl HKLM:SystemCurrentControlSetControlComputerName $acl<br />
. </em></li>
<li><em> </em>If you are trying to use Office Web Apps on DC(<a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=27d81b1c-18ae-4983-8e1c-224bb747eb99" class="broken_link">Office Web Application</a> need to be installed seperately, like a language pack or an update. Please also note that Office Web Application cannot be installed on <a href="http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx">needs to follow the same edit of config.xml</a> to install on Windows 7), then the following commands need to be run to make the services work. Please note that in different languages, Service Application names could be localized. You can find them out by Get-SPServiceApplications, and then change the names in the script as necessary.<br />
<strong>Please do note that Office Web Apps is not supported on a DC. So this configuration should never be used in production.<br />
</strong><em>$e = Get-SPServiceApplication | where {$_.TypeName.Equals(&#8220;Word Viewing Service Application&#8221;)}<br />
</em><em>$e.WordServerIsSandboxed = $false<br />
</em><em>$e.WordServerIsSandboxed </em><em> </em><em>$p = Get-SPServiceApplication | where {$_.TypeName.Equals(&#8220;PowerPoint Service Application&#8221;)}<br />
</em><em>$p.EnableSandboxedViewing = $false<br />
</em><em>$p.EnableSandboxedEditing = $false<br />
</em><em>$p.EnableSandboxedViewing<br />
</em><em>$p.EnableSandboxedEditing</em>&nbsp;</p>
<p><em> </em><em> </em><strong><em>#(Please use the below script for PowerPointServiceApplication &#8211; You need to enter &#8220;Y&#8221; for the answer of each cmd)<br />
</em></strong><strong><em>Get-SPPowerPointServiceApplication | Set-SPPowerPointServiceApplication -EnableSandboxedViewing $false<br />
</em></strong><strong><em>Get-SPPowerPointServiceApplication | Set-SPPowerPointServiceApplication -EnableSandboxedEditing $false</em></strong><em><br />
</em></li>
<li><em>In the server&#8217;s c:windowssystem32inetsrvconfigapplicationHost.config<br />
</em><em>Add the line below in the end of the dynamicTypes.<br />
</em><em>&lt;add mimeType=&#8221;application/zip&#8221; enabled=&#8221;false&#8221; /&gt;<br />
</em><em>IISRESET</em></li>
</ul>
<p>___________________________________________________________________________________</p>
<p>&nbsp;</p>
<p>If after that, opening an Excel document in sharepoint gives you this error: “<em>Unable to process the request. Wait a few minutes and try performing this operation again.</em>”</p>
<p style="text-align: center;"><img class="size-full wp-image-696 aligncenter" title="Excel" src="http://heidibrebels.be/wp-content/uploads/2011/05/Logo-Excel.png" alt="Excel" width="150" height="150" /></p>
<p>Then try this as a solution:</p>
<ul>
<li>Click <strong>Start</strong>, point to <strong>All Programs</strong>, <strong>Microsoft SharePoint 2010 Products</strong>, and then <strong>SharePoint 2010 Central Administration</strong>.</li>
<li>On the SharePoint Central Administration home page, in <strong>Application Management</strong>, click <strong>Manage web application </strong>&#8211;&gt; Sharepoint &#8211; 80&#8212;&gt; click Service connections- check/select that excel service.</li>
</ul>
<p>Note: also make sure that here you have the word and powerpoint services checked here!</p>
<p>___________________________________________________________________________________</p>
<p>&nbsp;</p>
<p>Also, Check if you are opening your document in protected view. To disable this, follow these steps (from <a title="Sharepoint 2010 - How to" href="http://howtosharepoint.blogspot.com/2010/04/word-experienced-error-trying-to-open.html" target="_blank">Sharepoint 2010 – how to</a>):</p>
<p><a title="Disable protected view" href="http://howtosharepoint.blogspot.com/2010/04/word-experienced-error-trying-to-open.html" target="_blank"><img class="size-full wp-image-697 aligncenter" title="Disable protected view" src="http://heidibrebels.be/wp-content/uploads/2011/05/openlock.jpg" alt="Disable protected view" width="133" height="200" /></a></p>
<ol>
<li>Run one of the Office 2010 application (e.g.      Word 2010).</li>
<li>Click on File menu, and select Options.</li>
<li>In the “Options” dialog, select Trust Center      in the left pane.</li>
<li>Click on Trust Center Settings in the right      pane.</li>
<li>Select Protected View in the left pane of      “Trust Center” dialog.</li>
<li>Disable any of all of the protected view      options as below by unticking the check boxes:
<ul>
<li>Enable Protected View for files that fail       validation</li>
<li>Enable Protected View for files originating       from the Internet</li>
<li>Enable Protected View for files located in       potentially unsafe locations</li>
<li>Enable Protected View for Outlook attachments</li>
</ul>
</li>
</ol>
<p>___________________________________________________________________________________</p>
<p>&nbsp;</p>
<p>After this point, most doc, docx and xlsx files will open, though there are still some persistent ones that fail to open.</p>
<p>Opening a Word doc gives this error: “<em>Word Web App cannot open this document for viewing because of an unexpected error. To view this document, open it in Microsoft Word.</em>”</p>
<p><img class="alignnone size-full wp-image-698 aligncenter" title="Word web app" src="http://heidibrebels.be/wp-content/uploads/2011/05/wordlogo.jpg" alt="Word web app" width="100" height="96" /></p>
<p>Apparently this happens when the extension isn’t supported by the Web Apps. Yet, the doc format should be supported, since Microsoft says this about it:<br />
“<em>Doc can be viewed in Word Web App. Word Web App converts the DOC-file to a DOCX-file so it can also be edited.</em>”<br />
See an overview of all the <a title="Supported file types Office Web Apps" href="http://support.microsoft.com/kb/2028380" target="_blank">supported file types here</a>.</p>
<p><strong>Note</strong> that xls is not supported by the Office Web Apps, not for viewing or editing. This format is only supported on their SkyDrive.</p>
<p>___________________________________________________________________________________</p>
<p>&nbsp;</p>
<p>Make sure that you check your permissions. For this, read: <a title="Account permissions and security settings (Sharepoint Server 2010)" href="http://technet.microsoft.com/en-us/library/cc678863.aspx" target="_blank">Account permissions and security settings (SharePoint Server 2010)</a>.<br />
This wasn’t a part of my problem, though.</p>
<p>___________________________________________________________________________________</p>
<p>&nbsp;</p>
<p>Have a look at the logs of Sharepoint.<br />
A very nice way to view them in realtime and record certain action is the <a title="ULS Viewer - Sharepoint Log viewer" href="http://archive.msdn.microsoft.com/ULSViewer" target="_blank">ULS Viewer</a>.</p>
<p style="text-align: center;"><a title="ULS Viewer - Sharepoint LOG viewer" href="http://archive.msdn.microsoft.com/ULSViewer" target="_blank"><img class="size-medium wp-image-685 aligncenter" title="ULS Viewer" src="http://heidibrebels.be/wp-content/uploads/2011/05/ULSviewer.png" alt="ULS Viewer" width="600" height="187" /></a></p>
<p>In the Logs of Sharepoint (default in <em>C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14LOGS</em>), I found this:<br />
<em>Librarian.BeginGetItem(F5a78dec131294bd88974b77dc36ee258mf05929c85d10495083846cfb9519854bm9b1ce232beae4457ab0bc9bbbf4c501fm, Png, docdata.xml)      bdbb85bf-03a5-49c1-ba53-1d24350ceb8e</em><br />
<em>ViewStore.BeginGetItem(F5a78dec131294bd88974b77dc36ee258mf05929c85d10495083846cfb9519854bm9b1ce232beae4457ab0bc9bbbf4c501fm, Png, docdata.xml)      bdbb85bf-03a5-49c1-ba53-1d24350ceb8e</em><br />
<em>ViewStore.SetCompleted(F5a78dec131294bd88974b77dc36ee258mf05929c85d10495083846cfb9519854bm9b1ce232beae4457ab0bc9bbbf4c501fm, Png, docdata.xml) &#8211; status = ConversionError          bdbb85bf-03a5-49c1-ba53-1d24350ceb8e</em><br />
<em>Librarian.SetCompleted(F5a78dec131294bd88974b77dc36ee258mf05929c85d10495083846cfb9519854bm9b1ce232beae4457ab0bc9bbbf4c501fm, Png, docdata.xml) &#8211; status = ConversionError          bdbb85bf-03a5-49c1-ba53-1d24350ceb8e</em></p>
<p>So, it seems that my issue is related to a ConversionError.<br />
This seems consistent with what Microsoft says about DOC files: “<em>Word Web App converts the DOC-file to a DOCX-file so it can also be edited.</em>”<br />
I read this about it: “<strong>Worker processes</strong>: The Word Viewing service application and the PowerPoint service application uses worker processes to convert documents and presentations into a series of PNG images or into XAML (if Silverlight is installed), and temporarily stores output locally on-disk. Administrators can configure worker process settings to optimize performance by using SharePoint Central Administration and by using Windows PowerShell.”</p>
<p><a title="Silverlight" href="http://www.microsoft.com/getsilverlight/Get-Started/Install/Default.aspx" target="_blank"><img class="size-full wp-image-711 aligncenter" title="Silverlight" src="http://heidibrebels.be/wp-content/uploads/2011/05/silverlight.png" alt="Silverlight" width="192" height="61" /></a></p>
<p>Which makes me next step installing <a title="Silverlight" href="http://www.microsoft.com/getsilverlight/Get-Started/Install/Default.aspx" target="_blank">Silverlight</a>. Close IE and Install Silverlight. Afterwards, restart it, then the error will change into:<br />
<em>ViewStore.SetCompleted(F5a78dec131294bd88974b77dc36ee258m1d5b8f44cba04d6d8ea29c2e96ab6c3fmc29170dd4f924af69ed2f40ad4367e83m, Silverlight, docdata.xml) &#8211; status = ConversionError       3aa0ec44-999c-46e9-ac1d-24ee6ea878d7</em><br />
<em>Librarian.SetCompleted(F5a78dec131294bd88974b77dc36ee258m1d5b8f44cba04d6d8ea29c2e96ab6c3fmc29170dd4f924af69ed2f40ad4367e83m, Silverlight, docdata.xml) &#8211; status = ConversionError       3aa0ec44-999c-46e9-ac1d-24ee6ea878d7</em></p>
<p>___________________________________________________________________________________</p>
<p>&nbsp;</p>
<h2>Document side</h2>
<p>After trying all these thing on the server side, it’s time to have a look at the documents themselves. Why would some of them open without any problems and some wouldn’t? It’s the same extension, so that can’t be an issue.<br />
Turns out that when we save and upload the documents without a header and custom user data, the documents that failed before open nicely in the browser now!!</p>
<p>To inspect a document for user data:</p>
<ol>
<li>Open the document in the office application (for example Word).</li>
<li>Click on the big, round Office button in the left upper corner.</li>
<li>Click on Prepare.</li>
<li>Click on Inspect document.</li>
</ol>
<p>I haven’t found an article from Microsoft so far that states which features you can include in a document that you upload to sharepoint and which you can’t.  Has anyone come across such an article?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2011/office-web-apps-error-sharepoint/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synchronize data to FTP with WinSCP</title>
		<link>http://heidibrebels.be/blog/archives/2011/synchronize-data-winscp</link>
		<comments>http://heidibrebels.be/blog/archives/2011/synchronize-data-winscp#comments</comments>
		<pubDate>Wed, 20 Apr 2011 12:31:16 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Sync]]></category>
		<category><![CDATA[Synchronizing]]></category>
		<category><![CDATA[WinSCP]]></category>

		<guid isPermaLink="false">http://www.heidibrebels.be/?p=666</guid>
		<description><![CDATA[I recently discovered WinSCP, a Free SFTP, FTP and SCP client for Windows. It has a graphical interface, but for me the most important feature is that you can easily script your way to a very fast and automated synchronization system with the software. ]]></description>
			<content:encoded><![CDATA[<p>I recently discovered <a title="WINSCP" href="http://winscp.net/eng/index.php" target="_blank">WinSCP</a>, a Free SFTP, FTP and SCP client for Windows. It has a graphical interface, but for me the most important feature is that you can easily script your way to a very fast and automated synchronization system with the software.</p>
<p><a title="WinSCP" href="http://winscp.net/eng/index.php" target="_blank"><img class="size-full wp-image-667 aligncenter" title="WinSCP" src="http://heidibrebels.be/wp-content/uploads/2011/04/logoWinSCP.gif" alt="WinSCP" width="150" height="150" /></a></p>
<p>First download and install the <a title="WinSCP" href="http://winscp.net/eng/index.php" target="_blank">WinSCP</a> software.</p>
<p>Then, create a txt file somewhere on your computer and use a similar script:<br />
# Automatically answer all prompts negatively not to stall the script on errors<br />
option batch on<br />
# Disable overwrite confirmations that conflict with the previous<br />
option confirm off<br />
# Connect using a password<br />
open ftp://user:password@IPaddress<br />
# Change remote directory<br />
cd /myDestinationFolder/myDestinationSubFolder<br />
# Force binary mode transfer<br />
option transfer binary<br />
synchronize remote C:mySourceFoldermySourceSubFolder<br />
# Disconnect<br />
close<br />
# Exit WinSCP<br />
Exit</p>
<p>Then create a bat file in the same directory:<br />
@ECHO off<br />
cd &#8220;C:Program FilesWinSCP&#8221;<br />
winscp.exe /console /script=C:PathToTxtFileJustCreatedTxtFileJustCreated.txt /log=&#8221;C:LogPathwinscp.log&#8221;</p>
<p>Then you can use TaskScheduler to schedule the bat file and your synchronization process is complete!</p>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2011/synchronize-data-winscp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full and differential backups in SQL</title>
		<link>http://heidibrebels.be/blog/archives/2011/full-differential-backups-sql</link>
		<comments>http://heidibrebels.be/blog/archives/2011/full-differential-backups-sql#comments</comments>
		<pubDate>Thu, 17 Mar 2011 10:12:19 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Differential backup]]></category>
		<category><![CDATA[Full backup]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[TSQL]]></category>

		<guid isPermaLink="false">http://www.heidibrebels.be/?p=641</guid>
		<description><![CDATA[Full and differential backups in SQL. Each differential backup holds the data between the time the differential backup was taken and the time that the last full backup was taken.]]></description>
			<content:encoded><![CDATA[<p>To set up backups automatically, use these scripts in combination with SQL Agent. In general, you make a full backup once a week and the rest of the week differential backups. Each differential backup holds the data between the time the differential backup was taken and the time that the last full backup was taken.</p>
<p><a href="http://heidibrebels.be/wp-content/uploads/2011/03/backup.jpg" rel="prettyPhoto[641]"><img class="size-full wp-image-644 aligncenter" title="Full and differential backup in SQL" src="http://heidibrebels.be/wp-content/uploads/2011/03/backup.jpg" alt="Full and differential backup in SQL" width="327" height="364" /></a></p>
<p>&#8211; Full backup</p>
<p>DECLARE @filename AS VARCHAR(255)<br />
DECLARE @backupSetId AS INT</p>
<p>SET @filename = N‘C:DBBackupDailyBackupDBName_‘ + CAST(YEAR(GETDATE()) AS VARCHAR(4)) + CAST(MONTH(GETDATE()) AS VARCHAR(2)) + CAST(DAY(GETDATE()) AS VARCHAR(2)) + N&#8217;.bak&#8217;<br />
BACKUP DATABASE [DBName] TO  DISK = @filename WITH NOFORMAT, INIT,  NAME = N&#8217;DBName-Full Database Backup&#8217;, SKIP, NOREWIND, NOUNLOAD,  STATS = 10<br />
select @backupSetId = position from msdb..backupset where database_name=N&#8217;DBName&#8217; and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N&#8217;DBName&#8217; )<br />
if @backupSetId is null begin raiserror(N&#8217;Verify failed. Backup information for database &#8221;DBName&#8221; not found.&#8217;, 16, 1) end<br />
RESTORE VERIFYONLY FROM  DISK = @filename WITH  FILE = @backupSetId,  NOUNLOAD,  NOREWIND</p>
<p>&nbsp;</p>
<p>&#8211; Differential backup</p>
<p>DECLARE @filename AS VARCHAR(255)<br />
DECLARE @backupSetId AS INT</p>
<p>SET @filename = N&#8217;C:DBBackupDailyBackupDBName_Diff_&#8217; + CAST(YEAR(GETDATE()) AS VARCHAR(4)) + CAST(MONTH(GETDATE()) AS VARCHAR(2)) + CAST(DAY(GETDATE()) AS VARCHAR(2)) + N&#8217;.bak&#8217;<br />
BACKUP DATABASE [DBName] TO  DISK = @filename WITH  DIFFERENTIAL , NOFORMAT, INIT,  NAME = N&#8217;DBName-Differential Database Backup&#8217;, SKIP, NOREWIND, NOUNLOAD,  STATS = 10<br />
select @backupSetId = position from msdb..backupset where database_name=N&#8217;DBName&#8217; and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N&#8217;DBName&#8217; )<br />
if @backupSetId is null begin raiserror(N&#8217;Verify failed. Backup information for database &#8221;DBName&#8221; not found.&#8217;, 16, 1) end<br />
RESTORE VERIFYONLY FROM  DISK = @filename WITH  FILE = @backupSetId,  NOUNLOAD,  NOREWIND</p>
<p>&nbsp;</p>
<p><strong>Note:</strong> You can&#8217;t make a differential backup before having first created a full backup.<br />
<strong>Note 2:</strong> Change DBName in the code above in the name of your own database!<br />
<strong>Note 3</strong>: If you copy/paste this code in SQL Server, please remove the single quotes and type them again. For some reason, my blog makes them into foreign characters for SQL Server.</p>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2011/full-differential-backups-sql/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save an image from SQL Server to a file using SQL</title>
		<link>http://heidibrebels.be/blog/archives/2011/save-image-sql-server-file-sql</link>
		<comments>http://heidibrebels.be/blog/archives/2011/save-image-sql-server-file-sql#comments</comments>
		<pubDate>Wed, 16 Mar 2011 11:16:58 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[File]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[TSQL]]></category>

		<guid isPermaLink="false">http://www.heidibrebels.be/?p=635</guid>
		<description><![CDATA[Images take up a lot of space in a database. Save the images from SQL Server to a file using SQL. ]]></description>
			<content:encoded><![CDATA[<p>Images take up a lot of space in a database. SQL Server databases aren&#8217;t cheap to come by at a hosting company and especially not big ones. Therefore, the last thing you would want, is to save your images into the database. I&#8217;ve never been in favor of this method, to use the image type in SQL Server. I always recommend saving the path as a VARCHAR in the database.</p>
<p>Yet, sometimes, you&#8217;re stuck with someone else&#8217;s database design and all of a sudden the issue of space comes up and there you are in the middle of a struggle to save the images from SQL Server to a file using SQL. Sure, you could use other programming languages, but I couldn&#8217;t resist using SQL <img src='http://heidibrebels.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p><a href="http://heidibrebels.be/wp-content/uploads/2011/03/Database_Design1.jpg" rel="prettyPhoto[635]"><img class="size-medium wp-image-647 aligncenter" title="Save an image from SQL Server to file in SQL" src="http://heidibrebels.be/wp-content/uploads/2011/03/Database_Design1-300x225.jpg" alt="Save an image from SQL Server to file in SQL" width="300" height="225" /></a></p>
<p>This script will help with this task:</p>
<p>DECLARE @SOURCEPATH VARBINARY(MAX),<br />
@DESTPATH VARCHAR(MAX),<br />
@ObjectToken INT,<br />
@image_ID BIGINT</p>
<p>DECLARE IMGPATH CURSOR FAST_FORWARD FOR<br />
SELECT Image_Data, image_ID from T_MyImageTable<br />
OPEN IMGPATH</p>
<p>FETCH NEXT FROM IMGPATH INTO @SOURCEPATH, @image_ID</p>
<p>WHILE @@FETCH_STATUS = 0<br />
BEGIN<br />
SET @DESTPATH = &#8216;c:mypath&#8217; + CAST(@image_ID AS varchar) + &#8216;.jpg&#8217;</p>
<p>EXEC sp_OACreate &#8216;ADODB.Stream&#8217;, @ObjectToken OUTPUT<br />
EXEC sp_OASetProperty @ObjectToken, &#8216;Type&#8217;, 1<br />
EXEC sp_OAMethod @ObjectToken, &#8216;Open&#8217;<br />
EXEC sp_OAMethod @ObjectToken, &#8216;Write&#8217;, NULL, @SOURCEPATH<br />
EXEC sp_OAMethod @ObjectToken, &#8216;SaveToFile&#8217;, NULL, @DESTPATH, 2<br />
EXEC sp_OAMethod @ObjectToken, &#8216;Close&#8217;<br />
EXEC sp_OADestroy @ObjectToken</p>
<p>FETCH NEXT FROM IMGPATH INTO @SOURCEPATH, @image_ID<br />
END</p>
<p>CLOSE IMGPATH<br />
DEALLOCATE IMGPATH</p>
<p>&nbsp;</p>
<p><strong>Note 1:</strong> Copy/pasting the single quotes in the code above will result in an error in SQL Server Management Studio. You will have to remove them and type them again to make the script work.</p>
<p><strong>Note 2:</strong> If your image table is very large then this process will require a lot of resources from your computer. In that case, you might consider using a where clause in the cursor select statement.<br />
For example: <em>SELECT Image_Data, image_ID from T_MyImageTable WHERE image_ID &lt; 10000</em><br />
Then he will first extract the first possible 10000 images. Next, run the script again with<br />
<em>SELECT Image_Data, image_ID from T_MyImageTable WHERE image_ID &gt;= 10000 AND image_ID &lt; 20000</em><br />
and so on &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2011/save-image-sql-server-file-sql/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Show multiple rows in one column in SQL</title>
		<link>http://heidibrebels.be/blog/archives/2011/multiple-rows-in-one-column-sql</link>
		<comments>http://heidibrebels.be/blog/archives/2011/multiple-rows-in-one-column-sql#comments</comments>
		<pubDate>Wed, 02 Mar 2011 15:54:10 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[column]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[rows]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.heidibrebels.be/?p=612</guid>
		<description><![CDATA[In SQL Server 2000, I've been looking for a way to show multiple rows in one column, one cell. The content of it separated by comma's.]]></description>
			<content:encoded><![CDATA[<p>Some websites still use a rather old database to store their data. The one I&#8217;m currently facing is MS SQL Server 2000.</p>
<p><a href="http://heidibrebels.be/wp-content/uploads/2011/03/databases.jpg" rel="prettyPhoto[612]"><img class="size-full wp-image-619 aligncenter" title="Databases - MS SQL Server 2000" src="http://heidibrebels.be/wp-content/uploads/2011/03/databases.jpg" alt="Databases - MS SQL Server 2000" width="400" height="300" /></a></p>
<p>I&#8217;ve been looking for a way to show multiple rows in one column, one cell. The content of it separated by comma&#8217;s.</p>
<p>For example, in stead of:</p>
<p>ProjectID                    Label<br />
&#8212;&#8212;&#8212;&#8212;                   &#8212;&#8212;&#8211;<br />
1200                           label1<br />
1200                           label2<br />
1200                           label3</p>
<p>I would like the result of my query to look like this:<br />
ProjectID                    Label<br />
&#8212;&#8212;&#8212;&#8212;                   &#8212;&#8212;&#8211;<br />
1200                          label1, label2, label3</p>
<p>In SQL Server 2000 this isn&#8217;t such a straightforward thing to do. After some googling, I came across a very useful <a title="SQLTeam" href="http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53293" target="_blank">forum</a> that helped me out. I can use a function to return the list of labels:</p>
<p>USE myDatabaseName<br />
GO<br />
CREATE FUNCTION dbo.ConcatLabels(@projectID int)<br />
RETURNS VARCHAR(8000)<br />
AS<br />
BEGIN<br />
DECLARE @Output VARCHAR(8000)<br />
SELECT @Output = COALESCE(@Output+&#8217;, &#8216;, &#8221;) + CONVERT(varchar(20), b.label_name)<br />
FROM	dbo.[T_labelproject] a<br />
JOIN dbo.T_label b			ON b.labelID = a.labelID<br />
WHERE	a.projectID = @projectID<br />
ORDER BY b.label_Name<br />
RETURN @Output<br />
END<br />
GO</p>
<p>Query it with:<br />
SELECT projectID, dbo.ConcatLabels(projectID) AS Label FROM T_Project</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2011/multiple-rows-in-one-column-sql/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resizing Lightbox images</title>
		<link>http://heidibrebels.be/blog/archives/2011/resizing-lightbox-images</link>
		<comments>http://heidibrebels.be/blog/archives/2011/resizing-lightbox-images#comments</comments>
		<pubDate>Sun, 13 Feb 2011 17:30:35 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[Resize]]></category>

		<guid isPermaLink="false">http://www.heidibrebels.be/?p=593</guid>
		<description><![CDATA[I'm using Lightbox2 in my newest project to show images. The images, though, are way too big to show in their original size. I was surprised that I couldn't find a property or something in the code to resize the images. After some researching on Google and figuring out a resize calculation, I made the following adjustments to the code to resize my images without having to resize each one of them before uploading.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using <a title="Lightbox" href="http://www.lokeshdhakar.com/projects/lightbox2/" target="_blank">Lightbox2</a> in my newest project to show images. The images, though, are way too big to show in their original size. I was surprised that I couldn&#8217;t find a property or something in the code to resize the images. After some researching on Google and figuring out a resize calculation, I made the following adjustments to the code to resize my images without having to resize each one of them before uploading:</p>
<p><strong><span style="color: #c7ca86;">Lightbox.css</span></strong></p>
<p>Change:<br />
#lightbox img{ width: auto; height: auto;}</p>
<p>To:<br />
#lightbox img{ max-width: 600px; }</p>
<p><strong><span style="color: #c7ca86;">Lightbox.js</span></strong></p>
<p>Change:<br />
imgPreloader.onload = (function(){<br />
this.lightboxImage.src = this.imageArray[this.activeImage][0];<br />
this.resizeImageContainer(<strong><span style="color: #c7ca86;">imgPreloader.width, imgPreloader.height</span></strong>);<br />
}).bind(this);<br />
imgPreloader.src = this.imageArray[this.activeImage][0];<br />
},</p>
<p>To:<br />
imgPreloader.onload = (function(){<br />
this.lightboxImage.src = this.imageArray[this.activeImage][0];<br />
this.resizeImageContainer(<strong><span style="color: #c7ca86;">600, imgPreloader.height / (imgPreloader.width/600)</span></strong>);<br />
}).bind(this);<br />
imgPreloader.src = this.imageArray[this.activeImage][0];<br />
},</p>
<p>I choose to always show the images with a width of 600px. So, if you want a different width, then change the 600 to the number you choose. You can also go with a height in stead of a width, but then you have to change the calculation formula a bit and use the max-height property in the CSS file.</p>
]]></content:encoded>
			<wfw:commentRss>http://heidibrebels.be/blog/archives/2011/resizing-lightbox-images/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

