RSS

Category Archives: General

T-Shirts for Software people

1

3

4

5

6

7

8

 
Leave a comment

Posted by on March 6, 2009 in General

 

Tags: , , , , , , , , , , , , ,

New Camera

I got a new camera it is Canon EOS 450D

Canon 450D  

Check this for more information about it

  3 Ducks Reflection Colors Flower Cross Processing  Effect mmalaka. Get yours at bighugelabs.com/flickr

 
Leave a comment

Posted by on December 31, 2008 in General

 

Tags: , , , , , , , ,

Firefox 2.0 – InnerHTML issue

Sorry about the long time between posts. Hope to start posting again soon

 

Anyhow,

 

I was working on a web application that is updating the details of a <map> HTML element using the innerHTML, the new innerHTML value is being processed in the server side using AJAX function

 

I was using the following JavaScript function to do that

 

function jvUpdateImageMap(ImageMapHTML) 

{

    try

    {

          document.getElementById(“MyImageMap”).innerHTML= ImageMapHTML;

           

     }

catch(err)

          {

          }

          finally

          {

          }

}

 

That was working fine for all the browser including Firefox 3.0 but not for Firefox 2.0

 

After debugging this I found that for FireFox 3.0 the result of updating the InnerHTML is this

 

  <map id=”MyImageMap” >

          <area SHAPE=”rect” id=”0_30″ usemap=”MyImageMap” Border=”0″ href=”#” COORDS=”538,420,550,408″ />

 </map>

 

 

This is the correct expected result

 

But for FIreFox 2.0 the result was this

 

<map id=”MyImageMap” >

<map id=”MyImageMap” >

          <area SHAPE=”rect” id=”0_30″ usemap=”MyImageMap” Border=”0″ href=”#” COORDS=”538,420,550,408″ />

</map>

</map>

 

 

So to fix this I had to add those lines to the server side function that generate the new <map> HTML code  

If Context.Request.Browser.Browser = “Firefox” Then

       If Context.Request.Browser.MajorVersion = “2” Then

               ImageMapHTML = ImageMapHTML.Replace(“<map id=””MyImageMap”” >”, “”)

                ImageMapHTML = ImageMapHTML.Replace(“</map>”, “”)

        End If

End If

 

 
Leave a comment

Posted by on December 4, 2008 in General, Photography

 

Tags: , , , , , , , , , , , , , , , , ,

Geogrpahy of Women

Between the ages of 15 – 20 a woman is like Africa.
She is half discovered, half wild.

 

 

 

Between the ages of 20 – 30 a woman is like America.
Fully discovered and scientifically perfect.

 

 

  

Between the ages of 30 – 35, she is like India & Japan.
Very hot, wise and beautiful!!!!!!!!!

 

 

  

Between the ages of 35 – 40 a woman is like France.
She is half destroyed after the war but still desirable.

 

 

  

Between the ages of 40 – 50 she is like Germany.
She lost the war but not the hope.

 

 

  

Between the ages of 50 – 60 she is like Russia.
Very wide, very quiet but nobody goes there.

 

 

  

Between the ages of 60 – 70 a woman is like England.
With a glorious past but no future.

 

 

 

After 70, they become Siberia.
Everyone knows where it is, but no one wants to go there.

 

 
Leave a comment

Posted by on October 24, 2008 in General

 

Tags: , , , , , , , , , , , , , , , ,

