I’m not motivated by shame. Who is?
Positivity encourages me. Be realistic not pessimistic.
from One Big Fluke http://ift.tt/1hGLupX
I’m not motivated by shame. Who is?
ESR on remembering your history about open source:
The Unix guys showed us the way out, by (a) inventing the first non-assembler language really suitable for systems programming, and (b) proving it by writing an operating system in it. But they did something even more fundamental — they created the modern idea of software systems that are cleanly layered and built from replaceable parts, and of re-targetable development tools.
from One Big Fluke http://ift.tt/1ktNF3j
Saw this behavior today:
>>> mimetypes.guess_extension('text/plain') '.ksh'
Behold, mimetypes.py, a gem from the Python standard library:
def guess_extension(self, type, strict=True): """Guess the extension for a file based on its MIME type. Return value is a string giving a filename extension, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. """ extensions = self.guess_all_extensions(type, strict) if not extensions: return None return extensions
If there are multiple possibilities, return one at random. In this case, a Korn Shell script.
from One Big Fluke http://ift.tt/1dwITKl
Feeling like a kid again – The joy of 3D printing
When I was 13 I became obsessed with programming. I was finally good enough at writing code to hack away like a madman. When I found a new programming problem I would work on it all night. I would enter the flow state. I wouldn’t notice time passing. I’d dream about it and go right back in the morning. I was inventing problems at the same time I was solving them. Programming made me so happy (and still does today).
For the past 30 days I’ve had that same feeling, something I haven’t experienced since I was 13 years old. I’ve been creating non-stop, obsessed with my latest experiments. I haven’t been able to sleep, staying up until 4am focused on making one more smidgeon of progress. It’s been a blast! But my time hasn’t been spent programming. It hasn’t been the occasional strategy game that has a similar effect (Civilization, Sim City, Starcraft, etc). What’s made me feel like a kid again is my 3D printer and the promise of rapid prototyping.
I’d been considering an idea for the past few months: Design a new gear shifter for my bicycle. I wasn’t interested in a typical derailleur shifter, but a custom shifter for the Shimano Nexus 8 internally geared hub used by Mission Bicycle*:
This hub is a non-standard part. The geometry is totally different than what’s out there. The chain never moves off the chain rings. All of the moving parts are hidden away. It looks awesome and works great (better than my old 12 speed bike). But the standard shifters for it look like this monstrosity:
There are two other compatible, aftermarket shifters out there, but I don’t like their look either.
The question was: What would it take to create my own?
Prototyping the shape
On January 18th I set out to make my own shifter a reality. The CAD software I decided to use was 123D Design from Autodesk (it’s free!). I did some Alias back in school, so I’m not a total newbie, but look how horrible my first attempt at modeling the shifter was:
After a few days of experimentation with the CAD package I had a better design. What surprised me about CAD modeling is I’d enter the flow state just like I do when programming. I’d have to think hard about how the geometry moves and fits together, just like I simulate how a program will behave in my head, poking data in and out of memory. It made me ridiculously happy.
The screws and springs you see in there are CAD models I downloaded off a supplier’s website. I had no idea how sophisticated the supply chain is for this stuff.
Meanwhile, I bought a 3D printer, the MakerBot Replicator 2X. I chose MakerBot because it’s well supported. Here’s a video of that thing in operation. The sound it makes is futuristic and haunting:
The CAD program exports an STL file (a mesh of triangles). The MakerWare software that came with my printer turns this into an execution plan (akin to Logo) that you can check for errors. The flat bottom parts are called “rafts”, easily removable supports that prevent the ABS plastic from curling off the build plate.
Here it is printed into reality:
A few days later I prototyped how the pieces (screws, springs, ball bearings) would fit together, and had an assembly that could move:
What followed was a huge amount of trial and error to make the geometry shift the gears in precisely the right way. I also had to figure out how to make the holes more durable against the crushing impact of the indexed shifting springs. Here’s the pack of duds I printed on my way to making it work. Each of these took about 75 minutes to print at 15% fill (meaning they are 85% hollow and chintzy):
But finally, miraculously, I made the shifter work. Here it is shifting the hub for the first time:
Iterating the design
After this things escalated quickly. I brought the prototype to the bike shop. We put it on a bike and found a design flaw: In high gears the knob would bang against the top tube when you turn the handlebars. It’s finding problems like this that makes 3D printing amazing. I had been prototyping for weeks and thinking about it all the time, but I still overlooked simple constraints that become obvious once you actually try it out. Fixing those problems was fast and cheap.
I went home that night, spent a few hours rotating the geometry 90° forwards, and then did a 100% fill print to make it strong. The next morning I dropped the new parts off at the bike shop. They built the bike out. By the afternoon, all the pieces were in place: We had a fully built bicycle with the new shifter. The day was February 18th, exactly 30 days after I started the CAD drawings.
I rode the bike home that day and have been riding it a bunch since. I’ve also improved the design further, shrinking the base and knob to make the whole thing more ergonomic. What’s crazy is how fast you can iterate. This design I thought of at 10am, had it in CAD by 10:30, had a print by 12:30, had it on the bike by 1pm. Being able to move this quickly reminds me of the liberating feeling of continuous deployment for building software. Having a 3D printer makes me feel like I can create anything. I’m no longer afraid of the physical constraints of designing real objects.
Now I’m looking for a machine shop to turn this part into a reality. ABS plastic is fine for a demo, but for durability and precision having it CNC'ed out of aluminum would be best. I want to anodize it in cool colors. I have no idea how much this will cost or how much time it will take. I’ll write up that experience in another installment of this story as soon as it’s done.
* Disclosure: I’m part owner of Mission Bicycle.
from One Big Fluke http://ift.tt/1dkxVHY
Added documentation to my Cohort Visualizer tool to explain what the calculations mean, reproduced here. This shit is more complicated than I remember:
A “bar” is every cohort for a particular day. A “bar segment” is one part of the bar for a day in single color, corresponding to a particular “cohort state” (like “Made two posts” above), which is usually some level of progression in the funnel.
∑↑ / ∑↕ “Percentage here and up”
Sum the bar your mouse is over vertically upward, including the bar segment your mouse is on top of. Then divide by the total sum for that bar vertically. Answers: “On this day, what percentage of users are beyond and including this cohort state in the funnel?” For the bottom bar segment this will be 100%.
∑↓ / ∑↕ “Percentage here and down”
Sum the bar your mouse is over vertically downward, including the bar segment your mouse is on top of. Then divide by the total sum for that bar vertically. Answers: “On this day, what percentage of users are before and including this cohort state in the funnel?” For the top bar segment this will be 100%.
X / ∑← “Percentage here of cumulative past sum”
Sum all bar segments from the cohort state you have your mouse over going back in time to the left, including the one your mouse is over. Divide the bar segment you have your mouse over by that sum. Answers: “What percentage of users does the highlighted bar segment represent as part of the whole past for that cohort state, including this day?”
X / ∑→ “Percentage here of cumulative future sum”
Sum all bar segments from the cohort state you have your mouse over going forward in time to the right, including the one your mouse is over. Divide the bar segment you have your mouse over by that sum. Answers: “What percentage of users does the highlighted bar segment represent as part of the whole future for that cohort state, including this day?”
X / ∑↔ “Percentage here of cumulative sum over time”
Sum all bar segments for the cohort state you have your mouse over for all days. Divide the bar segment you have your mouse over by that sum. Answers: “What percentage of users does the highlighted bar segment represent over all time for that cohort state?”
∑← / ∑↔ “Contribution of past to cumulative sum over time”
Sum all bar segments from the cohort state you have your mouse over going back in time to the left, including the one your mouse is over. Answers: “What percentage of users over all time got into the highlighted cohort state before and including the highlighted day?” For the last day this will be 100%.
∑→ / ∑↔ “Contribution of future to cumulative sum over time”
Sum all bar segments from the cohort state you have your mouse over going forward in time to the right, including the one your mouse is over. Answers: “What percentage of users over all time got into the highlighted cohort state after and including the highlighted day?” For the first day this will be 100%.
X / Max ↔ “Percentage of maximum single day ever”
Find the biggest bar segment for the cohort state you have your mouse over for all time. Divide the bar segment you have your mouse over by the the biggest amount. Answers: “How big is this day for users to get into the highlighted cohort state compared to all other days ever?” The biggest day will be 100%.
1 - X / Max ↔ “Delta from maximum single day ever”
Find the biggest bar segment for the cohort state you have your mouse over for all time. Divide the bar segment you have your mouse over by the the biggest amount. Subtract that from 100%. Answers: “How much bigger is the biggest day ever for this cohort state compared to this day?” The biggest day will be 0%.
from One Big Fluke http://ift.tt/1jeG8Ca