Bifurcated Rivets: From FB


Bifurcated Rivets: From FB


Bifurcated Rivets: From FB


Bifurcated Rivets: From FB

These are great

Bifurcated Rivets: From FB

None of mine on there...

MetaFilter: How Early-20th-Century Americans Taught Their Kids to Be Thrifty

Slate takes a look at some of the concepts in Andrew L. Yarrow's Thrift: The History of an American Cultural Movement including various methods of teaching thrift to children. One tool used was a chart that teaches children how much it cost their parents to support them.

New Humanist Blog: It might be time to hang up my dancing shoes

After taking a tumble, Laurie Taylor discovers a critical new life point.

Recent additions: microlens

Added by Artyom, Mon Aug 3 09:48:10 UTC 2015.

A tiny part of the lens library which you can depend upon Log-LTSV-Instance-0.04

LTSV logger

Slashdot: Tesla Presses Its Case On Fuel Standards

An anonymous reader writes: Tesla is preparing their case to leave federal mileage and emissions regulations intact, or make them even more strict. In addition, the company is fighting other car makers from loosening more stringent regulations in California. The WSJ reports: "Tougher regulations could benefit Tesla, while challenging other auto makers that make bigger profits on higher-margin trucks and sport-utility vehicles. Tesla's vice president of development, Dairmuid O'Connell, plans to argue to auto executives and other industry experts attending a conference on the northern tip of Michigan that car companies can meet regulations as currently written. 'We are about to hear a lot of rhetoric that Americans don't want to buy electric vehicles,' Mr. O'Connell said in an interview ahead of a Tuesday presentation in Traverse City, Mich. 'From an empirical standpoint, the [regulations] are very weak, eminently achievable and the only thing missing is the will to put compelling products on the road.'"

Read more of this story at Slashdot. Net-IP-LPM-1.10

Perl implementation of Longest Prefix Match algorithm AnyEvent-TLS-SNI-0.02

Adds Server Name Indication (SNI) support to AnyEvent::TLS client.

programming: CNN: Encryption a growing threat to security

submitted by Cabey4
[link] [37 comments] Net-SNTP-Client-0.15

Perl module to calculate the roundtrip delay d and

Computer Science: Theory and Application: GitXiv - Collaborative Open Computer Science

submitted by Xiphorian
[link] [2 comments]

Recent additions: getopt-generics

Added by SoenkeHahn, Mon Aug 3 08:18:56 UTC 2015.

Create command line interfaces with ease Devel-NYTProf-6.02

Powerful fast feature-rich Perl source code profiler

Hackaday: How to Rescue Your Quadcopter from a Tree

Whether it’s a new rocket, your latest quadcopter, or [Charlie Brown]’s kite, it always seems like there’s a tree waiting to catch and eat airborne projects. Sometimes you get lucky and find a way to climb up the tree to retrieve your wayward build, but most times you’re reduced to looking for rocks or sticks to fling up there in an attempt to shake it loose. But if you want to improve your chances of getting your stuff back, [U.S. Water Rockets] has a build for a retrieval tool made mostly from scrap bin parts that will help.

All you need is some PVC tubing, an old fishing reel and line, some latex surgical tubing, and a few dowels for projectiles. You can tell everything about the build from the BOM and stills, but the video after the break gives detailed instructions and shows it in action. Adding some fins to the dart or even substituting a cheap arrow from the sporting goods department of your favorite retailer might help with your aim. Even without fletching, the accuracy of the launcher is pretty good, and the range isn’t half bad either. Once the fishing line is over the branch that ate your quad it can be used to haul up successively stouter ropes, and pretty soon you’ll be shaking the tree like a boss.

Even if getting stuff out of trees isn’t on your immediate to-do list, this little hack could be put to other uses. Hams will use it to loft antennas up into trees, and tag-line placement for tree removal could be simplified with this tool. But if you still find yourself needing to retrieve stuff, you might want to be proactive and make your aerial robot tree-proof. That still won’t eliminate the need for drone-on-drone rooftop rescues.

Filed under: drone hacks, misc hacks

Open Culture: Coffee Portraits of John Lennon, Albert Einstein, Marilyn Monroe & Other Icons

Coffee Lennon

Paintings by Maria A. Aristidou

As philosopher Marshall McLuhan wrote in Understanding Media, “the medium is the message.”

Artist Maria A. Aristidou’s medium is coffee, and lately, she’s been garnering a lot of attention for java-based portraits of such cultural luminaries as Einstein, Darth Vader and The Beatles.

The prolific and highly-caffeinated artist found her niche when an accidental spill gave rise to a somewhat sullen facsimile of Vermeer’s Girl with a Pearl Earring.


She has since applied her espresso blends toward the Mona Lisa and one of Baroque era painter Juan de Arellano’s floral still lifes, but for the most part, she draws her subjects from the realm of pop culture.

Dorm room faves like Marilyn Monroe, Bob Marley, and John Lennon are overshadowed by fictional superstars like Frozen’s Queen Elsa, Nintendo’s Mario, and various personages from Game of Thrones.

My favorite? Kyle MacLachlan as Twin Peaks’ Agent Dale “Damn fine cup of coffee, Diane!” Cooper. That’s not just medium. That’s meta!

Aristidou is not the only artist finding inspiration in this non-traditional pigment. A recent NPR story on the trend cites coffee artists Angel Sarkela-Saur and Andy Saur and Giulia Bernardelli.

Scroll backwards to the mid-1800s and you’ll find author—and gifted draftsman—Victor Hugo experimenting with the stuff. Nor was his promiscuous nib a stranger to the artistic possibilities of soot, coal dust, and blood.

Aristidou, who holds degrees in Fine Art Printmaking and Arts Health, eschews the traditional artist’s website in favor of social media. Not only is she a master of the hashtag, she also designs cakes. View her complete oeuvre—including several cartons of corporate logo Easter eggs and some recent fashion illustrations that combine watercolor with java—on her Facebook or Instagram pages.

Above you can watch Aristidou paint portraits of Einstein, the Beatles and R2D2 in quick time-lapse motion.

Related Content:

Victor Hugo’s Surprisingly Modern Drawings Made with Coal, Dust & Coffee (1848-1851)

J.S. Bach’s Comic Opera, “The Coffee Cantata,” Sings the Praises of the Great Stimulating Drink (1735)

Black Coffee: Documentary Covers the History, Politics & Economics of the “Most Widely Taken Legal Drug”

The Fine Art of Painting Portraits on Coffee Foam

Ayun Halliday is an author, illustrator, and Chief Primatologist of the East Village Inky zine. Follow her @AyunHalliday

%%POST_LINK%% is a post from: Open Culture. Follow us on Facebook, Twitter, and Google Plus, or get our Daily Email. And don't miss our big collections of Free Online Courses, Free Online Movies, Free eBooksFree Audio Books, Free Foreign Language Lessons, and MOOCs.

Recent additions: applicative-fail 1.1.1

Added by AlekseyUymanov, Mon Aug 3 07:25:18 UTC 2015.

Applicative functor and monad which collects all your fails

Recent additions: quiver-enumerator

Added by patrykz, Mon Aug 3 07:02:33 UTC 2015.

Bridge between Quiver and Iteratee paradigms

Penny Arcade: Comic: The Third Sword

New Comic: The Third Sword

Slashdot: Modding Community Putting HD Textures Into Resident Evil 4

jones_supa writes: The Ultimate HD Edition of Resident Evil 4 does not fully adhere to its name, as terrain textures are actually not in high definition. A couple of fans called Cris and Albert are chipping in to help fix this deficiency. The pair is working for free to create the RE4 HD Project, a mod which is cleaning up the game's chunky textures and producing some nice and sharp screenshots. At present, it looks like the project is already about half complete, and an HD texture pack for the Village section of the game is available at the project website.

Read more of this story at Slashdot.

Hackaday: Hackaday Prize Entry: The Internet of Plants

The theme of this year’s Hackaday Prize is ‘build something that matters.’ Acrobotic Industries is in beautiful Southern California, where it won’t rain an appreciable amount until the mudslides come. For a little bit of help during this unprecedented drought, they’ve created Clouden, a system of irrigation that only waters yards and parks when the plants need it. This is apparently a novel concept for Southern California, and is most certainly something that matters.

The Clouden system has two parts. The first is a node with an array of soil water sensors and a Particle WiFi module. This node connects to the controller which alters watering schedules in response to actual conditions and predicted rainfall from the WeatherUnderground API.

There’s more to just listening to sensors – the Clouden controller also has the hardware to control 24VAC water valves and a web interface for scheduling irrigation times. With this many sensors – and the ability to not water when there’s a ban in place – it’s a great watering system, and something Southern California desperately needs.

The 2015 Hackaday Prize is sponsored by:

Filed under: The Hackaday Prize Comic for 2015.08.03

New Cyanide and Happiness Comic

Recent additions: quiver-bytestring

Added by patrykz, Mon Aug 3 04:31:01 UTC 2015.

Quiver combinators for bytestring streaming

The Half-Dipper: The Circle is Overcomplete

Instructables: exploring - featured: Simple Indian Chicken Curry

Curry is a basic Indian meal... some find its hard to prepare curry... actually it's easy if you follow the step.. there a lot of type curry.... they use different flavours and herbs... this is just a basic chicken curry.... hope you like it... :) Ingredients Prepare the ingredients before start...
By: Nanthini Suppiah

Continue Reading »

Instructables: exploring - featured: Waxing Wine Bottles

An amateur attempt at waxing the bottles of my homemade wine. Getting Started After 2 years of making homemade wine I'm finally ready to start giving away bottles to friends and family. In order to dress up the bottles I decided to coat the bottle tops in wax. This instructable will follow me on ...
By: dsexton8

Continue Reading »

Slashdot: Girls Catfish ISIS On Social Media For Travel Money

MarkWhittington writes: Yahoo Travel reported that three women in Chechnya took ISIS for $3,300 before getting caught. They are now under investigation for Internet fraud, which seems to be illegal even when committed against the most fearsome terrorist army in modern times. The scam seems to be a combination of the Nigerian Prince con, in which a mark is fooled into giving the con artist large sums of money and catfishing, in which the mark strikes up an online romance with someone he thinks is an attractive woman (or man depending on the gender and preference of the mark.)

Read more of this story at Slashdot.

programming: Automated reasoning in F#, Scala, Haskell, C++, and Julia

submitted by Categoria
[link] [8 comments]

MetaFilter: *Dʰu̯órom *Bʰl̥gés

The *Bʰlog

MetaFilter: a guy who's giving 150 percent, and yet you're not sure if he means it

"I'm not here, however, to adjudicate Cruise's religious views or mental health or even, really, his public image, which seems to be a complicated one. I'm here to say: It's time to start liking Tom Cruise, movie star and actor, again." - Bilge Ebiri, Vulture

Hackaday: Saving an Alarm System Remote and $100

[Simon] has been using his home alarm system for over six years now. The system originally came with a small RF remote control, but after years of use and abuse it was finally falling apart. After searching for replacement parts online, he found that his alarm system is the “old” model and remotes are no longer available for purchase. The new system had similar RF remotes, but supposedly they were not compatible. He decided to dig in and fix his remote himself.

He cracked open the remote’s case and found an 8-pin chip labeled HCS300. This chip handles all of the remote’s functions, including reading the buttons, flashing the LED, and providing encoded output to the 433MHz transmitter. The HCS300 also uses KeeLoq technology to protect the data transmission with a rolling code. [Simon] did some research online and found the thew new alarm system’s remotes also use the same KeeLoq technology. On a hunch, he went ahead and ordered two of the newer model remotes.

He tried pairing them up with his receiver but of course it couldn’t be that simple. After opening up the new remote he found that it also used the HCS300 chip. That was a good sign. The manufacturer states that each remote is programmed with a secret 64-bit manufacturer’s code. This acts as the encryption key, so [Simon] would have to somehow crack the key on his original chip and re-program the new chip with the old key. Or he could take the simpler path and swap chips.

A hot air gun made short work of the de-soldering and soon enough the chips were in place. Unfortunately, the chips have different pinouts, so [Simon] had to cut a few traces and fix them with jumper wire. With the case back together and the buttons in place, he gave it a test. It worked. Who needs to upgrade their entire alarm system when you can just hack the remote?

Filed under: home hacks, repair hacks

BOOOOOOOM!: Booooooom Reader Submissions: August


Here’s this month’s submission post! Thank you for all the submissions to the July Submissions post. This is the best way to submit your work to be considered for a post on Booooooom. Thanks to everyone for up-voting work you like, it really encourages artists in this community and helps me see what work you like. I encourage you to share your work here because these posts get a lot of traffic and even if your work is not a fit for Booooooom it still gets seen, and definitely sends traffic to your own websites.

Please share your work here during the month of August. The comments allow images to be attached so make sure post an image along with a link to your website.


Submission guidelines:

1. Please don’t flood the comments with a dozen images, just post 1 image that represents your best work along with 1 link.

2. If you see good work posted by someone upvote it so it appears at the top. This is not just a nice thing to do, it helps me see what work you actually like.

3. You can/should also encourage people who are sharing good work here! Comment on their posts and let them know you like what they’re doing. I really want to foster a community here, and this is a simple way you can connect with other people making work.

4. Keep in mind your post may not show up right away because it has an image attached. It may need to be manually approved first so don’t freak out and post a million times, once is enough.



View the whole post: Booooooom Reader Submissions: August over on BOOOOOOOM!.

Slashdot: Unicode Consortium Looks At Symbols For Allergies

AmiMoJo writes: A proposal (PDF) submitted by a Google engineer to the Unicode Consortium asks that food allergies get their own emojis and be added to the standard. The proposal suggests the addition of peanuts, soybeans, buckwheat, sesame seeds, kiwi fruit, celery, lupin beans, mustard, tree nuts, eggs, milk products and gluten. According to TNW: "This proposal will take a little longer to become reality — it's still in very early stages and needs to be reviewed by the Unicode Consortium before it can move forward, but it'll be a great way for those with allergies to quickly express them."

Read more of this story at Slashdot.

Instructables: exploring - featured: DIY Wax Candle Dragon Sculpture

This project is way easier than it looks. This is a tutorial on how to make an entirely hand sculpted dragon candle from a 12" tapered candle. The materials are extremely cost effective and easy to get. I think the total cost in materials comes out to under $5. SO, LET'S GET STARTED!WARNING: This pr...
By: MaeBerry

Continue Reading »

MetaFilter: Beyond fantasy monoculture

"As a black woman," Jemisin tells me, "I have no particular interest in maintaining the status quo. Why would I? The status quo is harmful, the status quo is significantly racist and sexist and a whole bunch of other things that I think need to change. With epic fantasy there is a tendency for it to be quintessentially conservative, in that its job is to restore what is perceived to be out of whack."

NK Jemisin on upending the fantasy literature status quo and getting beyond medieval fantasy Europe.

MetaFilter: The Big Uneasy

"Everyone in New Orleans knows that 911 is a lost cause." ''What I'm doing now isn't all that different from the trash thing,'' Torres said. ''It's about seeing a need — an unfortunate need — and stepping up to fill it.''

Slashdot: Research Scientists To Use Network Much Faster Than Internet

nickweller writes with this story from the Times about the Pacific Research Platform, an ultra-high-speed fiber-optic research infrastructure that will link together dozens of top research institutions. The National Science Foundation has just awarded a five-year $5 million dollar grant for the project. The story reports:The network is meant to keep pace with the vast acceleration of data collection in fields such as physics, astronomy and genetics. It will not be directly connected to the Internet, but will make it possible to move data at speeds of 10 gigabits to 100 gigabits among 10 University of California campuses and 10 other universities and research institutions in several states, tens or hundreds of times faster than is typical now.

Read more of this story at Slashdot.

Hackaday: Hackaday Links: August 2, 2015

Over the last few years, Maker’s Asylum in Mumbai has grown from a garage to a very well stocked workspace with 140 members. They’re getting kicked out at the end of the month and they need some help. We just had a meetup at the Delhi branch of Maker’s Asylum, and these guys and gals are really cool.

Speaking of crowdfunding campaigns for hackerspaces, South Central Pennsylvania might be getting its own hackerspace. The 717 area code is a vast wasteland when it comes to anything anyone reading Hackaday would consider interesting, despite there being plenty of people who know their way around CNC machines, soldering irons, and welders. This needs to happen.

Need some help with Bluetooth standards? Tektronix has you covered with a gigantic poster of the physical layer. If only there were a repository of these handy, convenient reference posters.

Forgings and castings make for great YouTube videos, and this aluminum bell casting is no exception. There’s about 18 pounds of aluminum in there, which is pretty large as far as home casting goes.

Electronic Goldmine has an assortment of grab bags – spend a few dollars get a bag of chips, LEDs, diodes, or what have you. What’s in these grab bags? [alpha_ninja] found out. There’s some neat stuff in there, except for the ‘SMD Mixture’ bag.

Remember the found case molds for the Commodore 64C that became a Kickstarter? It’s happening again with the Amiga 1200. This is a new mold with a few interesting features that support the amazing amount of upgrades that have come out for this machine over the years. Being new molds, the price per piece is a little high, but that’s your lesson in manufacturing costs for the day.

Filed under: Hackaday Columns, Hackaday links

Open Culture: Endangered Species (Including Cecil the Lion) Projected Onto the Empire State Building

Anyone with a Facebook or Twitter account last week couldn’t avoid hearing about Walter James Palmer, the Minnesota dentist who allegedly went trophy hunting in Zimbabwe and killed Cecil the Lion, a local favorite who had been illegally lured away from a protected wildlife preserve. I won’t say anything more about it, other than that you can sign a petition to get Palmer extradited to Zimbabwe and let him defend his actions to local authorities.

Meanwhile, back in New York City, two artists Travis Threlkel and Louie Psihoyos were getting ready to turn The Empire State building into a Noah’s Ark of Endangered Animals. And that’s exactly what happened on Saturday night. Placing “40 stacked, 20,000-lumen projectors on the roof of a nearby building,” Threlkel and Psihoyos projected an array of endangered animals “onto a space 375 feet tall and 186 feet wide covering 33 floors,” reports The New York Times. You can see photos of the animals over at the Racing Extinction Twitter stream. Touchingly, there was an homage to Cecil the Lion. A video from the Times appears above; another from The New Yorker below.

To learn more about how Project Mapping works, and to see other examples of Threlkel’s work, see the videos on this page.

Follow us on Facebook, Twitter, Google Plus and LinkedIn and share intelligent media with your friends. And if you want to make sure that our posts definitely appear in your Facebook newsfeed, just follow these simple steps.

%%POST_LINK%% is a post from: Open Culture. Follow us on Facebook, Twitter, and Google Plus, or get our Daily Email. And don't miss our big collections of Free Online Courses, Free Online Movies, Free eBooksFree Audio Books, Free Foreign Language Lessons, and MOOCs.

TOPLAP: Bricolage – The World of Live Coding

A great interview with David Ogborn on Live Coding, Bricolage Programming, art and life:

programming: Solving the temporary storage problem of C macros, to implement an inverse comma operator and swap macro

submitted by TheMG
[link] [19 comments]

Trivium: 02aug2015

Hackaday: 3D Printing with 2D Inkscape Projections

