» tagged pages
» logout
Google
Return to Google

crazybob.org

(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

other page actions:

Tags Applied to this Topic

1 person has tagged this page:

Bob Lee’s Blog – Java, AOP, OS X, and some occasional baby making

How to create simple Amazon affiliate links

In case you didn't know, Amazon will pay you to recommend their products. If you're going to link to a product anyway, why not take credit? Amazon provides all sorts of fancy tools and flashy widgets to help you advertise their products, but creating a basic URL through their web interface isn't straightforward.

In hope of simplifying the process, I followed some 3rd party instructions I found for hacking together your own referral URLs, but they didn't work. I asked Amazon instead, and here are the official instructions:

If you would like to link directly to an item's detail page using a simple text link, use the following format to construct your links:

http://www.amazon.com/dp/ASIN/?tag=your_Associates_ID

To make this link functional, replace "ASIN" with the 10-digit ISBN or ASIN of the product, and replace "your_Associates_ID" with your Associates ID or tracking ID. However, you would not be able to link to a search results page on Amazon.com.

If you would like to link to the Amazon.com homepage, you can use the following format:

http://www.amazon.com/?tag=your_Associates_ID

To make this link functional, replace "your_Associates_ID" with your Associates ID or tracking ID.

An item's ISBN/ASIN is listed on the item's detail page. For example, follow the link below, and then scroll down to the section labeled Product Details to find the ISBN (0439434866) for "Harry Potter Paperback Boxed Set."

http://www.amazon.com/exec/obidos/tg/detail/-/0439434866/

I don't make much money from referrals, but I do enjoy taking my payments in the form of Amazon gift certificates and buying myself a little something from my wish list every now and then.

Google: crazybob.org

Taken with my 'gPhone'

I've been playing around with the 3 megapixel camera on my Android-based G1. Like any phone camera, you need a little diligence, a lot of light, and a steady hand.

Walking home

Mask

Stanford

Fountain

Nested

For the best results, tap and release the shutter button, and then hold the phone still until it takes the picture a second or so later. It's not necessary to hold down the button until the picture takes. Holding down the button will contract the muscles in your hand and make it more difficult to keep the phone steady.

Click here for more photos.

Google: crazybob.org

Greeting Grammar

I've noticed that most people start off emails with "Hi Bob,". I suspect they're treating "hi" as a less endearing replacement for "dear" in "Dear Bob,". Technically, "dear" is an adjective describing "Bob" while "hi" stands on its own and is not part of the direct address. I prefer the more correct salutation: "Hi, Bob."

Who is the most grammatically correct social network? Facebook, Plaxo Pulse, and Flickr get this wrong, by my standards, in their automated emails. Twitter gets it right.

Google: crazybob.org

Expert Guice

Stephan just posted video of a talk I gave at Javapolis back in December: Expert Guice: 50 some odd ways to Guice up your Java

Update: Stephan fixed the audio levels so you should be able to hear me now. :-)

Google: crazybob.org

Guice @ Google I/O

Jesse and I are presenting Guice 101 at Google I/O, 11:15 this morning:
Guice (pronounced 'juice') is a Jolt award-winnning, lightweight dependency injection framework for Java 5 and above. Put simply, Guice alleviates the need for factories and the use of new in your Java code. Think of Guice's @Inject as the new new. You will still need to write factories in some cases, but your code will not depend directly on them. Your code will be easier to change, unit test and reuse in other contexts.

Google: crazybob.org

Going to JavaOne? Sign up for Twitter.

If you already twitter, feel free to skip to the next section. If you've never heard of Twitter, read on and keep your finger on the pulse of JavaOne.

With Twitter, you can broadcast short status updates to your followers and receive updates from people who you follow. It's like having one big instant messaging conversation with all of your friends.

You can access Twitter via SMS. During JavaOne, you can easily keep tabs on your fellow attendees as well as let them know what you're up to, all from just about any cell phone (standard text messaging rates apply).

For example, if you follow me, and I text "free beer at Guice BoF!" to Twitter, Twitter will forward the message on to your phone.

Note: In addition to following someone, you must also enable "device updates" for that person in order to receive their updates via text and instant message.

