Thursday

Navigation to the webpage was canceled chm

To fix this problem :
Right-mouse click it in Windows Explorer on chm file and select Properties. Then click Unblock.
Here is article describes the how to work around it : http://support.microsoft.com/kb/896054

Wednesday

Strong name validation failed.

To resolve this issue run following command in Visual Studio command line:
sn -Vr "[PathToProblemDLL]\[ProblemDll].dll"


Tuesday

c# extensions

     
//A. allows value.In("one", "two" , "tree")
public static bool In<T>(this T source, params T[] list)
{
if(null==source) throw new ArgumentNullException("source");
return list.Contains(source);
}

//#B Enable quick and more natural string.Format calls
public static string F(this string s, params object[] args)
{
return string.Format(s, args);
}

// like this one "lala {1} ".F(one, two)

//#C nice comparison tool :
public static bool Between<T>(this T actual, T lower, T upper) where T : IComparable<T>
{
return actual.CompareTo(lower) >= 0 && actual.CompareTo(upper) < 0;
}

//Allows to have :
if (myNumber.Between(3,7))
{
// ....
}

//#D a map function
public static void ForEach<T>(this IEnumerable<T> @enum, Action<T> mapFunction)
{
foreach (var item in @enum) mapFunction(item);
}

//allows to run function for every element
// like this one :
new { itemA, itemB, itemC }
.ForEach(item => {
item.Number = 1;
item.Str = "Hello World!";
});


Sunday

moving data between two list boxes +jquery

   

<select id="SelectLeft" multiple="multiple">
<option value="1">Australia</option>
<option value="2">New Zealand</option>
<option value="3">Canada</option>
<option value="4">USA</option>
<option value="5">France</option>
</select>

<input id="MoveRight" type="button" value=" >> " />
<input id="MoveLeft" type="button" value=" << " />

<select id="SelectRight" multiple="multiple">
</select>




<script language="javascript" type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"></script>
<script language="javascript" type="text/javascript">
$(function() {
$("#MoveRight,#MoveLeft").click(function(event) {
var id = $(event.target).attr("id");
var selectFrom = id == "MoveRight" ? "#SelectLeft" : "#SelectRight";
var moveTo = id == "MoveRight" ? "#SelectRight" : "#SelectLeft";

var selectedItems = $(selectFrom + " :selected").toArray();
$(moveTo).append(selectedItems);
selectedItems.remove;
});
});
</script>


Thursday

cross platform mobile development comparison

There's a detailed comparison of all these toolkits in this article here: Modern Cross Platform Development.
There are a number of other solutions around like
Rhodes,
Titanium,
PhoneGap,
JUCE,
MoSync,
Corona and
Moai.
Each of these use a bunch different languages, including HTML5/JS/CSS, Lua, Ruby, Python and C++. All except Corona are open source and free.

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...