Jutting Bytes

Digressions of a research engineer

Fixing the Brew Linkapps Issue on MacOSX

| Comments

Today, I have been extensively working on my emacs prolusion and updated emacs to its current HEAD version, that is,

To do so, I have obviously used brew:

$ brew reinstall emacs --use-git-head --cocoa

This builds Emacs.app into brew’s cellar, and to have it into your /Applications folder, brew invites you to invoke the following command:

$ brew linkapps emacs

This does the job, it symlinks Emacs.app from brew’s cellar to the Applications folder but it appears that symlinks are not supported by Spotlight.

To fix this, I found a nice one-liner solution. First remove the symlink:

$ rm /Applications/Emacs.app


$ osascript -e 'tell application "Finder" to make alias file to POSIX file "/usr/local/opt/emacs/Emacs.app" at POSIX file "/Applications"'

Spotlight will now index Emacs.app. The same procedure applies for other application bundles provided by brew such as MacVim.app.

Helm-Dash Makes You Efficient

| Comments

Every coder will say so: when learning a new language or using a new toolkit or library, a great documentation makes the difference. It is however usually really boring to browse when it comes as a pdf, or in html format.

Documentation engines, including doxygen, qdoc, appledoc among many great others, provide indexation and allow their authors to generate databases for fast queries of symbols. This is where IDEs come, as the documentation lookup becomes part of the code writing experience.

They however present many disadvantages: they are usually bound to a language and a small set of libraries. Also, they hide many aspects of the development life cycle: managing dependencies, hiding linking and post build phases. I won’t argue on why these are drawbacks, but ail those reasons make me use a single editor for all languages I’m coding with, all tools I’m using in a development cycle: Emacs.

I’ve been using macs for many years now, but I happen to hack on other operating systems as well. There is one software that made me love coding on the mac: Dash. It is an API documentation browser that pops up with a key sequence and disappears when it looses focus. It hosts and downloads more than 130 famous docsets and provide very fast searching and a nice browsing experience. Also, its author, Bogdan Popescu is a very nice person, easy to talk with and is very open when it comes to contributing to Dash, see this post.

Helm is an emacs incremental completion and selection narrowing framework, a fork of the well known anything.el, that is currently very popular for many developers are using it as a frontend for their own packages.

Here comes Helm-Dash, a wonderful emacs packages, available on Melpa that uses Dash docsets inside emacs to browse documentation. Note that is does not require the Dash app, and so, works on any platform, just as Emacs !

QChart.js: QML Bindings for Chart.js

| Comments

Working with Qt/QML on a new project on electro-magnetism data collection, I wanted to implement some simple yet meaningful and eye friendly charts to display data. It happens that some days before, I used Chart.js on the web backend of this mobile application and thought that for the sake of consistence I would give it a shot with QML since it integrates nicely with javascript.

Find it on GitHub.

QMake: The Maverick’s Case

| Comments

I’ve just spent hours figuring why after upgrading my Xcode to version 5, building projects using cmake goes fine while I have lots of undefined symbols using qmake. Let’s take an example.

Undefined symbols for architecture x86_64:
  "___sincos_stret", referenced from:
      _q_make in libquat.a(quat.c.o)
      _q_from_axis_angle in libquat.a(quat.c.o)
      _q_from_two_vecs in libquat.a(quat.c.o)
      _q_from_euler in libquat.a(quat.c.o)
      _q_euler_to_col_matrix in libquat.a(matrix.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/is-calibrator] Error 1

sincos_stret looks very much like a libmath symbol, even though not defined.

$ nm /usr/lib/libm.dylib | c++filt | grep sincos_stret

Clang-LLVM performs system optimization, so with this very new version of Xcode, many math functions end up in libsystem_m.

$ nm /usr/lib/system/libsystem_m.dylib | c++filt | grep sincos_stret
    0000000000014143 T ___sincos_stret

However using 10.8 SDK, the latter does not contain our symbol.

nm /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/system/libsystem_m.dylib | c++filt | grep sincos_stret

But on 10.9 SDK, here it is.

nm /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/system/libsystem_m.dylib | c++filt | grep sincos_stret
    0000000000014143 T ___sincos_stret

So why don’t we touch it when linking ? Well, here is the reason. Using qmake, (whatever the version of qt, tried with 5.1.x, 5.2.x), qmake’s macx-clang spec uses MacOS 10.8 SDK. Here comes qmake -d, a nice option logging what happens behind the scenes.

DEBUG 1: QMAKE_MAC_SDK.macosx.path := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdK

We want to use 10.9, so that linking on math gives us our symbol definition. Overriding qmake’s mac sdk is not something you easily find in the (however brilliant) qt docsets. If the debug output gives us some hints, we also want to set the deployment target flag. The project file snippet is as follows.

macx:QMAKE_MAC_SDK.macosx.path = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdK

Enjoy and save some time!

Qt on iOS Examples

| Comments

The Qt project has recently published a post on recent advances in writing an iOS platform plugin. So far, many features are working just as expected, and I must say, these features cover the needs of many many applications we have written so far. So yes, we can move forward porting our applications to iOS.

The first part of this post shows how to set up a development environment, note it merely summarises information given on the post, plus some additional hints to help you run the examples provided in the second part of this post.

The second part introduces a repository that demonstrates the behaviour of some relevant features of Qt, both in desktop, simulator and device configurations. Note they do no constitute a full demo application (check this one if you are looking for one), but a set of barely enhanced feature based hello world programs.

As usual, repository on GitHub.


| Comments

Leap represents an entirely new way to interact with your computers. It’s more accurate than a mouse, as reliable as a keyboard and more sensitive than a touchscreen. For the first time, you can control a computer in three dimensions with your natural hand and finger movements.

Late october, the following post has been published on LEAP’s blog, inviting people to register to the early admittance program, including a device and an access to LEAP’s SDK. LEAP motion is a really interesting innovative product. We wanted to build wrappers to let anyone using Qt and/or Qml to be able to interact with one of those.

We are pleased to let you know that our subscription has been selected. We already have some interesting results, but I’ve decided to create a dedicated project on GitHub – http://github.com/jwintz/qleap – that we will rewrite with Qt5, and populate as development goes on. A preliminary page that introduces the idea has been setup here: http://jwintz.me/qleap/.


| Comments

This post introduces a minimalistic proof of concept software on using Qt together with Qml to achieve interactive and concurrent rendering of fractal images. All sources available on GitHub.


| Comments

Have you ever found yourself scp’ing your .emacs.d folder from one machine to another, again, and again ? Well, I have. Firing up a repository to host your emacs config does the trick when it comes to easily retrieving the configuration and keep changes synchronized, but what about managing additional packages your config may need, with MELPA or Marmelade ?

Here comes Prelude.