2-13 12:15 <lahwran> how would one have an owned unknown-size non-resizeable array?
2-13 12:15 <reem> Box<[T]>
2-13 12:15 <lahwran> there's absolutely no way to have it on the stack?
2-13 12:15 <reem> Nope
2-13 12:15 <reem> There is no dynamic sizing on the stack right now
#!/usr/bin/env python | |
"""Edit a file in the host nvim instance.""" | |
import os | |
import sys | |
from neovim import attach | |
args = sys.argv[1:] | |
if not args: | |
print "Usage: {} <filename> ...".format(sys.argv[0]) |
All of these are "as long as not at huge expense to the others"; any would be bad on their own.
(in machine-learning-nerd terms, read these as a series of objective functions, and evaluate code based on these as something approximately like the sum of squared errors function. In non-machine-learning-nerd terms, one should try to minimize how much code breaks each of these rules individually. They are not priority sorted.)
-
Beautiful is better than ugly - while this is hopefully obvious, looking better is an acceptable thing to aim for.
-
Explicit is better than implicit - only delegate to implicit things that are sufficiently common to not be confusing.
-
Simple is better than complex - do make things implicit that will be obvious anyway.
tuningmind sent this in an irc pm to me (lahwran), formatted and categorized with tuningmind's permission. Comments in this section written by tuningmind.
- Your Brain At Work by David Rock
^ that one really influenced my thinking a lot
^ recommend starting with this one - Mindset by Carol Dweck
- So Good They Can't Ignore You: Why Skills Trump Passion in the Search for Meaningful Work by Cal Newport, one of my all time favorite bloggers
# to use: | |
# 1. put this file in ~/callstatement/callstatement.py | |
# 2. make a file ~/Library/Python/2.7/site-packages/derp.pth with this as the contents: | |
# "/Users/USER/callstatement/\nimport callstatement\n" | |
# 3. export PYTHONIOENCODING="callstatement_utf8" | |
# warning: EXTREMELY NASTY DO NOT USE IN PRODUCTION CODE | |
# WILL BREAK EVERYTHING I AM NOT RESPONSIBLE IF | |
# YOU'RE FOOLISH ENOUGH TO ACTUALLY TRY TO USE | |
# THIS |
encognifie | |
pego | |
undlont | |
chrong | |
husses | |
simulatic | |
humfree | |
sungressionon | |
eqloich | |
seasure |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in | |
all copies or substantial portions of the Software. |
# data source: | |
# http://www.census.gov/genealogy/www/data/1990surnames/dist.male.first | |
# http://www.census.gov/genealogy/www/data/1990surnames/dist.female.first | |
from collections import namedtuple | |
n = namedtuple("n", "freq, index") | |
m = namedtuple("m", "delta, mindex, findex, mfreq, ffreq") | |
def df1(f1, f2): | |
return abs(f1 - f2) |
""" | |
To use: | |
1. Install virtualenv and pip - probably best done via your package manager: | |
sudo apt-get install python-pip python-virtualenv | |
2. `virtualenv stupidaibot` | |
3. `source stupidaibot/bin/activate` | |
4. save this file somewhere (if you haven't already) |
This list was originally authored by a friend who has been learning programming for some time (tuningmind)
Note: Many books may be available from a nearby public library. Check there as well!
These two are about the best I've seen for starting from scratch:
- Head First Programming (book, for pay: amazon, python 3)