The Scary Programming (Variable Names)

terror

Ranting is not my favorite way to express, I’m more like a constructive guy. But also, the blog is a reflection of what I’m doing right now. And for the title of the post you can guess I’m not doing a lot of GIS.

Lately I’ve been spending my time reading some questionable code, which made me think about the habits of programming. There’s no exact science here, but it is true that bad handled code can explode really fast creating a series of problems.

  • Maintenance hells.
  • A bug fixed, uncovers another bug.
  • Hard to get somebody up to speed.
  • Lots of snorting (iup that’s me).
  • Clear increase of gray hair (iup, that’s me).

I started drafting a post about this topic. Then, it exploded in size. So I decided to split it in digestible bits of enjoyment.

The original title was: The Code Apocalypse but I settled for something milder because… that’s my style :-D.

Variable Names

Leave a comment

Filed under code, tips, TSP

QDCSS : Quick and Dirty CSS Sprites

qdcss
Ah, spriting.

When I think about sprites, my mind goes directly to the NES, and SNES era.

snests4nintendones

The graphics were meshed together in a way that was easier to handle than multiple images. And well, now they have this nostalgic appeal. I can’t watch this without a smile.

Luigi Sprite from Super Mario Bros.

Luigi Sprite from Super Mario Bros.

As old as 10 years ago (already? :-O) A list apart published an amazing article on how to use this same idea to reduce the amount of browser petitions for images. That article is wonderful, but apart (hehe) from that, it urges people to think creatively!

Long story short, this is going to be a post on how to create a CSS sprite image and stylesheet with 100 lines of python.

CSS sprite generator python

Leave a comment

Filed under code, tools

SLD in HTML and SVG

sld

A standard way to style any OGC layer is using SLD. Styled Layer Descriptors.

The Styled Layer Descriptors are a simple (and standard) way to style your web maps. But when you style you also want to generate a nice legend for it.

I recently found myself with the situation of reworking a website styling code. Instead of writing it from scratch we used existing pieces to cleanly fill our webapp divs with the correct legend.

Let’s style!

1 Comment

Filed under code, gis, Maps

Python and Jenkins

jenkins_logo

..
NOTE from the future:
Whoops, this was written and forgot in the depths of my drafts. So I just reviewed it and said, hey, It is acceptable to post πŸ˜€
..

The third (and probably last) post about this lovely Jenkins guy. It seems that people is right, lately I’m Jenkins man.

Most of what I do in Jenkins can be done with the Groovy Scripting language itself, usually via the Scriptler plugin to keep things organized.

I am a command line guy, and sometimes I just want to get a plain text file with the results for something, instead of firing up Jenkins, going to a build, checking the artifact or output.

In this post I’ll present how to combine a basic Groovy script, with a more in-depth analysis with a python script:

Let’s save some time

4 Comments

Filed under code, tools

Back To GIS

globe
Quick personal update.

This blog was originally GIS related (because that was what I was doing at the time). Time passed: I worked with ARM in the compiler group, and with SCYTL on their continuous integration systems. There are almost no posts related to ARM since I was not allowed to talk about most of the stuff, and continuous integration was kind of limited, but there’s a couple of remarks on Jenkins.

Now I moved again (It seems I can’t stop), landing at SITEP, a GIS related company (Yay!) in Barcelona. So, hopefully I’ll be working on interesting stuff and maybe (just maybe) I’ll have more to write about.

Generally I try to post compelling articles: things that helped me, or things that others might find useful, combined with small posts about books or other things.
And even with the small update cycle, this site enjoyed a steady flow of visits, and even some comments. I want to thank everybody who showed interest in those short three years. πŸ˜€

Salut!


1061 days since the first post, with 38 posts. It is roughly one post per month (If I spread them evenly). Being Basic Network Analysis With GRASS and Convex Hull, one algorithm implementation the absolute winners.

 

Leave a comment

Filed under Life

Auto Jenkins Setup

jenkins_logo_ansible
I recently talked about how to automate Jenkins using job-dsl. We are going a bit further here.

Jenkins is usually the frontend for projects to check their build status, but for some, Jenkins is the product that we develop, or where we drop plugins etc. In that case, we don’t want to do this into production.

In our case we work with Open Nebula as a VM provider, so it is fairly easy to create a quick VM to test something and then just remove it. It is not as common as having your own Jenkins instance, but since I found that I was doing this quite commonly, it was time to automate.

In this post I present an automatic way to set up a quick Jenkins host. So I just have to type a command and come back later.

automation time!

2 Comments

Filed under code, tools