Monday, September 22, 2008

1st webapp

To-Do ListImage by Jayel Aheram via FlickrAs alluded to in my post explaining django, I've decided to cut my teeth on web development with a little program of my own design. After careful consideration of what to work on, I decided on the incredibly unoriginal idea of creating the ultimate to-do list. Everyone seems to have their own method for planning out their day - that or they zealously adhere to a system like GTD or RTM. This is of course incorrect, as my to do list system is far superior.

My ultimate goal with this application is quite modest - to convert everyone to my way of doing things. If for some reason this proves to be more difficult than expected, I will pursue the slightly less arrogant aim of creating something that I myself will actually want to use. Even if that is a failure I'll still learn a lot, so whatever.

These are the topics I'm going to have to really learn in order to build this thing:
  • Interacting with a database - storing, retrieving, and updating the lists is pretty basic, but kinda important
  • How to design the user interface - I'll start with getting the thing working in simple html and then try to pretty it up with css and see where it goes from there
  • Handling users and accounts - possibly even exploring google app engine
And as a final incentive to learn, I've noticed that my dream to-do system is constantly in flux - so in order to keep my web application useful (to me) I'll need to really master everything so I can make changes quickly and easily.

So right now here is a rough outline of the features of my dream to-do web application:
  • Tasks fall into major categories that can be user defined (right now for me I have work, job search, and personal).
  • There should a master list (for each category) that persists between days, and at the beginning of each day you pull several items from this master list to populate your to-do list for that day.
  • When a task is entered the user also estimates the amount of time it will take to completion.
  • When the to-do list for a day is created, it graphically shows how much total time you're dedicating to each category.
  • (Edit) Make system work so that you only use the site once a day, you're not constantly going to the computer to add tasks and check them off - you print out a sheet once a day with space for adding stuff below
Here are some more features that I'd love to see but aren't quite as pressing (read: very unlikely to ever be implemented)
  • Certain tasks could be grouped as a series. The second step in a multi-step task could remain hidden or partially obscured until the first step is completed
  • Quick Task - App could display a timer and use an alarm to get you to focus on completing those really short tasks that end up taking way longer than they should.
  • Simple way to control how the importance level of specific tasks can change with time
  • Social website features - i.e. you can look up a vague task (like 'apply to college') and then you could import an actionable series of tasks that someone else has created and shared.
That's it for now, I'll keep you updated on my progress (this could take a while).

Oh yeah, and if you've never checked out Scribd.com, it's simply amazing what kind of textbooks and study guides you can find on there for free. Check it out.
Reblog this post [with Zemanta]

Thursday, September 18, 2008

The Charity Fallacy

Illustration from below bookImage via WikipediaI recently reread an old paper I wrote in a philosophy class that has had me in stuck in an infuriating loop thinking about our true motives when we act charitably. It was a paper examining Joel Feinberg’s essay that criticizes the concept of Psychological Egoism, which Feinberg defines as the belief that all desires have as their ultimate end self-interest. So for example, if I donate a ton of money to my local community center and they build a ‘James Raftery Center for Obese Orphans’ the fact that I get a building named after me and the respect of my peers makes my action self interested.

This may sound silly to you, but this line of thinking actually bothers me when I’m contemplating being charitable. For example, I decided yesterday that whenever I walked by someone collecting money on the street for the homeless or any other charity I would give them any spare change I had. Since I spend about an hour walking to and from Penn Station each day, this would ensure that I never had to carry around coins for very long. This seemed like a brilliant idea because making a rule like this would cause me to donate more than I normally would, it would keep my pockets nice and light, and it would ease my mind because I could feel like I was being a good person and not even have to think about it anymore! As far as a utilitarian is concerned, this would be a win all around.

However, the cynical psychological egoist in the back of my mind won’t stop nagging me. I keep thinking about how I’ll feel good about myself every time I hear “God bless you, sir” when I drop my change in the bucket, or the moral superiority I’ll feel to everyone around me who isn’t donating. Also, when debating whether or not it was a good rule to adopt, the only way I could evaluate it was by trying to imagine how great of a person someone would think I was if they were told about my rule! These are definitely not the kinds of generous intentions you’re supposed to have if you’re being charitable… (and that’s not even considering the crazy meta-smugness I’ll no doubt derive from writing a blog post about it!)

So is there any way to be charitable without getting too much self-gratification from it? Anonymous donation seems to be a good answer – but it doesn’t eliminate the self satisfaction you’d have (even if nobody else knows about it, it’s there) or the tax write-off. No, what we need is a Psychological Egoist Fund that takes money out of your bank account without you knowing it and donates that to charity. Naturally, our psychological egoist couldn’t sign himself up for this service, as that would make him feel too good about what he was doing! The best thing to do would obviously be to have friends or family secretly sign him up for the service somehow.

