Categories
Politics

Raise the Ceiling

David Frum: “…wouldn’t the best idea for now be: just lift the debt ceiling to give all parties more time to work out their differences?”

Categories
Business

Some people never learn

New York Times: “Month by month, the discourse has gotten more primitive; with stunning speed, the lessons of the 2008 financial crisis have been forgotten, and the very ideas that got us into the crisis — regulation is always bad, what’s good for the bankers is good for America, tax cuts are the universal elixir — have regained their hold.”

We know what caused the eventual 2008 meltdown in our financial system, but we choose not to fix it.

Categories
Development

Reusing your code investment

RibbitSomething I’ve always loved doing is creating frameworks for other developers to use. I’ve also had the pleasure of working on some wonderful developer tools during my career. First at Visio then later at Pelco.

Code Investment

Some companies, like Adobe and Pelco, have built frameworks over time to help deal with abstracting OS specific things into reusable components. These reusable components are built to allow the developer to focus on features and not worry about how to do it per OS. Windows, Mac OS X, and Linux have similar philosophies but specific libraries and models to support their OS. There is a point they do cross however. C and C++ are supported by all three of these platforms and are still in wide use across them.

If API’s vary across systems you have to provide an abstraction for developers if you want to support multiple OS’s. Depending on the level of portability you’re interested in you can end up with a large framework that does everything the same on all platforms, but this can result in lowest common denominator framework, but I digress.

That investment is time consuming but often times well worth because the developers using it can move quickly and get great results on multiple platforms. I saw this first hand at Pelco where I had the pleasure of working with a group of crazy smart people that delivered a cross platform Media Framework for video, audio, and metadata. It’s now used by many groups in the organization, in may different ways. A true success.

How do you do it?

For lower level things it tends to be a bit easier. You can stick to the CRT (C Runtime) for a lot of things. You also tend to typedef things so you end up with matching intrinsic, system defined, and framework defined types. Again, so the developer doesn’t have to spend time thinking about it.

Let’s say you’re writing a C++ class library, or framework. The objects provided by the framework would provide the abstraction.

Big Changes

This leads me to the point of this post. What happens when you have years of investment and the OS vendor makes a HUGE change to their API and development model? The Adobe Photoshop team faced this very hurdle, and managed to get through it. I linked to a post by Adobe’s John Nack that touches on their struggle to bring Photoshop into the Objective-C/Cocoa world(I’d love to see that code.) Objective-C and Cocoa are Apple’s preferred language and API(framework) for creating Mac OS applications. If you’ve ever looked at Objective-C it’s a strange mix of C and Smalltalk, but it maintains support for its C lineage, which allows you to mix C, C++, and Objective-C all in the same file. This is what allowed Adobe, and others, to bring applications into the new model. Hopefully by leveraging their frameworks abstraction from the OS.

I’ve created an example, granted it’s very simple, but it illustrates the point of a framework abstraction. In my example I’ve only created the Mac side of a C++ framework I called GrilledCheese because these abstractions form a kind of sandwich. The application is the top piece of bread, the middle is the abstraction, or framework, and the bottom piece of bread is the native OS layer. Here’s an example of drawing a rectangle in an abstract framework using Objective-C and Cocoa inside a C++ class.

void GrilledCheeseMac::DrawRectangle
(
	int x, 
	int y, 
	int width, 
	int height
)
{
	// Create a rect from our coordinates.
	NSRect rect = NSMakeRect(
					(CGFloat)x, 
					(CGFloat)y, 
					(CGFloat)width, 
					(CGFloat)height);
	NSFrameRect(rect);
	
} // DrawRectangle

Here’s that same method implemented on Windows using Windows GDI functions.

void GrilledCheeseWin::DrawRectangle
(
	int x, 
	int y, 
	int width, 
	int height
)
{
	HDC hdc = ::GetDC(_hWnd);
	if (hdc)
	{
		::Rectangle(hdc, x, y, x+width, y+height);
		::ReleaseDC(_hWnd, hdc);
	}
} // DrawRectangle

From the application developers viewpoint they would use this method exactly the same on all platforms. No need to fret over how to do it for Windows, Mac, and Linux. They’re used exactly the same way for all. Like this.

GrilledCheese* gc = new GrilledCheese();
if (gc)
{
    gc->DrawRect(0, 0, 20, 20);
    delete gc;
}

There is something to note in our example. In the example the class is named GrilledCheeseMac. This is where a typedef would come in handy.

E.G.

typedef GrilledCheeseMac GrilledCheese;

On Windows it may look like…

typedef GrilledCheeseWin GrilledCheese;

There you have it.

Please note, this is just one possible way to do things, and the example is overly simple to make the point.

