Archive

Archive for July, 2007

409 Users and Counting.

July 30th, 2007 No comments

My first facebook application, LibraryThing Feed, has broken the 400 barrier. Certainly not a great big deal, as other apps are counting users in the hundreds of thousands, but I still think its pretty cool. It’s been growing pretty steady at about 10-15 a day. I think I am pretty close to having all the major bugs out of it, which is good since I am gearing up for fall semester and probably wont have a chance to really make any more updates until the Winter break.

Categories: Uncategorized Tags:

Javascript Treachery

July 26th, 2007 3 comments

Every single time I deal with this, it punches me in the face. I love it because its cool, I hate it because I always forget.

In Javascript, (as well as other Object-Oriented languages) objects (what we used to call “variables” back in the day) can use functions as properties. For instance, in order to access the length of an array in Java, you would access its public method (or function) size().


ArrayList myArray = new ArrayList();
myArray.add("Mutemath is coming back to KC this fall!");
out.write(myArray.size()); // size() = 1

Note the parentheses that follow the size() method: This implies that it is really a function and not a simple property of the object. Most properties of Java objects are private, which are then accessed through public functions, such as get and set methods.

So here I go in Javascript, hacking away at something for 40 minutes trying to return the size of array. I recall that in js it is length() and not size() as is the syntax for its java counterpart.


var l = myArray.length();
alert(l + "!"); // Fiesta. We are really excited about the length of the array.

Alas, length is a property, and not a function. It is accessed only without the parentheses, as no function exists by that name.


var l = myArray.length;
alert(l);

This has happened to me more times than I care to admit.

Categories: Uncategorized Tags:

Fun With Lists

July 23rd, 2007 No comments

When I first discovered the list tags in HTML (ul, li…) I scoffed. That’s all fine and dandy to give an example of creating a grocery list, but who is going to really use that when building a website. And so I labeled it “lame” and went on my merry way of implementing seemingly-infinite-nested tables (which, in my defense, was “cool” in 1998). How times have changed.

With the onset of CSS, and the CSS box model (link provided for Microsoft developers who need a quick refresher on how its supposed to work) there are now alternatives to tables that are cleaner, easier to code (and refactor) and do not make the fatal mistake of mixing structure with presentation. Although DIVs are in widespread use as a table alternative, there are cases when you want some organizational pattern to your presentation, without being locked down by table badness. Enter: lists.

A traditional list, good for making grocery lists, looks like the following:

  • Chicken
  • Snow Peas
  • Soy Sauce
  • Frozen Pizzas

And uses the following standard HTML:

<ul>
<li>Chicken</li>
<li>Snow Peas</li>
<li>Soy Sauce</li>
<li>Frozen Pizzas</li>
</ul>

Now, lets say I want the list to display horizontally rather than vertically. Let the CSS begin. This particular example will use multiple lists, and attempt to list them all side-by-side in a visually appealing manner.

First, I always create a “wrapper div” around the objects I style, so as to not accidentally apply styles to somewhere they don’t belong (you know, for all those other lists on your page).
<div class=”listContainer”>
</div>

Second, place your lists inside the div.
<div class=”listContainer”>
<ul>
<li>Joe</li>
<li>Donahue</li>
<li>joedonahue.org</li>
</ul>

<ul>
<li>Adam</li>
<li>Spriggs</li>
<li>sprignaturemoves.com</li>
</ul>

<ul>
<li>Darren</li>
<li>Boyd</li>
<li>truthordarren.com</li>
</ul>
</div>

So far, not very exciting.

  • Joe
  • Donahue
  • joedonahue.org
  • Adam
  • Spriggs
  • sprignaturemoves.com
  • Darren
  • Boyd
  • truthordarren.com

But wait! Add the follow CSS goodness:
<style>
.listContainer {
width: 100%;
}

.listContainer ul {
float: left;
width: 100%;
}

