• Translating canvas mouse position to JointJS matrix coordinates

    Translating canvas mouse position to JointJS matrix coordinates

    If you need a way to convert the JointJS mouse position to the canvas matrix coordinates, this is a simple way to do it (in combination with an angular mouse wheel event):

    Short, but hopefully helpful! Cheers!

  • InfluxDB Studio

    InfluxDB Studio

    It feels great when someone uses something you made and thinks it’s good. Every now and then someone creates a pull request for the InfuxData.Net lib I made and have been maintaining. It’s sort of a nice confirmation of your efforts and makes you warm and fuzzy on the inside. :D

    Well, this guy named meverett recently made a few pull requests with fixes and some nice lib improvements AND then told me that he’s actually using the library to make an InfluxDB database management studio (sort of what SQL Management Studio is for SQL, but for InfluxDB)!

    I find the admin dashboard that comes with InfluxDB a bit too simplistic and buggy and was actually thinking about how useful it would be if only there was a proper management app for Influx. Well, the InfluxDB Studio does more than the web admin dashboard and works great. And it made me really happy! :D

    This is how it looks:

    Thanks for the great work meverett!

  • Playing with IBM Quantum Computer

    Playing with IBM Quantum Computer

    What does a programmer do when he has enough free time on his hands? He tries to do something with a quantum computer. :D

    IBM will let you try and do something with their quantum computer for free. Five qubits and all! :D There is a fair bit of documentation on their site on how one should go about thinking of quantum computer programming and it involves a lot of advanced math. It gets a bit difficult to follow at times, so I guess this is where all these college math courses paid off. :D

    So, after you go through the beginners guide, you can start playing with the composer. After running a few examples from the guide and another few I found on other blogs on the internet, I realized I’m not sure what to do with all this at this stage. You can spend your computing credits quite fast and easily so it feels a bit limiting and slow to do anything. But that’s ok, it wouldn’t be right for someone to usurp the thing for too long. You also realize quite quickly that today’s quantum computers aren’t really that powerful yet. Instead it feels more like a really interesting proof of concept. So anyway, it was really cool to be able to even do that and the fact that this is actually publicly accessible to anyone is beyond awesome. Guess I’ll pay attention to what happens with this in the future. :)

    In the mean time check how this guy made the rock/paper/scissors on the platform!

  • Passed the C# 70-483 exam (MCP)

    Passed the C# 70-483 exam (MCP)

    Today, after a few weeks of preparation I passed the C# 70-483 exam and became a Microsoft Certified Professional. Woohoo! :)

    Besides getting a cert, was it worth it? I would say in case of this particular exam – yes. I was already familiar with many topics covered by the exam but it did fill some gaps in my C# knowledge. And I enjoyed learning the new bits. It also did feel like I had to learn some details by hard at some points, which was less enjoyable.

    What did I use to prepare myself? I used the official practice exams from measureup, the 70-483 ref book, the Wrox Certification Toolkit book for this exam, in a few cases the official documentation and of course – StackOverflow. I feel the practice exam was very beneficial, the official ref book was also helpful but in my opinion very badly written. It’s as if the book has no structure and as if the authors didn’t communicate between themselves so that would make sense and so you could learn in some kind of logical order. Instead, the book jumps between topics in an unexpected way. The Wrox book was ok. I didn’t go through it in full detail, but read a few bits and pieces where I felt I wanted to get more details which I haven’t been satisfied with by the ref book. Both books seem to be riddled with various mistakes in code.

    Overall, I’m very happy I studied for this exam and that I passed. If you’re considering doing it – do it, you’ll be happy to learn new things and it isn’t really that hard but be prepared to put some time in it. Good luck! :)

  • Broadcasting AngularJS events from vanilla JavaScript

    Broadcasting AngularJS events from vanilla JavaScript

    In this short post I’ll show how to invoke AngularJS from plain JavaScript. Why would you want to do this? Well, in certain edge cases you might need to catch events in plain JS but still want to handle them back inside your Angular app. For example on an SVG element mouse event..

    Say you have an Angular controller named SomeCtrl and that’s where you want to handle the event. You’ll need an element you’ll be able to target either by an id or by a class, and it needs to be scoped with a controller like this:

    Next, say you have something like onmouseover=”onMouseOver()” on one of your HTML/SVG elements:

    You’ll need to add a $scope.$on listener for the “mouse-over-event” event inside your SomeCtrl controller. Your Angular app will catch the broadcast, you’ll be back inside the Angular scope and digest loop and you’ll be able to handle the event further from there.

    That’s it!

  • Alesis DM10, Ableton, Addictive Drums + an additional audio source from laptop

    Alesis DM10, Ableton, Addictive Drums + an additional audio source from laptop

    Hopefully this post will help you if you’re looking to setup your eDrums with Ableton and Addictive Drums 2 (or any another virtual drum kit with a VST for Ableton). I don’t know that much about music equipment so it took me a while to figure out where all the pieces fall into place.

    My initial issue with Ableton and AD2 was that MS Windows OS has very bad audio support (drivers) for anything more advanced than the simplest form of audio reproduction through speakers or headphones. What I wanted was to connect the Alesis DM10 to my laptop to get better quality drum samples with AD2 than what I had with the DM10 module and to be able to turn on a YouTube video and to play alongside with it. It didn’t take long for me to realize this wouldn’t work. Even with ASIO4ALL drivers, I could either get Ableton or the browser to output the sound into the headphones, not both at the same time.

    So, after a bit of research and some advice from a few fellow musicians, I decided that what I needed was a USB audio interface that would also act as a mixer. After doing a bit more research, I found out that Komplete Audio 6 was quite popular amongst drummers who wanted a low latency audio interface for triggering VST’s. I’m sure any other USB enabled interface with balanced input could easily do the job as well.


    The next few steps included removing the ASIO4ALL drivers, installing official Komplete Audio 6 drivers, setting up Ableton with AD2 VST (make sure to check the “install as VST” checkbox during AD2 installation) and wiring up the hardware together.


    This is how the Komplete 6 is supposed to light up when everything is connected and setup properly (both inputs are set to INST, headphones are set to 1/2, 48V on the back side is ON and the monitor “ON button” needs to be pressed once every time you turn this whole setup on):


    This is how the channels IN/OUT setup in Ableton looks like (click to view the full resolution screenshot):






    Ableton audio preferences:


    Ableton link/MIDI preferences:


    Komplete Audio 6 control panel:


    And this is the screen where you can map the DM10 MIDI triggers to AD2 sounds (this AD2 keymap might help you with that):


    To map the triggers easier, press the “Learn” button and then hit the element that you wish to map with a stick. This will utilize AD’s “smart learning” and will automatically map the input from a trigger with an AD2 element (snare, hi-hat, kick, whatever..). Sometimes it’s a bit hard to use this (for example the ride bell which can be somewhat hard to trigger on DM10) but I found that for all the other elements it does the job really well.

    You might also want to slightly adjust triggers sensitivity on the DM10 module itself to make the AD2 respond more to your liking and expectations (you can make it require more or less force to produce trigger sound). Use that in conjunction with the curve on the righthand side of the hi-hat image from the last screenshot.

    All in all, I’m really happy with how this works. The latency is very minimal and 99% of the time it’s not in the way of playing. I do have an SSD in the laptop and there was a noticeable difference in how Ableton/AD2 performed while the crappy 5400 was inside and after I installed the SSD. The CPU in the laptop is the i7-4510U (not sure if that makes any difference or not).

    Hope this helps. If you have any questions or a different setup that you’d like to share, leave a comment. Cheers!

Back to top