Tuesday, November 15, 2011

Haddock Tomboy Notes Sync for ownCloud

I have been working hard to get the Haddock Tomboy Notes Sync written and here is the first screen shot.  Please note that this is far from done, but it is pretty awesome.

What is currently does:
  • Syncs with Tomboy
  • Able to read notes in Haddock
What is DOES NOT do yet:
  • Edit notes
  • Create new note
  • Delete notes
  • Create / Manage notebooks
  • Search
  • And pretty much anything else.
I am making huge improvements to it everyday, so stay tuned. Also I plan on setting up a demo server soon for everyone to check out once it gets a little further along.


Tuesday, October 4, 2011

When unset() is bad in PHP

Many of my developers that work with and for me love the unset() function which is a really good thing, but there is one spot I noticed that they tend to put it that may not be such a good idea.  What I am talking about is usetting the iterator in a foreach loop like so:

foreach($myarray as $value) {
    echo $value."\n";
    unset($value);
}

The reason this is bad is because of how PHP works internally.  When PHP iterates through the array it reuses the iterator variable ($value) and the memory with it.  Whereas if you unset it, each time PHP has to work to free that memory and then reallocate new memory for the next iteration.  As you can see it is not a good idea.