Aside

Fixing a slow UI of a Java application running on Windows 10 in VMware Fusion

When maintaining systems for customers, I regularly use Windows 10 for VPN’ing to their systems and DbVisualizer for querying databases. However, recently the DbVisualizer user interface (UI) became sluggish and with what seemed like very slow refresh rates.

I suspected that some programmatically changed 3D settings of the virtual machine running in VMware Fusion or the settings in Windows 10 could be to blame, and I tried changing them systematically, but to no avail.

I then turned to tuning the Java VM graphics-related parameters and found that adding the following property (and restarting DbVisualizer) did the trick:

-Dsun.java2d.noddraw=true

Now, DbVisualizer is again speedy as I don’t know what. 

Aside

Troubleshooting “detected broken kqueue” on macOS

When attempting to compile a program using the Crystal compiler on macOS Sierra 10.12.1, I ran into the following error:

[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I solved the problem by reinstalling libevent:

brew update && brew reinstall libevent

…and then reinstalling the Xcode command-line tools:

xcode-select --install

Afterwards, I was able to run crystal -v and compile my program without any errors. 

Sources

https://github.com/Homebrew/homebrew-core/issues/2869

Aside

What to do when an external hard drive won’t mount on OS X

I recently experienced the that my external Western Digital My Book hard drive wouldn’t mount the WD Unlocker partition (for encrypted drives) on Mac OS X as it usually does.

Skimming though the console logs, I found a rather disturbing error message that described why the partition couldn’t be mounted:

28/07/2016 20.48.34,000 kernel[0]: disk2s0s2: alignment error.

After doing some googling, it seemed as if the disk was toast: in some forum posts, WD staff suggested that people should get the disk replaced if they experienced such errors. In other threads, it would seem that people suddenly experienced the error after upgrading to OS X 11.something.

Apparently, it all relates to the partition table information somehow being in an inconsistent/erroneous state, and OS X thus not being able to read the disk at all. OK, so OS X not being able to read the data, let alone not being able to fix the problems, is bad enough by itself, but the thought of not being able to recover the data on the disk at all was pretty annoying.

Luckily, I have had great experiences with installing file system drivers for various non-native file systems in different operating systems, and I thought that installing a driver for OS X’s HFS+ on a Windows box, and attaching the external hard drive to it, just might do the trick, as the driver, and the way that the operating system would access the disk might be different from what OS X does natively.

So, I installed the HFS+ driver for Windows 10 from Paragon Software, and after connecting and unlocking the drive with the Windows-based WD software, the HFS+ partitions showed up, and I was able to access the data without any problems whatsoever. Afterwards I tried reconnecting it to OS X, and the WD Unlocker partition showed up just as it had before the error.

Customizing Desk

The Desk App for Mac OS X – in all its simplistic glory – really is a fantastic editor for working in a non-interrupted flow with your texts.

However, for those of us with particular aesthetic contemplations, we may wish to change the default font used. Currently, it doesn’t seem that Desk supports this in a graphical user interface, which is why I bring to you this simple 9 step guide for setting the font you like!


Disclaimer: proceed at your own risk and remember to take proper backups!


Our goal is to edit the cascading style-sheet (CSS) that Desk uses for its built-in editor and configure it to use a another font installed on our Mac. To accomplish this, we’ll locate the CSS file within the Desk application package and edit it with the built-in GUI text-editor “TextEdit”.

The steps to accomplish this are as follows:

  1. Open a Finder window
  2. Navigate to the folder “Applications”
  3. Right-click on the “Desk” app icon and click “Show Package Contents”
  4. Navigate to the folder “Contents” > “Resources” > “MCE” > “css” (shown below)Screen Shot 2015-01-20 at 13.20.55
  5. Right-click on the file “iframe.css” and choose “Open With” > “TextEdit”
  6. Search for the line starting with “body {” (currently around line 20)
  7. Edit the “font-family” statement found a couple of lines below that to reflect your choice of font by placing the font name first in the list (see below for an example)
  8. Save the file (possibly needing you to authenticate as this is a restricted file)
  9. Start Desk – your changes should be visible

I have found that the font Quadon works great for me, and therefore my customized “font-family” statement in “iframe.css” has Quadon as the first font mentioned, with fallback to the usual sans serif suspects:

body{
 display: inline-block;
 overflow: hidden !important;
 border: 0 !important;
 margin: 0 !important;
 font-family: Quadon, Helvetica, Arial, sans-serif;

Happy hacking! 

Aside

Accessing a locked HSQLDB database file in read-only mode

Working a lot with the Atlassian tools (JIRA, Confluence, Crowd, Stash etc.), I often have to connect to the databases running behind them in order to perform various SQL queries on the data.

In a couple of use cases, it’s very convenient just to use the standard embedded HSQL database (HSQLDB) instead of a standalone relational database management system. However, with HSQLDB running in embedded mode, a lock file is set on the database file to inhibit other JDBC connections from writing to the database, which is, of course, very sensible (wouldn’t want any inconsistent data, now would we).

Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@d446e57c[file =/SOME_FOLDER/database.lck, exists=true, locked=false, valid=false, ]

To remove the lock on the database file, we would have to stop the application altogether. However, in many cases I want to query the database in read-only mode while the application is running, and fortunately the HSQLDB JDBC driver provides a property that can be set to provide lock-ignoring read-only access to the database file.

My database query tool of choice is the excellent Java-based tool called DbVisualizer, and setting the property can be done very simply in the Driver Properties tab of the connection settings view, adding a parameter “readonly” with value “true”.

HSQLDB readonly property in DbVisualizerWith that set, all that is left is rock and roll – SQL style! 


Further reading

Atlassian: Connecting to HSQLDB using DBVisualizer or HSQL database manager

Exploratory Ruby-magic with the iRuby Notebook

Learning the programming language Ruby can be a wonderful experience. The language is elegant and well-designed, promoting the use of eloquent and very human-readable programming constructs. Also, it speaks to my aesthetic sense in its syntactic simplicity and no-nonsense approach.

Personally, I learned Ruby through why the lucky stiff’s “The Poignant Guide to Ruby”, the Rails handbook, the Ruby Pickaxe book, and a lot of chatting on IRC. At the time there weren’t that many available screencasts (and no MOOCs), which, fortunately, has changed since then.

I like the idea of learning new programming languages ever so often, as it expands and enriches my way of thinking and creativity related to problem solving in the software domain.

Learning can be done in a lot of ways, and I have found that note-taking is an important activity for efficient learning during my personal learning endeavors. However, I’ve always felt like there was some gap between the notes I was taking about programming and the code and examples that I wanted to go with them to completely support my comprehension (especially after some time). You know, runnable code and notes intermixed.

Sure, you can make a Ruby-script and insert a lot of comments, but I’m more of the aesthetic type, so I wanted to be able to throw different fonts, graphics etc. in there. What to do?

Lo and behold! On the O’Reilly Strata + Hadoop World conference in New York, iPython and iPython Notebook was presented, and was is exactly what I have been longing for: Notebooks mixing HTML/Markdown, graphics and, not least, runnable Ruby code.

While installing iPython I ran into some problems, so here’s an end-to-end installation guide using Brew on Apple OS X:

 $ mkdir iruby # Create a new directory
 $ echo 'iruby' > iruby/.ruby-gemset # Define the Gemset to use
 $ echo 'ruby-2.2.0' > iruby/.ruby-version # Define the Ruby-version to use
 $ cd iruby # cd into the directory
 $ brew install zeromq # Install the libzmq dependency
 $ sudo pip install ipython pyzmq jinja2 tornado # Install Python dependencies
 $ gem install iruby pry rmagick rubyvis gruff # Install iruby and other Ruby goodness
 $ iruby notebook # Start iRuby Notebook
 
Status

Attending Strata+Hadoop World NY 2014

If you’re the slightest bit interested in data science, big data and everything in between, you should definitely visit one of the Strata+Hadoop World conferences.

With great speakers showcasing stories from the trenches, and industry-leading exhibitors demonstrating their impressive software, I’m having a blast here at Strata+Hadoop World NY 2014.

If you can, make room for yourself at Strata+Hadoop World Barcelona! I can promise that you won’t regret it. 

Ahoj Gamutron

Being a software guy, I pondered what technology this blog should be built with.

I love the Ruby programming language for its brevity and succinctness (amongst others), so some Ruby-based CMS-platform would have been the natural choice.

However, a static website generated by something (like Jekyll) would also have its charms (most of which would mostly be recognized by its author, I’m sure). Really, the choices don’t limit themselves to just Ruby, as also Scala, Python, Go, Erlang, and many others (JavaScript and Node.js included) are technologies with which I would love to fiddle in building a blog.

As I believe that one of the key traits of any person involved in producing technology-based products should be pragmatism, applying this trait to my thought process led me to good old WordPress; the battle-proven blog software that allows you to focus on getting things done (i.e. blogging) instead of voluntarily venturing down a rabbit hole of tech fetichism while reinventing the genre with new and fantastic software (and, admitted, most software geeks secretly dream of doing so).

I like WordPress, I really do, and I think it’s one of the best products ever produced by the open source PHP community – well, perhaps even by the open source community as a whole, I would argue. It has an efficient and well-designed UI, slick workflows and a large community of developers backing it, and the complete package that WordPress constitutes has helped a whole generation of internet users get their own voices heard world-wide.

So, for now being very mature and pragmatic in having chosen WordPress to power this site, I’m free to venture down into all the other gorgeous and geeky rabbit holes that I can think of (and that’s a lot).