Archive for the ‘Programming’ Category

Fixed Point Decimal Class for C++

Sunday, June 17th, 2007

I recently needed a fixed point decimal support in C++ for an inventory program I’m writing. Why doesn’t one already exist? I don’t know. There’s one for boost, but since I’m already using Qt, I don’t really see a need to pull in yet another (big) dependency.

It’s public domain, and appears to work (for me, anyway). It’s all standard C++ with no extra dependencies, and should work on all operating systems (although I’ve only tested it on Linux/g++-3.4). Please shoot me a mail (tajmorton@gmail.com) or leave a comment if you find a problem. See this page for it if you’re interested (hello Google bot):

Fixed Point Decimal Class for C++

bipolar
acai berry
skin care products
aciphex prescription
acomplia discount
osteoporosis treatment
actos prescription
aleve side effects
purchase allegra
alli weight
altace ramipril
antibiotic side effects
symptoms of alzheimers
anastrozole
ashwagandha herb
astelin drug
atacand 8 mg
atarax mg
augmentin antibiotic
avandia actos
avapro online
avodart
bactrim dose
benadryl for babies
generic benicar
biaxin tablet
buspar
cardizem medication
buy cheap celebrex
buy celadrin
cephalexin drug
cialis online
order cipro
cla 1000
purchase clarinex
benadryl vs claritin
clomid medication
information on clonidine
colchicine drug
generic coreg
coumadin
cozaar medication
creatine muscle
cholesterol medicines
cymbalta drug
order cytotec
depakote drug
cheap diclofenac
differin acne
diflucan price
diovan canada
doxycycline tablets
side effects of effexor
flagyl side effects
generic for flomax
glucophage xr
hair loss
get rid of hangover
hoodia diet pills
buy keppra
lamictal mg
discount lamisil
lasix medicine
levaquin mg
levitra professional
lexapro
lipitor 10mg
lisinopril price
melatonin 1 mg
metformin medicine
methotrexate ectopic
micardis plus
mobic rx
motrin children
msm and glucosamine
drug neurontin
nexium weight gain
nizoral canada
nolvadex 10mg
omnicef 300mg
cheap paxil
penis extender
phentermine 30 mg
phosphatidylserine
plan b information
plavix clopidogrel
pravachol prices
prednisone 5mg
premarin tablets
buy prevacid
prometrium
cheap propecia
provera 10mg
prozac effects
drug online reglan
reminyl medication
buy rimonabant online
risperdal children
rogaine information

singulair 10 mg
skelaxin cost
stop smoking
strattera 60mg capsule
stress relief
buy synthroid online
tetracycline side effects
topamax for bipolar
toprol drug
drug toradol
tramadol
trazodone hydrochloride
buy tricor
trileptal drug
ultracet
pro vs con of valtrex
buy viagra online
generic voltaren
vytorin cancer
weight loss
wellbutrin xl
yohimbe extract
cost of zantac
drug zetia
does zestoretic
zithromax
zoloft side effect
buy zovirax cream
zyban smoking
zyprexa for anxiety
zyrtec coupons
zyvox

Thoughts on Usability

Monday, May 28th, 2007

General ramblings written when I really should have been doing other things:

  1. Applications should keep track of the data they create:
    In other words, don’t make the user save data and remember where they put it. Use the email application model where you start the program and your data (email) is right there, stored “in the application.” When people lose files, it’s because they don’t remember where they put them. Usually they remember which program they used to create them (e.g., “I’m looking for a text document but I don’t remember what I called it (or where I put it)…”).
  2. Tags over Folders:
    Folders seem to me to be an archaic way of sorting data. Tags are much more flexible because each file/piece of data can have multiple tags assigned to it. This applies to email apps too.
  3. Use Fitts’ Law!
    Very generally translated to computers, Fitts’ Law says that the corners and edges of the computer screen are the easiest to find with the mouse. Current operating systems don’t use this as much could. Mac OS X has the menu bar at the top of the screen. XP/KDE have the start button at the bottom left. openSUSE has a cool thing where the “Slab” (start menu) will automatically come up when you move the mouse all the way to the bottom-left of the screen.

    It would help to see a lot more of this. I’d like to see window switching in 2 corners and possibly quick access to applications along one edge.

  4. Quick Application and Document Access
    I spend a lot of time searching through my K Menu or browsing through folders in Konqueror to find a document. In fact, a lot of the time it’s much faster just to type the program’s name into the Run Command box and hit enter. Use one of the edges of your screen (see above) to bring up the most recently used apps and documents and allow the user to search for apps/docs (ala Beagle and openSUSE 10.2’s slab, but improved). For keyboard monkeys like me, let people type in the name of the app and just hit enter.

    The thing on the right is a rough approximation of what I’d like. It’s searchable (just type in konsole, Konsole is automatically selected and hit enter), it makes your most used accessible from the keyboard (activate menu and use keys to navigate). Make it pop up when I hit the right-hand edge of my screen and I’d be fairly happy.

    Most importantly: don’t make the user browse through the file system to find anything (this applies to attaching files to email too)! Use tags, full content searches, and “this app created it” for finding files.

