March 28, 2008
filed just before lunchtime by DrScofield in: hacking
technorati tags:
QR code for this entry · average time to read 0:32 minutes

i realized the other day that the markdown-extra plugin i am using for text markup was generating non-unique footnote anchors, resulting in any footnote #1 in a blog entry on referring back to footnote #1’s anchor in the very first blog on a page with multiple blog entries. not good. so, i had a look at the markdown-extra.php’s source — it already contains a variable fn_id_prefix but that is initialized to the empty string

yet, that is a nice starting point, because all we have to do to get unique anchors is to add the following line of code in _hashHTMLBlocks_inMarkdown():1


  1. right after the initial

    if ($text === '') return array('', '');
    

    test. 

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
March 27, 2008
filed just before lunchtime by DrScofield in: from the grid, linux
technorati tags:
QR code for this entry · average time to read 1:37 minutes

to run the most recent libsecondlife release you need to have at least mono 1.9 installed. the following step-by-step recipe applies to a ubuntu 7.10 system and you should be root:

installing pre-reqs

apt-get install build-essential bison gawk
apt-get install libglib2.0-dev
apt-get install libpng12-dev libx11-dev libfontconfig1-dev 
apt-get install libfreetype6-dev libjpeg62-dev libtiff4-dev 
apt-get install libungif4-dev libexif-dev libcairo2-dev
apt-get install libpango1.0-dev libgtk2.0-dev libglade2-dev
apt-get install libgnome2-dev libgnomecanvas2-dev libgnomeui-dev
apt-get install libgnomeprint2.2-dev libgnomeprintui2.2-dev 
apt-get install libpanel-applet2-dev libgtksourceview-dev
apt-get install libgtkhtml3.14-dev

installing libgdiplus

wget http://go-mono.com/sources/libgdiplus/libgdiplus-1.9.tar.bz2
tar xvf libgdiplus-1.9.tar.bz2
cd libgdiplus-1.9
./configure --prefix=/usr/local
make
make install

installing mono

wget http://go-mono.com/sources/mono/mono-1.9.tar.bz2
tar xvf mono-1.9.tar.bz2 
cd mono-1.9
./configure --prefix=/usr/local
make
make install

installing nant

wget http://switch.dl.sourceforge.net/sourceforge/nant/nant-0.86-beta1-src.tar.gz
tar xvf nant-0.86-beta1-src.tar.gz
cd nant-0.86-beta1
make install prefix=/usr/local

you now have the base setup, which is sufficient for building and running libsecondlife and opensim. the following packages are add-ons that are nice-to-have but not necessary-to-have. i do recommend installing the monodoc & mono-tools stuff, however — it makes live easier :-)

gtk-sharp

wget http://go-mono.com/sources/gtk-sharp210/gtk-sharp-2.10.4.tar.bz2
tar xvf gtk-sharp-2.10.4.tar.bz2
cd gtk-sharp-2.10.4
./configure --prefix=/usr/local
make
make install

gnome-sharp

wget http://go-mono.com/sources/gnome-sharp2/gnome-sharp-2.16.1.tar.gz
tar xvf gnome-sharp-2.16.1.tar.gz
cd gnome-sharp-2.16.1
./configure --prefix=/usr/local
make
make install

gtksourceview-sharp

wget http://go-mono.com/sources/gtksourceview-sharp2/gtksourceview-sharp-2.0-0.12.tar.bz2
tar xvf gtksourceview-sharp-2.0-0.12.tar.bz2
cd gtksourceview-sharp-2.0-0.12
./configure --prefix=/usr/local
make
make install

monodoc & mono-tools

to get the monodoc C# documentation viewer (recommended!) we need to install the monodoc package and the mono-tools package. monodoc itself needs to be installed inside the mono-1.9 source directory1 from above.

cd mono-1.9 # this is the source directory from the above
wget  http://go-mono.com/sources/monodoc/monodoc-1.9.zip
unzip monodoc-1.9.zip
cd monodoc-1.9
./configure --prefix=/usr/local
make
make install
cd ../..

next, install mono-tools:

wget http://go-mono.com/sources/mono-tools/mono-tools-1.9.tar.bz2
tar xvf mono-tools-1.9.tar.bz2
cd mono-tools-1.9
./configure --prefix=/usr/local
make
make install

configure will mumble about gecko-sharp.dll not being build, that’s ok, just ignore it.


  1. …otherwise, monodoc will not pick up the C# doc for the base assemblies. 

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
March 13, 2008
filed mid-afternoon by DrScofield in: from the grid, hacking
technorati tags:
QR code for this entry · average time to read 0:30 minutes

