Categories
Life

Counting down to the next

Since living in Taiwan, the Western style new year feels a bit arbitrary for me. The Lunar New Year is at least tied to something, it is easy to define, even if it’s more complicated in its own traditions. Nevertheless, I like the New Year, and it’s good to have some periodic semi-forced review time. When it’s cold, it’s even better (sorry Southern Hemisphere).

Sunset over Taipei
Sunset over Taipei

This year felt a bit like growing up. I was grown-up before (can’t afford not to be at the age of 31), but my way of thinking have matured a lot, and it feels like that happened because of all the limitations and stress and projects and winding path I took on.

In 2012 somehow extended on the projects I worked on, like building a certain portfolio. Ignite Taipei is still there (maybe the main drive behind my experimentation), while it got company in the form of Future Shorts Taipei, the continuation of the Geek Dinners, later OpenHack Taipei and the (preliminary) Taipei Hackerspace. They seem to have a common theme – building local events related to technology, innovation and art. I hope I can continue with this theme, and see where it takes me. Kickstarter, social networks helped a lot to expand my world in these directions. Not sure if all these projects will survive next year (at least not with me at the wheel), but will definitely learn from all of them.

There were some really good books this year, discovered Pynchon, Tolstoy, and Calvino, as well as many smaller ones. Keep rediscovering Tolkien, Asimov, Murakami, Vonnegut, Beckett. Had a lot of brainy-books too. My shelf is still totally full, I can be sure, that the next year will be just as busy in terms of reading and just as mind-blowing.

In research I wasn’t that successful, though I have learned a lot. Will see what can we do in the next year in the lab. We were building a new experiment and it is not a real surprise that the results are still ahead. Whether my true way is down on academia lane or not, that remains to be seen.

I have a lot of startups related influence around me, and for years I’ve been hatching plans without any results. Next year supposed to see me set some hard deadlines for decisions (different visa for Taiwan, that lets me do more, for example).

There were some great travels this year, a big European tour for the first time since I moved to Asia, and in Japan for the first time ever. No plans for travel for the next year yet, maybe more within the country and more purposeful choices of destinations? Though I like quick changes of plans and surprises. And visitor friends from countries are good too.

This time it feels strongly that I’m in “in-between”, with choices ahead. The Sun is already setting on 2012 here, let’s make 2013 count.

Categories
Programming

The Gift of Code

I like advent calendars a lot. They can bring a lot of surprise, preparation, focus, and joy. They can come in many shapes and forms, and they encourage DIY – make your own calendar, count the things that are important.

This year, I got to play with a very interesting “advent calendar”, called 24PullRequests. It is the kind of thing that I don’t understand why people haven’t done it before. The mission: help out open source projects by submitting enhancements and fixes (i.e. “pull requests“), and do that for 24 days counting down to Christmas.

my 24 Pull Requests calendar
my 24 Pull Requests calendar

I had to take part in that one, and while the result wasn’t as successful as I wanted, it was so far my best contribution to open source.

My pull requests

Instead of 24, I managed to make 4 enhancements that were ready to be sent off. That’s not consoling me that it seems nobody managed 24, but never mind. Here are the things I made:

  • SmoothieCharts: make the charts use newer browser animation technologies that have better performance, and save on battery as well. This one was prepared somewhat earlier than December, but the final version was pushed within the right time frame. Being tested, not merged yet.
  • OpenHack: I’m organizing the event in Taipei, and noticed that some other place has broken image link. Hunted down the same pic from Google Cache, and set it up again.
  • Python Guide: added some info about installing certain Python packages in Arch Linux and Ubuntu. This is embarrassingly tiny fix, there’s so much more to do here
  • AngularJS: this is fixing that one couldn’t run the build script if the system Java can’t run in 32bit mode. I didn’t know that this was a Google project, until they sent me a request to sign some contributor agreement. I feel strangely humbled.

Lessons learned