If you had a formal drafting class, you probably learned about making orthographic projections–engineering drawings with multiple views (for example, top, front, and right). Even if you didn’t take the class, you’ve probably seen drawings like this where you view a 3D object as a series of 2D views from different angles.

These days, you are more likely to create a 3D model of an object, especially if you are going to 3D print it. After all, the 3D printer software is going to expect a model. When [Nightshade] wanted a laptop stand for his workbench, he started trying to do a 3D model. His final product though, was made by creating two views in Inkscape. They aren’t exactly orthographic projections of the final product, but the idea is similar.

Inkscape is a vector graphics program and generally creates SVG files, although it can also save EPS files. [Nightshade] used pstoedit to convert the EPS output to DXF format. DXF files are still two dimensional, but OpenSCAD can extrude DXF files into 3D shapes.

Just having a 3D shape of one view isn’t sufficient, though. The OpenSCAD script rotates the objects to the correct orientation and intersects them to form the final object. This is different from the usual cases of using Inkscape to trace a scan or generate simple text.

Inkscape can export DXF directly, but it has a lot of limitations. There are plugins (like the Big Blue Saw plugin) that work better and would probably also work in this application if you don’t want to uses pstoedit.

This technique is far from general purpose (some objects require more than two views and the profiles aren’t really projections). Still, this is a useful technique to generate 3D objects simply if you can get your head around the two shapes involved.

We’ve seen Inkscape used with printers and cutters before to either generate 2D laser cut patterns  or define useful outlines. In this case, though, the shapes actually blend (through the intersection command) to form the final 3D object. Of course, you don’t have to use Inkscape. Any CAD program that puts out DXF (for example, FreeCAD or LibreCAD) ought to work with this technique.

Thanks [miceuz] for the tip!

Filed under: 3d Printer hacks

Toronto After Dark Film Festival Updates: Record 1,200 Films Submitted to Toronto After Dark 2015! Official Titles to be Announced by End Sep

Toronto After Dark’s 2015 Call for Film Entries has now closed. We would like to thank a record over 1,200 filmmakers from around the world who chose to submit their works for programming consideration by our festival this year.  A special thank you also to many individuals and organizations who helped spread the word on our Call this year. All the films are now being reviewed. If you submitted a film to Toronto After Dark 2015 and are waiting for an update from us, or are interested in submitting to our event next year, please check our Submissions Page for key info and dates.

The first wave of 10 selected Feature Film titles will be announced by Mid-September. This will be followed by a Final Announcement of all the remaining programmed titles, including all short films, along with the festival schedule, by the end of September 2015. Individual Tickets to screenings will go on sale in Early October, while the festival’s popular ALL-ACCESS Passes, are already on Advance Sale.

Paper Bits: abwatt: thegreenwolf: falsedetective: falsedetective: my grandparents have to lock their car...





my grandparents have to lock their car doors when they go to sunday mass because people have been breaking in to unlocked cars and leaving entire piles of zucchini

i feel like i should’ve added more context when i posted this. my grandparents live in a rural area where farmers and casual gardeners alike are, at this point in the year, suddenly being hit with unexpectedly abundant zucchini crops. there aren’t just some random vandals leaving zucchinis in people’s cars for the hell of it, this is the work of some very exasperated, probably very elderly, folks who have more zucchini than they know what to do with

Yep. You can also expect to find a bag of zucchini on your porch.

My grandfather once found his neighbor stealing his tomatoes out of his garden at three in the morning. Red-handed, with a basket of the nearly-ripened ones.  He thought he was going to find gophers or something, but no, here’s Henry, taking his tomatoes. The best ones.

There was a long pause between them.

My grandfather (allegedly) said, “Henry… it’s OK.  You can take some tomatoes if you want them.”

Henry sighed in relief.

“But,” my grandfather said, “you have to take two zucchini for every tomato.”

There was another long silence.  “That’s a harsh bargain, John,” said Henry.  “But I accept.  I’ll tell Joe up the street, too.”

My grandfather said, “Tell Joe he needs to take three.”


Greater Fool - Authored by Garth Turner - The Troubled Future of Real Estate: The mushy middle

KITTENS modified

“I know you have lots of great advice for the Millennials but wondering what you have to say to us Gen X’ers who were late bloomers,” Paul writes me. “I’m 40, am topped out at my job as a Registered Nurse, my 5 year mortgage term is up and I am relocating to Calgary so it is potentially a clean break. I’m looking to buy again but not bound to the idea. What generates stress for me is adding a 25 year mortgage at any point beyond now just makes me OLD when it’s paid off.”

Not only that, Paul, but Calgary’s a time bomb. July sales were down again, this time 14%. And the tsunami of terminations is only beginning, now that Iran is back and oil’s headed for forty bucks. But I think you have bigger stuff to worry about.

“All I have in the bank is about $20K in RRSPs that I started with a former employer and the rest is tied up in my current home. Like you, Garth, I’m old, stubborn and hate the idea of going back to square one and having to rent a house that has been cheaply renovated with the laminate floors, rectangular multi-coloured tile backsplash and $99 pedestal bathroom sink. Have I mentioned my mid-life crisis? Any advice is always appreciated!”

Sure. It’s easy. Dump the Halifax house, move, rent and invest. Max your TFSA and put the rest in an ETF-laden balanced non-registered account with lots more non-Canadian assets than maple. If you take up nursing in Cowtown, concentrate on these accounts instead of putting more into an RRSP, since you’ll be working on a defined-benefit pension. If your specialty is psych medicine and the treatment of depression (and delusional socialism), there’s a great future ahead in Alberta.

But Paul’s right. People in theirs forties today seem to be at special risk. Unlike a lot of jaded, iconoclastic Millennials, these Gen Xers swallowed the house-is-good, only-need-one-asset strategy their Boomer parents laid on them. Like Paul, so many have real estate and nothing else. Except debt. And hopefully a job that lasts. Plus very, very expensive kids. And now they’re middle-aged. Bummer.

My old pal Benny Tal, a big-time economist at CIBC, has done some interesting work in this area. “While many Canadians, particularly those now close to 65, are on a path to the retirement of their dreams, the data show that millions of others are headed for a steep decline in living standards in the decades ahead, particularly those who are currently younger and who are in middle income brackets,” he wrote in a report on the dreaded R-thing. (Retirement.)

Tal says almost six million Canadians will experience at least a 20% drop in their living standards once they stop working. Those now in their thirties – prime house-buying and child-popping years – are being set up for an even bigger surprise. Says Benny: “On average, the replacement rate of those born in the 1980s, who will retire towards the middle of this century, will be only 0.7, implying a 30-per-cent drop in their standard of living.”

How could this be?

Simple. Like Paul, many have concentrated on buying a home and trashing the mortgage, instead of accumulating financial assets. That made sense in the olden days when loans were 8% or 9%, and financial stuff was barely keeping up. But those borrowings have been in the 3% range now for years, while a balanced portfolio has averaged almost 8% over the past half-decade (and 7.4% over ten years). So obviously it’s wiser to just service the mortgage debt, let your house appreciate in value (depending on location) and shovel extra cash flow into liquid assets. Better yet, crystallize your tax-free real estate gain and avoid the coming storm

Paul scares me. A house and just twenty grand saved at age 40 – all of it in a taxable account. Ouch. It’s this kind of myopia, ignorance and malinvestment that turns people into Dippers. They start thinking the ‘rich’ and corporations should be paying more tax, that a $15 minimum wage is reasonable or the state should be paying to look after their kids. It’s the inevitable result of that one-asset strategy where folks have been sucked into home ownership at punishing levels, and wake up half-way point through their lives to realize they may be blowing it.

And that’s exactly the case.


Whatever happens on the 19th of October, we will still have an oil collapse, a weak dollar, more job stress and a moribund economy. The US will still be raising rates, bond yields and mortgages will follow. House prices have only one direction in which to move, and yet most people are in denial. In the past ten years Toronto house values have risen 420% while incomes have gained 133%. How can your mom not see what’s coming?

There’s only one reason houses can inflate so dramatically while incomes do not – cheap money. And that will come to an end. You can get ready now, or panic later. Alternatively, you can do nothing, expecting the government will rescue you.

Good luck with that.

Instructables: exploring - featured: Bojagi for bottle

bojagi is adapted to all kind of shapes...this time is about wrapping a single bottle with 2 different ways. Method 1 Stand the bottle at the center of the bojagi. Take two opposing corners, lifting them up snugly along the bottle, then tie a single knot above the cap. Twist the en...
By: kavka08

Continue Reading »

programming: Install Me - #40 of "97 Things Every Programmer Should Know"

submitted by jCuber
[link] [38 comments]

TwitchFilm: Watch A Clip From Hammer Classic THE MAN WHO COULD CHEAT DEATH

Great news for Hammer Horror fans, as Eureka! Entertainment is bringing Terence Fisher's The Man Who Could Cheat Death to dual-format Blu-ray/DVD on 21 September.Fisher helped define the vibrant look of many of Hammer's classic gothic horror tales, and after scoring notable successes with the likes of The Curse of Frankenstein (1957), Dracula (1958) and The Hound of the Baskervilles (1959) he delivered this "Bava-esque" tale of scientific malevolence starring Anton Diffring (Fahrenheit 451, Where Eagles Dare), Christopher Lee and Hazel Court.Doctor and amateur sculptor Georges Bonnet (Anton Diffring) has discovered a murderous method of maintaining his youth, once every ten years he murders a young woman and removes her parathyroid glands to replace his own. But after 104 years, he's run into some problems. His collaborator...

[Read the whole post on]

Perlsphere: Driving a Business with Perl

I’ve been a freelance programmer for over twenty years. One really important part of the job is getting paid for the work I do. Back in 1995 when I started out there wasn’t all of the accounting software available that you get now and (if I recall correctly) the little that was available was all pretty expensive stuff.

At some point I thought to myself “I don’t need to buy one of these expensive systems, I’ll write something myself”. So I sat down and sketched out a database schema and wrote a few Perl programs to insert data about the work I had done and generate invoices from that data.

I don’t remember much about the early versions. I do remember coming to the conclusion that the easiest way to generate PDFs of the invoices was using LaTex and then wasting a lot of time trying to bend LaTeX to my will. I got something that looked vaguely ok eventually, but it was always incredibly painful if I ever needed to edit it in any way. These days, I use wkhtmltopdf and my life is far easier. I understand HTML and CSS in a way that I will never understand LaTeX.

Why am I telling you this, twenty years after I started using this code? Well, during this last week, I finally decided it was time to put the code on Github. There were two reasons for this. Firstly, I thought that it might be useful for other people. And secondly, I’m ashamed to admit that this is the first time that the code has ever been put under any kind of version control (and, yes, this is an embarrassing case of “do as I say, not as I do“). I have no excuses. The software I used to drive my business was in a few files on a single hard drive. Files that I was hacking away at with gay abandon when I thought they needed changing. I am a terrible role model.

Other than all the obvious reasons, I’m sad that it wasn’t in version control as it would have been interesting to trace the evolution of the software over the last twenty years. For example, the database access started as raw DBI, spent a brief time using Class::DBI and at some point all got moved to DBIx::Class. It’s likely that I wasn’t using the Template Toolkit when I started – but I can’t remember what I was using in its place.

Anyway, the code is there now. I don’t give any guarantees for its quality, but it does the job for me. Let me know if you find any of it interesting or useful (or, even, laughable).

p.s. An interesting side effect of putting it under (public) version control – since I uploaded it to Github I have been constantly tweaking it. The potential embarrassment of having my code available for anyone to see means that I’ve made more improvements to it in the last week that I have in the previous five years. I’m even considering replacing all the command line programs with a Dancer app.

p.p.s. I actually use FreeAgent for all my accounting these days. It’s wonderful and I highly recommend it. But I still use my own system to generate invoices.

The post Driving a Business with Perl appeared first on Perl Hacks.

TwitchFilm: NYC Happenings: "Cinema On The Edge: Best Of The Beijing Independent Film Festival" Brings Banned Works To U.S.

In the U.S., and in most countries for that matter, making independent films is a common and relatively unremarkable practice, mainly meaning creating works that are the opposite of studio and big-budget films. Usually, filmmakers go this route because they wish to make films that are more personal, more artistic, more daring, and less beholden to commercial considerations and constraints. Sometimes you can see these films playing in your local theater; increasingly more likely these days, you can catch them on VOD, via your computer or your cable provider, or even on your smartphone. But usually, film festivals are the most likely places you'll get to see independent films. Here in the U.S., especially in major cities like New York, Los Angeles, or Chicago, you can't swing...

[Read the whole post on]

Instructables: exploring - featured: Pressed Flower or Leaves Phone Cases

My grandmother used to press flowers when I was little. It's a fond summer memory of mine, picking Queen Anne's Lace at the edge of her garden shed. I've always had a soft spot for this flower.I have a bit of a resin obsession. Resin, when completely hardened, is a transparent, lightweight plastic a...
By: rawdesignco

Continue Reading »

TwitchFilm: Durban 2015 Review: THE SHORE BREAK Tries To Stem The Tide, But Only Time Will Tell

