Tech Support Websites

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 26 May 2013

NDepend - a powerful .NET code analysis tool

Posted on 14:10 by Unknown
Nearly a decade ago, I was amazed when a not-so-technical project manager gave detailed feedback on my C# code in a project I was working on. It turned out he had used FxCop to analyze the code and he was parroting the results that came out after the tool analyzed it. That was my first brush with code analysis tools.

This nifty class of tools is especially indispensable for architects, technical leads and solo programmers who are concerned about code quality and need to have code critically reviewed in order to avoid paying a technical debt. For architects and technical leads, having an automated tool can help them save time and cover a greater breadth of code to review for quality and any architecture flaws. For solo programmers who don't have the luxury of a peer to review their code (there is the StackExchange CodeReview forum but reviews may not be low-level or very comprehensive), these code analysis tools are a tremendous help to improve their craft.

NDepend (currently in version 4) is a powerful .NET code analysis tool that reveals a wealth of distilled information.  It can be used as a Visual Studio Add-in (for versions 2012, 2010 & 2008) or through a standalone Windows GUI app, VisualNDepend or via a console app.

Potential uses of NDepend include:

  • a thorough assessment of code quality via 82 different code metrics 
  • the ability to visualize your code at a high-level
  • detecting dependencies between assemblies/components
  • integrated into your build process
  • comparing builds and tracking code differences
  • reverse engineering a complex .NET code base
  • using the lines of code metric of an existing module to estimate time required for a future module based on its LoC. 
  • perform an objective analysis of the quality of a library before acquiring it
  • define custom rules to validate against and query code using CQL or Code Query Language, NDepend’s own query language for inspecting your code. It is like SQL for assemblies. 
  • receive warnings on Build process health 
  • integration of NDepend analysis into the build process can result in NDepend continuously checking for the violation of CQLinq rules  

For someone completely new to code analysis tools, understanding the code metrics jargon can be intimidating. While NDepend has pretty detailed documentation, understanding the numerous keywords that are referenced by the tool can be a little daunting. If you put the effort to get past that, NDepend can pay rich dividends.

The man behind the tool, Patrick Smacchia, has been a Microsoft Visual C# MVP since 2003. In tune with the theme of NDepend, his blog is titled Code Better. He regularly answers questions on NDepend and related topics that are posted on StackOverflow.

To get started, try the free 14-day evaluation copy downloadable from the NDepend website. I was fortunate to have received a review copy from NDepend.
Read More
Posted in Tools | No comments

TWIL - Week #8

