<?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>MariusSoft Development Blog</title>
	<atom:link href="http://mariussoft.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://mariussoft.com/blog</link>
	<description>Learning and Knowledge Sharing</description>
	<lastBuildDate>Tue, 20 Apr 2010 21:25:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Windows Application, Processes &amp; Threads</title>
		<link>http://mariussoft.com/blog/?p=129</link>
		<comments>http://mariussoft.com/blog/?p=129#comments</comments>
		<pubDate>Fri, 16 Apr 2010 21:58:46 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://mariussoft.com/blog/?p=129</guid>
		<description><![CDATA[How does Windows allocate CPU time?
CPU (Central Processing Unit) time is incredibly valuable. It  determines how much and how fast code can be executed (in the context of  length of time in regards to amount). Because of this, the operating  system has to be conscious of how it split processing time between [...]]]></description>
			<content:encoded><![CDATA[<p><strong>How does Windows allocate CPU time?</strong></p>
<p>CPU (Central Processing Unit) time is incredibly valuable. It  determines how much and how fast code can be executed (in the context of  length of time in regards to amount). Because of this, the operating  system has to be conscious of how it split processing time between the  different programs and services that are running. In order to make this a  reality, various structures are needed to represents the executing  code.</p>
<p><strong>Applications &#8211; Processes &#8211; Threads<br />
</strong></p>
<p>An application consists of one or more processes. A <em>process</em> is an executing program. One or more threads run  in  the context of the process. A <em>thread</em> is the basic unit to   which the operating system allocates processor time. A thread can   execute any part of the process code, including ?parts currently being   executed by another thread. All threads in a process share the same memory and system resources. Each CPU core can execute one thread at a time, so multi core systems can execute as many threads in parallel at the same exact time as the amount of CPU cores available.</p>
<p>To recap, a threads make up a  process which makes up an application. The simplest application will  have one process consisting of one thread. Multi threaded applications can have multiple processes with multiple threads.</p>
<p><strong>Thread Pools</strong></p>
<p>Creating  and terminating a thread is very time consuming. Memory allocation,  thread management, and processing time are all involved in handling  multiple threads. The more threads an application has, the more of these  resources it will consume.</p>
<p>Some applications are written to take  advantage of multiple threads and run processes (not windows process,  but a literal one) in parallel. Some of these processes are very short  lived and make the cost of creating and terminating the thread very  expensive. In a way, the ROI is not high enough.</p>
<p>In order to make  multi threading less expensive resource wise, thread pools were  introduced. Thread pools are collections of worker threads that handle  processes on behalf of the main thread.</p>
<p>A good analogy to this  would be a restaurant. A new waiter (thread) would have to be hired  every time a customer walked in the door. The waiter would take the  order, bring the food, charge the fee, and do other tasks. When the  waiter would be done serving that customer, they would be fired (thread  terminated) and a new waiter hired for the next customer. This is  incredibly inefficient if there are many customers and they spend very  little time in the restaurant. A thread pool would be like having a  staff of waiters ready to serve new customers as they walked in.</p>
<p><strong>Process  &amp; Thread Priority</strong></p>
<p>The operating system dictates how much  processing time is given to each process based on the process priority. In windows, you can change the priority of a running process by using the Windows Task Manager and the processes tab. Similarly, processes can change the priority of the treads that make it up. By assigning a higher priority, that particular thread would get more processing time allocated to it.</p>
<p>A good use of this would be in an application that has heavy background processing. The thread responsible for the UI should have a higher priority then the thread which is running background processes. This would ensure that the application is responsive to the user input.</p>
<p><strong>Memory</strong> <strong>Sharing</strong></p>
<p>While multiple threads can execute the same exact code at the same time, they can not read and write to the same memory space. Safeguards are built in to ensure that memory access by multiple threads don&#8217;t overlap. Race conditions are one of the biggest problems in multi threaded applications. When one thread starts reading or writing to a piece of memory, other threads have to wait for it to finish.</p>
<p>An example problem would be two threads needing to read the same memory. Thread A starts reading some memory, but can&#8217;t finish until thread B sends a value back that thread A needs in order to finish its calculation. Thread B, in order to send the value back, needs to read the memory that Thread A has locked. Both threads are now waiting for each other and are in a deadlock.</p>
<p><strong>Thread Timing</strong></p>
<p>Windows splits up processing time between threads based on priority. As each thread gets a given amount of clock cycles to process. If the thread finishes processing before the time is up, it returns the processing time to the OS. The extra time is then added to the pool of time and split among the other threads. If after every thread has processed there is extra time left over, the time is allocated to the System Idle Process that can be seen with Windows Task Manager.</p>
<p><strong>Multi Threading Considerations</strong></p>
<p>Problems such as the deadlock and race conditions described are some of the challenges that face multi thread applications. Taking advantage of powerful systems with multiple cores capable of running multiple threads at once increases processing speed, but developers have a lot more of challenges to work with. The timing or threads, the work they do, and the memory they share are all thrown into the equation when designing multi threaded applications.</p>
<p><strong>HAPPY CODING!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://mariussoft.com/blog/?feed=rss2&amp;p=129</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL Server 2005 &amp; 2008 &#8211; Unable to start job (reason: syntax error)</title>
		<link>http://mariussoft.com/blog/?p=120</link>
		<comments>http://mariussoft.com/blog/?p=120#comments</comments>
		<pubDate>Fri, 16 Apr 2010 21:43:15 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://mariussoft.com/blog/?p=120</guid>
		<description><![CDATA[Error Message
Unable to start execution of step 1 (reason: line(1): Syntax error).   The step failed.
The Problem
SQL renames or re-saves the package job after editing causing the package location to be inaccessible.


The Solution
Append a backslash &#8216;\&#8217; to the package name
1. Navigate to your job  (Database Server &#8211; &#62;SQL Server Agent -&#62; Jobs -&#62; Your Job) [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Error Message</strong></p>
<p>Unable to start execution of step 1 (reason: line(1): Syntax error).   The step failed.</p>
<p><strong>The Problem</strong></p>
<p>SQL renames or re-saves the package job after editing causing the package location to be inaccessible.</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/04/1.png"><img class="alignnone size-medium wp-image-122" title="1" src="http://mariussoft.com/blog/wp-content/uploads/2010/04/1-300x175.png" alt="" width="300" height="175" /></a></p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/04/2.png"><img class="alignnone size-medium wp-image-123" title="SQL Server agent error" src="http://mariussoft.com/blog/wp-content/uploads/2010/04/2-300x66.png" alt="" width="300" height="66" /></a></p>
<p><strong>The Solution</strong></p>
<p>Append a backslash &#8216;\&#8217; to the package name</p>
<p>1. Navigate to your job  (Database Server &#8211; &gt;SQL Server Agent -&gt; Jobs -&gt; Your Job) and right click, choose properties</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/04/3.png"><img class="alignnone size-medium wp-image-124" title="Agent properties" src="http://mariussoft.com/blog/wp-content/uploads/2010/04/3-198x300.png" alt="" width="198" height="300" /></a></p>
<p>2. Click on steps in the job properties, choose the first step in the job step list, click edit below the job list.</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/04/4.png"><img class="alignnone size-medium wp-image-125" title="Agent Package" src="http://mariussoft.com/blog/wp-content/uploads/2010/04/4-300x269.png" alt="" width="300" height="269" /></a></p>
<p>3. Add a backslash &#8216;\&#8217; to the package name and save</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/04/5.png"><img class="alignnone size-medium wp-image-126" title="Agent Steps" src="http://mariussoft.com/blog/wp-content/uploads/2010/04/5-300x269.png" alt="" width="300" height="269" /></a></p>
<p><strong>HAPPY CODING!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://mariussoft.com/blog/?feed=rss2&amp;p=120</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SunSpider Browser Benchmarks</title>
		<link>http://mariussoft.com/blog/?p=111</link>
		<comments>http://mariussoft.com/blog/?p=111#comments</comments>
		<pubDate>Wed, 24 Mar 2010 01:41:30 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mariussoft.com/blog/?p=111</guid>
		<description><![CDATA[Web 2.0
If you don&#8217;t already know, most of the web 2.0 technologies today are built on top of javascript. Javascript is scripting language that browsers use to perform the more advanced features of a website. All of the pretty CCS layouts, the XML traffic, and of course the constant tweeting and face-booking would not be [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Web 2.0</strong></p>
<p>If you don&#8217;t already know, most of the web 2.0 technologies today are built on top of javascript. Javascript is scripting language that browsers use to perform the more advanced features of a website. All of the pretty CCS layouts, the XML traffic, and of course the constant tweeting and face-booking would not be possible without this language and the support  browsers provide for it.</p>
<p><strong>Browsers</strong></p>
<p>As most of us know, different browsers render pages differently, some are more efficient then others at different tasks, and some are more secure. Some of the bigger players come pre installed on the os of your choosing, while others sit quietly behind the scenes and wait for the few followers to download them. In any case, one thing is universal, each and every browser is ultimately different then the other.</p>
<p><strong>Benchmarking</strong></p>
<p>Benchmarking is a way to test the speed and efficiency of a task. Benchmarking javascript, up until recently, was almost impossible. There have been lots of micro benchmarks here and there, but no true test that sums of the speed of the javascript engine in a browser.</p>
<p><strong>WebKit Open Source Project</strong></p>
<p><a href="http://www2.webkit.org/" target="_blank">Webkit.org</a><strong> </strong>is the home of the open source web browser engine developer by Apple, currently used in Safari and multiple OS X applications. One of the tools it provides is the <a href="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html" target="_blank">SunSpider Javascript Benchmark</a>, a true representation of a browsers javascript performance. By testing multiple facets of a browsers javascript processing speed, we can gain a balanced real world comparison between the different processing speeds different browsers offer.</p>
<p><strong>Chart in milliseconds (Lower means quicker &#8211; total was divided by 5 to fit nicely in chart)<br />
</strong></p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/03/Untitled-1.png"><img class="alignnone size-full wp-image-118" title="SunSpider" src="http://mariussoft.com/blog/wp-content/uploads/2010/03/Untitled-1.png" alt="SunSpider" width="804" height="423" /></a></p>
<p><strong>Raw Numbers</strong></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr height="20">
<td width="209" height="20"></td>
<td align="right">3D</td>
<td align="right">Access</td>
<td align="right">Bitops</td>
<td align="right">ControlFlow</td>
<td align="right">Crypto</td>
<td align="right">Date</td>
<td align="right">Math</td>
<td align="right">Regexp</td>
<td align="right">String</td>
<td align="right">Total</td>
</tr>
<tr height="20">
<td width="209" height="20">Internet Explorer 9 Beta</td>
<td align="right">440.6</td>
<td align="right">544.6</td>
<td align="right">489.4</td>
<td align="right">86.6</td>
<td align="right">245</td>
<td align="right">183.2</td>
<td align="right">270.8</td>
<td align="right">39</td>
<td align="right">466.4</td>
<td align="right">2765.4</td>
</tr>
<tr height="20">
<td width="209" height="20">Internet Explorer 8</td>
<td align="right">668.4</td>
<td align="right">929.6</td>
<td align="right">725.4</td>
<td align="right">139</td>
<td align="right">389.8</td>
<td align="right">474.2</td>
<td align="right">595</td>
<td align="right">208</td>
<td align="right">1012</td>
<td align="right">5141.6</td>
</tr>
<tr height="20">
<td height="20">Firefox 3.6</td>
<td align="right">165.4</td>
<td align="right">165.4</td>
<td align="right">51.8</td>
<td align="right">47</td>
<td align="right">65.8</td>
<td align="right">164.4</td>
<td align="right">68.6</td>
<td align="right">56.8</td>
<td align="right">279</td>
<td align="right">1064.2</td>
</tr>
<tr height="20">
<td height="20">Safari 4.0</td>
<td align="right">71.8</td>
<td align="right">60</td>
<td align="right">37.4</td>
<td align="right">6.2</td>
<td align="right">40</td>
<td align="right">78.4</td>
<td align="right">61.6</td>
<td align="right">26.2</td>
<td align="right">210.6</td>
<td align="right">592.2</td>
</tr>
<tr height="20">
<td height="20">Chrome 4.1</td>
<td align="right">81.6</td>
<td align="right">43.4</td>
<td align="right">48.4</td>
<td align="right">3.4</td>
<td align="right">38.4</td>
<td align="right">67.6</td>
<td align="right">504</td>
<td align="right">18</td>
<td align="right">193.8</td>
<td align="right">545</td>
</tr>
<tr height="20">
<td height="20">Opera 10.51</td>
<td align="right">62.2</td>
<td align="right">53</td>
<td align="right">23.2</td>
<td align="right">5.8</td>
<td align="right">30</td>
<td align="right">69</td>
<td align="right">56.6</td>
<td align="right">15.6</td>
<td align="right">153.6</td>
<td align="right">469</td>
</tr>
</tbody>
</table>
<p><strong>Conclusion</strong></p>
<p>As you can see, not all browsers perform at the same speed. Lagging far behind is Microsofts Internet Explorer 8. While IE 9 promises, and in tech previews proves to have made huge leaps in closing the gap behind the other leading browsers, it suffers from slow release cycles. The other leading browsers push routine updates which enables the end user to browse at the fastest speeds available while IE leaves months, or years in between version releases.</p>
<p>The true test of speed is yet to come. As more Twitter and Facebook sites pop up, and web 3.0 inches closer, it is up to the browser developers to ensure they keep up with the new demands for speed and efficiency.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariussoft.com/blog/?feed=rss2&amp;p=111</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# 4.0 &#8211; Optional Parameters, Default Values, and Named Parameters</title>
		<link>http://mariussoft.com/blog/?p=97</link>
		<comments>http://mariussoft.com/blog/?p=97#comments</comments>
		<pubDate>Tue, 23 Mar 2010 00:59:44 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://mariussoft.com/blog/?p=97</guid>
		<description><![CDATA[Parameters
Parameters are simply values that can be passed into a method. A method specifies what parameters, along with their type, it accepts and expects. Traditionally in C#, when we want to accept different sets of parameters or set default values, we would overload methods and supply the information by chaining the calls. This can be [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Parameters</strong></p>
<p>Parameters are simply values that can be passed into a method. A method specifies what parameters, along with their type, it accepts and expects. Traditionally in C#, when we want to accept different sets of parameters or set default values, we would overload methods and supply the information by chaining the calls. This can be messy and can cause a lot of variations of a method. Keeping track of default values can also become a challenge.</p>
<pre class="brush: csharp;">

static void Main(string[] args)
{
   CreatePerson(&quot;Marius&quot;);
   CreatePerson(&quot;Marius&quot;, 24);
   CreatePerson(&quot;Marius&quot;, 24, &quot;USA&quot;);
}

static void CreatePerson(string Name)
{
    CreatePerson(Name, 24, &quot;USA&quot;);
}

static void CreatePerson(string Name, int Age)
{
    CreatePerson(Name, Age, &quot;USA&quot;);
}

static void CreatePerson(string Name, int Age, string Location)
{
    //Logic...
}
</pre>
<p><strong>Default Values &amp; Optional Parameters in C# 4.0</strong><br />
In order to deal with the default value issue, C# 4.0 has introduced default values. By assigning a default to a parameter, we don&#8217;t require the value to be passed in which automatically makes it optional.</p>
<pre class="brush: csharp;">
static void Main(string[] args)
{
    CreatePerson(&quot;Marius&quot;);
    CreatePerson(&quot;Marius&quot;, 24);
    CreatePerson(&quot;Marius&quot;, 24, &quot;USA&quot;);
}

static void CreatePerson(string Name, int Age = 20, string Location= &quot;USA&quot;)
{
    //Logic...
}
</pre>
<p><strong>Named Parameters</strong></p>
<p>When you have a method that has multiple optional parameters and you want to provide the value of only one, you have to use named parameters. These are quite simply parameters formatted as [Parameter Name]: Value</p>
<pre class="brush: csharp;">
static void Main(string[] args)
{
    CreatePerson(&quot;Marius&quot;, BirthPlace: &quot;Other Location&quot;);
    CreatePerson(&quot;Marius&quot;, Age:26);
    CreatePerson(&quot;Marius&quot;, BirthPlace: &quot;Other Location&quot;, Age: 26);
}

static void CreatePerson(string Name, int Age = 24, string BirthPlace = &quot;USA&quot;)
{
    //Logic...
}
</pre>
<p><strong>Visual Studio &amp; Conditions</strong></p>
<p>The only conditions placed on the developer is that optional parameters are to be declared at the end of the method arguments, after all of the full parameters have been declared. This means that when calling the methods, all full parameters must be passed in like a normal method, and then the named parameters can be given for the optional default parameters in any order.</p>
<p>Visual Studio 2010 adds supports for these new language features very nicely. As you can see below, the default values for the optional parameters are shown, and intellisense supports the selection of the named paramaters as expected.</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/03/Capture.png"><img class="alignnone size-full wp-image-107" title="VS 2010 Optional Parameters" src="http://mariussoft.com/blog/wp-content/uploads/2010/03/Capture.png" alt="VS 2010 Optional Parameters" width="672" height="294" /></a></p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/03/Capture.png"></a></p>
<p><strong> </strong></p>
<p><strong>Other Thoughts</strong><br />
As with each iteration of the C# language, Optional Parameters, Named Parameters, and Default Values give even more control to the C# developer. These new features will save a lot of overloading and method chaining, and will undoubtebly save a lot of developers from the &#8220;factory method&#8221; value instatiation.</p>
<p><strong>HAPPY CODING!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://mariussoft.com/blog/?feed=rss2&amp;p=97</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securely Deleting Files From Your Hard Drive</title>
		<link>http://mariussoft.com/blog/?p=85</link>
		<comments>http://mariussoft.com/blog/?p=85#comments</comments>
		<pubDate>Tue, 09 Mar 2010 02:13:02 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://mariussoft.com/blog/?p=85</guid>
		<description><![CDATA[Deleting Files (or not&#8230;)
When deleting files in Windows, only the pointer to the file is deleted from the file table, not the actual data. Think of it like an index in a book. If the index pointer for a particular page is removed, it is much harder to find the particular page. If we go [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Deleting Files (or not&#8230;)</strong></p>
<p>When deleting files in Windows, only the pointer to the file is deleted from the file table, not the actual data. Think of it like an index in a book. If the index pointer for a particular page is removed, it is much harder to find the particular page. If we go through the book, page by page, we will eventually find the page we want without needing the index to help us.</p>
<p>Using free and commercial software recovery tools such as Recuva, we can  recover deleted files from a hard drive by scouring all of the bits on a hard drive, much like flipping through all of the pages of a book. For this reason, it is important that we ensure that files we want deleted are fully stripped from the hard drive.</p>
<p><strong>How The Disk Scrubber Works</strong></p>
<p>The MariusSoft Disk Scrubber leverages the power of the windows cipher utility to cleanly wipe deleted files. This process is accomplished in 3 steps. First, 0&#8217;s are written over all of the deleted files. This is followed by 1&#8217;s being written, and finally random 0&#8217;s and 1&#8217;s. This 3 step process ensures that sectors are obfuscated enough to where the deleted files are no longer recognizable by recovery software.</p>
<p><strong>Video Presentation</strong></p>
<div id="media" style="text-align: center;"><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="../media/DiskScrubber/DiskScrubber_controller.swf" /><param name="bgcolor" value="#1a1a1a" /><param name="quality" value="best" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="flashVars" value="autostart=false" /><param name="name" value="csSWF" /><param name="flashvars" value="autostart=false&amp;thumb=../media/DiskScrubber/FirstFrame.png&amp;thumbscale=45&amp;color=0x000000,0x000000" /><param name="allowfullscreen" value="true" /><embed id="csSWF" type="application/x-shockwave-flash" width="640" height="498" src="../media/DiskScrubber/DiskScrubber_controller.swf" name="csSWF" flashvars="autostart=false&amp;thumb=../media/DiskScrubber/FirstFrame.png&amp;thumbscale=45&amp;color=0x000000,0x000000" scale="showall" allowfullscreen="true" allowscriptaccess="always" quality="best" bgcolor="#1a1a1a"></embed></object></div>
<p>Get your hands on the Disk Scrubber <a href="http://mariussoft.com/Products.aspx?Product=DiskScrubber" target="_self">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariussoft.com/blog/?feed=rss2&amp;p=85</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Introduction to Data Security</title>
		<link>http://mariussoft.com/blog/?p=72</link>
		<comments>http://mariussoft.com/blog/?p=72#comments</comments>
		<pubDate>Thu, 04 Mar 2010 02:17:05 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://mariussoft.com/blog/?p=72</guid>
		<description><![CDATA[Data in the Digital Age
What is data? Simply put, data is information stored in digital form. Why is information so important? Simple, information is the key to modern day society. Information enables us to share ideas, make informed decisions, keep records, speed up processes, etc&#8230; Data storage and transfer is more prevalent today then it [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Data in the Digital Age</strong></p>
<p>What is data? Simply put, data is information stored in digital form. Why is information so important? Simple, information is the key to modern day society. Information enables us to share ideas, make informed decisions, keep records, speed up processes, etc&#8230; Data storage and transfer is more prevalent today then it has ever been as the medium of choice for information transfer. The biggest challenge is no longer getting data from one person to another, but securing that data.</p>
<p>With the introduction of the internet and the movement of storing more and more data onto computer systems, the electronic security age began and has flourished ever since. There are countless of entities all over the world trying to gain unauthorized access to data on every kind of system imaginable, and at the same time there are experts countering these entities.</p>
<p><strong>History  of the Internet</strong></p>
<p>In order to gain a better  understanding  of the internet and interconnected computer systems, one  should look at  its roots. The first rudimentary computer network that  linked  geographically separated computer systems was called <a href="http://en.wikipedia.org/wiki/Arpanet" target="_blank">Arpanet</a>.  Arpanet stands  for (Advanced Research Projects Agency Network) and was  created by DARPA  (<a href="http://en.wikipedia.org/wiki/Defense_Advanced_Research_Projects_Agency" target="_blank">Defense  Advanced Research Projects Agency</a>). The  network linked computer  systems from universities across the US  together. It was the first network to use <a href="http://en.wikipedia.org/wiki/Packet_switching" target="_blank">packet switching</a>, a communications method where data is transmitted in groups rather than the slower, less reliable <a href="http://en.wikipedia.org/wiki/Circuit_switching" target="_blank">circuit switching</a> that was prevalent at that time.</p>
<p>As the network  grew, more and more people gained access  to transferring more data  between each other. This brought many  advantages and many security concerns. As people started transferring sensitive data, those wishing to gain access to that data illegally started creating ways to do so.</p>
<p><strong>History of Hacking<br />
</strong></p>
<p>The modern day term of the words &#8216;hack&#8217;  and &#8216;hacker&#8217; was <a href="http://en.wikipedia.org/wiki/Hack_%28technology%29" target="_blank">first widely introduced in the 1960&#8217;s</a> and originated  at MIT. Simply, hacking referred to students who created a quick and  elaborate and/or bodged solution to a technical obstacle. The term  hacking is now almost synonymous with unauthorized access to computer  systems, not just by students but by anyone. While hacking does have a  rather dark modern day meaning, it does semantically apply to other  forms of legal hacking, ex <a href="http://hackaday.com/" target="_blank">hackaday.com</a>.</p>
<p><strong>Some Notable Hacks in History</strong></p>
<p><span style="text-decoration: underline;">1983:</span></p>
<p><a href="http://en.wikipedia.org/wiki/Kevin_Poulsen" target="_blank">Kevin Poulsen</a> aka  Dark Dante hacks into <a href="http://en.wikipedia.org/wiki/Arpanet" target="_blank">Arpanet</a>, the grandfather  to the modern day internet. While still a student, Poulsen found a  loophole in Arpanet&#8217;s architecture and exploited it to gain temporary  control of the US wide network.</p>
<p><span style="text-decoration: underline;">1988:</span></p>
<p><a href="http://en.wikipedia.org/wiki/Robert_Tappan_Morris" target="_blank">Robert Morris</a>, a 23 year old Cornell University Graduate student creates the first internet worm. Created with the intent to count how many computers existed on the internet at the time, he creates a program with just 99 lines of code. In order to bypass system administrators to gauge the size correctly, he includes code to evade the administrators and exploit several vulnerabilities in the computer systems. The worms spread rapidly, infecting thousands of computers, crashing them and causing huge potential loss in productivity.</p>
<p><span style="text-decoration: underline;">1995:</span></p>
<p><a href="http://en.wikipedia.org/wiki/Vladimir_Levin" target="_blank">Vladimir Levin</a>, a Russian computer hacker was the first to attempt to hack into a bank. He hacked into Citibank and managed to transfer $10 million dollars into accounts across the world.</p>
<p><strong>Increasing Amount of Data Accessible via the Internet</strong></p>
<p>According to <a href="http://news.netcraft.com/" target="_blank">netcraft</a>, there are about 190,000,000 (190 million) websites on the internet, with this number increasing faster and faster every year. This is not surprising given there are nearly <a href="http://www.bls.gov/oco/ocos303.htm" target="_blank">1.6 million programmers</a> in the world with more companies pushing internet based electronic services. The more websites and systems exist that have a connection to secure data and are reachable via the internet, the more chances there are that the data will be compromised.</p>
<p>As companies expand their presence and services on the web, more and more dynamic data is becoming available on the internet (online banking, social networking, accounting and tax software, etc&#8230;). Dynamic websites that provide these services, both personal and business, usually store some kind of identifiable information that can be monetized by hackers and spam organizations. Whether it be email addresses, names, social security numbers, credit card numbers, corporate research, etc&#8230; this data is sought by those that wish to sell it or use it for other unlawful means or exploitation.</p>
<p>Any system that is connected to the internet that has any kind of sensitive data worth securing is usually at risk of being attacked. This is the reality of today&#8217;s data exchange landscape and one that all, not just developers and system administrators, must think about. Every time you send your name, email address, or any other type of information over to a website, you risk your data getting compromised and stolen.</p>
<p><strong>Data Breaches</strong></p>
<p>Modern day governance take hacking and data breaches very seriously. Depending on the specific industry, some companies are required to <a href="http://www.privacyrights.org/ar/ChronDataBreaches.htm#CP" target="_blank">report any hacking/data breach incidents</a>. Huge amounts of money are spent into research and equipment to stop hackers.</p>
<p>Everything from network level <a href="http://en.wikipedia.org/wiki/Firewall_%28computing%29" target="_blank">firewalls</a>, <a href="http://en.wikipedia.org/wiki/Intrusion_detection_systems" target="_blank">intrusion detection systems</a>, <a href="http://www.imperva.com/products/web-application-firewall.html" target="_blank">web application firewalls</a> to password protected accounts, database security triggers, and application security frameworks are modern day countermeasures to try and prevent hackers from gaining unauthorized access to data.</p>
<p><strong>Securing </strong><strong>Data </strong></p>
<p>Over the next couple of blogs, I will talk about the different types of security. The following are some of the different topics I will cover.</p>
<ul>
<li>SQL server security</li>
<li>Web application security</li>
<li>Windows application security</li>
<li>.NET code execution security</li>
<li>Network level security</li>
<li>Social Engineering attacks and security awareness</li>
<li>Recovering from a breach of data security</li>
<li><a href="?p=85">Hard Drive File Deletion</a></li>
</ul>
<p><strong>Stay tuned!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://mariussoft.com/blog/?feed=rss2&amp;p=72</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SQL SERVER 2005 &amp; 2008 Quick Deletes in Large Tables</title>
		<link>http://mariussoft.com/blog/?p=51</link>
		<comments>http://mariussoft.com/blog/?p=51#comments</comments>
		<pubDate>Fri, 26 Feb 2010 22:21:33 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://mariussoft.com/blog/?p=51</guid>
		<description><![CDATA[SQL Transaction Logging
By default, any operations in SQL Server such as inserts, updates, and deletes are stored in the transaction log. The principle behind the transaction log is to revert the operation if an error occurs and to ship the logs for backup purposes. When you have a huge table and you initiate a delete [...]]]></description>
			<content:encoded><![CDATA[<p><strong>SQL Transaction Logging</strong></p>
<p>By default, any operations in SQL Server such as inserts, updates, and deletes are stored in the transaction log. The principle behind the transaction log is to revert the operation if an error occurs and to ship the logs for backup purposes. When you have a huge table and you initiate a delete command on all of the rows, SQL will delete each row after logging it into its transaction log.</p>
<p><strong>The Problem</strong></p>
<p>Logging takes a long time and the log file will grow as each record is deleted from the database. If an error is encountered, even at the last row to be deleted, all of the transactions will need to be reverted. The process of reverting the delete operations in itself takes a significant amount of time.</p>
<p><strong>The Solution</strong></p>
<p>SQL Server 2005 and grater enhanced the functionality of the TOP operator. It can be used in conjunction with insert, update, and delete statements. By leveraging the top function and deleting a limited set at a time, we can minimize the amount of records to be reverted in case of an error, issue less locks on the table making it more usable while the operation is taking place, and allowing the log file space to be re-used.</p>
<p><span style="text-decoration: underline;" class="redText">The following code performs a batch deletion of records 10,000 at a time</span>:</p>
<pre class="brush: sql;">
While (select count(*) from TABLENAME) &gt; 0
Begin
Delete Top(10000) from TABLENAME
If @@rowcount == 0 break
End
</pre>
<p>Just replace <strong>TABLENAME</strong> with the name of the table you are deleting and run the statement against your database.</p>
<p><strong>HAPPY CODING!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://mariussoft.com/blog/?feed=rss2&amp;p=51</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL Server 2008 Collation on Limited Security Accounts</title>
		<link>http://mariussoft.com/blog/?p=34</link>
		<comments>http://mariussoft.com/blog/?p=34#comments</comments>
		<pubDate>Fri, 26 Feb 2010 07:13:17 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://mariussoft.com/blog/?p=34</guid>
		<description><![CDATA[What is collation?
Collation is a set of rules that determine how data is stored and compared in SQL server. These rules define characteristics such as how data is sorted with the correct character sequence, case sensitivity specifications, how accent marks are treated, and character widths.
How can collation cause trouble in SQL Server Management Studio in [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What is collation?</strong></p>
<p>Collation is a set of rules that determine how data is stored and compared in SQL server. These rules define characteristics such as how data is sorted with the correct character sequence, case sensitivity specifications, how accent marks are treated, and character widths.</p>
<p><strong>How can collation cause trouble in SQL Server Management Studio in a limited security environment?</strong></p>
<p>By default, when you click the &#8216;Databases&#8217; node within the SQL server management studio under the Object Explorer after connecting to a server, a list of databases on that server is enumerated and shown. In a shared environment, such as a hosted SQL server account solution, each log-in only has access to its own database. This means that collation information is only available for the database that the log-in has access to.</p>
<p>SQL server management studio, by default, tries to grab collation information for every database that is enumerated on the server. The trouble occurs when a database that has a collation other then the default is enumerated and the log-in used to enumerate the database does not have access to the collation information. This usually results in a complete error when opening the &#8216;Database&#8217; node and prevents any databases from being shown.</p>
<p><span style="text-decoration: underline;" class="redText">The error usually states</span>:<br />
Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)<br />
&#8211;&gt; An exception occured while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)<br />
&#8211;&gt; The server principay &#8220;login&#8221; is not able to access the database &#8220;db with non default collation&#8221; under the current security context. (Microsoft SQL Server, Error:916)</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/02/Capture2.png"><img class="alignnone size-medium wp-image-43" title="SQL Error" src="http://mariussoft.com/blog/wp-content/uploads/2010/02/Capture2-300x102.png" alt="" width="300" height="102" /></a></p>
<p><strong>How can the problem be fixed?</strong></p>
<p>The quickest way to mitigate this issue is to turn off database collation by default. To do this, follow the steps below.</p>
<p>1. Click on the &#8216;Databases&#8217; folder under the SQL server in the SQL Server Management Studio.</p>
<p>2. Press F7 or click the &#8216;View&#8217; toolbar menu item then select &#8216;Object Explorer Details&#8217;</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/02/Untitled.png"><img class="alignnone size-medium wp-image-44" title="Object Explorer Menu Item" src="http://mariussoft.com/blog/wp-content/uploads/2010/02/Untitled-300x269.png" alt="" width="300" height="269" /></a></p>
<p>3. Right click the headers in the &#8216;Object Explorer Details&#8217; data grid and deselect &#8216;Collation&#8217;</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/02/collatiobn.png"><img class="alignnone size-medium wp-image-45" title="Collation" src="http://mariussoft.com/blog/wp-content/uploads/2010/02/collatiobn-300x220.png" alt="" width="300" height="220" /></a></p>
<p>That&#8217;s it! If you try to re-enumerate the databases, the blocking operation will no longer be executed by default.</p>
<p><strong>Happy Coding!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://mariussoft.com/blog/?feed=rss2&amp;p=34</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tortoise SVN Global Ignore Pattern for Visual Studio 2008 w/ ReSharper</title>
		<link>http://mariussoft.com/blog/?p=11</link>
		<comments>http://mariussoft.com/blog/?p=11#comments</comments>
		<pubDate>Thu, 25 Feb 2010 23:29:27 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Source Control]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://mariussoft.com/blog/?p=11</guid>
		<description><![CDATA[Source/Version/Revision Control
How many times have you spent countless hours writing code just to realize you&#8217;ve either overwritten or accidentally deleted your files? How many times have you been working with a team of developers just to realize your coworker has overwritten your code?
This has unfortunately happened to the best of us at one point or [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Source/Version/Revision Control</strong></p>
<p>How many times have you spent countless hours writing code just to realize you&#8217;ve either overwritten or accidentally deleted your files? How many times have you been working with a team of developers just to realize your coworker has overwritten your code?</p>
<p>This has unfortunately happened to the best of us at one point or another. This issue usually prompts us to look for a way to easily backup our code and share it between multiple developers. On our journey, we find many different flavors of source/revision control. Dependent upon your preference there are multiple options available, some free, some purchased. For more information on source control visit <a href="http://en.wikipedia.org/wiki/Revision_control">Wikipedia</a>.</p>
<p><strong>The Problem</strong></p>
<p>For those of you that have chosen Tortoise SVN, a windows shell integrated CVS source control solution, you may find it unnecessary to save files or folders created by plug-ins and visual studio. These files can be very annoying as they usually change every time you open up your solution, or build your application. A popular plug-in for Visual Studio that creates extra files and folders is <a href="http://www.jetbrains.com/resharper/">ReSharper</a>. I will focus on removing the files created by this plug-in.</p>
<p>As you can see, ReSharper folders and files are available to add to the source control by default.</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/02/Capture.png"><img class="alignnone size-medium wp-image-21" title="SVN-Dirty" src="http://mariussoft.com/blog/wp-content/uploads/2010/02/Capture-300x212.png" alt="" width="300" height="212" /></a></p>
<p><strong>The Solution</strong></p>
<p>In order to tell Tortoise SVN to ignore the files and folders created by ReSharper and to not list them every time we commit our files, we have to add the extensions/folders to Tortoise SVN&#8217;s global ignore pattern text box.</p>
<p><span style="text-decoration: underline;" class="redText">Ignore pattern to ignore ReSharper Created files</span>:</p>
<pre class="brush: csharp;">
**.ReSharper** **\_ReSharper.**
</pre>
<p><span style="text-decoration: underline;" class="redText">Ignore pattern to ignore Visual Studio Files which shouldn&#8217;t be source controlled</span>:</p>
<pre class="brush: csharp;">
*\bin* *\obj* *.suo *.user
</pre>
<p><span style="text-decoration: underline;" class="redText">Combined Ignore pattern to ignore both Visual Studio and ReSharper files</span>:</p>
<pre class="brush: csharp;">
*\bin* *\obj* *.suo *.user **.ReSharper** **\_ReSharper.**
</pre>
<p><code><br />
</code><strong>Implementation</strong></p>
<p>Adding any of these &#8220;ignore&#8221; rules is simple. First identify the rule you want to add; I recommend the combined rule, and then:</p>
<p>1. Right click on any of your repositories, hover over TortoiseSVN menu option, and click on the Settings sub link.</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/02/SVN-1.png"><img class="alignnone size-medium wp-image-9" title="SVN-1" src="http://mariussoft.com/blog/wp-content/uploads/2010/02/SVN-1-223x300.png" alt="" width="223" height="300" /></a></p>
<p>2. Add the rule you have chosen to the global ignore pattern and remember to click &#8220;OK&#8221;.</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/02/SVN-2.png"><img class="alignnone size-medium wp-image-10" title="SVN-2" src="http://mariussoft.com/blog/wp-content/uploads/2010/02/SVN-2-300x199.png" alt="" width="300" height="199" /></a></p>
<p>That&#8217;s it! Now when you try to commit your changes, you won&#8217;t see any of those annoying extra files!</p>
<p><a href="http://mariussoft.com/blog/wp-content/uploads/2010/02/Capture1.png"><img class="alignnone size-medium wp-image-22" title="SVN-Clean" src="http://mariussoft.com/blog/wp-content/uploads/2010/02/Capture1-300x267.png" alt="" width="300" height="267" /></a></p>
<p><strong>HAPPY CODING!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://mariussoft.com/blog/?feed=rss2&amp;p=11</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
