Sunday, September 26, 2010

Slow webdav performance on Windows 7

I just setup webdav and mapped it to a drive letter in Windows 7.  And it was so slow that it was unbearable to work with.   In my search to find a webdav client I stumbled upon this little tip... and Felt I would repost for others to find. 

now the following works like a charm!

net use * http://example.com/dav/

How to fix Slow WebDAV Performance in Windows 7:  source

  1. In Internet Explorer, open the Tools menu, then click Internet Options.
  2. Select the Connections tab.
  3. Click the LAN Settings button.
  4. Uncheck the "Automatically detect settings" box

Saturday, February 27, 2010

Google Apps Scripts

So I have been playing around with Google Apps Script.  It's pretty neat! I decided to putogether a google spreedsheet that would track my progress for training for a Marathon.  I'm not actually signed up for any specific marathon I just wanted to set some goals to excercise and to see if I could actually run 26.2 miles. So I put this spreedsheet together to hold me acountable for my progress.  Here is a screen shot:


I have no excel experience and have never put together a google spreedsheet doc before.  But one thing I wanted to do was to change a cell background color based off of another cell.   This apparently is not possible with the "Change colors with rules..." option from the menu.  This only allows you to change the color of the current cell based on it's value.  But what I wanted was a way to modify the completed cell background color if completed was equal to total. So I started playing around with google apps scripts to see if I could accomplish such a task.  I did accomplish the task with the following code.

I created a named rage called weekData that goes from A2:L22. (Range Names) There are a number of different way of invoking scripts.  Referencing it from a spreadshee formula as if it was an existing function, by click on the run button from the online script editor, from a custom menu, and by click on a drawing.

I really liked the idea of referencing it from a spreadsheet cell formula but quickly found out that when using a custom fuction you may only modify the value of the local cell, and trying to perform other actions to modify the attributes of the cell will result in a script error.  Invoking the script via the other methods does allow me to properly change the cell attributes like the background color. I also found that you can have the script execute when the document loads or refreshes by adding the following function to the top of the script:

function onOpen() {
}

So I did that along with adding a menu option to update on demand while making changes to the spreadsheet.

Here is the entire script:
function onOpen() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();  
  getCompleted();
  var menuEntries = [ {name: "Update Schedule", functionName: "getCompleted"} ];                     
  ss.addMenu("Update", menuEntries)
}

function getCompleted() {  
  var ss = SpreadsheetApp.getActiveSpreadsheet();  
  var weekDataRange = ss.getRangeByName("weekData");
  var weekObjects = getObjects(weekDataRange);
  
  //var week1 = weekObjects[0];
  //Browser.msgBox(week1.day1finish);
  ProcessSchedule(weekObjects);
}

function getObjects(dataRange)
{
  var data = dataRange.getValues();
  var objects = [];
  for (var i = 0; i < data.length; ++i)
  {
    var object = {};
    object['week'] = data[i][0];
    object['date'] = data[i][1];
    object['day1num'] = data[i][2];
    object['day1finish'] = isSet(data[i][3]);
    object['day2num'] = data[i][4];
    object['day2finish'] = isSet(data[i][5]);
    object['day3num'] = data[i][6];
    object['day3finish'] = isSet(data[i][7]);
    object['day4num'] = data[i][8];
    object['day4finish'] = isSet(data[i][9]);
    object['total'] = data[i][10];
    object['sum'] = 0;
    object['range'] = dataRange.getCell(i+1,12);

    objects.push(object);
  } 

  return objects;
}

function isSet(cellData)
{
  return cellData == "x" || cellData == "X";
}

function ProcessSchedule(weekObjects)
{
  for (var i = 0; i < weekObjects.length; ++i)
  {
    if (weekObjects[i].day1finish) {
      weekObjects[i].sum += weekObjects[i].day1num;
    }
    if (weekObjects[i].day2finish) {
      weekObjects[i].sum += weekObjects[i].day2num;
    }
    if (weekObjects[i].day3finish) {
      weekObjects[i].sum += weekObjects[i].day3num;
    }
    if (weekObjects[i].day4finish) {
      weekObjects[i].sum += weekObjects[i].day4num;
    }
    if (weekObjects[i].sum == weekObjects[i].total) {
      weekObjects[i].range.setBackgroundRGB(179,213,128);
    } else {
      weekObjects[i].range.setBackgroundRGB(255,0,0);
    }
    //weekObjects[i].range.setValue(weekObjects[i].sum);
  }
}

If you want to see this live here is alink to check it out: Marathon Training

Friday, November 6, 2009

Rock Climbing


I have friends big into rock climbing and  They climbing 5.10D's and has even done a few 5.11's if I recall. I feel most comfortable on 5.9's and have started to do some 5.10A's and 5.10B's. You might ask yourself how all these rock climbing numbers work... and Honestly I have no idea. All I know is that the higher you go the smaller the holds get... 5.10B they are small but reasonable.. 5.10D they are so small you have to have fingers like "jaws of life" to hold onto those stubs in the wall... (way too small) Maybe I'll do some research and blog about that too. I've been renting gear the last few months and feel it's time to start getting my own gear. Specially since it is something we are starting to do on a regular basis. There are so many option to choose from I'm not really sure what to go with. It's one of those things were asking the person at the store is pointless... You end up leaving the store with 5 extra things you don't need... They try and sell you everything under the moon and swear you need it... I was thinking about getting some gear from REI, but I have a friend that said the gear there wasn't very good and to goto a Rock Climbing Gym. There is one nice thing about picking gear up at REI is that you can swap it out years later when your done with it. So this is gonna be my goal tomorrow to venture over to the Rock Gym, I'm thinking I'm just going to start out with a Harness and Shoes, but will probably buy way more then I need... Because I do that...