Four contributions were already a lot of experience, because all of them were so different. Here are some lessons learned:

  • Write good pull requests – that starts with writing good commit message! People keep saying that, but seriously, no excuse not to do that.
  • When the changes have been sent in, don’t mind that they are not accepted yet. Every project have their own pace. Keep working on whatever you like
  • I was looking for ow hanging fruit, but one has to go in there still to make some meaningful contribution.
  • The issue tracker is a good start to see what to fix, but not always helpful, as it can be difficult to understand what propblem the others try to describe, if you are new to the project. On the other hand, try to use the code, I’m sure you’ll find some pain points right away (that was AngularJS). Also, the busiest issue trackers are not the best, they are full of things that would side-track you for a long time. Projects with a medium count are good for such an improve-and-run contribution.
  • Don’t be afraid to do things, but still do them the best you can. Your contribution doesn’t always feel meaningful, but still a little improvement is more than most people do. (just like PythonGuide was)
  • Keep things simple – easier to do, easier to pull. Even if sometimes that takes longer to write (the AngularJS contribution srunk to the quarter of its size while I was trying to figure out the simplest way to achieve what I wanted)
  • If interested, don’t worry if the project uses programming language you don’t know. You can pick up new things easier than it seems. Also, many projects give you feedback on your contribution, to help you improve it.
  • This project don’t encourage to work on your own stuff, but that doesn’t matter, there are another 11 months for that, or every day after these contributions are done
  • How to do this for the whole year? Bug squashing day in general? Still need to get deeper in projects, but go and explore. Can also see CodeTriage and ContribHub, linked from 24PullRequests
  • If stuck in the fixing, but the problem is interesting, don’t worry if it doesn’t fit in the 24 days. Keep working on it, the recipients will be happy any time (I have have 1 or 2 such patches)

Now let’s be a better coder in 2013.

Categories
Life Thinking

My 40-by-40 plan

A while ago I was reading someone’s 30 by 30 plan, 30 things to accomplish before the author turns 30 years old. Since I always liked lists, it got me interested. Since I’ve just turned 32 a few days ago, that other ship has sailed a long time ago, but then I can set my even more ambitious list: 40 by 40.

It took a 2 or 3 brainstorming sessions, here are the results, not any particular order, just numbering it to keep track, and a bit of explanation here and there:

  1. Travelling to: Chile, Africa (somewhere), Southern Hymalayas, a desert, Hokkaido (because seeing new places always open new dimensions)
  2. Create a new programming language (programming so much, maybe can make something new, which would me to appreciate the other languages even more)
  3. Become professor (that’s the science career path and working this long for other professors, I wanna see how I can be in their place)
  4. Publish a book (reading so much, writing quite a bit, can I really write something others want to read?)
  5. Start a company (the independence and creativity it would give me is hard to overestimate)
  6. Travel to space (unlikely, but let’s just set the goals high)
  7. Learn to play a musical instrument, current candidates: piano, trombone, or guzhen (I’m listening to so much music, want to be able to create something myself)
  8. Have an art exhibition (creativity knows no bounds, and interactive art is awesome, would be great to collaborate too)
  9. Be in a film (I’m a terrible actor, but still want to see what work goes into all the movies I like to watch so much)
  10. Sail on the ocean (adventure time, real travel, real toughness)
  11. Go skydiving (that must be a feeling impossible to describe, have to see it myself)
  12. Send my parents travelling somewhere where they wanted to go (I was lucky to have travelled more than most of my family, let’s pay back some of that while possible)
  13. Set up a foundation for some good cause (I was thinking about this quite a bit, I wonder how can I help the most?)
  14. Learn to swim properly (being a frong is just not enough)
  15. Run a marathon (I guess I’m already doing this wrong, but want to see what does it feel like)
  16. Do a defensive driving course (haven’t driven for almost a decade, but the way people drive in Taiwan, this would be a very important skill to learn)
  17. Write to my  inspirational people (though first really have to figure out who are they, have some but need time to think)
  18. Learn to meditate properly (have tried it a few times with guidance and it is simply life-altering experience, too bad single times fade, I want to have the habit)
  19. Create a high traffic website (can’t read Hacker News day in and day out without having this ambition)
  20. Become fluent in Chinese and one other language: Japanese, Spanish, French, or something else (languages are awesome, love to communicate with people)
  21. Long distance bicycle trip to somewhere (many people do that around Taiwan, and used to cycle much more than these days, is a great way to get around)
  22. Learn to brew really good coffee (these days I do drink a lot of coffee, but very few places make it such that it stands out, I want to see what it takes)
  23. Learn the constellations and other important object on the sky, be able to navigate by night (used to do much more astronomy as a kid, have to rediscover the universe)
  24. Get to know a traditional profession deeper, like carpentry or pottery. (there’s an awful lot to geek out about those)
  25. Build a building, or renovate an old one (break the mystery of the places where I stay everyday)
  26. Grow a tree (tried many times, and they have failed very early)
  27. Learn to be a technical writer (that’s the influence of my advisers from Oxford)
  28. Bring traditional Taiwanese food cooking back to Hungary, and Hungarian back here to Taiwan (cooking is a lot of fun, and dinner parties with people are even more)
  29. Overcome helplessness about the issues I see around me everyday (stray animals, homeless people, poverty, all could be improved upon if I can face them)
  30. Give away at least half of my stuff (I have too many things, need to simplify)
  31. Get back in touch with my childhood, teenager and uni friends (I have burned so many bridges by inaction)
  32. Learn to mix cocktails well – and come up with a new one that people actually like (cocktails are playground, and even though I can’t drink, I was reading a lot about them)
  33. Attend the Nobel prize ceremony (preferably when someone I know won the prize)
  34. Do something concrete for science education (also inspired by my high school friend who’s doing an amazing job at that)
  35. Write up our family tree and as much of our history as possible (I love history, and very interested in my family)
  36. Have a patent of an actually useful invention (then give it away)
  37. Have a radio show (had some small stuff before, just feel like doing it)
  38. Figure out how to donate blood again (they wouldn’t let me here because of being grown up in Europe)
  39. Learn to fly helicopter (somehow much more tempting than aircraft)
  40. Overcome the fear of heights (that would be very useful)

