Monday, July 11, 2011

Our (Brief) Foray into a Brother HL-2280DW All In One Laser Printer

Update at bottom (7/12/2011)
The Bad:
Can't scan multiple pages in to a single document
Wireless is not so easy to configure (I'm in IT).
Drivers won't be automatically detected (It's 2011 guys)

The Good:
It prints quickly
It scans (one page) quickly, with decent image quality.


Review:

We have been printing and scanning quite a bit so decided we would get an AIO.  We wanted a laser printer as an ink toner cartridge that lasts 500 pages won't go far with 30-40 page documents.  That said we spent quite a bit of time looking around and we found the Brother HL-2280 Printer was a small and inexpensive device which takes a Brother TN-450 toner cartridge that provides a decent cost per page.  My girlfriend went to Staples to play with and purchase the said printer and the cashier, the clerk informed her that the starter toner in the printer would only print 20 (twenty) pages before running out, and therefore she should purchase a new toner to go with it; he offered to sell her a TN-420.  Really?  Lying Thieves, thankfully she wasn't suckered in by this gimmick.  For reference, the printer comes with a TN-420 toner cartridge which according to staples.com prints 1,200 pages.  I can only assume that the pimply geek with huge gauge holes in his ears was flat out lying in order to get her to purchase a toner cartridge and improve his sales attach rate.  Also, the two year warranty is only 29.99.  Thanks, we'll pass. I hope it dies before two years is up so it can fill a dumpster somewhere.

Step 1) Plug in, configure wifi (Fail #1)
With the printer at home I plug it in, and turn it on.  Open the menu, go to wifi and use the wifi protected setup menu, which i've admittedly never used.  I choose the option where it gives me a code that i type in to the router, and then the devices pair.  60 seconds later my belkin router says device connected successfully, and the printer spits out a page saying failed.  I tried a couple variations of this and eventually gave up.  Ultimately I connected to the printer via an ethernet cable, connected to the web interface with the default username of admin and the default password of password and managed to configure the wireless from there.

Step 2) Connect to computer (Fail #2)
I used the add a printer wizard in Windows 7 and to my delight it was quickly detected.  Except the printer driver wasn't found.  I went to the brother website and download the printer driver, installed it via computer management and I'm off to the races!

Step 3) Print a document (The only successful step)
It prints. Oh, and it can print on both sides / duplex perfectly.

