In-place array uniq in C

I’ve been developing Insight even though the uni project has come to an end, because it’s fun! I also want to make it more stable and eventually release it under an open-source licence of some kind. There will be an update coming soon, I promise! I now have Internet, so I can write up some things… Anyway, one of the interesting things I wanted to do for Insight was an in-place form of uniq for an array, ideally without any additional memory allocation. It seems that this is something nobody else has done yet! So I set about doing it myself… For those of you who are unfamiliar with the Linux/UNIX command uniq, it takes a sorted list and removes any duplicates. This is almost exactly what I’m trying to do, with one caveat: I need to keep the “discarded” duplicates. What happens is that I have an array containing a number of strings, and these have all been dynamically allocated via malloc() or calloc(). If I just remove or overwrite their pointers, they’ll vanish and cause a memory leak. While I’ve now fixed a large number of leaks thanks to Valgrind, I’m trying to actively avoid any possibility of adding them. Read on for the details… Continue reading “In-place array uniq in C” »

Facebook Controversy

Introduction

There has been some recent controversy over Facebook‘s Terms and Conditions: specifically, it seems that these Terms imply that they own any Content that you post to the site. When I first heard about this on 1st October 2007, I thought that it couldn’t be right. A company couldn’t just bury that in their Terms and Conditions… could they?

I decided to go through it, and having assauged my own doubts, I felt it was worth explaining in detail to anyone who is interested. Hi to anyone visiting from a group set up about this.
Continue reading “Facebook Controversy” »