Unlocking your Verizon phone

May 8, 2012 at 4:09 pm (Personal)

I currently own a Verizon HTC Incredible 2 cell phone.

I’m happy with Verizon (they’re the only ones that have good signal inside my house). But when I go outside the USA (I go to Guatemala often), I want to be able to switch the SIM card to one that works with a local mobile service providers. Otherwise I would have to use roaming with Verizon and that is ridiculously expensive.

I gave Verizon a call and they quickly gave me the  ”unlock” code for me to enter in my phone. After entering the code, the phone was immediately unlocked! They only made me agree to a very obvious agreement that if I stick another SIM card in there I acknowledged that I was no longer using the Verizon service and Verizon could would not support me while I had that third party SIM card in my phone. But if I then switched back to my Verizon SIM card and ran my phone in CDMA (or Global) mode, I would be supported again.

And one more thing, Verizon uses CDMA. SIM cards are used for GSM. So I tried removing my Verizon SIM card from my phone and I was still able to get Verizon service. Nice to know.

I then stuck a SIM card from a friend that uses T-mobile and switched my Incredible’s mode to GSM, I could make and receive calls as him. Very cool.

Permalink Leave a Comment

Trying out backpack #2

April 7, 2012 at 8:59 am (Personal)

image

Trying out the second hiking backpack on a quick walk to see the daybreak ducks.

image

The first kelty backpack i bought was defective. But this brand makes way better packs than the competition so i stuck to that brand. So far the second pack looks good.

Permalink Leave a Comment

SQL query results into Excel

April 3, 2012 at 1:53 pm (Computer Science)

It is easy to pull data from a MS SQL table or view into excel, the UI is very straight forward for that. But that is not the case when you want a custom sql query to be the one pulling data from the database. 

To do this in Excel 2010, you need to first set up the connection to the database and then set up the query:

Setting up the connection

image

image

 

image

This is where you set the server location, login, AND the database you want to query:

image

Leave the default table empty:

image

Double click your newly created data source

image

Building the Query

The screenshot below pops up automatically when you double click the data source (see screenshot above). We don’t want to add any tables:

image

We want to use our hand written SQL:

image

Enter your SQL:

image

Chances are you’ll run into this, hit ok

image

Your query has been built, hit the exit button:

image

Tell Excel where to put the data from your query:

image

You’re done!

You can now right click on any cell that has data from your query and hit Refresh when you want Excel to pull fresh data from the database:

image

Permalink Leave a Comment

LINQ query to CSV

February 9, 2012 at 11:45 am (Computer Science)

The C# code below generates a CSV (comma separated value) string with the header row and data obtained from a LINQ query.

For example: A query like this:

dc.Users.Select(u => new
{
    user_id = u.UserId,
    username= u.Username,
    first_name = u.FirstName,
    last_name = u.LastName,
    creation_date = u.CreationDate
});

Would result in a CSV string like this one:

user_id,username,first_name,last_name,creation_date
"abf577a5-dc76-4719-9375-001a445d0c3d","jdoe","John","Doe",2011-03-29T14:50:28
"24b888cf-b02b-413e-8542-007e7ee572a6","jdoe2","John","Doe2",2009-05-29T19:52:32

And now to the code:

var users = dc.Users.Select(u => new
{
    user_id = u.UserId,
    username = u.Username,
    first_name = u.FirstName,
    last_name = u.LastName,
    creation_date = u.CreationDate
}).ToArray();

var usersCsv = GenerateCsv(users);

And make sure the following methods are delcared:

/// <summary>
/// This method generates CSV data out an array of anything. The array
/// elements could be of anonymous type
/// </summary>
private string GenerateCsv(Array items)
{

    var rowType = items.GetType().GetElementType();
    var colNames = rowType.GetProperties().Select(p => p.Name).ToArray();

    // create the header row
    var retVal = new StringBuilder();
    retVal.AppendLine(string.Join(",", colNames));

    // now create the body
    foreach (var row in items)
    {
        var rowItems = new string[colNames.Length];
        for (int i = 0; i < colNames.Length; i++)
            rowItems[i] = this.FormatCell(rowType.GetProperty(colNames[i]).GetValue(row, null));

        retVal.AppendLine(string.Join(",", rowItems));
    }

    return retVal.ToString();
}

private string FormatCell(object item)
{
    if (item == null)
        return "";

    if (item.GetType() == typeof(DateTime))
        return ((DateTime)item).ToUniversalTime().ToString("s");

    return "\"" + item.ToString().Replace("\"", "\"\"") + "\"";
}

Permalink Leave a Comment

Anika is crawling!

January 29, 2012 at 5:51 pm (Personal)

A few days before she turned 9 months, Anika began crawling!

She had been close to crawling for a long time but her right foot would get stuck on her left knee so she was not able to crawl freely with her knees, she would only move a little bit and then go back into the sitting position; after doing that a lot she could move from one side of a room to the other; but it took her a long time.

One night Carol and I placed a few of her favorite toys at a distance she could only reach by crawling, and we helped her get her foot unstuck. After doing that a few times, she was able to crawl by herself! She only did it by herself a few times and then got tired.

