Saturday, July 5, 2008

What Language Is This? Dot Com!

Since the language analyzer is becoming one of the most used web services that I run, the other day I was thinking that it would be cool get it its own domain (and a .dom domain costs just 50 SEK (around 850 yen in normal times) anyway). So I was thinking about what domain name to get - that isn't already taken - and well, one of the most common search phrases people use to find the language analyzer is "what language is this webpage/blog/text/whatever" and luckily whatlanguageisthis.com was available, so there it is! I think it's quite easy to remember and very easy to tell people. 4 stars out of 5, perhaps? Pretty good.


Setting up the new site was pretty easy; it's essentially just a php script that chdirs into the language analyzer directory and continues from there as before.

I also did another nice update: the data file that the app uses to identify the language is now downloaded after the page and all the application javascript files have loaded. That means the page should load much faster, and the user can start reading the instructions or entering text while the data is being downloaded in the background. If the user clicks "Go" before the data file is downloaded, it will stop and wait, while displaying a typical web 2.0-ish loading indicator.

I'm planning to add support for more languages soon, and improve identification of similar-looking languages even further. Anyway, here's the url for the new site again:
http://whatlanguageisthis.com/

Labels: , ,

Saturday, May 10, 2008

Updated the Language Identifier with ranking of most popular languages right now

Over time I've been making some smaller changes to the language analyzer (my language identification web app), like manually tuning it to better distinguish between hard-to-distinguish languages, like the Scandinavian languages, Serbian-Bosnian-Croatian-Slovenian, Afrikaans and Dutch, and Czech and Slovak.

But I've been wondering what languages people use it for, so yesterday evening, while drinking shochu (in spite of which I could only find one bug today! but I did write a processing and database-intensive function, n00b style, which I replaced with a single SQL query today...), I added logging of the results. Only when the language identification certainty is reasonably high is it logged, and only the result; the actual text inputted is not sent. This, of course, happens in the background. A language is only logged once per client, and results from clicking the "example" button (Tower of Babel extracts - I like that story) are not logged.

This morning I added the top ranking to the page. It's generated on the server side in order for the search engines to see it. The top 5 languages for the past seven days are printed. At this time, i.e. about 15 hours after the result logging started, these are Spanish, Korean, Portuguese, and Thai.

You can see the currently most inputted languages live: http://henrikfalck.com/languageanalyzer/

Labels: , ,

Sunday, January 27, 2008

The Amazing Language Analyzer Web Application

"Have you ever wondered what language a blog entry you glanced at might be in?" was the question I set out to work on more than two years ago, if memory serves me right. I always get curious when I see a blog post in an unknown language. I mean not just a language I don't speak - a language I can't identify.



I thought it would be a really hard problem to solve - writing a piece of software that could figure that out. It turned out not to be so hard though. Just hours of programming, and probably a lot of luck. Because my initial hunches on how to tune the algorithms proved to be pretty right, and I was, and still am, really startled at how good the software became.

I released it as the Wørd - Language Analyzer Opera widget. Unfortunately the target audience for Opera widgets is quite small, so I always thought of making it into a web page. I don't know why it took so long, but here it is!

The web page version has some new, cool improvements. It will try to detect as you're typing, for instance. It also has improved support for Swedish, Serbian, and Afrikaans. And the UI is in my opinion better than the widget version.

So please try it yourself and see how it works. It's pretty fun to just copy-paste any piece of text your can find on the Internet into it, or just type something in a language you know yourself and see when it gets it right. Here's the address again:

http://henrikfalck.com/languageanalyzer/

Labels: , , ,

Monday, September 24, 2007

Online Sudoku Alpha Release!

I tried to fight the urge to make a web-based sudoku, but well I just couldn't keep it up, so after I released Minesweeper I got started. Actually one of the reasons I wanted to do it was to see how much could be reused from Minesweeper to Sudoku - after all the basics are the same: a grid game field that the player modifies until it reaches a goal configuration.


But there are big differences as well. Where minesweeper starts with a randomly generated field, sudoku requires a puzzle to be correct, i.e. soluble with only one valid solution. The greatest challenge though, is to rate the difficulty of a given puzzle. Fortunately, I found one good program that can both generate and rate puzzles. My Sudoku game has an online database of thousands of puzzles, separated into five difficulty levels. Of course, it also has online high scores, just like Minesweeper.

