Skip to main content

Mobomo webinars-now on demand! | learn more.

I saw the article ’Google’s First Real Threat: Twitter’ pop up in my RSS readers today from a couple sources and didn’t click through and read; I had already learned the power of Twitter Search on multiple occasions (see my previous discussion here). But then something funny happened: I got an e-mail from O’Reilly saying that all three of my RailsConf proposals were accepted. Then I heard from a colleague here at Intridea that his talk was accepted.

This seemed, frankly, too good to be true. So I hit up Twitter Search for RailsConf, and sure enough, everyone seemed to be elated about getting their proposal(s) accepted. This confirmed my suspicion, and I contacted O’Reilly immediately. In fact, I contacted O’Reilly and they weren’t even aware of the problem yet. I may have been the one who alerted them to the issue in the first place. Confirmation came a few minutes later via the RailsConf Twitter account. While I’m a bit disheartened that I’m not necessarily speaking at RailsConf, it was an object lesson in just how powerful Twitter search has become.

Is Twitter a replacement for Google? No. But Twitter provides an instantaneous connection to what is happening to people right now, and in some (many) circumstances it can give you answers that Google never would, even after they re-index the web. This also to me serves as a lesson in how to truly compete with Google. Don’t try to “out-Google Google” like Cuil did. Instead find a way to provide a search that Google can’t touch, that can’t be created simply by crawling the web endlessly looking for new content.

Pay attention to where Twitter search goes in the coming months and years, because it’s no joke: real time search is a big deal.

Categories
Author

Everyone in social media and public relations has watched in amazement as Barack Obama's campaign made better use of Web 2.0/social media than any other campaign in history, demonstrating mastery of social networking, viral (truly) video and mobile initiatives. (Yes, the VP announcement SMS thing was a screw-up, but the strategy was right.)

In the past, the Web has not been kind to politicians, with Howard Dean's 2004 Iowa Caucus concession speech "war whoop" rocketing around the Internet, and Ted Stevens's "Internet Tubes" remarks being mercilessly lambasted with YouTube videos viewed by hundreds of thousands of people.

But 2008 will be recognized as the year Web 2.0 played a major role in positively influencing the electorate. The Obama campaign, and now administration, and organizations like Moveon.org, have exposed millions of "ordinary" Americans to these new communications tools.

And while @BarackObama is the most followed user on Twitter, it's unlikely he'll be tweeting you "great idea!" or "lol!" any time soon. The demands of the office, security considerations, and prioritization of where the administration and new president will invest their time and our money, will influence how Web 2.0 is used by the federal government. In fact, the best uses of social media may be invisible to citizens...

To read more about why I think this is the case, please check out my column in this month's Talent Zoo.

Categories
Author

You may have already noticed by following us on Twitter or just by clicking around on the site, but we've launched a number of Present.ly clients in the past weeks.

Desktop Application

First up is our cross-platform desktop application that runs on Adobe AIR. You can view your update stream, post updates and more from a simple interface. You can also get notified automatically as new updates come in.

Desktop Screenshots

This application is a great way to access Present.ly in a compact, always-on way right on your desktop. We will be rolling out additional features for the application in the coming weeks, but we're happy to be able to give people what they've been asking for since we launched.

Mobile Applications

We're also very excited to announce the release of our native mobile applications for Present.ly. Now you can use these applications to interact with your co-workers on your iPhone, BlackBerry, or Android device anywhere you go. With these applications, you can update your status, view your main stream, view your replies, direct messages and more.

applications

The iPhone application is based off the open-sourced Natsulion Twitter iPhone application. It is available for free in the App Store on iTunes. On the Android platform, the Present.ly application is based off of another open-sourced Twitter application, TwitterDroid. You can download the application for free at the Android Marketplace. The BlackBerry application can be downloaded by going to our BlackBerry page. From there you can enter in your e-mail address and we will send the application right to your phone.

For those of you who have another device not listed above, you can use our mobile web version of Present.ly. All you have to do is go to your account from your device's mobile browser to access the mobile web version of Present.ly. You can also interact with Present.ly through SMS, MMS, or e-mail. Depending on your carrier though, standard rates may apply. Go here to view a list of our supported mobile carriers.

An Open-Source Initiative

We believe strongly in open-source and supporting the open-source community. As part of that, all of the clients discussed today are open-source and available on GitHub. We hope that open-sourcing these applications will serve as a great foundation for building more cool things around Present.ly as well as giving the community the chance to beat us to the punch on improvements if they so choose.

Categories
Author