If you don't have unlimited text messaging, you can always access Twitter via the web or one of the zillion 3rd party Twitter applications.

#javaone

The Twitter world utilizes an ad hoc tagging system called hashtags. It's simple. Tag your JavaOne-related messages by appending "#javaone" to them, and I'll be able to see your update even if I'm not following you yet.

Simply text "track javaone" to Twitter in order to receive any message containing the word javaone from anyone on Twitter, or search for "#javaone" on Summize, a real time Twitter search engine.

Follow Me

I plan to twitter throughout JavaOne. In addition to following me, also check out these Java twitterers:

If you'll be twittering from JavaOne and I didn't mention you above, link to your profile from the comments so others can find you.

Finally, please spread the word about this post and twittering at JavaOne in general. The more people who Twitter from JavaOne, the more fun we'll have!

Google: crazybob.org

The Twubble with Twitter

Dion Almaer interviewed me about Twubble for the Google Developer Podcast:

If you use Twitter, Twubble can look at your existing friends' friends and recommend new people for you to follow. It's a stupid simple idea, but I think the execution and fun factor have won people over.

I wrote Twubble in a couple nights of hacking in bed after the kid went to sleep. I used the latest Google Web Toolkit milestone which supports Java 5 (flawlessly from my experience). I was writing Javascript code (server and client side) for years before I ever got into Java, but I have to say, you'd be crazy to write AJAX apps any other way than GWT nowadays.

Google: crazybob.org

Statically Typed Foreword

Robbie asked me to write a foreword for his upcoming Guice book. Having never written a foreword before, I Googled, "how to write a foreword," which brought me to two helpful posts from Muse Ink: Foreword Thinking and Foreword March.

Here's what I came up with:

I created Guice in the midst of one of the biggest projects of my career. When you have hundreds of engineers touching millions of lines of code, you come to appreciate the benefits of static type checking. Static types aren't just about compiler errors. In fact, I rarely see Java compiler errors nowadays. Thanks to all that great, formalized Java type information, my IDE helps me write correct code in the first place.

Writing your application in a nearly 100 percent type safe manner, like Guice enables and Robbie advocates in this book, opens the door to a new level of maintainability. You can effortlessly navigate unfamiliar code, jumping from interfaces to their implementation and from methods to their callers. As you master your Java tools, you realize that deceptively simple atomic refactorings combine to form molecular tools, which you can reliably apply to companywide swaths of code, accomplishing refactorings you'd never even consider trying by hand. In the long run, it's much cheaper to ward off bit rot through heavy reuse and constant refactoring than by nuking the world with a rewrite every couple years.

Having experienced Guice's benefits on a number of projects, we at Google knew we couldn't keep it to ourselves and decided to make it open source. Readying Guice for the outside world felt like it took an order of magnitude more work than writing that first internal version, but community contributors like Robbie who fuel the forums, help polish rough edges, and generate excellent documentation like this book pay back that effort tenfold. You'll find that Robbie's brevity and conversational tone suit Guice well. I like my books like I like my APIs: with high power-to-weight ratios.

I focused on static typing because I've gotten a lot of questions about it lately. There's a lot of misinformation out there. For example, some people incorrectly conflate static typing with compiler errors, and, based on that false foundation, they claim that unit testing is an adequate substitute for static typing.

Static typing and unit tests are orthogonal. Static typing doesn't replace unit tests. Unit tests don't replace static typing. In fact, static typing can make maintaining unit tests much easier, especially when paired with the right mocking framework. I certainly believe that scripting languages have their place; beware anyone who tells you that static typing doesn't.

Google: crazybob.org

Thanks for the Jolt!

Jolt

Guice took home the Jolt, a.k.a. the geek Oscar, at an award ceremony hosted by Bob Cringely during SDWest:

The Jolt Awards recognize those products, books, and websites that have "jolted" the industry in the past year. Winners are selected by a panel of judges consisting of industry insiders, columnists, and technology leaders.

I started reading Dr. Dobb's Journal back when I was 12. I regularly bought it off the newsstand at Oxford books in Atlanta and was lucky to understand one article in the entire magazine. I learned much of what I know by reading instead of going to college, so DDJ has been an invaluable resource for me. I remember greatly admiring the Jolt winners each year. I hardly imagined myself among them, especially so soon.

