Shared posts

12 Jan 18:59

How to fold a circle into an ellipse

by Tim Carmody

Believe it or not, I used to be a mathematician. And stupidly, I didn’t apply myself to applied math, stuff that uses computers and makes money. I was interested in 1) formal logic 2) the history of mathematics 3) the foundations of geometry, all of which quickly routed me into philosophy, i.e., obscurity.

But it does mean that I remain stupidly interested in things like ruler-and-compass constructions, axioms for foldable geometries, and the difference between Euclidean and non-Euclidean spaces. Folding is especially interesting because it’s tactile, it doesn’t require tools, and it sort of requires you to mentally balance the idea of the paper as representative of the geometric plane AND paper as the tool you use to inscribe that plane… oh, forget it. Let me just show you this cool GIF:

I’m not sure how this fits into foldable geometries exactly since it imagines an infinite procedure, and geometric constructions are typically constrained to be finite. But still. It’s really cool to look at, play with, and think about.

Tags: geometry   origami
14 Jul 04:15

The idyllic ‘cabin in the woods’

by Sarang Sheth


A perfect fit amidst Poland’s green terrain is this house, commissioned for a single family, designed by Kartik Reddy. Paying tribute and respect to the greenery, the house has a number of vertical gardens near the side passage and back entrance. It even primarily makes use of wood, to give it a natural aura, and the front facade is made entirely of glass, almost making the house look a little like an idyllic greenhouse among the trees!

The house’s exterior has a simple yet striking silhouette that echoes homeliness through its symbolic house shape. Plus, who wouldn’t feel at home amidst such stunning greenery?!

Designer: Kartik Reddy




16 Feb 14:11

Maintaining Accessibility in a Responsive World

by Chris Coyier

There a bit of a CSS trick is Scott Jehl's latest article. Perhaps you've used an "accessible hiding" technique? That's where you are deliberately avoiding display: none; because you want the element to be focusable, but not seen visually.

But... that can be awkward for anyone who uses the keyboard to navigate the site and also looks at the screen.

To avoid this, we try to remember that any accessibly-hidden content should be visible when it gains focus. For example, this CSS would place a focused element at the top of the viewport

