Saturday, July 29, 2006

Annologger update: now with pretty templates

Post and publish a schedule of events for your friends, your readers, your fans, no matter who you are.


I've just released v0.3 of Annologger. Now it supports pretty templates, as well as tweaks on UI interface. There are lots of little things that I've changed here and there to facilate ease of use.

The templates are from OpenWebDesign.org. These templates are all public domain, thanks to Chris Pearson, James Koster, and Pat Heard(template not shown) for submitting their fine work to OWD. Hopefully, the more people use annologger, the more exposure they'll get as designers.

It's been hard work in the past week, and I had lost track of all time. I had thought it was Weds when it was really Friday.

Tuesday, July 25, 2006

How to apply min-height in IE and other browsers � WordPress Support

How to apply min-height in IE and other browsers � WordPress Support:

#insideWrapper {
min-height: 500px;
height: auto !important;
height: 500px;
}


Another common problem with IE. This is a good fix for having min-height supported on both firefox and IE.

Announcing Annologger

Post and publish a schedule of events for your friends, your readers, your fans, no matter who you are.

I'm officially announcing Annologger. It is now up and running on beta. It's free to join.

Annologger lets you post and publish a schedule of events to the web. Each schedule listing not only displays the events in an organized matter, but also facilitates interaction between you and your readers.

This is a sample of a live annolog that is generated by Annologger. Try it out, and give me feedback.

PNG in Windows IE

PNG in Windows IE

This has been a pain in my butt for some time now. No more GIFs! I think lots of people probably already know this trick, but it's definitely worth mentioning.

However, it still doesn't fix the problem of using transparent PNGs for backgrounds in IEs.

Monday, July 24, 2006

What sucked about getting your feet wet in J2ME

The last two days were spent on trying to get the JavaME Wireless Tookit from Sun up and working with EclipseME. It's been a frustrating experience, to say the least.

I did find this webpage with a lot of information on hacking and modding your V3 RAZR. It's got a neat little story on the history behind the RAZR.

But aside from the cute diversion, I found on a forum at MotoX, that RAZR V3 isn't capable of upgrading its Java CLDC from 1.0 to 1.1, even if you flashed the firmware.

So it looks like I'll have to go find a phone with CLDC 1.1 to get anywhere.

Patching tests for Salted Login Generator

It's odd, but I was having problems with the SaltedLoginGenerator for Rails. I wasn't able to run the tests at all with rake. I was getting:

/usr/local/bin/ruby -Ilib:test "/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb" "test/unit/entry_test.rb" "test/unit/user_test.rb" "test/unit/localization_test.rb" "test/unit/stencil_test.rb" "test/unit/publisher_test.rb" "test/unit/annolog_test.rb"
/usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:74:in `load_specification': undefined method `parse' for Time:Class (NoMethodError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/specification.rb:307:in `date='
...clipped...

