ellipsix informatics

Ellipsix Informatics: the personal website and blog of David Zaslavsky.

I'm a graduate student styudying theoretical particle physics, and I also do a lot of computer programming. Find me elsewhere online:

2014
Dec
16

Adventures in China: The Christmas

Guess where this is?

pile of presents in restaurant lobby

This is the restaurant where I went to dinner last night. A fancy, yet very definitely Chinese restaurant. In China.

News flash: Americans aren't the only ones obsessed with Christmas.

Okay, to be fair, nobody turns Christmas into an obsession quite like the United States. I think the frantic rush to start making preparations in September is a uniquely American tradition. But the celebration is catching on among the Chinese, especially young people, in a big way. From what I hear, a lot of Chinese are taking Christmas as an occasion to spend more time with their families. And businesses are capitalizing on the spirit by putting up holiday-themed decorations — lights, presents, and even decorated trees are everywhere.

ornamented stairs at Best Western

tree at Best Western

As I write this, I've been sitting in the Beijing airport for five hours listening to a loop of "Santa Baby," "There's No Place Like Home For The Holidays," "Silver Bells," "Jingle Bells," and a rather Hawaiian-sounding rendition of "Let It Snow" (notable for the contrast with the complete lack of snow outside).

I guess the lesson is, if you're tired of the Christmas frenzy, you might be able to hide, but you can't run. It's everywhere.

2014
Dec
09

Website back up

Hooray, it works again! It took about 3 days of frantic hacking in the free time I had left over from research, but my website is back up and working properly (so it seems) on the new server. More blog posts to come, when I have time. Soon, I promise.

That is all.

2014
Dec
02

Switching servers

The (virtual) computer this site runs on is showing its age, so I'm switching over to a newer one within the next day or so. Just so you know in case you have any trouble accessing the site.

While I'm on the subject, kudos to Linode for having a very solid migration plan and for making continual upgrades to their hardware while lowering prices. The new server costs about a third as much as the one I'm using now.

2014
Nov
29

Introducing pwait

Today I'm announcing pwait, a little program I wrote to wait for another program to finish and return its exit code. Download it from Github and read on...

Why pwait?

Because I was procrastinating one day and felt like doing some systems programming.

Seriously though. Sometimes you need to run one program after another one finishes. For example, you might be running a calculation and then you need to run the data analysis script afterwards, but only if the calculation finished successfully. The easy way to do this is

run_calculation && analyze_data

(sorry to readers who don't know UNIX shell syntax, but then again the program I'm introducing is useless to you anyway).

Which is fine if you plan for this before you run the calculation in the first place, but sometimes you already started the calculation, and it's been running for 3 hours and you don't want to stop it and lose all that progress. The easy way to do this is to hit Ctrl+Z (or some equivalent; it depends on your terminal) to suspend the calculation, and then run

fg && analyze_data

which will resume it and run the analysis script afterwards.

Which is fine if the program is actually running in a terminal where you can get to it to suspend it, and doesn't already have something else set to run after it. But what if it's not?

Or what if doing this doesn't give you enough hacker street cred?

This is where pwait comes in. You run it as

pwait <pid>

and it will wait for the process with ID <pid> to finish, intercept the exit code, and return it as pwait's own exit code. You can use this to passively observe whether a program finishes successfully or not. Or, at least, semi-passively.

Blurry animation of pwait at work

How it works

pwait uses the ptrace system call to attach itself as a tracer to the process you want to wait for. A tracer process can do all sorts of things to its tracee, including stopping and starting it, examining its memory, changing values in its memory, filtering signals that are going to be sent to it, and so on. ptrace is mainly used by debuggers. But pwait ignores most of its tracer superpowers, only watching out for one thing: the signal the process receives when it is about to exit. The exit code is contained in that signal. So pwait copies that status code and exits itself.

