Wednesday, May 4, 2016

Python Extension Notations (Regular Expressions)

Extension Notations

Extension notations start with a (? but the ? does not mean o or 1 occurrence in this context. Instead, it means that you are looking at an extension notation. The parentheses usually represents grouping but if you see (? then instead of thinking about grouping, you need to understand that you are looking at an extension notation.

Unpacking an Extension Notation

example: (?

step1: Notice (? as this indicates you have an extension notation

step2: The very next symbol tells you what type of extension notation.

(?=       Only do a match if what follows the equal sign follows

(?#        Indicates a comment

(?!        Only do a match if what follows the ! does not follow in the string

(?iLmsux)        This turns on in python some special flags. I will elaborate below.

step3: How to use these. As far as I can tell, these are specific to python's regular expression engine. I have not found many references to them elsewhere and in the case of (?iLmsux) these are python regex specific flags, so I am thinking these are only implemented in python's regex engine.

inputString = r""
regExString = r'(?'
m =, inputString)

if m is not None: # m is a match object    print(
    print('m is None, so no match was found')

Running this code returns a match object but does not return the match. 

Wednesday, August 6, 2014

Hello World with Clojure and LightTable IDE

Open lighttable and also open the lighttable docs, getting started guide.....

hit your Ctrl + Space Bar.

Type insta until you see the choice 'Open a clojure instarepl'

Once you have chosen to Open a clojure instarepl, the Instarepl pops up in lighttable

then type (+ 3 4)

And 7 pops up as the answer if everything is working correctly.

We are used to seeing 3 + 4 = 7, which is called infix notation. However, clojure operates with prefix notation, which is (+ 3 4) = 7. This is also known as polish notation. Reverse polish notation is known as postfix notation and would be (3 4 +) = 7.

Tuesday, October 16, 2012

Today is Ada Lovelace Day!

Today is Ada Lovelace Day.

Finding Ada

The idea behind Ada Lovelace Day is to share stories about women who have inspired you to become who you are today in regards to programming and science (STEM Stuff)...

So, today I'm going to write about my wife, Marta Smith, who inspires me all the time. She is a programmer. Currently she is in school at Franklin University in Columbus Ohio where we live. She studies hard and she is passionate about programming. She's smart and she teaches me things and because we are both programmers it is fun to mess around solving problems together.

She stays up late to finish assignments and she is enthusiastic about learning more each day.

We recently went to the Grace Hopper Women in Computer Conference where I watched her lug her 10 lbs of laptop + books all around the conference as she tried to take in as much of the conference as possible while she also completed her homework. She made time to talk to others and she made a lot of friends while we were there. She just has so much passion for programming and for learning.

I'm proud of her. She's an inspiration.

Hard work comes with rewards. There is no better feeling than solving a hard programming problem that you've been struggling with for some time. To be a professional in any field it takes years of study and application. There are lots of women doing it everyday. Marta is definitely one of them. She is taking the field by the reins and having fun challenging herself and it is an inspiration.

Monday, April 2, 2012

How to run Knockout inside MVC 4

I'm watching Knockout Fundamentals by Steve Michelotti

I was having trouble getting the example running that he wrote to show how Knockout is used inside of a MVC 4 project.

This worked for me.

1. Create a new ASP.NET MVC 4 Project using the Internet Application template. Razor view engine is fine.

2. Right click on References and choose "Manage NuGet Packages". Install knockout.js

3. Navigate to Views -> Shared -> _Layout.cshtml
add in script tags:

After this reference, add the knockout reference

The order must be (a) jquery, (b) templates, (c) knockout. Also, the microsoft URL that worked in the previous post does not work in MVC 4 projects. This order must be exact or else it will fail.

4. Go to the scripts directory of the project and create a javascript file, named codeFile.js
Place the javascript code from this jsfiddle link into the javascript file.
JavaScript code from jsFiddle

5. Navigate to Views -> Index.cshtml
Place the html code and the template script tag from the jsfiddle link above into this file.

6. Create a reference to the javascript file by dragging and dropping the javascript file onto the view (Index.chtml).

Sunday, April 1, 2012

Trouble getting observableArray's running in Knockout?

I'm watching Knockout Fundamentals by Steve Michelotti

I was having trouble getting the example running that he wrote to show observableArray's.
There must be a bug in this URL

If you load the libraries in this order:

You will get all sorts of errors that will be very hard to track down.

Instead, use this URL from Microsoft and it works.

To get these working in jsFiddle, load jquery.tmpl.js first and knockout second. For jQuery you can choose the latest jquery framework from the frameworks dropdown.
The example working in jsfiddle

Here is the code outside of jsFiddle

Double click on these pictures to see the code enlarged.

Monday, March 19, 2012

Executive Summary: HTML 5

I'm introducing a new series of posts today. It is called the Executive Summary. Here is the first entry of this series: HTML 5

Things you need to know:

(0) HTML 5 is really a combination of technologies:
HTML 5, JavaScript, and CSS 3

(1) IE browsers are behind in supporting HTML 5 so in using these features you must do a lot of browser checking. The other main browsers are also supporting HTML markup tags in a piecemeal fashion, so you must make sure each feature is supported by each particular browser.

(2) The most important new features provided in new markup tags: Video, Audio, Drawing (called Canvas), Storage, GeoLocation

(3) HTML 5 isn't going to completely wipe out silverlight and other plugins because it does not have exactly every feature that they support. It is too early and premature to think that way.

(4) PhoneGap - you can code up apps in HTML 5 and use PhoneGap to port to different phone OS's. However, expect to do some work porting even when using Phone Gap.

(5) Windows 8 - you will be able to code tablet applications in JavaScript for windows 8 so learning this technology now will help you in windows development in the near future. Applications that are HTML 5 centric will most likely be easy to port to windows 8.

(6) JavaScript - this language is everywhere and most developers now need to take a look at it and its best practices. HTML 5 only enhances its value.

(7) HTML5 - is going to be a nice mulch-platform solution soon, once all browsers support it.

Tuesday, January 17, 2012

How to install Windows Phone Toolkit

1. Download NuGet package manager
Download Nuget

2. Go to Visual Studio 2010 Express for Windows phone -> Tools -> Library Package Manager -> Manage NuGet Packages for Solution...

3. Search "Windows Phone Tookit"

4. You should see Silverlight for Windows Phone Toolkit pop up... Install it for the solution

5. To test that it is installed. Go to Expression Blend. Right click on your solution and choose Expression Blend.

6. Go to the last symbol on the toolbar (>>), click on it to expand it.

7. Type "wrap" into the search box and if you find it, then Windows Phone Toolkit has been installed properly.