Lost Sydney

Click image for full size view.

Lost Sydney is a Facebook site with 100’s of photographs of Sydney, some dating back well over 100 years.

This is Sydney’s story. Lost Sydney is not just about demolished buildings, it’s also about photos of Sydney’s past.

Lost Sydney

Posted in Arch structures, Bach, Historic Bridges, Newton | Tagged , , | Leave a comment

Extracting text from an Internet table

For use in my Units spreadsheet (Units4Excel) I want to extract the unit conversion values from the comprehensive Wikipedia unit conversion table.

On Wikipedia the table looks like this:

and when copied and pasted as Unicode text into Excel, like this:

To convert the text in the final column to values the following changes are required:

  • Skip the leading non-numeric characters,
  • Remove spaces between numbers.
  • Remove the final numbers enclosed in brackets, indicating the uncertainty in the final digits.
  • Convert the exponent (e.g. x10-27) to Excel format (E-27). Note that a positive exponent displays as a 4 digit number, e.g. x1027.
  • Convert the resulting text string to a number with double data type.
  • Extract the units
  • Skip references to notes.

The following code does the job:

Function ExtractVal(Txt As String, Optional ExtractUnits As Boolean = True)
' Extract number and optionally units from Wikipedia unit conversion factor table
' Remove preceding text and trailing notes, and variance value enclosed in ()
' Convert x10nn to Enn or x10-nn to E-nn
Dim n As Long, m As Long, char As String, ValStr As String, RtnA() As Variant, i As Long, strcode As Long

' Skip over any non-numeric text before the first number
    If ExtractUnits Then
        ReDim RtnA(1 To 2)
    Else
        ReDim RtnA(1 To 1)
    End If
    n = Len(Txt)
    
    For i = 1 To n
        char = Mid(Txt, i, 1)
        If IsNumeric(char) Then Exit For
    Next i
    ValStr = char
    m = i + 1
    
 ' Extract all numbers until the first non-numeric text
 ' Skip over single spaces followed by a number
    For i = m To n
        char = Mid(Txt, i, 1)
        If IsNumeric(char) = False And char <> "." Then
            If IsNumeric(Mid(Txt, i + 1, 1)) = False Or char <> " " Then Exit For
        Else
            ValStr = ValStr & char
        End If
    Next i
    m = i + 1
    
' Skip over numbers enclosed in ()
    char = Mid(Txt, i, 1)
    If char = "(" Then
        For i = m To n
            char = Mid(Txt, i, 1)
            If char = ")" Then
                i = i + 1
                Exit For
            End If
        Next i
    End If

' Extract numbers following 'x10' and add to value string as Enn
' The 'x' in the Wikipedia table is Ascii code 215
    char = Mid(Txt, i, 1)
    strcode = Asc(char)
    If strcode = 215 Then
        m = i + 3
        ValStr = ValStr & "E"
        For i = m To n
            char = Mid(Txt, i, 1)
            strcode = Asc(char)
            If strcode = 45 Then char = "-"
            If IsNumeric(char) = False And char <> "-" Then Exit For
            ValStr = ValStr & char
        Next i
    End If
 ' Convert value string to double and copy to RtnA
    RtnA(1) = CDbl(ValStr)
    
 ' Extract unit text, skip over final note reference
    If ExtractUnits Then
        m = i + 1
        ValStr = ""
        For i = m To n
            char = Mid(Txt, i, 1)
            If char = "[" Then Exit For
            ValStr = ValStr & char
        Next i
        ' Copy unit to RtnA
        RtnA(2) = ValStr
    End If
    
    ExtractVal = RtnA
End Function

This function can be applied to the text at the top of the final column, and copied down, resulting in:

Columns AB and AC are the function output. Column AD uses the built in IsNumber function to confirm that the values in Column AB are indeed valid numbers.

Posted in Excel, Newton, UDFs, VBA | Tagged , , , , , , , | 3 Comments

Tanh-Sinh Quadrature update

Following some comments here Graeme Dennes and I have modified the start-up code for the Tanh-Sinh Quadrature spreadsheet to avoid problems opening the file when first downloaded, or copied to a new computer.

