We are hacker from malaysia
Getting back to playing with images
Inspired by Jack Kerouac by Ritator, it reminded me of the headers that I used to build for this site. I would take one of the local news’s webcam shots and slice a full height, single px wide segment and then let that repeat for the full width of the header. Simple and effective. The thing that I though was really neat about it was that I could start to tell what the weather was like just by the colors in the image. If it was mostly grey, it was likely raining.
That’s all well and good, but I hung that chunk of code out to dry so long ago, could I re-vive it? Was it even worth finding? No, why bother, start from scratch and make something else with the same idea. For example, this time around lets play with javascript.
Work has me playing with jQuery and I soon found pixastic, stitch them together and TADA you have a little image toy.
(if you want to play you’ll likely be happier playing with out the bounds of the iframe: go here instead).
It’s not a hard problem, I find a random 5px vertical slice and blur the image and then stretch it to the original dimensions. Some images result in more interesting results and the random factor has it’s ups-and-downs.
Just drop the URL of an image in the box, hit ‘GO’ and see what you get. It took me a while to get to a point where the ‘next’ call would clear out the created image. So far the hack I have in place has nasty side-effects. If you click ‘Go’ twice, it clears the image, like it should. But because the original img didn’t re-load the ‘load’ even is never fired thus the second image is not built. We’ll see if I fix that tomorrow or not.
UPDATE: the ‘Go-twice’ bug has been resolve, but it’s done in a rather crude way (I just do the work twice). Also I’ve added a marker on the original image that shows where the second image is built from.
Well hope you have as much fun playing with yet another toy I’ve built, as I had building it.
Ubuntu 10.4 upgrade drama
So I don’t know if I’m the only one but I’ve had some issues with my upgrade, figured I would do my part and list what went wrong and what I did to fix:
App::CPAN not available
So it seems that perl was upgraded twice, first to 5.10.0 then to 5.10.1. Some where in the mix nothing was installed to 5.10.1′s pool of modules, thus simple things like ‘cpan -i Moose’ would fail. You can get around this by going the old-long way of ‘perl -MCPAN -e shell’. Though I used this as an excellent time to try cpanminus, so far no complaints what so ever.
UPDATE: it has been suggested that I could have avoided this by the use of perlbrew to maintain a local copy of everything out of band of ubuntu’s idea of perl.
No bitmaped fonts
I’m still one of those hold-outs that thinks that the artwiz fonts are the best for coding (lime specifically). The problem is that ubuntu dropped default support for bitmap fonts a while ago and it’s always a hastle to get them back. Though this time it was straight forward ‘sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf’ , make sure that ‘/etc/fonts/conf.d/70-yes-bitmaps.conf’ exists and your back in the running.
udev hates my Logitech Cordless Optical Trackman
I’ve explained how to fix it before but because 10.4 switched to using udev exclusively, that fix no longer applies. The odd thing is that HAL is still running and still knows what to do with the mouse, it just seems that all changes are ignored. So far I’ve completely failed to get anything to work, seems that udev is set on assigning the evdev driver to that mouse, thus the AxisOffest option is not available.
So far my failed attempts include:
- writing a custom udev rule to assign the driver ‘mouse’ and all settings from the 9.10 fdi
- writing a custom udev rule to completely ignore the device
- doing the config in xorg.conf
In the end I just got out my old mouse and have been using that. I’ll post any updates as they come up.
Ubuntu 9.10 and a Logitech Cordless Optical Trackman
So there has been much written about getting this mouse set up with Ubuntu, but all failed for me. Heres a quick little post about what I’ve run in to and how I fixed it.
For the impatent heres my fdi:
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.mouse">
<match key="info.product" string="Logitech USB Receiver">
<merge key="input.x11_driver" type="string">mouse</merge>
<merge key="input.x11_options.Protocol" type="string">ImPS/2</merge>
<merge key="input.device" type="string">/dev/input/by-id/usb-Logitech_USB_Receiver-mouse</merge>
<merge key="input.x11_options.AngleOffset" type="string">-35</merge>
<merge key="input.x11_options.Buttons" type="string">10</merge>
<merge key="input.x11_options.ButtonMapping" type="string">1 2 3 6 7 8 9 10 4 5</merge>
<merge key="input.x11_options.ZaxisMapping" type="string">4 5</merge>
</match>
</match>
</device>
</deviceinfo>
Off Axis
Out of the box, this mouse is off axis, this fixes that.
<merge key="input.x11_options.AngleOffset" type="string">-35</merge>
Wheel non-functonal
Everything that I found on getting this set up with HAL used the ‘Auto’ protocol. For me what ever protocol HAL was picking would not see all the button clicks past 3, thus no wheel action. Forcing to ‘ImPS/2′ fixed that too.
<merge key="input.x11_options.Protocol" type="string">ImPS/2</merge>
No buttons past 5?
I’m finding that xev is not seeing any button press past #5, and because there are 10 buttons on the device that things are just duplicated. So far no solution to this one, but I’m not finding that I’m not really compelled to hunt this one down. So far here’s the button mapping’s on my box:
Well hope that helps some one out there, feel free to use the comments to add any corrections you’ve found useful.
A whole new day
This is just a test of poster (http://poster.nizzoli.net/ ) so we’ll see how this goes? Might be better then the email stuff that I could never get to work.
Welcome to sleeping blog syndrome
Everyone who ever decides to ever start a blog has likely run in to that span of time where you just can’t convince your self to post anything. Some times its a day, some times its a week, then for others (like me) its months at a time. So again I’m going to try and break that cycle and just start pushing ideas and rants here.
Lets see how this one goes.
Take that winter!
Next step, lets see how long the chin fluff stays?
–
benh~
So what have you been up to?
I have a problem with todo lists, I have the attention span of a turnip thus there a blessing and a curse, as I get excited and put a bunch of stuff on said list then promptly forget that there was a list at all. So I’m going to start making sunday the ‘clean up your todo list’ day. The hope is that come monday I’ll have a list that more accurately describes what really should be done for the week, hope being the operative word. So here goes:
The first ‘left-over task that I’m going to tackle today is to talk about my little side project, euler_bench, a little attempt at the little benchmarker that could. The initial goal was to build up something that would show how much progress the Rakudo project has made. Because it was easy we started off by using the Project Euler problem set. Because of this the current code is completely tied to the way that we started to organize around the euler problems.
This is not the worst thing in the world but since then it’s ballooned a bit in scope and now I would like to really re-do most of the back-end stuff to be portable, thus allowing the ability to compare anything to anything else. You know, the same problem that any quick prototype has, it works really well for one thing, but speed was traded for flexability, now its time to really build the project. All good lessons learned, and here’s where you come in.
Because the project is now at a point where planning is involved, if you have feature requests jump in. If you have any desire to play along feel free to grab a fork (its on github for just this reason). This has been the project that I’ve been working on at the weekly PDX Thursday Hackathon, so you can join in there too if you so desire.
So its not the best post, but it’s good enough to check the box in hiveminder. Off to check something else off too.
–
benh~
You might get asked to fill out a survey.
I am testing crowdscience so you might be asked to fill out a survey. Don’t know how this is all going to work, so if you feel like it go forth and click away, if not sorry in advance.
reason #432 why I love Moose, smart = easy
Moose gives you the tools to code in a very very clean and standard manner. It does not inhibit you from being dumb, but it makes being smart very easy. Let me give you an example.
For work we have a Type for our product id’s, it is just a few lines of code but in allows us to have all our objects know before they do anything that they have a valid id. Well a co-worker noticed this morning that the validation was overly strict, we would (correctly) fail if the id included leading or trailing white space.
Not a huge problem to solve, but why have every object do it’s own cleaning? Sure you could have a central place for the code, but what I really want is to never have to worry about this at all, and we already have a central choke point. So lets head back to that type that is already being cohersed… so why not do the change there, wait there is no reason not to.
5 minutes later we’re back up and running, no muss, no fuss. Moose, a good toolkit is makes doing the right thing easy, and you end up with an OO system for free =).
Thanks again team #moose.


