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

http://learningthreejs.com/blog/2013/03/12/move-a-cube-with-your-head/

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

Demo: http://jeromeetienne.github.com/tquery/plugins/headtrackr/examples/demo.html

Check If Time Is Between - Python

http://stackoverflow.com/questions/1907196/how-do-i-check-if-its-monday-to-friday-and-the-time-is-between-10-am-to-3-pm

From an user named miku:

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

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

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

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

Friday, March 15, 2013

Prevent Character Escaping - Python

http://stackoverflow.com/questions/2042342/network-path-and-variables-in-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
    Else
        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
    Else
        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="dave@davesgarage.com">

Friday, March 1, 2013

Overdue Member Calculator

https://github.com/pawl/OverdueMemberCalculator

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: http://www.htmlshell.com/