Not having coded in C# before, I decided this was an opportunity to try out the language. It's very nice! We approve. ;)
Included is an assembly (ip2country.cs), a command line test app. (ip2c.cs) and a GUI benchmark app. (ip2c_bench). There is a .bat file to compile, if you need that. The package also contains a version of the binary database.
The speed achieved on my P4 2 GHz 512MB RAM varies, but top speed seems to be around 1,17 million lookups/second.
This actually compiles under linux with mono. I haven't tried compiling the GUI (don't know if it can), but the command line tool runs fine, but seems a bit slow, although I can't be sure without the benchmark (which I don't feel like writing a command line version of right now).
Please bear in mind, that we're not C# developers, well we are, but not very seasoned ones ;) If you find any bugs, or have suggestions/improvements, you're welcome to mail us!
ip2c-csharp-0.9.2.tar.bz2 - C# Source code bzip2'ed (647 KB)
ip2c-csharp-0.9.2.zip - C# Source code zipped (547 KB)
| Etomite encountered the following error while attempting to parse the requested resource: | |||
| « PHP Parse Error » | |||
| PHP error debug | |||
| Error: | mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) | ||
| Error type/ Nr.: | Warning - 2 | ||
| File: | /www/weirdsilence/weirdsilence.net/www/index.php | ||
| Line: | 118 | ||
| Line 118 source: | if(@!$this->rs = mysql_connect($this->dbConfig['host'], $this->dbConfig['user'], $this->dbConfig['pass'])) { | ||
| Parser timing | |||
| MySQL: | 0.0000 s s | (0 Requests) | |
| PHP: | 0.0311 s s | ||
| Total: | 0.0311 s s | ||