And a lot more too. I really like what the OLPC team did with the Sugar interface–it’s a very cool reinvention of computer interfaces. Personally, I find the current state of usability of all computer environments (Linux DEs/Distros, Windows, and OS X) all equally appalling–and I suffer daily seeing people struggle with the basic concepts that “make sense” to nerds like you and me (because we think like computers), but not to normal people.

Software Name

Sunday, April 8th, 2007

I’ve written a something similar to the old USPS Shipping Assistant (creates mailing labels), but I don’t have a name for it–help, oh great internet, help!

Why is it so Hard to Write a Good Photo Organization App?

Sunday, January 14th, 2007

Yes Isak, I stole your title.

It’s time once again for the annual printed Wild Garden Seed catalog. This means pictures. And that means we need to find the pictures. And that means they need to be organized.

Applications like Picasa, F-Spot, iPhoto, and even Flickr do a pretty decent job of making your photos somewhat organized. You can tag/label/add keywords, put the photos to sets/albums/galleries, make screensavers, and burn CDs, but you can’t keep your photo collection on removable media (read: CDs/DVDs). I don’t know if this is just a case of “it’s hard”, or if the target user doesn’t need that feature. Most applications would work fine for the normal person who wants to take pictures and then find all the pictures of their dog to put on their Christmas card.

The fabled Joe Average takes at most a 1GB or 2 of photos a year. Most new computers can easily store this amount of data for years without running out of room. The problem comes with professional photographers, who might take 2GB in a month (that’s about 22/day at 3MB/photo, which is what some of the higher end cameras take). The average computer could maybe store 2 or 3 years of photos at a stretch. After that, what do you do? Buy a bigger HDD and reinstall Windows? Get an external 300GB HDD to keep everything on? What about laptops, who always are limited for storage? I suppose if you’re a large stock art company or magazine you could setup iSCSI or ATA-Over-Ethernet, but most photographers don’t have unlimited IT budgets and full time geeks on payroll.

I can only guess that the solution most people turn to is removable media like CDs and DVDs. We used Picasa to choose photos for the catalog, it was a nice piece of software, and worked surprisingly well. First, though, we had to manually look at each CD, writing down the ones we wanted, and then copying them to the hard drive for Picasa to manage. That was a pain. It would have been a lot easier to tag each photo as “lettuce” or “spider” when it was downloaded from the camera. Then, when you entered “spinach” into the search, all your images on your CDs would automatically be listed. Wouldn’t that be cool?

Of course, maybe I missed something really basic. Maybe F-Spot or Picasa already do this and I just wasted a bunch of time. I really hope so, because that would be great! But I’m afraid probably not. Which means I need to write another piece of software, or patch F-Spot, which might not be a bad idea.

Like Isak said in his post, I sound ungrateful too. I should write a patch. Hopefully I will. Soon.

Export Gallery 2 to Flickr

Friday, November 3rd, 2006

I recently had to export a photo gallery running Gallery 2 to Flickr. I guess Gallery 2 was pretty good, but it took A LOT of CPU power and my hosting account was disabled a few too many times because of it. So, I broke down, downloaded all of Gallery 2’s files off the website, setup the database, and started groking the code. Finally I got a very ugly script that sorta worked. phpFlickr saved me a lot of time! Thanks!

For the Googlebot, and people coming from Google who are interested: Go here

More Googlebot indexing: Firefox 2.0 Autopackage

Geeks

Friday, June 30th, 2006

Seen on a T-Shirt:

Geeks are people too

Oh, and what is this? According to this article, a geeks are:

Americans who use the Internet, have a home computer and own two or more high-tech gadgets.

