Technology

Suse 11.1, NFS, exportfs

I tried to mount an NFS volume on my MacBook at home and it was failing. I hadn’t accesed my NFS in a month since I updated to OpenSuse 11.1 or changed some network parameters.
Checking the logs on the server (/var/log/messages) showed this error:

mount request from unknown host

but the IP address seemed good. I checked the exported filesystems:

$ sudo exportfs
/home           192.168.13.*

and everything looked fine. Checked the exports(5) man page:

$ man 5 exports

and realized the “*” is meaningless in that context. Changed /etc/exports to use the /24 address for my network:

/home   192.168.13.0/24(fsid=0,root_squash,sync,no_subtree_check)

and re-exported:

$ sudo exportfs -ra
Technology

IMAP IDLE

Setting up my iPhone and various other clients to access my email via IMAP (Internet Message Access Protocol) I’d been reading about how Google finally supported the “IDLE” command and how this made “push” work a lot better. I finally got around to looking up some details. In a nutshell, the client keeps the TCP connection open; sends the “IDLE” command; and eventually the server responds when there’s a message.
From IMAP IDLE: The best approach for ‘push’ email:

How IDLE Works
IMAP works by the software on the mobile device (the client) issuing commands to the server. An IMAP server provides two things in response to a client command:

  1. An answer to the request.
  2. Information on any new messages.

This means that where a client is actively doing things with an IMAP server, it will > be told immediately about new messages. The client can then get summary information on the message to present to the user, and can (automatically) download the message when appropriate.
This means that an active client will always be kept up to date. The IDLE command deals with the situation where the client has no more requests to make. The server responds to the idle command when there is a new message (or messages) which indicates to the client that there are new messages.

Technology

Qt 4.5 released

License

Qt is now released under the Lesser General Public License meaning it can be freely linked into commercial applications.

New

Read What’s New or a more detailed description to see what’s changed since Qt 4.4 (released in May, 2008).

  • If you haven’t upgraded to Qt4, here’s what changed since Qt 3.3.4 in June, 2005.

  • Latest WebKit (aka the html display used by Apple’s Safari browser) including support for Netscape plug in so, for example, Flash can be embedded. Includes HTML 5 and CSS animation.

  • XSLT support (XML translation)

  • QtCreator is a Visual Studio like editor that works cross platform and incorporates debuging support and Qt Designer (a layout editor).

  • Mac OS X Cocoa support (latest Mac graphics library). Enables 64-bit support.

Performance

Read either Improved Performance or a white paper with more details and it requires registration so they can email it to you.

  • FileDialog is significantly faster (60x in one case)
    9CC977A0-0ED8-4046-8A9B-C1BEC82E7F69.jpg

  • QGraphicsView optimized
    E5BA610E-4C90-40A3-90EB-134156E13E68.jpg

  • Clipping sped up.

  • Added SquirrelFish javascript engine which is much, much faster.

  • Added QtBenchLib to make application performance testing easier.

Noteworthy

A few other noteworthy changes:

Politics

How to argue for more tax cuts

When you’re only policy solution is tax cuts, I guess you get pretty good at arguing for them. Matthew Yglesias summarizes the Republican arguments from the past decade.
From The Genius of Capitalism and the Tax Cut Debate:

There’s a certain beginner’s level of this. Here, when progressive tax policy has been in place during a period of growth, and that growth has led to a budget surplus, you argue not that it’s smart to balance the budget over the course of the business cycle, but rather that the surplus reflects the government “overcharging” in taxes that should be returned to those who pay the most taxes; which is to say to those who have the most money; which is to say to the rich. That’s a 1999 argument. Then if the economy falls into recession wiping out the surpluses, you argue that a tax cut for the rich is needed as economic stimulus. That’s a 2001 argument. And if the economy is growing during a period of conservative tax policy, you argue that the low taxes produced the growth so need to be kept in place forever. That’s a 2005 argument. And then if the economy falls into recession again, you argue that additional permanent tax cuts for the wealthy are the only solution.

Technology

Trivial subset sum problem

I was asked in a telephone interview how to find out if there are two numbers in
a list that sum to a certain value. I did an O(N^2) algorithm, then refined it to an O(n lg n) algorithm. Unfortunately, there’s an O(n) algorithm which I didn’t think of on the phone but came up with after the fact:

def somePair(values, Z):
    """
    Given a list of numbers and value Z, are there any pair of numbers such that X+Y = Z?
    This does this in O(N) time looking at each value, val, and checking if Z-val is
    already in a lookup table.
    """
    lookup = set()         # Store the values
    for val in values:
        diff = Z - val
        if diff in lookup:
            return True
        else:
            lookup.add(val)
    return False
if __name__ == '__main__':
    assert somePair([], 4) == False
    assert somePair([4], 4) == False
    assert somePair([1,2,3,4], 1) == False
    assert somePair([1,2,3,4], 2) == False
    assert somePair([-8, 12], 4)
    assert somePair([1,2,3,4], 3)
    assert somePair([1,2,3,4, 4], 3)
    assert somePair([1,2,3,4], 4)
News · Politics

Stimulus and the Economy

This chart from the Fed shows how far below capacity the economy currently expressed as a percentage of total capacity.
Utilization
It’s the counter argument to the proposition that the stimulus is just going to crowd out private investment. Businesses have cut back on production because of reduced demand which further reduces demand.