OpenID

January 12th, 2007

This is exciting. I just set up an OpenID identity with MyOpenID and set up josterpi.com to delegate. As soon as I can find a suitable Wordpress plugin and the time to install it, I’ll set it up here.

Simon Willison has a very nice screencast about OpenID.

Now I just need to find a place to use my fancy new OpenID…

reviewbuffer tag

December 4th, 2006

It seems I’m always bumping into potentially interested websites which I don’t have time to look over because I’m busy working on something else. Till recently, I’ve been keeping these sites open in a trusty firefox tab. This works pretty well, except that 1) over time, I end up with 30 tabs open, and 2) they’re sitting right there every time I’m looking at firefox saying “look at me! Look at me!” which is distracting. So, I’ve started tagging them reviewbuffer till I have the time to review them and see what, if any, tags I should use.

Another thing I’ve been thinking about doing is starting a linklog. Like I said, I’ve been using del.icio.us a lot more in recent weeks. A lot of of the stuff I tag is is for personal or work use, but sometimes I just run in cool stuff. The plan is to tag all of that cool stuff linklog.

Screen space

November 10th, 2006

I recently read Edward Tufte’s book Visual Explanations which I thoroughly enjoyed. I think I may go through it again, take notes, and post them. Given the visual nature of the book, that would hardly do it justice, but oh well.

One thing that he pointed out is that computer interfaces often squeeze the content in navigation, tools and borders. As thought I’d see how much space I was actually using and if I could increase it.

Let’s see what Firefox looks like:
firefox-before

The status bar is 30 pixels high. The top section is 115 pixels. Crunch the numbers [1] and you’ll find that Google is taking up only 81% of my screen. Of course, the information presented (such as the title, status information and url) is helpful, but let’s see if I can make better usage of my screen real estate:
firefox-after

By using small icons and removing the web developer tool bar (which I dearly love), I’ve increased the space that web pages use to 86% [2]. I’ve also removed a couple of the buttons that I don’t use and added the little gear button, which makes the web developer tool bar visible for those times I’m using it.

[1] My screen resolution is 1024×768 = 786,432 pixels. The status bar is 30 pixels high, running the full length of the screen, and the top bar is 115 pixels. So, (1024 x (30 + 115)) / 786,432 = 0.81

[2] I still have the status bar, but this time the top bar is 80 pixels high. Substitute 80 in for 115 in [1] and you get about 0.86

Comments!

November 10th, 2006

So I have comments on my blog now. Thanks y’all. When I set wordpress up, I told it to let me screen all of the comments first and set it up to email me when I got new comments. Turns out there was a little miscommunication. I was waiting for the emails to come in and wordpress was waiting for me to approve the comments so it could email me (you know, to let me know that I just approved a comment). In the process, I discovered what people mean by comment spam. I approved the six posts from people I know and marked the 160 junk comments. Blech.

Firefox tricks

July 29th, 2006

I’ve been using firefox for a number of years now, and I keep discovering new ways to browse more efficently. I often accumulate all of the tabs with things I may be interested in looking at in the near future, but which don’t merit bookmarking. Just recently, I discovered that the browser history can be used to this end much more effectively. Say I’m looking for page with all the options for Apache’s mod_rewrite. I know that I was looking at it yesterday, but I’ve closed the tab. Ctrl-H to open the history sidebar, start typing “mod_rewrite” in the search field, and I find it. Approximate time, start to finish: 4 seconds.

