Code and Bugs

Coding things

Tag: C

Machine Learning

This semester, I took an introductory course to Machine Learning. I learned about id3, version space learning, neural networks, GAs, etc. And I had to some homework using several of those techniques.

Read the rest of this entry »

GCC Array

While doing one homework I’ve observed one little known fact about gcc: declaring dynamic arrays as normal arays (like int a[n])

Read the rest of this entry »

Doxygen to the rescue

I was writing a homework from the Computer Graphics Course in C++ these days. Nearly 3000 lines of code and not all of the wanted by myself features included. The only problem was navigating through the many classes I have created (I rember that at one point I was thinking that I was using one kind of Object but this was not real).

Hopefully, I knew that doxygen can generate graphical views of the documentation. So, I’ve used another rule of my standard makefile and voila, just by using the images alone, I was able to understand where I was mistaken.

Here is one result generated by doxygen (reduced to thumbnail because of the size).

class Universe coll graph

Looking for the lost harmony

In fact, this is only a successful attempt at trying the Harmony Search for a toy problem.

Read the rest of this entry »

Books about Functional Programming

The last semester at college taught me programming paradigms. Since then, I have always thinked twice before deciding to write a piece of code in C or Haskell.

Read the rest of this entry »

Ending the Monkey Typewriter Problem

In this post I will show the last results concerning this problem while also showing that there is a way to stop any Monte Carlo simulation from doing useless runs.

Read the rest of this entry »

Haskell or C?

I got bored one day and was looking for something to test my coding skills by trying to solve a difficult problem on a difficult contest. Luckily, reddit provided me with this contest which was exactly what I was looking for. Read the rest of this entry »

Bits counting trick

During my chess AI project (named E85) my team run across the problem of counting the set bits from a long long constant. Of course, counting them in a loop was a solution but it was a slow solution and we wanted to see if there is something more rapid than this, preferably something without using ifs.

Read the rest of this entry »

The monkey typewriter revisited

In the previous article I presented a strange problem, dubbed the MT problem (the Monkey typewriter). This time we will deal with the same problem but from another point of view: the results obtained by Monte Carlo simulation.I will post here the two source files needed for simulating both cases and then I will give some results.

Read the rest of this entry »

Follow

Get every new post delivered to your Inbox.