Gears - robert-boehnke https://ciechanow.ski/gears/ <comment><AUTHOR> I have heard that it is good practice to always chose the number of teeth of two gears to be relatively prime. This is because there can be impurities in the metal, and if you have a small part of a tooth that is harder than the rest it will erode the opposing gear (there is always some friction going on). By choosing the number of teeth to be relatively prime, the wear and tear is distributed uniformly on the gears, and thus they last longer.

<comment><USER2> By relatively prime, do you mean the largest denominator == 1? Or in other words, 15 and 22 should be relatively prime?

<comment><USER3> This is what is commonly meant by 'relatively prime', yes. Also referred to as being coprime.

Defn: a & b are coprime/ relatively prime iff GCD(a,b) = 1

</comment></comment></comment><comment><USER4> This is an absolutely phenomenal 'explorable explanation'. It methodically layers concepts to foster understanding, deploys interactivity to build intuition, and on top of all that provides crisp, clear narrative on top of all of the amazing visualizations.

<comment><USER5> If you enjoyed the article, check out others by the same author which are done in a similar way. For example [https://ciechanow.ski/color- spaces/](https://ciechanow.ski/color-spaces/) and [https://ciechanow.ski/earth-and-sun/](https://ciechanow.ski/earth-and-sun/)

<comment><USER6> Or have a look at all his interesting articles here: [https://ciechanow.ski/archives/](https://ciechanow.ski/archives/)

<comment><USER7> Excellent - thx !

</comment></comment></comment></comment><comment><USER8> If someone ever makes the creation process for this type of visualization accessible to the average university professor, it could blow the lid of the digital textbook market. Most digital textbooks I've seen are basically just putting the text and images on a web page, and maybe integrating multiple choice quizzes. That's seriously under-utilizing the medium. They need to be _interactive_ , and encourage the student to ask questions and run mini experiments.

I'm aware this would be extremely difficult; maybe impossible.

<comment><USER9> I'm a professor currently writing an online textbook. I can assure you that writing a textbook, without anything interactive, is extremely challenging. I find it hard to imagine a time when my book will be good enough that adding interactive explorables will be the best educational return on time invested. (Though I'm thinking about it!)

<comment><USER10> Not to dismiss your work, but do you think the best investment of your time is to write another textbook (assuming this is an undergraduate level book in a relatively well-explored field), or in adding detail/great illustrations/great interactive charts to an existing work?

I know (really, like, _I know_ ) how detrimental this would be to anyone's career, and I'm not saying this as a moral condemnation of what you're doing - just curious, as I've found myself that there are many cases in these circumstances where the interests of the author do not align with those of the audience. Just wondering if you feel the same way.

<comment><USER9> I'm writing a textbook on a topic no existing book covers: the internals of a web browser.

For your broader question---I understand what you're saying, but it's very difficult to edit someone else's writing. That's where "committee voice" comes from: it's the lowest common denominator to multiple authors working together. And often how _I_ visualize things comes from how _I_ look at things, and coming up with a visualization for how _someone else_ looks at things is hard.

Take the OP as an example. This is a long blog post on gears in general, but animated by the specific question "what shape are gear teeth". If I were writing a blog post about gears, I wouldn't start at that place. And then, imagine if this blog post started text-only instead of visual. "Involute" would now be described with algebra, not a picture. The algebra is complex (compare the Wiki at [https://en.wikipedia.org/wiki/Involute](https://en.wikipedia.org/wiki/Involute)), and that algebra itself would need pictures. Illustrations and explorables aren't, ideally, something you sprinkle onto existing text.

<comment><USER10> OK yeah then your case doesn't apply to my general question. I imagine that for something that is as visual as your topic, animation would be extra useful though :) (like showing with a slider how reflowing works in certain edge cases or something) Not to egg you on of course :)

And I see what you're saying on how it's hard to build on someone else's work, and how what is relevant to illustrate heavily depends on the viewpoint of the author. Still I can't shake the feeling that there is so much duplication. Maybe I should just look at differently. Anyway, thanks for weighing in.

</comment></comment></comment></comment></comment><comment><USER11> I really like this presentation! It's wonderful.

I don't mean to hijack but I thought this would be an appropriate place to share a photo album of the 3D printed planetary gears in my open source robot: [https://imgur.com/gallery/GqXD2Zj](https://imgur.com/gallery/GqXD2Zj)

I've been 3D printing gears for some years now and I want to spread the word that 3D printed gears actually work really well! The gears in the image album above have been operating on that robot for over a year now and they're showing no real signs of wear.

It can be really fun to get a 3D printer and design a little gear assembly. Once you're comfortable with gears you can use cheap motors to make something that moves. Find a way to drive it with Python from a raspberry pi and you're on your way to making a robot. :)

<comment><USER12> That project looks great! I'm very tempted to start building this because of how good it looks, but I know it would take lots of time and effort, even with the designs already available.

