Google Code Jam. Minesweeper Master

The Minesweeper Master is the Problem C in the Google Code Jam 2014 Qualification Round.

Here is my solution for it in C language:
Read the rest of this entry »

Google Code Jam. Cookie Clicker Alpha

The Cookie Clicker Alpha is the Problem B of the Google Code Jam 2014 Qualification Round.

Here is my solution for it in C language:
Read the rest of this entry »

Google Code Jam. Magic Trick

The Magic Trick is the Problem A of Google Code Jam 2014 Qualification Round.

Here is my solution for it in C language:
Read the rest of this entry »

Sydney from above

Last week I’ve took a scenic flight with Sydney Seaplanes to Bondi Beach, then along North Beaches and around Sydney Harbour. Well, initially I’ve booked a flight through Sydney to Blue Mountains, but on that day Blue Mountains were covered with clouds so nothing was visible. Thus I’ve got an extra to Bondi Beach along Vaucluse and Dover Heights in addition to standard scenic flight along North Beaches.

Here are some photo from this flight.

South Head:

Read the rest of this entry »

dpsearch-4.54-2014-01-09

A new snapshot of DataparkSearch Engine 4.54 is available: dpsearch-4.54-2014-01-09.

Changes since the previous snapshot are:

  • added hour and minute limit types
  • fixed compilation in case when –without-aspell switch for configure is used
  • fixed use of uninitialised value in some cases when aspell is used

An example of constructing minute based time limit with DataparkSearch Engine (an hour based limit type is used by default for time limit)
Read the rest of this entry »

dpsearch-4.54-2013-12-31

A new snapshot of DataparkSearch Engine 4.54 is available: dpsearch-4.54-2013-12-31.tar.bz2

Changes since previous snapshot are:

  • improved charset/language guessing if only one of meta or server charset is specified
  • fixed innuendo loop when htdblimit is not set
  • fixed crash when no aspell extension is enabled
  • added AllowIf/DisallowIf commands
  • fixed automatic construction of IDN pattern for ‘Server page’ command
  • added writing URL data for redirected pages if subdocuments are enabled
  • restoreed mirroring
  • put value of alt atribute of img tag as a crossword section for the image pointed by the tag

Ubuntu/Debian and RPM packages made from this snapshot are available in the Download section on Google Code.

Happy New Year!

Happy New Year to everyone with best wishes from Sydney, Australia!

The final of Family fireworks at 9pm December 31st, 2013. As it was seen from the Dudley Page reserve in Dover Heights:

Midnight fireworks from the same place:

A rainy Christmas day in Sydney

Unusually empty Bondi beach:

Read the rest of this entry »

1000th commit

Yesterday I have made my 1000th commit to the DataparkSearch Engine on Google Code!

But if you prefer GitHub, it is here: github.com/Maxime2/dataparksearch :)

Getting DataparkSearch results in Python

Below is an example of accessing DataparkSearch Engine results from its searchd daemon in Python language using RESTfull client and JSON.

Not additional package installation is required on Ubuntu Linux, if you already have Python interpreter installed.

This example uses RESTful API provided by searchd daemon of DataparkSearch Engine and a search result template producing JSON file, you can find it in the doc/samples/json.htm inside DataparkSearch distribution package.

As a result of execution of this script a list of page titles along with its URL is printed out followed by the total number of documents in the database for the query given, the time took for the query execution and the range of document numbers shown in the list.


#!/usr/bin/python

import json
import urllib
import urllib2

url = 'http://inet-sochi.ru:7003/'

params = {
# The category of the results, 09 - for australian sites
    'c' : '09',
# number of results per page, i.e. how many results will be returned
    'ps': 10,
# result page number, starting with 0
    'np' : 0,
# synonyms use flag, 1 - to use, 0 - don't
    'sy' : 0,
# word forms use flag, 1 - to use, 0 - don't (search for words in query exactly)
    'sp' : 1,
# search mode, can be 'near', 'all', 'any'
    'm' : 'near',
# results groupping by site flag, 'yes' - to group, 'no' - don't
    'GroupBySite' : 'no',
# search result template 
    'tmplt' : 'json2.htm',
# search result ordering, 'I' - importance, 'R' - relevance, 'P' - PopRank, 'D' - date; use lower case letters for descending order
    's' : 'IRPD',
# search query, should be URL-escaped
    'q' : 'careers'
}

data = urllib.urlencode(params)

full_url = url + '?' + data

result = json.load(urllib2.urlopen(full_url))

rD = result['responseData']

for res in rD['results']:
 print res['title']
 print ' => ' + res['url']
 print

print ' ** Total ' + rD['found'] + ' documents found in ' + rD['time'] + ' sec.'
print ' Displaying documents ' + rD['first'] + '-' + rD['last'] + '.'

The source code of this example is available on GitHub: github.com/Maxime2/dpsearch-python. Feel free to make pull-requests with your samples of using DataparkSearch Engine in Python.


Switch to our mobile site