Saturday, March 14, 2009

PDFEdit

The IRS has PDF tax return forms. Normally, if you want to enter your own values into the form you download Adobe's Acrobat. Normally, I think Adobe makes shoddy products that I don't want to use. So I thought I'd use a free alternative.

First, I used fink to install kpdf. Which worked fine, if you want to read PDFs and you don't want to edit them.

So I searched around and discovered PDFEdit, which is supposed to edit PDFs.

It isn't available in my package manager, fink, so I downloaded the source and tried to compile it. I'll share some notes here because I found some oddities.

I used fink to get all required libraries. This puts them in /sw/lib. No big deal.

Configure required the following command:
>sudo ./configure --prefix=/usr/local --with-boost=/sw --with-boost-libdir=/sw QTDIR=/sw/lib/qt3

Notice that the QTDIR is set on the command line. Which is weird, because it is in all of my environments already. But without this addition, the command won't work.

now, if you try "sudo make", the script will barf on what appears to be a ranlib command. So I tried the command interactively to see about the error, and it worked fine. Turns out the problem is QTDIR again, so the following command worked:
>sudo make QTDIR=/sw/lib/gt3

And once again, "sudo make install" won't work without QTDIR, so once again:
>sudo make install QTDIR=/sw/lib/gt3

Now the program runs, and to the extent it is capable, it works. But "works" is different than "works as expected". Sure, PDFEdit will let you edit PDFs, but you need a degree of patience that I don't possess. This tool is, in my exaggerated opinion, a single step up from using a hex editor to modify PDFs.

Look at this screenshot (click to enlarge):


You simply selected a field, the social security number, and then use the panel on the right to pick out the PDF element from a tree, and then use the panel on the bottom right to insert a new value. I'm not sure whether to select l, m, s, l, or m from the object list. I'm not confident that changing any of these values will avoid PDF corruption. The process is scary.

If I'm scared by this software, I can't imagine what other users feel.

I'll stick to a pencil.

Thursday, February 19, 2009

Sometimes it is fun to goof around

#!/usr/bin/python

fiblist = [0, 1]

def fib(n):
  if(len(fiblist) < n):
    fiblist.append(fib(n-2) + fib(n-1))
  return fiblist[n-1]


Because sometimes it is more fun to goof around than to do homework.

My first version didn't keep a list, so the recursion got hairy quickly.  I tried fib(100) and waited long enough to expect an out-of-memory error for the VM stack rather than an answer.  The list version (shown) is as fast as the blink of an eye for fib(100), but it overflows to Long and I'm not sure whether Python retains significance or only retains magnitude.

I've always liked the fibonacci series.  When I read The DaVinci Code, I remember getting most of the mysteries right without cheating.  I think one or more had to do with this series, but I don't remember anymore.

In grade school math we had to draw a poster based a geometric theme.  I drew a series of circles whose centerpoints lied on a logarithmic spiral with diameters of the Fibonacci series filled with colors whose wavelengths approximated the Fibonacci numbers over the visible spectrum for the number of circles that fit on the poster.  It took a long time and a lot of thought.  I received a "C" because there "wasn't enough math."  In truth, the geometry was there but not perceptible if you didn't know where to look.

I liked my poster and I didn't care about the low marks.

Besides Dan Brown's Fibonacci parlor tricks, another source of "mainstream" Fibonacci goodness comes from Tool's song Lateralus.  The syllables in each line arpeggiate the Fibonacci Series.  There are tons of logarithmic easter eggs too, such as the lyrics starting 1.617 minutes into the song.  Swing on the spiral.

Thursday, December 11, 2008

Shopping History Horrors

Over a decade ago, when I was a teen, I bought a Star Wars book from Amazon (along with a dozen other books that summer), decided I didn't like it, and never bought or read another.

But Amazon remembers.  And every time I visit their website, it suggests a bevy of Star Wars books that I might like.

I can't make it stop.  I've tried.  I've tried.  I've tried.

The reason I can't change it is because when Amazon suggests an item that you might want, it will discount the price to help entice a sale.  Like all good systems, people began to game the system and force Amazon to recommend big ticket items so that they reduce the price (5% really adds up on a $2000 computer).  Once word got out, Amazon changed their policy to make it harder to guide their suggestions towards the items you were going to buy anyway.

I guess it shouldn't bother me so much.  But this all relates back to a simple fear that other people misunderstand my positions.  I suppose this entire post is built on that fear.

Saturday, November 8, 2008

Copyrights and Google Reader

