Archive

Author Archive

Java profiling

March 18, 2017 Leave a comment

YourKit is a great Java profiling tool. It is a commercial software but you can get a free 15-day evaluation license key for a fully functional version of the profiler.

The past week I was working on a Java project and the software was very slow. Using YourKit I could easily find the bottleneck. It turned out that 94% of the time was spent in a function that I implemented in a naive way. Choosing a better algorithm the software got much faster. A profiler is really useful…

For Java I use Eclipse. YourKit integrates in Eclipse perfectly through an Eclipse plugin.

Python profiling

Here is an excellent post about Python profiling.

Categories: java, python Tags: , ,

[Eclipse] use spaces instead of TABs

March 18, 2017 Leave a comment

Here is how to use spaces instead of TABs in the Eclipse IDE:

  1. Click Window -> Preferences.
  2. Expand Java -> Code Style.
  3. Click Formatter.
  4. Click the Edit button.
  5. Click the Indentation tab.
  6. Under General Settings, set Tab policy to: Spaces only.
  7. Click OK to apply the changes.

Tip from here.

Categories: Uncategorized Tags: , ,

Some IMDb alternatives

March 10, 2017 Leave a comment

IMDb shut down its message boards in February, 2017. Read more here. This is a shame. When I watched a movie, I loved to read the opinions of other people on this forum. It was a very stupid decision from IMDb and I’m sure I’ll visit their site much less.

Here are some alternatives:

Unfortunately, these sites won’t replace the good old message boards…

Project idea: write a script that takes the title of a movie and opens these sites in tabs. The sites in the tabs show the selected movie.

funny git commits

February 19, 2017 Leave a comment

Some funny GitHub commits:

Found here.

What to do if shit happened.

Categories: Uncategorized Tags: , , , ,

increase sudo timeout

February 12, 2017 Leave a comment

Problem
You want to increase the sudo password remember timeout.

Solution
Run “sudo visudo“, then add this line to the end:

Defaults    timestamp_timeout=60

Where 60 means 60 minutes. If you specify -1, then the password is never forgotten (which is not a good idea IMO).

Tip from here.

Categories: bash, linux Tags: ,

[manjaro] let “Super + d” show the desktop

February 9, 2017 Leave a comment

Problem
The “Windows key + d” (aka “Super + d”) minimizes all windows, i.e. it shows you the desktop. It works under Windows, it works under Ubuntu, but for some mysterious reason, under Manjaro (XFCE), it’s “Ctrl + Alt + d” that I’ll never get used to.

How to use the well-known “Super + d” shortcut?

Solution
There must a keyboard shortcut editor for this, but I never find it. So I created a new shortcut that calls a command-line application that minimizes all windows. This way you get the same result. The command-line command for showing the desktop is “wmctrl -k on“. You may have to install the package wmctrl.

Go to the Start menu, start typing “keyboard”, and open the Keyboard application. Go to the “Application Shortcuts” tab and add the “Super + d” shortcut to the command “wmctrl -k on“.

Categories: manjaro Tags: ,

a new range of shortcuts with the Hyper key

February 9, 2017 Leave a comment

On the YouTube channel of gotbletu I found a very nice trick (video). It explains how to replace the Caps Lock with the so-called Hyper key. And why? Because Caps Lock is pretty useless and you cannot use it for shortcuts. But if you tell the system that at the place of Caps Lock there is another key, namely the Hyper key, then you can use a new range of shortcuts.

You can find my .Xmodmap file here. Just put it in your HOME folder and upon the next reboot it’ll be activated automatically. To activate it without a reboot, use the command “xmodmap ~/.Xmodmap“.

Then, under Manjaro (XFCE), go to the Start menu, start typing “keyboard”, and open the Keyboard application. Go to the “Application Shortcuts” tab and add some new shortcuts. This time, when you press Caps Lock, it’ll be recognized as the Hyper key. I added these:

Hyper + g    gedit
Hyper + k    konsole
Hyper + f    file browser (thunar)

Music video

And if Hyper Hyper, then Scooter, of course: