Sunday, March 9, 2008

Getting voicemail delivered to your email account

I used to rarely check my voicemail. I'd wait until a convenient time on the weekend and then delete 4 or 5 voicemails I'd accumulated during the week, mostly from my girlfriend or my mom. Usually if I see a missed call and a voicemail, I'll just call that missed caller right back because its easier than checking voicemail and calling them anyways. If someone wanted to just leave me a message I didn't have to respond to, I'd expect it to come as a text message. And of course if I saw a missed call & voicemail that was work related, I'd listen to it, but I don't get those particularly often.

But I am very religous with checking emails... so I thought it would be great to get my voicemails as email messages that I could listen to in my browser (ff of course...).

So after an afternoon of wrestling with the pieces, heres how you do that:


  1. Sign up for grandcentral @ www.grandcentral.com. It was recently bought out by google, but it does not integrate with your existing google account. Try to get a number in your area code or one close by. I did this a couple of months before setting up my voicemail system, and was able to get a number.

  2. Use *71 to set up 'No Answer/Busy Transfer' on your current cellphone to forward to your grandcentral number. My cell is verizon, so this works very easily for me, and I'm sure other carriers provide something similar. This service is free (it is on my plan and as far as I know I never opted in) and it will try to ring your cellphone 3-6 times, and if you don't pick up will forward your call (regular call forwarding will forward your call without trying to ring you). After you don't pick up, the call is transfered to grandcentral were it will use your grandcentral rules to decide how to route the call.

  3. In my case, I turn 'quickrules' off so that grandcentral does not try to route my calls. In that case, it will go straight to grandcentral voicemail.

  4. Set your grandcentral notifications to email you at your primary email address, and you can optionally choose to be alerted by text message. I like to turn on the latter because it tells you detailed info about your voicemail (who, when, how long the message was).

  5. Profit?

  6. You should probably customize your grandcentral voicemail greeting too so people know to leave you a message. Or you can totally mess with them because you can have different greetings that get played to different people, but all strangers will still get your professional greeting.



I like this system because I check my voicemails much more frequently now (its fun). The messages go to your email with a play button that links to grandcentral (with a url you can access w/o being logged into so you can forward to your heart's content).

GrandCentral has a lot of other cool features too that you can exploit now that you have an easy way to make use of it. Enjoy!

- Dave

Friday, February 1, 2008

Carl from ATHF loves the GIANTS

This video accurately sums up my opinion on the Giants.

Thursday, January 31, 2008

VB6 -> VB.NET Upgrade Wizard, Fixed Width Structures

I used the upgrade wizard included in Visual Studio.NET and found it overall pretty good. My biggest issue with it was the way it handled structures with fixed width fields. In VB you'd define a structure like this:

Type example
field1 As String * 10
field2 As String * 10
End Type


In VB.NET it would get converted as:

Structure example
<VBFixedString(10), _
System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=10)> _
Public field1 As String
<VBFixedString(10), _
System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=10)> _
Public field2 As String
End Structure


So it looks like the wizard did the trick by adding all those attributes. I thought that this was adequate until we realized during testing that we weren't getting properly padded fields out of the structure like we had been in VB6. So if we set field1 to "hello" in VB6, then retrieved the value, we'd get "hello     " (thats 5 trailing spaces). In VB.NET, the same value in field1 would be retrieved as "hello" with no spaces. I'd bet that that fancy pants attributes actually does its job when used as a library from another COM app. But in just a normal capacity it did not behave expected.

No problem, we'll just have to try and fix it! So my first thought is that maybe there is some sort of .NET library to redirect all member access to a function. Sort of like __getattr__ in python. We could conceivably just change the Structure to a Class, and inherit it from a class that implements __getattr__ and we wouldn't have to change any code.

No dice, as far as I can tell there is nothing in .NET to bounce member access to a function. It would have been nice to have some sort of class that would provide the bounce for us, then we just override the member resolution function or something.

So what I did instead was turn those Structures to Classes anyways, and had them all inherit from a class implementing this property and method:

Default Public ReadOnly Property GetField(ByVal retrievethisfield As String) As String
Get
Return _GetField(retrievethisfield)
End Get
End Property

Public Function _GetField(ByVal fieldname As String) As String
Dim field As Reflection.FieldInfo = Me.GetType().GetField(fieldname)
Dim val As Object = field.GetValue(Me)
Dim fixedlength As Integer
For Each attr As Attribute In field.GetCustomAttributes(True)
If TypeOf attr Is VBFixedStringAttribute Then
fixedlength = CType(attr, VBFixedStringAttribute).Length
Return Left(CStr(val).PadRight(fixedlength, " "), fixedlength)
End If
Next
Return val
End Function


