idisposable.net: a blog about web 2.0, search, Microsoft, Google, and other fun stuff

Google launches compliance and archiving solution for Google Apps

Last night Google announced the integration of email
compliance features into Google Apps Premier Edition. They also increased the Premier Edition’s 10GB inbox to 25GB.

This is big news for Google Apps. Compliance and archiving are huge concerns for corporate customers. Just ask Intel or Merrill Lynch. Full-blown compliance systems are typically very expensive and come with liability concerns that make choosing a vendor very important. With Google in the game now, it makes the decision to move to a hosted collaboration platform like Google Apps much easier.

Some key features:

Policy management: lets administrators implement rules for how
messages are handled based on the sender, recipient, attachments or
content of the message.

Message recovery: allows you to search for mail across your whole
domain and recover deleted emails on a 90-day rolling basis, adding
peace of mind that important information is safe with Google Apps,
even in the case of accidental deletion by your users.

A full description can be seen here:

http://www.google.com/a/help/intl/en/admins/new.html#admin

the ‘net seems to be buzzing about this a bit:

Information Week

dbTechno

ArsTechnica

Alex Bunardzic is switching back to Assembler

Hmmm… maybe this whole Rails thing is just hype. I might start brushing up on assembler. In college, I was taught VAX assembler (not even x86!) so I am sure I’ll have no problems.

My favorite reason:

It’s small and fast

As mentioned above, small and slim, Assembler is THE fastest code on earth. Ruby and Rails are so far away down the food chain when it comes to instructing the machines, it’s not even funny.

Yeah man! Small and fast - “Agile” is such a buzzword now, what is more agile than assembler?

;P

Converting from ASP.NET to Rails: Part 2

This is part 2 in a series of articles on converting both your mindset and your ASP.NET web sites to Rails. Inside I hope to help anyone coming from a .NET background that is looking to create new Rails apps, or migrating existing ones.

Before we go forward, I assume that you have a basic understanding of Ruby and Rails. If not, read _why’s poignant guide to Ruby and buy Agile Development with Rails and run through at least the first couple of chapters.

One of the biggest challenges I had initially when starting with Rails was understanding the relationships between the web framework concepts I knew well from ASP.NET, and these new Rails concepts.

I discovered these key concepts from ASP.NET translate well into Rails:

  • Master Pages
  • User Web Controls
  • The ASP.NET Web Control / PostBack Event Model
  • The use and arrangement of .aspx, .ascx, and code-behind (.cs or .vb)
ASP.NET Concept Rails Concept
Master Pages Layouts
User Web Controls Partials
The “glue”:ASP.NET Web Controls.aspx,.ascx, and code behind (.cs or .vb) Rails MVCpage.rhtml _partial.rthml, and model.rb / controller.rb / helper.rb

Table 1: ASP.NET Concepts and their Rails counterparts

These concepts are not exact, as these are two completely different frameworks. Let’s take a look at each of these concepts in more detail.

Master Pages and Layouts

A Master Page gives you a canvas from which you can build other pages on without having to worry about all of the common elements like headers, footers, HTML directives, etc. Rails layouts are designed for a similar purpose and as such translate very well to ASP.NET Master Pages. As you will see in the next chapter in this series, I was able to convert an ASP.NET Master Page (site.master) to a Rails layout (application.rhtml) very quickly. ASP.NET Master Pages allow for multiple discreet content replacement zones, called ContentPlaceHolders. Rails does not have a preset “tag” for zones, rather you can use variables and a single “yield” statement to render discreet sections. It is best to reserve the “yield” for the main content body, and use variables for supplementary content like headers and titles that might be replaced.

This ASP.NET Master Page:


<@Page Title="Page Title">

Lorem ipsum blah blah blah

<asp:ContentPlaceHolder id="headerContentPlaceHolder" runat="server"></asp:ContentPlaceHolder>

Ipsum lorem blah blah blah

<asp:ContentPlaceHolder id="bodyContentPlaceHolder" runat="server"></asp:ContentPlaceHolder>

is functionally equivalent to this Rails layout:


<title><%=@title || "Default Title"%></title>
Ipsum lorem blah blah blah

<%=@header_content %>

Ipsum lorem blah blah blah

<%=yield%>

User Web Controls and Partials

In ASP.NET, User Web Controls (.ascx files), give you a nice way to encapsulate common web presentation elements. They can be included on any page or template, and have their own event model that custom code can be added to, much like ASP.NET Pages. An excellent example of a User Web Control would be a “contact us” widget that allows a user to fill out and submit a contact form in a consistent way across many pages of a website.

