Extending/Modifying KnotTheory`

From Knot Atlas
Revision as of 09:09, 28 August 2007 by 163.28.4.1 (talk)
Jump to navigationJump to search

dj fish ford fiesta newport 1.3 fiore domicilio cam girls polmone del suino cinelli amd athlon 64 desktop computer hotel loira francia taiyo yuden cuffie senza filo sony www articolo 31 it nec lampada hp 5 pixel djm 600 daiji maria teresa ruta nuda volo rozzano henryson o henderson, robert il sito ufficiale di pro evolution soccer bcs 333 dobson, rosemary gerocarne er califfo panasonic lumix 30 felisia discoteca mesa que mas apla porsche 911 coupe la ultima cena rappresentanti per estero sabrina 19 caldaie ricambi napoli ball revamped 2 profumi baldessarini spy killer foto naziskin beep batteria per nokia 8810 volatili affittacamere ebbrezza bianca recupero dati the lion sleep s tonight tesine esame terza media kenwood w6531 tracce esami di stato timok iposte hotel 3 stelle lisbona giochi dei cartoni animati fiat barchetta 1 8 navigatore gps bluetooth canon batteria sigillo convertibili champagne in paradiso movimento cantautori stafania orlando d m n 142 brother inkjet multifunzione con fax albergo 3 stella chicago tatoo bracciali tribali pissing singole guardie giurate link porno cuckold lo spavaldo midnight hour pickett luciano ferro perdona dvd ally mc beal james legros foto pornor inno sovietico sorpassometro foto lilla for men tesi pubblicata rotliegendes ups apc smart 750 pny geforce 7800gtx 256 mb pci express memoria ram toshiba satellite 5100 cappello con visiera severina video www atene it buffer figli di pitagora dimagranti integratori blazer 4.3 grimaldi spa di navigazione scuola per estetista albergo bolzano situazione disperata, ma non seria designjet 30 www samsung hi fi com stampanti lbp matera mp3 free shrek savage 25 incluso desktop computer www relatieplanet nl www porno foto video yugoslavia it alessandro sposa rossane ricevitore gps blutooth benni satisfaction televisore lcd 20 monitor crt lg 19 la ballata dei fantasmi genova - roma gutter brothers operation - hit squad rockstar game denver cose fare daewoo nexia aika. disco 1 eleciones 2 usa fiat usata torino video 666 com trattori vega bci 3000 x press attentato ai tre grandi enterite bandiera gran bretagna lingo squad telefonini lg edge sonia morales ratzel, friedrich croste honda civic 1.4i 16v 5p. s superfighetto it lingeries globalsat gsm allevatori como portatile amd l oceano del silenzio baciata multipla jtd km 0 dynamic sony mpk modellino della uno turbo concessionarie per la campagnia la maledizione della prima luna il disco vincitore amico evangelion the end pig word behringer xm8500 apple 23 ieee 1394 dv foto giornaliste sexy nuova alfa romeo 147 gta video petra nemcova profeti www ceteco it giacomo leopardi foto philips 109b50 fiera del cioccolato in perugia canzone anni 70 conqueror 1086 a.d. workcentre pe120i mtaa 4513 v stampante laser colori cx11n this is love marron 5 lettore memory stick pro tacchi sexi il segreto di cristoforo colombo tamenghest hp psc2410 clarima banca v data 512 emmanuil, cesare lavasciuga whirpool canon np-e3 saeva crazy tattoo lunapop latinlover vgn s4hp b the buggles volkswagen lupo 1.7 verifiche impianti termici bari jbl e20be nikon s4 fotos de velludos nizza shopping kensington contour notebook backpack enenma sesso animale it enricke zafira km zero televisore 18 max de angelis l evaso come dove quando farmacia florio condilomi vaginali luca barbareschi hungry space max trio cordless il demone del gioco io troia chatta con me e daniela beau bridges stranezze di nuoro generatore di ricariche false dfi la lanparty ut nf4 ultra-d articolo casa folletti e fate il gamecube sale sul ring

Anybody is welcome, indeed encouraged, to fix, modify or extend the package KnotTheory` to the benefit of everybody else. This note explains how this can be done and outlines some of the conventions used within KnotTheory`.

Seeing the sources

The source files for KnotTheory` are kept in a Subversion repository whose overall directory structure is as follows:

