- Windows logo key
+ Plus to zoom in
- Windows logo key
+ Minus to zoom out, and
- Windows logo key
+ ESC to exit.
Thursday, March 17, 2011
Using Magnifier in presentations
Sunday, September 19, 2010
Debugging Blogspot+Silverlight+Dropbox issue
Request URL:http://dl.dropbox.com/u/4186718/Nitin.Spike.XAPHosting.xap
Request Method:GET
Status Code:200 OK
Response Headers
Content-Type:application/octet-stream
Date:Sun, 19 Sep 2010 06:12:06 GMT
Server:dbws
accept-ranges:bytes
cache-control:no-cache
content-length:4379
etag:10n
pragma:no-cache
x-robots-tag:noindex,nofollow
The problem is that the Content-Type is application/octet-stream, it should have been application/x-silverlight-app. Okay so we know the problem, how do we fix it? I am using dropbox, are they suppose to push with correct content-type or do i need to configure it somewhere... I have asked this question in their forums...
Thursday, September 02, 2010
Testing Silverlight
Saturday, August 28, 2010
Enum extensions
using System;
using System.ComponentModel;
namespace Nitin.Spike.EnumExtensions
{
class Program
{
static void Main()
{
const Colors someColor = Colors.Red;
string description = someColor.Description();
if (someColor.HasDescription())
{
if (someColor.HasDescription("indicates stop", StringComparison.OrdinalIgnoreCase))
{
Console.WriteLine("Works");
}
}
}
}
public enum Colors
{
[Description("Indicates Stop")]
Red,
[Description("Indicates Nothing")]
Blue,
[Description("Indicates Go")]
Green
}
public static class EnumExtensions
{
public static string Description(this Enum someEnum)
{
var memInfo = someEnum.GetType().GetMember(someEnum.ToString());
if (memInfo != null && memInfo.Length > 0)
{
object[] attrs = memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute),false);
if (attrs != null && attrs.Length > 0)
return ((DescriptionAttribute)attrs[0]).Description;
}
return someEnum.ToString();
}
public static bool HasDescription(this Enum someEnum)
{
return !string.IsNullOrWhiteSpace(someEnum.Description());
}
public static bool HasDescription(this Enum someEnum, string expectedDescription)
{
return someEnum.Description().Equals(expectedDescription);
}
public static bool HasDescription(this Enum someEnum, string expectedDescription, StringComparison comparisionType)
{
return someEnum.Description().Equals(expectedDescription, comparisionType);
}
}
}
Saturday, July 31, 2010
High Speed Internet
The first time I connected to internet was some 9 years back, I got my own internet connection around 8 years back, and at that point of time I used to get 56 Kbps speed, and today I have a 512 Kbps line.
Is this speed enough for me? Hell no.. why not? because even today I can’t watch my videos directly off the web. Although I can watch low quality videos online, but now I want HD quality. I wonder if I will ever be satisfied with my connection.
Sunday, July 18, 2010
WPF Converter values
I posted this at stackoverflow : http://stackoverflow.com/questions/3204422/wpf-corelating-multibindings-and-converters-values
The problem was how do you handle indexes when your converter value array is of large size. I thought over it and come up with this:
https://www.assembla.com/code/TechnologyAndMe/subversion/nodes/ConverterValues
(Download complete source using a SVN client from http://subversion.assembla.com/svn/TechnologyAndMe/ConverterValues/)
So now all you have to do is :
Here Prop1,Prop2,Prop3 are the actual values that you want to pass to the converter, Value1, Value2, Value3 are just ids for Properties below them. Now in the converter, just use my BoundValues class and accessing the properties become as easy as saying :
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var boundValues = new BoundValues(values);
return string.Format("{0} {1} {2}",
boundValues["Value1"], boundValues["Value2"], boundValues["Value3"]);
}
Where BoundValues["Value1"] returns value of Prop1, so now I no longer have to worry about managing the sequence of bindings in my XAML.
Thursday, May 27, 2010
Generic Singleton
****
What was I thinking, if I use any regular class here, it will not be singleton as you could always new() up an instance.
****
Once and for all, I am going to settle with this implementation of singleton.
https://www.assembla.com/code/TechnologyAndMe/subversion/nodes/Singleton
(Download complete source using a SVN client from http://subversion.assembla.com/svn/TechnologyAndMe/Singleton )
Singleton is now as easy as:
var instance = Singleton<SomeOtherClass>.Instance;