Fania
EU flag minus UK star

ABOUT

I think, therefore I am.

Current

I'm a lecturer at De Montfort University (DMU) where I've been teaching various modules such as front-end web development, functional programming, and research to a variety of students from different courses across the Faculty of Computing, Engineering, and Media.

I'm a transdisciplinary creative generalist. I have passion for what I do, and what I think is right. Sometimes that involves saying "no".

My sense of purpose is my own - I'm an introvert.

Un-Current

I have a PhD in Software Engineering/Computer Science. The title of my thesis is Algorithmic Meta-Creativity and it's available as HTML or PDF at dr.physics.wtf.

My research interests revolve around studying human and computer creativity and how they are evaluated, the absurd pseudo philosophy pataphysics and its applications, and the development of creative exploratory search algorithms inspired by pataphysical concepts.

Although the PhD wasn't classed as "practice-based" research, an artefact pata.physics.wtf was submitted alongside the thesis. The software for this was written (mostly) in Python.

Sitemap

Internal: Home About Bookmarks Images Haskell Cheats
External: GitHub Teaching CodePen Dave

Bookmarks

Magic SVG

January 2020

Animated curved magic lines for order 4 magic squares

This project has grown from a proof of concept for drawing magic lines with SVGs, to full dynamic generation of animated magic lines of various orders in various artistic styles.

Dave Everitt and me are presenting a paper on this at EVA 2020 in London this year.

Jen Simmons: Mondrian Series

July 2019

Mondrian
Simmons' responsive Mondrian

Pamatamap

April 2018

I have now finished the map for my PhD thesis.

It’s handwritten svg code (based on a design originally created in Inkscape).

Animated SVG Spiral

November 2017

Hiroshige

October 2017

Hiroshige Hakone

Other favorites: Kameyama, Miyanokoshi, Nojiri, The Dyers District in Kanda, Susaki and the Jumantsubo Plain near Fukagawa, Yuhi Hill and the Drum Bridge at Meguro, Fox Fires on New Years Eve at the Garment Nettle Tree at Oji

PhD

October 2017

PhD
PhD

It’s done.

Alfred Jarry’s Semantics

October 2017

Stillman
Stillman

“a web of disambiguation, mirrors, energy, machines, and potential collisions”

Eschersketch

October 2017

Escher
Escher

Billy Roh: Albers as a Millennial

November 2018

Billy Roh: Albers as a Millenial
Josef Albers - Homage to the Square (by Billy Roh)

Nicolas Bernier

November 2018, March 2014

Nicholas Bernier: Monolithe 04
Monolithe 04
Nicholas Bernier: FREQUENCIES (LIGHT QUANTA)
Frequencies (Light Quanta)

PataKosmos

March 2015

PataKosmos website logo
PataKosmos

Neurobiology of Writing

July 2014

Neurobiology of Writing
PHD comics #1734

Murakamicat

Murakami Octocat
Octocat number 83 of GitHub

ZKM Karlsruhe

September 2018

ZKM Karslruhe
rosalie: CHROMA_LUX, 2009, ZKM_Foyer

Kentucky Route Zero

July 2014

Kentucky Route Zero
Kentucky Route Zero - Episode 3

Steve Calvert's Pataphysics

June 2014

Steve Calvert's Pataphysics

Windmaedchen

June 2014

Windmaedchen

Zalgo

June 2014

