Roy Tang

Programmer, engineer, scientist, critic, gamer, dreamer, and kid-at-heart.

Blog Photos Links Archives About

All entries tagged devnotes.

You can subscribe to an RSS feed of this list.

Nov 2019

DevNotes: Python's yield


I’ve been using Python for well over 10 years, and I still don’t have an intuitive mastery of one of its keywords: yield. Everytime I see it in someone’s code I need to stop and mentally remind myself what it does. I figured I’d write a devnote to help improve my recall. Typically, yield is used in a function with a loop, like so: def some_func(lim): for i in range(0, lim): yield i yield means the function returns a “generator” that can be used as an iterable in a loop:

read more (172 words)

Posted by under post at / software development devnotes / Syndicated: / 1 0 / 172 words

Aug 2019

Devnotes: Python Pathlib


Ever since I started learning Python back in 2008ish, I’ve been using it as my primary scripting language for various tasks such as processing log files, organizing my own file system, processing stuff on this blog, and so on. A lot of it is basically moving files around. In the days of Python 2, that involved a lot of imports of different libraries like os, shutil and glob. It can become a bit messy with so many imports, and I often can’t remember which import I need for a particular case and end up having to search for the documentation (or stackoverflow, let’s not kid ourselves here).

read more (316 words)

Posted by under post at / software development devnotes python / Syndicated: / 0 / 316 words
Big news in online repositories this week is that Bitbucket is sunsetting support for Mercurial! This might be the death knell for Mercurial, although Git was already the super popular choice before. Back when I started using online source control for my personal coding projects I started out with Bitbucket over Github because they offered unlimited private repos and Mercurial (which I had already tried out before at work, so at first I preferred it over git).

read more (279 words)

Posted by under post at / software development tech life devnotes / Syndicated: / 0 / 279 words
I recently found myself doing a really small project as sort of a proof of concept/demo for a potential client. It often seems that it might be a waste of time to do something like this since you don’t know if the project will actually push through or maybe the client will want something else. To kind of hedge my bets a bit, I decided to take the opportunity to try out some new technologies so that no matter what I at least learned something from all of this.

read more (750 words)

Posted by under post at / devnotes software development / Syndicated: / 1 0 / 750 words
I decided to start doing small “devnotes” on developer stuff I’m doing so I can refer to them later (and also because I feel like I could use more technical content on this blog) Today is about PostgreSQL. I haven’t used it much beyond standard ANSI sql stuff. You won’t always have a graphical interface to access your database, sometimes you need to ssh to prod and query the database from the shell.

read more (317 words)

Posted by under post at / devnotes software development / Syndicated: / 0 / 317 words

Roy Tang is a:

roytang.net is a personal site, an E/N site, and kind of a commonplace book; I post about a random assortment of topics that interest me including software development, Magic the Gathering, pop culture, gaming, and tech life. This site is perpetually under renovation.