Archive for December, 2006

SQL przyszłości

Tuesday, December 19th, 2006

Funkcje odpytywania tekstów w standardzie SQL

Ponieważ w pracy zajmuję się ostatnio trochę wyszukiwaniem pełnotekstowym (zwłaszcza dodatkiem tsearch2 do PostgreSQL), zastanawiałem się, czy doczekamy się kiedyś powszechnego standardu SQL dla odpytywania tekstów.

Tak żeby znający SQL człowiek, który podchodzi do swojego pięknego nowiutkiego “wypasionego” serwera nie musiał się zastanawiać co napisać, aby zmusić go do czarnej roboty.

Okazuje się, że już od jakiegoś czasu istnieje standard SQL/MM, który m.in. opisuje rozszerzenia pełnotekstowe.

Podaję przykłady zapytań, bo mówią same za siebie.

Tworzymy tabelę z polem pełnotekstowym:
CREATE TABLE dokumenty (
id INTEGER,
body FULLTEXT
)

Szukamy dokumentów, w których wyraz brzmiący podobnie do parboiled pojawia się w tym samym zdaniu, co słowo rice:
SELECT id
FROM dokumenty
WHERE body.CONTAINS(
' SOUNDS LIKE "parboiled"
IN SAME SENTENCE AS "rice" '
)

Szukamy dokumentów zawierających terminy bliskoznaczne do kontrola błędów (np. obsługa wyjątków):
SELECT id
FROM dokumenty
WHERE body.CONTAINS(
' THESAURUS "informatyka" EXPAND SYNONYM TERM OF "kontrola błędów" '
)

Standard definiuje też konstrukcje, których implementacja jest co najmniej nietrywialna:
SELECT id FROM dokumenty
WHERE body.CONTAINS( ' IS ABOUT "analiza leksykalna" ' )
ORDER BY body.SCORE( ' IS ABOUT "analiza leksykalna" ' )

Ładne, prawda? No w każdym razie dla mnie wygląda to bardzo sympatycznie.
Zachęcam do zerknięcia na cały dokument, jest do pobrania na stronie www.wiscorp.com.

Jednak nie wpadajmy w euforię.

Po pierwsze, SQL/MM Full-Text na razie jest tylko w ułamkowej części implementowany przez niektóre silniki bazodanowe.
Po drugie, relacyjne bazy danych mają swoje ograniczenia. Widoczne są one także na polu wyszukiwania “ze zrozumieniem” - bo w sumie do tego dążymy jak się chwilę zastanowić. Pisze o tym np. Curt Monash w artykule Relational DBMS versus text data.

jednak bywa RPG

Sunday, December 17th, 2006

Znalazłem ciekawą historię dotyczącą sieciowych gier RPG.

Uważam że dobrze oddaje ona to, co uważam za jedną z fajniejszych cech RPG: zjawisko “wyskakiwania” poza ramy scenariusza, zaskakiwania MG.

Cytuję z tego blogu:

Asheron’s Call, a MMORPG (the unpronounceable acronym for Massively Multiplayer Online Role Playing Game) that provides free monthly and (usually) story-driven updates to the game, marking it as a serial-narrative style game. Portal Year 11 was October 2000, and the game was beginning to wind up to the final stages of their first story-arc that spanned a year’s time. Shadows - creatures made of little substance and decedents of a rebellious nation - had become a prominent force throughout Dereth, attacking towns and terrorizing the landscape with their floating Spires. Their leader, once a Dericost man named Ilservian Palacost, was the dread Bael’Zharon. Unknown to the Isparians - the people (the players) who had settled Dereth many years later - Bael’Zharon’s rebellion was thrown down and his power captured within a series of crystals hidden throughout the land. Several months’ of recent explorations had uncovered those crystals and adventurers destroyed them, for not only did their power threaten Dereth, but they also wielded great riches to those who broke them.

Turbine - the developer of Asheron’s Call (which is published by Microsoft) - wove an amazing story over the course of several months. They counted on gamers’ desire to conquer, and to gain unique riches, because that desire in turn slowly released an evil upon the land. It was an ambitious and thoughtful design that played upon the persistent nature of the world to prevent recalling a decision. Once a crystal was destroyed, there was no reverting to a saved game to preserve it. For many months, destroying the crystals was seen as an act of preservation - the very first crystal, found in the frigid reaches of Frore, had cast an enduring winter upon all of the land. (…)

The crystal, no matter what, had to fall. Now, this wasn’t really a problem or a concern. In fact, the crystals on all worlds fell within a matter of hours. Gamers like to break things in hopes of finding something inside of them. (…)

Except on one server - Thistledown’s players mounted a defense of the Shard of the Herald (affectionately dubbed “Harry”) and proceeded to defend the crystal for the entire month. (…) The struggle and consistency of the defense was really quite impressive. Those of us who were on other servers kept track through message boards; we kept each other up to date in games. No one believed that the defenders would hold. But they did, until the very end. (…)

As the letter details, the developers enlisted the help of some players, got behind the controls of some powerful “toons” (avatars), and engaged in a major battle, tipping the scales so that “Harry” could be destroyed. The developers gave them the nod to acknowledge their feat, and instead of pulling the plug in the downtime, gave them an amazing final battle.

Czyż nie piękne? Jak widać również do świata MMORPG trafiają smaczki tak dobrze znane weteranom “klasycznych” gier fabularnych.

Ryż paraboliczny

Friday, December 15th, 2006

To dziwactwo siedzi w moim notesiku od jakiegoś czasu.

Robicie czasami zakupy w supermarkecie? No to pewnie traficie na ryż PARABOLICZNY.

Fatalna kal(e)ka z angielskiego parboiled (sparzony, podgotowany), które jakimś cudem wypączkowało najpierw do postaci paraboiled (tak, widziałem też takie), co w przekładzie na polskawy stało się przymiotnikiem paraboliczny.

Zapewne jakiś producent nie bardzo wiedział co sprzedaje.
Albo jednorazowa pomyłka jakiegoś projektanta opakowań.
Albo tłumacz nie dostał tyle kasy żeby wykonać swoją pracę na trzeźwo.

Swoją drogą zastanawiające, że taki drobny “bug” w głowie jednego człowieka ma zdolność propagacji podobną do wirusów.

Tak czy inaczej, przysporzyło mi to sporej dozy zdrowego śmiechu przy półce w supermarkecie.
Już zacząłem sobie wyobrażać jaką reakcję wywołałby ten fakt wśród matematyków. Na pewno wielu pokusiłoby się o sprawdzenie, czy wspomniany ryż faktycznie jest paraboliczny. Ale tak na moje oko to bliżej mu do elipsoidy.

Brawo Janosik!

Friday, December 15th, 2006

Kolejny mały kroczek do normalności.

Twórcy programu Janosik wygrali proces z Zakładem ubezpieczeń Społecznych o ujawnienie protokołu komunikacji służącego do przekazywania dokumentów w formie elektronicznej.

Stanowisko ZUS w sprawie Janosika stwierdza (nie wprost), że można korzystać z programów innych niż Płatnik, jeśli tylko przesyłane dokumenty są prawidłowo wypełnione.