Algorithmic Music Composition [paper]

After I wrote my first post about computoser.com, many were interested in the code. Then I open-sourced it. And now, to complete my contribution, I wrote a paper about my approach and findings. The paper is on Academia.edu and also on arxiv. I’d be happy to get honest peer reviews. It’s not a great novelty, I agree, but think it’s an improvement over existing attempts and possibly an approach to build upon in the...

Open Source for the Government [presentation]

A month ago I gave a talk at OpenFest (a Bulgarian conference for open technologies). The talk was in Bulgarian, but I’ve translated the slides, so here they are. Currently, many governments orders custom software and companies implement it, but it’s usually of low quality, low applicability, or both. Software is often abandoned. And we don’t even know what bugs and holes are lurking in (I found a security hole in the former egov.bg portal that allowed me to extract all documents in the system, containing personal data and whatnot). And it’s all because it’s a black box. In short, I propose to have all software ordered by our governments, open-source. I’m obviously not the first to have that idea (there are success stories in some countries, as you’ll see on the slides), but I think the idea is worth pursuing not only in my country, but in many other countries where the government still orders companies to build closed source software. The process is simple – the company that builds the software (or makes a customization of an existing open-source software) works in a public SCM repo (git or mercurial) that everyone can trace. That way we can not only monitor the development process, but also have a more transparent view on public spending for software. Here in Bulgaria the idea has already been embraced by some government representatives and is likely to gain traction in the next few...

Static Typing Is Not for Type Checking

In his post “Strong typing vs strong testing” Bruce Eckel described the idea, that statically (or strongly) typed languages don’t give you much, because you should verify your programs with tests anyway, and those tests will check the types as well – no need for the compiler to do that (especially if it makes you less productive with the language). While this looks like a very good point initially, I have some objections. First, his terminology is not the popularly agreed one. This stackoverflow answer outlines the difference between statically-typed (types are checked at compile time) vs strongly-typed (no or few implicit type conversions). And to clarify this about the language used in the article – Python – this page tells us Python is dynamically and strongly typed language. But let’s not nitpick about terminology. I have an objection to the claim that static typing simply gives you some additional tests, that you should write anyway. In a project written in a dynamic language, can you see the callers of a method? Who calls the speak method in his example? You’ll do a search? Well, what if you have many methods with the same name (iterator(), calculate(), handle(), execute())? You would name them differently, maybe? And be sure that you never reuse a method name in the whole project? The ability to quickly navigate through the code of big project is one of the most important ones in terms of productivity. And it’s not that vim with nice plugins doesn’t allow you to navigate through classes and to search for methods – it’s just not possible to make it...

Getting Started with Machine Learning

“Machine learning” is a mystical term. Most developers don’t need it at all in their daily work, and the only details about it we know are from some university course 5 years ago (which is already forgotten). I’m not a machine learning expert, but I happened to work in a company that does a bit of that, so I got to learn the basics. I never programmed actual machine learning tasks, but got a good overview. But what is machine learning? It’s instructing the computer to make sense of big amounts of data (#bigdata hashtag – check). In what ways? classifying a new entry into existing classes – is this email spam, is this news article about sport or politics, is this symbol the letter “a”, or “b”, or “c”, is this object in front of the self-driving car a pedestrian or a road sign. predicting a value of a new entry (regression problems) – how much does my car cost, how much will the stock price be tomorrow. grouping entries into classes that are not known in advance (clustering) – what are you market segments, what are the communities within a given social network (and many more applications) How? With many different algorithms and data structures. Which are fortunately already written by computer scientists and developers can just reuse them (with a fair amount of understanding, of course). But if the algorithms are already written, then it must be easy to use machine learning? No. Ironically, the hardest part of machine learning is the part where a human tells the machine what is important about the data. This...

Making Side Projects With New Technologies

(Captain Obvious mantle on) You are a software engineer and maybe you have a side project – something that you do at home in your spare time. If you don’t, go ahead and have one – no life outside is better than a few more hours of programming. Unwitty jokes aside, having a side project is indeed a very useful practice (read on). A side-project is sometimes thought of as “the thing that would make you rich and you won’t have to program ever again”. It very rarely is, so we’d better view it as “the thing that would sound cool when I speak about it”. But apart from the motivational/coolness aspect, side-projects have a very important practical consequence – they make you a better programmer. Of course, every extra hour of doing something makes you better at it, but a side-project is even better, because you are the one that makes all the decisions – what to do, how to do it, when to do it, what technologies to use. I’ll focus a bit more on the last point. Not only you can choose the technologies to use, but you can choose technologies that you don’t know yet (imagine going to your manager in the beginning of a project and and asking him to build it with a language or framework that nobody on the team has ever used). And that’s what I’m doing – for most of my side-project I choose technologies that I haven’t used before. I get to learn new frameworks, tools and languages (a.k.a. “technology”), and get relatively good with them. That’s the way...