Nov 22 2011

I recently upgraded to Eclipse PDT Indigo. It was exciting and stuff. The download size has also been completely slashed – from approx 120mb to 89.2mb, so that makes me happy. It was remarkably easy to install and import my existing projects and stuff (I started a new workspace, rather than re-using the existing one). My first problem I ran into was trying to install the Mylyn Context Connector (that gives you task-focused Navigator view etc.), it was moaning about org.eclipse.cvs.feature.group being missing. The solution, although not immediately obvious, is to actually add the Indigo Update site… which is not included in the default PDT install (!). I think this is one of the reasons the PDT Indigo download is much smaller though…

  • Help > Install New Software…
  • Enter “http://download.eclipse.org/releases/indigo” into the “Work with:” box
  • Hit enter… wait while it downloads
  • Once it’s downloaded, go back up to the “Work with:” box and choose “Mylyn for Eclipse 3.5, 3.6 and 3.7 – http://download.eclipse.org/mylyn/releases/latest”
  • Select “Mylyn Context Connector: Eclipse IDE”  from the package list
  • Do a little dance
I really wish Eclipse would make installing packages easier. It’s such hassle having to know the update sites for things left right and centre.

Feb 12 2011

OK so yesterday evening I released my first bit of Open Source code. Which is great, because I can start giving back to the community. Unfortunately this produces a new problem which I’m really confused about now… what license to use? Just to point out, that this isn’t a guide to Open Source Licenses and I can’t help you choose which one – not because I’m mean or don’t want to reveal my secrets – but because I honestly don’t know either. I’m currently using GNU GPLv3 but that may change (and as the copyright holder, I believe that I can change the license willy-nilly or something… I hope). Benjie suggested I use BSD/MIT licenses, and that’s sort of what kicked this turmoil in my head off.

These are the things I’m trying to bear in mind when hunting for a license to use:

  • I don’t want people to bundle the code in closed-source programs without having a link to where the source code can be found for my modules
  • I don’t mind if people use it in a money making software as long as I’m attributed to it
  • I’d encourage (but not force) modifications to be sent back to me to improve the original package
  • I wouldn’t want it forked for the purpose of making money (i.e. I don’t mind if it’s used as part of a money making software, but I don’t want it to be distributed on it’s own to make money)
  • I want to use it in my own projects (some of which are closed source)

Bear in mind this list isn’t strict, I’m actually quite flexible with my needs. I’ve sort  of narrowed it down to GPL, LGPL, MIT, BSD, MPL or EPL. Which to be fair, is most of the “bigger” ones.

Or am I over thinking this whole thing? It’s just a bunch of code I’ve written that probably only I find useful, so is there any point in thinking too much about a license, and just go with MIT or BSD (what the hells the difference in those two anyway?!?). Answers on a postcode kthxbai. Or just comment :P

Update: Here are some links I’m looking at which might be handy when choosing you’re own open source license:

Feb 11 2011

So tonight I released the start of some useful PHP libraries I use when I’m doing Zend Framework coding. Right now there’s hardly anything there (an eBay Trading API client, and a DbTable Mapper tool) but I’m planning on adding more stuff as I find it useful. It’s released under the GNU GPLv3, although to be frank I have no idea what is good and what’s not…

What’s quite special for me is that this is the first time I’ve actually released my own source code under an open source license. I’ve done plenty of development in my time, but for such a long time I’ve wanted to give back to the community. I know it’s not a huge amount at the moment, but it’s a start and I hope to build on it, and hopefully someone, somewhere, will find it useful and perhaps even contribute back one day.

I’ve called my libraries “MAL” which (hat-tip to @robertbasic here!) stands for Mighty Asgrim’s Libraries… which will do just fine I guess. I didn’t come up with anything better, and “MAL” is quite catch anyway.

Anyway, if you’d like to check it out, take a peek on github at: https://github.com/Asgrim/MAL

Jul 8 2010

I have a case at work where I needed to go through a big list of arrays, and add them to a new master array. It turns out this is incredibly slow when adding many large arrays to a larger array. The alternative to this if you don’t care about keys or duplication of values is to just add it into the array. So normally where one might do something like:

$big_array = array();
foreach($array_of_objs as $obj)
{
  $row = $obj->getSomeData(); // returns an array of data
  $big_array = array_merge($big_array, $row);
}
processData($big_array);

I believe that array_merge creates a new array every time which is what was slowing it down. The solution was simple enough, it just took me a while to think of! :)

$big_array = array();
foreach($array_of_objs as $obj)
{
  $row = $obj->getSomeData(); // returns an array of data
  foreach($row as $r)
  {
    $big_array[] = $r;
  }
}
processData($big_array);

This was vastly faster, again possibly because it doesn’t create a new array every time. There are limitations to this method, and it doesn’t do exactly the same thing as array_merge, but it does do what I needed it do, so if anyone has a similar situation, I hope this helps!

Feb 5 2010

At our company we currently all work on one shared network drive. The source code is not under any kind of source control, which for me is a big no-no. I’d love to be able to set up SVN and us all work of separate repositories and just commit back to a trunk or branch, but our tech manager doesn’t agree. The way I see it, there are two major issues:

  • The source has no history – if there is a problem, we can’t roll back
  • We overwrite each other’s changes if we work on the same file

How do other people manage this situation? Having source control on the network drive is fine, but that doesn’t solve the problem of overwriting each other’s changes does it… And setting everyone up with VMs or local repos doesn’t wash with the tech manager. Would a solutions such as each having their own checkout and then the shared network drive automatically update work? What about slowness in updating – people making a change and having to wait a while before it takes effect probably wouldn’t wash with our tech team, and committing back every tiny change seems a bit silly.

What about other source control (i.e. not SVN) – do you think it would suit us? I’m open to suggestions, except for Visual SourceSafe. Preferably something that integrates well with Eclipse, and is also cross platform (we use a mix of Windows, OSX and Linux), but something that also works well without Eclipse… tall order perhaps?