regardless of whether you check out opensim from a source repository or are using prebuild packages, opensim will always bring along its own libsecondlife.dll. as of the time of this writing this libsecondlife.dll is the subversion 1550 snapshot from libsecondlife’s subversion repo.

as mentioned in an earlier post, opensim’s libsecondlife sources are not contained within the main opensim source tree, you need to check those out separately:

% svn co http://opensimulator.org/svn/opensim-libs/libsl1550 opensim-libs

then, just go into the newly checked out opensim-libs directory and run nant to build libsecondlife.dll…

% cd opensim-libs
% nant

…and once it’s done, copy bin/libsecondlife.dll to your opensim/bin directory.

done. enjoy.

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
March 10, 2008
filed late at night by DrScofield in: from the grid
technorati tags:
QR code for this entry · average time to read 4:58 minutes

tonight i felt like being slartibartfast — yep, the urge to create some fjords, mountain ranges, and islands was just overwhelming. unfortunately, the previous routes to scratching that itch were blocked: using L3DT to generate a nice looking landscape (all by just twiddling a couple of sliders) and then loading the resulting terrain map on to the 4×4 island grid running on my trusted X60. that route was blocked because OpenSim’s new terrain module currently doesn’t do multi-region terrain loads :-(

yet — top gear moment! — how hard can it be to split out the terrain map from L3DT into region sized parcels and then just write a nice little script to load them individually?

well, it turns out: not very hard.

step-by-step from scratch to finished grid…

someone on the #opensim-dev IRC channel mentioned the other day, that L3DT would run fine under wine on linux. having bought the professional version (just USD 34.95 or so),1 i took note, as so far i had just been running it under vmware. sure enough, on l3dt’s web site is a HOWTO describing the linux setup.

install wine & then L3DT

so, first install wine (didn’t have a need for it on my box until now):

# apt-get install wine

next, download the development version of l3dt from the bundysoft website, then run the installer through wine:2

# wine /downloads/L3DT_PRO_dev-2.5.3.1.exe

that will install a runable l3dt on your ubuntu box. start it up and we are ready for that slartibartfast feeling.

becoming slartibartfast

either via “file->new project” or by clicking on the “new map” icon, start a new, well, map. you should be faced with the following dialog box:

l3dt-01.jpg

select “design/inflate” and then click on next. on the design map size dialog box which should now be facing enter the desired grid size you want to cover — highlighted below in red — and make sure that the horizontal scale is 1.00 m. note, too, that the one OpenSim region translates to a 4×4 L3DT area; in the screen shot below, i’m aiming for a 4×4 OpenSim grid area, thus, i need to have a 16×16 L3DT area:

l3dt-02.jpg

once you have entered your value, click next and you should get to the design map parameters dialog, which is a bit of a misnomer, i think, it really should be called slartibartfast parameters as this is where we get to be slartibartfast:

l3dt-03.jpg

here, you can muck around and tune your future grid terrain to your hearts content. just pick and choose (you can always restart). once you are done and want to give it a go, click next again — leading you to the calculation queue dialog, where you tell L3DT what maps you are interested in. you absolutely do need the heightfield map (this is going to be what we load into opensim later), i always turn on everything :-)

l3dt-04.jpg

again, click on next and you will get to the water flooding dialog:

l3dt-05.jpg

i like my water levels at 20m and am a huge fan of the sea, thus the entries in the highlighted area. next and we arrive at the texture settings dialog:

l3dt-06.jpg

if you want to, click on the make high-resolution texture check box (i usually do). click through the next dialogs and then watch L3DT do its job.

sooner or later3 your terrain will be ready! my terrain looked like this:

l3dt-07.jpg

exporting our terrain

next, we need to export our newly created terrain. to do so, first save your projects via “file->save->save project” or via the “save project” icon. then, select the heightfield map via the map selection icon…

sel-map.jpg

…and select the heightfield entry…

l3dt-08.jpg

…which should update the display area to show the heightfield map — which looks a bit like an x-ray of our terrain:

l3dt-09.jpg

next, we need to export the map using the RAW format. click on the “export this map” icon…

export-map.jpg

…and in the export map dialog click on split map into tiles (mosaic map) (highlighted in red below) and enter a name for the terrain map in the file name field (highlighted in yellow, i used slartibartfast).

l3dt-9-5.jpg

click next and select the RAW file format (highlighted in red) and adjust the tile size to 256 and click on options

l3dt-11.jpg

