-
A magazine-like experience built on top of Google Reader.
-
We all know journalism happens only at newspapers. Better to protect them at all costs than to invest in the murky "future."
-
Modernizr is a small and simple JavaScript library that helps you take advantage of emerging web technologies (CSS3, HTML 5) while still maintaining a fine level of control over older browsers that may not yet support these new technologies.
Latest from the blogs 
Magnetbox — links for 2009-07-02
Posted by Ben @ July 03, 2009 01:11 AM
Your Tech Weblog — iPhone 3GS killer feature: Far-better camera
Posted by Julio Ojeda-Zapata @ July 02, 2009 11:38 PM
I am delighted with Apple’s just-released third-generation iPhone, and especially with one of its marquee features: an upgraded still camera that also shoots video.
This makes the iPhone 3GS one of the big reasons to spend extra moolah for an Apple handset instead of going for a deal; a version of the second-generation 3G version of the iPhone is still being sold for $99. (Read my iPhone 3GS review.)
I’ve been snapping lots of pictures and videos with my 3GS loaner and I generally like the results, especially compared with the much-crappier photos I have taken with the 3G’s camera.
Resolution has been upped from 2 to 3 megapixels, and still imagery looks nicer overall. And in a twist, settings such as focus and white balance can be adjusted with touch-screen taps. If you want to focus on something in the foreground, just touch that part of the screen. There’s even a macro feature for up-close shooting.
As for video, I am thrilled to have the option of capturing moving pictures on a moment's notice, with the device that is already in my pocket at all times. The quality of my iPhone clips is surprisingly decent. Parents in the market for an Apple phone should definitely go 3GS; I’ve taken lots of shots of my kid already.
See above and below for examples of still and moving images I've recorded. I uploaded the videos to YouTube directly from the iPhone, which is a terrific trick. Uploading videos and photos to Apple’s MobileMe is another option. I'd like to see more options -- especially uploading to the popular Flickr and Facebook.
Your Tech Weblog — Phone overheats when it, like, gets hot, duh
Posted by Julio Ojeda-Zapata @ July 02, 2009 11:33 PM
I was on a beach outing with my family and my loaner iPhone 3GS the other day when I glanced at the phone’s display and saw the ominous message embedded here.
It was the first time I had seen that scary-looking screen. But, as it happened, I had left the handset in direct sunlight on a superhot day.
So, my reaction was, “Like, duh, of course the iPhone just overheated. Be more careful from now on.”
I tucked the iPhone into one of my backpack’s outer pockets to cool down and, when I checked on the device a half hour later, it was working just fine – and has worked perfectly ever since.
I wasn’t surprised, therefore, when Apple this week released an iPhone advisory about this very issue.
However, this has since seemingly been misconstrued by some to be an Apple admission of an iPhone-overheating problem. Nonsense, says CNET, in a piece titled, “iPhone heat issue much ado about nothing.”
I agree.
Schneier on Security — Information Leakage from Keypads
Posted July 02, 2009 05:09 PM
VISI BLOG — How Can Current Events Affect Your Business?
Posted by Rob Winnig @ July 02, 2009 03:53 PM
Schneier on Security — More Security Countermeasures from the Natural World
Posted July 02, 2009 11:11 AM
afongen — Links for 2009-07-01 [del.icio.us]
Posted July 02, 2009 07:00 AM
Rockford Lhotka — MCsla on the Olso May CTP
Posted by Rockford Lhotka @ July 01, 2009 11:15 PM
I’ve updated my prototype MCsla project to work on the “Olso” May CTP. The update took some effort, because there are several subtle changes in the syntax of “Oslo” grammars and instance data. What complicated this a little, is that I am using a custom DSL compiler because the standard mgx.exe utility can’t handle my grammar.
Still, I spent less than 8 hours getting my grammar, schemas, compiler and runtime fixed up and working with the CTP (thanks to some help from the “Oslo” team).
I chose at this point, to put the MCsla project into my public code repository. You can use the web view to see the various code elements if you are interested.
The prototype has limited scope – it supports only the CSLA .NET editable root stereotype, which means it can be used to create simple CRUD screens over single records of data. But even that is pretty cool I think, because it illustrates the end-to-end flow of the whole “Oslo” platform concept.
A business developer writes DSL code like this:
Object Product in Test
{
Public ReadOnly int Id;
Public string Name;
Public double ListPrice;
} Identity Id;
(this is the simplest form – the DSL grammar also allows per-type and per-property authorization rules, along with per-property business and validation rules)
Then they run a batch file to compile this code and insert the resulting metadata into the “Oslo” repository.
The user runs the MCslaRuntime WPF application, which reads the metadata from the repository and dynamically creates a XAML UI, CSLA .NET business object and related data access object that talks to a SQL Server database.
The basic functionality you get automatically from CSLA .NET is all used by the runtime. This includes application of authorization, business and validation rules, automatic enable/disable for the Save/Cancel buttons based on the business object’s rules and so forth.
If the business developer “recompiles” their DSL code, the new metadata goes into the repository. The user can click a Refresh App button to reload the metadata, immediately enjoying the new or changed functionality provided by the business developer.
The point is that the business developer writes that tiny bit of DSL code instead of pages of XAML and C#. If you calculate the difference in terms of lines of code, the business developer writes perhaps 5% of the code they’d have written by hand. That 95% savings in effort is what makes me so interested in the overall “Oslo” platform story!
thingelstad.com — Xefer Twitter Visualization
Posted by Jamie Thingelstad @ July 01, 2009 08:29 PM
This graphic can generally be put in the pile of visualizations of stuff that isn’t important, but the display is cool. This tool from Xefer looks at your Twitter behavior distribution over days of the week and time.
Happily, it seems I don’t use Twitter in my sleep.
This post is from the website thingelstad.com by Jamie Thingelstad.
Related posts
Schneier on Security — MD6 Withdrawn from SHA-3 Competition
Posted July 01, 2009 07:27 PM
Schneier on Security — New Attack on AES
Posted July 01, 2009 04:49 PM
MNteractive.com — Mpls.-St. Paul Wordpress User Group Meeting Registration Up
Posted by Jay Myers @ July 01, 2009 04:15 PM
The first meeting of the Mpls.-St. Paul Wordpress User Group is slated for July 30, 2009. We’ll be talking about a slew of WP topics, including:
- Organizing Wordcamp Twin Cities 2009
- Converting rocking HTML Designs into rocking Wordpress Templates
- Wordpress Overview for Beginners
- Wordpress as a CMS
Details:
/timelliott — Returning To Regular Blogging Shortly…
Posted by Tim @ July 01, 2009 03:45 PM

