Lost in translation…

18 04 2008

Michael sent me this line of text in German yesterday…

Auslieferung oder Würfel!

Now, me knowing absolutely ZERO German (except swear words, of course), hit up Google Translate. Google returned:

Extradition or cubes!
Uhhh.. meh?  Come to find out, he originally used Babel to translate “Surrender or die!” from English to German.  Now, extradition is a legal term for surrendering (basically being taken from one jurisdiction to another for trial), but… cubes?
 
If you’ve seen Google’s headquarters, they are anything but “cube farms,” so maybe this is a bit of their influences… cubes == death.
 
Also, tossing the phrase back into Babel is just as odd…
Distribution or cube!
For some odd reason, this continues to make me laugh as I sit back in my chair and look around at the 8’ cold, gray prison cube walls.




Gmail - Odd Filtering Request…

27 03 2008

I love Gmail—in my Archives, I still have my “Welcome!” email (because, I wanted to “save it all” since I had unlimited space) dated back to August ‘04 and I haven’t looked back since. 

It’s fast, has a great interface, and has become recognized and supported by dozens of vendors.  It’s also available EVERYWHERE—home, work, on the road, my cell phone, wireless devices, just everywhere.  I don’t have to worry about syncronizing and it connects to GoogleDocs, Calendar, and the other services extremely well.  If I could find a good way (without a client) to sync my cell phone to Google Calendar, I’d happily kick Exchange to the curb (for personal stuff).

I’m on several mailing lists too… various ones for both work and personal such as altdotnet.  As these groups have grown and conversation sometimes staggers, Gmail has been my saving grace by automagically keeping the hierarchy in a single “thread” to make the conversations easy to follow.

Unfortunately, Gmail can’t “autoforward” to folders—because there are no folders.  Labels and filters are great, but if I go a few hours without reading my email (you laugh… but seriously), I find I have 200+ in my box and can’t see the “real” mail from the list servers.

If I was using Outlook, I’d autoforward emails to a folder and be happy.

So, to get around this with Gmail, I tried something and over the next few days, I’ll see how it works.

  1. Setup a new filter that matches a common criterium of all the emails on a particular list, e.g. all altdotnet emails come from altdotnet@yahoogroups.com.
  2. Next, select “Apply the label” and create a new label for the group AND select “Skip the inbox”. 
  3. Save/Update the filter and, optionally, apply it to the discovered conversations (recommended to be sure you don’t have strays).

Gmail Labels

This applies a label, which is clickable from the Labels section on the left AND gets them out of the inbox, leaving it tidy.  You can see below, at a quick glance, that I have 41 unread “threads” in altdotnet and no outstanding jotts (I <3 Jott).

You also can create hyperlinks DIRECTLY to the individual labels (if you wanted to add them to your favorites, etc) by adding #label/{label name} to the end of your google mail URL. Here’s an example:

http://mail.google.com/#label/altdotnet

Since I use the Google Homepage and Gmail web part, I have a little list of links as well and have added this in there for “quick access” to that label.

Give it a try for a few days and see how it works—hopefully it’ll help tame my information overloaded inbox.





Custom Searches in Internet Explorer 7.0

30 01 2008

I do quite a bit of “Googling” and searching in general throughout my day.  One of the coolest features that not many seem to use is IE 7.0’s ability to create custom searches in the search bar.

Several sites, like WikiPedia, are setup to automatically offer a search engine provider using an OpenSearch provider.

Wikipedia Search Provider

Some sites, however, do not have a provider pre-configured.  This blog, for example, doesn’t (yet).  I can, however, add a custom provider.  Here’s how:

1. Do a search using the search provider you wish to add with the words TEST.

2. Copy/paste the generated “TEST” url.  For this blog, it looks like:

http://tiredblogger.wordpress.com/?s=TEST

3. In the search bar drop down, click “Find More Providers…”

4. Enter the URL and a friendly name in the “Create Your Own” box.

Create Your Own

5. Click the “Install” button and then “Add Provider”.

Now, when we look at our available providers, we see this blog listed.

blog.tiredstudent.com search engine.

Do a search now, for something like “facebook” and all posts I’ve written with facebook in them will appear.