I’m pleased to introduce a new service called Intridea University. It’s been in the works for a long time and we’re happy to be able to announce it’s arrival.

Registration is now open for “Introduction to Ruby on Rails” instructed by Joe Grossberg and myself. This course has been designed to introduce anyone familiar with programming to the popular Ruby on Rails framework.

This extended 3-day course will held at The Hotel George in Washington, D.C. starting on Friday, February 27th and ending in the afternoon on Sunday, March 1st. Breakfast, lunch, refreshments, and wireless internet will be provided throughout the weekend.

The Hotel George is a boutique hotel located in the Capital Hill district right down the street from Washington’s Union Station which has metro access to the entire area including Reagan National Airport and Baltimore International (via Amtrak).

We’ve scheduled 3 full days of training to make sure that we can go in-depth on important topics and have plenty of time to work directly with our students. Intridea University courses are hand-crafted and instructed by Intridea developers with knowledge cultivated though years of experience developing quality applications.

You’ll leave with enough knowledge to start building your own Rails applications and with the skills required to continue learning more advanced techniques.

There are 20 spaces available each costing $1250. If you register by February 19th, you can get the Early Bird rate of $995. Register now! Please visit Intridea University to learn more.

Come and join us for a weekend!

Categories
Author

I am a huge fan of SASS (Syntactically Awesome Stylesheets) for styling Rails applications. I have been using it on all of my projects for quite a while now and have developed some great techniques that make it much easier to organize, write, and read stylesheets in an application.

Unlike HAML, SASS retains most of the same “feel” when writing the code as vanilla CSS. It simply adds more power and better organizational tools, making it an easy choice as a go-to replacement. You can teach someone the basics of SASS in about 30 seconds: use two spaces to indent everything, put the colon before the declaration and no semicolon afterwards. In fact, I’ve even written regular expressions to convert CSS to SASS mechanically in some cases. It’s easy to pick up and once you do you will start reaping real benefits.

The 20-Second “Get Up And Running”

To use SASS, you must have the HAML gem installed on your Rails app. Add it to your environment.rb:

config.gem 'haml', :version => '>= 2.0.6'

Now you can create SASS stylesheets simply by making .sass files in a public/stylesheets/sass directory.

Basic Example: Building a Menu the SASS Way

The best way to start explaining the power of SASS may be through one of the more common styling tasks one encounters: styling a menu. Here we’ll assume a menu structure like this:

<ul id='menu'>   <li><a href='/'>Home</a></li>   <li><a href='/about'>About</a></li>   <li><a href='/services'>Services</a></li>   <li><a href='/contact'>Contact</a></li> </ul>

To style this menu in CSS, we might do something like this:

#menu {   margin: 0;   list-style: none; }  #menu li {   float: left; }  #menu li a {   display: block;   float: left;   padding: 4px 8px;   text-decoration: none;   background: #2277aa;   color: white; }

SASS allows you to use indentation to indicate hierarchy, saving much repetition and space. The same code in SASS looks like this:

!menu_bg = #2277aa    #menu   :margin 0   :list-style none   li     :float left     a       :display block       :float left       :padding 4px 8px       :text-decoration none       :color white       :background = !menu_bg

Hierarchical selectors mean that if you indent something, the selector it falls under will automatically be prepended to it, so the two examples above generate the same output. You’ll also notice !menu_bg in the SASS code. SASS allows you to declare constants that can be reused throughout the code, a very useful feature when dealing with colors.

Now we have our basic setup for the menu, but let’s handle some better cases. I want the color to change when I hover over the menu options and I want to highlight the current menu option (we’ll assume that the <li> encapsulating the current menu item will have class ‘current’ when it is selected). Let’s add these features first using CSS, then SASS. With CSS:

#menu {   margin: 0;   list-style: none; }  #menu li {   float: left; }  #menu li a {   display: block;   float: left;   padding: 4px 8px;   text-decoration: none;   background: #2277aa;   color: white; }  #menu li a:hover {   background: #116699; }  /* Make sure the color doesn't change when the current option is hovered. */ #menu li.current a, #menu li.current a:hover {   background: white;   color: black; }

This isn’t too bad, but our selectors keep getting longer and longer. Let’s look at the same thing in SASS.

#menu   :margin 0   :list-style none   li     :float left     a       :display block       :float left       :padding 4px 8px       :text-decoration none       :color white       :background = !menu_bg       &:hover         :background = !menu_bg - #111111     &.current       a, a:hover         :background white         :color black

