The boring rants of a lazy nerd

Monday, June 26, 2006

Update

  • The weather is hellish.
  • Strangely, I'm excited about my current assignment. I wonder how long that will last.
  • Was ordered to give a presentation on a system I've participated in building to rest of dpt. Was horrible, because I didn't return to the big picture after each chapter so people who lost me midway had no way to reorient themselves.
  • Appears to have found a bug in IBM C/C++ compiler for zOS, systems people promised to check whether it's documented.
  • Female team member appears to be afraid of me. I didn't do anything, it's just that none of us are all ok in the head.
  • New team member is the most painfully extroverted person I've met, with no tact whatsoever, zero experience in behaving at a workplace, programming, working in teams, quasi-military reality, etc.
  • Immediate boss is control freak, not talented at management at all.
  • Services we must rely on provided by other departments don't work so it looks like our stuff doesn't work and we look like idiots to our clients.
  • Buddy got left in the sun for more than ten hours because security officer freaked and decided that state of alert equals war and he can disregard the regs. His CO couldn't do anything about it.
  • Got detention for a week for being late. Spending it in an air conditioned room with a fridge, microware oven, cold/hot water thingy, phone with civilian line and an unmonitored broadband internet connection reminded me once again that I'm not really in the army. Was kind of a vacation!
  • I work in the public sector, so it all sucks, and I can't quit because I'm under contract. Because I can't quit, they can treat me like shit, and sometimes they do. Of course they know they get shitty work from an unsatisfied, undermotivated, undertrained, unwilling, often even downright depressed and rebellious workforce, but because it's the public sector (no competition, budget is decided with no correlation to actual work being done, promotions are decided with no correlation to accomplishments) nobody cares. Does that sound cynical enough? I'm a real patriot of my country, BTW, and I believe in doing what I can to improve what I can, but really, the system fights you every step of the way.
  • Boss' boss said a number of PHB lines so bad I had to force myself not to literally ROFL on the spot. Unrelated buzzword spewage is not funny when you have to actually work with the man.
  • AM2 and Conroe both look good. Of course Conroe is designed in Israel, so I'd buy that, but if AM2 still beats Intel at price/performance with moderate overclocking, I'll probably vote for the underdog.
  • FFDB goes nowhere, but I haven't given up yet, it's just that carving time is hard when you're depressed and no one shows interest anyway.
  • The latest fandom wank sounds all exciting, but I haven't read it yet. [Ed - I've meant the mssrcibe story by bad_penny]

Take care.

Friday, June 09, 2006

Me/Work - Damn

Last week I was transferred to another development team in the department, as part of an effort to create task-oriented teams and because my boss couldn't handle me. My new boss is better, though not as good as my old-old boss and nowhere near as great as my old-old-old boss. I moved into the team's rooms, two doors down. The room now sits me, a new college grad my age (though with no experience at all and no passion for programming), and our sole remaining female developer. Who is drop dead gorgeous. Usually, in day-to-day uniformed professional environment, I am able to ignore it, mostly. Yesterday there was a Sting concert and I've seen her leave the office ready for an outing with her hair down, perfumed, etc. I had to concentrate not to drool and my mind kept returning to it hours later. Potentially very embarrassing.

In other news I was asked to recommend technology and architecture for a project without being told what the app does. Also I've rewritten in PL/SQL a view that our production server refused to perform reasonably, but because my new boss can't read PL/SQL the code-review will be… interesting. It does work though. On my way home an old lady asked me to pull her shopping cart to her home because it was too heavy for her, and then thanked my profusely after I've put it down near her second floor flat's door. We've been cautioned in basic training that old people react strangely to uniform, and they were right - it happens every few weeks.

Sundiver and Startide Rising were a breeze, though for a multiple awards winning novel, Startide Rising wasn't that great. I don't wish to read the third book in the trilogy. Is the second trilogy better? Good Omens doesn't go that fast though. The Pratchett jokes are amusing, but I don't know that Gaiman brings to the table.

Saturday, June 03, 2006

Me/Web - Bookmarks

In my nerdy ways, I tend to spend weekends the same way as I spend the rest of my time - in front of the computer. I open sites like Reddit.com and I follow links. I open my feedreader and I follow links. I open Wikipedia or E2 to check something and I follow links. At the end of the weekend, I find myself sleepy on a work night with 50 open Firefox tabs. What do I do? The sensible thing - I "bookmark all tabs" and go to bed, obviously alone. Next weekend those bookmarks are not so interesting, So I open up Reddit.com...
So now I have a backlog of 120-some bookmarks I would actually like to follow. I estimate it would take me a month, so it would probably take me six months if I step on it.

Code/FFDB/Django - Query by Many2Many relations

Neither the docs not the IRC chennel helped much, so I had to hack my way through Django's guts using my non-existent Python skills to create the following generic manager method that finds stuff according to multiple related stuff. The official docs only show how to get e.g. a publication through an article it published, but not how to get a publication that published two articles (or three, or… n). I use it to find a ship involving some characters.

class FooManager(models.Manager):
  def get_by_m2m(self, m2m_field_name, related_obj_ids, specified_only = False):
    """
    Returns QuerySet with objects that are connected to
     all specified "related_obj_ids" through "m2m_field_name".
    Limits result to only those objects that are linked _only_
     to the specified related objects upon request.
    """
    assert len(related_obj_ids) > 0
    meta = self.model._meta
    m2m = [x for x in meta.many_to_many if x.name == m2m_field_name]
    if len(m2m) != 1:
      raise 'ManyToMany Field "%s" not found in model "%s.%s"!' %         (m2m_field_name, meta.app_label, meta.object_name)
    m2m = m2m[0]
    pk_column = meta.pk.column
    m2m_table = m2m.m2m_db_table()
    source_col = m2m.m2m_column_name()
    target_col = m2m.m2m_reverse_name()
    tables = []
    params = []
    where = ['"%s"."%s" = t1."%s"' % (meta.db_table, pk_column, source_col)]
    n = len(related_obj_ids)
    i = 1
    for id in related_obj_ids:
      if type(id) != type(0): id = id.id
      params.append(id)
      tables.append('"%s" t%d' % (m2m_table, i))
      where.append('t%d."%s" = %%d' % (i, target_col))
      if i != n:
        where.append('t%d."%s" = t%d."%s"' % (i, source_col, i + 1, source_col))
      i = i + 1
    if specified_only:
      where.append(
        '%%d = (SELECT COUNT(*) FROM "%s" WHERE "%s" = "%s"."%s")' %           (m2m_table, source_col, meta.db_table, pk_column))
      params.append(n)
    return self.extra(tables=tables, where=where, params=params)

About Me

GCS d- s-: a-- C++$ UL++ P+++ L+++ E--- W+++ N o? K? w++$ !O !M !V PS-(+) PE Y+ PGP+(-) t--@ 5++(+++) !X R-- tv-- b+>++ DI+++ D+ G e h! r* y--(-)>+++