Monday, November 2, 2015

The Case for Net Damage Jinteki at Worlds 2015

First of what will probably be a slew of Netrunner posts. I think about the game way too much & don't have enough people to blabber to.


The Personal Evolution "death by a thousands cuts" deck was the first Netrunner archetype I ever really fell in love with. Starting with core set & the first two big boxes, I stuffed Mushin No Shin, Gila Hands Arcology, House of Knives, Archer, & a bunch of traps in a deck & was immediately happy with the results. The deck fell out of my favor after the release of Order & Chaos; Shapers were using Feedback Filter, I've Had Worse was a great counter packed 3x in every Anarch deck, & the Eater-Keyhole shenanigans of the time were also a tough matchup. But I'm always looking for an opportunity for the resurgence of Jinteki net damage decks in the meta, from new archetypes like Chronos Protocol control to pieces that bolster Personal Evolution such as Lockdown & Back Channels. Just as Minh's Personal Evolution caught the meta off-guard at last year's Worlds & placed second, I think we're primed for another left-field Jinteki deck (not glacier or rush RP!).

General Metamovements

Disclaimer: only-partially-informed opinions of a tier two player. I'm hardly the best person to be making these calls, but damn if I don't have some ideas.

The top-tier corp decks at the moment are: glacier (with Caprice Nisei) or fast advance Engineering the Future with Team Sponsorship, NEH fastrobiotics, & NBN kill decks (whether a traditional Butchershop build out of NEH or newer 24/7 kill decks out of Haarpsichord Studios & other new IDs). In response, runner decks typically need to do a few things: pack meat damage protection (typically Plascrete Carapace), prepare to be tagged possibly including a tag-me mode, & go fast. None of these tactics are effective against slow, grindy net damage decks.

First off, drop the 1 or 2x Scorched Earth in your Personal Evolution lists. It will only land if the runner has Plascrete installed now—but if you remove the meat damage, you'll still see runners waste a click & 3 credits installing Plascrete. Fast decks, whether aggressive-running Criminals or Wyld-pancake Anarchs, have to abandon their game plan against loads of damage thinning out their deck.

Finally, Faust has become an enormously popular breaker; it's in nearly every Anarch list & creeping into some Shaper & Criminal (mostly Gabe & Leela) lists. But it's terrible against net damage, only racing the corp towards their win condition.

What's bad about the meta right now for Jinteki? Film Critic & recursion. Runners are packing heaps of recursion & the stock of viruses like Parasite & Imp has never been higher. All of these can really take the teeth out of traditional Jinteki lists; Film Critic steals your 2-of Future Perfects in Cambridge Personal Evolution with ease & negates the upside of Fetal AI. Imp can take out Neural EMP or the aforementioned agendas. Knocking breakers from the runner's Grip is far less powerful if they can snatch them back from the Heap in real-time with Clone Chip.

The Order & Chaos counters mentioned in my opening are still around, in particular IHW. But Keyhole decks have fallen out of favor a bit. I'd expect some very good MaxX or Valencia Keyhole decks at Worlds, but I'm still not convinced the archetype is strong enough to worry about.

Matchups

I see three dominant runners in the meta: Prepaid Kate, Noise, & circa-2013 Andromeda lists. The Andromeda choice is definitely conjecture; I expect to see far more Andromeda at Worlds than we have seen over the year, simply as a reaction to how strong NEH fast advance is. People perceive Andysucker to have a strong fast advance matchup, despite the lack of Clot, & will probably turn to her, but not in the Stealth Andy versions that were developed to beat glacier Replicating Perfection.

Andromeda

I've always felt that net damage decks have a good matchup against aggressive, fast-paced criminals. Criminals like to run & are geared to prevent credit taxation with tools like Desperado, Security Testing, Bank Job, & (splashed) Datasucker. But they still don't have great in-faction card draw. Fisk Investment Seminar & Drug Dealer changed this a bit, but ultimately Criminals still fall behind Shaper's draw events & Anarch's many options here. FIS & Drug Dealer are also still unproven; I think top tier players may hesitate before including cards with such obvious downsides & stick to more traditional Andromeda lists. The decks which these (decent) cards excel in are tier three decks (Laramy Fisk mill/hand bloat, Ian Stirling connections control).

To mention it again, Minh's second place at last year's Worlds largely demonstrates how great the Andromeda matchup is. I recall that one of his only Corp losses in the Swiss was to Spags' Prepaid Kate, while the lack of recursion of most Andromeda lists was simply no match for the amount of damage Personal Evolution threatens. This year, I'd expect every Andromeda list (perhaps every deck list, actually) to have at least one Clone Chip. Zero recursion simply isn't a viable choice anymore with the amount of program trashing available to Corps.

All this said, Account Siphon remains one of the best counters to Jinteki's traps. Controlling the Corp's credits is often the only way to safely check remote servers. Packing a Crisium Grid—also helpful in the Keyhole matchup—might be called for.

Kate

Kate is the toughest matchup for any Corp right now & Jinteki is no exception. The reason why is a bit different—Kate's typical win condition of multi-access R&D lock isn't viable against traps. Instead, it's the inclusion of Levy AR Lab access & heaps of recursion (not only 3x Clone Chip, but sometimes Scavenge as well) that make Kate difficult. Still, there are ways in which net damage takes Kate out of her comfort zone & negates her strongest attributes. The very strong economy of Prepaid Kate matters much less when cards are the point of taxation. Clot is a wasted card slot. Because net damage has fallen out of favor, almost every Kate list cut Deus Ex & Feedback Filter. Remember that those cards were in there originally to solve a touch matchup! Traps are problematic & Kate's propensity to play cards for economy (as opposed to persistent resource-based economy like Kati Jones & Security Testing) & lack of spare influence for I've Had Worse necessitates very careful play on the runner's side.

Noise

Noise is not necessarily an easy matchup, but one which Jinteki has the perfect tech for in Shock!, Crick, & Cerebral Static. Noise is the biggest pain against the traditional Personal Evolution shell game, since he can mill rapidly once set up & requires very few breakers to put up huge amounts of pressure. But Industrial Genomics ability (& that the lists almost always include Shock! & Crick) is an incredible hard counter while Chronos Protocol has a decent matchup as well. I think the only adjustments that need to be made for the Noise-heavy meta are packing a Cyberdex Virus Suite or 2 & maybe swapping one Snare! for a Shock!. Noise won't have Film Critic & some lists have even cut I've Had Worse in an attempt to cut down on events (to benefit Street Peddler). They tend to burn through their deck at an incredible rate, with Peddler & Wyldside leading the way, which means the long game isn't necessarily to Noise's advantage.

Exit Strategy

Looking at the Stimhack Tournmanent-winning decklists, there haven't been a lot of Jinteki lists lately. The most noticeable victory of late was Daryl Russell taking down the Australian nationals with an interesting (no House of Knives! no Hedge Fund! 1x Profiteering! 1x Chairman Hiro!) Personal Evolution list. That doesn't necessarily mean Jinteki is poorly positioned, just that they're not the focal point of the meta. I wouldn't be pretty surprised if more than half the Corp decks at Worlds are NBN. With all that fast advance and tagging, some Philotic Entanglement (with 24/7 News Cycle?!?) might make an impact.

Monday, November 24, 2014

A *NIX Use Case

Gist of this post with nicer formatting: https://gist.github.com/phette23/a71248765c0f0cfeddd7


Almost immediately after declaring a hiatus seems like a great time for a blog post.
Inspired by nina de jesus and Ruth Tillman's libtech level up project, here's something on the value of command-line text processing. Some of these common UNIX tools that have been around since practically the 1980s are great for the sort of data wrangling that many librarians find themselves doing, whether their responsibilities lie with systems, the web, metadata, or other areas. But the command prompt has a learning curve and if you already use text editor tools to accomplish some tasks, it might be tough to see why you should invest in learning. Here's one case I've found.
Scenario: our digital repository needs to maintain several vocabularies of faculty who teach in different departments. That information is, of course, within a siloed vendor product that has no viable APIs. I'm only able to export CSVs that looks like this:
"Namerer, Name","username" "Othernamerer, Othername", "anotherusername"
But to import them into our repository I need to clean up the data a little and put it into a slightly different format:
"Namerer, Name","facultyID","username" "Othernamerer, Othername","facultyID","anotherusername"
This single-line shell script is all I need:
#!/usr/bin/env bash

