Sunday, December 23, 2007

Wasting my time

Well, today we had our first real attempt to abuse the system, fake accounts and all. it's bizarre, people don't seem to realise it's a closed system - no matter what you do we can follow the credits, there is no way to "launder" them in Entrecard, no matter what tricks you pull it's a matter of a few clicks in the admin system to remove all the ads you bought, lock/delete your account, penalise you credits or whatever.

In this case the optimistic abuser thought that perhaps by sending credits to another account using the coupon system that he'd be able to avoid detection. it's pointless, we know exactly where they came from and where they went and all you do is end up with no credits, no ads and a locked account.

Instead, all he really did was waste time I could have spent writing actual features that would have helped him, and everyone else, actually get some value. Makes no sense.

In other news, another user decided to publish their own idea of how to bypass the Entrecard drop security system. The post was thinly washed over with "I hope they don't penalise me" as if it wasn't common sense not to post that kind of stuff. Really bizarre. If you wanna contribute materially to the security of Entrecard, then send us private feedback. We're ok with you taking credit, but only if you post about it *after* we've had a reasonable chance to fix it. If you just go off and post straight off, you go straight into the system abuse category, and we hit the penalty button - what other option do we have?

Labels: ,

Thursday, December 20, 2007

A day in the life off..

..an Entrecard programmer.

This post inspired by this forum thread

Ok, I'm going to outline todayish (it isn't even finished yet), but it's not my typical day, honestly, my life is crazy but not quite this crazy.

Ok, we'll start at 00:00...erm, ok, I'm still awake at 00:00, busy coding the latest Entrecard feature. I'm really excited about it but there are just so many small bits and pieces to cover with it. Wait, I'm getting ahead of myself. Welcome to December. In december, every year, the following 2 things happen:

1. Every single one of my clients, plus a couple of new ones, suddenly realise that they need something done urgently.
2. Every single year, I forget that this is the case.

So what happens is that by the end of November I have my December all nicely planned out, there will be holidays, a few decent projects, everything just so.

By Dec 2nd, things are going downhill rapidly. Emergency stuff is turning up like crazy and my regular project work is getting pushed back or squeezed.

So, back to my day, I spend the next few hours, until around 2:30am, getting the latest feature pretty much ready to go. Done with that, I can't release it at this point, it still needs a bit of layout polish plus I can't release big stuff just before I go to bed, gotta be around in case things blow up :)

