Snippets of the day – Wednesday, March 19, 2014

Posted on Leave a commentPosted in Snippets

Here are some of the most recently published snippets! C#: How to sanitize a string from unwanted characters This method defines a set of admitted characters (see ‘admtted’ string) and substitute the characters not belonging to admitted string with the ne provided in ‘subchar’ paraemter, or skip it if skip=true Open the snippet Author:    […]

Snippets of the day – Monday, February 24, 2014

Posted on Leave a commentPosted in Snippets

Here are some of the most recently published snippets! Typescript: passing a class member function as parameter to another function Typescript introduces the class construct and the concept of member functions. However if you try to pass a instance member function as parameter to another function the binding with the instance is lost. To solve […]

Snippets of the day – Tuesday, February 18, 2014

Posted on Leave a commentPosted in Snippets

Here are some of the most recently published snippets! Email Utilities in Java SWT environment This class provides some utilities for the management of email dispatch on client side for SWT environment, like opening an email client. Open the snippet Author:    cghersi Java Program to simultaneously execute 2 threds Open the snippet Author:    […]

Snippets of the day – Sunday, February 09, 2014

Posted on Leave a commentPosted in Snippets

Here are some of the most recently published snippets! C#: Prepare a string of comma-separated values from a collection. This method prepares a comma-separated (or any other character specified as ‘separator’ input) from the given list. It can also remove zero or negative inputs if explicitly required by setting removeZerosOrNegatives=true Open the snippet Author:    […]

Snippets of the day – Friday, February 3, 2014

Posted on Leave a commentPosted in Snippets

Here are some of the most recently published snippets! How to encrypt and decrypt strings in C# This class can be used to encrypt and decrypt the given string. In the current implementation the passwrod is directly saved inside the code; depending on the infrastructure and architecture of the code sometimes it can be passed […]

Snippets of the day – Monday, January 20, 2014

Posted on Leave a commentPosted in Snippets

Here are some of the most recently published snippets! Old Old autoSetFrameHeight Old Old autoSetFrameHeight: autoSetFrameHeight.js Open the snippet Author:    yicone http://www.tracefact.net/csharp-programming/immutable-atomic-value-types.aspx 1、当创建类型的目的是为了存储一组相关的数据,且数据量不是很大的时候,将它声明为Struct比Class会获得更高的效率;2、将类型声明为具有原子性和常量性,可以避免可能出现的数据不一致问题;3、通过在构造函数和Get访问器中,对对象的字段进行深度复制,可以避免在类型的外部修改类型内部数据的问题。 http://www.tracefact.net/csharp-programming/immutable-atomic-value-types.aspx 1、当创建类型的目的是为了存储一组相关的数据,且数据量不是很大的时候,将它声明为Struct比Class会获得更高的效率;2、将类型声明为具有原子性和常量性,可以避免可能出现的数据不一致问题;3、通过在构造函数和Get访问器中,对对象的字段进行深度复制,可以避免在类型的外部修改类型内部数据的问题。: immutable-atomic-value-types.cs Open the snippet Author:    yicone

Snippets of the day – Monday, January 6, 2014

Posted on Leave a commentPosted in Snippets

Here are some of the most recently published snippets! How to programmatically convert the Visual Studio coverage file to coveragexml by command line tool in csharp This code shows how to programmatically export and convert the coverage data ( .coverage) generated by Visual Studio into a readable xml file (.coveragexml). The xml file can be […]

Snippets of the day – Saturday, December 28, 2013

Posted on Leave a commentPosted in Snippets

Here are some of the most recently published snippets! C#: Get Enum from Description attribute This is a generic extension method which gets the Description attribute from an Enum Open the snippet Author:    lucky80 Bash command to remove CVS folders from a tree folder Removes all the folders named “CVS” from the tree folder […]