Malicious enjoyment derived from observing someone else’s misfortune
 

Yet another place I can’t leave a comment

You probably already know what this post is about. Why are people so eager to funnel everything they do online through Facebook’s webservers? Can’t we just comment anonymously anymore?



Does anyone else’s Google look like this?

Here’s an interesting results page I got today. I think they’re rolling out some new theming.

UPDATE: Thanks to Chris – it was apparently due to signing up to be notified when Google Plus launches, since apparently I’m still not activated there yet…


Contests that require Facebook/Twitter or How Facebook excludes the poor from its API

OK, this is getting old. Today I received an email from Amazon about a “contest” to win a digital camera. I read it, and it sounded interesting, so I clicked the link in the email and arrived at .. Facebook.

The contest rules are simple – “Like” the contest on Facebook for a chance to win. That way, they can bombard your Facebook account with advertising until the end of time, and learn lots of personal details about you. As someone who doesn’t have Facebook or Twitter (I use identi.ca – isn’t that good enough?), I’m actually a bit annoyed that these choices completely limit my entrance into contests (or anything for that matter). This also applies to websites that only allow logins with Facebook Connect. I haven’t encountered one of these yet, luckily, but I have encountered quite a few that allow Facebook Connect and not OpenID, which is an older and better system.

The real issue isn’t contests or logins, though. This tit-for-tat companies are doing for “friending” them or “tweeting” about them makes business sense, and legitimately makes them more money. Yet, participating in all of this basically makes you a living commercial, posting a Bounty ad between your deep emo thoughts on twitter. Is that how you want the internet to be? More emo blogginess after these messages from my sponsor? It’s already happened to basically every video online – content has ceased to be free. A small portion of us wish for an internet like it was a few years ago, when YouTube didn’t have Mormon ads in videos (and if it did, you could block them because they were text).

I think there should be some sort of benefit for people who won’t sell out to internet advertising campaigns. Right now, the only benefit is pride. It’s hard to prove that you never sign into Facebook, but it’s easy to prove you never tweet advertisements. The only way I can think of to counter this trend is to have a large number of sites post some javascript/flash that scans for a logged-in facebook user, and take some action if it finds one. This action could be replacing all content with advertising, just logging the event for future use, redirect them to facebook, etc. Even if a small percentage of sites did this, surfing the internet without logging out of Facebook first would be quite annoying.

I just looked into using the Facebook Javascript API to do this, and it looks like you (surprise!) need a Facebook account to use it, since you need to register your “app” and request an API key. Time to abuse my wife’s account! Oh wait!

OK, this is seriously stupid. To use an API, I have to give Facebook my credit card or mobile phone number? How exclusionary! We wouldn’t want any financially responsible poor people to be able to use our API, now would we? What a terrible thing to do. It’s not even worth it. I give up. Delete your Facebook account now.


Hiking at Dolly Sods

We’ve went camping at Dolly Sods on Friday. Dolly Sods is in West Virginia. It was fun. We’re back now, safely.


mkvmerge + mplayer Sadness Fix

I have been having some issues with newer versions of mkvmerge creating files that make mplayer cry. I finally messed around with the options enough to discover what (I think) was the problem. Header compression reduces filesizes of attachments significantly, but there are some compatibility problems with the files that have this option enabled. Here’s what I finally ended up with:

mkvmerge -o video.mkv --default-language eng \
  --compression -1:none --default-duration 0:41.708ms \
  --nalu-size-length 0:4 -A video.264 --compression -1:none \
   audio.dts subs.srt

Note that this doesn’t set the output language for the audio and subtitle tracks, but there’s only one of each, so I don’t really care. The key point is since this is an elementary h264 stream, I have to set the default-duration and nalu-size-length options manually, since they’re not encoded into the file. This default-duration corresponds to a 23.976fps frame rate, so you have to convert according to your source.

Really, the header compression option should be disabled by default; I have no idea why it’s on. It does save about 30MB of space in the output file, but that’s moot if it ruins compatibility.


LXPanel Plugins: Simplified

I started using LXDE last night, and I’m really liking it. It seems to take a whole ton less memory than Gnome did, and as a result my Intel Atom box runs a lot smoother because it doesn’t have to continuously swap. Anyway, I’ve been customizing some things, and I eventually found myself in plugin development land.

LXPanel is the gnome-panel equivalent for LXDE. There doesn’t seem to be a Trash can plugin for it, and I think that’s just sad. So, I decided to learn how these plugins are coded and make one of my own. I’m not sure if I’ll end up succeeding, but at least it will be a learning experience either way.

I found this page, which outlines a simple plugin that doesn’t do anything. It seems to be a good starting point. I followed the directions and ended up looking at an autoconf project that required a lot of work to get running in Ubuntu. Even though I finally got it to compile, I decided it took way to long to do so. I converted it to a scons project, and now it’s just one directory with a simple build script:

The shared object that’s output is exactly the same size as the one created by autoconf, so that’s good enough for me at the moment. Time to keep hammering away. The code for the example is available here for reuse.


Maryland Traffic Court: My story and some tips

So, I got a ticket for turning right from a lane with a green light when there was a red arrow in the adjacent lane. The penalty was $140 and 2 points on my license. Since I only work part-time now, I decided to see what traffic court is like. I had my hearing today, and it was very different from what I expected.

If you are the first catch of the day (scheduled for 8:30 AM), you all show up about 30 minutes early, and sit around outside the court room. The court room finally opens at about 9AM, and everyone goes in (my group was about 30 people). There are some officers that show up as well, and they have their own special assigned seating. Then, you sit around and wait until the judge decides to show up – in our case, he walked in at 9:27AM.

