Of phones and time
Aug. 13th, 2008 11:55 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)

There must be a sales drive going on at Sprint now because yesterday morning, I got a phone call from a rather insistent Sprint sales representative. Of course, I wasn't going to upgrade my calling plan since I hardly use any minutes in the first place, and I wasn't going to upgrade my phone either because I just got a replacement Razr V3m in good working condition. However, that sales call did get me to at least take a look at Sprint's current selection of phones.
The LG Rumor is one that I might get for the slide-out keyboard. The dealbreaker is it doesn't support EV-DO! If I have Power Vision, why get a phone that can't use it? The only other Sprint offering that I thought was interesting was the HTC Touch, a touchscreen Windows Mobile smartphone. However, the reviews are lukewarm. The rest of the phones are either less capable than the Razr V3m (so why buy those when I can always get a V3m on eBay?) or too high-end for me to be bringing out into the woods. Bottom line is I ought to wait and see. Maybe they'll have more choices next year when my contract is up for renewal.
Did more work on TwitVim. Yesterday, I added support for highlighting #hashtags and jumping to the Twitter Search for those hashtags. That should make hashtags easier to follow in TwitVim, not that many people on my friends timeline use those.
Then today, I rewrote TwitVim's date/time reformatting code in pure Vim script. It used to be written in Perl, so only those who ran Vim with the if_perl extension compiled in would see those. Everyone else saw raw Twitter API timestamps, which are in GMT instead of local time and aren't very pretty, besides. Now that this piece of code is in Vim script, everyone will get the new timestamps. Why was it in Perl earlier? Because Vim has barely anything by way of date/time handling functions so I was using Perl's library functions for that. Once I had the Julian date formula though, it was easy to write a Vim function to convert date strings to UNIX time values. (i.e. seconds since Jan 1, 1970) Of course, it was even easier to peek into the Perl library to see how they implemented timegm(). Wish I'd thought of that earlier.
So here's what timegm() looks like in Vim script:
Certainly not a long or difficult piece of code once the details have been hammered out." Convert date to Julian date. function! s:julian(year, mon, mday) let month = (a:mon - 1 + 10) % 12 let year = a:year - month / 10 return a:mday + 365 * year + year / 4 - year / 100 + year / 400 + ((month * 306) + 5) / 10 endfunction " Calculate number of days since UNIX Epoch. function! s:daygm(year, mon, mday) return s:julian(a:year, a:mon, a:mday) - s:julian(1970, 1, 1) endfunction " Convert date/time to UNIX time. (seconds since Epoch) function! s:timegm(year, mon, mday, hour, min, sec) return a:sec + a:min * 60 + a:hour * 60 * 60 + s:daygm(a:year, a:mon, a:mday) * 60 * 60 * 24 endfunction
(no subject)
Date: 2008-08-14 04:12 am (UTC)^.^
(no subject)
Date: 2008-08-14 06:35 am (UTC)Windows Mobile 6.1 and Sprint TV, plus the EV-DO Rev A, GPS and task manager from the previous update.
(no subject)
Date: 2008-08-14 11:43 am (UTC)(no subject)
Date: 2008-08-20 09:31 pm (UTC)(no subject)
Date: 2008-08-14 06:28 am (UTC)It also has EV-DO Rev A, and a slide-out keyboard.
It does have one annoying flaw, it tends to fail to answer calls, regardless of how quickly you press the answer button. This is supposed to be fixed in the latest firmware, which I just installed this evening.
The new firmware includes Windows Mobile 6.1, threaded SMS and Sprint TV.