sudhircblogs.blogspot.com
Sudhir C Blogs: Format string with Regex
http://sudhircblogs.blogspot.com/2011/08/format-string-with-regex.html
Learning something new everyday. Wednesday, August 3, 2011. Format string with Regex. Just discovered something cool today, and most of you guys probably knew it already, but this was new to me, and I am kinda excited sharing it - we can format strings with Regex. That's pretty awesome. The way we do it is:. RegexReplace("unformatted string", "regex", "format");. This returns the formatted string. Simple. Replace(PhoneNumber, @"( d{3})( d{3})( d{4})". Subscribe to: Post Comments (Atom).
sudhircblogs.blogspot.com
Sudhir C Blogs: Solving Sql vs C# Minimum DateTime Issue using Extension Method
http://sudhircblogs.blogspot.com/2011/04/solving-sql-minimum-datetime-using.html
Learning something new everyday. Friday, April 8, 2011. Solving Sql vs C# Minimum DateTime Issue using Extension Method. Do "DateTime.MinValue" in .NET, and you would get "1/1/0001 12:00:00 AM", the default value of DateTime variables. Try inserting it into SQL Server DB, and you will get an exception, because the minimum datetime in SQL Server is 01/01/1753. This is usually not a problem as most of the time t. He datetime variable is assigned with valid date. Creating extension method is very simple....
sudhircblogs.blogspot.com
Sudhir C Blogs: Implementing Custom Config Section - Part 2
http://sudhircblogs.blogspot.com/2012/11/implementing-custom-config-section-part.html
Learning something new everyday. Tuesday, November 13, 2012. Implementing Custom Config Section - Part 2. This is the Part Two of "Implementing Custom Config Section". You can visit Part One here. In part one, we looked at config sections that have non-repeating name value pairs.The config section we would like to have here have repeated name value pairs, added to the section using. Similar to appSettings section. So, lets get started. Step 1 - Define your configuration section. Element).Key; } }. Note: ...
sudhircblogs.blogspot.com
Sudhir C Blogs: Implementing Custom Configuration Section - Part 1
http://sudhircblogs.blogspot.com/2012/10/implementing-custom-configuration.html
Learning something new everyday. Tuesday, October 16, 2012. Implementing Custom Configuration Section - Part 1. The code is really simple, so I will not go through it completely, however I will point out some interesting stuffs along the way. So, here you go. Here's a custom configuration section I want to build for. And here's the class that can read the values from it:. System.Configuration; namespace. MyConfig.config1; } } public. MyConfig.config2; } } public. MyConfig.config3; } } } }. DotNetSlackers...
sudhircblogs.blogspot.com
Sudhir C Blogs: Sql Server - "Handy" While loop
http://sudhircblogs.blogspot.com/2012/01/sql-server-handy-while-loop.html
Learning something new everyday. Thursday, January 19, 2012. Sql Server - "Handy" While loop. While researching I came across " while. Loop in Sql Server, and below is how I got the test data generated. While loop is pretty straight forward in sql:. Set @i = 1. Set @i = @i 1. The output would be: 1 2 3 4 5 6 7 8 9 (each number in new line). In my case, it would be something like below. I am using a test table, 'myTestTable' which has 4 columns: pk, note, createDate, and userId. Set @c = getdate(). I am a...
sudhircblogs.blogspot.com
Sudhir C Blogs: Projects
http://sudhircblogs.blogspot.com/p/projects.html
Learning something new everyday. Below are some of the projects I worked on. Feel free to download the applications (, source codes) and play with it. Lucky Draw Android App. Meeting Expense Calculator Android App. 15 Puzzle using jQuery. Co-Developed with Manij Shrestha. Android app that lets you listen to top nepali music. Just tap 'Listen Now', and listen to endless Nepali songs streaming to your android phone. Download the app from: https:/ play.google.com/store/apps/details? A puzzle game to arrange...
sudhircblogs.blogspot.com
Sudhir C Blogs: Number of rows inserted by hour
http://sudhircblogs.blogspot.com/2011/03/number-of-rows-inserted-by-hour.html
Learning something new everyday. Friday, March 11, 2011. Number of rows inserted by hour. Almost all the time, when your database is large enough, you will be curious to know how busy the database is, and one of the ways is to find it is to look at the number of inserted row per hour. The idea is pretty simple: Select records by date, group by the hour and count. It does get interesting when we start thinking about var types we are using and io statistics. Select datepart(hh,createDate) [hour],. Select c...