git gui: Error when opening dialogs

I have 3 monitors configuration and recently I have noticed issue in ‘git gui’. When I tried to revert changes or merge branch, this dialog appeared:

smalldialog

That caused hang of window. In command line was visible an error:

jarek@lp-jarek:~/Navigo3/master/np$ git gui
bgerror failed to handle background error.
 Original error: bad pad value "3m": must be positive screen distance
 Error in bgerror: bad pad value "3m": must be positive screen distance

After some googling I have found an issue (bogus DPI):

jarek@lp-jarek:~$ xdpyinfo | grep -A1 dimen
 dimensions: 5408x1152 pixels (0x0 millimeters)
 resolution: -2147483648x-2147483648 dots per inch

And fixed it via:

jarek@lp-jarek:~$ xrandr --dpi 96
jarek@lp-jarek:~$ xdpyinfo | grep -A1 dimen
 dimensions: 5408x1152 pixels (1430x304 millimeters)
 resolution: 96x96 dots per inch

i-tec USB 3.0 Dual Docking Station & Ubuntu 16.04

My desktop looks like:

2016-10-27 08.18.44.jpg

I wanted to have 2 external monitors, but my Dell  Inspiron 15 (7559) has only one HDMI port. Other thing was that I had to plug/unplug many cables when I wanted to go to meeting room. So I decided to buy USB 3.0 dock. Not an easy task when you love Linux. Most docks only support Windows and OSX.

I have purchased i-tec USB 3.0 Dual Docking because they promise Ubuntu 16.04 compatibility. They only “forgot” to mention that only KMS drivers are supported, so forgot official NVIDIA blob drivers. Even with Nouveau drivers there was issues. Because I had also another issues I switched off dedicated card completely.

Then it was necessary to install DisplayLink driver from here. But after reboot graphic part of dock did not work. By running dmesg I have found out that kernel module was not loaded. I am using SecureBoot and their kernel module is not signed. So I have to do following as root:

cd /root
mkdir signing
cd signing

#generate certificate - do this once, but keep result files - you will have to sign modules for every kernel update
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Descriptive name/"

#import your certificate as trusted into SecureBoot
#remember entered password - you have to fill it after reboot and confirm adding certificate
mokutil --import MOK.der

#sign your module - you have to do this on every kernel update
/usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n evdi)

Then reboot your computer, authorize new certificate and dock should work!

Currently I have last issue: when playing music through dock it is time to time reset. It disconnects monitors, network and audio…

Dell Inspiron 15 (7559), Ubuntu 16.04 and NVIDIA GeForce GTX 960M

I had purchased Dell  Inspiron 15 (7559) when I entered my current job at Navigo3. I was asked to buy Dell to keep same brand with other laptops in company. I made some research and only feasible option (SSD, 16GB RAM, …) was this one. Unfortunately it is based on Intel Skylake which is not fully supported in Ubuntu 16.04 yet. It should be better with 4.8 kernel that should be backported in February 2017.

However main issue is dedicated graphics. I have experiences various issues from freezing during boot, problems with suspend, setting resolution on multiple screens, etc. Because I mostly do web development, I don’t need dedicated graphic card. So I decided to switch off dedicated card and keep only Intel HD Graphics 530. It is quite easy:

Install bbswitch-dkms:

apt install bbswitch-dkms

Switch off NVIDIA card by appending following into /etc/modules

bbswitch load_state=0

Blacklist NVIDIA by appending following into /etc/modprobe.d/blacklist.conf

blacklist nouveau
blacklist nvidia

 

And finally update initial ramdisk by running

update-initramfs -u

After reboot only Intel should be enabled:

intel.png

Credits: http://askubuntu.com/a/709552/93726 (Sorry, I cannot upvote because I don’t have enough reputation points)

PAC manager: Slow clipboard paste by middle click

I have create new AWS instance and defined connection to it via PAC manager. Later I realized that pasting through middle mouse button click or pasting through context menu is incredibly slow. Almost like typing it on keyboard. Pasting through CTRL+INSERT was fast.

I suffered two days with it and did not succeed in googling that issue. Today I found out that problem was in “Wait 200 millisecs for automated char sending” setting. In rest of connections it is set to 0 so I have no idea how this setting was done – maybe I set it by incident.

