How-Tos

Flask and WSGI

Flask is a python module that that makes Web application creation easier. Flask generates Web pages on the fly, and when coupled with WSGI (Web Server Gateway Interface) on an Apache Web server, scales up to commercial usage. Flask is built on the WSGI Werkzeug toolkit and the Jinja2 template engine. The definitive Flask tutorial: Flask Mega Tutorial. A readable and to-the-point WSGI installation guide: How to deploy a Flask application on Ubuntu. This is a concise reminder guide taken from the above. See the above references for specific details. Installing mo

Things I Noticed

No Pennies, Please

The automatic toll booths on the NJ Garden State Parkway have signs "No pennies, please". The thing is, if you throw pennies in the basket, the machine counts them up just fine – they just don't want them. It can take a while for the machine to count through them all.

How-Tos

Snake, Camel, Dromedary cases

When it comes to naming in computer programming, we have our go-to's "foo" and "baz" for quick name choices, for files or variables or functions. But it is considered best practice to use more meaningful names like "TaxTips.txt" or "Vacation_Photos_2021". We have case types too. In the olden days, metal type is stored in wooden cases in pullout drawers, one drawer per font and size. A composer removes a case and places it on an easel, and uses a composing stick to arrange the type pieces into a phrase that is then placed into a chase for printing. The capital letters 'A

Things I Noticed

Birds and Windows

It was a warm day with a breeze and I was in a classroom where someone left the window open. The vertical blinds were flapping so I opened them horizontally all the way. I didn’t understand why I was getting horrified looks from the class until I realized a bird had dived into the window. I turned around and saw a feather floating, and then I knew the terrible event I had caused. I reclosed the blinds. Predators have eyes positioned in front of their heads to triangulate distance to prey. Predated animals like many birds, have eyes on the sides of their heads to get a 3

Things I Noticed

GPS Challenge

"Tell me about Lake Chargoggagoggmanchauggagoggchaubunagungamaugg." It's also called Lake Chaubunagungamaug for short, or Webster Lake for outsiders, and is located in Worcester County, Massachusetts, near the town of Webster. Its name comes from Nipmuc, an Algonquian language, and supposedly translates to, “You fish on your side; I fish on my side; nobody fishes in the middle.” However, that translation has been disputed and may have been made up by an early 20th century newspaper correspondent. A more accurate translation may be the “fishing point that’s at the bou

Things I Noticed

The number 42 shows up all over ML

42 I hadn't realized it’s from Hitchhiker’s Guide to the Galaxy. They build a supercomputer to find the answer to the Ultimate Question of Life, the Universe and Everything, and after millions of years it comes back with the answer: 42. They don't understand the answer so they build a bigger supercomputer to figure out what the Ultimate Question is. If you are looking for a seed for your random number generator, try 42.

How-Tos

How to run Jupyter notebook on a remote server

You can run Jupyter server on a remote machine instead of your local machine. Replace the server port number with the port you want for your remote machine: remoteuser@remotehost: jupyter notebook --no-browser --port=9888 [default 8888]Use ssh to open a path between your local machine and the remote machine. The first localhost port below is the client side of ssh on your local machine: localuser@localhost: ssh -N -f -L localhost:9000:localhost:9888 -i "keypair.pem" ubuntu@ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.comReplace the address after keypair.pem wit