September 30, 2007

Semantic Similarity, False Friends, Cognates and Words Alignments @ RANLP 2007 Conference

As part of my PhD research I attended the RANLP 2007 conference in Borovets, Bulgaria (Recent Advances in Natural Language Processing – 2007) to present two scientific papers and a novel algorithm for measuring semantic similarity between words by searching Google and analyzing the local contexts comming for the returned page excerpts.

Improved Word Alignments Using the Web as a Corpus

With my co-authors we presented an approach for improving word alignments by combining orthographic similarity measure designed for Russian/Bulgarian with semantic similarity measure. The full paper is available here: Improved Word Alignments Using the Web as a Corpus (PDF). The presentation is also available: Improved Word Alignments – Presentation RANLP 2007 (PPT).

Cognate or False Friend? Ask the Web!

With my co-authors we presented a novel algorithm for distinguishing between cognates and false friends. The algorithm is based on improved version of our semantic similarity measure that uses the Web as a corpus. We also published an evaluation of its performance for Russian/Bulgarian. The full paper is available here: Cognate or False Friend? Ask the Web! (PDF). The presentation is also available: Cognate or False Friend? Ask the Web? (PPT). We also recorded video of my talk and the discussion: Cognate-or-False-Friend-Ask-the-Web-v1.0.avi.

Tags: , , , , , , , , ,

BGJUG First Meeting, BASD Seminar, GWT Talk

On 26th of September 2007 I and Peter Tahchiev organized the first meeting of the Bulgarian Java User Group (BGJUG) running at the Bulgarian Association of Software Developers (BASD). It was attended by about 120 Java developers. It is a good start!

BGJUG first meeting - GWT talk by Svetlin Nakov

I gave a talk on AJAX applications development with the Google Web Toolkit (GWT) technology.

Svetlin Nakov talking about GWT

I presented the fundamentals of GWT and made few live demonstrations including creating custom widgets and using RPC services. The GWT presentation, the demonstrations and the video recording (in Bulgarian) are available for download from the seminar’s official page.

There was high interest to my talk and to the event as a whole. Good job!

The BGJUG will meet regularly once monthly, each last Wednesday of the month. I hope the Java community will constantly grow and the events will become better and better.

Tags: , , , , , , , , ,

September 18, 2007

Forcing Windows to Hibernate

I usually use my home machine (running Windows 2003) from my office through Remote desktop. Sometimes in the evenings I want to hibernate it but the hibernation fails if I have used the machine remotely even if all remote connections are closed. I think this is a bug but I am not sure.

In the event log I see this message: “A request to suspend power was
denied by winlogon.exe”. This means that Windows intentionally does not want to hibernate because it thinks some remote users are still connected (which is not true).

I found two solutions to this problem:

1) Instead of using Start –> Shut Down –> Hibernate, use this command from the console:

shutdown /f /h

2) Compile and use this C# code to force Hibernation programmatically:

using System;
using System.Windows.Forms;

public class ForceWindowsHibernate
{
static void Main()
{
Application.SetSuspendState(PowerState.Hibernate, true, false);
}
}

Tags: , , , , , , , , ,

September 16, 2007

svnleave – a Tool for Cleaning-up an SVN Directory

When you need to copy a project that resides in a Subversion repository to another location or send a piece of the source code by email, you need to clean the all .svn or _svn files from its directory structure.

I know an easy way to do this by the TortoiseSVN GUI client for Windows:

SVN export

This works pretty well but sometime you need more simple solution: removing all .svn directories from given project. I didn’t found any useful tool for this so I wrote one: svnleave.

My favourite programming language for writing such small programs is C#. It is highly productive, user friendly, have very good development environment and runs on any Windows machine (I mostly use Windows as desktop).

Here is the source code:

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

/**
 * This utility deletes all ".svn" and "_svn" directories from
 * the current directory and its subdirectories recursively. It
 * is helpful when you need to send to somebody a part of your
 * project that is under version control with Subversion.
 *
 * The "svn export" command can help in most cases but this
 * solution can be better when you cannot perform export.
 */
