Tuesday 17 January 2012

Get Mouse Pointer Position

Get the mouse pointer position by Imports System.Windows.Forms
and assign the Cursor.Position.ToString() to any control you wish to :)

Thursday 12 January 2012

GIT User error after re-installing windows

if you have reinstalled your computer and found after GIT setup first publish that your username is showing as unknown you might need the following steps to correct the issue.

Did you try to set the user name with the following commands:
// global settings
$ git config --global user.name "FirstName LastName"
$ git config --global user.email "user@example.com"
or
// for a specific project
$ git config user.name "FirstName LastName"
$ git config user.email "user@example.com"

Edit: global settings are stored in the folder designated by the HOME environment variables, which should be unique for each Windows user, so you will have real data about the logged in user.

Git Host Key Verification Failed Error

if you re-formatted your computer like me and faced errors with GIT, you might need the following steps to setup the ssh key again.

1. Set your global settings first:
git config—global user.name “Your Name”
git config—global user.email “email@email.com
Your email address must be same as in Assembla

2. Generating a new key:
ssh-keygen -t rsa -C “name@email.com
Do not give it a filename. Just hit enter.
Creates a public and private key. Will ask for passphrase but you don’t need one. Just hit enter.

3. In Windows, the key will appear at C:\Users\name\.ssh on default
Copy public key (rsa_id.pub) into your Profile on Assembla
Best way to do this is to open it in Notepad and save it as rsa_id.txt without making any changes. Then upload it to your profile.

Wednesday 4 January 2012

Validate Email using RegEx

Dim regex As New
System.Text.RegularExpressions.Regex("^[\w-\.]+@([\w-]+\.)+[\w-]{2,3}$")
Dim match As System.Text.RegularExpressions.Match
match = regex.Match(myEmail)

If Not match.Success Then
ErrorMsg = ErrorMsg & "Email Not Valid"
End If