cat $1 | sort | uniq | sed -e '/"STANDBY",""/d' -e 's|, Staff"|"|' -e 's|, "|"|' -e 's|","|","facultyID","|'
Let's walk through the script. To make it, I put the above text in a file, named it something like "fac-csv.sh", and made it executable by running chmod +x fac-csv.sh. I won't go into permssions but chmod +x, and the paragraph below, aren't even strictly necessary, since one can type bash fac-csv.sh to run the script anyways.
#!/usr/bin/env bash tells the operating system what program to execute the script with. A lot of scripts list a path direct to the program, e.g. #!/usr/bin/python (for a python script) or #!/bin/sh (for a shell script). Using #!/usr/bin/env is just a bit more portable across systems; the env command looks in the *env*ironment for a given program, searching several possible locations, so if someone on a different system (one where the shell is in, say, /usr/bin/local/bash) executes the script it'll still work.
cat $1 prints out the full text file I want to operate on (a CSV, in this case) so I can start piping it through the processing steps. On the command line, I run this script like fac-csv.sh filename.csv and filename.csv becomes $1 (the first positional parameter) inside the script.
The pipes ("|") separating each command chain them together, making the input of one command the output of the last. This is perhaps the most powerful part of UNIX since it means almost arbitrarily complex operations can be composed of smaller ones.
sort takes the CSV, which might be in any order, and sorts the lines alphabetically.
uniq takes duplicate adjacent lines and removes them, thus only *uniq*ue lines are left. This step wouldn't work without the sort prior.
sed stands for stream editor, it takes the text passed to it and performs a series of edits, each edit is specified with an -e flag. We've already deduplicated the file, sed cleans it up. sed has a lot of edit types but I'm only using two; delete line and substitute.
'/"STANDBY",""/d' is a delete line command, which looks like /pattern/d. So here I'm saying "delete all lines that match the pattern "STANDBY","" since "STANDBY" is an artifact of our data system and not a faculty name we need to be recording.
The substitute commands look like: 1) the letter "s", 2) a delimiter (I've used "|" but other common choices include colons or forward slashes, in general you just want a separator that won't appear in your pattern since that complicates things), 3) a pattern to substitute, and 4) want to substitute for the pattern.
's|, Staff"|"|' finds , Staff" and deletes the comma-space-Staff part (note the quotation mark is retained).
's|, "|"|' finds , " and deletes the comma-space, leaving the quotation mark again. This and the step above clean up entries like "Sname, Gname, Staff","sgname, " => "Sname, Gname","sgname"
's|","|","facultyID","|' adds in a second "facultyID" value in each CSV row, which our repository needs for reasons.
In the end I've: deduplicated the export, deleted useless lines, and cleaned up messy lines. I find occaisions to run this script or a slight modification of it weekly. Doing the same steps in a text editor would be far more time-consuming and error prone (since I might forget one, not do them in right order, etc.).
Maybe this came out Greek, if so I apologize. It took me a long time to learn about all these steps, in particular sed has caused me much trouble. But now I'm able to write these quick, one-line scripts that automate what would've been several steps in a text editor.

Saturday, November 22, 2014

Hit the Pause Button

Just an FYI that this blog is going to go dormant for a while as I'm trying to be better about focusing my responsibilities. I'm a little overwhelmed at the moment, as the last post may have indicated, and cutting back my personal blog makes sense given what else I'm doing.

I'll still be around the interwebs though. Twitter, Tech Connect , and GitHub are good places to find me.

Sunday, September 21, 2014

Better to Burn Out than to Fade Away

Extra-professional obligations of mine:

  • I edit a column for the RUSQ journal, "Accidental Technologist". I'm proud of the columns I've published, but I've only written a couple. I identify topics, authors, read drafts, & provide feedback 4 times a year.
  • I write (quasi-)monthly blog posts for ACRL Tech Connect. Again, I'm proud of my posts. I also provide feedback for my excellent co-authors who mostly tolerate my nagging.
  • I'm on the LITA Forum Coordinating Committee. It's in Albuquerque this year & it's going to be great! Seriously. I'm excited about the keynotes & Forum has proven to be a great event to meet like-minded library technology folks.
  • I'm on the Code4Lib 2015 Keynotes Committee. We're still accepting nominations for keynote speakers!
  • I want to organize more Code4Lib NorCal meetups, which is the most neglected item on this list. If you're a C4L NorCal person, I promise you'll be seeing messages from me soon.
  • I'm juggling dozens of open source projects on GitHub, most of which suffer from benign neglect & could use some code & love. I just cannot help myself from jumping into new projects even when I clearly cannot commit enough. WikipeDPLA is my focal point at the moment but I've created about a half-dozen repos since publishing that & maybe I should just do one project at once.
To reiterate: these are all outside of my librarian position & while I do spend the occasional hour or two on them at work, for the most part I complete tasks outside of my 9-to-5. I'm can't get tenure, I just can't say "no". & I'm undoubtedly privileged; these are extra-professional commitments that aid my status in the profession, whereas others have extra-professional commitments oriented elsewhere. They can't put them in tenure dossiers, as unfair as that is.

But how? How can I continue? I find value in all of these bullet points, so how do I decide to say "no" to any of them? I know others are faced with similar struggles & I'm asking for advice. How do you do it all? There are so many people in libraryland who seem in a similar situation, I could name names but I'd leave someone out. I don't know how they do it, so much in such finite time periods.




Let's all take a breather. No one work for the next week. Let us catch up instead.

Sunday, August 31, 2014

Switching to Fish Shell

I started using Fish as my primary shell a few months ago. While I like Bash, the promise of a more modern shell intrigued me. I spend entirely too much time on the command line. My affinity for Bash has less to do with its features as a language or shell than with the UNIX philosophy of many small programs which play nicely together.

Fish jokingly bills itself as "a command line shell for the 90s". It isn't revolutionizing what a shell does, rather it starts from a strong design document to provide a better experience. If you're unclear on the difference between a shell, terminal emulator, Bash, & command line interface, try Bryan J. Brown's description on his blog.

What's Good with Fish

Why would I switch to Fish? Immediately after trying it out, a few advantages were apparent. I didn't even have to consult help documentation.

Discovery is where Fish shines. I discovered new, useful programs on Mac OS simply by tabing through available completions. Fish's completion is incredibly smart & detailed; it knows files, commands, variables, & flags. Bash does this too, but Fish is far superior & comes with a huge collection of completions for common programs. It's main advantage is that it'll show options, so the completion is exploratory, whereas in other shells the completion is a just convenience for people who already know what they're looking for. Fish shows the definition of a particular flag, function, or program—as well as the current value of variables—instead of merely showing that they exist.

Many of the tools I use have dozens of flags. I love them, but I can't memorize each flag for every one. Take Ack for example. I usually just add a flag for the programming language I'm searching (e.g. --js) & the string I'm looking for. But the other day I wanted to see the number of matches in each of the large list of files I was searching. Now, I know ack can do this, but I don't know what flag(s) I need. Typically, I'd need to open up ack's man page, search through it, close it, & then run the command. With Fish, I typed a couple dashes, then tab to see all its completions, spotted --count right away, & ran the command without leaving my current context.

Another nice advantage of Fish's completion; it learns from previously typed commands. So even if there's no custom-built completions for a particular program, Fish learns how you use it & develops completions over time.