The ampersand (&) in SASS is a shortcut to insert the entire parent selector at that point. By using &.current I am saying “the parent selector with a class of current.” &:hover means “the parent selector when hovered.” This makes it easy to write complex selectors in a compact, easy-to-read manner.

Another great thing about SASS is it has built in CSS color math. Note where I declared :background = !menu_bg - #111111. That is equivalent to subtracting 1 from each of the values of the constant’s color, which in this case yields #116699. This is great, because now I can change the color of the menu and the hover state will automatically change without me having to manually find it and recalculate it for a new color. Note that whenever you are using constants or performing calculations you need to add the equals sign to your declaration.

Getting organized with a master.sass

Another way you can use SASS is to organize all of your CSS into a single file without having to worry about it in your view. I have recently started using this approach for a number of reasons:

  1. It allows me to control stylesheet inclusion from within the stylesheets themselves, making the structure more readable.
  2. I can define global colors that can then be used in any of the child stylesheets.
  3. It’s really easy!

In a new project, I always create a master.sass that will look something like this:

// Define app-specific colors first !green = #191 !gray = #555  // Now define globally applicable, general styles  body   :font-family Arial, sans-serif    a   :color = !green   :text-decoration none   :font-weight bold  // Now import all of your other SASS files, they will be // automatically included in the same generated CSS file // at compile time.  @import menu.sass @import content.sass @import admin.sass @import users.sass

Using this structure I have a modular, easily expandable collection of stylesheets with global color constants and basic styles. In addition, I can add this to my Rails application with the simplest of calls:

<%= stylesheet_link_tag 'master' %>

Wrapping Up

Hopefully this gives you a taste of the easy awesomeness that is possible with SASS. The greatest thing about the library is you don’t lose touch with writing CSS because SASS is CSS, just with a few extras and shortcuts to make power-styling easier.

Update: A commenter pointed out that I forgot the @ before my import statements in the master.sass example, this has been fixed.

Categories
Author

We have built a country-sized economy online where the default price is zero -- nothing, nada, zip, writes Chris Anderson in The Economics of Giving it Away in the February 2 Wall Street Journal.

Semantics are very important here. Anderson chooses his words (I should say word, because Free is the title of his upcoming book) carefully. The price of nearly everything online is free, but not the cost. Anderson calls this the business model. People who love cheesy buzzwords call this monetization. I call it a fundamental misunderstanding of how things work.

Anderson has done a great job identifying the most sweeping change in the free enterprise system in the past 100 years, the price which people are willing to pay for certain things, but has missed a key element. This idea that digital goods are free is an absolute myth. As my journalism prof said, There's no free lunch, only a few stale peanuts on the bar.* What we have seen is not an evolution to free, but rather one in which the true costs of using many services are not as apparent as they used to be.

For example, even though you don't pay to use Facebook, Twitter, MySpace, LinkedIn, etc., there is actually an exchange of services (use of the social network) for an easily determined cash value. Users of so-called free Web 2.0 services are making a tacit exchange when they sign up for a particular service, create a profile, build a network of friends, and contribute to the user base of that service. The user base is the chief capital asset of any social network or site, with a discreet dollar value per user. You have exchanged your valuable time and your friendships/relationships in exchange for use of the service. And if you're at work, your employer is subsidizing that cost.

Anderson encourages entrepreneurs to innovate with new business models which, in some cases, involve charging for digital goods.

It's interesting that Anderson mentions in his first paragraph that online music is free. While some emerging/independent artists are offering free music downloads, the music industry, both publishers like Sony Music and Philips Music Group, and distributors like iTunes and Amazon, have not gone free. Technology has made it so easy to perfectly duplicate music, that huge numbers of people have unilaterally decided music ought to be free and are downloading and sharing it without paying for it. There's a big difference, however, between free and stolen.

Anderson is right, for the most part, that people are unwilling to pay up front for access to content and services, choosing instead to allow providers to extract cost/value through other less obvious means.

As John Yemma, the editor of The Christian Science Monitor, told NPR's Terry Gross, free online news is the only model that's out there. I don't think there's an alternative¦ we'd have to go back in the time machine to try to change this, but the expectation online is that news is free, and that expectation won't be altered.

Indeed, we have seen massive changes to how information and communications are delivered and to what and how people are willing to pay for them. But it's disingenuous to think that any of this is free. Nothing is free. Only the method of payment has changed.

* I have not given attribution for this quote because I found no reference to the peanuts version in my research and although some believe it was first said by economist Milton Friedman, there is much evidence that the quote is considerably older.

Categories
Author