The next day, we wondered if she had forgotten her new skill; but she didn’t. After a few days of practice she could go long without stopping:

Permalink Leave a Comment

Customizing the Contact form in Outlook 2010

December 19, 2011 at 11:47 am (Computer Science)

Most of my Outlook contacts are personal contacts, not business contacts. So I don’t have their business phone or address. By default the business phone field is the first on the list of phones on the contact form. And the business address is the only one that shows by default.

With a lot more work that what it should be, I was able to change the fields from this:

image

To this:

image

I was only able to do this on New Contacts, I did not continue trying to figure out how to edit my existing contacts to use this new field format.

 

To do so go to Outlook 2010 and add the Developer Menu Item by going to “File > Options > Customize Ribbon“ and select the Developer item on the tree view:

image

Hit the OK button to save your changes.

Go to your contacts and hit the “New Contact” button:

image

 

Change the fields to your liking by hitting on the drop down arrow next to the field name:

image

Go to the Developer item on the Ribbon and select Publish Form As:

image

Give your new form a Display Name and a Form name and hit Publish.

image

The form name is the one you’ll look for when setting the form as the default form, the Display name is the one you’ll see on the “New Contact” button.

Close the “New Contact” window you have open, if it asks you if you want to save changes say no.

image

We now want to make our new published form the default Contact form. To do this , right click on the Contacts folder:

image

Hit properties. Then update the “when posting to this folder, use” field to your new form and hit OK to save your changes:

 

image

Your new contact form will now be used on all new Contacts.

Sadly I could not find a straight forward way to make existing contacts use the new Form. If you figure out how to do this, let me know!

Permalink 1 Comment

3rd tooth coming out!

December 14, 2011 at 10:49 pm (Personal)

Anika has been really fussy lately, specially around bed time. We’ve been cutting down on her acid reflux medicine (per doctor’s orders) and we were worried that maybe that was the cause.

But today we saw this:

image

A third tooth is coming! It’s hard to see in the photo so here is a closeup. It’s coming on the right side (Anika’s left side) of the two teeth you can clearly see:

image

She’s growing so fast! She’ll be 8 moths old on the 21st. And hopefully she’ll be acid reflux medicine free in a short while =)

Permalink Leave a Comment

C# controlled lights via USB port

November 15, 2011 at 11:30 am (Computer Science, Personal)

At work, we thought it would be cool if we could turn on some siren lights when a server goes down.

Step #1 to make this happen was to be able to control simple electronics from custom code. I love C# and the USB port is what is common now so I researched and found the FT245RL “USB to FIFO” chip. This chip made it really easy for me. It plays well with drivers known by Windows.

When I plugged in the chip to the USB port, Windows 7 immediately recognized it and installed the drivers for it. You can use a couple of drivers the default is the simpler one to use where it turns the USB port into a virtual serial (COM) port.

Writing to serial ports is really standard so this is the code that outputs a byte through the chip:

private static void WriteByte(byte byteToWrite)
{
    using (SerialPort vcp = new SerialPort())
    {
        vcp.BaudRate = 9600;
        vcp.DataBits = 8;
        vcp.StopBits = StopBits.One;
        vcp.Parity = Parity.None;
        vcp.PortName = &amp;amp;quot;COM5&amp;amp;quot;;

        vcp.Open();

        vcp.Write(new byte[] { byteToWrite }, 0, 1);

        vcp.Close();

    }

}

Permalink Leave a Comment

Anika is exploring foods!

October 31, 2011 at 10:48 am (Personal)

People always say “we started giving our baby solid food”.. But is rice cereal and purees solid? I think they say that because it’s shorter than saying “we started giving our baby something other than breast milk and/or formula”.

Last Thursday October 27th, Carol gave Anika rice cereal! Anika got a hang of swallowing after about 4 spoon attempts. She ate about 2 ounces and I think that’s pretty good for being her first time.

I fed Anika for the first time this Saturday. It was fun but it certainly takes longer than just giving her a bottle! At the beginning she was really eager to be eating, but after a while she would wonder and was not ready for the spoon that was coming. So I thought she was not hungry any more, but then Carol gave it a shot and Anika finished the remaining half of the cereal!

DSC03005

DSC03015

The pediatrician suggested trying different foods every 3 days so yesterday (Sunday) we gave her pea puree. We cooked them and then ran them though the food processor with some water; we could see the pea skins but I thought it was not a big deal so we gave her some spoons just like that. Carol then freaked out and said that we really should strain the puree to remove the skins, so we did. I don’t think we needed to but I didn’t mind if we did and Anika didn’t mind either way as well.

She finished 2 ounces of pea puree, she wasn’t as excited as rice cereal so I’m thinking she didn’t love them but thought they were good enough to eat.

Permalink Leave a Comment

Bike commuting is over

October 31, 2011 at 9:31 am (Personal)

It has actually been over for a long time but I haven’t posted about it. I didn’t bike to work at all last week. It’s just too dark and I realized that even if I got a front light, cars would see me but I would not be able to see pot holes or other obstacles on the road.

Permalink Leave a Comment

Next page »

Follow

Get every new post delivered to your Inbox.