Oh, come on.

Anyone have any geek “slogans” to stick on a T-Shirt? I’m thinking about making some…maybe.

OpenProfile

Monday, June 12th, 2006

Dammit, Google is always "stealing" "my" ideas! When you go to http://www.google.com, they must use some fancy AJAX scripting to suck the contents of your brain out through your fingertips and into a secret government database somewhere. And they get to take a look at it too.

Whatever, that probably looks really stupid.

But yes, I did have an idea very similar (almost exactly the same?) as Google’s Browser Sync Firefox extention a few months ago. Right down to encrypting/decrypting the info client-side. Let’s call my idea “OpenProfile” for now. My idea was to have a decentralized system where users are identified by their email address (e.g., tajmorton@gmail.com). The client would try to connect to gmail.com and log in with tajmorton. If it failed because Google wasn’t running an OpenProfile server, then the client would go and ask a centralized OpenProfile server who is responsible for providing service to tajmorton@gmail.com. The client would then connect to that server like normal.

Although this makes the system somewhat centralized, the entire network would not fall over if the centralized box went offline. It does encourage use of a universally unique identifier (no two people can have the same email address), which I think is really needed. It would be so nice to be able to go to any forum, blog, website (slashdot, digg, kuro5hin, etc), and webservice and not have to go through the same hassle of registering, choosing an username, filling out your email address, name, etc, etc, etc. [1]

OpenProfile wouldn’t just be for your Firefox profile. My idea was that many applications could store their configuration in your OpenProfile account, and you could go from computer to computer carrying around your config info. Apps that could use OpenProfile off the top of my head:

  • Web Browsers (bookmarks, saved passwords, etc)
  • Email clients (account info)
  • IM Clients (account info)
  • RSS Feed Readers?
  • Newsgroup readers?

Obviously other apps, too. For some applications, carrying around settings without data wouldn’t make too much sense (word processors, for example). OpenProfile would be for people on the road who just want to check their email and chat with their friends, not those who want to write their thesis/book/code at a cyber cafe computer. I guess OpenProfile could end up being a whole remote file system, but network file systems are always so terribly slow (unless a genius designs them).

That’s my rambling nothingness for the night…


[1] I guess this is what OpenID is trying to achieve, however they chose a website URL instead of an email address to identify people. I don’t fully understand the logic behind this, but it seems a bit weird to me, as not everyone has webpages, and some people have more than 1. Also, adoption currently sits at ~2 (LiveJournal and Blogger, TMK).

Ancient GUIs

Friday, June 9th, 2006

Wow, I haven’t posted here forever. I’ve been buried under the bureaucracy of the DMV and school system. Here in Oregon, you can’t get your “Learners Permit” (a kind of semi-drivers license that lets you drive, but only if you have an adult in the car) unless you are enrolled in a school, have a high-school diploma, or a GED certificate. Being home schooled, it’s a little hard for me to prove that I’m enrolled in school, so we decided that I might as well just take my GED and get it over with. However, you can’t take your GED until your 16! So, this April, we started slogging through all the bureaucracy. First, we went to LBCC and got my GED authorization form. This we filled out, then sent in, they screwed with it, sent it back to us, we filled it out some more, and then sent it back to them. They then sent me my “Authorization to test for the GED”. Then, we went to the DMV to get my Photo ID, so I could prove that I was actually Taj Morton when I went to fill out more GED forms and take my test. However, we didn’t have my “real” birth certificate, only the one from the hospital (which apparently isn’t legally valid). So, after getting my real birth certificate from vital records, I got my ID. Then, we headed out to LBCC, where I filled out and signed a million forms. The result? I’ll be able to test in July.

Anyway, here’s something that I found pretty cool: GUIs on ToastyTech. All those old OSes that you weren’t alive to see. I found it very cool…finally I know what Microsoft Bob looked like–ugg!

Yay, we’re going to all 3 fiddle camps. They’re all in July, 2 of them are back-to-back. Fun!

PHP is cool!

Saturday, February 25th, 2006