Neil McAllister recently wrote a piece on InfoWorld entitled The Case Against Web Apps. In it, he outlines “Five reasons why Web-based development might not be the best choice for your enterprise.” Obviously, as an employee of a web application services and products company, I disagree strongly with that opinion.

Web applications are not a “trend” in enterprise software development. They represent a fundamental shift in how software is developed, implemented and used in today’s technological climate. But to be specific, let’s go point-by-point through the “case against web apps.”

“It’s client-server all over again”

It certainly is. The difference is, we’re not living in a mainframe, dumb-terminal world anymore. Server infrastructure is cheap and scalable, and as more enterprises push their IT infrastructure to the cloud (see another article from InfoWorld: IT needs to get over its cloud denial, or management will get over IT) the need for on-site datacenters will shrink and, for many companies, eventually disappear.

Web applications require no client deployment, no versioning, no installation and no machine-by-machine support. There’s no massive rollout procedure for a new version and no back-breaking process if there’s a small but important glitch in a major release.

“Web UIs are a mess”

When each project has specific and individual user experience needs, isn’t it good to reinvent the wheel a little bit? Having a blank canvas means having the chance to build exactly what is right for this application, not shoehorning an application into pre-defined constraints.

Bad web sites and bad desktop application interfaces are equally impenetrable to the average user. The success of the user experience lies not in the hands of the chosen deployment platform but in the hands of a developer with an eye for user experience. I don’t think it’s a stretch to posit that the majority of such developers work either on web applications or for Apple. When was the last time you saw a beautiful Visual Basic application interface?

“Browser technologies are too limiting.”

“User interface code written in such languages as C++, Objective C, or Python can often be both more efficient and more maintainable than code written for the Web paradigm.” This statement rings false to me; when was the last time you saw a graphic designer who could pop open his trusty Visual Studio 2008 and recompile a project to tweak the user interface? The fundamental advantage of HTML/CSS/Javascript based interface development is that is accessible to a wholly different set of people, people who understand how users think and want to behave but don’t necessarily have the programming chops to implement the actual code.

The proliferation of Flash, Quicktime, and Silverlight can pretty much all be explained by one fact: HTML doesn’t support embedded video. Few web developers turn to Flash or other technologies for much outside of rich multimedia playing. You also can’t consider such a tool a liability when it is available for more than 99% of all web users.

This also brings up a fundamental flaw in “the case against web apps”: if this is an article talking about using web applications for enterprise business applications, how are any of the concerns about browser compatibility valid? Don’t most enterprises have control over what browsers get used by their employees? The refusal of Internet Explorer 6 to kick the bucket certainly seems to indicate that companies have a great deal of control over how employees access the internet.

“The big vendors call the shots.”

Is this untrue of any development platform short of Linux? Companies are at the whim of Microsoft when they released an in-many-cases incompatible, largely disparaged upgrade to their operating system with Vista. That’s much more of a moving target than the web standards, which with the exception of Internet Explorer (another Microsoft project) make writing cross-browser, cross-operating system applications a relative ease.

“Should every employee have a browser?”

You know what? Lots of people e-mail jokes to their families from their work accounts, let’s not allow people to write e-mails anymore. I heard that sometimes people make personal calls from the office, so let’s get rid of the phones, too. Not only is this point inherently distrustful of the work ethic and general competency of most employees, it doesn’t even hold water: browsers can be used to access internal applications even if all outside internet access is restricted.

In the end, I may have spent too much time here refuting his arguments without making the real case for web applications. So, very briefly, here’s it is:

  1. Massively Agile: Web applications can be built, deployed, and put into general use in a matter of weeks, not months or years. New features can be rolled out on a continuous basis rather than waiting a year for a new “point release.”
  2. Massively Accessible: Web applications can be accessed from any device that can access the internet, regardless of operating system or system requirements. As mobile phones become more web capable this becomes even more apparent and necessary. Desktop applications require completely separate development efforts.
  3. The Local Data Problem: There’s no need for “shared” folders and collision control on documents in a web application. Everything is on the server, everything is up-to-date as soon as it is accessed.
  4. Web is the new Desktop: Technologies such as Adobe AIR and site-specific browsers have made it so that web applications are becoming more and more like desktop applications, bringing the ease of development and deployment with them.
  5. Collaboration is King: Web applications, due to their centralized nature, can naturally encourage less isolated, more collaborative work between employees.

Web applications aren’t the solution to every problem a business faces. If you need graphically intense 3D visualizations for your buciness, web applications probably aren’t the way to go for you. But for most businesses, most of the time, web applications will be more cost-effective, more useful and more agile than the alternative.

