I was watching Germany v/s Australia on my TV and my 3 yr old son asked me " Daddy what is this." I told him that this is a game of Soccer.
He said "OK" and started watching the game.
After a few minutes he said " Daddy, this is a game of soccer .. because they are kicking the balls with their socks".
I realized that it really appears as if they are kicking the ball with their socks.
I could not be more surprised and happy to listen to his explanation of the meaning of the word Soccer.
I got a creative genius at home :)
Abinaw's Blog
Wednesday, June 16, 2010
Thursday, May 28, 2009
Signature panel
We can create a signature panel using Visual Studio and MouseMove, MouseDown and MouseUp events of any control.
// Code ***********************
Bitmap bitimage;
Graphics graphSignature;
Point pnt;
Point prepnt;
Graphics gSignature;
bool mousedownclicked = false;
public Form1()
{
InitializeComponent();
bitimage = new Bitmap(this.Width, this.Height);
graphSignature = Graphics.FromImage(bitimage);
gSignature = this.CreateGraphics();
// create a white background
gSignature.Clear(Color.White);
graphSignature.Clear(Color.White);
}
private void MouseMoveForm(object sender, MouseEventArgs e){
gSignature.DrawLine(new Pen(Color.Red, 5.0F), prepnt, new Point(e.X, e.Y));// For display
graphSignature.DrawLine(new Pen(Color.Red, 5.0F), prepnt, new Point(e.X, e.Y));// For saving
prepnt.X = e.X;
prepnt.Y = e.Y;
}
private void MouseDownForm(object sender, MouseEventArgs e)
{
mousedownclicked = true;
pnt.X = e.X;
pnt.Y = e.Y;
prepnt.X = e.X;
prepnt.Y = e.Y;
}
private void MouseUpForm(object sender, MouseEventArgs e)
{
mousedownclicked = false;
}
//Code END ******************
-Abinaw
// Code ***********************
Bitmap bitimage;
Graphics graphSignature;
Point pnt;
Point prepnt;
Graphics gSignature;
bool mousedownclicked = false;
public Form1()
{
InitializeComponent();
bitimage = new Bitmap(this.Width, this.Height);
graphSignature = Graphics.FromImage(bitimage);
gSignature = this.CreateGraphics();
// create a white background
gSignature.Clear(Color.White);
graphSignature.Clear(Color.White);
}
private void MouseMoveForm(object sender, MouseEventArgs e){
gSignature.DrawLine(new Pen(Color.Red, 5.0F), prepnt, new Point(e.X, e.Y));// For display
graphSignature.DrawLine(new Pen(Color.Red, 5.0F), prepnt, new Point(e.X, e.Y));// For saving
prepnt.X = e.X;
prepnt.Y = e.Y;
}
private void MouseDownForm(object sender, MouseEventArgs e)
{
mousedownclicked = true;
pnt.X = e.X;
pnt.Y = e.Y;
prepnt.X = e.X;
prepnt.Y = e.Y;
}
private void MouseUpForm(object sender, MouseEventArgs e)
{
mousedownclicked = false;
}
//Code END ******************
-Abinaw
Tuesday, May 19, 2009
How to find out your location on a laptop?
We can use RIL_Initialize, RIL_GetCellTowerInfo, RIL_GetCellTowerInfo, RIL_Hangup, RIL_Deinitialize of the windows CE to find out our own location in the longitude and latitude forms. This information then can be used with Google MAP APIs to get the exect graphical view with the street and city.
-abhinaw
-abhinaw
Friday, May 15, 2009
Google Static Map API
Google released APIs for static map sometimes ago.
see this url:http://code.google.com/apis/maps/documentation/staticmaps/#Latlons
I noticed that the the example given in the "A Quick Example " section does not have the correct url.If you use the url given in the example then you will not get the markers in the map.
The correct url is:
http://maps.google.com/staticmap?center=40.714728,-73.998672&zoom=14&size=512x512&maptype=mobile\&markers=40.702147,-74.015794,blues|40.711614,-74.012318,greeng|40.718217,-73.998284,redc&key=MAPS_API_KEY&sensor=false
The difference is the "\" before &key. remove that slash(/) and you will get the correct url which will show markers in proper color.
-Abhinaw
see this url:http://code.google.com/apis/maps/documentation/staticmaps/#Latlons
I noticed that the the example given in the "A Quick Example " section does not have the correct url.If you use the url given in the example then you will not get the markers in the map.
The correct url is:
http://maps.google.com/staticmap?center=40.714728,-73.998672&zoom=14&size=512x512&maptype=mobile\&markers=40.702147,-74.015794,blues|40.711614,-74.012318,greeng|40.718217,-73.998284,redc&key=MAPS_API_KEY&sensor=false
The difference is the "\" before &key. remove that slash(/) and you will get the correct url which will show markers in proper color.
-Abhinaw
Monday, May 11, 2009
conversion from VB6 to Visual Studio .NET 2008
.NET has much more power than VB6 and this provides a very good reason to convert the existing VB6 projects to VS 2008 .NET .
Start with opening Visual Studio 2008 IDE.
open the existing VB6 vbp file. The converiosn wizard will guide you through the steps to convert all the VB6 files to the .NET files. It will also create a report and a back up folder in case you want to revert back to the old version.
If Microsoft.Sqlserver.MSXML6 was used in VB6 code then it will give compilation error in the .NET. you can replace it with System.NET namespace and use the HttpWebRequest class.
Dim oHTTP As System.Net.HttpWebRequest ( this is a replacement for Dim oHTTP As Microsoft.SqlServer.MSXML6.ServerXMLHTTP in the Vb6 code).
Morr posts will follow on this article.
Thanks
-Abhinaw
Start with opening Visual Studio 2008 IDE.
open the existing VB6 vbp file. The converiosn wizard will guide you through the steps to convert all the VB6 files to the .NET files. It will also create a report and a back up folder in case you want to revert back to the old version.
If Microsoft.Sqlserver.MSXML6 was used in VB6 code then it will give compilation error in the .NET. you can replace it with System.NET namespace and use the HttpWebRequest class.
Dim oHTTP As System.Net.HttpWebRequest ( this is a replacement for Dim oHTTP As Microsoft.SqlServer.MSXML6.ServerXMLHTTP in the Vb6 code).
Morr posts will follow on this article.
Thanks
-Abhinaw
Friday, May 8, 2009
TraceListeners in .NET
Trace object in .NET has a default trace listener and out put to this default trace listener can be viewed by using debugview utility from Microsoft ( sysinternals). It is also possible to direct the out put from Trace object to any other listener. Listener means any text file or Console or even log where we can write some text messages.
//Following line will create a text file ( MyLogs.txt ) in the same directory where the application //is running.
private static System.Diagnostics.TextWriterTraceListener TL = new TextWriterTraceListener(Environment.CurrentDirectory + "\\MyLogs.txt");
//Add this listener to the Trace object
Trace.Listeners.Add(TL);
//Write information to the txt file
Trace.WriteLine("Some Informational Message here");
This is a powerful technique to write logs to a specified txt file. The TL switch can be used to set the Trace level and also to enable or disable the trace.
- Abhinaw
//Following line will create a text file ( MyLogs.txt ) in the same directory where the application //is running.
private static System.Diagnostics.TextWriterTraceListener TL = new TextWriterTraceListener(Environment.CurrentDirectory + "\\MyLogs.txt");
//Add this listener to the Trace object
Trace.Listeners.Add(TL);
//Write information to the txt file
Trace.WriteLine("Some Informational Message here");
This is a powerful technique to write logs to a specified txt file. The TL switch can be used to set the Trace level and also to enable or disable the trace.
- Abhinaw
Wednesday, May 6, 2009
Microsoft F#
F# is a new language by Microsoft.
F# is a functional programming language built on .NET framework. It uses WPF and WCF libraries and provides a very easy yet powerful interface for rapid development.
You can download F# latest release (v1.9.6.0) at:
http://www.microsoft.com/downloads/details.aspx?FamilyID=61ad6924-93ad-48dc-8c67-60f7e7803d3c&displaylang=en
#light and let are the two very important key words of F# language.
There is a very informative introductory video on Microsoft website.
check the video here
http://channel9.msdn.com/pdc2008/TL11/
I will post more about F# as I develop projects based on F#.
-Abinaw
F# is a functional programming language built on .NET framework. It uses WPF and WCF libraries and provides a very easy yet powerful interface for rapid development.
You can download F# latest release (v1.9.6.0) at:
http://www.microsoft.com/downloads/details.aspx?FamilyID=61ad6924-93ad-48dc-8c67-60f7e7803d3c&displaylang=en
#light and let are the two very important key words of F# language.
There is a very informative introductory video on Microsoft website.
check the video here
http://channel9.msdn.com/pdc2008/TL11/
I will post more about F# as I develop projects based on F#.
-Abinaw
Subscribe to:
Posts (Atom)