Uncategorized

Re: Subverting Subversion

I used to use the same trick Rodney Dawes describes in Subverting Subversion. Yes, it was very annoying to have to set everything from a file every time, or from stdin.

Ah, but there’s a better way, and people new to SVN seem to somehow miss this valuable command.

$ svn propedit svn:ignore

Up comes your editor, just as if you opened .cvsignore. You can now safely nuke your .cvsignore files. This is a useful command, so write it down until it’s burned into your brain.

Happy New Year!

Another year come and gone. Hopefully everybody is out having a good time or recovering from a good time. I just finished up for the night and am planning to get some reading done before bed, but thought a quick blog post summarizing the year was in order.

  • This year marks my second year living in the Bay Area and working at VMware, and my first year really heading up some larger projects. I began the year by working on what would in time be known as VMware Server, and spent the first half of the year head down at my desk working on each release. Following that, I’ve been working on specifications, feature implementations, and even Tango-style icons for VMware Workstation 6.0, which I will continue with for some time.
  • Jamie and I have now been dating for just over two years.
  • For the first time, I was invited to FooCamp, hosted by Tim O’Reilly. Awesome event that I really hope to be invited back to next year.
  • I learned to boogie board with a couple of friends in Santa Cruz. Later in the summer, Jamie and I took a nice vacation in Santa Cruz and spent most of it at the Santa Cruz Beach Boardwalk.
  • I had my second trip to Boston this year for the GNOME Summit. I went with Jamie to Salem and explored the touristy little town. Fun place, and I’d definitely like to spend more time there in the next couple of years.
  • I went with some friends to Castro St. in San Francisco for the first time for the big Halloween costume party that they have every year. We found out the following day that there was a shooting not too far from us, which was unnerving.
  • I got a Nintendo DS and a Wii, and have spent far too much money on both. I’m going to just start signing over my paychecks to Nintendo.

I’m sure I’m missing a few things. 🙂

Now, New Years Eve doubles as my mom’s birthday, which I imagine was not fun when growing up. I think the only day worse for a birthday is Christmas. It was certainly fun tonight, though. The night was spent with my mom, stepdad, brothers, sister, and Jamie. We watched Cars and played Scrabble, Bomberman Touch! for the DS (fun game!), and Cranium. We ended up spending most of the evening on Cranium, which has to be my favorite family game. We kept laughing so hard that we got ourselves sick.

Jamie brought over a bottle of champagne for us to drink. It was a late Christmas present, intended for New Years. We’re not heavy drinkers, so we only finished half the bottle, but it was very nummy. Along with that, we had a variety of snacks, including cheeses, beef sausages, vegetables, sodas, and pizza. This was, I think, my first New Years with my sister Jenna, as she had always been visiting cousins on New Years. She was pretty good most of the night, considering she had to stay up until midnight 🙂

January 1, 2007. With any luck, this year will be more exciting and eventful than last year. There are changes I hope to make, projects to abandon, projects to take up, and places to go. I think I’ll get some sleep so that I can get a head start on that.

Happy New Year!

Time to rethink GTK+ Tab Dragging

I’ve been planning on adding tab drag-and-drop functionality to VMware Workstation 6.0. Rather than implementing this ability from scratch (which I did with Gaim, and would rather not do again), I took the sane approach and started investigating the GTK+ 2.10 API for GtkNotebook tab drag-and-drop.

This is functionality that many applications have had to implement themselves, so it’s great that support had finally gone into GTK+ 2.10. So I must wonder, with all the various applications that would benefit from this new API, how did we get it so wrong?

Now, before I continue, let me say that I applaud the effort in getting this into GTK+ in the first place. Reordering tabs looks smooth, it’s only one API call, and the basics are trivial. Where this all falls down is when you try to do anything complicated with it, and by complicated I mean anything beyond a simple text editor.

Before starting, I investigated how many projects were using this API. A quick Google Code search shows that almost nobody does, aside from maybe the tab reordering API. I did find this list of complaints, which I remember reading before. I won’t repeat everything on this list, but I will list what I’ve ran into, and how I think we can improve this API.

Global functions are very bad. (Bug 386935)

