elfs: (Default)

If you work with Django for any period of time, the day comes when you’ll be accepting outside data from your users: files, images, and the like.  Django provides only two places where you can store these items: in memory, or to a file.  Django storages provides for two more critical locations: BLOBs in your SQL database (which you may want to do– never know), and most importantly, Amazon AWS S3.  For my current work with a film library and catalog, having S3 be the storage solution has always been a bit of a kludge: producers would upload films to the server, and we’ve eventually get it into S3.  Now, with AWS S3, Django Storages backed with the incredible BOTO library makes the entire process unbelievably easy.

Storages also supports storing content in the database, CouchDB, FTP, or anything else you can imagine. And the source code makes for excellent examples.

Also, if you use django-storages, consider looking at many of the branches on bitbucket, because there are variants of it for S3 that disable the HTTPS default for Cloudfront, which was important for us at Indieflix. Not everything coming out of Cloudfront has to run through SSL.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

I recently got a full-time job and have had only limited time to dedicate to doing freelance, but I’ve been working on finishing up three clients, one of which I’ve had for a long time, and sending them merrily on their ways.

The most recently acquired of these clients is an interesting challenge.  They’re lobbyists.  Small time, state-level, but still: lobbyists.  They have a popular constituency they represent (they’re not a corporate interest), and their constituency has certain special needs that a Section508 specialist like myself can help with.  And they have no real idea what a website is for.  Their current website is basically a junk drawer of pages, maintained with Microsoft FrontPage, with whatever was most recently in mind what winds up on the home page.

It won’t be enough for me to move them to a CMS with an original structure.  I’m currently offering them 15 hours of design and development time (they’ve used only four, and so far so good), and 5 hours of training, and I’m realizing as I talk to them that more than just “This is how you use Wordpress and WAMP,” I’m going to have to discuss what it means to have a web presence.

Home pages do a lot of heavy lifting.  First, they inform new users about who you are and what you do.  That should be first and foremost on any home page.   The navigation and initial buttons should also guide new users to more about who you are, what you do and, most importantly, never scare anyone off.  Convincing your clients use the home page properly is priority #1.

Then, for the purposes of this client, the website informs people who are interested in what lobbying efforts are being done on their behalf (or perhaps on behalf of interests to which the visitor is opposed).    These are your regular visitors, the ones who want to get your monthly email newsletter, but no more than that.

And lastly, the website helps organize the distributed network of grassroots citizenry who are passionately interested in what the lobby is attempting to achieve.  These people want both direction and a free hand in participation.  These are the people who want to comment on your posts, participate in the conversation, and give direct feedback.  They don’t need help finding anything– they want to find it, they’ll search for it.  Just make sure it’s there, findable, in the right navigation bar or footer.  Anywhere obvious will do, so long as it doesn’t clutter the experience of the user.

The challenge now is crafting a website that appeals to all three of these groups.  It can be done.  And it can even be pretty.  It’s not pretty now; it’s very raw, but the low-vision support is in.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

I resolved, earlier this year, to start finishing some of my projects.  That hasn’t gone too well– the day jobbe appears to have chewed up most of my time.  But after my Palm V died, I no longer had a chiming program to help me get into the rhythm of the day.  I’ve since replaced it on my Palm T|X, but I’ve wanted something that I could feed through my headphones, rather than rely on the Palm, which chimes loud enough the whole house or office can hear it.

So, my first foray into times and chimes is done.  I used some free bamboo photoshop brushes, and jQuery, but the HTML, CSS, graphics, layout and so forth is all mine.  The script is 100% HTML5, there’s a lot of CSS3, and it uses HTML5 native audio, so this thing doesn’t work at all on IE (unless you’re running IE9; I don’t know what the capabilities of IE9 are yet).  Basically it works on latest & greatest: Chrome, Safari 3, Firefox 3.6 (maybe 3.5?) and so forth.  The whole project took approximately 10 hours of development time.

Nine Amazing Hours

Critiques, comments, suggestions are all welcome.  The functionality is what I want it to be; if you want a full-fledged meditation timer well, maybe I’ll do that next.

And one beg: The idea behind these projects is to learn how to, as my design teachers put it, “design, develop, market and maintain a project.”  I have no idea how to market something like this.  How would I go about telling people about it?

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

There are plenty of places where you can find great examples of 404 pages. Salon.com is not one of them.

