Code Maven

Search for '{{search_term}}'

Welcome to the Code Maven!

Programming Exercises for any language.

For now, just read the articles...

If you want to make sure you don't miss any new articles, you can subscribe to the Code Maven newsletter, follow via atom feed, Twitter, or even my Google+ account.

Almost infinite recursive template in AngularJS for representing tree structures

Representing a tree-like structure can be a tricky thing, but as plenty of other examples found on the Internet show, people need to do it. Recently I also needed to do that and it worked quite well till the people who built the data have added another level to the tree. Then it blew up with a horrible error message. It was so big that the link leading to the Angular Error report site was also broken.

After some additional research I found the solution. Let's see it.


Almost infinite recursive template in AngularJS for representing tree structures


Why Git is better than Subversion for Open Source Projects

For a long time while I was still using Subversion I was bombarded by people wanting me to switch to Git. It took me quite some time to understand the value in it. Let me tell you my story.


Why Git is better than Subversion for Open Source Projects



Record editor in Angular for fixed list of values

Earlier we have started to build an editor in Angular to edit a record. In the first article we have prepared and editor for a simple input box for free text.

This time we'll add an editor for a record where the user must choose from a fixed list of values.


Record editor in Angular for fixed list of values



Switch to interactive mode from a Python script

Instead of stepping through your code with a debugger, you can add some code to your Python script or application that will instruct it to stop excuting and enter the interactive mode for you to examine what's going on.

This can be especially useful when trying out objects that require complex setup you don't want to type in the console.


Switch to interactive mode from a Python script


Deploying Python Flask using uWSGI and Nginx on Ubuntu 14.04

The following is a tutorial on how to set up uWSGI with an Nginx front end to serve a Flask based application.

In this tutorial we will only use the packages that are supplied by Ubuntu and we will deal with a very simple Hello World application.


Deploying Python Flask using uWSGI and Nginx on Ubuntu 14.04


Create and download data in CSV format using plain JavaScript

There can be cases, especially in Single Page Applications, when you have some data in the browser already that you have probably received via an Ajax call that you'd like to let your users download.

CSV is a nice and simple format to keep tabular information.

In this simple example you'll see how to let your users save data from the browser.

This solution only works in the simple case, but it could be improved to handle some of the stranger cases as well.


Create and download data in CSV format using plain JavaScript


Angular example: simple router

When creating Single Page Applications with AngularJS it is quite important to handle the back button properly. The ngRoute service provides a simple way to handle this.


Angular example: simple router


Ideas for TED

TED is full of great talks about Technology, Entertainment, Design, and actually a lot more. I also love the fact that they have plenty of local events sometimes in the local language and that many of the talks have subtitles in a lot of languages.

This makes it even more likely that their ideas will spread.

So I thought I'd like to help it with my little knowledge of programming, but first let's write down a few ideas.


Ideas for TED