Archives
- April 2008 (2)
- March 2008 (6)
- February 2008 (14)
- January 2008 (9)
- December 2007 (12)
Quarks and Bits, and the Ever Increasing Demand for Bandwidth
January 27th, 2008
Physics has the convenience of being able to speculate that any given particle could potentially be composed of yet smaller particles. I realize that the credulous limit of building-block particles has probably been reached, theoretically; whether quarks or super-strings, or what have you. But even those thought experiments were a giant leap from the already miniscule building block particles of atoms, protons, neutrons, electrons.
In computer science, we don’t really have that luxury. A bit is not ever going to get any smaller. There wouldn’t even be a lot of meaning to speak of a “half of a bit.” This is easier to see if you view a bit as “on or off”, or as a true::false, yes::no, 1::0 pair. In a true or false question, does “half of a true” even mean anything?
The whole model breaks down if you allow a bit to be anything other than on or off. It doesn’t have a “size” per se, it is by definition the smallest digital component there is.
Looking at bits from an electrical engineering standpoint, where a receptor might view a pulse of a certain strength as an “ON” bit, and a weak pulse as an “OFF” bit, it makes marginally more sense to speak of bits getting “smaller”. Theoretically, the amount of electrical current needed to indicate an ON or OFF bit would be determined by the sensitivity of the components; if a component can distinguish accurately between very slight signals, that’s really all that’s needed. But the “bit” hasn’t gotten any smaller, functionally. It’s still a bit. You still need eight or sixteen of them to represent character data; and so on, and so on.
Physicists can always hope to find and learn more about yet smaller and smaller components of the universe. Not us. Computer scientists are stuck with the bit.
This silly line of thinking arose when I was thinking about bandwidth (in the sense of data transfer, not the electrical engineering sense). As we go forward, the need for greater and greater bandwidth seems to loom as one of the more daunting technical problems we’ll be solving in the next decade or so. If you were to make a straight analogy with physical pipes, one logical step would be to make the material that you are pushing through the pipe smaller. More bandwidth automatically, right? Except that the information being shoved through the pipe isn’t going to get any smaller.
(I suppose we could somehow mandate that all network traffic must be gzipped or otherwise compressed; that might help a little, but I think it would be close to impossible to enforce without altering the open nature of the Internet.)
So, we’re left with making the pipes bigger.
Looking around a little, NegaBytes has some interesting tips for optimizing HTML and CSS. A lot of them involve simply using fewer characters—single character class or ID names, single character javascript variables. It’s certainly a tautology that doing this will save bandwidth, but it seems to be that it does so at the expense of code maintainability, at least to a certain extent.
I’m neither a physicist or an electrical engineer; so if I’ve oversimplified my analogies, or otherwise embarrassed myself here, feel free to let me know. :-)
Rails And Shared Hosting
January 12th, 2008
Just found and read David Heinemeier Hansson’s post on The deal with shared hosts, and Dallas’ from Dreamhost posts on How Rails Could Be Better and his riposte. All interesting.
And, it turns out, pertinent to my own situation, as I’m currently using Dreamhost’s shared hosting, and trying to run Rails on it. This blog is the only “real” Rails app I’m running, and I didn’t write any part of it. I’ve started doing my development on my own local machine (as it seems to make a lot more sense to do it that way), but I’m obviously going to want to eventually deploy what I write to the server.
Now, with only one real exception, I’ve had little trouble with Rails on Dreamhost. Everything has mostly “just worked”. This blog stopped working for a bit, but it turned out that all I probably really should have done is re-run dispatch.fcgi.
So on the one hand, we have a group saying “Rails should be easier to run on shared hosting.” On the other hand, we have a group seeming to say, “Real Rails developers don’t use shared hosting.” (To be fair, what Hansson really said was that he’d love to see Rails run well on shared hosting and that the Rails team would happily cooperate with anyone wishing to work on that challenge.)
I’m reminded of a quote that stuck with me; it’s from Hansson’s keynote at RailsConf 2006. (emphasis added)
I don’t really think Rails currently is in a position where it should bend to the outside world. I think we’re actually working very well at bending the outside world to us.
I’m not going to try to defend or condemn that statement. Rather, I’m going to suggest that an “opinionated” framework, like Rails, would not be possible without that sort of attitude. Like it or not, I’m not sure Rails would be what it is without it.
So yes. Let’s have people who are interested and capable looking into the issue of improving the performance of Rails in shared hosting. The hosting companies will like it, and from Hansson’s post it’s clear that the Rails core team will welcome such improvements as well.
But let’s not think that Rails developers should drop everything and work on a problem which is not really “their” problem.
RubyGems And Dreamhost Shared Hosting
January 10th, 2008
If you want to be able to install gems locally on a Dreamhost shared hosting plan, you should be able to do it. You’ll need to set some environment variables; here’s what I’ve done.
If you try to install a gem in your dreamhost shared hosting account, you’ll get a permission denied error. That’s because rubygems is trying to put the gem in /usr/local/lib/ruby/gems/1.8/ and, I’m sorry, but you can’t write to there. Now, you can do this:
[your-DH-server]$ mkdir ~/mygems
[your-DH-server]$ gem install some_gem --install-dir ~/mygems
This will let you install a gem, but there’s still a problem: rubygems is not going to be able to find the gems you install in that directory. You could change the GEM_HOME environment variable to point to ~/mygems (or whatever you want to call your gem directory), but that would be a bad idea: rubygems would no longer be able to find the gems that are already on the Dreamhost server (and there are quite a few). Also, GEM_HOME (as I understand it) should only point to one gem repository. However, there is another environment variable, GEM_PATH, which can have multiple directories in it. So, we’ll do this:
[your-DH-server]$ echo "export GEM_HOME=/usr/local/lib/ruby/gems/1.8/" >> ~/.bashrc[your-DH-server]$ echo "export GEM_PATH=$GEM_HOME:~/mygems" >> ~/.bashrc[your-DH-server]$ echo "source ~/.bashrc" >> ~/.bash_profile[your-DH-server]$ source ~/.bashrc #just so you don't need to log out and back in for ENV to changeBasically, what you just did is tell bash to set a couple environment variables as soon as you start a new shell, ie, any time you log in with ssh, for example. By setting GEM_HOME first, and adding it to GEM_PATH, you make sure that all Dreamhosts gems will still be findable. So will yours.
Now, other than to confirm that this all seems to work, I haven’t tested this extensively, yet. Use at your own risk.
I believe you can also put libraries which would normally be installed as gems into your vendor/ directory in your Rails project — Mephisto does this, for example. Presumably, this is to make Mephisto easier to install — they don’t need to have a long “howto” about installing various plugins or gems before Mephisto will work.
I started out wanting to talk about Rails on shared hosting in general, but I’ll save that for another post. If this post was helpful or interesting, please consider leaving some feedback in the comments. Also, if I have anything wrong, or if what I’ve suggested could cause some other problem that I haven’t considered, please let me know!
Convention over Intuition
January 10th, 2008
So, thinking about usability.
There’s no particular intuitive reason why a logo in the header should be a link to the site’s home page. Or on a blog, why the header graphic, which more or less serves as a logo or brand identity for the blog, should be a link to the home page.
Then why do I get frustrated whenever I get to a site where the main header graphic (logo, site name, icon) is not a link back to the main page? (Chris Brogan, this means you, too!)
It doesn’t really matter that there is also a main navigation button saying “Home” right on it. I “intuitively” expect the main graphic or logo in the header to be a link back to the main page.
Note — I said “intuitive”, but it really isn’t. Like I said when I began, there’s no real world analogy which would cause us to think that this would be so. There’s no human DNA or instinct, or even cultural norm (that I can think of), which would cause us to think in terms of what should be hyper-linked and where it should point.
Rather, it’s become convention. A convention so ubiquitous that I think it could be argued that it has become intuitive to believe that the main logo or graphic in a header is also a link to the main page.
I always click on the header graphic or logo, without thinking about it, if I intend to return to the main page. I only look for a “Home” button if this doesn’t work. I admit; it’s ingrained so strongly for me to think that the logo will be the link that I’ll usually click it twice before moving on to look for a “home” link.
In an extreme case, esr’s old blog (I say “old” because the last post was in Summer 2006) did not even have a link of any kind to return to the home page. If you clicked into a single post, you had to either use the back button or (gasp) actually edit the URL in the address bar in order to return to the main page. (Of course, programmers being poor interface designers is a sad-but-true joke as old as computing itself, so perhaps that’s not too surprising.)
So; if the main graphic or logo on your site does not link back to the main page, I would at least encourage you to ask yourself “why not?” Is there some conscious, purposeful, tangible reason why using the logo to link to the main page (even if you already have a “Home” button/link) would be a Bad Thing?
Because if there is no reason not to do it… and if doing it would increase usability for a substantial number of web-surfers… why would you not do that?
Comments welcome!
Computer Science Tomorrow
January 9th, 2008
Hiatus
January 8th, 2008
I’m going to take a brief hiatus from this. That’s not to say that I won’t be posting at all, but I’m not going to be keeping a regular schedule. If you like the sort of thing you’ve read here and on my previous blog, you may want to subscribe to the RSS feed so you can see when it gets updated. If you’re into that sort of thing.
Reasons for the hiatus are many and varied, but it boils down to what I think will be the best use of my time over the next few months.
- I’m taking 3 classes, one of which is Calculus 2 and another of which is Software Engineering, and is an online class. I imagine these alone will take up a good deal of time throughout the week if I intend to do well, which I do.
- I work full-time. That cuts out 8-9 hours per day.
- In the time I have outside work and school, I intend to start one or more software projects, or else begin contributing to an existing project. This has been a goal of mine for some time, and splitting my energies in various directions makes it difficult to focus.
So, I’ll be taking a bit of a breather. Please do subscribe to the RSS feed, or at least check back now and then to see what’s happening.
Shalom!
The RSS Gap
January 7th, 2008
Been thinking a lot about markets and technology. What I’ve noticed is that if you are somewhat of an early adopter, and if you tend to hang out with a great many other early adopters — even if said “hanging out” is just in places like Twitter or irc — it’s very easy to forget that the average internet user does not even know what RSS is.
Stop for a minute and think about that. I’m pretty sure the average user of the internet not only doesn’t know what RSS is, but doesn’t care, and probably would not understand what the big deal is, anyways. This user is not dumb—it’s just that either:
- they don’t have any pains or problems that RSS would be a solution for. Or…
- no one has successfully explained or demonstrated how RSS could or would be a solution to some pain or problem they are facing.
And many people don’t need RSS in the way someone like Scoble uses it. Imagine this conversation:
Me: You know, you really need to start using RSS. It will make your life easier.Non-geek: Really? Sounds interesting; how so?
Me: Well, you’ll be able to track hundreds of blogs and news feeds in a lot more efficient fashion…
Non-geek: (interupting) Why the hell would I want to do that?
RSS is just one example.
Another might be Google. You might hear someone say how Google is this huge force that dominates the internet, and how all our data is there.
The average user would probably be a little confused by this statement; they might use Gmail, but they just as likely (maybe even more likely) use the Yahoo! or hotmail account they’ve had for years, or maybe their email from work, or possibly even (gasp!) an AOL account, or simply the account provided by their ISP, including the crufty html interface the ISP provides to access said email. They probably don’t use GoogleTalk, Google documents, Google Reader (no need for RSS, remember) or any of the other Google tools and applications. They might have a blog which they may or may not regularly use, but that blog is as (or more) likely to be on MySpace, Xanga, or LiveJournal than on Blogger. Google, to this user, is just a search engine, and a company that sells text ads. They probably know that it’s the most popular search engine, but that’s likely to be about it.
So, Google “taking over the world” isn’t really realistic to this person. (If only they knew. ;-) )
Anyways, back to things like RSS. I think these will continue to grow as tools and will become more ubiquitous, and yes, the average user will be using them.
But they probably won’t know they’re using them.
The key to widespread adoption will be the creation of tools that solve problems or make life easier in ways that people understand without having to read up on what RSS is, or Atom. Don’t even let people see lists of RSS 0.99, 1.0, 2.0… they’re liable to think that this is one thing which just got updated a few times, and telling them that it’s actually several projects that could even be seen as competing standards is only likely to cloud the issue.
No, don’t even tell people they’re using it at all, any more than you tell people who are new to the internet that they’re using HTTP and that their browser is rendering HTML and various other markup or programming languages. No, you just teach them to type into the address bar, to recognize and click links, to use “tab” to get through forms, possibly some keyboard shortcuts. They don’t care if it’s HTTP under the hood or not. It’s the Internet; get them to ebay.
I used to think that the answer (if one was needed) lay in educating people about what RSS is. I don’t really think that anymore.
The answer is solving the users’ problems. If that solution uses RSS, Ruby, Python, REST, web services, or whatever—nobody cares!
(Nobody except you and me; unless, of course, you don’t. I’ve assumed throughout this whole post that the reader is also an early(ish) adopter of RSS and related technologies, which is actually the same assumption that I’m warning against. My bad.)
How To Screw Up Your Mephisto Blog
January 4th, 2008
For some reason, this app stopped working last night. Not sure what happened… it’s possible it had to do with Rails being upgraded to 2.0.2 on Dreamhost’s servers, but now I’m not so sure. I might have been able to fix it just by killing and re-running dispatch.fcgi, which is basically “rebooting” a Rails app on dreamhost.
But, did I do that?
No. I followed some advice and froze Rails in 1.2.6, in case that was the issue. I’m not so sure it was, but in any case, initially doing that did not seem to work.
Then further into the comments on the previously mentioned advice, I saw Yet More Advice to run rm -rf vendor, which I ran without stopping to consider, well, much of anything at all.
Now, I’m a firm believer that one learns either by making ones own mistakes, or by watching other people make mistakes. So hopefully you will learn from mine. Don’t type rm -rf vendor unless you stop to look inside vendor and make sure you don’t want to keep any of it.
vendor, of course, is where plugins and locally stored gems might reside. Fortunately, when I realized this, I just went back to the original mephisto-0.7.3 tarball and recopied the original contents of vendor back to the server. Since then, everything has been fine.
Dreamhost’s support team was a great help, and were quite nice, even when I complained that they were hard to get ahold of — and it turned out that the reason I couldn’t log a ticket on the site was because I was using Firefox 3, which apparently just plain doesn’t render some of the things from their support form. Go figure — beta software that has bugs in it. So, thank you, Dreamhost support team. You are awesome, and if you visit Minneapolis I will still buy you all a coffee. But just one. You will have to share it.
The Sound of One Hand Hacking
January 2nd, 2008
Can you be a part-time entrepreneur?
I’ve been asking myself this for some time. Now, I know people do this, so objectively the answer is simple: yes. People do it all the time, start businesses or companies while they still maintain a full-time job. They have varying degrees of success, but there’s variation in success among businesses that start as a full-time venture, too.
So, the question I should be asking myself is not “can it be done?” Rather, it’s “can I do this?”
Yeah. That’s a good question.
Let’s see. There’s 24 hours in a day, times 7 days in a week makes 168 hours in a week. 40 hours for normal work—let’s be realistic, 45, plus an hour per day commute (I have it easy) makes fifty hours invested in paying the bills.
Speaking of paying bills, I’m sure I spend a few hours each week on those pedestrian tasks like paying bills, grocery shopping, doing laundry… if we’re including shopping, personal hygiene, and chores, let’s call it 8 hours per week (is that too low?).
I eat dinner, so figure an hour a day on average, and about 4 more hours for meals on weekends… so 9 more hours.
Loathe as I am to give up so much time to it, I must sleep. I average 6 hours a night, which works fine, so that’s another 42 hours in a week.
I’m also taking three classes this semester; getting to and from class plus class time will be about 8 hours per week (one class is online), plus I’m guessing about 6-9 hours to studying and homework. (Why so high? Calculus 2 and Software Engineering are two of the three classes). Let’s assume I’m a model student and put in the time, so that’s 17 hours per week to college.
Where are we at? 50 + 8 + 9 + 42 + 17 = 127.
Theoretically, that means I have 41 hours each week that gets nickel and dimed by “other things.” I don’t intend to become a hermit, so I imagine that about 16 hours goes to social situations, be it going out for coffee, meeting friends, etc. I play guitar in front of people about once a month, so I do need to stay in practice, let’s say 2 hours a week.
So, even with a few more hobbies and some social time penciled in, it looks like I should have 23 hours left over each week. That’s enough for a part time job, assuming you could do a part-time job in small increments between everything else you do.
Now, does all this off-the-cuff number crunching actually translate into an answer like, “Yes, I can be a part-time entrepreneur and bootstrap a business in my off-time”? That’s still an open question.
I would say the answer is a tentative “Yes” IFF...
- the numbers used for calculating my time are actually honest and accurate (I think they’re pretty good).
- I can have the discipline to use my extra time for product and/or business development rather than web-surfing, television, or xbox games (etc, etc).
- I have buy-in from my family (in my case, my wife) on my schedule. It would be difficult, if not impossible, to commit large blocks of your time in the week without the understanding and agreement of your family, particularly your spouse.
So, I think it’s doable even for someone with a schedule as full as mine. It will just take a lot of discipline, a lot less time spent doing empty tasks (ie, gaming, random purposeless web-surfing), and some really good time & task management. Probably time to dust off my David Allen books again.
