A few weeks ago, Christopher Vaugn from the IE7 dev deam contacted me
asking me to update FreeTextBox to support IE7's new user agent string.
After first, I was embarassed to know that I had coded it in such a way
that it wasn't forward compatible, but then I realized that it's
probably better to have FreeTextBox render a fully-functional downlevel
TextArea rather than a rich editor that had broken JavaScript if IE7
changed somehow.
Yesterday, I downloaded my beta copy of IE7 from connect.microsoft.com
(I'm still downloading Vista... 2.47 GB!!), so I could do actual testing
on it before releasing a compatible version. But I got an error message
on install,
"the data area passed to a system call is too small"
I have a really bad case of winrot and need to reinstall my machine, so
I might need to rebuild before I can get it to work. If any one has any
clues as to why the install doesn't work for me, I'd appreciate any
help.
This week, I needed to get read the duration of a few hundred Windows
Media Video files for a project. Since I started my development code in
ASP and then ASP.NET, I pretty much only know managed code, so I wanted
to use a .NET language. I searched google.com for "wmv duration" and
"wmv duration C#" and came up with nothing. I found the 10 different
Windows Media SDKs, 9 different DirectX SDKs, and a several forum posts
asking the question "How can I read the duration of a WMV/WMA in C#",
but no answers.
I finally found this post on windows.public.windowsmedia.sdk. It wasn't quite right, but it got me where I needed to go.
Here's the final code:
using WMPLib; // this file is called Interop.WMPLib.dll
WindowsMediaPlayerClass wmp = new WindowsMediaPlayerClass();
IWMPMedia mediaInfo = wmp.newMedia("myfile.wmv");
// write duration
Console.WriteLine("Duration = " + mediaInfo.duration);
// write named attributes
for (int i=0; i<mediaInfo.attributeCount; i++) {
Console.WriteLine(mediaInfo.getAttributeName(i) + " = " + mediaInfo.getItemInfo(mediaInfo.getAttributeName(i)) );
}
That's it.
A few weeks ago I went a little crazy
with the new Google Maps API. I also hooked it up to some pictures in
Community Server to see what would happen. I wanted to clean it up
before blogging it, but I don't have time right now to make it very
pretty, so here it is:
Using photos with Google maps is nothing new (flickr, etc.). But
since the satellite imagery of Google Maps is so good, I thought it
would be cool to show the direction in which each photo was taken with
little arrow. I added some meta data to my Community Server pictures in
Europe (latitude [float], longitude [float], angle [int]) and hooked
them up to the Google Maps API. Fun stuff. It'd be nice to add a map
control to the ShowPicture.aspx page of CS, but Google Maps requires a
unique key for each website directory, which means you would need a key
for each gallery. Maybe later...
Also, I just found about about Google Moon - funny stuff
Our home-grown online education platform has been localized! We
recently had a visit from the Chinese Bureau of Religious Affairs and
they loved it.
English
Chinese (traditional)
The current version of the platform uses ASP.NET Forums 2.0.1 and it's
localization was a big help. Since we only had resources for one
"dialect" of Chinese, we chose to go with traditional. For the next
round, we plan to include simplified Chinese and Spanish.
online education chinese localization ASP.NET
Originally, my Google Maps church search page was finding the nearest churches by
making an approximate square around the zip code's latitude and
longitude. For large distances (over ~25 miles), this proved pretty
inaccurate. To fix this, I created a SQL Function so that I could run a
query like this:
SELECT *
FROM
dts_Alumni_Churches
WHERE
dbo.CoordinateDistanceMiles(Latitude, Longitude, @ZipLatitude, @ZipLongitude) < @Radius
Here's the SQL function:
CREATE FUNCTION CoordinateDistanceMiles(
@Latitude1 float,
@Longitude1 float,
@Latitude2 float,
@Longitude2 float
)
RETURNS float
AS
BEGIN
-- CONSTANTS
DECLARE @EarthRadiusInMiles float;
SET @EarthRadiusInMiles = 3963.1
DECLARE @PI float;
SET @PI = PI();
-- RADIANS conversion
DECLARE @lat1Radians float;
DECLARE @long1Radians float;
DECLARE @lat2Radians float;
DECLARE @long2Radians float;
SET @lat1Radians = @Latitude1 * @PI / 180;
SET @long1Radians = @Longitude1 * @PI / 180;
SET @lat2Radians = @Latitude2 * @PI / 180;
SET @long2Radians = @Longitude2 * @PI / 180;
RETURN Acos(
Cos(@lat1Radians) * Cos(@long1Radians) * Cos(@lat2Radians) * Cos(@long2Radians) +
Cos(@lat1Radians) * Sin(@long1Radians) * Cos(@lat2Radians) * Sin(@long2Radians) +
Sin(@lat1Radians) * Sin(@lat2Radians)
) * @EarthRadiusInMiles;
END
If anyone has a faster method for use in SQL Server, I'd love to see it.
Our little Google Maps experiment was featured on a few websites this week:
This morning there is a very interesting use of the API to show the sites in London hit by terror attacks.
Over at CommunityServer.org there's a discussion about tagging. I'm trying to figure out what technorati.com picks up. They say you can add <category> entries to your RSS (CS info), but that doesn't seem to be getting picked up. You can also add tags through HTML anchors with rel="tag". I'm going to try a few of both on this post and see which ones technorati picks up.
Tags: technorati tagging rss dyer
For my first use of the newly released Google Maps API, I hooked up our database of churches with Dallas Seminary grads. We've had a "Find a church" list for a while, but this is much more helpful. Try it out:
The one problem I ran into was the number of flags that could be
placed on a page. Below is a picture of what a map looks like with >
300 icons placed on it. It took my P4 3.2 with 1GB RAM about 2 minutes
to load the map. It seems that around 50 is about right for a speedy
map. Here's a snapshot of the map with tons of churches on it:
PS. I relied on Google Maps for geocoding. I wrote some code to
lookup the latitude/longitude data for all the church addresses. After
doing this, I found out that it might be possible to use geocoder for retreiving this data.