Monday, April 23, 2012

Android: how to draw a horizontal ruler.

<View
android:layout_width="fill_parent"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_height="1dp"
android:background="?android:attr/listDivider" />

You can just enter the above code segment in the interested layout xml file and in the place where you want the horizontal ruler and change the android parameters according to your needs of the Android application.

Have fun.

Saturday, December 10, 2011

Mac OS X Enable/Disable Dashboard

This is a quick way to enable or disable the mac os x's shining dashboard.

Enable:
defaults write com.apple.dashboard mcx-disabled -boolean YES
killall Dock
 
Disable: 
defaults write com.apple.dashboard mcx-disabled -boolean NO
killall Dock 

Wednesday, July 13, 2011

C# Format string with a number to two decimal places

formattedValueFrom =  String.Format("{0:0.00}", decimal.Parse(row["ValueFrom"].ToString().Trim()))

row - A DataRow in a DataTable
ValueFrom - A column in the DataRow