Table of contents

  1. NVidia GT1030: how to run TensorFlow on Ubuntu 16.04

    March 2018

  2. ffmpeg: gapless video splitting and concatenation

    December 2016

  3. BUG: Android Kotlin dex transformation error

    February 2016

  4. Android ART can’t set final fields correctly

    January 2016

  5. The generated R class cannot be found (Android Annotations, AA and product flavors)

    May 2015

  6. Android transparent selector drawable doesn’t work

    May 2015

  7. How to Make Building with Gradle Faster

    October 2014

  8. Android .gitignore (Gradle + Android Studio)

    October 2014

  9. Compass + Yeoman

    October 2014

Content

NVidia GT1030: how to run TensorFlow on Ubuntu 16.04

I used these guides, though it was a quite long dance, so I didn’t write everything down 🙁
1. https://www.nvidia.com/en-us/data-center/gpu-accelerated-applications/tensorflow/
2. http://www.python36.com/install-tensorflow141-gpu/
3. https://medium.com/@samnco/using-the-nvidia-gt-1030-for-cuda-workloads-on-ubuntu-16-04-4eee72d56791

Key points:
1. Need to install a graphic driver nvidia-375.
2. Don’t reboot.
3. Then need to install CUDA (9.1). It’ll also install nvidia-384, though it doesn’t make a login loop after that.
4. Reboot.
5. Compile TensorFlow from the source code.

The driver and CUDA are deb-based.

Good sign: your video adapter should work. Just installation of drivers (correct) – 90% of success. DO NOT download drivers or cuda from the official site. Only from official repos. See guide aboves for the details.
If have any questions, please, mail me: egslava@gmail.com

ffmpeg: gapless video splitting and concatenation

For instance you have a big video file and want to split it onto several parts all.mpg. Splitting it on 1 sec parts:

After this you can want to check the result by combining these files together in one:

One alternative is:

But it works for me not always. So there’s also another one:

  1. Creating files.txt:

  2. Running

And here we’re!

BUG: Android Kotlin dex transformation error

Today I got strange error on HelloWorld-like project:

Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java” finished with non-zero exit value 1

Continue…

Android ART can’t set final fields correctly

For example you have class Person. Person is a POJO for REST-service (for instance, for using with retrofit).

This line of code creates two read-only fields. It’s necessary to assign initial values because every field is final. But there’s another way to do the same thing:

It’s hard to believe, but second – is the only right way to create class.

For example, you’re creating class instance:

I think it depends on JVM but it’s truth for Android ART.

How to Make Building with Gradle Faster

In the root of your project (in the directory with settings.gradle) create or just open file local.properties and add these two lines:

org.gradle.parallel=true
org.gradle.daemon=true

Compass + Yeoman

There’s an elegant method to connect Compass to Yeoman I couldn’t find in the web.
One line of code
So I just leave this here.

Continue…