Google Maps GeoCoder API returns code 602

21. July 2008

 

I spent a few hours today figuring out why the Google GeoCoder API was returning the error code “602” ( G_GEO_UNAVAILABLE_ADDRESS ) for an address in Clinton Township Michigan, but finds the address on the Google Maps page.

 

From what I gather from researching this issue is that Google possibly uses 2 different sets of data for Geocoding. One for their own use on Google Maps and another for their Google Maps API.

One solution that I discovered while testing data against their API was to check the Status code for a “602” error and then resubmit the information while leaving out the City information. This resulted in the API getting the Latitude and Longitude for the address.

 

Hopefully this will work for all addresses that return this error until Google updates this 2nd set of data or uses the same data source for both.

Google Maps

How I Got Started in Software Development

12. July 2008

 

How old were you when you started programming?

I started programming when I was 12 years old. My father had many programing books and I started reading them and doing all the exercises. This was all on a very slow x286 computer running DOS with a very colorful 4 color monitor.

 

How did you get started in programming?

As stated above I started learning from books my father had at a young age. All of the programs I made at this time were all written in BASIC. I don’t remember any of the books or programs I've made at this age except one.

More BASIC Computer Games
Edited by David H. Ahl, published 1979

 

An archive of this book can be found here http://www.atariarchives.org/morebasicgames/

 

What was your first language?

My first language was BASIC.

 
What was the first real program you wrote?

I cant consider any programs I made from programming books, any additions I made to them or the AOL Progs I made when I was in High School a real program. I cant consider any program I made in college a “Real"” program either.

Im going to have to say its the T2D Animation Datablock Editor I made for the Torque Game Builder Pro 2D from GarageGames.

 

Image1 Image2 Image3

 

It was a tool that took an image map and let you drag and drop it in the story board to create an animation for use in the game engine.

I used to have a movie of this in action but lost it to a hard drive crash and have long since deleted backups of my old web site.

After getting a job at Web Solutions I did not have the time to continue work on this editor and donated the code and rights to Garage Games.

They have integrated it into their game engine and improved upon greatly resulting in this.\

 

TorqueGameBuilderAnimationEditor1 TorqueGameBuilderAnimationEditor2

 

What languages have you used since you started programming?

I have used Actionscript, ASP, Assembly, Basic, C, C++, C#, Java, Javascript, PERL,  PHP, Visual Basic, VB.Net and a few more i cant even think of right now.

 

What was your first professional programming gig?

I’m still employed at my first gig. I started working at Web Solutions in Sept of 05.

 

If you knew then what you know now, would you have started programming?

Oh Yes! I may have done things differently though.

I’ve always wanted to do game development and put a lot of time into that. I found that doing Web and Application programming was more satisfying for me so I may have put more time into learning that even though the end results are not as fun.

 

If there is one thing you learned along the way that you would tell new developers, what would it be? 

"A scientist builds in order to learn;
an engineer learns in order to build."

-Fred Brooks

 

I would tell them that they should be careful on what they study in college. Many students who want to get into computer programming take many useless Computer Science courses.

If your goal is to build applications take as many Computer Engineering classes as you can.

Instead of going on about this. This article can explain it much better than I could.

Software Engineering is Not Computer Science

 

What's the most fun you've ever had ... programming?

Oh God, now this is the part where most people would not understand unless they are a code geek like me. I always have fun programming, well… unless I have to maintain software that was written horribly or that was written in an obsolete language.

About Me

HTML Superscripts and Subscripts messes up line height

25. May 2008

I was recently updating a clients site by adding in some ® symbols as superscripts and subscripts. This resulted in some pretty nasty line heights as you can see below.

 

Lorem ipsum dolor sit amet, consectetuer adipiscing elit®. Aenean ac orci in neque consectetuer viverra.® In eu tellus ut felis posuere sollicitudin. Nunc id lectus. Fusce quis turpis. Praesent egestas nunc sit amet lorem. Aliquam erat volutpat. Ut felis leo, lacinia molestie, molestie vitae, porttitor et, dolor. Quisque diam erat, rutrum non, cursus at, tempus in, libero. Maecenas dignissim dolor ut nibh. Suspendisse rutrum aliquet felis. Vivamus mi. Donec aliquam imperdiet mauris.

 

I searched on Google and found a few methods to correct this issue. They worked fine in Firefox but not in IE 6 and sometimes 7.

After experimenting a bit, I found a way that corrects this issue with CSS and works in Firefox, Opera, Safari, IE 6 and 7.

 

Lorem ipsum dolor sit amet, consectetuer adipiscing elit®. Aenean ac orci in neque consectetuer viverra.® In eu tellus ut felis posuere sollicitudin. Nunc id lectus. Fusce quis turpis. Praesent egestas nunc sit amet lorem. Aliquam erat volutpat. Ut felis leo, lacinia molestie, molestie vitae, porttitor et, dolor. Quisque diam erat, rutrum non, cursus at, tempus in, libero. Maecenas dignissim dolor ut nibh. Suspendisse rutrum aliquet felis. Vivamus mi. Donec aliquam imperdiet mauris.

 

 

sup
{

    vertical-align: baseline;
    font-size: 0.8em;
    position: relative;
    top: -0.4em;
}

sub
{
    vertical-align: baseline;
    font-size: 0.8em;
    position: relative;
    bottom: -0.4em;
}

 

Just adjust the position and font size to suit your taste.

CSS

