Matt RaibleMatt Raible is a writer with a passion for software. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

New Passport in 9 Days

A couple of month ago, I discovered my passport was missing. I looked all around my house but couldn't find it anywhere. Since I'm going to Munich in September, I had to get a new one. So last week, I went to Denver's Downtown Post Office, filled out an application, gave them an original birth certificate, got pictures taken - the whole ball of wax. It cost me around $100 and didn't take more than 30 minutes.

I was amazed when my new passport arrived yesterday in the mail. That's a mere 9-day turnaround! The last time I had to get a new passport, it cost me $350, but I also got it in 2 days. It's good to see getting new passports is an efficient process these days.

Posted in General at Aug 21 2008, 10:12:50 AM MDT 2 Comments

EhCache Project Busy this Summer

The EhCache project appears to be having a very busy summer. EhCache 1.5.0 (a major new version) was released on July 12th. In addition, a new (SOAP-based) EhCache Server was released at the end of July. You might ask yourself why you'd need such a beast. I think Greg explains it best:

Why am I doing this? There are lots of theories that have made their way on to the ehcache mailing list. The prosaic truth is that a large US corporate using ehcache for their Java apps on 200+ servers also wants to use it for their C++ apps. And they are prepared to sponsor development. The Web Services API lets them do it. That's it.

As to the larger question of how interesting this is to the world at large, my view is not very. However having to jump through all the hoops to get a server infrastructure done, I thought that the world at large may be interested in a RESTful, resource oriented ehcache server.

The next day, Greg announces EhCache for JRuby on Rails. A few days later, RESTful, resource-oriented caching becomes available in ehcache-server.

I guess this helps answer the question about OSCache vs. EhCache. OSCache hasn't had a release in over a year and EhCache is pumping out new releases and new products. Well done, Greg!

At LinkedIn, we use EhCache for many of our caching needs. However, it's likely we'll be moving to Memcached in the future. Since I'll be part of the team that implements Memcached, it'll be interesting to see which one performs better.

Posted in Java at Aug 10 2008, 09:12:31 PM MDT 7 Comments

Spontaneous Stuff Weekend

This weekend, I didn't have much planned to do with the kids. I had a couple ideas, but nothing set in stone. The good news is the kids were full of ideas and we kept ourselves plenty occupied. On Saturday, we went to Elitch Gardens. We rode the Light Rail and my stomach barely survived the 4-hour journey.

Roller Coaster at Elitches Spinner

I was pleased to find out they served beer at Elitches, but regretted it shortly after as I was spinning with the kids in the Tea Cups. But that wasn't the worst ride. The worst one was Thunderbolt - that was the one I had to go on back-to-back with each kid (b/c they weren't tall enough to ride alone). Shortly after getting off, I realized I'd left my iPhone on the ride. Luckily, I rushed back to the ride and the operator was able to find my car and grab it from a very happy teenager.

Today we decided it'd be fun to take a hike. We gathered everyone in the car and drove just past Idaho Springs to St. Mary's Glacier. It was a nice 1.5 mile round-trip hike and both the kids and Cookie (the dog) had a great time. I was pretty impressed with the kids' ability to hike, especially over all the big rocks on the trail. Of course, when I told them they did so well, it only took Abbie 2 seconds to process and respond with "does that mean we get toys?"

Hiking to St. Mary's Glacier St. Mary's Glacier

Conquering the Rocks Dad - I can't touch the sand!

Posted in General at Aug 10 2008, 05:25:00 PM MDT Add a Comment

Awesome Birthday Present: A Kegerator

My New Kegorator I'm proud to say I have the best parents in the world. For my birthday this year, they bought me a kegerator. It was delivered last week, but I didn't get a chance to put it together until this weekend. I've never had so much fun putting together an appliance.

Since it's summer and I'm in Colorado, I decided to get a keg of Sunshine Wheat to start things off. So far, there's issues with 1) too much head and 2) it's not quite cold enough. I think the first can be fixed by playing with the CO2 tank and settings. The 2nd might only be fixable by moving it inside. If you have a kegerator and have advice on how to fix these issues, please let me know.

Why did your parents buy you a kegerator?

