sn.printf.net

2010-02-08

Despite launching my blog only last week using Markdown as my blogging markup language, after reading Eric Holscher's Large Problems in Django, Mostly Solved: Documentation, I was curious if it would be much, if any, work to switch to reStructuredText and still retain the code highlighting support I was getting from Markdown's CodeHilite extension. The actual highlighting comes from Pygments, which is stand alone and should be possible to hook into reStructuredText as well.

Why bother switching? reStructuredText is pretty well loved among the Python community for documentation, and rightfully so. Although ReST is much more extensive than I need for blogging, I see no need to be using two markup languages. Plus, it saves me a module, since I don't have to install markdown.

First, make sure you have Docutils and Pygments installed. I tend to install Python modules with pip:

$ pip install docutils pygments

django.contrib.markup comes with a template filter, |restructuredtext that converts ReST into HTML, and if that works for your purposes, go ahead and use it. I, however, following advice from James Bennett's Practical Django Projects choose to store the rendered content in my database. This way it doesn't have to be parsed every time it is displayed. I peeked into the restructuredtext filter to see how it worked:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def restructuredtext(value):
    try:
        from docutils.core import publish_parts
    except ImportError:
        if settings.DEBUG:
            raise template.TemplateSyntaxError("Error in {% restructuredtext %} filter: The Python docutils library isn't installed.")
        return force_unicode(value)
    else:
        docutils_settings = getattr(settings, "RESTRUCTUREDTEXT_FILTER_SETTINGS", {})
        parts = publish_parts(source=smart_str(value), writer_name="html4css1", settings_overrides=docutils_settings)
        return mark_safe(force_unicode(parts["fragment"]))
restructuredtext.is_safe = True

So, basically it reads in your RESTRUCTUREDTEXT_FILTER_SETTINGS and renders using docutils.core.publish_parts. Personally, it's a pet peeve of mine when I find a template tag that has built in logic that would be useful outside the context of a template tag, but in this case, the template tag function will work fine if we import it and call it from the model:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from django.db import models
from django.contrib.markup.templatetags.markup import restructuredtext

class Entry(models.Model):
    title = models.CharField(max_length=150)
    slug = models.SlugField(unique=True)
    content = models.TextField(editable=False, blank=True)
    content_raw = models.TextField()

    def save(self, *args, **kwargs):
        if self.content_raw:
            self.content = restructuredtext(self.content_raw)
        super(Entry, self).save(*args, **kwargs)

On save, I render whatever was typed into the content_raw to html, then store it in content. content is hidden in the admin (editable=False) and content|safe is used in the templates.

