Posts tagged with 'c'
Here's a little weirdness that I discovered this week. (I think this may just apply to ASP Classic but I'm not 100% sure).
I was writing some ASP Classic that reads some information from HTTP headers (which are put into the request from a mobile application). For some reason, the data wasn't showing up:
Turns out that the server replaces underscores with dashes. At first, this was just a wild guess on my part, but luckily it worked out.
A bit annoying, but I guess I learned something new!
Welcome to another "Weekly Concerns". This is a post-a-week series of interesting links, relevant to programming and programmers. You can check out previous Weekly Concerns posts in the archive.
- A platform to write apps in Ruby for ANY phone that uses SMS: Dumb Store.
- Password manager that doesn't actually store passwords: AnyHash.
- It took 54 years, but Xanadu is finally released as OpenXanadu.
- ECMAScript (aka the JavaScript spec) 6 is scheduled to be done by the end of this year. Of course, that doesn't really mean every browser will support every feature.
- Tetris was first created 30 years ago.
If you have an interesting link that you'd like to see in Weekly Concerns, leave a comment or contact me.
A project I'm working on now has a SPA project that uses the doT template engine.
Using it isn't terribly different from other JS templating engines (like Mustache), so if you have experience with those, it should look pretty similar.
First, you need a template. Just define it in a <script></script> block like so:
Notice the {{ }} areas in the template? That's what doT is going to fill in with whatever data we want (i.e. interpolation). The data that will be passed in is simply a JavaScript object, and this template knows that object by the name "it". So you can think of "it" as kinda like a keyword.
The next step would be to get the data, get the template, and combine them together to get an output.
Note that I'm using jQuery for convenience, but it's not required.
doT also offers conditionals and looping. It claims to be the "fastest + concise" templating engine for Node.js and browsers. If performance is a major concern for your templating engine, you can check out their benchmarks. Seems to be a close race depending on the browser, but doT is no slouch. Personally, I believe that templating is (hopefully) such a small part of the overall performance of a typical SPA app that it won't keep me up at night.
Welcome to another "Weekly Concerns". This is a post-a-week series of interesting links, relevant to programming and programmers. You can check out previous Weekly Concerns posts in the archive.
- Need a real API for demonstrating Ajax stuff? Check out The Example API. It provides all kinds of methods (GET, POST, etc), content responses (JSON, JSONP, XML, etc), response codes (404, 500, etc). Great for cross-domain testing, and it's what I used for my jsonp example post.
- Something to think about: Why Link Shorteners Harm Your Readers
- How to create better cards (in Pivotal, LeanKit, whatever card tracking/PM system you're using). I find the idea of gherkin/cucumber tests in the card to be an intriguing one.
- Need a dummy placeholder image? Use dummyimage.com to get them dynamically.
Ever experience the new wave? Next wave? Dream wave? Flava flav? A guy named Dave? Men's aftershave? A voodoo conclave? 12 Years a Slave? Shortwave? OR CYBERPUNK!? Ever stared at a CRT wistfully?
I didn't think so.
If you have an interesting link that you'd like to see in Weekly Concerns, leave a comment or contact me.
I'm starting up a series of brief, informal, biographical blog posts about some of the most important people in the history of computer called "Brief Bios".
I've made a list, and I'm just going to start chronologically. One of the challenges with biographies in historical computing is that computing, especially its early history, is inextricably tied to mathematics. This means that I could go all the way back to the very roots of mathematics, but I won't. I will instead be drawing an arbitrary line (this whole series will contain a lot of arbitration, in fact). I'll be starting at Wikipedia and branching out from there, based on what catches my interest.
So, just keep in mind that this is a blog, and therefore a series of relatively short, informal posts. Think of this series as a starting place for learning more about these people; each of their lives and the work of lives of those they've influenced could easily fill an entire library (and for some of them, that's literally the case). It's entirely certain that my blog posts will contain much that is apocraphal, or at least wildly inaccurate. I welcome your corrections and omissions in the comment section.
Blaise Pascal
Blaise Pascal, born in 1623, was a philosopher, mathematician, and physicist. But his greatest contibution to computing was spurred by taxes. Pascal may have been the first person to ever obtain a software patent for his calculating machine, the Pascaline, invented in 1642 and shown to the public in 1645. In 1649, King Louis XIV granted a royal privilege to Pascal, which gave him exclusivity to design and manufacture calculating machines. I'd wager that his wealthy father, Étienne Pascal, who was a lawyer and French aristocrat helped to arrange this, before he died in 1651. Certainly Étienne influenced the invention of the machine in the first place, since he was also a tax official (his father being Martin Pascal, a treasurer of France). Since Étienne took it upon himself to be his children's formal educator, I imagine the Pascal hallways filled with the pitter-patter of decimal points.
The Pascaline was not a commercial success. After 50 prototypes, he built around 20 more production machines. As useful as a mechanical calculator might have been for calculating taxes, the Pascaline was seen more as a status symbol (a concept that's not completely foreign to modern consumers who pay twice as much for comperable hardware with a certain logo on it). Nine machines are known to still remain today; the only one in the US is in the IBM archives (but it says it's a replica, so why does that count?) which I guess is in New York somewhere? I would like to check out that IBM attic someday.
Here's a video about how the Pascalines work. The machine consists of inputs (dials) and outputs (windows). Each input is kinda like a rotary phone, and is used to enter digits. The results of the calculation are then displayed in the digit windows, which kinda look like single-digit odometers. "Carry the one" operations are handled by a mechical arm that spans internally between dials. Subtraction is also possible with nines' compliments. You can build a Pascaline with Lego. I believe it's safe to say that these devices are not Turing-complete, and therefore not programmable computers, since you cannot have any conditional branching and you cannot arbitrarily change memory locations. It's essentially a one-way counter that can count by 1s,10s,100s,etc.
Lots of things are named after Pascal. The Pascal programming language, developed by Niklaus Wirth, is one that many programmers have probably at least heard of.
In his final years, Pascal had all sorts of nasty health problems and illness, including a brain lesion. In 1662, his last words were "May God never abandon me", and he's buried in Saint-Étienne-du-Mont - a Church bearing his father's namesake.
The plaque says, approximately: "The body of Blaise Pascal who died August 19, 1662 in the parish of Saint Étienne Du Mont was buried near this pillar. R.I.P."