Feb 4 2010

CSBE API">Google Custom Search Refinements and the CSBE API

As part of my duties at Site­Point, I’m imple­ment­ing a Google Cus­tom Search Engine (Busi­ness Edition).

One of the neat fea­tures of Google’s CSE is Refine­ments. You can tag por­tions of your site — sub­di­rec­to­ries, sub­do­mains, or even sep­a­rate sites that you’ve added to your engine — with labels. You can then cre­ate refine­ments that will either boost results from these tagged regions of your site, list only results from spec­i­fied tags, or exclude cer­tain tags alto­gether from the result set.

Unfor­tu­nately the means of using these pro­gram­mat­i­cally are not so well doc­u­mented — the API doc­u­men­ta­tion doesn’t spec­ify how to include or exclude cer­tain labels (as far as I’ve been able to determine).

So! For the record, the solu­tion is to use the strings ‘more:<label>’ and ‘less:<label>’ in your query string.

Con­tinue reading


May 25 2009

What’s that Pong!?

Over the past few weeks, I’ve been work­ing on some iPhone game devel­op­ment. For a long time I’ve wanted to get back into game dev (long aban­doned after Uni­ver­sity as some­thing that I didn’t have time for) — the iPhone is prov­ing to be a fun plat­form to work with.

So here is a brief treat­ment of my first project, which for the moment goes by the moniker Dot­Slash­Pong. It’s in (work­ing, but early) pro­to­type at the moment, but I’ll tell you more about it as devel­op­ment con­tin­ues — and pro­vide a few screen­shots in about a months’ time!

Overview

Pong is an ancient videogame clas­sic. The orig­i­nal game fea­tured a few sim­ple ele­ments — two pad­dles, a ball bounc­ing between them. The object of the game was to bounce the ball off your pad­dle in such a way that your oppo­nent failed to sub­se­quently hit it. If the ball goes off your side of the screen, your oppo­nent scores a point.

Sim­ple. Laugh­ably prim­i­tive by today’s standards.

Dot­Slash­Pong takes that game­play and tears its face off. The basic game­play is the same, albeit sped up some­what to cater for the faster twitchin’ reflexes of today’s gamer on the go. The pad­dle is con­trolled by sub­tle twist­ing of the iPhone, using the accelerom­e­ters to con­vert that twist­ing motion into move­ment of the pad­dle. We add a lib­eral sprin­kling of power-​ups, some extremely shiny neon graph­ics, a theme, a sub­tle whiff of a metagame, and occa­sional com­plete break­down of the expected Pong metaphor.

Then we toss that on the iPhone, lib­er­ally apply mul­ti­player and net­work con­nec­tiv­ity in some unex­pected ways, and see what we get.

Con­tinue reading


Mar 31 2009

Free Speech != Supporting Criminals

Tonight’s cov­er­age of the inter­net cen­sor­ship debate on Insight (and the sub­se­quent chat, which was … intense — I got quite a few com­ments in, and responded to by the guests!) fea­tured a lot of the pro-​clean-​feed side argu­ing that being against the black­list, or in sup­port of free speech, is to be in sup­port of crim­i­nal behav­iour. (You can review the chat here)

This asser­tion needs to be torn to shreds. It’s a straw man argu­ment.

I/​we are directly opposed to the pro­posed inter­net cen­sor­ship for a vari­ety of reasons:

  • We hold that peo­ple should be able to make their own choices, within the frame­work of the law…
  • … but Gov­ern­ment man­dated cen­sor­ship should never be a part of the frame­work of the law
  • We under­stand that you are inno­cent of any crime, until proven guilty in a court of law
  • The abil­ity to speak freely, do research and come to a con­clu­sion are an inar­guable neces­sity of any democ­racy — no mat­ter the sub­ject, no mat­ter how odi­ous, there are legit­i­mate pur­poses for not restrict­ing access to most (if not all) con­tent (how do researchers at the ANU, hypo­thet­i­cally, study the preva­lence of ille­gal mate­r­ial if they can­not access it?)
  • The pro­posed clean feed does not block the most com­mon routes taken by crim­i­nals for dis­trib­ut­ing their rep­re­hen­si­ble mate­ri­als (p2p shar­ing, pri­vate non-​web file­shar­ing sites, email, etc.)
  • The pro­posed clean feed CANNOT block all meth­ods of access, because the world has encryp­tion; it will always be pos­si­ble to dis­trib­ute infor­ma­tion freely (regard­less of the legal­ity of that material)
  • Expe­ri­ence in Den­mark, Fin­land, South Korea and Thai­land has shown that while fil­ter­ing sys­tems may ini­tially be intended to stop ille­gal mate­r­ial, they are soon used to stop legal mate­r­ial too
  • The leak of the ACMA Black­list has shown that Aus­tralian author­i­ties are not up to the task of admin­is­ter­ing and main­tain­ing the black­list, which con­tained sev­eral erro­neous entries (and there­fore blocked legal material).