…and it won’t be about lifestreaming
Related articles by Zemanta
- When blogging less becomes more (trishussey.com)
behind the times — Forgotten Refactorings
Posted by Hamlet D'Arcy (noreply@blogger.com) @ July 01, 2009 02:01 PM
Seven years later, I still believe this is the book to read when starting out on the path to being an engineer. It's not so high-level or inaccessible as Design Patterns (although still a foundational book), nor is it as low level and implementation specific as Clean Code or Implementation Patterns (also worthwhile reads).
At the time I read Refactoring, I was neck deep in PocketPC and PalmOS development. C and C++ code without unit tests. Difficult to write and difficult to change. The better developers knew the operating system API by memory, and the best developers could explain how the API interacted with the hardware. I remember one job interview where I was asked what "Hello" + 4 yields.* My answer of "I would never write code like that" was met with, "Of course you wouldn't, but you'll need to debug it." How true.
Refactoring laid out a vision of good, clean code that went beyond simply working correctly. This wasn't exactly new information. My peers and I all valued short methods, small classes, high cohesion, and low coupling even if we had a lot to learn about how to achieve those properties. But we also valued shipping code on the delivery date and not working the weekend too frequently. So when timelines got tight, we cranked out sort-of working code and moved on to the next project, which was usually the maintenance phase of the same project.
The beauty of Refactoring was that it laid out specific instructions on how to make crummy code better. And those instructions were almost mechanical in their execution... first do this, then do this, then finish. In fact, the instructions for each refactoring are in a section called "Mechanics". The promise was: if you follow the instructions then your code will improve and nothing can go wrong. I loved this. Finally, I had a guide and body of knowledge around what to do about all that old code I had to sort through.
So why did it all go so wrong?
Why does refactoring so often introduce bugs into your system?
Why is refactoring a word you can barely mention to QA and Operations without horrified reactions?
Most importantly, what happened to the "and nothing can go wrong" part of the refactoring promise?
I'll tell you what went wrong: our tool vendors screwed us.**
I've been interviewing Java candidates all week, and I always ask about refactoring. Everyone knows what refactoring is. Many people know the keyboard shortcuts. It couldn't be easier to recall the various refactorings available in the IDE... there is an entire freakin' menu of them. And not a single one of those menu items is implemented correctly in terms of Fowler's Mechanics:
Chapter 1, Page 7: The First Step in Refactoring: Whenever I do refactoring, the first step is always the same. I need to build a solid set of tests for that section of code.
Page 7! This isn't buried in some appendix, it is front and center. And in case you're just skimming the book and missed it, it's called out in a sidebar with a lightbulb on the very next page:
Chapter 1, Page 8 Before you start refactoring, check that you have a solid suite of tests. These tests must be self-checking.
I don't know how much more emphasized step 1 of refactoring could be: don't touch anything that doesn't have coverage. Otherwise, you're not refactoring; you're just changing shit. And not a single IDE enforces or encourages you to have test coverage before mucking about with the refactorings. I propose we make a change to our behavior. If QA or Operations asks us what introduced a defect, and our answer is a refactoring without coverage, then we reply, "I was just changing some shit." I think this would work to eliminate reckless refactorings. Hmmm. You know what might work better? How about we just try a little harder to bring our code under test. Reading "Working Effectively with Legacy Code" is a good place to start, as well as using functional testing frameworks like DBUnit or maybe FIT. The choice is yours, I guess. The second option seems a little more useful in the long term, however, I kinda like the idea of developers telling QA and their managers that software is late because they decided it was a good time to "change some shit".
But please, whatever you do, stop saying refactoring when you're making changes to untested code. You're ruining it for the rest of us who want to do real refactoring.
* "Hello" + 4 yields 'o' as a character. Strings are just character arrays lined up in contiguous memory, so H is offset 0, e offset 1, and o offset 4. I thank God this information is no longer useful to me.
** Yeah, it's more our fault than the tool vendors, isn't it? Still, it's a lot easier to blame a nameless entity than the guy sitting across from you.
Schneier on Security — Security, Group Size, and the Human Brain
Posted July 01, 2009 11:51 AM
The Cloud CTO Blog — Build it and they will come
Posted by cloudcto @ July 01, 2009 03:52 AM

