| |
Dondo Land
Bryan Donovan's Weblog
Sunday August 27, 2006 |
|
Rubyquiz has accepted my submission, asking readers to write a class that returns a range of days in a human-readable format. The quiz can be found here.
Here's an excerpt explaining the idea..
If you've ever created a web application that deals with scheduling recurring events, you may have found yourself creating a method to convert a list of days into a more human-readable string.
For example, suppose a musician plays at a certain venue on Monday, Tuesday, Wednesday, and Saturday. You could pass a list of associated day numbers to your object or method, which might return "Mon-Wed, Sat".
The purpose of this quiz is to find the best "Ruby way" to generate this sentence-like string.
[...]
Here are some example lists of days and their expected returned strings:
1,2,3,4,5,6,7: Mon-Sun
1,2,3,6,7: Mon-Wed, Sat, Sun
1,3,4,5,6: Mon, Wed-Sat
2,3,4,6,7: Tue-Thu, Sat, Sun
1,3,4,6,7: Mon, Wed, Thu, Sat, Sun
7: Sun
1,7: Mon, Sun
1,8: ArgumentError
To my surprise, there have already been several submissions with varying ways of solving the problem. This is a good way to learn some Ruby for sure..
(2006-08-27 12:10:46.0/2006-08-27 10:15:06.0)
Permalink
Trackback: http://blogs.sun.com/bdonovan/entry/day_range_rubyquiz
|
|
|
Saturday August 05, 2006 |
|
We should have played board games in business school
This game is brilliant and fun. Here's a quick description of Modern Art:
Five different artists have produced a bunch of paintings, and it's the player's task to be both the buyer and the seller, hopefully making a profit in both roles. He does this by putting a painting from his hand up for auction each turn. He gets the money if some other player buys it, but must pay the bank if he buys it for himself. After each round, paintings are valued by the number of paintings of that type that were sold. The broker with the most cash after four rounds is the winner.
If you don't want to get the board game, you can get a free Windows version here.
(2006-08-05 09:22:07.0/2006-08-05 09:22:07.0)
Permalink
Trackback: http://blogs.sun.com/bdonovan/entry/we_should_have_played_board
|
|
|
Wednesday August 02, 2006 |
|
Everyone should get a Sun Ray
If you run a company with a separate computer for each employee, you should really stop doing that and switch over to running a company with a Sun Ray for every employee. Yeah, this is a "plug" for Sun, but I'm serious about this. Sun recently set me up with a Sun Ray at home (a Sun Ray 170 to be exact), and I'm very impressed. We've been using Sun Rays at work for a few years now, but seeing them work so well from home is whole other level of technological coolness. Here's a short list of benefits:
- I don't have to maintain anything. All of the applications sit on centralized servers, which are much easier and cheaper to maintain than individual (especially Windows-based) systems.
- I can leave my session at work with various applications open, even if I'm in the middle of typing an email, and when I get home, I simply insert my badge/smart card and I can pick up where I left off.
- It's fast. Right now I'm typing this from 13 miles away from the servers and I can see no delay as I type. Sometimes the screen jitters a bit when I switch windows, but it's not bad at all.
- It's secure. I don't have to worry about setting up my laptop to be hacker-proof and don't have to worry about it being stolen.
- It's completely quiet and power efficient. The first time I used a Sun Ray at home, I found it almost too quiet in my condo. No fans, no heat, no hard drive noise.
- This 17" LCD is way nicer than my laptop display!
Heck, if I had a family, I'd set up a small Sun Ray network at home. Of course, I'd also make my kids use Solaris or Linux too...
(2006-08-02 22:33:19.0/2006-08-02 22:10:00.0)
Permalink
Trackback: http://blogs.sun.com/bdonovan/entry/everyone_should_get_a_sun
|
|
|
|
| « August 2006 » | | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|
| | | 1 | | 3 | 4 | | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | | 28 | 29 | 30 | 31 | | | | | | | | | | | | Today |
Today's Page Hits: 85
|