Crazy piece of code: Checking query parameter

Posted by Dmytro Shteflyuk on under ASP.NET

How often you are laughing out loud when looking on the someone’s code? Today I found great code in my current project and I can’t hold posting this to my blog. So,

1
2
3
4
5
6
7
8
9
10
11
if (Request.QueryString.HasKeys())
{
    string[] keys = Request.QueryString.AllKeys;
    foreach (string k in keys)
    {
        if (k == "memberpagemode" && (string)Request.QueryString.GetValues(k).GetValue(0) == "edit")
        {
            pSett.ChangeFormViewMode(FormViewMode.Edit);
        }
    }
}

And how do you search through the hash for a key with specified value?

Sphinx Client API 0.3.1 and 0.4.0 r909 for Sphinx 0.9.8 r909 released

Posted by Dmytro Shteflyuk on under Ruby & Rails

Sphinx Search Engine I have a good news: Sphinx Client API has been updated and now it supports all brand new features of the unstable Sphinx 0.9.8 development snapshot. What does it mean for you as a developer? What features you will get if you would decide to switch to the new version? I will describe most valuable improvements of the Sphinx in this article, and will show how to use them with new Sphinx Client API 0.4.0 r909.

Read the rest of entry »

Generating content for the Facebook’s setFBML method in ASP.NET

Posted by Dmytro Shteflyuk on under ASP.NET

In my current project we decided to build a Facebook application. This is really great platform with many interesting ideas inside, which usually means that you will spend a much time to make your application working as expected. Today I wanna talk about user profiles. Any Facebook application could add some action links, which will be displayed under the user’s picture, and some content for wide or narrow column. Of course, you can use FBML syntax, especially fb:if-... tags set to choose which content to show on specific profiles to concrete users.

Read the rest of entry »

Human computations

Posted by Dmytro Shteflyuk on under Links

Very cool video about free human resources usage I have found the other day. As you could see from my resume, I’m graduated from the Intelligent Decision Support Systems Department of the Kharkov National University of Radio-Electronics. I don’t remember too much from my courses (but I know where and what to search when some sort of knowledge will be necessary, be sure), but what had stuck in my memory is that there are tons of tasks which can’t be easily solved: images classification, object detection, automatic expert systems knowledge bases building, etc. Some of these tasks are partially solved and have satisfactory results (for example mathematical and statistical methods of objects detection), others have bypassing methods (for example, Google uses text from HTML links to classify images). The main reason is that computers are not so smart as humans (maybe it’s not so bad, just think of the “The Matrix” movie).

Read the rest of entry »