select the Mode (ComboSelector) entry by double clicking and change it to 32-bit floating-point (metres)

l3dt-12.jpg

and then click on OK and finish the rest of the dialog by clicking on OK again.

you should end up with a set of files named slartibartfast_x0y0.raw, slartibartfast_x0y1.raw, and so forth.

importing the works into opensim

finally, we are about to import our opus magnus into opensim. to do that we need to

  • rename all *.raw files to *.r32 so that opensim does not mistake them for LindenLab raw files
  • create a command script to load the terrain into each region separately.

first, though, copy the *.raw files to the bin directory of your OpenSim installation:4

# cp *.raw /opt/opensim/bin

next, rename:

# for i in *.raw ; do  r=$(basename $i .raw); mv $i $r.r32; done

now, create a command script for opensim which looks roughly like this:5

change-region Xanadu Blue
script terrain load slartibartfast_x0y0.r32
change-region Shangri-La
script terrain load slartibartfast_x0y1.r32
change-region Torchwood
script terrain load slartibartfast_x1y0.r32
change-region 13th Floor
script terrain load slartibartfast_x1y1.r32
change-region Skybreaker
script terrain load slartibartfast_x2y0.r32
change-region Hyperion
script terrain load slartibartfast_x2y1.r32
change-region Aurora
script terrain load slartibartfast_x3y0.r32
change-region Flotsam
script terrain load slartibartfast_x3y1.r32
change-region Shutdown
script terrain load slartibartfast_x0y2.r32
change-region User Error
script terrain load slartibartfast_x0y3.r32
change-region Core Dump
script terrain load slartibartfast_x1y2.r32
change-region Division by Zero
script terrain load slartibartfast_x1y3.r32
change-region Gondor
script terrain load slartibartfast_x2y2.r32
change-region Misty Mountains
script terrain load slartibartfast_x2y3.r32
change-region Rivendell
script terrain load slartibartfast_x3y2.r32
change-region The Shire
script terrain load slartibartfast_x3y3.r32

save.

start up OpenSim, and once you have the console prompt, issue

Region# :
command-script slartibartfast.cmd

this should result in quite a bit of output by opensim telling you that it’s doing the terraforming!

a new landscape!

login to your opensim grid and explore your new terrain!


  1. the standard, free, version is perfectly fine for generating terrain maps for a single region. to cover larger grid areas, you either need to wait for OpenSim to support it again, or get the professional edition which supports mosaic tiling — that is, you generate the terrain map for the intended grid area and then let L3DT split it into region sized terrain maps. 

  2. in case you are using the standard, free, version, that would be L3DT_SE_dev-2.5.3.1.exe instead. 

  3. that, i’m afraid, depends on the horse-power of your system, but even on a dual-core CPU it will take a couple of minutes. 

  4. on my box, opensim lives in /opt/opensim

  5. adapt the region names to your region names, otherwise this will be a frustrating exercise… 

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.
March 1, 2008
filed just before lunchtime by DrScofield in: void
QR code for this entry · average time to read 0:50 minutes

while working on a lengthy LaTeX text in my favourite editor, emacs, i noticed that once i turn on flyspell-mode (spell check as you type), that transient-mark-mode (highlight marked regions) would become borked :-( not good.

investigating the issue, it transpired that the flyspell.el and ispell.el files installed as part of the ubuntu 7.10 dictionaries-common package are a bit out of date: that problem has been fixed back in 2005. funnily enough the emacs-snapshot package brings along its own ispell and flyspell emacs lisp files that are more recent — and don’t have the problem fixed.

so, to sort this out i diverted the dictionaries-common versions like so:

% dpkg-divert --rename --local \
        --divert /usr/share/emacs/site-lisp/dictionaries-common/flyspell.el-borked \
        --add /usr/share/emacs/site-lisp/dictionaries-common/flyspell.el
Adding `local diversion of /usr/share/emacs/site-lisp/dictionaries-common/flyspell.el to /usr/share/emacs/site-lisp/dictionaries-common/flyspell.el-borked'
% dpkg-divert --rename --local \
        --divert /usr/share/emacs/site-lisp/dictionaries-common/ispell.el-borked \
        --add /usr/share/emacs/site-lisp/dictionaries-common/ispell.el
Adding `local diversion of /usr/share/emacs/site-lisp/dictionaries-common/ispell.el to /usr/share/emacs/site-lisp/dictionaries-common/ispell.el-borked'

this not only renames flyspell.el to flyspell.el-borked (and ispell.el to ispell.el-borked) but also does this in case there’s an update of the dictionaries-common package.

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.