Alternatively, our poor psychological egoist could donate like normal, but feel so guilty about all of the selfish motives that giving was no longer pleasant. Hopefully that will take all the fun out of donating, which is of course the point.
Reblog this post [with Zemanta]

Wednesday, September 17, 2008

The Internet is a Series of Tubes


No doubt if you’re reading this you’re more computer literate than our friend Senator Stevens or John McCain. But what do you really know about the glorious series of tubes that is the internet? For the past couple of months I’ve been on a self-education binge, so naturally I was troubled when I realized that I had absolutely no idea how a website works or how people build them. I must confess though, my interest in learning about web development is not purely academic. When I have my brilliant idea for a startup I want to be ready for it, and I don’t want to handcuff myself to being just another non-tech guy with an idea for a cool website (not that that doesn’t work for some people). Anyway, over the past two weeks I’ve devoured the free Django Book in an effort to understand the Django framework for web development. Consider me your personal plumber, and I’ll remove the porcelain toilet tank cover of the web and point out some of the major features.

Websites that are interesting these days are dynamic pages that do way more than displaying static content (Although there is a special place in my heart for a simple html page with an under construction .gif). The magic behind all of the functionality in modern websites lies in the programming that has gone on behind the scenes. Django is a framework for web development built on the programming language called Python, and it consists of three parts: urls, views, and templates.

Urls are everything that comes after the .com up at the top of your browser. Django takes this string of characters and figures out what program is supposed to run. When you make your website, you create a list containing each url you want to exist, and pair it with a program (called a view) to run whenever that url is visited.

Views are the real meat of your website. This is where you get to manipulate data, make calculations, and do all the things that make your website interesting. They get their information from the url that called them and from the information stored in the website’s database (a big file somewhere) and then do whatever it is they’re supposed to do.

Templates generate what the user sees when they visit a website. When a view is all done with its calculations, it calls a template and gives it the information for the template to dress up. The template is just an html document with a bunch of blanks in it that get filled in with the output of the views. Django takes the answers, fills in the blanks, and then sends the document to the browser to display.

So here's an example:
  1. You navigate to www.example.com/welcome/', Django sees ‘/welcome/’ and runs the program ‘my_welcome_view’
  2. ‘my_welcome_view’ looks up what user just logged on and saves the name ‘James’ for later
  3. The template ‘Welcome to the site {{ name }}’ becomes ‘Welcome to the site James’ and shows up in your browser.
The brilliance of this is probably not clear from my incredibly brief explanation, but the people who made Django set everything up this way for a good reason – to promote the philosophies of ‘loose coupling’ and ‘don’t repeat yourself’. Each component of the website is separated from the other two as much as possible. This makes it easy to create the website and keeps you sane when you’re making changes to it later. For example, if you decide to change the url of a particular part of your website, simply change it while smiling to yourself because you know you didn’t screw up the views or templates associated with it. Similarly, you can change a view or swap out a template without making a mess in other areas.

It also reduces having to write the same code in different places, since you can write one view that gets used with more than one url or have flexible templates that can be used in many places.

The final cool thing about working in Django and Python is that they are both designed so that you can iterate your website quickly. Python doesn’t need to be compiled and there is an interactive interpreter so you can play around and try little pieces of code without any trouble. Django takes this even further by providing you with a development web server that instantly reflects changes you make to your website. This means as soon as I add a piece to my site I can switch over to my browser and see what it looks like.

If you want to know more check out the fantastic book or drop me a line. Also stay tuned for my details on the first website I’m going to make in Django.
Reblog this post [with Zemanta]

Monday, September 15, 2008

Welcome

The human brainImage via Wikipedia
Welcome to my blog everyone. A quick disclaimer - this blog is NOT about hypomania, which is a symptom of bipolar disorder and cyclothymia! I have not been diagnosed with either of these serious disorders and do not want to make light of them, so apologies to anyone I offend.

Hypomania - \ˌhī-pə-ˈmā-nē-ə, -nyə\ - literally below mania.
People with hypomania are generally perceived as being energetic, euphoric, overflowing with new ideas, and sometimes highly confident and charismatic, and unlike full-blown mania, they are sufficiently capable of coherent thought and action to participate in everyday activities. A person in the state of hypomania might be immune to fear and doubt and have little social inhibition. They may talk to strangers easily, offer solutions to problems, and find pleasure in small activities. (Wikipedia)

In life I have many interests and obsessions, often jumping from one to another. These jumps are usually accompanied by a state of mind that seems remarkably like hypomania. This blog is my attempt to record my wanderings and share them with you. Perhaps it will create some structure to my random walk, or help me locate kindred spirits and people with the similar obsessions. Expect to hear a lot about technology, entrepreneurship, and science - with a smattering of politics, finance, and anything else I worth writing about.
Reblog this post [with Zemanta]