Much has improved since last time I tested compiling Neuronify to WebAssembly. The latest version of Qt for WebAssembly, which comes with Qt 5.15.2, performs much better than it did about a year ago. In addition, more functionality has been added that improves the developer experience, such as support for saving and loading files asynchronously. With all of that in place, I decided to give Neuronify on the web another go. You can check out the result here:
I have just started working on adding an option to record from voltmeters and spike detectors in Neuronify.
I recently joined Zivid, a company that creates machine vision cameras for robotics and automation. The Zivid cameras are based on a technique called structured light, where a projector and a camera are placed next to each other to shine light on and take images of objects.
I have for some time dabbled with the what makes a good programming language for simulations. After having worked with scripts for simulation environments such as NEURON, NEST and Brian for neural simulations, and LAMMPS for molecular dynamics, I believe declarative languages should be used much more in simulations instead of imperative languages. Especially where users are defining states, rules or models.
Recently, I have been programming in both Rust and TypeScript at the same time, which has made me very aware of which language features I miss the most when moving from one to the other.
Recently, I have been inspired to explore the benefits of copy-by-value semantics by talks like Sean Parent’s “Better Code: Runtime Polymorphism”. This has lead me to experiment with a new container that behaves like a regular value, but still limits the number of copies made of the data it contains.
As mentioned in my post on uniform call syntax in C++, I have become envious of traits in Rust and would like us to have something similar in C++. The great thing about traits in Rust is that you can keep the data separate from the implementation. For instance, the data needed to represent a 3D vector
Vector3can be kept as a struct, while traits of the vector, such as its length, are implemented separetely.
I got my reMarkable tablet last week, and it is great for drawing and taking notes! It almost feels like writing on paper, and I like the fact that it is a device for just that purpose. It has no web-browser, e-mail client or anything that can distract me from my work, which I find refreshing. It’s just for drawing and taking notes.
I just published my first post on the Qt blog about CPU usage improvements in Qt 3D. In the post, I show how the CPU usage has gone down in recent releases and some of the things we did to achieve this. In later posts, I plan to write about which memory optimizations we have done and possible upcoming changes that will improve performance even more.
If you are working on the Qt source code, you likely want to compare your work with the latest stable branches for benchmarking or testing. However, once you checkout a different branch,
makewill often rebuild everything that you were working on. This can take a long time, making it hard to quickly compare with the latest stable build.
While looking into uniform call syntax in C++, I stumbled onto how some libraries use the
|operator to create pipable functions. Paul Fultz II has a good tutorial on how to create your own pipable functions. However, I wanted to also make existing free functions pipable without too much boilerplate and by chance I found that it can be done with very little code and a lot of unknown consequences:
PyQt and PySide are Python bindings for Qt. I will focus mainly on PyQt in this post, but most of what I write is also the case for PySide. Both are a common choices for adding a GUI to a Python application.
Update: You might also be interested in the discussion on Hacker News.
I was amazed when I read Morten Johan Sørvig’s blog post about bringing Qt to Native Client (NaCl) and Emscripten in September last year. I have been following multiple efforts to bring Qt to the web for some time. Mostly because I wanted to make my own Qt projects easily available to others, but also because I find the whole concept of running C++ code in a browser fascinating.
In CINPLA we are developing teaching material for a new course in biology and programming. One topic we’re working on is that of bioinformatics and DNA. I figured that an artistic rendering of the DNA double helix would be nice to have and decided to try and make one in Blender. At first I considered building this from the ground up using its design tools, but I quickly figured that it would be too time consuming and hard to get the proportions right. After all, I’d like it to be as close to the real structure of DNA as possible.
I recently started working on a new C++ library for reading and writing HDF5 files. I got the idea when I was working on a few files in Python and C++ at the same time. The Python library h5py is just way more comfortable than the HDF5 C++ API. But with the new features in C++11 and C++14, I figured it should be possible to make a C++ library that is just as easy to use as h5py. And I must admit that I believe I’m on the way to making it even easier.
I have written about unit testing in Qt Creator on multiple occasions earlier. Since then, a new testing framework seems to have become a new leader in the field, and that is Catch. It is similar to UnitTest++ and Google’s gtest and brings the best of both worlds. It is header-only and appears to reduce the amount of code that must be written in comparison to the other two.
I have been inspired to learn Rust and Julia lately. The idea was to use these promising languages in all of my new projects. I wanted to learn Rust because it is a safe and fast replacement for C++. I wanted to learn Julia because it is a language tailored for scientific use that might someday replace Python.
I always use QML with Qt Quick for GUI programming. It’s incredible both for prototyping and larger applications. I find it easy to express myself in QML, because it is so flexible. It’s declarative. You can bind a button’s position to the value of a slider in just one line. Not that you’d ever want to do that, but it shows how easy it is to connect objects together. I really wish the web was written in QML and not HTML.[ref]There have actually been some efforts to make QML a language for the web.[/ref]
title: Straight from the source: NEURON’s incredible backwards compatibility Date: 2015-10-26 00:37 Author: svenni Tags: Straight from the source, Technical Tags: C++, hoc, neuron, neuroscience, plot, plotting, Programming, vt100, vt125 Slug: straight-from-the-source-neurons-incredible-backwards-compatibility Status: published layout: post
Kunstige nevrale nettverk er en etterligning av nervecellene våre i hjernen. De skal brukes til å gjøre datamaskiner like flinke til å lære som mennesker og dyr. Dette gjøres ved å herme etter hvordan hjernen er bygd opp.
Da jeg fikk jobben som stipendiat ble jeg med i en gruppe ved navn CINPLA. Gruppen er dannet for å kombinere eksperimenter og simuleringer innen hjerneforskning.
This apps shows your realtime data from all your nearest stops. Add all stops of your choice and the app will immediately fetch information about the next travels from Ruter.
For et par dager siden lå jeg våken i sengen og innså at dette var en av de nettene hvor jeg ikke kom til å få sove. Heldigvis sovner jeg alltids til slutt, men det går fort noen timer fra jeg legger meg til jeg faktisk sovner. Andre ganger sovner jeg umiddelbart, litt som en lysbryter som skrus av akkurat klokka 22:04.
Sumatra is a great tool for reproducibility and provenance when you are running numerical simulations. Keeping your work reproducible ensures that you and others will be able to check your results at a later time, while provenance is to keep track of where your results came from in the first place.
Note: This is a new version of an earlier post, with a revised project structure.
*Edit: In QtCreator 3.1, the method used here (using resource files) will become the default way to perform deployment on all platforms. I.e., this guide is only useful if you have created your project using QtCreator < 3.1.
I needed a new sound card for Ubuntu that would allow me to do some recording and playback easily. After a bit of searching and testing, I figured I would go with the Focusrite Scarlett 2i2, which is a USB sound card with 2 XLR + jack inputs, stereo monitor output and a headphone jack. It also supports +48V phantom power if you need to connect a condenser microphone.
In this post I will explain how to write to the binary LAMMPS file format from C++, using data stored in Armadillo vectors and matrices. After running the example in this post you should be able to open the resulting file in Ovito or any other program capable of reading binary LAMMPS files. The example should also be fairly easy to port to other data structure type, if needed.
While preparing for a presentation I’m giving on Python scripting in Blender, I figured I’d also try out some new features . One such feature is in Sculpt Mode, where dynamic topology is now allowing fine-grained control over the level of detail while sculpting. This turned out to be a lot of fun, so I decided to sculpt a human face while at it:
Sometimes you want to copy some data files to the same folder as your final executable when you are building with qmake in a different directory than your source code. This is what Qt Creator does by default, so this is quite often needed.
While Qt3D has a transform for drawing billboards, it is not very useful if you are drawing thousands of particles. This is because the transform can only be applied to one object at the time, and using thousands of objects is never a good idea in neither OpenGL or Qt. This is simply because the overhead of each object is very large, both in terms of memory and performance.
Qt3D is an amazing library for Qt that gives you the ability to render your own 3D stuff together with your existing widget or QML based GUI. The library was started by the Qt developers a few years back, but has not yet been released with the official Qt SDK. It was announced that it would be bundled with Qt5.0, but because of the state of the library at the time, its release was postponed. Even so, the library is still very mature and appears to work very well in my opinion. So I would urge you to test it out.
I love unit testing. First of all, I think it is a good idea to test separate units of the code, but after doing so for some time, I’ve come to realize that unit tests are great for managing the software development cycle too. It all boils down to the idea that you should write tests before you write your code.
Are you reading random stuff on the web while waiting for your C++ compilation to finish? Then you have come to the right place. In this post I will tell you about two really nice tweaks you may do to speed up your compilations, namely ccache and the make -j flag, and how you may set these up in Qt Creator.
I’m using a widescreen display most of the day, which makes it quite useful to have two browser windows open or one browser window and a text-editor side-by-side. But sometimes I keep the browser window maximized, which is a bad thing for sites like Wikipedia. The articles get dragged out in full width, making the lines a bit too long to read comfortably:
Note: I’ve found a better way to visually verify that all tests are running. Check out this post on Jenkins to see how I’m now working with my tests. The below post is still useful as a reference on how to set up UnitTest++ in Qt Creator, also when using Jenkins.*
We’re working on a new project in FYS4460 about percolation. In the introduction of this project, we are given a few commands to help us demonstrate a few properties of percolation clusters using MATLAB.
While working with the molecular dynamics project in FYS4460 I decided to learn more about how to optimize my C++ code for performance. As always, I follow Donald Knuth’s famous quote as a guideline to optimization:
Gah… So once again my temptation to install the latest and greatest causes a conflicting system setup. This time it was my attempt at installing the Ubuntu SDK on a Kubuntu system with backports enabled that conflicted. Backports are packages that are only available to newer versions of Ubuntu rebuilt for older versions, like when you want to use KDE 4.10 for Ubuntu 12.04. Although rare, when you want to install newer versions of other software you might end up with conflicts.
Ovito is a great tool to visualize atoms from molecular dynamics simulations and to perform some statistical analysis on the data. The tool is an alternative to other similar tools such as VMD and ParaView.
If you, like me, are tired of having Firefox open up Nautilus for folders and Evince for PDFs in KDE on Ubuntu, you might want to change your default application settings. To fix this once and for all, open up /usr/share/applications/defaults.list and change the line with
So I’m working with Qt5 on Windows and figured that since the Qt5 SDK is currently only compiled against Visual Studio 2010, I had to figure out how to build the Botan library without using MinGW.
I’ve become very happy with the Logitech G500 mouse. I like its responsiveness, the USB connection rather than wireless (no batteries, always responsive) and how it sits in my hand.
What exciting news! Ubuntu is coming to phones in the near future, and they are already pushing forward for developers to get started on apps for the upcoming OS. The really great part? It is actually Ubuntu running on the phone, so making apps will be pretty much like making applications for Ubuntu on the desktop. Even better? They have chosen Qt and QML as first-class citizens for app-development together with HTML5.
After discovering todo.txt, I realized that I needed something similar for notes. About a year ago I started working on a similar tool that would enable me to write
In the newest version of Enthought’s Python Distribution (EPD) on Ubuntu, the plotting package has been moved from enthought.mayavi.mlab to the shorter and more general mayavi.mlab. This does however mean that if you, like me, need to work with different versions of EPD on multiple systems, will experience the following error from time to time:
It seems the IPython and Pylab packages has also been updated in 12.04 and thus removing the old ipython -wthread flag that would ensure Mayavi plots to be run in a separate thread. Running with the flag causes this error to show up:
A friend of mine is switching between a Mac and a Linux machine, causing some readjustment whenever he switches keyboards. The most urgent fixes were to move the curly and square braces together with the backslash and dollar sign. Basically to map the keys as follows:
I just came over a great LaTeX editor named TexMaker. It seems to fit my needs perfectly, with auto-complete and mapping between tex and PDF files. It does however not have a Norwegian dictionary installed, but this is easily fixed:
Running the vanilla install of Kubuntu 12.04 worked incredibly well. It took me quite some time to notice that I was in fact using the open source noveau driver. Dual displays, desktop effects and all other first impressions worked without glitches. In fact, it was not before I tried to run Google Maps’ WebGL version that I started noticing some rendering errors. And according to the noveau project’s own webpages, the OpenGL acceleration is exactly where noveau is still lacking.
I just replaced an old Ubuntu install with the fresh live CD carrying XBMC. It has now been named XBMCbuntu, noting its inheritance a bit more than earlier. While running XBMCbuntu has its benefits with a pre-made nicely working setup of XBMC, it lacks direct access to applications like a web browser and for instance Spotify. One can boot up the LXDE desktop environment when logging in instead of starting XBMC in full screen, but that is kind of tedious if one wants the default behaviour to be a full screen home theatre PC.
Tired of remembering root passwords for MySQL on your servers? Fear no more, help is on the way.
I have grown very fond of the ease and usability of Qt Creator lately, making it my main tool for developing anything in C and C++. Recently I started learning the MPI framework for doing large scale parallel programming and figured I wanted to try to make MPI play along with Qt Creator.
I’m trying out Thunderbird with Lightning as my calendar application, but for some reason Lightning did not show up under Add-ons in Thunderbird. Instead I installed it by using the xul-ext-lightning package. However, this ended up with all options in Lightning grayed out. To fix this I had to install the libstdc++5 package as well, as reported in this forum thread.
I just learnt how to get a headless connection to a server before it has even booted. This gives access to LUKS and LVM, giving the oppurtunity to decrypt an encrypted hard drive. The solution was in this blog post. I also found a post about this on Stack Exchange, which I decided to contribute to. For my own later reference, I’ll repost the walkthrough here.
This turned out to be really simple. I was trying to create a Mac OS X version of my game, Nanoparticles, and was having trouble with some flicker when running a QGraphicsView with OpenGL. The solution turned out to simply be to disable some style sheet settings that I didn’t need.
Thanks to the great work of Bogdan Vatra and the Qt Developers working on Lighthouse, I have finally been able to create a running version of Nanoparticles on Android. Their efforts have led to the Necessitas project, a very user friendly and working port of Qt to Android.
For some strange reason I have experienced on one server that the RewriteRule in .htaccess is not working for cURL via the command line. The fix has been to add a User-Agent line to the header of the cURL command, like this:
Today I found a great tool to ease the navigation in terminal, called apparix. It lets you bookmark a folder so that you easily can navigate to it just by typing
So the new Ubuntu version is finally out and as with every other time I’ve been upgrading from one version of Ubuntu to a new one, I keep forgetting how to fix the sound issue on the Dell XPS M1330. It is no big issue, really. It is simply that the lowest volume threshold is a bit high with headphones plugged in and that the volume intervals are a bit too large.
Finally the N9 is here. And so is Nanoparticles for the Nokia N9. You can over to Nokia Store to get a copy right now:
The simple answer to how you get things done is to actually do them. However, to do things in an organized manner is more easily said than done. Why? Because it is way too easy to drift away with less important stuff when you’re supposed to do anything you have to.
I just came over this website called Detexify that helps you figure out the name of a symbol based on your drawing of it. With most the symbols I tested, it managed to suggest correctly the symbol I was trying to draw. Quite impressive, and very useful!
The N950 is delivered with a keyboard without Norwegian keys, so I decided to map holding the function/arrow key and pressing comma (,), period (.) or asterix (*) to ø, æ and å, respectively.
If you want to pause an application to save battery power when the screen is turned off, you can do this by listening for the locked screen event in Qt for Maemo. However, this is not made easily available through a wrapper function (that I know of), so in this case we’ll need to resort to listening for the right DBus call. (Thanks to Diph from Maemo.org for providing the recipe to make this possible.)
When you are developing with Qt on Maemo you might want to minimize or detect minimization of your application to the dashboard. Qt lacks clean functions for these use cases, but thankfully it’s still very easy to accomplish them.
The survival of the green charge is in your hands. The purple charges will destroy the green one upon touch, so you’ll have to keep them away from each other.
I had some trouble today figuring out why my Redmine installation wouldn’t start running on my shared server. I received the following error in my log/mongrel.log file:
Have you ever tried to copy an image in Gimp and open a new image to paste it into? Then you’ve probably noticed that the size of that new image isn’t automatically adjusted to the size of the image in your clipboard - like it is in Photoshop or in earlier versions of Gimp.
I have a setup with two monitors on my computer and wanted to restrict my Wacom tablet to only one of the screens. Otherwise, the tablet is expanded to the entire two screens, making any drawing stretched.
Awesome news! Spotify is now finally available as a native client for Linux. I have no idea why I haven’t spotted this earlier, as it was already announced in July, but in any case it is finally here.
I’ve written an earlier post on how to draw simple schematically springs in Inkscape. After reading a great tip from ~suv in the Launchpad bug tracker, I figured I should bring you guys another update on how to do this using ~suv’s method.
Together with my good friend, Mikael, I’ve started a blog about physics, chemistry, maths and technology over at Mindseye.no. Some of my postings over there will be dual posted here. Especially those about technical notes and tutorials. This is the first one, about LaTeX equations in Thunderbird.
What do you say? Is there something wrong with the internal license? Well, just change the name of that client, and we’ll be alright!
All content on this site, except where specifically noted, is created by Svenn-Arne Dragly and is licensed under a Creative Commons Attribution-ShareAlike 3.0 Norway License.
I just figured that Qt Creator is now packaging every Maemo application whenever you tell it to run one. This might be annoying if packaging fails and will in any case slow down the whole process of debugging. However, if you want to skip the packaging step, this is not an option in Qt Creator 2.0(!).
If you are developing for Nokia N900 using the Nokia Qt SDK, you are most likely following this guide to set up your environment. This is all nice and easy, but if you are connecting using usb you have to open a terminal each time you plug in your N900 and write
Note : This method is now easily replaced by the awesome Qt3D module that has support for loading a range of different file formats into an OpenGL context.
I don’t think you’ll notice, but I’ve just moved this page permanently to dragly.org. There seems to have been some problems getting this site indexed properly when it was hosted on a subdomain of dragly.com. To get the site ut to speed I decided to move it. After all, what is a webpage without visitors? And how would you get here without the site being visible?
Update: Check out the new spring drawing method here. The old one on this page is still useful, but the new one is a bit faster.
Recently I’ve had some issues with my previous solution for synchronizing files between my computers. I used to have an SSH server which I placed all my files on, and usually I edited them directly on this server. Whenever needed offline I used to synchronize them to my computers using Unison. Recently, however, the SSH connection to the server has been pretty sluggish on my laptop, causing the work flow to slow down.
Sometimes scripting languages can be a real annoyance. Why? Because when you get as much help as you do with for instance Python, you also lose a lot of control.
E-mail encryption is getting more and more important as more information is accessible to your ISP, e-mail provider or even your government. In this tutorial I won’t be going into any of the principles for why you should encrypt your e-mail or how it works - I rather assume that you have already realized the dangers of letting your personal e-mails swarm around on mail servers open for everyone to read.
I was preparing to do some tasks in my physics course today, and experienced a rather annoying problem when attempting to use the python-visual package in Ubuntu.
These annoying errors have been haunting me the last couple of days, so I figured I should share the most common reason for their occurrence. That is in my projects at least.
If you ever need to mount an SSH server in Ubuntu, this is probably the easiest way to do it. This method uses a public/private key pair to authenticate with the server, making the whole process work without passwords.
After going through a couple of guides on the net, I figured out how to add build numbers and revision numbers to my NetBeans projects. The build number will be incremented for each build, and the revision number is gathered from your subversion repository. If you don’t use Subversion just skip that part and add the revision number manually.
Greece. The beautiful country in the south of Europe with all its islands spread in the Mediterranean Sea. After a couple of days here on the beautiful island of Naxos, I must say that I once again have fallen in love with Greece and its pretty nature.
I have been connecting to my home folder at the Universitiy of Oslo for quite some time now, and since they use the Windows file-sharing protocol for this purpose, there has been room for quite som headaches.
subscribe via RSS