I learned this today because I followed some links off an article about George Carlin that were poorly coded.  Those links took me to Salon’s 404 page, which uses Salon’s standard layout, complete with ads. That is a major faux-pax; when the user is lost, the last thing he or she wants is to be sold to.  I understand that Salon needs to make money and ad impressions are its chief vehicle for doing so, but the add blare was such a major turn-off I almost gave up struggling to find what I wanted.

The 404 is incredibly unhelpful.  So are most in the galleries you might find on the Internet.  A 404 ought to make a positively heroic effort to decode what you were trying to do and help you find it.  If you recently re-arranged your website, hopefully the arrangement has some sort of algorithmic relationship: “pages named x-y-z.html can now be found in y/z/x.html,” for example.  Helping people find that relationship for themselves and understand your new layout is far better than just saying “Er, you screwed up.”

PS,  It’s “We screwed up.” Never blame the user.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

According to a service that tracks such things, the most popular types of websites people put for which there is a subscription fee include (in order from most to least popular)

  • How to lose weight
  • Health products – Vitamins, minerals, colon blow
  • Starting a home-based business
  • How to make money from your existing business
  • How to market on the Internet
  • How to make money through investments
  • Personal improvement
  • How to turn a hobby into a business
  • How to move to a new state/country
  • How to practice your religion

I’m not sure why, but I find this list incredibly sad. There are so many decent sites out there that give this information away, and most of what’s behind the paywalls is pure bullshit not worth the pixels it’s drawn with.

This just confirms what one commenter said earlier: most people don’t want a well-made website. Well-made websites scare people into thinking there’s trickery, deceit, and too much intelligence behind them for the individual to keep up with. Stupidity sells.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

I’ve recently watched John Underkloffer’s presentation on 3D UIs, and how he helped create the presentation for the film Minority Report. You know the scene, the one where Tom Cruise is working his way through the UI with a series of hand gestures (although the one in Iron Man 2 is an upgrade). As I was watching the clip, I watched Underkloffer work through a prototype, wearing gloves (as Cruise did, but Downey did not), and he had to make all of these esoteric gestures to make it behave.

As he did so, I flashed on the way my wife has to use her iPhone, with these weird gestures she has to use to get it to behave. There’s an entire library of gestures, and even worse, those gestures can mean completely different things in different contexts– in different programs, or even in different modes of the same program.

Underkloffer talks about how the WIMP (Window, Icon, Menu, Pointer) interface was a miracle when it debut popularly in the Macintosh, but we haven’t really progressed far from there. He wants us to stretch beyond that interactive format.

The thing about the WIMP interface, and one of the reasons we haven’t progressed far from that original design, is that it’s absolutely minimal in what you need to know from the start to make the system behave. Point, click, read. You don’t need to memorize a whole slew of esoteric commands, as you did with DOS (or as we Linux people pride ourselves on doing). Well-written UIs have discoverability and affordance, with the written word and the icon as the primary cues as to what to do next.

Underkloffer’s demonstration shows a world where affordance and discoverability don’t exist; you have to know the gestures, or be shown them, before you can do anything. Maybe we’ll have the bandwidth per application to teach that, maybe not. But the 3D UI (and all gestural UIs, like those in tablets and phones) is a step back to the era when we had to know some esoteric and unfamiliar activity– a code word, a gesture– to get anything done.

Most people don’t love Emacs. I understand that.

On the other hand, I did love one bit about Underkloffer’s essay. Back in the summer of 1992, I had the good luck to accompany a student group to a presentation and dinner by Dr. Timothy Leary. At that dinner, Dr. Leary and I got into a rather heated discussion about virtual reality.

Leary’s contention was that virtual reality was never going be the stuff of home installations. It was too expensive, too complicated. We’d have to go to places, like we go to theaters, to get the full virtual reality experience. He was adamant; by 2010, there’d be these places in malls you’d go to have what sounded a lot like Huxley’s “feelies.”

I argued that we were already there. We had mucks at the time, which were the beginnings of a communal virtual experience. He was highly dismissive: after all, that was still text on a screen. The whole goggles-and-gloves things would never happen in the home. I argued that the problem was one of bandwidth, which had grown in leaps and bounds in the ten years since the earliest BBSes.

Underkloffer’s vision is that five years from now every object we buy will have spatial sensors in the bezel, and interaction with the real world is just a matter of time and effort, the development of software to meaningfully interpret our gestures and convert them into commands.

I look forward to that.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

I was going to respond to this on genehack, but recovering my password proved to be onerous, and besides, the issue is an important one worth discussing.  John SJ Anderson wrote:

Elf digs into some Javascript on a particular high-traffic site. In the same way that some people love reading about high-performance cars or bikes they’re never going to own or even use, I love reading about deconstruction of these optimizations that are only worth doing on a tiny, tiny fraction of ultra-high traffic sites.

The Digg trick has nothing to do with high-traffic.  It’s about user experience and page size.   Even the smallest website can have large individual web pages. As HTML5, CSS3 and Javascript become the backbone of user experience, it becomes necessary to replace default behaviors with explicit ones, and adapt the style of elements programmatically.

The early way to do that was to just throw javascript at the problem an pray the DOM was available when the script ran.  The next-wave solution was to put javascript at the bottom of the page so that DOM elements to be manipulated by javascript were guaranteed to be available.  Current wisdom is to put the Javascript back in the header, but use $(document).ready() (or its equivalent in other libraries) to hook up all behaviors, timers, and event managers to the appropriate DOM object.

The current wisdom has a flaw: pages take time to download and parse.  While the page is in transition javascript-dependent display elements look ugly and javascript-dependent event managers drop down to their default behaviors– often no behavior at all, or worse, undesired anchor behavior.

The Digg technique ensures that when elements are rendered the correct programmatic styles and behaviors are simultaneously set.  Instead of waiting for the complete DOM to load, the Digg technique runs element-specific javascript when the associated DOM object is ready.   Anxious users quick on the mouseclick will get to where they want to go, even if the page isn’t done loading.  Persnickety types won’t see the designer’s elegantly designed carousel momentarily displayed as an ordinary, prestyled linked list.

Although I’m mostly a developer, I care about design.  A lot.  The Digg technique solves a serious problem in web design– making buttons do what we say they’ll do, making pages look the way we say they’ll look, and keeping backstage what belongs backstage.  Any website can use this technique, and any website with customers should.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

David Mamet to the writers of The Unit:

Our friends, the penguins, think that we, therefore, are employed to communicate information — and, so, at times, it seems to us.

But note: the audience will not tune in to watch information. You wouldn’t, I wouldn’t. No one would or will. The audience will only tune in and stay tuned to watch drama.

Question: what is drama? Drama, again, is the quest of the hero to overcome those things which prevent him from achieving a specific, acute goal.

I suspect “the penguins” is Mamet’s way of writing “the suits.”  There’s much more, and I recommend you read it all.

This entry was automatically cross-posted from Elf's writing journal, Pendorwright.com. Feel free to comment on either LiveJournal or Pendorwright.
elfs: (Default)

From twitter: TheOnion.com has migrated to Django. If you don’t understand this, please register with your local unemployment office.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

I recently had to convert a few GIMP palettes into color schemes for a website, and since I’m very fond of LessCSS, I decided to create LessCSS variables and use that as a plug-in to my CSS.   The trick was converting on the fly; GIMP palettes store their variables in decimal, and I like my variable names lower-case for neatness.  Nobody but me needs this, but here it is in all of its glory:

perl -ne '($a,$b,$c,$d) = m/^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\w.*)$/; $d=~s/ /-/g; print sprintf("@%s: #%x%x%x;\n", lc($d), $a, $b, $c);' < palette.gpl > colors.less

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

In my current development house, we have the painfully obvious “different settings for different stages of the development cycle.”  Production, obviously, isn’t in DEBUG mode so users don’t see the underlying technology when things go awry, and each dev has his own database.   The solution we’ve found is to create separate settings files with only the minor changes made, and then for settings.py to import that when loading, using the “--settings” argument to manage.py.

There is an inherent conflict between South and Fabric when we do this.  We use Fabric for roll-out from the repository to staging and production, and call migrate in the process.  We came to use South late in the development cycle, and many of our apps were converted to South long after they’d been populated with data.  We know how to do the whole “create, migrate data, drop table” migration process, but the real trick was 0001_initial.py; South “fakes” this for tables with existing data, recording that it was run when, in fact, it was skipped over in favor of the version created ages ago by migrate.py syncdb.

