Log in

My drafts are a continuum

I don't know if I finished the first draft of my novel. At the beginning of last year I said I was going to, but I don't know. That's because I'm no longer sure what should count as a first draft. The zeroth draft was clear. I had a beginning and an ending, but the middle lacked some chunks. Now all the parts are in place, and in the right order. Finding the right order was nontrivial. Maybe normal writers write a story in a linear fashion, as it develops in time, but that's not me. I write chunks and scenes, and wrack my brain about how to make them fit together. Which one should come before another one? The story can be told in any of the million ways.

I can't help but see stories from a software engineering perspective, not something that develops in time, but as a modular structure that occupies (mental) space. The logical way the modules fit together may not necessarily be the temporal way.

I finally worked out the order in which to string the scenes together. But I also determined I need more scenes with certain characters, because they are more instrumental to the story than I thought before. So can I really say I have Draft 1, or is still Draft 0.5? Or perhaps novel drafts should not be versioned like software releases?

I also have several short (or "short") stories I am working on, all but the newest one completed, and in various states of rewriting. One of them underwent five rewrites -- five completely different variations on the same theme with the same characters, converging on the same finale -- and this is still not the end. I need to figure out how to make the final version shorter. Might I be overthinking this just a tad?

That's the state of my writing for 2011. As far as my programming goes (and I can only speak of spare time projects, not anything I do at work), I'll spare the gentle reader an account of all false starts and stops on my coding endeavors throughout the year. It suffices to say that for the last month I've been trying to get an application I wrote to work on a Windows-hosted website. It is supposed to automate certain tasks on which I spend a lot of time, so it is important to me. To make a long story short, I found out that there are certain incompatibilities between the development environment on my laptop, and my Windows website environment, that can make it impossible to host that application. There are a couple of ways to deal with this, and I don't know which is more viable. It can also be said that when it comes to web hosting, I have champagne tastes on beer budget.
A fire alarm rings at work. You leave your desk and properly evacuate to the parking garage. It turns out to be a drill, and 10 minutes later you are allowed back. You get a brilliant idea: you'll use this disruption to do something good for you health. You'll take the stairs up to the third floor where your office is. And maybe you should try walking up and down the stairs a few times during the day, so your butt won't meld with the chair. You don't quite remember where the stairs are in this building -- you only took them once -- but a building deputy showed them to you.

You go up to the third floor. The stairwell door won't open. It's locked. You swear the last time you tried it, it was unlocked.

You go up to the 4th (top) floor, then to the 2nd floor, and all the stairwell doors are locked. You get down to the first floor, and the door is unlocked, but it opens into a small dead-end hallway with several other nondescript, identical, unlabeled doors. You try one after another, until you find one that opens into a longer hallway, which leads you to the elevators... just in time before your claustrophobia flares up.

This is what happens in corporate America when you try to do something good for your health. It's like that in pretty much any office building. In some buildings, I heard, people are so discouraged from using the stairs, that an alarm would go off if you open the stairwell door! The stairs are to be used strictly as a fire exit.

And yet there is no shortage of health experts who tell us to incorporate small acts of fitness into our daily life, first and foremost by taking the stairs. Also, ride your bicycle to work. Uh-huh. And play Russian roulette with the cars whizzing by, and arrive to your cubicle sweaty, and delight coworkers with your post-workout aroma. None of those experts must have ever worked in corporate America, or lived in a suburb. Next thing they'll tell us to eat cake. :-)
Not long ago it was an anti-drug week at Erika's elementary school. Every day of the week the students were supposed to make an anti-drug statement with visual aids, including their clothes. What, you ask, were they told to stop wearing gang attributes to school? Even their hemp-promoting t-shirts? Nooo. They were supposed to wear mismatched socks. Why? Don't you see -- it's like saying "sock it" to drugs. Makes perfect sense, right? Then again, it makes only marginally less sense than some things adults do, like running a 10K race "against" a disease. Well, at least those races also raise funds. So that makes it logical, I know.

Anyway, back then I just shrugged and forgot about it. Some time later I asked Erika not to wear red shirt with a green jacket because they clash. She replied: "If you wear matching clothes, you like drugs!"

