Archive | Tech

Logging in Python

May 6th, 2008No Comments

I’ve been using log4j for a long time, but never got into Python’s logging module. But last week I was sitting in a class about logging and my company’s new standard and toolset. The instructor kept giving Python as an example (as well as log4j) of a logging system that worked with our logging repository. During a break, I asked the instructor if there was a pocket of Python users in the company. Alas he said no, but he used it as an example of something that used the same logging standard as log4j and other Java logging utilities.

Later in the week, I was faced with a problem that needed to be solved with a Python script. I thought to myself, “Why not use Python’s logging?” I did, and it was good. Very good.

I could give examples, etc. on it, but I really don’t need to — the documentation is quite good by itself. But I didn’t see a concrete example on how to get the function name into the log message, so here is my example, as simple as it is:

def saveXml(xml):
    log = logging.getLogger("saveXml")

On Evernote

Apr 30th, 2008No Comments

Some kind soul was kind enough to give me an invite to Evernote. The features seem cool, such as:

  • A Note management program for Windows and Mac.
  • A somewhat limited Web version
  • The Windows client doesn’t require Administrator rights, so I can install it at work!
  • You can send photos from your cell phone camera and send it to Evernote.
  • Evernote can search text even in the photos!

Despite those cool features, I was not very impressed with it. Here’s why:

  • The Mac client is Leopard-only. I’m still on Tiger and have no immediate plans to move to Leopard. Bad, bad Evernote.
  • The Windows version couldn’t get through the office firewall.
  • I sent a few test pics to Evernote, but they never showed up.

So I left Evernote alone, thinking that it wasn’t up to the hype.

Then, yesterday, I was looking at my Phone Contacts backup on the web (yes, we love you Verizon!) and I noted that the email address I had on file for Evernote was wrong. I had “euernote.com” instead of “evernote.com”. I looked at my phone again, and it seemed to have “evernote.com” as the email address. So I entered it again, and noted that the “u” and the “v” on my cell phone look exactly alike! Yikes! So I make sure that it said “evernote.com” this time. And then I resent a picture that I took once. In seconds, seconds that picture showed up in the Web client.

Now we’re talkin’!

I took some time today to investigate the Windows client. A search on their forums seemed to indicate that others have had this problem too but Evernote Support swore up and down that it used the same proxy settings at IE. I laughed, but thought I should try to install the latest Windows client and see what happened. I got strange errors on the first sync, so I tried it again — and it worked. Like a charm.

So then I had an image with text in it in my “thick” Evernote client, so I could try the text search in the image. And, guess what? It works nicely.

Therefore, in 24 hours I went from a “it’s a little better than hype-ware” to “Wow — it’s really cool!” But it would be cooler with a Tiger client.

Now, as a finish — I have 7 invites to Evernote. The first seven people who email me or leave a comment get them. If you don’t think I have your email address, I’ll need that too. This should be an interesting exercise, since only about three people regularly read this blog.

When “Convention over Configuration” goes wrong

Apr 28th, 20082 Comments

Exhibit A:

Passenger solves this problem by implementing user switching. A Rails application is started as the owner of the file config/environment.rb. So if /home/webapps/foo/config/environment.rb is owned by joe, then Passenger will launch the corresponding Rails application as joe as well.

It took two experienced programmers an hour and a half to figure this out. I mean, what other application runs as the user of a configuration file? It’s normal (and sensible) to run as the owner of the executable or even as the user that executes the startup but not at the user of a configuration file. If you want to do something different, mark it in big, bold letters, not some little section tucked away in your docs.

</rant>

Update

Apr 22nd, 20082 Comments

It’s been almost two weeks since I have posted anything. Must be a new record. But it’s not like I haven’t been doing anything. Here is an update:

  • Leah started soccer three weeks ago. It’s about time I posted something — the season is half done! Leah loves it — she can’t wait until the next week. They don’t actually play any soccer games at this level. Instead, each kid always has a ball and they play games to work on fundamentals, listening skills, etc. It’s a great program. Gina has some pics and a video. More pictures of our little soccer star are forth-coming.
  • A cold has ravaged our household. Leah was spared the worst of it, but both Gina and I had it really bad. We first thought it was allergies but it’s wasn’t. I just got my voice back yesterday, after struggling since last Thursday. It’s been horrible!
  • In my not-very-copious spare time, I’ve been working a Ruby on Rails project. It’s, ah, interesting. I don’t know Rails very well but my partner does and he has been mentoring me. This is my first real work with it. The plethora of plugins are nice, but it’s “convention over configuration” thing gets annoying because they wouldn’t be conventions I would ever pick. Example: starting partials with a “_” but never actually using that character when using them. Anyway, it’s been interesting and I’m learning a lot.
  • Adia posted a link about rain barrels. I’ve seen them before when I was in Australia years ago. I love the idea but I’m not spending $100 for a rain catcher. My brain is started to hatch a plan to build one myself, but I did just mention my non-copious spare time.
  • On the subject of outdoors and environment and recycling . . . last fall I decided to make our compost pile bigger. And bigger it is — much bigger than it probably should be. If anyone in Omaha wants to stop by and take a bucket or two, drop me a line. Not all of it is ready, but it would make a great starter for a pile of your own. It’s just lawn waste and a few fruit peels — no manure is involved. And if you think it must stink — it doesn’t.
  • Today I’ve been trying to get a handle on Wicket – the new Web UI standard at my employer. The “leader” of the Java UI team gave us a demo but it turned out to be more a sales demo than a technical how-to. He didn’t mention that you have to had a new log4j as well as SLF4J. And he forgot to mention that you have to put your HTML templates with your classes. Therefore, getting it working has been very problematic. And after I get it working, I don’t know what I would think of it. Maybe it’s like my problems with Rails — the concept is nice, but putting all your page representation as POJO’s instead of in configuration will just give you bad code instead of a bad configuration. Is that better? I simply don’t know.

An example of Intellij’s coolness

Apr 10th, 20081 Comment

 So I was coding away in Intellij, and did my Ctrl-Click thing to bring up a method in another class, and look what I see:

Intellij telling me to update

So I click on “Update Project”, I get the latest from SVN, and I move on with my life.

This, my friends, is coding bliss.

Page 10 of 58« First...«89101112»203040...Last »