Picking Up The Crumbs
17 June, 2013 § 25 Comments
A few days ago a new feature landed in Firefox Nightly that makes closing multiple tabs easier than it was before.
I often find myself in situations where I have multiple tabs that I opened only to look at for short periods of time. Sometimes I reach this state while reading articles on Hacker News or looking at funny pictures on Reddit. At the end of looking at the tabs, it would be nice if Firefox had a way to close these ephemeral tabs so you can get back to your previous work quicker.
Well, Firefox now does! If you open lots of tabs from Reddit and then want to close all of the tabs to the right of Reddit, just right-click on the Reddit tab and choose “Close Tabs to the Right”. It’s easy and quick!
Why “close tabs to the right” and not “close tabs to the left”? When we open new tabs they appear on the end, and so naturally tabs that have a longer lifetime end up being promoted to the start-side of the bar. This leads us towards the situation where closing tabs “to the right” is a simple way of closing the ephemeral tabs.
Users who are using Firefox with a right-to-left locale such as Hebrew or Arabic should see the equivalent “Close Tabs to the Left” feature.
Huge thanks go out to Michael Brennan who contributed the patches and automated tests for this feature! Unless something drastic happens, this feature will find its way to Firefox Release in just over 12 weeks in Firefox 24.
A new semester, a new capstone project
11 January, 2013 § 3 Comments
This is the first week of a new semester at Michigan State University, and with that brings a new group of students who will be working on a senior capstone project with Mozilla.
This semester the students will be focusing on multitouch gestures within the browser. They’ll start out the semester by fixing a few good-first-bugs, then they’ll move on to adding some gestures to standalone image and video documents. The final step of the project will be to focus on improving our pinch-to-zoom for webpages in Firefox.
As the semester progresses, the students will be blogging their progress on their own blogs (I may crosspost them here from time to time):
Brandon Waterloo: http://brandonwaterloo.wordpress.com/
Raymond Heldt: http://heldtray.wordpress.com/
Bill de Araujo: http://spartanfire.wordpress.com/
Here’s to a great semester!
Identity theft with Comcast?
28 November, 2010 § 1 Comment
Over the holiday weekend, the cable box in my house stopped working. The user interface for the cable box functioned fine, but the picture and audio were completely gone. I brought the cable box to Comcast and swapped it with one that they had in stock for no charge.
The next day I hooked up the cable box and called Comcast to sync up the box with their licensing service. When I was on the phone with them, the operator mentioned that there was a pending service order in a couple days and they could do the work then if that wasn’t a problem. Weird, nobody here knew anything about this service order.
Somehow there was an order in for telephone and cable service upgrades/installation. The phone number they had on file as requesting this service had nothing to do with us. Googling the phone number got us a name and address of a house in the next city over. It goes without saying that we promptly got the service order cancelled.
In the end, I’m happy that we noticed this before it happened.
Could we be a victim of identity theft? How could an order like this be placed on our account? What would have happened if we hadn’t noticed?
Thank you Tom Izzo
16 June, 2010 § Leave a comment
Thanks Tom. These past few days have brought a community and state together for a common cause that will most likely be forgotten about when Midnight Madness comes around.
Often times a coach of a college basketball team has to help his players choose if they should leave college for the pros, and just recently Izzo got to trade places with his students (not for the first time though).
Izzo could have decided to leave East Lansing and move down to Cleveland to coach arguably the best professional basketball player right now. But he didn’t.
As an MSU student and alumni, I am glad that Tom decided to stay at MSU. The basketball program has helped the university tremendously, and much of the thanks go to Mr. Izzo and his family.
Unit testing code behinds in ASP.Net Web Forms
13 June, 2010 § 7 Comments
Have you ever inherited an ASP.Net website with waaaaaaay too much logic in the code behinds?
A while back I came up with a solution to solving this problem. I don’t have a name for it, but if you do, please leave a comment at the end of this post.
The problem that I was trying to solve is that I wanted to make a new page and implement it using Test Driven Development. The hard part was that there was a lot of code that basically dealt with the visual aspect and interaction of the page but not much with the data model. I needed to find a way to write tests around this code, as the data model code already had a framework for writing tests.
Here is an example of the before-case:
public class CodeBehind : System.Web.UI.Page { protected void btnFindUser_Click(Object obj, EventArgs e) { if (Page.IsValid) { var dbConnection = new DatabaseConnection(); var users = dbConnection.GetUsers( txtQuery.Text ); if ( !users.empty() ) { dataTable.Bind( users ); } } } }
What I came up with was an introduction of a “controller” class that lived outside of the ASP.Net Web Forms project. Here is an example of the after-case:
// CodeBehind.aspx.cs public class CodeBehind : System.Web.UI.Page { protected void btnFindUser_Click(Object obj, EventArgs e) { controller.FindUser( Page.IsValid, txtQuery.Text, dataTable ); } } // CodeBehindController.cs public class CodeBehindController { public void FindUser( bool pageIsValid, string query, DataTable dataTable ) { if ( pageIsValid ) { var dbConnection = new DatabaseConnection(); var users = dbConnection.GetUsers( query ); if ( !users.empty() ) { dataTable.Bind( users ); } } } } // CodeBehindControllerTests.cs public class CodeBehindControllerTests { public void FindUser_WithNoUsersFound_DataTableIsEmpty() { DataTable table = new DataTable(); CodeBehindController controller = new CodeBehindController(); controller.FindUser( true, "ImpossibleUserToFind", table ); Assert.IsTrue( table.empty() ); } }
With that, I can now mock out the DatabaseConnection and the DataTable and I’m good to go. By passing in Page.IsValid instead of the whole Page object, I’m able to provide types that are easier to instantiate and I also now have code with less dependencies.
Getting this to work is actually very simple. Just introduce another class and put all of your logic in that class. There shouldn’t be a single conditional in your *.aspx.cs page. As long as you follow this pattern, it should be pretty easy to TDD your next ASP.Net Web Forms page.
Any questions? Leave a comment and I’d be glad to help.