In order to allow for a tab to be dragged out and form a new window, the application must call gtk_notebook_set_window_creation_hook and pass a callback function. When a tab marked as detachable is dragged to the root window, this function will be called. It is expected that the function create a new window, position it as per the x and y coordinates of the drop (if it so desires), show it, and return the resulting notebook. GTK+ will then add the tab to that notebook.

While useful, this suffers from a major design flaw. You can’t set a window creation hook per-notebook. You get exactly one window creation hook function, which must be responsible for any and all notebooks in the program. The hook function can only distinguish between them using the notebook’s group ID.

For smaller programs, this isn’t a huge limitation. Simple text editors and the like only need one function. However, imagine if your application has multiple notebooks that each need to be dragged, and imagine if the code for those notebooks are in two separate parts of the tree. Maybe you have a nice separation of the different parts of the project. Regardless, now you have to have one common function that knows about both and handles their window creations.

The problem gets far worse for applications separated into different libraries, or those using widget utility libraries. Two separate libraries both providing a notebook with drag-and-drop with their own window creation won’t be able to set up a hook. They would require that the main application handle determining the group IDs of the notebook widgets they care about and then calling the proper functions in the libraries. While doable, it’s a horrible burden on the application, and it doesn’t always work.

Of course, the whole thing completely breaks down when you’re writing a plugin with a notebook rather than an application. The plugin won’t be able to offer its own window creation, due to possible conflicts with the main application and other plugins.

The solution, of course, is to have per-notebook window creation hooks. GTK+ could attempt to call one of these and then fall back to the global hook, if it exists. If calling the global hook, GTK+ could spit out a warning informing the user that the program should be upgraded to the new API and that the existing method is deprecated.

Rather than functions, though, a signal handler may make more sense. It could use a collector and call the handlers until it finds one that returns a GtkNotebook. I could see this being useful if a widget component library (as part of a larger project) provides a default window creation handler that the calling application wants to override for a specific case.

Numeric group IDs lead to namespace collisions. (Bug 386930)

Right now, in order to indicate which notebooks are compatible for drag-and-drop operations, each GtkNotebook gets a group ID. This is an unsigned integer with absolutely no rules on how an ID should be picked. This is very dangerous, as it could cause namespace collisions in larger applications, resulting in tabs being droppable onto incompatible notebooks. This could easily crash such applications.

There’s no reason for us to be using integers. Take a look at GtkRadioButton. They also have groups, but they work a bit differently. The first GtkRadioButton defines the group, and the rest get passed that as the group identifier. In gtkmm, you actually have a Gtk::RadioButtonGroup object that you simply instantiate and then pass to each radio button.

Now, in any well-designed program, there should be only one place creating the notebook for a certain type of window, and usually that’s the only type of notebook capable of accepting tabs from the same class of notebook. So, why not do something like what gtkmm does and have some sort of static object that represents that group, define it once, and pass it to each notebook? This is guaranteed to be unique, and solves the namespace collision issue.

Signals need to be more clear. (Bug 386943)

You can determine if a page was added to a notebook or removed from it, but there’s no clear way of determining if it was due to an API call, or a drag-and-drop operation. We worked around it in VMware Workstation, but it would have been very helpful to know precisely that a page was added due to drag-and-drop. Same with the removed signal. I know they wanted to condense the signals and figured it would work in all cases, but it doesn’t, so please, give us some more specific signals!

Drop operations should be able to be programatically rejected. (Bug 386950)

There are times when you want to allow a tab to be draggable, but want to reject it in notebooks under certain circumstances. For example, in VMware Workstation, we have the “Home” tab. I would like to be able to drag this to empty windows, but if that window has a “Home” tab already, I want to reject the drag. To my knowledge, there is no way to do this currently.

Detaching tabs into new windows requires a drag to the desktop. (Bug 360225)

In most any program with tab drag-and-drop, you can drag a tab off into any area not in the tab bar and it will detach into a new window. With the GTK+ tab dragging, you have to actually drag it to the root desktop. Even dragging off into another window isn’t good enough. This sucks. Let’s fix this properly. We’re not doing anybody any favors.

I’m missing a few annoyances I ran into, but I’ll be blogging about them separately once I remember.

