Tuesday, 9 November 2010

VNC For Android!

logo

 

 

This is one of THE most useful applications for remotely controlling your computer / remote system administration /  and lot of fun remote VNC sessions for the Home User!!!. You can realize the potential straight away, YES!! controlling a remote computer from your android phone!!

Now, I take absolutely no responsibility for this post but i would like to share a very quick way of configuring a remote computer to allow incoming VNC connections on a port and then use the ‘VNC for Android’ application to connect to it. (from anywhere in the world Winking smile)

The indented audience are home users / geeks and enthusiasts.

1] Download Ultra VNC Server from here and Install it.

2] Download the ‘VNC For Android’  Application to your android phone. (Don’t start it just yet)

3] Configure you VNC Server. Set Passwords , Ports and User Impersonation. My advise is to use ‘A’ random port from the range and not just use 5900. (Although 5900 works completely fine, It’s anybody's guess when it’s comes to how secure your open ports are to the outside world ), because soon you will discover that you might have to open the port in your router to allow the communication via VNC.

vnc viewer

4] Login to your Router’s administration page and forward the port no (which you just configured in step 3) to the machine which has the VNC Server application running on it.

5] Find your IP (WAN) from here, or your router’s administration page. (still better if you know it by heart). Note it down.

6] This is the best part..Open the VNC Viewer for Android application now on your android phone, and follow these steps

config

(Image Courtesy –x)

Add a ‘Nickname’  - This is only to identify your connection.

Add the password of your VNC Server (Step 3)

Add the IP address of your VNC Server (Step 5)

config2

(Image Courtesy –x)

Choose a Color Format ( If you are on WIFI, Choose the 24-bit Color, If you are on 3G Select a lower color depth for performance )

This should be enough to get you started. Press the ‘Connect’ button, Wait for handshake  (default of 10 seconds) and authentication from your VNC Server and Voila, You’re done!!

Fore more, you can dig here.

Enjoy Remoting from you phone !, and if this helped you configure your device, post a comment below! Smile

Windows Live Writer 2011

Yes, I am using the new windows live writer 2011. I don’t particularly like the year part in this software, don’t know why..2011 sounds like a strange figure to me, Strange for Microsoft software!. Visual Studio 2010, Office 2010, SharePoint 2010…………………you know what i mean ??, Anyhow, I like this version of the live writer and it has a bunch of improvements around UI and bits of bobs of functionality. Until later version, I’ll definitely be using Live Writer!

Friday, 5 November 2010

Enter the Cloud!

I’m migrating some of my test web applications a.k.a simple concept web apps to the windows cloud, a.k.a ‘The Windows Azure Platform’. I'm all excited to share my experiences with Windows Azure, SQL Azure and App Fabric.

I encourage you to download the Training Kit from Microsoft and give it a go.

The tools you might need to get started are

Either

1] Windows Azure Tools for Visual Studio

or  Install Visual Web Developer 2010 Express.

or if you have another development language (Java,PHP,Ruby), try

2] This

JS Trick

Ever wondered how to close that damn browser window without getting a warning from the browser ?.

Well, I've gone through that many a times before when trying to close a window(subject)  from either the main window or any other window which did not create the subject.

and…and i remember the solution, which i had devised for IE. (not sure about other browsers and I'll leave that for you ).

You have to remember, the window.open method creates a reference to the window.opener ??    (Hint, Hint! )

function CloseWindow(){

//removes the previous window.opener reference and

//tricks the browser not to display the annoying warning message.

window.opener = ‘fake’;

window.close();

}

Winking smile

Thursday, 23 September 2010

Tip of the day – A good use of auto implemented properties.

A very practical use of auto implemented properties could be to create a immutable lightweight class. An auto implemented property is a ‘property’ in C# without fields. The C# JIT Compiler generates the IL with a field for the auto implemented properties. (hence the name). The IL also replaces the Get and Set accessor stubs in the Properties to return and set the automatically generated field.

Take a look at the below code ( class ‘Books’). There are Title, Author and PublshedYear auto implemented properties. Notice the set is private, This makes the ‘Books’ class immutable.

autoprop

The tip is to use this kind of construct to replace structs when ever a reference type is required. Also notice that the constructor is made ‘private’. Simply because i find the factory method ‘CreateBook’  semantically appealing to call the private constructor rather than having to use the auto implemented property directly in the constructor for initializing the Books object.

Take a look at the IL for Books.,  Notice the ‘k__BackingField’ feild generated by the C# Compiler.

image

//////////////get_Author: string() IL////////////////////

.method public hidebysig specialname instance string
        get_Author() cil managed
{
  .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
  // Code size       11 (0xb)
  .maxstack  1
  .locals init (string V_0)
  IL_0000:  ldarg.0
  IL_0001:  ldfld      string ConsoleApplication1.Books::'<Author>k__BackingField'
  IL_0006:  stloc.0
  IL_0007:  br.s       IL_0009
  IL_0009:  ldloc.0
  IL_000a:  ret
} // end of method Books::get_Author

 

//////////////////set_Author:void(string) IL////////////////

.method private hidebysig specialname instance void
        set_Author(string 'value') cil managed
{
  .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
  // Code size       8 (0x8)
  .maxstack  8
  IL_0000:  ldarg.0
  IL_0001:  ldarg.1
  IL_0002:  stfld      string ConsoleApplication1.Books::'<Author>k__BackingField'
  IL_0007:  ret
} // end of method Books::set_Author

Now, a demo of using the above immutable lightweight class

democode

Happy patterns discovery..

I’ve used the MSDN example here to illustrate.