As an aside, would something like [https://www.makerfol.io/](https://www.makerfol.io/) be useful for your build log? I see many people using imgur for this but it's always struck me as suboptimal.

<comment><USER11> Thank you! It's certainly an involved project. I recommend starting by building one motor and gearbox assembly and getting control working from python. If you can get that far you can build the rest!

And the website you linked looks nice. There is also hackster.io and hackaday.io. While those sites are fine, it becomes one more thing to update. I prefer imgur for simple photo albums as that integrates well with reddit, my primary promotional place. Imgur actually works really well for me there. And then my real build updates are on my YouTube channel. And I have my own website where I try to throw everything.

So I end up trying to funnel people to my website and just using whatever media hosting makes sense for that particular media.

<comment><USER12> That makes sense, thanks! Regarding the build, I didn't see any information regarding the control system on the material I saw, but I probably wouldn't want to make it as autonomous as you have. I'd probably connect an ESP8266 as the controller and a receiver for my RC radio and control it that way.

Out of curiosity, is there more detailed information about the controller somewhere?

<comment><USER11> Well do you mean the motor controller, the control computer, or the remote control?

I've got some info on the motor controllers I'm using: [https://reboot.love/t/vesc-mods-for-robotics- use/](https://reboot.love/t/vesc-mods-for-robotics-use/)

The control computer is a raspberry pi running python. It looks like I've not committed the code in a while, but this repo may be helpful: [https://github.com/tlalexander/rover_control](https://github.com/tlalexander/rover_control)

Though for the above, I've recently found that I can use velocity control on the VESC, which is easier than doing velocity control on the Pi as I had done in that repo.

For the wireless remote control I use, it's my own design and they're not for sale or well documented. I'd recommend any wireless controller that you can read in python.

The software should be pretty simple now that I've switched to velocity control mode. You just need to read a joystick and convert that to velocity commands for each VESC. Technically even the VESCs could do that onboard if you wanted to modify the firmware.

But if you can drive the VESC from an esp32 that would work too.

<comment><USER12> Oh huh, that's pretty involved, thanks. Can I ask why you rolled your own instead of using off the shelf RC components, like what is used in RC cars, for example? For the remote control and ESC, at least, it seems like it would be simpler.

<comment><USER11> Well for the remote control, I already had the one I used. I started a wireless electronics company in 2013 (and eventually failed), so it's a point of pride to use my own remote. But any RC remote would work.

For the ESC it's more complicated. The VESC is off the shelf, but it has a feature most ESCs don't. The VESC supports encoders. The use of an encoder is very important to get full motor torque on the brushless motors even at zero velocity. This allows Rover to slow down or stop even on a slope. The encoder is also used for precise velocity control, which keeps all the wheels spinning in concert. Additionally, the encoder data is sent up the CAN bus to the raspberry pi so my program knows wheel velocities.

You could certainly build a rover without encoders and with a regular ESC, but it may have trouble starting from a standstill and it may not always drive in a straight line if the wheel velocities are not all the same. Another thing to note is that if you spin the motors really fast you'd probably melt the gearboxes. I'm moving the motors pretty slowly compared to their maximum speed. But a regular ESC might work fine! I've not tried it.

<comment><USER12> That's very helpful, thank you. So you're basically turning the brushless motors into stepper motors with the VESC, that's very interesting. Again, great project, congratulations.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER13> The most important section is on involute curves. It's the curve formed by unwinding a string against the circle:

[https://ciechanow.ski/gears/#strings- attached](https://ciechanow.ski/gears/#strings-attached)

It creates a constant angular velocity ratio at all points where the gears mesh (the law of gears).

In layman's terms, the tip of the tooth gets thinner so that the angular velocity there is reduced at that larger radius. Otherwise the gears advance/retreat as they rotate, which creates vibration.

I think there might be a whole host of curves that work for this, the other main one being a cycloid, which I'm not really familiar with:

[https://en.wikipedia.org/wiki/Cycloid_gear](https://en.wikipedia.org/wiki/Cycloid_gear)

I first learned about involute curves from a cousin that works as a machinist. Mr. Wizard also blew my young mind with noncircular wheels:

[https://www.youtube.com/watch?v=lg4_Kf9B0MI](https://www.youtube.com/watch?v=lg4_Kf9B0MI)

Edit: stumbled onto this technique to make involute gears in CAD:

[https://www.fictiv.com/blog/posts/creating-involute-gears- in...](https://www.fictiv.com/blog/posts/creating-involute-gears-in-cad)

If someone has a simpler method, I'd love to see it.

<comment><USER14> Well, I think the parametric formula for the involute of a circle is (1-it) exp(it). If you pop open Python with Numpy you can say

        t = np.linspace(0, 1); (1 - 1j*t) * np.exp(t * 1j)

And that gives you almost a radian of the involute, unless I've screwed something up. You can evaluate that at the desired number of points, clipped to the desired range of radii, export the coordinates to CSV if necessary, and import them into your CAD program as a smooth polyline. For example, with FreeCAD, you can directly script it in Python and [https://forum.freecadweb.org/viewtopic.php?t=27866](https://forum.freecadweb.org/viewtopic.php?t=27866) Draft.makeBSpline will apparently do the job. Blender should be similar.

To me this sounds simpler.

</comment></comment><comment><USER15> Wow this is great OP! If you like this check out [http://507movements.com/](http://507movements.com/) \- an animated webpage of 507 mechanical movements with descriptions from a classic book.

<comment><USER16> I'm sad to say it took so long to occur to me, but I believe 507 was what introduced me to the concept that it's levers all the way down.

</comment></comment><comment><USER17> Nicely done. Reminds me of [https://geargenerator.com/](https://geargenerator.com/) which I used to build gear systems for fun.

<comment><USER18> Also Matthias Wandel's gear generator

[https://woodgears.ca/gear_cutting/index.html](https://woodgears.ca/gear_cutting/index.html)

</comment></comment><comment><USER19> I didn't know anything about gears until someone filed an issue to tell me that a graphic on the Caddy homepage was wrong: [https://github.com/caddyserver/caddy/issues/2949](https://github.com/caddyserver/caddy/issues/2949)

Wish I saw this earlier!

<comment><USER20> It's funny how often that happens. A favorite example: [https://en.wikipedia.org/wiki/Two_pounds_(British_coin)#Desi...](https://en.wikipedia.org/wiki/Two_pounds_\(British_coin\)#Design)

<comment><USER21> In case anyone else couldn't tell from the image and didn't want to read all of the history:

 _> An oddity of the design is that it depicts nineteen interlocking gears. Because there is an odd number of them, the mechanism could not actually turn._

<comment><USER22> That's not the case for the two pounds though. In the coin's situation, it's because the three gears at the top are interlocked and jammed.

</comment></comment></comment></comment><comment><USER23> In college, one of my lab courses required us to learn manufacturing techniques. We covered a wide range of methods for machining and shaping things, all out of metal.

Making gears was interesting, we had to first turn a rough blank of metal on a lathe to make a steel gear blank (about 12cm in diameter and 2cm thick) then drill out the center and broach a keyway for the axle that would go through the gear. This was all pretty straightforward, but the final piece of work was more difficult, it was cutting the teeth of the gear. The teeth of a properly made gear require complex shapes.

There are, as I recall, two ways to cut the teeth. Hobbing uses a helical cutting head turning on an axis that is roughly perpendicular to the axis of the gear. The cutting head and gear turn at the same time in a synchronized manner and the teeth are eventually cut out by the cutting head. See [1] for a video of a large complex gear being made this way.

The other method, broaching, uses a straight bar of tool steel that has thick straight across cutting teeth. The bar is pushed past the disk shaped gear blank. The cutting bar moves in a straight line parallel to the axis of the gear blank. Repeated passes over the gear blank cuts out the spaces between the gears teeth.

Master machinists taught us how to make these kinds of projects. They would produce a finished gear in about 15 minutes of instruction; then we would have something like two weeks to make the gear. They made everything look easy; it definitely wasn't easy for me.

[1] [https://www.youtube.com/watch?v=0rnTh6c19HM&feature=share](https://www.youtube.com/watch?v=0rnTh6c19HM&feature=share)

</comment><comment><USER24> For me, nothing beats the mechanical calculator used to calculate torpedo firing solutions in WWII. It was a sophisticated differential equation solver that kept a real-time updated firing solution using ... gears.

There's a whole maintenance and operations manual beautifully scanned here[1]. I've wanted to build one forever, but lack the time and expertise.

1\. [https://maritime.org/tech/tdc.htm](https://maritime.org/tech/tdc.htm)

<comment><USER25> I am interested in differential analyzers too, especially after the anecdotes in Richard Hamming's Learning to Learn (aka Hamming on Hamming)[1] about re- purposing "gun directors" to solve engineering problems.

Some of the mechanisms involved are really elegant, like the torque amplifier[2] which wasn't invented until the 1920s. A tabletop demo of one is on my to-do list.

[1] [https://www.youtube.com/playlist?list=PL2FF649D0C4407B30](https://www.youtube.com/playlist?list=PL2FF649D0C4407B30)

[2] [https://en.wikipedia.org/wiki/Torque_amplifier](https://en.wikipedia.org/wiki/Torque_amplifier)

</comment></comment><comment><USER26> I'm going to add very little to this discussion, but it's the second article from this blog I've seen here, and - like the other one, about the Earth and the Sun - it's absolutely amazing. This is some of the finest work in "explorable explanations". I'm going to save the copy of both just to be sure to show them to my kid in a couple of years; this beats any educational material on the topic I've been exposed to before.

<comment><USER27> It is indeed great, and probably one reason you don't see it more is that it's a ton of work! That's 5K lines of hand-written code! (view source and it's at the end of the page)

        $ wc -l gears.js base.js
         4135 gears.js
          904 base.js
         5039 total

I've wanted to make visualizations like this for my blog. Writing a blog post takes me around 10 hours, which is a fair amount of effort.

I believe that the visualizations will take more time than writing in general -- i.e. it would be more like 20 hours, bringing the total to 30.

If you consider that it's 4K lines of code (assuming the base library is reused), it's very easy to see that it could take 20+ hours. Probably more like 40-80 to be honest.

I guess there is that other thread that says people only write 10 lines of code a day, which would make it 400 hours ;) I don't think that applies here but it could be closer to 400 than 10 or 20.

\----

I also wonder if you can save time by using a less "hand-written" style (e.g. d3.js, which seems to be on everyone's wishlist to learn).

My inclination is also to go "hand-written" rather than using a bunch of JS libraries. I think you get a better result that way. It's interesting to see that I'm not totally wrong -- the thing everyone praises ends up being very hand-written. And it's smooth and fast, etc.

\----

another edit: I also believe one reason that this visualization is good is because there's no build process in the JS. The author clearly just edits the code and refreshes the browser. You need that kind of fast edit-view loop to make good visualizations.

IOW, consider using plain JS for blog posts. They are documents and not apps.

<comment><USER28> Having been down this road, yes, it does take time, but you can save some time by using SVG and some DOM library. Although canvas is faster, most diagrams don't really need it, so I use SVG unless I really need to switch to canvas. SVG also adjusts for screen dpi automatically.

The things I like:

1\. Reactivity (ObservableHQ, Vue.js, hyperactiv.js, etc.). There's usually some underlying data and then a corresponding visualization. These reactive systems let you modify the underlying data and then the visualization updates automatically. You don't have to figure out which diagrams to update when. Even easier: just redraw everything every time you change anything.

2\. Some easier way to write the DOM (d3.js, jsx, vue, lit-html, etc.). Since I'm writing a blog post with html, I usually prefer writing my js-in-html (vue) rather than html-in-js (jsx) but try both directions and see which you prefer.

3\. No build step. This is especially important when I want to update a page years later and don't want to figure out which build tools I was using in 1997 or 2007 or 2017. I want my pages to last for decades, and I still update my pages from 25 years ago.

I tried recreating one of the gear page diagrams in ObservableHQ [https://observablehq.com/@redblobgames/unwind-circle- example](https://observablehq.com/@redblobgames/unwind-circle-example) . It's not a lot of code. There's a slider, there's a loop to generate the lines, and there's the output svg. Whenever you move the slider it recalculates the output.

I admit that I'm not using ObservableHQ much for my own projects because I want more of a "hand-written" style. I used d3.js for my older pages and vue.js for my newer pages. Vue's reactivity and templates save me probably a factor of 2 or 3 over d3.js.

<comment><USER27> Thanks for these tips -- I've seen your visualizations and it's nice to hear from people who have done it!

It's cool that you were able to reproduce the diagram quickly and in a small amount of code. It looks a bit foreign to me, probably because I don't know much about SVG (or canvas for that matter). And as I understand it Observable is almost another language on top. (I do know HTML, CSS, and JS pretty well, but there's still a gap.)

Do you ever mock visualizations up in a WYSIWIG tool, or do you always use web technologies in a text editor?

Doing it programmatically has advantages when you need to make 30 similar diagrams, as in this post about gears.

But I also feel WYSIWIG tools could help in prototyping to avoid throwing away a lot of code that wasn't properly conceived of. That is, implementing the visualization is only part of the huge amount of work; the other part is designing it of course. And in many cases the design effort is probably larger.

For example, I have wanted to write an article about regexes, visualizing NFAs and DFAs. I find that some programmers have trouble with the idea of nondeterminism, which is more of a mathematical thing. A subtitle would be something like _" A trie is a special case of a DFA"_.

This post has some nice diagrams, and you can easily imagine them being interactive and more approachable:

[https://swtch.com/~rsc/regexp/regexp1.html](https://swtch.com/~rsc/regexp/regexp1.html)

(in fact a few months ago else I posited that a textual summary of these great but dense posts would be useful too)

I can sort of imagine what I want to visualize, but I also think there will also be many false starts. Though maybe a pencil and paper is sufficient. I'm not sure I will get to it, but this polished and smooth gears post got me thinking again! Using something reactive like vue rather than doing it "vanilla JS" is also probably something I should look into as well.

<comment><USER28> SVG is declarative. You write <circle cx=300 cy=400 r=100 fill=red/> to make a red circle at (300,400) with radius 100. You can then change any of these properties and the system will redraw automatically. Canvas is imperative. You write ctx = canvas.getContext('2d'); ctx.fillStyle = "red"; ctx.beginPath(); ctx.arc(300, 400, 100, 0, 2 * Math.PI); ctx.fill(); and the system will draw that circle. You handle redraw yourself by redrawing everything on that canvas, so you need to keep track of it all. The DOM helpers (React, Vue, etc.) help you with SVG but not with Canvas.

I usually mock visualizations on paper! I'm interested in using WYSIWIG interactive diagram tools like [http://aprt.us/](http://aprt.us/) but I never seem to get into them. When I started, making the visualizations was the largest part of the work, but now I've gotten better at it, and making the explanation is now the part that takes the most time.

After paper, I often use SVG to make a _non_ interactive diagram, either by hand, or in inkscape. One of my guiding principles is that the page should be usable _without_ interaction, so the static diagram is a test of that. If it looks promising I can then gradually transform it into an interactive diagram. For example if I had the circle above, and I am using vue.js, I can change it to <circle :cx=x :cy=y r=100 fill=red/> (note the ":" before attributes), and then vue will fill those values in from the object I give it. I can give it {x: 300, y: 400}, and any time I change x or y, it will automatically redraw. I can then hook up x or y to a slider to try out the interactivity. This allows me to start with a static diagram, gradually add interactivity, and then build reusable abstractions that I can apply to multiple diagrams. ObservableHQ and React/JSX allow something similar, with slightly different syntax.

I'd love to see an article about regexes with interactive diagrams. There's a standalone diagram tool [https://regexper.com/](https://regexper.com/) and an interactive tutorial [https://regexone.com/](https://regexone.com/) but neither is an essay in the style of the Gears article. If you're pursuing this, let me know at email@example.com and I can send over more resources.

</comment></comment></comment></comment></comment><comment><USER29> This was simply wonderful, and hidden at the bottom was a link to an insect named "Issus coleoptratus"[1] which evolved something like a biological gear for synchronizing its legs.

As an almost complete aside, in Terry Pratchett's "Last Continent" there is a God of Evolution that comments on how difficult it is design a biological wheel.

"It's very hard to design an organic wheel, you know," said the god reproachfully. "They're little masterpieces."

"You don't think just, you know, moving the legs about would be simpler?"

"Oh, we'd never get anywhere if I just copied earlier ideas," said the god. "Diversify and fill all niches, that's the ticket."

"But is lying on your side in a mud hole with your wheels spinning a very important niche?" said Ponder.

[1] [https://en.wikipedia.org/wiki/Issus_coleoptratus](https://en.wikipedia.org/wiki/Issus_coleoptratus)

</comment><comment><USER30> You may find yourself wondering: what would happen if the gears are not circular?

The answer is then they can implement a wide range of mathematical functions like reciprocal, tangent, square etc. and you will get a kick out watching an hour long video about a mechanical "computer" with cams building up differential calculations: [https://www.youtube.com/watch?v=s1i-dnAH9Y4](https://www.youtube.com/watch?v=s1i-dnAH9Y4)

Enjoy!

</comment><comment><USER31> A very cool style gear is a harmonic drive. It has a somewhat flexible inner gear driven by a cam which engages it to the outer gear. It allows for extreme gear ratios with high torque in very small packages (think helicopter pitch control).

[https://en.wikipedia.org/wiki/Harmonic_drive](https://en.wikipedia.org/wiki/Harmonic_drive)

<comment><USER32> Very cool! It looks like the output shaft has quite a bit of lateral movement, perhaps something like a Schmidt coupling ([https://www.thingiverse.com/thing:233667](https://www.thingiverse.com/thing:233667)) could be used to remove that movement and allow a fixed output shaft.

I last saw one of these inside an IBM 3890 check reader machine.

</comment></comment><comment><USER33> The whole blog, really. Someone throw money at this person to write science texts full time.

<comment><USER34> Imagine if we could revamp the textbook industry so articles like this have a fighting chance of being included.

</comment></comment><comment><USER35> If only textbooks could be this good.

<comment><USER36> Exactly. Or put another way, why is there not more pedagogic material like this on the web? We have Jupyter notebooks in many different academic subjects but so many of them are half-baked. This website serves as an example of how good web-based teaching material can truly be.

<comment><USER37> I think we'll get there. Part of the problem has been ensuring that the content keeps working. There has been so much educational content produced on Flash, Java Applets, and other platforms that currently have no support.

But the "modern web" (HTML5 and javascript) seem likely to last a long time and be supported on many, many platforms. So now we need better authoring tools, because as another comment suggests, not everyone is up for writing 4K lines of code.

<comment><USER14> That's what I thought, but now more and more features are being disabled either entirely (as with the SQLite interface in WebKit) or for unencrypted sites, which — correct me if I'm wrong here — includes web pages you've archived on your local filesystem. Maybe <canvas> will survive that, despite its use in browser fingerprinting, but camera access and appcache are already nuked, and the only interface that let you do custom realtime DSP on audio streams from an unencrypted origin is deprecated.

</comment></comment></comment></comment><comment><USER28> Really great interactivity and visualizations on this blog. Check out the other posts too: [https://ciechanow.ski/archives/](https://ciechanow.ski/archives/)

</comment><comment><USER38> Cool, really cool. I really wish I could've seen that as a kid. Not asking, but logical next step is to go 3-D with straight-cut gears & helical-cut &c &c.

Anyone else play Gizmos & Gadgets as a kid? I can't help but flash back; I feel like that's how I learned "gearing" (and magnets, and maybe more..).

<comment><USER39> I played Gizoms and Gadgets. Fun game.

</comment></comment><comment><USER40> Slightly off topic but it has long bothered me that racing simulations let you pick arbitrary gear ratios in the tranissions and differentials. Real life has two restrictions, you can't have half teeth, and you can't have huge teeth count. A 3.00 ratio sure, 12:36 but a 3.01? No car differential can fit a 100:301 ratio gearset and 10:30.1 just won't turn past the broken tooth.

<comment><USER41> I'm not a car guy, and I don't know about the differentials, but don't continuously variable transmissions allow for this? I'm guessing they're not in common use on race cars, but in principle, shouldn't they allow for a 3.01 ratio?

<comment><USER40> Yes, a CVT uses a steel belt around two cones, and can have any ratio between them.

Most race cars use mechanical transmissions with automatic controls as that's the most robust design. Some stunt vehicles use automatics or CVT as landing with the wheels at different speeds than the vehicle causes a massive shock through the drivetrain. In a manual that shock goes right to the engine, in automatics there is usually some amount of absorption of rotational shocks due to the less rigid coupling.

Diffs are almost always a ring and pinion gear.

</comment></comment></comment><comment><USER42> There should be some tool to make such nice animations easily. Not just gears, but any other illustrations with moving parts with the ability to have a zoomed in detail beside the animation, etc.

<comment><USER43> You're in luck, such a tool exists! It's HTML and JavaScript. :)

<comment><USER44> I think you missed the 'easily'.

</comment></comment></comment><comment><USER45> Well illustrated and explained.

For some interesting, less conventional gears that surprisingly still function, checkout out _How To Make Organically-Shaped Gears_ :

[https://www.youtube.com/watch?v=3LdlSAN1yks](https://www.youtube.com/watch?v=3LdlSAN1yks)

</comment><comment><USER10> I have a dumb question about this. Under the header 'Torque', where the wrench is introduced the first time, the length of vector F is non-linear with the position of the slider; in other words, the curve you see (that of the length of F) is not straight. Why is that? Torque is distance times force, where is the non-linear component? The article goes on to talk about the angle of the force, but that isn't relevant in that graph yet, is it? (meaning, that graphic seems to suggest we're talking only about a force perpendicular to the wrench?)

<comment><USER46> Torque = distance×force, so force = torque/distance, so force is linear in 1/distance.

<comment><USER10> Thanks, that makes sense. Once you start thinking about it, it's obvious (e.g. F can never go to 0), turns out I've always had a wrong mental model of how the length of a lever influences the torque (beyond 'longer lever = more torque' of course).

</comment></comment></comment><comment><USER47> I am learning about car mechanics as a hobby. How a car works is a nice learning site. [1]

Just learned about starter motors today. I didn't know it has gears too, in particular the planetary gear system, which is not mentioned in this tutorial. (I quickly skimmed through)

[1] [https://www.youtube.com/watch?v=VRe_hKxzKUg&t=1094s](https://www.youtube.com/watch?v=VRe_hKxzKUg&t=1094s) [https://www.howacarworks.com/](https://www.howacarworks.com/)

</comment><comment><USER48> Nicely made. And as soon as the fan appeared my cpu fan started to spin like crazy. It felt real

<comment><USER49> Now it needs to be 3D and a smell generator that emits grease odor and you will have a full 5D experience!

Digital scent technology: [https://en.wikipedia.org/wiki/Digital_scent_technology](https://en.wikipedia.org/wiki/Digital_scent_technology)

</comment></comment><comment><USER50> These interactive animations are so well done.

</comment><comment><USER51> If you're interested in the machining/making of gears there's a youtube channel where a person makes clocks and other timekeeping devices (some of ancient designs). It's fascinating to watch, and makes me want to get a metal lathe/mill someday.

[https://www.youtube.com/channel/UCworsKCR- Sx6R6-BnIjS2MA](https://www.youtube.com/channel/UCworsKCR-Sx6R6-BnIjS2MA)

<comment><USER52> Clickspring's work on the Antikithra mechanism (and the Pateron exclusive Byzantine Sundial) is particularly interesting, because not all of the movements created by gears are circular or even. The input can be purely rotational, but the output is not.

For example on the Antikithra mechanism, it has to account for the procession of the moon's orbit which causes an uneven time to complete one orbit. To properly simulate this, a pin-and-slot system is combined with an offset pivot to turn the rotation of gears into a movement that lags behind and then speeds ahead, mirroring the actual orbital period.

I worded that poorly; the video does a better job of explaining it (within the first minute), and the rest of the video shows the gear train coming together

[https://youtu.be/v19cu2hj2Ms](https://youtu.be/v19cu2hj2Ms)

</comment></comment><comment><USER53> This is a great learning resource. I just found tec-science the other day and I agree with the author that it is worth to take a look, as they have some excellent visualisations. [https://www.tec-science.com/mechanical-power- transmission/ge...](https://www.tec-science.com/mechanical-power- transmission/gear-types/cylindrical-gears/)

</comment><comment><USER54> This is wonderful and I can't wait to go through his other articles.

It reminded me a lot of: [https://acko.net/blog/animate-your-way-to- glory/](https://acko.net/blog/animate-your-way-to-glory/)

</comment><comment><USER55> Nicely done! It kind of reminds me of this old video: How Differential Steering Works (1937)

[https://www.youtube.com/watch?v=yYAw79386WI&t=209](https://www.youtube.com/watch?v=yYAw79386WI&t=209)

<comment><USER56> I love this video. It's such a great visualization, simple and clear, and gets the point across while being entertaining.

And it's from 1937! We have so many video editing and effects tools today, but sometimes simpler is best.

</comment></comment><comment><USER57> This may be a stupid question, but it is something I always wondered.

Torque is effective due to the mass of the lever having a force applied to it, right? Is the length of the lever being used as a stand-in for the mass being affected (a longer lever would necessarily have more mass)? If the lever had no mass, would there be no torque? If the lever did not have a uniform mass distribution, would the difference in applied torque differ based on where on the lever you applied the force (is the derivative of torque with respect to mass not constant for a non-uniform mass distribution)?

<comment><USER58> No, the mass of the object that has a force applied to it has absolutely nothing to do with the torque.

Here is how Wikipedia defines the torque caused by a force acting on an object with a rotation axis: Torque is the product of the magnitude of the force and the perpendicular distance of the line of action of force from the axis of rotation.

<comment><USER57> So the force generated by the torque is completely unaffected by the mass of the lever? Then, why does applying the force on a longer portion of the lever create more torque? I had thought it was because there is more mass acting on the point of rotation (longer lever = more mass).

<comment><USER14> > _So the force generated by the torque is completely unaffected by the mass > of the lever?_

Yes, that's right.

> _Then, why does applying the force on a longer portion of the lever create > more torque?_

Most of the answers to this question reduce, upon examination, to "that's how we define torque". We define the torque of 100 newtons at a lever distance of one meter as the product of 100 newtons and a meter, which we can call 100 newton-meters, which is equal to 1000 newtons at a lever distance of 0.1 meters.

But that doesn't really answer the question, which becomes, why is torque defined in this way an interesting thing to think about? And the answer is that if the lever is a rigid body free to rotate around a fulcrum, then 100 newtons at one meter in one direction will make it start to rotate, while 1000 newtons at 0.1 meters in the opposite direction will precisely cancel that "moment", as we call it, and there will be no tendency to start rotating. It's about what forces are needed to cancel each other.

Well, but, why should that be? Why does it take exactly 1000 newtons and not, say, 316.2 newtons? And I don't think I have a really good answer for that question. In the case of an elastic solid body it falls out of Hooke's law and the geometry of the situation, which you can reduce to two long, skinny triangles sharing a common side bisected by the fulcrum. But it seems to be much more general than that.

> _I had thought it was because there is more mass acting on the point of > rotation (longer lever = more mass)._

Nope. You can try using a pair of scissors or a folding ladder as a lever, or pull in different directions on the end of a fixed-geometry lever. The lever's mass doesn't change, but the leverage certainly does.

<comment><USER59> A generalization which applies to levers, pulleys, and hydraulics is mechanical advantage while conserving energy. You have a system with input work and output work (energy) that are the same, ignoring frictional losses.

Recall that work is force over distance. The mechanical system relates the input and output distances by a scalar coefficient. Since the working distances are related by a ratio, the working forces are related by the reciprocal of that ratio.

You can find the lever and fulcrum ratio with simple geometry. The input and output lever segments are radii, and the travel is distance along two arcs. Since the arc length is directly proportional to radius, the ratio of lever radii translates directly to the same ratio of arc lengths, and the reciprocal ratio is the force multiplier. Your 10:1 lever sweeps 10:1 arc lengths and balances with 1:10 opposing forces.

<comment><USER14> Yes, that's an excellent point, but I think the lever law is more general than that. For example, it continues to apply when the lever in question is stationary, even though no value of the forces involved would violate conservation. In fact, it holds to higher precision in that situation because your measurements aren't confounded by vibration and accelerating masses.

Maybe you can derive it from some kind of generalization of Hooke's Law to cover nonlinear stress–strain relationships, elastic hysteresis, anisotropy, viscoelastic behavior, and so on, but it's not obvious to me what that would be. Also, I feel like the concept of angular moments acting to produce angular acceleration is simpler and more general than all that stuff, but I'm not sure if conservation of energy and geometry alone are sufficient to derive it.

</comment></comment></comment></comment></comment></comment><comment><USER60> Seymour Papert writes in the introduction Mindstorms about he was fascinated by gears as a child and spent much time playing with them, and what he learnt through play provided a valuable intellectual foundation for learning many elementary and advanced ideas in mathematics.

[http://www.papert.org/articles/GearsOfMyChildhood.html](http://www.papert.org/articles/GearsOfMyChildhood.html)

</comment><comment><USER61> I am super impressed by the smooth animation and the graphic design of the elements.

I wish this were all open source so I could just copy it in to a project I'm in the middle of.

Very inspiring.

<comment><USER62> There are 30(!) different animations on this one blog post alone.

The work he put into this is admirable. A great education tool.

</comment></comment><comment><USER63> That gif at the top reminds me of an IQ test I took in 6th grade. There was an entire section where they would show you a sequence of gears and tell you what direction one of them was spinning. Then they would ask you what direction some other gear was spinning.

They all looked like that first gif (but not animated of course).

</comment><comment><USER64> Seymour Papert's childhood (cf. "Mindstorms" [1] introduction) obsession with gears sprung to mind.

[1] [http://worrydream.com/refs/Papert%20-%20Mindstorms%201st%20e...](http://worrydream.com/refs/Papert%20-%20Mindstorms%201st%20ed.pdf)

</comment><comment><USER65> This is awesome. I wonder if the author could be convinced to participate in a similar discourse on the subject of gears, as they relate to audio synthesisers?

Pretty much all the modern synths these days have infinitely lubricated gears and pulleys in them, pushing those speaker cones/amp inputs ..

</comment><comment><USER66> Maybe I'm misremembering but isn't torque usually expressed as a cross product of force and radius?

(Making pound-feet the pedantic but correct phrasing of the colloquial "foot- pounds")

That way the torque vector points in the direction that a screw would move if you turned it in the direction it's being forced.

<comment><USER67> That is the correct way to express torque with vectors.

The definitions in the blog post are not vectors, they are scalars and the dot is not a dot product, just multiplication. (F_t there is what is commonly notated as F_perpendicular). I agree it is confusing to those of us used to seeing bold letters usually used for vectors (and I would argue that using more conventional notation at even a basic level is better), but it's not wrong.

</comment></comment><comment><USER68> This is Also a very helpful GIF how a gearbox in a car works

[https://mobile.twitter.com/moo9000/status/121019063004082176...](https://mobile.twitter.com/moo9000/status/1210190630040821760)

</comment><comment><USER69> Bravo for the author for such a captivating interactive blog post. Works great on mobile!

</comment><comment><USER70> This is great! The visual representation of rotation speed at each point makes a confusing subject much clearer. Is anyone familiar with the gear wars? I know it wasn't all about the gears, but I would love to get more insight into it

</comment><comment><USER71> This looks pretty fantastic on mobile. Nice and responsive. Great animations. Good job!

</comment><comment><USER72> A fun one to watch afterwards: [https://www.youtube.com/watch?v=5q-BH- tvxEg&feature=emb_titl...](https://www.youtube.com/watch?v=5q-BH- tvxEg&feature=emb_title)

</comment><comment><USER73> Works fine with noscript and ublock active.. wish all sites played this well

</comment><comment><USER74> This is very well done. Interactive textbooks should look like this.

</comment><comment><USER75> I would need additional proof that gears were designed with many of these mathematical considerations in mind and didn't just arise out of trial and error by the machinists

</comment><comment><USER76> Wow!. I always blank out when my MEs talk to me about Gear ratios and TOrque when designing Electro mechanical systems. This is really helpful. Thanks for making this.

</comment><comment><USER77> Oh my! These animations are sooooooo satisfying to look at!

</comment><comment><USER78> This is a really awesome article and brought me back to intro physics class, saving it and will return to it in the evening so I can fully digest :) Thanks!

</comment><comment><USER79> [https://youtu.be/Q-XOM4E4RZQ](https://youtu.be/Q-XOM4E4RZQ) An awesome video on making gears.

</comment><comment><USER80> This is beautiful. Great explanations, and a really powerful interactive website. A really impressive and engaging page to pull it all together.

</comment><comment><USER81> The writing and interactive examples are really amazing. Would deffo read the entire series of articles. Gonna bookmark it.

</comment><comment><USER82> Very nice!

These animations are running in a <canvas>.

Any idea what the author used? Is everything produced with math (eg: a gear solver, etc)?

<comment><USER34> I was wondering the same!

The author appears to be using his own functions written in vanilla JS. The Gears page loads a custom Canvas library base.js [1] plus an page-specific gears.js [2]. iOS graphics appears to be an area of expertise [3] for the author.

[1]: [https://ciechanow.ski/js/base.js](https://ciechanow.ski/js/base.js)

[2]: [https://ciechanow.ski/js/gears.js](https://ciechanow.ski/js/gears.js)

[3]: [https://github.com/Ciechan?tab=repositories](https://github.com/Ciechan?tab=repositories)

(P.S. <canvas> is an interesting choice, I had expected <svg> before opening the page inspector. Separately, I love the creative use of TLD in the domain name.)

<comment><USER82> Thanks for the JS files.

Would be nice to know about his process.

Here it appears he is importing the graphics from somewhere else converted to imperative drawing code:

[https://imgur.com/jFpN0f3.jpg](https://imgur.com/jFpN0f3.jpg)

<comment><USER83> That's just a function that draws a spanner.

<comment><USER82> Obviously, but my point is that if you look at the coordinates these do not seem to have been handwritten.

</comment></comment></comment></comment></comment><comment><USER84> For the author: adding support for touch events, or using normal HTML sliders would be helpful.

<comment><USER85> Curious: does something not work for you? If so, what platform are you using? Asking because it works perfectly for me on mobile...

<comment><USER84> I was on a Chromebook with a touchscreen. Maybe you do "platform detection" and don't register touch handlers on laptops. I haven't looked at your code (I didn't see a repository link and I didn't bother looking further).

Cheers on the cool demos, I think it could be the start of a great resource for elementary school teachers introducing machines. I know this sort of thing would have been great when I was in grade 3.

<comment><USER85> Sorry, I didn't mean to imply I was the author - I was just curious what failed. Thank you for the explanation! I agree that OP made cool demos. :)

</comment></comment></comment></comment><comment><USER86> That diagram with the wrench and force increasing as the radius decreases should be linear.

</comment><comment><USER87> Great article. How did you make those images with sliders? Any tool or library you used?

</comment><comment><USER88> High quality content. Thanks OP!

</comment><comment><USER89> I remember learning gear size ratios in sixth grade math class with special LEGO sets.

</comment><comment><USER90> Must have been an insane amount of work to put this together - well done!

</comment><comment><USER91> This is incredible, and apparently every other post on that site is too.

</comment><comment><USER92> i'm so happy for the global pause button in this article

</comment><comment><USER93> > The considerations behind real world gears are much more complicated than > what I've presented

Nah... Nah I would say you pretty much nailed it in this blog post! Incredible. HN Gold right here.

</comment><comment><USER94> How are these animations implimented?

</comment><comment><USER95> Incredible. Thanks for posting this.

</comment><comment><USER96> Cute explanation; Thank you;

</comment><comment><USER97> This is a beautiful article.

</comment><comment><USER98> This is a beautiful article

</comment><comment><USER99> Can you 3d print gears?

<comment><USER100> Absolutely, they even work for a while.

The Youtube channel "Gear Down for What?" has some pretty cool planetary designs.

[https://www.youtube.com/c/GearDownForWhat](https://www.youtube.com/c/GearDownForWhat)

<comment><USER99> Why only for a while?

</comment></comment></comment><comment><USER101> Hi guy so thx

</comment><comment><USER102> Amazing work!

</comment><comment><USER103> Lovely work, thanks!

</comment><comment><USER104> The illustrations are what draws attention and they are very nice and informative.

In context of parallel HN discussion¹ on merits of animated SVG, I consider it a loss for open standards that these animations are not made in SVG. If you try to inspect this page, the design and animation is hidden behind canvas and some (nicely written BTW) imperative javascript. It is hard to replicate, and hard to compose with other elements. The illustrations are completely white when disabling JS, which is less than ideal graceful degradation. Some people would argue that executing custom scripts should not be required to show animated graphics, even if it includes basic interactivity.

For comparison, visit this page² and try to 'inspect' animated graphics. Observe the SVG element in DOM and see how it changes when you scroll. Just by spending few minutes exploring you could probably recreate them, or at least reuse them somewhere else. We still don't see what's driving the animation (also JS), so that could still be improved using SMIL, but there is obvious benefit for using SVG here.

Don't take me wrong, it is really a nice article with very pleasant and clear animations. I'm merely speaking from perspective of open standards, and technology stack that provides good foundation for building complex illustrations. The author is not to blame here, as we lack decent tools for declarative graphics/animations.

¹ [https://news.ycombinator.com/item?id=22297461](https://news.ycombinator.com/item?id=22297461) ² [https://www.opencrux.com/](https://www.opencrux.com/)

<comment><USER105> > The author is not to blame here, as we lack decent tools for declarative > graphics/animations.

Please show me the pure SMIL declaration for a pixel-exact replica of the example from the wonderful article: number and size of teeth on a spinning gear scales based on the horizontal position of a draggable slider.

On a related note: this wonderful article is an article. The next time an HN article about web complexity triggers another HTML Class of 4.01 Reunion, it would be great if admirers of this article would post the link and force them to reveal the true depths of their asceticism.

I think I win either way. If there really is an SMIL solution then then the 4.01 grumps would be forced to backport declarative graphics/animation into their nostalgia. If not, then my point stands.

<comment><USER104> Can you explain what is it that you win? Because the current state where it takes a talented programmer + mathematician + designer to create this kind of content is loss for everyone.

No, SMIL on its own cannot replicate these illustrations. I hope that some future standard for declarative reactive graphics will be able to.

</comment></comment></comment><comment><USER106> The diversity of topics, hand-crafted graphics, and quality of explanation on all the posts on this blog remind me a lot of Andrew Glassner's columns from IEEE CG&A. Really delightful work (in both cases).

</comment><comment><USER107> > Almost by definition, the second hand of a clock rotates at 1 rpm

Minute hand, surely ;)

<comment><USER108> The minute hand would be one revolution an hour.

<comment><USER107> Hoist by my own petard!

</comment></comment></comment><comment> globular-toast While I appreciate the beauty this piece, I can't help but think of the irony of such a complicated piece to explain something which mechanics and engineers, who actually use gears, understand completely intuitively.

<comment><USER109> Why is it ironic? The target audience clearly is not mechanics and engineers who actually use gears.

</comment></comment><comment><USER110> _sigh_

If I don't post it someone else will. Here's the spinning levers video you've all already seen a million times:

[https://www.youtube.com/watch?v=JOLtS4VUcvQ](https://www.youtube.com/watch?v=JOLtS4VUcvQ)

<comment><USER111> It's been posted on HN a few times too, although without much discussion.</comment></comment>


Hong Kong goods for export to U.S. to be labelled made in China - <AUTHOR> https://www.reuters.com/article/us-usa-trade-china-hongkong/hong-kong-goods-for-export-to-u-s-to-be-labelled-made-in-china-idUSKCN2570UT <comment><USER2> I though they were already labelled "HK, China", or "HK, SAR" because China itself wants to make it clear, although 'SAR' probably means nothing to most people.

In any case this sounds like PR spin from the US more than anything else.

</comment><comment><USER3> Well, ain't that the truth?</comment>


Apple Refuses to Unlock Terrorist's iPhone - <AUTHOR> https://www.inc.com/jason-aten/apple-wont-help-fbi-unlock-a-terrorists-iphone-heres-why-it-shouldnt.html <comment><USER2> Although I favor privacy and I'm against backdoors, I am not entirely sure how I feel about this. Luckily, Apple says they cannot do it; but, what if they could?

The individual is dead and there is no question about his guilt. This is not a case of rushing to judgement, like was done with Richard Jewell,

In this particular case, if not a terrorist, this guy had issues. Should we be able to access his phone to see what warning signs there were, which might help us identify others with similar issues?

If indeed a terrorist and working with others, shouldn't we be able to get information that might help identify those others?

How much privacy do you give a dead terrorist/criminal?</comment>


Kensho's AI for Investors Just Got Valued at Over $500M in Series B - <AUTHOR> https://www.forbes.com/sites/antoinegara/2017/02/28/kensho-sp-500-million-valuation-jpmorgan-morgan-stanley/ <comment><AUTHOR> And we're looking to grow our team in Boston and New York. Check out our careers page for more information: kensho.com/careers</comment>


Jobs at Apple-Search - <AUTHOR> https://jobs.apple.com/us/search?job=36607344&openJobId=36607344#&openJobId=36607344 <comment><USER2> This could explain the User-Agent "apple/0.1" that has started showing up in apache logs from IP addresses starting with "17."....

</comment><comment><USER3> It could be app search, pretty much everything about discovery on the App Store sucks right now.

<comment><USER4> I agree, Apple has a lot of efforts going on right now, I doubt they want to tackle Web Based Search (ala Google)... though it's just one position.

<comment><USER5> If anything, web search would be counterproductive for them. Google likes search because you see ads on search results then go to other pages and see more ads.

Apple doesn't have that incentive; if anything they want to keep you in the App Store's curated experiences. Why send someone to an Open Street Maps website instead of one of the various OSM clients on iOS where you can get extra features via in-app-purchase?

<comment><USER2> Maybe they actually just want their end users to have a great web search experience? They added DuckDuckGo as an option to their OSes recently and I'm sure they would be happy to not feed any more traffic to Google than strictly necessary.

It could benefit Siri making the built in web search more intelligent instead of leveraging a 3rd party API who might even charge for access since there's no ads.

It might even sell more devices if they make it an Apple device exclusive service, or at least as a gateway to lure new customers kinda like the online versions of icloud/pages/numbers/keynote.

</comment></comment></comment></comment><comment><USER6> I am doubtful this is to take on Google directly, and I am sincerely doubtful that they'd be able to pull it off if it was. Microsoft funneled billions in to competing, and it has mostly fizzled. Google has had too much of a head start to be competed with head-on.

<comment><USER7> Apple has two things Bing & Google don't:

1) an ad-free business model

2) control of Siri & Spotlight, the native search functions on a huge swath of devices

I'd say they have a fighting chance.

<comment><USER8> A fighting chance of what? Unless they monetize search, it's just a cost. What ad-free business model can monetize search?

Unless they are paying Google a fortune to be the current engine, and rolling their own is cheaper. This seems unlikely.

<comment><USER7> > What ad-free business model can monetize search?

The one where you make craptons of profits selling high-margin devices that come bundled with services that offer ad-free user experiences and maximum privacy.

And it's Google that pays Apple a fortune to be the current engine, not the other way around. Just to give you an idea of who holds the cards here.

<comment><USER9> There is no way they would make enough from iPhones/iPads to pay for the costs of building and running a competitive web search engine. (At least not one built like Google and Bing are)

There is a reason they take a cut of profits from App developers; it's to help pay for the cost of running the App store.

<comment><USER10> They're generating profits at a rate of $200 Million per day [sic]. It's fair to say they make enough to pay for the costs of almost anything, including this. You've identified the one requirement they can in fact satisfy; the hard part is... everything else.

Edit: Clarity

<comment><USER9> You may be right.

Assuming you're right about their profits, that's 18B per quarter. Operating cost have been said to be around 5B per quarter for Google and 1.25B per quarter for Bing.

<comment><USER7> Source please?

Bear in mind they're already running their own competitive map service for exactly the same reasons I say they want to run their own web search. And that's probably not cheap either.

<comment><USER9> My source for the costs of Google: [http://www.datacenterknowledge.com/archives/2014/07/23/from-...](http://www.datacenterknowledge.com/archives/2014/07/23/from-112-servers- to-5b-spent-on-google-data-centers-per-quarter/)

"Google data centers cost the company more than $5 billion in the second quarter of 2014"

My source for the costs of Bing: [http://www.businessinsider.com/microsoft- bing-losing-billion...](http://www.businessinsider.com/microsoft-bing-losing- billions-2011-4)

"Put differently, Bing is spending $5.5 billion a year to generate $3 billion of revenue." (I divided by four to get quarterly)

GPS data is not really on the same level as Web Crawl data. How often is a street added or changed versus a web page?

<comment><USER7> 1\. $5B is super way off. First of all you are lumping one-time construction costs in with the incremental costs of running the data centers. The article clearly states the bucket in which data center operational costs are included is $2.82B.

2\. Even that bucket is a grab bag of other costs as well such as amortization of acquired assets (not necessarily for data centers). Additionally while web search is major it is certainly not the only thing that Google data centers do; for example they run Gmail and an AWS competitor on it. So it's very hard to determine just what the operational cost of web search is, but it's certainly well under $2.82B.

3\. The Bing article clearly states its major cost increases are "costs associated with the Yahoo! search agreement and increased traffic acquisition costs", i.e. promotional not operational costs. This is not applicable to Apple, who already _gets_ paid for traffic.

4\. As for maps it's not just GPS data, it's road and signage and building data including visual imagery. That's many orders of magnitude more expensive to gather than loading a web page (even loading it 1000 times). You have to roll trucks and fly planes. In fact there was just a story yesterday about Apple rolling trucks to start gathering competing "streetview" data.. all from scratch.

<comment><USER9> Chatting about this with you made me challenge my knowledge of how web search works. Many articles I've found suggest that the hardest problem to solve isn't competing on the size of Google but the relevance of Google. Which is partly to do with the size and power of their datacenters. But also to do with smart engineering of the servers, database, and algorithms. The algorithms not only determine the how to order the results but which pages to crawl and how often.

What this all makes me think of is all the work being put into AI research lately. IBM, Google, Facebook, Baidu etc. There is a race to AI and the winner could very well make a better Google.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER11> I think it's more likely associated with Spotlight vs a web search engine

<comment><USER12> Or a better search tool through all itunes content ( apps, books, courses, etc).

<comment><USER13> Agreed. And to do this "local" search you could imagine it being much better using signal from the web (who is linking to what content in iTunes, etc).

</comment></comment></comment><comment><USER14> I've wondered to myself why they didn't buy DuckDuckGo and just integrate. I'm sure there are 1000 good reasons not to do it, but I did wonder it to myself. Especially since they seemed to put it in the spotlight with the iOS8/Yosemite release. Privacy is now a legitimate selling point and people would probably be willing to pay for services and tools that value that. But I guess there is no value in buying it so that would be why.

</comment><comment><USER15> Possibly not significant, but I noticed the location's given as San Francisco - normally, Cupertino-based positions are tagged as "Santa Clara Valley".

</comment><comment><USER16> Just curious, but what salary do you think an "engineering product manager" at Apple makes?

<comment><USER17> [http://www.glassdoor.com/GD/Salary/Apple-San-Francisco- Salar...](http://www.glassdoor.com/GD/Salary/Apple-San-Francisco-Salaries- EI_IE1138.0,5_IL.6,19_IM759.htm?filter.jobTitleFTS=Engineering+Project+Manager)

</comment></comment><comment><USER18> Search != Web Search.

Besides web crawling almost seems quaint nowadays, they have other data they could better unearth or improve existing search functions.

</comment><comment><USER19> That job ad doesn't indicate that Apple is going into the search business. Getting into search would need a bigger team.

Given the publicity, this may be a bluff by Apple. Yahoo did something similar. In early 2014, Marissa Mayer announced that Yahoo was going to build their own search engine. Nothing happened. That seems to have been a ploy to get a better deal from Bing.

<comment><USER20> > Nothing happened.

First hand or just based on trend?

<comment><USER19> Yahoo never staffed up to build a search engine. That would have been noticed in Silicon Valley. They hired a VP for search whose previous area of expertise was negotiating with Microsoft.

</comment></comment></comment><comment><USER20> I suspect content search. Imagine people's home filled with Apple TV, Macbook and iPad. Now what you need is content search. TV program search is done, and it isn't really much exciting than Netflix's suggestion. What about content people bought? Browsing history? Payment history? Medical? Calendar? Travel? Weather? They have a whole ecosystem they built since last release. As other speculates, a refined but better, unified version of spotlight, not just for iOS or OSX, but a truly search with their devices connected. With Sri now you can ask at home like Amazon's Echo, or ask Sri when you are driving. Content search is what matter these days.

</comment><comment><USER21> If there is one company that has the pockets and audience big enough to compete it is Apple. They will have to a hire an enormous number of the best search people to do it though.

<comment><USER22> As with a few of their other skunkworks (POWER->X86) we have no way of knowing if they've already been hard at work on it for years and years.

<comment><USER23> The Apple Maps experience is evidence against that, though. We know that they were working on maps for years and things like PoI search were among the biggest issues. I find it hard to believe they would have done that badly if they had an in-house search team (if only because such a team would have been good at flagging problems and suggesting solutions).

<comment><USER21> I agree. I don't think you can hide hiring the right search people. They have pulled in a few search companies, but nothing at the scale necessary (e.g. Topsy).

</comment></comment></comment></comment><comment><USER24> > ... detailed oriented projects

...

</comment><comment><USER25> Apple was at Lucene Revolution in DC this past fall. It's a little silly IMO to extrapolate too much from a job posting -- Apple has had a large search infrastructure for a long time, as do most tech companies.

</comment><comment><USER26> I'm really not sure why people think Apple would get into the web search business. Web search represents just a fraction of the total advertising spending that other web companies like Facebook aren't even bothering to chase Google for it. Google's stock has been in the toilet this year because their core business is facing shrinking ad margins from the shift to mobile, it doesn't make any financial sense to get into that business.

Add that to the fact that this is completely out of Apple's wheelhouse and their history of relatively never straying out of their circle of competence and it should be pretty clear that this isn't for web search.</comment>


What It's Like to Write Software on a Team - <AUTHOR> https://obaidfarooqui.com/2019/12/12/what-its-like-to-write-software-on-a-team/ <comment><USER2> Brilliant article, I sometimes think the same :)</comment>


Plastic Has a Big Carbon Footprint – But That Isn't the Whole Story - <AUTHOR> https://text.npr.org/s.php?sId=735848489 <comment><USER2> One thing that irks me is SF city rushing to enact laws and code of varying types to address perceived wrongs. But they rush to it. They want to signal that they are thoughtful and progressive. So they often grab at shiny things without understanding the full impact. Oh, someone at UC Davis did a study which showed something we agree with, let's go with it! These are hi-viz, low impact measures. Often they are counterproductive. Like the ban on straws. As if that's the biggest threat that must be addressed with utmost urgency. Housing problem: oh, rent control!

<comment><USER3> The straw ban might be "small beans", but I can't think of a reasonable argument that it's counterproductive. Let's refocus: you sound hostile to any perceived threats to profit, which are unfortunately some of the most direct paths to reducing our impact on the Earth.

</comment></comment><comment><USER4> This article seems to directly contradict other articles that say cotton bag production is equivalent of 7000 plastic bags in terms of greenhouse gases

<comment><USER5> I havent heard 7000. I'm not sure where you got the direct contradiction?

Here's one saying 131 uses [1].

Cotton isnt actually all that green though. And as the article points out plastic bags can be very light weight so aren't _that_ bad. If I were choosing a boogie man, plastic bags wouldn't be top of the list. But I wouldn't be using a reusable cotton bag either.

[1] [https://assets.publishing.service.gov.uk/government/uploads/...](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/291023/scho0711buan- e-e.pdf)

Edit: This is actually linked to from the article.

<comment><USER6> A re-usable bag is always better IMO, as it does not generate trash, while single use plastic bags are often disgarded right away

<comment><USER5> In the cotton bag example, I believe the 2 big factors that make them not great is water usage, and chemicals for bleaching etc. Is bleach getting pumped into a river better or worse than a plastic bag that gets ingested by an animal? I wouldn't say the chemicals aren't trash either.

Plus in these situations im reminded of before I had a car, I'd walk to the shops, and not wanting to lug around a load of reusable bags I got disposables and walked home. What's the better option there? Car and reusable bags, or walk and disposables?

Having said all that I'd agree with you.

<comment><USER7> > Plus in these situations im reminded of before I had a car, I'd walk to the > shops, and not wanting to lug around a load of reusable bags I got > disposables and walked home. What's the better option there? Car and > reusable bags, or walk and disposables?

The better option is that you don't get the choice and you just deal with taking bags with you. "Lugging bags around" is a bit over the top, don't you think? Even the massive IKEA style bags fit in a back pocket.

I used to just bring a big military style backpack to the shop.

</comment></comment></comment></comment></comment><comment><USER8> Easy way to half the footprint of anything: use it twice. Not very hard and more effective than many other suggested alternatives.</comment>


Developing for the Amazon Echo - <AUTHOR> https://medium.com/@genadyo/developing-for-the-amazon-echo-2578339992dc <comment><USER2> I'm actually impressed by the level of detail provided in the rejections. There's nothing worse than getting a rejection that does not clearly state the reason for the rejection and a path to resolution. Apple and especially Google are notoriously bad about this.

<comment><AUTHOR> Yeah, it was half QA process.

</comment></comment><comment><USER3> You definitely can get an Alexa skill off the ground without using Lambda, but there are a lot of little details with their authentication to work out. I'd highly recommend one of the libraries that are out there:

Go - [https://github.com/mikeflynn/go- alexa/tree/master/skillserve...](https://github.com/mikeflynn/go- alexa/tree/master/skillserver) (full disclosure: I created this one)

Offical Java SDK - [https://developer.amazon.com/public/solutions/alexa/alexa- sk...](https://developer.amazon.com/public/solutions/alexa/alexa-skills- kit/docs/using-the-alexa-skills-kit-samples)

Node - [https://www.npmjs.com/package/alexa- app](https://www.npmjs.com/package/alexa-app)

...to name a few.

<comment><AUTHOR> Thanks

<comment><USER4> Shameless plug for my node skills framework[1] if you want something a little more flexible than alexa-app. Has express support as well[2].

[1] [https://www.github.com/nickclaw/alexa- ability](https://www.github.com/nickclaw/alexa-ability) [2] [https://www.github.com/nickclaw/alexa-ability-express- handle...](https://www.github.com/nickclaw/alexa-ability-express-handler)

</comment></comment></comment><comment><USER5> This article sums up my recent experience trying to get a skill published. It was slightly frustrating to receive multiple rejection emails, but at least the responses were detailed and helpful.

While building some skills for fun, I also made some gulp tasks for locally testing skills and deploying the code to your lambda. [https://github.com/tmcleroy/alexa-skills](https://github.com/tmcleroy/alexa- skills)

</comment><comment><USER6> I built a similar app for Chicago's CTA trains, called CTA Tracker. There seem to be train tracker apps for most major cities, since they're easy to implement and legitimately useful.

</comment><comment><USER7> Nice write up! I can't wait to start developing for my Echo!

<comment><AUTHOR> Just do it!

</comment></comment><comment><USER8> Aside:

> NextTrain {FromStation} to {ToStation}

Does Echo have some concept of scoping for these skills? Or do you have to opt-in to the skill?

<comment><USER9> You have to opt into the skill by enabling it via the app that was mentioned in the post.

</comment></comment><comment><USER10> Great write up. I wonder how developers can actually profit from developing apps for echo

</comment><comment><USER11> damn, this changes a lot. I was scared of Amazon Echo (or any other retailer's product) listening to me 24/7, but I guess it can't be avoided

<comment><USER12> Why would you be scared? The keyword(s) is processed locally, and it only sends the request following the keyword over the wire. If they tried anything fishy, such as sending everything it hears over the wire, then they would be outed within a day.

<comment><USER13> It also makes a sound (tho not by default) and lights up whenever it's listening.</comment></comment></comment>


Free Online Guide for Apache Wicket framework - <AUTHOR> http://wicketguide.comsysto.com/

<comment><USER2> The big issue I have with Wicket is that it seems more suitable for the web we had 5 years ago than the web we have today. These days we have static html/css/js that accesses data through a json api. Wicket is really not a good platform for this.

If you like the Java ecosystem and really want some top notch tooling, I'd recommend the following:

      JAX-RS for the JSON API (eg Jersey )
      Atmosphere for data push and updates (pubsub, websocket)
      GWT for the frontend html/css/js (good integration with
        Jersey via RestyGWT)

<comment><USER3> Wicket isn't suitable for highly scalable or single page applications as is (the ones which benefit from a rich client side and a stateless API approach). It is highly productive for typical backoffice applications though. The only problem is the complexity of the framework - writing custom reusable components is really hard.</comment></comment>


Peter Thiel & Max Levchin: "Silicon Valley Lacks Radical Innovation" - <AUTHOR> http://www.siliconvalleywatcher.com/mt/archives/2011/02/top_paypal_alum.php <comment><USER2> _A lot of what our parents generation did: building interstate highways, Manhattan Project, etc, could not be done today._

Being the only remaining superpower (and having little global military competition) really takes the wind out of government's sails of achievement.

Interstate highways, the Manhattan project, the space program, national infrastructure, aerospace, much medical technology, and even computers were all borne out of military necessity. With so many bad guys around the globe, only a traitor could vote against these things.

Our parents built the stuff needed to save the world. We're building better ways to instantly share our bowel habits. I don't know whether to laugh or to cry.

<comment><USER3> Blah Blah Blah. Social networking was crucial for a country of highly oppressed people to overthrow their tyrannical government. Doctors can identify diseases from their phone in a way that would have taken days, we can de-salt water in way that is practical. New times, new problems.

Our generation is pushing innovation at a speed that is unparalleled, don't confuse the 47 fart apps in the app store as a complete misappropriation of focus.

<comment><USER2> _Blah Blah Blah._

Normally, I ignore such responses, but how could I resist bait like that?

 _Social networking was crucial for a country of high oppressed people to overthrow their tyrannical government._

Ahh, the jury's still out on that one. Let's see how much less tyrannical the next government is. I bet not much.

 _Doctors can identify diseases from their phone in a way that would have taken days_

To what purpose? This is the first generation with worse health and life expectency than its parents. What good is providing so much technology at so much cost to those who push so little value out of the other end of the pipeline?

 _New times, new problems_

No question. All I'm wondering is, "Where is the new value?"

 _Our generation is pushing innovation at a speed that is unparalleled_

Versus what? Citing, please.

Hmmm, lets see...

From 1910 to 1960: The masses received first value from the automobile, the airplane, the telephone, radio, television, electricity, indoor plumbing, sewage treatment, and antibiotics.

From 1960 to 2010: We can carry our phones with us. Cool.

 _don't confuse the 47 fart apps in the app store as a complete misappropriation of focus_

Opps, I completely forgot about smart phones. I was referring to all the instant communications we now have that produce so much activity and so little value. Is that all we've got?

<comment><USER4> > From 1910 to 1960: The masses received first value from the automobile, the > airplane, the telephone, radio, television, electricity, indoor plumbing, > sewage treatment, and antibiotics. > From 1960 to 2010: We can carry our > phones with us. Cool.

Not to be overly pedantic, but just to compare correct time periods: electrical distribution really got running in the 1890s, the telephone also is from the late 1800s, etc.

1960 to 2010 brought space exploration, the internet, economical airplane travel, computers, all sorts of cures/treatments for diseases, pretty much 100% of what is now called microbiology, and yes.. even mobile phones.

Just 15 years ago it was such a pain to get things done, due to the lack of widespread web and email. Some may say otherwise, but I feel life is much easier now - at least for those who can use the technologies well.

<comment><USER5> The pace of innovation in America has slowed, though, as the government has consumed a greater share of GDP. For example, cellphone technology was invented in 1947 but was stifled by the FCC for a generation.

</comment></comment></comment></comment></comment><comment><USER6> I think one of the big reasons you don't see startups changing the world anymore is that the name of the game has changed from 'go public' to 'get acquired'. Many game changing technologies that big companies have released in the past 10 years (since the dot-com crash) have been through acquisition. With the IPO market now completely stagnant, its nearly impossible to aim for a public offering... and your investors want an exit.

Its not about changes in innovation, its about changes in exit strategy.

<comment><USER7> I'm not one to bash software, but software only goes so far in radical innovation.

I think the reason you don't have the radical innovation is because everything has tipped heavily towards web and consumer/convenience oriented innovation. This isn't a bad thing, the costs for writing code are much smaller than R&D costs for most anything else, and it puts people to work and solves problems.

There are still some companies like Tesla/SolarCity in the valley (or technically, on the East bay) changing the name of the game, but even Tesla is valued less than Groupon, for instance.

<comment><USER8> I think this is one of the key factors: most of the buzz today is orienting on what amounts to entertainment for the moneyed. Since the moneyed, well, have money, they buy it, and thus the company does well.

What makes my life 1% more fun does nothing for someone in a third-world country. This is compared to, say, 50 years ago, where something that made my life better, e.g., an advance in refrigeration tech, could be distributed out to the third world better. I'm pulling examples out of a hat here, and I'm sure that other and better examples could be found.

There are a ton of more fundamental projects done by companies, people, and universities out there. But they don't get the buzz right now, _generally speaking_.

</comment></comment></comment><comment><USER9> _Max Levchin: Groupon is probably under-valued. The fastest growing company ever. I came across a startup recently that had a Powerpoint and no engineers, no product and it had a $16 million valuation. That's an over-valued company._

Interesting how different his opinion of Groupon's valuation is from the prevailing sentiment.

<comment><USER10> Groupon has had pretty huge revenue growth and is currently bringing in some hundreds of millions of dollars a year in revenue.

Skepticism about the ability to maintain that growth rate, and the suspicion of many (especially here) that they're burning bridges with the companies they work with put a high valuation in doubt, but that's a matter of opinion at this point. Evidence that Groupon is having any trouble finding partners to offer coupons is so far anecdotal.

I never thought there'd be this much money in coupons, but so far it looks like it's a great business model. It wouldn't shock me if those valuations were true.

</comment></comment><comment><USER11> How does "valuations are all over the map" jive with "there is no bubble in tech"? If a lot of tech companies are being systematically overvalued, isn't that the definition of a tech bubble?

It's also no secret that monetary policy is as loose as ever, so it doesn't take a lot of dot-connecting to see which forces are driving these valuations, especially with Fed bedfellows like Goldman are getting involved. Would people be so willing to throw their cash behind 10-100x PE companies if they had to obtain that cash at market rates and without implicit government backstopping of losses? I'm sure no one involved in tech investing wants to recognize this situation for what it is, but come on now, anyone can see that something's fishy.

<comment><USER12> I think a tech bubble generally means that nearly everyone is overvalued.

<comment><USER11> A sector being overvalued as a whole isn't enough? Perhaps the bubble is really focused on particular segments within what is generally known as 'tech', but it still seems like the most appropriate label.

<comment><USER12> I didn't realize they said the sector was overvalued as a whole. That is sufficient. I just caught the part that valuations were all over the map, which to me means that some companies are overvalued and others undervalued, but no significant trend one way or the other.

</comment></comment></comment></comment><comment><USER13> 1950-2000 was one of those rare moments in history when industries (whole states, countries even) could coast on regular, incremental improvements to a single world-changing technology. SV was in the right place at the right time, and never totally lost it's edge. But the semiconductor and software industries are mature now, and spread much more widely than thirty years ago. SV still retains many advantages, but you can't get blood from a stone. The radical, disruptive stage of digital technology is over.

</comment><comment><USER14> Money quote: "Too many companies are featurettes."

</comment><comment><USER15> _ML: There is not enough radical innovation in Silicon Valley. Focus is too narrow. Too many companies that are featurettes._

Companies…like Slide?

<comment><USER16> Maybe that's how he formed his opinion? He spent years catering to the whims of 14 year old girls. It failed.

</comment></comment><comment><USER17> They're right. Silicon Valley has become enamored with the overnight success, which is usually attributable to fashion rather than innovation. Real innovation often takes a long time to catch on, since by definition it goes against conventional wisdom. VCs don't want to get rich slowly, and entrepreneurs are following their lead in chasing hockey-stick growth curves, which are a lot easier to come by in fashion than they are in technology.

</comment><comment><USER18> That was a great event, and that discussion sparked quite a bit of debate between my two friends and me over dinner afterwards. (Actually, you can see the three of us sitting in the front-right-most seats in the photo!)

In my opinion, the notion of "radical innovation" depends on one's point of view: one could argue that, although the spectacular innovation during the space race, e.g, like landing a man on the moon, was indeed remarkable, it was, for all practical intents and purposes, little more than a political publicity stunt to the average individual, i.e., it did not have a profound effect on a personal level.

In contrast, the developments of the past 20 years -- internet, cell phone, facebook -- have profoundly changed individuals around the planet.

I don't think the question should be whether a thing is more or less innovative than another thing, but rather what effect the thing has had on a group of people on an individual level.

</comment><comment><USER19> You can't expect radical innovation every day. It takes time, just like it took time to build streets, cars, airplanes and mobile phones (50-100 years). We could however hope that the intervals between radical innovations are shorter, now that we have a more efficient way to use technology.

IMO Google brought radical innovation and it is only what, 10-12 years old? The next big thing is probably in works, but we can't foresee the future so we'll know that is radical, when it's here.

</comment><comment><USER20> Peter Thiel: "Everything is short-term focused no one is looking into the future, 15 to 20 years like they used to in our parents' generation. A lot of what our parents generation did: building interstate highways, Manhattan Project, etc, could not be done today."

This from a huge libertarian?

<comment><USER21> _This from a huge libertarian?_

Being a libertarian doesn't conflict with wanting to be forward looking, or with wanting to do ambitious projects. And a "small 'l' libertarian" might even be OK with the State managing the construction of something like the Interstate highway system. A "Big 'L' Libertarian" would oppose funding such a project through coercive, involuntary taxation, but wouldn't necessarily oppose the idea in itself. They would just argue that a means of funding should be found that doesn't involve coercion.

That said, I don't know Peter Thiel and I don't know how deeply his libertarian roots run, or how much of an ideologue he is. There are a lot of people who call themselves libertarians that I wouldn't necessarily call libertarians myself. <shrug />

<comment><USER22> Libertarian has been diluted to meaningless.

These days, if you go by majority vote, it generally means "doctrinaire conservative who decided deficits were really important on January 20th, 2009".

<comment><USER23> Here are some articles by libertarians criticizing deficits as early as 2004.

<http://www.cato.org/pubs/briefs/bp87.pdf>

<http://reason.com/archives/2005/02/13/revive-gramm-rudmann>

<http://reason.com/archives/2007/02/12/the-beltway-cut>

<comment><USER22> I'm sure you can find a token libertarian criticism in between enabling these guys every other spare second. Ron Paul even opposed the war in Iraq. (I'll give that guy credit for being principled even though half of his opinions are loony-bin crazy).

But I'm talking about the totality -- check out Fox News and the Tea Party if you want the beating heart of the conservative movement. These are the _exact same people_ , not figuratively, literally, who defended the Bush admin for 8 straight years. And CATO? How many pieces did they put out as cover for the Bush admin during that same time period? They're basically part of the republican messaging system.

<comment><USER11> "(I'll give that guy credit for being principled even though half of his opinions are loony-bin crazy)"

Which opinions? I doubt you comprehend the first thing about any of them. Let's see if you can even restate them correctly.

P.S. You can disagree with someone without mudslinging. I disagree with Paul on a number of things as well, but all his ideas have a large amount of thought and scholarship behind them (a hell of a lot more than anything the establishment parties come up with). Dismissing them out of hand with no backup is definitely below the standard HN tries to reach.

<comment><USER22> Two words: Gold Standard.

I'm not falling into that "restate them correctly" trap where you interpret some phrase differently than me so I'm an idiot. Gold standard is crazy without even needing an explanation.

<comment><USER11> Yeah, being able to restate an argument you've called crazy is a "trap". Give me a break.

Seriously, the goal here is to have mature discussions. If you aren't even willing to back up your assertions, just don't post.

<comment><USER22> Ok, "moving from fiat currency to gold-backed currency" is crazy. "Disbanding the federal reserve" is crazy. It would involve massively reducing the money supply and liquidity for the overall economy, and destroy the current counter- cyclical levers we have to lower/raise interests rates when we want to either stimulate the economy or cool down inflation. Take a look at the extreme boom/bust cycle from the late 19th century if you want to see what happens without those levers. There's a reason they went to fiat currency in the first place, and it wasn't, "I'm a liberal caricature and I want to do this to increase government control". It's because the gold standard wasn't adequate to the job. Let alone that there's no way to get from here to there in the modern world where the entire G20 has fiat currencies.

The gold standard is a position of "I don't care what's been proven to work in the real world or what's possible to actually accomplish, I care about what I find emotionally satisfying".

EDIT: Regarding civil discussions, you might consider chilling out on the ad hom attacks yourself. You've called me uninformed multiple times while misinterpreting my comments to mean something that I don't see any possible way to construe from what I said. Bringing Chinese actions from the 1950s and 60s into a discussion of "modern china's" propensity for militarism above, as if anyone would consider maoist China the same thing as the current regime, and implying that I had no idea such events happened.

<comment><USER11> Look, the Fed printing money doesn't "stimulate" anything except the balance sheets of its own member banks and their friends. It is functionally equivalent to counterfeiting on a mass scale. Why do you think counterfeiting is illegal? It gives the counterfeiter a (stolen) financial benefit, then dilutes the value of existing money. Anyone posting on a hacker forum should understand this basic functional relationship. It really isn't hard to grasp. Inflation doesn't create wealth. It transfers wealth. It's not very difficult to see which direction it's being transferred. Trying to stop this is not 'crazy'. It's common sense.

International food prices recently hit an all time high. Americans really need to wake up from their fantasies quick. Their incredible ignorance of how their leaders operate is costing the world a nearly unimaginable toll of suffering and death, and it's getting worse every day.

<comment><USER22> Lowering the interest rate is not equivalent to printing money. If you want to redefine terms, you can prove whatever you want to prove.

<comment><USER24> The Federal Reserve has responsibility for both interest rates and creation of money (check out the Wikipedia page). I believe the parent was referring to the Fed increasing M0, the base money supply. Interesting things have been happening to M0 over the past couple of years. Also, the Fed sets reserve requirements on the banks, which directly affects how much money they (the banks) can create (M1 and higher).

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER25> Fundamental research isn't cheap or fast. Private investors aren't usually going to to take the long road until they can afford it.</comment>


Smarter Rails Seeding with Sprig - <AUTHOR> http://viget.com/extend/smarter-rails-seeding-with-sprig

<comment><USER2> It looks like using Rails test fixtures (reborn) to create seed data. Which is an OK win I guess, and having it separated out by environment (implicitly mentioned in the article) is nice.. but I don't see how much of a win this is over instantiating fixtures or FactoryGirl.create in your seeds.rb file.

Yes, there are tons of problems with using db/seeds.rb for anything serious. I'm not sure that Sprig will handle my issues much better than I currently do myself.

For the record, my desired behaviors for a seed data solution are:

1\. environmental separation (which Sprig has). Developers have different needs for seed data as QA does, as does the staging server, as does production. Developers want an easy default email@example.com user with a simple password, but you don't want that in production.

2\. If I rerun my seed solution (perhaps because I added some more seed data) it shouldn't duplicate records (or throw errors because it's trying to create the second user with the same email address)

3\. Handle bootstrap data I need in my app (example: I want a list of US states, and every environment should get this. To reiterate my second point, I should be able to add to this bootstrap data without getting two copies of "California" in my US state list).

It's sad that no real solution exists to handle all three of these needs. Some projects I've been on have gotten this close, but that was years ago and things have changed.

(If Sprig does have these things, then that's the selling point, not seed data as fixtures which the article emphasized)

I'm also not sure about using fixture like things in Sprig. I give it 6 months before most users remember why many people in the Rails community moved to a Factory pattern for (test) data construction long ago.

However, I am happy that a relatively well known Rails consultancy is released 1.0 of a seed gem. Hopefully the name recognition / noise will lead developers to the gem and I'll be a better solution with many more eyes.

<comment><USER3> Not sure about Sprig, but Seedbank hits all 3 of those and has for the past two years.

[https://github.com/james2m/seedbank](https://github.com/james2m/seedbank)

</comment></comment><comment><USER4> I completely expected the OP to have had a typo in the headline and for it to actually be about "Spring", which is an amazing an essential gem (and part of 4.1beta)...but this is pretty cool too :).

I'm biased because the OP shows off a custom-parser for Google Spreadsheets, which is neat to me because Google Spreadsheets is my goto-interface for new prototyped apps...a much better, live-collaborative admin than anything I could easily build myself or with Rails tools.

But I wonder if this gem is more work than its worth? I mean, seeds don't seem like the best place to persist intricate production-ready data in the repo. And if you continue to use Google Spreadsheets, or whatever, as your main admin input interface, then it seems worth it to build a more elaborate abstraction to handle that usecase.

Also, I wonder if some of the self-referencing could be done via YAML's standard syntax? That would mean no JSON as a format, but YAML seems like it was built for this kind of lightweight relational data storage?

<comment><USER5> The Google Spreadsheet example is admittedly a reach. It's mostly just a demonstration of how flexible Sprig can be with data formats.

That's a very interesting idea to use YAML's self-reference syntax. Although a lot of the value of this gem comes from the seed organization across different record-type-specific files, and I think YAML's self-referential syntax might make cross-file referencing a bit more difficult for the user. Good thing to keep in mind for the future though, especially once everyone is on board the YAML train.

Do you have another place/system for persisting that you've success with in the past? I've always felt that seeds are designed to be the place to persist record data in the repo.

<comment><USER4> For data that I intend to share/reuse, I tend to have it in a SQL dump, but here are my (perhaps non-informed) assumptions and needs:

1\. The values in this data _never_ change. That is, if I'm maintaining a store of the U.S. Congress vote database, all votes (in the past) are inextricably and forever tied to a legislator's ID.

2\. The seed data is so large that loading by ActiveRecord is too slow and needs to be done either by plain SQL import or activerecord-import.

3\. The dataset should, when possible, imply its own opinion on conventions...so the Congressmebmer table will always be "congressmembers" and Vote will always be in "votes" and the relations and their keys will have the same convention in any app that uses this data. Of course, a particular app may choose to rename things, but they can do that after the seeding process.

4\. For a situation like the above, it's likely that a Rails Engine has been made, i.e. with all the domain-specific logic.

For smaller datasets, say, a list of the U.S. states and their abbreviations...storing them as plain seed files should suffice.

So anyway, those are my past practices. I'm not saying they're best, though, and am always looking for better ways to organize data between apps.

</comment></comment></comment><comment><USER3> This feels like just re-inventing the wheel again. The seedbank gem [https://github.com/james2m/seedbank](https://github.com/james2m/seedbank) has been around for a couple of years and does a great job for managing seeds on a natural, more granular level, if that is what you need.

</comment><comment><USER6> Seems like an oversight not to include XML support

</comment><comment><USER7> No. Just no.</comment>