# use as standalone function def chunk_array(array, pieces=2) len = array.length; mid = (len/pieces) chunks = [] start = 0 1.upto(pieces) do |i| last = start+mid last = last-1 unless len%pieces >= i chunks << array[start..last] || [] start = last+1 end chunks end # use as array.chunk class Array def chunk(pieces=2) len = self.length; mid = (len/pieces) chunks = [] start = 0 1.upto(pieces) do |i| last = start+mid last = last-1 unless len%pieces >= i chunks << self[start..last] || [] start = last+1 end chunks end end
Chunked Array
Colorzilla finally up and running on Mac Intel
Colorzilla
Color SchemerWeb 2.0 Digital Ethnography
This video really illustrate what I am doing now, its time to think about my life and grasp the essence of life, again there is nothing right or wrong situation. Web is something changing my lives now and I also being too exaggerated about it.
Web 2.0 ... The Machine is Us/ing Us
Programmers don't like coding, they like problem solving.
If programmers liked to code, we'd all be writing in machine language to this day. You can write that stuff all day and get precious little of the real problem solved. If programmers liked to code, they wouldn't value a language by its libraries. If programmers liked to code, every last one of us would be overjoyed to write our own HTTP client.
Instead, programmers get pissed when they have to write code. They will abandon languages/platforms wholesale that lack the features they need (either built-in or as libraries). From an outsider's vantage, I can see why they'd think we like coding. We solve problems by coding, and we're all happy and enthused while typing away or talking code. But they're confusing the action and the intention. It's not pulling the trigger that makes me happy, it's hitting the target. The action approaches incidental.
Another reason outsiders think we like to code is that we're always talking about rewriting things. Even coders themselves fall into the delusion we rewrite because it's more fun than reading other people's code. Bad source bases irritate programmers because it shakes their foundation of understanding necessary to solve the problem. I reject the explanation that programmers capriciously want to rewrite code for the fun of it.
Programmers desire to rewrite because they know that after starting with a clean sheet of paper and building it all again, at the end they'll understand the whole. Programmers write code to learn. Software has this double-edged sword where you can't just wave your hands instead of implementing a particular function. It all has to be crystal. Programmers know this. They know when they're done, they'll have a complete understanding. It's a noble desire.
Programmers don't like to code, we like to solve problems. Coding is not problem solving, but software problem solving usually involves some coding. Even when we talk about rewriting something, the objective is not to code, it's usually to get a better understanding of the problem for solving in the best possible manner.

