Roberto Abraham Scaruffi

Tuesday, 21 June 2011


For comments or enquiries please contact webmaster@codeproject.com View online Monday, June 20, 2011

Welcome to this week's newsletter from The Code Project.
To ensure that future newsletters you receive from The Code Project aren't mistakenly blocked by antispam software, be sure to add the maillist.codeproject.com domain to your list of allowed senders.

Site News

We regularly review our hardware and systems to ensure that (a) the site is up, and (b) it's working as best it can, and (c) we're spending as little as possible in making (a) and (b) happen. As part of this we decided to do a fairly major overhaul of our office systems, where "overhaul" is a euphamism for "throw it all out and start from scratch". It's a little rough on the nerves but means we get to flush out all the little gremlins while also reducing the number of actual machines we have lying around.
On a practical note this means we may be a little slower to reply to emails for the next couple of days. It also means that, with the removal of half of the servers, we no longer get to use the server room as a pizza oven, but sacrifices must be made.
Wish us luck.
Don't forget: an iPad 2 is up for grabs in our HTML5 / CSS3 competition.
cheers,
Chris Maunder

The Code Project Offers

Click HereJoin the AMD OpenCL™ Coding Competition with $50,000 in prizes!
This phase of the competition is an open innovation challenge with the only requirement being to use the AMD APP SDK and OpenCL code. Think you have what it takes to think outside the box? Prove it and you might win big!
Click HereASP.NET Ad Hoc Reporting. Life can be simpler.
Download here.
Click HereLearn Visual Studio, Silverlight, WPF, SharePoint and more – Just $99.99
Master the hottest Microsoft technologies with this library of 3,000 video tutorials by Microsoft MVPs and experts. An entire year of training is just $99.99 for a limited time. Subscribe now!
Click HereThe Code Project Virtual Tech Summit on Cloud Development is on-demand!
Take the fluffiness out of cloud computing and get pragmatic, tactical guidance on deploying, managing, and optimizing your cloud applications. There is still time! Register now – no cost!
Click here /n software Red Carpet Subscriptions
Components for every major Internet protocol from SFTP to IMAP to SNMP, SSL & SSH, S/MIME, Credit Cards, Compression, Messaging, Shipping, and more. .NET, COM, C++, Java, Pocket PC, Delphi, Mac OS X, iPhone

Latest Additions

138 articles overall 87 new, 79 updated, 0 moved. 37 were edited, 101 unedited
Article topics listed: All Topics
Too many articles? Visit your profile page to change your newsletter article filters.

Tips and Tricks added

Grid & Data Controls

ASP.NET

HTML / CSS

Android

Azure

DLLs & Assemblies

Programming Tips

String handling

Installation

Database

  • I don’t know why my boss always gets angry - jwood_denver
    Why don't you just use a query like this?SELECT CAST(serverproperty(N'servername') AS varchar(50)) AS [Server Name], db_name() AS [Database Name], SCHEMA_NAME(schema_id) AS [Schema Name], [name] AS [Object Name], [type_desc] AS [Object Type], [create_date] AS [Create... (Unedited)
    SQL-Server