The judges picked three productivity winners and one overall Jolt winner from a pool of six finalists in each category. Guice had some stiff competition; other finalists in the Libraries, Frameworks and Components category included the Eclipse Modeling Project, JasperReports, Qt Jambi, the Spring Framework, and the Zend Framework. Congratulations to the productivity winners: Eclipse, Zend and JasperReports.

Kevin and I had the pleasure of accepting the award on stage, but the truth is, Guice 1.0 is heavily indebted to a lot of people. I can't name you all, but I would like to thank:

  • My wife Krista and daughter Dagny for their support
  • The Jolt judges for recognizing our hard work
  • Kevin Thompson, our manager at the time who gave me the latitude to work on Guice full time
  • My mentors Josh Bloch and Neal Gafter
  • Cedric and Hani for their treatment of Guice in Next Generation Testing
  • The early adopters and contributers who helped steer Guice to 1.0, in random order: Jesse Wilson, Zorzella, Laura Werner, Peter Epstein, Don Brown (Struts 2), Cliff Biffle, Arthur Gleckler
  • Brian Slesinsky, for his apt analogies, Eric Burke, for his cartoons, and all the other bloggers who helped popularize Guice
  • Robbie for writing a Guice book
  • Dhanji for writing a Guice book, and integrating Guice with Hibernate and JPA in Warp Persist
  • My parents for instilling a strong sense of type safety at an early age (Thanks for the reminder, kebernet.)

And finally, I'd like to thank Google for its unparalleled commitment to open source. If you haven't tried Guice yet, now is the time.

Google: crazybob.org

The trouble with Twitter is...

When it's down, the first thing you want to do is Twitter about it being down. I originally wanted to tell Duncan Davidson how much I love his site design. I'm sure it's been that way for awhile, but I normally only see his RSS feed.

I'm also thinking about picking up the second edition of the Dragon Book. I want to learn more about language design and compilers. I know the Dragon Book has it's shortcomings, but I love that the new edition covers JIT compiling and garbage collection, and I'm really just looking for a foundation, not a definitive reference. I can catch up on the latest and greatest via the ACM.

I guess it would have been hard to fit that into 140 characters anyway.

Update: After reading the Amazon customer reviews, I bought Programming Language Pragmatics instead.

Google: crazybob.org

In the hot seat

I sat down for an interview with Carl Quinn during Javapolis, and the video is now up on parleys.com. You can also find an audio-only podcast version on the Java Posse's web site. In it, we talk frankly about:
  • The history of and philosophy behind Guice, what problems it solves, how we implemented it, the secret sauce in Guice's stellar performance, and how Guice compares to other approaches.
  • How we in the Java community need to take a step back and rethink API and framework design after Java 5 and 6. Reflection heavy and convention based Java 1.4 designs won't fly for much longer. Readability doesn't necesarily mean fewer characters. Java 5 made static type safety a reality and introduced explicit meta data. Java 6 lowered the barriers to compile time code generation, but good documentation of these new features is still much needed.
  • The future of Guice and dependency injection in general. I'd like to see dependency injection on mobile devices and deeply integrated into Java SE. One day, many of the problems we're solving in a separate framework will be addressed seamlessly by the core platform, and we'll be free of integration headaches and able to focus on higher level abstractions all around.
  • Google Collections, an excellent open source project led by Guice co-lead Kevin Bourrillion. Check it out if you haven't already. Kevin and the rest of the team try to hold the Google Collections to the same standards as the core Java SE Collections, and it shows.
  • Weak vs. soft references, which you should use, and specifically when not to use soft references.

Thanks again goes to Carl and Stephan and the rest of the BeJUG team. Javapolis was one of the most fun, inspiring, community-oriented conferences I've been to in a long time. Getting back and forth between your hotel and the conference was a little tricky at times, but the venue itself absolutely rocked.

Google: crazybob.org

Guice @ Javapolis