and then later on, after a fix (I'll describe it later), I was getting:

/usr/local/bin/ruby -Ilib:test "/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb" "test/unit/entry_test.rb" "test/unit/user_test.rb" "test/unit/localization_test.rb" "test/unit/stencil_test.rb" "test/unit/publisher_test.rb" "test/unit/annolog_test.rb"
/home/wil/proj/3cgworkspace/annologger/config/../test/mocks/test/time.rb:5: undefined method `cattr_accessor' for Time:Class (NoMethodError)

I think that problem was that I had an older version of rails and ruby, so I've updated to both ruby 1.8.4 and rails 1.1.4. And because I didn't generate rails with the new version, I had to insert these two lines requiring both 'rubygems' and 'time' into my test_helper.rb under test/, before requiring the environment file in config

ENV["RAILS_ENV"] = "test"
require 'rubygems' # patch to fix undefined 'cattr_accessor'
require 'time' # a patch to fix undefined `parse'

require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'

class Test::Unit::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the

Thursday, July 20, 2006

Finding easy-to-read web content

Finding easy-to-read web content: "Posted by T.V. Raman, Research Scientist

Like most of you, when I search the web, I want to find relevant information with a minimal amount of distraction. But because I can't see and I use a device that converts web text to speech, I'm even more in tune with the distractions that can sometimes get in the way of finding the right results. If the information I'm after is on a visually busy page, I have to sort through that page to find the text I want--an extra step that can sometimes be very time-consuming."

It'd be nice if this could be used for filtering out ads.

Saturday, July 15, 2006

The uniqueness of mobile devices as a platform

About a year ago, I searched on the web for opinions on what are the killer apps of mobile devices. By its original definition, a killer app is a piece of software that someone would want so bad, they'd be willing to buy the hardware just to run it. But now, 'killer app' is used simply as a piece of software lots of people will use. I was curious about what people predicted.

I read all sorts of things; that mobile gaming, ringtones, web browsing were the killer apps. Others lauded that voice--being able to make calls--is the only killer app you need for mobile phones.

I beg to differ. I think with every new platform, people first make copies of what they could do in the old platform before really realizing what the new platform has to offer. From the paper platform to desktop platform, people first made spreadsheets and word processors before making web browsers. Same thing happened when we had the web platform.

Mobile devices has a unique set of characteristics. While other platforms may share some of the characteristics, they don't have all of them.
  • They are mobile (obvious)
  • They are always connected
  • They can get location-based information
  • They are almost always on a person, and considered personal by the owner
  • They are the gateway to other people all the time
Verizon and other carriers currently offer boring services, such as ringtones, wallpapers, video casting, and weather. They might take advantage of the first three attributes, but I feel the real power of the mobile platform is its decentralized nature, and ability to create social spaces based solely on the fact that they're always on a person. And in essence, other people, in whatever form, is what we like to interact with.

Dodgeball and Twttr are moving in the correct direction. But I think there can be much more done with it. Decentralized messaging that moves people to emergent actions would be something like a next step.

A more concrete example would be an application on your mobile device that tells you what everyone you care about is doing locally--either locally in time, in proximity, or in your social network. But this information would have to be presented in a way that creates a positive feedback, so that the more people are doing something, the more other people will do it.

I'm going to do some hand waving here, as I don't know exactly what would compel people to participant. It could be something as simple as showing how many other people are doing it. However, the point is, if this positive feedback mechanism was in place, you could have Digg and Slashdot effects happening in the real world.

Imagine that.

But if it got out of hand, it wouldn't be good. Mobbing is never good in real life, and I've warned about the tyranny of the masses in a previous post. But I think that's the potential power of mobile devices.

Something's a twttr-ing in the morning

I was chilling out, thinking about going to sleep when the secret mail sent me this link to Om's post on Twttr

There's lots of ways to describe twttr, but at its simplest, it is a service that notifies your friends (people that care) about your presence and status. Technically, it's very simple: it sends your SMS text messages to all your friends' phones. On the flipside, you will receive txt msgs from those friends that you want to get msgs from. You can view the stream of text messages on the web, from yourself or all your friends. While this has the potential to spam your phone, I think they're on the right track with development on mobile devices.

Thought of another way, it's a more fine-grained blog that encourages short, and otherwise ethereal thoughts to be sent. Where as IM is presence on a computer or sidekick, and blogging is presence in a world of ideas, twttr encourages the idea of presence as "what are you doing at this moment" to bleed into real life.

Mobile devices have certain chacteristics unique to the platform. I think this application takes advantage of the unique characteristics of a mobile platform, unlike the boring applications that Verizon comes up with, like directions and video casting.

Offline rdoc gem documentation in Ruby

I always forget how to do this one, even though it's really simple. (Make sure that you have rdoc installed first) To view all the API documentation in gems, simple run:

gem_server
gem server

from the command prompt. It will start a WEBrick server up on your local machine on port 8808. Therefore, if you browse to http://localhost:8808/, you'll see a list of documentation of the gems on your machine.

Updated:
It's incorporated into the gem command now, so just do "gem server"

A short Net::SFTP tutorial and freezing gems

FTP itself is not very secure, since it sends a user's login and password over cleartext. So while Net::FTP in Ruby is pretty handy, I'm hoping to wean off of it soon.

That's when, after poking around for a couple minutes that Net::SFTP exists under the Net::SSH project. Huzzah! Yet, shared hosts don't have the ability for you to just install anything though. So it was then I found:

gem list --remote net-sftp
gem install net-sftp

So that way, I can install it as a gem on shared hosts. Also, I had forgotten how to freeze gems in rails. After lots of futile searching, I did come across a more automatic way. I didn't like the way it copied everything in the ./lib, because ./lib is suppose to be for in-house libraries, and ./vendor is for 3rd party libraries. I'd like to keep them separate.

Update:
So I remembered there was a manual way to do it....Ends up is that all you have to do is copy your gems into the vendor directory. use:

gem unpack gem_name

And it'll copy the gem into the current directory for you. However, in order to be able to include it as if it were a library, you'll need to change the environment.rb file found in your config directory in your application root directory.

Under the Rails::Initializer.run do |config| block, you'll see "config.load_paths". Uncomment that line and add the various gems in the vendor directory. Note that you don't put commas inbetween every path.

config.load_paths += %W(#{RAILS_ROOT}/vendor/needle-1.3.0/lib/
#{RAILS_ROOT}/vendor/net-sftp-1.1.0/lib/
#{RAILS_ROOT}/vendor/net-ssh-1.0.9/lib/ )

So now, you'll be able to do "require "net/sftp" even if the gem isn't installed.
Update:
So how do you use the Net::SSH and Net::SFTP libraries? Just looking at the APIs, I thought I could piece it together, but it's not as simple as it sounds. It took a bit of poking around to find this manual for Net::SSH. There is no manual for Net::SFTP--only a Net::SFTP FAQ. And after looking at the manuals and FAQs, it is as simple as it looks. I wonder why I didn't get it...

Here's a little tutorial on how to start an SFTP session.

require 'net/sftp'

Net::SFTP.start(host, user, password) do |sftp|
sftp.put_file "/path/to/local.file", "/path/to/remote.file"
end

Albeit the SFTP library is complicated and kinda hard to use, the coolest thing that I found out about is that you can do is actually upload a file from memory. I wasn't able to figure out how to do this with the native Net::FTP library in Ruby.

require 'net/sftp'

data = "This is the contents of my file"

Net::SFTP.start(host, user, password) do |sftp|
sftp.open_handle("/path/to/remote.file", "w") do |file_handle|
contents = sftp.write(file_handle, data)
puts contents.code
end
end

I don't know exactly how this is done, but my naive guess is that since you already have an SSH session open through SFTP, you're able to perform native commands outside of the FTP protocol? Either way, it's just what I needed, so I wouldn't have to create local copies, upload them, and then delete them.

Making Debian packages from self-extracting installs

I usually just installed tarballs or self-extracting files, because that's what the instructions said. And it's also kinda cool to be able to run make and watch it compile. However, it makes for a mess when you have to keep track of what you installed where, especially if the install isn't all in the same directory in linux.

RPM was always hard for me to use...I dunno why. Maybe it's because of all the flags, I could never remember what they were. That's why yum and apt-get for fedora and ubuntu have been godsends lately.

This article describes how to convert the java 5.0 sdk from the self-extracting file into a debian package so that you can install it in ubuntu.

According to my roommate, this way, if other packages that are installed need java, they'll know that it's there, and won't ask for it.

Good plan.

So I think I turned over a new leaf. From now on, I will always make packages from tarballs.

Friday, July 14, 2006

S5 slideshowing

S5 has gotten less attention than it should have, once I realized what S5 stood for. To start, you can say S5 is powerpoint done through the web. As long as you have an internet connection, you can make, edit, and share powerpoint presentations very easily.

I didn't think much of it at first, since a lot of people are simply taking desktop applications and putting them on the web. Writely is a word processor on the web. There's someone else doing a spreadsheet that I can't remember the name of.

But S5 = "Simple Standards-based Slide Show System" It basically uses XHTML, CSS, and javascript to make slideshows. The advantage is that to make new themes, you can just change the CSS. And you can also write scripts to generate slideshows. I once had to put together 200 slides of graphs in MS powerpoint. It sucked, and wished I could script it, since it was a very mechanical procedure.

And presentations would transfer easily from place to place...given that the network was available. I think it'd be useful when wireless internet connection is ubiquitous.

Wednesday, July 12, 2006

Remember in Ruby it's raise/rescue, not throw/catch

Yesterday, I spent hours debugging a stupid exception construct in ruby. Why wasn't it rescuin the thrown exception? Ends up that it's because you RAISE exception, not throw them. Throw/catch mean completely different things in ruby.

Raise/rescue! And another thing I forget often is that I have to raise an instance of a class, not just the class itself!

Online communities were never meant to supplant real life

At least with this article, it sounds like she really uses these services as opposed to someone that just heard about them and rags on it without ever really trying it out.

Online communities were never meant to supplant ones in your in-person life. It just adds another dimension to it. Sure, you'll get people that go overboard and cut off their in-person relationships, but they're the outliers. For certain types of interaction you'll probably find that most people would prefer face to face interactions. These types of interactions include friends that you already know and for finding mates. It's for that reason that friends still get together when they're in town and that people on match.com still meet first before committing.

For other types of interactions, like Brad Pitt fan club forums, World of warcraft (online game), and scientific google groups, your only interest in the other people is only within the confines of those contexts. And while that's what I imagine rubs people like the author of the NYTimes article the wrong way (having a cafeteria tray attitude to getting to know people). The people we interact with no longer has to fill every aspect of our social needs. It is acceptable now to have friends you only hang out with, friends you only tell secrets to, and friends you only go on naked streaking parties with. The same goes with people you interact with online.

Cars and suburbs have probably done more to keep people apart from each other than the internet has. Think about it. You use to have to walk to the local store, passing people in your neighborhood that you knew along the way. Now, you just drive on the highway. Suburbs rarely have sidewalks, and things are further apart, so people use their cars to drive, and not interact with each other.

And even if there were people around, you wouldn't necessarily want to talk to them. Out of all the times you've ridden the subway, when was the last time you struck up a conversation with a stranger sitting next to you? I'd venture to say, very few. Now if you lived on the West Coast (except LA)...maybe things would be different.

In addition, I've often discovered that some people didn't keep friends in a certain part of their life because, "We just hung out together, and did stuff. We didn't really get to know each other." Just because a relationship is face to face doesn't mean that you will have a deeper connection with each other. No matter what the medium, it takes effort on both sides. Besides, just because there are people around doesn't mean you're not lonely. I had always taken Nighthawks to illustrate that, and Edward Hopper was way before the internet.

Presence doesn't have to be physical anymore. It can be across different spaces, and even asynchronously across different times. While these forms of communications like cell, IM, email, blogs, wikis, forums, VoIP, etc are just facsimilies of face to face interactions, they're good enough for what we need to get done or enjoy just a snippet of each other. Between friends that can't meet face to face all the time, it's better than nothing.

And some forms of communication and interaction, while more limited to face to face, actually are beneficial in other ways. There'd be no way you'd be able to produce an encyclopedia from a room full of hundreds of people, as you do with Wikipedia. Online forums leave a trail of solutions to questions and problems others have encountered. I can't tell you how many times I've gotten help with configuring my linux box or rails when I've hit upon a wall from the dregs of people helping each other.

The current body of social network web applications, however, do have a problem. While novel at first, you quickly realize that they don't actually DO anything. If it helped people connect to not only their friends, but also connected you to like-minded strangers, or MOVED people to action, then that would really be something. But the current incarnation of social networks have much to be desired. Like all revolutions, it always takes a bit of tweaking, yet it's not going away. Developers are experimenting with other types of social networks, such as the recent Twttr and Dodgeball.

Online communications are here to stay, and like all things, it's good in moderation. No matter the medium, it takes effort and attention from both parties. It's the dual act of giving and receiving that makes a relationship between humans worthwhile. Online communications only provide the conduit, even if it's a facsimilie of real life. But it's up to you to do the rest and fill it up with meaningful content.

Introduction to Bindings in Ruby

When it comes to programming languages, software developers really are zealots--everyone has their favorites. Like Paul Graham says about himself, you shouldn't just listen to a person just because they have notoriety. But I think his article about how some programming languages are more powerful than others is convincing (can't find the link right now).

What I liked about Ruby over Java or C++ most are the different types of programming ideas that I've had to wrap my head around. Just yesterday, I was looking at Ruby's ERB (Embedded RuBy) library. It executes ruby embedded in text (plain text or html). Most commonly, Rails uses ERB as a way to translate view templates into html to be displayed to the browser.

I had the problem of trying to render templates outside of controllers, which was why I was looking at ERB. I couldn't get the ERB to read the variables I had defined in the function. I mean...that's the way it worked in the controllers!

@title = "The web and all that jazz"
template = "<html><body><%= @title %></body></html>"
erb = ERB.new(template)
html = erb.result

It didn't take. It ends up that you'd have to pass ERB the current binding as well, because it assumes TOPLEVEL_BINDING. I think ERB uses eval() heavily, which in turn uses binding.

html = erb.result(binding)

binding() is a kernel method that returns the binding--essentially the scope which code is being executed. Not only that, binding() returns the binding as an object, so you can store it for future use, and even pass it around. That means that you can request the scope of a block of code (the variables that are available to it) at that time in execution, and use it at another time, when that scope might have already expired.

So in the erb example, result() was assuming scope at the very top level of the application, rather than the local scope. And that's why it couldn't find @title.

I only found one extensive article on binding. It has great examples on binding.

Being able to pass around bindings seems odd to me. It's like being able to pass scope around, and I wonder if it violates encapsulation...or maybe it's ok to violate it once in a while? But then again, I remembered that closures and blocks in ruby also have bindings. The scope in which a block is define is remembered, and can be passed around; and it's part of their power. So every time you do an array each() and pass it a block, you're passing around bindings as well. It's so much easier than messing around with function pointers.

Saturday, July 08, 2006

BlogShares - Fantasy Blog Share Market

I knew that people trade all sorts of stuff besides stocks. Fantasy Sports is a form of trading...you make educated guesses based on how well you think the players are going to do. And if you think the player's not going to do well in the future, you try to trade it for someone else that another player is willing to part with.

People also trade weather! So it seemed brilliant to me when I saw Blogshares, a place where you do can fantasy trading on blogs.

It seems like any complex system on the edge of chaos are systems that people like to trade. Because if something was completely predictable, it would be trivial. Everyone would know which the best pieces were, and wouldn't want to trade once they had it. If it was a system that was completely random, I argue that people wouldn't trade either, because the only heuristic that would work with minimal effort is to choose and trade randomly. I'm not sure why, but it's my experience that people don't like that, especially if something's at stake.

Wednesday, July 05, 2006

Cellophane as a cheap skin

This article from ZDNet via Smart Mobs talks about how cellophane is a pizoelectric. Pizos are materials that can bend if an electric field is applied to them.

Pizos are important as both sensors and actuators. If you apply an electric field to pizos, they bend, and hence they are actuators. If you bend a pizo, it should generate an electric field.

To make a pizo with cellophane and a thin layer of gold is a pretty shocking development, because they are cheap materials (a thin layer of gold is not too pricey). It opens up the door to lightweight and cheap pizos.

Rollable keyboards are now possible to be cheaper to make, in addition to surface skin tables for user interactive screens. Wouldn't it be possible to use something of the equivalent of Surface Acoustic Waves, to detect where something was touched?