Tag Archives: python

Tenma72-2540 Linux serial control

I daily work with a DC power supply to run different boards and prototypes. One day, plugging in the power supply I realized there was a USB and a COM port!
It is not correct from a tinkerer’s to avoid this option. So this day ended up with a small Python program (also golang, but that’s a different story) to use this feature.

more

Advertisements

Leave a comment

Filed under code, tools

XLS to CSV

A common situation for us (people in the programming/computing/processing world) is that we don’t always work with the same tools as some of our non-tech peers.

Case in point, I received a big bunch of files in XLS/XLSX format, very big files, LibreOffice has trouble working with them. Since I want to perform quick processing on that data, and I already have scripts that process similar data in CSV, the simplest path is to transform those files to plain, ugly, useful CSV files.

Then again, there are 100 files, and I don’t feel like dancing around each one: opening, clicking save as, selecting CSV, telling LibreOffice that this is a semicolon separated CSV file … etc etc.

Entering pandas.

continue please

Leave a comment

Filed under code, tips, tools, Uncategorized

Europe DbPedia 2017

europeflagdbpedia
I was kind of bored while doing some work, and just past week we were discussing with a colleague about my vague-places project.

This project was forgotten in time, but today I’ve blown the dust away, recovered it, and updated the Europe DbPedia map.

Image overview

Most of you won’t be interested in the full story. So here, see a set of results. If something picks your interest (like, why Portugal has almost no points) just keep reading 😀

Keep Reading

Leave a comment

Filed under curious, gis, Maps

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

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

Retrieve KML links

kmlhell

On my previous post I worked with a kml that was splitted in various networked kmz files. This was particularly annoying given that I had to track the files in my computer.

I am ashamed, this should have been automatized! And since a friend prepared a nice script for it, here it is.

get my kmls

Leave a comment

Filed under gis, tools