Added setRowOffsets to LiquidCrystal library

Original commit by Mark Sproul, but cleaned up by Matthijs Kooijman.
Make the LiquidCrystal row offsets uint8_t instead of int

Since these are memory addresses, there is no need to make them signed.
Furthermore, the HD44780 chip supports memory addresses up to 0x67, so
uint8_t shouldbe sufficient.
In LiquidCrystal::setCursor(), check against length of _row_offsets as well

Before, the row value was maximized against _numlines already, but the
value from _numlines is not limited anywhere, so it could be longer than
the length of _row_offsets. This check makes sure the array bounds is
never exceeded.
Support more LiquidCrystal displays out of the box

Previously, the row offsets were hardcoded to the ones used for 20x4
displays (which woudl also work for all 2-line displays). Now, the
number of columns given is used to calculate the offsets most likely to
apply.

For 2-line displays and 20x4 displays, the (used) offsets are completel
unchanged. With this change, common 16x4 displays and (if they even
exist) other 4-line and 3-line displays might also work (depending on
the hardware configuration used, of course).

See this page for some info on common LCD sizes and configurations
encountered in practice:

http://web.alfredstate.edu/weimandn/lcd/lcd_addressing/lcd_addressing_index.html
In LiquidCrystal::begin(), use a define instead of a hardcoded 0
In LiquidCrystal, remove an unused variable
Added idle mode to the delay function

The controller will be sent to idle mode if the remaining delay time allows this. It will be woken up by any interrupt, which will be latest by the timer0 interrupt.
fix Descriptor.c
Merge pull request #2258 from QuentinPerez/fix-descriptor-firmware

fix Descriptor.c
Fix for upload problems on Arduino Leonardo (and derivatives) with OSX 10.9.4
Printable.h doesn't need new.h but only stdlib.h for size_t.

Probalby new.h may be removed completely.
Correct implementation of gcc specific internal functions

The following empty stubs has been replaced by the gcc
flag -fno-threadsafe-static:

  int __cxa_guard_acquire(__guard *);
  void __cxa_guard_release (__guard *);
  void __cxa_guard_abort (__guard *);

The following empty stubs has been moved into their specific
module abi.cpp:

  void __cxa_pure_virtual(void) __attribute ((noreturn));
  void __cxa_deleted_virtual(void) __attribute ((noreturn));

Fix #107
Fixed license for new.cpp and small cosmetic changes
Merge pull request #2284 from cmaglie/ide-1.5.x-cxx-abi-compat

Correct implementation of gcc specific internal functions (take 2)
Remove unneeded check in String::remove(unsigned int)

This check already happens in the remove(unsigned int, unsigned int)
method that is caled, so there is no need to also check this here.
Fix bounds check in String::remove()

Previously, if you passed in a very big index and/or count, the
`index + count` could overflow, making the count be used as-is instead
of being truncated (causing the string to be updated wrongly and
potentially writing to arbitrary memory locations).

We can rewrite the comparison to use `len - index` instead. Since we
know that index < len, we are sure this subtraction does not overflow,
regardless of what values of index and count we pass in.

As an added bonus, the `len - index` value already needed be calculated
inside the if, so this saves a few instructions in the generated code.

To illustrate this problem, consider this code:

String foo = "foo";
Serial.println(foo.length()); // Prints 3
foo.remove(1, 65535); // Should remove all but first character
Serial.println(foo.length()); // Prints 4 without this patch

Not shown in this is example is that some arbitrary memory is written
as well.
Simplify String::remove(unsigned int)

Previously, this method calculated the length of the string from the
given index onwards. However, the other remove() method called already
contains code for this calculation, which is used when the count passed
in is too big. This means we can just pass in a very big count that is
guaranteed to point past the end of the string, shrinking the remove
method by a few bytes.
Merge pull request #2279 from cmaglie/fix-leo-upload-osx10.9.4

Fix for upload problems on Arduino Leonardo (and derivatives) on OSX 10.9
Fix off-by-one in String::substring

When checking the `left` argument, it previously allowed having
left == len. However, this means the substring starts one past the last
character in the string and should return the empty string. In practice,
this already worked correctly, because buffer[len] contains the trailing
nul, so it would (re)assign the empty string to `out`.

However, fixing this check makes it a bit more logical, and prevents a
fairly unlikely out-of-buffer write (to address 0x0) when calling
substring on an invalidated String:

	String bar = (char*)NULL;
	bar.substring(0, 0);
Fix indent and small cosmetic changes