ASP.NET Flash Remoting

9. May 2008

If you are looking for information on a free ASP.NET Flash Remoting Solution you have come to the right place.

The Midnight Coders have a product called WebORB® that will meet all of your remoting , real-time messaging (RTMP) and Flex Data Services (AMF0 and AMF3, Data Management, Flex Messaging (pub/sub, push)) needs.

I have used this product's Flash Remotings features extensively on one of my clients sites and I highly recommend it to anyone looking for a Flash Remoting Solution even if they are not doing development in ASP.NET.  WebORB® also comes in Java, Ruby On Rails and PHP versions.

 

Installation

Installing WebORB® is extremely easy. Just copy its assemblies to your bin folder, copy a few files and folders to your web applications root directory and give a few of them write permissions. The final step is updating your web.config file with its HTTP Handlers.

If you install WebORB® on your server, you have the option of automatically deploying to to a virtual directory.  There seems to be 1 downfall, it appears that it can only be automatically installed to virtual directorys of your default web site. If you are on a server that is hosting multiple web sites, you should just do the manual install.

Using WebORB

One of WebORB's best abilities is that it will parse your Web Applications Assemblies and generate Action Script code for use in your flash movie or JavaScript for your AJAX functions. It can generate code in a variety of formats and styles: Flex Remoting / AS3, Flash Remoting / AS2, ARP Framework / AS2 or AS3, Cairngorm Framework, FlashComm / FMS2, AJAX Client and PureMVC.  It will generate code for anything that your functions  in your assembly returns. Objects, DataSets, strings  etc.

 

WebOrb

ASP.NET, Flash Remoting ,

ASP.NET Persistent Checkbox State in a GridView With Data Paging.

9. March 2008

One major downsides of using a checkbox in a GridView control to handle mass updates and deletes is that the state of the checkboxs will be lost when going to another page.

To work around this were going to have to write some code to save and load the state of the checkboxes.

You can download the files below.

 

 

The 1st thing we want to do is set up our GridView and a DataSource.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Grid View Check Box Example</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:GridView ID="Gridview1" OnDataBound="Gridview1_OnDataBound" runat="server" Width="100%" OnPageIndexChanging="Gridview1_PageIndexChanging" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="recordID" DataSourceID="AccessDataSource1">
                <Columns>
                    <asp:BoundField DataField="recordID" HeaderText="recordID" InsertVisible="False" ReadOnly="True" SortExpression="recordID" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="chkPerson" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="firstName" HeaderText="firstName" SortExpression="firstName" />
                    <asp:BoundField DataField="lastName" HeaderText="lastName" SortExpression="lastName" />
                </Columns>
                <HeaderStyle HorizontalAlign="Left" />
            </asp:GridView>
            <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/gridviewCheckbox.mdb" SelectCommand="SELECT [recordID], [firstName], [lastName] FROM [record]"></asp:AccessDataSource>
            <br />
            <br />
            <asp:Button ID="bttnMassUpdate" runat="server" OnClick="bttnMassUpdate_Click" Text="Mass Update" /><br />
        </div>
    </form>
</body>
</html>

 

For those of you who are unfamiliar with grid views, The DataKeyNames property is set to the PrimaryKey column of your datasource and in this example its the recordID column.

The OnDataBound and OnPageIndexChanging properties are set to the name of the functions I created that I want called when these events are fired.

 

I used a AccessDataSource for this example because It would allow anyone to download and run this example without the need to install a SQL server.

The data in this Access Database was generated with http://www.generatedata.com/.

 

Now since we have our aspx page setup we need to choose a data structure that can hold the primary key for each select row. I chose a List for this task.

protected void Page_Load(object sender, EventArgs e)
   {
       if (!Page.IsPostBack)
       {
           List<int> list = new List<int>();
           Session["gridSave"] = list;
       }
   }

 

Now when we go to another page we need a way to store the primary key of each row that has been selected and to also remove any key that has been unselected.

private void saveValues()
{
    List<int> list = (List<int>)Session["gridSave"];
 
    foreach (GridViewRow row in Gridview1.Rows)
    {
        int id = (int)Gridview1.DataKeys[row.RowIndex].Value;
        bool chk = ((CheckBox)row.FindControl("chkPerson")).Checked;
 
        if (chk)
        {
            //see if we have a id added already
            if (list.Contains(id) == false)
            {
                list.Add(id);
            }
        }
        else
        {
            if (list.Contains(id))
            {
                list.Remove(id);
            }
        }
    }
 
    Session["gridSave"] = list;
}

 

Everytime we go to a new page we will also have to see if any checkboxes need to be checked

private void loadValues()
{
    List<int> list = (List<int>)Session["gridSave"];
 
    foreach (GridViewRow row in Gridview1.Rows)
    {
        int id = (int)Gridview1.DataKeys[row.RowIndex].Value;
        if (list.Contains(id))
        {
            CheckBox chkPerson = (CheckBox)row.FindControl("chkPerson");
            chkPerson.Checked = true;
        }
    }
}

 

The above functions are called from the GridViews PageIndexChanging and OnDataBound Events.

protected void Gridview1_PageIndexChanging(object sender, GridViewPageEventArgs e)
   {
       saveValues();
       Gridview1.PageIndex = e.NewPageIndex;
   }
 
   protected void Gridview1_OnDataBound(object sender, EventArgs e)
   {
       loadValues();
   }

ASP.NET, Generics, GridView , ,