Skip to content

Posts...

Page 16 of 42

Mock an Observable Interface

August 1, 2016Categories: Software, Tutorial
TL;DR: Use a doAnswer() with a new Answer<Observable<Type>>() if you have to mock observables. Today I wrote my first test where I had to mock an observable interface: where the User model is: Solution In my test class (named UserDatabaseTest ), I first mocked the interface: Then, my setup…

Fix "Multiple dex files define L..." Errors

July 22, 2016Category: Software
Today I got an error when building the APK: Multiple dex files define L/... My scenario is that of a project with 2 modules: a core and an app . Both modules use a plugin named androiddevmetrics , which generate some code, including a class which has the same signature in both modules. The…

Thou Shall Stop Reading

June 30, 2016Category: IT
I've caught myself reading about a subject matter (now, that's android ). I've been reading articles, documentation on new libraries, looking for inspiration on the net about UI... All for an app I'm upgrading with new functionality and looks. This is bad and I'll stop doing it after I tell you…

Mirror a Website with WGet

June 10, 2016Category: Software
TL;DR: if you want to mirror a site where you need to authenticate, you need to do it in two steps. In the process of testing my app, I needed a mirror of the website I'm using. Since the website has authentication (via a form), the mirroring process has 2 parts. First part is to log in and get the…

Replace a colour in an image with imagemagick

June 8, 2016Categories: IT, Tutorial
I had to change the colour of some monochrome icons for a personal project, from black to something else (i.e. not black). I've tried in python with PIL. Unfortunately, my attempts to use ImageOps failed miserably, because I'm working with RGBA images, not RGB :(. Of course, one could separate…

Strip HTML tags in python

June 5, 2016Categories: Software, Tutorial
Note: This is a post transferred from Laurii for historical and consolidation purposes. A common problem I have to deal with quite often is to remove all HTML tags from a document. While this is easy for XML (well formatted etc.) and you could do it by hand with a regexp, HTML has a bit more…

Gitlab Dreamhost SMTP

June 1, 2016Categories: IT, Tutorial
The other day I've tried to install GitLab on Docker because I've got a Synology NAS which does support Docker :) I've found that if I create an user, it sends a confirmation email (of course it does!) and, unlike with Django, I'm not that versed in RoR to reconfigure to use logs instead of real…

Outlook VBA: Iterate recursively over folders

May 31, 2016Categories: Software, Tutorial
Note: This is a post transferred from Laurii for historical and consolidation purposes. As part of the program I've started , I had to perform a recursive walking of all sub-folders from a starting point in a .pst file. Code looks like this: This doesn't do too much... It selects a folder…

Cascade get value from dictionary in Python

May 31, 2016Categories: Software, Tutorial
Several times I've been faced with the problem: Get a value from a dictionary. If the key is not present, then get from another key. Normally, the implementation would go like this: Or, even worse, with try-catch statements. That's fine if the sequence is fixed, but what if you want to have some…

Outlook VBA: Write to a file

May 30, 2016Categories: Software, Tutorial
Note: This is a post transferred from Laurii for historical and consolidation purposes. I'm not a master in VB (I hate it actually) not in VBA, but it;s quicker to write something like a hack in VBA for outlook than in C#. So, here's a tiny snapshot on how to write to a file in Outlook (my…
PreviousNext

All tags