Ḭ̵ͦͣ͒̒̃̎̿̀ ̯́͗̏̍ͩ̽͊̌͞h̪͎̜̞̫̲̑̿̋ͫͩa̜͚̠͈͚͚̳͋̈̋̏̎̋̾ͯ͝ţ̩̜͕͎̂͂̽ͪ̎e̷̬̫͖͍̓ͬ̒͟͞ ̷̗̞̮̪̘̼͎̪̮̎ͬ̑̇̐͐b̛̞̬̤̣̱ͣ͒͊͡e̥̠̤̐ͧͬͬ͋i̴̪̩̙̱͍̼̟̗̋̎̕n̯̈́̂̌ͤ͛̈́̓̇͟͞g̴̨̮͎̰͎̈ͫ̅ͫ ̨̫̪̟̩̜̗̎͆͑͛̆̎ͬ̉̚͘s̴̩̞̮̓̊̒͊͒̏ͮ̃i͈̳̗͉͓̬̰͑ͫ͞c̬͔̮̼̅͆ͧ̿̇͐̃̇k͓͍̬̞̬̞̊̃̆̿̄͋ͣ̓ͅ.̃ͮͨ͏̣͎ ̵̪̳͕̲̫̓̿ͮ͑̐̃̐̅ͤ͢͞I̩̰̞̜̮̓̄͂͊̌ͦ̾́͘ ̰̪̖̈́h̶̼̠̲̘̻̼͊ͦ̑̈͗ͩ̐̀͘͢a̛̼̬ͥͩ̅̋ͧť̡ͨ́͛̈́͑͏͚̜̞̞̜̣̱͙̳e̶̮͎̳ͬͭ̈́̿̒̾̚ ̹̳̠̻̟ͥͦb̨̦̲̲̝͎͕ͨ̃e͖͚̘͍̓͒̑̋̉͗͛̅ͭ́i̵̢͉̣̘̺̝̻͖͊ͣ̄͛ͬn͚͉̪̜͇̋̒ͪͤ̒̍́͝ͅg̶̲̥̟̦͕͙͚͕̋̇̇̑ͩ ͛ͩͬͤ̆̄̉ͨ̚͏̵̛̣̜̰͔d͉̱̠̭̙͕ͭ͌̉͗̕ͅe̬̤̳̤̠̮ͥ̐̓͂̎͋ͮ̅͘p̳̯̏ͩͯͯͩͯ̄̕ṛ͙͍̰̱̫̘̩̑́ͨ̐̌̄̅́ȇ̳͖͖̝̦̗̦̼̬ͣͦ̃ͤ̀͆͊̋́͘s̷̥̙͈̦̦͐̂̿̓ͤ̀̌͢͟sͫ̅́̋̂̎͏̸͖͉̗̳̮̝̯̳ė̕͢҉͍̟̭̘̺̳͖d̸̖̩̱ͫ̆̅̀͘.̫̤̝̱͉̓̉͑ ̧̉̃ͪ̽͜҉̯̰̜̣͎I̶̵̼̱̋͋͒̆̃̓͂́ ̹͙͈̫̯̠̲ͪ̈ͭ̌w̵̟̻̭̹͉̻͖̻͗̓͆ͩ̊ͨ̽ͨ̕͞ͅaͩ͂̓͏̶̬̺̘̰̜͖̖͟ͅņ̈̓͌̑̔͂̂ͥ̀͏͉͈̟͇̲͚͚̻t̤̗̋ͮ̽͑̀͋͘ ̰̹͈̼͈̏́́͜ť̵̸̙̼͆ǫ͈͔͉̯̗̩̬̖̑͐͌̄̐ͨͥ̚ ̘͕͎̺̍̑͂̕͝b̢̠̜͉͆͛ͯ͆͂̍̋̿͘e̩̣̳͇̻ͬ͗͌̾͑̓̏ͩͯ ̵̟̹͓͌̽ͩͦ̕ͅh̹͖̠̯̅̐̍͋͛̈́͐ͅḁ̮͙̫̠̽̅̓̋p̸̻̞̭̯̫̬͎̰̄͒͆ͫͯ̀p̰͓̊̋͆̃ͦỹ̛̯͖̘͍̅̎͛̂͆͂̈́ͪ̕.̥̳̭̗͙͋̎ͫ ̘̼͔̙̙̙̲ͭͫI̧̛̙̮̦͔͇̭̬̠̋͛̈ͧ͐̿̾̕ ̵̬̳̭̪̱͕̺̰̔́w̶̼̱̞̩͖̘̯̞͓̽͢a̴̧̼̳͔͉̖͖ͥͩ̊̐n̵̢̪ͯ͒̈́̂̓ͮt̄̌̔̎̾ͧͭͨ҉͈̜ ̵̸̗ͦ̉ͪ̓̇͌ͯ̕ț̢̝͓̭͔̱͍̙͙̈́̓̎ͥ̎o̸̘̞ͬ͢ ̵̳̖̘͈̐̇̾͒̃̇ͥ̿̽b̧̳̩̫͍͉̖̘̦ͬͣ̓̑̋̔̈̿͑e̤̘ͫ̌̀̊͛̏́̕.̪͎̭̪̪͗ͭ̄͂͗ͯ̀ͅ ̵̺̅͋͋͛M̓͛ͤ͑҉̠ė̷̬̤̰͓͍͓͗̿̇̆ͤ.̟̩̘̘̭͐̆ ̪̓͆̀Ḯ̢͖ͪͪ̂ͬ̾̇̏̚͟ ̖̯͍̯̮̱̘͐̓̌̂͂̈̉͂͡͠ͅl̢͙̺͔ͧ͗̾ͮ̿̔͛̔ͅo̶̱̹̗͙̭ͩ̔ͧͣ͗ͨ̿̓vͬ̌͏̗͍̦̱̞̘͟e̳̭͓͎͆͘ ̵̭̲̣̤̐́ͮ̄ͯͤ͐ͨ͟c̸̛̲͎̞͇̥͌͘a͖̘̱͖̻̘̗ͪ̓̃͑͋̄́́lͯ͊͏̲̼̬̣͡m̷̹̣̯̜͌ͦ̎͗̉̿̈͘͡.̛̦̝̲͍ͣ̆͟ ̵̉ͭ͂҉̱I̧̻͖̬̰̜ͭͤ͠ ̨̖̲̹̮̩̥̥̞̤͐͝ļ̴̙̤͎̥̺ͭͥ̅̌̐̀͛ͅo̷̼̠̖͙̟͎̞̩̊̔v͉̖̮̜̭͉͉̐̈́͛̽͆ͨe̋́ͩͩ͏̶͍̱͚ ̸̯̦̭͍̱̫͚̻͒͊͌̐̓͒͒͒̓̕ͅn̵̘̝̣̝̭͓ͧ̓̿ͅȃ̶̸̮̲͕ͥ̉́t̬̣̞͎̥͖͎̟ͫͩͭ̿̓͢ư̶̟͕̺͔ͩͧ͂̀ͧͪr̵̸͖͍͔̊ͣ͗́͆e̵̥̤̦̖̘ͩ̅ͬ̂ͯ́͢.͙̫̞͖̏ͧ͒̒́͠ ̙͈̻̌ͧ̀̿̋ͦ̌̄̚͜I̷͙̤̪̪ͨ͌͐͐́ͫ́ ̴͉̤̫̠̪̠̹̪͈͂̈́̀m̧̺̙̳̖̹̈̑̋͐̎̉̎͗i̶̖̹̦͆͛ͥͧ̓ͯͣ͡s̟͖̮̺͚̻̹̮̉̿̐ͩ̌̆̊͑ͯ͝ͅș̰͕͎̣ͭ́͢ ̼͙̼ͨ̃̍́͘ć̣̪̠͉̼͛ͪͩ̇͑́h͈̖̐ͩ̅ͨͥ̌͑̍͘ā̷̶͖̩͇̻̼͎̀ͬ͘ͅô̸͓̖̹̋̓͜s̯̭͒̓ͥ͐̆̆̒̀.̴͖ͮ͌̓ͭ̄ͨͨ͠ ͖͎̜̰͌̍̃̾̆̔ͩȈ͂҉̨̲ ̠͔͖̖̫ͥ̄m̷̶̯̞͈̄ͨ̕i̶̷̼̟͈͇̦̪ͪͫͤ̿̈ͤͦͫ̑s͍̭͉͖̙͎̤̫̉̋̆s̢̟͙͇ͯ̈́̔̀͝ ̶̼̱̫̥̩̱̣̣ͮ̌̅̃͋ͩ̈́͟ͅs̡͖̥̹̦͔̜̜̍͛ͮ͐ͥ͂̔̒t͖̦̦̰͉̍̐̊ͫ͊r̉ͫ͒̓̄ͨͧ͏̛̟̞̬̖͚̭̣ͅu̧͈̼̖̭̫̜̦ͪ̎̑̿͛c̗̠̪̜̼̣̳̿̌ͤ̎ͭţ̰̗̾̓̑ͫ̆̄͞ư̡̥̰̮̹̼̱̠ͦ̍̈́̆ͨ̒̽̒͘r͛ͣ͋ͩ̉ͪͥ̎͏̺̪͞ě͈̖͕̔͞.̴̡͙̮̅ͧͦ̂̉̋ͣ ̴̷̡͎͑̽͒͒̔ͧ̚Ḭ͇͌̓̃͟ ̫̻̅ͬ͂ͤ͠l͓̫̠ͮͬ̽ͥͩ͜͟o͓͓̟͓̜̝̪̟̞͌͌v̛̹͖̹̓̓̒̓́͟e̦͉̜͕ͦ̊͐͟ ̶̭͔̜̳̯̹ͫ̂͒̀͞ͅy̰̠̜̝̻̩̰̣̅̄ͨͅó͚̱̪̫͓͂̂͐͗͗̌ͥu̟̦̫̣͉͇̭̙̦ͨͤ̃ͯ̚̚͟.̧̡̖̺̱̞̫͆̑͐ ̬̖̜̤̏̌́͂̄

