Laur's blog
  • Home
  • About
  • Support my work
Sign in Subscribe
Definitive Tutorial to CM13 on LG G2 D802
cm13

Definitive Tutorial to CM13 on LG G2 D802

NOTE: You need to be able to reach download mode at least (Power + Volume Up). If you don't you need to go search somewhere else how to get to this point. Prerequisites You'll need the following: * A Windows machine. Windows 8 is what I tried, but
Feb 24, 2016 3 min read
Clean Factory Reset for LG G2 (802)
g2

Clean Factory Reset for LG G2 (802)

TL;DR: If you can't enter recovery (but you can enter download mode) and you've installed Lollipop stock back from CM13, you need to erase everything (CSE Flash on your LG Flash Tool). The other day I've updated CM13 to a new nightly and
Feb 22, 2016 2 min read
GoogleApiClient .connect() Interface or Class
android

GoogleApiClient .connect() Interface or Class

TL;DR: * If it's your code, check the version play services (com.google.android.gms:play-services-\*). * If you're using a library, check if the library has a version using play services >= 8.1.0. If not, you'll need to clone and upgrade it
Feb 14, 2016 1 min read
Fix Gradle Error: UNEXPECTED TOP-LEVEL EXCEPTION
dex

Fix Gradle Error: UNEXPECTED TOP-LEVEL EXCEPTION

Today I got the lovely UNEXPECTED TOP-LEVEL EXCEPTION from the dexer in android. Looking on the net yielded several causes and resolutions. Note: I'm using Gradle 2.10, Android Studio 2.0.0-beta2 Caching Apparently, sometimes Gradle is shooting itself in the foot with the caching. The first
Feb 10, 2016 1 min read
Migrate PostgreSQL Between Two Machines
database

Migrate PostgreSQL Between Two Machines

TL;DR: Once you prepare the connection, pg_dump is your friend. Recently, we had to migrate a large-ish DB (1.5 TB) from a Windows installation to a Linux one in order to accommodate a series of third party extensions. We have split the process in three: 1. Prepare
Feb 5, 2016 3 min read
Hide Apps in Nova Launcher Drawer
android

Hide Apps in Nova Launcher Drawer

