Archive for the 'Computers' Category

Stravomatic: an Android app to automatically start Strava rides

Sunday, December 17th, 2017

This week-end I remembered that when I got my new phone, it counted my steps on its own, and I looked up why. I discovered that there’s a Google Play Service that enables developers to get the user’s activity (walking, running, cycling etc) and I decided to try to code my first Android app: Stravomatic.

I use Strava since a few years and find it great to keep track of statistics , but sometimes I forget to start it each morning and evening when commuting.

Development went much better than I expected and I think I have a good and reliable app that starts a Strava activity if I start bicycling (or running) (for completeness, because I never run) (apart this week-end where I went around the garden numerous times for testing). It’s a simple app with a settings page and a background component that keeps track of what happens :

As it doesn’t use GPS, and takes advantage of Google Play Services, it doesn’t seem to take a noticeable toll on the battery, so I’m quite happy about that.

I published it on Google Play : Stravomatic, and I’m quite proud about it! I hope it’ll help other forgetful people :)

How to act like an idiot and cost a free software project money

Thursday, March 13th, 2014

A few monthes ago, a user made us a €5 donation for Claws Mail’s Windows version. Then asked me over email and Facebook friend request for support on “error messages that pop is starting up prior to sm something da da da” (actual quote).

7i2dq

I just replied that this seemed like he’d need to enable POP before SMTP, and that he’d get better support on the users mailing list.

And this person then filed a chargeback at his credit card company, and consequently, Paypal withdrew €5 from my account, and withdrew an extra €16 the bank charged for processing.

This got me a little disgruntled, to say the least, so I sent Paypal screenshots of the user’s email support request and Facebook friend request, and Paypal forwarded those to the bank.

Yesterday I got news that the bank resolved this in our favor (and I do hope our indelicate user got a scolding :-)), and the €5 reappeared on my account.

The €16 processing charges, though, seem lost forever.

7i2f5

Full story about Claws Mail donations – what they are for, what they aren’t for.

iReport: adding QRCode to Jasper reports the easy way

Wednesday, October 9th, 2013

After testing various complicated solutions to embed a QR Code into iReport Jasper reports, the easiest way I’ve found is this:

1) Put ZXing’s Core and JavaSE jars in the classpath (using Tools/Options/Classpath if compiling locally, or the classpath property if using Ant and net.sf.jasperreports.ant.JRAntCompileTask)

2) Add an image to your report with the following settings:

  • Expression Class:
    java.awt.Image
  • Image Expression :
    com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
         new com.google.zxing.qrcode.QRCodeWriter().encode(
             $F{CONTENT_TO_ENCODE},
             com.google.zxing.BarcodeFormat.QR_CODE, 300, 300))

    Of course, replace $F{CONTENT_TO_ENCODE} with your actual content.

3) Compile the report and enjoy !

Panorama, Hugin, Stellarium and three.js: Creating equirectangular panos

Sunday, December 30th, 2012

It’s been a long time since I didn’t post any geek stuff here, so here we go. At last!

I’ve recently installed Stellarium, which is a great planetarium software, helping a lot to figure out what’s above our heads at a given time, what will be, or what has been, which is great  to learn the sky, figure out what will be enjoyable on the next clear night, or what that was the other day.

Stellarium has a nice feature that allows users to use their own landscape instead of the predefined ones. The predefined ones are nice, but they don’t really reflect reality for me, because I’m usually in my little garden, surrounded by walls and trees and other view-blockers. So I decided to make a landscape of “my garden” and went out and took pictures, rotating about myself.

360° worth of garden

I then imported all these pictures into Hugin, another great free software that helps stitching panoramas. Some years ago, the process was long and painful, filled with control points settings, corrections and this kind of things.

Nowadays, you can launch Hugin, click Load images…, select them, click Align…, wait, and click Create Panorama…, and wait. This thing just rocks and does everything by itself.

Here’s the Fast Panorama Preview window that Hugin opens after you click on Align, showing the result of its calculations. Most likely, you can just close that window and proceed with Create Panorama.

panorama

Now that you have a 100MB TIF file containing your 360° equirectangular panorama, you can open it with the Gimp to fix some of the details that Stellarium wants right. First, make sure that the image ratio is 2/1, and that both dimensions are a power of 2. (4096 pixels wide by 2048 high, for example). The ratio is for the panorama to look right, and the power of 2 is an OpenGL rendering requisite.

Last but not least as you’ll want to see stars in the sky, you have to remove the sky from your panorama. The best is to take the picture with a clear sky so that the sky’s colour is homogeneous. I’ve used the Gimp’s Select by Color tool, which is much greater than the Fuzzy Select tool for that job because it will also select the isolated sky pixels inside a tree’s branches, for example. In case some of the rest of the picture is sky-coloured too, just exclude these bits from the selection (using Ctrl + any other Select tool). When your selection’s right, make sure you have an alpha channel on your image (Layer/Transparency/Add alpha channel if it’s not already grayed out), then get rid of your selected sky (using Cut or the Delete key, for example). Here’s the result :

Panorama in Gimp

(You’ll see that the ground is bad, that’s because my original pictures didn’t include enough ground. Also, I cheated with some tree tops, because my original pictures didn’t include enough sky).

There just remains to export the file, and create Stellarium’s landscape.ini file, as described on their wiki. I suggest you use their Moon landscape’s landscape.ini file as a basis. The only information you need to have is your latitude, longitude and elevation, which you’ll get out of any smartphone, GPS or Google Maps; and the angle to use to point North in your landscape, calculated this way.

Aaaand, here we are in Stellarium, showing the perfect International Space Station transit that could have been observed on the 28th here (you can know when and where to look for the ISS easily, with NASA’s Spot The Station service or loads of smartphones apps):

stellarium

(Of course, it’s after sunset but you can still see it). The end result is not downloadable because it’s too big (45MB).

Added bonus

You can also export these panoramas to be viewable in HTML-5 compatible browsers, using the nice three.js library. Here it is (with a fake sky re-added) :

[iframe src=”/panos/jardin.jpg” width=”500″ height=”250″]

Use Right-click/This Frame/Show only this frame inside the image, then View source if you want to try that at home.

Two little screencasts

Monday, December 20th, 2010

It’s been a long time since I didn’t post any Claws Mail news… (probably because it’s reaching maturity) so here are two screencasts that should please our Windows users :

Hope you’ll like it !

news for few, stuff no-one cares about