Posted on 11:28 by Unknown
This Week I Learned:
  • Yahoo will pay $1.1 billion for Tumblr, a six-year-old company founded by David Karp (aged 26) with more than 100 million users, 500 Mn pageviews a day, peak rate of ~40k requests per second, ~3TB of new data to store a day, all running on 1000+ servers but very little revenue. 
  • Teenager, Eesha Khare won the Intel Foundation Young Scientist Award and a $50,000 runner-up prize for her invention - to fully charge a cell phone in 30 seconds or less.
  • GeoGuessr is an interesting online geography game that uses the Google Maps API and found a mention in XKCD. I wonder which came first GeoGuessr or Where in the World?
  • According two economists at the University of California, Santa Cruz, having a computer at home won't raise a school student's grades. It doesn't help - or hurt. Is there any proof that computers that Indian populist politicians give away to students in India have a positive impact?
  • CBSE, Directorate of School Education, Tamil Nadu offer school textbooks for their respective Boards for free download. Nice.
  • Why you shouldn't mess with Matthew "The Oatmeal" Inman
    Read More
    Posted in India, TWIL | No comments

    Thursday, 23 May 2013

    ASP.NET MVC 4 Questions and Answers

    Posted on 09:50 by Unknown

    Q) What is the name of the unit testing Framework that is available with a ASP.NET MVC 4 Project in Visual Studio?
    MSTest

    Q) Which code will execute before any of the Controllers are run?
    The code within Application_Start() in global.asax will start executing before any of the Controllers run

    Q) Which HTTP status code does a RedirectPermanent ActionResult return?
    RedirectPermanent returns a 301 status code

    Q) How does ASP.NET know how to deliver a request like http://localhost/home/about?
    Routing engine (not tied to ASP.NET MVC Framework) directs requests to Controllers. The route map is defined in global.asax

    Q) What is NuGet?
    It is a Package Manager for .NET applications. NuGet can be used to install, update and configure software (DLLs) in the form of Packages, for use in a Visual Studio project. This way you don't have to download it or track dependencies. NuGet understands package dependencies & will fetch dependent packages as well.

    Q) Where do NuGet Packages come from?
    1. NuGet official feed of packages (from nuget.org)
    2. Your local repository
    3. Your network share
      Q) Where do NuGet Packages go?
      When you install a NuGet package it goes into the Packages folder within the Visual Studio Solution from where you requested. It stores the Package on a per solution basis, not putting in the GAC or Program Files. It is local to that Solution. This makes it easy to update and put a package under version control. The Packages.config file within a Visual Studio solution lists all the Packages that have been installed for the project

      Q) What is in a NuGet Package?
      A *.nupkg is a zip file that contains:
      Metadata - dependencies, URLs, version numbers are specified in a XML file
      Binaries - assemblies (DLLs)
      Other content - scripts, images, code blocks

      Q) Can NuGet commands be executed from the command line?
      Yes, using PowerShell. To view the list of commands, open the Package Manager Console in Visual Studio (View > Other Windows > Package Manager Console) & type help package

      Q) Which is the namespace you have to include when you're using DataAnnotations?
      System.ComponentModel.DataAnnotations

      Q) Where does the Razor Layout View reside?
      The Layout View in Razor (the equivalent of Master Page in ASP.NET WebForms) resides in the Shared folder under the Views folder. It is represented by the _Layout.cshtml file

      Q) How does MVC runtime know that it has to use _Layout.cshtml?  
      Q) What is the significance of the _ViewStart.cshtml file?
      _ViewStart.cshtml resides in the root of the Views folder. It contains a code block containing a Layout property set to the the _Layout.cshtml file. It is a Razor convention that anything inside  _ViewStart.cshtml will execute before a View does. _ViewStart.cshtml applies to all Views. It can be overriden on a per View basis.

      Q) What does a Razor Layout page contain?

      Razor Layout pages are HTML files that define a Body and additional sections by using the following instructions:
      @RenderBody(): Renders the content of a page that is not within any named sections.
      @RenderSection("mySectionName"): Renders the content of the section within the given name. Sections are mandatory by default, so each page linked to the template will have to declare them.
      @RenderSection("mySectionName", optional:true): Renders the content of an optional section. The pages that are linked to the template can omit the definition of an optional section.

      Q) How to ignore the default Layout view?
      To avoid using the default Layout page, set Layout property to null

      Q) Can you build your own custom HTML Helpers?
      Yes, you can build your custom HTML Helpers

      Q) What does the Razor WebGrid Helper do?
      The WebGrid Helper renders an HTML table that displays data from the model or from a database. It
      supports data formatting, paging and sorting.

      It generates a collection of Columns and parameters within the given data source, which is rendered as an
      HTML table that can be accessed after the grid is generated.

      Q) What does @: in Razor represent?
      @: makes Razor interpret a string as literal text

      Q) What are the project templates presented to you by Visual Studio when you start a ASP.NET MVC 4 Project?
      Empty - empty ASP.NET MVC 4 Project
      Basic - basic ASP.NET MVC 4 Project
      Internet Application - a default ASP.NET MVC 4 Project with an account controller that uses Forms Authentication
      Intranet Application - a default ASP.NET MVC 4 Project with an account controller that uses Windows Authentication
      Mobile Application - an ASP.NET MVC 4 Project for mobile devices with an account controller that uses Forms Authentication
      Web API - a ASP.NET Web API Project

      Q) What are Action Filters? Give examples.
      Action Filters are the components that are used to apply cross-cutting logic i.e logic that has to be executed across multiple controller actions so that you don’t have to duplicate code inside of individual controllers.

      Action Filters supply pre and post processing logic to a controller action and its result

      Global filters are applied at application startup. 

      Examples:
      OutputCache - caches the output of a Controller
      Authorize - restricts an Action to authorized users or roles
      ValidateAntiForgeryToken - helps prevent cross site request forgeries
      HandleError - can specify a view to render in the event of an unhandled exception.

      work in progress...

      Read More
      Posted in ASP.NET-MVC | No comments

      Tuesday, 21 May 2013

      Book Review: Instant jQuery 2.0 Table Manipulation How-to

      Posted on 10:11 by Unknown

      Instant jQuery 2.0 Table Manipulation How-to by Charlie Griefer is an excellent book that explains practical web development scenarios that are possible with the use of tables and jQuery, like the following:

      • Table row striping 
      • Sum columns 
      • Show/hide rows 
      • Highlighting cells 
      • Pagination
      • Column sorting 
      • Filtering 
      • Table-related jQuery Plugins (DataTables & Tablesorter)

      While you'll be able to find several code samples for the above scenarios online, what really sets this book apart is the detailed explanation of the code samples. The ideas from the book can be adapted to newer scenarios.

      Although it has jQuery 2.0 in the title, there is nothing specifically meant for jQuery 2.0.

      The book is suitable for a beginner to intermediate level web developer audience. Some basic prior knowledge of HTML, CSS & jQuery is required to follow the content in the book. This can be a good reference to keep handy. It is a slim book with just 56 pages and I wonder if it qualifies to be called a book.

      I found the book well-written, engaging & informative. I recommend it to web developers working with jQuery.

      This review is based on a complimentary ebook that Packt offered me.
      Read More
      Posted in Book Review, jQuery | No comments

      Sunday, 19 May 2013

      TWIL - Week #7

      Posted on 01:21 by Unknown

      This Week I Learned:
      • Azure is also a business success with annual revenue topping $1 billion. That’s $1 billion with only a 20% share of a $6 billion dollar market.
      • 42% of the world’s top 1 million sites are hosted in the U.S. 97% of websites (in the Alexa top million) with a .kr ccTLD are hosted in South Korea. Google, Facebook, Amazon have millions of users in india, but no data centers in India. 
      • A typeface is the specific letter-form design of an alphabet. A font is a collection of all the characters of a typeface, including capital letters and lowercase letters, numerals and punctuation marks. The words font and typeface are often interchanged. Times New Roman was Microsoft's first font and the default in most MS programs till Calibiri replaced it. Matthew Carter created the Georgia and Verdana fonts for Microsoft.
      • Like the United States Computer Emergency Readiness Team (US-CERT), India has a Computer Emergency Response Team (CERT-In, part of the Department of Electronics and Information Technology of GoI) too which has been in operation since January 2004. It is probing into the $45 million ATM heist in which hackers broke into two card processing companies, raising the balances and withdrawal limits on accounts that were then exploited in coordinated ATM withdrawals in 28 countries around the world. The heist involved a couple of Indian companies. The CERT-In website uses frames and has disabled right-clicking on its pages (both bad practices, in my opinion). According to Defacement Statistics on the CERT-In website, there were 3419 defacements from Jan,2013 to Apr,2013 
      • 146 Indian Members of Parliament have appointed relatives (family members include 60 sons and 36 wives) as their personal staff. Source: Times of India

      Read More
      Posted in India, TWIL | No comments

      Saturday, 18 May 2013

      Learn about Chrome DevTools at Code School

      Posted on 11:06 by Unknown
      Code School  teaches web technologies via online video tutorials. While most of their courses are paid, some like the course on Chrome DevTools are free. The Chrome DevTools course is well-produced and impressive.

      In my opinion, learning about DevTools within at least one browser is crucial to do a good job at web development. Some of the tricks you learn in the Code School Discover Chrome DevTools tutorial can easily be re-used with the Developer tools of other browsers (like IE, Firefox Firebug)

      Like Pluralsight, Code School provides some of its courses for free:
      • Try jQuery 
      • Try Git 
      • Try Ruby 



      Read More
      Posted in Browsers, Chrome, Learning Resources | No comments

      Thursday, 16 May 2013

      Book Review: Instant jQuery Drag-and-Drop Grids How-to

      Posted on 07:28 by Unknown

      Instant jQuery Drag-and-Drop Grids How-to is a beginner level book by Marcos Placona on getting started with the Gridster jQuery plugin.

      Gridster is a MIT licensed jQuery plugin that allows building intuitive draggable layouts from elements spanning multiple columns. You can even dynamically add and remove elements from the grid. It has an active following on GitHub. The minified version (jquery.gridster.min.js) of this powerful plugin  measures just 33KB. Gridster supports Internet Explorer 9+, Firefox, Chrome, Safari and Opera.

      jQuery plugins like these make building compelling website user experiences a simple task.

      The plugin does come with online documentation but if you need some hand-holding and have to get up to speed quickly, this book can guide you through. The book should be read while you're trying out the six download-able code samples that come along. It is just 48 pages long and is more like a long article. This book could have been longer and clubbed as a chapter of a bigger book on useful, liberally-licensed jQuery plugins.

      It is interesting to know and commendable that the publisher of this book, Packt, pays a royalty to open source projects on which the books it sells are based.

      This review is based on a complimentary ebook that Packt offered me.
      Read More
      Posted in Book Review | No comments

      Wednesday, 15 May 2013

      Glossary of keywords used in Microsoft Technologies

      Posted on 20:26 by Unknown
      I like keeping definitions of  keywords used in Microsoft technologies handy. This is a placeholder for links to online resources that have definitions.

      • SharePoint 2010 Glossary - MSDN
      • SharePoint 2013 Glossary - MSDN
      • Azure Glossary (including SQL Database) - MSDN, Technet
      • WCF Glossary - MSDN
      • C# Reference - MSDN


      work in progress...
      Read More
      Posted in Microsoft, Programming | No comments

      Sunday, 12 May 2013

      TWIL - Week #6

      Posted on 11:28 by Unknown

      This Week I Learned:

      Programming:
      • IE10 for the phone and the PC are built on the same engine and use the same renderer which means that what you see on your desktop (or tablet) is what you'll see on your phone. Additionally, the web browser control in Windows Phone apps is a full instance of IE10, with the same speed and power as the native phone browser.
      • An analysis of the world’s top 1000 URLs reveals that page weight increased 28% from March 2012 (822 K) to March 2013 (1053 KB). The median page load time on desktops got ~3.5% faster, and on mobile was ~18% ~30% faster.
      General:
      • To quickly watch YouTube screencasts: open video in HTML5 mode > cog > set speed to 1.5
      • Standalone SWF, PDF files can be viewed with Chrome
      • Samsung's cost of materials and manufacturing to produce the U.S. version of the S 4 is slightly above $237 a unit. This is higher than Apple's $217 production cost for a 32-gigabyte iPhone 5, which has a smaller and less-costly display screen.
      • Windows has less than 5% of the global smartphone market and less than 8% of the tablet market 
      • In India, where one-in-six people are undernourished, an unlikely business is booming: obesity surgery. India is one of the fastest-growing centers in the $1.2 billion global market for bariatric devices.
      Read More
      Posted in TWIL | No comments

      Monday, 6 May 2013

      HOW TO view a .NET DLL's dependencies

      Posted on 11:22 by Unknown
      The simplest though not the most convenient way to view a .NET DLL's dependencies is to use the ildasm.exe tool

      Click on the Manifest node to view names of dependent assemblies

      The manifest lists the names and versions of all other assemblies that the current assembly depends upon.

      If you're adding a reference via NuGet, you can find the dependencies from the information provided for each Package in the Package listing -


      Read More
      Posted in C#, HOWTO | No comments

      Sunday, 5 May 2013

      TWIL - Week #5

      Posted on 08:14 by Unknown

      This Week I Learned:

      Programming-related
      • Windows Azure SDK for .NET v2.0 has some nice updates. Windows Azure SDK for .NET is a fully open source project (Apache 2 license) hosted on GitHub.
      • ProgrammableWeb maintains a directory of  programmable Web APIs. As per their recent count, there are 9,000 APIs!
      • I like tracking the weather these days. When I'm not connected to the Internet, I use Google's SMS feature to get weather info. Send a text message with the command weather {your-city-name}  to 9773300000 and you'll get a response with the weather conditions in seconds. This week, I learnt about SkyMetWeather which focuses on weather in India pretty comprehensively. They currently don't appear to provide an API to extend their service for developers. The graphics & presentation of weather data by Forecast, the new global weather service, is impressive. The Forecast API looks easy to use.
      • There are a bunch of alternatives for .NET Reflector - that brilliant tool which was initially free
      • Twitter is extending API v1 Retirement until June 11, 2013
      • Words representing objects can be best remembered if you can visualize the object. I like the paper-version of the Oxford Dictionary as it makes liberal use of illustrations to explain the meaning of words. Among online dictionaries, TheFreeDictionary (best viewed in the printer-friendly mode without ads) has pictures. This week I ran into EZeeDictionary which is a picture dictionary of reportedly 2.5 lakhs word definitions. 
      • Trello, the free web-based project management tool uses MongoDB
      General
      • Sockpuppeting means using a fake identity for deceptive purposes. It refers to an account made on an internet message board, by a person who already has an account, for the purpose of posting more-or-less anonymously
      • F4 and Ctrl-Y in Word will "Repeat the last action". This feature is useful when you have to scale large images to fit the width of your document. 
      • You can selectively color parts of an image using Paint.NET 
      • Some companies are designing their offices in ways that employees who work in seperate divisions bump into each other. The hope is that these casual face-to-face chats among people with different skills might spark new ideas, lead to new solutions or at the least, increase workplace camaraderie. Gmail and Street View are said to have started off from casual employee conversations. 
      Read More
      Posted in India, TWIL | No comments

      Thursday, 2 May 2013

      HOW TO easily autofit or scale wide images so that they fit within a Word document

      Posted on 10:34 by Unknown

      With the AutoFit option in Word, you can get a wide table copied from elsewhere scale neatly within your document. However, if you copy some wide images from an external source, there is no convenient AutoFit option as for a table.

      You have to select an image, right click on it and select the Size and Position... option. In the dialog box that opens up, specify desired scaling width and height. For best results, you can choose to lock the aspect ratio


      If you have several images, you can use F4 or Ctrl-Y on each image to repeat the same effect rather than use the Scale image setting for each one. The nifty F4 keyboard shortcut can be used to repeat any last action.
      Read More
      Posted in HOWTO, Word | No comments
      Newer Posts Older Posts Home
      Subscribe to: Posts (Atom)

      Popular Posts

      • Windows 8 keyboard shortcuts
        Win + X   - context menu to access common features like Control Panel, Task Manager, File Explorer, Programs & Features, Run, Search etc...
      • What is the difference between Browser Mode & Document Mode in IE
        If you're a web developer and your job actively involves building web pages that work the same in all browsers including the last three ...
      • My 30-day personal project - watch 100 hours of Pluralsight videos
        Inspired by Matt Cutts' 30-day challenges , I plan to watch 100 hours of Pluralsight online videos to get up-to-date with current ...
      • Archive tweets & favorites with Google Reader
        There are numerous ways to archive tweets but rather than use yet another tool, I prefer using Google Reader to preserve the tweets I mark ...
      • TWIL - Week #3
        This Week I Learned: New Azure VM Image Templates include SQL Server, BizTalk Server, and SharePoint Server (2013?) images . This can be han...
      • Dashboard-like info with Browser tabs, Windows 7 Taskbar tabs
        Browser tabs & Windows 7 Taskbar tabs are turning self-aware.  This is how my browser looked the other day: I had the summary of all tha...
      • The State Of HTML5 Video
        Key points from the  The State Of HTML5 Video  report by LongTailVideo (last updated on April 19, 2012): 75% of the desktop & mobile bro...
      • Azure in Pictures - overview of Windows Azure Features, Services and Common Uses
        Download the Windows Azure Poster in PDF format (1.1MB)
      • Indian comparison shopping sites
        Did you know, India has 120 million Internet users & the Indian e-commerce market is worth $7 billion ?  Travel accounts for over 80 per...
      • Things to consider before settling on a JavaScript Library or jQuery plugin for your project
        In the article, Which JavaScript Library Should I Pick? , Pamela Fox has listed some practical points to consider before you settle on a Jav...

      Categories

      • AJAX
      • Android
      • APIs
      • App
      • ASP
      • ASP.NET
      • ASP.NET-MVC
      • Azure
      • Azure SQL Database
      • AzureInPictures
      • Bing
      • Book Review
      • Bookmarklet
      • Browsers
      • C#
      • chart
      • Chrome
      • Cloud
      • CSS
      • CSS3
      • DidYouKnow
      • E-Commerce
      • Excel
      • FB
      • Fiddler
      • Firefox
      • Gadgets
      • GeoLocation
      • GMail
      • Google
      • Google Docs
      • Google Reader
      • Health
      • Hotmail
      • HOWTO
      • HTML
      • HTML/CSS
      • HTML5
      • Humor
      • Hyderabad
      • IE
      • IIS
      • India
      • Internet
      • IT
      • Javascript
      • jQuery
      • JSON
      • JSONP
      • Laptop
      • Learning Resources
      • Lists
      • Map
      • Metrics
      • Microsoft
      • miscellaneous
      • Mobile
      • NAPA
      • Office365
      • Opera
      • PDF
      • Performance
      • Personal
      • PHP
      • PM
      • PowerShell
      • Privacy
      • Programming
      • Rant
      • Safari
      • Science
      • Search Engines
      • SearchEngines
      • Security
      • SEO
      • Sharepoint
      • SharePoint2013
      • Silverlight
      • Software Engineering
      • Solutions
      • SQL Azure
      • SQL Server
      • TFS
      • Tip
      • Tips
      • Tools
      • Tools/Utilities
      • Trivia
      • TWIL
      • Twitter
      • UX
      • VM
      • VS.NET
      • VS2010
      • VS2012
      • WCF
      • WebApps
      • Websites
      • WF
      • Windows Phone
      • Windows7
      • Windows8
      • Word
      • WP7
      • WPF

      Blog Archive

      • ▼  2013 (112)
        • ►  October (16)
        • ►  September (14)
        • ►  August (8)
        • ►  July (8)
        • ►  June (13)
        • ▼  May (12)
          • NDepend - a powerful .NET code analysis tool
          • TWIL - Week #8
          • ASP.NET MVC 4 Questions and Answers
          • Book Review: Instant jQuery 2.0 Table Manipulation...
          • TWIL - Week #7
          • Learn about Chrome DevTools at Code School
          • Book Review: Instant jQuery Drag-and-Drop Grids Ho...
          • Glossary of keywords used in Microsoft Technologies
          • TWIL - Week #6
          • HOW TO view a .NET DLL's dependencies
          • TWIL - Week #5
          • HOW TO easily autofit or scale wide images so that...
        • ►  April (12)
        • ►  March (8)
        • ►  February (15)
        • ►  January (6)
      • ►  2012 (127)
        • ►  December (11)
        • ►  November (14)
        • ►  October (13)
        • ►  September (14)
        • ►  August (16)
        • ►  July (16)
        • ►  June (6)
        • ►  May (5)
        • ►  April (11)
        • ►  March (12)
        • ►  February (7)
        • ►  January (2)
      • ►  2011 (98)
        • ►  December (5)
        • ►  November (2)
        • ►  October (5)
        • ►  September (7)
        • ►  August (7)
        • ►  July (15)
        • ►  June (10)
        • ►  May (7)
        • ►  April (8)
        • ►  March (10)
        • ►  February (11)
        • ►  January (11)
      • ►  2010 (163)
        • ►  December (14)
        • ►  November (19)
        • ►  October (19)
        • ►  September (15)
        • ►  August (18)
        • ►  July (17)
        • ►  June (20)
        • ►  May (17)
        • ►  April (19)
        • ►  March (5)
      Powered by Blogger.

      About Me

      Unknown
      View my complete profile