Getting the Table Name of a field in a View (SQL2000, C#)

So I have a View that join different tables, I wanted to get the Table name of a Field in the View. So I created a Function [GetTableName] with the following Inputs

 

         View Name

         Connection String of the View.

         The required Field Name

 

This is the function

 

public string GetTableName (string ViewName, string ConnString, string FieldName)

        {

            SqlConnection MyConnection;

            string toReturn = ViewName;

 

            MyConnection = new SqlConnection(ConnString);

            MyConnection.Open();

 

            DataTable MyTable = MyConnection.GetSchema(“Views”);

            foreach (DataRow dRow in MyTable.Rows)

            {

                object[] sqlArray = dRow.ItemArray;

                if (sqlArray.GetValue(2).ToString() == ViewName)

                {

                    DataTable MyVTable = MyConnection.GetSchema(“ViewColumns”);

                    foreach (DataRow dVRow in MyVTable.Rows)

                    {

                        object[] sqlVArray = dVRow.ItemArray;

                        if (sqlVArray.GetValue(2).ToString() == ViewName)

                        {

                            if (sqlVArray.GetValue(6).ToString() == FieldName)

                            {

                                toReturn = sqlVArray[5].ToString();

                            }

                        }

 

 

                    }

 

                }

            }

           

            return toReturn;

        }

 

 

 

 
Leave a comment

Posted by on October 10, 2008 in General, Photography

 

Tags: , , , , , , , , , , , , , ,

Using PageMethods/WebMethods to update Sessions variable

I created functions for updateing/reading sessions variables using PageMthods and WebMethods, I am using VS2005 (VB.NET):

 

Import the web.services library

  Imports System.Web.Services 

 

This is the VB.NET function for setting the session variables

           <WebMethod()> _

Public Shared Function AjaxSetSession(ByVal SessionValue As String)

                    Try

                             HttpContext.Current.Session(“SessionKey”) = SessionValue

                   Catch ex As Exception

 

                   End Try

          End Function

 To access the session we need to use HttpContext.Current.Session

 

This is the VB.NET function for getting the session variables

       <WebMethod()> _

          Public Shared Function AjaxGetSession() As String

                    Try

                             AjaxGetSession = HttpContext.Current.Session(“SessionKey”)

                    Catch ex As Exception

                             AjaxGetSession = “Error”

                    End Try

    End Function

 

This is the JavaScript Code to set the session variable

 

PageMethods.AjaxSetSession(“PageMethods”,”WebMethods”)

This the JavaScript Code to read the Session Variables

 

PageMethods.AjaxGetSession(JSGetSessionSucess,JSGetSessionFaild);

 

JSGetSessionSucess is a JavaScript function that would be executed if the AjaxGetSession succeeded

 

       function JSGetSessionSucess(value, methodName)

      {

               try

              {

                        alert(value);

                }

catch(err)

               {

               }

               finally

               {

              }

      }

 

JSGetSessionFaild is a JavaScript function that would be executed if the AjaxGetSession failed

        function JSGetSessionFaild (ex, methodName)

      {

               try

              {

                        alert(ex.get_exceptionType());

                }

catch(err)

               {

               }

               finally

               {

              }

      }

 

 
Leave a comment

Posted by on October 8, 2008 in General, Photography

 

Tags: , , , , , , , , , , , , , ,

Blonde Joke








 
Leave a comment

Posted by on October 7, 2008 in General

 

Tags: , , , , , , , , , , , , , , , , , , , , , ,

World Of Romance Game

In the world of romance, one single rule applies to men:

 

Make the woman happy. Do something she likes and you get points.Do something she dislikes and points are subtracted. You don’t get any points for doing something she expects.Sorry, that’s the way the game is played.


Here is a guide to the point system:


SIMPLE DUTIES

 

You make the bed (+1)
You make the bed, but forget the decorative pillow (0)
You throw the bedspread over rumpled sheets (-1)
You go out to buy her what she wants (+5) In the rain (+8) But return with Beer (-5)
You check out a suspicious noise at night (0)
You check out a suspicious noise, and it is nothing (0)
You check out a suspicious noise and it is something (+5)
You pummel it with iron rod (+10)
It’s her pet (-10)


SOCIAL ENGAGEMENTS

 

You stay by her side the entire party (0)
You stay by her side for a while, then leave to chat with a college buddy (-2)
Named Rita (-4)
Rita is a dancer (-6)
Rita is single and is really beautiful (-80)
HER BIRTHDAY
You forget her birthday (-50000)
You take her out to dinner (0)
You take her out to dinner and it’s not a sports bar (+1)
Okay, it’s a sports bar (-2)
And it’s all-you-can- eat night (-3)
It’s a sports bar, it’s all-you-can- eat night, and your face is painted the colours of your favourite team (-10)
A NIGHT OUT
You take her to a movie (+2)
You take her to a movie she likes (+4)
You take her to a movie you hate (+6)
You take her to a movie you like (-2)
It’s called ‘DeathCop’ (-3)
You lied and said it was a foreign film about orphans (-15)


ENJOY THE ‘BIG’ QUESTION

 

She asks, “Do I look fat?” (-5) [Yes, you LOSE points no matter WHAT]
You hesitate in responding (-10)
You reply, “Where?” (-35)
Any other response (-20)


COMMUNICATION

 

When she wants to talk about a problem , you listen, displaying what looks like a concerned expression (0)
You listen, for over 30 minutes (+50)
You listen for more than 30 minutes without looking at the TV (+500)
She realizes this is because you have fallen asleep (-10000)


Now what chance do you have???

 

 
Leave a comment

Posted by on September 24, 2008 in General

 

Tags: , , , , , , , , ,

Install multiple versions of IE on your PC

I was looking to test my web application on different browsers including different versions of IE, so I used the MultipleIEs installer from TredoSoft and it worked fine with me ….

 

MultipleIEs Installer

 

 

 
Leave a comment

Posted by on September 22, 2008 in General, Photography

 

Tags: , , , , , , , ,

Handling an Application Event in another application

I was working on a Console application that read SQL Database connection details from a configuration file then send these details to another application (Let us call it the Update Application) which will go through the records of a table to update them using a For Loop, I wanted to show a status message on the Console screen for each record.

 

In the Update Application (VB.NET) I defined a Public event to handle the status message

 

Public Event Message(ByVal sMessage As String)

In the update function I raised this event with the required message

For Each dbRow In DataSet.Tables(“DataTables”).Rows

 

      RaiseEvent Message(“Start Processing record of ID “  & dbRow (“ID”).ToString())

                    ‘Do the Update Here                          

      RaiseEvent Message(“End Processing record of ID “  & dbRow (“ID”).ToString())

 

Next

 

In the Console Application (C#) I defined a handler for the event

 

 

  using System;

  using System.IO;

  public delegate void UpdateAppMessageHandler(string myString);

 

 I defined the required function for the event handler

 

 

   internal class Program

    {

        UpdateAppMessageHandler MySEvent = new UpdateAppMessageHandler (ConsolAppMessageHandler);

 

        static   void  ConsolAppMessageHandler(string sMessage)

        {

            Console.WriteLine(sMessage);

        }

Now I need to assign the Update Application event to the event handler in the Console Application

 

  private static void Main(string[] args)

        {

            try

            {

                UpdateApp MyUpdateApp = null;

                MyUpdateApp = new UpdateApp ();

                MyUpdateApp.Message += ConsolAppMessageHandler; 

                       .

                       .

                       .

Now the Console Screen will show a message for Start/End processing of each record in the Database
 
 
Leave a comment

Posted by on September 17, 2008 in General, Photography

 

Tags: , , , , , , , , , , , ,

 
%d bloggers like this: