Automatically associating users with django models on save

I have spent way too much time trying to figure out how to automatically have created_by and modified_by be foreign keys to the current user, without mucking with every view and form. Every example I could find that told me how to do this, including django’s documentation itself, told me I had to customise every view and form, which I found to be rather un-DRY.

Thanks to stealing borrowing some code from django-audit-log (in order to be threadsafe) I figured out how to update these values on any model that has them, without any fiddling with forms or views. I might wrap this up in a little project, but for now, here’s the gist.

Note that you should set editable=False on your created_by and modified_by fields so that they will not otherwise show up in forms.

If anyone is really interested i could wrap this in a self-installable package.

Generating UUIDs in PHP (for Drupal)

I have begun my quest to convert Drupal over to using UUIDs instead of IDs so that merging/branching drupal databases will be easier.

The first thing to figure out is how best to generate UUIDs in PHP. The naive pure-php approaches that use rand() have quickly proven to be non-viable (generating 10 of them hasn’t completed after several minutes), at least on my test virtual machine, presumably on account of running out of randomness.

The OSSP UUID module for PHP5 is much better, generating 60k “type 4” (completely random) uuids per second. However, the memory usage grows the more UUIDs you generate, so that could be an issue. So despite the fact that this module implies a C module that has to be available to PHP, I’m going to use it.

I will try to keep my implementation open to creating UUIDs in the DB, as PostgreSQL uses the same library to create UUIDs, so no sense in reinventing the wheel. MySQL UUIDs are broken in any sort of replicated environment (in that you can get the same UUID repeatedly from a given SELECT UUID();) so I must have a language-level version available.

So now that I’ve elected to settle on the OSSP UUID module, I can take the next steps towards making it work in Drupal.

PayPal and automated suspicion

So today I discover that, not only have I received a low winning bid on my auction of my old G5, but my PayPal account access was limited, because “We have observed activity in this account that is unusual or potentially high risk.” Initially, PayPal asked me to confirm my address and SSN, called me to be sure I was me, and made me provide a tracking number for the machine I’d shipped. I did so, providing PayPal with proof that I am the same meat person who has had an account with them for 6 years.

Here’s where it gets wierd. They decide I’m still suspicious: in fact, at this point Amber, a PayPal employee, suspects I stole the G5 I sold on ebay:

Please complete the steps below so that we may review your account further:

– Fax copies of the original bills of sale or invoices referencing your purchase or acquisition of the items you are selling along with the name and telephone number of your supplier(s)

If you are faxing information, you must use the cover page provided by PayPal. The cover page contains information specific to you and using it ensures that your documents are routed and handled in a timely manner. To print the cover page, log into your account and click on the fax documents link on the “Limited Account Access Details” page.

The best part about this email is that there is no fax documents link, nor any page with that title. (a case where an href is worth a hundred words.)
So now I have to dig up proof that the machine is mine, something slightly complicated by the fact that Vika bought it for me.

The main interesting bits here are:

  1. I was declared suspicious by an algorithm.
  2. The algorithm’s ‘reasoning’ is deliberately obfuscated from me.
  3. The human (Amber) who reviewed the case made the situation worse, not better, and demanded I follow impossible instructions.
  4. The human I called could do nothing save modify the page to show the link.

Between this, identity theft and no-fly lists, I’m feeling like we’re well on our way to computer mediated injustice, where algorithms will be judge, jury, and executioner, and the targets will be so random that no effective defence will be mounted.

Anyway, this really shows up my “PayPal is grand” perkiness of the past. I’ll use craigslist instead of ebay to sell anything else, and will try to avoid paypal if at all possible.

Weird, how pointlessly wrong one’s feelings about corporations can be. I had warm fuzzies about PayPal- they’d made my financial life much easier, in the past- but this frisking really blows it. It’s like someone you’d been casually seeing for a while turn paranoid and accusatory for no good reason.

Navigating Nodes of Influence

Missed the beginning – now we’re talking about what average users do. A bunch of examples of how people are deeply confused by the frequency of crappy links.

Survey person gets deep into a survey on internet searches. They gave up because it’s too contextual. Early adopters search different from later adopters. What kind of data you’re searching for is different as well.

Everyone starts off as skeptics. Most worrisome is commercial ties. They don’t mind political bias but don’t like commercial bias. People can be fooled. People assign credibility to bells & whistles.

People get to a point where they get confused. They send the information around to get second opinion. Use links to start conversation between human beings. Many points for actually talking about what links are about.

New gent – information seeking process is iterative. Helped create new field of information architecture. Spent last few years helping sites organize their stuff. Heart of his practice is to enable people to move between modes of browsing & searching.

Looked into human computer interaction. Learning to use human testing was humbling because people have problems. Noticed power of words; single words in a link or title helps. If they recognize a word they’ll click.

Started looking into various dimentions of the experience and hit on “findability” as the thing he wanted to follow. Wrote a book called Ambient Findability (Must be Peter Morville.

New gent says “links are the architecture of the web”. Says NYTimes is filled with links that point inward.

Another gent starts talking about how google is all about popularity and that infamy/fame are equivalent.

Went to the loo, and now they’re talking about how it might be nice to add additional information to links. There’s some agreement that it should be available.

35% of adults have created content, 57% of teens have.

Question: how to improve users. One answer: “the users use the wrong keywords” Another: “Taking thing as face value” – he suggests that people clicking on first 10 links are taking things as face falue; it seems rather to me that people clicking on the first 10 links are just trying to optimize their time.

Most people don’t live lives online like we do. Audience participant is saying that a study has shown that people will prefer the convenient answer over a better answer. A response is that people sometimes do search diligently. Another answer is every 100ft you get away from library, the # of people using it drops off. He also mentions that many people aren’t willing to slog through the dross to get to databases that have quality information.

A bit of a tangent onto sex info. Now they’re talking about how using web resources often makes it hard to get information (e.g. citation information) about a page.

Can Mapmakers Change the World?

We’re getting an overview of mapmaking and how its useful – the Mark Monmonier discusses weather sites. Then he gets into political remapping- the impact here is quite large.

Jeremy Crampton talks about “transformation” as a motiviation for blogging. Personal transformation (self discovery, Focault’s technology of the self). Second is sociopolitical transformation, or changing people’s thinking. This gathering is taking place at same time as Yearly Kos (daily Kos con). Kos wrote a book about trying to get around the traditional political approach.

He’s talking about map mashups as a transformative tool, particularly as a political one. Shows us a map of pennysylvania showing the voting records from the last presidential election, showing turnout + who voted- referring to the Atlas of US presidential elections.

Martin Dodge discusses how the internet graphs aren’t really a map but an algorithm perspective of nodes. He’s interested in bringing these points back onto the map and further looking at how the place that internet conversations are occuring is relevant.

Alexander Halavais starts with “If you fly on JetBlue, gradually you will come to believe that Chicago doesn’t exist”. Satellite photo of the conference location is nice but useless b/c it doesn’t show you where you can go. Information maps help show us where we could go in society.

How often do links cross world boundaries. Shows us a map of the US that show where they link. Turns out that all links lead to NYC. He says that listening to people have dinner conversations.
Mary Hodder starts in with this rocking video that says “we are the media” that really pumps out on the speakers in this room until some soul turns it down to mellowness; it ends with a link to josh leo’s blog.

Shows off this click-tracking website that lets you see everything some person has clicked on and see click trends and that sort of thing.

Stefaan Verhurlst talks a bit about famous Belgian map makers (eg Mercator) then gives a nice little graphic on mapmakers as change agents. He says they’re codifying and mediating existence by framing the perception of reality and also by guiding and navigating people.

Shows the european history of maps … I’d like to see the knot maps of polynesians and incans, but it looks like that’s off the board.

He argues that we now have the paradigm of interdependence(?!) because of … something about internet maps, I didn’t quite catch it.

Three unresolved issues: Identity, location, and policy(?). Policy/mediators are important. Dual use of technology- good and bad he says.

I asked about mapping non-earth info into some sort of sensible form; response was “no good way to do that yet” and “we’re trying to figure out how to take thousands of dimensions and mapping them to two, and there’s a lot of information loss”

Hodder makes the point that links need to be able to indicate more information – a lot of subtleties are lost in the simple links. It’s nice to finally hear something about how links might evolve at this hyperlinked conference.

A gent is asking a question wherein he bags my “ball of string” metaphor and says they can be useful because “maps display information”… but it seems to me like the line graph map we’ve seen so far has been a bundle of lines… and the whole problem is I don’t get what it’s supposed to be telling me.