There are definitely more ways than one to skin this cat.

Categories
Life

Zeldman on being Starstruck

Zeldman: ‘My eyes slid toward her of their own accord, and as they landed, I saw that her smiling, knowing, superior but also playfully flirtatious eyes were locked on mine. She had been watching me studiously avoid looking at her, waiting for the inevitable collapse of my will, the moment when I could no longer resist. “Busted,” her eyes said. “You didn’t fool me for one minute. Yes, it’s me. Nice meeting you. Bye.”’

Fun story.

Categories
Politics

We’re not there yet

Prospect Magazine: “Maggie Benedict and Jinx Drda from suburban St Louis were also greatly disappointed to hear Huckabee had bowed out of the presidential race. They’ve always voted but it wasn’t until Obama’s victory that they became more active in politics.

“It’s the first time I’ve felt the president wasn’t a true American,” Maggie says. “And that he wants to become a dictator. We didn’t like seeing him get elected because of his race.”

Emphasis is mine.

We still live in a divided, hate filled, America.

Don’t even try to defend this, it’s indefensible hatred. To make matters worse these are supposed to be Christians. Ever wonder why people think Christians are a bunch of holier-than-thou hypocrites? There’s one reason. Not very Christlike is it?

Categories
Movies

John Lasseter, Cars 2

Los Angeles Times: ‘EMERYVILLE, Calif.—
“Honnnnnk! Honnnnnk!” John Lasseter had explicit instructions about how the Galloping Goose, an antique steam train character in “Cars 2,” should look and sound, and he was delivering them with brio. It was January and the animation czar was making the hourlong commute from his home in Sonoma County to his Pixar office here on the outskirts of Oakland in the passenger seat of a town car. On his lap, he balanced an iPad loaded with shots to review while he recorded voice memos for the movie’s crew: “Like a diesel horn. I wanna have air horns on his roof,” he told them, voicing the nasal sound he wanted. “He is just unbelievably cute, you guys.”‘

Great story, it’ll make you want to work for Pixar.

Categories
Development

Windows 8 Speculation

Duct tape makes the world go 'round!A co-worker, thanks Sudeep, turned me on to a great Windows 8 article on Ars Technica and that got me thinking. The article talks about an updated set of API’s for C++ applications and a new set of managed .Net API’s that get closer to the machine, which is a great thing. It sounds like we’ll have peer un-managed and managed layers, but…

What about the Windows API?

The article talks about WinRT, the new C++ API’s, and DirectUI, the un-managed API’s, but it doesn’t say a word about the “old” Windows API’s. There are tons of applications written against that set of API’s so they cannot go away, at least for now. That begs the question “What about the Windows API?”

The answer is, it will be there, but where? It’s time Microsoft moved toward a modern model right down in the OS. These transitions are never easy, but it can be done. When Steve Jobs came back to Apple and we were given OS X Apple made a decision to move toward Objective-C and Cocoa as their modern model and support the old C-style Mac API’s(Carbon) so legacy applications, like Photoshop, could move to the new OS. At that time Apple said they would abandon that support in the future, and they managed to support it for about 10 years. With Snow Leopard they decided not to bring all of Carbon forward, which was painful for Adobe and others. I guess my point is the old Windows API will need to stay around for a while, and the transition to WinRT could be painful, but definitely doable. Part of Microsoft’s strength, and weakness, has always been backward compatibility. It looks like they’re finally ready to make a bold change. Good for us.

How will it look?

That’s a great question. I wish I had a definitive answer, but I could see three possible scenarios, maybe there are more?

Here’s what I think could happen.(Click for a larger image.)

Windows 8 Speculation

Categories
Life

So, you want to be an intern?

SmartBlog on Leadership: “First of all, interns should not be fetching coffee at all. They are not personal assistants and shouldn’t be treated as such. In an ideal internship, at least 51% of the experience should be spent learning and the remaining time should be spent applying what they learned. Remember, mentorship and education come first.”

Go read the article, it’s short, and worth it.

Categories
MLOTW Uncategorized

Movie line of the week answer

Happy July 1st!

Our big winner is Ms. Taylor “Bug” Fahrni, yes, she’s my daughter. Congratulations Bug!

The correct answer was…

Harry Potter and the Deathly Hallows: Part 1.

Categories
Business

Drive Them Out!

LA Times: “One affiliate, Ken Rockwell of San Diego, the owner of a 12-year-old photography website, said he planned to move out of state.

“Will it be Las Vegas or Scottsdale or Ensenada?” he said. “It’s a question of where, not if.””

A question of when, not if. Let’s see how many folks flee California. It’s a beautiful place to live, unmatched by any other state, but it’s also the most unfriendly state to business.