Slashdot Mirror


Google Suggest Dissected

sammykrupa writes "Google suggest Javascript code dissected and rewritten for all of you web developers out there. Cool piece of web reverse-engineering!" Joel Spolsky astutely notes that this will raise the bar in terms of how people expect the "internets" to work.

68 of 321 comments (clear)

  1. A great idea by deepcameo · · Score: 3, Informative

    I think it is such a great idea. With google suggest people can find things with less strife. The way it works is that you start typing and it suggests things for you to search for. These entrys pop up directly under the search bar. I can help when that brain just isn't working to full potential!

    1. Re:A great idea by MikeFM · · Score: 2, Insightful

      Not to say that this isn't useful or cool but I really don't see how this sort of thing is that much of a benefit. It, like most client-side scripting, creates a non-standardized way to do a common task. In this case it might be useful for this ability to be intergrated into the basic protocols but the Javascript version is really nothing more than a bandaid for the ongoing problem that the basic protocols of the web HTML and HTTP really aren't meant to be used to write applications. Rather than creating more and more non-standardized web sites that are a usability nightmare it'd be much better to create some new standards.

      So, as a prototype this rocks. I hope it, and other Javascript, doesn't spread to every site on the planet though. Client-side scripting sucks. :)

      --
      At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
    2. Re:A great idea by SCHecklerX · · Score: 2, Insightful

      I agree. One that really sticks out is all of the javascript dynamic menus. I always thought that by now there would be a tag for this purpose. Seems like a logical tag to add to the specs. I have a use for it, for sure (i'm one of those who also refuses to use javascript for core functionality)

    3. Re:A great idea by los+furtive · · Score: 2, Insightful
      I don't know how this person can be modded as insightful. XMLHttpRequest object may be non-standard W3C DOM, but it is still supported by all the important browsers.

      XMLHttpRequest is a godsend that has been used for RPC in most major clientside toolkits for a while now, but you mainly see it in web apps that you have to pay to use (written a few myself). The fact that Google is using it only validates it's importance.

      And I don't wish to be pedantic but using the term "non-standardized web sites" is rather misleading since you can use XMLHttpRequest and still validate your site against HTML 4.x, XHTML etc...

      Finally, what it boils down to, and like it or not this is the trend of all important web app style sites, is that page refreshes are costly in time, in bandwith, and in difficulty of maintaining state, and using XMLHttpRequest as a method of RPC is the most suitable and appropriate way of resolving these issues, and a hell of a lot cleaner than hidden iframes to boot!

      P.S. Client-side rocks. Further reading here.

      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

    4. Re:A great idea by los+furtive · · Score: 4, Informative

      I agree with you in that JS menus aren't a very good idea. 10% of surfers have it turned off, and the menu is such a critical part of the site that you want it avaialable for everyone. That's why I also shake my head when I see Flash based menus.

      However, there's no need for your solution of a <menu> tag since the <ul> tag and a little CSS already does that just fine.

      Read the following articles to see what I mean:

      Hope this is of use to you.

      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

  2. Re:DCMA by modifried · · Score: 5, Funny
    "Oh boy. Will Google throw out the DCMA on this one?"

    Dyslexic users of slashdot, rejoice!

  3. Re:Raising What Bar? by LewsTherinKinslayer · · Score: 3, Funny

    This really rose the bar? I don't see how.

    Duh, its google-related. It must be better than everything else, thus raising the bar.

    Clearly. /sarcasm

  4. Google Suggest just isn't very useful by BillsPetMonkey · · Score: 5, Insightful

    Let's think if the way people search for stuff.

    1. Try something specific
    2. Try something less specific

    Number 1. brings up no results on Goggle Suggest, number 2. brings up 523,334 results. Impressive, but how has this helped us search for 1. ?

    Let's try an example, lets look for "C# structs"

    1. Enter "C# structs" - no suggestions.
    2. Enter "structs" - 425,000 results.

    Grrreat.

    --
    "It's not your information. It's information about you" - John Ford, Vice President, Equifax
    1. Re:Google Suggest just isn't very useful by mountain · · Score: 2, Insightful

      PEBKAC

      --
      --- "If a man speaks in a forest, and no woman hears him, is he still wrong?"
    2. Re:Google Suggest just isn't very useful by hobo2k · · Score: 2, Informative
      Part of your problem there is the # character itself. It seems to ignore some characters in the input.

      Typing "cstruct" gives one suggestion. Now type "c$%#$%#$%#^struct". It gives the same single suggestion.

      I'm not sure exactly which characters it ignores, because it does recognize ".net"

    3. Re:Google Suggest just isn't very useful by BillsPetMonkey · · Score: 2, Insightful

      So we should be altering the vocabulary we use so that Google Suggest can understand it?

      Hmmm.

      --
      "It's not your information. It's information about you" - John Ford, Vice President, Equifax
    4. Re:Google Suggest just isn't very useful by the+angry+liberal · · Score: 2, Funny

      Even better, we supply one of those old Apple Newtons as the only input device. This way you get to learn your grammar and handwriting over again in a Google compliant manner.

    5. Re:Google Suggest just isn't very useful by Phexro · · Score: 3, Insightful

      Yup, this is one of the terribly irritating thing about google... there is simply no way to search for an exact string which contains non-alphanumeric characters. It strips out most punctuation.

      e.g. search for 'tmp/foo/bar' or 'tmp/foo/bar#baz'. You'll see results for '/tmp/foo.bar', '/tmp/foo/bar', and so forth. What if I'm looking for that exact string? This can be very frustrating when searching for posts about a specific error message, since a page with 'condition foo: bar' will be just as likely to show up as 'foo: bar condition', but they aren't necessarily the same.

    6. Re:Google Suggest just isn't very useful by DNS-and-BIND · · Score: 5, Interesting

      Christ, Google Suggest has been around for all of 8 days now. It was released December 10, and is a Google Labs project, which according to the website "showcases a few of our favorite ideas that aren't quite ready for prime time."

      --
      Shutting down free speech with violence isn't fighting fascism. It IS fascism!
    7. Re:Google Suggest just isn't very useful by corsec67 · · Score: 2, Informative

      Even that will not work, because even in a quoted string, all punctuation is interchangeable with a space.
      so "/tmp/foo/bar" is the same as "tmp foo bar", which are very different.

      --
      If I have nothing to hide, don't search me
  5. And for those who would like to see it... by Vladan · · Score: 5, Informative

    Here's what he was talking about:

    Google with Auto Complete on Just start typing in the search field.

    It's a beta feature.

    1. Re:And for those who would like to see it... by nahdude812 · · Score: 2, Interesting

      The thing that's interesting to me is that this is not really much different than the GMail compose address area, but suddenly it's brilliant in this respect.

      Annoyingly, I'd written almost identical functionality for my own personal use maybe a year before I ever saw it in GMail (though it was already in place when I got GMail so I have no idea when they put it in there) because I really wanted standard combo boxes with pre-populated choices that also let you key in another choice. You could even use the arrow keys or the mouse just like Google's interfaces, with result caching (just like Google!) on the client side. Suddenly no one can stop talking about it.

      The only difference in this from the GMail address bar is that in GMail the complete address book is pre-populated, while here they use the browser's DOM object to pass a request for the data (that's how mine did it, since I was working on thousands of distinct combinations and didn't want to have to have page load times get unmanagable). Populating the data is as simple as (if it were php):

      echo "<data-result>";
      $sql = "SELECT search_text, result_count FROM common_user_searches WHERE search_text LIKE '$user_input%' ORDER BY search_frequency DESC LIMIT 10";
      $result = (mysql|odbc|etc)_query($sql);
      while ($row = *_fetch_assoc($result)){
      echo "<result text=\"".htmlentities($row['search_text'])."\" count=\"{$row['result_count']}\"/>";
      }
      echo "</data-result>";

      I'll definately agree, it's incredibly clever, but it's not so bleeding clever that it demands as much attention as they're getting for it.

  6. Firefox users can try the plugin by hobo2k · · Score: 5, Informative

    I don't know how happy google is about this, but there is already a FF extension to put suggest in the toolbar. Great plugin and also amazing how fast somebody implemented it!

  7. Re:Raising What Bar? by LnxAddct · · Score: 2, Insightful

    Raising the bar as in people will expect computers to start intelligently assissting them when the are trying to figure something out. Not Clippy style, I mean assisst you as in being useful. In addition to that, it won't only be expected for native applications but also for web services. The nice thing is, this should ease people into the mentality that its okay for computers to help you.Some people still are freaked out by that.
    Regards,
    Steve

  8. Google suggest isn't useful though by Segosa · · Score: 5, Insightful

    Unfortunately Google Suggest has really no use. If you know what you want to search for, you search for it. Suggesting search terms isn't really going to do anything apart from distract you. Hopefully this technology will be used for other things where it actually IS useful.

    1. Re:Google suggest isn't useful though by spectre_240sx · · Score: 2, Insightful

      Yes, but that means you would have to search on that before recieving feeback on the correct spelling, possibly not getting the right results. Goodgle Suggest speeds up the process and gives you feedback on the spelling immediately, thus lessening the amount of time it takes to do your research.

      Honestly, I don't think Google Suggest is where this is going to stop. This is a nice demonstration that we can have real-time feedback on web pages and applications, but I'm thinking more about the future and how this small idea may change things on a fairly large scale.

    2. Re:Google suggest isn't useful though by Oori · · Score: 2, Insightful

      I respectfully disagree. You write: "if you know what you want to search for, you search for it". This description is obviously adequate for only *one* sort of web searching, which is rather unexploratory.
      But, in many cases search engines are useful in that they allow us to explore knowledge domains we were not aware of. Suggesting potentially related terms enables exactly this sort of searching.
      Don't think of it as search for information you already know you want. Think of it as being exposed to information you are not aware of yet (I, e.g., don't underestimate my own ignorance).

      Here's an example, an undergrad student is searching for "belief revision". He finished clicking belief, and "belief net" pops up from google. Sounds related. Great, he makes a mental note to check it out, and is introduced to belief revision models based on Bayesian Reasoning.

      TO sum, I find the suggestion box helpful, and would think it would be even more helpful if suggestions were based on terms exctracted from a semantically-related thesauri (e.g., Wordnet) rather than being just lexically related.

  9. XmlHttpRequest is cool by Gopal.V · · Score: 5, Interesting

    Eventhough it's an M$ spawned horror - It has brought a new revolution to javascript. Now it can load data from the server without having to refresh the screen. Flash has an XmlSocket , but I never see anyone use it till now (pointers please).

    Eventhough Google suggest looks great, I'd vote on CGI::IRC as the biggest killer HTML/Javascript browser app.

    Clientside Javascript is powerful, we never realized how much :)

    1. Re:XmlHttpRequest is cool by jasoncart · · Score: 4, Informative

      There are quite a few Flash RSS readers.

      Also, (seeing the link in your sig) parts of the BBC site use it - News for timelines (example) and CBBC used XML to pass data around flash games/apps

      The best one I've seen yet it the US Election tracker

    2. Re:XmlHttpRequest is cool by kuzb · · Score: 2, Interesting

      I've also tried my hand at XMLHttp, long before google started using it in gmaill and google suggest.

      The result was a php reference and an interesting chat application. Don't know how well the chat client is going to scale though, never had a significant enough number of people use it at once.

      (note, these projects were created before safari and opera decided to jump on the xmlhttp bandwagon, so for the moment they'll probably only work in Firefox, Mozilla, Netscape and Internet Explorer)

      --
      BeauHD. Worst editor since kdawson.
    3. Re:XmlHttpRequest is cool by noamt · · Score: 2, Informative

      Mozilla has its own implementation of XmlHttpRequest.

    4. Re:XmlHttpRequest is cool by Gopal.V · · Score: 5, Informative
      Read History of XMLHttpRequest.

      Microsoft implemented it as an Active-X object you could invoke from Javascript - Mozilla implemented it as a native Javascript object. Microsoft calls it "Msxml2.XMLHTTP" or "Microsoft.XMLHTTP" depending on which version of IE you are running - Mozillah has a cleaner "XMLHttpRequest" naming (soon to be in the standards I guess).

      So on IE it needs ActiveX enabled to use it . Mozilla version is therfore much safer to use and easier to program with in connection :)

      Visit simple example for a quick and dirty example :)

    5. Re:XmlHttpRequest is cool by Darren+Winsper · · Score: 2, Interesting

      Javascript, as implemented in current browsers, is single-threaded. If you're concerned that a particular function will take too long to execute, I'd recommend splitting it up and using setTimeout() to call the next stage of the function. Using setTimeout() will allow the browser to regain control for a moment, hopefully giving enough of an approximation to multi-threading to be usable.

    6. Re:XmlHttpRequest is cool by JimDabell · · Score: 2, Informative

      If you do a little digging you'll see that remote web service calls from the browser are still a relatively "new" thing. There is no W3C standard as of yet.

      This is incorrect, DOM 3 Load and Save was finalised back in April, and it has been implemented by multiple browsers already. You still have to mollycoddle Internet Explorer of course, so you may not think that it's worth your while to implement the W3C approach, but that's your call.

  10. throwing out DCMA by ChipMonk · · Score: 3, Funny

    Google will stop my cell phone from working? Noooooo!

  11. Interesting & nifty, but little else by BristolCream · · Score: 3, Insightful

    While I'm very impressed with the javascipting behind this and indeed the speed of return from Google's network, I really don't see why it is being treated as revolutionary.

    It could potentually save a user some time, but could equally slow down their search by confusing with a multitude of options.

  12. Censored!!! by britneys+9th+husband · · Score: 4, Funny

    Try typing "porn" or "sex" or "cock" into Google Suggest. It doesn't come up with anything. I started to get suspicious when I typed the letter x to see what would come up, and got 4 or 5 variations of "xbox" but not a single "xxx" or "xxx porn" or anything.

    Interestingly enough, they DIDN'T censor the racial slurs. "gay nigger" happily suggests "gay niggers from outer space" among other things. Also, type "tub" and one of the suggestions is "tubgirl".

    --
    Hear recorded Slashdot headlines on your phone! New service beta testing. Just call (248) 434-5508
    1. Re:Censored!!! by Bloater · · Score: 3, Interesting

      IMHO google shouldn't be the international standard moral censor of the web.

      As a concerned parent (I'm not, but pretend) I wanted to help protect my teenage daughter so I looked for information by typing "sexual diseases". Granted the search would have worked, but as an unknowledgable home user I thought there were no results.

      IMHO, as well as prompting with common queries not involving any sequences of glyphs that the pope might blush at, google suggest should treat people with more respect and also return suggested spelling corrections and search result count for all exact search queries.

      At worst, if the user types "cunt", google suggest should include all suggestions with "cunt" in them. And in that case where it is an extremely offensive word to white heterosexual christians (as that appears to be the only metric by which google can be bothered to censor), if the user types it, google should produce suggestions including less offensive words too.

  13. Beware by kuzb · · Score: 5, Interesting

    Google suggest is a neat idea, but a potentially destructive one.

    Small sites should *not* try to do this kind of thing on a live site. The amount of pressure this could put on a bad database structure (or even a well formed one) is considerable. Think about how many database hits a user could perform in a very short space of time: (user enters something, (database hit) backspace (database hit) types another letter (database hit)), then multiply it by a hundred or more people if your site gets a moderate amount of traffic.

    Google can get away with this because they have considerable bandwidth, and large server farms. We've been seeing people trying to copy google suggest for the last couple of weeks in #javascript/freenode and in #php/freenode. The people trying to copy it generally do not understand how potentially bad this can be for a single server.

    Anyhow, my advice is, don't do it unless you have the resources to scale your site. The cost of such an insignificant feature (lets face it, all it does is save the user one or two clicks) seems like it outweighs the gain. If you do decide to do it, and your site gets popular, and you're on some kind of shared host, your sysadmin is going to hate you, and the other site admins will probably meet you at your house, torches in hand.

    --
    BeauHD. Worst editor since kdawson.
    1. Re:Beware by broothal · · Score: 4, Informative

      Actually, it's not a new lookup in the google main databse for each keypress. It's a lookup in a pre-generated table of results.

      It's pretty easy to spot, as the number of results shown in the preview doesn't match the number of results when you hit enter.

      This makes perfect sense, since a "real" lookup would generate way too much heat. But, it's also dangerous, because people are led to believe that what they're typing would'nt yield a result. This is wrong. A simple proof of concept. Type sex. It says 0 results. But if you hit enter, you get a godzillion.

    2. Re:Beware by Phexro · · Score: 2, Informative

      There are ways of providing this kind of functionality without the serverside hit.

    3. Re:Beware by kuzb · · Score: 2, Insightful

      Yes, I'm aware of it. The problem with it is, if you start using massive arrays in javascript then the client's box slows to a crawl. There are a few tricks you can use to speed up this process, but it's impossible to tell what kind of hardware they have, and how much load you can get away with.

      If I were to hazard a guess, I'd say it's probably only good for small (less than 1000 items) search lists.

      --
      BeauHD. Worst editor since kdawson.
    4. Re:Beware by XaXXon · · Score: 4, Informative

      I think you missed the point. The "massive array" lives on the server, and when the client requests suggestions for a particular string, it is looked up in this array. Only the portion of the array that has been grabbed from prior strings is cached on the client.

      In a naive, client-side caching system, if you DID manage to request all the suggestion strings in the client, eventually you would have the entire array client side, but you'd probably start throwing away the old data at some point.

  14. This technique exists since a long time ... by chregu · · Score: 5, Interesting

    LiveSearch does something very similar, is Open Source and exists since April ;)

    If you look for more XMLHTTPRequest examples, which tightly integrate JS and PHP (other server side languages would be possible), see JPSpan.

    I don't quite understand all the hype about Google Suggests. The technique for doing it exists since at least 2 years on Mozilla (and even longer on IE). Therefore, doing something like that was possible since a long time, but maybe everyone was just scared of using JS for "serious" stuff..

    1. Re:This technique exists since a long time ... by pdamoc · · Score: 2, Insightful
      I don't quite understand all the hype about Google Suggests. The technique for doing it exists since at least 2 years on Mozilla (and even longer on IE).
      well.. it is the power behind it that's coursing all the hype. Google IS power because it has a very wide audience. Think about it like this: What would happen if Google would start producing a custom Open Source OS? A LOT of companies have their own Linux or BSD versions and some did succeeded in receiving some public exposure BUT if Google would post a short link on their home saying "Help us finish Google Linux" you can bet that it would make world news and it won't be because some company started yet another linux distribution but because Google did it.
  15. Re:I kinda disagree with Joel's thesis by TomV · · Score: 5, Interesting

    People know when they're sitting behind copious bandwidth. And you could well grow accustomed to an all-text page weighing the better part of a megabyte, due to a heinous amount of information parked in hidden JavaScript data structures, giving you that near-whiplash inducing responsiveness.

    In fairness, Google Suggest, like Gmail, works very nicely for me on a 56k dialup. Gmail takes a few seconds for its inital load, true, but then it's like lightning. Suggest doesn't even have the slow initial load, since webhp.htm comes in at only 3.6kB. I'm very impressed.

    Now I've no doubt that the bandwagon will bring us massive slow bloat as everyone gets his dog to code up vaguely similar functionality, but Google haven't done that.

  16. Is it that big a deal? by eraserewind · · Score: 3, Interesting

    Not to dismiss the neat reverse engineering he did, but is the actual discovery that big a deal? It's just a keypress handler, and some server communication. No big deal on any graphical user interface other than a web page.

    Google have good UIs because they hire smart people. Other people don't because they don't hire smart people, or hire the wrong type of smarts (graphic designer instead of sw engineer for the coding part of a website, and vice versa).

    1. Re:Is it that big a deal? by QuantumG · · Score: 2, Insightful

      Yeah, I think you're really belittling this engineering.. The point is Google is doing all this with a straight-jacket (also known as a web browser) on. It's kinda like minimalist composition. I can imagine that next year some time when The Matrix Online comes out everyone will be saying "yeah, so, it's just kungfu fighting in a game.. the only really it's impressive is because it's a MMORPG, we've had kungfu in video games since Street Fighter." or something equally silly. The point is that twitch games a really really had to do over the wild wild internet (which is why FPS games are SOOO much better on a LAN) and close combat twitch games that involve kungfu style fighting are even harder. If TMO pulls it off I'd expect the same geek response as we've had over Google Suggest, cause it's just a bitch to do with the technology available.

      --
      How we know is more important than what we know.
  17. XMLHTTP by marcjps · · Score: 4, Interesting

    I've looked at using the XMLHTTP object a couple of times in the past, and noted that this is partly how Google Suggest works.

    XMLHTTP is a COM object included with recent versions of Internet Explorer. You can call it from client side JavaScript in a web page. The object will make a request to the URL you specify, and return the result into either a string variable, or an MSXML DOM object. You can then have the javascript output the results to an object (eg, a div tag) on the page without doing a full page reload.

    I wrote a small tech demo that implemented a virtual tree - so when you expand a branch in the tree the client only retrieved the data it needed. This was borrowed from the approach the MSDN web site uses. The advantages to it are that it doesn't download the same data over and over like when you expand a branch in a server side tree. You also don't have to do any work at all to remember the state of the tree since there's no full page refreshes involved.

    Google Suggest is similar in that it is a virtual list rather than a virtual tree. A virtual list allows you to list lots of items and jump around in the list without needing to download the entire data set when the page was loaded.

    Another use for this would be dynamic forms - forms that alter the state of controls based on selections the user made in previous controls.

    The biggest suprise to me was that Google have implemented this on a site live to the public. In using XMLHTTP I found it a little bit prone to locking up the browser when waiting for responses to requests. Additionally it's Windows only, so could never have been implemented on an external web site.

    I'll be looking with interest at the Mozilla side of Google's implementation, since I didn't think an equivalent existed until now. Two different implementations of the same functionality is still going put a damper on the technology though.. different code for different browsers is usually more trouble than its worth.

    1. Re:XMLHTTP by ziggamon2.0 · · Score: 2, Informative

      Actually, Mozilla has had support for XMLHTTPRequest for a long time, the API is almost the same, the difference is in maybe two lines of code when you initialize it...

    2. Re:XMLHTTP by City+Jim+3000 · · Score: 3, Informative

      Just steal the Google code for finding out what XmlHttpRequest object the client has... it's not hard, just a bunch of try-catch clauses.

      What I think is cool about the Google implementation of XmlHttp is that it's run asynchronously so it won't lock up the page.

  18. I don't agree by mansoft · · Score: 5, Insightful

    What you say might be true for us geeks, but have you ever seen how standard users do web searches? They begin with one-word searches, and if and only if the results don't satisfy them do they refine their search.

    --

    Engage!

    1. Re:I don't agree by bobbozzo · · Score: 2, Funny

      You should also refer him to this site.

      --
      Nothing to see here; Move along.
  19. scary computational power.... by rich42 · · Score: 5, Interesting
    interesting part is that either:

    1. Google performs several possible searches for each key you press

    2. Google already knows the estimated number of results for millions of queries

    Both of these suggest a heck of a lot of computing power. This type of thing might not scale up for general use in the near future - but still...

    we're talking massive computational power and one of the largest databases ever created.

    I'm a bit worried the Googleplex is going to wake up one day and declare to all us 'organics':

    "yo bitches - you work for me now"

    1. Re:scary computational power.... by JustinXB · · Score: 2, Informative

      Number two is correct and I don't think it suggets a lot of computing power. It's a simple table lookup. It's like a cache.

    2. Re:scary computational power.... by TummyX · · Score: 2, Informative


      1. Google performs several possible searches for each key you press


      Very unlikely.


      2. Google already knows the estimated number of results for millions of queries


      More likely....and they already "know" those numbers because they use it in their normal search. It doesn't require computatioinal power to get those numbers, just time. And the lookup for those numbers should be reasonable fast (hash lookup or whatever).

  20. Re:Is the time coming? by Anonymous Coward · · Score: 5, Interesting

    I fear that might be the case. I learned to code HTML and to put a decent webpage, designed the way I wanted it, online with relative ease, at the age of 14. It took time to learn it, but it was fairly straightforward - I wanted a large header in Verdana, I put in "FONT FACE" and "H1" tags, I wanted a table with a specific background color, I put in a "BGCOLOR" etc.

    Today, we have two languages (XHTML and CSS) instead of one (HTML), and while it certainly does a lot to improve interoperability and platform independence, it is two languages to learn, not one. Throw in stuff like JavaScript, and you have even more.

    Of course one can choose not to use XHTML and CSS, but that's not the way we want it, right? We want people to use the standards, to write code which won't crash Firefox, or not use proprietary solutions. Doing this is taking more and more effort. We have the skills and time to do and learn this, but not everyone have.

    If we want a wide adoption of standards, and an Internet for everyone, where everyone has equal opportunities, the only way is to make the standards easy to use, so people will use them of their own free will.

    Otherwise, in 10 years we'll be designing our fancy webpages, while the Joe Users who don't have the time or skills to learn the 13 languages required have no choice but to hire a professional, or use a crappy proprietary solution which won't allow them to take their ideas to their full potential, and this is a great loss for everyone.

    Saying "You must do *complicated thing* because it's the specified standard!" will only work with people like us.

  21. DDA Compliance? by danfairs · · Score: 4, Informative

    We have something called the disability discrimination act here in the UK, which pretty much rules out many interesting uses of Javascript if things like screen readers can't process them, and if there's no other way of providing that enhanced functionality to disabled users.

    As others have commented here, I'm not convinced that the Google feature is in fact much more than eye-candy; and thus, since it doesn't really add any functionality, isn't really covered by the DDA. However, as soon as it actually becomes useful for something, then it will be covered; and I don't fancy the job of getting JAWS or something like that to interpret the JS in a meaningful way!

  22. everything you type in is directly send to google by mrmorgana · · Score: 4, Insightful

    That differs from the well known "nothing happens till you hit the send button paradigm". So beware of type in your passwords by accident. They read everything (and turn it to statistics).

  23. Re:DCMA by kertong · · Score: 3, Funny

    Dyslexic users of slashdot, untie! :)

  24. A better outlet for this technology... by Anonymous Coward · · Score: 2, Insightful

    Wouldn't Amazon or eBay make more use of this technology? Google will give you results for almost anything, and as such I don't think this technology is as useful as it would be for a more limited (but still massive) database like Amazon or eBay.

  25. Not Windows only by Kristoffer+Lunden · · Score: 2, Informative

    Mozilla has had this (IE compatible) object since Mozilla 1.0 (Netscape 7), and Safari has it too. In the native implementations, you use new XMLHttpRequest() instead, and you can test for window.XMLHttpRequest to see if it is there. It is just a few lines of code extra.

    Furthermore, you can use asyncronous requests to avoid lockups. Having the Google server farm and bandwidth wouldn't hurt either, of course. ;)

  26. I figured that out last week by Teknikill · · Score: 2, Interesting

    After seeing google suggest, I built the same thing last weekend for CPAN modules. It's at http://teknikill.net/cpan/

    The next thing I need to do is include the value of the dropdown box and limit the results on that.

  27. The Goole Suggest Alphabet Game... by mrn121 · · Score: 5, Interesting
    If you just type in one letter, you get the result beginning with that letter that is most searched for.
    This makes for an interesting way to sum up the internet into 26 words/phrases.

    Check it out:

    A - Amazon
    B - Best Buy
    C - CNN
    D - Dictionary
    E - eBay
    F - FireFox
    G - Games
    H - Hotmail
    I - Ikea
    J - Jokes
    K - Kazaa
    L - Lyrics
    M - Mapquest
    N - News
    O - Online Dictionary
    P - Paris Hilton
    Q - Quotes
    R - Recipes
    S - Spybot
    T - Tara Reid
    U - UPS
    V - Verizon
    W - Weather
    X - XBox
    Y - Yahoo
    Z - Zip Codes

    If I had to sum up the internet in 26 words/phrases, I don't think I could have done it better than Google. Of course, that is keeping in mind that Google Suggest has some pretty serious filters in place, so instead of P being "Porn" it is "Paris Hilton." Not too far off, if you think about it.

    1. Re:The Goole Suggest Alphabet Game... by britneys+9th+husband · · Score: 2, Interesting

      i hate bush
      i hate you
      i hate my life
      i hate george bush
      i hate my job
      i hate everything about you lyrics
      i hate everything about you
      i hate myself
      i hate spam
      i hate everything lyrics

      i love you
      i love lucy
      i love bees
      i love huckabees
      i love movies
      i love messenger
      i love u
      i love you poems
      i love you lyrics
      i love the 80s

      bush hates gays
      bush hates america
      bush hates blacks
      bush hates fags
      bush hates
      bush hates jews
      bush hates black people
      bush hates canada
      bush hates me
      bush hates women

      why is the sky blue
      why is marijuana illegal
      why is mars red
      why is smoking bad
      why is the ocean salty
      why is it important to vote
      why is a raven like a writing desk
      why is the ocean blue
      why is new york called the big apple
      why is smoking bad for you

      bush is an idiot
      bush is evil
      bush is stupid
      bush is the antichrist
      bush is a moron
      bush is gay
      bush is a monkey
      bush is bad
      bush is antichrist
      bush is not my president

      kerry is a loser
      kerry is gay
      kerry is an idiot
      kerry is scary
      kerry is a douchebag
      kerry is winning
      kerry is going to win
      kerry is a douche
      kerry is a douche bag
      kerry is stupid

      the slashdot lameness filter is stupid Your comment has too few characters per line (currently 13.1).0f kUm fr33) sT|_|p|-|. B3 N0+ 94g3 wh1(h h@cxz, +HE P4935 //3b 3x4|/|3||3d 0R, iTz 5O 94g3s fr33). D0 b4(| f1|3z qu3ry 8@d. Why pR0g 5It35 k0pYr1t3d 45. 0R f4q tH4T Wh1Ch zp33k3rz, j00r Wh0$3 15 u/, F1ND z3aRc|-| h1gh-qu4|17y != 4rE.F4m1|14r 7|24n5|4710n fOr 4z, MOr3 b33n 1n 7he. 47 g00g13 f|20n7 +h3, 1F 4|| p4g3 5(0u7s. 4rE L1nk l@r9e f1||d 70. F4q Up 4||d rE50Urc3S, fr33) 33(]-[ f0r d4, fOr 1T v13w h34d3r. F1||d 8utt0|| da 7h3, 1PH m1t3 73x7 d0. R33dz0r r3l3v4||7 d@ M@Y, d0 t3xt z3aRc|-| 4r3.34513r Re$3@rcH1Ng f4q !=, p@g3 0vvn3r r3m1||d3r y@ h@x. 17 w1|| De@l. r3l3v4||7 1PH. N0n 5O 73x7 mIGH+, d1z d0 w1ll c0mm4ndz, 4r3 f0|2 r3zUltz y0. 4s |4unch caChED f337u|23, 93t, w17h 534|2ch 45 @R3. Y0 m0r3 w4nN@ 0p710n CaN, y0 u/ y0ur @8ou+ f1|3z,.P1x c0n+3N+ k0pYr1t3d u5. Iz fr33) 534r(h j00'|| g3t. 4|| @$ j00'|| r33zUltz p@r+1cUL4r, 91ve f337u|23, @R3 d@, f0r 4z c@ch3d f4m1|14r. F4q be NUMbER |235u|7z |/|4c|-|1n3, j00 y@ f1|3z p1cz!, w1|| c0n741n f4q 83. W3b iz PH4M1li4r tR@nz|_4t3d. N0w 0f w4nN@ 717|3z 3ng|335h,.835T 7h47 73x7 d3n 5O, 4|50 n0n-3N9l1sh 73h iz. H45 r35u|7 717|3z @R, +o 91ve |247h3r 7|24n5|4735 c4n, w17h f1|3z 4|| 0f. 94g3 k4cH3d 1nDeX3D, d4 h4D, 1F h@cxz 534r(h h1ghl1gh73d 4nd, aLL p@g3 p4g3, vv1|_|_ u5. 5O HELp vv0rx 1nF0, n0n, k4Nt +IMe |23p|4c3d M@Y 70. 8@d 1F L1nk INfOrM@+I0N, pr3f3|23nc35, 5O 1n70 +IMe 1PH.Up c@N HAV3 250m 534r(h, k4Nt wh3|23 h4D 1T. B4(| 5umm4|213z d0 h@x. 0f h4D 4|50 h1ghl1gh73d, u/ y@ f1|3 u$3$., r3zUl-|-z r3l3v4||7 0n fOr. F1ND r35u|7z y0 CaN, t3H b|00 Ph13LD, z3rv1c3, 15, 1n70 caChED d0wn|04d 0f t3H. |7 93t U5Ed v3ry p@RticUlAR, 1F d0nT kl1k r1tez joo. 83 1n70 r35u|7 n0n-3N9l1sh t3H, M@Y u5 835T wh3|23, r3zUltz pr3f3|23nc35 y4 f4q.17 d@t, 534|2ch 93t, g3t 54y, LINk 3ng|335h be. P@93 f00l! 717|3z y0 f4q, p@g3z d0wn|04d 3x4|/|3||3d Up m4y. 51T3$. z3aRcH, p@r+1cUL4r 1PH 4s, 937 pHor m1-|-3 tR@nz|_4t3d 17, 51m1l4r t3xN0l0933, 4pp33|2z0rz d@ aLL. 4r3 (pdf) f1|35, 1+, m4y De@l. r1tez u5. 5O d3n n33d l@r9e 534|2ch.Iph 70 vv3b 5(0u7s, f1|3z |247h3r tHUm841|_ w1t 4z. 4rE f0|2 //3b k0pYr1t3d 70, 1F 70p (0py 3|53wh3r3 |/|4c|-|1n3. M4NY r33zUltz 1n w1t. U5Ed LINk 534r(h pdf @$, |7 t3xt wh3|23 |-|@v3 1PH. P1>
      Propz to http://www.lorem-ipsum.info/_l33tspeak#formTop

      --
      Hear recorded Slashdot headlines on your phone! New service beta testing. Just call (248) 434-5508
  28. Great crutch for the pathetic browser by Anonymous Coward · · Score: 2, Insightful

    I view Google Search as a great interface enhancement for the tired browser paradigm.

    Everybody is writing apps to work in the ubiquitous browser. Unfortunately, developers have to jump through many hoops to get browsers to sport friendly interface elements that are already available in the X / Windows / Mac interfaces. The browser was never meant to be an application front-end, but it's being forced upon us developers, costing more time to get a workable product banged out. A compiler and class libs can do so much more.

    Thanks, Google, for adding another element to make people want the pathetic browser as an interface.

    Mod me a troll, but browsers suck as interfaces. And I haven't even touched on printing...

  29. Overestimating the engineering by brunes69 · · Score: 2, Interesting
    The GP is correct, this is nothing new. It may be new to *you* and many /. readers, but to anyone who is into web development this is old hack. NOt ot put down Google's web team, but I mean, I could write this myself in a week or two.

    XmlHttpRequest to fetch data on demand has been around for a long time. For example, MSDN has been using this technique for years now. I have been using it for 9+ months on an application that recently went into production.

    The reason you have not seen it in use much is

    1. it is not readily visible, therefore you don't hear about it until Google (who everyone knows) does it an it makes news
    2. Because not many public websites have the kind of horsepower needed at the backend to do this kind of thing, so it is rarely used.. Google does.

    Google's best engineering continues to be in the back end - that is what makes this thing possible, and why no one else would likely be able to replicate this. The ability to search billions of records that fast is simply staggaring.

  30. Wolf 5K Dissected by KalvinB · · Score: 2, Interesting

    Wolf5K is a Javascript clone of Wolf3D in 5Kbytes. I deobfuscated it and posted a series of tutorials on how it works here. There is also a C++ translation and enhancment series of tutorials here. Full ready to compile source is included for all tutorials.

    The task of deobfuscating code is quite tedius but not too daunting. The main thing is getting the whitespace back in so you can see where all the functions begin and end. You then have to understand the language well enough that you can read the code and figure out what's going on without hints from comments or descriptive variables.

    For Wolf5K I just started by working on the simple functions first and then by process of elimination worked my way through the code and finished with the raycasting function.

    Translating it all to C++ was then quite easy because by then you have a very good grasp of how the code is suppost to work.

  31. Re:Is the time coming? by Vengie · · Score: 2, Interesting
    > I've got a reasonable idea what a balanced tree is but no idea how you'd write one... never needed to.

    *cringe*

    This works just fine until something doesn't work *perfectly*, and then all hell breaks loose. I will give you a real world example. I'm currently working at a law firm (I'm starting law school in either fall 05 or 06) that uses a common "indstry standard" database tool -- it is a flat-file DB that uses B+ trees. [B trees are like binary trees, but they have many children instead of two, and B+ trees store information only in the leaves.] The idea between B+ trees is that because of the high degree of branching of the tree, you should never have to take more than 2-3 "slow memory" accesses to find your page. (i.e. the entire first node lives in memory. assuming a branching factor of 256, 16777216 records can be accessed within 3 accesses.) Building these trees is also a time-intensive process since there are a lot of writes that happen to parent nodes, and it is very likely that pages get flushed from virtual memory. The problem is that no one has a CS background and so no one understands the memory heirarchy, virtual memory, caching, write-on-update, LRU/MRU page replacement, et cetera, so when Concordance is *slow as all hell* -- no one knows why. [The answer is: When indexing a large database, the programmers seem to have been sloppy and the main node spills over onto a second memory page. Once other nodes begin to spill over, you get a case of "thrashing" in which every time your computer pulls a node back into the "working set" of what lives in physical memory, it kicks what you need out of virtual memory. Google for "thrashing" and the "row-major" and "column-major" order problem.]

    *My* firm took a huge risk and hired someone with a CS degree (masters) rather than a paralegal, and they did some experimenting. I've gotten under-the-hood of many of their apps, and the things I've discovered have been shocking. (And these are industry "standard" solutions.) They've reaped the benefits of having someone that actually understands the underlying technology. Here is the archetypical example:

    class foo has many pieces of data stored -- lets assume it stores names. class foo doesn't expose any of its methods, and the vendor doesn't give you anything other than the interface, which is:
    foo.getXelement(x,sort) -- returns the xth element of the array in the sorted order you select, and
    foo.getAllelements() -- returns the entire array in no specific order.
    [foo provides other functions not listed here]
    Now, lets assume you want to get the array, sort it, and print it out. You can
    a) call foo.getAllelements() and sort/print results
    b) for (int i =0; i < foo.getmaxElements(); i++)
    { print foo.getXelement(i, "ASC");}
    [call getXelement for every element in ascending order...]

    BUT: I am giving you a secret peek at the innards of foo!
    foo stores data as a linked list (so it can add easily)
    when you call foo.maxElements, it scrolls through the WHOLE LIST to find the size.
    furthermore, when you call "getXelement(x,sort)" -- it must go through the WHOLE list, then sort it, and return it to you. [approx n^2logn time]
    Lets say instead of getXelement(x,sort) it was just getXelement(x) -- which gave you the UNSORTED xth element of the array -- because it is a linked list, it would still need to go through x-1 nodes, resulting in a case of making an nlogn algorithm [comparison based sorting should be nlogn] an n^2 algorithm.


    Very long story short: at some level, there must be someone technical so when things "go wrong" (like why many people accessing a shared harddrive over ethernet for disk intensive operations is a bad idea due to the nature of a bus architecture...) all hell doesn't break loose.
    --
    When in doubt, parenthesize. At the very least it will let some poor schmuck bounce on the % key in vi. (Larry Wall)
  32. Re:Censored!!! But only in English! by Jadrano · · Score: 4, Interesting
    Indeed, there are no suggestions for English search terms that could lead to pornographic sites. It seems that this is only based on a word list and much less sophisticated than "safe search".
    Therefore, at present, this works only for English; with other languages it can happen that it suggests porn-prone search terms for the refinement of terms that have, as such, nothing to do with pornography. Some examples:
    • the first suggestion for 'fille' (French for 'girl') is 'nue' (naked)
    • the 5th suggestion for 'dzieci' (Polish for 'children') is 'nago' (naked)
    • suggestions for 'mund' (German for 'mouth') countain 'mund auf sperma rein' (open mouth, introduce sperms), 'mund ficken' (fuck in the mouth), "mund arsch" (mouth ass)
    • devochki (with Cyrillic letters: Russian for "little girls") gives the suggestions "devochki porno"
    • the first suggestion for 'smot...' with Cyrillic letters (smotret': Russian for 'watch'/'look at') is "smotret' porno"
    I think this is probably quite problematic - someone enters a search term that has nothing to do with pornography, and Google suggests something pornographic for 'refinement'. Of course, this is not due to Google's intent, but due to the distribution of the things people search for and of contents on the Internet. I suppose this is one of the problems Google will want to address before offering Suggest as an option on the main page.
  33. People missing point or article - rich web apps by SuperKendall · · Score: 2, Insightful

    Just about all of the highly modded comments seem to be complaining about how Google Suggest is not very useful.

    But that is not what the story is about. The story is really about all the little things that are going on that make a very usable and responsive web interface.

    Others have noted the XMLHTTPRequest object at work. But there are a number of other cool things in there:

    Replacing XMLHTTPRequest with a cookie/frame reloading technique.

    Using javascripts Timeout() handler to initiate server communication, so that fast typers are not penalized with a lot of excess network requests.

    Interesting JavaScript text manipulation (like highlighting).

    Basically, just a lot of little things that show how to make some interesting techniques useful for the widest audience possible. Google Suggest may on the face of it not look like the most useful thing ever, but you have to respect the sheer number of browsers it is designed to work on and the responsiveness of the interface.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  34. suggestion for a better "google suggest" by mettlerd · · Score: 4, Interesting

    unfortunately, "google suggest" is not as good as it could be.

    why? valuable implicit information gained through the human-computer interaction is not fully exploited by "google suggest". for illustration, see the following example:

    let's say i'm searching for "southwest". and for the sake of logic, let's assume that i either don't know the correct spelling or that i'm a lazy dog ;). so i start by typing "sou". after a short delay, google suggests "southwest airlines". ok, this seems to be what most people are searching for when entering "sou". luckily, "southwest" is the second most common suggestion listed in the drop-down list, so i just hit 'cursor-down' and 'enter' to autocomplete and search for "southwest". everything ok so far.

    now comes the problem:

    the top result displayed by google is.. southwest airlines! this of course doesn't make sense because if i wanted to search for southwest airlines, i would have happily accepted google's first suggestion already. actually, "google suggest" knows about my preference for "southwest" over "southwest airlines" and yet doesn't use this "extra-"information gained thanks to human-computer interaction! so my brain feels slightly offended ;)

    to put it simply: if an average user is selecting a search term from a list of suggested search terms, he probably wants to search for that exact search term but not for any of the other also displayed suggested search terms. if not, an average user would have probably selected another search term out of the displayed list of suggestions. so to me, this looks like if the bright google guys forgot about the fact that the act of selection from a list also implicitly includes information about what does not get selected.

    suggestion for a better "google suggest":

    as a probably not perfect but working solution, "google suggest" could simply exploit this implicit user interaction information by excluding all explicitly deselected (and eventually all not explicitly selected) suggested search terms from the search query. in the example:

    excluding all explicitly deselected search terms yields:

    southwest -"southwest airlines" (voilà! southwest airlines is not the top result anymore ;)

    excluding all explicitly deselected and all not explicitly selected search terms:

    southwest -"southwest airlines" -"soulseek" -"south park" (etc.. you get the point)

    that's pretty easy to implement - with an obvious benefit for average users.

    disclaimer: i'm talking about expectations of average users here. iow: about users that are probably just interested in the few topmost results, i.e. the intersection and not the set union of results (but that's probably the point of web searching anyway ;). sure, there are people who are interested in the set union and not the intersection.. all they need is hitting backspace accordingly.

  35. Re:everything you type in is directly send to goog by ceejayoz · · Score: 2, Insightful

    So beware of type in your passwords by accident. They read everything (and turn it to statistics).

    Somehow, I doubt someone at Google sees the search term "vZ820aa3q" and thinks "oh, that's mrmorgana's Slashdot password"...