When we roll out to another stage, that database has no knowledge of this fakery.  Neither does South.  Fabric would call ‘migrate’ and the process would crash with warnings about how the table already exists.   So how do we get past that step?

Well, the answer would be to modify 0001_initial.py to test if the table already exists, and to skip if it does.  We need for the engine to fail only when actually accessing the data, and we need it to fail early.  Most models have a core table, the one without which the entire app would be meaningless.  In my example, that table is “stories.story”:

    def forwards(self, orm):

        # Probe for this.  If it works, we don't want to proceed,
        # because this isn't a migration, it's a build-out.

        if not db.dry_run:
            try:
                x = orm['stories.Story'].objects.all()
                return
            except Exception, e:
                pass

Now, if the database table doesn’t exist, the ORM handler will throw an exception and we’ll proceed to build the table. If it does, the table already exists and we shouldn’t proceed.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

The older stories run on a version of Narrator written in ruby. Yowlers runs on Django, which has slightly different requirements, so the link was borked for a while. I’ve fixed it.

This entry was automatically cross-posted from Elf's writing journal, Pendorwright.com. Feel free to comment on either LiveJournal or Pendorwright.
elfs: (Default)

  I would be totally remiss in my duties if I didn’t remind you that I had some Tron fanfic of my own, now wouldn’t I? Data Flow is M/M, and a warning for non-consensual sex.

Meanwhile, enjoy staring at the totally hot chick. If that’s Mercury, damn, that’s a lot of nice polygons.

This entry was automatically cross-posted from Elf's writing journal, Pendorwright.com. Feel free to comment on either LiveJournal or Pendorwright.

elfs: (Default)

I need to make clear that I did not invent the code below. I’m not sure who did, but the topic of making vi’s “paren bounce” feature work in Emacs came up in a conversation I had the other day, and I’m posting the chunk of code that’s lived in my .emacs file since, oh heck, must have been back in my days at F5 Networks.  This code creates a new function, “paren-bounce”, and binds it to the key sequence “CTRL-%” (I know, that’s probably not a real control code, but Emacs Doesn’t Care).

(defun paren-bounce ()
  (interactive)
  (let ((prev-char (char-to-string (preceding-char)))
	(next-char (char-to-string (following-char))))
    (cond ((string-match "[[{(<]" next-char) (forward-sexp 1))
          ((string-match "[\]})>]" prev-char) (backward-sexp 1))
          (t (error "%s" "Not an expression boundary.")))))