A gov­ern­ment is just a group of peo­ple, as fal­li­ble as any other. We do not trust them to make the deci­sions about what we can/can’t view on the Inter­net on a day to day basis, using tax­payer dol­lars; as cit­i­zens, we believe we have the right to self-​inform and self-​educate.

Con­tinue reading


Mar 18 2009

An Ode to Revision Control

A project I’m work­ing on had things that needed to be printed. Ini­tially, I used FPDF to gen­er­ate and out­put a PDF doc­u­ment, which was rea­son­ably pretty and very printable.

Some­where along the way, I lost my mind and re-​implemented these as HTML doc­u­ments. I don’t know what came over me. There was a rea­son for it at the time. HTML doc­u­ments are a pain in the back­side to print, most of the time — browsers usu­ally feel oblig­ated to stick head­ers and foot­ers on them with URLs and dates, and in Fire­fox at least, these are a pain to turn off.

So, the call was made to turn them back to PDFs. For most of them this wasn’t too hard, or they hadn’t been imple­mented in the first place and needed to be cre­ated from scratch in FPDF. One of them was a bit ornate, and had been a PDF before — what a pain, to have wasted all that effort!

Oh-​hoh! But I use sub­ver­sion. My effort was not wasted. Revert to revi­sion 190, code recov­ered. Bam! I love you, Subversion.

If you’re the tech­no­log­i­cal soft­ware devel­oper type, you might be won­der­ing now why I’m not using git or bazaar or the like — one of the new dis­trib­uted RCS tools. Quite hon­estly, they’re overkill for me — I have at most 2–3 other peo­ple work­ing on my projects, they’re not open source projects that the world will see, so there’s really no point to set­ting up a new RCS when Sub­ver­sion does the trick.

The rest of you are already smil­ing and nod­ding at the crazy computer-​man. :D


Dec 1 2008

Clean Feed slammed by Children’s Welfare Groups

Via the Syd­ney Morn­ing Herald:

Sup­port for the Government’s plan to cen­sor the inter­net has hit rock bot­tom, with even some children’s wel­fare groups now say­ing that that the manda­tory fil­ters, aimed squarely at pro­tect­ing kids, are inef­fec­tive and a waste of money.”

When the peo­ple whose job it is to think of the chil­dren are telling you that your plan to save the chil­dren is wrong and stu­pid, it’s seri­ously time to give it up.


Nov 21 2008

Give up, use tables

[Oops! Meant to post this last week. Ah well.]

A link sent to me by klepas: http://​give​u​pan​duseta​bles​.com/.

There really does come a point, when you’re try­ing to put a site together, at which all the fuss­ing and prod­ding you’re doing to CSS becomes irri­tat­ing beyond belief. You get it work­ing in one browser, only to dis­cover that another imple­ments the box model slightly dif­fer­ently or doesn’t quite like to float things the way the stan­dard says.

It’s dis­heart­en­ing that the web has become such a big part of our lives, and we still can’t get the lay­out of things right. Joel Spol­sky explains why it’s such a prob­lem, sort of, in his arti­cle Mar­t­ian Head­sets.

Spol­sky argues that there’s no ‘stan­dard imple­men­ta­tion’ for web devel­op­ers to test against, and that specs are really hard to read (no argu­ment there). I think he’s got the prob­lem around the wrong way though; the prob­lem isn’t web devs test­ing against a stan­dard imple­men­ta­tion, the prob­lem is browsers han­dling the stan­dards incor­rectly — and we do have a ref­er­ence imple­men­ta­tion for browser devel­op­ers to work against! The ACID2 tests from the Web Stan­dards Project.

How­ever you look at it, some­times it’s just eas­ier to give up and use tables. Even if it is a dirty, dirty thing to do.


Nov 13 2008

Only proof against Internet Rabbits…

While I was doing some research for my last dia­tribe, I came across a few heartening/​interesting links:

http://​defend​ingscoundrels​.com/​2​0​0​8​/​1​0​/​c​a​n​-​l​a​b​o​r​-​i​m​p​l​e​m​e​n​t​-​c​l​e​a​n​-​f​e​e​d​.​h​tml — Via Elec­tron­ics Fron­tiers Aus­tralia, Dale Clap­per­ton out­lines legal rea­sons why the Fence won’t stand. His whole blog is worth a look.

http://www.australianit.news.com.au/story/0,27574,24641171–15306,00.html — Con­roy cop­ping flak on Tues­day for being vague about the plan.

I’ll keep post­ing such fun things as I find them. Down with censorship!