Fish also has colors! Nice ones! They pop more than I'm used to. What's more, the shell provides convenient abstractions for changing colors. The set_color command lets you use natural language like "red" rather than the crazy looking echo \033[1;33m (yes, this is actually how you change colors in Bash). set_color is handy, but Fish also has added features like prompt_pwd, which is great for shortening the working directory for inclusion in a prompt.

If you don't want to spend hours configuring a custom prompt, Fish comes with a couple dozen nice ones built-in. You can run **fish_config** to open a configuration interface in a web browser which gives you copy-pastable prompt code. This config feature makes it super quick to get started without a ton of research & looking up replacement tokens. Every shell should have such a feature.

Scripting in Fish is far more straightforward, as the shell's language is minimal & clean. It looks Ruby-esque & favors natural language everywhere over strange, punctuated incantations. Because it's a smaller & more rationale language, learning the basics of Fish scripting is quicker than with other shells.

Fish also has wonderful error messages, perhaps the best of any programming language I've dealt with. That may not seem valuable but it helps immensely with learning the shell, especially when transitioning from Bash. Fish will not only point to the erroneous character, but will note common mistakes & try to guess what you missed. For instance, in Bash a subshell is launched with $(…) whereas Fish uses (); the $ in Fish means one & only one thing, that a variable is being used. So when you use a $ in the wrong context, it says so. An example:

> echo $(whoami)
fish: Did you mean (COMMAND)? In fish, the '$' character is only used for accessing variables. To learn more about command substitution in fish, type 'help expand-command-substitution'.
echo $(whoami)
     ^

Fish is half written in its own scripting language, so it's easy to see how some features work & extend them. I noticed that there weren't any completions for Node & NPM, so I added them myself by aping existing ones. Exposing so much of the shell's core functionality makes it customizable & approachable.

Annoyances

In a way, Fish is the perfect shell for someone just getting starting at the command line because of its brilliant completions, easy (no code!) configurability, & sane scripting language. Unfortunately, for me, it's not quite perfect because I'm already used to Bash's quirky parts & rely on numerous packages, settings, & scripts that assume a more common (read: Bash) environment.

Example: z. Z is a vital utility for me; it allows me to quickly jump between my current location & places I've been previously. Z's API is simple; "z [string]" where "string" somewhere matches the place you want to go. So if I'm destroying system settings in "/Library/Application Support" & then need to go to my Doge Decimal project, I type "z doge" & am transported to "/Users/phette23/code/dogedc". But Z is a shell script; it's written in Bash. Luckily I found a port for Fish, but for a while I was trying really hacky solutions (including proxying Z through Bash every time I ran it). Other tools, like nvm, pose this same problem.

To be fair; various incompatibilities aren't Fish's fault. They can only be solved by popularity, so when someone writes a script they think "I need this to work in all the popular shells: Bash, Zsh, & Fish". Sublime Text proved to be the biggest compatibility pain. Sublime uses os.environ['PATH'] to find the user's path & this path is used in all kinds of plug-ins. I use several linting plugins, such as SublimeLinter-JSHint, which rely on JSHint being in your path. But Fish separates path locations with a space & not a colon; Sublime consequently misreads the whole PATH string, breaking almost every plugin I've installed.

I found a way around…and it was to default back to Bash. I ran chsh -s /usr/local/bin/bash to switch my default shell back to Bash, so when Sublime runs os.environ['PATH'] it comes back with a predictable, colon-separated path. But then, because I actually want to use Fish, I had to edit all my terminal emulator profiles (I use iTerm2) such that, instead of running as login shells that would default to Bash, they execute the /usr/local/bin/fish command. A surmountable problem, but it took me weeks to identify what was wrong & how to fix it.

In general, Fish users will run into more compatibility problems with all sorts of tools that assume a Bash or strict POSIX environment. As I said, much of this isn't Fish's fault, but it is worth noting that the shell doesn't strive for 100% POSIX compliance. In a way, this is necessary; Fish conflicts with POSIX only where a substantial benefit in usability is at stake. That's great, but it also causes headaches that can't be easily fixed since backwards compatibility is broken.

While Fish breaks with some POSIX traditions, in other places it doesn't go far enough. It relies heavily on double-underscored internal functions; anywhere there's a naming convention like this, there are scoping problems. It's not clear to me why all shell scripting languages lack true objects; everything ends up in the global scope. While Fish has nice arrays, certainly better than Bash, it still lacks data structures that aid in organization. A hash/dict/associative array type is badly needed. I think this might be a place where Windows PowerShell improves upon POSIX shells, though I haven't used PS enough to truly know.

There are also things I genuinely like about Bash. I like its || & && logical operators, which behave slightly different from the natural language or & and of Fish. I like some of Bash's crazy-looking expansions, like !! (references the last command), which are weird & hard to remember but handy at times.

My main struggles with Fish revolve around output redirection, which it seems to be more stringent about. I still haven't found a nice way to quietly test if a command exists (which occurs all throughout my dotfiles, since I try not to assume a particular software setup). In Bash, this was simple with command -v $PROGRAM. But command is a shell built-in, not an external program, & so it differs in Fish. Fish doesn't replicate the "v" flag, it only uses "command" as a way to bypass aliases. I've worked around it with a two-line solution: PROGRAM --version >/dev/null; if test $status…. This runs the program, silencing all output, & then checks the exit status (which would be 0, signifying an error, if the command didn't exist). It works, but it's slower & more verbose.

There's more than you ever wanted to know about my transition to Fish shell. I'm guessing that switching shells isn't something people consider very often. Those who use the command line rarely probably don't think it's worth the trouble (or don't even know/care that it's possible), while those who rely on the command line necessarily build up lots of dependence on a specific environment. Despite all that, I'd strongly recommend Fish to anyone and I thoroughly enjoy using it every day. The pains are, oddly enough, lesser for inexperienced shell users, while the benefits are greater thanks largely to how sane and helpful Fish is designed to be.

Thursday, August 7, 2014

How Not To Do User Testing

  • Perform tests only after a final product has already been rolled out
  • Use your tests to reify assumptions already built into the product
  • Test once and then never again because hey, you’re finished
  • Refuse to accept the validity of any given test until a statistically representative sample of your user populace has been obtained (it’ll never happen)
  • Never change your testing tasks and procedures, even the ones that prove to be deeply flawed, poorly worded, uninformative
  • Ask users for their opinions rather than observing what they actually do. “Do you like this background gradient?” is a particularly apt question.
  • Conversely, test only tasks you think are important without gauging what users think is important
  • Collect personal information and video recordings during tests with no plans for how to secure the data or when to delete it
  • Simply refuse to do user testing

Monday, April 21, 2014

Looping Over Regular Expressions in JavaScript

Much as JavaScript has literal forms for strings & numbers, it also has a literal Regular Expression (henceforth regex) form. So you can wrap characters in single or double quotes to make a string literal, & you can wrap characters in forward slashes ("/") to make a regex literal.

So regexes are literals in JavaScript…except JavaScript is sort of a broken language with regard to literals. The typeof operator is nearly useless.
typeof /foo/
// returns "object"…damn you, typeof
/foo/ instanceof RegExp
// true! hurrah for instanceof
Because regexes have a literal form of sorts, you can do nice things with them like put them in an array & loop over the array:
var tests = [/Foo/i, /BAR/, /baz/i],
    str = 'This is a sentence. Foo, says the sentence.';

// check if each regex has a match in sentence
tests.forEach(function(re) {
    if (re.test(str)) {
        console.log(re + ' is a match!');
    }
});
This is the approach I use in my Wordpress Spam Clicker bookmarklet: I have an array of regexes matching known spammer patterns which I loop over, testing each comment against them.

BUT what if you want to slightly modify each regex in an array? For instance, what if you want to loop over regexes but test for strings with a space at the beginning the match? You can save some typing & potentially (depending on how big the array of regexes is) a lot of bytes by storing a truncated version of the regexes & then modifying them later. Except it doesn't work:
var tests = [/Foo/i, /BAR/, /baz/i],
    str = 'This is a sentence. Foo, says the sentence.';

// check if each regex has a match in sentence
tests.forEach(function(re) {
    if ((/\s/ + re).test(str)) {
        console.log(re + ' is a match!');
    }
});
I'm trying to take each regex & prepend the special character for a space ("\s"), so /foo/i should become /\sfoo/i. But the addition operator doesn't work here, JavaScript doesn't know how to add 2 regular expressions, instead it casts them to a string (typeof (/\s/ + /foo/i) === 'string'). What do?

Well, JavaScript also has constructor functions for all its literals: String(), Number(), & RegExp(). Generally, you do not use these. I repeat, if you're writing code like var count = new Number(0) you can stop it, stop it right now. One reason is that typeof count will return "object" if count was created with a constructor. But also it's just an unnecessary amount of typing.

BUT it turns out that compiling regexes from strings can be done using the RegExp constructor. So to achieve my earlier goal I can write:
var tests = ['Foo', 'BAR', 'baz'],
    str = 'This is a sentence. Foo, says the sentence.';

// check if each regex has a match in sentence
tests.forEach(function(re) {
    if (RegExp('\\s' + re).test(str)) {
        console.log(re + ' is a match!');
    }
});
Instead of storing regexes which are later cast to strings, I can store strings & then essentially cast them to regexes using the RegExp constructor. I have to escape the backslash to ensure \s makes it into the regex, but it works. The RegExp constructor takes the regex flags as a second argument too, so I could write RegExp('\\s' + re, 'i') to make all my regexes case insensitive. This, too, could be very handy & save a lot of bytes/typing.

Sunday, March 30, 2014

Git Tools

On a recent commute I mulled over the various tools I use to make git, the popular distributed version control software, easier to use and more powerful. Here's a round up of what I use, or find interesting.

gitconfig - anything you do with the git config command can also be placed in a .gitconfig runtime configuration file in your home directory. My main use case is aliases that save me a ton of typing. Simple shortcuts like "c = commit -m" are an obvious starting point. But git also has several commands with multiple, handy flags; for instance, my "sweet-looking but concise logs" alias is "l = log --pretty=oneline -n 20 --graph --abbrev-commit". I do not want to memorize and type that monster, not once, not ever. My entire .gitconfig can be found in my dotfiles repo.

gitsh - an interactive shell for git. If you're running a bunch of git commands in a row, enter gitsh & run them without typing "git" over & over. This can be very useful as git commands tend to come in waves; "oh I need to commit these final changes, rebase, checkout master, & then merge this feature branch" is a common workflow, for example. Gitsh also displays repository information—the current branch & working directory status—in its prompt.