The 36th Durban International Film Festival in South Africa has wrapped its annual showcase of international film, with this year's menu providing distinctly more African fare under the new directorship of Pedro Pimenta.  South African documentary The Shore Break is Ryley Grunenwald's second feature, after Dawn Of A New Day, and firmly establishes her place among the cadre of fantastic female documentarians making their mark in the region (e.g. Meg Rickards' 1994: The Bloody Miracle; Tarryn Lee Crossman's Fatherland; Annalet Steenkamp's I, Afrikaner).At the heart of The Shore Break is a very difficult question: how to develop one of the most rural and remote areas of South Africa, Amadiba in Pondoland - largely bereft of roads, schools, health services and jobs - without sacrificing either...

[Read the whole post on]

Perlsphere: July 2015 Grant Votes

The Grants Committee has concluded the voting of the July round.

Proposal in this round

Voting Results

Plerd435 = 2 + 1 + 1 + 1
blogs.perl.org8035 = 5 + 5 + 5 + 5 + 5 + 5 + 4 + 1

Definition of the score is found in 3.2 of the rules.


In this round, we got two proposals about Perl blogging platform. We will approve and fund this grant. The outstanding issues have to be fixed and it will be the right thing to use the community money in this area.

Plerd: We will approve it but will not fund it in this round. That is, we will review the same proposal in the next round and re-evaluate it with the remaining fund we have. See the rules 3.4 for the details.

Next round

The next round is in September. You can submit proposals now.

Saturday Morning Breakfast Cereal: Saturday Morning Breakfast Cereal - MY LIFE IS RUINED

Hovertext: Still better than the time he got stuck as a wolfman.

New comic!
Today's News:

The Axis of Eval: RESTful RDP with big values

What if you want to use a big value, like a whole database table or weblog, as a Reactive Demand Programming signal value? This would make it possible to use RDP to orchestrate things like incremental MapReduce pipelines. Here's one weird trick to make it work.

In effect, each RDP signal becomes a RESTful server, speaking an HTTP-like protocol. Clients of a signal remember the ETag of the last version of the signal they've processed, and send it to the server on subsequent requests.

The protocol to retrieve the value of a signal may work like this:
  • If a client hasn't seen a previous version of the signal, it sends no ETag. The server replies with the complete value. The value may be split up into multiple pages, using something like an Atom paged feed. (Other non-sequential kinds of splits are possible: for example, tree-like data like a filesystem can be fetched in parallel using hierarchical splits.)
  • If a client has seen and processed a previous version of the signal it sends the stored ETag. There are three possibilities:
    • The content hasn't changed (i.e. the server's ETag matches the client-sent ETag), so the server replies with a status code that indicates that there is no new content (HTTP's 304 Not Modified).
    • The content has changed, so the server replies with a diff of the client's version versus the server's version.
    • The content has changed, but the server is unable to provide a diff against the client's version. This can happen for servers that do not keep a complete history, or also if the server determines that it's more efficient to have the client retrieve the whole value again instead of sending a diff. The client has to re-fetch the whole signal value, as if it had seen no previous version of the value.
I haven't worked out all the details, but I think this scheme could be made to work.

Better Embedded System SW: Avoiding EEPROM Wearout

Summary: If you're periodically updating a particular EEPROM value every few minutes (or every few seconds) you could be in danger of EEPROM wearout. Avoiding this requires reducing the per-cell write frequency. For some EEPROM technology anything more frequent than about once per hour could be a problem.

Time Flies When You're Recording Data:

EEPROM is commonly used to store configuration parameters and operating history information in embedded processors. For example, you might have a rolling "flight recorder" function to record the most recent operating data in case there is a system failure or power loss. I've seen specifications for this sort of thing require recording data every few seconds.

The problem is that  EEPROM only works for a limited number of write cycles.  After perhaps 100,000 to 1,000,000 (depending on the particular chip you are using), some of your deployed systems will start exhibiting EEPROM wearout and you'll get a field failure. (Look at your data sheet to find the number. If you are deploying a large number of units "worst case" is probably more important to you than "typical.")  A million writes sounds like a lot, but they go by pretty quickly.  Let's work an example, assuming that a voltage reading is being recorded to the same byte in EEPROM every 15 seconds.

1,000,000 writes at one write per 15 seconds is 4 writes per minute:
  1,000,000 / ( 4 * 60 minutes/hr * 24 hours/day ) = 173.6 days.
In other words, your EEPROM will use up its million-cycle wearout budget in less than 6 months.

Below is a table showing the time to wearout (in years) based on the period used to update any particular EEPROM cell. The crossover values for 10 year product life are one update every 5 minutes 15 seconds for an EEPROM with a million cycle life. For a 100K life EEPROM you can only update a particular cell every 52 minutes 36.  This means any hope of updates every few seconds just aren't going to work out if you expect your product to last years instead of months. Things scale linearly, although in real products secondary factors such as operating temperature and access mode can play a factor.

Reduce Frequency
The least painful way to resolve this problem is to simply record the data less often. In some cases that might be OK to meet your system requirements.

Or you might be able to record only when things change more than a small amount, with a minimum delay between successive data points. However, with event-based recording be mindful of value jitter or scenarios in which a burst of events can wear out EEPROM.

(It would be nice if you could track how often EEPROM has been written. But that requires a counter that's kept in EEPROM ... so that idea just pushes the problem into the counter wearing out.)

Low Power Interrupt
In some processors there is a low power interrupt that can be used to record one last data value in EEPROM as the system shuts down due to loss of power. In general you keep the value you're interested in a RAM location, and push it out to EEPROM only when you use power.  Or, perhaps, you record it to EEPROM once in a while and push another copy out to EEPROM as part of shut-down to make sure you record the most up-to-date value available.

It's important to make sure that there is a hold-up capacitor that will keep the system above the EEPROM programming voltage requirement for long enough.  This can work if you only need to record a value or two rather than a large block of data. But it is easy to get this wrong, so be careful!

Rotating Buffer
The classical solution for EEPROM wearout is to use a rotating buffer (sometimes called a circular FIFO) of the last N recorded values. You also need a counter stored in EEPROM so that after a power cycle you can figure out which entry in the buffer holds the most recent copy. This reduces EEPROM wearout proportionally to the number of copies of the data in the buffer. For example, if you rotate through 10 different locations that take turns recording a single monitored value, each location gets modified 1/10th as often, so EEPROM wearout is improved by a factor of 10. You also need to keep a separate counter or timestamp for each of the 10 copies so you can sort out which one is the most recent after a power loss.  In other words, you need two rotating buffers: one for the value, and one to keep track of the counter. (If you keep only one counter location in EEPROM, that counter wears out since it has to be incremented on every update.)  The disadvantage of this approach is that it requires 10 times as many bytes of EEPROM storage to get 10 times the life, plus 10 copies of the counter value.  You can be a bit clever by packing the counter in with the data. And if you are recording a large record in EEPROM then an additional few bytes for the counter copies aren't as big a deal as the replicated data memory. But any way you slice it, this is going to use a lot of EEPROM.

Atmel has an application note that goes through the gory details:
AVR-101: High Endurance EEPROM Storage:

Special Case For Remembering A Counter Value
Sometimes you want to keep a count rather than record arbitrary values. For example, you might want to count the number of times a piece of equipment has cycled, or the number of operating minutes for some device.  The worst part of counters is that the bottom bit of the counter changes on every single count, wearing out the bottom count byte in EEPROM.

But, there are special tricks you can play. An application note from Microchip has some clever ideas, such as using a gray code so that only one byte out of a multi-byte counter has to be updated on each count. They also recommend using error correcting codes to compensate for wear-out. (I don't know how effective ECC will be at wear-out, because it will depend upon whether bit failures are independent within the counter data bytes -- so be careful of using that idea). See this application note:

Note: For those who want to know more, Microchip has a tutorial on the details of wearout with some nice diagrams of how EEPROM cells are designed:

If you've run into any other clever ideas for EEPROM wearout mitigation please let me know.

TwitchFilm: The Many Faces Of Simon Pegg

Last week brought a new installment in the Mission: Impossible series, and with it a supporting appearance by Simon Pegg. For some time, just after his international breakthrough, it seemed Simon was some kind of superman. Whether you were checking his latest output or digging into his back catalogue, you only kept discovering more and more gold. Here was a fellow geek and fan who "got it", and who was part of a fun team which was creatively capable of transferring that love cinematically to a large audience. A team (hell, an A-team, even!) which understood the difference between parody and homage, and could do both. Alas, some lesser entries in his output have not kept him at the automatic "must-see" level for me (though...

[Read the whole post on]

Planet Haskell: JP Moresmau: Playing with Recurrent Neural Networks in Haskell

Some time ago an interesting article surfaced on Reddit, about using recurrent neural networks to generate plausible looking text. Andrej did a very good job in explaining how they work and some of the techniques and algorithms he used. I thought this was worth some explorations on my own, so I did a bit of research and tried to implement my own networks in Haskell.

I implemented the basics using the hmatrix package to have vectors and matrices. I went to Khan Academy to learn more about these topics because I had stopped math in school before learning matrices. Once I managed to implement hopefully correctly the algorithm I used the simple-genetic-algorithm package (well, my fork, uploaded on hackage) to evolve the network via genetic selection and mutation.

This gave some results, especially when I fixed my mutation code, that in fact was doing nothing, thus emphasizing again that mutation is a critical part of genetic algorithms, and not just crossovers.

Then I went to implement proper learning algorithms, a bit less random than genetic evolution. I was clearly out of my depth there, but learned a lot. To implement gradient descent I actually used the ad library and had to rewrite the algorithms without hmatrix so they would work on simple lists. Given that a couple of weeks again I didn't even understand what AD was, I'm happy I got some stuff to work. I was lucky to find some good code in python, even trying to understand the under-specified RMSProp algorithm.

The end result is not great, though. My network can learn the really complex sentence "Hello world!" and regenerate it after a couple of thousand iterations of the learning algorithm, in around a minute on my machine. I haven't managed to parallelize the treatment yet, and running on all my cores instead of just one make performance a lot worse. On more complex sentences performance becomes really bad, as both the network becomes bigger (more characters to deal with, etc) and the data to evaluate is bigger.

Trying to use a sparse representation for characters using 2 values instead of 1 as in the standard 1-of-k encoding didn't work well. I also realize that tweaks in the cost function had a huge impact on how well and how fast the network can learn. I have started to look at cutting the data in batches but I think I need to make the learning on simple data as fast as possible before moving on.

So, nothing earth shattering, no great progress or insight, but I feel I learned a lot by implementing my own stuff and running into all the issues that are probably well known of people familiar with these subjects. My artificial intelligence is still pretty dumb, but hopefully my own natural intelligence has progressed a bit!

The code is on github of course, so if anybody wants to have a look, I'll gladly take any feedback!!

Computer Science: Theory and Application: Imperative Parser Series

submitted by hzhou321
[link] [3 comments]

Ansuz - mskala's home page: Notes on notes on the plane

I have posted a detailed set of notes (PDF file) describing the theory behind my Black Swan Suite, detailing the endless chase of Elmer and Daffy across Penrose, pinwheel, and other nonperiodic tilings of the plane. Fans of music and computational geometry may find the document interesting. At the very least, it was fun to typeset.

programming: Project Euler has been hacked once again

submitted by plasmanuclear
[link] [352 comments]

Cowbirds in Love: Mother of Two

They don’t let you join support groups for mothers if you are a mother of calamities.

Toronto After Dark Film Festival Updates: FILMMAKERS: 2015 Call for Entries NOW ON! Submit by Very Final Deadline: JULY 31!

Submit your film to Toronto After Dark Film Festival 2015 here. Comic for 2015.08.02

New Cyanide and Happiness Comic

Computer Science: Theory and Application: Solving the Travelling Salesman Problem using Simulated Annealing and 2-opt algorithm

submitted by SolitaryPenman
[link] [4 comments]

TwitchFilm: Fantasia 2015 Review: CRUMBS Finds Ethiopia In Tarkovsky's Zone

Ethiopian post-apocalypse dystopian fairy tale Crumbs has a decaying handsomeness to match its unique vision. It has a confident and accomplished auteur unwillingness for either pandering or traditionally pleasing its audience, while simultaneously offering an archetypal hero-journey tale. If features an optimistic message ("the ducks are coming home..."), cloaked in a walkabout of despair and confusion that leads ultimately to 'home is where the heart is' platitudes that are not platitudes because of the sheer will of the performances. That eerie feeling you get wandering the early morning fog of an abandoned theme park is what Miguel Llansó has harnessed here, and the gorgeous melancholy is tempered with a sharp wit and soothing empathy. The film is a balm. It is also an African riff on Stalker, with the whole world...

[Read the whole post on]

Paper Bits: "The result of this is an incessantly repeating argument where a Black person says “Racism still..."

“The result of this is an incessantly repeating argument where a Black person says “Racism still exists. It is real,” and a white person argues “You’re wrong, I’m not racist at all. I don’t even see any racism.””

- I, Racist

Paper Bits: A reprise: Radical Empathy & Fierce Kindness




Is not the same as forgiveness, tolerance or being a doormat. It’s not letting people get a free pass.

It’s realising that even arseholes are scared. It’s realising that the worst criminals in history still had people who loved them. It’s realising your enemy is probably just doing the best they can in a world that makes no sense. (That’s why, incidentally, they’re adherents tof toxic ideologies and practices, andrefuse to interrogate them; such things provide them with fucking security blankets. They give them a sense of agency.)

We have to be kind to each other, even if it’s thrown back in our faces. Why? Because we’re all here together, for such a terribly short time, and contrary to popular belief WE. ALL. NEED. HELP.

All of Nietzsche’s talk of Monsters, and Abysses? That’s what he was saying. Fuck the syphilis story. He had a nervous breakdown when he witnessed a horse get beaten to death in the middle of the street.

He signed his letters Dionysos and “the crucified one” - why?

Because he realised we are all that horse, and also the people beating it.

Please, be kind. It’s the only way anything will change permanently. Be angry, rise up all you need to, but be kind to each other as you do it.

I know it’s hard, nearly impossible in fact, but it’s the only way we’re going to survive - as a species and as you and your friends and family. I’m not inherently kind, not at all. But all the good things I ever had, and have? I got them by being kind, by letting the bullshit flow past, letting the crap of the world pass by and focusing on the importance of trying my best to help other people, as they helped me.

Call me a hippy if you want - it’s not true. I’m a grumpy bastard who really would rather be a misanthrope. Maybe I can’t be kind to everyone, but I’m going to be kind to those I can be. And if they ask me why, I tell them this: Because it’s infinitely preferable to the alternative.

Because it’s not a war, it’s a rescue mission. It’s descending into the dark to find light that you can share with others, to help them learn how to heal and be whole.  If I have to bleed to do it, if I have to pour my heart out with words of storm and fury, fire and ice and black bird’s carrion calls, so fucking be it.

And you’re going to help. You have already. So many of you have already, in small unnoticed ways, but you have and will

Consider this a reminder then. Consider this a voice in your ear. An act of memory.

Thank you for existing. For reading these words.

Be well, OK?

Needs reblogging to remind myself

Going to need this, today.

Paper Bits: "To my aunt, the suggestion that “people in The North are racist” is an attack on her as a racist...."

“To my aunt, the suggestion that “people in The North are racist” is an attack on her as a racist. She is unable to differentiate her participation within a racist system (upwardly mobile, not racially profiled, able to move to White suburbs, etc.) from an accusation that she, individually, is a racist.”

- I, Racist

Planet Haskell: Dimitri Sabadie: Luminance – framebuffers and textures

I’m happily suprised that so many Haskell people follow luminance! First thing first, let’s tell you about how it grows.

Well, pretty quickly! There’s – yet – no method to make actual renders, because I’m still working on how to implement some stuff (I’ll detail that below), but it’s going toward the right direction!


Something that is almost done is the framebuffer part. The main idea of framebuffers – in OpenGL – is supporting offscreen renders, so that we can render to several framebuffers and combine them in several fancy ways. Framebuffers are often bound textures, used to pass the rendered information around, especially to shaders, or to get the pixels through texture reads CPU-side.

The thing is… OpenGL’s framebuffers are tedious. You can have incomplete framebuffers if you don’t attach textures with the right format, or to the wrong attachment point. That’s why the framebuffer layer of luminance is there to solve that.

In luminance, a Framebuffer rw c d is a framebuffer with two formats. A color format, c, and a depth format, d. If c = (), then no color will be recorded. If d = (), then no depth will be recorded. That enables the use of color-only or depth-only renders, which are often optimized by GPU. It also includes a rw type variable, which has the same role as for Buffer. That is, you can have read-only, write-only or read-write framebuffers.

And of course, all those features – having a write-only depth-only framebuffer for instance – are set through… types! And that’s what is so cool about how things are handled in luminance. You just tell it what you want, and it’ll create the required state and manage it for you GPU-side.


The format types are used to know which textures to create and how to attach them internally. The textures are hidden from the interface so that you can’t mess with them. I still need to find a way to provide some kind of access to the information they hold, in order to use them in shaders for instance. I’d love to provide some kind of monoidal properties between framebuffers – to mimick gloss Monoid instance for its Picture type, basically.

You can create textures, of course, by using the createTexture w h mipmaps function. w is the width, h the height of the texture. mipmaps is the number of mipmaps you want for the texture.

You can then upload texels to the texture through several functions. The basic form is uploadWhole tex autolvl texels. It takes a texture tex and the texels to upload to the whole texture region. It’s your responsibility to ensure that you pass the correct number of texels. The texels are represented with a polymorphic type. You’re not bound to any kind of textures. You can pass a list of texels, a Vector of texels, or whatever you want, as long as it’s Foldable.

It’s also possible to fill the whole texture with a single value. In OpenGL slang, such an operation is often called clearing – clearing a buffer, clearing a texture, clearing the back buffer, and so on. You can do that with fillWhole.

There’re two over functions to work with subparts of textures, but it’s not interesting for the purpose of that blog entry.

Pixel format

The cool thing is the fact I’ve unified pixel formats. Textures and framebuffers share the same pixel format type (Format t c). Currently, they’re all phantom types, but I might unify them further and use DataKinds to promote them to the type-level. A format has two type variables, t and c.

t is the underlying type. Currently, it can be either Int32, Word32 or Float. I might add support for Double as well later on.

c is the channel type. There’re basically five channel types:

  • CR r, a red channel ;
  • CRG r g, red and green channels ;
  • CRGB r g b, red, green and blue channels ;
  • CRGBA r g b a, red, green, blue and alpha channels ;
  • CDepth d, a depth channel (special case of CR; for depths only).

The type variables r, g, b, a and d represent channel sizes. There’re currently three kind of channel sizes:

  • C8, for 8-bit ;
  • C16, for 16-bit ;
  • C32, for 32-bit.

Then, Format Float (CR C32) is a red channel, 32-bit float – the OpenGL equivalent is R32F. Format Word32 (CRGB C8 C8 C16) is a RGB channel with red and green 8-bit unsigned integer channels and the blue one is a 16-bit unsigned integer channel.

Of course, if a pixel format doesn’t exist on the OpenGL part, you won’t be able to use it. Typeclasses are there to enforce the fact pixel format can be represented on the OpenGL side.

Next steps

Currently, I’m working hard on how to represent vertex formats. That’s not a trivial task, because we can send vertices to OpenGL as interleaved – or not – arrays. I’m trying to design something elegant and safe, and I’ll keep you informed when I finally get something. I’ll need to find an interface for the actual render command, and I should be able to release something we can actually use!

By the way, some people already tried it (Git HEAD), and that’s amazing! I’ve created the unstable branch so that I can push unstable things, and keep the master branch as clean as possible.

Keep the vibe, and have fun hacking around!

Computer Science: Theory and Application: SciRate: an open source website to browse, save and comment arXiv articles

submitted by gasche
[link] [8 comments]

Computer Science: Theory and Application: Green Programmer Survey Report

Dear programmers,

To aide programmers in producing power efficient applications, we need to understand what programmers generally know or do not know about software power consumption. By understanding the mental environment of programmers, we can better design tools and solutions that address their needs to reduce software power consumption.

On 2013-09-04, we invited this group to participate in our Green Programmer Survey.

Thank you all who contributed to the research.

Through the survey we try to answer four research questions:

[RQ1] Are programmers aware of software energy consumption?

[RQ2] What do programmers know about reducing the energy consumption of software?

[RQ3] What is the level of knowledge that programmers possess about energy consumption?

[RQ4] What do programmers think causes spikes in software energy consumption?

The research results will be published in IEEE Software in the near future.

If you are interested, the raw data summary can be found online.

A preprint version of the paper for peer review can be found in PeerJ.

If you have subscription to IEEE Xplore, the IEEE early access version of What do programmers know about software energy consumption? is also available.

Once again, thank you very much for your help.

Best regards,

Green Programming Team

submitted by green_prgm
[link] [18 comments]

Lambda the Ultimate - Programming Languages Weblog: Running Probabilistic Programs Backwards

I saw this work presented at ESOP 2015 by Neil Toronto, and the talk was excellent (slides).

Running Probabilistic Programs Backwards
Neil Toronto, Jay McCarthy, David Van Horn

Many probabilistic programming languages allow programs to be run under constraints in order to carry out Bayesian inference. Running programs under constraints could enable other uses such as rare event simulation and probabilistic verification---except that all such probabilistic languages are necessarily limited because they are defined or implemented in terms of an impoverished theory of probability. Measure-theoretic probability provides a more general foundation, but its generality makes finding computational content difficult.

We develop a measure-theoretic semantics for a first-order probabilistic language with recursion, which interprets programs as functions that compute preimages. Preimage functions are generally uncomputable, so we derive an abstract semantics. We implement the abstract semantics and use the implementation to carry out Bayesian inference, stochastic ray tracing (a rare event simulation), and probabilistic verification of floating-point error bounds.

(also on SciRate)

The introduction sells the practical side of the work a bit better than the abstract.

Stochastic ray tracing [30] is one such rare-event simulation task. As illus- trated in Fig. 1, to carry out stochastic ray tracing, a probabilistic program simulates a light source emitting a single photon in a random direction, which is reflected or absorbed when it hits a wall. The program outputs the photon’s path, which is constrained to pass through an aperture. Millions of paths that meet the constraint are sampled, then projected onto a simulated sensor array.

The program’s main loop is a recursive function with two arguments: path, the photon’s path so far as a list of points, and dir, the photon’s current direction.

simulate-photon path dir :=
  case (find-hit (fst path) dir) of
    absorb pt −→ (pt, path)
    reflect pt norm −→ simulate-photon (pt, path) (random-half-dir norm)

Running simulate-photon (pt, ()) dir, where pt is the light source’s location and dir is a random emission direction, generates a photon path. The fst of the path (the last collision point) is constrained to be in the aperture. The remainder of the program is simple vector math that computes ray-plane intersections.

In contrast, hand-coded stochastic ray tracers, written in general-purpose languages, are much more complex and divorced from the physical processes they simulate, because they must interleave the advanced Monte Carlo algorithms that ensure the aperture constraint is met.

Unfortunately, while many probabilistic programming languages support random real numbers, none are capable of running a probabilistic program like simulate-photon under constraints to carry out stochastic ray tracing. The reason is not lack of engineering or weak algorithms, but is theoretical at its core: they are all either defined or implemented using [density functions]. [...] Programs whose outputs are deterministic functions of random values and programs with recursion generally cannot denote density functions. The program simulate-photon exhibits both characteristics.

Measure-theoretic probability is a more powerful alternative to this naive probability theory based on probability mass and density functions. It not only subsumes naive probability theory, but is capable of defining any computable probability distribution, and many uncomputable distributions. But while even the earliest work [15] on probabilistic languages is measure-theoretic, the theory’s generality has historically made finding useful computational content difficult. We show that measure-theoretic probability can be made computational by

  1. Using measure-theoretic probability to define a compositional, denotational semantics that gives a valid denotation to every program.
  2. Deriving an abstract semantics, which allows computing answers to questions about probabilistic programs to arbitrary accuracy.
  3. Implementing the abstract semantics and efficiently solving problems.

In fact, our primary implementation, Dr. Bayes, produced Fig. 1b by running a probabilistic program like simulate-photon under an aperture constraint.

Saturday Morning Breakfast Cereal: Saturday Morning Breakfast Cereal - Exam Nightmare

Hovertext: In case you're wondering, yes, I would ace a test in smugness.

New comic!
Today's News:


i like this art: Nina Koennemann


Nina Koennemann.

Work from Lithic Reductions.

“Lithic Reductions is a site-specific installation by NINA KOENNEMANN presented in the former paint spraying booth at Taylor Macklin in Zürich.

The project focuses on NINA‘s porcelain objects that look like archaeological fragments. She took an interest in the development of stone tools which is still practiced by hobbyists as ‘knapping’. The knappers attempt, according to the press release, ‘to replicate neolithic artifacts, contextualizing their works with technical speculation, esoteric projections of stone-age thinking, and imagined narratives of survival and scarcity’.

By displaying these fictional prehistoric tools made of sanitary porcelain in the industrial exhibition space of Taylor Macklin , NINA KOENNEMANN not only questions the current notions of history, universal knowledge and vernacular culture but also examines the vestiges of the repertoire of forms within contemporary art.

➝ Lithic Reductions by NINA KOENNEMANN is on view at Taylor Mackin in Zürich till August 18, 2015.

-via We Find Wildness Comic for 2015.08.01

New Cyanide and Happiness Comic

All Content: You Picked the Wrong Guy to Bully: "Rowdy" Roddy Piper, 1954-2015


Roddy Piper was put on this Earth to chew bubblegum and kick ass and he's all out of bubblegum.

He put on those dark shades in "They Live" (1988), and saw things how they really were. The billboards read, "OBEY." The 1%-er investment bankers were really skull- faced aliens, and the rising income inequality that has been going on in this country at least since Reagan took office was all laid bare in a modestly-budgeted John Carpenter sci-fi movie starring a professional wrestler.

But "Rowdy" Roddy Piper wasn't just any pro-wrestler. He was probably the craziest man in the insane asylum. He busted beer bottles over his head and let the blood just drip down his face while issuing challenges to the Sheepherders, all in front of a live studio audience. He also wrestled a bear once in Fresno. Another wrestler slapped a handful of honey on Piper's trunks as he made his way into the ring. The bear buried his snout in Piper's rear for several painful minutes. This was called paying your dues, and Piper paid them in full with interest.

He was an undersized hellhead in a world of giants who made you believe that he was a menace to 6'8" mounds of muscle like Hulk Hogan through sheer intensity. That crazy glint in Roddy's eye that made him a top attraction during the WWF's (now WWE) 1980s WrestleMania boom period, also made him so believable as John Carpenter's alien-blasting bindlestiff in "They Live." Sure, Kurt Russell, Carpenter's muse in so many similar films in the 1980s, could have acted circles around Piper, but he wouldn't have put in a better performance.

When Piper says, "You look like your head fell in the cheese dip back in 1957," to one of those skeletal aliens, it's the same kind of line that could have incited a riot in the wrestling ring, as Piper recalls doing in Los Angeles and Puerto Rico in his autobiography, "In the Pit With Piper" (Berkley Trade, 2002). Piper knew the power of insults in a way that no mere actor ever could.

Born Roderick George Toombs in Saskatoon, Saskatchewan on April 17, 1954, Piper had his first wrestling match by the time he was 15. He wrestled Larry "The Axe" Hennig in Winnipeg. Hennig beat Piper in ten seconds.

"That match certainly didn't help my confidence," he once recalled to me.

In 1975, when Piper was just 18, he made his way to Los Angeles, where he became the protégé of "Judo" Gene LeBell, an ass-kicking renaissance man who mastered overlapping careers in martial arts, pro-wrestling and movie stunt work that would've permanently crippled lesser men. LeBell taught Piper the chokeholds and arm bars that he needed to survive in the wrestling ring, where the fights may have been fake, but the pain never was.

In 1978, LeBell brought Piper into another one of his spheres, helping Roddy land his first movie role in Carl Reiner's "The One and Only," a heavily fictionalized Gorgeous George biopic starring Henry Winkler during his Fonz heyday. For Piper's part, Winkler smashed a German helmet repeatedly over his skull during a sports montage. Pain was always going to be part of Piper's art.

While "They Live" is the film that Piper will be best remembered for, and the only film many people think he was ever in, he ground his way through enjoyable low-budget junk-food like "Hell Comes to Frog Town" (1988), "Body Slam" (1986) and "Street Team Massacre" (2007). He also amassed guest starring roles in such television shows as "Walker Texas Ranger," "Highlander," "Robocop," and a recurring role in " It's Always Sunny in Philadelphia" as, appropriately, Da' Maniac. Like so many stars of straight-to-streaming grindhouse fare, Piper leaves four films in post-production, ensuring that he'll have new releases hitting the Redbox for months to come.

The one time I had anything resembling a conversation with Piper was when I was the ghostwriter for LeBell's autobiography. Piper dictated the foreword to Gene LeBell's autobiography to me over the phone. As he wrapped up his piece on his mentor and sensei, I told him that I was flying out for a two-week wrestling tour of Europe the next day.

"That's rough, brother," he said. "That's real rough."

Then he asked how much I was making on the tour. It's not a rude question in wrestling circles. When I told him, he said, "$100 for wrestling? That's not bad for wrestling."

That moment of empathy from such a tough man made today's news of Piper's passing much harder to take than other celebrity deaths. By the end of Piper's active pro-wrestling career, he was a throwback who struggled to maintain a sense of honor in an industry that increasingly had little use for such things. He was a true mensch in a business (hell, a world) full of thieves. He honored handshake agreements, and was loyal to those who had his back and gave him his start.

Sometime last night, Piper posted a tweet that ended with, "YOU PICKED THE WRONG GUY TO BULLY!" Then he went to bed, and never woke up.

Looking at it now, "YOU PICKED THE WRONG GUY TO BULLY" with the caps lock going full throttle is as fitting an epitaph for "Rowdy" Roddy Piper as any. He will not only be missed, but I know so many people who miss him already. 

Open Culture: Kurt Vonnegut Maps Out the Universal Shapes of Our Favorite Stories

Imagine a hat. Flip it upside down, and you’ve got yourself the outline of a story the public will never weary of, according to author Kurt Vonnegut, who maps it on out a chalkboard in the video above.

His Y-axis charts a range between good and ill fortune. Vonnegut recommends positioning your main character slightly closer to the good (i.e. wealth and boisterous health) end of the spectrum, at least in the beginning. He or she will dip below midline soon enough.

As for the X-axis, Vonnegut labels it B-E, from beginning to end.

Now plot your points, remembering that it’s all about the curves.

Some popular themes include people getting in and out of trouble, and the evergreen boy gets girl. (The always progressive Vonnegut reminds his viewers that the genders in the latter scenario are always open to interpretation. Again, it’s the curves that count…)

Thinking about my favorite books and films, it seems that most do follow Vonnegut’s upside-down hat narrative arc.

Are there exceptions?

Horatio Alger’s rags to riches stories, for example. We should all be so lucky to find ourselves powering up such a steep uphill grade.

Of course there are exceptions!

Vonnegut himself identifies a particularly high profile one, whose geometry is less an elegant curve than a staircase that terminates in a free fall. (SPOILER: it involves a fairy godmother and ends in an infinity symbol.

Those weary of parsing story using the Hero’s Journey template should investigate Vonnegut’s graphic approach. It works!

Related Content:

Kurt Vonnegut’s 8 Tips on How to Write a Good Short Story

Kurt Vonnegut Explains “How to Write With Style”

Kurt Vonnegut Urges Young People to Make Art and “Make Your Soul Grow”

Ayun Halliday is an author, illustrator, and Chief Primatologist of the East Village Inky zine. Follow her @AyunHalliday

%%POST_LINK%% is a post from: Open Culture. Follow us on Facebook, Twitter, and Google Plus, or get our Daily Email. And don't miss our big collections of Free Online Courses, Free Online Movies, Free eBooksFree Audio Books, Free Foreign Language Lessons, and MOOCs.

Open Culture: What Beatboxing and Opera Singing Look Like Inside an MRI Machine

Beatboxing, the practice of producing drum machine-like beats (especially TR-808-like beats) with one’s voice, has long since made the transition from parlor trick to acknowledged musical art form. But we still have much to understand about it, as the recently-emerged first generation of beatboxing scholars knows full well. “A team of linguistics and engineering students at USC wanted to learn more about the mechanics behind the rhythms,” writes Los Angeles Times music critic Randall Roberts. “By using MRI technology, they recorded an unnamed local beatboxer working his magic, broke down the most commonly employed sounds by examining the movements of his mouth and then analyzed the data.”

This resulted in a paper called “Paralinguistic Mechanisms of Production in Human ‘Beatboxing’: A Real-Time Magnetic Resonance Imaging Study.” Roberts describes it as “predictably heavy with linguistic jargon, but even to a civilian, the results are illuminating,” especially the video the research team recorded, “which reveals how the human mouth can so convincingly create the pop of a snare drum.” At the top of the post, you can see this sort of thing for yourself: in this video “The Diva and the Emcee,” featured at the International Society for Magnetic Resonance in Medicine (ISMRM) Scientific Sessions in Seattle, we see how a beatboxer’s technique compares to that of an opera singer.

You can find out more at the site of the Speech Production and Articulation Knowledge group (SPAN), the USC team that performed this pioneering research into an important component of one of the pillars of hip hop. Keep their findings in mind next time you watch a beatboxing clip that goes viral (such as the Goldberg Variations one we featured back in 2012) for a richer listening experience. After all, it does no harm to the romance of the beatbox, to paraphrase Carl Sagan, to know a little bit about it.

Related Content:

Beatboxing Bach’s Goldberg Variations

All Hail the Beat: How the 1980 Roland TR-808 Drum Machine Changed Pop Music

Langston Hughes Reveals the Rhythms in Art & Life in a Wonderful Illustrated Book for Kids (1954)

Do Rappers Have a Bigger Vocabulary Than Shakespeare?: A Data Scientist Maps Out the Answer

Colin Marshall writes on cities, language, Asia, and men’s style. He’s at work on a book about Los Angeles, A Los Angeles Primer, and the video series The City in Cinema. Follow him on Twitter at @colinmarshall or on Facebook.

%%POST_LINK%% is a post from: Open Culture. Follow us on Facebook, Twitter, and Google Plus, or get our Daily Email. And don't miss our big collections of Free Online Courses, Free Online Movies, Free eBooksFree Audio Books, Free Foreign Language Lessons, and MOOCs.

Open Culture: Patti Smith Plays at CBGB In One of Her First Recorded Concerts, Joined by Seminal Punk Band Television (1975)

The picture of punk as the domain of boorish nihilists who can’t play their instruments has been as much a creation of marketing (via Malcolm McLaren) as it has been a virtue-of-necessity minimalist pose and a form of avant garde DIY experimentalism. But there have always been, since the coining of the term “punk” as a musical genre, stellar musicians and thoughtful, poetic lyricists shaping the scene. Of the former, we must mention Television, with their magnificent guitar interplay between leader Tom Verlaine and Richard Lloyd. And, of the latter, we need look no further than the godmother of punk herself, Patti Smith, who has always commanded stage and studio with her smart, arresting lyricism and powerful set of pipes.

Years before the Sex Pistols invaded the States, these two bands played regularly at CBGBs (Television was, in fact, the very first band to play there) with a loose collection of misfits who re-invented rock and roll. In December, 1975, Smith released her first album, Horses, a hybrid of punk and spoken word produced by the Velvet Underground’s John Cale. But before that record made her famous—in April of that year—the Patti Smith Group took the stage with Television, and two teenage fans were there to record both sets from both bands. First appearing as a bootleg CD generically titled “Early Gig ’75,” the disc has since been reissued as We Can’t Do Anymore… Cause I’m Just Too Tired!, with another set of Smith covers tacked on from a ’78 concert in Santa Monica.

We get classic tracks from both bands, such as Television’s “Marquee Moon” and “Little Johnny Jewell” and Smith’s cover of “Hey Joe” and Van Morrison’s “Gloria” as well as her own “Horses” and “Piss Factory.” At the top of the post, you can hear her do six songs from that night in 1975, the last three with Television joining her onstage: “We’re Going to Have a Real Good Time Together” (Velvet Underground cover), “Redondo Beach,” “Birdland,” “Space Monkey,” “Distant Fingers,” and “Gloria.” You’ll also hear the two young tapers chatting it up in the first few minutes of the tape.

Smith’s band, writes bootleg blog Doom & Gloom From the Tomb, “was transitioning from a cabaret-leaning trio to a fully-fledged rock band sound,” and the ramshackle performances show us a talented bunch of musicians still finding their footing as a group. The following year, Smith and band would appear in Stockholm after the release of Horses. As you can see and hear above (after a brief interview) they’d become a tighter, and somewhat more conventional, rock and roll machine, but the early performances at the top—for all the lo-fi murkiness and intrusive crowd noise—have a raw appeal only heightened by the fact that they are now important documents of a now-legendary musical era. See this review of the bootleg CD reissue for a blow-by-blow description of this historic ’75 concert from two seminal, and phenomenally talented, punk bands.

Related Content:

The Talking Heads Play CBGB, the New York Club that Shaped Their Sound (1975)

The Ramones, a New Punk Band, Play One of Their Very First Shows at CBGB (1974)

Blondie Plays CBGB in the Mid-70s in Two Vintage Clips

Josh Jones is a writer and musician based in Durham, NC. Follow him at @jdmagness

%%POST_LINK%% is a post from: Open Culture. Follow us on Facebook, Twitter, and Google Plus, or get our Daily Email. And don't miss our big collections of Free Online Courses, Free Online Movies, Free eBooksFree Audio Books, Free Foreign Language Lessons, and MOOCs.

Paper Bits: "White people do not think in terms of we. White people have the privilege to interact with the..."

“White people do not think in terms of we. White people have the privilege to interact with the social and political structures of our society as individuals. You are “you,” I am “one of them.””

- I, Racist

Greater Fool - Authored by Garth Turner - The Troubled Future of Real Estate: If he asked me


It’s a day etched in my memory. The prime minister called me into his office on the third floor of Centre Block, with the big wooden door guarded by two beefy guys with wires in their ears.

He said a few things that pissed me off, so I got up to leave. He ordered me to sit. Like a poodle. Then this: You were a journalist, he continued. Journalists make lousy politicians. They think they always have to tell the truth.

And that was the moment I knew this was going nowhere. So I left. A few weeks later my derriere was punted from the Conservative party, even thought I’d been elected a Con MP. The PM sent his caucus chairman out to tell the media it was because I had blogged about matters the public had no right to know. (By the way, that guy was later arrested by the OPP with drugs in his vehicle.)

See how much fun politics is? Mr. Harper knew that by running me out of the party I’d be finished. I knew it, too. And that’s exactly what happened. I became a pathetic blogger, sleeping in ditches and underpasses, stealing food scraps from feral dogs, selling financial advice in bath houses and brothels, until rescued by a kindly nun who turned out to be an Amazon. But that’s another story.

I mention this because we’re at a new intersection of economics and politics. Sometime this weekend, it seems, the Big Guy will drop the writ for the autumn election. The supposed date is October 19th, but if he asked me (lol) I’d suggest Monday the 14th of September. There are a few reasons for this.

First, the Bank of Canada is set to make its next interest rate announcement at 10 am on Wednesday, September 9th. This is a tricky situation for the governing Conservatives. With the economy now in negative growth every single month so far in 2015, the price of oil mired in the mid-$40 range, our trade numbers in serious deficit and job losses looming, there’s a growing chance the BoC could cut again. On one hand, voters love cheap money and free mortgages, believing it will keep their houses going up forever. On the other hand, this will hurt the dollar and underscore our economic woes, creating a sense of crisis.

That is eerily similar to the vote of October 14, 2008. The stock market was crashing, the credit crisis was expanding, companies were slashing payrolls and fear gripped the land. Is this, Stephen Harper asked, the time to let some tree-hugging, tax-increasing untested leftie take the reins of power? And he won, defeating Jack Layton and Stefan Dion.

Of course, if the central bank does not drop its rate in early September, then the government will point to it as evidence the economy is recovering and we should all get over ourselves.

Second reason for an early election: the Fed. If you believe Janet Yellen, the US central bank boss, instead of all the Nobel-winning macroeconomists who read this blog, the first rate increase in ten years will take place on September 17th. That will dramatically highlight the disparities between the two economies – theirs which is healthy enough to end excessive monetary stimulus and stand on its own and ours, which sucks bad. Besides, if the BoC cuts one week and the Fed raises the next, you can kiss the dollar (now at 76 cents) goodbye.

Third, we’re in the ninth inning for housing – a fact which will be a lot more evident to people once they stop drinking Red Bull and return to autumnal sobriety. With the Canadian economy entering a technical recession, amid lousy commodity prices, rising unemployment and off-the-chart household debt it’s only a matter of time before most people sweat. Greed can turn to fear in a few days. When it happens, folks need somebody to blame, since they themselves are utterly blameless. Remember that Canadians do not vote for a new politician. They just punish the old one.

As we head into this election-call weekend, a new report from TD is warning of “cautionary yellow” flashing over the housing markets in YVR and 416. “When we put it all together, key housing indicators on balance continue to highlight the vulnerability of the Toronto and Vancouver housing markets to a significant correction in activity and prices,” says the bank. In a departure from the past, we now have a major Bay Street outfit using words like “a steep and painful price adjustment,” which the economists are giving a “moderate” chance of happening.

So there it is. That’s why I’d call this election early, and not risk waiting until October – also traditionally the most volatile month for financial markets and the value of your TFSA. But if I were Stephen Harper, I’d have retired long ago, paving the way for a charismatic new star to grab the party horns with a fresh alternative to the leftist hordes.

Isn’t ego interesting?

CreativeApplications.Net: Waiting for Bárðarbunga – Non-Linear Landscape Cinema

Waiting for Bárðarbunga_02Created by François Quévillon, Waiting for Bárðarbunga is an installaton made of hundreds of video sequences which are presented according to a probabilistic system influenced by real-time sensor information coming from the computer that displays them.

Penny Arcade: News Post: New Shirt!

Gabe: Dabe has delivered a new shirt design that I find hits a bit too close to home. I remember very vividly when I broke my Pokemon card game addiction. I was free and clear until my son Gabe got hooked. Now I’m right back in! -Gabe out

Penny Arcade: News Post: PAX Dev Schedule is out!

Gabe: I have three pieces of PAX related news to share with you. 1. If you are attending PAX Dev and you would like to know when all the cool stuff that is happening there is happening then check out this schedule. 2. The Dates for PAX South are January 29, 30, 31. 3. We are “planning” on launching ticket sales for PAX South on September 16th 2015. 4. I hate when I’m trying to get to the World’s Grave but I get turned around at the Circle of Bones and I end up in the Skull Orchard. One of those places is not actually in Destiny. -Gabe Out

Quiet Earth: EXTINCTION is Just Another Mediocre Zombie Horror Movie [Review]

With a title like Extinction, you can pretty much guess what Miguel Ángel Vivas's new film, his English language debut, is about: the end of humanity. In this case, it's the story of the last three survivors of a zombie apocalypse.

Matthew Fox and Jeffrey Donovan star as Patrick and Jack respectively, two men surviving on the outskirts of a big city. They're so far off the beaten bath that even the monsters that prowl the cityscape seem to have forgotten about them. Patrick still makes daily outings into the city with his trusty dog to scavenge but Jack… he's more cautious. He's got a daughter who depends on him so he only goes out when absolutely necessary. And never mind taking anything that his neighbour Patrick might offer. The men don't talk and over the cou [Continued ...]

new shelton wet/dry: Who we are when we are not paying attention

One woman reported having 8 car accidents in one 150 mile journey. She was also unlucky in love. After joining a dating agency, her first date fell off his motorcycle and broke his leg. The second date walked into a glass door and broke his nose. Eventually she met her future husband and the church they were going to get married [...]

new shelton wet/dry: Every day, the same, again

Chinese workers go ‘faceless’ for a day to avoid stress of faking facial expressions There is a widespread consensus amongst psychologists that tyranny triumphs either because ordinary people blindly follow orders or else because they mindlessly conform to powerful roles. However, recent evidence concerning historical events challenges these views. 40% of the US population would not [...]

bit-player: AIpocalypse

The Murder by Robot in R.U.R. (Image from Wikipedia.)The robot that runs amok and turns on its maker has been a staple of fiction and film for at least a century. The plotline goes back to Karel ?apek’s 1921 play R.U.R., with earlier shadows of the same idea in Mary Shelley’s Frankenstein and the golem stories of Jewish folklore. Nowadays we have Arnold Schwarzenegger dressed up as The Terminator.

A number of thoughtful people (including Stephen Hawking, Nick Bostrom, Bill Gates) believe we should take the threat of AI insurrection seriously. They argue that in decades to come we could very well create some sort of conscious entity that might decide the planet would be a nicer place without us.

In the meantime there are lesser but more urgent threats—machines that would not exterminate our species but might make our lives a lot less fun. An open letter released earlier this week, at the International Joint Conference on AI, calls for an international ban on autonomous weapon systems.

Autonomous weapons select and engage targets without human intervention. They might include, for example, armed quadcopters that can search for and eliminate people meeting certain pre-defined criteria, but do not include cruise missiles or remotely piloted drones for which humans make all targeting decisions. Artificial Intelligence (AI) technology has reached a point where the deployment of such systems is — practically if not legally — feasible within years, not decades, and the stakes are high: autonomous weapons have been described as the third revolution in warfare, after gunpowder and nuclear arms.

When I last checked, the letter had 2,414 signers who identify themselves as AI/robotics researchers, and 14,078 other endorsers. I’ve added my name to the latter list.

A United Nations declaration, or even a multilateral treaty, is not going to totally prevent the development and use of such weapons. The underlying technologies are too readily accessible. The self-driving car that can deliver the kids to soccer practice can also deliver a bomb. The chip inside a digital camera that recognizes a smiling face and automatically trips the shutter might also recognize a soldier and pull the trigger. As the open letter points out:

Unlike nuclear weapons, they require no costly or hard-to-obtain raw materials, so they will become ubiquitous and cheap for all significant military powers to mass-produce. It will only be a matter of time until they appear on the black market and in the hands of terrorists, dictators wishing to better control their populace, warlords wishing to perpetrate ethnic cleansing, etc.

What would Isaac Asimov say about all this?

I was lucky enough to meet Asimov, though only once, and late in his life. He was in a hospital bed, recovering from heart surgery. He handed me his business card:


Natural Resource

No false modesty in this guy. But despite this braggadocio, he could equally well have handed out cards reading:


Gentle Soul

Asimov was a Humanist with a capital H, and he endowed the robots in his stories with humanistic ethics. They were the very opposite of killer machines. Their platinum-iridium positronic brains were hard-wired with rules that forbade harming people, and they would intervene to prevent people from harming people. Several of the stories describe robots struggling with moral dilemmas as they try to reconcile conflicts in the Three Laws of Robotics.

Asimov wanted to believe that when technology finally caught up with science fiction, all sentient robots and other artificial minds would be equipped with some version of his three laws. The trouble is, we seem to be stuck at a dangerous intermediate point along the path to such sentient beings. We know how to build machines capable of performing autonomous actions—perhaps including lethal actions—but we don’t yet know how to build machines capable of assuming moral responsibility for their actions. We can teach a robot to shoot, but not to understand what it means to kill.

Ever since the 1950s, much work on artificial intelligence and robotics has been funded by military agencies. The early money came from the Office of Naval Research (ONR) and from ARPA, which is now DARPA, the Defense Advanced Research Projects Agency. Military support continues today; witness the recently concluded DARPA Robotics Challenge. As far as I know, none of the projects currently under way in the U.S. aims to produce a “weaponized robot.” On the other hand, as far as I know, that goal has never been renounced either.

Penny Arcade: News Post: Nightlight and my Dad

Gabe: Nightlight is wrapped up now and for those who have no idea what’s going on, I posted a breakdown in the forum. When my Dad and I were at the Child’s Play golf tournament he saw me have a conversation with Kiko and Dabe about Nightlight. It was before I left for my vacation and I was really struggling to figure out what the monsters in this world would be like. The three of us were bouncing around ideas and my Dad just sat there and listened. We talked about the particular child’s fears informing each monster design. Dabe had the idea of getting real kids to draw monsters and then…

Disquiet: What Sound Looks Like

This being San Francisco, when rent on my #noiseoffice went up over 50%, I figured that was part of the price of being in the city. But then friends and colleagues started directing me toward more cost-efficient options, and in the end much of what my current office’s rent included (shared conference room, waiting area, bathroom with shower) wasn’t all that necessary for me. Surprisingly quickly, I lucked out and found a place that was 40% less than my current rent (do the math regarding how much less that is than my projected rent). Anyhow, the new spot is also about 50% larger than my previous office, though lacking in some of the amenities (no street view, fewer windows, carpet instead of wood floors). For local flavor’s sake, my new office is in between that of a massage therapist and a crematorium. They don’t have an oven in the crematorium office — they just hold meetings there. This shot is the view out the one window in my office. The building neighbors a local church, whose bells ring clearly at 5pm, and likely other times of the day — when exactly I’ll find out after I move in.

An ongoing series cross-posted from

All Content: The End of the Tour


Directed by James Ponsoldt ("The Spectacular Now"), "The End of the Tour" might fit well on a double bill with "Amadeus," another film about a genius and a lesser artist who basks in his aura. Of course, the setting is very different, and the stakes are much lower—"Tour" is a fictionalized account of the week-and-a-half that Rolling Stone writer David Lipsky spent following the late David Foster Wallace as he toured to promote his doorstop-sized masterpiece "Infinite Jest"—but it's still the story of a competent but unremarkable creative person observing brilliance up close, feeding on it, reveling in it and resenting it. 

It is also certainly one of cinema's finest explorations of an incredibly specific dynamic—that of the cultural giant and the reporter who fantasizes about one day being as great as his subject, and in the same field. What it definitely isn't is a biography of David Foster Wallace, much less a celebration of his work and worldview. Whether that proves a deal breaker, a bonus, or a non-factor for viewers will depend on what they want out of this movie. 

"The End of the Tour" is not really about Wallace (Jason Segel), although he's the other major character. It starts with Lipsky (Jesse Eisenberg) expressing amazement (but really jealousy) over a rave review of "Infinite Jest" in New York magazine, a moment that sparks his obsession with Wallace. It ultimately leaves us thinking about Lipsky's feelings and career trajectory, and whether he feels any guilt about using his brief association with Wallace to further his own career as a writer of books. At this point in his life, Lipsky has had just one volume published, a novel that few people bought and fewer read; after some hesitation, he foists it on Wallace while visiting him at the University of Illinois during a punishingly icy winter. 

The screenplay by Donald Margulies spends most of its time and energy observing a dance. One dancer is Lipsky. He only got Rolling Stone to pay for his rock-star style profile of a novelist by agreeing to ask Wallace about the rumors that he uses heroin, and his motivations for doing the story are, to put it mildly, less than noble. The other dancer is Wallace. His fiction and nonfiction were partly concerned with the meaning of the word "authenticity," and how the social rituals and technology and economic structure of modern life created false intimacies that Wallace was determined to reject. 

Theirs is a complex relationship, brief as it is. The most fascinating thing about it is how each side of it seems to be happening in a different storytelling genre. 

Wallace's side of the story is something along the lines of a light drama, perhaps even a romance, about somebody who's been burned over and over and has withdrawn from nearly all relationships save for a handful that he feels he can trust and believe in. Although the small part of the world that cares about writers' private lives thinks of Wallace as a bit of a recluse and perhaps a bit mysterious, it's immediately clear that he's just selective and self-protecting. It's the story of a man learning to trust again (in a love story, it would be "to love again") while worrying that he's going to get burned one more time. Lipsky isn't a Wallace-level intellect, he is very smart, and a good listener, and excellent at getting subjects to open up, even though his demeanor is presumptuous. He doesn't approach Wallace with the appropriate  humility. He instead comes at him from the point-of-view of a writer who believes that he is Wallace's potential equal—somebody as profound as Wallace but not as accomplished or famous, for now. Wallace seems to buy this. Why? Maybe because he's a teacher, and at least a few of his students have real talent, and he doesn't want his ego or insecurity to rule out the possibility that he might cross paths with an artist. Or maybe he's just a decent, optimistic guy.

Lipsky's side of the story often feels like the story of of a con man, or a regular person who uses other people without realizing that's what he's doing. If this were a romantic drama, Lipsky might be a drug user who swears he's gotten clean, or a recovering alcoholic who's not as far along in the process as he claims to be, or a serial cheater who wants everyone to think he's reformed and can be monogamous even though he's constitutionally incapable of that. We keep waiting for the other shoe to drop—for Wallace, who genuinely likes Lipsky even though he's observant enough to spot all the warning signs immediately, to realize that Lipsky cannot have a real friendship with him, and that in general it is a bad idea for a subject to think that he can have that kind of relationship with a reporter. 

Any journalist who's been profiling famous people for any length of time will recognize the dynamic depicted here by Ponsoldt, Eisenberg and Jason Segel, and the honest ones will be made uncomfortable by it. There is something vampiric about features like the one that Lipsky has been assigned to write. There are also elements of theatricality. As Wallace observes early on, the subject is expected to give a performance of sorts, imitating the person he'd like to be perceived as being. The reporter in turn playacts casual curiosity, and tries to push past the facade and find something real, maybe uncomfortable, best of all revelatory. 

Segel and Eisenberg, who as movie stars have been in Wallace's position many times, have an intuitive understanding of how this relationship works, and they illuminate it in the moment, with specificity and clarity. Segel doesn't really look or sound like Wallace (not that that matters; Anthony Hopkins didn't look or sound like Nixon in "Nixon" but was extraordinary) and I didn't necessarily buy him as somebody who could write like Wallace, but he's so smart and genuine and peculiar that we believe he is capable of Wallace's extreme sensitivity and delicate observations—a major accomplishment. Eisenberg is the true star of the movie—an actor of extraordinary originality and also bravery, insofar as he never seems to trouble himself with whether people will hate his characters. He's a great listener but also a rather scary one. His characters often seem to be scrutinizing other characters the way a snake might scrutinize a field mouse. There are many moments in "The End of the Tour" when we dislike Lipsky. There are a few moments where we might find him sickening. 

Is this a story that will fascinate an audience beyond editors, critics, reporters, novelists, and people who care about the problems of such people? I have no idea, though it seems unlikely; the film's incredible specificity would seem to mitigate against being discovered and championed by a wide audience, despite Segel and Eisenberg's presence in the cast. Did the film necessarily need to have David Foster Wallace as one of its two main characters? That's a thornier question. We rarely hear any of his prose read aloud (Lipsky reads a passage of "Jest" to his girlfriend, but that's about it) and there is nothing in the film besides some of Wallace's dialogue to indicate that the movie has any interest in illuminating Wallace's fiction, or the obsessions that he worked into them. 

It is very much an Amadeus and Salieri story, and if you are familiar with Amadeus, and the barest outlines of Wallace's life, and the fact that this is based on a nonfiction book by the writer David Lipsky, you know how the story must end: with Lipsky gaining a greater measure of fame via his brief association with Wallace and not being quite sure how to feel about it. The best thing you could say about "The End of the Tour" is that it could've been about any two creative people. That's also the worst thing you could say about it. 

Saturday Morning Breakfast Cereal: Saturday Morning Breakfast Cereal - Sports

Hovertext: That's the safe word!

New comic!
Today's News:

 In honor of Her August Presence, it has been renamed the Weinersmithsonian Museum.

Colossal: A Monumental Sculpture of Colorful Twine Netting Suspended Above Boston



One hundred miles of twine compose this public sculpture of suspended netting above Boston, a structure that spans the void of an elevated highway that once split downtown Boston from its waterfront. The artist, Janet Echelman (previously), designed the artwork titled As If It Were Already Here to reflect the history of the installation’s location. Echelman also intended the piece to be a visual metaphor—a way to “visually knit together the fabric of the city with art,” she explains.

The installation is 600 feet at its widest, including over 500,000 knots for structural support. Each time one section of the sculpture sways or vibrates in the wind the other parts follow suit, undulating as a single form 600 feet in the sky. As the day progresses the 1,000-pound structure’s webbed surface begins to glow, becoming a beacon in the sky rather than blending into the blue above it. In addition to moving with the wind, the structure also glows in response to sensors that register tension and project light onto the sculpture.

As If It Were Already Here is just one of Echelman’s enormous sculptures, she’s also installed pieces in Montreal, Seattle, and elsewhere. Echelman received the Guggenheim Fellowship, the Harvard University Loeb Fellowship, a Fulbright Lectureship, and was named an Architectural Digest Innovator for “changing the very essence of urban spaces.” You can see Echelman speak about her other environmentally-responsive sculptures in her TED talk here. (via Beautiful Decay)







BOOOOOOOM!: Music Video: Miami Horror “Cellophane”


Australian electro-pop band Miami Horror’s latest video, directed by Lachlan Dickie, is weird in the best way. “Cellophane” from their sophomore album All Possible Futures features a bunch of people with Inspector Gadget-like limbs. Watch the video below.

View the whole post: Music Video: Miami Horror “Cellophane” over on BOOOOOOOM!.

All Content: Best of Enemies


Examining the fiery, acerbic debates televised debates between William F. Buckley, Jr. and Gore Vidal during the Republican and Democratic conventions in 1968, Morgan Neville and Robert Gordon’s “The Best of Enemies” provides a rich, extraordinarily fascinating account that’s sure to have many viewers’ minds constantly shuttling between then and now, noting how different certain things about politics and media were in that distant era, yet marveling at how directly those archaic realities led to many of our own.

The differences may jump out first. Like the Beatles on Ed Sullivan and Neil Armstrong walking on the moon, the Buckley-Vidal throwdown was the product of the decade when television was truly in full effect in American life, and much was brand new. The 1968 conventions were the first to be broadcast in color, and an estimated 80 percent of Americans watched them. It was not an even playing field for the three networks, though. CBS and NBC had their star anchors (Walter Cronkite on the former, Chet Huntley and David Brinkley on the latter) and set out to broadcast the events gavel-to-gavel. 

Poor third-place ABC, with neither the stars nor the resources to match its competitors, needed a gimmick, and it lit upon a corker: have two ideological opposites debate the conventions as part of the network’s coverage. The choice of antagonists could not have been more incendiary. William F. Buckley, editor of the National Review and host of PBS’ “Firing Line,” was already the nation’s leading conservative media celebrity. Asked by the network if there was anyone he would not debate, he said he would refuse any Communist, or Gore Vidal. So the network of course enlisted Vidal, a celebrity provocateur from the left side of the dial, and persuaded Buckley to accept it.

The two had a history. They had crossed paths at political events in 1962 and 1964 and come away with a profound mutual loathing. As one interviewee, the late Christopher Hitchens, understates, “They really did despise each other.” That antipathy, which evidently owed much to Vidal’s taunting pan-sexuality and Buckley’s rigid Catholic revulsion at same, didn’t erupt into history-making acrimony till the ninth of the ten debates, but it’s in plain view from the first.

These exchanges came in the context of an America that was “being split at the seams,” as one commentator puts it. The Tet offensive in the winter showed the Vietnam War spiraling toward disaster. Martin Luther King and Robert F. Kennedy were assassinated not long after, the former death sparking riots across the country. When the Republicans decided to hold their convention in Miami—their first below the Mason-Dixon line in 104 years—it was intended to distance the event from protestors.

When we see Buckley and Vidal in the first debate, both seem self-conscious and slightly awkward, with forced smiles and graceless stabs at jocularity. No doubt the pressurized situation and their intense dislike of each other accounted for this initial discomfort, but the two media pros soon overcame it. Still, they were fundamentally ill-matched in the initial round: While Buckley had gone sailing prior to the convention, Vidal had hired a researcher and come away with a sheaf of Buckley quotes that he used to nail him. Buckley soon rectified his mistake. 

Speaking of the differences between then and now, it’s striking how remote from any current TV personalities they are. Both were products of plush upbringings and boarding schools, with patrician accents and mannerisms that scream privilege and hauteur. Yet despite the upper-crust images, they were not, as one observer notes, products of the old Eastern establishment, but conquerors of it: outsiders who found their way in.

Public intellectuals of a sort almost unknown today—which is to say, real intellectuals totally accustomed to the media glare—both men were extremely prolific authors who also ventured into the arena of politics. Vidal ran for Congress in 1960 with the support of presidential candidate John F. Kennedy (Jackie Kennedy was related to the author by marriage); on losing the race, he bitterly left the U.S. for Italy. For Buckley, losing his race for New York City mayor to liberal John V. Lindsay in 1965 was not a total defeat; it helped him sharpen the ideas that would guide right-wing politicos in years to come.

In a sense, the two debaters we see sparring in 1968 are prophets in the making. Buckley’s ideas, perhaps more than any other thinker’s, undergirded the conservative movement that gathered momentum during the next decade and resulted in the election of Ronald Reagan in 1980. And Buckley’s own brother, Reid Buckley, actually uses the word “prophesy” in crediting Vidal for warning about the dangers of America turning into an overextended empire like ancient Rome.

Indeed, the racial turmoil of 1968, the arguments over economic inequality (Vidal called the GOP the “party of greed” while quoting statistics showing far less disparity than is the case now), the draining foreign entanglements, the “culture wars” over values and morality, together with Buckley’s and Vidal’s provocatively contrasting views of all such subjects – it all make the debates we hear feel very much connected to the present day.

Yet the sharpest verbal blows waged aren’t ideological but personal. It happens in that ninth debate, after the scene has shifted to the Democratic convention in Chicago, where chaos reins in the streets outside (and Vidal has been tear-gassed along with Paul Newman and Arthur Miller). During one heated exchange, Vidal calls Buckley a “crpyto-Nazi” and Buckley replies, “Listen you queer, stop calling me a crypto-Nazi or I’ll sock you in your goddamn face and you’ll stay plastered.”

Even now, you can practically hear the nation gasp. Mr. and Mrs. America were not used to hearing such language, or witnessing such visceral hatred between respected cultural figures, on the pacifying white-bread TV of the time. The repercussions were felt instantly. Says Dick Cavett of ABC: “The network shat.”

Strangely, as the film shows, this moment of white-hot vituperation had an even greater effect on the two men involved than on the culture at large. Neither could put it behind him. Buckley wrote a long piece for Esquire the following year ruminating on the contretemps. When Vidal riposted with (insulting) thoughts of his own, Buckley sued the magazine and the writer, a lawsuit that dragged on for years (Esquire eventually settled). As the intimates of both men tell it, they were haunted by the exchange till the end of their days, with Vidal apparently gaining a small degree of satisfaction in outliving Buckley and thus being able to have the final word.

Naturally, the way the Vidal-Buckley battle served as a template for all the idiotic political shouters on TV in years to come does not go unnoted. And not surprisingly, the verdict on this is that we’ve now evolved into a polarized culture where such high-volume screaming matches are virtually all heat and no light. The 1968 debates, critic Eric Alterman offers, were a “harbinger of an unhappy future.”

All Content: Counting


In his masterful “Museum Hours,” filmmaker Jem Cohen merged his skills as an urban documentarian with a narrative about two unlikely friends. Art, history, companionship, support and everyday life merged into one vision. His latest, “Counting,” billed as a “A film in 15 Chapters,” is both more ambitious and less purposeful in its intent. Clearly designed as a nod to Chris Marker (particularly “Sans Soleil”), “Counting” captures life around the world in all its simplicity and diversity, as Cohen bounces back and forth from New York City to Russia to Turkey, and locales in between. There’s little narration, little noise at all outside of the hum of traffic or the whine of a train or the rustle of leaves. Most people in frame are seen from behind, or via reflection, or from a distance. And there are cats. Everywhere. Cohen isn’t as interested in faces as he is urban tableaus. The result is a challenging work that can be both exhilarating and grueling in its deliberate pace. Cohen is an undeniably gifted filmmaker, even if the sum total of this piece isn’t quite as interesting as its parts.

“Counting” opens in New York City, featuring footage that the filmmaker captured around the city from 2012 to 2014. The first segment of “Counting,” which I believe is also its longest, is arguably its best as it’s a fantastic display of Cohen’s skills. He can turn the mundane imagery of urban existence into art by the way it’s shot, scored, or juxtaposed with another image. What captures his eye and the way he weaves into a piece can often result in great art. In the first segment, we hear a speech about discovering the secrets of the universe while we view a sedentary homeless person. We see a torn page with a headline about “The World’s Last Mysteries.” Cohen is placing imagery and audio of the questions of the universe against reflections of travelers on a train or a homeless man crossing the street. This is daily life and the world’s greatest mysteries are contained within it.

Cohen has a remarkable ability to go from placid, almost soothing imagery to kinetic, more frantic footage like when he captures an “I Can’t Breathe” protest scored to discordant, loud music. Even flags waving in the wind at a car dealership look antagonistic. He’s playing with the essence of filmmaking here, knowing that the images just before and after those flags, along with the choice of audio, change the way the viewer responds to them.

Sometimes Cohen can be straightforward and even didactic, such as in chapter 7, in which he presents imagery of reflections of people on their phones accompanied by audio of testimony about the NSA wiretapping. Although even this “short film within the big film” feels contextually resonant within a piece that feels, at least to me, about interconnectivity and commonality. Cohen jumps around the world and finds numerous images that look like reflections of each other. People crossing squares in New York City and St. Petersburg become often indistinguishable. Some of his compositions are picture-postcard beautiful while others take a minute to even discern what it is being displayed. And he’s obsessed with travel and motion. A voice sings in one chapter, “Do you ever wonder where it is you’re wandering?” We’re all wanderers around this world that’s more similar than we even know.

There are times, many times actually, when “Counting” feels a bit too self-indulgent, something that never struck me during “Museum Hours,” an undeniably more accessible piece for the average filmgoer. It starts to get a bit exhausting and unfocused. Unpacking “Counting” can be difficult, and it feels at times like it’s purposefully so, as if Cohen is challenging traditional expectations of film analysis, even ones as often abstract as his. But one cannot deny the ambition of “Counting,” a movie that travels the world, connecting it through the commonality of both everyday behavior and the universal language of cinema.

“Counting” ends almost peacefully, with images of calm and night. I was hoping for a bit more cumulative power, something to tie these chapters together, but I think Cohen purposefully avoids those kind of easy cinematic answers. Maybe these are just images, people and places around the world that he found interesting. Perhaps you will too. And sometimes life is as simple as that.

All Content: Wild City


Hong Kong neo-noir "Wild City" takes its time going everywhere it needs to go. That's not a diplomatic way of saying that the film is boring, nor is it a polite way of admitting that the film is poorly paced. Instead, "Wild City," the first feature film written and directed by master Hong Kong filmmaker Ringo Lam ("City on Fire," "Full Alert") in 12 years, is unhurried, stylish, and completely unreal. This is a movie that introduces you to T-Man (Louis Koo, contemporary Hong Kong cinema's answer to Chow Yun-Fat), its jaded lead protagonist, by showing him staring off in the mid-distance on a crowded Hong Kong street corner. This is shortly after T-Man laments that money corrupts everything, a theme that the film returns to frequently. T-Man's world of middle-men gangsters, fairweather associates, and commonplace violence feels real because Lam takes his sweet time while rehashing a story you've probably seen in one form of another. This is a film noir that is, despite some jittery, Tony Scott-esque action sequences, so cool, that you will leave it begging for a sequel.

Meet T-Man, an unfortunately-named anti-hero who could easily stand shoulder-to-shoulder with modern pulp heroes like Jack Reacher or Jason Bourne. T-Man, a bartender and haunted ex-cop, is the kind of pragmatic gentleman who gracefully gives Yun (Tong Liya), a mysterious drunk, a couch to crash on after she gets in a bad car accident, but also casually asks step-mom Mona (Yuen Qui) to be his "witness" that he did nothing untoward to Yun. Yun may be the crux of a mystery that involves a stolen briefcase, a gang of lead-pipe-wielding thugs, and T-Man's brother Chung (Shawn Yue). But "Wild City" is all about T-Man, a not-all-good guy whose wardrobe comes in shades of white: bright-white khakis, and cream-colored jackets all look amazing on Koo. 

"Wild City" is also a film with twists that can be seen from a mile away, though that doesn't really matter. "Wild City" reminds me of a line from a recent Leonard Cohen song: "I've always liked it slow/slow is in my blood." You could easily believe that line is true of Lam, even if "Wild City" is the first film you've seen by Lam. To be fair, the film is clearly made by an older filmmaker who wants to prove his relevance by modernizing his style in some ways, and retaining its laid-back essence in most others. So some of the film's chase scenes are frantic, full of jittery in-camera effects, over-exposed lenses, and choppy editing that give you the feeling of being shell-shocked during pivotal chase scenes. And some lines of dialogue are hokey as sin, particularly when T-Man laments that he gets no kick from money: "In exchange for time that can never be returned, this printed paper is all over-valued."

Luckily, Koo delivers a star-worthy turn and holds "Wild City" together in the same way that Chow Yun-Fat and Lau Ching-wan did for Lam's earlier efforts. Koo is so good that he makes you see Lam's style as style, and not a desperate collection of aesthetic quirks. Just look at the scene where Chung, Yun, and T-Man have a fight while they're aboard a small yacht (!!!). When Chung storms off in a huff, and starts swimming away from the boat, Yun innocently asks T-Man: "Can he make it to shore?" Koo replies with a pregnant, Bogart-esque pause. 

Koo is unstoppable in "Wild City." He nails a Mametian line as slick as "I trust you. But I don't trust the money." Koo is so damn charming that he even looks good during a foot-chase where his gangly physical appearance should make him look as hip as Tom Hanks (long legs, ball cap, freshly-pressed white khakis: move over, dadbod, here comes: starched-collar-bod!).

Watching Koo, as T-Man, fire a gun in the air to disperse a crowd is thrilling because it makes you want to believe that he's not playing it cool, but rather introducing you to the next big dime novel hero. I have purposefully kept the film's plot a mystery because the joys of "Wild City" come from getting to know the characters through their bitter one-liners, romantic behavior, and sensational confrontations. Case in point: there's a scene of violence later in the film that is so shockingly grim that it's a small wonder that it works within the context of the rest of the film. The scene in question is a real make-or-break moment, a perfect test of whether or not you can surrender to "Wild City" as an eccentric, but essentially formula-driven narrative. When you see it, you will gasp.

Planet Haskell: Well-Typed.Com: Lightweight Checked Exceptions in Haskell

Consider this function from the http-conduit library:

-- | Download the specified URL (..)
-- This function will 'throwIO' an 'HttpException' for (..)
simpleHttp :: MonadIO m => String -> m ByteString

Notice that part of the semantics of this function—that it may throw an HttpException—is encoded in a comment, which the compiler cannot check. This is because Haskell’s notion of exceptions offers no mechanism for advertising to the user the fact that a function might throw an exception.

Michael Snoyman discusses some solutions to this problem, as well as some common anti-patterns, in his blog post Exceptions Best Practices. However, wouldn’t it be much nicer if we could simply express in the type that simpleHttp may throw a HttpException? In this blog post I will propose a very lightweight scheme to do precisely that.

If you want to experiment with this yourself, you can download Checked.hs (tested with ghc 7.2, 7.4, 7.6, 7.8 and 7.10).

Throwing checked exceptions

Let’s introduce a type class for “checked exceptions” (à la Java):

-- | Checked exceptions
class Throws e where
  throwChecked :: e -> IO a

This looks simple enough, but here’s the rub: this will be a type class without any instances.

Once we have introduced Throws we can write something like

simpleHttp :: (MonadIO m, Throws HttpException) => String -> m ByteString
simpleHttp _ = liftIO $ throwChecked HttpException

And, unless we explicitly catch this exception, this annotation will now be propagated to every use site of simpleHttp:

useSimpleHttp :: Throws HttpException => IO ByteString
useSimpleHttp = simpleHttp ""

Type annotations

There’s something a little peculiar about a type class constraint such as Throws HttpException: normally ghc will refuse to add a type class constraint for a known (constant) type. If you were to write

foo = throwChecked $ userError "Uhoh"

ghc will complain bitterly that

No instance for (Throws IOError)
    arising from a use of ‘throwChecked’
In the expression: throwChecked

until you give the type annotation explicitly (you will need to enable the FlexibleContexts language extension):

foo :: Throws IOError => IO a
foo = throwChecked $ userError "Uhoh"

I consider this a feature, not a bug of this approach: you are forced to explicitly declare the checked exceptions you throw.

Catching checked exceptions

In order to catch checked exceptions (and indeed, in order make throwChecked actually do anything) we need to turn that throwChecked into an honest-to-goodness throwIO. We can do this by creating a type class instance at runtime (requires RankNTypes and ScopedTypeVariables, and from ghc 7.10 and up also AllowAmbiguousTypes):

-- | Rethrow checked exceptions as unchecked (regular) exceptions
rethrowUnchecked :: forall e a. (Throws e => IO a) -> (Exception e => IO a)
rethrowUnchecked act = aux act throwIO
    aux :: (Throws e => IO a) -> ((e -> IO a) -> IO a)
    aux = unsafeCoerce . Wrap

-- | Wrap an action that may throw a checked exception
-- This is used internally in 'rethrowUnchecked' to avoid impredicative
-- instantiation of the type of 'unsafeCoerce'.
newtype Wrap e a = Wrap (Throws e => IO a)

This method of creating type class instances at runtime is a well-known trick in the Haskell community, used for instance in Edward Kmett’s reflection package and Richard Eisenberg’s singletons package. Austin Sepp’s blogpost Reflecting values to types and back explains it in detail.

For us here the important thing is that rethrowUnchecked basically replaces uses of throwChecked with a regular throwIO, and hence we can catch the resulting “unchecked” exception as usual:

-- | Catch a checked exception
-- This is the only way to discharge a 'Throws' type class constraint.
catchChecked :: Exception e => (Throws e => IO a) -> (e -> IO a) -> IO a
catchChecked = catch . rethrowUnchecked

-- | 'catchChecked' with the arguments reversed
handleChecked :: Exception e => (e -> IO a) -> (Throws e => IO a) -> IO a
handleChecked act handler = catchChecked handler act

Subclasses of exceptions

Suppose we had

readFile :: Throws IOException => FilePath -> IO String

then we can write a function to get a file either by reading a local file or by downloading it over HTTP:

get :: (Throws IOException, Throws HttpException)
    => String -> IO ByteString
get url = case removePrefix "file:" url of
            Just path -> readFile path
            Nothing   -> simpleHttp url

removePrefix :: [a] -> [a] -> Maybe [a]
removePrefix = ..

Alternatively we can define a bespoke exception hierarchy and combine the two exceptions:

data SomeGetException = forall e. Exception e => SomeGetException e

wrapIO :: (Throws IOException      => IO a)
       -> (Throws SomeGetException => IO a)
wrapIO = handleChecked $ throwChecked . SomeGetException

wrapHttp :: (Throws HttpException    => IO a)
         -> (Throws SomeGetException => IO a)
wrapHttp = handleChecked $ throwChecked . SomeGetException

get :: Throws SomeGetException => String -> IO ByteString
get url = case removePrefix "file:" url of
            Just path -> wrapIO   $ readFile path
            Nothing   -> wrapHttp $ simpleHttp url

This kind of custom exception hierarchy is entirely standard; I just wanted to show it fits nicely into this approach to checked exceptions.


There is one caveat to be aware of. Suppose we write

returnAction = return (simpleHttp "")

Ideally we’d give this a type such as

returnAction :: IO (Throws HttpException => IO ByteString)
returnAction = return (simpleHttp "")

But this requires impredicative types, which is still a no-go zone. Instead the type of returnAction will be

returnAction :: Throws HttpException => IO (IO ByteString)
returnAction = return (simpleHttp "")

which has the Throws annotation on returnAction itself; this means we can make the annotation disappear by adding an exception handler to returnAction even though it’s never called (because returnAction itself never throws any exception).

returnAction' :: IO (IO ByteString)
returnAction' = catchChecked returnAction neverActuallyCalled
    neverActuallyCalled :: HttpException -> IO (IO ByteString)
    neverActuallyCalled = undefined

This is somewhat unfortunate, but it occurs only infrequently and it’s not a huge problem in practice. If you do need to return actions that may throw exceptions, you can use a newtype wrapper such as Wrap that we used internally in rethrowUnchecked (for much the same reason):

returnAction :: IO (Wrap HttpException IO)
returnAction = return (Wrap $ simpleHttp "")

Of course you will probably want to define a datatype that is more meaningful for your specific application; for instance, see see the definition of HttpClient in the Repository.Remote module, which defines something like

data HttpClient = HttpClient {
    httpClientGet :: Throws SomeRecoverableException => URI -> ...


Of course, a type such as

simpleHttp :: (MonadIO m, Throws HttpException) => String -> m ByteString

does not tell you that this function can only throw HttpExceptions; it can still throw all kinds of unchecked exceptions, not least of which asynchronous exceptions. But that’s okay: it can still be incredibly useful to track some exceptions through your code.

So there you have it: checked exceptions in Haskell using

  • one—singleton—type class Throws, with no instances
  • just two functions rethrowUnchecked and catchChecked
  • requiring only a handful of non-controversial language extensions (RankNTypes, ScopedTypeVariables, and FlexibleContexts), and AllowAmbiguousTypes from ghc 7.10 and up

and without introducing a special new kind of monad (such as in the control-monad-exception package) and without complicated type level hacking as in the Checked Exception for Free blogpost.

Right now I’ve implemented this as a small module Checked.hs in the hackage-security library, but if people think this is a worthwhile approach perhaps it would be useful to release this as a separate tiny library.

BOOOOOOOM!: Interactive Music Video: Foals “Mountain At My Gates”


Visionary director Nabil and United Realities utilized GoPro cameras to shoot a spherical video for Foals’ “Mountain At My Gates”. You can view the video below (in Chrome) but to really get the full effect you should open it in the Youtube App on your phone. Stand in one place, and move your phone around as you watch the video.

View the whole post: Interactive Music Video: Foals “Mountain At My Gates” over on BOOOOOOOM!.

BOOOOOOOM!: Animation of the Day: Wonderful 3D Miyazaki Tribute


Vimeo user dono pays tribute to Hayao Miyazaki, seamlessly blending animation from various films and music by Joe Hisaishi with original 3D segues. Watch the video below!

View the whole post: Animation of the Day: Wonderful 3D Miyazaki Tribute over on BOOOOOOOM!.

BOOOOOOOM!: Artist Spotlight: Hannah Stouffer


Some new paintings by artist Hannah Stouffer, from her show currently up at Paradigm Gallery. More images below.

View the whole post: Artist Spotlight: Hannah Stouffer over on BOOOOOOOM!.

i like this art: Maxime Guyon

display-e1438251196225Maxime_Guyon_Malleable_Composition_01Maxime_Guyon_Malleable_Composition_02Maxime_Guyon_Malleable_Composition_03Maxime_Guyon_Malleable_Composition_04Maxime_Guyon_Malleable_Composition_05  sideviewMaxime Guyon

work from Technical Exaptation at ECAL Switzerland

This project deals on the technological evolution at its large sense. Replicating the hyper-commercialization aesthetic codes, this series dissects standardized commodities and high technologies which are here listed as full species.The images are intentionally manipulated, which finally witness the hybridizations that the photographic medium as well as technology undergo. This work acts like a research on the role of a photographer nowadays while we currently experience a significant rise of post-internet art.

These 5 pieces are made of bended and laser cut steel sheet, then wrapped with glossy vinyl print, which is a function originally applied for car body printing.


Penny Arcade: Comic: Grace, Part Six

New Comic: Grace, Part Six

Perlsphere: Make bitwise operators always use numeric context

Most Perl operators force their context on the values. For example, the numeric addition operator, +, forces its values to be numbers. To “add” strings, you use a separate operator, the string concatenation operator, . (which looks odd at the end of a sentence).

The bitwise operators, however, look at the value to determine their context. With a lefthand value that has a numeric component, the bitwise operators do numeric things. With a lefthand value that’s a string, the bit operators become string operators. That’s certainly one of Perl’s warts, which I’ll fix at the end of this article with a new feature from v5.22.

Consider this demonstration where the operator is the same but the type of argument changes:

my $number  = 0x80 ^ 0x20;
my $mixed   = "P"  ^ 0x20;
my $string  = "P" ^ " ";

print <<"HERE";
Number is $number
Mixed  is $mixed
String is $string

The result is different in each case:

Number is 160
Mixed  is 32
String is p

This leads to the joke about the difference between Perl and perl being one bit:

% perl -e 'printf "[%b]\n", ord("perl" ^ "Perl")'

This is a problem if you want a particular context. You have to force either the string or numeric context. If either of the operands has a numeric component (see Create your own dualvars) it’s a numeric operation:

"$var" ^ "$var2"
$var + 0 ^ $var2

Or, you can skip all this messiness with a new experimental feature from v5.22. The bitwise feature makes the bitwise operators always work in numeric context. You have to import this one explicitly because it’s not automatically imported as part of the default new feature set:

use v5.22;
use feature qw(bitwise);
no warnings qw(experimental::bitwise);

my $number = 0x80 ^ 0x20;
my $mixed  = "P"  ^ 0x20;
my $string = "P" ^ " ";

print <<"HERE";
Number is $number
Mixed  is $mixed
String is $string

Now the output for the last case is 0 instead of p:

Number is 160
Mixed  is 32
String is 0

This is probably what you want most of the time. And, if you don't want this, do you really want a bitwise operator? Comic for 2015.07.31

New Cyanide and Happiness Comic

s mazuk: Hello, do you have any zine making tips or tricks for a novice?

hi anon, yes I do! the process of making zines is one of the most empowering and healing things I’ve ever taken on, I’m really glad you’re even thinking about. 

  • tap into your favorite influences + inspiration from others but remember that the most magical part of a zine is that it’s your individual input. your personal touches and ideas are what make the zine special. as many parallels run through our experiences, your individual mind is one of a kind; don’t be shy to highlight that.   
  • there is no official format or template that you have to follow. mini-zines (folded from a single sheet of 8.5″ by 11″), large poster zines, standard size zines (made from folded 8.5″ by 11″ paper), fabric zines, etc. you can stick w/ tested tried formats or you can also just make up your own. honestly, no one can stop you. 
  • not every zine you make needs to see the light of ‘public’ day. it’s ok to make a zine and realize, eh, maybe this is just for me. I have a really big collection of personal mini zines that I never intend to zerox or distribute. 
  • work with things you’ve already got lying around. the best part about making zines is that they can be made with a found pen and found paper — you don’t need to spend any money on the process (unless you decide to make copies/distribute which, in my opinion, is the absolute most boring part of zine making). I nearly always make the templates for my zines from used/found paper and old magazines (for collage material). It’s a great way to give new life to stale stuff that’s maybe considered trash but is really just zine fuel. 
  • silence those crushing judgements from your inner critic. if you listen to every negative thing you tell yourself during the process (the following is from my own inner dialogue, not trying to impose any negativity) “ugh, this looks stupid / that drawing is dumb / I hate this ____ / etc.” then the zine will never get to do its thing. unless you’re already self-supportive + kind to your own output (which is so rad!) then don’t be hard on yourself as you begin to un-learn being your own worst critic. zine making is a great meditation on confronting + healing from your own internalized pains/judgements towards yourself.
  • this is cheesy af but I need to say it: have a really great time making your zine. zine making is a chance to express yourself, idea(s), visions w/ 0 filter or censoring. it’s a chance for you to be in control of how/what you say. yes, you can have fun! 
  • with that last point said, if you decide to publish your zine: you are RESPONSIBLE for your output. yes, you’re free to do/make anything you want, but that is not a license to put out toxic shit. your energy/output has effects on people, believe it or not. I really hope this is not the case, but if you’re creating offensive, hateful, problematic material, by having created that output, you need to be held accountable + responsible for what you’ve put out into the world. please be mindful and respectful of the communities in which you circulate your material. zines have a real potency and ability to affect people’s minds - use that energy for good, not harm. 

Planet Haskell: Yesod Web Framework: S3 Hackage mirror for Travis builds

Yesterday, I noticed a bunch of Travis build failures with the cabal error message "does not exist." As I covered last month, this is typically due to a download failure when trying to install packages. This leaves some ambiguity as to where the download failure originated from: was the client (in this case, Travis) having network issues, or was there a problem on Hackage's end? (Or, of course, any one of dozens of other possible explanations.)

I have no hard data to prove that the failure is from the Hackage side, but anecdotal evidence suggests that it's Hackage. In particular, Gregory Collins reports that the Snap build bot is also having issues. When we had these issues in FP Haskell Center, we resolved it by switching to an S3 mirror, so I've decided to start migrating my Travis jobs over to this mirror as well. This is fairly straightforward. First, add a new script to your repo containing:


set -eux

mkdir -p $HOME/.cabal
cat > $HOME/.cabal/config <<EOF
remote-repo-cache: $HOME/.cabal/packages
jobs: \$ncpus

I called this file, but you can give it whatever name you want. Just make sure to set it as executable. Then, just make sure to run this script from your .travis.yml script, likely in the before_install section, e.g.:

 - export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
 - ./

My first rollout for this is the stack repository. My plan is to keep this blog post up-to-date with the best instructions for doing this, so if you have recommendations on how to improve this setup, please report back to me (or just send a pull request.

Well Typed's TUF implementation is planned to allow cabal to download from mirrors automatically, which will hopefully fix this problem in the future. But this change is a useful stop-gap measure. The only downside I'm aware of is that the mirror can take up to 30 minutes to sync with Hackage, so you may end up with a slightly older package index than if you used Hackage itself.

Disquiet: Disquiet Junto Project 0187: Three Strands


Each Thursday in the Disquiet Junto group on and at, a new compositional challenge is set before the group’s members, who then have just over four days to upload a track in response to the assignment. Membership in the Junto is open: just join and participate.

This assignment was made in the evening, California time, on Thursday, July 30, 2015, with a deadline of 11:59pm wherever you are on Monday, August 3, 2015.

These are the instructions that went out to the group’s email list (at

Disquiet Junto Project 0187: Three Strands
Shift between three renditions of the same melody.

Step 1: Choose a simple melody/song/rhythm of your own creation, or that is in the public domain (or that is available thanks to an appropriate Creative Commons license).

Step 2: Record yourself performing the melody/song/rhythm from Step 1 three times, each time with a different instrument or set of instruments. Each of the three resulting tracks should be the same length, at least a full minute. (A single track can be a concatenation of multiple copies of the same recording of the segment — you don’t have to play it straight through for the full minute.)

Step 3: Make a new recording of the three tracks playing simultaneously. The only thing you can do throughout is shift between the tracks, playing either one of them, two of them, or all three of them at the same time. You can shift every few bars, or at a granular level, or anywhere in between — either with a concerted rhythmic purpose, or at random. The decisions you make about these shifts constitute the core compositional decisions you’ll make for this project.

Step 4: Upload your completed track to the Disquiet Junto group on SoundCloud.

Step 5: Then listen to and comment on tracks uploaded by your fellow Disquiet Junto participants.

Deadline: This assignment was made in the evening, California time, on Thursday, July 30, 2015, with a deadline of 11:59pm wherever you are on Monday, August 3, 2015.

Length: The length of your finished work is up to you, but it should be at least a minute.

Upload: Please when posting your track on SoundCloud, only upload one track for this assignment, and include a description of your process in planning, composing, and recording it. This description is an essential element of the communicative process inherent in the Disquiet Junto. Photos, video, and lists of equipment are always appreciated.

Title/Tag: When adding your track to the Disquiet Junto group on, please include the term “disquiet0187-threestrands” in the title of your track, and as a tag for your track.

Download: It is preferable that your track is set as downloadable, and that it allows for attributed remixing (i.e., a Creative Commons license permitting non-commercial sharing with attribution).

Linking: When posting the track, please be sure to include this information:

More on this 187th Disquiet Junto project (“Shift between three renditions of the same melody”) at:

More on the Disquiet Junto at:

Join the Disquiet Junto at:

Disquiet Junto general discussion takes place at:

Image associated with this project by Brian Hefele, used courtesy of a Creative Commons license:

Planet Lisp: drmeister: Timing data comparing CClasp to C++, SBCL and Python

Work on CClasp (Clasp using Robert Strandh’s Cleavir compiler) is moving forward, here is some timing data that I generated comparing CClasp performance to C++, SBCL and Python.

NOTE: this test is a specific test of an algorithm that uses FIXNUM arithmetic. I have inlined simple FIXNUM arithmetic (+, -, <, =, >, and fixnump) and so these operations are fast. Code that uses other functions will run a lot slower until inlining is implemented more broadly.

I’m calculating the 78th Fibonacci number 10,000,000 times in each case. For these integer arithmetic heavy functions, CClasp performs pretty well (~4x slower than C++). Once type inference is added as well as a few other optimizations CClasp should be generating performant code.

Note: There are compiler settings (loop unrolling) where the C code runs even faster than SBCL, it’s just for this specific test, with the compiler settings below that SBCL comes out a little faster than C++. I don’t want to start an argument about the speed of SBCL vs C++ here, my point is that CClasp has come a long way from being hundreds of times slower than C++ to within a factor of 4.

Here is the C++ code, it converts the numbers back and forth from Common Lisp representations:

Integer_sp core_cxxFibn(Fixnum_sp reps, Fixnum_sp num) {
  long int freps = clasp_to_fixnum(reps);
  long int fnum = clasp_to_fixnum(num);
  long int p1, p2, z;
  for ( long int r = 0; r<freps; ++r ) {
    p1 = 1;
    p2 = 1;
    long int rnum = fnum - 2;
    for ( long int i=0; i<rnum; ++i ) {
      z = p1 + p2;
      p2 = p1;
      p1 = z;
  return Integer_O::create(z);

Here is the Common Lisp code:

(defun fibn (reps num)
  (declare (optimize speed (safety 0) (debug 0)))
  (let ((z 0))
    (declare (type (unsigned-byte 53) reps num z))
    (dotimes (r reps)
      (let* ((p1 1)
             (p2 1))
        (dotimes (i (- num 2))
          (setf z (+ p1 p2)
                p2 p1
                p1 z))))

Here is the Python code:

import time
def fibn(reps,num):
    for r in range(0,reps):
        p1 = 1
        p2 = 1
        rnum = num - 2
        for i in range(0,rnum):
            z = p1 + p2
            p2 = p1
            p1 = z
    return z
start = time.time()
res = fibn(10000000, 78)
end = time.time()
print( "Result = %f\n", res)
print( "elapsed time: %f seconds\n" % (end-start))

More details.

CClasp version is 0.3-test-10

It was compiled using settings:
“clang++” -x c++ -O3 -gdwarf-4 -g -Wgnu-array-member-paren-init -Wno-attributes -Wno-deprecated-register -Wno-unused-variable -ferror-limit=999 -fvisibility=default -isysroot /Applications/ -mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++ -O3 -O3 -gdwarf-4 -g -O3 -Wno-inline -DBUILDING_CLASP -DCLASP_GIT_COMMIT=\”cf99526\” -DCLASP_VERSION=\”0.3-test-10\” -DCLBIND_DYNAMIC_LINK -DDEBUG_CL_SYMBOLS -DDEBUG_FLOW_CONTROL -DEXPAT -DINCLUDED_FROM_CLASP -DINHERITED_FROM_SRC -DNDEBUG -DPROGRAM_CANDO -DREADLINE -DTRACK_ALLOCATIONS -DUSE_BOEHM -DUSE_CLASP_DYNAMIC_CAST -DUSE_STATIC_ANALYZER_GLOBAL_SYMBOLS -D_ADDRESS_MODEL_64 -D_RELEASE_BUILD -D_TARGET_OS_DARWIN -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I”../../../../include” -I”../../../../projects/cando/include” -I”../../../../src” -I”../../include” -I”../../src/cffi” -I”../../src/core” -I”../../src/gctools” -I”../../src/llvmo” -I”../../src/main” -I”../../src/serveEvent” -I”../../src/sockets” -I”/Users/meister/Development/externals-clasp/build/common/include” -I”/Users/meister/Development/externals-clasp/build/release/include” -c -o “../../src/main/bin/boehm/cando/clang-darwin-4.2.1/release/link-static/main.o” “../../src/main/”

The C-code is embedded within Clasp and is thus compiled with the same settings.

The Clang version is 3.6.1

The Python version is 2.7.6. I ran the python code using: python

The SBCL version is: SBCL 1.2.11

These were run on a MacBook Pro (Retina, 15-inch, Early 2013)

Greater Fool - Authored by Garth Turner - The Troubled Future of Real Estate: Lessons

DOG SHOT modified

Some things worth knowing as we head into a weekend federal election call, a slagging Canadian economy and the biggest vacation period of the entire year. So slide on those flip-flops, grease up with SPF 30 and throw a tofu burger on the barbie. Here we go:

THURSDAY SEPTEMBER 17th: That’s the day US interest rates will rise for the first time in a decade. This is a big deal, with global implications – not to mention for your mortgage and our dollar. There’s now little doubt the Fed will pull the trigger that day, after this week’s economic report.

The American economy grew at 2.6% in the second quarter – more than forecast – and growth in the first three months of the year (plagued by snow and strikes) was revised higher. Job creation has stayed impressive while corporate profits are running higher than anticipated and we’re heading into a Presidential election year. Even legendary bond guru Bill Gross has thrown his cards on the table, saying cheap rates are bad for the world – creating asset bubbles, distorting capital flows and turning people into porcine debt-snorflers.

So, up she goes. And down goes the loonie. Then, in 2016, the Bank of Canada eats a giant crow and follows suit. Unless, of course, we’re in the throes of a scary recession. In which case we are will have a helluva lot of real estate news to share.

DINKY DIVIDENDS: Here are three headlines which splashed across the MSM this week as we settle into what’s looking like a long and serious commodities rout…

Cenovus looking to cut jobs, slashing dividend by 40 per cent
Goldcorp slashes dividend 60 per cent as price of gold tumbles
Shell to axe 6,500 jobs, cut spending to cope with lower oil prices

It’s been ages – almost seven years, in fact – since we’ve seen news like that. Trust me, the last thing CEOs want to do is cut dividend payments to stockholders. This makes the shares inherently less attractive, drops the capitalization of the entire company, torpedoes the market price and signals that the company’s entering survival mode and needs cash that normally would be distributed.

This also throws more cold water on the belief many amateur investors have that they should load up on dividend-paying stocks and eschew diversification. Bad idea. See why?

COWTOWN CARNAGE: Well, not exactly, but it may be coming. What does it tell you when a local real estate board tries to get out in front of public opinion, and issues a warning? Yup, crapstorm coming.

That just happened in poor Calgary. The realtors, who seven months ago predicted prices would rise 1.58% this year are now forecasting a slight decline in values and a big drop in sales – 22%. The effects of cheap oil are just starting to be felt, they say, and the city’s economy “continues to be plagued with a level of uncertainty.” You think? Just take a look at the headlines above – the big job cuts may only be starting. About 12,000 positions have been cut – a whack of them highly-paid engineers or execs – and the Conference Board is predicting twice as many will get the axe in the next five months.

“Employment conditions are expected to worsen and put increased downward pressure on wages. When combined with lower levels of migration, it’s expected that these conditions will cause further impacts on the housing sector.” So far this year detached homes sales have dropped by a quarter, luxury-home sales are a disaster and the rental vacancy rate has doubled. Commercial space for lease? Don’t even ask.

Only a year ago Cowtown was a swaggering mass of bidding wars, cowboy testo and realtors leasing Audis. If you can’t see a lesson in here, I give up.

CANADIAN SUBPRIME: Remember how we loved to make fun of Americans with their insane borrowing, their zero down payments, adjustable mortgages with teaser rates, subprime lending market and liar loans? Well, those days are gone.

Now we borrow far more than they, with banks giving 100% financing. There are 1.99% home loans, while subprime lending is the fastest-growing segment of the mortgage market as people finance down payments for million-dollar homes. And, yes, lender fraud. Apparently almost a billion in diddled loans from one company alone, Home Capital.

The largest ‘alternative mortgage lender’ in the land, as the result of an OSC investigation, was forced this week to reveal that 45 brokers were punted from its network for falsifying the incomes of borrowers. Yup, liar loans. In order to secure larger loans, brokers purposefully inflated the earnings of clients. Collectively, these bad seed brokers wrote about 12% of Home Capital’s 2014 loans, representing 5.3% of its outstanding assets.

This raises serious questions about how often this practice goes on among the nation’s tens of thousands of mortgage brokers. Besides, all of these falsely-obtained mortgages were insured by CMHC, and apparently still are. Worse, Home Capital (in its defence) said it did not verify the incomes of applicants, because it doesn’t have to. Apparently CMHC guidelines don’t require such a bothersome detail. “The practice met the standards of mortgage insurance companies, including the federal government’s Canada Mortgage and Housing Corporation,” it explained.

Still feel smug?

This doesn’t end well.

Tudor Girba's blog: .Net Rocks! interview on Moose, humane assessment, Pharo, GT and related things

A couple of weeks ago I had the pleasure of chatting with Carl Franklin and Richard Campbell on a .Net Rocks! interview.

We started from Moose and then we diverged into the issue of too prevalent code reading and how humane assessment addresses this part. We eventually also touched the Pharo live programming environment and the Glamorous Toolkit.

But, the experience was unique. I found both Carl and Richard to be great listeners, and I felt they helped me bring the message out. I could have done a better job, but it was certainly an interesting experience. For example, I truly love how they introduced the interview with a discussion about the return of Cobol. It paved the way nicely and I tried my best to link to it.

All in all, it was great fun. I’d do it again.

new shelton wet/dry: ‘We all have darkness and light within us, and we are in control of neither.’ —Fiona Neill

A mezuzah is a small case affixed to the doorframe of each room in Jewish homes and workplaces which contains a tiny scroll of parchment inscribed with a prayer. It is customary for religious Jews to touch the mezuzah every time they pass through a door and kiss the fingers that touched it. However, kissing [...]

new shelton wet/dry: [Taylor is pretending the coffee he and Bill are drinking is champagne] I propose a toast

There’s been a ton of news recently about how awesome coffee can be for many aspects of your health – heart disease, longevity, depression, Type 2 diabetes, Parkinson’s.  The scientific data has been so strong that the nation’s top nutrition panel recommended earlier this year that people might even want to consider drinking a bit more. Now comes a sobering report. In a [...]

new shelton wet/dry: ‘Where is the knowledge we have lost in information?’ —T.S. Eliot

We meta-analyzed the effects of sexual media, violent media, sexual ads, and violent ads on the advertising outcomes of brand memory, brand attitudes, and buying intentions. The meta-analysis included 53 experiments involving 8,489 participants. Analyses found that brands advertised in violent media content were remembered less often, evaluated less favorably, and less likely to be purchased [...]

The Rhizome Frontpage RSS: Data Ontology: James Bridle on secrecy, surveillance, and the limits of knowledge

A new exhibition by writer/artist/publisher/technologist James Bridle, "The Glomar Response," is on view through September 5, 2015 at NOME, Berlin. Here, Bridle discusses the exhibition with Fiona Shipwright.

James Bridle, Fraunhofer Lines 001 (Committee Study of the Central Intelligence Agency's Detention and Interrogation Program) (2015). Photo by Bresadola+Freese/

The title of the show is "The Glomar Response"—the official term for the response that one can "neither confirm nor deny" a particular fact. What do you find compelling about this term?

What I find so extraordinary about the Glomar Response is its spread. The fact that this thing—which was developed by the CIA at the height of the Cold War to disguise a top-secret operation to retrieve nuclear misses from the bottom of the ocean—is now a standard part of the vernacular of your local council. But it's also interesting because within that response is this kind of deep ambiguity of these knowledge forms; there's the danger of overloading the visible/invisible idea, the notion that "I've made this all transparent and possible for you to understand," because that assumes that it is even possible to do.

That is the underlying basis for these kind of technological forms of knowledge, this kind of data ontology. It's the same principle that surveillance relies on, the idea that "we'll just keep on gathering information, then we'll know for sure," that some absurd level of truth can be reached. At that point the Glomar Response actually almost feels like a kind of honest response to the genuine complexity of the world, that's now undeniable. Or rather it should be undeniable but we keep trying to generate these simplistic stories out of it.

This exhibition is structured around technological investigation, specifically this weird knife-edge between how technology obscures but also reveals—once you have literacy to read it. That balance is something I am constantly fascinated by. The work in in the show is also about limits; whether it's the limits of transparency, the limits of investigation through technological methods, the limits of visualization as means of representing data in a useful way, or the limit of what you can know from data alone, which is kind of the thing that I really want to get into understanding and critiquing.

"Unseen" can just be another word for "overly complex." There's also the question of what form of "unseen" is it? Is it unseen because it's quite literally invisible or is it because it's something that takes on the texture of the rest of the world? Or is it because it's just so deeply embedded into these technologies? Whilst I like the very literal "artness" of throwing paint over the invisible man, making something visible is also just bringing criticality to bear on these things, isolating them and discussing in such a way that means we can actually have a conversation about them.


James Bridle, Seamless Transitions (2015). Animation by Picture Plane. Commissioned by The Photographers’ Gallery, London.

For Seamless Transitions you used freely available archival material to create architectural visualisations of the "unphotographable" spaces of the UK's immigration detention and deportation apparatus, but they arguably tell far more than any static photographs could. Are we past the point where a "no photos" rule is enough to keep something out of sight?

The subject matter of the Seamless Transitions piece is not even at the highest level of concealment. If I wanted to do the same thing and create visualizations for installations on Diego Garcia [a US military base and one of the geographical subjects of the Waterboarded Documents series, which features water-damaged evidence relating to a CIA black site that may have been used for waterboarding], whilst it would certainly not be impossible because there are satellite images, there wouldn't necessarily be things like the actual architectural floor plans available.

James Bridle, Diego Garcia (Waterboarded Documents 001) (2015). Photo by Bresadola+Freese/

But what that makes clear is that the limits to what we can see now are not determined where you can physically get to yourself: it's largely determined by what you're interested in. The thing that's stopping us seeing this stuff is a lack of interest. You can see every point on the earth's surface in Google maps but it still requires someone—either by chance or with a particular interest—to come along and say, "I need this bit" and to make sense of it.

Now you can see everything, what do you want to see? Or conversely, if it's all there, then why haven't we seen this? A lot of my projects are about filling in an image gap where one exists because that usually points to some kind of process of occlusion.

There's one work associated with the show which we don't see displayed: Citizen Ex, a browser extension that maps one's "Algorithmic Citizenship"—how you appear to the internet as a collection of data and the "real" consequences of that. The word "citizenship" often has connotations of democracy and participation, but in your project it has a more ambivalent status. Can you talk more about this?

I am uncomfortable with that aspect of Citizen Ex, for many reasons. I don't want to enact citizenship online. I don't think we should base new forms of identity on the nation state—the project is an articulation of one idea, and whilst it's not the one I necessarily want to see in the world it is a reflection of the way things are being constructed today.

When the question is asked, "why is surveillance is bad?" one of the reasons is because of the limitations it puts on individual expression—and there's no more obvious example of that than how the early net functioned. It allowed one to experiment with one's presentation of self, and that's just being stamped out on the larger platforms where people now operate. Preventing surveillance in the corporate context prevents advertising, targeting and money; that which is necessary for capitalism to function online. And that's the image that we've increasingly built the web in.

Berlin-based writer Fiona Shipwright is an editor of uncube magazine. She can be found on Twitter @edwardiansnow

Quiet Earth: First Wave of Fantastic Fest 2015 Titles!

Fantastic Fest have just announced the first wave of titles for its 11th annual celebration of exciting genre-bending films, including the World Premiere of BONE TOMAHAWK with Kurt Russell and Matthew Fox in attendance, a retrospective of Turkish Genre Cinema, and a special Mondo Gallery event and programming series curated by filmmaker Nicolas Winding Refn to celebrate the release of his new book "Nicolas Winding Refn: The Act of Seeing", which profiles Refn's collection of vintage exploitation-era American movie posters.

"We're very excited about this year's mix of premieres, unique events and a retrospective theme unlike any other featuring audacious and otherworldly Turkish remakes of classic Hollywood films," said Fantastic F [Continued ...]

Colossal: A 17th-Century Stanchi Painting Reveals the Rapid Change in Watermelons through Selective Breeding [Updated]

Giovanni Stanchi (Rome c. 1645-1672). Oil on canvas. 38 5/8 x 52½ in. (98 x 133.5 cm.) / Courtesy Christie’s


Old master work paintings are frequently cited for their depiction of historical events, documentation of culture, or portraiture of significant people, but there’s one lesser known use of some paintings for those with a keen eye: biology. One such instance is this Renaissance still life of various fruits on a table by Giovanni Stanchi painted sometime in the 1600s that shows a nearly unrecognizable watermelon before it was selectively bred for meatier red flesh.

Horticulture professor James Nienhuis at the University of Wisconsin tells Vox that he’s fascinated by old still life paintings that often contain the only documentation of various fruits and vegetables before we transformed them forever into something more desirable for human use. You can read a bit more about the science behind the changes in watermelons over the last 350 years here. (via Kottke)

Update: Greg Cato writes: “The painting depicts a rare outcome of sub-par growing conditions, known as ‘starring.’ It’s perfectly normal, still happens, and is not the result of selective breeding (although it would be cool if it were).” You can see an example here.

Quiet Earth: Don't be Fooled by the Poster, ROOM is Deeply Disturbing

In what has got to be the strangest marketing campaign of all time, the first poster and trailer for ROOM, a new thriller starring Brie Larson as a young woman who’s been held captive for years along with her 5-year-old son Jack has emerged from distributor A24.

With the tagline "Love Knows No Boundaries" and a sunny poster than makes the film seem like an uplifting family drama, I imagine you'll be slightly shocked to watch the trailer, which is deeply unsettling.

Even the synopsis is oddly vague, going so far as to leave out the film's high-concept: "A modern-day story about the boundless love between mother and child."

Room is based on a novel by Emma Donoghue, who also wrote the film's screenplay. It is directed by Lenny Abrahamson who you might know from his [Continued ...]

Quiet Earth: Top 5 Weapons used in NORTHMEN - A VIKING SAGA

Anchor Bay Entertainment has passed along some exclusive images from Northmen: A Viking Saga, showcasing the very best in Viking weaponry. These guys and gals certainly knew how to get into the fray!

In Northmen: A Viking Saga, a band of Vikings cross enemy lines and a panicked race begins. The losers will pay with their lives.

Northmen: a Viking Saga sees release in Theaters and on Digital HD on July 31st. The film will be available on VOD and DVD/BD on August 11th.

1. Swords

The most effective Viking tool for getting the job done.

[Continued ...]

Saturday Morning Breakfast Cereal: Saturday Morning Breakfast Cereal - Cleaning Algorithms

Hovertext: Watch - I can make fun of every religion and get no hatemail, but when I write any amount of code...

New comic!
Today's News:

CreativeApplications.Net: Rhythmic Gymnastics – Denso robotic arm and the sensibility of human movement

RHYTHMICGYMNASTICS003Created by the team at FIG.- Amana Prototyping Lab in Japan, Rhythmic Gymnastics is a practical experiment using a Denso VS-050S2 robotic arm. In this experiment the aim is to represent the sensibility of human movement using harsh robot mechanics.

OCaml Planet: Andrej Bauer: Intermediate truth values

I have not written a blog post in a while, so I decided to write up a short observation about truth values in intuitionistic logic which sometimes seems a bit puzzling.

Let $\Omega$ be the set of truth values (in Coq this would be the setoid whose underlying type is $\mathsf{Prop}$ and equality is equivalence $\leftrightarrow$, while in HoTT it is the h-propostions). Call a truth value $p : \Omega$ intermediate if it is neither true nor false, i.e., $p \neq \bot$ and $p \neq \top$. Such a “third” truth value $p$ is proscribed by excluded middle.

The puzzle is to explain how the following two facts fit together:

  1. “There is no intermediate truth value” is an intuitionistic theorem.
  2. There are models of intuitionistic logic with many truth values.

Mind you, excluded middle says “every truth value is either $\bot$ or $\top$” while we are saying that there is no truth value different from $\bot$ and $\top$:
$$\lnot \exists p : \Omega \,.\, (p \neq \top) \land (p \neq \bot).$$
Coq proves this:

Theorem no_intermediate: ~ exists p : Prop, ~ (p <-> True) /\ ~ (p <-> False).

Note that we replaced $=$ with $\leftrightarrow$ because equality on $\Omega$ is equivalence on $\mathsf{Prop}$ in Coq (this would not be neccessary if we used HoTT where h-propositions enjoy an extensionality principle). You should also try proving the theorem by yourself, it is easy.

A model of intuitionistic mathematics with many truth values is a sheaf topos $\mathsf{Sh}(X)$ over a topological space $X$, so long as $X$ has more than two open sets. The global points of the sheaf of truth values $\Omega$ are the open subsets of $X$, and more generally the elements of $\Omega(U)$ are the open subsets of $U$.

So, if we take an intermediate open set $\emptyset \subset U \subset X$, should it not be an intermediate truth value? Before reading on you should stop and think for yourself.

Really, stop reading.

Let us calculate which open set (truth value) is
$$(U \neq \top) \land (U \neq \bot).$$
Because $U = \top$ is equivalent to $U$ and $U = \bot$ to $\lnot U$ our formula is equivalent to
$$\lnot U \land \lnot\lnot U.$$
Remembering that negation is topological exterior we get
$$\mathsf{Ext}(U) \cap \mathsf{Ext}(\mathsf{Ext}(U))$$
which is empty,
Indeed, $U$ is not a counterexample!

We have here a typical distinction between internal and external language:

  • The mathematicians inside the topos think and speak locally. They ask not “Is this statement true?” but “Where is this statement true?” If you aks them a yes/no question they will answer by giving you an open subset of $X$. They will conclude that $U \neq \top$ holds on the exterior of $U$, and $U \neq \bot$ on the double exterior of $U$, and that nowhere are they true both together.
  • The mathematicians outside the topos (that’s us) understand $(U \neq \top) \land (U \neq \bot)$ differently: it is about comparing the open set $U$ to the open sets $X$ and $\emptyset$ as elements of the topology of $X$. For them “yes” and “no” are valid answers, and no other.

By the way, the mathematicians on the inside also think that “yes” and “no” are valid answers, and there is no other – that is precisely the statement “there is no intermediate truth value” – but they think of it as “holding everywhere on $X$”.

There are of course many situations where the difference between iternal and external language may create confusion. For example, if $X = \mathbb{N}$ is a countable discrete space then the object of natural numbers is the sheaf of all maps into $\mathbb{N}$, of which there are uncountably many. Thus on the outside we “see” that there are uncountably many natural numbers in $\mathsf{Sh}(X)$. Those on the inside would of course disagree. This is an amusing situation, sort of a reverse of Skolem’s paradox.

OCaml Planet: GaGallium: Formally verifying the complexity of OCaml programs with CFML -- interlude

<style type="text/css"> .hll { background-color: #ffffcc } .c { color: #408080; font-style: italic } /* Comment */ .k { color: #008000; font-weight: bold } /* Keyword */ .o { color: #666666 } /* Operator */ .cm { color: #408080; font-style: italic } /* Comment.Multiline */ .cp { color: #BC7A00 } /* Comment.Preproc */ .c1 { color: #408080; font-style: italic } /* Comment.Single */ .cs { color: #408080; font-style: italic } /* Comment.Special */ .gd { color: #A00000 } /* Generic.Deleted */ .ge { font-style: italic } /* Generic.Emph */ .gr { color: #FF0000 } /* Generic.Error */ .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .gi { color: #00A000 } /* Generic.Inserted */ .go { color: #888888 } /* Generic.Output */ .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ .gs { font-weight: bold } /* Generic.Strong */ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .gt { color: #0044DD } /* Generic.Traceback */ .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ .kp { color: #008000 } /* Keyword.Pseudo */ .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ .kt { color: #B00040 } /* Keyword.Type */ .m { color: #666666 } /* Literal.Number */ .s { color: #BA2121 } /* Literal.String */ .na { color: #7D9029 } /* Name.Attribute */ .nb { color: #008000 } /* Name.Builtin */ .nc { color: #0000FF; font-weight: bold } /* Name.Class */ .no { color: #880000 } /* Name.Constant */ .nd { color: #AA22FF } /* Name.Decorator */ .ni { color: #999999; font-weight: bold } /* Name.Entity */ .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ .nf { color: #0000FF } /* Name.Function */ .nl { color: #A0A000 } /* Name.Label */ .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ .nt { color: #008000; font-weight: bold } /* Name.Tag */ .nv { color: #19177C } /* Name.Variable */ .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ .w { color: #bbbbbb } /* Text.Whitespace */ .mb { color: #666666 } /* Literal.Number.Bin */ .mf { color: #666666 } /* Literal.Number.Float */ .mh { color: #666666 } /* Literal.Number.Hex */ .mi { color: #666666 } /* Literal.Number.Integer */ .mo { color: #666666 } /* Literal.Number.Oct */ .sb { color: #BA2121 } /* Literal.String.Backtick */ .sc { color: #BA2121 } /* Literal.String.Char */ .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ .s2 { color: #BA2121 } /* Literal.String.Double */ .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ .sh { color: #BA2121 } /* Literal.String.Heredoc */ .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ .sx { color: #008000 } /* Literal.String.Other */ .sr { color: #BB6688 } /* Literal.String.Regex */ .s1 { color: #BA2121 } /* Literal.String.Single */ .ss { color: #19177C } /* Literal.String.Symbol */ .bp { color: #008000 } /* Name.Builtin.Pseudo */ .vc { color: #19177C } /* Name.Variable.Class */ .vg { color: #19177C } /* Name.Variable.Global */ .vi { color: #19177C } /* Name.Variable.Instance */ .il { color: #666666 } /* Literal.Number.Integer.Long */ </style> <script src="" type="text/javascript"> </script>

This small interlude post is not about Coq nor CFML: I present a data structure from Okasaki's Purely functional data structures, implemented in OCaml.

It comes as a preliminary explanation for an incoming formalization of it in CFML, including an complexity analysis!

The structure we decided to study is Okasaki's "binary random access list". It is a functional data structure, which features usual list operations (cons and uncons for adding and removing an element at the head of the list), but also random access lookup and update. That is, you can add or remove an element at the head of the list, but also modify or query the \(i^{th}\) element of the structure.

These four operations perform in worst-case \(O(log(n))\) steps, where \(n\) is the number of elements stored in the structure.

Let us see step by step how it is implemented in OCaml. The source code for the complete implementation can be found here.

Type definitions, implicit invariants

A binary random access list is a list of binary trees: we first define a tree OCaml type.

  type 'a tree = Leaf of 'a | Node of int * 'a tree * 'a tree

Notice that only the leaves store elements. Nodes contain an integer corresponding to the number of elements stored (in the leaves) in the tree, which makes a size function trivial to implement:

  let size = function
    | Leaf x -> 1
    | Node (w, _, _) -> w

Now, a binary random access list is a list of either a tree, either nothing. We consequently define an "tree option" type, here dubbed "digit".

  type 'a digit = Zero | One of 'a tree

The name "digit" comes of the similarity between a binary random access list and a list of bits, representing an integer - adding an element at the head being similar to incrementing the integer, etc. We'll see more of that later.

Finally, we define the type for the whole structure: the binary random access list.

  type 'a rlist = 'a digit list

A valid binary random access list should satisfy some additional invariants:

  • Trees are complete trees -- a tree of depth \(d\) always has \(2^d\) leaves;

  • Any rlist contains trees of increasing depth starting at some depth \(p\): if the \(i^{th}\) cell (indexing from \(0\)) contains a tree (is of the form One t), then this tree has depth \(p+i\).

  • A complete binary random access list is a rlist with starting depth \(p\) equal to \(0\): its first tree, if present, is only a leaf.

To sum up, a binary random access list is a list, which stores in its \(i^{th}\) cell either nothing, or a complete binary tree of depth \(i\).

As an example, a binary random access list storing the sequence \(1, 2, 3, 4, 5\) can be represented as:

binary random access list

binary random access list

Binary random access lists look like integers in binary

As I mentioned before, a binary random access list is in fact quite similar to an integer represented in binary - i.e. as a list of bits.

Actually, if you erase the trees from the implementation (type 'a digit = Zero | One of 'a tree becomes type digit = Zero | One), you obtain an implementation of integers, represented as a list of bits (least significant bit at the head of the list); the cons operation being incrementing, the uncons one decrementing (lookup and update do not make much sense, though).

How do you increment an integer? You look at the least significant bit; if it's a zero, you turn it into a one; if it's a one, you turn it into zero, and recursively continue to increment, starting with the next bit.

"Consing" to a binary random access list is similar, except that we have to handle a bit more information: the elements of the structure, stored in the trees.

Instead of adding \(1\), we add a tree t (more precisely, a digit One t): if the first element of the list is Zero, we turn it into One t. If it's a One t', we turn it into Zero, and recursively continue, but with a new tree: Node (size t + size t', t, t'). This corresponds to the link operation, which combines two trees of depth \(d\) into one of depth \(d+1\).

  let link t1 t2 =
    Node (size t1 + size t2, t1, t2)

The OCaml implementation follows:

  let rec cons_tree t = function
    | [] -> [One t]
    | Zero :: ts -> One t :: ts
    | One t' :: ts -> Zero :: cons_tree (link t t') ts

  let cons x ts =
    cons_tree (Leaf x) ts

The uncons operations follows the same idea: it's just like decrementing, except that you also have to invert the link operation to obtain trees of smaller depth.

  let rec uncons_tree = function
    | [] -> raise Empty
    | [One t] -> (t, [])
    | One t :: ts -> (t, Zero :: ts)
    | Zero :: ts ->
      match uncons_tree ts with
      | Node (_, t1, t2), ts' -> (t1, One t2 :: ts')
      | _ -> assert false

  let head ts =
    match uncons_tree ts with
    | (Leaf x, _) -> x
    | _ -> assert false

  let tail ts =
    let (_,ts') = uncons_tree ts in ts'

Unconsing a rlist of starting depth \(p\) always returns a tree of depth \(p\) (or fails if the list is empty). In particular, as the binary access list manipulated by the user always starts with depth \(0\), we can assume in the implementation of head that the unconsed tree is a leaf.

Random access

Random access lookup and update are quite easy to implement.

The idea is to walk through the list; faced with a Node (w, l, r) tree, we know how much elements it contains: it is exactly w. Knowing the index \(i\) of the element we want to visit, we can compare it to w to know whether we should explore this tree (if \(i < w\)), or look for the element \(i - w\) in the rest of the list.

  let rec lookup i = function
    | [] -> raise (Invalid_argument "lookup")
    | Zero :: ts -> lookup i ts
    | One t :: ts ->
      if i < size t
      then lookup_tree i t
      else lookup (i - size t) ts

If we have to walk through the tree, we can also do this without performing an exhaustive exploration: by comparing the index to half the size of the tree, we can decide whether we should explore the left or right subtree.

  let rec lookup_tree i = function
    | Leaf x -> if i = 0 then x else raise (Invalid_argument "lookup")
    | Node (w, t1, t2) ->
      if i < w/2
      then lookup_tree i t1
      else lookup_tree (i - w/2) t2

The update function works in a similar fashion.

  let rec update_tree i y = function
    | Leaf x -> if i = 0 then Leaf y else raise (Invalid_argument "update")
    | Node (w, t1, t2) ->
      if i < w/2
      then Node (w, update_tree i y t1, t2)
      else Node (w, t1, update_tree (i - w/2) y t2)

  let rec update i y = function
    | [] -> raise (Invalid_argument "update")
    | Zero :: ts -> Zero :: update i y ts
    | One t :: ts ->
      if i < size t
      then One (update_tree i y t) :: ts
      else One t :: update (i - size t) y ts

Next time

Final post incoming, where I present a formalization of this exact OCaml implementation, using CFML and the time credits-related functions I presented in the first post. Stay tuned! / 2015-08-03T10:29:00