Rail Spikes — Testing HTTP Authentication
Posted by Luke Francl @ July 01, 2009 01:44 AM
If you ever need to test HTTP Authentication in your functional tests, here is how you do it:
1 2 3 4 5 6 |
def test_http_auth @request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials("quentin", "password") get :show, :id => @foobar.id assert_response :success end |
This is much like testing SSL.
Hat tip: Philipp Führer for Functional test for HTTP Basic Authentication in Rails 2.
Magnetbox — links for 2009-06-30
Posted by Ben @ July 01, 2009 01:05 AM
-
Extreme makeovers of actual fast food items
MN Headhunter — 3 FREE Online Seminars: Job Search Tool Kit July 7th | LinkedIn A-Z July 8th | Social Media July 9th
Posted by MN Headhunter @ June 30, 2009 07:28 PM
While Be Your Own Headhunter is under going a facelift this is how to stay in touch with upcoming seminars:
All presentations are 60-90 minutes with a Q&A that follows.
If you are a Twitter user and would like to provide immediate feedback during a presentation add #BYOH to your comments and suggestions. I will follow up with you on Twitter after the presentation.
PLEASE NOTE: If you are unable to attend the sessions during these times (or are seeing this post after sessions have been held) either click MN Headhunter Blog or Be Your Own Headhunter where you will find a calendar of upcoming events or register anyway so you can get the slides via email.
July 7th, 3 PM & 7 PM CDT
Job Search Toolkit - Be Your Own Headhunter
This is for those in a job search or those thinking either by choice or force they will be doing one soon. Topics to be covered include:
- To plan your job search
- How to market yourself
- Ways to ask for referrals and advice
- Where to find the hidden job market
- Where to research companies
- How to find contact names and email addresses
- Tips on using email and phone for contacting and follow up
To register click:
July 8th, 3 PM CDT
LinkedIn A to Z - Use LinkedIn Like A Headhunter
Whether you are using LinkedIn as a job seeker, recruiter, sales person or for general networking purposes this presentation will show you how to:
- Create and optimize your profile
- Create your personal URL
- Connect with and expand your network
- Find and participate in groups
- Research companies
- Use Google to see all of LinkedIn, not just your 3 degrees
- Write and ask for recommendations
- Participate in Questions and Answers
- Search for names using keywords, title, company, skill set and location
- Avoid pitfalls
To register click LinkedIn A to Z - Use LinkedIn Like A Headhunter
July 9th, 3 PM CDT
Using Social Media For Networking, Lead Generation And Job Search
For those of us who write a blog and/or have profiles on Facebook, Twitter, MySpace and Ning groups we often use these site to communicate with friends, coworkers and family but until recently very few thought of them as opportunities to network, for lead generation, find jobs and consulting opportunities.
I will walk through the use of blogs, Facebook, Twitter, MySpace and Ning groups showing ways one can:
- Optimize profiles with keywords, locations, etc
- Use the site to search others
- Join and create groups
- Overtly and covertly say you are networking, looking for customers, jobs or consulting gigs
- Show what you are working on and prove expertise
- Engage in a regional, local and industry conversation
- Connect and network prior to and after industry events
To register click Using Social Media For Networking, Lead Generation And Job Search
If you are seeing this blog post after the sessions have taken place click Be Your Own Headhunter for latest announcements or MN Headhunter to return to the front page for the current schedule
Schneier on Security — Cryptography Spam
Posted June 30, 2009 06:36 PM
Schneier on Security — Growth of the CSE
Posted June 30, 2009 11:32 AM
Tech Career Tips — Prodigy Developers - Sara Chipps
Posted by Tavis Hudson (noreply@blogger.com) @ June 30, 2009 11:17 AM
Here is the third installation of my Prodigy Developers interview: Sara Chipps – You can find her at GirlDeveloper.com. I highly suggest you check out her site. You will find some links below. She is loaded with energy, intelligence and a great thoughts on advancing your career as a developer.
Who: Sara Chipps:
Where: GirlDeveloper.com and Datamation (Search for “Sara Chipps” and review some of her great columns and career suggestions)
Employer: MakeOver Solutions Site = DailyMakeover.com
Connect: Sara is open to comments and questions - sarajchipps [at] gmail.com
Sara has a realistic approach to communication in the work place and how to interact with others (in work or in the tech community) to learn and grow. She is not afraid to really push herself into uncomfortable areas, then using that experience to succeed and grow. She is very courageous and confident (although she may say otherwise).
Here is the Q&A with Sara.
Production Note: (Each link will take you to just that question/answer)
- Sara’s Background: Who What Where When: (2:40) .NET Developer at MakeOver Solutions - DailyMakeover.com, Speaking, Writing, very involved
- Sara on Continued Education / Training and the Community: (2:19) She uses training events, user groups, writing and connecting with other developers to force her learn. “People that really get involved keep each other educated.”
- Sara on being a woman in software Development Industry: (2:53) Gender is not an issue unless you make it an issue. Don’t be afraid to ask questions. Don’t be afraid to make a mistake. Many resources out there for women developers (technical professionals). ***Side note: Here is a related article Sara wrote for Datamation on Girls Considering a Career in IT.
- Sara on Importance of Communication (4:34) Most important non-technical skill is “Communication.” You must hear what they say vs. what they mean. She answers the differences in communicating with Developers, Users and Leaders.
- Sara on Strengths and Weaknesses (1:13) Good developer knows strengths and weaknesses
- Sara on Growing through the use of social media and benefit for asking Good Questions (2:09) “Ask questions all the time” always have someone to contact to help out with an problem. “There is such a thing as a dumb question” – do some research first, be prepared.
- Sara on Most Enjoyable part of being a developer and Balance (2:07) Love all of it. I do what I love. Choose what part of your craft you are good at, do it well.
- Sara on Reaching out to Community and her WAN Party (3:02) Do more with the community, speaking, WAN Party forces her to learn more.
- Sara on Mentoring (2:08) Most important thing to do when you start out is find a mentor. Find someone that thinks like you, but better. Find multiple mentors.
For reference here is Sara’s latest VLog: Girl Developer the News
Again I think you will see a similar thread here with others I’ve interviewed. In addition to their technical skills, hard work and passion they’ve had a good return on their investment by getting involved in the developer community. In Sara’s case she is everywhere; writing, speaking, blogging, vloging, answering questions, asking questions, creating her own WAN parties. She is not afraid of doing the uncomfortable for a personal / profession gain.
ASK YOURSELF:
What are you doing to get involved in the community?
How have you put yourself into uncomfortable situations to help you grow (knowledge and career)?
Are you learning new things by interacting with other developers.
Do you have a mentor?
Do you really know your Strengths and Weaknesses?
Are passionate about what you are doing?
What are you doing to sharpen your communications skills?
Decide to do at least one thing to increase your value to your employer. Today is the day!
Project Oriel — 78% More Satisfied
Posted by Peter Edstrom @ June 29, 2009 10:08 PM
Some great survey results about Agile:
78% of business stakeholders are more satisfied with Agile projects than Traditional projects.