TL;DR: Select Nova Settings -> App and widget drawers -> Hide apps (scroll down bit) -> select the apps you want to hide. I've noticed that my app drawer started to get cluttered with stuff I'm not really using (like the Audio
Jan 28, 2016 1 min read
Add Wear Notifications to Android App
android

Add Wear Notifications to Android App

TL;DR: Use android.support.v4.app notification mechanism. Steps are: * Create a WearableExtender: NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender() .setHintShowBackgroundOnly(true) .setHintHideIcon(true) .setContentIcon(R.mipmap.ic_launcher); * Extend the notification mechanism: NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setContentTitle(titl
Jan 24, 2016 1 min read
LibGDX drawPixel has Wrong Colours
colour

LibGDX drawPixel has Wrong Colours

TL;DR: Note that Pixmap.drawPixel(x, y, colour) expects a RGBA8888 colour, even if the pixmap is not RGBA8888. Today I wanted to create a background with a bunch of different pixels and I had a lot of problems, displaying different colours from what I had in my array.
Jan 17, 2016 1 min read
Create a Background with Vertical Lines of Different Colours
background

Create a Background with Vertical Lines of Different Colours

I've got a list of colours (RGB) in an array and I want to build a background with vertical lines, each representing a colour from my list. The process is too simple to put in a TL;DR :) If my list of colours is, Array<Vector3>
Jan 17, 2016 1 min read
Stream from a String Instead of CIN in C++
c

Stream from a String Instead of CIN in C++

TL;DR: You can stream from a string instead of STDIN. Code is simple and is listed below. A project I did recently had a requirement to overload the >> operator use and STDIN to load data. The problem was not the overload itself, but the fact that testing
Jan 11, 2016 1 min read
Load Glyphs with LibGDX
android

Load Glyphs with LibGDX

TL;DR: Remember to give the font loader the list of characters to render from the font! I'm trying to get a more resolution-independent mechanism to load simple shapes in place. After investigating SVG loading for several days I got nowhere. Then, I found out that libGDX actually
Jan 3, 2016 3 min read
Don't Use Assert() If You Don't Mean It (C++)
c++ assert

Don't Use Assert() If You Don't Mean It (C++)

I found the hard way that assert() in C/C++ exists hard. This post explains that you get a SIGABRT . So, if you want your code to be testable, you better throw an exception instead. I defined a LOGIC_ERROR(condition) macro: #define LOGIC_ERROR(e) if(!(e)) throw std:
Dec 26, 2015 1 min read
Trick C++ on Unused Variables
macro

Trick C++ on Unused Variables

If you enable warning on unused method parameters ( -Wextra or -Wunused) and you get warnings in method parameters, you're supposed to change the signature. Sometimes this is not OK and you still need the build to pass cleanly. Java has the glorious @SuppressWarnings, so my best and most
Dec 24, 2015 1 min read
Simple Floating Point Equality Check in C++
c

Simple Floating Point Equality Check in C++

TL;DR: Here you can see a handmade comparison function for floating point values. While working on a C++ project using templates, I had to perform an equality to see if two values are identical. While the == is OK for integer values, it is not really OK for floating point
Dec 21, 2015 1 min read
Build a Simple Makefile
c

Build a Simple Makefile

TL;DR: If you don't have anything better to do, create Makefiles by hand :) Gist here. The other day I went back to origins with building a small C++ project. With modern tools, all went OK. However, deployment was a bit of a problem, in the sense the
Dec 21, 2015 2 min read
Generate Amazon Underground Launcher Icons
amazon

Generate Amazon Underground Launcher Icons

TL;DR: Use (adapt) the script below to automatically generate the Amazon Underground application launcher icons. I was toying with the idea to build an Amazon Underground version of one of my applications. According to their rules, you need to: * Repackage your app * Name custom permissions (Lollipop) * Apply Amazon Underground
Nov 27, 2015 2 min read
Fix "Damaged app" Message
application

Fix "Damaged app" Message

TL;DR: Use xattr -rc /location/MyApplication.app (see here). I use to save all my apps on my NAS. The other day I wanted to use an old app for colour palette. I've downloaded it from my NAS and...: “MyApplication” is damaged and can’t be opened.
Nov 17, 2015 1 min read
RGB to HSV to RGB - for Shaders
glsl

RGB to HSV to RGB - for Shaders

TL;DR: Go here to get the RGB->HSV and HSV->RGB conversion functions for shaders. The other day I tried to tint a colour in a texture (or rather all texture) with a different colour. It's quite easy to rotate things around, but, if you
Nov 15, 2015 2 min read
About Java Exceptions in SE 7
7

About Java Exceptions in SE 7

TL;DR: JDK 7 improves on exception handling (less code, base exception class...). Base exception class Reflective operations exceptions now have a base class ReflectiveOperationException. This allows you to to a global catch rather than one for each exception. Now you can write: try { // Some reflective stuff ... } catch(ReflectiveOperationException e)
Nov 7, 2015 1 min read
Picking Colours for Your Application
android

Picking Colours for Your Application

While working to get a theme for my new app Epso View (Play and Amazon), I've identified two types of websites: * Inspiration (like dribbble or materialup) * Combinations (like colourlovers or materialui) You can use the inspiration sites to get inspired; what colours work together, would your app look
Nov 5, 2015
TIL you can mix ASC, DESC in ORDER BY (SQLite)
ascending

TIL you can mix ASC, DESC in ORDER BY (SQLite)

TL;DR: You can use ORDER BY column1 DESC, column2 ASC ... in your code. The other day I was trying to get a custom ordering in a list for an object: * order decreasing by UNREAD MESSAGES count and then * order ascending by DATE Initially, I tried a GROUP BY, but
Nov 4, 2015 1 min read
Python and Outlook - An example
mapi

Python and Outlook - An example

TL;DR: Install win32 extensions (e.g. using this to put it in your virtual env). Read some code below (there are folders with stuff, messages have CapitalizedPropertyNames). Profit. The other day I needed to perform some statistics on an Outlook mailbox. In particular, use the frequency per day to
Oct 20, 2015 3 min read
TIL: Lambda Expressions
expression

TIL: Lambda Expressions

TL;DR: A lambda expression is a shortcut notation to anonymous inner classes containing a single method. Usually, they define implementations for functional interfaces (interfaces declaring a single method). Today I finally found out what lambda expressions are (formally) by watching this tutorial. Lambda expressions are a concise way of
Oct 19, 2015 1 min read
Got an OnePlus Two - Cleaning it up
android

Got an OnePlus Two - Cleaning it up

Today I got a OnePlus Two without an invite, from one of the many crazy providers with European warehouses. Woo-hoo. Unfortunately, recent reports state they come with malware. Since this phone will not be used by me, I'll clean it up. Here are the steps I took: Preliminary
Oct 15, 2015 2 min read
Addendum to Installing CyanogenMod 12.1 on a LG 802
12.1

Addendum to Installing CyanogenMod 12.1 on a LG 802

Today I got sufficiently annoyed with the stock version of Lollipop on my phone and decided to try (again) CyanogenMod (no longer alive). I've tried to follow the steps in the wiki, but got into problems, so here's my alternative experience. Preparation Make sure you install
Oct 13, 2015 2 min read
← Newer Posts Page 17 of 26 Older Posts →
Laur's blog © 2026
  • Sign up
Powered by Ghost