I am not a lawyer, you are not my client, this is not legal advice, if you want legal advice then hire yourself a lawyer.  This is a blog for my personal entertainment only.

I recently read a case where Perfect 10 (P10), a company who sells images of naked ladies, sued Google for indexing P10 images on the Google Image Search (GIS).  508 F.3d 1146 (9th Cir. 2007).  GIS finds an image on the internet, turns it into a searchable thumbnail, and then links to the original.

P10 says that Google is infringing upon a copyright.  Google defends on "fair use".  Google wins because the thumbnailing step is "highly transformative", serving a different function than the original.  Those looking to buy the original aren't likely to settle for the thumbnail.  Google isn't hurting P10's market (at least, P10 didn't prove that Google was hurting their market).

To skip some steps, Google creates and hosts "original" thumbnail copies, and simply links to the full size images hosted on other websites.

This is a good time to repeat my earlier disclaimer.  IANAL.  YANMC.  TINLA.  For entertainment purposes only.

If, supposing alternate facts, Google hosted full size pictures instead of thumbnails, then their use would not have been transformative, and they probably would have lost their case.  And this brings us to the heart of today's post.  When Google hosts a full copy, it may be liable.

There is so much more that can happen here.  Copyright law is applied on a case-by-case basis.  Anything could happen.  17 U.S.C. §107 intentionally avoids bright line rules.  No presumptions can be made.  I cannot say this any clearer — this is just for entertainment.  I haven't done my research and google probably already won its battles.

How can Google Reader allow me to copy a webpage and publish the result on my shared list?  Check out my latest post for an example: My Shared Items

I just posted a picture of Max Biaggi riding the 2009 Aprillia on the amazing new Portimão track.  The image is linked from SuperbikePlanet.  Said another way, the image is not hosted on Google's server.  That is a good thing for Google's liability.

But the text is not linked.  Well, a link exists.  But the article (this happens to be a one sentence article) is copied in full.  Non-transformatively.

I could run through a boring fair use test.  Instead, I'll just conclude that this stuff makes me wonder.  Maybe it is permitted because the site permits Google crawling.  Maybe because much of the Reader material is published by RSS anyway (a copyright holder can't really publish and then expect privacy, right?).  Maybe the commercial use is minimal (though I think the commercial use is pretty strong — Google gains a lot of valuable information on me and my friends, and then shares it with spooks in a Virginia bunker).  Maybe, maybe, maybe.

One of my favorite uses of the "note" button is to take an annoying burned feed and share it in full.  Is that fair use?

What would the Roman Emperor do?

Saturday, October 18, 2008

Fall Fashion: Horizontal Stripes

The trees are changing colors and I decided to take advantage of a sunny day by working on a project I've been planning for at least a year now.  The concept is simple: trees look really good in the fall and I could take stunning photos.  But I wanted to capture more than just a few trees.  I wanted to take pictures of Portland.

My photos have more than just pretty trees.  These photos also have power and telephone lines.  You'll feel like you are in Lake Oswego on a sunny fall day, surrounded by all the colors of the rainbow represented in the delicate texture of fading leaves.  And by our fine city's vast cable network.  If you've got the telephones, flaunt it.  Don't be shy.

I've shared a handful of photos at my gallery here.  Please check it out.  All photos are unprocessed, unfiltered, 21mm.

Thursday, October 2, 2008

Summer is Over


Today feels like the first day of Winter.  Many people think of winter as the season starting in late December and lasting until the flowers bloom.  As a former Alaskan, I think of Winter as the season starting around the first snowfall in late September or early October and lasting until Break-Up in April.  So this is the right time of year for Winter to come, in my little world.

The rains came heavy today.  We have a new season.  Time to start wearing a jacket.

Tuesday, September 30, 2008

For the record

OK, sometimes I think I'm a computer smart guy.  Capable.  And all that.

Today I spent 30 minutes trying to figure out why Google Reader doesn't save my password.  I started with my browser, telling it to autofill.  When that failed, I updated my keychains and removed the entry for Google so that I could make a new one with the right properties.  When that failed, I reset my browser, deleting all cookies and stuff.  When that failed, I didn't know what to do.

All of this takes 30 minutes because fixing problems on a computer is mainly about perseverance.  It still didn't work.  So I persevered.

Ultimately, the fix was to adjust my bookmark.  It took me to a login page instead of to the general page where it would remember my login.

Fixing problems isn't about knowing the solution.  It is more about trying and trying and not giving up.