[via Agile Modeling, Scott W. Ambler]
Rockford Lhotka — If you can’t reach me…
Posted by Rockford Lhotka @ June 29, 2009 08:32 PM
I use register.com for my email – though after today that may have to change…
Why? Because the register.com email service is down, and has been for several hours. There was a brief moment earlier this afternoon when I thought they had it fixed, because a few emails squeaked through, but otherwise it is deader than a doornail.
register.com is apparently doing some sort of email system upgrade – fancier AJAX web UI, etc. And that’d be fine, but all I really care about is reliable POP/SMTP service, and the “upgrade” appears to have been a major step backward in that regard…
This affects my personal email, the email for the CSLA .NET forum and email for my online store.
So if you sent me email and expect/need a response, don’t get your hopes too high. Maybe they’ll get it fixed, but I’m beginning to suspect that they really messed themselves up. This may be the push I need to explore other email options – probably ones that are cheaper and better (since register.com is not a great value in that regard – they are just convenient).
VISI BLOG — Who Uses Exchange 2007?
Posted by Jonathan Hamilton @ June 29, 2009 08:01 PM
Schneier on Security — Anti-Stab Knife
Posted June 29, 2009 07:18 PM
Minnov8 — Could MSP Be the Social Media Capital of the World?
Posted by Graeme Thickins @ June 29, 2009 05:57 PM
Or at least the social media breakfast capital of the world? It felt like it Friday, as a mob of people began gathering bright and early, with the smell of bacon and eggs wafting above the expansive lawn at Deluxe Corporation’s headquarters in Shoreview, MN. The scene was the 16th consecutive monthly meeting of an organization called Social Media Breakfast-Twin Cities, or “SMBmsp” for short. Complete with a “Jumbotron” on wheels for the presenters’s slides, the event was unofficially dubbed “Social Media Palooza” by the sponsor, and beach balls were even bouncing from row to row before the morning was over.
The event was originally slated to be held indoors at Deluxe, but free tickets for the 125-person capacity room sold out on the group’s online sign-up site within two hours. So, organizer Rick Mahn and sponsor PartnerUp (a Deluxe company) scrambled to accommodate demand. They quickly decided to open up the event by holding it outside, and then promptly sold out all 250 tickets. 
Just what is a “Social Media Breakfast”? As explained on the group’s web site (a social networking site, of course!): “It’s where folks get together to talk about using social media and social networking tools in their business or careers. It’s about networking, it’s about learning, and mostly it’s about people.”
The SMB concept has taken off nationally, now with 25 chapters. But in early 2008 the Twin Cities group was one of the first to get started — the third, actually, after Boston and New York City, according to Bryon Person, the founder of Social Media Breakfast. Person spoke at the local “SMPmsp 15″ event at Concordia College in St. Paul on May 16. (Person is based in Austin, TX and is a blogger, podcaster, speaker, and social media evangelist for LiveWorld. He is @BryanPerson on Twitter.) Person also said the Twin Cities SMB group has held the most meetings of all the chapters, and consistently has the biggest attendance. Thus, one could conclude that Friday’s outdoor event was the biggest SMB breakest ever held nationally, since attendance was about twice that of the largest previous SMBmsp event.
Speakers at the “SMBmsp 16″ event included Tim Brunelle (@tbrunelle on Twitter), pictured at right below, who spoke on “The Impact of Social Media on the Advertising and Marketing Industry,” and Minnov8’s own Steve Borsch (@sborsch on Twitter), at left, who presented on the topic of “Personal/Professional Hubs: A Place to Aggregate Your Digital Life.” 
Borsch commented later, after he had left for Chicago immediately following the breakfast. “Wow, what a great event. Thank you to PartnerUp and Deluxe for going way above and beyond the call of duty to host this gathering and making it such a success.” As he was presenting, Borsch said he was thinking: “Gee, if I’m sweating up here in the shade, imagine how they must be feeling!” The sun was amazingly strong, even so early in the morning. He said later on the SMBmsp site’s blog: “This event just goes to show the level of interest, the strength of our community, and that each of you recognize how fundamentally important is the shift being exhibited by the onrush of social media… Or it was all just about free hats and bacon?” 
Borsch uploaded a PDF of his Apple Keynote presentation, which was shown on the Jumbotron (he’s shown here readying for his talk), and it is viewable and downloadable at that link above. “I was using my iPhone to control the presentation with the ‘Keynote App’ from Apple. You can see one slide and your notes — flickably scrollable to advance the slide or scroll your notes — or, in landscape mode, to see the next slide queued up ready to go. It runs over wifi.” [Yes, that's our Steve Borsch -- the ultimate geek!] 
For more on SMBmsp, you can read all the tweets posted about it by simply going to search.Twitter.com and entering either “SMBmsp” or “SMBmsp16″. You can also see some great photos here: a Flickr set by Jamie Thinglestad. The closeup photo above of the two speakers, and the two shots below are Jamie’s, used here with permission; all other photos are from my own Flickr set.
I asked Phil Wilson, fellow contributor to Minnov8, for his reaction to SMBmsp 16: “It was great to see so many new faces coming to check out what’s happening in our social media community. I hope that they can come back to really get a sense of how easy it is to connect with the group. I prefer a more intimate setting where we can better discuss the topics presented, but it was fun to be part of ‘Social Media Palooza’. I’ve never seen a keynote presentation on a jumbotron! Steve’s presentation was spot on. I also thought Tim Brunelle had some great information and insight. For anyone interested in using social media for business or ‘brand’, it’s vital to keep in mind the impact it will have on marketing and advertising.”
Anyone may join the “SMBmsp” group by registering for free at its site. There are currently 827 people who have done so, according to the Members page. The site has a regular podcast, and also a blog where any member can post.

thingelstad.com — iPhone 3.0 Phone Label
Posted by Jamie Thingelstad @ June 29, 2009 03:28 PM
This is a little change in the iPhone 3.0 release that I hadn’t seen anyone mention. When you change the type of a phone number in Address Book on the iPhone you’ve always been able to set custom labels in addition to the built-in ones. However, there was a new one added in 3.0 for “iPhone” (see 2nd choice).
Kind of odd. Not real sure what you would use this for other than vanity. I guess you could sometime specify, particularly with the coming use of MMS, that I only want to send this to iPhones?
This post is from the website thingelstad.com by Jamie Thingelstad.
Related posts
Schneier on Security — Protecting Against the Snatched Laptop Data Theft
Posted June 29, 2009 11:51 AM
behind the times — Writing (and Testing) Good Error Messages
Posted by Hamlet D'Arcy (noreply@blogger.com) @ June 28, 2009 09:13 AM
Hear me out become calling me a pedant.
Contract-Driven Development is a technique more widely accepted than it is debated, especially for Java development. While Java does not support contracts as part of the language, the conventional wisdom I'm given is to think about what constitutes a method's contract and invariant state and then fail fast when this contract is violated.
Consider the following Java method:
public void process(Message msg) {
Content content = msg.getContent();
//...continue processing mesage content
}
At the most trivial level, thinking about contracts means thinking about the range of inputs. Null is certainly not a valid input to this method. One might be tempted to explicitly check for a null parameter like this:public void process(Message msg) {
if (msg == null) throw new IllegalArgumentException("Null: msg")
Content content = msg.getContent();
//...continue processing mesage content
}
This seems like a silly exception; you would have gotten a NullPointerException instead of an IllegalArgumentException, big deal. But what if the NullPointerException happened in the middle of a long process task instead of the first line of the method. Could a transaction be left half executed? What state is the system in when an exception is thrown halfway through a method? It's quite possible that the system would be left in an unstable state: a state that violates your class's invariant. So yes, I do believe we should be asserting the proper range of parameters on method input. In fact, this type of checking saved me a surprising amount of time on Friday. When we changed our web service schema, JAX-B beans started coming through our sevice with nulls in bad places. Our Flex developer was able to say, "Why am I getting a null: site exception" in our standup instead of asking, "why am I getting a null pointer at line 23 of class xxx". Good error messages are easier to diagnose.Not only do I like to write argument checking exceptions but I also like to test them:
public void testProcess_Contract() {
shouldFail(IllegalArgumentException) {
service.process(null)
}
}
This is not an incredibly helpful test and looks like the litter avid TDD practitioners like to scatter around a test tree. I write it mainly to get my testing juices flowing and to take the overhead of creating the test class. Plus it's part of my TestCase template file so it's probably just habit.So what is this about testing error messages? As a system wide invariant, this is what I consider to be my contract with my users: Error messages should contain the cause of the problem and a solution to the problem. There is no error message on Java's NullPointerException, but "Null: message" satisfies this contract because it tells you what the cause of the error is (message) and what a solution is (don't pass null). By the way, including the failure information in the exception message is Effective Java Item 63: Include failure-capture information in detail messages. A better example can be seen in the Groovy codebase, where a method called visit requires some very specific objects to be in an array:
public void visit(ASTNode[] nodes, SourceUnit source) {
if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) {
throw new RuntimeException(
String.format(
"Internal error: wrong types: %s / %s. Expected: AnnotationNode / AnnotatedNode",
nodes[0].getClass(),
nodes[1].getClass())
);
}
//... continue processing
This is quite a bit of code for error handling, largely because of my insistence on using String.format whenever I can. Anyway, if this error occurs you are told what happened (wrong types), you're told what was expected (AnnotationNode and AnnotatedNode), and you're told what was actually passed (nodes[0].getClass() and nodes[1].getClass()).So should you test the exception message? Yes you test the contract: Error messages should contain the cause of the problem and a solution to the problem.
public void testVisit_Contract() {
def message = shouldFail(RuntimeException) {
def badInput = [new ConstantExpression("sample"), new EmptyExpression()] as ASTNode[]
new SingletonASTTransformation().visit(badInput, null);
}
assertTrue(ex.getMessage().contains("wrong types"));
assertTrue(ex.getMessage().contains("ConstantExpression"));
assertTrue(ex.getMessage().contains("EmptyExpression"));
assertTrue(ex.getMessage().contains("Expected: AnnotationNode / AnnotatedNode"));
}Testing exceptions is fragile, I'll admit. But using assertTrue and String.contains minimizes that fragility. Here we're testing that the error is stated (wrong types), that the values causing the error are reported ("ConstantExpression" and "EmptyExpression"), and that the expected values are reported ("Expected: AnnotationNode / AnnotatedNode"). I find this testing approach to be a good compromise between not testing the contract and writing a fragile test, and the style still allows those annoying TDD zealots to write tests in your codebase while playing nicely with everyone else.Lastly, I believe writing assertions on exception messages might fail under certain character set/localization schemes. I seem to recall this was a Java Puzzler at some point but don't have the book handy. Will these assertions fail under different character sets? I've never seen it happen myself.
afongen — Links for 2009-06-27 [del.icio.us]
Posted June 28, 2009 07:00 AM
code_poet — acts_as_stripped Now Available
Posted by Ryan Sonnek @ June 27, 2009 08:04 PM
In my experience, it's very common for web frameworks to automatically strip extra whitespace from posted forms. Wicket, for example just does the "right thing" by default, and it genuinely surprised me when I found out that Ruby on Rails does not do this by default.
Rails is a wonderfully pluggable framework, and so I've published a Ruby gem which will strip out extra whitespace for any string attributes. It's called acts_as_stripped and can be found on github at http://github.com/wireframe/acts_as_stripped/. The Rails community is all about sexy project names, but I just couldn't make myself name this little plugin "stripper". :)
Usage of this plugin is incredibly simple:
# strip whitespace from *all* string attributes
class User < ActiveRecord::Base
acts_as_stripped
end
# strip whitespace from *select* string attributes
class Post < ActiveRecord::Base
acts_as_stripped :title, :summary
end
Drop me a line if there are any questions or suggestions. The nice benefit of using this plugin is that it works with any ActiveRecord model object and is not directly tied to the Rails web framework.
This plugin was inspired by this post: http://granth.ca/2006/02/strip-whitespace
MN Headhunter — Online Classifieds - Another Resource in your Job Search
Posted by MN Headhunter @ June 27, 2009 07:05 PM
The following post is courtesy of the Recruiting Blogswap:
From: CareerAlley
I don't really remember when Internet job searching overtook the old fashioned print classified ad, but it wasn't all that long ago that most of can remember the commerical "I found my job through the New York Times". But print classifieds are very much alive (although not a major force anymore) and their web-based "sister" versions are very much in use. So if you need to try something new, try some of these web-based classified ads.
- New York Times - The NY Times, which still has a print version of it's classified jobs listings (the Sunday version is fairly large), has a web-based classified section as well. Working with Monster.com, the site is very well organized. There are tabs at the top: Find a Job, Post Your Resume (you can register here too), Job Seeker Login and Career Advice. The left hand side of the page is for Job Seekers, with a simple search followed by top job categories, top job locations and a number of related articles below that. The center of the page has a Post Your Resume get started section followed by a salary comparison section. Career Calendar, another really good resource, is on the right hand side of the page and lists upcoming events (you can check into the future as well). But wait, there's more! Below the calendar is a short listing of "Who's Hiring" and then featured jobs. When I tried their generic search it returned more than 5,000 jobs. This site is definitely worth spending time on, I would rate it 5 stars out of 5.
- Los Angeles Times - Flipping to the Left Coast, the LA Times also maintains a web-based classified jobs section. In this case, the LA Times is partnered with CareerBuilder. While not as robust or filled with features as the NY Times version, this site too is worth a look. You can register and post your resume here too. There is a simple search function top center of the page, with a number of links going down the left hand side of the page (Find a Job, Search Jobs, Create Job Alerts, etc.). Career related stories are listed down the middle of the page with Jobs by Category to the right. Worth a look, I would rank it 3 out of 5 stars.
- Chicago Tribune - Continuing the review of print on web classifieds we move back to the center of the country. The Chicago Tribune's web-based classified site is also in partnership with CareerBuilder. This page combines current news (most of which is not career related) with job search. There is a search box center left on the page with links to resume writing services, Upload your Resume, Job Alerts and a link for hourly job seekers. Below this there are a few different search options: By Company/Industry, By Category and career advise. Far right is "Who's Hiring in Chicago" and a Chicago Career Fair link half way down the right hand side. Also worth a look, I would rate this site 3 out of 5 stars.
- Craigslist - Not known in print, but certainly one of the better known web-based classified ads providers, Craigslist is another great source for job search (see the next bullet for an article on this). Less is more with CraigslList, so you won't see all of the content that you see on the other sites. Find your city or state and then click on any of the categories under jobs (or see below).
- Craigslist - How to Find a Jobs on Craigslist - This article, from about.com, provides a very brief view on how best to leverage Craigslist for job search.
Article courtesy of the Recruiting Blogswap, a content exchange service sponsored by CollegeRecruiter.com, a leading site for college students looking for internships and recent graduates searching for entry level jobs and other career opportunities
Garrick Van Buren — How to Kill a Frozen Parallels Virtual Machine
Posted by Garrick Van Buren @ June 27, 2009 04:24 AM
Multiple projects have me using Windows more than I’m accustomed to, so I picked up a copy of Parallels and Windows Vista and loaded them up on the MacBook Pro.
My relationship with the MacBook Pro has been trying these past few weeks. Like an aged sitcom introducing a new character – this recent addition isn’t helping.
I found myself with a frozen Vista shutdown this afternoon, and for my own future reference here’s how to terminate a frozen Parallels Virtual Machine (from Parallels knowledgebase)
ps auxwww | grep prl
And grab the processes UUID of the process containing prl_vm_app and curly brackets (it’ll be obvious – especially if you’re only running one virtual machine)
Then
sudo kill [The VM's UUID]
Easy.
philcrissman.com — Ruby’s Object::send can call private and protected methods
Posted by Phil Crissman @ June 27, 2009 02:18 AM

Photo by xiaming
One of the hallmarks of object oriented programming in most every implementation of it that I know of is the ability to designate certain methods as “private” or “protected”, thus keeping them from being called willy-nilly by any old script that wants to call them. Ruby also has this, of course, but interestingly enough it can be easily circumvented.
I guess there are a few posts floating around about it, but I discovered it by accident playing around in irb this evening. I was reading David A. Black’s The Well Grounded Rubyist, where he mentions that you could send a message to a class either within the class definition itself, or by simply sending it to the class object like you’d send any other message:
1 2 3 4 5 6 7 | # The normal way to do it class Thing message :whatever end # you could also do this Thing.message(:whatever) |
David mention’s attr_accessor in this context, so I thought I’d try that. Open irb:
1 2 3 4 | >> class Thing ?> end >> Thing.attr_accessor :name NoMethodError: private method 'attr_accessor' called for Thing:Class |
Oh. So much for that, then. But, knowing of the existence of the send method, I thought I’d try that.
1 2 | Thing.send(:attr_accessor, :name) => nil |
For the non-irb user, that nil that was returned, and the fact that no error message was returned, indicated that our experiment worked. Now Thing’s have a name attribute.
1 2 3 4 5 | >> t = Thing.new >> t.name = "Larry" => "Larry" >> t.name => "Larry" |
What’s interesting about all this is that attr_accessor is a private method on Class. Yet we just called it.
send is often introduced as a way to show how everything is an object and that you can do exciting things like 1.send(:+, 1) and get 2 as the result. No one usually mentions that it can be used to call private or protected methods from outside a given class.
To make it clear what you could do here:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | >> class Thing ?> def hello ?> puts "Hello, world!" ?> end ?> private ?> def private_hello ?> puts "Hello, privately." ?> end ?> end >> t = Thing.new >> t.hello Hello, world! => nil >> t.private_hello NoMethodError: private method 'private_hello' called for ... >> t.send(:private_hello) Hello, privately. => nil |
So, yes. You can do this, if you so choose. Please use your powers for good, and not for evil.
Now why this works, I can’t yet say, though I’m interested in learning, if there is a reason. Evidently there may have been some debate as to whether ruby 1.9 would still have this behavior, but as of this writing it does.
Note: I did only a brief search, and it seems this functionality is not unknown, though it still seems somewhat odd to me that such an easy way to sidestep the private/protected designation of methods exists.
Project Oriel — Necessary Non-Value
Posted by Peter Edstrom @ June 27, 2009 01:42 AM
Everything a company does, can not be directly coorelated to benefiting the customer. Ester Derby says it best in Non-valued added, but necessary:
“tasks that don’t directly add value to the customer, but enable delivering value to the customer. Sometimes these are the tasks and functions that enable the business to stay in business–like accounting, or payroll, or management.”
MN Headhunter — Social Media Breakfast Minneapolis & St. Paul Has The World’s Largest Event
Posted by MN Headhunter @ June 26, 2009 11:43 PM
I can be a little (a lot) competitive and for my friends around the country who talk about how cool their Social Media Breakfast, happy hour club or professional network is let me say this...
We kicked your ass today.
Has your event ever had 300+ people, met 16 months in a row or had a jumbotron? Yes, I said jumbotron. Minneapolis/St. Paul is not the flyover prairie you think it is so step down from your “I am so cool sitting here on a coast” pedestal. (sorry, had to get that out of my system)
We owe this effort here to one guy, Rick Mahn (@rickmahn) Founder of Social Media Breakfast – Twin Cities. Rick is one of the nicest guys you will meet. He will mention he has had some help planning events and sponsors (including me two times in the beginning) and that this is about the community (which it is) but without Rick’s leadership this thing would not be what it is today. He is not doing this for himself but believes we have a great community here and it should get together.
Rick (and this about as serious as I ever get) we all thank you for the work you have done. It is not easy getting an event like to day with 300+ folks coordinated and put together. Thank you, thank you, thank you.
More folks to thank today include Deluxe Corporation and PartnerUp for hosting and sponsoring the event. Both companies are hiring and you can find their jobs posted at Deluxe Corporation Careers and PartnerUp Jobs.
Speakers were Steve Borsch (@sborsch) with "Personal/Professional Hubs: A place to aggregate your digital life", his slides posted here Presentation from SMBMSP #16, and Tim Brunelle (@tbrunelle) with “Impact of Social Media on the Advertising and Marketing Industry”.
I forgot one thank you, Mother Nature. This event was outside at Deluxe Corporation and other than being a little warm and humid it was awesome. For those who folllowed the Twitter stream there were lots of jokes about people getting a free breakfast, some learning, networking and a tan or in some cases sunburn.
Speaking of suntan/burn many of us are looking a bit odd this evening. We were facing south so the left side of our faces were facing the sun. So for me, my left ear has a bit of red color to it and the right ear as white as it was. Clearly some (or many) in our group need to get out more.
I joked with Rick that now I need to find a way to get one of my Minnesota Recruiters events to 350 attendees so I can take back my unofficial title of largest grass roots event. Hmm, I wonder how many chairs I can get at Best Buy....
Last note, I had some awesome conversations with people today. I truly believe we have seen the bottom of the recession in Minnesota and today was more evidence of this. In some cases a very small but noticeable bump up is being felt. People today had more good news stories than previous months and their attitude is much more positive than 3 months ago
I went a little nutty with my camera today so the rest of this blog post is photos:
Welcome to Deluxe Corporation and PartnerUp. These hats were not only a great give away but needed by the attendees.
Deluxe Corporation and PartnerUp are hiring
Phil Wilson and Steve Borsch Rick Mahn and Brian Kennett of PartnerUp
Meet Stephanie Jones. Stephanie and her husband Andy are going to Turkey for 2 years. They are raising money to help cover their costs. They are good people and going to do good things. You should consider making a donation (not very subtle on my part). Learn more here at their blog Turkish Crossroads.
Jumbotron I was not joking
Photos with me and Jeff Pesek, Keith Privette, Kristin Gast and Tavis Hudson. I learned that I suck at taking picture of myself. Clearly a skill I need to work on.
Greg Swan A photo of Graeme Thickins taking a photo
Nathan Eide delivering bacon Rick Mahn post intro’s working on his tan
Lee Odden, Doug Pollei, Tim Brunelle Mykl Roventine, Doug Pollei Albert Maruggi
Steve Borsch doing his presentation
Tim Brunelle got everyone to stand. I took 2 more pics but they cam out blurry. Sorry Tim.
Social Media Palooza, that’s an understatement
Hey!!! Hello!!! Where did everybody go? I was the last person standing.
There are some blog posts and photos from others that I will be linking to as I see them. What I see so far:
Schneier on Security — Friday Squid Blogging: 8 Gig USB Squid Flash Drive
Posted June 26, 2009 09:52 PM
Rockford Lhotka — When Windows Home Server crashes…
Posted by Rockford Lhotka @ June 26, 2009 09:37 PM
I’ve had quite the experience over the past couple weeks.
Three weeks ago I was in Las Vegas speaking at VS Live. While there, I realized I’d forgotten to copy some key files to my laptop before leaving home, but Windows Home Server made that a non-issue, since it provides a secure web interface to my files. Awesome!
Then I got home and discovered that one of the two additional hard drives I added to my WHS machine was failing. This was unpleasant, but not cause for alarm since all my key files are set to duplicate.
(I only discovered the failure because WHS started crashing, and I looked in the Windows system event log to find the drive failure notifications – they’d been occurring for several days, but I don’t check my system event log daily, so I didn’t know – this is the one place where WHS really let me down – I still don’t know why Windows knew the drives were going to fail, but WHS blindly ignored this clear intelligence…)
Unfortunately I couldn’t get WHS to dismount (remove) the failing hard drive. After 3-4 tries, it finally did remove the drive. This took 2.5 days, since each failure took 12-24 hours, as did the final success.
I should also note that I was under serious time pressure, because I was flying out to Norway for the NDC conference and only had about 3.5 days to solve the problem!
After the failed drive was removed, things were obviously not right on the WHS machine. Clearly the remove didn’t work right or something. Poking around a bit further, I found that the second additional hard drive was also failing. What are the odds of two drives failing at once? Small, but yet there I was.
I quickly bought and installed a brand new hard drive (Seagate this time, since the dual failures were Western Digitals) and tried to remove the second failing drive. The attempt was still running when I flew to Norway.
Fortunately Live Mesh allowed me to use remote desktop to get back into my network, and I kept trying to remove the drive (failure after failure) while in Norway.
When I returned from Norway I manually removed the drive. Clearly it wasn’t going to remove through software. I can’t say this made matters worse, but it sure didn’t make them better either. Now WHS still wouldn’t remove the drive even though it was shown as “missing”. It had “locked files” and couldn’t be removed.
Thanks to some excellent help from the Microsoft WHS forum (thanks Ken!) I came to realize that my only option at this point was to repair the WHS OS – basically do a reinstall. I have the cute little HP appliance, and it comes with a server restore disk – pop it into my desktop machine, run the wizard and in very little time I had my server back, just like when I bought it originally.
OK, so now I have a functioning WHS again, but it is empty, blank – all my data is gone!
I’ve been here before (a couple times) with other servers though, so I have backups for my backups. All “critical” data is always in 3 places. So I just restored my server backup and got back my “critical” files – everything for my work, all the family photos and home videos of the kids, etc.
Here’s the catch though – I rapidly discovered that my “non-critical” data is actually pretty critical. Things like music, videos and miscellaneous files.
The music I was able to recover from a Zune device. I tried my Zune device, but that was a mistake. As soon as I connected it to my desktop machine it synced – and it discovered I’d “deleted” all my music and so it cleared the device. Damn!
Fortunately my son also has a fully-synced Zune, and I connected his to my desktop machine as a guest. No automatic sync, and so I was able to highlight all music on his device and say “copy to my collection”. Just like that all our music was back on the server.
I still don’t have any videos or miscellaneous files. They are gone. Arguably this isn’t the end of the world, as technically I can get back anything that really matters – by re-downloading, or getting files from friends, etc. But that’s all a pain in the butt and a waste of time, so it is unfortunate.
(it might be that I can recover some of them from the two defunct hard drives – using various data recovery tools I may be able to connect them to my desktop machine and retrieve some of the files – but that’s also a big hassle and may not be worth the effort)
So what did I learn out of all this?
- WHS is awesome, and I still really love it
- WHS can’t handle two hard drives failing at once – if that happens you better have a backup for your server
- “Critical” files include things that aren’t really critical like music and maybe videos – external hard drives to backup the server are relatively cheap – just get a 2 TB external drive and back up everything – that’s my new motto!
Oh, and I’m now using IDrive to get offsite backups for my truly critical files. I know, I didn’t need it in this case, but the whole experience got me thinking about floods, tornadoes, fire, etc. What if I did lose my family photos or home videos? The last 15 years of my life is digital, and nearly all record would be lost in such a case. Having automatic backups of that data, along with other important documents and files seems really wise.
So now my super-critical files are in at least 4 places (one offsite). My critical files (using my newly expanded definition) are in at least 3 places. And my non-critical files are in 2 places. I’m so redundant I’m starting to feel like NASA :)
Garrick Van Buren — Kernest.com, @font-face Service – Now in Private Preview
Posted by Garrick Van Buren @ June 26, 2009 06:28 PM
As I mentioned over at the Kernest blog, I sent out the first batch of emails announcing a sneak preview of Kernest – the @font-face, type-as-a-service project I’ve been working on.
If you’d like to check it out and give your blog a font upgrade, drop me an email and I’ll reply with a password.
The preview will be running until July 16th when I give a public demo at The Foundation- you’re invite. It’s free.
See you there.
Schneier on Security — Fake Receipts
Posted June 26, 2009 06:16 PM
Schneier on Security — The Problem with Password Masking
Posted June 26, 2009 11:17 AM
afongen — Links for 2009-06-25 [del.icio.us]
Posted June 26, 2009 07:00 AM
Last updated:
July 03, 2009 02:03 AM
All times are UTC. (We're working on fixing that!)


![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=fc96e1e2-bc9d-45ff-a1f3-316b35307517)
