Saturday, February 27, 2010
giza++ under windows
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
make GNU Make 3.81 (built for i686-pc-cygwin)
With
$ make
under giza-pp-v1.0.3\giza-pp I have obtained two executables: GIZA++-v2/GIZA++.exe and mkcls-v2/mkcls.exe which perfectly run under Windows XP Professional Version 2002 SP 2.
Saturday, December 19, 2009
RuSSIR'2010
4th Russian Summer School in Information Retrieval (RuSSIR 2010)
Monday September 13 - Saturday September 18, 2010
Voronezh, Russia
http://romip.ru/russir2010/eng/
FIRST CALL FOR COURSE PROPOSALS
The 4th Russian Summer School in Information Retrieval (RuSSIR 2010) will be held on September 13-18, 2010 in Voronezh, Russia, one of the major cities in south-western Russia. The mission of the school is to teach students about modern problems and methods in Information Retrieval; to stimulate scientific research in the field of Information Retrieval; and to create an opportunity for informal contacts among scientists, students and industry professionals. The Russian Conference for Young Scientists in Information Retrieval will be co-located with the school. RuSSIR 2010 will offer 4 or 5 courses and host approximately 100 participants. The working languages of the school are English (preferable) and Russian. The target audience of RuSSIR is advanced graduate and PhD students, post-doctoral researchers, academic and industrial researchers, and developers.
The RuSSIR 2010 Organizing Committee invites proposals for courses on a wide
range of IR-related topics, including but not limited to:
- IR theory and models
- IR architectures
- Algorithms and data structures for IR
- Text IR
- Multimedia (including music, speech, image, video) IR
- Natural language techniques for IR tasks
- User interfaces for IR
- Web IR (including duplicate detection, hyperlink analysis, query logs)
- Text mining, information and fact extraction
- Mobile applications for IR
- Dynamic media IR (blogs, news, WIKIs)
- Social IR (collaborative filtering, tagging, recommender systems)
- IR evaluation.
Each course should consist of five 90-minute-long sessions (normally in five consecutive days). The course may include both lectures and practical exercises in computer labs.
RuSSIR 2010 organizers will cover travel expenses and accommodations at the school for one lecturer per course, but there is no additional honorarium. The RuSSIR organizers would highly appreciate if, whenever possible, lecturers could find alternative funding to cover travel and accommodation expenses and indicate this possibility in the proposal.
Course proposals for RuSSIR 2010 must be submitted by email to Pavel Braslavski (pb@yandex-team.ru), by February 14, 2010. A course proposal should contain a brief description of the course (up to 200 words), preferred schedule, prerequisites, equipment needs, a short description of teaching/research experience and contact information of the lecturer(s). All proposals will be evaluated by the RuSSIR 2010 program committee according to the school goals, presentation clarity, lecturer’s qualifications and experience. Topics not featured at previous RuSSIRs are preferred. All submitters will be notified by March 1, 2010. Early informal inquiries about the school or the proposal evaluation process are encouraged.
About RuSSIR: The Russian Summer School in Information Retrieval is co-organized by the Russian Information Retrieval Evaluation Seminar (ROMIP) and Voronezh State University. Previous schools took place in Ekaterinburg, Taganrog, and
Petrozavodsk. Previous RuSSIR courses included IR Models (by Djoerd Hiemstra), Modeling Web Searcher Behavior and Interactions (by Eugene Agichtein), Computational Advertising (by James Shanahan), Text Mining, Information and Fact Extraction (by Marie-Francine Moens), Natural Language Processing for Information Access (by Horacio Saggion), Music IR (by Andreas Rauber), and other. Ricardo Baeza-Yates, VP of Research for Europe and Latin America at Yahoo, has confirmed as an invited lecturer for RuSSIR 2010 with the course 'Web data mining'.
About the RuSSIR 2010 location: Voronezh is a major city in southwestern Russia, spanning both sides of the Voronezh River, with population of 850,000. Express trains from Moscow to Voronezh take about 10 hours. There are also regular flights from Moscow, Munich, Prague, Tel-Aviv, and Istanbul. The town was founded in 1586. In the 17th century, Voronezh gradually evolved into a sizeable town, especially after Tsar Peter the Great built a dockyard in Voronezh. Currently, Voronezh is an administrative, economic and cultural center of the Voronezh region. Voronezh surrounding area has many attractions including archeological museum, nature and historical reserve Divnogorie, Kostomarovo cave monastery, Orlov trotter stud farm at Khrenovoe. Voronezh has a large student population: 37 institutions of higher education and 53 colleges educating over 127,000 students today. Voronezh State University was founded in 1918 and is one of the largest universities in Russia, with a total enrollment of 22,000.
Contacts
Use the e-mail address and substitute [at] with @ and [dot] with "." school[at]romip[dot]ru.
Monday, November 30, 2009
Semantic Analysis: theory, applications and use cases
Monday, October 12, 2009
Augmented Reality with Adobe Flash
As the presenters define it, AR is superimposing "graphics over real-world environments in realtime". So I checked out the exciting (and long) tutorial on how to set up the development environment to hit the road. For running a quick demo from the tutorial I printed a black and white pattern (it makes sense to make it smaller, than I made, as it is much easier to handle). Before diving into details I decided to have a clue on how it is going to look like and made a small video which I share with you (please be patient about video quality and mute your player).
It is early to draw any conclusions on the future of AR, but it sounds like a very exciting field of software development in the future. It is where creative people get together and come up with an exciting business card and all sorts of interesting things.
Wednesday, September 16, 2009
Sting's programmer's mind
"I quite like using songs as a modular system where you can mix and match lines from different songs. It's a tradition now and people expect it. Basically, it's all one big song. You could say it was an aspect of postmodernism if you liked but you'd be called pretentious if you said that."
Perl: concise way to map one array onto antother in perl hash
my @ar1 = (...);
my @ar2 = (...);
Easy way to map ar1 (keys) onto ar2 in perl is:
my %hash;
@hash{@ar1} = (@ar2) x @ar1;
Important assumption: the order in this two arrays matters. In other words first element of ar1 maps to first element of ar2, ..., n-th element of first array ar1 maps onto n-th element of ar2 and there exactly n elements in both arrays.
Examples
It is OK to have unique keys, obviously for the hash to preserve correct mapping (include use Data::Dumper in your code):
sub unique_mapping
{
my @ar1 = ('a', 'b', 'c', 'd', 'e');
my @ar2 = ('1', '2', '3', '4', '5');
print Dumper(\@ar1);
print Dumper(\@ar2);
my %hash;
@hash{@ar1} = (@ar2) x @ar1;
print Dumper(\%hash);
}
Result:
$VAR1 = [
'a',
'b',
'c',
'd',
'e'
];
$VAR1 = [
'1',
'2',
'3',
'4',
'5'
];
$VAR1 = {
'e' => '5',
'c' => '3',
'a' => '1',
'b' => '2',
'd' => '4'
};
The mapping is not what you might want to have in the case when keys are not unique:
sub keys_non_unique_mapping
{
my @ar1 = ('a', 'b', 'b', 'd', 'e');
my @ar2 = ('1', '2', '3', '4', '5');
print Dumper(\@ar1);
print Dumper(\@ar2);
my %hash;
@hash{@ar1} = (@ar2) x @ar1;
print Dumper(\%hash);
}
Result:
$VAR1 = [
'a',
'b',
'b',
'd',
'e'
];
$VAR1 = [
'1',
'2',
'3',
'4',
'5'
];
$VAR1 = {
'e' => '5',
'a' => '1',
'b' => '3',
'd' => '4'
};
Monday, September 14, 2009
Logging: helpful perl snippet to start with
use strict;
my $log_file=file_string_here;
my $LOG_HANDLE = open_log_file_for_writing($log_file);
log_entry($LOG_HANDLE, "Logging started");
log_entry($LOG_HANDLE, "Logging finished");
close_log_file($LOG_HANDLE);
sub open_log_file_for_writing
{
my $log_file = shift;
my $LOGGING_HANDLE;
print "INFO Opening log file...\n";
unless(open $LOGGING_HANDLE, ">> ", $log_file) {
return undef;
}
my $current_time = localtime;
print $LOGGING_HANDLE "\n".$current_time."\n";
return $LOGGING_HANDLE;
}
sub log_entry
{
my $LOGGING_HANDLE = shift;
my $log_entry = shift;
print $LOGGING_HANDLE $log_entry."\n";
}
sub close_log_file
{
my $LOGGING_HANDLE = shift;
print "INFO Closing log file...\n";
close($LOGGING_HANDLE);
}
upd: the logging handle can be externalized for easing the use of the logging. It comes at cost of global variable, but might still suit moderately sized perl-scripts. Code will change a bit:
my $g_LOGGING_HANDLE = open_log_file_for_writing($log_file);
log_entry("Logging started");
sub log_entry
{
my $log_entry = shift;
print $g_LOGGING_HANDLE $log_entry."\n";
}
Now you can call log("log entry goes here") from where you want quickly, without the need to pass down as well the logging handle, for example deep inside some procedure or function.
upd1: If you want to control whether to log or not, another small modification will do it for you:
my $LOG_ENABLED = 1; # put 1 to enable logging, 0 to disable logging
my $log_file = "plugin_request.log";
...
my $g_LOGGING_HANDLE;
undef $g_LOGGING_HANDLE;
if ($LOG_ENABLED)
{
$g_LOGGING_HANDLE = open_log_file_for_writing($log_file);
}
...
sub log_entry
{
my $log_entry = shift;
return if (!defined($g_LOGGING_HANDLE));
print $g_LOGGING_HANDLE $log_entry."\n";
}
sub close_log_file
{
my $LOGGING_HANDLE = shift;
return if (!defined($g_LOGGING_HANDLE));
print "INFO Closing log file...\n";
close($LOGGING_HANDLE);
}
Friday, September 11, 2009
C++: if file line length exceeds array (buffer) length
// read input file line by line
// allocate 256 characters for each line
ifstream input_file("some_file.txt");
const int BUF_SIZE=256;
char buf[BUF_SIZE];
string s, strCurString;
if (!input_file.is_open())
{
cerr << "File some_file.txt coudl not be open!" << endl;
getch();
exit(EXIT_FAILURE);
}
while(!input_file.eof()) {
input_file.getline(buf, BUF_SIZE);
strCurString = buf;
s += strCurString;
}
cout << "File contents: " << endl << s << endl;
But what if the current file length exceeds BUF_SIZE? Well, in this case the while loop will never end, becoming an infinite loop. Why? Simply, because in the input file stream object a special bit (failbit) will be set, saying that the last getline() operation has failed (in this case not due to the end of a file, but due to the buffer length exceeding). In this case all subsequent calls to getline() will fail to read anything (can be seen by calling input_file.gcount(), which constantly returns 0 (zero) after the last getline() call that led to setting a failbit).
To overcome this, we can use a trick found here:
// read input file line by line
// allocate 256 characters for each line
ifstream input_file("some_file.txt");
const int BUF_SIZE=256;
char buf[BUF_SIZE];
string s, strCurString;
if (!input_file.is_open())
{
cerr << "File some_file.txt coudl not be open!" << endl;
getch();
exit(EXIT_FAILURE);
}
while(!input_file.eof()) {
input_file.getline(buf, BUF_SIZE);
// remember about failbit when amount of
// characters in the current line is
// more than BUF_SIZE
if (input_file.fail() && !input_file.eof())
// clear up the failbit and
// continue reading the input file
input_file.clear();
strCurString = buf;
s += strCurString;
}
cout << "File contents: " << endl << s << endl;
Monday, August 31, 2009
HackDay'09
Sunday, August 2, 2009
Porvoo is a unique old city, but old town is disgustful
Surprised with the topic formulation? Read on for the details.
Visiting Porvoo
The unique old city is the old city of Porvoo [1] we have visited today. It's been a pleasure, though it was raining almost all the time. Some photos here [2]. Comments in Russian though (well, as it was once said in a humourous russian show KVN, "learn Russian in order to understand humour" and vice versa). Why Porvoo might have become widely known is thanks to a fact Finland had been declared autonomous Grand Duche of Russia in the local cathedral.
Related work and criticism
I usually try to avoid posting any anti-ads in the blog, but this time it's unavoidable. It is about the second part - old town, which is the restaurant with reported refined taste and special service. Well, it was about 16:00 already, but should it make any difference for the service quality? First we have waited way too much time for placing an order, basically from being *very* hungry to the point of thoughts to leave getting nothing for our pains. When the waitress came down, she missed the soup story completely leading to two of us having a soup (delicious, nothing to say!) instead of one. But the topic adjective starts with pasta. Have you ever eaten the fast food spaghetti? Somewhere in a student dormitory may be or in a camp. So take this spaghetti, add some sea food (which is nice however) and put it into the micro. The taste was something like this. We experienced culmination for an ordered and never arrived dessert. As some random passers-by might have fetched all the cakes we have ordered coupled with black tea, the wairtress wasn't very confused to inform us that only one cake left. Why that happened? Because the restaurant had another side feature: a cafe. Sounds like a multitier technology, right? Which in practice averages to a (restaurant + cafe) / 2 quality level. The place has managed to blur the impression about Porvoo as right after that we have left the city, but thinking about it now, when about 5h passed, I generally feel the journey was pleasant. We decided not to slap our wrathful feelings into their face, but to publish this post.
Discussion
We have thought about why the restaurant quality was *that* not good and came to the conclusion that the target audience of it was tourists. Which means mostly occasional visitors, who will never remember it (as they usually don't come back) even if it wasn't worthwhile. Also, if you do care about your clients, think twice of coupling a restaurant with a cafe in the same cramped premise.
Conclusion
Instead of blurring, use sharpening: go for a home pizza or may be visit some really expensive place to eat and polish the collected impressions of your day in Porvoo.
Bibliography
[1] http://en.wikipedia.org/wiki/Porvoo_Cathedral
[2] http://picasaweb.google.ru/dmitry.kan/Porvoo#
Friday, July 31, 2009
Perl: trust programmatic access to VB Project
If you came to the following problem when accessing the the VB Project programmatically from your Perl script:
"Programmatic access to Visual Basic Project is not trusted"
, you will need to allow the access and trust in your target MS Office app:
Office 2003 and Office XP
1. Open the Office 2003 or Office XP application in question. On the Tools menu, click Macro, and then click Security to open the Macro Security dialog box.
2. On the Trusted Sources tab, click to select the Trust access to Visual Basic Project check box to turn on access.
3. Click OK to apply the setting. You may need to restart the application for the code to run properly if you automate from a Component Object Model (COM) add-in or template.
Office 2007
1. Open the 2007 Microsoft Office system application in question. Click the Microsoft Office button, and then click Application Options.
2. Click the Trust Center tab, and then click Trust Center Settings.
3. Click the Macro Settings tab, click to select the Trust access to the VBA project object model check box, and then click OK.
4. Click OK.
Tuesday, July 28, 2009
Java: encoding and listing files in a directory
Encoding. When your input text files are in encoding different from your default platform's there is no way to use FileReader in this case. Instead you should go deeper in the class hierarchy and specify a file enconding, which you know in advance. Code (inspired by answers here):
private static String loadFileContents(String filename)
throws FileNotFoundException, IOException {
StringBuilder contents = new StringBuilder();
InputStream is =
new BufferedInputStream(new FileInputStream(filename));
Reader reader = new InputStreamReader(is, "UTF8");
BufferedReader bufferedReader =
new BufferedReader(reader);
String line;
while ( (line = bufferedReader.readLine()) != null ) {
contents.append(line + "\n");
}
return contents.toString();
}
Directory listing. Suppose you want to list files in a directory based on some filename criteria. Easy way to do this is to implement a custom filename filter. Entire code (watched here):
/**
*
*/
package org.dk.mt;
import java.io.File;
import java.io.FilenameFilter;
/**
* @author Dmitry_Kan
*
* Lists given directory based on filename pattern
*/
public class DirectoryLister {
private String filenamePattern;
private String dirname;
public DirectoryLister(String filepat, String directory) {
filenamePattern = filepat;
dirname = directory;
}
public String[] getListOfFiles() {
class CustomFilter implements FilenameFilter {
public boolean accept(File dir, String s) {
if (s.contains(filenamePattern) && s.contains("txt") )
return true;
return false;
}
}
return new java.io.File(dirname).list(new CustomFilter());
}
}
Wednesday, July 22, 2009
tabs in Firefox 3.5.1
Friday, July 17, 2009
Post builder script for CGI development in Eclipse
In CGI development it may be a lot of help to have some sort of a post builder script. The primary aim of this script should be updating the cgi scenario(s) and modules when you build your perl project under Eclipse.
So I have come up with the following post_builder_script.pl:
#!/usr/bin/perl -w
use strict;
# append "/" to the target path if required
my $target_path = $ARGV[0];
if (not( $target_path =~ m/\/$/)) {
$target_path .= "/";
}
# copy cgi script: what, from where, to where
my $file = "uni_search.cgi";
my $copy_base_path = "../";
my $copy_from = $copy_base_path.$file;
my $copy_to = $target_path.$file;
copy($copy_from, $copy_to);
# copy Perl modules
my @modules = ("Module1.pm", "Module2.pm", "Module3.pm");
my $modules_path = "some_path/";
$copy_base_path = "./";
my $target_copy_base_path = $target_path.$modules_path;
foreach my $module(@modules) {
copy($copy_base_path.$module,
$target_copy_base_path.$module);
}
sub copy
{
my $copy_from = shift;
my $copy_to = shift;
my $result;
# chmod'ing
$result = system("echo ".[your_sudo_password_here].
" | sudo -S chmod +w ".$copy_to);
print "Changing write rights: ".$result."\n";
# updates / copies the cgi script to server
$result = system("sudo cp ".$copy_from." ".$copy_to);
if ($result == 0) {
print "Result of copying the ".$copy_from.
" to server's cgi-bin: ".$result."\n\n";
}
}
It is easy to add a builder which will call the script. In Perl perspective go to Project->Properties->Builders. Select "New..." on the right. Choose "Program" in the popup window. Configure the program by choosing what to launch, where and command line arguments:
There you go. After the builder has been successfully configured, edit your code and do full rebuild (select the root node of your project and Project->Build Project), when you want to deploy your cgi script set to your web server.
Thursday, July 9, 2009
Information retrieval: conceptual problem
interfaces (not grep ones as grep serves other aims) is that they lack one major feature. It is the feature of visualizing the search space or from other perspective -- a feature of search hints.
Suppose I want to search *something* about HTTP protocol (some very specific detail) and I know very little about HTTP (an artificial example). So for example, I even don't know which category does that particular detail belongs too.
Needless to say, that I don't know the term which I'm looking for. Now I'm stuck. I should have some starting hints, which would lead me to first query terms apart from HTTP. Because HTTP is very wide term in a tree of terms (like the tree root), I will spend hours and hours reading through millions of returned hits.
Instead, I would use a concept graph, visualized, which directly corresponds to the search index of a searching engine.
Now I can easily jump in a concise way over those categories getting deeper and deeper into HTTP topic and discovering
some previously unknown terms, which I can further search for. Thus narrowing down the search space with the parallel learning I would come to a result faster.
Tuesday, June 30, 2009
Perl is truly weird
It is actually $#($ar_ref) which is the last index of an array referenced via $ar_ref.
Friday, June 26, 2009
Michael's last curtain call
But the strangest thing is - when now I see him performing on my screen, I do not *feel* him passed away. It is half sad and half light feeling about what happened.
"This is it. This is the final curtain call." Michael Jackson
Wednesday, June 24, 2009
Gmail: spam handling as a user experience
1) I'm rather busy at work to find their blog
2) let's check Google's track_everything_happening_on_the_web property
About spam again. Recently I have been receiving quite a bulk of these pleasant messages (giving the unique opportunity to enlarge something on a recipient's body etc) - which results in about 100+ messages / day filtered out to the spam folder.
Not sure about the majority of e-mail user habits, but I have an attitude to check all the spam messages (don't worry, only the titles; well the body rarely as well) and get rid of them manually, rather than leaving the engine to automatically delete them after N days. I should notice the precision of the spam filtering algorithm Google has in Gmail: it works perfect in my case. But still even the tiniest 0,(0*)1% probability to overlook the valid message in spam folder may give hard times and irreversible processes in my brain, which I do not want to happen.
So my idea follows next. Suppose I have 10 pages of junk piled up in the spam folder. When I open one page and start looking through the e-mail topics, I obviously spend some time (like 2-3 minutes for 100 messages). Once I have done this, I may or may not proceed to the next spam page, but with no regard to it Gmail marks internally the page as "read". When I sign out or after a while (another configurable parameter), Gmail silently deletes all the "read" messages.
For the sake of flexibility there can be the third feature: a button (or a fixed option) , explicitly prohibiting to silently remove messages even though they have been read.
Friday, June 19, 2009
Словарный запас: результаты теста
| Итак, ваш запас: Тоже очень хороший результат. Ваш словарный запас значительно выше среднего |
| Пройти тест |
Tuesday, June 16, 2009
Perl's flexibility
sub getHeaderName
{
return (split " - ", shift)[1]; # let's see if it works. Upd: it works!
}
, where input string is of type: "process_type - process_name" and I need process_name value from it.