Categories
Uncategorized

Let’s Code!!1!!

code!

There’s been so much talk about learning to code lately… I figured I should provide some insight, as someone who has been writing code that computers can understand (sometimes) since the early years of the 1980s.

Writing code is fun! Well, sometimes. You know, on the rare occasions when your code actually works. Writing code can be fun, just like things blowing up can be fun… under the right circumstances. Fireworks on the fourth of July? Fun! Your car’s engine blowing up? Not fun! Don’t worry, your code will “blow up” on occasion, and you’ll have to fix it. Often this will happen at 2:30am.

Maybe writing code is fun like driving is fun. You know, a cross-country trip, 20 hours straight in a car with cranky, smelly people… that’s fun! Having things break for no reason and having to spend lots of time (and possibly money) fixing things? Fun!

I’m partially kidding, of course. Writing code can be fun, but it can also be terrible. You’re typing at a keyboard with the goal of telling a computer what to do. We really are slaves to the machine. Computers were supposed to help automate everything so we’d have more free time for leisurely activities like building robots, which of course require you to program a computer to make them work. It’s a vicious cycle!

But hey, you should write code. You should write code to solve problems. You could be awesome and release that code under an open source license so the next poor sucker doesn’t spend 10 hours solving the problem you already solved. Of course some people/companies/organizations believe that everyone should solve their own problem, so they won’t let you share your code, even if you wrote it on your own time… don’t work for them. Work for the betterment of humanity.

You should also write code for fun, real fun, enjoyment, for real! Write code that does something silly, or stupid, or amazing, or to play a prank on someone. Don’t lose sight of the fact that learning should be an enjoyable experience. Most programmers I know have a sense of humor. It’s probably a requirement for that line of work.

But… which language should you choose? Eh, it doesn’t matter. Start with the easy ones, perhaps a scripting language. It may be all you need. I’ve been using Perl for about 16 years, and I still use it all the time because it’s the fast and easy way for me to get things done. I like getting things done more than I like buzzwords or whatever the popular kids are using to write code.

So yeah, write some code… see if you like it. If you hate it, don’t write code. Find something else to do. The world always needs people to bake things. Baked goods are delicious and very enjoyable, and it’s extremely rare that someone complains that a loaf of bread just “stopped working” or somehow didn’t do what they wanted it to do.

Bake on, man… Bake on!

Categories
Uncategorized

MMPIS (Part II)

Info Screen

See Also: MMPIS (Part I), and MMPIS (Part III), and MMPIS (Part IV).

MMPIS is semi-related to reMMinderbot, in that it’s meant to actually provide helpful information. reMMinderbot lets us know (via email) when there is a meeting, or if we haven’t blogged in a while, or when the monthly cleanup day is coming. (It has to remind us of that twice! On Wednesday and Saturday before the actual Sunday we clean.) There’s lots of Perl and cron involved in reMMinderbot.

reMMinderbot is also supposed to send an email telling us what’s on the calendar each day. This occasionally works. I’ve been writing code to deal with calendars for way too long. It’s sort of a nightmare. The iCalendar format is best described as Wibbly Wobbly Timey Wimey.

There’s an old saying:

Some people, when confronted with a problem, think “I know, I’ll use regular expressions.”
Now they have two problems.

Parsing iCalendar files can be like that. Luckily, Perl has a module for everything! So iCal::Parser was pulled into service. Unluckily, it has bugs. iCalendar can be tricky. There are repeating events, but they can have exceptions, days they don’t actually happen. I’ve seen weird time zone issues, and differences between clients. Anyway, it’s all wibbly wobbly.

Our original Perl code grabbed the calendar file from Google, parsed the file, and then output the upcoming events to a file that is then included in the main page. As I said, though… it doesn’t always work. So I decided to scrap it.

In an ideal world, we would just clone the calendar page on the web site and display that. There’s just way too much Javascript on that page though, and it takes too long to render. I then remembered a web application I used years ago, so I turned to PHP iCalendar.

PHP iCalendar

PHP iCalendar manages to display things properly! All events revealed! Though the monthly view is not what I want. Nor is the daily or weekly view, but… At the bottom is a “This Month’s Events” section. We can use that!

List of Events

I took the files that showed the monthly view and started hacking. I stripped out the unneeded HTML, edited the CSS to get what I wanted, and it was pretty close, but… it was just displaying the current month’s event. This would mean that if there was an event on the first of the month, you’d never see it until the first of the month, which is silly. Digging through the PHP it was just a matter of changing things to look at the current month and the next month. Not 100% perfect, but an acceptable solution.

Right now it’s looking two weeks ahead, so you’ll get any event for the next 14 days. This is what you see below.

MMPIS Events

I may play around with setting the viewport to be 1920×1080 and then using overflow: hidden to better use the space on the screen, but I’ve also got the issue that I’m doing development on a 1280×720 screen, so I may need to do some CSS stuff depending on the screen size, if that’s even possible. (Also, to pick a nit, the resolution of the TV I am using today says it is displaying 1360×768.)

Anyway, the PHP iCalendar solution has been working so good I’ll probably roll it into reMMinderbot’s calendar code. It’ll take a bit of Perl-fu to do the right thing there (multiple servers are involved) but it should be a major improvement. (Hopefully.)

What’s that? You can’t wait for Part III? It’s coming…

Stay Tuned!

Categories
Uncategorized

MMPIS (Part I)

MMPIS

See Also: MMPIS (Part II), MMPIS (Part III), and MMPIS (Part IV).

I typically write about a project after it’s done, but I thought I should turn that around and start writing about a project much closer to the start. So here’s Part 1 of the story of the MMPIS, the project more formally known as the Milwaukee Makerspace Pi-powered Information System, which is a kiosk at the makerspace which will provide members (and guests) with useful (and silly) information.

