Thursday, July 20, 2017

Excel Pivot Chart Data Label Bug - Display 00 days as 30

This is a place holder for me to come back and talk about a bug that I discovered in Excel 2013 while working on a analytic / dashboard prototype solution for my day job.

When using Pivot Charts and using data formatted as dd:hh:mm. Data labels are showing 00 days as 30.

Pretty sure this ties back to the default date or first date value in VB Date object / array as being 12/30/1899.

The expect return value should The value being returns for day values of 00 is 30.

Example: dd:hh:mm = 00:08:12

Bug: dd:hh:mm = 30:08:12 (Day portion return 30 for day = 0 / 0 in date array dd = 30)

I am pretty sure the "30" being returned instead of expected value of  "00" by the Pivot chart is from the 0 position of the VB Date object array.

Saturday, April 15, 2017

Excel VBA: Find Next Empty Cell in Row, When only Row 1 is Populated

It is Saturday and I'm about to go out and mow my lawn but I had an Excel VBA problem I wanted to get past fist.

Not sure this is the best solution, but it is the one I came up with so I'll share it with you now before I go mow.

Problem: Have worksheet that is an event log for other subroutines. When created, the worksheet had a header row also created with data in Row 1 across columns A thru G.

When "WriteToEventLog" call is firing off, we're checking for next empty row in column A and cell "A1" already has header data written to it.

The method below works when cell "A2" is the starting cell, but fails when cell "A1" is used as the starting Range.

This code fails in an infinite loop and Out of Memory Error when starting from cell "A1" and ends up selecting all the cells memory can hold from column A.

        Range("A1").Activate
        ActiveCell.End(xlDown).Select
        ActiveCell.Offset(1, 0).Select

Here is my Saturday morning, pre mow, attempt to solve this issue with a custom Excel VBA function that correctly finds the next empty cell when row 1 contains the header row.

Please email me if you read this and it has helped you in any way.

1st Pass Code:

Sub AddItemToEndOfList()
    Worksheets("Sheet1").Activate
    'We assume that row 1 is already filled out from first process
    'Check to see if cell A2 is empty, if so then enter the next value in A2.
    'if not then go to next empty cell and enter the value.
    Range("A2").Activate
    If IsEmpty(Range("A2").Value) Then
        Range("A2").Activate
        ActiveCell.Value = "http://wwww.FinditClassifeds.com"
    Else
        Range("A1").Activate
        ActiveCell.End(xlDown).Select
        ActiveCell.Offset(1, 0).Select
        ActiveCell.Value = "http://wwww.FinditClassifeds.com"
    End If
End Sub

This can all be replaced with one line of code...

2nd Pass Code:

Range("A2").End(xlDown).End(xlUp).Offset(1, 0).Select

This works every time when we know Row 1 is already populated.

Thursday, April 13, 2017

Callback Functions in Javascript - Explained!

I'm coming back to write more on this but this is the gist of it...

I'm working on a project and this topic came up. I'm sure I've come upon this before in the past but never spent a lot of time on thinking deeply about it.

Javascript callback functions. I see a lot of video and blogs about it but most say it is hard to explain. I've just spent 2 hours digging in and here is the easiest way I can explain them to anyone.


A Javascript callback function is just a placeholder when I want to be able to pass a function in to another function, then it acts as the function itself once we inject it in to the other function where we can substitute callback "in our minds" with the name of the function we passed in the code logic.


I will be back soon to elaborate and provide you with examples.


-Regards Rick


Here are some good references I'm looking at now.
http://recurial.com/programming/understanding-callback-functions-in-javascript/

Video:

Sunday, January 8, 2017

Colspan and Rowspan, The Basics of HTML Table Design using Column and Row Spanning


HTML / Colspan and Rowspan
Display
inline
Attribute of
<th> — table header — A header cell in a <table>.
<td> — table data — A data cell in a <table>.
What does colspan= do?
Allows a single table cell to span the width of more than one cell or column.
What does rowspan= do?
Allows a single table cell to span the height of more than one cell or row.
Why use colspan= or rowspan=?
Sometimes it makes sense for a cell to span multiple columns or multiple rows. This might be used for a header cell that titles a group of columns, or a side-bar that groups rows of entries.
Both colspan= and rowspan= are attributes of the two table-cell elements, <th> and <td>. They provide the same functionality as "merge cell" in spreadsheet programs like Excel.
The value of either attribute must be a positive integer (a whole number). The value specifies the number of columns or rows that the cell fills.

VIDEO


Sample Code

COLSPAN Example Code

