Social Software powered by Instant Communities
Springe direkt: zur Navigationzum Inhaltzur Sidebar

Archiv für 'programmierung'

QuaaxTM 0.7.0 insights

05.09.2011

Few days ago I have released version 0.7.0 of the PHP Topic Maps engine QuaaxTM which supports ISO/IEC 13250-2 Topic Maps Data Model. Two main aspects have been considered in this iteration:

  1. Increase of code coverage in the unit tests (quality aspect)
  2. Introduction of a memcached based MySQL result cache (performance aspect)

(more…)

Eclipse Workspace wiederherstellen inklusive SVN

26.06.2011

Eclipse meldete mir eben nach dem Start eine Exception mit der Meldung “Keybinding conflicts occurred. They may interfere with normal accelerator operation. [...]” – und der Projekteexplorer blieb leer. Ein Albtraum.

Mit folgendem Vorgehen konnte ich meinen Workspace inkl. SVN wiederherstellen:

  1. In den Metadatenordner der Projekte wechseln: cd workspace/.metadata/.plugins/
  2. Alle Metadaten der Projekte entfernen: rm -rf org.eclipse.core.resources/ (via http://letsgetdugg.com/2009/04/19/recovering-a-corrupt-eclipse-workspace/)
  3. Projekte einzeln über File -> Import -> Existing Projects into Workspace importieren (via http://forum.ubuntuusers.de/topic/eclipse-svn-subversive-import-existing-projec/#post-2485358).

Auch Projekte unter Versionskontrolle mit SVN können danach wieder einwandfrei bearbeitet und mit dem Repository synchronisiert werden.

Importing topic maps with QuaaxTMIO

07.11.2010

Last week, version 0.5.4 of the QuaaxTM PHP Topic Maps engine was released which, finally, brought XTM 2.1 read/write support via the QuaaxTMIO library. QuaaxTM now provides a basic tool set of Topic Maps technologies enabling PHP developers to build subject centric applications on the LAMP stack.

An essential feature is the import of topic maps. Topic maps (TMDM instances) can be serialized to one of the various Topic Maps syntaxes such as XTM 1.0/2.0/2.1, CTM, LTM, AsTMa=, or JTM to allow data interchange. Let’s see how to import a publicly available topic map from Maiana using the QuaaxTMIO library; I choose Lutz Maicher‘s  topic map about Donald Duck in XTM 2.1 for the following example.

QuaaxTM has to be set up like described in README (maybe you’d like to tun the PHPUnit tests afterwards). You’ll need three classes then which you have to require_once:

  • TopicMapSystemFactory.class.php (from lib/phptmapi2.0/core)
  • PHPTMAPITopicMapHandler.class.php (from lib/quaaxtmio/src/in)
  • XTM201TopicMapReader.class.php (from lib/quaaxtmio/src/in)

First, get a TopicMapSystem:
$tmSystemFactory = TopicMapSystemFactory::newInstance();
// QuaaxTM specific feature
$tmSystemFactory->setFeature(
VocabularyUtils::QTM_FEATURE_AUTO_DUPL_REMOVAL, false
);
$tmSystem = $tmSystemFactory->newTopicMapSystem();

Import the topic map using the XTM 2.0/2.1 parser and a topic map handler:

$tmHandler = new PHPTMAPITopicMapHandler($tmSystem, 'http://localhost/topicmaps/1');
$reader = new XTM201TopicMapReader($tmHandler);
$reader->readFile(
'http://maiana.topicmapslab.de/u/lmaicher/tm/ducks/download.xtm'
);

Finally access the imported topic map via PHPTMAPI 2.0:

$tm = $tmSystem->getTopicMap('http://localhost/topicmaps/1');
$topics = $tm->getTopics();
echo count($topics);// 278

Data Provider in PHPUnit

28.08.2010

Ein sehr praktisches Feature in PHPUnit ist der Data Provider. Data Provider sind dann hilfreich, wenn ein immergleicher Test auf verschiedene Daten ausgeführt werden soll. So benötigt man lediglich eine Funktion, die den Test enthält sowie eine Funktion, die die Daten bereitstellt (und nicht jeweils eine Funktion pro Daten-Test). Das Beispiel in der Doku von PHPUnit zeigt die Verknüpfung der beiden Funktionen: http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers

You are currently browsing the archives for the programmierung category.

Creative Commons License
This work is licensed under a
Creative Commons Attribution-Share Alike 2.5 License.
t8d blogged mit WordPress