He explains the rules and gets to work. The first cases he dealt with were those where the defendant had requested a trial (not a plea guilty hearing, which is an option they added last year). Names were called, and people came up. If no officer was present, the case was immediately dismissed and that person got to sit down. If the officer did show up, there was a quick statement by the officer (about 2 minutes) and a quick statement by the defendant. In the cases I saw today, even when the officer was present, the penalties were generally reduced. So, this seems like the way to go if you want to contest a ticket.

I had elected to do the other option, plead guilty and have a hearing. This puts you in the second batch of people, so once all the trials are done, these start. Almost all of these carried reduced or waived points, and almost always reduced fines. Yet, there was a $33 court fee, so if your fine wasn’t reduced enough, you could have paid more. Anyway, I managed to get mine reduced from $140 and 2 points to $100 and 0 points given my clean driving record and my explanation of the circumstances. So, $133 later, I was finished and I drove home.

Out of all the testimonies I saw today, even the really bad ones had their penalties reduced.

Tip 1: Make sure to pay your parking meter for at least 2 hours. The judge can apparently take his sweet time, and even though you show up at 8:30, you’re actually scheduled for 9:00. You could also arrive just before, but that might be bad planning. Parking at Montgomery County District Court is right across the street, and it’s cheap – like $0.75 an hour.

Tip 2: Don’t over-prepare. I made color copies, wrote a few pages of text, etc. This probably will not help you – I didn’t use any of this – my case was decided in less than 1 minute. I’m sure you can press the issue if you want, but at the risk of upsetting the judge by making him work longer. He has the power to increase your fine to up to $500 if he wants. Just go in there, say your piece, and be done.

Tip 3: You probably don’t need to dress up, but it might be a good idea. Don’t go in there looking like a slob, but if you just wear something nice, it seems like it doesn’t matter. I wore a full suit and tie, and I don’t think he was any more generous to me than to anyone else wearing sweat pants and a shirt.

Tip 4: Don’t be nervous. Generally, if your judge is lenient, you’ll get your penalties reduced. It’s not a formal affair – just go up there like you’re on Judge Judy and talk. If you want to know if your judge is cool, ask the police officers on the bench. They generally know who’s a hardass and who’s not. This can influence how you present your case.

Tip 5: Have cash. All fines are due right after your hearing is over, and they charge you extra for debit and credit cards. Luckily, I had $133 in my wallet.

Tip 6: You can leave as soon as they hand you a piece of paper. After you’re sentenced, you get a paper. Take it and go.

Tip 7: This is the most important thing: Make sure to request a trial rather than a guilty hearing. There is no reason why you shouldn’t unless you’re really afraid of seeing the officer(s) that ticketed you, and the only reason you’d be afraid of that is if you were going to lie. If the officer doesn’t show, you walk away scot-free. If he does, just plead guilty and it’s basically the same as the other option, except you get out faster because you go first.

All in all, it’s a thing to be avoided, but there’s almost no reason you shouldn’t go contest a ticket in Maryland.


AVR LCD Namebadge

I finished my conference namebadge tonight. I’ll post a video pretty soon. Here’s some pictures:

Done and working!CloseupCloseupLCD pins in the boardBreadboard workingDarker finalPower SupplyGetting ready to solder


Learn from my AVR mistakes

I’m learning a lot programming in AVR C.  There’s are a few subtleties to watch out for, and some of them have had me banging my head against the wall for days.  This post is an attempt to prevent anyone else playing with AVR outside of AVR Studio (I’m using Linux and the command line) from having the same issues.

Sections for avr-objcopy

When you compile an AVR C program, you get object code, which you have to convert into HEX format to flash onto the chip.  You do this using avr-objcopy, and there are apparently several valid ways of doing it.  I recommend learning about what the -j and -R flags are doing when you come across tutorials with this command in them.  I was using one from a tutorial that looked like this:

avr-objcopy -j .text -O ihex some.o some.hex

That’s all fine and dandy except it only works for programs that don’t end up using the .data section of the object code! Now, this wouldn’t be a big deal if there were any warnings about this, but there aren’t – you just have to know to add a -j .data. A better solution, posted here by clawson, is to use the -R flag to remove parts you know you do not want. Here’s my current strategy:

avr-objcopy -R .fuse -R .lock -R .eeprom some.o some.hex

This fixed 2 separate problems when I did it, one with struct initialization and one with my LCD displaying block characters for strings but working for single characters.


LCDiesel: Yet another AVR HD44780 LCD library

I created an HD44780 LCD library for the AVR architecture today. There were a ton already, and mine is based off of one by Peter Fleury. I added a couple cool little features, and decided it needed to be on github to allow people to improve it and access it easier.

LCDiesel on Github

Here’s a quick code example using the library:

#include <avr/io.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include "lcd.h"

// Include the chars we want
#define CHAR_USE_OPEN_RECTANGLE
#define CHAR_USE_HEART
#include "chars.h"

int main(void)
{
    /* initialize display, cursor off */
    lcd_init(LCD_DISP_ON);
    lcd_command(LCD_FUNCTION_4BIT_2LINES );
    lcd_clrscr();

    // Testing if x,y are set wrong
    lcd_gotoxy(3, 1);

    // Load character
    lcd_custom_char_p(0x00, _char_open_rectangle);
    lcd_custom_char_p(0x01, _char_heart);

    // We better still be at 3, 1
    lcd_putc(0);
    lcd_putc(1);
    lcd_putc(255);

    for(;;);
}

See how easy it is to define custom characters? Cool, huh? I think so. The heart and rectangle bit vectors are in chars.h, and are only compiled in when they are defined, keeping code size down. Here’s how I have it hooked up on the breadboard (and the output of the program above):

Wiring