GeoServer – create a datastore programmatically

Martin ZellerGeoServer, java 2 Comments

Currently I am programming an upload module for GeoServer 2.1-RC2. The user should be able to upload a shape file which is automatically installed as datastore in the default workspace. For this intention I didn’t want to use the REST-API of GeoServer, I wanted to create the data store  programmatically. The following piece of code adds a ShapeFile data store …

C pointers for dummies (like me :)

Martin ZellerANSI C Leave a Comment

Just a little piece of code in C for clearing up pointers… look at the comments in the first part! (If you need an environment to develop in C on windows, find a solution here: environment for ansi c on windows [c] void change(short*, short*); int main(void) { short *pointer1 = NULL; short *pointer2 = NULL; short value1 = 1111; …

gcc on windows with eclipse and mingw

Martin ZellerANSI C 2 Comments

This information will help you: if you want to develop in C with gcc on windows if you want to develop in C with mingw and eclipse with CDT plugin Forget all the tutorials for installing and configuring eclipse with mingw or cygwin – just download the Wascana Eclipse C/C++ IDE for Windows Developers You will be surprised! Wascana is …

Het mysterie van Arendarvon Castle

Martin ZellerAllgemein Leave a Comment

Gute Neuigkeiten für alle niederländischen Fans des C64-Adventures ‘Das Geheimnis des Schloss Arendarvon’. Dank eines eurer Landsleute konnte (und wird auch weiterhin) die niederländische Version unserer Fanpage nun endlich richtig übersetzt. Seht: => Het mysterie van Arendarvon Castle (Die deutsche Version der Fan-Seite: => Das Geheimnis des Schloss Arendarvon) Unser Dank geht an H. Zwetsloot

The “IE7 setAttribute class” problem!

Martin ZellerJavascript Leave a Comment

This does not work with IE7: [js]elem.setAttribute(‘class’,  cssClass);[/js] Use this instead: [js]elem.setAttribute((document.all ? ‘className’ : ‘class’), cssClass);[/js] Problem: document.all exists in IE8 too, but IE8 does not work with ‘className’! My solution in one of my projects was prototype: [js]Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6; Prototype.Browser.IE7 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 7; Prototype.Browser.IE8 = Prototype.Browser.IE && !Prototype.Browser.IE6 && !Prototype.Browser.IE7; …

SqlHelper und benutzerdefinierte Tabellentypen mit SQL Server 2008

Martin Zeller.net, sql server Leave a Comment

Arbeitest du mit SQL Server 2008, SqlHelper und benutzerdefinierten Tabellentypen und erhältst folgende Fehlermeldung? [text]Der eingehende Tabular Data Stream (TDS) für das RPC-Protokoll (Remote Procedure Call) ist nicht richtig. Tabellenwertparameter (‘@xxx’), Zeile n, Spalte n: Für den Datentyp xxx (benutzerdefinierter Tabellentyp) wurde ein Datenbankname mit einer Nicht-Null-Länge angegeben. Der Datenbankname ist mit einem Tabellenwertparameter nicht zulässig. Es sind nur ein …

Pdf thumbnails / Pdf to jpg

Martin Zellerphp 2 Comments

Do you want to create thumbnails for pdf files with PHP (or C#)? You can simply do this with ghostscript. Here’s the php way (it is very easy to convert this code to C#): First install ghostscript on your server. Download: http://ghostscript.com/releases/ Then write your code: [php]$pathToPdf = "C:\….\PdfFile.pdf"; $pathToJpg = "C:\….\generatedThumbnail.jpg"; $gsCall = "\"C:\….\gs\gs8.70\bin\gswin32.exe\" -q -dBATCH -dMaxBitmap=300000000 -dNOPAUSE -dSAFER …

Zend_Captcha, an example without Zend_Form

Martin Zellerphp 2 Comments

Here is your example how to implement Zend_Captcha_Image without using Zend_Form. In your action method: [php]public function indexAction() { //… $captcha = new Zend_Captcha_Image(); $captcha->setImgDir(APPLICATION_PATH . ‘/../public/tmp/captcha/’); $captcha->setImgUrl($this->view->baseUrl(‘/tmp/captcha/’)); $captcha->setFont(APPLICATION_PATH . ‘/fonts/elephant.ttf’); $captcha->setWidth(350); $captcha->setHeight(150); $captcha->setWordlen(5); $captcha->setFontSize(70); $captcha->setLineNoiseLevel(3); $captcha->generate(); $this->view->captcha = $captcha;   // giving captcha object to the view //… }[/php] In the corresponding view render the captcha and add a hidden …