So, to recap, I believe we should:

  • Deprecate gtk_notebook_set_window_creation_hook and add a new create_window signal, returning a GtkNotebook.
  • Ditch the numeric group IDs and use some sort of identifier object or generic pointer to a static variable and pass that in instead.
  • Add new signals or something telling us specifically how the tab was added/removed.
  • Provide a way to reject a tab drop on a particular notebook programatically.
  • Call the window creation hook any time the tab is dragged off the tab portion of the notebook.

It would be great to see these things fixed so that more applications can actually use this API without major headaches. Anyone up for the task?

I plan to put up a new post soon giving a couple of tips for using the current API.

Update: Bugs have been filed for the above. They’re in the topic headers.

Random Fun Stuff

  • Welp, I’m up late tonight, as Woot.com is having a Woot-Off. These are dangerous for both my health and my wallet, but I’m determined to get a Bag of Crap this time. I don’t expect to win a 50″ HDTV or a Wii like some lucky people, but I figure it’ll be fun regardless. That is, if these USB harddrive enclosures ever sell out.
  • I ordered a DVD boxset of the entire Buffy the Vampire Slayer series, and it finally came! Not a bad price, given that Buy.com was having a sale and Google Checkout was taking $20 off on top of that.
  • I’ve been hooked on Zelda: Twilight Princess for the Wii. Best Zelda game I’ve played since the original. I think I’m about 20 hours into it right now, though I’m perhaps not as far along as I should be. Spent a lot of time just exploring the world, as one should do in a Zelda game.
  • I must buy this toy if/when it comes out. The expressions on the little people are priceless.

A Wii Surprise for Mii

Like every other self-respecting Nintendo lover out there, I tried to get a Wii on opening day, with of course no success. I was heading back home to visit family on opening day, and had researched roughly how many Wiis each store in town had in stock, but there were more people than Wiis at each store. I called up Circuit City later that day and asked when they expected another shipment in. They said they didn’t know, but after talking to the guy for a couple minutes I was told that if I came in, I could place a special order and would be notified when my Wii arrived.

I went to Circuit City and talked to the guy who handles the special orders. He seemed a bit upset that someone had told me that they were accepting special orders and was quick to tell me that they weren’t officially doing that and that my special order might be canceled at any given time. However, after a little bit of pushing, he took my credit card info and put me on the list. He said I would get a call if and when a Wii arrived that they could give me, but told me that I would likely be called and told that the special order was canceled, at which point they would refund my money.

That was Sunday the 19th. On Wednesday the 22nd, I was woken up with a call from Circuit City letting me know that they randomly received one Wii, and that it was being held for me. I was told I could pick it up at any time. Well, I wasted no time on this one. An hour later, I was setting up my brand new Wii.

The Wii is a very impressive system. The controls work far better than I had expected. I have Wii Sports and Excite Truck, with plans to pick up Elebits, Zelda, and Mario Galaxy when possible. Wii Sports is a great multiplayer game, but I must recommend stretching before play. Excite Truck is also loads of fun, though its multiplayer support could stand improvement. It’s limited to a two-player versus mode, so if you want any more players, you’re out of luck. Still, fun game, and I highly recommend it.

I invited my friends Jen, Amanda, and Dell, and my girlfriend Jamie over to play with my Wii (don’t bother with the jokes, we’ve already made them). I had them create Miis, which they loved, and we all played some Wii Sports. They had a blast and talked about how much fun the system was. Now, they’re all gamer girls to some degree, but I’m looking forward to inviting some of my non-gamer girl friends over to see what they think of the system. If Nintendo is right, they’ll hopefully be drawn to it. We shall see 🙂

Now, part of the reason I wanted a Wii so bad was to play classic games using the Wii’s Virtual Console. I added $40 in Wii points and picked up Legend of Zelda, Solomon’s Key, Bomberman 93, and Solomon’s Key. The emulation works very well. I spent most of today playing (and beating) Legend of Zelda. What’s cool is that most of the console games can be suspended and resumed later on, so if you suddenly get the urge to play something else, you simply press the Home button, play another game, and then come back to the emulated game whenever you want to.

What excites me the most isn’t the Wii itself, but what’s coming next. I can’t help but wonder what the next generation of consoles will be a few years from now, what they’ll be capable of, and how they will change gaming.