pac

Gradle + Immutables + Eclipse

There is some documentation about IDE integration directly on Immutable web. Unfortunately none of proposed approaches works.

Fortunately there is Gradle plugin gradle-processors. Usage is deadly simple:

plugins {
  id 'org.inferred.processors' version '1.2.3'
}

dependencies {
  processor group: 'org.immutables', name: 'value', version: '2.2.6'
}

(Please not usage of processor instead of compile in dependencies)

That’s it! Just do gradle eclipse and restart Eclipse.

Music that resonates with my brain

I usually prefer songs with strong lyrics. But sometimes I meet melody that resonates deeply inside me. This experience is probably not universal – I doubt that wide audience would appreciate this list that high. It is more than “I like it”, it is much much deeper experience.

As you may find in post Modern approach to AI I like hierarchical model of brains. And I believe that this experience happens deep inside of this hierarchy. Recently I read William Calvin’s The Cerebral Symphony. And I get idea of multiple parallel hierarchies causing local excitement on certain level. Using darwinism are then found winners that may excite higher levels. It helped me a lot in thinking about brain structure – in previous thinking I was too limited by idea of single hierarchy and had problems with biological topology.

Resonating with music is that kind of  experience you can’t tell easily by human language – because human language was created to describe world around us – and that happens on shallow levels of hierarchy. This happens much deeper – I would not hesitate to call this deep levels soul. And people that can describe that experience are artists. Books, music, poetry, painting, films. By such methods they can describe abstract terms like love, faith, democracy, justice. And maybe build new representation deep inside of you – as sometimes happen after good book or film. And you can – if you are not an artist – express such abstract terms only using metaphors and examples. And only poorly.

Every single person having own representation deep inside may explain many clashes in society. For example Donald Trump’s internal representation of democracy is way different than mine 🙂

Here goes list of my über-melodies. Do we share some of them?

Jazz:

Classic music:

World music:

Believe Driven Development

Years ago I was young programmer starting his professional programming career. I had my eyes widely opened. And I was lucky. Very first project I was assigned to was driven by boss-of-my-boss who was incredible source of inspiration.

When we get raw specification I started rolling up my sleeves and starting my IDE. I wanted to program. Now. But I was disappointed. We spend incredible amount of time on meetings with customer (it was internal one) where we tried to get not only what  customer wants, but also what is its motivation for it. And not only that – we learned step-by-step business domain of customer – vocabulary, rules, conventions, best practices, etc.

We spent so much time with it that I was more and more skeptical about finishing project before deadline. But deeper and deeper we were in discussions I more and more realized how wrong product I would build without this information.

Then there was this moment from when we started to get feeling we are discussing same topics again and again but there is no resolution to discussed problems. That was correct moment to start implementation. We were aware of many problems we may have. That was enough, it was not necessary to have answer for them. It appeared later that some of them had simple solution, some had no good solution and some were just virtual problems that disappeared. But we were aware of them.

As Dwight D. Eisenhower puts it:

Plans are nothing; planning is everything.

I don’t have to say that project was successful and that software is still in production usage (12 years now). Since then I used this approach many times and it always led to less stress development and better product when compared to other teams that uses Believe Driven Development (BDD), as I named it.

So what is BDD:

  • You believe your assumptions are correct
  • You believe you understand customer needs
  • You believe that customer understands his needs
  • You believe that you understand business domain
  • You believe that you don’t need to analyse complex environments (business rules, future requests, machines, software) in advance
  • You believe customer is providing correct information
  • Customer believe you can deliver what he dreamed of

Opposite approach of  BDD would be Assurance Driven Development (ADD):

  • You assure your assumptions are correct
  • You assure that customer knows what it needs
  • You assure you learn enough from business domain
  • You assure you understand complexity of environment
  • You assure information provided by customer is correct

Be suspicious. About customer, conventions, rules, your assumptions, … everything. Put all of this to the test. Asked for same information from many points of view. Make sure you build correct model of reality in your brain. Then start, but assure you validate your model again and again and again as time goes and new information appears. As Elon Musk does.