The other trick I’ve been using recently is the shortcut key to get to the Google search box in the top right: Ctrl-K. Try it. Want to search for something on Google? Ctrl-K, type, enter. (If you know exactly where you want to go, Ctrl-L will take your cursor to the location bar.

onetencommunications.com is live!

July 28th, 2006

I just finished a long, productive week of work. The highlight of the week was getting the website for one:ten communications up on the web. It was really a whirlwind project. I think we started seriously thinking about it last week and didn’t start putting things together till early this week.

My primary contribution was the implementation: html, css, and a bit of Django. I’ve mostly seen—and mostly used—Django in the context of dynamic websites. In this case, we have a website that is pretty much just sits there. While it’s probably overkill, it turns out that Django can make your life easier when it comes to making web sites that are traditionally done with just html or maybe a smattering of php.

The flatpages is the key app here. With Django’s admin, I can add, remove, and edit pages easily. Then, I put together a couple templates to abstract out the common elements between the standard pages and the profile pages. That made me happy. Having to make header or footer changes across a bunch of pages is not a good way to do things.

Fun with the Django ORM API

July 21st, 2006

I’ve had the good fortune of getting to learn and use Django for my job this past couple months. One of the really nice things about Django is the ORM and the API that allows me to do things such as this:

I’ve been working on the product database. One of the things that needed to be done was to take a bunch of products from the old site and put them on our site so that we can get a feel for what it will look like. Books like “Test book 1″ by “someone” only go so far.

One thing that is associated with each product is a thumbnail picture of the product and a bigger picture of the product. So, for the product ltpr-18758, there are two pictures: ltpr-18758_n.jpg and ltpr-18758_t.jpg. Last night I had a directory full of pictures and an excel file full of product information. So I played with it a bit and was able to pull all of the information into the database. It was cool. To save time, I just randomly added two picture to each product. This morning, I think it would be better to have the pictures be correct, as well as to associate picture and products correctly.

Django has a spiffy API to access data.
This will get all of the products:
>>> product_list = Product.objects.all()
Then, I could do something like this to get the title for the 10th book:
>>> product_list[9].title
'Some Random Book'

What I want to do is for all products, take their product code, add a “_t.jpg” or “_n.jpg” and set that to the image1 and image2 fields. Like so:


for product in product_list:
   product.image1 = "item-images/" + product.internal_code.lower() + "_t.jpg"
   product.image2 = "item-images/" + product.internal_code.lower() + "_n.jpg"
   product.save()

So, you’ll get an image1 like item-images/ltpr-18758_t.jpg

From the Archives 5

July 21st, 2006

From January 26, 2005:

So I’ve been thinking lately about organizing data. I know a lot and I’ve done a lot. In fact, I’ve consumed so much information and figured out so much stuff that I don’t remember half of it. That’s unfortunate. For work, I’ve been playing with a Wiki to manage what’s going on and help communication with the team. It’s going pretty well I think. I’ve used it more than anyone. So I was thinking, what if I could put together a website or a program or something to just put information? It would be a nice central place to store links, for example. I always end up deleted all my bookmarks/links/favorites and starting over whenever I reload the OS or change computers or whatever. So, what if I had a website to manage those? Then, what about a sort of project notebook? A place to store all my thoughts as I’m trying to figure something out, and then what I discover works. It’d be like my own personal repository of tutorials. Another idea is a place to mirror webpages. Now, this would be a bit sticky, legally, if I made them availible to the public, but I’m thinking more of a place to archive really useful sites that may cease to exist at some point. Which brings up another point. It might be interesting to have it publically availible. It might even be worth doing a Wiki sort of thing. But I definitely need to have some access control. I think something a little more flexible than public and private is also a good idea. Extensibility is critical. What about an address book? RSS agregation of other stuff I’m interested in? Google search box? Ranking sites by how often I go to them. Can I do that? something like www.mysite.com/linktrack.php?www.google.com or something like that. The key thing here is having the data accesible. Presentation of information is very important. Searchability is key. *very* dynamic. A Firefox extension, or maybe a bookmark would work like “blog this”. Ok, out of ideas. We’ll see what comes of this.

From the Archives 4

July 21st, 2006

From March 15, 2005:

One of these days I’m going to create a separate site for all my computer related writing. In the mean time, I found a couple new cool things about vim, my text editor of choice.

[Ha!  I just did that.]

First, because it has all sorts of cool autoindent features and comment continuation stuff, pasting can be a pain. It usually ends up totally messing up the formatting. There is a solution. It’s the ‘paste’ setting. Who would have thunk it? Before pasting, :set paste. After pasting, :set nopaste. Piece of cake and it works like a charm.

Next, I don’t like how vim does indenting. Eight spaces is way too much. Also, when editing code that has an existing standard, it would be nice to maintain that standard. How? The relevant settings are ’shiftwidth’, ‘tabstop’, ’softtabstop’, and ‘expandtab’. I’m not sure 100% how these all work together but here’s a stab at getting things to work:
expandtab: either on or off. When it’s on, it doesn’t insert tab characters. Just spaces.
shiftwidth: The width in characters that the auto-indent should be.
tabstop: The width in characters that the tab character displays as.
softtabstop: By default set to 0, aka off. When on, it is the number of spaces that are inserted with the tab key. Say you set it to 6, with tabstop set to 4. Then pressing tab would result in a tab character and two spaces being inserted. I think I can do evertyhing I want to without using this.

So, I think the way I want things is tabs to be 3 characters. So, set tabstop=3'and set shiftwidth=3 should do it.

What about files where it is all spaces, with a 2 character indent? :set tabstop=2 and :set shiftwidth=2 and :set expandtab does the trick quite nicely.

From the Archives 3

July 21st, 2006

From December 3, 2005:

More Eterm. I haven’t figured out the End key, but I figured out how to toggle between black-on-white and white-on-black.

This involves ANSI escape sequences. Tricksy things. \e]2;TITLEBAR\a is an example of an escape sequence. (See the previous entry) Here are the two lines that do the job:
bind ctrl alt b to string ‘^[]39;#aaaaaa^G^[]49;black^G’
bind ctrl alt w to string ‘^[]39;black^G^[]49;white^G’
I’m not sure how to explain them, so I’ll leave it at that. Here is the site where I found the escape sequences to use.