<?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>A Programmer with Microsoft tools &#187; mini tools list</title>
	<atom:link href="http://msprogrammer.serviciipeweb.ro/category/mini-tools-list/feed/" rel="self" type="application/rss+xml" />
	<link>http://msprogrammer.serviciipeweb.ro</link>
	<description>A programmer journey through code, books and tools</description>
	<lastBuildDate>Mon, 14 May 2012 06:59:14 +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>VS 2010 Extensions</title>
		<link>http://msprogrammer.serviciipeweb.ro/2012/05/14/vs-2010-extensions/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2012/05/14/vs-2010-extensions/#comments</comments>
		<pubDate>Mon, 14 May 2012 04:50:00 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[mini tools list]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/2012/05/14/vs-2010-extensions/</guid>
		<description><![CDATA[Visual studion extensions that I use:
NuGet Package Manager 
Microsoft &#8211; Visual Studio Platform Team (Microsoft Corporation)
Productivity Power Tools 
Team Foundation Server Power Tools December 2011 
Web Standards Update for Microsoft Visual Studio 2010 SP1 
PowerCommands for Visual Studio 2010 
Web Essentials 
SQL Server Compact Toolbox 
EF 4.x POCO Entity Generator for C# 
EF 4.x DbContext [...]]]></description>
			<content:encoded><![CDATA[<p>Visual studion extensions that I use:</p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c">NuGet Package Manager </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/site/search?f%5B0%5D.Type=User&amp;f%5B0%5D.Value=Microsoft%20-%20Visual%20Studio%20Platform%20Team&amp;f%5B0%5D.Text=Microsoft%20-%20Visual%20Studio%20Platform%20Team">Microsoft &#8211; Visual Studio Platform Team (Microsoft Corporation)</a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef">Productivity Power Tools </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f">Team Foundation Server Power Tools December 2011 </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83">Web Standards Update for Microsoft Visual Studio 2010 SP1 </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/e5f41ad9-4edc-4912-bca3-91147db95b99">PowerCommands for Visual Studio 2010 </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/6ed4c78f-a23e-49ad-b5fd-369af0c2107f">Web Essentials </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/0e313dfd-be80-4afb-b5e9-6e74d369f7a1">SQL Server Compact Toolbox </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/23df0450-5677-4926-96cc-173d02752313">EF 4.x POCO Entity Generator for C# </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/7812b04c-db36-4817-8a84-e73c452410a2">EF 4.x DbContext Generator for C# </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981">Portable Library Tools 2 Beta </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/25622469-19d8-4959-8e5c-4025d1c9183d">Visual Studio 2010 SP1 SDK </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/46A20578-F0D5-4B1E-B55D-F001A6345748">GhostDoc </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/a56eddd3-d79b-48ac-8c8f-2db06ade77c3">Image Optimizer </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/1f6ec6ff-e89b-4c47-8e79-d2d68df894ec">Razor Generator </a></p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/a70ec2bf-8787-4da1-9b62-0f3a3f92758c">ReverseEquality </a></p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2012/05/14/vs-2010-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Azure tools</title>
		<link>http://msprogrammer.serviciipeweb.ro/2012/04/23/azure-tools/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2012/04/23/azure-tools/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 04:48:00 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[azure]]></category>
		<category><![CDATA[mini tools list]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/2012/04/16/azure-tools/</guid>
		<description><![CDATA[Azure storage Explorer : http://azurestorageexplorer.codeplex.com/&#160; &#8211; like in VS , but simpler and cleaner
Windows Azure ASP.NET Providers Sample : http://code.msdn.microsoft.com/windowsazure/Windows-Azure-ASPNET-03d5dc14 – utils for fast membership and roles. Small problem on local.
More samples here: http://code.msdn.microsoft.com/windowsazure/
And that will be all , after reading the documentation and understanding the concepts ( for example,if you understand the session problem [...]]]></description>
			<content:encoded><![CDATA[<p>Azure storage Explorer : <a title="http://azurestorageexplorer.codeplex.com/" href="http://azurestorageexplorer.codeplex.com/">http://azurestorageexplorer.codeplex.com/</a>&#160; &#8211; like in VS , but simpler and cleaner</p>
<p>Windows Azure ASP.NET Providers Sample : <a title="http://code.msdn.microsoft.com/windowsazure/Windows-Azure-ASPNET-03d5dc14" href="http://code.msdn.microsoft.com/windowsazure/Windows-Azure-ASPNET-03d5dc14">http://code.msdn.microsoft.com/windowsazure/Windows-Azure-ASPNET-03d5dc14</a> – utils for fast membership and roles. Small problem on local.</p>
<p>More samples here: <a title="http://code.msdn.microsoft.com/windowsazure/" href="http://code.msdn.microsoft.com/windowsazure/">http://code.msdn.microsoft.com/windowsazure/</a></p>
<p>And that will be all , after reading the documentation and understanding the concepts ( for example,if you understand the session problem in azure, then you will find a Session provider in the samples and use it)</p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2012/04/23/azure-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Kinect</title>
		<link>http://msprogrammer.serviciipeweb.ro/2012/03/05/kinect/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2012/03/05/kinect/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 06:24:00 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[kinect]]></category>
		<category><![CDATA[mini tools list]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/2012/03/05/kinect/</guid>
		<description><![CDATA[
I have the opportunity to borrow a Kinect hardware  &#8211; to make an application( I will make a simple anti-theft application).
The steps for developing in Kinect are:

Download the SDK from http://www.microsoft.com/en-us/kinectforwindows/develop/overview.aspx – it contains the drivers also
Connect Kinect to USB , plug in the socket
Run the Kinect Explorer or Kinect Shape Game from Kinect SDK [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/Kinect_683B/image.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/Kinect_683B/image_thumb.png" border="0" alt="image" width="244" height="101" /></a><a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/Kinect_683B/image_3.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/Kinect_683B/image_thumb_3.png" border="0" alt="image" width="244" height="137" /></a></p>
<p>I have the opportunity to borrow a Kinect hardware  &#8211; to make an application( I will make a simple anti-theft application).</p>
<h2>The steps for developing in Kinect are:</h2>
<ul>
<li>Download the SDK from <a title="http://www.microsoft.com/en-us/kinectforwindows/develop/overview.aspx" href="http://www.microsoft.com/en-us/kinectforwindows/develop/overview.aspx">http://www.microsoft.com/en-us/kinectforwindows/develop/overview.aspx</a> – it contains the drivers also</li>
<li>Connect Kinect to USB , plug in the socket</li>
<li>Run the <strong><em>Kinect Explorer </em></strong>or <strong><em>Kinect Shape Game </em></strong>from <strong><em>Kinect SDK Sample Browser </em></strong>installed at 1.  Ensure it works.</li>
<li>Read the <strong><em>Kinect Explorer </em></strong>source –it is SO clear!</li>
<li>Read documentation – finally, you should RTFM <img class="wlEmoticon wlEmoticon-winkingsmile" style="border-style: none;" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/Kinect_683B/wlEmoticon-winkingsmile.png" alt="Winking smile" /></li>
</ul>
<h2>Optional resources:</h2>
<ol>
<li><a title="http://kinectcontrib.codeplex.com/" href="http://kinectcontrib.codeplex.com/">http://kinectcontrib.codeplex.com/</a> – Visual Studio template for Skeleton, Audio, Video. Simple example that works ( simpler than <strong><em>Kinect Explorer !</em></strong>)</li>
<li> <a title="http://c4fkinect.codeplex.com/" href="http://c4fkinect.codeplex.com/">http://c4fkinect.codeplex.com/</a> – added methods to Kinect.</li>
<li><a title="http://kinecttoolbox.codeplex.com/" href="http://kinecttoolbox.codeplex.com/">http://kinecttoolbox.codeplex.com/</a> – detection of gesture.</li>
</ol>
<h2>Example 1: Integrating saving image in <strong><em>Kinect Explorer </em></strong>when a skeleton is detected</h2>
<p>Add reference to <strong><em>optional resource 2</em></strong>( either download , either via Nuget)</p>
<p>Search for  <strong><em>KinectAllFramesReady</em></strong> in <strong><em>KinectSkeletonViewer.xaml.cs</em></strong> and put this code</p>
<pre class="brush: csharp;">
						var takePic = this.skeletonData.Count(item =&gt; item.TrackingState == SkeletonTrackingState.Tracked) &gt; 0;

						if (takePic)
						{
							DateTime imgDate = DateTime.Now;
							string imageName = &quot;andrei&quot; + imgDate.ToString(&quot;yyyyMMdd_HHmmss&quot;) + &quot;.jpg&quot;;
							if (!File.Exists(imageName))
							{
								using (var image = e.OpenColorImageFrame())
								{
									if (image != null &amp;&amp; this.skeletonData.Length &gt; 0 &amp;&amp; this.skeletonData.Count(item =&gt; item.TrackingState != SkeletonTrackingState.NotTracked) &gt; 0)
										if (image != null &amp;&amp; takePic)
										{
											var x = image.ToBitmapSource();
											var b = Save(x, ImageFormat.Jpeg);

											var t = Task.Factory.StartNew(

												(img) =&gt;
												{

													imgDate = DateTime.Now;
													imageName = &quot;andrei&quot; + imgDate.ToString(&quot;yyyyMMdd_HHmmss&quot;) + &quot;.jpg&quot;;
													if (File.Exists(imageName))
														return;
													byte[] i = img as byte[];
													if (i != null)
													{
														File.WriteAllBytes(imageName, i);
													};
												}, b);
											//t.Start();
										}
								}
							}
					}
</pre>
<h2>Example 2 : Detecting circle by right hand in <strong><em>Kinect Explorer </em></strong>when a skeleton is detected</h2>
<p>Add reference to <strong><em>optional resource 3</em></strong>( either download , either via Nuget)</p>
<p>Download circleKB.save file and put in your project. Ensure “Copy to output directory” is “copy always/copy if newer”</p>
<p>Add a variable named</p>
<pre class="brush: csharp;">
TemplatedGestureDetector circleGestureRecognizer;
</pre>
<p>In <strong><em>KinectSkeletonViewer.xaml.cs </em></strong>in constructor put</p>
<pre class="brush: csharp;">
			using (Stream recordStream = File.Open(&quot;circleKB.save&quot;, FileMode.Open))
			{
				circleGestureRecognizer = new TemplatedGestureDetector(&quot;Circle&quot;, recordStream);
				circleGestureRecognizer.OnGestureDetected += new Action&lt;string&gt;(circleGestureRecognizer_OnGestureDetected);
//TODO : implement circleGestureRecognizer_OnGestureDetected : void circleGestureRecognizer_OnGestureDetected(string obj)
			}
</pre>
<p>Search for <strong><em>KinectAllFramesReady</em></strong> in <strong><em>KinectSkeletonViewer.xaml.cs</em></strong> and put this code</p>
<pre class="brush: csharp;">

foreach (Joint joint in skeleton.Joints)//existing code
							{
								Point mappedPoint = this.GetPosition2DLocation(depthImageFrame, joint.Position);//existing code
								jointMapping[joint.JointType] = new JointMapping//existing code
									{
										Joint = joint,
										MappedPoint = mappedPoint
									};
//new code from here:
									 if ((joint.TrackingState == JointTrackingState.Tracked) &amp;&amp; (joint.JointType == JointType.HandRight))
									{
											circleGestureRecognizer.Add(joint.Position, Kinect);
									}

							}
</pre>
<p>That will be all…<br />
If you have developed with Kinect, please share your sources as comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2012/03/05/kinect/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Transform Mozilla Bookmarks into a list</title>
		<link>http://msprogrammer.serviciipeweb.ro/2011/11/28/transform-mozilla-bookmarks-into-a-list/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2011/11/28/transform-mozilla-bookmarks-into-a-list/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 05:50:00 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[quick and dirty]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/2011/11/28/transform-mozilla-bookmarks-into-a-list/</guid>
		<description><![CDATA[You have seen that I begin to post “friday links”
It is simple , once you have SqlLite Manager add-on for FF. ( add-on, source)
Just run the following query ( for the last 7 days bookmarks) by selecting &#8220;places.sqllite&#8221;:

SELECT
&#34;&#60;p&#62;&#60;a target='_blank' href='&#34; &#124;&#124; moz_places.url  &#124;&#124; &#34;'&#62;&#34; &#124;&#124; moz_bookmarks.title &#124;&#124; &#34;&#60;/a&#62;&#60;/p&#62;&#34;

FROM moz_bookmarks Inner JOIN moz_places WHERE moz_bookmarks.fk [...]]]></description>
			<content:encoded><![CDATA[<p>You have seen that I begin to post “<a href="http://msprogrammer.serviciipeweb.ro/category/friday-links/" target="_blank">friday links</a>”</p>
<p>It is simple , once you have <a href="https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/" target="_blank">SqlLite Manager add-on</a> for FF. ( <a href="https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/" target="_blank">add-on</a>, <a href="http://code.google.com/p/sqlite-manager/" target="_blank">source</a>)</p>
<p>Just run the following query ( for the last 7 days bookmarks) by selecting &#8220;places.sqllite&#8221;:</p>
<pre class="brush: sql;">
SELECT
&quot;&lt;p&gt;&lt;a target='_blank' href='&quot; || moz_places.url  || &quot;'&gt;&quot; || moz_bookmarks.title || &quot;&lt;/a&gt;&lt;/p&gt;&quot;

FROM moz_bookmarks Inner JOIN moz_places WHERE moz_bookmarks.fk = moz_places.id AND moz_bookmarks.title != &quot;null&quot;
and last_visit_date BETWEEN  strftime('%s',date('now','-7 day'))*1000000 and strftime('%s',date('now'))*1000000
and dateAdded BETWEEN  strftime('%s',date('now','-7 day'))*1000000 and strftime('%s',date('now'))*1000000
</pre>
<p>(OK, I must know why I multiply by 1000000  &#8211; but,hey – it works ….)</p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2011/11/28/transform-mozilla-bookmarks-into-a-list/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Programmer tools 2011</title>
		<link>http://msprogrammer.serviciipeweb.ro/2011/10/31/programmer-tools-2011/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2011/10/31/programmer-tools-2011/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 06:24:17 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[mini tools list]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/?p=856</guid>
		<description><![CDATA[List of programmer tools
I have re-installed the PC and I have been taken notice of what tools I have on the system now:

Magic Disc – can mount .iso files ( for  2 )
Visual Studio – must have for a easy developing path
Sql Server 2008 &#8211; primary database for me
7-zip  - archiver
Firefox ( plus addons, see [...]]]></description>
			<content:encoded><![CDATA[<p>List of programmer tools</p>
<p>I have re-installed the PC and I have been taken notice of what tools I have on the system now:</p>
<ol>
<li>Magic Disc – can mount .iso files ( for  2 )</li>
<li>Visual Studio – must have for a easy developing path</li>
<li>Sql Server 2008 &#8211; primary database for me</li>
<li>7-zip  - archiver</li>
<li>Firefox ( plus addons, see below)</li>
<li>Smtp4dev – to see messages</li>
<li>AspNetMVC3ToolsUpdateSetup</li>
<li>FreeCommander -  dual panels for windows explorer</li>
<li>Foxit reader – pdf viewer</li>
<li>Notepad ++ ( with hex addon)</li>
<li>Winmerge – files/ folders difference</li>
<li>Clean project – archive solution</li>
<li>SqlSearch from RedGate – fast search after names</li>
<li>SSMS tools – record every operation you do in sql server</li>
<li>EntityFramework41  &#8211; code first development</li>
<li>XUnit – automated testing + samples  to do BDD style</li>
<li>SSCERuntime_x86-ENU –SqlCompact provider. Works with EF4.1</li>
<li>SqlCe40Toolbox – SqlCompact viewer</li>
<li>NuGet.Tools.vsix – Nuget is awesome!</li>
<li>ImgBurn  &#8211; burn cd-s</li>
<li>consolas font  - see  1 and l ?</li>
<li>LogParser  &#8211; never know when you need to parse some files</li>
<li>Moq  &#8211; mocking tool</li>
<li>PreviewHandlerPack  -see c# code in preview window</li>
<li>Regulator and Regulazy – regular expression helpers</li>
<li>StringTemplate.NET  &#8211; templating generator. Maybe replaced by razor ?</li>
<li>NLog &#8211;  logging tool. Log4Net was pretty unreliable in .NET 4</li>
<li>FileHelpers – reading writing text data.</li>
<li>Tcmdwincearm – Total Commander for mobile. Free.</li>
<li>Jquery and Jquery UI.</li>
<li>DataTables – html tables supports sorting , filtering, others.</li>
<li>Windows Live Essential – blogging fast.</li>
<li>InsertFilePlugin – Live writer extension to insert files to upload.</li>
<li>OfficeOpenXMLPart4-MarkupLanguageReference  &#8211; markup for Office XML. Used with StringTemplate</li>
<li>SharpZipLib – knows how to zip multiple files.</li>
<li>AutoFixture – generating sample data</li>
<li>HtmlAgilityPack – parsing web pages</li>
<li>T4MVC – get rid of magic names for controllers, actions</li>
<li>Itextsharp – save as pdf</li>
<li>Ninject – DI provider</li>
<li>Hudson – continous integration</li>
<li>AutoMapper  &#8211; transferring data between DAL and BLL</li>
<li>Selenium – testing web interfaces</li>
<li>Svn  -source control</li>
<li>MVC Contrib – pages list and more</li>
<li>Msbuildtask from tigris – build make it easy</li>
<li>Psr – help made easy in Windows 7</li>
<li>Firefox addons here</li>
</ol>
<p><a href="https://addons.mozilla.org/en-US/firefox/collections/ignatandrei/ignatandrei/">https://addons.mozilla.org/en-US/firefox/collections/ignatandrei/ignatandrei/</a></p>
<p>For every tool search for it . The first link will give you all details.</p>
<p>You can have as pdf here:<a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/2011/10/List-of-programmer-tools-2011.pdf">List of programmer tools 2011</a></p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2011/10/31/programmer-tools-2011/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MVC Zip Result</title>
		<link>http://msprogrammer.serviciipeweb.ro/2011/01/31/zip-result-mvc/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2011/01/31/zip-result-mvc/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 05:12:11 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[mini tools list]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[zipresult]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/?p=684</guid>
		<description><![CDATA[Sometimes you need to send to the user more than 1 file &#8211; or, maybe, the file is too large
The simplest way is : made a zip file that contains the others.
What do you need
1.  SharpzipLib from http://www.icsharpcode.net/opensource/sharpziplib/ ( or download via NuGet in VS)
2.  obtain the file(s) that you want as a [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to send to the user more than 1 file &#8211; or, maybe, the file is too large<br />
The simplest way is : made a zip file that contains the others.</p>
<p>What do you need<br />
1.  SharpzipLib from <a href='http://www.icsharpcode.net/opensource/sharpziplib/' target='_blank'>http://www.icsharpcode.net/opensource/sharpziplib/</a> ( or download via NuGet in VS)<br />
2.  obtain the file(s) that you want as a string or as a byte[] &#8211; let&#8217;s say you have a byte[] to store in a <b>str</b> variable<br />
3.  make in your action something like that:</p>
<pre class="brush: csharp;">
 var fcr = new ZipResult(&quot;Export.xls&quot;, str);
            fcr.AddFile(&quot;readme.txt&quot;,&quot;this zip file contains ..&quot;);
            return fcr;
</pre>
<p>4. copy the following code in your asp.net mvc projects:</p>
<pre class="brush: csharp;">

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
using System.Text;

namespace utilsResult
{
    public class ZipResult : FileResult
    {

        private Dictionary&lt;string, byte[]&gt; content = new Dictionary&lt;string, byte[]&gt;();
        public string FileNameZip;
        public ZipResult(string FileName, byte[] Contents)
            : base(&quot;application/octet-stream&quot;)
        {
            this.FileDownloadName = Path.GetFileNameWithoutExtension(FileName) + &quot;.zip&quot;;
            AddFile(FileName, Contents);
        }
        public void AddFile(string FileName,  byte[] Contents)
        {
            content.Add(FileName, Contents);
        }
        public void AddFile(string FileName,string Contents, Encoding e = null)
        {
            if (e == null)
                e = ASCIIEncoding.ASCII;

            content.Add(FileName, e.GetBytes(Contents));
        }

        protected override void WriteFile(HttpResponseBase response)
        {

            using (ZipOutputStream zos = new ZipOutputStream(response.OutputStream))
            {
                zos.SetLevel(3);
                zos.UseZip64=UseZip64.Off;

                foreach (var item in content)
                {
                    ZipEntry ze = new ZipEntry(item.Key);
                    ze.DateTime = DateTime.Now;
                    zos.PutNextEntry(ze);
                    int count=item.Value.Length;
                    zos.Write(item.Value, 0, count);

                }
            }
        }
    }
}
</pre>
<p>5. future improvements:<br />
Zip the file(s) in a dll project to made fully testable!</p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2011/01/31/zip-result-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing EF4 and EDMGen2</title>
		<link>http://msprogrammer.serviciipeweb.ro/2010/11/22/optimizing-ef4-and-edmgen2/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2010/11/22/optimizing-ef4-and-edmgen2/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 05:47:00 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[mini tools list]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[edmgen2]]></category>
		<category><![CDATA[EF]]></category>
		<category><![CDATA[Entity framework]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/?p=557</guid>
		<description><![CDATA[Just reading (from Adrian Florea links ) how the EF4 could be optimized : http://www.codeproject.com/KB/database/PerfEntityFramework.aspx
First modification is to “Pre-generated Your View”. For this you must have .ssdl, .csdl, and .msl files – so you change the “Metadata Artifact Processing property to: Copy to Output Directory.”. Then you process the .ssdl, .csdl, and .msl with edmgen [...]]]></description>
			<content:encoded><![CDATA[<p>Just reading (from <a href="http://blogs.ugidotnet.org/adrian/" target="_blank">Adrian Florea</a> links ) how the EF4 could be optimized : <a title="http://www.codeproject.com/KB/database/PerfEntityFramework.aspx" href="http://www.codeproject.com/KB/database/PerfEntityFramework.aspx">http://www.codeproject.com/KB/database/PerfEntityFramework.aspx</a></p>
<p>First modification is to “Pre-generated Your View”. For this you must have <em>.ssdl</em>, <em>.csdl</em>, and <em>.msl</em> files – so you change the “Metadata Artifact Processing property to: Copy to Output Directory.”. Then you process the <em>.ssdl</em>, <em>.csdl</em>, and <em>.msl</em> with edmgen in order to can have the  views.</p>
<p>Until here , all ok.</p>
<p>But, in the next advice, is to keep “Metadata Artifact Processing property to: Embed in Output Assembly.”</p>
<p>One solution is to put “Metadata Artifact Processing property to: Copy to Output Directory.” , compile, put again “Metadata Artifact Processing property to: Embed in Output Assembly.” and compile again. But , if you change the edmx (add fields or tables ) you must redo the operation  &#8211; so you will have more things to do(if you remember)</p>
<p>A solution is to build them on the pre-build step .But how to generate the <em>.ssdl</em>, <em>.csdl</em>, and <em>.msl</em> files  ?</p>
<p>Edmgen2 , <a title="http://code.msdn.microsoft.com/EdmGen2" href="http://code.msdn.microsoft.com/EdmGen2">http://code.msdn.microsoft.com/EdmGen2</a> , to the rescue. Download, put into a lib folder under your solution folder and put a pre-build like this :</p>
<p>$(SolutionDir)lib\edmgen2\edmgen2 /FromEdmx $(ProjectDir)<strong><em>prod</em></strong>.edmx&#8221;</p>
<p>&#8220;%windir%\Microsoft.NET\<strong><em>Framework</em></strong>\v4.0.30319\EdmGen.exe&#8221; /mode:ViewGeneration /language:CSharp /nologo &#8220;/inssdl:<strong><em>prod</em></strong>.ssdl&#8221; &#8220;/incsdl:<strong><em>prod</em></strong>.csdl&#8221;   &#8220;/inmsl:<strong><em>prod</em></strong>.msl&#8221; &#8220;/outviews:$(ProjectDir)<strong><em>prod</em></strong>.Views.cs&#8221;</p>
<p>What you must change on your project?</p>
<p>1. IF you are on 64 bit, change <strong><em>Framework</em></strong> to <strong><em>Framework</em></strong>64</p>
<p>2. change the <strong><em>prod</em></strong> with your edmx name.</p>
<p>What is the performance?</p>
<p>Tested by loading a table with 301 rows by doing the steps :</p>
<p>1. open connection, load all table in objects(POCO), closing connection</p>
<p>2. open connection , find object with PK = 1, closing connection</p>
<p>3. open connection ,  loading 1 tables with 2 related (include ) , closing connection</p>
<p>The results are in milliseconds:</p>
<p><strong>Without</strong> pre-compiled views</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="111">LoadTable</td>
<td width="97">LoadID</td>
<td width="132">LoadMultiple</td>
<td width="64">Total Time</td>
</tr>
<tr>
<td>579</td>
<td>800</td>
<td>172</td>
<td>1551</td>
</tr>
<tr>
<td>563</td>
<td>755</td>
<td>171</td>
<td>1489</td>
</tr>
<tr>
<td>559</td>
<td>754</td>
<td>169</td>
<td>1482</td>
</tr>
<tr>
<td>568</td>
<td>762</td>
<td>240</td>
<td>1570</td>
</tr>
</tbody>
</table>
<p><strong>With</strong> pre-compiled views:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="111">LoadTable</td>
<td width="97">LoadID</td>
<td width="132">LoadMultiple</td>
<td width="64">Total Time</td>
</tr>
<tr>
<td>606</td>
<td>807</td>
<td>183</td>
<td>1596</td>
</tr>
<tr>
<td>509</td>
<td>706</td>
<td>177</td>
<td>1392</td>
</tr>
<tr>
<td>852</td>
<td>137</td>
<td>192</td>
<td>1181</td>
</tr>
<tr>
<td>530</td>
<td>733</td>
<td>221</td>
<td>1484</td>
</tr>
<tr>
<td>523</td>
<td>722</td>
<td>183</td>
<td>1428</td>
</tr>
</tbody>
</table>
<p>The average / min / max results:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="111"></td>
<td width="97">average</td>
<td width="132">max</td>
<td width="64">min</td>
</tr>
<tr>
<td>without</td>
<td>1523</td>
<td>1570</td>
<td>1482</td>
</tr>
<tr>
<td>with</td>
<td>1413.25</td>
<td>1596</td>
<td>1181</td>
</tr>
</tbody>
</table>
<p>In the next picture the smaller the duration(milliseconds), is the better :</p>
<p><a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/2010/11/image2.png"><img style="display: inline; border: 0px;" title="image" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/2010/11/image_thumb2.png" border="0" alt="image" width="587" height="260" /></a></p>
<p>Conclusions:</p>
<p>1.  For the average and min the difference is 7%, respectively 20%. Please remember we are using only 3 queries.</p>
<p>For the max, it is vey curious : the with is more than without. The penalty is 1%, I think that is a measuring error ? – or maybe not. However , the penalty is small comparing with others.</p>
<p>2. Very curious, find after ID, with a table with 301 rows, took longer than loading the whole table.However, did not take into accound finding in the list the object( it is in memory also)</p>
<p>3. It may worth to add the pre-build step shown before to pre-compile views.</p>
<p>Links :</p>
<p><a title="http://www.codeproject.com/KB/database/PerfEntityFramework.aspx" href="http://www.codeproject.com/KB/database/PerfEntityFramework.aspx">http://www.codeproject.com/KB/database/PerfEntityFramework.aspx</a></p>
<p><a title="http://msdn.microsoft.com/en-us/library/bb896240.aspx" href="http://msdn.microsoft.com/en-us/library/bb896240.aspx">http://msdn.microsoft.com/en-us/library/bb896240.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2010/11/22/optimizing-ef4-and-edmgen2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EF Profiler and investigating object context</title>
		<link>http://msprogrammer.serviciipeweb.ro/2010/11/15/ef-profiler-and-investigating-object-context/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2010/11/15/ef-profiler-and-investigating-object-context/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 04:17:49 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[money]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[EF]]></category>
		<category><![CDATA[efprof]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/?p=547</guid>
		<description><![CDATA[Summary : EF Profiler worth his money !
Long Description :
I have finished a application with Entity Framework and POCO – and custom generated (.tt) files.
Now it was time to investigate performance  &#8211; and it was a terrific problem.
How EF Prof helped me :
1.  Displaying number of ObjectContext created and disposed in a Unit of Work [...]]]></description>
			<content:encoded><![CDATA[<p>Summary : EF Profiler worth his money !</p>
<p>Long Description :</p>
<p>I have finished a application with Entity Framework and POCO – and custom generated (.tt) files.</p>
<p>Now it was time to investigate performance  &#8211; and it was a terrific problem.</p>
<p>How EF Prof helped me :</p>
<p><strong>1.  D</strong>isplaying number of ObjectContext created and disposed in a Unit of Work and / or web page.</p>
<p><a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/2010/11/image.png"><img style="display: inline; border-width: 0px;" title="image" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/2010/11/image_thumb.png" border="0" alt="image" width="244" height="199" /></a></p>
<p><strong>2. D</strong>isplaying problem with the ObjectCOntext : using same context from multiple threads, alerts about code like  here :</p>
<p><a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/2010/11/image1.png"><img style="display: inline; border-width: 0px;" title="image" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/2010/11/image_thumb1.png" border="0" alt="image" width="206" height="244" /></a></p>
<p>The red dot is about querying the database from the view. The gray one is about selecting a whole table without selecting top 1000 rows(OK, it was a dictionary table, like the list of countries)</p>
<p><strong>3. W</strong>hen you want caching on your site , you can fast see this by seeing the difference between the number of queries and/or number of ObjectContext for the first time and the second one ( first time : 10, second time:2 or 0 <img src='http://msprogrammer.serviciipeweb.ro/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  )</p>
<p><strong>4. S</strong>ee most expensive queries as time – usually this is a good option to put an index on the “where” columns.More , you can see also non-unique queries (that you perform more than 1 time)</p>
<p><strong>5. I</strong>nvestigate easily all queries. Know what you want to optimize and where.</p>
<p>Improvements  :</p>
<p>1. Say where is the ObjectContext that is not closing.</p>
<p>Alternatives:</p>
<p>How to: View the Store Commands : <a title="http://msdn.microsoft.com/en-us/library/bb896348.aspx" href="http://msdn.microsoft.com/en-us/library/bb896348.aspx">http://msdn.microsoft.com/en-us/library/bb896348.aspx</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa173918%28SQL.80%29.aspx" target="_blank">Sql Profiler</a> : http://msdn.microsoft.com/en-us/library/aa173918%28SQL.80%29.aspx</p>
<p>(free ones :</p>
<p>http://sites.google.com/site/sqlprofiler/</p>
<p>http://code.google.com/p/sqlexpressprofiler/</p>
<p>)</p>
<p>But the job will be done by yourself!</p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2010/11/15/ef-profiler-and-investigating-object-context/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LogParser, PowerShell and Quick and dirty parsing of IIS files</title>
		<link>http://msprogrammer.serviciipeweb.ro/2010/09/20/logparser-powershell-and-quick-and-dirty-parsing-of-iis-files/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2010/09/20/logparser-powershell-and-quick-and-dirty-parsing-of-iis-files/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 04:44:55 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[mini tools list]]></category>
		<category><![CDATA[quick and dirty]]></category>
		<category><![CDATA[logparser]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/?p=430</guid>
		<description><![CDATA[For a local enterprise IIS system you do not have to resort to Google analytics or other beasts that interprets IIs logs. After all, users are identified through ActiveDirectory, does not matter from what city do they come, and so on. But it will help to have some details of wjhat happened on the system [...]]]></description>
			<content:encoded><![CDATA[<p>For a local enterprise IIS system you do not have to resort to Google analytics or other beasts that interprets IIs logs. After all, users are identified through ActiveDirectory, does not matter from what city do they come, and so on. But it will help to have some details of wjhat happened on the system this day( or the day before , if you want to send an email about the previous day totals)</p>
<p>So <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en" target="_blank">logparser</a> to help  &#8211; he knows already to read IIS logs with  -i:IISW3C</p>
<p>So I have come up with the syntax  :</p>
<p><strong>C:\</strong>LogParser -e:10 -i:IISW3C &#8220;SELECT cs-uri-stem as url, DIV(SUM(time-taken),1000) as Seconds, Count(time-taken) as Requests, DIV(Seconds ,Requests) as TimeExecuting   INTO <strong><em>C:\newfile</em></strong> FROM   <strong><em>C:\Windows\System32\LogFiles\W3SVC1\ex100909.log</em></strong> GROUP BY cs-uri-stem Having SUM(time-taken)&gt;0 and Seconds&gt;0 order by Seconds   desc&#8221; -o:TPL -tpl:%2\iistime.tpl</p>
<p>Basically , this will do this report about statuses of URL requested  :</p>
<table border="1" cellpadding="10" bgcolor="#d0d0e0">
<tbody>
<tr>
<th>Status</th>
<th>Requests</th>
</tr>
<tr>
<td><tt>200</tt></td>
<td><tt>1541</tt></td>
</tr>
<tr>
<td><tt>302</tt></td>
<td><tt>89</tt></td>
</tr>
<tr>
<td><tt>401</tt></td>
<td><tt>11</tt></td>
</tr>
<tr>
<td><tt>403</tt></td>
<td><tt>61</tt></td>
</tr>
</tbody>
</table>
<p>The problem is that <strong><em>C:\newfile</em></strong> and  <strong><em>C:\Windows\System32\LogFiles\W3SVC1\ex100909.log</em></strong> are hard-coded – we need to modify every time… So PowerShell to the rescue (Ok, I could do a C# Console program – but</p>
<p>1. it is more fun this way – fun meaning I want to learn something new</p>
<p>2. the script could be modified easily</p>
<p>)</p>
<p>So the same command is written this way with arguments , in order to can be executed each time :</p>
<pre class="brush: csharp;">
%2\LogParser -e:10 -i:IISW3C &quot;SELECT cs-uri-stem as url, DIV(SUM(time-taken),1000) as Seconds, Count(time-taken) as Requests, DIV(Seconds ,Requests) as TimeExecuting   INTO %2\%4 FROM   %5\*%1  GROUP BY cs-uri-stem Having SUM(time-taken)&amp;gt;0 and Seconds&amp;gt;0 order by Seconds   desc&quot; -o:TPL -tpl:%2\iistime.tpl
</pre>
<p>But who will give arguments ( such as the system date ) ?Now powershell  to the rescue :</p>
<pre class="brush: csharp;">
$namepc = (gc env:computername)
$a = get-date
$a = (get-date).AddDays(-1)
$allpath= Split-Path -Parent $MyInvocation.MyCommand.Path;
$logfolders = $env:WINDIR +&quot;\system32\Logfiles\W3SVC*&quot;
foreach($logfolder in  Get-ChildItem $logfolders)
{
$logfiles= $logfolder.FullName
Write-Host &quot;parsing&quot;  $logfiles
$log =  $a.ToString(&quot;yyMMdd&quot;) + &quot;.log&quot;
$process = [Diagnostics.Process]::Start($allpath + &quot;\iis.bat&quot; , $log + &quot; &quot;+ $allpath + &quot; &quot;+ $log + &quot;.html&quot; + &quot; TIME&quot; +$log + &quot;.html&quot; + &quot; &quot; + $logfiles)
$process.WaitForExit()
$content = &quot;&amp;lt;h1&amp;gt;IIS REPORT &quot; + $namepc  + &quot;&amp;lt;/H1&amp;gt;&quot;
$content += (get-content ($allpath  + &quot;\&quot; + $log + &quot;.html&quot;))
$content += (get-content ($allpath  + &quot;\TIME&quot; + $log + &quot;.html&quot;))

$SmtpClient = new-object system.net.mail.smtpClient
$SmtpServer = &quot;your server&quot;
$SmtpClient.host = $SmtpServer

$mm = new-Object System.Net.Mail.MailMessage(“&lt;a href=&quot;mailto:from@yourcompany.com&quot;&gt;from@yourcompany.com&lt;/a&gt;”,&quot;&lt;a href=&quot;mailto:to@yourcompany.com&quot;&gt;to@yourcompany.com&lt;/a&gt;&quot;)
$mm.Subject = &quot;Report IIS &quot; + $namepc
$mm.Body = $content
$mm.Body=$mm.Body.Replace(&quot;&amp;lt;cmp&amp;gt;&quot;,$namepc  )
$mm.IsBodyHtml = 1
$SmtpClient.Send($mm)
}
</pre>
<p>Explanation of code :<br />
line 1: I take the computer name to put in the report<br />
line 2 : take the date ( if you want the current date , just comment the line 3)<br />
line 5 : I go to usual path to logfiles (did I say quick and dirty ?)<br />
line 6 : get all W3SVC folders and iterate to send report<br />
line 11 : launching the bat (that contains logparser command ) in order to parse  arguments<br />
line 12 :waiting for the process to exit &#8211; in order to can send files.<br />
line 13 to 15: get the output<br />
line 17 to 27 : send the output by email</p>
<p>Homework  :<br />
1. Execute script on a system and modify if it does not work<br />
2. Clean up the temporary files after sending email<br />
3. Instead of sending an email, write into a database with the current date.</p>
<p>You can execute sc.bat at regular times ( such as 1:00 AM)</p>
<p>Here is the zip file with sources <a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/2010/09/logiisparser.zip">logiisparser</a></p>
<p>LogParser download : <a title="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en" href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en</a></p>
<p>Powershell scripts : <a title="http://gallery.technet.microsoft.com/ScriptCenter/en-us/site/search?f[1].Type=SearchText&amp;f[1].Value=internet&amp;f[0].Value=applications&amp;f[0].Type=RootCategory&amp;f[0].Text=Applications&amp;x=0&amp;y=0" href="http://gallery.technet.microsoft.com/ScriptCenter/en-us/site/search?f[1].Type=SearchText&amp;f[1].Value=internet&amp;f[0].Value=applications&amp;f[0].Type=RootCategory&amp;f[0].Text=Applications&amp;x=0&amp;y=0">http://gallery.technet.microsoft.com/ScriptCenter/en-us/site/search?f[1].Type=SearchText&amp;f[1].Value=internet&amp;f[0].Value=applications&amp;f[0].Type=RootCategory&amp;f[0].Text=Applications&amp;x=0&amp;y=0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2010/09/20/logparser-powershell-and-quick-and-dirty-parsing-of-iis-files/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Logparser quick and dirty</title>
		<link>http://msprogrammer.serviciipeweb.ro/2010/09/13/logparser-quick-and-dirty/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2010/09/13/logparser-quick-and-dirty/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 05:10:15 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[mini tools list]]></category>
		<category><![CDATA[quick and dirty]]></category>
		<category><![CDATA[logparser]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/?p=427</guid>
		<description><![CDATA[Sometimes you must find information in text files. Many,many text files, like IIS logs or other custom non-regular formats.
I have a bot from http://www.imified.com/ – and I log the messages with log4net in text files, with another messages.
An entry looks like that :
System.ArgumentException: ;channel=private;botkey=&#60;guid&#62;;userkey=&#60;guid&#62;;user=name@yhaoo.com;network=Yahoo;msg=hello;step=1;value0=hello;to=asdasd
And there are multiple log files that I want to parse and [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you must find information in text files. Many,many text files, like IIS logs or other custom non-regular formats.</p>
<p>I have a <a href="ymsgr:sendim?cursval&amp;m=bnr+eur" target="_blank">bot</a> from <a title="http://www.imified.com/" href="http://www.imified.com/">http://www.imified.com/</a> – and I log the messages with <a href="http://logging.apache.org/log4net/" target="_blank">log4net</a> in text files, with another messages.</p>
<p>An entry looks like that :</p>
<p>System.ArgumentException: ;channel=private;botkey=&lt;guid&gt;;userkey=&lt;guid&gt;;user=name@yhaoo.com;network=Yahoo;msg=hello;step=1;value0=hello;to=asdasd</p>
<p>And there are multiple log files that I want to parse and find the email adresses to collect feedback from those persons that use my bot.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en" target="_blank">LogParser</a> to the rescue! Download from <a title="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en</a> and use this command line</p>
<p>LOGPARSER &#8220;Select Text into a.csv from current* where Text like &#8216;%@%&#8217;&#8221; -i:TEXTLINE</p>
<p>Explanation of command :</p>
<p>Select Text into a.csv from current* where Text like &#8216;%@%&#8217; –means find in files that begin with current(current*) all text that contains emails ( ‘%@%’) and put in file a.csv  the results.</p>
<p>-i:TEXTLINE – means the format is text</p>
<p>What can be more simple ?</p>
<p>(Ok, for finding the user name I had to resort to excel, to remove duplicates … )</p>
<p>More I think it is fast enough : for parsing 114 files with 58.8 MB (PC with a 2GB RAM + 7200 RPM ) the results are :</p>
<p>Statistics:<br />
&#8212;&#8212;&#8212;&#8211;<br />
Elements processed: 487176<br />
Elements output:    1044<br />
Execution time:     7.69 seconds</p>
<p>Also logparser can be used for more than text files :</p>
<p><a title="http://support.microsoft.com/kb/910447" href="http://support.microsoft.com/kb/910447">http://support.microsoft.com/kb/910447</a></p>
<p><a title="http://www.stevebunting.org/udpd4n6/forensics/logparser.htm" href="http://www.stevebunting.org/udpd4n6/forensics/logparser.htm">http://www.stevebunting.org/udpd4n6/forensics/logparser.htm</a></p>
<p>More, it can be as a COM DLL in every .NET project, making it a usefull tool . See</p>
<p><a title="http://www.codeproject.com/KB/recipes/SimpleLogParse.aspx" href="http://www.codeproject.com/KB/recipes/SimpleLogParse.aspx">http://www.codeproject.com/KB/recipes/SimpleLogParse.aspx</a></p>
<p>Next time I will show the using Powershell in combination with <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en" target="_blank">LogParser</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2010/09/13/logparser-quick-and-dirty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

