programming

Home/Tag: programming

gatekeeping.js

As someone whose (primarily web-based) programming output decreased in inverse proportion to the rise of JavaScript, I really feel this article a lot…

2019-01-03T09:25:10+11:005th May, 2019|Tags: programming, tech|

Emoji code.

Swift, Apple’s multi-purpose programming language for its various platforms, apparently supports full Unicode.

The actual intent of this is to assist programmers whose native languages use non-Roman character sets. The practical result is that it means you can type code that looks like:

infix operator ⛏ {}
public func ⛏(set: Set, count: Int) -> Set {
    func rnd(i: Int) -> Int {return Int(arc4random_uniform(UInt32(i)))}
    var items = set, chosenItems: Set = []
    (1...count).forEach { _ in
        let whichOne = items
            .startIndex.advancedBy(rnd(items.count))
        chosenItems
            .insert(items.removeAtIndex(whichOne))
    }
    return chosenItems
}

Set(["a", "b", "c", "d", "e"]) ⛏ 3 // pick 3 members
2018-04-27T13:58:50+10:002nd April, 2016|Tags: programming|

What is code?

The World Wide Web is what I know best (I’ve coded for money in the programming languages Java, JavaScript, Python, Perl, PHP, Clojure, and XSLT), but the Web is only one small part of the larger world of software development. There are 11 million professional software developers on earth, according to the research firm IDC. (An additional 7 million are hobbyists.) That’s roughly the population of the greater Los Angeles metro area. Imagine all of L.A. programming. East Hollywood would be for Mac programmers, West L.A. for mobile, Beverly Hills for finance programmers, and all of Orange County for Windows.

There are lots of other neighborhoods, too: There are people who write code for embedded computers smaller than your thumb. There are people who write the code that runs your TV. There are programmers for everything. They have different cultures, different tribal folklores, that they use to organize their working life. If you told me a systems administrator was taking a juggling class, that would make sense, and I’d expect a product manager to take a trapeze class. I’ve met information architects who list and rank their friendships in spreadsheets. Security research specialists love to party.

What I’m saying is, I’m one of 18 million. So that’s what I’m writing: my view of software development, as an individual among millions. Code has been my life, and it has been your life, too. It is time to understand how it all works.

Paul Ford on the way the world works.

From a while back, and ve-ee-ee-ery long (like, novella length). But definitely put aside some hours in your day, or some consecutive days, to read this. It’s everything you never knew you needed to know about code, written by a
non-natural coder”–i.e. someone, not unlike yours truly, who can code, but for whom it’s an uphill battle–and aimed at non-technical, specifically business, people. Also, the actual format of the article itself–it has a bunch of embedded “try it yourself!” style widgets–is pretty sweet.

Oh, and there’s the gif of Ballmer doing the “DEVELOPERS DEVELOPERS DEVELOPERS!” chant. Which is, like, meme flashback city I swear.

2018-07-27T14:25:11+10:0017th December, 2015|Tags: programming, tech|

White-hat jerking.

When we at Floate build things for people, I always ask “how could someone screw this up for shits and giggles?” People tend to think I’m joking but I’m deadly serious because if your site, network, or product becomes a playground for a bunch of jerks, it turns off the people whose time and attention you’re really trying to obtain. Almost nobody ever got a promotion doing that.[

–Ross Flotate on white-hat jerking.

For a long time it was my job to go around to development teams and ask them, “Okay. You’ve built the product. Now how would you break it?”

The amount of blank and straight-up incredulous responses I got (“But… no-one would do that!”) was… not encouraging, let me tell you. Particularly given I’d cut my teeth on exactly this sort of stuff back when I was a teenage girl cutting shitting PHP code to make blogs1 and webrings/fanlistings (remember those?). Back in those days, hacking someone else’s code was part of the relationally aggressive game of cliquish one-upmanship all teen girls go through.2 Meaning that not ending up as the digital equivalent of the loser with a birthday party guest-list of zero entailed being able to find weaknesses in your own code before someone else “found” them for you.

It’s worth noting, incidentally, that all of this occurred largely outside of the influence of any traditional open source or computer hacking culture. And did I mention basically everyone involved was a teenage girl? (Or, at the oldest, a young woman in her early 20s?)

Yeah. Talk about the Forgotten History of Female Hackerspace. Someone should really write a book or something about that one of these days…

  1. This was, like, way back in the late ’90s/early ’00s, when Blogger and LiveJournal were only just beginning and stuff like Facebook and Twitter was still years away. []
  2. Boys do all of this too, of course, but in this instance I’m talking about communities that were like 90%+ girls under the age of 20. Hence the gendered language. []
2014-10-22T08:59:53+11:009th December, 2014|Tags: culture, infosec, programming|

ArnoldC.

IT'S SHOWTIME
HEY CHRISTMAS TREE isLessThan10
YOU SET US UP @NO PROBLEMO
HEY CHRISTMAS TREE n
YOU SET US UP 0
STICK AROUND isLessThan10
GET TO THE CHOPPER n
HERE IS MY INVITATION n
GET UP 1
ENOUGH TALK
TALK TO THE HAND n
GET TO THE CHOPPER isLessThan10
HERE IS MY INVITATION 10
LET OFF SOME STEAM BENNET n
ENOUGH TALK
CHILL
YOU HAVE BEEN TERMINATED

ArnoldC, a programming language made entirely out of Arnold Schwarzenegger quotes.

2014-07-27T21:24:25+10:002nd September, 2014|Tags: pop culture, programming|

Recurring todos in HabitRPG via PHP.

So some of you may remember a while back I started “playing” (using?) HabitRPG. Habit is basically a cross between a task management app and an RPG game. Instead of things like “kill ten rats”, your quests are things you define from your own todo lists, like “go to the gym” or “write your goddamn book you lazy bastard”.

Habit has three types of tasks: habits are ad hoc things you want to either do (giving rewards), or avoid (bringing pain); dailies are things you want to do either every day, or every Tuesday, or every Sunday and Wednesday, or whatever; and to dos are “projects” you want to do at some point, then tick off.

One of the downsides of Habit is that it doesn’t support recurring tasks that aren’t liked to a particular day of the week. So, for example, I have a daily to take the bins out every Sunday (because that’s when garbage collection is, and it doesn’t make sense to do it on another day), and a habit for washing the dishes (I won’t cry if it’s not done every day… but I should do it). But what about, say, re-dying my hair, which is something I generally want to do on the first Friday of every second month, although if it waits a few weeks it doesn’t matter much (I’ll just suffer through a faded dye job)? Or what about my gym schedule, which is alternating weights and cardio, though, again, doesn’t really matter if I don’t go literally every single day?

Yeah. This can get complicated real quick.

Fortunately, Habit has an API, and I know some PHP scripting. So I whipped up something cute and dinky containing all my silly task auto-creation logic, and run it once a day with cron.

The foundation of the script is a very simple class to access the Habit API, which looks like: (more…)

2018-11-26T08:25:14+11:0016th August, 2014|Tags: php, programming, tech, xp|