While making this list, though, I was thinking: this is all good and nice, but I care much less about it than I thought in the beginning. These would be nice, but I actually have 1-by-40 plan: be happy.

Let’s see how does that go. :)

Categories
Computers Thinking

The Internet hates programming

I was annoyed the other day by something the other day (well, by meetings in general), and wanted to check if other people are just as annoyed by it than I am. So I went to Google, started to enter “meetings are…” and since search is correcting what I type according to what people look for and type around the Internet, I got this:

Google's suggestions for what meetings are
Google’s suggestions for what meetings are according to the Internet

The results were really for my liking, and I was thinking whether I can use this to get some insights into fields of knowledge, for example what does the Internet think about different programming languages?

Started with LabView, since that’s the one I’m struggling at work at the moment (that’s for some other stories). I don”t want to overly generalize, and I have a lot to learn about it, but still, I am not that surprised by the Number 1 spell correction:

Labview is crap
Labview is….. crap, according to the Internet

So let’s see how the other languages and software engineering keywords come are treated?

Positive sentiments

There were some keywords with positive sentiments, never really among the top suggestions and never too many but there were

Neutral sentiments

There are some languages, that come up only with language related corrections, I guess that’s mostly because people don’t have strong negative or positive feelings, or maybe it’s more confusing then infuriating? Or people just don’t know much about some of these?

Mostly negative sentiments

Now onto the good parts…

I think my favorites are “worse than crap” and “an exceptionally bad idea”, with so explicit phrases, people must feel very strongly about it. Also, I’m surprised that with this many “dead” languages there’s still any programming going on! Of course, this is not an exhaustive list, would love to see more examples, and add to the list

Anyways, let’s head back to coding now that I have cheered myself up. Programming is hard, and the Internet knows that too.

Categories
Admin Lab Programming

Laboratory 2.0 – a monitoring system

Looks like that one of my specialty as a physicist, and contribution to the labs where I have worked so far, is bringing different kinds of programming techniques, and technologies to the table. I’m not saying I’m any better than many of the professors, post-docs, and students I’ve met so far (there are plenty of ingenious ones), it’s more like I experiment with different tools, have tried more of the cutting edge or recent technologies, did some web programming and could whip up something quick – that might not work very well at first, but does broaden the horizon for the rest of the people.

Also, I’m a lazy person, so want to automate as much as possible. That was on my mind recently when we have been preparing to do a vacuum-system bake-out. It’s essentially a procedure to have a delicate experimental system, mostly made up of steel, glass, and stuff like that, closed up from the atmosphere, all the air pumped out, then heated up to high temperature (~150-300°C). One has to be careful, because things can break, there are temperature limitations for some materials, also on how quickly that temperature can change, requiring careful monitoring of the status of the system. And the whole thing takes something like two weeks or more. Perfect setting for automation.

Set up the electronics

The pressure measurements are done by some expensive other equipment so didn’t have to bother with that one yet, so set to work first on the temperature monitoring. Before it was a bunch of thermocouples and multimeters, requiring manual intervention and lots of labour. Instead, got some inspiration from Adafruit’s Thermocouple Breakout Board, using the MAX31855 chip, and also from the Thermocouple Multiplexer Shield. It can handle only one channel, but can use some other chip together with it to switch between the different thermocouples, and so we can read it out one-by-one. The Adafruit board could only handle 1 channel, and the multiplexer shield was using an older chip for the measurement that I could not buy anymore. In the end, found a good analog multiplexer that one that is sold in the computer market here in Taipei, the CD4067B, and it works pretty well.