There's actually a good reason for this. A few years ago, Julie and I made an agreement that I could buy a kegerator when I paid off the last of my student loans. While Julie and I aren't a couple anymore, it still seemed like a good idea. I paid off my last student loan in June. However, it wasn't my loan, it was my Mom's. When I was applying for colleges way back in the early nineties, my parents said I could go to DU, but only if I paid for it.

My Mom took out quite a few loans over the years to help with tuition, and I finally paid them all off. When I was with my parents over the 4th, I joked that they should buy me a kegerator since I was paying off their loans. Lo and behold, my subliminal messages worked and I ended up with a tap at my house. I couldn't be happier.

Update: Speaking of birthdays, this is the first post I've had to start the 7th year of this blog. My first post was on August 1, 2002.

Update 2 on Friday: I haven't had a beer from the kegerator since Sunday. This evening I poured a fresh one and I'm happy to report the head and temperature issues seem to be fixed.

Posted in General at Aug 05 2008, 09:01:20 PM MDT 6 Comments

Maven Plugin for Running Integration Tests against Multiple Containers

Don Brown has created a pretty cool Maven plugin that allows you to run integration tests on multiple containers in one go. I learned about it on the Struts 2 Dev List:

I've started adding functional tests to Struts 2 by adding a few to the REST showcase application, running against Tomcat 5.x, Jetty 6.x, JBoss 4.2.x, and Resin 3.x. The magic happens through a new Maven 2 plugin I developed called maven-itblast-plugin, which enables multiple integration test runs against multiple containers in one go. For more info, see http://github.com/mrdon/maven-itblast-plugin/wikis/home.

You might notice that this plugin is hosted on GitHub. If you want to learn how to use GitHub with Maven, you might want to see Don's entry on Maven-enabled project hosting with GitHub. Thanks Don - good stuff.

Update: Don has posted more information about this plugin on his blog.

Posted in Java at Jul 31 2008, 05:39:23 PM MDT Add a Comment

Presenting Web Frameworks of the Future Tomorrow in Denver

Tomorrow (Thursday) night, I'll be doing an encore presentation of my Web Frameworks of the Future at DeRailed. If you're in Denver and would like to hear me ramble while drinking a beer, join us at Forestroom 5 at 6:30.

After the last few days, I'm happy to report I should be in good enough condition to pull this off. If you're curious to learn more about my experience at OSCON and this presentation, please see my writeup on the LinkedIn Blog.

Posted in Open Source at Jul 30 2008, 09:56:17 PM MDT 2 Comments

My OSCON Aftermath

Last week, I had a great time at OSCON '08. However, I've been paying the toll ever since. For the 5 days prior to OSCON, I stayed up late working on my presentation. I was furiously trying to develop an application with Rails, Grails, Flex and GWT. In the ~30 hours I spent developing the application (Rich Resume), I was able to finish the Rails and Grails pieces, but didn't get much farther than "Hello World" with Flex and GWT.

Even though I had my kids the weekend before OSCON, I still managed to get 4 hours of sleep each night. The next couple nights were no better. On the day of my presentation, I started to feel sick. Luckily, it didn't affect my talk and it never really hit me until the next day. On Thursday, I woke up with swollen tonsils and the feeling of an oncoming cold. I attended the conference on Thursday and went to bed early to get lots of rest.

On Friday, things weren't improving, but they weren't getting any worse either. My family and I attended the Oregon Brewers Festival and had a great time. Yes, I actually survived taking my kids to a Beer Fest for several hours. That evening, we stayed the night at the Kennedy School and thoroughly enjoyed ourselves. Again, I went to bed early as the kids and I had a 7:30 AM flight the next morning.

On Saturday, I started to lose my voice and my cold was still bearing down on me like an avalanche. I drove up to Vail for a friend's wedding on Saturday night. Of course, I stayed up too late and drank too much, but I did have a heckuva a good time. ;-)

When I woke up Sunday, I was in bad shape. The hangover wasn't bad, it was the body aches (from the cold) and the fact that my right eye was draining and it hurt to open it. A friend had to drive me home because I couldn't put my contacts in. I went to bed when I got home (around 5) and didn't wake up until noon the next day (Monday). I called in sick yesterday and went to the ER in the afternoon (I couldn't find a doctor who'd have me). The doctor in the ER said it was Pink Eye and gave me some drops to make it better. I came home, took a nap and crashed for the night a couple hours later.