So, at 2:30, I get to start on my next job, reconfiguring a netscreen router at another clients place. This rapidly descends into the usual exercise in frustration that networking stuff always is - it's much easier to debug code - but I nail the problems one by one and make some good headway on the main problem. At 4:30am I get stuck, I'm trying to manage a straight-through src/dst NAT on a VPN tunnel (it's even more complex than it sounds) and the docs say "If you'd like to know more about this, see page 156". This, in a 100 page document. I fight with it for a while but eventually it hits 5am and I've gotta be up fairly early so I hit the sack and stare at the ceiling for a bit while my brain winds down.

At 9:08am I stagger out of bed, have a shower, check a few things on the computer, and then walk across town to my dentist, where they give me some anesthetic and then drill out the center of my tooth (it's called a Root Canal). it didn't hurt, bu t at one point the dentist accidentally let the "long thin file" she was using into my line of sight. Nothing like knowing your dentist is cleaning the *inside* of your tooth with what is basically a small ice-pick.

11:45am, $350 poorer, with a numb mouth and 2 more sessions to go, I wander back out onto the street and off home. Most of the walk passes in a daze, I stop to pick up some yogurt because I know from experience it's great post-dentist food. I then get woken from my daze by loud horn blaring. Slight diversion: you may or may not be aware that Japan likes to hunt down and kill whales. By "likes" I mean, they appear to have no regard for what the rest of the world thinks about it, they'll do anything, including the laughably thin-veiled cover of "science", to hunt and kill whales. It's really weird, the Japanese I know seem like nice people, I'm not certain how a bunch of nice people end up living in a nation that does that.

Anyway, New Zealanders really like whales, and they get quite upset about this time of year every year then the whaling boats go out once again and the inevitable greenpeace stand-offs etc. Anyway, there were a bunch of girls standing on the sidewalk with huge signs saying "HONK FOR WHALES". Needless to say, in NZ, this basically resulted in infinite amounts of honking. I'm sure the people working in the offices above were delighted.

I finally made it home, sat down, ate some yogurt, and then got down to trying to get the latest feature stuff out for Entrecard. This is the ideal time to do it because all the hard thikning had already been done "last night", so all I really needed to do was clean up some styles and push it out to the live platform. A few hiccups later (big upgrades invariably lead to some problems, especially when you're releasing as fast and furious as Entrecard does) and it was all live. I went and bought myself a featured status, and emailed a friend who helps out quite a bit with Entrecard debugging to get him to get one too. Fixed a bug he hit immediately, and we're away.

All during this I'm also managing about 3 conversations with clients via IM, which can be occasionally distracting. Oh, and I've run out of yogurt, and my tooth hurts.

Now I'm thinking I should write something about the new feature, but in fact I don't want to. One of the things I quite like doing is letting people discover new stuff themselves. Yes Graham will do a post about it soon enough no doubt, but initially I like to reward people who are active and paying attention. In this case, that could be quite a big win but since I didn't add a button to the top bar nobody seems to have noticed it yet - probably just as well :)

Anyway, so, no big announcement, but I did wanna write something, and then I remembered the writing thing we were going to do that people have been talking about on the forums, so I figured why not and jumped into it. That brings us pretty much up to date.

From here, I've got more client work to do, some bug fixing and new features from a release the other day. I need to go pick up some Goon Show episodes from a friend so I can take them on holiday, I need to go renew our video hire of "Bones" (I love her office. I love it. It's just..awesome) which we'll probably watch some of later tonight, I have to work out whether I'm willing to take the risk of playing Twilight soccer with my tooth the way it is, then more work later in the evening trying to get the rest of that router config stuff working.

yeah. they don't call it the Silly Season for nothing. Bring on the holidays!

Labels:

Wednesday, December 12, 2007

What is a futex and why does Phi hate it?

A futex is a mechanism for dealing with resource contention and synchronisation between (semi)independent threads or processes. It is used to build locks and various other tools for managing threads.

What? didn't understand a word of that? no big deal. it's just a coding concept that means hundreds of different user requests can all access the database at the same time without getting in each others way.

I hate it, because right now, I'm having real trouble with one on Entrecard. The problem is simply a situation called a "deadlock". Imagine the following scenario (simplification):

Piece of code A uses Lock 1, then Lock 2
Piece of code B uses Lock 2, then Lock 1

These will always work, except in the instance when A and B initiate at precisely the same time. When this occurs, code A gets Lock 1, but can't get Lock 2, and code B gets Lock 2, but can't get Lock 1. As a result both of them sit there waiting for the other, and neither of them will release their lock. Immediate result: horrible nasty application hang.

The evil bit is that you'll never notice this scenario when you're developing your application, because a single user almost never triggers this kind of event. Nor are you likely to notice it when your application has a low volume of users, for the same reason. It appears out of nowhere just when you have a bunch of users, and just when you really really don't want things like horrible nasty application hangs.

I have one of these somewhere. The problem is not fixing it, the problem is finding it. Entrecard is a lot of code, with a very high level of abstraction, and the nature of a deadlock makes it very difficult to debug after it has happened in a complex environment. Worse, it happens totally randomly, so I'm unable to narrow down where in the application it is happening. I'm confident I'll get it but HOLY CRAP is it frustrating, especially when I have to drag myself out of bed at 3am because it hung the app server and I have to restart it.

Labels: , , ,

Tuesday, December 4, 2007

Entrecard Tricks and Tips 1: Card design

Ok, this may or may not be a regular series but hey, we can hope right?

Good design itself isn't my province, I can't help you there, I'm a coder :) however I can give a few Entrecard-specific suggestions:

  • Definitely go for the 125x125 pixel image based card. The text stuff is ok, but it doesn't stand out since we only have 5 designs, so in a big card listing you get lost with all the other black + silver cards.

  • Upload your image in PNG format. For security reasons we have to re-encode all the images uploaded, and JPEG doesn't re-encode very well so you end up with some compression artifacts. PNG on the other hand should work perfectly.

  • When on display in a widget, your card will always be surrounded by a border of #444444 (dark gray), in other spaces the border can be black or white. Make sure you test against these to be sure it doesn't look weird.

  • It is possible, with a bit of work, to design a card specifically for a given advert spot. To do so, do your design (say, in pink and white for display on galadarling.com), upload it (Edit on your dashboard), and then apply to the advertiser. The design then "sticks" with them, and you can upload a new image to use as your regular card or apply at a new site without changing what will end up displaying on the first spot.

Labels: , ,

Stats, settings, bits and pieces

A fair few changes dropping on a regular basis. it's likely nobody besides me even realises how many micro-changes hit every day, I probably commit roughly 6-12 times a day to the production tree, although only a few of those result in user-visible changes.

Anyway, the latest major one to drop in yesterday was the new stats screen:



We introduced some new numbers, specifically the organic clicks, and fixed the term at 30 days - the 7 day chart was just silly. More importantly however was the explanation I added next to each chart, explaining what it is and how you can improve your numbers. I think this is something that's often missed - places provide you with piles of numbers but no good information on what you can reasonably do about them.

I've added another control to the Advert settings page, granting people control over whether they want to auto-accept previously approved entrecards. The system is pretty much flawless, in the sense that if you've approved it before, there's little reason not to again, however part of our mission is to ensure control remains in the hands of the site owner so having the switch there is important, and we defaulted it to "off" so it won't auto-accept unless you ask it to.

A few other bits and pieces around the place, fixes, nailed one of the cookie bugs which sorted the last two no-drop cases I'm aware of which is great.

In case nobody noticed, I also managed to finally stab that weird firefox rendering error to death. For those who were curious, it turns out that despite happily displaying block-level elements inside an "a href", firefox occasionally fails to render the contents properly. However, if you use span tags instead, but use CSS to change their display mode to block..it works fine. Nutty.

Labels: , ,

Sunday, December 2, 2007

Queue limits, multiple advert block

Well, when someone like ProBlogger arrives it inevitably highlights any bugs in the management of advert requests. In this case the poor guy got bombed with ad requests, including multiple requests from single users.

We hadn't really decided whether multiple ad requests were a problem before. It was one of the reasons people were rejecting ads, but at the same time it seemed managable and nobody was complaining. But 5 requests from the same person is just..a little silly.

So that's gone now, if you have an ad queued, approved or running on a given blog you can't submit further adverts. Later I hope to provide people with finer grain control of whether they accept multiple requests but for now we needed a solid solution. Feedback welcome.

In addition, we now have a "queued" limit, you can't have more than 15 entrecards queued at a time. This prevents someones mailbox getting too stuffed on their first day or if they're suddenly popular for some reason :)

I hope to make the blocks a little clearer soon - at the moment they're an error displayed if you try to advertise rather than preventing you from clicking the button in the first place.

Labels: , ,

Saturday, December 1, 2007

Recommendations, advert options

New shiny things today.

We got Recommendations, which let you post a public recommendation of another Entrecard site. The recommendations are approval-only, so they're not exactly going to paint an unbiased picture of a given blog, but at the same time they do help people get a feel for what the blog is, whether it does a good job and it lets people who like a given blog show some appreciation in a meaningful way.

That's basically why I did it anyway :)

In other news, we have the option to switch off advertising for your entrecard. When you do this (under Advert settings) your card will no longer accept adverts (the ones you have queued will continue to display as normal). The objective is to prevent people who are, say, going on holiday or otherwise too occupied to avoid ending up with a massive pending queue and then irritating everyone with a string of rejects.

Labels: ,