You can do this with most any on-site search engine or forum software.  Here’s a few I’ve added:

  1. www.whois.net for looking up domain registration information
  2. www.ffxiah.com for looking up FFXI auction information
  3. Wikipedia (built-in) for all purpose anythings
  4. FFXI and EQ2 Wikia (built-in) for quick access to items/quests
  5. www.eq2llinks.com for EQ2 items and information
  6. Gmail for quick access to emails

 





Creating a Google AJAX Search Control in .NET

30 10 2007

As I discussed yesterday, the current non-SOAP Google approach is to use 100% JavaScript and their own custom UIs.  That really annoys me that I can’t take the service, call it, pass along some values, and get search results back.

My next thought was, if nothing else, encapsulate all the odd options and such into a nice little control.  This isn’t necessary for the Yahoo! search, as it’s SDK has it’s own controls, result objects, etc.  For the full list of Google AJAX Search options, check out the class reference.

Download .net 3.5 Complete Project [updated 30 Oct 07/10:55]

Our control has five properties:

  • The Google AJAX Search API Key: this string property is for the key specific to this particular instance and is URL aware, so you’ll need one per application (or directory).
  • Four “Enable” properties: EnableWebSearch, EnableImageSearch, EnableVideoSearch, EnableBlogSearch.  These are booleans are true by default and toggle the searchers applied to the control.  I made these toggleable because in some environments, like at my office, Google’s Image and Video searches are blocked, and others may not want those results. :)

The only method to override in our custom control is CreateChildControls; we’ll use it to populate the page with our JavaScripts.

protected override void CreateChildControls()