I called in sick again today. I woke up around 9 this morning, took a nap 10 minutes later and finally woke up around 1:30 this afternoon feeling halfway decent. The body aches aren't nearly as bad as they were and my eye is no longer draining.

The worst part of this whole thing is I lost my glasses a couple months ago so I've been living w/o good vision for 3 days. I can read things 12 inches from me, but watching TV doesn't work too well. Since I can't wear my contacts for 7 days, I hopped on my bike and rode to the nearest LensCrafters to get a new pair of glasses. Those are scheduled to be done in the next 5 minutes (I'm typing this at the Apple Store in Cherry Creek Mall) and I'll finally be able to see again.

Lessons Learned: Sleep is important, get lots of it. Don't get Pink Eye and a cold at the same time. If you wear contacts, make sure you have a backup pair of glasses for when you get Pink Eye.

Posted in General at Jul 29 2008, 06:08:58 PM MDT 5 Comments

OSCON 2008 Wrapup

This week, I attended OSCON 2008 in Portland, Oregon. I talked to someone who thought the conference had a very small Java presence. I noticed this too, but that's how it's always been. Interestingly enough, they also thought it had a small Ruby showing. I guess Perl, Python and PHP will always dominate OSCON. Of course, there's nothing wrong with that. I've always admired OSCON for the diversity of developers and languages.

Below is a list of my entries for all the sessions I attended.

If you attended OSCON, did you enjoy the show? What was your favorite session? I'd love to hear other's impressions of the conference and how it could be improved.

Posted in Open Source at Jul 25 2008, 10:05:08 AM MDT Add a Comment

[OSCON 2008] Even Faster Web Sites by Steve Souders

Steve works at Google on web performance and open source initiatives. To begin his talk, Steve is running YSlow in "autorun" mode. This runs YSlow Performance tests on the top 100 sites according to Alexa. Before Google, Steve was at Yahoo for 7 years. You can download Steve's slides from his site (don't ask me where).

iGoogle with an empty cache: 9% of the time is spent getting the HTML document. The % of time of what a webserver does is a pretty small percentage of the overall picture. If the cache is primed, the time goes up to 17% of the time.

80-90% of the end-user response time is spent on the frontend. Start there.

There's a greater potential of improvement on the frontend. If you improve the backend performance by 50%, chances are the end-user only sees a 5% improvement.

The 14 Rules are encapsulated in the YSlow plugin. At OSCON last year, Yahoo released YSlow. 500,000 downloads since it was released. Following the release of YSlow, Steve wrote High Performance Web Sites.

High Performance Web Sites, Vol 2. The 3 most important rules are:

  • Split the initial payload
  • Load scripts without blocking
  • Don't scatter inline scripts

Why focus on JavaScript? A lot of the top sites use JavaScript. For example, up until a few weeks ago, Facebook served up 1MB of JavaScript, uncompressed. Scripts block parallel downloads and page rendering. To see it in action, go to http://stevesouders.com/cuzillion/?ex=10008.

Any content below a <script> is blocked from rendering - even if it's already cached in the browser. Cuzillion is an open source project that Steve is releasing that allows you to add components to a page and test their performance.

Split your JavaScript between what's needed to render the page and everything else. Load "everything else" after the page is rendered. To do this, you can use Firebug to do it manually, or you can use Doloto from Microsoft to automate the splitting of your files.

MSN.com solves the script blocking problem by using JS DOM to allow for parallel downloading. There's 6 techniques for doing this:

  • XHR Eval (must have same domain as page)
  • XHR Injection (same domain)
  • Script in iFrame (same domain)
  • Script DOM Element (domains can differ)
  • Script Defer (only supported in IE, domains can differ)
  • document.write (not recommended, parallelization only works in IE)

How do these techniques cause "browser busy" indicators? XHR Eval and Injection don't trigger any indicators. You need to choose when you want to show busy indicators. It's good to show them when you want to show your users that something is processing (but not for lazy-loading JavaScript that's not required for load). For the different techniques, most don't ensure order of parsing.

Based on 3 factors, Steve can tell you which technique is best to use. These three factors are 1) the URL of the page and script 2) if you want busy indicators and 3) if you care about order. Steve thinks it would be awesome if web frameworks could support this to write out JavaScript appropriately for the developer's input.