hub - a command-line tool for interacting with GitHub. I don't use this because it wouldn't gain me a whole lot of efficiency but I bet hub would be invaluable if you're an active GitHub user.

js-git - an interesting project to implement git in client-side JavaScript with support for various browser storage APIs. Could feasibly bring git into environments like Chromebooks, where one doesn't have command-line access but could still benefit from version control.

Sublime Text Packages

I use Sublime Text as my main editor & these two packages are great in terms of git integration.

Git - this package is essential if you're working in Sublime Text. It gives access to all the common git commands—add, commit, diff, log—right in the command palette. You never have to leave your editor to access version control, you can stay in a single context & do everything you need. It's a huge boon to productivity. I use "Quick Commit" (adds and commits the file I'm currently viewing) all the time. I bet roughly a third of my commits are through that single convenience method.

GitGutter - highlights lines that have been changed, added, or deleted in the file you're viewing with coloring in the gutter. You can select from a few different styles of coloring. This is a small nicety most of the time but can be of great assistance when returning to a project that has a dirty working directory or stashed changes which you've forgotten.

Thursday, March 20, 2014

Start-Up Thinking Is Inappropriate for Libraries

tl;dr — if you believe your institution is a social necessity, start-up thinking is a terrible approach.

A recent conversation with a friend who has worked in the start-up space brought up Brian Mathew's "Think Like a Start-Up" white paper and some unresolved issues I have with it, never publicly articulated. See also: The Marketing Unproblem of Libraries.

#Fail


Most start-ups fail. Start-ups are praised for their agility, their ability to solve problems, but not for their longevity. If you believe in the worth of libraries as institutions, I'm guessing you don't want 75% of them to go under. It's unfathomably, eye-rollingly ironic that Mathews starts his white paper with doomsaying about the sustainability of academic libraries and then offers transient organizations as a model for survival. I can't even.

Trying to flip this fact later in the white paper does little to assuage my concerns. Noting the failure-prone nature of start-ups is not simply some snarky observation; it speaks to irreconcilable differences between how start-ups are run & how are libraries should be run. If you want your library to be around next year, next decade, next century, you probably don't want to emphasize risk-taking. Long-term thinking might be more suitable. You probably don't want to be a technological solutionist. Heck, you probably don't want to rely on the assumption that you only need to serve a population with access to certain technologies. Making an iPhone app is not enough. Making any app is not enough. Being a community-driven organization just might be enough.

It's also worth mentioning start-up culture has its own atrocities. It's hostile to women.* It's hostile to people of color. They're just generally not the type of organization socially conscious people probably want to work for, not that there aren't exceptions to this generality. I find it intolerable to valorize start-up culture while its downsides go unmentioned.

On Choosing Appropriate Proxies


I envision a rejoinder that libraries should praise & emulate the agility & innovativeness of start-ups, focusing on those attributes rather than their ephemerality. Leaving aside the fact that this straw-person argument is basically "but if you only look at the good things start-ups are good," it hints that start-ups are a poor proxy for what we actually want to talk about. I despise poor proxies. They muddle the debate & obscure the underlying issues. To use my favorite example: when we use age as a proxy for technical savvy, we not only discriminate against older folks but overestimate the abilities of the young. So let's discuss "libraries should be agile & innovative," not "libraries should think like start-ups."

But that's a lame tag-line right? And tag-lines are important. It's catchy, "Think like a Start-Up." But if it's so misleading as to be positively counterproductive, it should be ditched.

Exeunt


Finally, there's perhaps a tension in that start-ups are capitalist institutions par excellence & modern libraries** typically follow a more socialist, resource-sharing approach. But that's too much to go into here & I haven't thought about it enough.

In general, there are virtually no similarities between what libraries should be(come) & what start-ups are. Mic drop.

Notes


* There are numerous examples or articles I could have linked to here but Ashe Dryden's is particularly apt. If you think this statement is contestable, leave a comment & I can cite additional instances of hostility.

** Obviously "social libraries" like Benjamin Franklin's Library Company of Philadelphia (unnecessary emphasis mine), where only subscribed members could access the collection, aren't following a very socialist model. These are less common in America today than tax-funded public libraries, for instance.

Friday, January 31, 2014

Open Letter to Middle States Commission on Higher Education

Middle States, one of the major higher education accrediting bodies, is seeking feedback on a new set of Characteristics for Excellence [pdf] in Higher Education. They have a survey which is open for comment but only until the end of today (1/31/14) so I encourage everyone to read the draft and submit feedback. For reference, it may help to read the previous Characteristics of Excellence though they're a lot longer and more convoluted, IMHO.

tl;dr

Accrediting standards for libraries should be more rigorous, certainly not entirely absent.
Also, stop making assumptions about why students attend higher education institutions.

Below are the survey questions and my responses to them.


5. Provide any general comments on the draft of the Characteristics of Excellence (MSCHE accreditation standards):

There's a glaring lack of consideration for libraries, information literacy, and library services in the draft. Specific weaknesses will be addressed in the answers below.
I do want to say that I appreciate the authors' focus on brevity. Whatever my complaints below, this draft is far easier to read, understand, and reason about. This is not only due to its conciseness but also due to the reduced redundancies: no longer must one constantly cross-reference between standards when investigating a single topic, such as assessment of student learning outcomes. It is commendable that this was clearly a focus of the authors.

There is a reason that every higher education institution in America has a library in some form or another, but if institutions were held to these draft standards a library would be an unnecessary expense. Hopefully in my following answers it will become clear why higher education institutions have always had and continue to need libraries.

6. Provide specific comments about the ability of the revised accreditation standards to honor the diversity of institutional mission:


This passage from Standard IV makes assumptions about the reasons why students attend institutions: "the successful achievement of students’ educational goals including degree completion, transfer to other institutions, and post-completion placement". While those are only examples, they reduce education entirely to credentialing (degrees) and job placement. This neglects civic duties like preparing students to be informed, critical, and engaged citizens but also many other educational missions (lifelong learning, job promotion, understanding others, bettering one's self, curiosity, entertainment even). Really, it should either read "the successful achievement of students’ educational goals" with no examples that make damaging assumptions about why students attend the institutions that they do or encompass a far broader range of educational missions. Isn't it enough that institutions support students' goals, not what they think students' goals should be?

7. Provide specific comments regarding the ability of the revised accreditation standards to measure and demonstrate academic rigor and institutional quality:


Standard III #5 which outlines a general education program does not include information literacy, which was covered in the past standards. I would hardly call education which doesn't include information literacy rigorous or quality. While the draft's authors perhaps think that critical analysis and technological competency encompass information literacy, the discipline exceeds those two in places. For instance, critical reasoning does not cover efficiently accessing information, incorporating it into one's knowledge base, employing it to accomplish a specific purpose, or understanding its surrounding ethical/legal/technical issues in the same way that, say, the Association of College and Research Libraries' information literacy standards do. If anything, information literacy is a prerequisite for any critical analysis and more worthy of inclusion. It would be difficult to critically analyze sources when staying within the prescribed arena of assigned readings and one's own filter bubble online, for instance, yet the draft standards do not assure that students will have the means of identifying, seeking, and finding information outside of those areas. Similarly, technological competence doesn't extend to retrieving documents from information systems or ethical inquiry into the innate bias of different technologies and how that bias shapes the availability of information. To mention filter bubbles again, one can be perfectly "competent" at Google searching without realizing that it serves different results to different users depending on a variety of factors such as geographic location, gender, and the web browser being used.

Libraries also provide access to scholarly resources. With no institutional obligation to provide a library to its students, the quality of information available to students cannot be validated. Even if instructors were excellent and the student experience sublime, the scholarly materials available would be lacking. While an increasing amount of academic material is available freely on the web, the vast majority of scholarly literature is still locked in subscription databases. Furthermore, academic information on the web is scattered, difficult to find, and hidden amongst sources of more dubious quality. Couple that with the fact that you have not required that students be information literate and there is simply no hope that they will learn to read and use high-quality information, an effect that in turn reduces institutional quality. Finally, librarians are trained and strive to provide information from multiple paradigms. Without them, academia becomes an exercise in confirmation bias; there's no assurance that students or even faculty will seek out, or have available to them, alternate points of views.

Probably for the reasons outlined above, many other major higher education associations recognize information literacy as a key competency, e.g.:
AACU "LEAP" Essential Learning Outcomes: http://www.aacu.org/leap/documents/EssentialOutcomes_Chart.pdf
New England Association of Schools and Colleges Commission on Institutions of Higher Education, Standard 4 "The Academic Program"

8. Please provide specific comments related to the ability of the revised accreditation standards to measure the quality of the student experience - both within and outside of the classroom:

Standard IV #6 mentions review of student support services "designed, delivered, or assessed by third-party providers" but does not apply the same to in-house services. Apparently only outsourced services need to be of sufficient quality? Or is the implication that support services should not be developed locally?

Further, libraries are essential to student experience and go completely unmentioned in the draft. Libraries provide space for study, whether in collaborative groups or in quiet isolation, as well as territories for intellectual exploration. These territories are increasingly digital; do not picture simply a student roaming tall shelves filled with volumes, but also browsing interactive digital archives that serve both to sustain cultural memory and stimulate curiosity. What's more, many libraries are engaged in creative endeavors that involve facilitating student production of various artifacts, whether those be videos, podcasts, publications both print and online, or artifacts produced by three-dimensional printers.

It is not merely that libraries go mentioned which is disconcerting, but that Middle States has never sufficiently assessed libraries. I am currently in the middle of a self-study and am personally disappointed at how meek the library requirements are. The standards seem to ask "Do you have a library? If so, check yes." They do not ask that library services be responsive to student needs and assessed for their efficacy. Holding libraries to the very low standard of mere existence damages both the profession of librarianship and higher education at large. If anything, rather than excising all mention of libraries from the Characteristics, your organization should seek more substantive demonstrations of value from libraries.

9. Please provide specific comments related to the ability of the revised accreditation standards to maintain a focus on continuous improvement while demonstrating meaningful institutional outcomes:

(I had nothing to say here, plus was rambling too much elsewhere, so left it blank)

10. Please provide specific comments related to the ability of the revised accreditation standards to encourage and support innovation:


While I see nothing in the standards that specifically encourages innovation, I see much that limits it. Specifically, commitments to specific planning, documentation, and reporting structures limit the agility of institutions, particularly small ones. Innovation is given lip service in Standard III #2 subsection d, which is shared with professional development. If it's so important that you ask for feedback in this survey, perhaps it deserves more prominent focus in the Characteristics.

One improvement might be recognizing the role that failure plays in innovative organizations. Language is powerful and an accrediting body actually acknowledging that failure can be a learning and growing experience would be of immense benefit to higher education. Accreditation has traditionally been a punitive exercise; do something wrong and you are warned or lose accreditation. What if you reframed it as a process that rewards experimentation? Experiments often do not work out, but if results are shared properly then they prevent others from making the same mistakes and increase the likelihood that future efforts will succeed. Encourage effort and sharing as opposed to punishing failure.

Friday, January 10, 2014

Philosophizing: Minority, Numbers, Gender, Librarians

Update (1/27/14)

I'm going to leave the post below intact, but after the #libtechgender panel I want to confess a glaring problem with this post: it's pretty clearly essentializing gender (e.g. the penultimate paragraph). If I took away one thing from the panel, it was the importance of understanding intersectionality and that many people have multiple attributes which are oppressed (gender, race, ableness, sexual orientation, class, religion...there are more). Focusing on one difference downplays this intersectionality. For some of the panel's content, Chris Bourg and Cecily Walker both wrote blog posts. Those posts were written before the panel so they don't necessarily cover all that we talked about but they're great reads on these issues.


Before I participate in a panel on #libtechgender at ALA MidWinter, I wanted to articulate some thoughts that have been on my mind.

The word "minority" is unfortunate because of its numerical connotations. When we speak of a "minority" group of people, the proportion of group is not at issue. My thinking follows Deleuze & Guattari:
The notion of minority is very complex, with musical, literary, linguistic, as well as juridical and political, references. The opposition between minority and majority is not simply quantitative. Majority implies a constant, of expression or content, serving as a standard measure by which to evaluate it. Let us suppose that the constant or standard is the average adult-white-heterosexual-European-male speaking a standard language (Joyce's or Ezra Pound's Ulysses). It is obvious that "man" holds the majority, even if he is less numerous than mosquitoes, children, women, blacks, peasants, homosexuals, etc. That is because he appears twice, once in the constant and again in the variable from which the constant is extracted. Majority assumes a state of power and domination, not the other way around. It assumes the standard measure, not the other way around. — A Thousand Plateaus, pp.116-7
This is particularly relevant in America. Here, whites are about to (have already? I'm being a bad librarian and not looking this up) become a numerical minority. And doubtless some pundits will use this to argue that white people should benefit from affirmative action and other programs, opportunistically preying upon a misunderstanding of the word minority. What makes white people a majority is their status as a standard, not their quantity. D&G's example is perfect: white heterosexual men are not a numerical majority, but they are a standard. So much assumes their viewpoint.

Other than avoiding silly conclusions, recognizing the non-numerical status of the majority/minority group helps in one other way: it hints that solutions will not be arithmetical. Numbers are great proxies but they are not the thing itself. As a hypothetical, consider if we attain female representation at library technology conferences in equal proportion to the number of female library technologists. Is our work done? Gender equality! The numbers are equal thus equality! No, again, equality is not a numeric term here. Not until women not only participate in similar proportion but also feel as comfortable, are respected as much, etc. is there anything that could be called equality. So increasing female participation numbers is great, but only as a means to this non-numeric equality. And also, this non-numeric equality doesn't mean "we're all the same" which I feel is used as a pedantic counterargument to liberatory politics. "Equality" means no one group hold the majority position. No group plays standard, has their viewpoint assumed.

There is a lot more to talk about but I'm only going to outline it because digression. Just as equality does not mean we're all leveled into one homogenous mass of humanity, it does not mean power struggles suddenly disappear (on the contrary, power would be more fluid, would circulate far more). Also, the notion of "minority" is incredibly strong in D&G, as the quote above implies. It's an artistic, social, ontological notion even. Because majority is more standard than highest proportion, those considered within the majority group can "become-minority" (specific examples abound in D&G, such as "becoming-woman", "becoming-animal"). This is where the majority members can realize their own liberation. They too are not held to a standard, can embrace alternate ways of being. As an example, patriarchy hurts men, too. They must be manly, be heterosexual, not cry, not show emotion, not get beat up, etc. Ultimately everyone runs into a limitation of the standard, a point where they do not meet its demands.

Sunday, December 29, 2013

Top 10 Albums of 2013

Just in time for the New Year, here's another list for you and another digression from my usual topics.



1. Flaming Lips / The Terror — the last two Flaming Lips albums have been excellent. They're dark, ragged affairs, not at all the polished weird pop of Yoshimi.

2. Jon Hopkins / Immunity — one of the best electronica albums in years. Crunchy, huge, pounding. Not exactly beat- or melody-driven, just amazing sounds.

3. Altar of Plagues / Teethed Glory and Injury — a black metal band that's coming full circle back around to riffs. There isn't as much tremolo picking here as tense atmosphere & well-timed brutality.

4. Kanye West / Yeezus — I liked My Beautiful Dark Twisted Fantasy a lot, but Yeezus does everything that album did—staggering egotism—better, with a more cohesive sound. A friend, not having heard the album, described it as "industrial rap," a weird label for Kanye since he's always been a pop artist at heart. But the beats are as much NIN as Just Blaze. The fact that there's only 10 songs & that there are fewer grandiose digressions (e.g. "All of the Lights") makes it more focused. MBDTF was interesting for its sprawling, diverse nature, but Kanye would do well to limit the sheer number of ideas & contributors he packs into his albums. He has plenty of creativity on his own & Yeezus shines due to that.

5. James Blake / Overgrown — Blake has a tremendous voice which quivers with insecurity, love, & despair. It's a powerful instrument sorely lacking in the dubstep scene which makes his work stand out. Blake's last album was good but inconsistent: I listened to the superlative first three tracks ("Unluck", "The Wilhelm Scream", & "I Never Learnt to Share") over & over, skipping the rest of the album. Overgrown lacks obvious standouts & is better for it. It's a rich experience where songs fluidly intermingle, no abrupt drops in quality.

6. Earl Sweatshirt / Doris — Odd Future's output has been erratic. Even the good albums (mostly Tyler, the Creator's, but Frank Ocean's Channel Orange too) tend to have half-baked songs that shouldn't have made the cut. Doris is the first great album by the crew's most talented member. Sweatshirt's flows are dense & rhyme-laden. He isn't a fast rapper or witty, he's obsessed with the sound of language & it shows. That the songs tend to be moody productions with plaintive lyrics (e.g. "Chum" & it's "get up off the pavement, brush the dirt up off my psyche" refrain) is a bonus.

7. Windhand / Soma — very low, overwhelmingly distorted metal. A nice job with the "voice lost in the machine" dynamic which has always been a favorite of mine.

8. Daniel Avery / Drone Logic —  this album hit a sweet spot for me. I've missed acid techno so much (Aphex Twin, where are you? Come back to us.) & Drone Logic does it straightforward, no frills, well.

9. Sadgiqacea / False Prism — brutal metal with a healthy dose of dissonance. Combines slow droning with rapid black metal, often in the same song. Sadgiqacea change things up just enough to make the music interesting without reducing its molten impact. The shortest song, "False Prism", demonstrates these strengths well, starting with a few echoing, quiet notes from a clean guitar before diving into frantic picking, and then towards the end becoming a slow, chugging affair.

10. The Range / Nonfiction — is this what trip-hop is nowadays? I like it. The songs with looped vocal samples toward the beginning are the best, like "Metal Swing".

Honorable Mentions


Burial / Rival Dealer — I've cheated in the past by putting Burial EPs on what's supposed to be a list of albums (what's an album, anyways?) so I'll attempt to make up it for it by leaving Rival Dealer off. It's great, though. Burial's recent swing into anthemic, ≈10 minute songs on his last three EPs—Rival Dealer, Truant / Rough Sleeper, Kindred—is wonderful. He's always been a master of atmosphere & the two-minute interludes of rustling wind work better as slow-downs in otherwise intensely emotional music as opposed to separate tracks.

The Haxan Cloak / Excavation — creepy, dark, & consistent in its execution. It's a good album but a bit too slow-moving, the atmosphere too thin in places.

James Holden / The Inheritors — pretty weird electronic music, the sort that sounds like circuits being twisted & soldered together rather than keys on a synth being pushed. Organic electronic.

Moderat / II — solid mix of R&B & electronica, catchy without being too predictable.

Wednesday, December 4, 2013

My All-Time NBA Starting Five

Possibly-surprising fact: I'm really into the NBA. This post is a serious detour from my usual subjects.


PG - Magic Johnson

Considered: John Stockton, Oscar Robertson

Magic Johnson is one of the most anomalous players the NBA has ever seen. More so than anyone else, he could (and did) play every position. He could rebound like a center and pass like a point guard. Magic's 52% career shooting average is the highest amongst point guards and his rebounding percentage (11.1%) probably ranks up there as well. His ability to play multiple positions defensively while leading fast breaks is a devastating weapon. To put it in modern terms, Jason Kidd has been an elite (for many years, arguably the best) point guard in the NBA; Magic Johnson does everything Kidd does but significantly better (Kidd's three-point shooting ability towards the end of his career aside).

It's difficult to leave Stockton off this list. He was never an elite scorer, but excelled everywhere a point guard should: good three-point shooter, terrific defender, better at generating steals than Magic, assisted on over half of the possessions where he touched the ball (an unbelievable statistic). In some ways, when building a team, it's better to have a prototypical point guard rather than someone unique like Magic, whose strength comes from his size and rebounding, not traditional point guard qualities. Stockton's ability to space the floor and set up others would doubtless serve a team of superstars well, given that there would be no lack of scoring talent on the floor. In the end though, the tremendous mismatches that Johnson causes (there isn't a point guard in the world who can guard him on the low post) as well as his additional rebounding win out.

The Big O is also difficult to leave off, but not necessarily because he's a comparable talent. Unfortunately, without a three-point line and many statistical categories (steals, turnovers), it's tough to tell just how good Oscar Robertson was relative to Magic. He had the same all-around type of game, with tremendous rebound totals for a point guard, and shot a very good 48.5% from the field while taking 7.5 free throws per 36 minutes (see how close those figures are to Jordan's below). But for what info we do have, he falls behind Magic in many vital categories: rebound, assist, and effective field goal percentages, per-minute assist and rebound totals, win shares. Robertson's star was built off of a few extraordinary early seasons and playing 40+ minutes per night; his career was great but not best-in-class.
 

SG - Michael Jordan

Considered: No one else comes close.

Shooting guard is the only easy choice on this entire list. Jordan is head and shoulders above any other shooting guard to have played the game. Jordan was known for being a dynamic scorer, someone who could create his own shot with ease and take defenders off the dribble. But he had a stunningly complete game: he rebounded better than your average guard, was every bit as amazing a defender as a scorer, generated steals, passed fairly well, and turned the ball over surprisingly rarely given the amount of time he spent handling it (9.3 career turnover percentage). Jordan shot a high percentage for a shooting guard at 49.7 and generated 7.7 free throws per 36 minutes with his aggressive drives. His only weakness is his poor three-point shooting: towards the end of his Chicago days he had a couple good years, but he was a lifetime 32.7% shooter from beyond the arc putting him well below most modern shooting guards.

Some would argue that Kobe Bryant is, if not better than Jordan, at least in the same league. There is no statistical validity to this argument. Bryant is worse is every category I mention above—rebounding, steals, turnovers, shooting efficiency, defensive win shares, free throws attempted per minute. It's barely true that Bryant is a better three-point shooter, but he's still below what you want from a SG at 33.6%. Objectively, he does not belong in the conversation. Julius Erving would be an interesting pick as he is actually better at some things—he rebounded and blocked shots at a SF level—but in the end Jordan is just clearly superior in too many categories to consider anyone else.

SF - LeBron James

Considered: Larry Bird

Short forward has surprisingly few candidates for the All-Time Team. Up until about the past decade, when the NBA started to showcase wingmen with tremendous athletic gifts like LeBron James and Kevin Durant, the position was not a premier one. Shooting guards and power forwards accounted for the majority of scoring; SFs were often role players who spaced the floor with shooting and provided defensive versatility, as typified by Bruce Bowen. The few historical exceptions were either high-volume, low-efficiency scorers (Baylor) or rebounding beasts lacking an elite all-around game (Cunningham, DeBusschere, Rodman).

Bird was a significantly better rebounder and distance shooter than James. James is a better passer who also turns the ball over a smaller percentage of the time. James, who seems to continuously improve in terms of scoring efficiency, has pushed both his true shooting and effective shooting percentages higher. He also makes up for his lesser (though dramatically improved) three-point shooting with an uncanny ability finish drives to the rim, which results in him attempting three more free throws per 36 minutes. In my book, free throws are the single most valuable source of points: they come with fouls which get the opponent into trouble and allow your defense to set itself on the next possession. In terms of defense, LeBron is clearly superior. Bird was a crafty and underrated defender but lacked lateral quickness; James not only blocks more shots than Bird (their steals percentages are close) but has more versatility with his quickness. In the end, that's what puts LeBron ahead for me: James has only a slight offensive edge but is a unique defensive talent. His win shares are significantly higher than Bird's which validates my conclusion.
 

PF - Tim Duncan

Considered: Karl Malone

This was a tough choice between two excellent players. Looking at their careers, a dichotomy becomes clear: Malone was a superior offensive player while Duncan is a better defender. Malone would benefit this team with his uncanny ability to run the floor for a man of his size and his scoring efficiency (57.7% career true shooting as opposed to Duncan's 55.1%). Malone actually wasn't a traditional big man offensively, however: he scored off of pick-and-rolls (playing with Stockton helped a lot here), dribble drives, fast breaks, and the occasional jump shot. He used his quickness as much as his strength to overcome defenders.

Duncan, on the other hand, is more of a traditional back-to-the-basket big man. He scores mostly via post-ups but also pick-and-rolls. While Malone was also an all-NBA defender in his time, Duncan's defense stands head and shoulders above: Duncan's block percentage (4.6 career as opposed to 1.5), defensive rebounding (26.5% career to 23.5%), and defensive rating (an incredible 95 to Malone's respectable 101) are all ample evidence of this. He manages to defend excellently while committing half a foul less than Malone per 36 minutes as well.

In the end, Duncan's defense outweighs the offensive benefit that Malone would bring. Also, while it'd be nice to have Malone's ability to run the floor coupled with the other fast-break superstars on this roster, it's actually even more appealing to have a post-up player in the mix. Duncan's presence down low could give the perimeter players a bit more space to take jump shots and drive into the paint. Since my center pick below isn't going to provide that low-post scoring, it's good to get it out of the power forward. Duncan's not just a good defender for a PF either, he's arguably one of the best defenders the game's ever seen at any position, but he still can't compete with my pick for center.

C - Bill Russell

Considered: Wilt Chamberlain, Shaquille O'Neal, Hakeem Olajuwon, Kareem Abdul-Jabbar

Center is, by far, the most difficult position to make a decision. The NBA has showcased many great centers, all of whom affected the game at both ends of the floor tremendously. Their high shooting percentages, team-leading rebounding, and massive defensive impact has historically made them basketball's premier position.

Bill Russell is also probably the most noticeably flawed player on this list: he's not a good shooter by any means. Russell tended to shoot mid-range jump shots, the NBA's worst shot, resulting in a miserable effective field goal percentage of 44 and a true shooting percentage of 47.1. However, he was an excellent rebounder, above-average passer, and superlative defender. While we don't have block and steal statistics for his era, he lead the league in Defensive Win Shares an unmatched ten years in a row and in eleven of his thirteen years in the NBA. In fact, his Defensive Win Shares are probably the most aberrational statistic in the entire NBA; they're almost 40% greater than the next best player (Duncan). He is the best defensive player ever. He won more championships than anyone else.

While I listed many other centers who rightfully belong in the consideration, the only one who gives me serious doubts is Wilt Chamberlain. Chamberlain and Russell were contemporaries and there is ample evidence that Chamberlain was a superior player. Chamberlain had more win shares, shot an incredible percentage, and was a good (if not at Russell's level) defender. Yes, Russell won many championships, but on a set of deep Celtics teams that featured other superstars. Russell won 5 MVPs to Chamberlain's 4. In the end though, I have to pick Russell. In filling out a roster, you want someone who makes sense given your other players. Russell is a defensive anchor who doesn't need to put up shots offensively. He fits in any lineup. If I could have one player to build a franchise around, it would be Russell and I wouldn't regret it for an instant.

Caveats

Traditional NBA and modern (1980  and on) NBA stats are not comparable because of differences in pace and the three-point line. Older games had more shots, more misses, and stratospheric rebounding totals. New games benefit from the three point shot and new statistics, such as blocks, steals, and plus/minus figures. The three pointer is an ongoing problem; the line keeps getting moved back further. Contemporary players are shooting more difficult threes than Larry Bird did in the 1980s. I tried to correct for the NBA's changing rules but the effort is ultimately futile; we cannot know if the classic greats of the game could compete with even mediocre modern players. My unsupported guess is that athletes have evolved; LeBron James would crush Oscar Robertson if the two competed in their prime.

I do want to take a moment to point out that David Stern and the NBA office clearly have an agenda behind their recent rule changes. They keep pushing the three point line back, a couple of inches every couple years now it feels like. They create new rules (no hand checks, the "no charge" semi-circle, the unspoken ban on travelling) which benefit drives. They are trying to generate dunks with rule changes. The contemporary NBA discourages long jump shots, zone defense, and perimeter play in favor of drives, isolation matchups, and flashy dribbling. Whether that is right in any sense is clearly irrelevant; it's a marketing choice and dunks are exciting. But I do wish somebody (for all the innumerable talking heads, I have yet to hear anyone mention what I consider to be an evident trend) would talk about it.

Saturday, November 9, 2013

thanks to #libtechwomen

Yesterday, Travis Good of Make Magazine gave what I thought was a pretty good keynote. He talked about technology, progress, makers, community—it hit all the right spots.
But one thing that crossed my radar, thanks to the wonder that is librarians on Twitter, is that much of his language was gendered:


I consider myself a pretty sensitive person with respect to these issues. In language as well as action, I try to let things be neutral and fair, evicting unnecessary and damaging assumptions. But I didn't notice the gendered language at all until I saw the tweets calling it out. And more than anything I want to say: I appreciate this. I need the reminder. We all do. It can't stand and it's not going to change unless people are persistent, unless they call put even the most seemingly-innocuous assumptions. Because they're not innocuous. Because we need to say what we mean, not something that's close but shrouded in the biases of our past.
So, thank you, #libtechwomen, and everyone else who fights this fight. We appreciate it and learn from you.

Tuesday, July 23, 2013

Adding LibGuides to Drupal's Search Results

This will be another super specific post about how to do something useful for libraries in Drupal. The tl;dr is that you can use LibGuides XML Export, the Feeds module, and the Feeds XPath Parser module to make LibGuides show up in your Drupal site search results. So when users search for "english composition" and you don't have any study guides on your Drupal site, something relevant from LibGuides might show up.

I was inspired to do this by the Drupal in Libraries book, though I haven't read it (I saw it mentioned in American Libraries). I didn't see specific details in the book's preview, and Michigan is putting the XML into their Solr search index which is too sophisticated for my small college, so I thought a brief write-up might benefit other libraries who have LibGuides but don't use Solr. Libraries using other CMSs might still benefit from the general outline, though the specific details won't be useful. I'd be shocked if Wordpress libraries couldn't do the same, using WP All Import or other plugins.

These directions are specific to Drupal 7; I bet the same can be achieved in 6 but I can't vouch for any of the settings or code being the same.

Set-up: LibGuides & Modules

In order to do this, you have to do a couple steps first to prepare both LibGuides and Drupal.

  • Purchase the Images and Backups Module from Springshare. In my experience, the pricing is very reasonable, and the "images" part of it means you can upload images to LibGuides which makes adding them to guides much, much easier for authors.
  • Install the Feeds module, a popular and well-maintained module for mass importing nodes from structured data (RSS/Atom feeds, CSV files, OPML files) into Drupal
  • Install the Feeds XPath Query module which adds an extra parser to your Feeds installation, allowing you to import nodes from arbitrary XML documents

Once you've done these three steps, download the XML export from LibGuides (Springshare will email you when it's ready) and enable both modules in Drupal.

Process the XML

I don't work with XML much (shame, librarian, shame!) but this is a step where you could edit the LibGuides export to make it more useful as an imported node. In my pre-processing, I only wanted to accomplish one thing: when I import the nodes, I don't want any unpublished or private guides to be published in Drupal. We have a few under-construction or private guides that shouldn't show up in search results.

To do so, there's just one Drupal quirk you have to know: later on, in configuring the way your data maps to Drupal nodes, you'll be able to map the contents of an XML element to a Drupal node's "publication status" field. 1 means published and 0 means unpublished.

Luckily, the LibGuides XML has a <STATUS> element underneath each <GUIDE> which you can easily map to either 0 or 1. To process the XML, I performed a simple pair of search-and-replace operations in Sublime Text:

  • Search for "<STATUS>Published</STATUS>" and replace with "<PUBLISH>1</PUBLISH>"
  • Search for "<STATUS>.*</STATUS>" and replace with "<PUBLISH>0</PUBLISH>"

That second search and replace uses a teeny bit of regex: the period stands for "any character except a line-break" and the asterisk means "any non-zero number of the preceding character". So I'm searching for any non-empty string of text inside of a <STATUS> element and turning it into <PUBLISH>0</PUBLISH>, which works because all of my published guides no longer have a <STATUS> element after the first search-and-replace.

Configure the Feeds Importer

Back inside Drupal, we need to create a new content type and set up the Feeds module to receive our XML file.

  • Under the "Structure" menu of the admin toolbar, select Content Types
  • Add content type and then give it a name and description, e.g. "Imported LibGuides"
  • Add fields to your new content type, which at the very least should contain two new fields: an "ugly URL" field for LibGuides that don't have a friendly URL, and a "friendly URL" field. You can make these Text field types with the standard settings.
  • Under the "Structure" menu of the admin toolbar, select Feeds importers (or visit {{drupal root}}/admin/structure/feeds)
  • Add importer and then give it a name and description, e.g. "LibGuides Importer"

There are a lot of settings here, which can seem intimidating, but is actually great. The Feeds module gives you control over how data is imported into Drupal and everything is straight-forward if you take the time to read through it. I'll walk through my basic settings, but just know that you could do whatever seems reasonable here and be OK; the only piece of this post you might need to reference are the XPath queries later on.

  • Basic Settings
    • Attach to content type: select your LibGuides content type here
    • Periodic import: off, periodic import is only for grabbing nodes from web feeds, e.g. RSS
    • Import on submission: check
  • Fetcher: File upload
    • Allowed file extensions: you can leave as is, but I put XML since I'll only be uploading XML files
    • Upload directory: leave as is
  • Parser: XPath XML parser (this option only appears if you installed Feeds XPath Query)
    • Settings: see the section below on the XPath queries, but trust me this won't be that painful
  • Processor: Node processor
    • Bundle: select your LibGuides content type again
    • Update existing nodes: this is a bit of a judgment call, but you'll be fine with either "Replace existing nodes" or "Update existing nodes."
    • Skip hash check: I leave this unchecked but you'd be fine either way
    • Text format: your call, I leave as "Plain text" which is fine for search results
    • Author: anonymous, or your user if you want to brag about how many nodes you made
    • Authorize: probably should leave checked
    • Expire nodes: Never
    • Mapping for Node processor: make the Title, Body, Published status, Friendly URL, and Ugly URL fields all map to an "XPath Expression" source. The two URLs fields are ones we created with our Imported LibGuides content type, so if you chose a different name for them back then they will appear differently in the Target drop-down options here.

Whew, we're done! I know that looks like a lot, but Feeds has a pretty nice UI for such a sophisticated and powerful module.

Parsing XML with XPath

Now for the fun part: we need to map XML elements in LibGuides to Drupal fields using XPath expressions. We also get to say things like that which only .01% of humans understand.

XPath is a query language for XML, if you know SQL or CSS it's kind of similar. It gives you a way of traversing the structure of an XML document to retrieve the contents of various elements. The LibGuides XML is structured in a pretty logical, simplistic manner so writing our queries won't be tough. Back in the Feeds importer settings that we were just editing, select the Settings link under the Parser section. This gives us a menu where we can write our XPath queries. Here's the setup that I use with some English translations:

Context: //GUIDE

We want our queries to run in the context of each <GUIDE> element. We could do without this, but it means we'd be prepending /LIBGUIDES/GUIDES/GUIDE/ to each query below, which is silly.

title: NAME

body: DESCRIPTION

Set the name of the LibGuide to the node's title and the body of the node to its description. The description is the brief sentence which shows up underneath the name of a LibGuide.

field_friendly_url: FRIENDLY_URL

field_ugly_url: URL

Each <GUIDE> element has two URLs, so we map both of those to the two custom fields we set up on our Imported LibGuides content type. Once again, if you named your fields something different, their machine-readable names (which is what you see in this menu, they're just lowercase with underscores instead of spaces) will be different.

status: PUBLISH

Remember when we edited the LibGuides XML to set up a <PUBLISH> element that's either 0 or 1? That's where this mapping comes into play, taking that Boolean value and using it as Drupal's publication status field.

You can leave all the "Select the queries you would like to return raw XML or HTML" options unchecked. Note that this could provide some interesting options if you were doing more sophisticated things with LibGuides, since the XML export contains all the raw HTML of the various boxes in each guide. Debug Options can also be left unchecked, although if you're testing this process I recommend checking them off. The debug options show you what Drupal found with each XPath query, which can help you configure the importer properly.

I leave "Allow source configuration override" unchecked as well. Since we just set up our XPath queries the way we wanted, there's no need to override them later. However, you could do something interesting where you set up a generic LibGuides importer in these settings, then have multiple different ways of mapping the XML into nodes.

Redirecting Imported Nodes to LibGuides

Before we actually import our LibGuides, we want to make sure they're handled appropriately. That is, we don't want people clicking on their search results simply to see some lame text and URLs on the screen, we want them to be redirected straight to the LibGuide.

There are probably other ways to do this, for instance the Field Redirection module, but I use node templates, which are PHP templates that apply to only specific node types. Under the Templates folder of your theme (which will be somewhere in sites/all/themes likely) create a file named "node--imported-libguides.tpl.php" where "imported-libguides" is whatever you named your LibGuides content type but with hyphens replacing spaces. Inside that template, paste the following PHP:

<?php
// redirect user to LibGuide rather than node if user is not signed in
// uid 0 means anonymous user
if ( $user->uid == 0 ) {
  // prefer friendly URL if available
  if ( $node->field_friendly_url ) {
    drupal_goto( $node->field_friendly_url[ 'und' ][ 0 ][ 'value' ] );
  } else if ( $node->field_ugly_url ) {
    // ugly_url should always exist but just in case, use a conditional
    drupal_goto( $node->field_ugly_url[ 'und' ][ 0 ][ 'value' ] );
  }
} else {
  print render($content);
}
?>

I've written comments in the code, but essentially here's the path this code steps through:

  • Is the user anonymous? If yes, redirect them. If not, we assume the user is some kind of editor, so we print out the lame text fields. This makes it easier for librarians to edit nodes after they've been imported, but assumes that your users don't have Drupal accounts. If they do, you'll need to consider the first if condition thoroughly to make sure only the right types of users are seeing the plain text.
  • Does the node have a friendly URL? If so, redirect anonymous users to it.
  • If not, the node must have an ugly URL, redirect anonymous users to that.

I noted it above, but because it's so important: if you allow users to create Drupal accounts, this template won't work well. It won't expose confidential data or anything, but it's definitely meant for Drupal sites where all non-editor traffic is anonymous.

Your theme may also have a particular way of printing out nodes that you want to stick to; in that case, you'd be better off copying node.tpl.php or another node type template rather than using my code verbatim. You could put the logic piece of this code at the top of your node template, dropping the else clause at the end. That would work fine as long as it's named appropriately, e.g. "node--imported-libguides.tpl.php".

We're Almost There

Now that our template is set and our importer configured, we need to create an importer node, give it a file, and let it run wild. Go to {{drupal root}}/import to see a list of available importers, including the default ones that come with the Feeds module and your LibGuides Importer. Select LibGuides Importer and you're greeted with the usual node editing form, except this time there's a place to upload a file towards the top. Use that to browse to the processed LibGuides XML, then upload it. You can leave the body and other fields blank.

Once you've created this node, it will have an Import tab with an identically named button. Simply click that and your nodes should be created in Drupal, with whatever debug messages you chose in the importer displaying as well.

Totally screwed up the XPath queries, causing a bunch of broken and useless nodes to be imported? No worries, the importer node that you just created has a Delete items tab which can delete any of the nodes which it imported. This makes trying out a Feeds importer rather risk free; just keep trying until you get it right.

Final Steps

Drupal's internal search index will still need to index the new nodes before they show up in its results. You can run cron a few times depending on how many nodes you just added and they should show up. Try a search for the title of a LibGuide that wouldn't return any of your other pages, and make sure clicking on a LibGuide result from an anonymous session causes you to be redirected to the guide.

As LibGuides are added and removed, you'll have to sync them to their Drupal nodes again. However, once you've done the process once, it only takes a few minutes to grab a new XML export, upload it, and click the import button.

Monday, July 1, 2013

Foreign For-In, or Python as a First Language

...being a brief recap my experience at the Python Preconference at ALA Annual. In general, the session was a smashing success and I was elated to see a diverse group of people picking up Python so quickly. Without going into details elsewhere, which I think other attendees or organizers will cover, here's one struggle and one pleasant surprise from the preconference.

Explain a For-In Loop

Describing how a for-in loop works was difficult and I repeatedly ran into attendees who just couldn't quite grok it. A Python for-in loop looks like:

for word in wordlist:
    print word

That would loop through the wordlist data structure, which we'll say is a list (similar to an array in other languages), printing each term to the screen. Simple, right? But it's actually pretty weird, because in the above example what exactly is word? It's a local variable that gets a new value each time through the loop. If for-in loops for lists didn't exist in Python, you might implement them like so:

i = 0
while i < len( wordlist ):
    # being super explicit here
    word = wordlist[ i ]
    print word
    i = i + 1

len( wordlist ) here returns the length of the wordlist list, for non-Python people. Otherwise, I assume the syntax is straightforward for anyone who knows a little code. The biggest disadvantage to this implementation is you end up with two variables in the scope—i and word—neither of which is useful after the loop has run.

I'm not sure my explicit for-in loop is more clear to a new programmer, but it's my conceptual model. Students struggled with understanding the for variable's name; where does word come from? In the lecture, Becky Yoose used this example:

for fruit in pies:
    print fruit

The reaction from attendees seemed to be "since pies is a list of different fruits, the variable name has to be 'fruit' here." As if Python was somehow doing natural language processing to figure out a good descriptive term of an individual item in a thematic list. It's a weird thing to grasp conceptually, perhaps the crux being you're getting a variable without any assignment statement. That's a nice convenience for programmers coming from other languages but it obscures what's going on for learners.

Nested Loops & First Languages

On the other hand, I found that a lot of our exercises and final projects involved nested loops, sometimes three to four layers deep. Everyone seemed to absorb this without conceptual difficulty. Maybe it's my own experience speaking here, but I get more and more anxious the deeper my indents go. A lot of this anxiety is based in JavaScript, where blocks wrapped in curly braces tend to take up more space and are harder to parse than in whitespace-happy Python. The uglist code in the world is an instantly-invoked function expression which ends in a bunch of closed code blocks:

            }
        }
    }
}( 'this happens way too often in JavaScript' ) );

Python's conveniences, like range() and how the for-in loop works seamlessly across different data types (lists, dictionaries, even strings. Strings, people!) are a serious boon to beginners. I still think JavaScript makes a great first language for a few reasons: 1) everyone already has it installed via their web browser, so there's zero setup barrier, 2) the web is where data and applications live these days and JavaScript is the language of the web, and 3) a trivial amount of jQuery can make cool things happen. Other languages require more investment before the cool things go down.

But the setup process wasn't an issue for the preconference. We held a help session the night before and only two people came; one of them already had Python installed and on the Windows path, they just needed confirmation that they'd done it right. A number of factors contributed to the ease of setup: many attendees had Macs which typically come with a 2.6.x or 2.7.x version of Python, the Boston Python Workshop docs are great and cross-platform, and a fair portion of attendees were advanced computer users. So with an easy setup, Python (or Ruby) is a sensible choice for a first language.