Breadboard setup for temperature monitoring Arduino
Breadboard setup for temperature monitoring with Arduino

Of course, setting it all up was quite a bit of fun times, as there were way too many gotchas along the way.

  • MAX31855 is a surface-mount component, and haven’t worked with it before. Not too bad, and can be much neater, just takes some plactice
  • MAX31855 is a 3.3V circuit, so the CMOS voltage levels used by my Arduino Mega ADK had to be level shifted
  • Unlike the older chip, MAX31855 really needs differential input, and it’s much more sensitive to the environment. This required different kind of analog multiplexer than that board had
  • The Arduino Mega is a new model for me, and had some strange behaviour in terms of the serial communication
  • Surprisingly there are not too many options for 3.3V voltage regulators over here, just the LM1117, which is different from what others are using elsewhere
  • Lots of noise and stability issues until figured out what should be how. For example under no circumstance should touch the thermocouple to conducting surfaces, and avoid ground loops
  • While MAX31855 says it’s “cold-point compensated”, meaning that it accounts for the chip-s local temperature when measuring the thermocouple, it doesn’t appear completely compensated, meaning that we can have unexpected measurement change because the chip is heating up for example by being in a closed box.
  • Figuring out the right amount of time to wait between switching channels (375ms seems to be good enough, 500ms is totally fine)
In the end, though, we did have a nice 16 channel thermocouple multiplexer, sending off the measurements onto an LCD screen and to the computer over an USB cable.
Temperature monitoring board soldered
Temperature monitoring board in it’s lab setting with 16 thermocouple channels

This is then saved in a database, and can be accessed from elsewhere.

Visualize!

The thing that my co-workers were most amazed by wasn’t the electronics. Sure, they haven’t worked with Arduinos, but did do similar stuff. Instead they liked the monitoring interface much more, this is the one on the picture right here (can click to enlarge)

Bakeout Monitor  interface showing the vacuum system, temperatures, pressures and long term graphs
Bakeout Monitor interface (click image for full view)

It’s the schematic layout of our equipment, with the temperatures positioned where the actual sensors are. Also, the change of the measured values in time are also displayed with live scrolling.

I’m not saying it’s great. Thinking about it, the major insight that made it good for the rest of the people is that I realized how much more people understand visual data: the placement of the values to the corresponding locations on the schematics. That’s the only thing.

So inside it’s a MongoDB database (learned from previous mistakes, using a replica-set at least), with Python scripts talking to the sensors and saving the data, NodeJS / Smoothie Charts for visualization (and plain old CSS positioning of <input> tags for the reading display), nginx‘s upstream module for running two monitoring servers just in case. It’s mostly in the Github repo of the monitoring code, as well as the Arduino sketch for talking to the electronics.

It was actually quite fun to write it all, and the gradual improvements, trying the new tech, trying not to lose to much data, amazed how well it works. Especially had a good time learning about the database, scaling, fault tolerance, performance…

Of course there could be room for a lot more improvements.

  • My failover-restart bash scripts are awful, though they do seem to work more or less and counteract the USB unreliablilities
  • There were some changes to Smoothie Charts that I could improve on: logarithmic plotting, some display enhancements, wonder if it can be more optimized for performance
  • More efficient data loading. 12h data is about 30Mb in JSON format, that I send compressed, apparently it gets down to ~5% in size, but it still takes quite a bit of time to process on the frontend
  • The layout now can be changed from config files if the sensors change, so co-workers can do that without programming knowledge. I wonder if that can be simplified even more

Of course, I’m a person who generally overengineers stuff, so maybe it’s good to stop somewhere. And the somewhere might be when I got to the point to use my Kindle for monitoring (craps out on 1h data already, but some real time things are good enough).

Bakeout Monitor interface running on Kindle
Bakeout Monitor on running on Kindle 3, not perfect but does work

Get on with it

I did learn a lot along the way, and I’m sure that with this experience I will be let to do a little bit more in the lab in terms of programming ideas. I don’t like that the rest of the system is currently forced to be LabView, but that’s for another post, and there are so many things that can be improved in general as well. Let’s just go and do that.