<html>
<head>
<title>Colspan Example</title>
</head>
<body>
<table border="1" cellpadding="4">
<tr>
<th colspan="3" bgcolor=”#99CCFF”>Production</th>
</tr>
<tr>
<td>Ricky Bobby</td>
<td>1493</td>
<td>beers</td>
</tr>
<tr>
<td>John Smith</td>
<td>3892</td>
<td>beers</td>
</tr>
<tr>
<td>Karen Farmer</td>
<td>0238</td>
<td>beers</td>
</tr>
</table>
</body>
</html>

ROWSPAN Example Code

<html>
<head>
<title>rowspan.html</title>
</head>
<body>
<table border="1" cellpadding="4">
<tr bgcolor=”#99CCFF”>
<th>Month</th>
<th>Savings</th>
<th>Savings for holiday!</th>
</tr>
<tr>
<td rowspan="2">January</td>
<td>Rent</td>
<td>$100</td>
</tr>
<tr>
<td>Gas</td>
<td>$25</td>
</tr>
</table>
</body>
</html>

Sunday, October 23, 2016

Classifieds like Craigslist and Craigslist Alternatives

Can you trust Craigslist? Can you really trust any website 100%?

Here are a few free alternatives to Craigslist.

1. FinditClassifieds.com - Free classifieds, covers US, Canada and Australia. Does not share information with 3rd parties and is indeed 100% free with no strings attached.  Developed and funded by Rick Cable at Webzcom. 

Thursday, April 14, 2016

Viper VTS-979 Taser test. 51,000,000 Volt Rechargeable Stun Gun

This is my 2015 X-Mas tech gadget review which includes my wife, Christine, tasering me. Good times!

Viper VTS-979 Taser test. 51,000,000 Volt Rechargeable Stun Gun 

Vermicomposting - Worm Factory 360 w/ Build and Follow-up Videos

Almost 2 months ago I decided to try my hand at worm farming also known as "Vermicomposting".

Why you may ask? Well, let me share two reasons...

1. I had just moved to a new home where the backyard was pretty much dead and in desperate need of rehabilitation. The entire backyard had not been watered in at least a year. A small patch of where grass used to be and a dead tree. This yard was a wasteland. I'm pretty sure the previous owner had sprayed ground clear when preparing the house for sale.

2. Our new house's garbage cans where half the size of the house we just left on the other side of town. The first couple of months we lived in our new house, we always seemed to have an over flowing garbage can. This made me wonder if I could do more to recycle and reduce our garbage output that ends up in the local landfill.

Here are my YouTube videos that will take you through my experiences in vermicomposting.

Most recent to oldest:

Worm Factory 360 (45 Day Update)



Building a Worm Factory 360 (Unboxing and Build)

Monday, March 7, 2016

Trouble Shooting a Flip Mino HD Video Camera that Won't Power On

The Story

This weekend I decided to start making YouTube videos again after laying off for a couple of years.

Before I can begin filming, I needed to find all my video and audio equipment of which I had quite a lot and needed make sure it was all working.

The Problem

One of the cameras, a Flip Mino HD, had sat without use in a drawer for about 3 years.  That is a long time to let a battery discharge.  This was the root of the problem I'm going to describe to you now.

The darn thing would not power up for nothing. So off to YouTube I go and I find a lot of videos offering solutions.  Most of the videos show these 3 steps:

  1. Using a paper clip, find the reset button hole at the bottom of the unit inside the tripod mounting threads. [Pic Here]
  2. Push and hold the reset button for at least 10 seconds.
  3. Plug in to your computer and it should start charging.

Rick's Solution

  1. Using a paper clip, find the reset button hole at the bottom of the unit inside the tripod mounting threads. [Pic Here]
  2. Push and hold the reset button for at least 10 seconds.
  3. Plug in to your computer and it should start charging. Wait up to 5 minutes. It will come on.
  4. Repeat the above process as many times as needed.  Took me 15 times but it did work. Your patience will pay off.


Why Did This Happen?

I will come back and update this if I find more evidence but what I think is happening is that the battery was so low that on camera, like 1-2% that the camera's OS could not fully boot and the OS actually needs to load to monitor the battery charging process. It seemed like the OS would not fully take over until the until had achieved to certain level of battery capacity which took about 15 reboots and reconnection of the USB charging cable.  It was a real pain in the ass but I was able to save the camera.  I bet a lot of people ended up throwing these cameras away because of this.


Monday, December 22, 2014

CDO.Message.1 error '80070005' Access is denied.

Today I was in the process of moving an application originally written to run with classic ASP on IIS 6.0 to a new server running IIS 7.

I have an email function that sends emails out which worked fine on IIS 6 but failed on IIS 7 on the new server.

Step 1: Make sure SMTP was installed and configured on IIS 7.
This video was helpful


Step 2: Set permissions on the C:\inetpub\mailroot\Pickup folder to allow write access using the IIS_IUSRS account.

Step 3: include the following lines in your code:
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
objNewMail.Configuration.Fields.Update