Rails partials serve a similar purpose. They allow a developer to encapsulate HTML with the intent of reusing across many pages or layouts. The “contact us” widget example above also fits well with partials.

From the excellent overview at the Rails Diary:

Partials let you break out a chunk of RHTML that is going to be used across multiple views in a controller or even across multiple controllers.

For more information, partials API Documentation can be found here.

In the next part of the series we’ll wrap up the ASP.NET concept comparison and start to look at implementing real-world ASP.NET to Rails conversion.

How Rails, Apache2, mongrel and mod_proxy_balancer are like IIS and ASP.NET

We recently migrated our corporate website from ASP.NET 2.0 to Rails. I am putting together a multipart series on migrating from ASP.NET to Rails, but in the meantime I thought I’d share some tidbits that I’ve come across that hopefully can help people who are otherwise scouring Google and the interwebs for information on how to fix arcane problems.

I have made a decision to deploy all of my Rails apps on a combination platter of the following delicious ingredients:

  • Debian Etch - because I like the way it works with my homeboy, Apache 2
  • Apache 2 - because its safe, it makes me feel good, and I really like the enormous amount of documentation available for it
  • mod_proxy and its sibling, mod_proxy_balancer, because they aren’t afraid to work with the workhorse (I should say, work-dog), mongrel
  • mongrel, via mongrel_cluster - because its fast, it always works, and it is becoming the de facto Rails server.

So this is my “platter” (stack is so overused). I like it. I can understand it. It makes sense to me. In .NET/Microsoft/IIS parlance, I think of it this way:

  • Apache 2 is like IIS — duh
  • Mongrel is like aspnet_wp.exe - aspnet_wp.exe is the ASP.NET worker process that executes ASP.NET code. Kind of like mongrel executes Ruby on Rails code
  • mod_proxy_balancer is conceptually similar to the ASP.NET worker process pool (as configured in the MMC under Application Pools), in that it handles the distribution of requests from the container server (IIS or Apache2) to the worker process (aspnet_wp.exe or mongrel). I know in reality it works nothing like this, but if you think of it this way its less scary and shows how much more control you have when working with this stack vs. ASP.NET.

I was first perplexed by the single-threaded Rails model, then I realized that with the power of proxying processes, you can determine exactly how and where your application scales.

With IIS and ASP.NET, you have a black box around the how you scale your processes within your application. Sure, you can set the maximum number of threads and some limits — but you essentially have very little control of how your distribute load. With mod_proxy_balancer, you can determine not only how you are going to proxy (for example, in my platter of services I choose to let Apache2 serve up html, php, images, etc) - but also where your application serves from. Try doing this in IIS / ASP.NET - you’d need to whip up some fancy distributed / remoted .NET architecture to even think about it.

So I can scale within my server by adding more mongrels with mongrel_cluster, and I can scale outside of my server by spinning up more mongrels on another server, without having to deal with anything fancier than IP addresses and ports. Neat.

PS - Before you think I drank the Kool Aid too quickly, I realize that IIS / ASP.NET is a hardened stack and works really well and can scale, and is great for lots of things. But the more I learn about this open-source stuff, the more I think you can achieve the same ends for lower cost, lower frustration, and higher level of satisfaction in your workaday development and prototyping activities.

Converting and migrating a web application from ASP.NET / C# to Ruby on Rails: Part 1 of ?

Folks,
I’ve had it with ASP.NET.

I had a simple missing tag on a Master page (I think VS2005 conveniently erased my form tag because I was trying to actually do something nifty), and it blew up our company web page.

I am going to convert http://www.ltech.com to Ruby on Rails from ASP.NET 2.0 / C#.

Ltech.com is a simple site, nothing too dynamic, and with a limited number of web forms. This should provide a good case study.

Once I figure out how to post nice “code snippets” in Blogger ( or move to Mephisto or WordPress ), I’ll start posting here.

Mapping and Location Mashups in Rails: GeoKit and Geonames

If you are building geography based mashups in Rails, or just need some simple calculations for distance, be sure to check out GeoKit plugin and Geonames API Gem. They will save you hours of time.


What is GeoKit?

“Geokit is a Rails plugin for building location-based apps. It provides geocoding, location finders, and distance calculation in one cohesive package. If you have any tables with latitude/longitude columns in your database, or if you every wanted to easily query for “all the stores within a 50 mile radius,” then GeoKit is for you”

It is fantastic. Here is some sample code:

include GeoKit::Geocoders
   def get_location( location )
      loc = MultiGeocoder.geocode( location )   # ask GeoKit to find your city
      return loc
    end
 
    def calculate
     start_city = get_location("Hoboken NJ")
     end_city = get_location("Los Angeles CA")
     distance = start_city.distance_to( dest )
     #thats it!  really?? yes.
    end

