Jutting Bytes

Digressions of a research engineer

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.

1
2
3
4
5
6
7
8
9
10
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.

1
$ 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.

1
2
$ 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.

1
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.

1
2
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.

1
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.

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

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.

QLeap

| 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/.

QTrace

| 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.

Prelude

| 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.