So the dirty part is that to set you use normal member lookup via obj.field1 etc, but to do a get you do obj("field1") and it will do the padding for you (Note the use of the default property...). You can get rid of some of those wizard attributes, as long as you use VBFixed. Ugly huh! What would be nice is to be able to then tag the member variables in the structure/class as writeonly so I could find (as errors in the task list) all the gets and replace them with my lookup. This is possible for properties, but not for member variables because they must be second class citizens.

Sometimes I feel like VB.NET has some python like things I like (specifically invoking unknown methods on an 'object' object). Other times I realize its a totally different animal and I can find comparable things between any language if I wanted to.

Tuesday, January 29, 2008

Superbowl Box Pool Odds on Point Change

my dad sent me this link today:

http://www.j-e-f-f.com/sb-o-m.htm


it details the percentage payout per quarter that each superbowl pool box has earned in all superbowls. since we play a pool on point change, this link doesn't actually tell us much.

so i went to superbowl.com for stats and made a quick program to come up with this chart that gives us the percentage of hits on each box. here it is:


0 1 2 3 4 5 6 7 8 9
0 10.69 2.24 1.21 8.79 5 1.72 7.59 8.45 1.21 2.76
1
0.17 0.34 0.86 0.86 0.34 1.03 1.38 0.17 0.52
2

0 1.21 0.34 0 1.03 1.38 0.17 0.52
3


3.62 2.76 0.17 4.83 5.52 0.17 1.55
4



0.69 0.52 1.55 3.1 0 1.9
5




0 0.17 0.52 0 0.17
6





1.21 3.45 0.34 0.86
7






2.93 0.86 1.9
8







0.17 0.69
9








0.34


When taking AFC & NFC into consideration, this is the chart. NFC is the columns going across, AFC is the rows going down.



0 1 2 3 4 5 6 7 8 9
0 10.69 1.55 0.69 4.66 2.93 1.21 3.97 4.48 1.03 1.55
1 0.69 0.17 0.34 0.69 0.69 0.17 0.69 0.86 0.17 0.34
2 0.52 0 0 0.52 0.34 0 0.52 0.69 0 0.34
3 4.14 0.17 0.69 3.62 1.03 0 2.59 2.76 0.17 1.38
4 2.07 0.17 0 1.72 0.69 0 1.03 2.07 0 1.03
5 0.52 0.17 0 0.17 0.52 0 0.17 0.34 0 0.17
6 3.62 0.34 0.52 2.24 0.52 0 1.21 1.72 0.34 0.34
7 3.97 0.52 0.69 2.76 1.03 0.17 1.72 2.93 0.34 0.86
8 0.17 0 0.17 0 0 0 0 0.52 0.17 0.52
9 1.21 0.17 0.17 0.17 0.86 0 0.52 1.03 0.17 0.34


and likewise, here are the expected final scores when afc/nfc is not taken into account:


0 1 2 3 4 5 6 7 8 9
0 0 2.44 2.44 2.44 0 4.88 4.88 7.32 0 4.88
1
0 0 0 4.88 4.88 2.44 2.44 2.44 2.44
2

0 0 2.44 0 0 2.44 0 2.44
3


0 4.88 0 4.88 2.44 0 0
4



0 0 0 9.76 0 2.44
5




0 0 0 0 0
6





2.44 2.44 2.44 2.44
7






4.88 0 2.44
8







0 2.44
9








0

and when afc & nfc are taken into account (afc is rows again)


0 1 2 3 4 5 6 7 8 9
0 0 0 2.44 0 0 4.88 2.44 4.88 0 2.44
1 2.44 0 0 0 2.44 2.44 2.44 2.44 2.44 2.44
2 0 0 0 0 2.44 0 0 0 0 2.44
3 2.44 0 0 0 2.44 0 0 2.44 0 0
4 0 2.44 0 2.44 0 0 0 9.76 0 2.44
5 0 2.44 0 0 0 0 0 0 0 0
6 2.44 0 0 4.88 0 0 2.44 2.44 2.44 2.44
7 2.44 0 2.44 0 0 0 0 4.88 0 0
8 0 0 0 0 0 0 0 0 0 2.44
9 2.44 0 0 0 0 0 0 2.44 0 0

First Post!

yes, i've created a blog using the power of the internet.