Lead is a pollutant and poison, and especially bad for children as their organs are still developing and less able to flush it out as adults. There's now no safe minimum for lead so controlling it as much as possible is the goal. In 1978, lead in paint was banned for residential use). As paint ages it peels and the lead dust can enter the atmosphere. My county, Alameda, offers free inspections to help homeowners contain lead.
The visit was about an hour long and consisted of a visual inspection of any painted surface. My inspector, Gabrielle, was looking for signs of age, and peeling. Fortunately, having a remodel, my house is in good shape. But knowing which areas were higher risk (older) was useful to know in case of future work.
Here are my quick notes:
Keeping a home well ventilated ("cross ventilation" - keeping windows at ends of the house open) can help ensure dust is blown out.
Soil testing should happen in areas where you're hoping to grow. Don't mix the samples, and ensure they're labelled so you can match the results back to which area.
Recycled wood is OK to use so long as it doesn't have old paint on it. Pressure treated wood is not OK for growing since it contains chemicals you wouldn't want to consume.
More lead-safe gardening tips (PDF brochure).
One benefit of learning about doing lead-safe construction and contract work is simply being on the look-out for contractors that do and don't know about it. Gabrielle sent me this handy checklist on hiring a lead-safe contractor. There's even a list of certified folks.
There are labs that will do soil testing. Again, ACLPPP has guidance on that.
When doing work with lead, cover the area at least 6' away from the work site, and ideally create a contained "room" around the area. It requires more washing than you might expect. Sanders should have a HEPA attachment to catch & filter the dust. Aim to "work wet" to clump the dust to prevent it floating around. At the end of a work session, wash clothes & shower. Don't eat during sessions - it's not just about washing hands but preventing dust from hair, clothes, etc being ingested. Lead dust can makes its way into your home from a distant job site via clothes, equipment, car seats, etc. ACLPPP do day long classes that are a combination of hands-on and theory to demonstrate all this, and even for a small ($50) fee certify you.
The body sees lead as a mineral to store (oops) so it ends up in bone. Calcium and iron help remove it (although this study suggests not, but dietary fiber and avoiding cigarette smoke help).
The conversation meandered into general home maintenance which turned out to be really useful too:
This neat doodad (Eva-Dry E333) passively dehumidifies and when it's "full" (wet) you plug it in and it dries itself out ready for another round. Lasts ten years. Another worthwhile product is DampRid.
Preventing moisture by checking exterior drainage; there's probably a couple of places I could extend water spouts, etc. Really, I need to look into water capture properly at some point (interesting pro/con cost/benefit discussion of rainwater collection in California).
The Alameda County Master Gardeners at UC Davis is an amazing resource I've used before too and is recommended by ACLPPP.
Block up holes around the house to prevent rodents making homes in walls, attics, crawlspaces, etc. Copper mesh and expanding foam are good for that. Even if you don't mind rats(!) you don't want to be the local motel... Prevention better than pesticides.
Phew! Thank you Alameda County! :)
I hear this line all the time and have wondered exactly what the mechanics of it are. So I asked, we got chatting, and I was told, in great detail.
]]> Ten months ago she was a normal kid in high school doing her A-levels, English, History, and Music. She plays piano to Grade 7 and wants to be a music teacher. She did Maths A-level as well (that's right, four A-levels; think about that the next time you're passing a homeless person) but only because she fancied the tutor.As her mother descended into drug addiction she ended up in foster care and after age 18, a legal adult, she ended up on the streets. In the last three months she's been beaten, stabbed, and a few weeks ago, raped.
Her stabbing came from a guy who sold her (without her even knowing!) while she was sat on a bench. "You have to spend 24h with that guy, I just got paid £70 so off you go, when you're done you'll get your cut". Saying "no" resulted in her cut being a stab wound in her crotch slicing both her femoral artery & vein. Thanks to a passerby who knew exactly what to do she staunched the wound and ended up in intensive care.
The rape was recent enough for me to see her thighs covered in bruises and cuts - it looked horrid. The stabbing, while healed, left a deep puncture hole in her leg.
After we first met I walked her to a hostel which is very close to where I'm living and paid her £19.70 hostel which apparently buys seven days accommodation and some entitlement to benefits (the details I don't recall in the blur of her explanation). We wandered back to my place and I offered her some food and we chatted, where I heard the whole story. The most tragic was listening to her wishing, through angry desperate tears, how she could rewind the last year.
I set her up with a Gmail account and we wrote a piano lessons ad in Gumtree. Who knows, cross fingers. If you need a smart, intelligent, able pianist, I'd suggest giving her a call.
(Originally posted on my Facebook profile)
]]>One unusual aspect of this company is that we don't encourage people to work more than four days a week, so people have three day weekends, or one-day midweek breaks. I personally believe that the 9-6, five days/week schedule is bad for creativity, if you wish to have any creativity outside of your workplace.
20% Life Project: I have been getting increasingly interested in currency trading aka forex and now actually have the risk capital to pursue it seriously; I've taken a bunch of courses and been trading with some success on demo accounts. My goal is to be profitable (by my strict standards) so I can trade while travelling this summer. We'll see... I'd love to hear from more folks doing this professionally or who can show profits on demo accounts. I have already made arrangements to stake a trader.
That said, I'm open to anything happening, as anyone who's heard the story of how I ended up in Texas knows...
Sunday 25th May 2008
18.33 - 18.39
Halfway along Grafton Street, near the clock outside Barratts: map
The Grand Central Freeze:
]]>Here's how to drive up to eight LED clusters or other high current device off a single, cheap 18-pin IC with no extra components.
It turns out someone's thought of this already and produced a handy IC that contains a bunch of these transistor circuits. The doodad in question is a €1.15 ULN2803A darlington pair array [datasheet]. Page 4 of the datasheet, figure 1a has an example circuit.
How these work: The left side of these chips are the input (pins 1-8) and the right side are the ouputs (pins 10-17). Pin 9 is the ground, pin 18 the common +V. Connect your +5V to your load, e.g. LED cluster + appropriate resistor (e.g. 20ohm for ~8 LEDs), and connect the cathode (-V) end of that circuit to an output pin. The darlington circuit acts as a sink. Here's the circuit,
From Darlington pairs driving LED clusters |
Each darlington circuit can sink 500mA (peak 600mA) and they can be wired in parallel so e.g. connecting two can drive a 1A load.
The example here is using the included Fade demo sketch with an extra write to another pin to flip one cluster one and off just to demonstrate the circuit doing two things. Note how the LED clusters have a common +V and they source separately into different outputs via the small resistors.
]]>The technique is to light row by row, and rely on our persistence of vision effect. Playing around with the delay it seemed like 3ms for a total of 15ms (five rows) was about the point where flicker just started being noticeable.
Geeky detail after the fold...
]]> The software pulls the row pins high one by one while the column pins are set low for every LED to light, sinking the current from the one high row pin. There's a 3ms delay, then the next row pin is brought high and the last one low.The data for the little animation is a 2D byte array that looks like,
byte PATTERN[][5] = { /* ... */ {B0111, B1110, B1100, B1000, B0000,}, /* ... */ };
('B' is a handy prefix for a binary number.)
You can see a diagonal band of 1's there in the early part of the wipe. Each byte's translated into pin writes by looking at the lowest bit in the byte and then shifting right and looking at the next. LOW is on.
void SetColumn(byte pattern) { for (int i = COL_COUNT-1; i >= 0; i--, pattern >>= 1) { digitalWrite(COL_PINS[i], pattern & 1 ? LOW : HIGH); } }
A "frame" of the display is completed by lighting each row in turn,
void ShowPattern(byte pattern[]) { int last_row = ROW_COUNT-1; for (int row = 0; row < ROW_COUNT; last_row = row++) { digitalWrite(ROW_PINS[row], HIGH); digitalWrite(ROW_PINS[last_row], LOW); SetColumn(pattern[row]); delay(MULTIPLEX_DELAY_MS); } }
The main loop draws each frame over and over until a certain amount of time has elapsed and then it goes onto the next one. millis() is a built-in that returns the number of milliseconds since the board was switched on. (This code would fail after about nine hours when the counter resets.)
void loop() { for (int pos = 0; pos < PATTERN_SIZE; pos++) { long start = millis(); while (millis() - start < PATTERN_DELAY_MS) { ShowPattern(PATTERN[pos]); } } }
I actually had the circuit the other way around, cycling through column-by-column and the rows programmed in turn with a line of lights. This happened out to make writing patterns awkward so I flipped the orientation which made SetColumn pretty straightforward.
The matrix could've had more lights on it but the breadboard limited width a bit. I was quite proud of the tight wiring under the LEDS.
From Multiplexed LED Matrix |
This was one of the projects where the bits that seemed like they'd be hard Just Worked and then silly things wasted time, like C mistakes with sizeof.
int ROW_PINS[] = {13, 12, 11, 10, 9}; int COL_PINS[] = {5, 4, 3, 2}; #define ROW_COUNT (sizeof(ROW_PINS)/sizeof(ROW_PINS[0])) #define COL_COUNT (sizeof(COL_PINS)/sizeof(COL_PINS[0]))
Parameterizing these kinds of things made moving from a 3x4 board to 4x5, flipping the rows & columns, and using different pins trivial. An unfortunate cargo-cult effect in Arduino and Wiring code I've seen is folks not using #define and sizeof.
Some cute enhancements might be to have an array of structs, the struct containing additionally a delay time for each frame. We could also have, rather than 0/1, a wider range of values to indicate brightness. With that, (e.g. Perl/Python scripted) code could generate the animation sequences rapidly flipping frames to give an impression of anti-alias. Unfortunately I have other things to do... (yeah, I made the animations by hand in vi and pasted into the Arduino editor :-))
And finally, a Wiring-based pair of color LED matrixes are used as toilet signs... that change throughout the night [video]. More on this funny project.
]]>The tutorials are great and introduce the important concepts with example circuits and code. In fact, the set of example code is all accessible directly from the Arduino app's main menu, which is a nice touch. (I.e. you don't have to dig around trying to open a file buried on your hard drive.)
So anyway here it is. Eleven LEDs connected to digital pins 0-10, and a 22k linear pot (variable resistor) feeding analog pin 5. The LEDs "chase" up and down with a speed taken from the pot position.
It was fairly painless, at least after an initial scare where programs wouldn't upload,
avrdude: stk500_recv(): programmer is not responding avrdude: stk500_recv(): programmer is not responding
I read all sorts of scary solutions online where folks were reprogramming their bootloaders and other horrors. One Arduino hacker mentioned running the board off an external power supply (rather than rely on USB) during programming as the current draw is apparently higher. This was enough for me to try pull the LED's ground pin out so the lights turned off: Bingo! No problem programming. It became a bit annoying pulling the ground lead out every program: next trip to Maplin I get a switch...
The other issue I had was remembering how C does casting. My function to scale the analog input into a minimum and maximum delay was being simultaneously confused by my code not casting up to a float early enough, and a persistently dodgy connection with the pot.
(The fifth pin/LED didn't seem to light very strongly. Tried different LEDs and lower resistance. Didn't fix it or figure out why it was dim; I'll try a different board soon.)
So what led me to Arduino? The brand new Science Gallery at Trinity College in Dublin is running a programme to introduce high school kids who wouldn't otherwise have had the educational opportunity to do so to learn about electronics. I'm helping out there on Wednesday afternoons, which so far has mostly involved teaching them how to solder, and debugging electronics problems. Where possible I have them learn from my mistakes: my room in my parents' house, for example, was so badly burnt from soldering iron accidents and riddled with little lumps of solder they had to replace it after I left... (I suppose one useful legacy I left was installing about two dozen plug sockets :-))
So far the kids have created some very cool LED pictures each with a fierce amount of soldering and now are ready to hook them up to Arduinos. Hence the need to stay one step ahead of the younger generation ;-)
#define LED_COUNT 11 #define DELAY_MIN 10 #define DELAY_MAX 400 #define DELAY_STEP 50 #define POT_PIN 5 #define INTERNAL_LED_PIN 13 void setup() { for (int i = 0; i < LED_COUNT; i++) { pinMode(i, OUTPUT); digitalWrite(i, LOW); } pinMode(POT_PIN, INPUT); pinMode(INTERNAL_LED_PIN, OUTPUT); } int ScaleDelay(int in) /* Calculates a delay between DELAY_{MIN,MAX} from an analogRead. */ { float d = (DELAY_MAX - DELAY_MIN) * (float)in; d = d / 1024 + DELAY_MIN; return (int)d; } void LightLED(int led_pin, int last) /* Reads a delay, lights an LED on led_pin; turns off the last one a short time later. */ { int d = ScaleDelay(analogRead(POT_PIN)); digitalWrite(led_pin, HIGH); delay(d / 10); digitalWrite(last, LOW); delay(d); } #define TAIL_LENGTH 3 int tail[TAIL_LENGTH]; int tail_pos = 0; int LastLED(int current) /* Maintains a list of lit LEDs. Returns the very last one. */ { tail[tail_pos] = current; tail_pos = (tail_pos + 1) % TAIL_LENGTH; return tail[tail_pos]; } void loop() { int last; for (int i = 0; i < LED_COUNT; ++i) { last = LastLED(i); LightLED(i, last); } digitalWrite(INTERNAL_LED_PIN, HIGH); for (int i = LED_COUNT-1; i >= 0; --i) { last = LastLED(i); LightLED(i, last); } digitalWrite(INTERNAL_LED_PIN, LOW); }]]>
So being the gadgety skinflint that I am, what follows is how to disassemble it and replace the batteries with more powerful ones...
]]>Enjoy :-)
]]>As Fortune would have it, also out kiting was Ben who very kindly let me have a crack at Samurai 5m2 monster. Here's a few pics, including it dragging me around,
(Yes, Jez, I should've looked into this when you first mentioned it a decade or so ago :-))
]]>According to my fancy Tanita scales I'm currently at 8.3% body fat. Which is pretty damn low; not quite "walking anatomy lesson" but certainly on the way. For comparison, male athletes vary between 6% and 12%; more here.
So, how did I lose 10kg? After hours of reading and assimilating scholarly nutritional texts, womens' magazines, physiologists' deepest secrets, and all the while studiously avoiding the fridge's whispered promises, I put together the following plan. My Magic Formula For Losing Weight is...
So that's basically what I did for a year.
In some future blog I'll write more detail about what I did and ate. In the meantime I will say engaging in aerobic and anaerobic exercise was key, so if you're casting about for more on weight loss there's something I wrote a long time ago, how to get, and stay, motivated.
As a final aside, to row Lightweights at Cambridge University means being not more than 72.5kg. If I were to weigh that my body fat percentage, assuming I miraculously didn't lose any muscle mass, would be 5%(!) Another reason I'm happy not to be in university...
]]>The bad news is that every morning and sometimes if I've been on my feet for hours, e.g. walking around the house cleaning, my feet ache. They overall feel weaker too. I am constantly reminded by the background pain of my mistake falling off that house. I imagine this will be with me to varying degrees the rest of my life. My main hope at this point is that it doesn't get worse; so far it's been getting better.
On a positive note, here's some examples of what I'm doing with my feet these days:
Walking. I can walk for hours now, especially with MBT shoes. Actually these shoes are a real boon for me and I'm ordering more so I'm not always wearing red... I am still limited by walking. Recently visiting Prague there were a couple of times where hours upon hours of sight-seeing took its toll and I was suffering. An excellent leg & foot massage helped dramatically though.
Hiking. Over the Easter weekend I volunteered to drive a bus around Ireland on a "4 peaks" type of challenge. The loons who were doing it cranked out four "mountains" in less than two-and-a-half days so were sleeping in the van. On the third one in Killarney I hiked with them for about three hours on the gentle early part of the slopes. That was enough although I wasn't hammered and my feet/joints didn't hurt too much later and the next day.
Running. I have had a recent pleasant surprise with running. Some background first: I never much liked running as a sport so not being able to really only impacted my being late for the occasional bus/plane/train. In the last two years I have literally run for a total of about two minutes, most of that one time in an airport. Just recently however, at work there's a timed "gym challenge" that involves a bunch of body-weight exercises (push-ups, sit-ups, etc) plus, for the Gold challenge, a 2km run. Being the competitive type this tipped me over the edge to try running again, and 2km isn't that far so I figured I'd see how it went. The first time I did it I was going at 12km/h for 10minutes. I've done it once more since at 14.2km/h (8:30). I have no intention of training any more than I have to to win this, but I know have to get at least 18km/h which is reasonably quick.
Each time I've run like this my feet ache somewhat the next day and I cannot walk around totally comfortably.
Overall if regular longer-than-sprint running is a necessary or desired (you freak! :-)) part of your life and you break your heels badly I'd say you're screwed. Find something else to do. On the other hand, it seems like despite a serious heel fracture I can run for short distances at a useful speed, and go about my life including some competitively athletic pursuits like rowing for the most part unaffected. So, considering I was so close to being paralyzed, not a bad result at all!
]]>I'm working on an application that needs to present a graph of stock prices over a given time for a list of securities. The data is missing in some cases, for example weekends, and the graph should not be discontinuous. If however the start date is Saturday there is no previous day's data in the dataset so it has to use the day (or two, or three, ...) ahead's. From the point where data appears we baxtrapolate the data to the start point.
Related: baxtrapolation (n.)
]]>(Of course, I had another bottle of JD there. Improvizing around a lack of eggs, milk, flour, ... is one thing, but to go dry on Old No. 7...)
A week after the madness that was London Santacon, Santacon arrives in Dublin! Go here for more info: Santa's on Bebo.
(I've always wanted a megaphone, and jaysus, is this thing loud. That's a "tequila belt" I'm wearing, complete with shot glasses--possibly one of the coolest and most destructive Christmas presents I've ever got [thanks Eva!]. Accompanied by Jack Daniels, and a pound of chocolates, Santa is ready!)
]]>