Categories
Author

I've been using Git for almost a year now, but I didn't really start using Git until recently when I began working for Intridea.  Once I started using Git on a daily basis, dealing with multiple projects, and multiple branches per project, I would occasionally make the mistake of changing code on the wrong branch.  While annoying, it was easily fixed by stashing the changes and applying the stash to the proper branch.

As much as I love git stash, this began to get old, and constantly hitting up git status to check the current branch wasn't cutting it.  After a bit of googling,  It describes how to add the current branch name and its clean/dirty status to you terminal prompt.

Just add this to your .bash_profile:

function parse_git_dirty {
  [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
  git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* (.*)/[1$(parse_git_dirty)]/"
}

export PS1='u:[33[31;40m]w[33[0;33m]$(parse_git_branch)[e[0m]$ '

And you should end up with something that looks like this:

As you can see, I like to use a bit of color to help things stand out.

So far this has been immensely helpful.  With this info at a glance, I always know where I am and how I last left things.

Categories
Author

Sometimes when developing a web application a feature will come along that needs to be *'smart'*. Smart features are features that in some way automate or abstract away operational details to make the user experience smoother and more intuitive. Developing smart features, however, can be quite difficult and requires a great degree of thought.

In the end what you are trying to accomplish by building smart features into your product is to do something that the user would want to do anyway without them having to do it manually. That's the catch: you have to know what your users will want to do *all of the time*.

h3. Designing the Interaction

When planning out a smart feature, you need to ask yourself three questions:

# What will 80% of users do in this situation?
# What is the best solution for that 80%?
# Will this solution harm the experience of the other 20%?

Very few user experience tweaks will be perfect for every user in every circumstance. You can't please everyone all of the time, and that reality can sometimes be harsh. But as long as you have a good *escape plan* you'll do all right.

An escape plan is the usage recovery for the 20% who don't need or want the "smartness" you are building into the application. To prevent angry mobs (small angry mobs, but angry mobs are generally a bad idea) you need to make sure that the smart feature can be circumvented in a way that feels intuitive to those who will want not to use it.

See what's happening here? What we're really doing is building a *second* smart feature for people who don't want the *first* one so that they can easily *avoid* the smartness of the first feature. Complicated!

Categories
Tags
Author

One of my favorite techniques to DRY up a Rails application is to pull out common functionality into a simple “vocabularized method,” by which I mean a simple descriptive method call that can be made from within your model or controller definition. For instance, in some applications I might have multiple models that have an “avatar.”

These avatars all behave the same and should do the same things so I don’t want to just repeat myself in the code. Instead I set up a file called has_avatar.rb inside my config/initializers folder. We use Paperclip for attachment handling at the moment, so I am going to create a wrapper for the specific Paperclip functionality I need for the avatars. Here’s the code:

module HasAvatar   STYLES = { :large  => ["200x200#", :png],              :medium => ["100x100#", :png],               :small  => ["70x70#", :png],              :little => ["50x50#", :png],              :tiny   => ["24x24#", :png] }                 def self.included(base)     base.extend ClassMethods   end      module ClassMethods     def has_avatar       has_attached_file :avatar,                         PAPERCLIP_DEFAULTS.merge(                           :styles => HasAvatar::STYLES,                           :default_style => :medium,                           :default_url => "https://assets.presentlyapp.com/images/avatars/missing_:style.png",                           :path => ":account/avatars/:class/:login/:style.:extension"                         )     end   end end  ActiveRecord::Base.send :include, HasAvatar

We define a module, HasAvatar that will add a new class method called has_avatar into whatever class it is included. I defined a constant STYLES that lets me access the style hash outside of the attachment definition. A final piece of DRYness in the code is the PAPERCLIP_DEFAULTS constant which is just the default setup for all attachments (S3 Bucket, etc.) and I override the options I need for the avatars by merge-ing them in.

class User < ActiveRecord::Base   has_avatar end  class Group < ActiveRecord::Base   has_avatar end

Now both users and groups will have all of the expected Paperclip functionality without having to repeat ourselves. This is a simple example but it shows the general practices behind building your application vocabulary, which is just my made-up term for the abstract reusable components that are specific only to this application. Of course, if it’s useful outside of the application, you might want to just go ahead and pluginize it!

The usefulness of these abstracted methods also comes in through the inherently polymorphic nature of Ruby. Throughout my code I can write helpers, views and more to support avatars without caring whether the object in question is a User or a Group. Basically, the DRYer you start the DRYer you stay.

Categories
Author
Subscribe to