I'm calling it an "alpha" though, because I actually suck at sudoku, so I can't really test it myself yet. I've invited people whom I know like solving sudoku puzzles to test it, and you're invited as well! Please add your comments to this blog post, and I will be extremely thankful. Things I'm looking at specifically are:
  • Are the difficulty levels correctly rated?
  • Are the puzzles "good"?
  • How can the interface be improved? I know sudoku software usually has some methods for making notations as you solve the puzzle. The next step will be to add that, but how should they be designed?
  • Any improvements you'd like to see.
  • Any bugs you find.
So please, start solving those puzzles! :)
http://henrikfalck.com/sudoku/

Labels: , , ,

Thursday, August 2, 2007

Minesweeper!

Finally! My Minesweeper game is ready for the web! It's the classic game in a web 2.0 costume. Why did I do that? when surely it's been done before. Because I like minesweeper.

Developing this game has taught me one something about the time it can take from prototype to somewhat finished product: Developing the completely playable "offline" prototype version was quick and easy - after all, I developed minesweeper already in high school on my programmable Casio calculator. So I thought it would take about trice the time to finish it, but in the end it took about ten times that time.

One reason for this is the online highscore functionality. But T-rex, online highscores just means keeping a list of the best times on the server and sending it to the client. Yes, but then it wouldn't take much to figure that all you need to do is type "register_highscore.php?time=0&name=script%20kiddie" into your browser's address field to get an instant all-time high. So how did I solve that?

The game is played simultaneously on the client (i.e. in the web browser) and on the server (in php). Sweeps are sent at regular intervals to the server, which then plays the same moves and checks the results. So in the end it's the server that decides that a game is over, how long it took, and whether that's a new highscore or not. That, ideally, is not so complicated either, but well there are lots of opportunities to make stupid mistakes. (Especially when you're having a shochu on the rocks while coding (I did it during my vacation).)

The other reason is that it's hard to make a web app behave like a nifty game. You need graphics, animations, and that kind of stuff that often causes you to run into problems with layout positioning and, most of all, browser inconsistencies. Web browsers just aren't ideal for making applications yet. (Well, tell me a platform that is, anyway...) The game runs best, as always, in Firefox. Although I admit I haven't tried IE 6 yet. I'll tackle that beast tomorrow. :) IE 7 works good, though.

I still have a number of features planned that I'll implement during the coming weeks, but at least now it's good enough to play. Try and beat my times! Here's the url again:

http://henrikfalck.com/minesweeper/

Labels: , , , ,

Sunday, July 15, 2007

The Days of Web Standards

As I mentioned before, I was going to appear at The Days of Web Standards, 2007. And as also mentioned, I was working on an ajax messaging library. I'm sitting here at the Days in Akihabara now, listening to one of the last presentations for the day. There's quite a lot of people here, and there's a certain conferency mood in the air. I have the W3C on my left and the Mozilla Corp. on my right. Got some nice Firefox stickers.

I combined the two mentioned matters and did a presentation and demo developing a chat widget using the freshly-released Ajax Messaging Library. Well, it's in early beta quality with many features planned but not yet implemented, but it works! Even on stage (except for a small bug, hehe). Anyway, it's out there now! I'll write more about it later.

P.S. I did the presentation in my socks; my shoes were drenched this morning by Typhoon no. 4.

Labels: , , , , ,

Thursday, July 5, 2007

A JavaScript messaging library

I'm working on a library for sending messages between browsers using JavaScript, XMLHttpRequest, and PHP/sqlite on a server. The idea is that even though it's not possible to open a connection of sorts directly between the clients (i.e. web browsers viewing a page, or even different pages, or running a widget), you can pull for updates in a way that will make it seem like you have a connection open. Not only that, but all client listening on the same channel, so to speak, will receive the messages, so it's like broadcasting. Technically this is nothing fancy, it's just that you don't see it much, and if implemented and packaged nicely I think it'll be useful and fun to use.

How do I know this works? Because it's based on a much cleaned up version of the code used on paintmyblog.com - which has proven itself already. I look forward to writing some cool apps using this library, and I hope other people will use it as well. Expect the first release next week.

Labels: , , , , , ,