Step 4) Scan a document (Fail #3) (Update below)
I press the scan button expecting the scan to email function similar to other brother AIO's I've used.  It says check connection.  This device can only perform the scanning functions through the brother software.  No problem I say! I download the 130MB software, install it (reboot required... ugh it's 2011), and scan a document.  All of the defaults scan to JPG, including scan to email or file.  I change it to default to PDF and go to scan my document.  As it turns out, this brother All In One HL-2280DW IS NOT CAPABLE of scanning multiple pages in to a single document.  Say you want to scan and email a 2 page document, you will need to scan it in to two separate files and email them separately.  The scanner we had some 12 or 15 years ago was capable of this simple functionality.  Press scan, it scans the document, asks you if there are any more pages, and either scans the next page or finishes with the file.

Step 5) Return for full refund.
Reason stated on return claim: defective.




My Backstory:
I have installed and used multiple brother all in one laser devices and figured I'd give them a shot since at the budget end their cost per page is far lower than the competing HP model (1.7c/page vs 5c/page).  I have no previous hatred of brother until this new device was purchased (and about to become returned).




UPDATE: 
It turns out it is possible to scan multiple pages. The preferences menu doesn't show the option, but if you right click on the email or file button for example, and go to settings you get almost the exact same menu you find under preferences, but it has a checkbox for manual scan. It does work. The downside is you must return to your computer to press the next page button, and the software on the computer effectively does a new scan job and stitches the two together. This is clearly a piece of equipment meant for scanning one page things, and the software isn't well designed (why does the checkbox only show up on right click -> settings, instead of the main preferences tab you get?

Thursday, July 7, 2011

Embedding a User Editable Google Maps and Street View Control in a Website

We recently added a feature allowing our users to show the Google Street View of their property on our website and there wasn't a lot of documentation about how to do it.  Ideally we wanted to be able to display the street view of a real estate listing so prospective buyers could get a better feel for the property and the surrounding area, and it seemed like a solveable problem.

The final solution ended up looking like this:

In order to accomplish this we needed to do several things.  First, we already know the address of the property that is being entered because as a real estate listing site that is something users enter with their listing info.  Therefore we simply need to use the google maps and google street view API to display the map and street view version to our users so they can confirm the location and angle of the view.  Once they have done this we store the POV information and the location of the property (in case the google approximation is incorrect) in our database to ensure we display the correct info.

Step 1) Display the approximate location for the street view and map controls and allow the user to adjust the view to their liking

[code]
var map1;
var panoramaOptions;
var myPano;
var point;
var point1;
var marker1;

/*********************************************************/
//Use the validate form code to set hidden textboxes to the values
//from the streetview Pano, so when the form gets submitted the
//values get passed to the server to be saved
/*********************************************************/
function validateForm(){
this.document.getElementById('pitch').value = myPano.getPov().pitch;
this.document.getElementById('heading').value = myPano.getPov().heading;
this.document.getElementById('svzoom').value = myPano.getPov().zoom;
this.document.getElementById('sv_latitude').value = myPano.getPosition().lat();
this.document.getElementById('sv_longitude').value = myPano.getPosition().lng();
this.document.getElementById('latitude').value = map.getPosition().lat();
this.document.getElementById('longitude').value = map.getPosition().lng();
return true;
}

function load() {
//set the point for the panoramic
//at this point we don't know the POV info so we set them all
//to 0, the user will have to adjust the POV and we will save
//that information
point = new google.maps.LatLng(66.6666, 66.6666);
panoramaOptions =
{
position:point,
pov: {
heading: 0,
pitch:0,
zoom:0
}
};
/*********************************************************/
//use a div with elementid pano to display the streetview panorama
/*********************************************************/
myPano = new google.maps.StreetViewPanorama(document.getElementById("pano"), panoramaOptions);
myPano.setVisible(true);


var sv = new google.maps.StreetViewService();
var availability_cb = function(data, status) {
/*********************************************************/
//if the streetview service can't display teh location (due to lack of data)
//then we use a bunch of hidden fields to display an error message
//apologizing for the inability to use streetview
/*********************************************************/
if (status !== 'OK')
{
document.getElementById('sv_enabled').checked = true;
document.getElementById('pano').style.display='none';
document.getElementById('pano').style.visibility='hidden';
document.getElementById('panotext').style.display='none';
document.getElementById('panotext').style.visibility='hidden';
document.getElementById('panoerror').style.display='';
document.getElementById('panoerror').style.visibility='';
}
/*********************************************************/
//show the panoramic
/*********************************************************/
else
{
myPano.setVisible(true);
}
}

sv.getPanoramaByLocation(myPano.getPosition(),50,availability_cb);

/*********************************************************/
//this code displays the normal streetview map and allows
//the user to drag the pushpin to set the proper location
//in the event the google provided position isn't quite accurate
//this map gets put in a div with the id map
/*********************************************************/
map1 = new google.maps.Map(document.getElementById("map"),
{
center: new google.maps.LatLng(66.6666, 66.6666),
zoom: 15,
mapTypeId: 'roadmap'
});

point1 = new google.maps.LatLng(
parseFloat(66.6666),
parseFloat(66.6666));

marker1 = new google.maps.Marker({
map: map1,
position: point1,
draggable: true
});
}


[/code]
All of the preceding code creates the following layout in the website:


Step 2) We store the information from the streetview and normal map in our database, that way when we display the listing to users they get the previously-set location.

Step 3) We display the street view control and the normal roadmap view on our site.
[code]
var map1;
var panoramaOptions;
var myPano;
var point;


function load() {
/*********************************************************/
//Set up the street view position
/*********************************************************/
point = new google.maps.LatLng(66.6666, 66.6666);
panoramaOptions =
{
position:point,
pov: {
heading: 61.4137, //This is the custom POV that was set
pitch:9.02999, //by the user
zoom:0
}
};

/*********************************************************/
//use the same divs as before, pano for streetview and map
//for the roadmap.
/*********************************************************/
myPano = new google.maps.StreetViewPanorama(document.getElementById("pano"), panoramaOptions);
myPano.setVisible(true);




/*********************************************************/
//set up the roadmap
/*********************************************************/
map1 = new google.maps.Map(document.getElementById("map"), {
center: new google.maps.LatLng(66.6666, 66.6666),
zoom: 15,
mapTypeId: 'roadmap'
});
var point1 = new google.maps.LatLng(
parseFloat(66.6666),
parseFloat(66.6666));

var marker1 = new google.maps.Marker({
map: map1,
position: point1
});

}

[/code]

Wrap Up
And once again this creates the final picture:
I've left out some things like storing the POV info in my database as well as how to convert an address in to a Lat/Lng via the google maps API so you'll have to read the API's to figure out how to do that.  This should help you a bit with the street view functionality :)
If you'd like to see it in action this code is what currently drives the street view and property map functionality of all the Commercial Real Estate Listings at www.cimls.com