PhD Comics Cecilia

June 2014

PhD Comics

Uri Goren

June 2014

Uri Goren: typedef unsigned char t;t*F="%c",l[]="|\\/=_ \n](.\0(),*(.(=(}*.)[[*.",N='\n',* r;typedef(*H)();extern H Ar;Q(a){return(a|-a)>>31;}H S(c,a){return(H)(a&~c|(int )Ar&c);}extern t*ist;V(t*u){*u^=*u&2^(*u>>7)*185;}Z(t*u,t n){*u-=n;}e(t c,H h){ R(h,Q(* r^c));} I(){r=l +7-4*Q( getchar ()^*l); }R(H h, int c){Ar=S (c,h);- main() ;}P(){r ++;}z() { O(&N);} O(t*c){ printf( F,+*c); }T(){r= "This is not a function\n" ;}w(U){ U=Z(r,8 ); r-=~Q(* r/8-4); return 0; }M(){r= ist-68; } h(){t G =r[1]-r [2]^*r; G^=30;V (&G);e( 0,(O(&G ),P(P(* r++)),z));}g(){M();R(h,0);}f(){P(O(r));e('f',g);}p(){P();e('a',f);}d(){P(O(r)); e('n',p);}c(u){u=r[-2];T(Ar=d);R(f,Q(u^'"'));}n(){e(w(O(l+*r%8)),c);}a(){I();R( n,0);}main(){S(Q(Ar),a)();}H Ar;t*ist="Rene Magritte"-(1898-1967);