Using ptrace has some drawbacks. For instance, you can't have multiple tracers tracing the same process. This means you can't wait for a program you're debugging. (I can't imagine this ever really being a problem, but you never know.) You also can't wait for a single program with multiple instances of pwait. (I could imagine this being an inconvenience.)

To get around some of these issues, I added a netlink mode. netlink is a way for the Linux kernel to pass messages to and from normal (userspace) programs. Of course, there are many ways messages get passed back and forth between the kernel and userspace, but netlink is rather generic and you can get a broad spectrum of information out of it. Of particular interest to pwait is that netlink can be configured to emit a message every time a process exits. pwait can then register itself to wait for that signal. It gets notified about every process that exits on the whole system, but it'll just discard all those notifications until it finds one that matches the process ID it's looking for.

netlink is definitely on the "new and fancy" end of Linux kernel tools; in fact, I could only find one website that demonstrates the functionality I needed for pwait.

How to get it

I'm not particularly confident in this program yet, so there's no formal release. Just head to Github and click on "Download ZIP" in the lower right, or just clone the repository if you prefer. Bug reports and feedback are very welcome!

2014
Nov
25

First steps toward new scicomm conferences

Join the Google group mailing list to stay informed or to help with planning!

My post last week considering options for a new science communication conference series got a pretty strong response, at least relative to most things on this blog. As it turns out, there already are some people in various stages of planning new (un)conferences in the style of Science Online, much like what I was thinking about. I won't say anything about them here because those people haven't revealed their plans yet, but I hope they will go public soon!

I also completely forgot that Science Online was not monolithic; it had regional branches around the US and around the world, which were largely separate from the main organization. At least two of them are still holding events: Science Online Leiden and Science Online DC. (There are also branches in Boston, Denver, and Vancouver, maybe others that I don't know about, but they seem to be inactive.) These smaller groups could play a big role in the future of the science communication community, since as several people have pointed out, it's a lot easier to organize events that involve fewer people. Perhaps a big international conference is too much to plan for in the next couple of years, but bringing together communicators from a couple of neighboring states? Not so hard. If there's no science communication group in your area, why not start one? If you do, it'd be an excellent thing to announce on the mailing list!

In fact, the same goes for topical conferences, like the massively successful Science Online Oceans. Again, a smaller conference is easier to organize, and it could build up over time to become something for the whole community.

Of course, there's no reason for me to only be writing about Science Online affiliates. I just do it because those are the events and groups I know, or can easily find out about. Actually, a lot of people I've heard from think that we should see any new conference, not as replacing Science Online, but as an opportunity to construct an event that the science communication community wants, from the ground up. I agree. After all, Science Online had its share of problems; the brand is somewhat tarnished, and any new events would probably do well to set themselves apart from that history.

Toward a new conference

While other people pursue their plans for new conferences, I've been musing on the seven-step "plan" (if you can call it that) I laid out in my earlier blog post. Here are some thoughts on the early steps, in light of what people have told me in the past week:

  1. Putting together a group with organizational experience: the Science Online "regulars" were no strangers to organizing events. After all, if you want to communicate with people, bringing the people to you is step 1. So the talent and the experience are out there. I've actually been in touch with several people who would be very capable of planning a new conference, once they decide it's time to go ahead and do it.
  2. Figure out what went wrong with Science Online: a lot of things. Here's a (partial) list, in fact. Here's another one. But this step is ongoing.
  3. Gauge interest: Yes, people are interested. Maybe not all the same people who used to regularly attend Science Online events, but a lot of them are interested enough that — as I mentioned above — they were talking about plans for some kind of new event even before my first blog post on the matter. The trick seems to be putting the interested attendees in touch with the interested organizers, which is what I'm trying to do right now.

The rest of the details — time, location, content, name, sponsors — is stuff for the future. For now, I think it's all about communication. So, whether you're interested in planning a conference or just want to be kept up to date on what everyone else is doing, please, join the mailing list!