Showing posts with label rant. Show all posts
Showing posts with label rant. Show all posts

Thursday, April 12, 2012

Scripting, processing.org, images, video, etc

So, at my new job, a bunch of my coworkers are "designer-programmers." Usually these are people who have training in art or design and who teach themselves how to program (often quite well). As one might expect, many of them shifted into C++ and OpenGL after first whetting their appetites with processing.org (which I will simply call "processing" from here on).

Every once in a while I'll run into a quick one-off scripting task whose output (or input!) is an image or a video asset, and my first instinct will be to start looking up scripting language wrappers around things like PIL and ImageMagick. Whenever I express a thought in this vein, invariably, one of the designers will say "Why don't you just use processing?" or "Processing can do that!"

And it turns out that they're right. I have conceded that, even without a strong knowledge of processing, processing is a better tool for quickly programmatically generating images and video than many of the more conventional scripting languages out there (including Ruby and Python). There are two reasons for this. The first of these is that processing gets out of your way, and lets you call visually-related API functionality without having to do a bunch of imports, or the equivalent of "system.out.println instead of printf". The second is slightly more subtle. Processing is structured around the idea that you'll have a setup, a draw, and an event loop, and that the "draw" will draw things, either every frame, or on certain events. It is absolutely amazing how much more natural this is than "print stuff out" for tweaking and debugging programs whose output is (primarily) other visual artifacts.

Tuesday, August 24, 2010

blogger question

Does anyone know if there is a way to get the "summary" field in the atom feed from a blogger blog to include thumbnails of the images in the blog?

I recognize that this would probably require some coding on Google's part, but it doesn't seem like anything that's beyond them, and it would be a pretty cool feature/option.

Saturday, August 21, 2010

Hyperbolic Paraboloid Buildings

Ever since I first stumbled upon them in "A Visual Dictionary of Architecture" I've been fascinated with the concept of hyperbolic paraboloid buildings.

Essentially a hyperbolic paraboloid is a structure which, in some frame, is described by the equation

z=x*y

If you slice it along constant z you get

1~ x*y or y~1/x or x~1/y

If you slice it along a line y=k*x you get

z=k*x*x or z=k*x2

But the part that makes it useful as a surface for buildings is that if you slice it along constant x or constant y you get

z~x or z~y

in other words, a straight line.

For this reason, it is called a "ruled surface", and a framework for it can be made entirely out of straight beams, as in the pictures from this site

http://www.savetrees.org/Hyperbolic%20Paraboloid%20roof%20shelter.htm



One problem with such a surface is that, while it is easy to construct the frame out of straight beams (and the resulting structure is known for its strength), constructing the roof to fit into the frame is non-trivial, especially if the surface must be hard.

It is *possible* to construct something that mostly fits snugly over it by cutting pieces out of a cloth tarp (as shown in the above link), but any patch of the true surface of the object is curved (as well as any line which is not constant in either x or y)

One solution might be a "concrete tent" similar to what is proposed in this article
http://www.wired.com/science/discoveries/news/2005/03/66872 (start with a "tarp with sections cut out" and brush wet concrete over it. Then let the structure harden)

Another alternative might be to layer a fine mesh of straight wires along constant x and constant y, and take some goopy filler material, such as plaster, and brush it over the wire mesh. I wonder if something like this is how they make permanent buildings with hyperbolic paraboloid roofs. Some of the images of such structures certainly look like a wet material was painted on top of a mesh and then allowed to dry, although larger hyperbolic paraboloid structures, such as the Catholic Cathedral on Gough Street in San Francisco, are often clearly made from piecewise surfaces (float or otherwise). I think to have a piecewise surface of flat segments perfectly conform to a frame of straight segments in such a roof, the segments have to be triangles (and highly irregular ones at that!)

Friday, August 13, 2010

Planning

On my bike ride to work, from Mountain View to Cupertino, I usually start on the Stevens Creek Trail, and I can take either one of two routes after crossing El Camino Real.

One of them takes me through the red circled region on the map posted below, while the other takes me through the blue.



I will call the blue region (the "circle" around it isn't closed since the region extends off the map) "ecocity Sunnyvale". It has actual bike lanes, streets connect, so that things a close distance apart can actually be walked or biked to, and the area seems to be fairly mixed-use (schools, businesses, etc) for a residential / sprawling ranch houses area.

The red region, while superficially similar by the map, is an entirely different beast. The dashed green line going through it on the bicycle map isn't so much a bike path, as it is an unmarked route through a maze of suburban cul-de-sacs. Having successfully laid out the streets in such a way as to prevent cars from cutting through this neighborhood, whoever designed this area also managed to prevent cyclists and pedestrians from taking any sort of sensible straight cut-across, while simultaneously zoning the entire region purely residential.

Monday, July 19, 2010

A manifesto in the form of a sequence of seemingly unrelated ideas

  • Programming is a social activity. Sure there are cases where you are working with a fixed set of libraries you know well, and you're trying to generate something interesting within this vocabulary of thought, but most industrial coding seems to consist of cobbling various libraries together.
  • Computing is a social activity. (no explanation needed)
  • (completely unrelated) Things that only the "dorky kids" did in my generation are the exact things "all the kids" seem to be doing in subsequent generations.
  • Programming is the fundamental activity people do with computers, much like "driving" is the fundamental activity people do with cars
  • Learning to program only *seems* hard because we try to force students from zero to programming-literacy in one college semester, then fail them if they fall behind on the interesting stuff that depends on that basic literacy. Imagine if we spent a year slowly teaching programming for every year we taught kids about reading, writing or arithmetic.
  • Analogy between modern professional programmers and ancient scribes.
    • Elite group of educated scholars
    • Write using needlessly difficult technology (either "C" or "All caps and no punctuation")
    • Mostly write things like "So and so owes the king 15 sheep" / modern day business software
  • Analogy between programming and other basic intellectual tasks.
    • Perhaps in the future being a "professional programmer" will be as weird as being a "professional writer" or a "professional mathematician" today
    • But, likewise, everyone will need to do a little reading/programming/arithmetic
    • There may be many "high school programming teachers"
  • Printing press analogies
    • Looking at computers and the internet to day and getting interested in them as "fascinating machines" is like looking at the first printing presses and becoming obsessed with the screw mechanism.
    • Omitting the rest of the analogy