XKCD Pain

June 2014

xkcd 883

Solutions Log

Inspired by the infinite solutions log

DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far ...

Topics:

Git

Core commands:

  • Create repository in folder git init
  • Clone existing repository git clone URL
  • Add any new files git add .
  • Commit changes git commit -m 'Message'
  • Push changes git push origin master or git push
  • Force push changes (overwrites stuff) git push --force
  • List all local branches git branch
  • List all branches (incl. remote) git branch -a
  • Create branch (but don't checkout) git branch NAME
  • Create branch (and checkout) git checkout -b NAME
  • Switch branch git checkout NAME
  • Delete local branch git branch -d NAME
  • Force delete local branch git branch -D NAME
  • Delete remote branch git push origin --delete NAME
  • See log git log
  • Nicely formatted log log --graph --date=short --pretty=format:"%h%x09%ad%x09%s"
  • See changes git status or git diff
  • Purge file from commit history with BFG Repo-Cleaner

Git Deployment

January 2020

1. On local machine

  • add ssh key to server's authorised keys ssh-copy-id -i ~/.ssh/id_rsa.pub user@server
  • add ssh key to server's authorised keys ssh-copy-id -i c:\users\name\.ssh\id_rsa.pub user@server
  • these might need a port too -p 1234

2. On server

  • live site: /home/user/site
  • bare repo: /home/user/site.git
  • initialise bare repo: git init --bare
  • enter hooks folder: cd hooks
  • create "post-receive" file: touch post-receive
  • add the following script using nano post-receive:
    #!/bin/sh
    git --work-tree=/home/user/site --git-dir=/home/user/site.git checkout -f
  • or use the post-receive script mentioned in this article: Simple automated GIT Deployment using GIT Hooks
  • fix permissions of post-receive script: chmod +x post-receive

3. On local machine

  • add new remote: git remote add server user@server:site.git
  • check remotes: git remote -v
  • add the following lines to the local git config file (i.e. in .git/config as opposed to the global config in c:\users\name\.gitconfig):
    [alias]
      pushall = !git push origin master && git push server master
  • make changes and push to both remotes: git pushall

Specify port:

  • git remote set-url server ssh://user@server:port/absolute/path/to/site.git
  • (if cmd complains about caching key and you can't click yes, run putty itself so you can click yes there)

Multiple users pushing to same repo on server:

  • Create user account for "git": sudo adduser git
  • su git
  • cd
  • mkdir .ssh && chmod 700 .ssh
  • touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
  • Each user wanting to push to the server needs to add their public ssh key to the "git" user's authorized_keys file:
  • From local machine: ssh-copy-id -i ~/.ssh/id_rsa.pub git@server
  • From local machine: ssh-copy-id -i c:\users\name\.ssh\id_rsa.pub git@server

More info

Pandoc & Git Hooks

Add the following code to a pre-commit hook in the .git/hooks folder of your repo. This will generate html files from markdown content every time just before you commit.

Make sure you add styles inside a <style> block to a file called "styles". See pandoc command in script below.


#!/bin/sh

echo "Converting markdown files to html with Pandoc..."

for file in markdown/*.md 
do
  echo "Processing $file"
  name=$(basename ${file%%.*})
  # echo $name

  pandoc $file -f markdown -t html -o html/$name.html -s -H styles --quiet
  # --quiet = suppress warning messages
  # -s = standalone (full htmlm not snippet)
  # -H = include file in header
done

git add .
echo "... and stage generated html files."
      

SSL

August 2019

Secure Sockets Layer

Nginx + Debian Stretch 9

  • certbot for Nginx on Debian 9 (Stretch)
  • install certbot: sudo apt-get install certbot python-certbot-nginx -t stretch-backports
  • create certificate: sudo certbot --nginx
  • certificates are found in: /etc/letsencrypt/live
  • check certificates: certbot certificates
  • renew certificates test:certbot renew --dry-run
  • force renew certificates certbot renew --force-renewal
  • expand/update certificates certbot certonly --cert-name example.com -d example.org,www.example.org
  • revoke/delete certificates certbot revoke --cert-path /etc/letsencrypt/live/CERTNAME/cert.pem
  • check crontab: crontab -l
  • edit crontab: crontab -e
  • restart cron: sudo /etc/init.d/cron restart
  • certbot logs: /var/log/letsencrypt/letsencrypt.log
  • cron job for auto-renew: 0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew (unconfirmed)

Nginx + Debian Jessie 8

  • Forum autorenew question
  • certificates are found in: /etc/letsencrypt/live
  • wget https://dl.eff.org/certbot-auto
  • chmod a+x certbot-auto
  • check certificates: /etc/certbot-auto certificates
  • might need to add flag:--no-bootstrap
  • renew certificates test:sudo /etc/certbot-auto renew --dry-run
  • cron job for auto-renew: 0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && /etc/certbot-auto renew --pre-hook "service nginx stop" --post-hook "service nginx start"

fix ssl labs server rating ubuntu nginx link

Server Management

August 2019

General

  • Cross origin resource sharing (CORS): enable-cors.org
  • get Debian version lsb_release -d
  • get Kernel version cat /proc/version
  • When upgrading remember to re-install nginx, git, certbot, couch, python 3.8, etc

Users

  • sudo adduser name
  • Change user permissionschown user file
  • Change user permissions for allchown -R user folder
  • Change group permissionschgrp group file
  • Change group permissions for allchgrp -R group folder
  • Edit access rightsnano /etc/ssh/sshd_config
  • Securing a VPS
  • NGINX

    • /etc/nginx/sites-available
    • /etc/nginx/sites-enabled
    • /etc/nginx/snippets
    • stop nginx: service nginx stop
    • restart nginx: service nginx restart
    • get nginx status (incl pid): service nginx status
    • test settings: nginx -t
    • create symlink from sites-available to sites-enabled: ln -s /etc/nginx/sites-available/name /etc/nginx/sites-enabled/name
    • Nginx not restarting
    • check running processes of nginx: ps aux | grep [n]ginx
    • kill process: kill -9 1234 for each process!
    • then start nginx again: service nginx start

    Screen

    • show all running screens: screen -ls
    • start new screen with name: screen -S name
    • attach to a running session: screen -x
    • attach to session name: screen -r name
    • detach from a session: Ctrl-a d
    • kill a screen: screen -S NUMBER -X quit

    Netstat

    show ports used: netstat -plutn

  • CLI

    Command-line Interfaces

    General

    • Curl Manual
    • Open cmd as admin 'Right-click' cmd executable
    • Edit files with nano

    Customisation

    • Customisation config file for new Windows Terminal in Customisation stuff in C:\Users\Fania\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.json

    Open at location

    • 'Shift-right-click' folder to open CMD there
    • Use the 'Open-In-Terminal' script

    Finding things

    • Show all locations of file type -a NAME
    • Show location of file or folder which NAME
    • Show location of file or folder (if virtualenvwrapper-win is installed) whereis <NAME>

    Reloading

    • Reload terminal source ~/.bash_profile
    • Reload cmd SET PATH=%PATH%;C:\CmdShortcuts (unconfirmed)

    Running Scripts

    • Make sure Execution Policy is set appriately Set-ExecutionPolicy RemoteSigned
    • Check Execution Policy with Get-ExecutionPolicy
    • See How to allow scripts to run

    SVG

    CSS

    FlexBox

    Grid

    Tools

    SASS

    • Reference SASS
    • How to setup Sublime
    • Edit scss file and then Command+B to compile
    • Edit init.js file to use sass or css files; or if scripts are disabled edit individual import statements in html files

    JavaScript

    Node

    • Official Node.js website
    • npm init to create package.json
    • npm i XYZ or npm install XYZ to install XYZ into local "node_modules" folder
    • node app.js` or node app` to run app
    • npm rm XYZ to remove XYZ
    • npm uninstall XYZ to remove XYZ

    Markdown

    Cross references - see also Pandoc & Git Hooks.

    • Dillinger: For creating, editing and exporting markdown files in html.

    Web Development

    March 2020

    General Guides / Checklists / Roadmaps

    Tools / Resources

    Service Workers

    Intersection Observers

    Jokes

    • No Code: The best way to write secure and reliable applications. Write nothing; deploy nowhere.

    Search Engine Optimasation (SEO)

    Favicons

    Icons

    • Fontello Icon Fonts Generator
    • Icomoon SVG icons
    • HeroIcons high-quality SVG icons for UI development
    • Zondicons free premium SVG icons
    • CSS GG Minimalistic icon library Designed by code. Customizable & Retina-Ready icons — entirely built in CSS.

    Fonts

    Images

    Responsive Web Design

    Printing

    Social / Sharing / Structured Data

    Interesting Sites

    LaTeX

    October 2017

    • Texcount fix, Perl, Texcount.Perl - Comment out section on win stuff at top
    • Table Generator: For creating, editing tables in Latex, html, markdown, etc.
    • Latex Equation Editor: For creating, editing Latex equations.

    Databases

    March 2020

    CouchDB

    • find couchdb: localhost:5984
    • couchdb GUI: localhost:5984/_utils
    • edit config: nano /opt/couchdb/etc/local.ini
    • Bulk updates might need an increase in request body size due to error 413. add a line in nginx config file for couch domain: client_max_body_size 100M;
    • files to backup are in /usr/local/var/lib/couchdb
    • CouchDB Debian Buster
    • CouchDB Nginx conf
    • JSONBox.io free HTTP based JSON storage. See docs.

    VS Code

    October 2017

    Extensions

    Haskell

    October 2017

    NLTK

    October 2017

    WordNet

    • Reference WordNet Interface for NLTK
    • Import wordnet from nltk.corpus import wordnet as wn
    • Loop through lemmas for l in synset.lemmas():
    • Lemma name as string str(lemma.name())
    • Antonyms synset.lemmas()[0].antonyms()
    • Install NLTK 3.0.0b1 pip install -Iv https://pypi.python.org/packages/source/n/nltk/nltk-3.0.0b1.tar.gz#md5=f3f67fcda9bc76f57d91811a572c36e4

    Data

    • Reference NLTK Data
    • Install nltk data: (1) python
    • Install nltk data: (2) import nltk
    • Install nltk data: (3) nltk.download()
    • or nltk.download('stopwords') and nltk.download('wordnet')
    • add path of nltk_data folder to system path
    • or better yet add it to the local repo and code:
    • import nltk
    • nltk.data.path.append("PATH/TO/nltk_data")

    Python

    April 2020

    See also info on screen

    Install Python 3.8

    Python WSGI ('Whiskey') Server

    Switch the /usr/bin/python link to point to current python link

    • cd /usr/bin
    • rm -f python
    • ln -s /Library/Frameworks/Python.framework/Versions/Current/bin/python python

    Pip

    • Reference Pip
    • Upgrade pip pip install -U pip
    • Upgrade pip python -m pip install -U pip
    • Install NAME pip install NAME
    • Install NAME version 1.0.4 pip install NAME==1.0.4
    • Install specific version pip install -Iv Link-to-tar.gz
    • Uninstall NAME pip uninstall NAME
    • Show installed packages pip list
    • Show out-of-date packages pip list --outdated
    • Upgrade NAME pip install --upgrade NAME
    • To freeze local requirements pip freeze --local > requirements.txt
    • To freeze requirements pip freeze > requirements.txt
    • To install from requirements pip install -r requirements.txt

    Virtualenv

    • Python 3 reference Virtualenv
    • Old reference Virtualenv
    • Python 3: create a new venv python -m venv NAME
    • Old: Create a new venv virtualenv NAME
    • Activate NAME . NAME/bin/activate
    • Activate NAME NAME\scripts\activate
    • Deactivate deactivate

    Virtualenvwrapper

    • Reference Virtualenvwrapper-win
    • Reference Virtualenvwrapper
    • Make a new venv mkvirtualenv ENVNAME
    • List all virtualenvs workon or lsvirtualenv
    • Activate a virtualenv workon ENVNAME
    • Deactivate virtualenv deactivate
    • Remove virtualenv deactivate and then rmvirtualenv ENVNAME
    • Bind ENVNAME to project setprojectdir <project_path>
    • Bind ENVNAME to project setvirtualenvproject [virtualenv_path project_path]
    Virtualenvwrapper-win not finding virtualenv-script.py:
    • Edit C:\PythonXY\scripts\mkvirtualenv.bat with the following changes on lines 47, 48
    • Line 47 virtualenv.exe %*
    • Line 48 REM python.exe "%PYHOME%\Scripts\virtualenv-script.py" %ARGS%

    Paths

    • C:\Python27;C:\Python27\Scripts;
    • Set folder for virtualenvs export WORKON_HOME=$HOME/.virtualenvs
    • Set folder for virtualenv projects export PROJECT_HOME=$HOME/Desktop/PhD_Offline/Git_code
    • source /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh
    • PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
    • PYTHONPATH="/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/:${PYTHONPATH}"
    • export PATH

    Surface Pro 4

    October 2017

    • Get battery report: powercg /batteryreport

    Heroku

    • Dashboard Login
    • Install the toolbelt
    • Python Flask Guide
    • Login heroku login (needs authenticator code)
    • Git Push git push heroku master only in git bash !
    • make sure reqs.txt is called requirements.txt

    Acrobat Reader

    October 2017

    • Forum Help
    • Uncheck preference located under Edit > Preferences > Documents "Open Tool pane for each document"

    Images

    Category Filters


    Type:



    Location:



    Year:

    Cats

    Yuki & Aya and her kittens :)

    <3

    People

    Year: