Saturday, August 8, 2009

Use thunderbird to Transfer gmail email

I recently made the decision to switch from one gmail account to another. The former was created in college and was more for fun than future use. The second one I created is more appropriately named and professionally sounding. Anyhow, I wanted to transfer all email from one gmail account to the next. There was not a clearly defined way to do this, so I had to hunt around the interwebs to find a solution for myself. Here are the steps I took:
  1. Enable IMAP in both your old and new gmail email accounts.
  2. Download Thunderbird.
  3. Add your old gmail email account to Thunderbird with IMAP protocol options.
  4. Add your new gmail email account to Thunderbird.
  5. In your old gmail email account, expand the [Gmail] folder to view the IMAP folders for your gmail account.
  6. Select the email messages you want to copy to your new gmail account.
  7. Right Click >> Copy To >> new gmail account >> [Gmail] >> whatever location you want the email to be copied to (Inbox, Sent, All Mail)
Let Thunderbird work it's magic. Depending on how many messages you are copying and their size, it can take a while. Thunderbird will download the entire message locally and then copy it to the destination. Hope this helps! -Dave

Friday, August 7, 2009

Running Robot

Check out this cool link for the new Toyota Running Robot (smart-machines blog)

Thursday, August 6, 2009

DataItem Dag-Nabbit!

Recently I was faced with the issue of trying to get multiple data columns from a DataGrid row during the event raised from a link button inside of a TemplatedColumn. When the link button was clicked, I was not able to access the selected item's DataItem. I had to find a work around. Microsoft does not allow access to the selected item's DataItem except during runtime using reflection. But, I needed to access the data item somehow so I created a workaround. Here is my original code:


                    
                        
                            
                                
                            
                        
                        other column 1
                        other column 2
                        other column 3
                     


protected void cmdUpdateContractID_Command(object sender, CommandEventArgs e)
        {
            DateTime RunDate = Convert.ToDateTime(e.CommandArgument.ToString());
            String RunSeq = e.CommandName.ToString();
        }

I wanted to be able to access the data from the other BoundColumns. So, I used an expression on my aspx page, and a custom method in the code behind to get around the DataItem lifecycle issue:


                    
                        
                            
                                
                            
                        
                        other column 1
                        other column 2
                        other column 3
                     


protected string GenerateArgString(object dataItem)
        {
            StringBuilder args = new StringBuilder();
            args.AppendFormat("{0}|", 
                 Convert.ToString(DataBinder.Eval(dataItem, "FIELD_1")));
            args.AppendFormat("{0}|", 
                 Convert.ToString(DataBinder.Eval(dataItem, "FIELD_2")));
            args.AppendFormat("{0}|", 
                 Convert.ToString(DataBinder.Eval(dataItem, "FIELD_3")));
            args.AppendFormat("{0}|", 
                 Convert.ToString(DataBinder.Eval(dataItem, "FIELD_4")));

            return args.ToString();
        }

You can see that I added the CommandArgument attribute to my Linkbutton, which in turn allowed me to generate a string of pipe delimited values from the selected item's DataItem. The expression calls the GenerateArgString method, which evaluates the DataItem using DataBinder.Eval method to retrieve information by column name.