I'm speaking about Guice first thing on Wednesday and JSR 299 Web Beans on Thursday. How should I approach my Guice talk? We already have a pretty good video introduction up on the web. Is it safe to assume enough people understand the basics and dive right into the future of dependency injection? What would you like to hear about?

Google: crazybob.org

I dream of electric sheep.

In roughly 24 hours, we'll release the Android SDK, and I'll finally be able to talk about what I work on. My phone will be one (big) step closer to freedom. Wish us luck!

Update: It's alive!

Google: crazybob.org

Why Guice?

TheServerSide just posted a video interview they recorded in May shortly after the Guice 1.0 release. Since then, I've had ample time to chew over what I like so much about Guice and hone my thoughts on dependency injection in general.

Being a fan of plain old Java, before I wrote Guice, existing dependency injection frameworks were non-starters for me. I'd sooner write factories by hand than keep XML in sync with my classes or embed method names in strings. I mean, if you don't have type safety, all of that extra typing really is for naught, and you might as well switch to Ruby. Furthermore, a programmer shouldn't have to fire up a debugger or even think too hard in order to figure out what her code is doing. I felt the same way about mocking frameworks until EasyMock pioneered their extraordinarily typesafe approach.

Before Guice, I had to make the same up-front decision over and over: do I call a constructor directly, or do I write a factory and call it instead? If you start out calling a constructor and later decide that you need a factory, you have to go back and change all the callers. On the other hand, factories come at a cost: they clutter your API and result in a bunch of boilerplate code which you have to both write and maintain. In practice, if the only reason you need a factory is to enable testing, most programmers will forgo the factory, testing be damned.

Guice provides the best of both worlds and finally enables agile programming in Java. Injecting an object requires roughly the same amount of effort as calling a constructor. If you decide later on that you need more abstraction, write a factory and change your code in one place; there's no need to change all the callers. If you're providing code to someone else, give them a bunch of interfaces and a Guice module. They can test their code, you can change how you create objects to your heart's content without impacting your users, and your API will be smaller to boot. As you can probably tell from Guice, I love small, interface-heavy APIs.

Google: crazybob.org

Tax-Free Guice

I'm speechless. Thanks, Eric.

Google: crazybob.org

Gavin King on ActiveRecord

Referring to this ActiveRecord example:

class Person 

Gavin says:

At this point, most developers are thinking um, ok, so how the hell am I supposed to know what attributes a Company has by looking at my code? And how can my IDE auto-complete them? Of course, the Rails folks have a quick answer to this question Oh, just fire up your database client and look in the database!. Then, assuming that you know ActiveRecord's automagic capitalization and pluralization rules perfectly, you will be able to guess the names of the attributes of your own Company class, and type them in manually.

Somehow, excitement about the Ruby language has warped their perceptions to such an extent that these people actually believe that this is a good thing!

Couldn't have said it better myself.

Google: crazybob.org

Silicon Valley JUG @ Google Tonight

Swing by, and say hello.

Topic: Improving your Code with Objects and Aspects
Speaker: Chris Richardson
Agenda: Snacking and mingling from 6:30 to 7, presentation from 7 to 8:30
Location: Google Inc., Tunis Conference Room (Bldg. 43)

Google: crazybob.org

Treader Supports del.icio.us

After installing Treader, you could already post to Twitter directly from Google Reader by hitting Shift+T. Now, you can hit Shift+D to bookmark an entry in del.icio.us, too.

Google: crazybob.org

Why reinvent the wheel?

Why indeed? I'm not a big fan of the question, "Why reinvent the wheel?" It's what you call an Appeal to Tradition, "a fallacy that occurs when it is assumed that something is better or correct simply because it is older, traditional, or 'always has been done.'"

Depending on the context, you can almost always replace "Why reinvent the wheel?" with "Please don't compete with me," or "Please don't make me learn something new." Either way, the opponent doesn't have a real argument against building something newer and better, but they also don't want to admit their unhealthy motivations for trying to stop you.

More seeds, more blooms, I say. Don't build houses on kitchen sinks. Reinvent away. Most of our current technology sucks, and even if it didn't, who am I to try and stop you?

Google: crazybob.org

Page 1 | Next >>
Username:
Password:
(or Cancel)