Laur IVAN

BIOS Loads from 0x7c00

Posted by in Software, Tutorial

Today I was investigating a bug where a simple program wasn’t executing properly. It emerged that BIOS loads the code from the MBR at 0x7c00. Relevant info reproduced here: The (legacy) BIOS checks bootable devices for a boot signature, a so called magic number. The boot signature is in a boot sector (sector number 0) and it contains the byte sequence 0x55, 0xAA at byte offsets 510 and 511 respectively. When the BIOS finds such a boot sector, it is loaded into memory at 0x0000:0x7c00 (segment 0, address 0x7c00). (However,…read more

Set Different Gradle Configurations

Posted by in IT, Tutorial

TL;DR: create a global gradle.properties file (in <HOME>/.gradle or GRADLE_USER_HOME if defined). Place there the system specific configuration. The other day I had the unpleasant surprise that Android Studio replicated my proxy settings into gradle.properties and got committed to Git. Including a password (which has since became obsolete). Since my other environment doesn’t use a proxy, I got an error there. Now, the question became: How do I create a single project gradle settings file which would allow me to run smoothly in both places? Although I thought of a…read more

Migrate Chromium and Keep all Settings

Posted by in IT, Tutorial

TL;DR: Backup App Data\Local\Chromium on your old machine, copy it to your new one and uncompress (in the same place), install Chromium, profit. With the migration to a new computer, I’ve managed to keep all my Chromium settings. The steps I did are the following: On the old computer Note the chromium version you’ve installed Go to App Data\Local Archive the Chromium directory Note: this might be huge! To reduce it, clean the Chromium\User Data\Default\Cache Note the plugins (optional) – this might be useful if you have plugins depending on…read more

Install and Use Package Control Behind Proxy

Posted by in IT, Tutorial

TL;DR: Install Package Control manually. Add the proxy settings to the configuration file as described in step 2 below. Today I’ve had to install Sublime Text 3 again on a new computer. Package control didn’t want to install due to my proxy settings (I was getting a 407 error code – Proxy authentification required). I managed to do it with two simple steps: Install Package Control manually. At the time of writing this post, the process is simple: Click the Preferences > Browse Packages… menu Browse up a folder and…read more

Fix “No Voice” with Kraken 7.1 and VLC on OSX

Posted by in Hardware

Today I had an odd issue with my Kraken 7.1 Chroma: I could not hear the voices in a movie in VLC. I could however hear the other sounds (like the voices were filtered out). I could also hear everything with the internal speakers or one of the monitors… I’ve tried finding answers online but the only bits I could find were for Windows. So, without further ado, my solution is to install Boom 2 (as a trial). I’ve ended up buying it because it boosts up audio nicely. If…read more

Mock an Observable Interface

Posted by in 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() method is:

where USER_NAME is a String. To use it, you need to attach an observer and assert:

This is quite simple. Alternative Note: This I haven’t tried yet, but here it goes… If you want…read more

Fix “Multiple dex files define L…” Errors

Posted by in 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 linking (APK generation) resulted in an obvious conflict. My steps to solve this error are: Identify which package/module generates the error. The L/com/android/… will tell you exactly who the culpable is. In my case, the idea is to…read more

Thou Shall Stop Reading

Posted by in 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 why. First of all, it’s the time. My time is limited because this is done outside work hours. With the other stuff I’m doing (e.g. watch a game), the time I can dedicate to development drops even more. The new…read more

Mirror a Website with WGet

Posted by in 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 cookies:

Now, the cookies are saved in the cookies.txt file. Note that you need to specify –keep-session-cookies. Otherwise, the file will be empty. The second part is to actually…read more