1 2 3 4
public static void Capitalize() { TextInfo oTextInfo = CultureInfo.CurrentCulture.TextInfo; ...
C# Capitalize directory name w...
I wrote a method to capital...
1 2 3 4
public static string ToRelativeDate(DateTime input) { string suffix = "ago"; ...
C# Twitter-esque Relative Dates
Given an input date, this m...
1 2 3 4
private string getMD5String(string PlainText) { System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); ...
C# Cryptography with MD5
This is a simple example of...
1 2 3 4
using System.Security.Cryptography; public class CryptographyRSA() ...
C# Cryptography with RSA and B...
This is a simple example of...
1 2 3 4
namespace Utilities { using System; ...
C# StringExt.cs (String Extens...
Ok take it easy on me, I ju...
1 2 3 4
private static Regex _namedtags = new Regex (@"</?(?<tagname>\w+)[^>]*(\s|$|>)", RegexOptions.Singleline | RegexOptions.ExplicitCapture); ...
C# Balance HTML Tags
For the subset of HTML tags...
1 2 3
Declare @Name varchar(128) Declare @Cursor Cursor ...
C# Cache SQL Server Views
Question: Is there anyway t...
1 2 3 4
namespace DataSetTableAdapters { partial class MyTableAdapter { ...
C# TableAdapter and CommandTim...
by Auron,
July 02, 2008 10:19,
8 refactorings, tagged with tableadapter, commandtimeout, dataset, ado, C#, .net
As TableAdapters are are au...
1 2 3 4
public static List<T> MergeListCollections<T>(List<T> firstList, List<T> secondList) { List<T> mergedList = new List<T>(); ...
C# Merge generic lists
Toying with some utility me...
1 2 3 4
// ***** Encryption and Decryption ***** // byte[] Key(string sText) { ...
C# Encryption and Decryption
This is my first attempt at...
1 2 3 4
private static Regex _tags = new Regex("<[^>]*(>|$)", RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled); private static Regex _whitelist = new Regex(@" ^</?(a|b(lockquote)?|code|em|h(1|2|3)|i|li|ol|p(re)?|s(ub|up|trong|trike)?|ul)>$ ...
C# Sanitize HTML
Takes a provided HTML strin...
1 2 3 4
using System; using System.Collections.Generic; using System.Linq; ...
C# Pointers in C#
I am trying to work out how...
1 2 3 4
void CopySourceTables(List<TableNameResult> tables, int id) { // Execute the "Copy" Command on the Server for Each Table. ...
C# Common StProc Code
Hi guys, following my previ...
1 2 3 4
bool Do_People_Still_Read_This { // Not sure what to put here? "return true;" or "return false;" ? ...
C# Since I Cannot Message Peop...
Didn't/couldn't see how to ...
1 2 3 4
public List<double> GenerateLogNormalDistribution(int numberOfTimes, double mean, double standardDeviation) { Random randomGenerator = new Random(); ...
C# Lognormal Distribution
Is there a better way to do...
1 2 3
def filename self.uri.split('/').last ...
C# Get the Filename segment o...
by jwmittag,
January 01, 2008 15:04,
10 refactorings, tagged with ruby, rails, Ruby on Rails, RoR, C#, CSharp, C-Sharp, .net, DotNET, asp.net, Scott Porad, Comparison
On his Blog "Progress vs. P...
1 2 3 4
private string CodiceControllo(string codice_fiscale) { int somma = 0; ...
C# Code to Simplify
by Squall77it,
December 19, 2007 16:26,
6 refactorings
Hi, I am new on c#...
ther...
1 2 3 4
using System; namespace FizzBuzz ...
C# I hate to do this, but...
by nibbles&bits,
October 24, 2007 15:13,
12 refactorings
Let the battle begin!
1 2 3 4
static class SqlExec { public static void ExecCommandBatch(System.Data.Common.DbConnection conn, System.Data.IsolationLevel isolation, ExceptionFailSafeEventHandler<System.Exception> failSafe, params System.Data.Common.DbCommand[] cmds) ...
C# ExecuteCommandBatch
by nibbles&bits,
October 21, 2007 02:34,
1 refactoring
It's rather large, but also...
1 2 3 4
while (classificator.Clients.Count > 0) { Client client = ServiceHelper<Client>.GetFirst(classificator.Clients); ...
C# How to add gracefully undo ...
by Darius Damalakas,
September 27, 2007 02:42,
2 refactorings
.Net, C#
The code below ...
The below is some code I re...