Long executing inline scripts block rendering and downloads. If you know you're going to have scripts like this, you can solve it with a couple workarounds:

  • Initiate execution with setTimeout(>250 for Firefox)
  • Move JavaScript to enternal script with advanced downloading techniques
  • Use defer attribute for IE

In Firefox 2, stylesheets block parallel downloads just like scripts. IE doesn't. However, IE will block when you have a stylesheet followed by an inline script. To solve, it's best to move line scripts above stylesheets or below other resources. use <link>, not @import.

Takeaways: focus on the frontend, run YSlow, focus on JavaScript (split initial payload, load scripts w/o blocking, don't scatter inline scripts).

Three Announcements:

Posted in The Web at Jul 24 2008, 04:23:12 PM MDT 8 Comments

[OSCON 2008] CSS for High Performance JavaScript UI by Gavin Doughtie

Gavin is a front end developer on Google’s Picasa Web Albums and a contributor to the dojo toolkit. The original designer tools for Web 1.0 were the FONT tag, TABLE hacks and spacer gifs. Now we live in the future (shows a picture of the iPhone). Maybe it's time to accept that we're stuck with CSS. "I'm a coder, not a designer" is what happens at OSCON.

There are costs of JavaScript: development, download, parse time and runtime performance. It's extremely powerful and high-level, but it's slow because it's interpreted. Drawing a box with JavaScript in Firefox 3 isn't too difficult. Another way to do the same thing is with CSS. Doing the same thing in CSS is much faster and requires less code. Surrender To Win. You don't have to code it all. You can hand off part of that to your runtime environment (browser).

CSS Fundamentals
You want to how things flow in a page. Browsers were originally designed to render text. They're built to render flowing text. Other important fundamentals include float, positioning, negative margins, relative units, pseudo-selectors. Lastly, you need to know when to use tables. Gavin is now showing an example of using CSS to modify an image so it scales with the browser window. It's pretty simple:

body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

img { 
  position: relative;
  width: 100%;
  height: 100%;
}

Relatively Absolutely: "Absolute" in relative to position:relative. If an element has absolute positioning, it will only be positioned relative to it's parent element. To draw a box on an image, it's usually best to calculate the percentage position and sizes in script or on the server. The world's greatest psuedo-selector is :hover. Unfortunately, :hover doesn't work on anything but <a> in IE 6.

With floats, you can "float" elements to the top, right, bottom and left. In Firefox and Safari, you can set a border-radius to draw lines that are curved. Before Firefox 3, these lines where terrible looking.

Tables make a lot of sense when you have a grid layout. Use table-layout:fixed if you don't want table cells to be the width of their contents.

For sizing images and other elements, it's usually best to use em for the height and width and relative measurements. You can then use style.fontSize to resize the images. Using this technique is must faster than using JavaScript to set the height and width on an image.

WebKit, the CSS Wonderland. Gavin loves WebKit. It's on Safari (Windows, OS X and iPhone), Android, GNOME and KDE. With WebKit, you can build expanding lists w/o any coding. To do gradients in WebKit, you use:

background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#00abeb));
-webkit-border-radius: 0.24em;

To do animation, you can use:

-webkit-transition-property: width, height;
-webkit-transition-duration: 250ms;
-webkit-transition-timing-function: default;

Another thing you can do with WebKit is rotate images (using -webkit-transform: rotate()) and just about anything (divs, forms, etc.). WebKit also supports SVN masks, which means you can open up a hole and view an image through it.

Gecko's pretty cool too. Firefox 3 introduced a new rendering engine based on Cairo. You can do an SVG transform in Firefox 3 to create reflections of elements (divs) in your page.

"With browsers, you cut people off at the knees, but everyone's the same height." -- Alex Russell

IE 6 is not the problem, we're the problem. If you drop support for IE 6, you won't have to worry about coding towards it. It might not be possible if you work for a large company, but if you're small, you should definitely think about it hard.

It's funny to think that IE 6 is the new Netscape 4.

Gavin's slides from this talk will be available at http://xdraw.org/oscon2008.html in the next few days.

Posted in The Web at Jul 24 2008, 03:30:32 PM MDT 1 Comment