I recently implemented the Bugzilla Reports extension at work for MediaWiki. We use MediaWiki to outline release notes and other documentation, and we include in those notes a list of related bugs that were resolved and closed. With so much manual work to write out the bugs and link to them, it made more sense to include this extension so displaying those bugs is just a simple query. But what I also noticed is that our list of bugs can be quite long depending on the size and nature of the release notes. It would be great if we could hide sections so in the event the bugs section was too huge, you can easily hide/show it. Enter jQuery!

I won’t go into the specifics of setting up jQuery on MediaWiki, but you can find a decent summary of the steps here. Once you have that working, you’ll need to do the following:

  • For the skin you are using, edit the ** //skins/.php** file
    • After the </body> tag and after your script tags for including jQuery, add the following: </ul>
    $(":header>span.mw-headline").click( function() {
        var $start = $(":header").index($(this).parent());
        var $end   = $start + 1;
    And that&#8217;s it! The reason we look for the span with a class of &#8220;mw-headline&#8221; is because of the &#8220;Edit&#8221; section buttons. If we look for just the header, you&#8217;ll wind up catching the Edit button and if you try to click the Edit link you&#8217;ll actually toggle the section instead. This is also why we we get the index of *$(this).parent()*. Since we clicked on an element inside the header, we don&#8217;t want to use the index of that element otherwise it won&#8217;t toggle everything correctly. 
    Props to <a href="https://www.mail-archive.com/jquery-en@googlegroups.com/msg40033.html" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'https://www.mail-archive.com/jquery-en@googlegroups.com/msg40033.html', 'Andi']);" >Andi</a> for some example code. Made it easy to tweak it a little to get the Edit button working again.

CarolinaCon starts tomorrow evening. If you happen to be around the Raleigh area, I highly recommend coming and enjoying some of the talks that are lined up. You can’t beat three days of great talks, networking, and rocking out for $20. As I did last year, I’m still tweaking my talk. It’s ready to rock as is, but I tend to fuss over this type of stuff and I want to make sure I include as much information as I can without going over my time slot, and making time for questions during/after the talk.

After my talk is done, I’ll be posting the presentation for anyone to download if they can’t make it. If you do get a chance to go, find me and say hi!

Devotion To Duty

I’ve been asked many times how one might get some logging information when doing work on an Android phone. The answer has always been, and always will be “use logcat.” Just to be clear, logcat isn’t just some easy way do something like `cat /var/log/syslog`. It’s actually quite powerful. I always recommend having a terminal open and running logcat whenever you’re doing something on your phone or your emulator. It helps tracking down little nasties, and is a huge help when reporting bugs.

I’d write more on this, but Google has done an excellent job with the documentation. The only thing I would stress is getting very familiar with filtering log output. It will save you a lot of time if you know exactly what you’re looking for. Another tip that’s hidden at the bottom of the documentation is that by default, stdout and stderr are redirected to /dev/null. You can redirect them for visibility in logcat by doing the following:

$ adb shell stop
$ adb shell setprop log.redirect-stdio true
$ adb shell start

You can also set this by default in /data/local.prop.

What an eventful con this turned out to be…

Once we got checked in, we decided to head down to the bar area and hang out (as most con attendees hang there off-hours). We saw a bunch of people we knew almost instantly. It was great seeing them all again. GM1 hooked me up with a sample of some new music he’s working on, which is amazing stuff. We met Michelle G. at the bar, who hadn’t been to ShmooCon before. Turned out she was there with one of the vendors. We sort of took her under our wing for the weekend, gave her the scoop on the con, and hung out quite a bit. It’s always great meeting new people! We wound up hanging at the bar until almost 2am. I wound up sleeping on the floor in Tyler’s room with no blankets. It resulted in about zero sleep.

The next day was a whirlwind of working the con, seeing vendor setups, getting free shwag, donating to charities, meeting up with friends, and getting food. Both of my shirts sold out on Friday which was great. It was really awesome seeing so many people walking around with my designs. Of course it was even more exciting knowing money went to charities for each one that sold! Then of course the weather changed. We dubbed it the Snowpocalypse. It was crazy amounts of snow. After we were done for the day, we all went down to hang at the bar again. I found out that Freshman’s girl (also named Michelle) grew up one town away from me. We also found out that I know all of her hand-gestures and what they mean. We spent the rest of the night with Michelle G, Freshmen, Michelle, and the RIT crew reminiscing about our college days. Evidently we had a crazy college experience while at RIT. After a quick snowball fight at 1am, I think we turned in around 2am (catching a theme here).

Saturday was wonderful. It started out with one of the ceiling windows shattering and it snowing in the hotel. That aside, we had a great day at the con. Our Hack or Halo competition went extremely well. The Halo competition ended ahead of schedule, and the same person from last year won it this year. Michelle G. wound up hanging with us and helped out with the Hack portion. We all had a blasty-blast together during HoH. After the competition was over, we made haste to get ready to go to the con party. While walking down the middle of the streets due to the lack of cars being able to drive on them, we saw a biker lift his bike over his head in frustration and throw it into a snowbank. We got to the club and had a few drinks before going next door to this other place we had. Evidently not a lot of people knew about it, but that was great because the people who were there were fun, had some great conversations, it wasn’t crowded so moving around and dancing was easy, and was overall just a pleasant experience. A lot of pictures were taken, and I need to track them down. It was very cold on the way back, and I think we wound up getting to sleep around 4am.

Sunday morning it was hard to get going. We had a lot to do to wrap up the conference. I had an early meeting, then attended Tyler’s Mobile Security and Blackberry Spyware talk (which was totally awesome). After doing some security and catching one last talk, we ended the conference and all was well. Unfortunately with all of the snow, flights were cancelled, no buses or trains were going, and driving was hazardous. So Tyler wound up extending his room for an extra night. The hotel upgraded him to a pimp suite which was great. So we had a get-together Sunday night for the Superbowl, and to hang in general. We played some cards, had some food, and people kept showing up. Michelle G, wxs, and myself went downstairs for some food and to chat for a while, and came back to someone playing guitar! Sweet! Again, a late night, and we all crashed around 3am.

We got up this morning, and pretty much ate and bolted. The roads were a freaking mess trying to drive out of DC. Once we hit Virginia it wasn’t too bad. But the ride felt a lot longer. I think being so drained from the con made the difference. But at least we made it home safely. I have one less day than I was expecting to prep for the move this Thursday. Hopefully I can make up for lost time tomorrow and Wednesday.

So yea, a great weekend, and one of the best ShmooCon’s I think we’ve had. To all of you who didn’t get to come due to the Snowpocalypse, we missed you and wished you were there. To those that were stranded (and those who are still stranded) at the hotel, safe travels home. To our new friends, thank you for everything! And to everyone who was at the con, we’ll see you next year!