First, the name… We have a history of naming things with acronyms and/or using an many “M”s as possible, such as: HMMMMMM, M6 (Milwaukee Makerspace Morgifying Marble Manipulation Machine), M4 (Milwaukee Makerspace Maker Mobile), reMMinderbot, M2C2 (Milwaukee Makerspace Can Crusher), MMLC (Milwaukee Makerspace Lighting Controller), and of course, BADASS (Beer Automated Dispensing And Security System). I choose MMPIS because it’s fun to say. I nearly went with MMKIS (Milwaukee Makerspace Kiosk Information System) but unless I’m outvoted, I’ll probably stick with MMPIS.

I’ve long had an interest in digital signage and kiosks, so after my recent Sir Like-A-Lot project, I felt like pursuing a kiosk for the Makerspace. We had a Raspberry Pi that had been floating around waiting for a project, and there’s a huge TV that jason g. brought in that we used only occasionally. Those two pieces and a few other things were all it took. Well, that and writing some code.

The heavy lifting is all provided by Screenly, and actually, it’s the Open Source Edition of Screenly. (Also on GitHub.) Screenly is a pretty nice open source kiosk application. I’ve discovered a few bugs, and have some feature requests, but it definitely works. I’ve been meaning to check out Concert and Xibo as well, but I’ve not dug into those yet.

The first group of screens is pretty simple, here’s a few grabs.

Info Screen

Here’s the main screen (for now) which tells you where you are (duh!) and shows the date and time. It also tells you where to park, has a quote from the wiki, and shows the upcoming events. Well, some of them. We’ll get into that in Part II.)

Park!

We’re also showing our Parking App to let members know which side of the street to park on. (This, as every other screen, may change in the future.)

HMMDMMH

We’ve also got our How Many Members Does Milwaukee Makerspace Have? page. The HMMDMMH page uses our member management software to let us boast about this impressive number.

What's Cookin'?

Prepare Thyself for Making

The last two are just graphics that live on the Pi that runs Screenly. All the others are web pages out there on the big old Internet. Oh, I should note that the pages need to be fairly simple. Large, complex pages utilizing Javascript or other heavy lifting don’t do very well, due to the lightweight nature of the Raspberry Pi and the browser Screenly uses.

OK, that’s our intro to the MMPIS. In the next installment we’ll get into the events that the MMPIS shows, or should show.

Stay Tuned!

Categories
Uncategorized

Lazzor the Snowflakes!

Snowflake Designers

For the Holiday Make-A-Thon at Milwaukee Makerspace we came up with the idea of using Snowflake 2.0 so people could design their own snowflake ornament that we would then laser cut for them.

We had two computers running and instructed people how to use the app. We had to make sure people didn’t overlap the lines, as each line would be seen by the laser cutter as a place to cut, and people would end up with a pile of little wood pieces instead of a snowflake. We also found a bug where you could drag a node off the screen and then not be able to reach it to drag it back. Besides those little issues, the app was great, and lots of makers had interest in download it and playing with it.

Oh, Lance did all the laser cutting, and he was kind enough to add the person’s name, along with “Christmas 2013” to the back of each ornament, and a hole to hang them. Since it was a minimal amount of etching, and then just two vector cuts, things went pretty fast, which is good, because I think we made over 80 snowflakes!

Here’s a few of the designs people came up with during the event.

Snowflake

Snowflake

Snowflake

Snowflake

Snowflake

Snowflake

Snowflake

I’m tempted to dig into the code a bit and see if I can tweak things with Snowflake 2.0. Not surprising, but it’s been a year since I played around with snowflakes.

Categories
Uncategorized

Printing Plates v2.0

My last attempt at printmaking didn’t turn out as well as I had hoped it would, so I figured it was time to try again. And actually, the main reason I wanted to try again is because I saw the work of Jenie Gao at Milwaukee MakerFest, and after I took over her table so she could take a break, I asked her a few questions about printmaking, and the most important thing I learned is that I should seal the wood. With that small bit of advice, I was ready to try again…

Laser cutting the plate

Rather than do the same thing I did last time, I decided to start fresh. I once again used the laser cutter, but this time I didn’t want to use a raster etch, but instead opted for a vector cut to create the plate. (A raster etch works quite well of course, as Bret recently demonstrated, but they are time consuming, and tie up the laser for a long time. Vector cuts are much faster.)

Sanding the plate

Once I had my pieces cut from 3mm Baltic Birch, I used the piece of wood I cut them from as a guide to glue them down. After the glue dried I sanded it to make the surface nice and smooth. I’m not sure I needed to do this, but sanding always feels like the right thing to do in these situations.

Sealing the plate

I then coated the piece with polyurethane, sanded it down a bit, and repeated that process two more times. (I’m just doing what is recommended on the can. I don’t know if multiple coats are really needed, but it can’t hurt, right?) I let the whole thing dry for at least 24 hours.

Inking the plate

Ready to print! I inked up the plate and slapped down some paper, did a bit of rubbing, and I actually got a decent looking print! One thing I should do next time is create a larger backing piece, as it was hard to hold the plate in place while inking it, and I got a good amount of ink on my fingers and the table. (And yes, that is a mirror I am rolling the ink on. It’s from a 3D printing experiment long ago.)

MKE Print

The final print. There’s a few spots that could use more ink, but as I wasn’t doing a large run, I didn’t use a lot of ink. I also printed on crappy paper and it turned out good. (Supposedly the suggestion of using ‘Rives BFK’ can be ignored. Regular drawing paper can be used instead.)

Ultimately, my plan is to sort of merge the concept of printmaking with letterpress to make a weird combination of the two… but, you know, using a laser cutter and cheap Baltic Birch plywood.