http://katlas.math.toronto.edu/svn/KnotTheory/...

  • trunk/... contains the current "working" version of the package.
    • KnotTheory/... is an unpacked version of the whole package, as seen by users.
    • src/... contains the individual mathematica "modules" that are glued together to make KnotTheory/init.m, the main executable of KnotTheory`.
  • branches/... contains development versions of certain new features that are not yet included in the package.
  • tags/...
    • stable/... contains the last "stable" version of the package. It is a snapshot of the trunk/ directory, at some previous moment in time. "Stable" doesn't necessarily mean any great degree of testing has gone on; it just means that the most recently introduced bugs in the trunk haven't been included. The downloadable package is generated from this directory.

Writing Your Extension

Submitting Your Extension

KnotTheory` is a computer program written in an unrestricted language. Meaning that a vicious programmer could use it to do harmful things to the computer running it. Therefore unlike much of the rest of the Knot Atlas, it can be modified directly only by the administrators of this site. If you aren't one, email your extension/modification to Dror. Dror will read through it quickly to confirm that it's not malicious and doesn't do anything obviously wrong and post it in the Setup section of this manual. Thanks!

Lessons learnt from integrating LinKnot`

In February 2006, Radmila, Dror and Scott spent a few days making LinKnot` and KnotTheory` play nicely together. In the end, we had at least partially achieved two of our goals:

  1. Allowing the concurrent usage of KnotTheory` with LinKnot`, so that users of LinKnot` can access the databases and algorithms available in KnotTheory`, while maintaining familiar notations and function names.
  2. Making the functionality of LinKnot` transparently available to users of KnotTheory` (with function names and data conventions consistent with KnotTheory`).

These two goals seem to be a reasonable model for integrating a pair of complementary Mathematica packages; former users of each expect not much to change, but simply to have extra functionality. It's also a reasonable 'minimal' model, in that only 'compatibility layers' are written, leaving the original packages (mostly) unchanged.

Loading side by side

Our first goal was simply to be able to load KnotTheory` and LinKnot` side by side. Initially, we were prevented by two different problems. Firstly, each package unintentionally introduced symbols into the Global` Mathematica context. Secondly, each package expected that the current working directory always be the home of the package; expectations unsatisfiable simultaneously!

Global` symbols

Fixing leakages from KnotTheory` wasn't too hard; just load KnotTheory` in a fresh Mathematica session, then issue the command Names["Global`*"]. There shouldn't be much there, and it's mostly a matter of tracking down where the stray symbols have been introduced. If you don't understand Mathematica's (utterly ugly) system of contexts, you'll start to get the hang of it while doing this!

Leakages from LinKnot` were much more serious, as several subpackages were loaded directly into the Global` context (the authors of K2K didn't follow the usual Mathematica package conventions).

At this point we discovered the first of several painful problems associated with symbols in contexts which aren't currently on the context path, namely that conversions to and from strings (with ToString and ToExpression) are very dangerous. These happen 'at runtime', so the context path could be quite arbitrary (that is, having been modified by other packages or users since the package was loaded), rather than at the moment the package is loaded. It is often necessary to wrap calls to ToExpression with code which temporarily resets the context path. Seaching for ToExpression in the LinKnot sources should find examples of this.

Current working directory

Unfortunately many parts of the K2K package rely on the current working directory being the LinKnot` installation directory. This causes all sorts of problems; users should be able to change the current working directory arbitrarily. Even worse, there are still some bugs in KnotTheory` where certain things don't work if the current working directory isn't set to the KnotTheory` installation directory!

We used two techniques to get around this. First, the KTtoLinKnot subpackage tries to work out the LinKnot` installation directory, using the mnemonic

LinKnotDirectory[]=
        DirectoryName[
          File/.Flatten[
              FileInformation[ToFileName[#,"LinKnots.m"]]