C#

  • Pascal and Camel Case to Display Text Conversion - Steve Roberson
    This version treats the input string as an indexed string. The code is a little shorter.private string createDisplayText(string propertyName){ if (String.IsNullOrEmpty(propertyName)) { return String.Empty; } StringBuilder builder = new StringBuilder(); ... (Unedited)
    C#, ASP.NET, format

Azure

  • Maintain Scroll Position Problem fix for Chrome. - Wonde Tadesse
    The other option will be to use Update Panel ASP.NET control as much as possible. It helps to retain the current position on the page whenever a postback happens to the page. (Unedited)
    C#, ASP.NET

Win32/64 SDK & OS

  • Open a command prompt anywhere. - manish76235
    Good one. However typing CMD in the explorer address bar and pressing enter will also open up the command prompt inside the selected folder path as well. Hope this helps. (Unedited)
    Win7, Shell, Commands

Programming Tips

  • Trick when using Array.Contains() - Ctznkane
    The Array class already contains this capability with no casting required. The IndexOf method is a static one that returns the index of the value and a -1 if it doesn't exist.Here is an example:exists = Array.IndexOf(arr, "item") >= 0 (Unedited)
    C#2.0
  • Changing App.Config on the fly for unit testing - EbenRoux
    An alternative is to abstract the settings that you intend to use.So instead of changing your app.config on the fly, simply change a mock or the instance values of the configuration object.For example:public interface IApplicationConfiguration{ string MaybeAFolderINeed { get; } ... (Unedited)
    C#
  • Get Default Mail Client Name - MWBate
    I have been using the following code (suggested by someone on an MSDN forum) to determine if a default mail client has been configured:RegistryKey hkey = Registry.ClassesRoot.OpenSubKey( "mailto\\shell\\open\\command", false);hkey will be null if there is no such client. (Unedited)
    C#
  • Deserialize JSON with C# - AlexCode
    .NET Framework actually has this functionality built-in.The object is this one: system.web.script.serialization.javascriptserializer.aspx[^]I use this a lot and it works as expected.Here's 2 examples:1. Dumb deserializationHere's the easyest way, where you get what you... (Unedited)
    C#, Javascript, JSON
  • Simple Trick To Make Form Invisible - pranav95
    Even simpler.form1.opacity=0; (Unedited)
    C#

String handling

  • L33t Tr4nsl4t0r (Leet Translator) - Luc Pattyn
    Way too much code. Using arrays of characters, your switch constructs can be reduced to just a few lines of code, like so:switch (c) { case 'a': sb.Append("4"); break; case 'e': sb.Append("3"); break; case 'i': sb.Append("1"); break; ... (Unedited)
    C#4.0
  • Ordinal suffixes in English for the nth degree - YDaoust
    What aboutpublic static string NUMthOF(UInt32 v){ return v.ToString() + // Append the ordinal suffix for the unit digit // unless the ten digit is a one (force 'th') "thstndrdthththththth".Substring(2 * (int)(v / 10 % 10 != 1 ? v % 10 : 0), 2);}?Now all... (Unedited)
    C#
  • Basic string to integer conversion extensions - George Swan
    As it stands, the TryParse method will fail if the string contains commas. E.g., 10,000. To get around this, you can use:bool isnumber=int.TryParse(text,System.Globalization.NumberStyles.Integer | System.Globalization.NumberStyles.AllowThousands, ... (Unedited)
    C#

Technical blogs added

Button Controls

  • Ribbon with C++, Part 4: Layout Controls in Windows Ribbon Framework - Arik Poznanski
    This is the 4th post about Windows Ribbon Framework features. On previous posts we have introduced the Windows Ribbon Framework, shown a complete example of how to develop a ribbon enabled application and reviewed the different buttons-based UI controls that the ribbon framework provides. In t (Unedited)
    All-Topics

Files and Folders

Shell and IE programming

  • IE Blocking IFrame Cookies - Elad1010
    IE Blocking IFrame Cookies (Unedited)
    ASP.NET, PHP
  • Ribbon with C++, Part 1: Introduction to the Windows Ribbon Framework - Arik Poznanski
    The basics of the Windows Ribbon Framework - a rich command presentation system that provides a modern alternative to the layered menus, toolbars, and task panes of traditional Windows applications. (Unedited)
    C++, Windows, Framework, Controls
  • Ribbon with C++, Part 3: Using Buttons with Windows Ribbon Framework - Arik Poznanski
    On previous posts we have seen an introduction to the Windows Ribbon Framework and learned how to develop a ribbon enabled application. In this post we continue our review of the various features in the Windows Ribbon Framework. This time we will focus on the most common feature in the ribbon: Butt (Unedited)
    C++, Windows, Dev

Applications & Tools

Client side scripting

  • JSON Object Code Example - Elad1010
    An example to demonstrate the power and accessibility JSON offers to developers. (Unedited)
    Javascript, Dev, JSON

HTML / CSS

  • IE CSS Hacks - Elad1010
    CSS Tips to allow coding for a specific IE version (Unedited)
    CSS, HTML

Windows Mobile

Windows Phone 7

  • Metro In Motion Part #7 – Panorama Prettiness and Opacity - Colin Eberhardt
    This blog post details a simple metro-in-motion behaviour which reduces the Panorama control’s contents while the user slides from item-to-item so that they can really appreciate your fancy background graphic! (Unedited)
    C#, Windows-Phone-7, Dev

Microsoft BizTalk Server

  • SQL SERVER – Solution – Puzzle – SELECT * vs SELECT COUNT(*) - pinaldave
    Earlier I have published Puzzle Why SELECT * throws an error but SELECT COUNT(*) does not. This question have received many interesting comments. Let us go over few of the answers, which are valid. Before I start the same, let me acknowledge Rob Farley who has not only answered correctly very first (Unedited)
    All-Topics

Database

  • Database Documentation with a Data Dictionary Part 2 - Andrew Zwicker
    A continuation of the data dictionary discussion with information about how the documentation is done. (Unedited)
    SQL, SQL-Server, DBA, Dev
  • Gotcha #1167: Quoted Identifiers in Oracle - MBigglesworth79
    Quoted identifiers appear to be causing more problems and confusion than they are worth; not least the potential creation of "duplicate" column names. (Unedited)
    SQL, Oracle, Dev
  • INT to BINARY string in SQL Server - AlexCode
    Converting INTs to BINARY in SQL Server (Unedited)
    SQL, SQL-Server, Dev
  • A Look at Dapper.NET - MBigglesworth79
    Dapper.NET is an Open-Source, lightweight ORM that is simple to use, and is compatible with any database which implements a provider for .NET. (Unedited)
    C#, VB.NET, Dev

C#

Other .NET Languages

.NET Framework

  • How To Use a .NET 4 Based DLL From .NET 2 Based Application? - Arik Poznanski
    Introduction The official answer is you can’t. Even with the In-Process Side by Side execution (SxS) feature, introduced in .NET 4. The SxS feature was intended to be used when COM is involved. For example, if you got an application that loads plugins, like outlook, and it loads 2 COM plugins, one (Unedited)
    All-Topics
  • Delegates 101 - Part I: What is a Delegate? - MBigglesworth79
    What is a Delegate? (Unedited)
    C#, Javascript, HTML, VB.NET, .NET

Win32/64 SDK & OS

Internet / Network

  • RSA private key import from PEM format in C# - Tamir Khason
    How to import OpenSSL private key into .NET application and use it with X509 public certificate to establish TLS connection with asymmetric encryption and two phase certificates handshake (Unedited)
    C#, Web-Development, security, key

Macros and Add-ins

Uncategorised Quick Answers

  • Quick JSON Tutorial - Elad1010
    A very quick and usable tutorial for JSON (Unedited)
    All-Topics, JSON

Uncategorised Tips and Tricks

Design and Architecture

Uncategorised Technical Blogs