One method is to use the DatePart method.
But here is a much nicer way to get the Date Portion:
CAST(FLOOR( CAST( GETDATE() AS FLOAT ) )AS DATETIME)
One method is to use the DatePart method.
But here is a much nicer way to get the Date Portion:
CAST(FLOOR( CAST( GETDATE() AS FLOAT ) )AS DATETIME)
Scenario: You need to define a string value that needs to be reused across your application (eg: Application Title)
One way the above scenario can be implemented is by using the “Application.Resources” in the App.Xaml file.
The first step is to define the string resource. This is done by defining the type (clr:String) and a key that will be used to access the string. The value is also defined here:
<Application.Resources>
<clr:String x:Key="ApplicationTitle">OptiRoute</clr:String>
</Application.Resources>
The above resource can then be accessed in your XAML markup using StaticResource markup extension:
<TextBlock x:Name="ApplicationTitle" Text="{StaticResource ApplicationTitle}" Style="{StaticResource PhoneTextNormalStyle}"/>
I needed a list box that would allow users to reorder items in the box by clicking and dragging a handle. Weirdly, the SDK does not support this kind of behavior (I would have thought that something like this would be part of the standard behavior).
My next step was to see if there was an existing control built by someone else on CodePlex and I had no luck there either. I finally, came across Jason Ginchereau’s blog on the “ReorderListBox” that he wrote. And its an awesome implementation of a re-orderable list.
Check out his blog-post for more details on the capabilities of his control. I have been trying it out and its exactly what I wanted.
Below is a screen of the reorderable list in-action: I am moving the 2nd item to the first place.

Some tips I gathered while working on invoking commands from Powershell. (an example would be calling iisreset from Powershell).
1. The Call (or invocation) Operator “&”
The call operator is used to run a command or even a script block. Here is an example:
$cmd = "systeminfo" #where systeminfo is a dos-command
& $cmd
2. Passing parameters to the command:
If you try:
$cmd = "ping www.google.com"
& $cmd
You will find that an error will be thrown. To pass parameters to the call-operator, you need to send them as separate strings:"
$cmd = "ping"In addition, if you need to pass separate arguments, each one should be sent as a separate string.
$cmd = "ping"
& $cmd "www.google.com" "-n" "2"
One nice little work-around to passing each argument as a separate quoted string is to use the split command:
$cmd = "ping"
& $cmd "www.google.com -n 2".split()
3. Use the automatic variable $LastExitCode to determine the exit code of the command you just ran using the call-operator:
It’s a contrived example, but its just so that I can illustrate how to use $LastExitCode:
$LASTEXITCODE = 0;
$cmd = "cmd.exe"
$result = & $cmd '/c copy z:\txt.txt m:\txt.txt';
Write-Host $LASTEXITCODE;
if ($LASTEXITCODE -ne 0)
{
Write-Host "Error" -ForegroundColor DarkRed
$result
}
In the above example, the copy command will fail and because of that the “Error” message will be printed to the screen.
4. Capturing error messages:
One problem with the above example is that, you don’t get to capture the error message reported by the copy (although it gets printed to the screen, its not in the $result object). If you want to be able to log all the error messages, you should redirect StdErr to StdOutput and this is done by appending “2>&1” to command above:
$LASTEXITCODE = 0; #reset the value of the lastexitcode. done so that you can be sure that lastexitcode was set by your call
$cmd = "cmd.exe"
$result = & $cmd '/c copy z:\txt.txt m:\txt.txt 2>&1';
Write-Host $LASTEXITCODE;
if ($LASTEXITCODE -ne 0)
{
Write-Host "Error" -ForegroundColor DarkRed
$result
}
Tip:
The PowerShell Community Extensions projects has a command-line tool called “EchoArgs”. It is a useful tool for the purpose of determining how powershell will pass along arguments to a command.
More Info:
Call operator: http://technet.microsoft.com/en-us/library/dd347588.aspx
LastExitCode: http://technet.microsoft.com/en-us/library/dd347675.aspx
EchoArgs: http://stackoverflow.com/questions/8905232/powershells-call-operator-syntax-and-double-quotes
How do you go about converting a SecureString object to plain text in powershell? Turns out its not through the Convert-SecureString method.
Instead, you need to perform some interop to get the plain text string.
$Pwd = read-host -assecurestring "Password:"; #returns a SecureString object
#convert the SecureString object to plain text using PtrToString and SecureStringToBSTR
$bstr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($Pwd)
$Pwd = [Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr) #$Pwd now has the secure-string contents in plain text
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) #this is an important step to keep things secure
More info:
http://blogs.msdn.com/b/shawnfa/archive/2004/05/27/143254.aspx
The Hype Cycle is a graph used by the Gartner group to show the typical stages through which technology innovation gets adopted. It provides insight into the typical cycles that any new technology goes through.
![]()
Another graph that maps to the hype-cycle is the “">Market Life Cycle” graph:

And finally, there is the Magic Quadrant graph that allows one to figure out where their company/technology is positioned in terms of other competitors.

More info:
Pointed out to me by Mike Schmidt, these are 2 useful documents on Richard Lawrence’s site that show different strategies that can be used to split user stores:
1. Story splitting cheat sheet: http://www.richardlawrence.info/wp-content/uploads/2009/10/Story-Splitting-Cheat-Sheet.pdf
2. Flow chart to aid in splitting of user-stories: http://www.richardlawrence.info/wp-content/uploads/2012/01/Story-Splitting-Flowchart.pdf
PhoneGap is an open source mobile app development platform that allows you to create an app for Windows Phone 7 (WP7) and the same app can also be run on other app platforms. Windows Phone support was added as part of version 1.3.
Read the quick start to see how easy it to create a WP7 app.
And here are some videos on using PhoneGap with WP7: http://phonegap.com/2011/12/20/phonegap-for-windows-phone-getting-started/
And more information can be found at this blog-post: PhoneGap for WP7 dissected
Liked this post by Scott Hanselman, where he applied Maslow’s pyramid to software development:http://www.hanselman.com/blog/MaslowsHierarchyOfNeedsOfSoftwareDevelopment.aspx

Read the post!