I guess we'll have to work with her on the basics of logic: A -> B does NOT mean B -> A. A discussion of whether teacher's words should be taken with a grain of salt may also be due soon.

How come xkcd hasn't addressed this?

I often hear that engineers are literal. This typically includes software developers. I hear this even from people who work with engineers all the time -- you'd think they would take a more nuanced view. But perhaps not many people understand what "literal" means. I'm not even talking about the common, oft-ridiculed use of "literally" to mean "figuratively" -- as when somebody tells you "I literally died laughing" (and they don't have chunks of rotten flesh falling off, so they're not Undead).

Figurative, after all, is the opposite of literal. You can also say that the opposite of literal thinking is metaphorical thinking. Apparently most people don't understand how much certain intellectual activity, such as science and engineering, relies on metaphor. As an example, read this article in Wikipedia about Aspect-oriented programming, and show me even one paragraph in it that does NOT contain a metaphor.

The point is: software design, like any design, models real world problems in some kind of abstract conceptual framework. This is only possible if you think in metaphors.

I really think there should be an xkcd cartoon on this.
Some stores must be really, really sick of people stealing their shopping carts. So sick that they put the cart before the horse's customer's safety... or maybe just don't think how anti-theft devices can put customers at risk.

A case in point is an incident my significant other, Ray, termed "The Great Magnetic Shopping Cart Caper". It occurred in Babies'R'Us parking lot in Austin. Here is the email he sent to Babies-R-Us Management.

The evil lurking in a shopping cartCollapse )

So there you are. I guess the children's store is showing by example how to practice "tough love". After all, setting consequences is a common parenting advice. Only in this case it is, step outside the line, get a jolt of reality. No matter if it sends you under the wheels of oncoming car.


In all my programming life I never tried communicating in code with real-world objects. But now there is something to make it easy (or at least doable): Arduino. Sharon Cichelli demonstrated it at the All Girl Hack Night in October of 2011. Arduino is a microcontroller that lets you program blinky LED lights, or things that make buzzing alarm sounds, or all sorts of other electronic. It also accepts input from buttons or sensors, or anything that translates a physical action into electric pulse. You can plug things into one of its pins (there are 13 of them, if I recall), and have it "read" electric pulses from those pins, or "write" to them.

"Read" and "write" probably shouldn't be in quotes, because they are the same programming concepts as reading and writing to/from any input/output device. So, to switch on an LED light that's plugged into pin 13, you would digitalWrite(13, HIGH). As with all things digital, the function digitalWrite only recognizes on/off, or in this case, HIGH/LOW values. HIGH means the device plugged into the pin is on, LOW -- off. Simple, right? These basics allow one to sit down and program a primitive blinky light in minutes. The programming language is fairly high level. Its function names, as one can see, resemble human language -- this isn't assembly, where you push bits around with three-letter commands. It enables you to quickly do simple demos, like Sharon Cichelli did. Just as you digitalWrite to a pin to turn a device on, you digitalRead from a pin to recognize, say, a button press. Again, you pass to it the number of a pin into which the button is plugged in.

You write the code in an IDE, and with one mouse click upload it to an Arduino connected to your computer via USB.

Sharon Cichelli dictates the code that Anne types up on the laptop

Sharon Cichelli demonstrates Arduino programming.

Arduino programming seems encouragingly simple at first, but as with everything, once you get deeper into it, you discover complexities. In fact, one's lack of electronics background might put brakes on the progress. Having been told that a LED light is plugged into a pin number 13, you (and by you, I mean me) might notice that the light actually has two wires, both plugged into tiny slots. Why are there two wires, and which of them is # 13, you ask. Oh, it's because the light needs to be grounded. The other wire is plugged into the grounding pin, you can ignore it for the purposes of your program. Yes, grounding is something you should have remembered from physics classes, but didn't. Then you digitalWrite to it, and it still doesn't light up -- that's because something is wrong with the hardware, and the circuit does not close as expected. Maybe the light isn't plugged in firmly enough. So, there are two dimensions to debugging Arduino code: a programmatic and an electrical dimension. As if catching just the software bugs wasn't tricky in itself!

Sharon couldn't help but demonstrate troubleshooting techniques, as things malfunctioned. Pins "floated". Still we had enough time to progress to a more advanced part of the lesson: Pulse Width Modulation. If you can only send "on" or "off" signals to a LED, how would you dim the lights, or produce nice, slow fade on / fade off effects? The fading or increase in brightness is caused by flickering very fast between on and off positions. If the light spends more time in the "off" position than "on", it appears to fade; if in on position, it grows brighter. If we graph HIGH and LOW signals versus time, where every HIGH signal is a vertical bar, we'll see that the "width" of the HIGH signal decreases (increases) over time. So that, simply put, is Pulse Width Modulation. Sharon pair-programmed with someone (sitting another person down at her laptop's keyboard, and dictating code to her) to implement the slow fade.

Besides blinking and buzzing things, you can connect Arduino to vibrating things. Erm. I mean, like a mat under a cat food bowl. A vibrating mat would scare off a cat that is afraid of vibration. This was the idea one of the girls had. How do you make a cat lose weight, if you also have a normal-weight cat, and each time one sees the other eating, she will eat too? The goal is to make the fat cat to eat less frequently than the normal-weight cat. So, this girl got an idea to put a vibrating mat under the cats' food bowl, so that when the cat steps on it, her weight would send an input to Arduino, which would trigger the vibration, scaring the cat off. The smaller cat's weight would not trigger this response. And the fat cat's weight would only do it at certain times but not others, otherwise the pudgy feline would never eat.

And if you don't have problematic cats, there is still a wide variety of applications for Halloween costumes, such as blinky eyeballs like Sharon made for her own Halloween costume).

Not all those who wander are pilgrims...

This must be the season when American students learn about the first Thanksgiving, and pilgrims, or the first immigrants. First-graders might not necessarily know the difference between pilgrimage and immigration, because my daughter asked me if I was a pilgrim. Ancient as I might seem to the youngest generation, I'm not that old!

Grandma Eileen, Erika"s pilgrim

She was, however, quite sure that her Scottish grandmother was indeed a pilgrim, because, in Erika's words, "she came to America for opportunities". Which she did in the eighties, more than three centuries after the Pilgrims arrived. So when Erika had to make a pilgrim doll for her class project, she picked grandma. Here it is, on the left.

One day I should explain immigration to Erika -- a task made all the more complicated by the fact that Pilgrims were the first unauthorized immigrants. :-)

Rowan 4-month update

Rowan gurgles, screeches and makes sounds slightly resembling a cartoonish alien. Or a cartoonish alien crossed with a cat in heat. He stares into your eyes for a minute, and eventually says "ngu". He may cry while you're changing his diaper, but then you'll raise your head and he'll be suddenly looking at you and smiling, without even letting a pacifier out of his mouth. A month ago I could swear I heard him say a few syllables, like bu-bu-bu. But he didn't say it again. He must have decided that there is no need to meet those milestones early, and set high expectations for the rest of his life.

Erika holds 3-month-old Rowan

He also started making a pouty face. He pushes out the lower lip while crying. When nursing, he sometimes puts his hand to his temple, as if saluting.

He does not like to be on his tummy, though he holds his head pretty well. He is able to roll onto his side, but not all the way over. A month ago he consciously started grabbing and swatting his toys, so now I have less of a dilemma of how to keep the baby occupied when he's not eating or sleeping. I just put him on a mat with the hanging toys, a.k.a the jungle gym. Sometimes he works hard to grasp a toy with his feet, as seen in this video. It reminds me of machines that let you try to grab a plush toy with a "claw". He has achieved about the same amount of coordination that most people have with the claw. (The video has no sound since I didn't want to pollute the viewers' ears with the random sounds of our household.)

When Erika started going to day care at 10 months, she came back with a runny nose the first day. After that followed several months of endless ear infections and colds, and this was a girl who had not even caught a sniffle while she was at home. Rowan, however, went to day care at 6 weeks, and only got fever twice in the last couple of months. I knock on wood.