(global-set-key [(control ?%)] 'paren-bounce)

Similar solutions can be found here and here. I suspect the latter is where I got mine from– there are minor differences, but his page hasn’t been updated since 2001, so that’s about right.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

This is probably a “no-duh” to some people, but I had not known this. When you upload something to the CDN, you get a url that looks like this:

http://cdn.mycompany.com/images/someimage.jpg

Which is all fine and good. Django’s MEDIA_URL is usually suffixed with a closing slash, meaning that if you’re in the habit of typing something like %(foo)s/images/someimage in a standard python template, you’re going to end up with:

http://cdn.mycompany.com//images/someimage.jpg

And the CDN throws a wobbly. Most djangoites know to write the template as {{ MEDIA_URL }}images/someimage.jpg apparently. I need to build that habit. Apache is forgiving. Amazon is not.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

Who knows? I might make it by Friday after all:

It was easy then. Remove his infectious code, pull up the registry and edit out all the brutal redirects from his remotes, along with shutdown codes that prevent legitimate anti-malware from running.

The penguin doesn’t care about any of that. To me, all of that’s just bits and bytes, and tromping through it is routine.

Even in 2020, being a cocksucker in South Africa is dangerous outside of Capetown or Johannesburg, especially if you meet the rare angry religious type from the northeast corner. Being pale-skinned is unusual, but not worth remarking on except when getting joshed by your mates. But living with cyberwear that just works without daily permission from Seattle or San Jose? Now that’s queer.

This entry was automatically cross-posted from Elf's writing journal, Pendorwright.com. Feel free to comment on either LiveJournal or Pendorwright.
elfs: (Default)

A few weeks ago, I installed the latest version of the Gnome Accessibility Toolkit (Gnome-AT), and while I never quite got it to work the way I wanted to, it didn’t seem to be doing any harm.  I figured once I got to the point of showing the client the work we’d talk about accessibility issues.  (Many of her clients have low vision problems, so making the site super-accessible is super-important.  I’ll have a post soon about making specific zones of your websites auto-sizeable in an elegant way with jQuery.)

It turns out that it wasn’t working because I hadn’t stopped and restarted X. So, when I did that after installing some new fonts, everything went kablooey. The most tragic was Emacs, which grabbed the mouse and keyboard and never let go. Very annoying. I had to kill X remotely, logging in through my Palm pilot (which isn’t much fun, believe me.)

The problem with very stable OS’s is that when they go unstable, the events that caused the instability may be separated from the experience of instability by days, even weeks. In this case, four weeks. It wasn’t until X had died for the third time– this time is a screen session I had accidentally started it in, but which luckily preserved the output of X’s error log– that I finally saw Emacs spitting out all these “at-lock-FAIL” warnings and wondered what the heck those might be. A quick un-install of the accessibility components and I’m back up and running, but man, that was annoying.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

Functional. Elegant. Foolproof. Pick two.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

No great announcements, just a few writerly things I saw today:

#1: Regarding my recent reviews of Jeanette Winterson’s The Stone Gods, Jo Waltonnails my opinion to the floor:

The techniques of writing and reading [science fiction] have developed in that time. Old things sometimes look very clunky, as if they’re inventing the wheel—because they are. Modern SF assumes. It doesn’t say “The red sun is high, the blue low because it was a binary system.” So there’s a double problem. People who read SF sometimes write SF that doesn’t have enough surface to skitter over. Someone who doesn’t have the skillset can’t learn the skillset by reading it. And conversely, people who don’t read SF and write it write horribly old fashioned clunky re-inventing the wheel stuff, because they don’t know what needs explanation. They explain both too much and not enough, and end up with something that’s just teeth-grindingly annoying for an SF reader to read.

Exactly right, and that’s what’s wrong with everything fromWinterson’s The Stone Gods to the atrocious “science fiction” of e-book only romance writers like Jet Mykles and Reese Gabriel.

#2: The Five Stages of Publishing. See, I skipped down to acceptance right from the beginning. And it’s always worked for me.

#3: I’ve been writing again, and it’s been an iffy thing. The skill comes and goes like a guilty whoremonger. But I received an invitation for an anthology of “Queerpunk,” and have been thinking about how to work cyberpunk, homosexuality, near-future transhumanism, and I think I have an opening:

I met him in the one place where we could possibly have met: on a de-orbiting shuttle. I was coming back from another freelance job in orbit, all wracked out and drained but carrying so much new knowledge it had weight. He had a suit, and a tie, and all the signs of a lunar career.  We’d have never met if it hadn’t been for the blackout, that fifteen minutes of silence when you’re cut off from the net.  We were forced to talk to each other.  Hell, we were forced to notice each other.  Which wouldn’t have happened without the blackout.

Our seats were side by side.  But he had all the newest stuff, corporate double-signed and encrypted with Diffie Hellman Six, every one of them with a publicly visible EULA and the checkmark box visible should the Pirate Corps come looking.  And me?  Diffie Hellman nine but GPL’d, man… all the way.

I’m not sure where to go from there. I know I have to get them into bed and emotionally involved, but what’s the plot? Hmm…

This entry was automatically cross-posted from Elf's writing journal, Pendorwright.com. Feel free to comment on either LiveJournal or Pendorwright.
elfs: (Default)

In case you missed it, I’ve posted a new story in the Bastet series: Bath Night, which brings us to the most recent decade and a riff on something I read during the Iraq war.

If you’re a fan of the Singularity, here are two stories told from opposite sides of the fence: Gentle Seduction by Marc Stiegler is an early, and hopeful, depiction of the Singularity.  It starts as a riff on the seminal trans-Singularity movie Brainstorm, and moves on from there, reflecting on the character of a woman who we normally wouldn’t have thought of one of us– and it is her quality as someone not interested in the rapture of the nerds that makes her so pivotal to our success. The other is by Peter Watts, so expect nastiness, and Watts delivers: The Things is John Carpenter’s The Thing as told from the point of view of the monster. Watts manages to make us sympathetic to the creature, even when leading to an even more horrific conclusion than what Carpenter delivered.

This entry was automatically cross-posted from Elf's writing journal, Pendorwright.com. Feel free to comment on either LiveJournal or Pendorwright.

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 25th, 2025 05:39 pm
Powered by Dreamwidth Studios