What is Geonames

Geonames is a public location database / web service API that allows you to search and reverse lookup geography and location information, such as city names and towns, longitude/latitude, etc.

The excellent Geonames Gem for Ruby provides an easy to use interface into the geonames web service.

Why use geonames? I’ve found it extremely useful for finding “nearby” locations as well as cities/counties/subdivisions within another area. For example, look at the following call:

http://ws.geonames.org/search?q=NJ&maxRows=20

Viola! All the cities and location features in NJ. The real power in geonames (which you don’t necessarily get with geokit) is the ability to restrict searches based on FCL and FCODE designators.

For example, some locations from geonames might these elements attached to them:

<fcl>P</fcl><fcode>PPL</fcode>

What do these codes mean?

FCL and FCODE represent “feature codes.” A complete list of feature codes can be found here.

You can do neat things with feature codes. Witness:

“Geonames?”Yes, Ed

“New Jersey has over 127 miles of beachfront and another 83 miles of bayshore. Where are all of these beaches??

Ed, I am not a person, just an XML web service. You’ll have to ask me a different way.

“Ok, how about this: http://ws.geonames.org/search?q=NJ&featureClass=T&featureCode=BCH

Yumm.

More geonames; simple latitude / longitude lookup:
http://ws.geonames.org/postalCodeSearch?postalcode=10012&country=US

gives us the longitude and latitude for a zip code in Manhattan.

It is a great tool when you don’t want to have a local database with geography information. Put memcached in front of the calls, and you’ll have a zippy, small-footprint mashup in no time.

The Ruby on Rails Production Stack: Too many choices

Is it me or are there too many choices for Rails production stacks?

Depending on what kind of server you are deploying to, you can have any or all of the following in your mix:

Apache
Lighty (LightTPD)
Pound
Pen
Mongrel (or mongrel_cluster)
Ngnix
FastCGI

Whoa! That is way more confusing than even the most obsfucated Java stack.

I am a huge Rails fan, but I hope the community can come together with some simple production stacks that are easy and enjoyable to deploy for as Ruby is to develop in.

I’d like to know, what are you using? I am using Pound/mongrel_cluster right now, but I am looking into Ngnix.

Say what you want about Microsoft, but copy->paste into IIS directory is a whole lot easier to do.

"Facebook surfers may cost their bosses" - but look who is doing the survey

Today CNET published an article claiming that Facebook could cost employers as much as $4 billion (yes, thats BILLION) dollars per year.

Internet security company SurfControl looked at the phenomenon and found that Australian workers who keep a close watch on their Facebook profile page were cumulatively costing their employers up to 5 billion Australian dollars ($4 billion) a year.

Hmmm. SurfControl “looked at the phenomenon.” Ok, let’s see - who is SurfControl?

From their website:

SurfControl Web filtering solutions enable companies to cost-effectively monitor network use and abuse anywhere in the organization, no matter how or where users connect to the Internet, across the full spectrum of Web-based content: IM, P2P, streaming media, file downloads, and Web-based e-mail.

So, a company who sells products that allow employers to filter internet content, comes up with a report that companies are losing $4 billion a year to Facebook. Slight conflict of interest here eh?

I could only imagine the economic boom we’d see if people stopped surfing Facebook! Just imagine all of the new products, inventions, cures for disease, and subsequent world peace that would occur if this menace was stopped! I am going to go out and buy SurfControl right now to get ahead of this as fast as I can.

In reality, social networks, websites, distractions, are always part of what workers have to contend with - information workers and otherwise. If employers think that Facebook (or SurfControl) is going to reap them many man-hours of productivity gains, they are likely the same employers whose employees waste time by surfing the web all day instead of contributing to the bottom line.

Tutorial: How to virtualize your PC and run it in Mac OS X (Intel editions only)