{

base.Page.ClientScript.RegisterClientScriptInclude(“apiScript”,

“http://www.google.com/jsapi?key=” + this.Key);

StringBuilder searchers = new StringBuilder();

       searchers.AppendLine(“google.load(’search’, ‘1′);”);

       searchers.AppendLine(“function initialize() {”);

searchers.AppendLine(“\tvar searchControl = new

google.search.SearchControl();”);

       if (EnableWebSearch)

searchers.AppendLine(“\tsearchControl.addSearcher(new

google.search.WebSearch());”);

if (EnableImageSearch)

searchers.AppendLine(“\tsearchControl.addSearcher(new

google.search.ImageSearch());”);

if (EnableVideoSearch)

searchers.AppendLine(“\tsearchControl.addSearcher(new

google.search.VideoSearch());”);

if (EnableBlogSearch)

searchers.AppendLine(“\tsearchControl.addSearcher(new

google.search.BlogSearch());”);

searchers.AppendLine(“\tsearchControl.draw(document.getElementById(’” +

this.ClientID + “‘));”);

searchers.AppendLine(“}”);

       searchers.AppendLine(“google.setOnLoadCallback(initialize);”);

 

       base.Page.ClientScript.RegisterClientScriptBlock(this.GetType(),

“searchers”,

             searchers.ToString(), true);

}

The apiScript provides the link to the Google JavaScript objects (and passed along the unique key).  The searchers is the guts of the search component and generates a JavaScript block wherever you place your control. 

Notice on the .draw method of the searchControl, it’s drawing back to itself (the control, by default, generates a span tag; we’re simply returning the “drawing” of the control back to that.  It’s possible to add another property, something like TargetControlId, and use that to separate out the search logic and the actual location the search UI is presented.

To place the control on your page, drop and drag it from the toolbar, or code.  Here’s an example with the VideoSearch disabled.

<googleControls:GoogleSearch

ID=”GoogleSearch1″

runat=”server”

EnableVideoSearch=”false”

Key=”KEYHERE” />

Unfortunately, this still doesn’t resolve using the Search API for non-web interfaces. :(





Consuming Services: Yahoo! API vs. Google API

29 10 2007

As both a proof of concept for some internal uses as well as demonstration, I’ve been doing a bit of research into how the Yahoo! and Google APIs work—especially in .NET.  Here’s a bit of a comparison of what I’ve found so far.  I welcome any comments and such as I’m quite sure others out there have been using these technologies far longer than I have—and may have some workarounds for the odd glitches found in each framework.

Yahoo! Developer API

I’ll start out that I’m quite impressed by Yahoo!.  The Developer API was introduced to me in an AJAX session I attended a few months ago and I had totally forgotten about it until recently.  Their .NET Developer Center provides articles, SDK libraries, and most anything you’d need to wrap Yahoo! functionality into your .NET Application. Since Yahoo! returns standard XML (or JSON if you so desire and want to use the FromJson extension method and a custom type), I built a quick console-based searcher app.  The UI is irrelevant, I simply wanted to see how fast I could take data, search for it, and return information.

Most of the code here can be gleamed from the Yahoo! examples…

static void Main(string[] args)

{

// Capture the Yahoo query from the console.

       Console.WriteLine(“Your query to www.yahoo.com’s Image Search engine:”);

       string query = Console.ReadLine();

       // If query is blank, end.

       if (query == “”) return;

                      

       foreach (XmlNode node in GetImageSearch(query))

       {

              Console.WriteLine(“{0} @ {1}”,

node["Title"].InnerText,

node["Url"].InnerText);

}

}

This bit of code takes the input (from the console at this point) and then searches.  My GetImageSearch method returns an XmlNodeList (encapsulating the whole “get an XML, convert it, get the elements, etc” process) and then allows us to iterate through it, set it to a DataSet, etc.

static XmlNodeList GetImageSearch(string query)

{

// Create the web request

       Uri address = new

Uri(“http://search.yahooapis.com/

ImageSearchService/V1/imageSearch”);

string appId = “YahooDemo”;

HttpWebRequest request =

 WebRequest.Create(address) as HttpWebRequest;

       // Set type to POST  

       request.Method = “POST”;

       request.ContentType = “application/x-www-form-urlencoded”;

       // Create the data we want to send  

       StringBuilder data = new StringBuilder();

       data.Append(“appid=” + HttpUtility.UrlEncode(appId));

       data.Append(“&query=” + HttpUtility.UrlEncode(query));

       // Create a byte array of the data we want to send  

byte[] byteData =

UTF8Encoding.UTF8.GetBytes(data.ToString());

       // Set the content length in the request headers  

       request.ContentLength = byteData.Length;

       // Write data  

       using (Stream postStream = request.GetRequestStream())

       {

              postStream.Write(byteData, 0, byteData.Length);

}

       // Get response

       using (HttpWebResponse response =

request.GetResponse() as HttpWebResponse)

       {

              // Get the response stream  

             StreamReader reader =

new StreamReader(response.GetResponseStream());

             XmlDocument xmlOutput = new XmlDocument();

             xmlOutput.LoadXml(reader.ReadToEnd());

             XmlNodeList resultsNodes =

xmlOutput.GetElementsByTagName(“Result”);

             return resultsNodes;

}

}

That’s it!  Note for real world use, you’ll need to replace that AppId with a real Yahoo Application Id.

Pros:

  • XML Output is standard, JSON optional.  Works like a snap for .NET usage.
  • Amazing support and community for the APIs.
  • A Search SDK exists for C# and VB.NET, though I didn’t use it.  That’d probably replace all of the coding above to a simple call or two.
  • You only need one Yahoo! Application ID per… application! (you’ll see why this is a pro in a minute).
  • Almost any language/framework has a Developer Center.

Cons:

  • It’s Yahoo.  I’m a Google fan myself (using Web Search, Google Mail, Google Docs, etc.), maybe this will change my mind and make this into a Pro as time goes on.

Google Developer APIs

Google’s been my Search of Choice for years now.  As I mentioned above, I use several of their services and have never had much of a problem.  In the results I get back from their search services, I tend to get what I’m looking for in the top ten or twenty, not the top 100 to 200 as I do with Yahoo and Live Search. With that in mind, their Developer Center is almost horrifying.  While AJAX and JavaScript are grand technologies, I had hoped for a bit of the same control as the Yahoo! solution provided—especially if I wanted to consume the information in non-web applications. 

[update 30 Oct 07: Google previously had a SOAP Search, but as of 5 December 2006, the SOAP Search is no longer available.  Bloody hell, why?! 

“Depending on your application, the AJAX Search API may be a better choice for you instead. It tends to be better suited for search-based web applications and supports additional features like Video, News, Maps, and Blog search results.

Okay, I’ll give you that, but what if you don’t want to use it in a web application?  *grumble*]

To provide an example of the AJAX Web Search, here’s what we have:

 

<html>
<head>
<title>Search Example</title>

<script type=”text/javascript”
  src=”http://www.google.com/jsapi?key=KEY” />
<script type=”text/javascript”> 

google.load(”search”, “1″);

function initialize()
{
 var searchControl = new google.search.SearchControl();
 searchControl.addSearcher(new google.search.WebSearch());
 searchControl.draw(document.getElementById(”searchcontrol”));
}

google.setOnLoadCallback(initialize);

</script>
<script type=”text/javascript”>

</script>

</head>
<body>
    <div id=”searchcontrol”></div>
  </body>
</html>

 

That code works just fine, but it doesn’t give me control of the UI or the results, it generates: Now, I did find the google-gdata project, a Google Data API for .NET—but apparently GData doesn’t include things like searches, only Claendars, Docs, and such.  Bleh. So, what could be done to wrap this up?  I could put the JavaScript into a custom control and intercept the text coming back into the element from the .Draw method, but ehh… beyond that, I’m interested to see how others are wrapping Google technologies into .NET applications—if you have, please post links and feedback!

 

Pros:

  • Development outside .NET or outside the OOP side of .NET, it’s pretty slick.
  • Creates a nice interface for the tools.

Cons:

  • You need a new application key for every service you use, for every site you create.  If your site consumes Search, AJAX Feed, and Maps, you need 3 keys.  Really a hassle.
  • Appears to be little or no language specific support outside of HTML and JavaScript for the API.  That’s fine, but wrappers would be nice too.
  • Google Web Toolkit is Java only. :(

For now, both of these services still interest me and both are excellent examples of what could be done to mash up technologies into a modern web application—it all depends on what you need. For grins, I’m sure the “Microsoft” answer is to consume Live Services rather than the competition, but I’ve never had much luck using Live—anyone using it now?





Google’s Lost it’s Cookies

17 08 2007

Reading through the blogs and the notes attached to each Google “gadget,” it appears something has been happening in the background at Google and all that’s left are a few fingerprints and cookie crumbs.

As far as I understand, the gadgets use profile-specific “cookies” for authored gadgets (non-Google).  For example, things like the del.icio.us, Enhanced Bookmarks, and other cool plug-ins to the iGoogle homepage.

Well, earlier this week, something has gone astray.  I haven’t had del.icio.us bookmarks all week and today, my Enhanced Bookmarks… just vanished.  *twitch*

I like Google’s because I use gmail, google docs and really like having the translator (my workplace has 6 “official” languages, so I’m constantly translating UI elements and such) and wikipedia show up for quick reference.  I’d be a bit more inclined to MSN if I was a Hotmail user… but no.  But, on the other hand, I can’t deal with this unreliability… especially when it’s not something that I can back up.

So, I’m curious… what does everyone use for a “home page”? 

 





Google joins the “let’s sue Microsoft!” party!

11 06 2007

At first, when I saw the headline, I couldn’t quite grasp what business a search provider could have with suing a client/operating system maker.  Last I checked, Google kicked LiveSearch’s butt.  Well, it appears it has to do with their Desktop Search application.

Google’s allegations are under review by the Justice Department and state attorneys general who were parties to a consent decree that resolved the US government’s antitrust case against Microsoft in 2002.

Microsoft rejected Google’s allegation that the Vista desktop search violates the settlement.

“We don’t believe that this feature is covered by the consent decree or that it raises any antitrust issues,” Brad Smith, Microsoft’s general counsel, was quoted as saying.

A report on the latest allegations to the Washington federal court overseeing the case is due later this month and the judge, Colleen Kollar-Kotelly, “has shown frustration over Microsoft’s compliance with the settlement,” the Journal noted.

Google files antitrust complaints against Microsoft: report - Yahoo! News.

Now, I have to admit.  In Vista, I have the “instant” search turned off and use the search bar primarly as a run bar (you can type cmd, regedit, iexplore, outlook, whatever and it runs… neat stuff). I don’t (often) misplace my files as they’re on file servers… and I don’t really store anything on my local machine, even my email, which I use Google Mail (gmail) for—I have no need to constantly parse my hard drives for files.

But, if I WANT to, I could simply disable it using the Control Panel and install Google’s.  What’s so “blocking” about that?  Did I miss something or what?  When I install Vista, does it ask me if I want to install, feature-by-feature, every aspect of the operating system from a 3rd party?  Nope… thank God.  But, if I’m smart enough (read: an elementary school kid’s level of computer savvy), I can install those features I’m looking for if I’m not pleased with Microsoft’s version.

What’s next?  Are we going to sue Microsoft because we want to replace the Spell Check tool in Office and there isn’t an easy way to do it?

 





MSDN Really Slow Search?

8 06 2007

The new “MSDN” has been a dog… a slow, very tired, somewhat early-days-of-summer dog.  The new layout is an upgrade, for sure, but the interface and moving page-to-page is extremely slow.  To top it off, today, I hit it up and ran a simple query (it’s a long day already and I just couldn’t remember some of the control property syntax).  So, rather than Google, I set my IE7 search bar to MSDN and searched there.

Results 1-50 of approximately 81 for: “Web User Control” +properties (15.3 seconds)

MSDN Enhanced Search.

15.3 seconds.  On the web, that is a LIFETIME and my mind has already moved on to another tab or window to do something else.  I ran it a few more times to see if it was caching or anything useful, and it kept taking LONGER and returning the same amount of results.  Wow.  What about Google?

Personalized Results 1 - 50 of about 17,300 for Web User Control” +properties. (0.19 seconds)

Google Search.

Nuff said.





Creating Information From Data…

5 06 2007

I think, however, that simply calling the current school-age generation a “generation of editors” is a little too limiting. It’s true that today’s kids don’t have to hunt down kernels of information as if they’re ancient Cro-Magnon scrounging for roots and berries. Instead, it seems to be replacing those hunting-and-gathering skills with the ability to synthesize and combine information in ways that my own Baby Boomer mind can’t always grasp.

Are We Just Editors Now? by Loyd Case of ExtremeTech

This article from ExtermeTech’s Loyd Case caught my attention this morning.  He, as ironincally has he notes, is responding to Bill Harris’ article entitled “Information”.  In it, he notes how disecting information has changed through the generations.  Both authors are comparing times to those of their generation (mid-to-late 40’s to 50’s) and even that of my parents (70’s) in how information is acquired and decoded.

So if you were researching something, you’d have to pull out a rack in the card catalog according to the alphabetized subject and flip through the cards. If you got lucky, the title of a book or a brief description would point you in the right direction. Then you had to actually find the book, skim through it, and hope that you’d find some information.

I know what you’re thinking about now: you’ve got to be freaking kidding me.

Dubious Quality: Information by Bill Harris

I remember that.  I’m, in spite of the target audience, in my 20’s and I remember the card catalog (my small, rural school district was a bit late in adopting technology).  I even remember the dewey decimal system—inspite of all attempts to forget it.  But, I’m also part, I believe of this age of information mashup—using Google or whatever information source of choice, and finding bits and pieces of data here and there, applying logic and care (ala: not everything you read on the Internet is true—you’ve had this lecture, right?), and then turning that data into information for your purpose.

Now, looking forward and seeing what the youth of today are doing is astonishing.  Collaboration, sharing, information overload using MySpace, Facebook, YouTube, even here on WordPress.  The alpha site for Popfly is a great example of the current demand—taking dozens of information services and mixing and mashing them together to come up with a solution: a photo album that contains music referenced by keywords in each photo, an address book with photos from Facebook and a map using Maps, etc.

I do agree with Loyd’s assumption that these are not “editors”, as that, to a degree, implies that nothing new is being created; however, this generation advocates data and services as multi-purpose tools and excel at finding new ways to use data and turn it into information, not simply finding a source of reference and citing it in a book report.

 





Replacement for Omea found in Google?

5 03 2007

I was tormented most the weekend by being unable to access Omea at work (couldn’t RDP into the office) and found that I hate relying on client applications.  I dinked around with Google’s Reader and Groups and am pretty pleased.  Reader is especially nice, I love it—it’s fast, it can import my OPML lists, and it’s everywhere I go.  I did have a bit of a downer with Google Groups that I’m still attempting to work around—my MSDN account.  I have a specific email address I use on the microsoft.public.* groups and Google Groups forces me to use my Gmail account.  Hmm.

I’ll keep working with it—I like the tools and the flexibility; I just need to work through the current hassle regarding the email address.

Tags: , , ,