You probably already knew that, but I’ve been rereading Programming PHP while laying in bed being tired and sick :(. Nice reading material, I know, but I’m a geek, so go figure. I get to implement a photo gallery into osCommerce, fun! Maybe more fun than printing by drawing on a canvas–just maybe. So that’s my random, pointless post of the day–sorry.

Oh, and Happy Birthday Mary (hmm, that capitalization doesn’t look right at all)

Why do I write these things, anyway?

Thursday, February 9th, 2006

I wanted to make a blog post, but couldn’t think of a good title, because I have no clue what to write…I still don’t.

Let’s start with the weather; It has been beautiful spring weather. For the past 2 weeks, it has been ~13°C (55°F), the sun has been out, no rain–just beautiful. This is following about 4 weeks of very heavy rain, so I may be slightly biased, but it is nice. Not that I don’t like the rain, I do! Changes are nice every now and then, though.

Anyway, what have I been doing? Not outside in the sun, no–inside, with the blinds down, in my nice dark hole (aka, the kitchen table). We bought an HP OfficeJet Pro K550 because a) our old HP Deskjet 932C was dieing, and b) the Deskjet didn’t “print pictures too pretty.” We have the K550 dtwn–not sure what the dt stands for, but wn stans for “Wireless/Wifi network”. Yes, we have a wireless printer, it’s very sweet. We could have gotten a wired one and saved about $20, or we could have gotten one with no networking and used our Netport (a device from Intel that has a 10Mbit ethernet port and a parallel (LPT) port) and saved about $60. But wireless was a good deal, given that we currently have one free port on our wireless router. Yeah, we have a crappy IPv4 router with 4 LAN ports and 1 WAN port, plus an antenna. Whatever.

This printer is sold as being Linux compatible (yes, I check, I’ve been burned before). Not trusting the people who want my money to always tell the whole truth, I checked LinuxPrinting.org (an awesome site, by the way), and the printer is reported as “Working Perfectly”. Great, I say–piece of cake! The first sign of trouble was that there was no mention of this printer on the CUPS drivers list where you select the driver for your printer. “No problem,” I thought, “Just download the PPD from LinuxPrinting.org and copy it into /usr/share/ppd. I did that, restarted CUPS, and the driver appeared–yay! So, I printed a test page, network activity occurred, the printer picked up a piece of paper and printed:

* Unable to open the initial device, quitting

*sigh* A few more pieces of paper, a little digging through the CUPS debug log, and a little Googling gave me a few hints. GhostScript didn’t like the OfficeJet K550, and was giving that cheery little message. I headed on over to the hpijs project page (HP’s drivers page for their inkjet printers). After reading some obscure ChangeLog, I found that support for my printer was only available in hpijs-2.1.8 and above–Slackware ships with version 1.7 (yes, even slackware-current). Heading on over to the SF download page, I discovered that hpijs is no longer distributed (last available version is 2.1.6), and is instead contained in hplip package, which is used for HPs Mopiers, or whatever they’re called–a printer, scanner, copier, fax machine, whatever all in one box. Turned out that LinuxPackages.net had a hplip package of “sufficiant versionage” (is that even close to a real word?). I used the one for Slackware 10.2, version 0.97p2, I beleive. I downloaded it, uninstalled the hpijs package, installed hplip and its dependecy net-snmp, re-downloaded the PPD from LinuxPrinting.org, restarted cups, readded my printer, and I was good to go! Yay!

EDIT :: You need to install the netsnmp package too.

Boy, I bet that was an exciting read. I really just posted it so that people who have the same problem might get an idea about what to try.

Back to the weather. I was outside a few minutes ago, it was warm! (Getting tired of those <em> tags yet? So am I.) Amazingly warm for the 2nd week of February. It actually felt a little bit like August. Or maybe it didn’t, but it reminded me of August, which means it reminded me of all sorts of great things–Booher Camp, Willamette Valley Fiddle Contest, harvesting seed (oh yeah, that was reeally great, *sigh*). The Gaston fiddle contest has worn off me and I am missing my fiddle friends again. :( Oh well, the first fiddle camp isn’t until July, I guess I’ve got to wait a while…

On the QuickI front, it looks like I’m back to manually drawing on canvas again for printing. QTextDocument just doesn’t give me enough control. For example, I cannot set the border of a table (cell) to be exactly what I want. It’s like <table border=”1″> vs <table style=”border: .5em;”>. QTextDocument uses the HTML table border approach, using some sort of set widths that TrollTech came up with. 1 just is too big to make stuff pretty. Maybe I’ll try a simple sketch/mockup if I’m not too tired after I post this.

No, I did not “fix” the timestamp to say exactly 11:30 last night–it just happened.