I recently converted from an IBM ThinkPad T43 to a MacBook Pro. I was able to keep all of my PC-specific software, including MS Office, Visual Studio 2005, SQL Server, QuickBooks, etc. This method allowed me to preserve my PC as it was - perfectly frozen in time with all my preferences - and take advantage of the powerful Darwin/OS X operating system for better productivity and as a platform for Ruby on Rails development.

  1. Clean your PC up to make sure you have eliminated anything you don’t need. This will ensure that you don’t have a larger virtual disk (the big file that your PC will be stored as) than you need. Here is how I did that:
    • I installed FolderSizes, from Key Metric Software: http://www.foldersizes.com/download-folder-sizes/index.htm This allowed me to see where all the “hidden” large items were on my disk. I was able to remove over 10GB of old files and garbage this way. Be sure to eliminate “Temporary Internet Files”, “Temp” directories, etc.
    • I ran “Add Remove Programs” and eliminated everything I didn’t need, or what would be easily replicated natively in OS X. For example, I removed iTunes, Picasa, a bunch of utilities, etc.
    • I copied all of my music, photos, projects, personal files to an external hard drive. If you have an external hard drive (USB 2.0 preferrably as it will work great between both your PC and your Mac), do the following:
      • Plug it in to your PC
      • Create a folder called “archive” on it
      • Copy your music, photos, personal files, etc. to it
      • That’s it - you are done.*
      • (* if your external drive is formatted with NTFS it might be a bit tricky to get it to be recognized by your Mac, so try to use a FAT32 drive if you can - I’ll post NTFS instructions later as I had to go through this)

OK, now that your system is nice and clean, you are ready to convert it into a virtual machine.

2. Convert your PC into a virtual machine using VMWare Converter.

    • Download VMWare Converter from here: http://www.vmware.com/download/fusion/eval.html
    • Install and run it.
    • Click “Import Machine” on the button bar.
    • Start the wizard, choose “Physical Computer” from the source screen. (click next)
    • Choose “This Local Machine” (click next)
    • Converter will evaluate your machine. You should choose at least your “main volume” (the larger one).
    • At this point, to save space on my Mac, I chose to enter a custom size (40GB) to hold my current system (28GB) and have some breathing room. If your PC has 80GB+ of storage, you probably don’t need to have a virtual disk that big. YMMV.
    • Click next (twice) and choose “VMware standalone virtual machine” (this is important). Click next again.
    • Give your machine a name “MYLAPTOP” or something like that, then choose a location (a USB 2.0 disk is a perfect choice) to save it to. Click next a few more times (no more advance setup required), and start your machine import.
    • Wait a few hours.

Whew! That was some experience, metaphorically similar to a religious conversion - you are at the altar but not quite there yet. Now you are ready to import your virtual PC into your Mac and join the dark/light side of the force (depending on your POV).

3. Install VMWare Fusion on your Intel-powered Mac OS X (Tiger) and “enjoy” your PC , exactly the way it was, on your Mac.

  • Download VMWare fusion onto your Mac: http://www.vmware.com/download/fusion/eval.html
  • You may want to review the release notes.
  • Install it.
  • Copy your virtual machine file from your USB 2.0 drive (see step 2 above), to your Mac. ~/Virtual Machines is a good directory for it (in other words Home -> Virtual Machines — create the directory first)
  • Run VMWare fusion.
  • Open the machine from your filesystem.
  • Off you go!

4. (Optional) Your new VM might behave erratically at first or force you to “Activate Windows”

  • If your VM bluescreens, just reboot it. Its normal behavior because you just essentially ripped the soul of your PC out and put it in another shell. It freaks out a bit. You shouldn’t need to reboot more than a few times.
  • If Windows asks for Activation, go through the steps. Your product key should be somewhere on your computer. If that doesn’t work, go through the “I’m not connected to the internet, activate by phone” menu and call them and get a new activation code.

If you have problems, leave comments here and I’ll try to answer them. Also you should check out the VMware support forums.

Good luck and happy computing.

Public Airwaves for the Public Good

http://civic.moveon.org/airwaves/

Please check this out people. This is huge; if Google or someone else opens up the new wireless spectrum, we will see another technology revolution.

Here is part of the letter I sent when signing the petition.

Thank you for your time and kind consideration. I am the CTO of a information services firm (getthejob.com) based in New Jersey, with offices in Cleveland and Naples, Florida. We employ over 40 full time employees and contribute much to our local economy, including well-paid high-skilled jobs.

A large part of our business was inspired by the Google model. Companies like ours to thrive on the ability to openly provide web tools for consumers; a concept ingrained into to the open Internet.

The wireless spectrum has been part of a closed system for too long. In the past, the engineering know-how required to master safe wireless operation made it wise to leave the protections in the hands of large, well-known and skilled firms like AT&T.

Today, technology (especially software) has become so advanced that spectrum owners like Google, or other like-minded companies, can safely allow access to the spectrum to inventors, innovators, small and medium sized businesses, and other economy driving enterprises.

The wireless spectrum is a treasure; a part of the public trust, as important to our nation as so many monuments and natural wonders that mark our land. A new economy and technology boom will occur if open access is provided to the innovators that have fueled this great nation since its inception.

Please consider adopting open access measures for all aspects of the new spectrum auction.