At the last checkup yesterday, his height was in the 99 percentile, his weight in the 95-97 percentile, and head circumference in the 75%. So, still a big baby. He sleeps through the night about half the time. The pediatrician told us he should be able to sleep through the night the other half of the time too, and the key is not to feed him when he wakes up (he's clearly capable to last through the night without getting too hungry), but put him back to sleep. Do it now, because the older the child is, the harder it is to change his habits, she said ominously. (Well, as ominously as could be expected from that very friendly woman, who is nevertheless is a stickler for schedules and discipline.)

Defining the peak oil is not simple

As we may have already reached peak oil, the point in time when the maximum rate of global petroleum extraction is reached, it is timely to have a panel like "Imagining a future without fossil fuels". But before we can ask science fiction writers what will happen once oil production enters inevitable decline, we have to take into account that the definition of peak oil in itself, err, slippery. The question of whether there is a peak oil should be, "peak oil at what price", says Paolo Bacigalupi, whose novel "The Windup Girl" is set in post-fossil-fuel future. At $90/barrel, it becomes profitable to convert shale into oil. So when cheap oil becomes unavailable, people start extracting oil from reserves that were harder to reach. Since petroleum is used for much more than fuel, but also for plastic, fertilizers, and many other things, at some point oil will become too valuable to burn as fuel. We'll have to prioritize what we'll use fossil fuels for -- driving versus plastics, food, or fertilizers.

Will we still be able to play WoW on bicycle-powered computers?Collapse )

David Chang and Paolo Bacigalupi hope that the tools and technology we have these days will make it possible for ordinary people to innovate solutions for post-fossil-fuel future. Bacigalupi has faith in people like a guy down the street from him, who is working on a biogas composter in his garage.

We could save lots of energy just by wasting it less, the audience points out. House builders used to (or still do) put the air conditioning unit in the attic, where it gets 150 degrees in summer. With energy costs rising, they might soon become smarter about that.

Some cool post-fossil-fuel transportation ideasCollapse )

Are most internet ads scam?

This is an example why I will never try to make money off my website and blog by running ads. I saw this on Freethought Blogs website.

"Invention to heal water" ad on Freethought Blogs

Yes, the notion of "healing the water" meshes so well with a scientific approach to the world. And yet the ad selection software (probably run by a third party) keeps putting ads on Freethought Blogs that directly undermine their message. (Even if Freethought Blogs aren't specifically oriented against pseudoscience, it is a big area of scrutiny in the freethought community.) At the very least the ad rotation software needs to be more semantic-aware, to gauge the attitude of the target audience towards the ad. There was a time when New York Times could also benefit from a similar intelligent filter, at least in their Science section; ads for a "quantum healing" change-reality-with-your-thoughts self-help course might not sit well with the audience who wants to read about physics. (I haven't seen those ads on nytimes.com in a while; maybe they got wise to it.)

But if better semantic analysis eliminated every ad promising $$$$/week working from home, or one "weird" tip for a flat belly, would there be any ads left to run?

I'm exaggerating, because I do see ads for useful products, like shoes, handbags and cell phones, or Dell servers and programmer outsourcing firms (I guess data mining algorithms must have concluded I'm a female CTO of some company. I should feel flattered. :-)), but those are no more than 1/3 of all the internet ads I see. It is just me, or is it really true that overwhelming majority of internet ads are snake oil products and scams?

If so, what does it say about the whole business model of advertising-supported websites? Companies that have something valuable to sell don't seem too interested in advertising on the web. And yet many startups count on being able to survive off ad revenue. I wonder if they are being naive about this whole concept (and given the rate at which they go under, they may be) -- unless they count on there always being plenty of idiots to fall for scams. (That may be not a bad assumption, sadly.)

I've seen some too-good-to-be-true ads, e.g. hot stocks and ridiculously cheap car insurance, even on websites of major U.S. newspapers like Washington Post. Is that an indication of just how desperate for cash newspapers are?

Latest Month

January 2012

free hit counter



RSS Atom
Powered by LiveJournal.com