ReST, as documented, now works in my Entry model. However, it knows nothing about code syntax highlighting. The Pygments website has a brief entry on ReST support that merely left me confused. Here's the gist of it: you need to create a "directive" (aka markup tag) to display source code and pygmentize it. Pygments graciously provides the necessary code in the external folder of the download, or you can view it online. I have included it below, taking the liberty to uncomment the "linenos" variant option:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# -*- coding: utf-8 -*-
"""
    The Pygments reStructuredText directive
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    This fragment is a Docutils_ 0.5 directive that renders source code
    (to HTML only, currently) via Pygments.

    To use it, adjust the options below and copy the code into a module
    that you import on initialization.  The code then automatically
    registers a ``sourcecode`` directive that you can use instead of
    normal code blocks like this::

        .. sourcecode:: python

            My code goes here.

    If you want to have different code styles, e.g. one with line numbers
    and one without, add formatters with their names in the VARIANTS dict
    below.  You can invoke them instead of the DEFAULT one by using a
    directive option::

        .. sourcecode:: python
            :linenos:

            My code goes here.

    Look at the `directive documentation`_ to get all the gory details.

    .. _Docutils: http://docutils.sf.net/
    .. _directive documentation:
       http://docutils.sourceforge.net/docs/howto/rst-directives.html

    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

# Options
# ~~~~~~~

# Set to True if you want inline CSS styles instead of classes
INLINESTYLES = False

from pygments.formatters import HtmlFormatter

# The default formatter
DEFAULT = HtmlFormatter(noclasses=INLINESTYLES)

# Add name -> formatter pairs for every variant you want to use
VARIANTS = {
    'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True),
}


from docutils import nodes
from docutils.parsers.rst import directives, Directive

from pygments import highlight
from pygments.lexers import get_lexer_by_name, TextLexer

class Pygments(Directive):
    """ Source code syntax hightlighting.
    """
    required_arguments = 1
    optional_arguments = 0
    final_argument_whitespace = True
    option_spec = dict([(key, directives.flag) for key in VARIANTS])
    has_content = True

    def run(self):
        self.assert_has_content()
        try:
            lexer = get_lexer_by_name(self.arguments[0])
        except ValueError:
            # no lexer found - use the text one instead of an exception
            lexer = TextLexer()
        # take an arbitrary option if more than one is given
        formatter = self.options and VARIANTS[self.options.keys()[0]] or DEFAULT
        parsed = highlight(u'\n'.join(self.content), lexer, formatter)
        return [nodes.raw('', parsed, format='html')]

directives.register_directive('sourcecode', Pygments)

But what the heck do you do with this? You need to import it somewhere, anywhere really, where it will get loaded. I saved it as rstdirective.py and played it safe by importing it at the top of my settings.py file. Other people import it in the __init__.py of the app using it.

#settings.py
import rstdirective.py

Now you can outline code by using:

.. sourcecode:: python

    import foo #source code!

Or, with line numbers:

1
2
3
4
.. sourcecode:: python
    :linenos:

    import foo #source code!

The code should be rendered, marked up, and ready for color. Pygments doesn't come with any CSS files, although it does have a tool to create them automatically:

$ pygmentize -f html -S monokai -a .highlight > media/css/pygments.css

Basically: create me CSS under the class .highlight using the theme monokai. You can preview the default Pygments themes here. If you're lazy/confused, richleland has a github repo with the CSS files already generated, you just need to change the class from .codehilite to .highlight. Include the CSS in your template link you would any other CSS file, refresh, and enjoy!

2010-02-08 19:30

The django.contrib.comments app, like all good apps, comes with many default templates so you can get them up and running in minutes. Unfortunately, by default they will not match your website, since they couldn't possibly know about your site's template structure. Fortunately, because of the way template loading works in Django, it's easy to extend these templates to match.

You may have noticed these lines in your settings.py:

1
2
3
4
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)

When Django looks up a template, it will check these modules in order.

django.template.loaders.filesystem.load_template_source will check the directories you specified in the TEMPLATE_DIRS setting. If it doesn't find the associated template, it will move onto django.template.loaders.app_directories.load_template_source, which will look in the templates directories of apps you've listed in INSTALLED_APPS.

Barbara Shaurette recommended overriding any of the templates you wanted to customize by changing each to inherit from your base template, but there's a quicker way that lets you play dumb about how many templates there are (and any updates made to them).

Copy only the base.html template ([DJANGO_DIRECTORY]/contrib/comments/templates/comments/base.html) to your template directory and edit it so that instead of having the page markup included, like this:

templates/comments/base.html

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>{% block title %}{% endblock %}</title>
</head>
<body>
    {% block content %}{% endblock %}
</body>
</html>

... have it inherit from your base template (or whatever template you want):

1
2
3
4
{% extends 'base.html' %}
{% block body %}
    {% block content %}{% endblock %}
{% endblock %}

Using this method, by overriding just the top level template, you've customized all the comment templates, without even having to know what they are.

This method will of course work with any application. I just ran in to it specifically using the comments app.

2010-02-08 02:30

2010-02-05

If you are using django.contrib.comments for your project, it may not be immediately obvious how to get back to the page the comment was posted from. The user gets left at a "Thank you for your comment" message.

However, the comment object returns a comment specific URL with its get_absolute_url() method. If you have defined get_absolute_url() on your object, the comment URL will effectively redirect to your object's URL. It even passes along an anchor in the form of #c[comment_id] so you can automatically scroll right to the comment!

Since the posted.html template that renders the thank you message already has access to the comment object, one easy way to get the user back where they came from is to override this template by copying it to your template directory and add in a link back to the object:

templates/comments/posted.html

1
2
3
4
{% block content %}
    <h1>{% trans "Thank you for your comment" %}.</h1>
    <a href="{{ comment.get_absolute_url }}">Return to blog entry</a>
{% endblock %}

2010-02-05 19:31

For the first time, I have my own idiotic app review rejection story.  I have to say, until now I've been one of the lucky ones.  My developer app was approved in days, and every app and update I've put through has been approved with no hassles (save for the ...

2010-02-05 19:31

One of the reasons entrenched Windows users find switching to the Mac unappealing is that the interface is so different.  Different can be better. But in my opinion, after 6 months developing on the Mac, different is definitely NOT better.  I consider myself fairly used to the Mac interface and ...

2010-02-05 19:31

You probably heard that the FCC has taken an interest in Apple's rejection of the Google Voice app and requested information from the three companies.  Anyone who has read Stromcode over the past 6 or so months knows that this news makes me uncommonly happy, but I haven't posted about ...

2010-02-05 19:31

2010-01-30

Fixed an annoying UI bug where UI updates done outside the main thread fail to update until an event propagates into the main thread. Now a user can "login" to the game.

by Blake Householder (noreply@blogger.com) at 2010-01-30 00:01

2010-01-27

I finally got back into development after a long bunch of trips and wedding planning.

Now my app has the beginnings of a UI. All I have to write is 50 other things and it will be working!

by Blake Householder (noreply@blogger.com) at 2010-01-27 22:25

2010-01-13

So here’s the deal: you want to help contribute to Ubuntu in some small way but don’t want to make much effort or risk your “real” computer.  Enter ISO Testing.

Basically, you burn a disk and attempt to install.  If it works, you click a box, and if it doesn’t, you click another and file a bug.  If the installer finished but turned everything pink and that’s not really your thing, don’t check the box for “serious”.

This is one of the best ways of helping Ubuntu that doesn’t actually involve using it.  So if you have a spare computer, partition, or even VM you can basically spend about 30 minutes after downloading and submit a good test report.

To get started:

  • Go here and make an account and then click about 4 buttons.  There’s even a “I’ve started a test so others can try something else” feature.
  • A fuller explanation is at the wiki page

Benefits:

Once enough people give successful ISO test reports, the Alpha is released and the coolest of us can start general testing.  That’s where you actually use the installed system and test all the experimental new features like being slightly less brown.  But before that can happen, testers need to know they can install and update without hassle – the daily CDs are frequently unbootable for one reason or another, so that means the alpha CDs need to be good enough to install from.

Also, here is a picture of my cat:

by YokoZar at 2010-01-13 21:40

2010-01-07

holy-shit-awesome-2.jpgWe all know (well – unless you’ve under a rock) about Unladen-Swallow, the semi-Google-Sponsored optimization-focused branch of Python 2.x. Collin, Jeffrey and many others have been working tirelessly on porting the CPython interpreter over to LLVM, applying optimization patches, writing tests, etc all aimed at speeding up real-world operations and code since before last year’s PyCon – at that time, the first release was already working hard, rendering YouTube’s templates. (See the Project Plan for more information)

You probably also saw the 2009Q3 testing/performance results (here), showing a hefty speed increase for various operation. The 2009Q4 will be coming soon.

What you probably don’t know – yet, is that a PEP is coming, proposing Unladen Swallow be merged back to Python-core – specifically, the Python 3k branch. Yeah, that’s right – a PEP to merge Unladen Swallow back into the mothership, but to Py3k only. Talk about a shot in the arm!

Quoting Collin Winter:

Python 3 is the natural place for something like Unladen Swallow to land: Python 3 is clearly the future, and I think improved performance will be a strong selling point in the language’s favor. What we and others have done for Python 2 applies directly to Python 3.

One of the things we’ve really focused on with Unladen Swallow is creating a solid foundation that the wider CPython developer community can build on top of. We’ve fixed some nasty problems in the x86-64 JIT, for example, so that the CPython community can focus on the fun stuff — more optimizations! Having the basic JIT infrastructure in place and well-tested opens up a world of opportunities that didn’t exist before.

I think PyPy’s focus on research is incredibly valuable. Unladen Swallow has always been about, “what can we achieve right now?” One of our guiding principles has been, Do nothing original, don’t be innovative. PyPy is looking 10 years down the road and thinking, What can we do if we question everything? I think having those different perspectives is important to the community. So, no, I don’t see us in competition (with PyPy) at all.

There’s been a lot of talk about how slow adoption of 3k has been – a backwards incompatible implementation of a widely used language will always have slow(er) adoption then releases of the same language, backwards compatible – but I’d argue that to an extent, part of the reason is that there “haven’t been enough carrots” in the Py3k cart to provide enough of an incentive for projects, libraries, etc to move to it at an accelerated rate.

This, well – this changes things. A significantly faster interpreter, a more rational GIL thanks to Antoine Pitrou – these are the improvements to Python 3 which make it the perfect target to aim for for new projects and libraries. It should drastically help provide the impetus for larger libraries to move over. Things like these are exactly why something like the moratorium make sense, efforts can be focused on the ecosystem of python outside of the syntax, on the interpreter, the standard library, etc.

This is huge; and with a little luck, a lot of discussion and debate – and a ton of work, by the end of 2010, we’ll have not only the best implementation of Python, as a language to date in Python 3 – but the best interpreter as well.

The PEP should go out for review soon, probably within the next two weeks – and more details/information will be coming out at PyCon in February (you’re coming, right?!).

Also see Michael Foord’s post about this news too.

by jesse at 2010-01-07 02:58

2009-12-24

Sound in Wine has been a big issue.  From a user’s perspective, it didn’t work well.  From a technical user’s perspective, there were 3 different drivers to choose from and none of them worked well.  From a developer’s perspective, no sound driver would ever work well.

Wine was a victim of the proliferation of sound drivers on Linux.

At one point, Wine had separate sound drivers for ARTS, ESD, OSS, JACK, and ALSA.  None of them worked right, even if the user could figure out how to configure Wine to use the “correct” one.  Subtle changes to each API and differences between distribution versions made matters even worse.

PulseAudio was supposed to be a solution to problems like this by being the one true Linux Sound System, but in some ways it made the problem worse.  Now Wine needed a separate PulseAudio sound driver, and no one wanted to write sound driver code since the whole thing was a big mess to begin with.  Worse, the most work had gone into making the ALSA driver better, and there were a few technical reasons why it seemed like a good choice to stick with ALSA and use it as a default.*

So, the decision was made to go with ALSA and improve it a bit, and hope that PulseAudio’s ALSA-compatibility layer would work well enough.  That didn’t exactly happen – PulseAudio didn’t actually want to support some “abuses” of the ALSA API, as one dev put it.  Some users took to killing PulseAudio outright every time they wanted to use Wine.

Things got a bit political.  Was Wine at fault here, or PulseAudio?  Should Wine include a PulseAudio driver, even if it was poorly maintained?  What would the default be?  Also, what the hell were we gonna do about the Mac?

The solution, which in retrospect is pretty obvious

Wine wasn’t the only program facing this problem.  Anyone writing or porting a Linux game had to answer the question about how they would play sound – almost none chose to write 7 separate audio drivers.  Instead they all did the smart thing, and used a higher level library.

So, that’s the plan – Wine will use a sound library.  And then we’ll let them worry about actually talking to whatever sound system happens to be working best.  OpenAL is the smart choice here, for much the same reason that OpenGL was the smart choice for graphics.  We get Mac compatibility “for free” too.

Now, why didn’t this happen earlier?  Well, in fairness to Wine, OpenAL didn’t actually exist in a usable form until Wine already had sound drivers for a few years.  A similar thing happened with wikis and distributed version control systems – we eventually saw the light that new open source projects had been following for years, and the project is better because of it.

* As I understand it, a lot of Windows programs expected to be very close to the hardware and at the time many users were having issues with PulseAudio latency.

by YokoZar at 2009-12-24 14:38

2009-12-19

I’m building (and will eventually post someplace) a collection of the cooler Python snippets I dredge up. I’m looking for snippets which are:

  • Short
  • New-to-Python accessible
  • Showcase the best ideas of python – clean, simple, powerful.

The goal is to build up a small pile of code snippets that programming newbies, or programmers from other languages can look at and go “wow, I got to get me some of that”.

Anything is game; feel free to post them in the comments, on pastebin (obviously post the link), etc.

by jesse at 2009-12-19 14:52

2009-12-06

So, following the lead of several other PyCon/Python people – I thought I’d share the talks I’m pretty jazzed about, as well as some other bits of PyCon-related news.

First up – early bird registration is open – early bird reg nets you a decent discount on registration fees for PyCon, and will run until January 6th.

Next – for those of you who didn’t see the news, Mark Shuttleworth will also be doing a Keynote at PyCon – this is awesome news. I think both keynotes, his and Antonio Rodriguez’ will be great. I don’t want to speak as to the content just yet – but with two high caliber entrepreneurs/founders, I’m dead sure it will be awesome.

As for the talks I want to see – well, this is criminally difficult. I pretty much want to see almost every single invited talk we have (I’m especially excited about Alex’s, Jack’s, Joe’s and Ned’s talks. I think our invited speakers this year will be very, very popular.

As for talks that “made it through the painstaking review process” I presided over, here’s my personal “gotta see” list:

  • “Understanding the Python GIL” – David Beazley; David’s been hinting at taking his talk he did earlier this year “up a notch” – I can’t wait!
  • “Actors: What, Why, and How” – Donovan Preston. Hell yeah!
  • “Turtles All The Way Down: Demystifying Deferreds, Decorators, and Declarations” – Glyph Lefkowitz; Glyph is a fantastic, and energetic speaker. Definitely looking forward to see this dog-and-pony show.
  • “Using Django in Non-Standard Ways” – Eric Florenzano; I’ve been doing a fair amount of non-standard Django work lately, and I’m interested to see things which may apply to my day-to-day work.
  • “Modern version control: Mercurial internals” – Dirkjan Ochtman and “Hg and Git : Can’t we all just get along?” – Mr. Scott Chacon; these both apply to a lot of the work I’m doing (not the day job) and given the adoption rate of both mercurial and git, and the fact git continues to fill me with a seething rage every time I use it, I desperately need to see Scott’s talk!

That’s a quick top five (six) off the top of my head – and I could probably list out a heck of a lot more. I’m completely jazzed about PyCon this year. We’ve added a fifth track, we’ve got poster sessions, kick ass tutorials, fantastic talks, and rocking Keynotes.

So why haven’t you registered yet?

attending-pycon2010-325x50.png

by jesse at 2009-12-06 14:09

2009-11-29

Boy, writing a client-server game is hard. You have to simultaneously develop a protocol, write a server, and write a client to prove that each of the other two components are doing what you expect them to.

I feel like I haven't gotten enough done lately on this project. I need to get more done.

by Blake Householder (noreply@blogger.com) at 2009-11-29 02:26

2009-11-25

I decided that I was designing my game entirely wrong, and I have since decided to work on a different project. For those who cared, I was working on a Tetris Attack clone, which seems to be conspicuously absent from the App Store.

This new project will require me to write a server for the game, which should make this an interesting (and more difficult) task.

by Blake Householder (noreply@blogger.com) at 2009-11-25 23:04

2009-11-21

Turns out you can do callbacks with Cocos2d. Nice job hiding one of your most powerful features! Maybe they felt it was:
  1. Too difficult for new programmers
  2. Error prone, even for experienced programmers
  3. Just didn't really feel like documenting things that day
Today my main competitor set their price on the App Store to free! Thanks guys!

I really think devs are 100% shooting themselves in the foot by setting their price to free in an effort to gain popularity and convert that to sales. You can look at it as extremely low conversion rate advertising.

by Blake Householder (noreply@blogger.com) at 2009-11-21 01:24

2009-11-20

I’m pleased to announce the first stage of my roadmap to fully open Default Programs Editor with the release of Aero.Wizard and Aero.Controls.

What are Aero.Wizard and Aero.Controls?

Aero.Wizard is an WinForms implementation of an Aero Wizard Dialog. Aero.Controls is a package of a half dozen WinForms controls, intended for use with an Aero Wizard Dialog. These are some of the components I wrote for the creation of Default Programs Editor 2.0 with the revised user interface, and I’m now freely releasing them to the public.

Aero.Wizard:

Aero Wizard Info Screenshot

Aero.Wizard Info Screenshot

Aero.Wizard Features:

  • History/Navigation handled automatically
  • Page contents are children of separate container controls, which can be created in design time like a regular Windows form
  • Glass title area degrades gracefully when running a theme without glass, or on XP
  • Blank Wizard Page template included
  • Use with Aero.Controls pack to make Windows UX Guidelines compatible user interfaces

Aero.Controls:

Aero.Controls Info Screenshot

Aero.Controls Info Screenshot

Aero.Controls Includes:

Both of these projects strive to adhere to the Windows User Experience Guidelines, freely available documentation from Microsoft which provided the basis for the DPE 2.0 restructuring.

Licensing

I debated for some time on this issue, trying to figure out a permissive license where I could retain some amount of ownership without being overbearing. I settled on BSD, which in my opinion is very permissive and seems to be low-friction for other developers to use this code in their projects.

Downloading

Both projects are hosted on Bitbucket (Mercurial) and you can either clone the repositories, or download the latest revision as a zip file. I encourage anyone to contribute bug fixes or report issues on each project’s public issue ticketing system.

Aero.Wizard on Bitbucket

Aero.Controls on Bitbucket

What’s next?

With the release of this code pack, my plan for fully releasing Default Programs Editor is underway. It is now possible to fully replicate the UI with this release. The next step is for me to continue refining and documenting the base file association library the project is built on, then release that as well as the UI logic for the program itself. Be looking for that in the next few months.

by Factor Mystic at 2009-11-20 19:52

Today I got a fucking deadlock because a filename was blank. Sometimes Objective-C errors go way beyond cryptic, to where they make harder to debug the program than if it just said "ERROR: Something broke."

Now I have gravity animations woo.

I found Pinch Analytics the other day, does anyone know if it's any good?

by Blake Householder (noreply@blogger.com) at 2009-11-20 01:11

2009-11-19

Well, now I have gravity and matching implemented.

The hardest part of making a puzzle game that is a nice to look at and play is making everything not happen instantly.

Today I was reading the SA iPhone apps thread and iPhone games thread. To quote Ted, "100 pages isn't a thread, it's a fucking research project", but I'm finding it quite informative.

They pointed me to the AppShopper Blog and Touch Arcade (yes, I hadn't heard of this yet).
I thought it was pretty interesting to see the number of apps approved per day in the store.

by Blake Householder (noreply@blogger.com) at 2009-11-19 02:11

2009-11-18

Today I fixed the bug with Cocos apparently projecting my 2d game with a 3d OpenGL flag that was causing my tiles to have random gaps between them ranging from 0 to 1 pixels. Argh. Here's the code for people who care:
[[Director sharedDirector] attachInView:window];
[[Director sharedDirector] setProjection:CCDirectorProjection2D];

I probably lost the ability to make my game wave-y, but whatever, now it looks right.

I also finally found the Cocos2d iPhone docs Now I can have some idea of what the hell I'm doing.

by Blake Householder (noreply@blogger.com) at 2009-11-18 00:39

2009-11-16

In bullet point form.

  • We’re serious about a 1.2 release in the next few months.  As Alexandre said, “it’s time”.
  • 64 bit support will be the major new release goal.
  • For most people, having no regressions and working with way more apps than 1.0.1 did will be the actual feature they care about.
  • Users will need to make a new Wine installation to migrate from 32-bit to 64/32-bit capable.  It is left to me to figure out and code a humane way to present this.  This is also a convenient time to make their Wine folder case insensitive.
  • We’re giving up on separate Pulse/ALSA/OSS/Jack sound driver layers and instead doing the smart thing: passing everything to OpenAL.  Maarten Lankhorst will handle most of it.
  • Packagers like me will have to work out CJK font support for our respective distros.  Wine will need manual links to whatever font is actually provided by the distro when it’s in a CJK locale.
  • We need some help from Freedesktop.org for solving bug 10841.  Essentially we need a standard way of saying “hey reset the resolution when I’m done, even if I crash.” I was “volunteered” for the task of approaching the respective projects.
  • We need user help finishing up the Tahoma replacement font.  It’s still missing some glyphs for certain languages and some users report it as “ugly”.
  • VMware is an ally of Wine.  They use our test suite on Thinapp, and even contribute test fixes and new tests back to us.  Tests are just as good as “real” code.
  • We need more users to run git update and winetest daily (with their screens unlocked).
  • Alexander announced a new patch tracking system to prevent patches from getting lost in the nether (and for devs to know when a rejection occurs)
  • By far the largest concentration of wine developers is in the netherlands.  It has something to do with being below sea level, which means global warming is an ally of Wine as well.
  • Francois Gouget has promised to teach me every nuance to Winelib so that I can document it properly.
  • I need to update about 10 different wiki pages to give them more modern instructions, such as how to get a good backtrace (eg on Ubuntu you install wine1.2-dbg).  A recurring theme to this conference seemed to be that if it’s written in English and concerns the Wine project, it’s probably my responsibility at this point.
  • Owen is going to setup planet.winehq.org, since he’s done it before for another project.  There you’ll see my blog and a few others.  I might actually update more than once a month too!
  • Andre Hentschel is working on a Wine port to ARM.  I’ll see if I can get him a first generation Pandora (I had the misfortune of preordering two about a year ago, and they may actually arrive sometime next month).
  • Jeremy White wants help recognizing people who should come to wineconf.
  • I need to make a proper message box to indicate that Wine is loading immediately after a user opens an application (currently there can be about 5 seconds of nothing, resulting in either frustration or opening the application multiple times).  Wine should be sending the signals it needs (with xdg message) already, we just need to have the desktop listen to them.
  • I need to make a “Press” page for the website, including an email address for press@winehq.org which will probably direct to me possibly several others.  I’m curious how other projects have handled this – is it a good idea to have multiple press contacts?
  • All documentation needs to be moved to the wiki.  From there it shouldn’t be too hard to setup a wiki->pdf->docbook/xml conversion script and have the documentation build automatically based on the latest wiki pages.  Then we can start shipping it with packages again (since offline documentation still matters somewhat).
  • I’m going to experiment setting up Redmine for the Wine project.  If I can get it running well on a separate server and have it fully import Bugzilla, the Wiki, and our Git repositories then we can switch to it and start using its nice management features.  Budgetdedicated will provide the server.
  • The winehq.org Donation link needs to go to a proper web page that actually says where the money goes and what we’ll do when we raise enough.  Currently it just dumps you off to paypal without explanation.  Amazingly, some people actually give money (enough to partially fund WineConf).  This task is also mine.

I need to finish preparing for the Ubuntu Developer Summit that starts in a few hours, so the bullet points will have to suffice for now.  I’ve got my work cut out for me it seems.

by YokoZar at 2009-11-16 07:21

I got pieces moving around interactively with touches today, woo!

Some guy and some other guy quit iPhone development a few days ago.

I'm sure Apple is totally scared the iPhone is going to fail now. "Oh no! We've lost two high profile iPhone developers! Wherever are we going to find several thousand more to replace them?"

Ask the average iPhone user to name one iPhone developer. They'll say "uh... the guy who made Paper Toss?"

No one gives a shit about individual developers. Get over it.

by Blake Householder (noreply@blogger.com) at 2009-11-16 02:14

2009-11-13

Argh I still don't like Objective-C. This is like a painful lesson in why Python is such a great language. Explicitly setting pointers to point to things, allocating memory for objects, declaring things twice in .h and .m files. All Gay.

I got my developer certificate thing from Apple. Boy, did they bury the instructions to get everything set up. I was expecting an email that said "click this link, 1, 2, 3, 4, now you're done!" But I had to go dig for it.

My app is reporting coordinates that were clicked on. It's a small step, but I'm making progress.

I bought geoDefense Swarm. It's definitely been worth my $2. I recommend it to anyone who likes tower defense games.

by Blake Householder (noreply@blogger.com) at 2009-11-13 03:09

2009-11-10

Well I came to Dallas to work on iPhone stuff with Ted, got next to nothing done, but he convinced me to use Cocos2d-iPhone as a framework for my game. I think I will end up saving way more time by using this than I lost from sitting around doing nothing for 4 days.

I also found the OpenFeint dev page. Even though I hate the name, it seems like it might be useful for adding multiplayer with low effort.

Random plug: geoDefense Swarm has to be one of the best tower defense games I've ever seen, and it's for iPhone! Screenshot:

by Blake Householder (noreply@blogger.com) at 2009-11-10 09:40

2009-11-08

Working on iPhone dev with Ted. I just manage to draw two separate objects with OpenGL. It's too bad none of the Obj-C examples show how to do this. They mostly seem to focus on cramming all your geometry into a single triangle strip for efficiency.

Optimize-first design isn't really a development practice I want to adopt.

I guess Zen Bondage finally made a port to iPhone: Zen Bound.

by Blake Householder (noreply@blogger.com) at 2009-11-08 11:19

2009-11-06

Today I learned more about OpenGL ES. It's still confusing, but less confusing. I also learned the guy who wrote the "butterfly" demo of texture atlasing for iPhone is a huge douchebag that writes code that is a million times more complicated than it needs to be to demonstrate a feature. The object coordinates and texture coordinates are stored in a single interleaved array! Ridiculous!

by Blake Householder (noreply@blogger.com) at 2009-11-06 03:20

2009-11-03

Today I got a custom texture loaded into an iPhone app and made it spin crazily.

It's the little things that count.

I found out how the iPhone (and other devices) can locate you based on wifi networks alone. Apparently some companies just drive around checking for wireless networks and save their locations. Also, it appears that whenever you get a GPS fix, and then query for location data, it uses the combination of your GPS+wifi listing to store new information about the wifi networks. I wish I had gotten in on the ground floor of that.

Tutorial on how to make this icon:and this button (programmatically):
As well as 8 confusing Objective-C warnings that I expect to be seeing a lot of in the future.

by Blake Householder (noreply@blogger.com) at 2009-11-03 22:57

Today I found out that in order to have your OpenGL app run on all iPhones and iPod Touches, it has to be OpenGL ES 1.1. I'm not really sure why Apple is pushing OpenGL 2.0. I guess they have plans to phase out the old version and encourage developers to create games and graphics-intensive apps that only run on the newest hardware.

I've heard about Flash on the iPhone, but I remain skeptical. Business models that have the option for a third party to "flip a switch" and ban them make me nervous. And yes, I realize the irony of saying that as an iPhone developer, but I think Apple has less incentive to block a random app than to block Flash->iPhone development.

Jeff LeMarche's take on Flash on iPhone

My friend's company's app got approved today! MMA Underground (iTunes link)

by Blake Householder (noreply@blogger.com) at 2009-11-03 04:03

2009-11-02

I got my MacBook on Friday, and I've been enjoying learning about all its Mac-y weirdness. I've found a ton of things the Mac does better than any of the PCs I've used, here's a short list:
  • The power adapter light turns green when the battery is charged
  • Program installation is so easy, just drag a file to /Applications
  • A reasonable amount of software comes pre-installed
  • The design of the laptop is beautiful
  • The screen is way, way brighter than I could ever need
  • The multi-touch touchpad is extremely convenient
  • The magsafe adapter is something everyone should copy
However, there are negatives:
  • The laptop came with OS X 10.5 preinstalled and a 10.6 disk for some reason. Why wasn't 10.6 just installed already?
  • It's impossible to drag an item up very far with the touchpad because the hinge for "clicking" is at the top and quickly overwhelms your accuracy-strained finger
  • I don't like the keyboard, I like the one on my Dell laptop a million times more.
  • The arrow keys are squished :(
  • The mouse acceleration is all goofy, it's like it was designed for people who value the ability to select a specific pixel over people who just want to click buttons
I'm also confused, why is Apple able to provide so many programs out-of-box with a Mac and OS X, but it's an anti-trust issue if Microsoft does it? As someone on SA pointed out, Linux can read MS Office files out of the box, but MS Windows can't.

by Blake Householder (noreply@blogger.com) at 2009-11-02 21:56

2009-10-29

Iconfactory just released Pickin' Time for the iPhone, another in a long line of PBRTs (plant-based reflex testers).

I'm sort of confused as to the apparently super positive reception this app has gotten, especially after all the trouble they've had with selling apps.
I don't want to be mean, but seriously, who writes a review like:

It's sort of like an inverse-bizarro YouTube where all the reviews are super coherent and all the words are spelled correctly. (or perhaps there is some shilling involved? eh?)

Convenient list of rejection reasons from the iStore: App Store Rejection Reasons
Thinking, Boxes, & What Kittens Can Do To Them - Wil Shipley's opinion on thinking outside the box -- "don't". PS I read tons of his blog today, it's great and I recommend it to any programmer.

by Blake Householder (noreply@blogger.com) at 2009-10-29 04:33