Learning Python Programming

Uncategorized
I give a number of talks on Python and other subjects. The two universal questions I get are: - how can I... learn Python? get better at Python? learn programming? - which web framework should I use? There's a number of resources for learning programming with Python. Here are my favorites: - Girl Develop It https://www.girldevelopit.com/ This (USA) national organization helps train women (and men) in learning web and software development. In the Los Angeles area they have classes nearly every weekend. My girlfriend took the "CSS" and "Javascript" classes and found them rewarding. As an experienced dev who wants teaching experience, the organization itself is pretty easy to get in to. You can be a TA (teacher assistant) or work up to being a Teacher.  You can be paid or…
Read More

Programs matter more on programmers, than the language

Uncategorized
A study in 2000 showed a very wide range of performance for different programmers, more so than the language used. C/C++ tended to be fastest, but not by much. C/C++ and Java had a wide range of variability -- a programmer's skill was more important here. With Perl, for some reason, skill didn't matter as much. Never mind the language, the programmer is what matters | Psychology of Programming
Read More

"find Perl TCP servers and clients"

Uncategorized
> netstat -Ainet -anp | egrep perl tcp        1      0 10.36.109.155:45720     10.36.109.155:8082      CLOSE_WAIT  19642/perl    Process ID 19642 is a Perl process connecting to local port 8082. Better: netstat -lnp --tcp | egrep -i perl "List all Perl servers listening to TCP ports".  The previous command would also give us clients and UDP -- the second command is shorter.
Read More

tech book recommendations

Uncategorized
Recently I was asked about Python books covering Object Oriented programming for someone coming from another language. Here are some resources: - I recommend subscribing to Safari Books Online. They have jillions of books and videos, including "Python Beyond The Basics - Object Oriented Programming" (high-ranked video). It's $40/month. If you're a professional Dev or DevOps, or trying to be, it's an easy investment. - the class section of "Modern Python Cookbook" (book) has tons of real-world Python idioms: designing classes with lots vs little processing, classes with __slots__, and advanced class design... Actually this book looks great I'm going to read it. - David Beazley's "Python Cookbook" is great, overflowing with real-world problems, solutions, and discussion. - in the Los Angeles region all the Lynda.com tech resources are freeee…
Read More

talk: Functional Programming and Django QuerySets

Uncategorized
thanks everyone for coming, for Media Temple for hosting, and for Esther for coordinating! I thought Justin's talk (his first!) on Swagger was fun and extremely useful. I hope everyone had a good time. Here are the slides and notes for "Functional Programming and Django QuerySets" (2016 edition) -- have fun! http://johntellsall.github.io/johntellsall.com/class/django-queryset3/_build/
Read More

Kafka on macOS

Uncategorized
Generally I run everything in Docker: it's less fiddly, and I can do a clean uninstall very easily. Alas Docker networking is different, and changes every few months as Docker makes things easier... by changing the networking. As of July 2018 here's the easiest way I've found to run Kafka on macOS: brew install kafka kafkacat zookeeper brew services start zookeeper brew services start kafka Once Kafka is up, list out the brokers: $ kafkacat -L -b localhost Metadata for all topics (from broker -1: localhost:9092/bootstrap):  1 brokers:   broker 0 at 192.168.0.133:9092  0 topics: Now let's go to the mysterious directory that has tons of good tools. Create a topic, then use "kafkacat" again to verify our new topic has been created: $ cd /usr/local/Cellar/kafka/*/libexec/bin ./kafka-topics.sh --create  --topic example-topic…
Read More

TIP: Git Grep searches your project really fast

Uncategorized
Searching inside a large project of source code can be a challenge In my codebase there's lots of "delete" methods, but only a few "_delete_" methods. If I search for "delete", I'll get zillions of false positives. By using the super-fast Git Grep and also "W" for matching non-word-characters, I can find all references of the target string "_delete_": $ git grep 'W_delete_W' app/looks_services.py:390:        order._delete_() app/models.py:2634:    def _delete_(self, **kwargs):
Read More