The one downside to the Wii is that when you’re sick, it’s hard to play some games (Wii Sports mainly). I’ve been dealing with a head cold for a few days, and it’s difficult to play some Wii games when you don’t feel like moving. Fortunately, there’s always the classic games.

If you know me and you have a Wii, contact me and we can exchange Wii console numbers.

Planet VMware, Planet V12n

We officially announced two new planets last night at VMware: Planet VMware and Planet V12n, both powered by Planet.

Planet VMware is a Planet for VMware employees, in the spirit of Planet GNOME and such. There are currently ten VMware bloggers on there. This will of course increase in time.

Planet V12n is designed to be the go-to source for virtualization news. Blogs and sites such as virtualization.info and Virtual Strategy Magazine are included, with news covering all things virtualization, VMware and otherwise. The VMware employee blogs are also shown alongside the virtualization blogs.

The planets are very new, so there’s a couple of bugs to work out. The Planet VMware atom feed is busted right now, but it’s a known problem and will be fixed shortly. Please let us know if there are any other glaring problems.

Castro St.

Last night for Halloween, a few of my friends and I went to Castro St. in San Francisco. This was our first time, and we heard it was a lot of fun, so we decided to see what all the fuss was about. We got a few pictures (though I don’t have them yet, but look, here’s a pic of me as a Lego character!).

The costumes were awesome. Lots of unique ideas, lots of repeats, lots of people hardly wearing anything at all. Guys making out with guys, guys making out with girls, girls making out with girls. About what you’d expect for Castro St.

What we didn’t expect, though, were the shots fired within a block of us. We didn’t hear it at the time, and just found out this morning. We started thinking about it and we realized just how close we were. I guess it’s a good thing we didn’t even know this had happened, because we would have panicked. Not sure we’re coming back next year, but at least we had fun and nobody got hurt.

Did the Internet lose something?

I think the Internet lost something.

There used to be an awesome fake guide for Final Fantasy 6 that contained lists of secret characters you could get (Mario, Link, Satan…), secret dungeons, items, etc. It was all fake, but so funny, and it was a long document. I’ve been searching now for an hour and I think it’s gone. The closest I’ve found is this, and it contains the same text as that guide for the characters listen. Does anybody remember this, and have any idea where it might be nowadays? This was such an awesome work of video game fiction that I find it hard to believe it doesn’t exist anymore.

Birthday Bash and Mario Bros

This past week was crunch time at work. People working all hours of the day and night, barely seeing their homes. And I had a lot to do, like everyone else. So what did I do? I went home to visit friends and family.

There’s a good reason, though. It was my girlfriend’s birthday, which I wouldn’t have missed for anything. I organized a little surprise party with our friends at a nice sushi restaurant. I decided to spoil her, and bought her a Black Nintendo DS Lite, Brain Age, Sonic Rush, Super Princess Peach (which she loves), and Mario Kart DS.

I did actually manage to get everything I needed done for work, though. The trick is to learn how not to sleep. I’d get up every morning, work, spend time with friends, family, and Jamie.. Go home, work, go to bed around 4, repeat. It was worth it, though.

I didn’t get to visit with my sister Jenna as much as I would have liked, but we still had fun and did our usual donut and AM/PM run. Jamie and Jenna and I did spend some time feeding the ducks, though, which was a lot of fun. It was one of those days you thoroughly enjoy. All the stress of life went away. It was just us and the ducks. Ah, new memories.

While back home, I purchased a DVD box set of the Super Mario Bros. Super Show. Clearly the best purchase I’ve ever made. My sister, who is now six years old and a Super Smash Bros. nut, saw the DVD box and begged me to let her watch it. We watched a view episodes, with her glued to the TV, and my mom asked her if she liked it. She said, “No, I don’t like it… I LOVE IT!!”

How’s that for an endorsement? And I got to enjoy old cartoons I watched at her age with her. She’ll be coming to visit in a couple of weeks and we’ll be watching some more. Now I need to introduce her to The Legend of Zelda, Captain N: The Game Master (which really needs to be on DVD), and Chip and Dale Rescue Rangers. I can pretend to be a kid again through her eyes 🙂

Scroll to Top