Posts Tagged ‘WordPress’

Two Plugins To Publish Quick Posts On WordPress

For those who have already fallen in love with the WordPress “Press This” bookmarklet, you might not need to look for another alternative. All you need to do is to tweak the bookmarklet to perfection using “Press This Reloaded” plugin. As the name suggested, this plugins gives users the best of both world: the ability to post quick post and the full functionalities of WordPress editor.

You can get the plugin via “Install Plugins” menu at your WordPress’ side menu. Perform a quick search and click the “Install Now” link.

via Two Plugins To Publish Quick Posts On WordPress.

Advertisements

Equipping yourself before digging into Unit Testing!

Generic Type, Delegate as an Anonymous Method, and Lambda Expression are what you need to master before you can work with Moq Framework (one of the Unit Test frameworks).

I made a summary here about those terms. Please view the web site referred in the source section to read full details.

 

[Anonymous Delegate]
Basically, anytime you see a method that accepts a delegate as a parameter you could use anonymous methods.

Example:

Sort method in class List.

definition

class List
{
	...
	public void Sort (Comparison<T> comparison);
	...
}
public delegate int Comparison<in T> (T x,	T y);

usage

List myList;

myList.Sort(delegate(MyItem item1, MyItem item2)

{

return Comparer<MyItem>.Default.Compare(item1, item2);

});

ForEach(Action<T> action) method in class List.

usage

myList.ForEach(delegate(MyItem item) {//do-something} )

see more .Find, .ConvertAll

source: http://weblogs.asp.net/dwahlin/archive/2007/04/23/The-Power-of-Anonymous-Methods-in-C_2300_.aspx

 

[Generic type]
Make the code much more reusable: They are a type used for methods whose code  remains the same whilst the data type of the parameters can change with each use.

To truly create a generic type parameter, you need to ensure that a constraint is met – i.e. a class or interface that must be included as a part of the type used for the parameter.

Example:

Class Compare<AnyType, AnyType>
{
	AnyType GetLarger(AnyType obj1, AnyType obj2)
					where AnyType : IComparable
	{
		//Logic...
		if obj1.Compare(obj2) > 0 return obj1 else return obj2;
	}

}
 source: http://www.developer.com/net/net/article.php/2229511/What-Are-C-Generics.htm

 

[Anonymous delegate replaced by lambda expression]

<pre>Func<int, int> f1 = delegate(int i) { return i + 1; };
Func<int, int> f2 = i => i + 1;

My favourite WordPress themes

Here are the themes I like the most on WordPress:

  1. SpringLoaded
    A++
    A colorful with green but still being elegant Dates is decorded nicely but categories and tags are displaying so simple.
  2. Rubric
    A
    A Dynamic Width theme
  3. MistyLook
    A++
    I’m fond of this theme very very much except the bullet style.
  4. Ocean Mist
    A+
    It’s lovely for everything except the font is too small.
  5. Journalist
    A
    Very clean style to read my blog.
  6. Inove
    B
    Another clean style. But it has distracting icons under the title of each post and the title itself is not big enough.
  7. zBench
    A+
    Grayscale color theme I found elegant to used!

For these ones I also like them, and I will have a try on them soon.

  1. Twenty ten
  2. Fusion
    A
    Simple but Clean ‘n’ Clear. The title each post is so “simple” and easily get blurred with the content.

Have fun!