Nov 13 2008

But there’s no rabbits in the Internet?

Urgh.

Sen­a­tor Conroy’s Inter­net Rab­bit Fence (apt name?) is bring­ing up a few nasty issues in my mind when it comes to pol­i­tics. We’ll take it as given that the idea is fun­da­men­tally stu­pid on a tech­ni­cal level — bet­ter net­work types than I have pointed out the flaws.

All this stress­ing about what peo­ple are see­ing on the Inter­net though, that’s a symp­tom of some­thing deeper, and far more insidious.

A bit of a recap, for those who missed the issue: the gov­ern­ment wants to set up a fil­ter on all inbound and out­bound inter­net con­nec­tions in the coun­try (essen­tially). This would pre­vent access to mate­r­ial deemed ille­gal by any­one, and option­ally, pre­vent access to mate­r­ial deemed ‘objec­tion­able’ (unless you opt out of that fil­ter­ing list). So no more access to the Anarchist’s Cook­book for us.

Unfor­tu­nately, what con­sti­tutes ‘objec­tion­able’ mate­r­ial has yet to be read­ily explained, so we’re not exactly sure what else we’ll lose access to, either.

Sen­a­tor Conroy’s own web­site has a choice quote:

The inter­net is a won­der­ful tool that is deliv­er­ing ben­e­fits to increas­ing num­bers of Aus­tralian fam­i­lies but the Gov­ern­ment wants to find ways to make it safer, par­tic­u­larly for chil­dren. This report will assist the Gov­ern­ment to deliver on its elec­tion com­mit­ment to cre­ate a safer online envi­ron­ment,” Sen­a­tor Con­roy said.

(DBCDE Minister’s Web­site, accessed 13 Novem­ber 2008)

It’s that tired old “won’t some­body think of the chil­dren!?” line. The Inter­net does make it eas­ier for every­one to access infor­ma­tion of all sorts, it’s true, and some of that infor­ma­tion could be called ‘unde­sir­able’, at best. I cer­tainly can’t argue that young and devel­op­ing minds should be shielded from some mate­r­ial, or at least guided through any inter­ac­tion with it by some­one of sound mind and good sense.

How­ever — that’s the respon­si­bil­ity of par­ents and fam­i­lies, not the state. The Inter­net does not fly into liv­ing rooms by magic; data of an unde­sir­able nature must be actively sought out. Gone are the days of porn pop-​ups on major sites and search results that con­tain links to smut — you have to go look­ing for the bad stuff.

There are con­sent­ing adults in Aus­tralia who like smut. My gen­er­a­tion par­tic­u­larly seem quite com­fort­able with the idea of pornog­ra­phy (eth­i­cal issues aside, that’s a dis­cus­sion for another day). We are vot­ing, tax-​paying adults, many of us of sound mind and good sense. If we say we want smut, then by crikey, smut we shall have.

This fil­ter, as pro­posed, allows some­one in the gov­ern­ment — I’m not quite clear whom, yet — to cre­ate a black­list of sites that none of us can see. Bet­ter yet, we don’t get to see what that list of sites is; we’re expected to sit qui­etly by and let the gov­ern­ment make those deci­sions for us. So far, I see no abil­ity for any­one to object to what goes on that black­list, there’s no way to opt out of it entirely, and no means by which to chal­lenge those decisions.

Any time some­one in gov­ern­ment starts talk­ing about mak­ing these kinds of deci­sions for you, it’s time to get angry. We’re a nation of adults. Most of us are edu­cated (to some degree or another), at least loosely aware of what we object to, and what we find acceptable.

WE CAN MAKE UP OUR OWN DAMN MINDS.

I’m all for pro­tect­ing the chil­dren; let’s do that. How­ever, let us do that in a way that does not restrict access for every consenting-​age adult in the land; make the sys­tem opt-​in for par­ents and fam­i­lies who are con­cerned, and leave the rest of us the hell alone.

It’s a slip­pery slope from ‘objec­tion­able on moral grounds’ to ‘objec­tion­able because it crit­i­cises the gov­ern­ment’. This gov­ern­ment may, indeed, be well-​intentioned. They might not want to use the Rab­bit Fence in a way that restricts access to legit­i­mate infor­ma­tion. What about the next gov­ern­ment? The one after? Once the infra­struc­ture is in place, it’s just a mat­ter of time.

This one needs to be fought, and fought hard, by every legal means. I urge you all to talk about this issue, dis­cuss it, get the word out, and let your rep­re­sen­ta­tives in gov­ern­ment know that it’s not going to fly — it’s a waste of tax­payer money, and worse, it’s a ridicu­lous assault on our civil liberties.


Have a high premium? Then look for the best automobile insurance deals online. | bad credit cash advance