Wednesday, September 28, 2005

A Gift..........

A Gift . . .

What have I done,
to deserve this gift I've received..?
It is a gift without comparison,
that is more precious to me than can be believed.

I don't know why I've been blessed,
with such a heavenly gift.
And if this is truly a dream,
then I never want this sleep to lift.

Why you chose to give me this gift,
is more than I can see.
But in return I promise,
that you will never lose me.

I will stay by you always;
never letting you fall.
And if you are ever in danger,
I will defend you until I fall.

For you are a gift,
that I hope never to lose.
And for as long as I live I'll know,
no gift in this world deserves to be cherished more than you . . .

Tuesday, September 27, 2005

Moving or deleting the ViewState from the page

' This method overrides the Render() method for the page and moves the viewstate ' from its default location at the top of the page to the bottom of the page.
This ' results in better search engine spidering. '

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim stringWriter As System.IO.StringWriter = New System.IO.StringWriter
Dim htmlWriter As HtmlTextWriter = New HtmlTextWriter(stringWriter)
MyBase.Render(htmlWriter)
Dim html As String = stringWriter.ToString()
Dim StartPoint As integer = html.indexOf("
("Dim EndPoint As integer = html.indexOf("/>", StartPoint) + 2
Dim viewstateinput As String = html.Substring(StartPoint, EndPoint - StartPoint)
html = html.Remove(StartPoint, EndPoint - StartPoint)
Dim FormEndStart As integer = html.indexOf("") - 1
If FormEndStart >= 0
Then html = html.insert(FormEndStart, viewstateinput)
End If
End If
writer.Write(html)
End Sub

Wednesday, September 14, 2005

Unwritten Laws - But very true.

Law of Mechanical Repair:
After your hands become coated with grease, your nose will begin to itch.

Law of the Telephone:
When you dial a wrong number,you never get an engaged one.

Law of the Alibi:
If you tell the boss you were late for work because you had a flat tire, the next morning you will have a flat tire.

Variation Law:
If you change queues, the one you have left will start to move faster than the one you are in now.

Bath THEOREM
When the body is immersed in water , the telephone rings.

LAW OF CLOSE ENCOUNTERS The probability of meeting someone you know increases when you are with someone you don't want to be seen with.

LAW of the RESULT
When you try to prove to someone that a machine won't work, it will.

LAW OF BIOMECHANICS
The severity of the itch is inversely proportional to the reach.

THEATRE RULE At any event, the people whose seats are furthest from the aisle arrive last.

LAW OF COFFEE
As soon as you sit down to a cup of hot coffee, your boss will ask you to do something which will last until the coffee is cold.

Tuesday, September 06, 2005

Doing Interop with Win32 APIs in DotNet

PINVOKE.NET attempts to address the difficulty of calling Win32 or other unmanaged APIs in managed code (languages such as C# and VB .NET). Manually defining and using PInvoke signatures (also known as Declare statements in VB) is an error-prone process that can introduce extremely subtle bugs. The rules are complex, and if you make a mistake, you’ll probably corrupt memory.
Therefore, this site is a repository where you can find, edit, and add PInvoke signatures, user-defined types, and any other information that helps us leverage each other's efforts. Think of this as the 21st century version of VB6's "API Text Viewer," a standalone application which used static files such as WIN32API.TXT as input. Did you spend hours figuring out how to successfully define & call a given unmanaged API in managed code? Share (and get credit for) your discovery here! Is there an error on this site? Go ahead and fix it!