Saturday, July 17, 2010

Decapus - 10 legged power supply



Having built guitar effects pedals for the last 10 years, I've progressed from battery power to requiring a power splitter for a decently powered DC adapter.

The overall plan is to put the power supply on the underside of the pedalboard, so I needed about 10 outputs and four to be longer than others.



It's a very simple design, but it really needs to work reliably and a minimum parts count was desireable.



So it's not that pretty, but it's rugged enough to sit on the bottom of the pedalboard without to any dramas.

Friday, July 16, 2010

Codility

I was reading a blog concerning how to hire new programmers. According to this blog, one of the classic mistakes some recruiters make is that they don't get the propsective candidate to write any code during the interview. This seems a bit odd, but I guess in some small companies they may not have the competence to select their first programmer. This blog mentioned Codility, a way to test a candidate's programming skills.

I headed over and liked the design and thought I'd take the demo test. I recommend you give it a go and come back after that.

It was a neat and easy to understand interface. I selected C as it's my weapon of choice for everything except for applications that need extensive string handling (in which case the String class makes bothering with Java worthwhile).

They had a fair problem and a suboptimal solution as a framework. After coding my most intuitive solution (for those who tried the demo, getting the righthand side total then:

for(i=0;i<n;i++){
rsum -= arr[i];
if (lsum == rsum) return i;
lsum += arr[i]; }


To avoid arithmetic overflow, the array consists of doubles to be on the safe side. I overlooked this the first time in.

Anyway, in the 30mins I got it except for the overflow, which I went back and checked that it worked. I wish there were a few more tests like this as work doesn't exercise all my c muscles :) Props to Codility hopefully a thing of the future.