Category Archives: Tools

Free XSD Editor – Generate XSDs from XML

From an old post: To start out with XML-Schema this might be of interest to you:

XSD-Tutorial: http://www.liquid-technologies.com/XsdTutorial_01.aspx

Free graphical Tool: http://www.liquid-technologies.com/LiquidXMLStudio.aspx

[2009-06-27] Update: A very cool feature is the generation of a Schema, based on example-XML files you give Liquid XML Studio! I discovered this when I built a Schema that would not validate against my desired XML structure and I could not figure out why. I generated the XSD like this:

  • Open one of your XML examples with Liquid XML Studio.
  • Select from the menu “Tools / Infer XSD Schema”.
  • You are asked for more examples. I did it with just one XML file.
  • And bingo: You have your XSD.

As I did a diff of my handcraftet version of the XSD and the generated one, it revealed the reason for not validating nicely for me ;).

Cool tool, you can use with the 30-day trial licence.

Bulk Image Resize using Conditional Width

I am currently working on a project in which we have lots of images from an old CMS waiting to be migrated into a new layout. Of course there are restrictions so it should not happen that certain image types exceed a certain max. width.

OK, we have many many images… So I took a closer look at ImageMagick (also take a look at the usage examples). And I have to say: Awsome!

You can install ImageMagick on Ubuntu or Debian with a simple
# apt-get install imagemagick

In combination with a bit conditional scripting I came up with the following solution:

Console doing bulk resize.

Console doing bulk resize.

I wanted to have a shell script that, given a directory containing all our images, checks the width of each image and resizes it if it exceeded a certain width. Simple, but powerful.

Usage:

$ ./resize_image_dir.sh ../../brand_logos

And you are done with thousands of images in a minute. Do not forget to make a backup if designers change the desired width later…

You can download the shell scripts with example images ready to test:
!resize_conditional_images_bulk2

Frameworks…

Find out interesting thoughts and experiences about the selection and usage of a frameworks for your projects in this set of slides ‘Living with Frameworks‘ by Stuart┬áHerbert, Technical Manager at www.gradwell.com.

You will learn about:

  • How frameworks save you time (=money) and ensure quality but can also waste resources if applied in another way the framework was intended to be used.
  • The importance of the framework guru role.
  • That a chosen framework and architecture should be strategically introduced (top-down).
  • Introduction and proper use of a new framework has a steep learning curve.
  • Legacy code and the parallel maintenance hassle.
  • Refactor early, refactor often, perform regular code reviews with the framework guru.
  • Frameworks will not fix bad practice (specification, quality, no training).
  • Your framework should fit your overall development plan and practice.
  • Training your staff in your framework is a means of building your team.
  • Headcount on projects has increased, means more teamwork, organisation around needs to mature too.
  • Importance of upgrades and backward compatibility.

A Simple PHP Google Sitemap Generator

I just hacked together a very simple class and CLI script to help me generate Google sitemap XML on a daily basis using PHP. If you have not yet heard of it: Google sitemaps help you promote your content if you have certain deep links that only show up if a visitor for example performs a search and clicks a result.

Check the documentation of the Google Sitemap Format

Here is the code: Google Sitemap Generator

It works like this:

$ php generate_gsitemaps.php; #will generate your standard sitemap
$
php generate_gsitemaps.php -e > my_sitemap.xml; #echo sitemap xml to another file

Example: generated_example_sitemap.xml

Have fun being found!

Etherpad

EtherPad is a free webbsased editor which lets people remotely and simultaneously edit the same text document. Just click ‘Create new Pad‘ and you see the URL which you can send to your remote friend(s).

etherpad_screen

Use it for group development on code snippets, catch realtime meeting minutes, brainstorming ideas and many things more…

Thanks AppJet for this nice tool!

Hippie Completion in Eclipse

I was using a factory like this

$factory = new Object_Factory();
$curr_object = $factory->create('brand');

to generate instances of objects I needed and wondered why Eclipse could not auto-complete e.g. getters and setters in my code for me later on for the $curr_object. My productivity and my motivation to type all that stuff were seriously suffering…

So I found a very nice solution: Hippie Completion!

Instead of listing possible completion solutions like with Strg-Space the

key-combo “Alt-/” (/ on the number block!)

just completes what you started typing. You can also press Alt-/ as many times you like to page through all terms you could have meant like with the Strg-r on the console.

In case you try and wonder why it is not working like expected right away: Precondition for the hippie completion in Eclipse is, you typed the term to be completed once before!

Why didn’t anyone tell me this cool one before!

Planning Poker for better Estimates

There are many essays and articles on ‘Planning Poker’ out there. So I do not need to repeat the principles here. By checking out the recommended links (and folloups and others from your own research) you need to understand the following:

  • What a story point of a project looks like and how you generate those story points in advance. Remember, your estimation should include design, coding, testing and delivery. In Planning Poker it is your goal to come up with estimates to those those story points with your team.
  • The process of how one story point is estimated using the Planning Poker card deck and how to narrow down your team members’ estimates through discussion of the ‘played’ estimates.
  • The background of the card deck used and why there are such odd numers in it.
  • The effect all this will have to your project and the team.

The important thing is not the single estimate as such, but rather the open discussion among the the team members in advance, the mix of different perspectives and the collection of confidence in the team’s estimates. If the team is not able to get confident for an estimate you better recheck the user story in question and clarify it – possibly again with the customer. The more confident the team in one estimate is (=no big spread in single estimates of the team members), the less unclear ‘assumptions’ have been made in the estimate itself. This, in the end, reduces the overall risk (friction and interruptions) during the actual project and most importantly makes your customer happy.

Recommended articles and links:

Subversion Repository on Samba Share

I use a Subversion repository which sits on a Samba share in our LAN. Most of the times I used it from Windows machines where I simply assigned a drive letter (N:) to the filesystem of the network share (//TERASTATION2/share) hosting the repository. A SVN checkout including URL looked like this:

  • svn co file://N:/_repos/projectname/trunk .

Now I have my new Ubuntu/Linux notebook and asked myself how I could use the repository from there too. I tried using smb://terastation2/share/_repos/myproject/trunk – but this did not work in combination with file://.

The solution looks like this:

  • Create a dir to mount the share to: $ sudo mkdir /mnt/terastation2;
  • Mount the filesystem: $ sudo smbmount //TERASTATION2/share /mnt/terastation2 -o lfs;
    (You can create a launcher to do that for you in the future)
  • Then you can do your desired operations: $ svn co file:///mnt/terastation2/_repos/projectname/trunk .;