The new file is located (as before) at:

Tanh-Sinh Quadrature

Any problems, please leave a comment below, with details of error messages and Excel version, including 32 bit or 64 bit.

Posted in Excel, Maths, Newton, Numerical integration, UDFs, VBA | Tagged , , , | Leave a comment

Four Forgotten Female Folkies

Barbara Dane

In her speech to the GI Movement of the Vietnam War Era (whose text can be found in the booklet that’s included in Paredon Records’ FTA! Songs of the GI Resistance vinyl album of 1970), Barbara Dane said, “I was too stubborn to hire one of the greed-head managers, probably because I’m a woman who likes to speak for herself. I always made my own deals and contracts, and after figuring out the economics of it, I was free to choose when and where I worked, able to spend lots more time with my three children and doing political work, and even brought home more money in the end, by not going for the ‘bigtime.’ I did make some really nice records, because I was able to choose and work with wonderfully gifted musicians.”[7]

Tia Blake

Tia Blake was the stage name of Christiana Elizabeth Wallman (1952-2015), an American writer and singer…

Wallman was born in Columbus, Georgia, in 1952, and grew up in North Carolina.[1] In 1970 she worked for Farrar, Straus and Giroux in New York for six months, before moving to Paris.[1] In Paris she recorded an album of folk songs at Ossian Studio in 1971. This was released in February 1972 by Société Française de Productions Phonographiques (SFPP) under the title Folk Songs and Ballads: Tia Blake and Her Folk-group.[1]

Bridget St John

Bridget St John (born Bridget Anne Hobbs; 4 October 1946 in Surrey, England)[1] is an English singer-songwriter and guitarist, best known for the three albums she recorded between 1969 and 1972 for John Peel‘s Dandelion record label. Peel produced her debut album Ask Me No Questions. She also recorded a large number of BBC Radio and Peel sessions and toured regularly on the British college and festival circuit. St John appeared at leading folk venues in the UK, along with other folk and pop luminaries of the time such as Nick DrakePaul Simon, and David Bowie, among others.[2] In 1974 she was voted fifth most popular female singer in that year’s Melody Maker readers poll.[3] Blessed with a “rich cello-like”[4] vocal style, she is also an accomplished guitar player who credits John Martyn and Michael Chapman as her “musical brothers”.[5]

Vashti Bunyan

Vashti Bunyan (born Jennifer Vashti Bunyan[2] in 1945[3]) is an English singer-songwriter.

Bunyan released her debut album, Just Another Diamond Day, in 1970. The album sold very few copies and Bunyan, discouraged, abandoned her musical career. By 2000, her album had acquired a cult following; it was re-released and Bunyan recorded more songs, initiating the second phase of her musical career after a gap of thirty years.[4] She subsequently released two albums: Lookaftering in 2005, and Heartleap in 2014.

Posted in Bach | Tagged , , , | 2 Comments

Newton-Raphson and Brent’s Method – Solver examples

I recently discovered the Computing Skillset site (via open-struct-engineer), which has good information on the basis and use of the Newton-Raphson method:

The Newton Raphson method explained, details, pictures, python code

Highly instructive examples for the Newton Raphson method

I have added an example from these papers to my ItSolve spreadsheet, illustrating some advantages of Brent’s Method for problems that may be difficult to solve using the Newton-Raphson method. The updated spreadsheet (including full open-source code) may be downloaded from:

ItSolve.zip

The example finds solutions to the function shown below:

Using the Newton-Raphson Method a solution may not be found:

The screen-shots below show all four solutions between -7 and 7 using Brent’s method:

Note that:

  • The values specified for the search range must return a positive and negative function result. If both are positive, or both negative an error message is returned.
  • The Quadbrent function works with functions entered as text on the spreadsheet as shown, or (by default) will call a named VBA function. The QuadbrentT function is a front-end for Quadbrent with defaults set to use text on the spreadsheet, as shown above.
  • The text function must be entered in a format recognisable by Excel, for instance the value Pi is entered as Pi().
Posted in Excel, Maths, Newton, UDFs, VBA | Tagged , , , , , | Leave a comment