.listContainer ul li {
list-style-type: none;
float: left;
display: block;
width: 120px;
}
</style>

  • Joe
  • Donahue
  • joedonahue.org
  • Adam
  • Spriggs
  • sprignaturemoves.com
  • Darren
  • Boyd
  • truthordarren.com

And you have a table, without the table. A lot cleaner, easier to refactor, and the presentation could be changed at any time without needing to the change the structure underneath it.

Categories: Uncategorized Tags:

240,000 Words

July 14th, 2007 3 comments

If a picture is worth a 1000 words, than I have just added 240,000 more words to my flickr page. I realized that I have not uploaded photos to flickr since Mia first came home, and I must apologize to her international fan base.
Its actually only about 200 pics, but I used the number 240,000 just for Tim Troxler.

Categories: Uncategorized Tags:

New Google Joy: Bookmarks!

July 13th, 2007 No comments

I have only recently discovered Google Bookmarks, but it has quickly become a source of internet joy. And joyness. It’s power and functionality is only harnessed when coupled with this Google Bookmarks firefox extension.
The actual “bookmark” function is pretty straightforward: You can enter websites that you visit frequently for quick access or for less clicking if a page lies buried several “clicks” into a site. Google changes the game by making the list shared and using tags instead of the standard “folder” approach to bookmark organization.
Shared
Once a site is bookmarked, it resides in the internet rather than on a local computer. This allows for a single set of bookmarks no matter what computer you are on. This is great news for me – I use my desktop at home, my laptop at school, and a completely different computer at work. Bonus: I recently received a new computer at work. Time taken to update my bookmarks: none. Sweet.
Tags
Once a site is bookmarked, you can associate tags with it, creating a sense of organization in the jungle of links. The traditional problem with this is that bookmarks on a local computer can only live in a single folder, barring link duplication (and opening the vortex for questionable data integrity!!) but Google Bookmarks allows links to have multiple tags, which sorts them into “virtual folders,” if you will.
If I have a tag named “School” that I put on links to important pages on the school website, then the one or two links that I frequently visit will become harder to find in that list. I could additional tag the important ones with “Frequently Visited” or even “Important” to distinguish the pages I visit often from the pages that are simply for future reference. If I am visiting a technology site and find a really great article that I don’t have time to read, I can bookmark and tag it both “technology” as well as “To Be Read” (or “Someday” for the GTD geeks out there).
Firefox Extension
The single greatest strength of Google Bookmarks is that all the links live in shared location on the internet. This is also its greatest weakness. Whereas traditional links live as close by as 1 click right on your browser toolbar, now they live several clicks (and possible typing-a-URL) away, putting you farther away from the information that you want right at hand. Enter a firefox extension for Google Bookmarks. After installing it, you will need to drag-and-drop it onto your bookmarks toolbar via View -> Toolbars -> Customize. Sign in to Google, wait about three seconds, now all your bookmarks are once again in your browser, right where they belong. You can also edit your bookmarks and add new Google Bookmarks with this extension by clicking on the star. I am a fan.

Categories: Uncategorized Tags:

One Month Down

July 5th, 2007 2 comments

Yesterday marked off one month since Amelia was born. We started to sing “Happy Birthday” but half-way through, she began crying. Not completely unexpected. It has been an incredibly long month, and has brought with it some of the most happy – and most frustrating – times of my life. We continue to get notes from friends and family saying how cute she is, and it is often a much-needed reminder. Danielle sent me a note on facebook last night saying just this… and we kept it in mind as Amelia stayed up until midnight and then slept for hour-long intervals.
She did sleep long enough for us to watch Stranger Than Fiction, which was really good! I think I am going to need to watch it a couple more times, but we both really enjoyed it. I’d like to thank my blockbuster $1.99 coupon for making it possible.
Tonight I am planning to do a little grilling, and to go pick up Andy Fey at the airport.

Categories: Uncategorized Tags: