Advertise with Googlier.com  Ben Galluzzo - .NET A little bit of everything that beeps and blinks http://bengalluzzo.com/ http://www.rssboard.org/rss-specification BlogEngine.NET 2.0.0.36 en-US http://bengalluzzo.com/opml.axd http://feeds.feedburner.com/BenGalluzzo Ben Galluzzo Ben Galluzzo 0.000000 0.000000 Code Camp NYC 2016 - MongoDB for Developers <p>Code Camp NYC 2016 Presentation</p> <p>MongoDB For Developers And Accessing MongoDB data</p> <p>This is where .NET, MongoDB, and SSIS meet. We'll begin with an overview of what MongoDB and NoSQL are and how it is often used in the world. Then, we'll go over some of terminology of MongoDB and how these terms map to the SQL world. Lastly, we'll demonstrate how we can work with MongoDB from SSIS using .NET code to make all of the connections.</p> <p><a href="http://bengalluzzo.com/file.axd?file=2016%2f10%2fCodeCampNYC_2016_MongoDB_Intro.pptx">CodeCampNYC_2016_MongoDB_Intro.pptx (1.05 mb)</a></p> <p><img src="http://www.codecampnyc.org/wp-content/uploads/2011/08/01.jpg" alt="Code Camp NYC" width="960" height="73" /></p> <p>&nbsp;</p> http://bengalluzzo.com/post/2016/10/08/Code-Camp-NYC-2016-MongoDB-for-Developers.aspx http://bengalluzzo.com/post/2016/10/08/Code-Camp-NYC-2016-MongoDB-for-Developers.aspx#comment http://bengalluzzo.com/post.aspx?id=834c3538-f56a-47e2-8a71-fae7039fa09d Sat, 08 Oct 2016 05:38:00 +0300 .NET C# Events SQL NoSQL MongoDB SSIS Code Camp NYC Ben Galluzzo http://bengalluzzo.com/pingback.axd http://bengalluzzo.com/post.aspx?id=834c3538-f56a-47e2-8a71-fae7039fa09d 5 http://bengalluzzo.com/trackback.axd?id=834c3538-f56a-47e2-8a71-fae7039fa09d http://bengalluzzo.com/post/2016/10/08/Code-Camp-NYC-2016-MongoDB-for-Developers.aspx#comment http://bengalluzzo.com/syndication.axd?post=834c3538-f56a-47e2-8a71-fae7039fa09d Windows 8 Camp <p>This past Saturday, Microsoft hosted a Windows 8 Camp at Harrisburg Area Community College (HACC) on the Harrisburg campus.&nbsp; If you get the opportunity, take advantage of one of these free events offered by Microsoft.&nbsp; They provide for a good way to keep abreast of newer technologies and connect with fellow developers.&nbsp; Listed down below are links for you to keep tabs of some of the local development events.&nbsp;</p> <p>The Windows 8 Camps are a great learning experience.&nbsp; Right now, if you haven't noticed, there's quite a change in how people stay connected and work with computer technologies.&nbsp; Tablet sales are projected to <a href="http://venturebeat.com/2013/02/18/tablet-sales-will-surpass-pc-sales-by-late-2012-or-early-2013/" target="_blank">surpass</a> PC sales this year so how users interact with the software which developers build is changing considerably.&nbsp; In some ways, end users of current technologies sometimes seem to be more in tune with these changes than even seasoned developers.&nbsp;</p> <p>The focus of this camp was right in line to help existing .NET developers get in sync with the new <a href="http://www.testyengineer.com/2012/12/windows-8-quickstart.html" target="_blank">Windows paradigm shift</a>.&nbsp; Also, Microsoft kindly supplied breakfast munchies and a lunch.&nbsp; Chris Gomez <a href="https://twitter.com/SpaceShot" target="_blank">@SpaceShot</a> and Microsoft MVP John Baird <a href="https://twitter.com/jbaird_pa" target="_blank">@jbaird_pa</a> gave tag-team presentations and were both understanding of what it takes for an existing .NET developer to advance the new mindset and make the jump to Windows 8 app development.</p> <h3>Sessions</h3> <h4>Building Windows Store Apps Using HTML5/JavaScript</h4> <p>The first session overviewed Building Windows Store apps using HTML5, CSS3, and JavaScript.&nbsp; Chris opened up by keying in on some of main features of Windows 8 user interaction and what is essential in making good applications interoperable within a Windows 8 environment.&nbsp; Basically this was to jump-start experienced developers with one of the more significant changes to the Microsoft development portfolio.</p> <p>In order to understand what is to be accomplished, Chris presented a cursory review of the Windows 8 user experience and then did a code walkthrough of navigation, searching, controls, sharing, and async operations.&nbsp; If there's one thing you can take away from this, it's Microsoft's recommendation that interacting with WinJS will simplify developing Windows 8 apps when using HTML5, CSS3, and JavaScript .&nbsp; WinJS is simply a JavaScript, CSS, and HTML library that helps build Windows 8 controls that are not necessarily implemented in HTML5.&nbsp; However, you can still develop apps with HTML5/JavaScript without the use of WinJS.&nbsp;</p> <h4>Building Windows store Apps with XAML/C#</h4> <p>Next John jumped into Building Windows Store apps with XAML and C#.&nbsp; A good portion of the participants had already been developing in this realm, so this session was an easier jump to constructing Windows 8 apps.&nbsp; If you've been building .NET applications in XAML for sometime, whether it's Silverlight or WPF, your learning curve to getting a Windows 8 app running is actually going to be fairly quick.&nbsp;</p> <h4>Process Lifetime of Windows 8 Apps</h4> <p>The third session, Process lifetime of Windows 8 apps, was led by Chris.&nbsp; Certainly, anyone who's been running Windows over the years knows that being mindful of your available resources is important in ensuring that things run smoothly, and actively keeping tabs of what's running and killing any unnecessary processes is a part of daily computing.&nbsp; However,&nbsp; the intention with Windows 8 is a bit different. To get you in the right frame of mind, think how you've been computing these days with your smart phone or tablet.&nbsp; The perspective is that provisions for an always-on and available mentality is in place when interacting with Windows 8 apps.&nbsp; Chris went on to describe throughout his walkthrough how apps go through the suspend and resume process and how to maintain consistent application state for a user friendly experience.</p> <h4>Introducing the Windows Store</h4> <p>Lastly, John went into an overview&nbsp; of the Windows Store.&nbsp; If you've used <a href="https://play.google.com/store" target="_blank">Google Play</a> or the <a href="http://www.apple.com/osx/apps/app-store.html" target="_blank">Mac App Store</a>, you understand this concept.&nbsp; The Windows Store is basically a distribution system which allows for developers to deliver their certified apps to consumers.&nbsp; John went over a list of details in using the Windows Store and performed a walkthrough of signing up and registering your app on the Store.&nbsp;</p> <p>During this, he discussed details on: <br /> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &bull; Selling, price points, and getting paid <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &bull; Advertising options <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &bull; Beta options<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &bull; Limited functionality and timed trials<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &bull; Registration <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &bull; Application Certification Kit (ACK) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &bull; Localization <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &bull; Deploying apps for use in other countries <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &bull; Updates and versioning</p> <h3>Wrapping Up</h3> <p>As with any other nice event there was a little bit of <a href="http://en.wikipedia.org/wiki/Promotional_item" target="_blank">SWAG</a> and closing with a bunch a nice prizes. &nbsp;Again, keep tabs on your local events. &nbsp;The most important thing you can do is to meet other developers and possibly form ongoing relationships in your field. &nbsp;Right now, there's a dramatic change taking place in personal computing, and now's a great time to be part of that change.</p> <h3>Resources</h3> <h4>Downloads, SDK&rsquo;s, &amp; Tools</h4> <p><br /><a href="http://msdn.microsoft.com/en-us/windows/apps/br229516" target="_blank">Windows Store Apps Developer Downloads</a> <br />includes the Windows 8 SDK, Blend for Visual Studio, Windows Application Certification Kit (ACK), practice labs, sample apps, and much more.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp; <br /><a href="http://www.windowsstore.com/" target="_blank">The Microsoft Windows Store</a> <br />&nbsp;&nbsp;&nbsp;&nbsp; <br /><a href="http://www.microsoft.com/en-us/download/details.aspx?id=29854" target="_blank">Windows 8 Camp in a Box</a> - Official Microsoft Download Center <br />Lesson slides, the hands-on-labs, samples, and related resources. <br />&nbsp;&nbsp;&nbsp;&nbsp; <br /><a href="http://msdn.microsoft.com/en-us/jj554680.aspx" target="_blank">Windows 8 Hands-on Labs Online (HOLO)</a> <br />Scheduled live online presentations and labs.&nbsp; Experts are available in for real-time assistance through your lab work.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp; <br /><a href="https://applabs.msregistration.com/" target="_blank">Windows Store App Labs</a></p> <h4>Event Calendars</h4> <p>&nbsp;</p> <p><a href="http://channel9.msdn.com/Events/Windows-Camp" target="_blank">Windows Camps Events Channel 9</a> <br />&nbsp;&nbsp;&nbsp;&nbsp; <br /><a href="http://communitymegaphone.com/" target="_blank">Community Megaphone</a> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /><a href="http://msevents.microsoft.com" target="_blank">Microsoft World Wide Events</a></p> http://bengalluzzo.com/post/2013/03/18/Windows-8-Camp.aspx http://bengalluzzo.com/post/2013/03/18/Windows-8-Camp.aspx#comment http://bengalluzzo.com/post.aspx?id=ce9d389b-b903-450c-9bbd-2f1e8a212d87 Mon, 18 Mar 2013 20:31:00 +0300 .NET Events Windows 8 Ben Galluzzo http://bengalluzzo.com/pingback.axd http://bengalluzzo.com/post.aspx?id=ce9d389b-b903-450c-9bbd-2f1e8a212d87 545 http://bengalluzzo.com/trackback.axd?id=ce9d389b-b903-450c-9bbd-2f1e8a212d87 http://bengalluzzo.com/post/2013/03/18/Windows-8-Camp.aspx#comment http://bengalluzzo.com/syndication.axd?post=ce9d389b-b903-450c-9bbd-2f1e8a212d87 Hide Tab Header of Tab Control <p>There are multiple ways in which the tab header of a tab control can be hidden. &nbsp;One way is to set the DrawMode of the control to "OwnerDrawFixed," the SizeMode to "Fixed, " and then set the ItemSize to "0, 1" &nbsp;What's left is somewhat of an abandoned tab header. &nbsp;A little bit of fussing with the layout is then required to clean up the tab control. &nbsp;</p> <p>Another method is to extend the WinForm tab control and override the WndProc method to trap the TCM_ADJUSTRECT message, which is sent when it needs to adjust the size of the tabs, while the control is in DesignMode. &nbsp;This allows for a nice way of completely eliminating the tab header from the control without any need to clean up the layout. &nbsp;Once you trap the TCM_ADJUSTRECT message, return the value 1 to specify that the message was handled.</p> <pre class="brush: c-sharp;"> if (_message.Msg == TCM_ADJUSTRECT &amp;&amp; !DesignMode) _message.Result = (IntPtr)1;</pre> <p>&nbsp;</p> <p>While you're at it, put the class inside your custom library and add it the Visual Studio Toolbox so it can dragged onto a form whenever it is needed.&nbsp;</p> <pre class="brush: c-sharp;">using System; using System.Windows.Forms; namespace StoreLib { public class NoHeaderTabControl : TabControl { private const int TCM_ADJUSTRECT = 0x1328; protected override void WndProc(ref Message _message) { if (_message.Msg == TCM_ADJUSTRECT &amp;&amp; !DesignMode) _message.Result = (IntPtr)1; else base.WndProc(ref _message); } } }</pre> <p>&nbsp;</p> <h4>References</h4> <p><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.wndproc.aspx" target="_blank">Control.WndProc Method<br /></a><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb760573(v=vs.85).aspx" target="_blank">TCM_ADJUSTRECT message (Windows)</a></p> http://bengalluzzo.com/post/2012/11/07/Hide-Tab-Header-of-Tab-Control.aspx http://bengalluzzo.com/post/2012/11/07/Hide-Tab-Header-of-Tab-Control.aspx#comment http://bengalluzzo.com/post.aspx?id=ea960188-e833-46b1-80bc-dcdc77ebf9c9 Wed, 07 Nov 2012 19:00:00 +0300 .NET C# WinForm Ben Galluzzo http://bengalluzzo.com/pingback.axd http://bengalluzzo.com/post.aspx?id=ea960188-e833-46b1-80bc-dcdc77ebf9c9 215 http://bengalluzzo.com/trackback.axd?id=ea960188-e833-46b1-80bc-dcdc77ebf9c9 http://bengalluzzo.com/post/2012/11/07/Hide-Tab-Header-of-Tab-Control.aspx#comment http://bengalluzzo.com/syndication.axd?post=ea960188-e833-46b1-80bc-dcdc77ebf9c9 Reading and Writing to an INI File in Managed Code <p><span style="font-size: 14px; font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif;">Due to the push for the adoption of XML configuration files, INI file handling was not built into the .NET Framework. &nbsp;However, INI files do still exist in legacy applications and can sometimes be found in newer software as well. &nbsp;So there needs to be a way to work with them from code. &nbsp;There are some available libraries, such as <a href="http://sourceforge.net/projects/nini/" target="_blank">Nini</a> and <a href="http://sourceforge.net/projects/nini/" target="_blank">CommonLibrary.NET</a>, which can perform this type of work, however, since this is part of the <a href="http://www.bengalluzzo.com/category/Quick-and-Dirty.aspx">Quick-and-Dirty</a>&nbsp;Series, here's a very simple example that will work for a lot of scenarios. &nbsp;</span></p> <h5><span style="font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif;"><span style="font-size: 14px;">Interop Services to the rescue</span></span></h5> <p><span style="font-size: 14px; font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif;">Two kernel32.dll functions can be exposed to handle these INI files; WritePrivateProfileString and GetPrivateProfileString. &nbsp;The class IniFile listed below shows how to utilize these functions from Kernel32 via interop.</span></p> <pre class="brush: c-sharp;">using System; using System.Text; using System.Runtime.InteropServices; namespace StoreLib.Configuration.Ini { public class IniFile { [DllImport("kernel32")] private static extern long WritePrivateProfileString(string _section, string _key, string _val, string _filePath); [DllImport("kernel32")] private static extern int GetPrivateProfileString(string _section, string _key, string _def, StringBuilder _retVal, int _size, string _filePath); public IniFile(string _path) { Path = _path; } //Write to INI File public void WriteValue(string _section, string _key, string _value) { WritePrivateProfileString(_section, _key, _value, Path); } //Read from INI File public string ReadValue(string _section, string _key) { StringBuilder sb = new StringBuilder(255); int i = GetPrivateProfileString(_section, _key, "", sb, 255, Path); return sb.ToString(); } public string Path { get; set; } } }</pre> <p>&nbsp;</p> <p><span style="font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif; font-size: 14px;">Once the IniFile class is ready, reading a value is easy:</span></p> <pre class="brush: c-sharp;">IniFile iniFile; iniFile = newIniFile(@"C:\LegacyApplication\la.ini"); string dataSourceKey = "source1"; string dataSourceName = iniFile.ReadValue("DataSources", dataSourceKey);</pre> <p>&nbsp;</p> <p><span style="font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif; font-size: 14px;">Similarly, writing a value to the file is just as easy:</span></p> <pre class="brush: c-sharp;">IniFile iniFile; iniFile = newIniFile(@"C:\LegacyApplication\la.ini"); string appLoadKey= "splash"; string appLoadValue = "logo"; iniFile.WriteValue("AppLoad", appLoadKey, appLoadValue);</pre> <p>&nbsp;</p> <p><span style="font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif; font-size: 14px;">That's all there is to it. &nbsp;This is just one option for accessing an INI file and should be able to handle most instances of a section's simple key-value pair. &nbsp;Feel free to give it a try.</span></p> <p><span style="font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif; font-size: 14px;">&nbsp; </span><span style="text-decoration: underline;"><span style="font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif; font-size: 14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></span><span style="text-decoration: underline; font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif; font-size: 14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ___________</span></p> <p><a style="font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif; font-size: 14px;" href="http://www.bengalluzzo.com/category/Quick-and-Dirty.aspx">Quick-and-Dirty</a><span style="font-family: 'Segoe UI', Frutiger, Tahoma, Helvetica, 'Helvetica Neue', Arial, sans-serif; font-size: 14px;">&nbsp;Series - Hopefully still a sound solution, these may not be the best, fastest, or most appropriate methods of accomplishing a development task, however, they work and are fast to put in place.</span></p> http://bengalluzzo.com/post/2012/08/13/Reading-and-Writing-to-an-INI-File-in-Managed-Code.aspx http://bengalluzzo.com/post/2012/08/13/Reading-and-Writing-to-an-INI-File-in-Managed-Code.aspx#comment http://bengalluzzo.com/post.aspx?id=70f8c6c9-e821-4f3d-9d05-c8ca9688cdda Mon, 13 Aug 2012 19:00:00 +0300 .NET C# Quick-and-Dirty Ben Galluzzo http://bengalluzzo.com/pingback.axd http://bengalluzzo.com/post.aspx?id=70f8c6c9-e821-4f3d-9d05-c8ca9688cdda 723 http://bengalluzzo.com/trackback.axd?id=70f8c6c9-e821-4f3d-9d05-c8ca9688cdda http://bengalluzzo.com/post/2012/08/13/Reading-and-Writing-to-an-INI-File-in-Managed-Code.aspx#comment http://bengalluzzo.com/syndication.axd?post=70f8c6c9-e821-4f3d-9d05-c8ca9688cdda My .NET Development Environment Toolset <p>By all means, this is far from a complete list of my .NET development toolbelt. &nbsp;It is just a select few of effective lightweight utilities that I commonly use. &nbsp;Often said, although there is often a better tool for the job, sometimes the best tool for the job is the one you know. &nbsp;Please feel free to share some of your own favorites.</p> <h1>Productivity &amp; Desktop</h1> <h3>dnGREP</h3> <p>Developing and working within Unix (I often date myself by typing UNIX) and Linux environments, I've learned to really appreciate some of the great shells and commandline utilities. One of my favorite utilities was grep, which is a text searching utility. dnGrep is a Windows implementation of this utility.</p> <p><a href="http://code.google.com/p/dngrep/">http://code.google.com/p/dngrep/</a></p> <h3>Cygwin Bash Shell</h3> <p>Tee'ing off of the previously stated usefulness of the Unix command shells, Cygwin is a port of many of the more popular Unix tools and provides commandline interaction of these utilities.</p> <p><a href="http://www.cygwin.com/">http://www.cygwin.com/</a></p> <h3>Focus Booster</h3> <p>This is just one of a dozen-dozen utilities assisting with the Pomodoro Technique. This is just one that I like because it's simple, clean, and small. That's kind of a theme of mine when it comes to maintaining my development toolbelt.</p> <p><a href="http://www.focusboosterapp.com/">http://www.focusboosterapp.com/</a></p> <p>If you want to learn more about the Pomodoro Technique have a look here: &nbsp;<a href="http://www.pomodorotechnique.com/">http://www.pomodorotechnique.com/</a> &nbsp;Obviously, this isn't the end-all be-all of productivity methods. &nbsp;There may another one that's a better fit for you.</p> <h3>Input Director</h3> <p>Multiple computers, multiple monitors, one keyboard, one mouse. There's nothing that keeps my desk cleaned up and my hands in one place better than this productivity tool.</p> <p><a href="http://www.inputdirector.com/">http://www.inputdirector.com/</a></p> <h3>notepad</h3> <p>Maybe overstating the obvious, but notepad is one of my more useful tools as well. &nbsp;Often I'm on a system without a good toolset and need to remove any textual formatting from any text that's block copied. While my development machines have various utilities for pasting cleaned up text, that system on the other end of the network probably will not.</p> <h3>ImgBurn</h3> <p>As often, simple is always better. I've created so many less coasters over the years with this CD/DVD burning/copying utility than with any other tool.</p> <p><a href="http://www.imgburn.com/">http://www.imgburn.com/</a></p> <h3>FormatFactory</h3> <p>This is a just a great media converter. &nbsp;It's been very effective for me and is one of the few that doesn't bog down my workstation.</p> <p><a href="http://www.pcfreetime.com/">http://www.pcfreetime.com/</a></p> <h1>Graphics &amp; Images</h1> <h3>Paint.NET</h3> <p>This is probably my alltime favorite graphic editor. &nbsp;It is such a capable image editor and has a large following with which to collaborate.</p> <p><a href="http://www.getpaint.net/">http://www.getpaint.net/</a></p> <h3>Greenshot</h3> <p>Greenshot is a speedy lightweight screenshot tool. I'm hesitant to keep anything running in my windows taskbar that I don't need at all times and is going to use up a lot of memory. &nbsp;These kind of utilities are notorious for sapping away more memory than they need while waiting for you to use them. &nbsp;Greenshot is not one of them and has a home in my taskbar. &nbsp;</p> <p><a href="http://getgreenshot.org/">http://getgreenshot.org/</a></p> <h3>Wordpad</h3> <p>Did I hear a laugh? Yes, as funny as it sounds. Often I need to get full or partial screen shots on systems that don't have much of anything in terms of productivity tools installed on them. I sometimes need to gather a few simple screen shots and to move on. &nbsp;I've found that it's quicker, and tidy, to just drop a bunch of images in a Wordpad document and then wrap things up elsewhere.</p> <h1>Reporting</h1> <h3>RSScripter</h3> <p>Although, it can be done from a manual sense, I often need to grab a load of SSRS reports from a server to either be moved or worked on. &nbsp;This little utility is great for short work of these operations.</p> <p><a href="http://www.sqldbatips.com/showarticle.asp?ID=62">http://www.sqldbatips.com/showarticle.asp?ID=62</a></p> <h3>Report Builder</h3> <p>I often say that developers are lazy. They only want to type something once, automate things, and build things that, in turn, build things for them. Every once in awhile a dynamically generated report doesn't fit the bill and a one-up report is needed. I don't want to take up time with a project, I just want to get the information out there into a report format as quickly as possible. Better yet, if all of the work is done in a stored procedure and available to the report definition, I only need to worry about the layout, groupings, etc. of the report.</p> <p><a href="http://www.microsoft.com/en-us/download/details.aspx?id=6116">http://www.microsoft.com/en-us/download/details.aspx?id=6116</a></p> <h1>Internals</h1> <h3>Dependency Walker</h3> <p>This great utility by Steve Walker examines Windows assemblies and provides realtime interactive diagrams of any activity, errors, and interactions between the different modules running on your system. While it provides extremely detailed useful information, it is surprisingly intuitive for the uninitiated.</p> <p><a href="http://www.dependencywalker.com/">http://www.dependencywalker.com/</a></p> <h3>Sysinternals</h3> <p>Ever since I first purchased the Winternals suite of admin tools years ago, I've been a satisfied customer. &nbsp;This suite of small and effective utilities are use for monitoring and managing Windows systems. &nbsp;Microsoft later obtained Winternals and still has the majority of the tools available for free. I often create scripts or shell commands to the various utilities. &nbsp;Process Explorer, TCPView, PsService, PsList, PsKill, PsInfo, PsExec are the utilities I make use of on a regular basis.</p> <p><a href="http://technet.microsoft.com/en-us/sysinternals/bb842062">http://technet.microsoft.com/en-us/sysinternals/bb842062</a></p> <h1>Development/Debug</h1> <h3>Firebug</h3> <p>This is a Firefox plugin that provides a more detailed view of HTML, CSS, and JavaScript from the client.</p> <p><a href="http://getfirebug.com/">http://getfirebug.com/</a></p> <h3>Glimpse</h3> <p>This is an ASP.NET diagnostics tool that captures performance characteristics for further debugging or troubleshooting. &nbsp;It has the ability to gather an amazing amount of detail fairly easly.</p> <p><a href="http://getglimpse.com/">http://getglimpse.com/</a></p> <h3>JustDecompile</h3> <p>Reflector used to be my go-to tool for .NET code decompilation. &nbsp;This has been an incredible useful tool. &nbsp;Not long after Reflector became a premium product, JustDecompile from Telerik came on the scene.</p> <p><a href="http://www.telerik.com/products/decompiler.aspx">http://www.telerik.com/products/decompiler.aspx</a></p> <h3>FXCop</h3> <p>FXCop is tool that helps maintain that certain rules pertaining to security, naming conventions, proper memory usage, and design are met within .NET code. &nbsp;</p> <p><a href="http://msdn.microsoft.com/en-us/library/bb429476(v=vs.80).aspx">http://msdn.microsoft.com/en-us/library/bb429476(v=vs.80).aspx</a></p> http://bengalluzzo.com/post/2011/09/11/My-NET-Development-Environment-Toolset.aspx http://bengalluzzo.com/post/2011/09/11/My-NET-Development-Environment-Toolset.aspx#comment http://bengalluzzo.com/post.aspx?id=dad07c77-227d-4a6d-9616-b25ec6ae687b Sun, 11 Sep 2011 22:00:00 +0300 .NET Development Environment Utilities Ben Galluzzo http://bengalluzzo.com/pingback.axd http://bengalluzzo.com/post.aspx?id=dad07c77-227d-4a6d-9616-b25ec6ae687b 4841 http://bengalluzzo.com/trackback.axd?id=dad07c77-227d-4a6d-9616-b25ec6ae687b http://bengalluzzo.com/post/2011/09/11/My-NET-Development-Environment-Toolset.aspx#comment http://bengalluzzo.com/syndication.axd?post=dad07c77-227d-4a6d-9616-b25ec6ae687b Setting Up Debug Mode for a Windows Service Project <p>If you&rsquo;ve tried to run a Windows Service project in debug mode, you&rsquo;ve probably seen the message shown below.&nbsp; To debug our code by default, we would have to install the service and then attach the debugger to a Process (Ctrl+Alt+P).&nbsp; Obviously, this can get tedious.&nbsp; There is a more appropriate and efficient way to debug the Windows Service project in which we&rsquo;re developing.</p> <p><a href="http://www.bengalluzzo.com/image.axd?picture=DebugModeError_489x199.png"><img style="background-image: none; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="DebugModeError_489x199" src="http://www.bengalluzzo.com/image.axd?picture=DebugModeError_489x199_thumb.png" border="0" alt="DebugModeError_489x199" width="491" height="203" /></a></p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>Let&rsquo;s start out by constructing a simple Windows Service&hellip;&nbsp; Add a Windows Service class item to the project; in our case, the class is named <span style="font-family: 'Courier New';">AgentService</span>.&nbsp;</p> <pre class="brush: c-sharp;">using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Linq; using System.ServiceProcess; using System.Text; using System.Timers; namespace ProvingGrounds.Agent { partial class AgentService : ServiceBase { private Timer timer = null; public AgentService() { InitializeComponent(); timer = new Timer(6000); timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Enabled = true; timer.AutoReset = true; } protected override void OnStart(string[] args) { Start(); } protected override void OnStop() { Stop(); } public void Start() { timer.Start(); } public void Stop() { timer.Stop(); } void timer_Elapsed(object sender, ElapsedEventArgs e) { //TODO:Do Something } } }</pre> <p>&nbsp;</p> <p>Next, update Main() found in Program.cs to execute AgentService.</p> <pre class="brush: c-sharp;"> static void Main() { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new AgentService() }; ServiceBase.Run(ServicesToRun); }</pre> <p>We should now have our Windows Service constructed. Feel free to compile it and then go ahead try running it in debug mode. You should be receiving our "Start Failure" error message.</p> <p>Next, let's get this thing running in debug mode from Visual Studio. We can do this by adding the #if DEBUG preprocessor directive to our Main() function. We simply wrap the existing call to our AgentService with the conditional preprocessor directives.</p> <pre class="brush: c-sharp;">using System; using System.Collections.Generic; using System.Linq; using System.ServiceProcess; using System.Text; using System.Threading; namespace ProvingGrounds.Agent { static class Program { static void Main() { #if DEBUG AgentService agentService = new AgentService(); agentService.Start(); Thread.Sleep(Timeout.Infinite); agentService.Stop(); #else ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new AgentService() }; ServiceBase.Run(ServicesToRun); #endif } } }</pre> <p>&nbsp;</p> <p>That's all there is to.&nbsp; Go ahead and hit F5 from Visual Studio and your Windows Project should be running in Debug Mode.</p> http://bengalluzzo.com/post/2011/01/14/Setting-Up-Debug-Mode-for-a-Windows-Service-Project.aspx http://bengalluzzo.com/post/2011/01/14/Setting-Up-Debug-Mode-for-a-Windows-Service-Project.aspx#comment http://bengalluzzo.com/post.aspx?id=f5bfe414-b111-4bbe-866b-678ed07e7974 Fri, 14 Jan 2011 17:36:00 +0300 .NET Debugging Windows Service C# Admin http://bengalluzzo.com/pingback.axd http://bengalluzzo.com/post.aspx?id=f5bfe414-b111-4bbe-866b-678ed07e7974 391 http://bengalluzzo.com/trackback.axd?id=f5bfe414-b111-4bbe-866b-678ed07e7974 http://bengalluzzo.com/post/2011/01/14/Setting-Up-Debug-Mode-for-a-Windows-Service-Project.aspx#comment http://bengalluzzo.com/syndication.axd?post=f5bfe414-b111-4bbe-866b-678ed07e7974 Rounding-Out A Class Library – Extension Methods <p>One potential improvement to a custom class library could lie in the use of extension methods.&#160; In short, extension methods are a quick and simple way to extend a type without modifying or recompiling the actual type which is being extended.&#160; Utilizing an extension method is as simple as calling the <em><strong>ToString()</strong></em> method on a type.&#160; At first it may seem difficult to come up with uses for extension methods.&#160; However, working through a project, potential use for an extension method may present itself and also could very well reside in commonly created utility classes.&#160; Operations often performed against a type in the same context is a perfect use for converting a utility function into an extension method.</p> <p>Defining an extension method might seem a little odd at first to the uninitiated.&#160; Take a bit of time to think about what’s happening under the hood to provide this added functionality, automatically, to an existing type. The first parameter of an extension method takes on the <em><strong>this</strong></em> modifier to accept the type on which the method operates.&#160; Utilizing the extension methods requires adding a <em><strong>using</strong></em> directive of the namespace for which the extension method resides.&#160; </p> <p>Below are a couple very simple examples of extension methods and their use.&#160; These two extension methods provide a boolean value for a check of a null value or an empty value against an Array type and also a for String type.</p> <pre class="brush: csharp;">using System; namespace ProvingGrounds.Lib { public static class LibraryExtensions { public static bool IsNullOrEmpty(this Array _value) { return (_value == null || _value.Length == 0); } public static bool IsNullOrEmpty(this string _value) { return (_value == null || _value.Length == 0); } } }</pre> Utilizing these new extension methods can only be done if applying the proper using directive to the calling class; in this case, using <font color="#008000">ProvingGrounds.Lib</font>. <pre class="brush: csharp;">using System; using System.Collections.Generic; using System.Linq; using System.Text; using ProvingGrounds.Lib; namespace ProvingGrounds.Console { class Program { static void Main(string[] args) { string emptyTest = null; if (emptyTest.IsNullOrEmpty()) System.Console.WriteLine(&quot;emptyTest is null or empty&quot;); } } }</pre> <p>Omitting the proper using directive will result in the extension method not being available for use.</p> <p><a href="http://www.bengalluzzo.com/image.axd?picture=ExtensionMethod_271x101.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="ExtensionMethod_271x101" border="0" alt="ExtensionMethod_271x101" src="http://www.bengalluzzo.com/image.axd?picture=ExtensionMethod_271x101_thumb.png" width="273" height="105" /></a></p> <p>&#160;</p> <p>&#160;</p><p>&#160;</p><p>&#160;</p> <p>Care should be taken when enabling more global usage. For instance, if the class housing the extension methods are added to the <font color="#008000">System</font> namespace, their use can be made more readily available. </p> <pre class="brush: csharp;">using System; namespace System { public static class SystemExtensions { public static bool IsNullOrEmpty(this Array _value) { return (_value == null || _value.Length == 0); } public static bool IsNullOrEmpty(this string _value) { return (_value == null || _value.Length == 0); } } }</pre> <p>So there it is. A couple of very simply extension methods in practice. Have fun with them. Use them to simplify often used operations on types; operations whose functionality may already reside in common util classes.</p> http://bengalluzzo.com/post/2010/11/01/Rounding-Out-Your-Class-Library-–-Extension-Methods.aspx http://bengalluzzo.com/post/2010/11/01/Rounding-Out-Your-Class-Library-–-Extension-Methods.aspx#comment http://bengalluzzo.com/post.aspx?id=22ed5c09-889d-4f5b-82e2-1a7274180e25 Mon, 01 Nov 2010 16:57:00 +0300 .NET admin http://bengalluzzo.com/pingback.axd http://bengalluzzo.com/post.aspx?id=22ed5c09-889d-4f5b-82e2-1a7274180e25 132 http://bengalluzzo.com/trackback.axd?id=22ed5c09-889d-4f5b-82e2-1a7274180e25 http://bengalluzzo.com/post/2010/11/01/Rounding-Out-Your-Class-Library-–-Extension-Methods.aspx#comment http://bengalluzzo.com/syndication.axd?post=22ed5c09-889d-4f5b-82e2-1a7274180e25