Friday, March 29, 2013

PHP - Loop Through Excel Document and Print Cells

require_once 'excel_reader2.php';

foreach($reader->sheets as $k=>$data)
    echo "\n\n ".$reader->boundsheets[$k]."\n\n";

    foreach($data['cells'] as $row)
        foreach($row as $cell)
            echo "$cell\t";
        echo "\n";

Saturday, March 16, 2013

Head Tracking In The Browser

Had no idea this was even possible, but that's an example of head tracking in the browser done with WEBRTC.


Check If Time Is Between - Python

From an user named miku:

>>> import datetime
>>> d = 
# => datetime.datetime(2009, 12, 15, 13, 50, 35, 833175)

# check if weekday is 1..5
>>> d.isoweekday in range(1, 6)

# check if hour is 10..15
>>> d.hour in range(10, 15)

# check if minute is 30
>>> d.minute==30

Friday, March 15, 2013

Prevent Character Escaping - Python

If you want to use network paths without adding extra slashes, you can use python's raw string function.

Here's an example of something you want to make a raw string:

source_path = r"\\mynetworkshare"

Tuesday, March 5, 2013

Check If Workbook Is Open By Name - VBA

This code from StackOverflow helped me find whether a workbook was open with its name. Here's the link to the thread: Link

Function BookOpen(strBookName As String) As Boolean
    Dim oBk As Workbook
    On Error Resume Next
    Set oBk = Workbooks(strBookName)
    On Error GoTo 0
    If oBk Is Nothing Then
        BookOpen = False
        BookOpen = True
    End If
End Function

Sub testbook()
    Dim strBookName As String
    strBookName = "myWork.xls"
    If BookOpen(strBookName) Then
        MsgBox strBookName & " is open", vbOKOnly + vbInformation
        MsgBox strBookName & " is NOT open", vbOKOnly + vbExclamation
    End If
End Sub

Sunday, March 3, 2013

"The link you have used to enter the PayPal system is invalid. Please review the link and try again."

Using an incorrect e-mail address in the hidden "business" field in your HTML form can cause this issue.

Example of the hidden field with the problem:
<input type="hidden" name="business" value="">

Friday, March 1, 2013

Overdue Member Calculator

This should help ease the pain of dealing with suspended paypal recurring payment agreements.

The page accepts variables from the URL, then generates a paypal payment button based on the person's last payment date.

HTML Skeleton / Boilerplate

Here's a good HTML skeleton/boilerplate tool: