Add minutes using Excel

This came up at work today.  How do you add minutes to a time using Excel?  The video below shows a quick solution without all the extra math you may be seeing from people who know the intimate details of how Excel stores date/time values.

…And while I am at it, remember that to “lock” a cell reference in a formula use the $ symbol.

Skreens unboxing

I am so excited to receive the Kickstarter edition of Skreens!  The package arrived in the mail today, a short 10 months since the project was funded.  Huge congratulations to Team Skreens!

Here is what we got:

1. Nice, simple box

2.  Power supply and quick start guide on top

3.  Here is everything taken out of the box

My first impression is that this is a well thought out package.  It includes everything needed to install the device and begin using it with existing equipment: HDMI cable, power supply, power cord, and the device itself.

I am a little disappointed that the device itself is in a plastic housing, with no standard mounting options, and a strange unlabeled button in the front.  But since this is a Kickstarter edition, I am also impressed at how much this already feels like a retail product.

Here are some more details:

The device itself is 8 inches wide. There are air vents on both sides so you’ll need at least 12 inches of width to keep the air flowing smoothly.

It is 4 inches deep, but watch out for that tiny white button on the front.  It is easy to bump it so I’d suggest giving the front a good half-inch more space and the back is where the wires go, which I always leave a minimum of 3 inches.  I’d recommend at least 8 inches of depth to allow for all of the wires and space in front to avoid any accidental button press.

The heighest point in the curved face of the unit is just shy of 2 inches.  If you are really tight in space I would allow for 1 and 7/8 inches.  There is no need for any additional height.
As for the power supply.  It is a typical power brick, but it is nice that this switching supply supports a large input range for those of you outside the USA.  This one has an output rated for 5V up to 4Amps, which means you won’t be powering this off a USB port.

That’s it for now.  Here is a quick look at the quick start guide.  I plan to install and test everything as soon as possible and will report my findings in the next post.

Oh, and here is a screenshot of the Skreens app before I have the device connected.

Mac OS X Board thingdev (platform esp8266, package esp8266) is unknown

Here is a quick fix if you run into the error:
“Board thingdev (platform esp8266, package esp8266) is unknown”

This will remove all of your Arduino boards and preferences

1. open a terminal
2. type cd to access your home directory
3. type cd Library
4. type rm -rf Arduino15/ to remove all Arduino settings
5. follow the instructions found here to reinstall:

Sad Review of Solar Winds IP Address Tracker Tools

I was hoping to find a good, simple, tool for tracking IP address assignments. My first choice was Excel, but I thought someone must have an easy to use program for this common task. After a quick Internet search I found, Solar Winds

I installed the Solar Winds Free IP Tracker using their installer “SolarWinds-IPAT-FreeTool-v4.3.exe” but was never able to run the program. It seems to install. I definitely see a lot of background processes running for it. I just can’t get the program to launch without an error.

I contacted Solar Winds to report the problem but it has been over a week and still no response. I am sad to say all of this and must recommend that you Do Not Use Solar Winds products.

Using LUA in a C++, Visual Studio 2013, Qt, or any C/C++ application

Start Super-Quick-Start Guide:

  1. Download and extract the LUA source.  Click here
  2. Add all of the .c files in the “src” directory to your project except for lua.c and luac.c (these are the interpreter and compiler that are not needed for this example and, depending on your use, are not needed at all)
  3. Add the path to the LUA headers to your project include paths. For example:
  4. Assuming you are using C++, add this line to the top of your source to include the headers needed in a C++ friendly way:
    #include “lua.hpp”
  5. That is it!  You are all set and ready to use LUA in your program.
  6. OK, here is an example to get you started!
const char* luaScript = "\
function addTwoNumbers(x,y)\n\
  addCount = addCount + 1\n\
  return (x+y)\n\
int luaScriptLength = strlen(luaScript);
int addCount;
int addResult;

// create lua and load the script data
lua_State *L = 0;
L = luaL_newstate();
luaL_loadbuffer(L, luaScript, luaScriptLength, "luaScript");
lua_pcall(L, 0, 0, 0);

// get value of addCount global variable
// stack addCount
lua_getglobal(L, "addCount");
// value of top stack item (in this case addCount)
addCount = lua_tointeger(L, -1);
// addCount should be 0
// unstack var1
lua_pop(L, 1);

// add two numbers
// stack addTwoNumbers
lua_getglobal(L, "addTwoNumbers");
// stack value 5
lua_pushinteger(L, 5);
// stack value 10
lua_pushinteger(L, 10);
// call 2 stacked args, 1 stacked function, and expect 1 stack result
lua_pcall(L, 2, 1, 0);
// value of top stack item (in this case the addTwoNumbers result)
addResult = lua_tointeger(L, -1);
// addResult should be 15
// unstack result
lua_pop(L, 1);

// get value of addCount global variable
// stack addCount
lua_getglobal(L, "addCount");
// value of top stack item (in this case addCount)
addCount = lua_tointeger(L, -1);
// addCount should be 1
// unstack addCount
lua_pop(L, 1);


RED – change quoted strings

Your Regular Expression of the Day (RED) is how to change a quoted string in C/C++.  This is a bit complex, but hopefully it will be a good starting point.  It will allow some start characters to be captured, followed by the quoted string, and finally some end characters.  The captured data can then be used with whatever additional data you want to insert.

RED: ([,\( ])\”(.*)\”([,\) ;])

In VS2013, the Replace with string would be: $1_T(“$2”)$3


TI CC3200 LaunchPad Gotcha

Important things to note about the CC3200:

1.  You can get the launch pad from Digikey for about $30

2.  If you follow the Getting Started Guide, make sure you also try the following when the Code Composer connection fails:

A.  press the reset button on the board before debugging

B.  Do Not open your serial port terminal application until after the debug session has started (or it won’t start at all)

3.  Code Composer is pretty low-level and may ultimately be unnecessary.  You may get faster results using Energia

FreeNAS Using External USB Hard drive formatted FAT32

Here is how to use an external hard drive on FreeNAS as a plain FAT32 drive.

1. create your partitions and format the drive

Show paritions:
gpart show da0

Delete existing partitions:
gpart delete -i 1 da0
gpart destroy da0

Create new partitions and format:
gpart create -s gpt da0 (create the span for the whole disk)
gpart add -t mbr da0 (create the slice (partition))
newfs_msdos -F32 /dev/da0p1 (format it as FAT32)

Mount the partition to an existing directory <mount point>.  For example: /mnt/usbhd:
mount -t msdosfs -o large /dev/da0p1 /mnt/usbhd

2. When you are done, just unmount the drive using:
umount <mount point>

That’s it!  Now you can stop searching through all of the Internet to find the answer 🙂

Z-Wave Project – Day 1

I installed two Linear WD500Z-1 Wall Mounted Dimmers this morning.  You need a lot of space because of the extra wires and wire nuts involved.  You also have to remove the tabs that would overlap in the 2 gang box.  These tabs are apparently heat-sinks, so that reduces the max watts supported from 500W down to 400W.  Still, I got them to fit and they work perfectly.

Now I want to control them remotely, which is why I bought them in the first place.  I am using a hand-held controller, the Intermatic HA07.  It was easy to setup the controller, but the trick was getting the Linear dimmers to be included into the network.   To make the Linear WD500Z-1 dimmer listen to the remote, first Delete the dimmer from the network by pressing delete on your controller and tapping up on the dimmer twice.  Tapping up twice is the most important step that was not obvious from the Linear documentation.  Next to include the dimmer in the network, press Include on the controller and tap the dimmer up twice.

Next I need to assign channels, lighting levels, and program the timer.  Should be easy 🙂