.accessible-hidden {
  position: absolute;
  top: 0;
  left: -999px;
  height: 1px;
  width: 1px;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
.accessible-hidden:focus {
  position: fixed;
  top: 0;
  left: 0;
  background: #fff;
  padding: 10px;
  /* etc etc... */

Scott credits Joe Watkins for the idea.

Direct Link to ArticlePermalink

Maintaining Accessibility in a Responsive World is a post from CSS-Tricks

06 Dec 23:57

Ben Heck's hour of code in 50 minutes

by element14
Ben shows us how easy it is to use a CodeBug to participate in the global movement Hour of Code this week. Now join Ben in exploring coding concepts using a drag and drop development environment with this kid-friendly project! Visit The Ben Heck Show...
04 Jun 20:47

Airbnb rolls out a pricing recommendation tool for hosts

by Nicole Lee
If you try to book a hotel room in San Diego in September, you can probably get one for around $200-300 a night. If you try to do the same in mid-July during Comic-Con? You'll likely have to cough up close to $1,000 a night, and that's if you can get...
14 Apr 22:39

More Control over Text Decoration

by Chris Coyier

Marie Mosley just finished up a revamping of the text-decoration property (and friends) in the Almanac. You're probably aware of this property. For instance, most default browser styles include underlined links by way of text-decoration: underline; - which you can remove with text-decoration: none;.

But you may not be aware that there is more you can do with this property, as well as various sub-properties offering more fine-grained control.

Text can have multiple decorations


a {
  text-decoration: underline overline;

See the text-decoration entry in the Almanac. More specifically, this is adding multiple values to the text-decoration-line subproperty.

You can change the color of the decoration

The default for the color of the decoration lines is the same as the color of the text. But you can change that:

a {
  text-decoration-color: #f06d06;

Check out the text-decoration-color entry in the Almanac.

Note that Gecko renders the underline behind descenders while WebKit/Blink render on top:

Left is Chrome, right is Firefox.

A common way of handling colored underlines has generally been to use a border instead of text-decoration. Borders can have individually controlled colors, thicknesses, and position a bit better than text-decoration can pull off.

But there are some things borders can't do, like...

You can change the style of the decoration

Can't make a border do this!

a {
  text-decoration-style: wavy;

Check out the text-decoration-style entry in the Almanac.

It's going to get even fancier

There has been some clear desire for better underlined text. For instance, skipping the descenders for better readability, as noted in that post:

That's going to be controlled by text-decoration-skip, although not yet implemented anywhere. In the meantime, setting an underline to a more relaxed, less contrast-y color might help. Here's rgba() in use:

And skipping descenders is just one ability it's likely to have. You'll be able to skip certain inline elements, whitespace, and control the edges.

Note that Safari/iOS seems to skip descenders by default.

If you want to turn this off, -webkit-text-decoration-skip: none; works.


Due to varied levels of browser support, some (or all) of this demo may not work in your browser.

See the Pen text-decoration-style by CSS-Tricks (@css-tricks) on CodePen.

So yeah! Even simple stuff like this (that we sometimes take for granted) changes over time in CSS land.

More Control over Text Decoration is a post from CSS-Tricks

05 Oct 01:18

Extending Composer - easybib/dev

Composer is one of the core tooling we use at EasyBib when we work on the various products for the company. The following deck of slides is from a talk I gave at the Berlin PHP Usergroup meetup in November.

In addition, there were a few questions how dependencies are handle in a project when installed through composer’s global command:

  1. Do you have to require the autoloader from $COMPOSER_HOME in order to use code which is installed through ./composer global require?
  2. How does composer handle different versions of dependencies with global vs. local?

Loading global vendors

This is a tricky question! Composer will not require regular vendors automatically for you.

The global command should be used to install and maintain cli-tools (like phpunit) or composer plugins. And not to install libraries globally.

When plugins are installed globally, they get loaded automatically from the $COMPOSER_HOME. You don’t need to put them into every project’s composer.json file.

Different versions of a dependency

When you install a plugin through global and require another version locally in a project, the locally installed version wins once it’s installed.

23 Sep 22:33

Mobile First With Bootstrap 3

by Carlos Cessa

Ok so a couple of weeks now, on it’s very own two year anniversary Mark Otto and the rest of the guys responsible for the develop and maintenance of Bootstrap announced the official release of the framework’s third version, and it came on steroids, let’s see what we’re getting.

What’s New?

First off, the most important changes you’re going to find in the new Bootstrap release is the support for responsive websites, as a matter of fact the responsive module has been removed. Now, from its core, Bootstrap is responsive, more than that, this new version comes with the approach of “Mobile First”, meaning that almost everything has been redesigned to start from a lower screen size and scale up (more on that in a bit).

Nearly everything has been redesigned and rebuilt to start from your handheld devices and scale up.

In the look and feel you’ll see a lot of changes too, prominently the fact that the whole style has gone flat, and there’s an optional theme for a 2.0-er look. Additionally, the icons have gone from images to a font, which is really handy to use when needing different sizes and colors.

Grid System

Let’s start talking about the Grid System, oh the Grid, as a matter of fact, there are four Grid Systems in this new version of Bootstrap, each works exactly the same, being differentiated by the screen size width at which they operate.

Enabling the Grid

In order for the Grid System to work properly and also to ensure proper rendering and touch zooming, add the viewport meta tag to your document:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Different Width Grids

There are four Grid Systems in this new version of the framework, with the width of the viewport being the parameter that differentiates them. The widths that set the frontiers between one and another are as follows:

  • Extra small devices ~ Phones (
  • Small devices ~ Tablets (>= 768px)
  • Medium devices ~ Desktops (>= 992px)
  • Large devices ~ Desktops (>= 1200px)

And each of the different supported viewports have a particular class to address it, as follows:

  • col-xs- ~ Extra small devices
  • col-sm- ~ Small devices
  • col-md- ~ Medium devices
  • col-lg- ~ Large devices

To make use of the Grid System you’d need a container element, with a class "container", and inside a second container with a class "row". Notice how in both cases the “fluid” suffix has disappeared, this in contrast with Bootstrap 2. And inside the second container you’d place your columns.

<div class="container">
    <div class="row">
        <div class="col-xs-6">col-xs-6</div>
        <div class="col-xs-6">col-xs-6</div>

As I mentioned earlier, this new version of Bootstrap comes with a Mobile First approach, what this means is that the columns with a class suffixed with an "xs" are always going to be floated horizontally, no matter the viewport size. If you were to say, use columns prefixed by an "md" and the viewport happened to be less than 992px wide (even 991px), those columns will stack one below the other with a 100% width, as in the next example.

<div class="container">
    <div class="row">
        <div class="col-md-4">col-md-4</div>
        <div class="col-md-4">col-md-4</div>
        <div class="col-md-4">col-md-4</div>

When this page is viewed at a viewport of 992px or more, it will look like this:


If you would happen to see that document in a viewport of 991px or less, it would look as follows:


You can also combine classes to address your elements at a given viewport size. For instance, if in the following example you’d need the first two columns floated side by side in small devices (sm) and stacked on phones, you could add the col-sm-6 in addition to the col-md-4 class.

<div class="container">
    <div class="row">
        <div class="col-sm-6 col-md-4">col-sm-6 col-md-4</div>
        <div class="col-sm-6 col-md-4">col-sm-6 col-md-4</div>
        <div class="col-sm-6 col-md-4">col-sm-6 col-md-4</div>

In this case, opening the page in a viewport larger than 991px you’d see three equal columns, one next to the other, just like in the last example. However, if you’d see it in a viewport with a width between 768px and 991px, you’d get the following result:


As in the example above, you can combine and nest columns in a lot of different combinations to create very complex layouts. There’s a lot more to the Grid System in Bootstrap, but going into detail about every aspect of it would take a while to cover, so for a deeper look into it I’d strongly suggest that you go ahead and take a look at the documentation.

Bootstrap CSS

Most of the classes for the Base CSS part of Bootstrap have remained the same, however there are some changes that we must keep in mind when using this new version.

The code as a whole, has being re-written and variable names have changed. If you look at the .less files, you’ll find that all the variables in the framework have switched from camelCase to use hyphens for word separation, and also every variable name has been standardized in a “element-state-pseudo state” approach. What this means is that element-specific styles like:

<ul class="unstyled">...</ul>

Now are prefixed with the element that they are applied to, so in this new version of Bootstrap the previous list would become.

<ul class="list-unstyled">...</ul>

The same applies for lists with an “inline” style applied to them. Some other changes in the variables names reflecting in the classes that we’ve known from the earlier days are those related with size, for instance with buttons, in version 2.* you’d have:

<button class="btn btn-mini"></button>
<button class="btn btn-small"></button>
<button class="btn btn-large"></button>

This size suffixes have changed to match the overall naming convention and this is the same as for the Grid System, so the previous buttons declaration for version three becomes:

<button class="btn btn-xs"></button>
<button class="btn btn-sm"></button>
<button class="btn btn-lg"></button>

The same applies for input sizes and visibility declarations as well.

Responsive Tables

The overall syntax and layout for the tables remain the same in this version of the framework, but, loyal to the whole “Mobile First” paradigm, now we have responsive tables in this iteration of Bootstrap. To take advantage of it, simply wrap the whole table in a container with a class of “responsive-table“, what this will do is make the tables scroll horizontally in small devices (

<div class="table-responsive">
    <table class="table">...</div>

And the resulting table:



In the CSS department, it’s in the Forms where you’d see the major differences. For starters, every input in a form in Bootstrap three is now displayed as a “block” element with a 100% width. The “size” attributes you can modify with a class in form controls relate to the padding and font-size of the element and not the width, to control that you’d need to put it in a container of the desired width.

The markup for the forms has also changed, in it’s most basic form, in version 2.* a form would look something like this.

        <label for="input">...</label>
        <input type="text" name="input" placeholder="..." >

The markup for the same form in the new version adds an extra element, and a class to the input itself, and goes as follows.

<form role="form">
        <div class="form-group">
            <label for="input">...</label>
            <input type="text" name="input" class="form-control" placeholder="..." >

Bootstrap has been created with Accessibility in mind, that’s the reason for the “role” attribute addition, note also that the label/input combo is wrapped inside a wrapper with a class of “form-group“, and like everything else, this has to do with the responsive nature of the framework.

The search form is gone in this version, and since all inputs and textareas are 100% width by default, special consideration has to be taken with inline forms, however the markup for these is almost identical to that of the previous form.

<form class="form-inline" role="form">
    <div class="form-group">
        <label class="sr-only" for="email">Email address</label>
        <input type="email" class="form-control" placeholder="Enter email">
    <div class="form-group">
        <label class="sr-only" for="pass">Password</label>
        <input type="password" class="form-control" placeholder="Password">
    <div class="checkbox">
            <input type="checkbox"> Remember me
    <button type="submit" class="btn btn-default">Sign in</button>

Note the addition of the class “form-inline” to the form element, and that of “sr-only” to the label, this last class has to do with the Accessibility part of the framework. The use of a label is optional with inline forms, however it’s highly encouraged and doesn’t hurt anyone. And by the way, the “sr-only” stands for Screen Reader only. So screen readers will find the label and “say it” to the user.

Lastly, to create a horizontal form you simply set the width of the label by setting it’s “col-md-” or “_sm” or whatever and the corresponding “control-label” class, just as with version two., and then wrap the input in a container with its own column width specified.

<form class="form-horizontal">
    <div class="form-group">
        <label class="col-md-2 control-label" for="email">Email address</label>
        <div class="col-md-3">
            <input type="email" class="form-control" placeholder="Enter email">

And the resulting form.


There are some other changes that have been made in regard to forms, like the removal of “input-prepend” and “input-append” classes, in favor of “input-group” and “input-group-addon“. However, there’s a lot more to cover yet, so for details on that, please refer to the documentation.


Another area where you’re going to find major changes is in the framework’s icons. The icon library includes 40 new glyphs, and not only that, they switched from using images to fonts, so now instead of adding the two “glyphicons-*” images to your “img” folder, you’ll have to add the four “glyphicons” fonts to your “fonts” directory, and yes, four of them. This has to do with the browser’s compatibility.

For performance reasons, every icon requires a base class and a icon specific class. So now, to add a user icon you’d use:

<span class="glyphicon glyphicon-user"></span>

The switch from images to fonts, gives control to icon coloring and sizing, and also allows you to replace the default icons with some custom ones you may like. If you happen to wonder where you might find such font icons, Fontello is a great resource.

JavaScript Components

Although redesigned and recreated, the JavaScript Components in Bootstrap 3.0 keep the same names and usage. With a couple of slightly and not that gentle differences.


Perhaps one of the most used plugins in Bootstrap is Modals. You’ll find it is quite similar, with the differences being that the containers “modal-header”, “modal-body” and “modal-footer” are not wrapped inside a “modal-content” inside a “modal-dialog” container. So what used to be:

<div class="modal hide fade">
    <div class="modal-header"></div>
    <div class="modal-content"></div>
    <div class="modal-footer"></div>

Changes to:

<div class="modal fade">
    <div class="modal-content">
        <div class="modal-dialog">
            <div class="modal-header"></div>
            <div class="modal-content"></div>
            <div class="modal-footer"></div>

Yes, it’s a little more markup, but it improves the responsiveness of the component and also allows it to scroll the whole viewport instead of having a “max-height” parameter.

To trigger them via JavaScript, you’d use the same method as before.

$( '#my-modal' ).modal('show');

The rest of the plugins remain mostly the same. On a special note, the accordion is gone in favor of collapsible panels, they work pretty much the same and have a very similar syntax. With some classes changing a bit, they still require the transitions plugin and don’t require any extra containers.

Also, the Typeahead plugin has disappeared from Bootstrap in favor of Twitter’s Typeahead plugin.


JavaScript events are now namespaced, but what does mean to you? Well, in Bootstrap two, to listen for the moment when some alert in your site was “close“, you’d add:

$( '#my-alert' ).bind( 'close', function() {});

Now in this third version, the event name has changed, it is namespaced to the framework, so the previous snippet would be:

$( '#my-alert' ).bind( '', function() {});

Go ahead and take a look at the rest of the JavaScript Components Bootstrap has to offer (which, are still dependent on jQuery).

New components

There are a couple new components in the CSS part of the framework, list groups and panels.

List Groups

List groups, from the official documentation.

… are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.

To create a list group simply create an unordered list with a “list-group” class, and add the “list-group-item” to every list item.

<ul class="list-group">
    <li class="list-group-item">Lorem ipsum...</li>
    <li class="list-group-item">Dolor sit...</li>

You can add the “active” class to any item in the list to highlight it, also if you happen to place a badge inside it, it will be centered vertically and align it to the right, inside the item. Go ahead and try it.


Panels are a way to box in some content in your site or application, highlight it and give it a sense of unity. The panel markup is fairly simple, and its contents can be combined with different elements to achieve a unique look and feel.

Panels can have headers and footers and get a special meaning with the well known “sucess“, “error“, “warning“, etc. classes. For instance.

<div class="panel panel-success">
    <div class="panel-heading">Panel Heading</div>
    <div class="panel-body"><p>Some content here</p></div>
    <ul class="list-group">
        <li class="list-group-item">Lorem ipsum...</li>
        <li class="list-group-item">Dolor sit...</li>

As you can see, panels work well with list groups, and also with non-bordered tables.


Also new in this version is the Customizer in which, not only the look has changed, is far better organized and gives you control on things like the viewport width at which a certain Grid System takes control.

As always, you can set all your fonts styles and colors. It’s a huge topic on its own so I’d encourage you to go on your own and mess with it.


Browser Support

Long has been the suffering brought to all of us by Internet Explorer, it’s version six was a total nightmare and its predecessors still have a lot of catching up to do. In version 2.* Bootstrap’s team still supported the version seven of Microsoft’s browser. In this new iteration of the framework, support for IE seven is gone, as well as for Mozilla Firefox 3.6 and below.

Specifically, Bootstrap supports the latest version of all the major browsers (Safari, Opera, Chrome, Firefox and IE), in both Windows and Mac when there are both.

For IE, it supports version eight and forward, and although there are some properties that the browser doesn’t render, such as “border-radius“, the framework is fully functional only with some minor look and feel differences. Also IE eight requires respond.js for media query support.

To get a detailed list of workarounds and gotchas for the different browsers (cough Internet Explorer cough) look at the official docs.


Since its beginning, Bootstrap has been a great tool for rapid prototyping and creation of great sites and web applications and this third version is no different. If you need just one reason to use it, I would definitely go for the Grid System, with the growth of mobile browsing and the always increasing viewport sizes out there, responsiveness is a must now, more than ever. And in this latest version, that’s the area where Bootstrap shines the most.

03 Aug 05:26

Mesmerizing Marble

by Troy Turner

The ONDA marble bench is born from the desire to minimize material waste by using modular sections that aren’t instantly recognizable as similar. Cut from the same block, each “wave” is just alike with the same dimensions. Reversing the pattern with every other one being turned the opposite direction creates a visual illusion of woven complexity when it’s rather simple!

Designers: Paolo Ulian & Moreno Ratti

Yanko Design
Timeless Designs - Explore wonderful concepts from around the world!
Shop CKIE - We are more than just concepts. See what's hot at the CKIE store by Yanko Design!
(Mesmerizing Marble was originally posted on Yanko Design)

Related posts:

  1. Mesmerizing Circles
  2. Mesmerizing Table
  3. Mesmerizing Flower Lamp

18 Jul 16:27

Injectable 'smart sponge' controls diabetes, presents new targeted drug delivery method

by Mariella Moon

DNP Targeted drug delivery via sponge

Diabetics might appreciate high-tech glucose sensors when they're available, but the option for other advanced treatments is certainly intriguing. Take, for example, this new method developed by North Carolina State University researchers that uses injectable sponge to control blood sugar levels. No, it's not the same sponge you use to clean at home -- the material is made out of a substance taken from crab and shrimp shells called chitosan. This spongy material forms a matrix that's approximately 250 micrometers in diameter, where a rise in blood sugar causes a reaction in the pores that leads to the drug's release.

Fighting diabetes is but one of the things this miraculous sponge can be used for; developed further, it could even "intelligently" release anticancer drugs whenever the chitosan reacts to tumors or cancer cells in close proximity. Seems like medical technology is getting smarter with each passing day.

Filed under: Misc, Alt


Source: North Carolina State University

09 Jul 17:52

Loader Facelift!

by Troy Turner

While wheel-dozers and loaders most often function on flat ground, there are times when more rugged terrain must be tackled to get the job done. To ease working on uneven land, the Arm Loader features a driver’s cabin positioned on a moving arm that keeps the operator elevated and balanced even when the machine is not. This provides workers a safer, less tiresome position with a better view of obstructions that would otherwise not be visible depending on the machine’s angle. Check out the vid for the 360!

Designer: Hoyoung Lee

Yanko Design
Timeless Designs - Explore wonderful concepts from around the world!
Shop CKIE - We are more than just concepts. See what's hot at the CKIE store by Yanko Design!
(Loader Facelift! was originally posted on Yanko Design)

Related posts:

  1. Grandfather Gets a Facelift
  2. Forklift Facelift
  3. Central Train Station to get a Space Age Facelift

08 Jul 12:08

Garmin's $130 smartphone HUD limits distractions with line-of-sight directions

by Zach Honig

Garmin's $130 smartphone HUD limits distractions with lineofsight directions

We've become so dependent on GPS that a three-minute drive often means frequent glances at an in-car navigation companion. But taking your eyes off the road can be very dangerous, even if it's only for a moment. If you're fortunate enough to have one, a head-up display will let you get to your destination efficiently and safely, and Garmin's got a new aftermarket solution to keep you cruising on the cheap. The company's new HUD projects bright directions onto a transparent film mounted on your windshield, serving up guidance within your regular line of sight. The simple interface displays your current speed and the speed limit, turn arrows, the distance until your next turn and an ETA. The Garmin HUD is compatible with Bluetooth-equipped smartphones running Garmin StreetPilot and Navigon apps. It's expected in stores this summer with a MSRP of $129.99.

Filed under: Displays, GPS


07 Jul 17:29

Square Stand credit card terminal to be sold at Apple Stores

by Mel Martin

Square is now in a partnership with Apple to bring its new Square Stands to Apple retail stores.

The Square Stand will convert an iPad into a full point-of-sale system that pairs with cash drawers, receipt printers, barcode scanners and credit card readers.

The US$299 device begins shipping this week and will be available at the same time at Apple retail stores, Best Buy and other select retailers.

The Square Stand only works with 2nd and 3rd generation iPads because of the 30-pin dock connector. A Lightning-connector model will be available later this year.

[via Electronista]

Square Stand credit card terminal to be sold at Apple Stores originally appeared on TUAW - The Unofficial Apple Weblog on Sun, 07 Jul 2013 10:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments
06 Jul 14:55

Anna Filina: How to Motivate Your Developers

Anna Filina has a quick new post to her site today with some helpful tips on how to motivate your developers (and coworkers) to make for the best end result.

When developers are not motivated, progress is slow and quality is low. This ultimately affects company revenues and can lead to reduced opportunities for all employees. Motivation leads in the opposite direction: wealth and happiness. The first thing to understand about motivation is that it's internal. We can't force someone to become motivated, but we can still have a strong influence. Here are my top three picks to increase motivation from my presentation at IPC 2013 in Berlin.

Her top three are:

  • Setting goals for the group and a purpose for making it good
  • Focus on the "small wins" sometimes to keep motivation high
  • Let developers use their full range of talents, don't force them into one niche
04 Jul 19:25

Zen-Inducing Stool

by Troy Turner

The Opus stool finds inspiration in traditional Chinese medicine where the balance between mind and body is key in keeping physically and mentally agile. The ball-based structure encourages the user to take control of their balance by placing them in a new position between traditional seat and upright standing. In this posture the center mass of the individual is located under the spine, positioning them in a stance where mind/body harmony will keep them comfortable.

Designer: Dor Ohrenstein

Yanko Design
Timeless Designs - Explore wonderful concepts from around the world!
Shop CKIE - We are more than just concepts. See what's hot at the CKIE store by Yanko Design!
(Zen-Inducing Stool was originally posted on Yanko Design)

Related posts:

  1. Vertigo Inducing Kazimir Supermatic
  2. Emergency Stool
  3. Stiletto Stool

04 Jul 13:48

Scientists grow human liver from stem cells, hope to relieve transplant woes (video)

by Nicole Lee

Stem cells used to create human liver tissue

Stem cell research has resulted in several important breakthroughs in medicine, such as rebuilding the larynx and regenerating spinal cord connectors. Now the liver, one of the most highly sought after organs on the donor transplant list, could get some serious stem cell assistance as well. A team of scientists led by Takanori Takebe of Yokohama City University has successfully created a miniature version of the human liver with the help of induced pluripotent stem cells (iPSC), which are derived from adult somatic cells. They developed the iPSC into generalized liver cells called hepatocytes, at which point the researchers mixed in endothelial cells and mesenchymal stem cells, left the petri dishes alone for a couple days, and voila -- an extremely tiny version of a human liver, said to be the first-ever functional human organ grown from stem cells, was born.

The liver "buds," as they're known, measure five millimeters long and are the sort you would find in human embryos shortly after fertilization. When implanted in mice, the baby livers managed to perform all the functions of their adult equivalents. The researchers' next step would be to generate liver buds that are a touch closer to normal liver tissue -- like the addition of bile ducts -- and to see if they can mass produce them by the tens of thousands. Don't go wasting your liver just yet though, as it'll likely be years before the likes of you and me will be able to have a lab-grown liver in our bodies. In the meantime, check out the time-lapse video after the break to see a young liver bud take shape in a petri dish.

Filed under: Science, Alt


Via: Smithsonian

Source: Nature

04 Jul 13:47

Holy Smoke!

by Radhika Seth

C-Thru is a helmet that is designed to help firefighter walk through dense smoke during smoke diving search and rescue missions. Time constrains of six minutes per mission, makes it imperative that the gear is optimal. C-thru gives them the edge thanks to the wire-frame vision of the interior geometry, surrounding the smoke diver. Using technological enhancements, the helmet provides a visual map of the interiors so that it becomes easy for the firefighter to locate the victims.

This is how it works:

  • C-Thru’s vision system integrates many technologies to aid firefighters, such as a head-mounted projection display, optical thermal camera, cloud computing, selective active noise cancellation and target acquisition.
  • The optical thermal camera captures the imaging of the surrounding area and sends the data to the smoke diver leader’s handheld device.
  • The data is calculated there and sent back to the helmet.
  • Newly generated 3D wire-frame data is projected by the head-mounted projectors through the retro-reflective front visor of the helmet.
  • This wire-frame outline of their surroundings helps firefighters find a path through the building and locate victims.

Designer: Omer Haciomeroglu

Yanko Design
Timeless Designs - Explore wonderful concepts from around the world!
Shop CKIE - We are more than just concepts. See what's hot at the CKIE store by Yanko Design!
(Holy Smoke! was originally posted on Yanko Design)

Related posts:

  1. Holy Driver
  2. UPDATE: Holy Cup of Doubleness
  3. A Holy Lamp for Lovers of Illusion

04 Jul 13:46

Swapping Out Text, Five Different Ways

by Chris Coyier

It's a common need in web apps: you click something and the text of the thing you just clicked changes. Perhaps something simple like a "Show" button that swaps to "Hide", or "Expand Description" to "Collapse Description." This is a fairly simple thing to do, but there are various considerations to make. Let's cover a bunch of ways.

jQuery Way (Less Markup / More JavaScript)

You need to store the "swap" text somewhere. I'd say in most cases it is a design/view concern so storing it in the markup is a good idea. We'll use the example of a button who's text swaps between "Hide" and "Show". A data-* attribute is a perfectly good place to store the swap text. So that becomes:

<button data-text-swap="Show">Hide</button>

It's easy to swap out the text, like:

var button = $("button");

But, if we did that we'd lose the orignal text forever. We need to store the original text first. Another data-* attribute will do.

var button = $("button");"text-original", button.text());

To do that on a click event, you'd do:

var button = $("button");
button.on("click", function() {"text-original", button.text());

But that only goes one direction. To complete the "swap", we'll need to compare the current text value of the button to see if it matches the swap text or not. If it does, change it back to the original. If not, to the swap text. This is what it looks like all done:

$("button").on("click", function() {
  var el = $(this);
  if (el.text() =="text-swap")) {
  } else {"text-original", el.text());

jQuery Way (More Markup / Less JavaScript)

If we're willing to set that data-text-original value in the original markup, we can simplify the JavaScript a bit. We can use a single ternary operator to check if the swap matches the orignal and perform the right action based on the truthiness.

$("button").on("click", function() {
  var el = $(this);
  el.text() =="text-swap") 
    ? el.text("text-original")) 
    : el.text("text-swap"));

Vanilla JavaScript Way

I'm guilty of using too much jQuery around here for things that can be done without it. This is what the first "less markup" version would look like in "raw" JavaScript:

var button = document.querySelectorAll("button")[0];
button.addEventListener('click', function() {
  if (button.getAttribute("data-text-swap") == button.innerHTML) {
    button.innerHTML = button.getAttribute("data-text-original");
  } else {
    button.setAttribute("data-text-original", button.innerHTML);
    button.innerHTML = button.getAttribute("data-text-swap");
}, false);

CSS Way (with jQuery changing class names)

Since this is a view concern and could be considered a "state," a popular idea is to use JavaScript only to change classes which represent states and let CSS define what the visual change actually is.

We could use the class "on" to represent the swap state. Then that class would apply a pseudo element covering the old word and replacing it with the swap word. I don't think actual button elements with default browser styling take well to pseudo element so let's use an anchor here.

a {
  position: relative;
a.on:after {
  content: "Hide";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;

This is a bit funky, to be fair. I think this is almost worse that putting the swap word in the JavaScript. CSS isn't really meant for this kind of thing and likely has some accessibility concerns.

This also happens to work because the word "Hide" is smaller than "Show" a little bit. If the swap word was bigger, the original would stick out underneath the white cover. You might be able to get around that by inline-blocking the original, hiding the overflow, and kicking the original out of the box with text-indent. But the fact that the replacement word is absolutely positioned removes it from the flow, which could be an issue, not to mention real world design isn't always a simple as flat-color-on-flat-color.

CSS-Only Way

But hey as long as we're getting funky, we could use The Checkbox Hack here to make the text swap entirely CSS. The replacement happens the exact same way, it just happens when an invisible checkbox right before the word is either :checked or not. This means the word needs to be in a label as well, which is able to toggle that checkbox's state through the for attribute.

<input id="example-checkbox" type="checkbox">
<label for="example" id="example">Show</label>
#example {
  position: relative;
#example-checkbox {
  display: none;
#example-checkbox:checked + #example:after {
  content: "Hide";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;

Demo of All Five Ways

Check out this Pen!


How have you done this kind of thing in the past? We didn't cover just putting the swap word right in the JavaScript... how do you feel about that?

Swapping Out Text, Five Different Ways is a post from CSS-Tricks

04 Jul 13:45


It's commonly believed that Lorentz contraction makes objects appear flatter along the direction of travel. However, this ignores light travel times. In fact, a fast-moving butt would appear rotated toward the observer but not substantially distorted. Shakira was right.
03 Jul 04:54

Understanding Streams in PHP

by Vito Tardia

Streams are resources provided by PHP that we often use transparently, but which can also be very powerful tools. By learning how to harness their power, we can take our applications to a higher level.

The PHP manual has a great description of streams:

Streams were introduced with PHP 4.3.0 as a way of generalizing file, network, data compression, and other operations which share a common set of functions and uses. In its simplest definition, a stream is a resource object which exhibits streamable behavior. That is, it can be read from or written to in a linear fashion, and may be able to fseek() to an arbitrary locations within the stream.

Every stream has a implementation wrapper which has the additional code necessary to handle the specific protocol or encoding. PHP provides some built-in wrappers and we can easily create and register custom ones. We can even modify or enhance the behavior of wrappers using contexts and filters.

Stream Basics

A stream is referenced as <scheme>://<target>. <scheme> is the name of the wrapper, and <target> will vary depending on the wrapper’s syntax.

The default wrapper is file:// which means we use a stream every time we access the filesystem. We can either write readfile('/path/to/somefile.txt') for example or readfile('file:///path/to/somefile.txt') and obtain the same result. If we instead use readfile('') then we’re telling PHP to use the HTTP stream wrapper.

As I said before, PHP provides some built-in wrappers, protocols, and filters. To know which wrappers are installed on our machine we can use:


My installation outputs the following:

    [0] => tcp
    [1] => udp
    [2] => unix
    [3] => udg
    [4] => ssl
    [5] => sslv3
    [6] => sslv2
    [7] => tls
    [0] => https
    [1] => ftps
    [2] => compress.zlib
    [3] => compress.bzip2
    [4] => php
    [5] => file
    [6] => glob
    [7] => data
    [8] => http
    [9] => ftp
    [10] => zip
    [11] => phar
    [0] => zlib.*
    [1] => bzip2.*
    [2] => convert.iconv.*
    [3] => string.rot13
    [4] => string.toupper
    [5] => string.tolower
    [6] => string.strip_tags
    [7] => convert.*
    [8] => consumed
    [9] => dechunk
    [10] => mcrypt.*
    [11] => mdecrypt.*

A nice set, don’t you think?

In addition we can write or use third-party streams for Amazon S3, MS Excel, Google Storage, Dropbox and even Twitter.

The php:// Wrapper

PHP has its own wrapper to access the language’s I/O streams. There are the basic php://stdin, php://stdout, and php://stderr wrappers that map the default I/O resources, and we have php://input that is a read-only stream with the raw body of a POST request. This is handy when we’re dealing with remote services that put data payloads inside the body of a POST request.

Let’s do a quick test using cURL:

curl -d "Hello World" -d "foo=bar&name=John" http://localhost/dev/streams/php_input.php

The result of a print_r($_POST) in the responding PHP script would be:

    [foo] => bar
    [name] => John

Notice that the first data pack isn’t accessible from the $_POST array. But if we use readfile('php://input') instead we get:

Hello World&foo=bar&name=John

PHP 5.1 introduced the php://memory and php://temp stream wrappers which are used to read and write temporary data. As the names imply, the data is stored respectively in memory or in a temporary file managed by the underlying system.

There’s also php://filter, a meta-wrapper designed to apply filters when opening a stream with function like readfile() or file_get_contents()/stream_get_contents().

// Write encoded data
file_put_contents("php://filter/write=string.rot13/resource=file:///path/to/somefile.txt","Hello World");

// Read data and encode/decode

The first example uses a filter to encode data written to disk while the second applies two cascading filters reading from a remote URL. The outcome can be from very basic to very powerful in our applications.

Stream Contexts

A context is a stream-specific set of parameters or options which can modify and enhance the behavior of our wrappers. A common use context is modifying the HTTP wrapper. This lets us avoid the use of cURL for simple network operations.

$opts = array(
    'header'=> "Auth: SecretAuthToken\r\n" .
        "Content-type: application/x-www-form-urlencoded\r\n" .
              "Content-length: " . strlen("Hello World"),
    'content' => 'Hello World'
$default = stream_context_get_default($opts);

First we define our options array, an array of arrays with the format $array['wrapper']['option_name'] (the available context options vary depending on the specific wrapper). Then we call stream_context_get_default() which returns the default context and accepts an optional array of options to apply. The readfile() statement uses these settings to fetch the content.

In the example, the content is sent inside the body of the request so the remote script will use php://input to read it. We can access the headers using apache_request_headers() and obtain:

    [Host] => localhost
    [Auth] => SecretAuthToken
    [Content-type] => application/x-www-form-urlencoded
    [Content-length] => 11

We’ve modified the default context options, but we can create alternative contexts to be used separately as well.

$alternative = stream_context_create($other_opts);
readfile('http://localhost/dev/streams/php_input.php', false, $alternative);


How can we harness the power of streams in the real world? And where can we go from here? As we’ve seen, streams share some or all of the filesystem related functions, so the first use that comes to my mind is a series of virtual filesystem wrappers to use with PaaS providers like Heroku or AppFog that don’t have a real filesystem. With little or no effort we can port our apps from standard hosting services to these cloud services and enjoy the benefits. Also – and I’ll show in a follow-up article – we can build custom wrappers and filters for our applications that implementing custom file formats and encoding.

03 Jul 04:53

The PHP 5.5: New CLASS Constant

The have posted another article in their series looking at the new features that come with the latest release of PHP (5.5). In this new post they cover the "CLASS" constant.

Last week, the first stable version of PHP 5.5 was released. It introduced a class-level constant, aptly named CLASS, that is automatically available on all classes and holds the fully-qualified name of that class. [...] So why would you need such a constant? [...] When you need the fully qualified name of a namespaced class that is referenced by a namespace alias ... then it gets interesting.

He illustrates with an example of a unit test using stubs and mocks. The normal method requires the definition of the class namespace in the "getMock" call. With the CLASS constant, PHP can extract that information from the namespace referenced in the "use" and drop it in as a replacement.

03 Jul 04:53

Running Monte Carlo Simulations in PHP

by J Armando Jeronymo

One of the exciting things in the 1980′s was programming simulations to solve complex analytical problems, and one of the most useful techniques employed was running Monte Carlo simulations. The approach repeatedly runs a simulation many times over to calculate the most likely outcome.

Although PHP isn’t known as a scientific or research programming language, Monte Carlo simulations can easily be written in a PHP web app. In this article, I’ll show you how.

A Real-World Problem

The day before yesterday I had a meeting at 9:00 AM about 100 miles away from my home. At 6:30 I was awake and dressed, and while having breakfast I began to work out the next couple of hours on a notepad. I obviously wanted to arrive at the meeting safely and on time, so I started sketching the drive split in eight stages: urban departure, country road, state road northbound, state road eastbound, state highway eastbound, urban crossing, state highway southbound, and urban arrival. The sketch more or less looked like this:


My wife had filled the gas tank the evening before and ideally I could drive straight out to the country road. The tires seemed alright when I looked at them, but doubt whether or not to make a 10 minute detour to properly check their pressure hounded me. If I stopped and checked the tires, I’d be certain of their pressure. Otherwise, I’d have to travel with the uncertainty. Poor tire pressure could have an effect on my driving stability and speed.

I could leave as early as 6:40 but then my wife would have to take our daughter to school instead of going straight to work. If I waited another 10 minutes, I could be at the school as their gates opened for the morning and spare my wife the trouble. The school is on my way out of town so there’d be no significant added travel time.
I went back to my drawing and added the following:


Sipping my second cup of coffee, I stood by the window. A clear dusk sky and brisk morning breeze agreed with the perfect day forecast on my smartphone which made me believe the drive would be a fast one. To finish my planning, I drew from past experience and wrote down the estimated drive times:


The expected time en route was 115 minutes (1 hour 55 minutes), which I could cover non-stop. My ETA was 8:35 if I left straight for the road and 8:55 if I decided take my daughter to school and check the tires.

But no plan survives its first encounter with the enemy! For some mysterious reason, many other parents decided to drop their children off at school earlier than usual, and I had lost more than 5 minutes on what was planned to be a quick detour. Knowing that my baseline was already compromised, I decided to skip the tire check and drive straight to the country road.

I reached the road actually five minutes sooner than the original worst case estimate and the drive went well until, somewhere between milestones B and C, I ran into dense fog which reduced my visibility. This reduced my average speed and made it harder to overtake the slow but long trucks.

The urban traffic in the town I had to cross was much lighter than usual and it didn’t take me more than 10 minutes to go across. And a few miles onto state highway southbound the fog lifted so I was able to drive at the full legal speed. But when I approached my destination, I realized that some road work that was in progress had blocked the exit I planned to take. This added another 10 minutes to my travel time and needless to say I arrived late.

Modeling the Trip in PHP

I believe most PHP coding is dedicated to profit and non-profit business websites. But PHP can be a fine tool for scientific research and might as well be easier to teach non-professional programmers, like engineers and scientists, than other languages like my beloved Python.

Let’s write the basic code that will help me understand how much earlier or later I could have arrived at the meeting if one or more stages of my plan varied substantially from their baseline estimates. We can begin to model the trip as follows:

class MyTrip 
    protected $departureTime; 
    protected $meetingTime; 
    protected $travelTimes; 

    public function __construct() { 

        // travel times in minutes between milestones 
            'AB' => 17, 
            'BC' => 17, 
            'CD' => 36, 
            'DE' => 9, 
            'EF' => 15, 
            'FG' => 15, 
            'GH' => 6 

    // for convenience convert time string to minutes past
    // midnight 
    protected static function convertToMinutes($timeStr) { 
        return substr($timeStr, 0, 2) * 60 +
            substr($timeStr, 2, 2); 

    public function setDepartureTime($timeStr) { 
        $this->departureTime = self::convertToMinutes($timeStr); 

    public function setMeetingTime($timeStr) { 
        $this->meetingTime = self::convertToMinutes($timeStr); 

    public function setTravelTimes(array $travelTimes) { 
        $this->travelTimes = $travelTimes; 

    public checkPlan($stopAtSchool = true, $checkTires = true) {
        // ...

Plans must be feasible, and the suitable criteria to judge this one is whether the sum of all times plus the earliest departure time is less than or equal to the time of the meeting. That is what the checkPlan() method determines:

public checkPlan($stopAtSchool = true, $checkTires = true) {
    // calculate the sum of travel times between milestones
    $travelTime = array_sum($this->travelTimes);

    // add delay if dropping kid off at school
    $schoolDelay = ($stopAtSchool) ? 10 : 0;

    // add delay if checking tire pressure
    $tiresDelay = ($checkTires) ? 10 : 0;

    // find the total schedule baseline
    $meetingArriveTime = $this->departureTime + $travelTime +
        $schoolDelay + $tiresDelay;

    // does the traveller make the meeting on time?
    $arriveOnTime = $meetingArriveTime <= $this->meetingTime;

    return array($meetingArriveTime, $this->meetingTime,

Now all we have to do is create an instance of the class and ask it to check my plan:

$trip = new MyTrip();

Given the default values, the above will output that my original plan was okay:

    [0] => 535
    [1] => 540
    [2] => 1

I should be there 535 minutes after midnight, and the meeting takes place 540 minutes after midnight. According to the baseline, I’ll arrive at the meeting at 8:45 AM, just 5 minutes before the scheduled time!

But what about the inevitable variations? How can we account for the uncertain elements?

Monte Carlo and Adding Randomness

In a very simplistic way we can define a safety margin to every event and say it could happen 10% earlier and 25% later of the scheduled time. Such margins can be randomly added to the departure delays and every travel time between milestones by multiplying each factor by rand(90,125)/100.

We can also assign a 50% probability for both decisions to drop my daughter off at school and to check the tires. Again the rand() function can helps us:

$this->checkTires = rand(1, 100) > 50;

Putting it all together, we can define a method checkPlanRisk() to computer whether or not I can arrive on time given the many uncertainties that stand in my way:

public function checkPlanRisk() {
    // adjust and sum travel times between milestones
    $travelTime = 0;
    foreach ($this->travelTimes as $t) {
        $travelTime += $t * rand(90, 125) / 100;

    // decide whether to drop kid off at school and randomly set
    // the delay time
    $schoolDelay = 0;
    if (rand(1, 100) > 50) {
        $schoolDelay = 10 * rand(90, 125) / 100;
    // ditto for checking tires
    $tiresDelay = 0;
    if (rand(1, 100) > 50) {
        $tiresDelay = 10 * rand(90, 125) / 100;

    // find the total schedule baseline
    $meetingArriveTime = $this->departureTime + $travelTime +
        $schoolDelay + $tiresDelay;

    // does the traveller make the meeting on time?
    $arriveOnTime = $meetingArriveTime <= $this->meetingTime;

    return array($schoolDelay, $tiresDelay, $meetingArriveTime,
        $this->meetingTime, $arriveOnTime);

The question now is, how likely is the traveller to arrive on time given the initial conditions and the assumed uncertainty? Monte Carlo simulations answer this by running a large number of times and computing a “level of confidence”, defined as the ratio of arrivals on time to total number of trials.

If we run this method a sufficient number of times and record how often the traveller arrives on time, we can establish some sort of margin of confidence whether the trip is feasible as planned.

public function runCheckPlanRisk($numTrials) {
    $arriveOnTime = 0;
    for ($i = 1; $i <= $numTrials; $i++) {
        $result = $this->checkPlanRisk();
        if ($result[4]) {

        echo "Trial: " . $i;
        echo " School delay: " . $result[0];
        echo " Tire delay: " . $result[1];
        echo " Enroute time: " . $result[2];

        if ($result[4]) {
            echo " -- Arrive ON TIME";
        else {
            echo " -- Arrive late";

        $confidence = $arriveOnTime / $i;
        echo "\nConfidence level: $confidence\n\n";

Creating a new instance of MyTrip and asking it compute the confidence level for 1,000 trials is straightforward:

$trip = new MyTrip();

The output will be a screen print-out of 1,000 entries like this:

Trial: 1000 School delay: 0 Delay tires: 11.3 Enroute time: 530.44 -- Arrive ON TIME
Confidence level: 0.716

With the parameters above, the confidence level seems to converge to 0.72, which roughly indicates that the traveler has 72% chance of getting to the meeting on time.

Grosso modo, Monte Carlo relies on the convergence of the mean result of a sequence of identical experiments. The mean result is also known as the expected value and can be thought of as the probability of a desired result occurring. Of course this is quite an old concept and such simulations have been done a long time before the arrival of the digital computer.


Today, we have immensely powerful resources at our disposal and a very convenient language like PHP which can be used to create both the simulation logic and a user friendly web interface for it. With a few lines of code, we created a model and applied Monte Carlo simulations with it, producing an intelligible result useful for business decisions. This is a field worth exploring and it would be nice to see some scientific computation functions added to PHP so scientists and engineers could take advantage of this versatile, non-nonsense language.

Code for this article is available on PHPMaster’s GitHub page.

Image via Fotolia

03 Jul 04:30

Realistic Criteria

I'm leaning toward fifteen. There are a lot of them.
02 Jul 21:44

Retro-futuristic Lowrider

by Troy Turner

Steam-O is a modern cruiser that takes inspiration from the iconic steam locomotives of the past, applying the signature aerodynamic shape to its stark frame. In classic 1930s style, the bike sports a leather seat with spring suspension, an oversized headlight with chrome and bronze polish, and choo-choo style rims. The main feature, however, is a pushrod drivetrain like that of locomotives from the time. This unique power system and distinct attention to detail set it apart from other cruisers new and old.

Pedaling torque is transmitted by bearing on shaft and coupling rods. Coupling rods move in a vertical motion as well as horizontally as the crank-arm rotates. The same shaft at the rear wheel receives the torque ration 1:1. To gain a useful travel speed it needs a small gearbox (about 1:6 ratio depending on the crank arm length and rear wheel size).

Design: János Insperger

Yanko Design
Timeless Designs - Explore wonderful concepts from around the world!
Shop CKIE - We are more than just concepts. See what's hot at the CKIE store by Yanko Design!
(Retro-futuristic Lowrider was originally posted on Yanko Design)

Related posts:

  1. Retro-Futuristic Yacht
  2. SpeakerBox, Just A Little Retro
  3. Steampunk PC, Oh So Retro!