PHP – Delete files by pattern

Martin Zellerphp 1 Comment

If you want to delete files by pattern (e.g. “*.txt”) in a directory, you can do this with the php function glob! [php]$files = glob(‘/path/to/files/*.txt’); // finds all txt files in the directory /path/to/files/ foreach($files as $file) unlink($file);[/php] With this method you can also delete all files of a directory – with pattern *.*

PDF: direct printing with .NET

Martin Zeller.net 47 Comments

  In this article I will show you the results of my search to find a way to print a pdf with .NET. My task was to find a simple solution for an intranet web application where the user gets pdf reports (ActiveReports). Depending on configuration settings these pdf files should be displayed in the browser and be printed immediately …

Client localisation with zend framework

Martin Zellerphp Leave a Comment

If you want to find out the language or country of the clients browser, do it this way: [php]<?php require_once ‘Zend/Locale.php’; $locale = new Zend_Locale(); echo $locale->toString(); ?>[/php] But be aware! This way you only get the localisation of the clients browser. And this is configurable by the user. The code above will give you output like this: [text]de_AT[/text] or …

Passwort setzen für das Gastkonto unter Windows 7

Martin Zellerwindows 7 2 Comments

Das Passwort für den Gast-Account unter Windows 7 zu setzen ist eigentlich gar nicht schwer, wenn man einmal weiß, wie’s geht 😉 “windows”-Taste + “r” Eingabe von “control userpasswords2? Im sich öffnenden Fenster findet man dann die notwendigen Möglichkeiten Viel Erfolg

MySQL: import a dump

Martin ZellerMySQL Leave a Comment

If you have got a sql-File and want to import it to your MySQL database then you can do this with a simple line in the shell: [shell] mysql -u username -p password -h databaseservername  datebasename < sqlfile.sql [/shell] Example: Say there is a local MySQL database, with a database called ‘mybestsellers’, we have got a dump file ‘/home/users/jripper/bestsellerdump.sql’ and …

Magento: Warning in Mage/Eav/Model/Entity/Abstract.php ?

Martin ZellerMagento 1 Comment

All you want to do is saving a product like this? [php]$api = new Mage_Catalog_Model_Product_Api(); $productData = array(); $productData[‘visibility’] = Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE; $productData[‘status’] = Mage_Catalog_Model_Product_Status::STATUS_DISABLED; $api->update($product->getId(), $productData);[/php] Or maybe without the API? [php]$product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE); $product->setStatus(Mage_Catalog_Model_Product_Status::STATUS_DISABLED); $product->save();[/php] And all you get is an error like this? [text]Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/whlid/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 972 #0 /opt/lampp/htdocs/whlid/app/code/core/Mage/Eav/Model/Entity/Abstract.php(972): mageCoreErrorHandler(2, ‘Invalid argumen…’, ‘/opt/lampp/htdo…’, …

Visual Studio 2005 und Windows 7

Martin Zellerwindows 7 3 Comments

Da der Bildschirm meines alten Laptops mit XP (Vista habe ich an mir spurlos vorüberziehen lassen) langsam aber sicher einen bunten Vorhang aus bunten Streifen fallen läßt, habe ich  mich dazu entschlossen, mir rechtzeitig einen neuen zuzulegen. Gleich mit Windows 7, etwas Risiko muß sein. Ich  muß sagen, die Portierung meiner Entwicklungsumgebungen für php und Java klappte ohne Probleme – es war nur …

Das C64 Textadventure ‘Das Geheimnis des Schloss Arendarvon’

Martin ZellerAllgemein

Wie gestern bin ich auch heute beim weiteren Umbau dieser Homepage auf einen Schatz gestoßen: meine alte Fanpage zum Textadventure ‘Das Geheimnis des Schloss Arendarvon’. Wenn ich an das Schloss Arendarvon denke, kommen nostalgische Erinnerungen in mir hoch. Ich denke, ich war um die zwölf, dreizehn Jahre alt, als ich meinen ersten Commodore 64 bekam. Zusammen mit dem Spiel ‘Das …