class SVNLeave
{
    static void Main(string[] args)
    {
        string currentDir = Directory.GetCurrentDirectory();
        DeleteSVNDirectories(currentDir);
    }

    /**
     * Deletes all ".svn" and "_svn" directories from given directory
     * recursively in depth.
     */
    private static void DeleteSVNDirectories(string path)
    {
        string[] subdirs = Directory.GetDirectories(path);
        foreach (string subdir in subdirs)
        {
            FileInfo subdirFileInfo = new FileInfo(subdir);
            String subdirName = subdirFileInfo.Name;
            if ((subdirName == ".svn") || (subdirName == "_svn"))
            {
                DeleteSubdirectory(subdir);
            }
            else
            {
                DeleteSVNDirectories(subdir);
            }
        }
    }

    /**
     * Deletes a directory along with all its subdirectories. Unlike
     * Directory.Delete(path, true) deletes read-only and system files.
     */
    private static void DeleteSubdirectory(string path)
    {
        string[] subdirs = Directory.GetDirectories(path);
        foreach (string subdir in subdirs)
        {
            DeleteSubdirectory(subdir);
        }

        string[] files = Directory.GetFiles(path);
        foreach (String file in files)
        {
            File.SetAttributes(file, FileAttributes.Normal);
            File.Delete(file);
        }

        File.SetAttributes(path, FileAttributes.Normal);
        Directory.Delete(path, false);
    }

}

A compiled version svnleave for .NET Framework 2.0 is available for download here: svnleave.exe.

Tags: , , , , , , , , ,

Bulgarian .NET User Group at the Bulgarian Association of Software Developers

The Bulgarian Association of Software Developers (BASD) which I currently manage is about to start a new division – Bulgarian .NET User Group. The division will focus on Microsoft technologies and will organize seminars, meetings, courses and will run other projects.

Bulgarian Association of Software Developers (BASD) is working on .NET technology for several years. We have successfully completed several community projects:

I believe we will be soon approved to join the International .NET Association (INETA).

Tags: , , , , , , , , ,

September 13, 2007

Bulgarian Java User Group

The Bulgarian Association of Software Developers (BASD) which I lead for the last few years launches a Bulgarian Java User Group:

Java User Groups

The groups will perform regular meetings in Sofia once monthly and will organize technical events and discussions. It will have separate web site (http://www.java-bg.net) and independent membership regardless of the membership in the association. The first meeting will be in the end of September 2007. I will post about it.

Tags: , , , , , , , , ,

September 5, 2007

Caching Google RPC Services (in GWT)

In my current GWT project I have some data comming from the server side but is unlikely to be changed during the execution of the project. This is the the list of languages available in the system. I wanted to cache the requests to the RPC service that returns the list of available languages so that this list to be dowloaded only once.

What I done:

public class LanguageServiceAsyncCache {

  private static LanguageDTO[] languagesCache = null;

  public static void getLanguages(final AsyncCallback callback) {
    if (languagesCache != null) {
      // Languages are cached, return the cached instance
      callback.onSuccess(languagesCache);
    }
    else {
      // Execute a RPC service to get the languages list
      LanguagesServiceAsync languagesServiceAsync =
        ServiceUtils.getLanguagesServiceAsync();
      languagesServiceAsync.getLanguages(new AsyncCallback() {
        public void onSuccess(Object result) {
          languagesCache = (LanguageDTO[]) result;
          callback.onSuccess(languagesCache);
       }
       public void onFailure(Throwable caught) {
         callback.onFailure(caught);
      }
    });
  }
}
}

In the above code the LanguageDTO class is simple JavaBean that transports the data from the server to the client (see Data Transfer Object pattern). The ServiceUtils is a simple class that keeps the client proxies of the RPC services as singletons. It is used to ensure that teh service proxy for each RPC srevice is created no more than once.

Tags: , , , , , , , , ,

Older Posts »