June 2016 Update: Times change fast! Already, the migrate_source_json module mentioned in the post has been (mostly) merged directly into the migrate_plus module, so if you're building a new migration now, you should use the migrate_plus JSON plugin if at all possible. See Mike Ryan's blog post Drupal 8 plugins for XML and JSON migrations for more info.

Recently I needed to migrate a small set of content into a Drupal 8 site from a JSON feed, and since documentation for this particular scenario is slightly thin, I decided I'd post the entire process here.

I was given a JSON feed available over the public URL http://www.example.com/api/products.json which looked something like:

{

"upcs" : [ "11111", "22222" ],

"products" : [ {

"upc" : "11111",

"name" : "Widget",

"description" : "Helpful for many things.",

"price" : "14.99"

}, {

"upc" : "22222",

"name" : "Sprocket",

"description" : "Helpful for things needing sprockets.",

"price" : "8.99"

} ]

}

I first created a new 'Product' content type inside Drupal, with the Title field label changed to 'Name', and with additional fields for UPC, Description, and Price. Then I needed to migrate all the data in the JSON feed into Drupal, in the product content type.

Note: at the time of this writing, Drupal 8.1.0 had just been released, and many of the migrate ecosystem of modules (still labeled experimental in Drupal core) require specific or dev versions to work correctly with Drupal 8.1.x's version of the Migrate module.

Required modules

Drupal core includes the base 'Migrate' module, but you'll need to download and enable all the following modules to create JSON migrations:

After enabling those modules, you should be able to use the standard Drush commands provided by Migrate Tools to view information about migrations ( migrate-status ), run a migration ( migrate-import [migration] ), rollback a migration ( migrate-rollback [migration] ), etc.

The next step is creating your own custom migration by adding custom migration configuration via a module:

Create a Custom Migration Module

In Drupal 8, instead of creating a special migration class for each migration, registering the migrations in an info hook, etc., you can just create a migration configuration YAML file inside config/install (or, technically, config/optional if you're including the migration config inside a module that does a bunch of other things and may or may not be used with the Migration module enabled), then when your module is installed, the migration configuration is read into the active configuration store.

The first step in creating a custom migration module in Drupal 8 is to create an folder (in this case, migrate_custom_product ), and then create an info file with the module information, named migrate_custom_product.info.yml , with the following contents:

type: module

name: Migrate Custom Product

description: 'Custom product migration.'

package: Migration

core: 8.x

dependencies:

- migrate_plus

- migrate_source_json

Next, we need to create a migration configuration file, so inside migrate_custom_product/config/install , add a file titled migrate_plus.migration.product.yml (I'm going to call the migration product to keep things simple). Inside this file, define the entire JSON migration (don't worry, I'll go through each part of this configuration in detail later!):

# Migration configuration for products.

id: product

label: Product

migration_group: Products

migration_dependencies: {}

source:

plugin: json_source

path: http://www.example.com/api/products.json

headers:

Accept: 'application/json'

identifier: upc

identifierDepth: 0

fields:

- upc

- name

- description

- price

destination:

plugin: entity:node

process:

type:

plugin: default_value

default_value: product

title: name

field_upc: upc

field_description: description

field_price: price

sticky:

plugin: default_value

default_value: 0

uid:

plugin: default_value

default_value: 0

The first section defines the migration machine name ( id ), human-readable label , group, and dependencies. You don't need to separately define the group outside of the migration_group defined here, though you might want to if you have many related migrations that need the same general configuration (see the migrate_example module included in Migrate Plus for more).

source:

plugin: json_source

path: http://www.example.com/api/products.json

headers:

Accept: 'application/json'

identifier: upc

identifierDepth: 1

fields:

- upc

- title

- description

- price

The source section defines the migration source and provides extra data to help the source plugin know what information to retrieve, how it's formatted, etc. In this case, it's a very simple feed, and we don't need to do any special transformation to the data, so we can just give a list of fields to bring across into the Drupal Product content type.

The most important parts here are the path (which tells the JSON source plugin where to go to get the data), the identifier (the unique ID that should be used to match content in Drupal to content in the feed), and the identifierDepth (the level in the feed's hierarchy where the identifier is located).

destination:

plugin: entity:node

Next we tell Migrate the data should be saved to a node entity (you could also define a destination of entity:taxonomy , entity:user , etc.).

process:

type:

plugin: default_value

default_value: product

title: name

field_upc: upc

field_description: description

field_price: price

sticky:

plugin: default_value

default_value: 0

uid:

plugin: default_value

default_value: 0

Inside the process configuration, we'll tell Migrate which specific node type to migrate content into (in this case, product ), then we'll give a simple field mapping between the Drupal field name (e.g. title ) and the name of the field in the JSON feed's individual record ( name ). For certain properties, like a node's sticky status, or the uid , you can provide a default using the default_value plugin.

Enabling the module, running a migration

Once the module is ready, go to the module page or use Drush to enable it, then use migrate-status to make sure the Product migration configuration was picked up by Migrate:

$ drush migrate-status

Group: Products Status Total Imported Unprocessed Last imported

product Idle 2 0 2

Use migrate-import to kick off the product migration:

$ drush migrate-import product

Processed 2 items (2 created, 0 updated, 0 failed, 0 ignored) - done with 'product' [status]

You can then check under the content administration page to see if the products were migrated successfully:

If the products appear here, you're done! But you'll probably need to do some extra data transformation using a custom JSONReader to transform the data from the JSON feed into your custom content type. That's another topic for another day! You can also update all the migrated products with migrate-import --update product , or rollback the migration with migrate-rollback product .

Note: Currently, the Migrate UI at /admin/structure/migrate is broken in Drupal 8.1.x, so using Drush is the only way to inspect and interact with migrations; even with a working UI, it's generally best to use Drush to inspect, run, roll back, and otherwise interact with migrations.

Reinstalling the configuration for testing

Since the configuration you define inside your module's config/install directory is only read into the active configuration store at the time when you enable the module, you will need to re-import this configuration frequently while developing the migration. There are two ways you can do this. You could use some code like the following in your custom product migration's migrate_custom_product.install file:

<?php

/**

* Implements hook_uninstall().

*/

function migrate_custom_product_uninstall () {

db_query ( "DELETE FROM {config} WHERE name LIKE 'migrate.migration.custom_product%'" );

drupal_flush_all_caches ();

}

?>

...or you can use the Configuration Development module to easily re-import the configuration continuously or on-demand. The latter option is recommended, and is also the most efficient when dealing with more than just a single migration's configuration. I have a feeling config_devel will be a common module in a Drupal 8 developer's tool belt.

Diving Deeper

Some of the inspiration for this post was found in this more fully-featured example JSON migration module, which was referenced in the issue Include JSON example in the module on Drupal.org. You should also make sure to read through the Migrate API in Drupal 8 documentation.

Download the source code of the custom product migration module example used in this blog post.


By now, in these last remaining days before the election of 2012, we have learned enough about the beliefs of the Republican presidential candidate to see them as a worldview all its own – a kind of creed that explains Mitt Romney. Those who say he has no principles are selling him short.

Despite its contradictions and ellipses, Romneyism has an internal coherence. It is different from conservatism, because it does not intend to conserve or protect any particular institutions or values. It is also distinct from Republicanism, in that it is not rooted in traditional small-town American values, nationalism, or states’ rights.

The ten guiding principles of Romneyism are:

1. Corporations are the basic units of society. Corporations are people, and the overriding purpose of an economy is to maximize corporate profits. When profits are maximized, the economy grows fastest. This growth benefits everyone in the form greater output, better products and services, and higher share prices.

2. Workers are a means to the goal of maximizing corporate profits. If workers do not contribute to that goal, they should be fired. If they cannot then find other work that helps maximize profits in another company, their wages must be too high, and they must therefore accept steadily lower wages until they find a job.

3. All factors of production – capital, physical plant and equipment, workers – are fungible and should be treated the same. Any that fail to deliver high competitive returns should be replaced or discarded. This keeps an economy efficient. Fairness is and should be irrelevant.

4. Pollution, unsafe products, unsafe working conditions, financial fraud, and other negative side effects of the pursuit of profits are the price society pays for profit-driven growth. They should not be used as excuses to constrain the pursuit of profits through regulation.

5. Individual worth depends on net worth — how much money one has made, and the value of the assets that money has been invested in. Any person with enough intelligence and ambition can make a fortune. Failure to do so is sign of moral and intellectual inferiority.

6. People who fail in the economy should not be coddled. They should not receive food stamps, Medicaid, or any other form of social subsidy. Coddling leads to a weaker society and a weaker economy.

7. Taxes are inherently bad because they constrain profit-making. It is the right and responsibility of individuals and corporations to exploit every tax loophole they (and their tax attorneys) can find in order to pay the lowest taxes possible.

8. Politics is a game whose only purpose is to win. Any means used to win the game is legitimate even if it involves lying and cheating, as long as it gains more supporters than it loses.

9. Democracy is dangerous because it is forever vulnerable to the votes of a majority intent on capturing the wealth of the successful minority, on whom the economy depends. The rich must therefore do whatever is necessary to prevent the majority from exercising its will, including spending large sums of money on lobbyists and political campaigns. The most virtuous among the rich will go a step further and run for president.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

10. The three most important aspects of life are family, religion, and money. Patriotism is a matter of guarding our economy from unfair traders and undocumented immigrants, rather than joining together for the common good. We owe nothing to one another as citizens of the same society.

On Tuesday we’ll decide whether these should be the guiding principles of America.


Q:

jsTree not working

I am new to jQuery and jsTree and I am not sure why I can't get it working?
Using this tutorial:
http://tkgospodinov.com/jstree-part-1-introduction/
And this html / javascript:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <meta name="description" content="">
        <title>
            BLA BLA
        </title>
        <base href="/">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

Team A's Projects

Iteration 1

Story A

Story B

Story C

Iteration 2

Story D

Nothing seems to work.
I get the following error:
$("#selector").jstree is not a function

A:

Working demo of your example: JSFiddle1 and JSFiddle2
Please check the reference and how you are calling it. This tree should be exactly the same as what you are looking for.
Rest the source of all the documentation can be found here: http://www.jstree.com/

Include the files mentioned below. See demo here.

<link rel="stylesheet" type="text/css" href="/css/normalize.css">
<link rel="stylesheet" type="text/css" href="/css/result-light.css">


# Name:     xbin-store-cloud-service-sso
# Time:     2017-05-07

FROM java:8-jre-alpine

MAINTAINER Binux <xu.binux@gmail.com>

RUN mkdir /app

WORKDIR /app

COPY xbin-store-cloud-service-sso-1.0.0.jar /app

ADD http://on2bs9q7q.bkt.clouddn.com/wait-for-it.sh /

RUN chmod +x /wait-for-it.sh

ENTRYPOINT ["./wait-for-it.sh", "config1:8502","--", "java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app/xbin-store-cloud-service-sso-1.0.0.jar"]

EXPOSE 8515


Q:

Is the language $a^i b^j c^k$ with $i+j > k$ context-free?

I am learning about Context Free Grammars and currently stuck on the following question.

Is the following language context-free? If not, then how can we prove it using Pumping Lemma?
$\qquad L = \{a^i b^j c^k \mid i,j,k \geq 0 \land i+j > k\}$.

After spending some time I have been able to generate the production rules for the following language, but unable to understand and conclude the above.
Important Condition ($i+j = k$)

$\qquad M = \{a^i b^j c^k \mid i,j,k \geq 0 \land i+j = k\}$.

$\qquad\begin{align*}
  S &\to aSc \mid X \\
  X &\to bXc \mid ε
\end{align*}$
Any assistance in solving the condition ($i+j > k$) would be a great help.

A:

There is a simple way to obtain a grammar for the language $L_{\geq} = \{a^ib^jc^k : i+j \geq k\}$ given a grammar for the language $L_= = \{a^ib^jc^k : i+j = k\}$. Starting with a grammar for $L_=$, change all rules mentioning $c$ to rules mentioning a new non-terminal $C$, and add the two productions $C\to c \mid \epsilon$.
Concretely, if we start with the following grammar for $L_=$:
$$
\begin{align*}
&S\to aSc \mid T \\
&T\to bTc \mid \epsilon
\end{align*}
$$
then the corresponding grammar for $L_{\geq}$ is
$$
\begin{align*}
&S\to aSC \mid T \\
&T\to bTC \mid \epsilon \\
&C\to c \mid \epsilon
\end{align*}
$$
Of course, this is not quite the restriction we were after. It is possible to modify the grammar for $L_{\geq}$ to a grammar for $L_{>} = \{a^ib^jc^k : i+j > k\}$ by "signalling" within the grammar that at least one $c$ was actually dropped. This requires duplicating some of the non-terminals and rules. Details left to you.
Another modification which will produce $L_{\geq}$ from $L_=$ replaces each $a$ by a non-terminal that generates $a^+$, and each $b$ by a non-terminal that generates $b^+$:
$$
\begin{align*}
&S\to ASc \mid T \\
&T\to BTc \mid \epsilon \\
&A \to Aa \mid a \\
&B \to Bb \mid b
\end{align*}
$$
Again we can use signalling to get $L_>$ rather than $L_{\geq}$. Details left to you.


Q:

poet.books throw fatal error: NSArray element failed to match

please help, this error broke my app.
I have two classes:
First Class-Poets
class Poets
 {

    var poetName:String = ""
    var poetYearsOfLife:String = ""
    var poetImage:String = ""
    var poetBiography:String = ""
    var books=[Works]()
}

Second class Work
class Works
{
    var nameWork:String = ""
    var workPoet:String = ""
}

TableViewController
var poetsPath = NSBundle.mainBundle().pathForResource("Poets1", ofType: "plist")
    var poetsArray = NSArray(contentsOfFile: poetsPath!)!
    var booksPath = NSBundle.mainBundle().pathForResource("Works1", ofType: "plist")
    var booksDict = NSDictionary(contentsOfFile: booksPath!)

    for poetArray in poetsArray
    {
        let poet=Poets()

        poet.poetName = poetArray["name"] as! String
        poet.poetImage = poetArray["image"] as! String
        poet.poetYearsOfLife=poetArray["yearsOfLife"] as! String
        poet.poetBiography=poetArray["biography"] as! String
           poets.append(poet)

        poet.books = booksDict![poet.poetName as String] as! [(Works)]//<---error
        for bookArray in poet.books {
            var book=Works()
           book.nameWork = "nameWork"

            }
    }

How I can fix this bug?
fatal error: NSArray element failed to match the Swift Array Element type

I have Work1.plist. I try to make a segue and to pass values from plist associated with a particular poetName from Poets1.plist in a table.Sorry for my bad English.
<plist version="1.0">
<dict>
<key>poet_name1</key>
<array>
    <dict>
        <key>nameWork</key>
        <string>Благовест</string>
        <key>work</key>
        <string>Среди дубравы</string>
    </dict>
</array>
<key>poet_name2</key>
<array>
    <dict>
        <key>nameWork</key>
        <string>Бессонные ночи</string>
        <key>work</key>
        <string>Какой кошмар!</string>
    </dict>
</array>
</dict>
</plist>

A:

My suggestion is to add an initializer to your Works class:
class Works {

    var nameWork = ""
    var workPoet = ""

    init(nameWork: String, workPoet: String) {
        self.nameWork = nameWork
        self.workPoet = workPoet
    }
}

Then you can use it like this:
let worksArray = booksDict[poet.poetName as String] as! NSArray
for work in worksArray {
    let dictionaryFromArray = work as! NSDictionary
    let workObject = Works(nameWork: dictionaryFromArray["nameWork"] as! String, workPoet: dictionaryFromArray["work"] as! String)
    poet.books.append(workObject)
}


1. Field of the Invention
The present invention generally relates to the field of liquid crystal devices, and more specifically to a high speed liquid crystal display and fabrication method in which electrodes and microelectronic electrode driver devices are integrally formed in a transparent monocrystalline silicon semiconductor layer.
2. Description of the Related Art
A liquid crystal display includes a sealed space which is filled with a liquid crystal material. Front and back electrodes are disposed on opposite sides of the space and are selectively energized to apply electric fields to the liquid crystal material to cause it to locally change its orientation resulting in a spatially variant perturbation of the light passing through. The electrodes also provide charge storage for the cell.
Different liquid crystal materials affect light passing through by different mechanisms, such as variable birefringence, scattering, etc. The display may provide only discrete black and white levels, or a continuous gray scale.
Liquid crystal displays can have either transmissive or reflective configurations. The front electrodes can be arranged in segments to provide an alphanumeric display for a calculator or clock, or in a rectangular matrix to provide a continuous graphic image for television, computer and other applications.
U.S. Pat. No. 4,239,346, entitled "COMPACT LIQUID CRYSTAL DISPLAY SYSTEM" issued Dec. 16, 1980 to R. Lloyd discloses a reflective Active-Matrix Liquid-Crystal Display (AMLCD) including a transparent front electrode and electrode back plates formed of single crystal silicon which define a sealed space therebetween which is filled with liquid crystal material. A common front electrode is formed on the inner surface of the front plate, whereas a semiconductor layer includes the inner surface of the back plate.
Back electrodes of reflective metal are formed in a rectangular matrix pattern on the top surface of the semiconductor layer in contact with the liquid crystal. MOSFET electrode driver transistors, interconnected by polycrystalline silicon bus lines, are also formed in the semiconductor layer, and are operatively connected to the electrodes. Electrical potentials are selectively applied between the individual back electrodes and the front electrode via the bus lines and driver transistors to locally polarize the liquid crystal material and form an image complete with gray scale.
The preferred material for the front and back plates is glass, due to its negligible reactivity with liquid crystal materials, low cost and transparency, allowing either reflective or transmissive liquid crystal effects to be used. Although epitaxial deposition of monocrystalline (single crystalline or bulk) silicon is possible on various materials such as sapphire, the temperature required for deposition is on the order of 1,000.degree. C. which is far in excess of the melting point of glass. In addition, the atomic structure of glass is highly irregular, and nonconducive to the growth of an epitaxial silicon layer.
For these reasons, the silicon layer on the front plate of Lloyd's display is formed by a standard silicon wafer. Alternative displays have used silicon layers formed by chemical vapor deposition (CVD) of amorphous or polycrystalline silicon. CVD of these materials can be performed at low temperatures and is not adversely affected by the irregular crystalline structure of the glass material of the plate.
However, the carrier mobility of polycrystalline silicon is one-eighth that of monocrystalline silicon, and the mobility of amorphous silicon is one-hundredth that of monocrystalline silicon. The operating speed of a microelectronic device is linearly proportional to the mobility. The low mobility of polycrystalline and amorphous silicon limits the operating speed of the electrode driver transistors and thereby the displays in which they are incorporated. These devices generally operate at less than 60 Hz, which is a common video display speed. In order to accommodate the leakage current and refresh time of transistors fabricated in polysilicon for 60 Hz operation, two transistors are connected in series to obtain sufficiently high impedance and low current.


WraptorSkinzTM self-adhering vinyl skins will look amazing on your electronic gear, printed at the highest resolution possible for unbeatable color and razor sharp clarity. Unlike bulky silicon, plastic or metal cases and faceplates, WraptorSkinz are designed to be thin and very tough. WraptorSkinz are a composite of layered commercial grade vinyl. The bottom layer is a soft, flexible vinyl with a special removable adhesive that is easily positioned, applied without air bubbles, and effortlessly removed without leaving a sticky residue. WraptorSkinz are printed with the latest in UV protected inks that resist fading for up to 3 years even in direct sunlight. Finally we bond a professional grade laminate over the entire skin adding a professional glossy protective finish. This item is not affiliated with or endorsed by the Beats brand in any way.

WraptorSkinzTM self-adhering vinyl skins will look amazing on your electronic gear, printed at the highest resolution possible for unbeatable color and razor sharp clarity. Unlike bulky silicon, plastic or metal cases and faceplates, WraptorSkinz are designed to be thin and very tough. WraptorSkinz are a composite of layered commercial grade vinyl. The bottom layer is a soft, flexible vinyl with a special removable adhesive that is easily positioned, applied without air bubbles, and effortlessly removed without leaving a sticky residue. WraptorSkinz are printed with the latest in UV protected inks that resist fading for up to 3 years even in direct sunlight. Finally we bond a professional grade laminate over the entire skin adding a professional glossy protective finish. This item is not affiliated with or endorsed by the Beats brand in any way.

WraptorSkinzTM self-adhering vinyl skins will look amazing on your electronic gear, printed at the highest resolution possible for unbeatable color and razor sharp clarity. Unlike bulky silicon, plastic or metal cases and faceplates, WraptorSkinz are designed to be thin and very tough. WraptorSkinz are a composite of layered commercial grade vinyl. The bottom layer is a soft, flexible vinyl with a special removable adhesive that is easily positioned, applied without air bubbles, and effortlessly removed without leaving a sticky residue. WraptorSkinz are printed with the latest in UV protected inks that resist fading for up to 3 years even in direct sunlight. Finally we bond a professional grade laminate over the entire skin adding a professional glossy protective finish. This item is not affiliated with or endorsed by the Beats brand in any way.

WraptorSkinzTM self-adhering vinyl skins will look amazing on your electronic gear, printed at the highest resolution possible for unbeatable color and razor sharp clarity. Unlike bulky silicon, plastic or metal cases and faceplates, WraptorSkinz are designed to be thin and very tough. WraptorSkinz are a composite of layered commercial grade vinyl. The bottom layer is a soft, flexible vinyl with a special removable adhesive that is easily positioned, applied without air bubbles, and effortlessly removed without leaving a sticky residue. WraptorSkinz are printed with the latest in UV protected inks that resist fading for up to 3 years even in direct sunlight. Finally we bond a professional grade laminate over the entire skin adding a professional glossy protective finish. This item is not affiliated with or endorsed by the Beats brand in any way.

WraptorSkinzTM self-adhering vinyl skins will look amazing on your electronic gear, printed at the highest resolution possible for unbeatable color and razor sharp clarity. Unlike bulky silicon, plastic or metal cases and faceplates, WraptorSkinz are designed to be thin and very tough. WraptorSkinz are a composite of layered commercial grade vinyl. The bottom layer is a soft, flexible vinyl with a special removable adhesive that is easily positioned, applied without air bubbles, and effortlessly removed without leaving a sticky residue. WraptorSkinz are printed with the latest in UV protected inks that resist fading for up to 3 years even in direct sunlight. Finally we bond a professional grade laminate over the entire skin adding a professional glossy protective finish. This item is not affiliated with or endorsed by the Beats brand in any way.

WraptorSkinzTM self-adhering vinyl skins will look amazing on your electronic gear, printed at the highest resolution possible for unbeatable color and razor sharp clarity. Unlike bulky silicon, plastic or metal cases and faceplates, WraptorSkinz are designed to be thin and very tough. WraptorSkinz are a composite of layered commercial grade vinyl. The bottom layer is a soft, flexible vinyl with a special removable adhesive that is easily positioned, applied without air bubbles, and effortlessly removed without leaving a sticky residue. WraptorSkinz are printed with the latest in UV protected inks that resist fading for up to 3 years even in direct sunlight. Finally we bond a professional grade laminate over the entire skin adding a professional glossy protective finish. This item is not affiliated with or endorsed by the Beats brand in any way.

WraptorSkinzTM self-adhering vinyl skins will look amazing on your electronic gear, printed at the highest resolution possible for unbeatable color and razor sharp clarity. Unlike bulky silicon, plastic or metal cases and faceplates, WraptorSkinz are designed to be thin and very tough. WraptorSkinz are a composite of layered commercial grade vinyl. The bottom layer is a soft, flexible vinyl with a special removable adhesive that is easily positioned, applied without air bubbles, and effortlessly removed without leaving a sticky residue. WraptorSkinz are printed with the latest in UV protected inks that resist fading for up to 3 years even in direct sunlight. Finally we bond a professional grade laminate over the entire skin adding a professional glossy protective finish. This item is not affiliated with or endorsed by the Beats brand in any way.

WraptorSkinzTM self-adhering vinyl skins will look amazing on your electronic gear, printed at the highest resolution possible for unbeatable color and razor sharp clarity. Unlike bulky silicon, plastic or metal cases and faceplates, WraptorSkinz are designed to be thin and very tough. WraptorSkinz are a composite of layered commercial grade vinyl. The bottom layer is a soft, flexible vinyl with a special removable adhesive that is easily positioned, applied without air bubbles, and effortlessly removed without leaving a sticky residue. WraptorSkinz are printed with the latest in UV protected inks that resist fading for up to 3 years even in direct sunlight. Finally we bond a professional grade laminate over the entire skin adding a professional glossy protective finish. This item is not affiliated with or endorsed by the Beats brand in any way.


At its heart is the nutrient-rich Miracle Broth™ created by Dr. Huber that has become renowned for its healing abilities. True to Huber's coveted formula, Crème de la Mer's exclusive Lime Tea is also utilized in its original concentration. Created through the time-intensive process of extraction, Lime Tea is an exceptionally powerful anti-oxidant. Helping protect against a wide range of external insults, it gives skin the ability to focus energy on repair.

Created with La Mer's proprietary sea kelp, a natural humectant, The Moisturizing Gel Cream deeply moisturizes while maintaining an airlight feel on the skin, encouraging it to look and feel renewed, hydrated and conditioned.

DESCRIPTION_IPAD

At its heart is the nutrient-rich Miracle Broth™ created by Dr. Huber that has become renowned for its healing abilities. True to Huber's coveted formula, Crème de la Mer's exclusive Lime Tea is also utilized in its original concentration. Created through the time-intensive process of extraction, Lime Tea is an exceptionally powerful anti-oxidant. Helping protect against a wide range of external insults, it gives skin the ability to focus energy on repair.Created with La Mer's proprietary sea kelp, a natural humectant, The Moisturizing Gel Cream deeply moisturizes while maintaining an airlight feel on the skin, encouraging it to look and feel renewed, hydrated and conditioned.

DISPLAY_ORDER

0

DISPLAY_STATUS

0

DRUPAL_URL

/product/5834/12470/Moisturizers/The-Moisturizing-Gel-Cream

EXP_9275

0

FAMILY_CAT_ID

FAMILY_CODE

28FC

FINISH

HAIR_NEEDS_COLORED_TREATED

HAIR_NEEDS_DRY

HAIR_NEEDS_OILY

HAIR_TYPE_FINE

HAIR_TYPE_STRAIGHT

HAIR_TYPE_THICK

HAIR_TYPE_WAVY_CURLY

HAZARDOUS_PRODUCT

0

IMAGE_TYPE

LARGE_IMAGE

/media/export/images/products/lrg/28FC_lg.jpg

LEGACY_PARENT_CAT_ID

LEGACY_PROD_ID

MEDIUM_IMAGE

/media/export/images/products/med/28FC_md.jpg

META_DESCRIPTION

META_KEYWORDS

MISC_FLAG

0

MULTI_SPECIAL_IND

0

MULTI_SPECIAL_TEXT

OBJECT_ID

HAuZa4dSAtKoD21bM9izEg

ONLY_RATINGS_COUNT

PARENT_CAT_ID

CAT5834

PARENT_PRODUCT_TYPE

PATH

CAT5834PROD12470

PRODUCT_ATTRIBUTES

PRODUCT_ID

PROD12470

PRODUCT_TMPL

PRODUCT_TYPE

2

PRODUCT_USAGE

To activate the broth and release its key ingredients, pat a small amount between fingertips and press into your face, neck, even under the fragile eye area. Apply day and night for a lifetime.

PRODUCT_USAGE_IPAD

To activate the broth and release its key ingredients, pat a small amount between fingertips and press into your face, neck, even under the fragile eye area. Apply day and night for a lifetime.


Meta-analysis of bioabsorbable versus durable polymer drug-eluting stents in 20,005 patients with coronary artery disease: an update.
To perform an updated meta-analysis comparing biodegradable polymer drug eluting stents (BP-DES) and durable polymer drug eluting stents (DP-DES). BP-DES have been suggested to reduce late stent thrombosis (LST) rates as compared to first generation DP-DES. Recently, second generation DP-DES have replaced older DES, but comparison of these stents with BP-DES has not yielded consistent results. Medline/Web databases were searched for studies comparing BP-DES and DP-DES, and reporting rates of overall/cardiac mortality, myocardial infarction (MI), LST, target lesion revascularization (TLR) and target vessel revascularization (TVR) and late lumen loss (LLL), with a follow-up ≥6 months. Twenty studies (20,005 patients) were included in the meta-analysis. Median follow-up time was 1 year. Compared with DP-DES, BP-DES showed lower LLL (in stent: weighted mean difference WMD -0.45 mm, 95% CI -0.66 to -0.24 mm, P = 0.00001; in segment: WMD -0.15 mm, 95% CI = -0.24 to -0.06 mm, P = 0.001) and lower rates of LST (OR 0.51, 95% CI = 0.30 to 0.86, P = 0.01), although they did not improve mortality, MI, TLR, and TVR rates. BP-DES coated with sirolimus or novolimus, in comparison with biolimus or paclitaxel, were associated with reduced LLL (P < 0.0001 for subgroups). In comparison with DP-DES, BP-DES significantly reduce LLL and LST rates, without clear benefits on harder endpoints. The efficacy of BP-DES in preserving lumen patency seems larger for sirolimus and novolimus DES.


The effects of ascorbic acid on the induction of urothelial lesions in mice by 2-acetylaminofluorene.
288 BALB/c male mice were allocated to: Group 1-control; Group 2-500 ppm of 2-acetylaminofluorene (2-AAF) in the food, with control water; Group 4-500 ppm of 2-AAF in the food and 250 mg/100 ml of vitamin C in the water; and Group 3-control food and 250 mg% of vitamin C in the water. Major histopathologic changes at the end of 28 days included both inflammation of the lamina propria and hyperplasia of the transitional epithelium of the urinary bladder in mice receiving 2-AAF. The most severe lesions were seen in the mice administered the combination of 2-AAF and vitamin C. It was postulated that either decreased water consumption and concentration of the urine and/or reduction in urinary pH may have contributed to the severity of the lesions.


To figure that out, we need to look back at the state of Motorola some 19 months ago and apply some mathematical magic.

The thought experiment

When the Nexus One was introduced, Motorola sported a market cap of about $10.6 billion. That's for the entire Motorola beast, including the infrastructure and enterprise operations that later became Motorola Solutions. At the time, mobile devices represented 31 percent of Motorola's sales and did not generate profits. The only fair division available is to split the company along revenue lines.

Thirty-one percent of $10.6 billion is $3.3 billion, and Google is paying 3.8 times that amount. If the deal falls apart for some reason, like failing regulatory approval or due to Motorola's shareholder vote, Google will pay a $2.5 billion breakup fee that nearly equals our hypothetical early-2010 market cap.

In slightly more realistic terms, Google would probably have needed a similar-sized buyout premium back then. This would put the theoretical buyout price at $6.2 billion, or about half of the final price tag.

When Motorola separated last December, the final value of Mobility was one-ninth of the total company—Motorola shareholders received one Mobility share per eight regular shares. Using that ratio instead, you'd get a fair price of $1.9 billion including the buyout boost.

The road not taken

Any way you slice it, Google could have saved a truckload of cash by getting into the hardware game much earlier. Its bold plan to revolutionize the way cell phones are sold fizzled early on, and the Nexus One became nothing but a developer phone in less than six months' time. We don't know what that failed experiment ended up costing Google, but most of the pain was probably passed to Nexus-maker HTC.

Since then, Android's reference models have jumped from one manufacturer to another, including the Samsung-designed Nexus S and Motorola's Xoom tablet. With this acquisition safely under its vest from an early date, Google could have kept that zig-zagging firmly under control and in-house, while also clamping down on the much-maligned Android fragmentation issues.

On the other hand, Google would also have lost a chance to build the diverse support system that Android now enjoys. Some call it fragmentation and others call it choice or diversity; from that perspective, Mountain View would be probably better off leaving Motorola alone altogether, though it did manage to round up quotes from handset manufacturers saying they support the buyout.

What's new?

Ironically, buying Motorola Mobility makes Google a truer copy of the Apple business model. No longer a hands-off software provider with no financial interest in handset sales, Google now needs to worry about hardware implementation and direct profits. This two-headed beast will deliver the purest Android experience on the market, and will be held up as a role model or pariah when things go right or very wrong for the platform.

And let's not forget that Motorola Mobility might not go home with Google after all. Perhaps the biggest reason to pick up Motorola rather than just buying another basket of protective patents is that regulators might block a pure patent deal but could let this agreement pass because Google is buying hardware operations where it holds no monopoly whatsoever. That doesn't make it a slam-dunk, however.

All told, leaving Motorola on the table for a year and a half added at least $6 billion to the dollar cost but also brought about a slew of less obvious costs—and benefits.

For better or worse, Android just changed in a big way. And if Google had made this move a year ago, the market would look very different today in that unpredictable way that makes hurricanes out of fluttering butterfly wings.

80 Reader Comments

I think you should address the issue of the number of patents Moto had back then, compared to the number they have now, when Google announced they wanted to buy them. Would it still have been worth while back then?

If Google really wants to change the mobile phone business (in the US at least) they don't need to buy a handset maker; they need to buy a bunch of Congresspeople and get carrier-locked phones outlawed.

Hopefully *crosses fingers* this will help them make more phones that are unlocked off the shelf with a more pure Android Exp. I know a lot of people have some hate for Moto, but damn if I don't love my Droid2 Global. I love me some slideout keyboards.

Why is there no mention of Motorola's Set-Top Boxes and Cable Modems in any of the Google buying Motorola Mobility? Motorola Mobility includes both of those along with the mobile handset portion of Motorola.

If Google really wants to change the mobile phone business (in the US at least) they don't need to buy a handset maker; they need to buy a bunch of Congresspeople and get carrier-locked phones outlawed.

They could theoretically buy T-Mobile once that merger is disapproved, but I don't think Google would want in on it anyways, although it could be a better deal than "buying" a few congresscritters

If Google really wants to change the mobile phone business (in the US at least) they don't need to buy a handset maker; they need to buy a bunch of Congresspeople and get carrier-locked phones outlawed.

They could theoretically buy T-Mobile once that merger is disapproved, but I don't think Google would want in on it anyways, although it could be a better deal than "buying" a few congresscritters

I think you should address the issue of the number of patents Moto had back then, compared to the number they have now, when Google announced they wanted to buy them. Would it still have been worth while back then?

I don't think it would've been a major factor, especially if Google kept to the same hands off management promises they're making now. In that case the patent generation rate would be mostly unchanged.

I love my original Droid, but I was not going to buy another Motorola product because I didn't want to buy a phone that would brick itself if it thought I was unlocking it (even though I have no plans to actually unlock it, all it takes is one malicious virus to blow them up). This makes me happy, since I hope that Google will get rid of those brick circuits, and I can buy a Droid4 or Droid X5 or whatever it is in a year or so.

If Google really wants to change the mobile phone business (in the US at least) they don't need to buy a handset maker; they need to buy a bunch of Congresspeople and get carrier-locked phones outlawed.

Locked phones (and the subsidies that come with them) is the only thing keeping Android afloat.

Eh, hindsight is 20/20. It might have been a good deal then but it also would have been a good deal to buy Apple shares before the ipod/iphone hit. Not that it's not fun to speculate, but I think the more exciting conversation is what does this mean for the industry going forward. Personally I don’t think we’ll see a significant change. Google just wanted the patents so I don’t see them folding Motorola into the Google fold. They probably won’t rebrand or do anything else drastic. They’ll just keep Motorola running as a separate business. Of course, if they start to lose money on it we could see them trying something drastic just because they can.

Why is there no mention of Motorola's Set-Top Boxes and Cable Modems in any of the Google buying Motorola Mobility? Motorola Mobility includes both of those along with the mobile handset portion of Motorola.

There've been a few mentions; but Google TV has largely been a no-show and the cable modem business is completely separate from any of Google's logical reasons for buying the company. If Google changes plans and ends up integrating moto more thoroughly I suspect the cable box business will end up being sold or spun off.

Why is there no mention of Motorola's Set-Top Boxes and Cable Modems in any of the Google buying Motorola Mobility? Motorola Mobility includes both of those along with the mobile handset portion of Motorola.

These types of devices aren't made to Moto's specifications, they're made to the cable provider's specs. They're not remotely keen on Google TV so I can't see how this acquisition would do anything other than kill that part of Moto's business.

Having been on the other side of the fence (Enterprise Mobility), I have mixed feelings about it. Our side wanted to get rid of Mobile Devices for a while because they were taking all the resources, and we mused about the possibility of Google buying it. I have some trepidation about the merge, as if they're not interested in hardware a lot of good hardware engineers will be out of a job. Mot's never been known for their software, but I've always been impressed by the hardware design.

Why is there no mention of Motorola's Set-Top Boxes and Cable Modems in any of the Google buying Motorola Mobility? Motorola Mobility includes both of those along with the mobile handset portion of Motorola.

These types of devices aren't made to Moto's specifications, they're made to the cable provider's specs. They're not remotely keen on Google TV so I can't see how this acquisition would do anything other than kill that part of Moto's business.

That's how it works now, but Google is entirely different than Moto. They have a ton of cash, even by cable company standards, AND the ability to revolutionize tv advertising, which has become borderline fraudulent (we sell you tv, with ads, for a fee you can skip the ads, we sell ads to companies, who think you're watching ads that you pay extra to avoid). I'm sure cable companies will resist change, they have become very adept at that, however, when Google shows up at your doorstep with a briefcase of cash and a new advertising model, there isn't a cable exec in the world that wouldn't listen.

Eventually the players will be turned, they need a new ad model. They see the writing on the wall, anyway: live tv is dying and horrible set top boxes are killing their business.

If Google had a acquired Motorola in 2010, Samsung, HTC and others might have been less keen on pushing Android, knowing they are using the OS of a direct competitor in the hardware space.

Google had to make a relatively weak showing in the hardware space (Nexus One) to bluff and show they are only in it for the software, not the hardware.

Even now, they have to make relatively weak moves in the hardware space to bluff and suggest that the buyout is all about the patents and not so much the hardware. To make this convincing, they would have needed to try to buy patents in 2009/2010 and fail.

So, the timing is just about right. They first needed to see that Android would be successful, that the other hardware players would make a good push for Android, then try to acquire a bunch of patents and fail, then purchase one of the successful hardware manufacturers for their patents, then get your new competition to praise the move, then slowly become the dominant hardware player.

This was the next logical step of verticalization that's taking place in mobile computing business.

To be a meaningful player, one has to actively drive development of hardware, components, software, media content, and data services, as well as to have a clout with carriers and attention from apps developers. A couple of entities with all these competences are emerging to duke it out: Apple and Google + handset makers.

It's unclear how much room and/or opportunity there is left for other weaker entities: Microsoft + Nokia, RIM, Samsung (with Bada), HP (webOS), or Intel (Meego).

At least Google has come to a realization of what it takes to be a player and a decision to be one. This cannot be said of other contenders; they all seem to want to continue doing what they know (or unable to do otherwise), and somehow success will come if they just tried harder.

There've been a few mentions; but Google TV has largely been a no-show and the cable modem business is completely separate from any of Google's logical reasons for buying the company. If Google changes plans and ends up integrating moto more thoroughly I suspect the cable box business will end up being sold or spun off.

OTOH, a cable box running some version of Android would beat the pants off of any of the shitty options out there now. Cable boxes have terrible interface and software design, almost as bad as phones were before Apple/Google/MS. Still, cable box choice is a very "back room deal" kind of thing, so having the only decent one wouldn't necessarily mean anything.

A lot of hand-wringing, retrospective cloudy crystal ball gazing and generally just a really bad piece of "journalism"... I think it's time Ars introduces a dedicated opinion section, because reporting this ain't.

To be a meaningful player, one has to actively drive development of hardware, components, software, media content, and data services, as well as to have a clout with carriers and attention from apps developers. A couple of entities with all these competences are emerging to duke it out: Apple and Google + handset makers.

It's amazing that Apple realised this and were actually able to execute such a long time ago and yet the rest of the industry (HP, RIM, Microsoft and now Google) is only just catching on.

The phone portion of this is definitely only part of the equation. MotoMobile has agreements with cable companies for their set top boxes. Google now has their foot in the door to the cable market and can start pushing their GoogleTV / DVR combo (remember Google bought SageTV just last year). This is way more than phones. Oh and they will likely "license" out the GoogleTV OS for free and Moto will make money on the hardware. Chances are it will come with a touch screenish remote control so you can actually navigate without having a coronary.

This was the next logical step of verticalization that's taking place in mobile computing business.

To be a meaningful player, one has to actively drive development of hardware, components, software, media content, and data services, as well as to have a clout with carriers and attention from apps developers. A couple of entities with all these competences are emerging to duke it out: Apple and Google + handset makers.

It's unclear how much room and/or opportunity there is left for other weaker entities: Microsoft + Nokia, RIM, Samsung (with Bada), HP (webOS), or Intel (Meego).

Medium term at least I think this is going to give WP7 a boost. While Samsung, HTC, etc are probably still leery about what the MS+Nokia partnership will mean in the long term they can hope to suck thier way into sweetheart deals of their own, and in any case it's less tight integration than Google+Motorola. And at $23bn Nokia's market cap is still probably too big for MS to buy; and if WP7.5 is successful it will probably go up again because Symbian's perceived lack of future has been a large part of what's hammered it down by ~6x over the last few years. If WP7.5 fails to gain an appreciable amount of market share Nokia will probably fall to something MS could buy; but in that case there'd be little reason for them to do so.

A lot of hand-wringing, retrospective cloudy crystal ball gazing and generally just a really bad piece of "journalism"... I think it's time Ars introduces a dedicated opinion section, because reporting this ain't.

thought the author added a few nice bits that conceded that this was guesswork with some humility. much better than the dan lyons piece that is being trashed left and right for good reason.

For better or worse, Android just changed in a big way. And if Google had made this move a year ago, the market would look very different today in that unpredictable way that makes hurricanes out of fluttering butterfly wings.

The same will be true a year or two from now. Google is making a big bet changing the Android ecosystem and I think it's an uncertain one. These large technology mergers seldom work, especially when you have two completely different corporate cultures. A year from now it will probably be more interesting to ask what Google lost and gained by buying Motorola at all.

The sort of reasoning we see in this article is almost never useful, as it seems to assume that this possibility actually made sense to Google in that time frame. By buying a hardware vendor then Google could easily have alienated the other big Android OEM's, before they were so deeply into Android to make it difficult to extricate themselves. I'm sure they're now considering how Google's direct competition leads to increased business risk for them. Had this happened 19 months ago, Meego, a future WP7, or another alternative might have seemed significantly more attractive and that would have been bad for Google.

People use the same sort of reasoning with Apple: If only Apple didn't have such a long iPhone exclusive with sucky old AT&T, they could have blunted Android's advance. Again, that is completely fallacious because it assumes that that path was open to Apple--it was not. If Apple wanted to retain the sort of control over the user experience and platform that they like, they had to give up something--they went exclusive with AT&T to get that control. Otherwise, they would have been in the same boat as every other vendor--forced to relent to unique carrier-branded iPhone variations that users despise, except that Apple was new to the cell phone market and they weren't in as strong a position vis-a-vis their competitors. If Apple had gone carrier agnostic in that timeframe the iPhone would not look like it does today--the experience would be greatly degraded.

I think in hindsight both Google and Apple made the right decisions in the right timeframes, even if it did cost Google a lot more cash and gave Android an opening vis-a-vis iPhone.

This article doesn't address the over $2 Billion tax credit or over $3 Billion in cash Google is acquiring in this deal. The true price will turn out to be around $7 to $8 Billion when all is said and done.

In 2010, Apple wasn't trying to sue Android off the market using bullshit patents. Acquiring a patent defense was Google's primary reason for acquiring Motorola. I don't foresee the two companies integrated for a long time, if ever. The corporate cultures are significantly different; Google's flat, pseduo-independent management structure won't mesh well with Motorola's more traditional corporate structure.

In regards to the set-top boxes. If you haven't seen the writing on the wall as of yet, set-top cable boxes will be a thing of the past in the near future.

Granted I'm probably a little ahead of the majority here, but I don't have a cable connection in my house. I've been using consoles to stream media for the last 3 years. This year I bought a Samsung TV that speaks DLNA. It doesn't communicate perfectly but its a sign. The LAN connection on your TV will supersede the necessity for a set top box in the near future.

I think Googorola could certainly play a part in revolutionizing the television experience, but given the fact that we can put an i5/i7 in a laptop less than an inch thick. I think its more of a certainty that TV makers could very well place CPU's inside your TV that will allow for any number of interactions sans cable/set-top box. They don't need Google to do any of that either (but they could, certainly do so - that would be grand!).

As for the buyout I do believe that the Motorola Mobility CEO Sanjay Jha played Google like a fiddle. It was quite amazing to read the maneuvering of last week and see how it played out for them on Monday. Kudos to that man, brilliant play.

I see this playing out several ways, I don't see many of them helping Android save face in light of recent litigation, given that Motorola is already a defendant in several cases and Microsoft and Apple may already license a fair number of patents from Motorola via various channels or through exhaustion with chip makers. Google still hasn't come to the aid of HTC or Samsung and still has an uphill battle with Oracle.

As others have pointed out. Android is fast becoming a large expense for Google. The Motorola purchase costs them 1/3 of their capital and may quicken the departure of other vendors towards WP7, it doesn't weigh well on any current litigation and they paid a huge premium for a company that is falling down.

Yes, this has only to do with patents. Google tried to get hold of Nortel's patents and Apple and Microsoft paid way to much to keep Google from getting them. So Google did a surprise move and bought even more applicable patents with the Motorola purchase.

As for the fact that Motorola makes phones and set top boxes, that is irrelevant.

The worse thing that could happen is if Google's well known arrogance rears its head and they think they can run the phone and set top business. Google should spin those units off, and let them, as well as Samsung and HTC, and other Android vendors, have a free license to the patents.


Q:

how to use bar code reader in c# windows application?

I want to create windows application in c# that can work with bar code reader.
I want following feature to be add in my windows application:
-> Details of Product should be fill up automatically in form when bar code reader scanned correct bar code of product.

A:

There are (at least) two types of bar code readers:

working as keyboard input
working on Serial Port

So the first one is really easy. Just plug in your reader to your computer, put the cursor on your TextBox and read barcode. As it works as keyboard input, the code will automatically fill your TextBox. There may be line break at the end of read (it depends on reader and/or its settings).
This works out of the box. The problem is that your textBox MUST HAVE focus.
Other type is ComPort. This is great if you want more functionality (or don't want to have focus on control). But needs more work. But C# has a class to do that: https://msdn.microsoft.com/pl-pl/library/system.io.ports.serialport(v=vs.110).aspx
You will need to set some things like baudrate, parity bits, port name (COM1, COM2, etc). It's more complicated but the question is about how to do it - not about COM ports. So I am not writing about COM ports.


Back in March, DARPA announced that it had awarded company called Aurora Flight Sciences a contract to start test its far-out design for a VTOL craft propelled by two dozen ducted fans. Now the project is getting substantially more real and passed its first test with flying colors. This thing can really fly, a small version of it anyway.

The craft—officially named the LightningStrike—won the contract for phase two of DARPA's VTOL X-Plane program which aims to develop a vertical takeoff plane that can hit high speeds of up to 460 mph. Whipping up a wacky animation is one thing, but actually flying a model is another. This little sucker weighs 325 pounds and is a 20 percent of the scale of the final prototype to be built during the next two years, but its successful little trip seems to validate DARPA's choice.

This content is imported from Vimeo. You may be able to find the same content in another format, or you may be able to find more information, at their web site.

Viewers who watch all the way through (bless you) will notice something is missing. This test flight shows takeoff and landing, but not the part where the LightningStrike would transform mid-air for better cruising performance. V-22 Ospreys can do it, and so can a ten-prop NASA design so it is far from impossible, but it's still a tricky bit of design work the LightningStrike still has to overcome.

Like its little brother here, Aurora Flight Science's final larger prototype will also be unmanned, and while the X-Plane project does not demand that its champion be human-piloted, DARPA has said that it wouldn't wind seeing that flavor as well. For now, the mini version will have to do.

This content is created and maintained by a third party, and imported onto this page to help users provide their email addresses. You may be able to find more information about this and similar content at piano.io


Q:

Ruby OO design : how to handle inconsistent state in a mutable class?

Abstract
I'd like to have advice on how to :

implement methods that rely on a state,
when the instance is mutable and may be in an inconsistent state,
in such a way that the methods either silently fail or return nil,
without having to nil guard / coerce state to meaningful values everywhere.

Anyway, if my design is wrong itself, let me know.
Context
I have an ActiveRecord class. It is pretty simple, but has lots and lots of methods that require the whole instance to be valid? to work correctly.
The class in question handles a complex tax calculation, but for the sake of clarity, let's boil it down to this :
class Foo < ActiveRecord::Base

  validates :a, :b, :c, :d, :e,
            numericality: {inclusion: 0..100}
  validates :f, :g, :h,
            numericality: {greater_than: 0}

  def some_method
    a * b / c
  end

  def other_method
    d + e * (g / f)
  end

  def yet_another_method
    some_method - other_method * f
  end

  def this_is_getting_really_complex
    yet_another_method * other_method - some_method
  end

  # and so on, with piles of methods calling each other
end

Moreover, i have subclasses for this class that override these methods (different tax calculation rules, etc.)
The thing is, as long as an instance is in a consistent state (all a, b, c... fields are present and valid), all the methods work fine. But ActiveRecord instances must be able to be in an inconsistent state, because...well, we want to be able to validate them. So raising ArgumentError during initialize when the params are meaningless is out of the question.
In this case, let's say a, b, c are filled with junk strings or nil instead of meaningful values : all of our methods will raise various errors, or even worse - thanks to duck typing it will work in a crazy, unintended way ( "junk" * 300_000, anyone? ).
Trying to solve this problem
first try : nil guards
this is getting ugly pretty quick :
def some_method
  return nil unless [a, b, c].all? &:present?
  a * b / c
end

... ugh, nil guarding isn't enough, what if i have strings instead of numbers ? I admit for a while i was tempted with heresy :
def some_method
  a * b / c
rescue TypeError, NoMethodError
  nil
end

This is too bad. Wait, what if i simply check for validity ?
def some_method
  return nil unless valid?
  a * b / c
end

A bit better, but now the whole validation process kicks in every time i call a method. This is silly. OO to the rescue ?
second try : OO refactoring
My first thought was : well, we have a behavior that varies according to state - this is textbook example for a state machine. But how would i hook this on AR's validation cycle ? Did not figured it out.
Then I proceeded to try and extract those methods into a variety of immutable decorator classes, with a factory method that accepted one instance from my Foo class :
 class FooDecorator

    def self.factory( foo )
      # NullDecorator has methods that always return nil
      return NullDecorator.new( foo ) if foo.invalid?
      case foo
        when Foo:Bar then BarDecorator.new( foo )
        when Foo:Baz then BazDecorator.new( foo )
        else raise ArgumentError
      end
    end

    def initialize( foo )
      @foo = foo.dup.freeze.readonly!
    end

    def some_method
      @foo.a * @foo.b / @foo.c
    end

    def yet_another_method
      some_method - other_method * @foo.f
    end

  end

I promptly stopped because it felt ridiculously overengineered, and smelled like feature envy over the top.
I also considered using the Maybe monad, or create a monad of my own like "MaybeAValidNumber" to coerce everything to meaningful values. That felt not much better than nil guards and again, overengineered.
third try : don't care
Thinking about this, i wondered if i should nil guard at all : after all, these methods are only relevant if the instance is in a consistent state. As far as i understand it, design by contract goes this way : if you do not ensure state prerequistes are met before calling the methods, you break the contract, so you are at fault.
Problem is, as you can easily guess, these methods are likely to be called in the views to display the results of calculations. I don't find having to throw a bunch of conditionals in my views entirely satisfying...
Thoughts ?

A:

Looks like your class has two separate responsibilities:

validating a set of fields (fields can be in an inconsistent state)
performing calculations on these fields (fields must be valid)

Therefore I would split it up into two classes:

The ActiveRecord could still take care of the validation and other ActiveRecord stuff.
All the tax calculations though would happen in say TaxCalculator, which initializes all its fields from a validated ActiveRecord that's passed in from a constructor, so all the methods of it can blindly assume that the fields are OK.


Q:

How to change AnimationTimer speed?

I use AnimationTimer for several tasks like animation with changing pictures and ProgressIndicator animation. To achieve needed speed I put thread to sleep, but when several animations are running simultaneously they affect each others speed. Is there any other way to change speed of AnimationTimer? Code sample:
private void initialize() {
 programButtonAnimation=new AnimationTimer(){
            @Override
            public void handle(long now) {
                    showClockAnimation();
            }
        };
 programButtonAnimation.start();
}

private void showClockAnimation(){
    String imageName = "%s_"+"%05d"+".%s";
    String picturePath="t093760/diploma/view/styles/images/pink_frames/"+String.format( imageName,"pink" ,frameCount,"png");
    programButton.setStyle("-fx-background-image:url('"+picturePath+"')");
    frameCount++;
    try {
        Thread.sleep(28);
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    if(frameCount>=120){
        programButtonAnimation.stop();
        frameCount=0;
    }
}

A:

The AnimationTimer's handle method is invoked once for each frame that is rendered, on the FX Application Thread. You should never block that thread, so do not call Thread.sleep(...) here.
The parameter passed to the handle(...) method is a timestamp, in nanoseconds. So if you want to throttle updates so they don't happen more than once every, say 28 milliseconds, you can use this to do so:
private void initialize() {
 programButtonAnimation=new AnimationTimer(){

            private long lastUpdate = 0 ;
            @Override
            public void handle(long now) {
                    if (now - lastUpdate >= 28_000_000) {
                        showClockAnimation();
                        lastUpdate = now ;
                    }
            }
        };
 programButtonAnimation.start();
}

private void showClockAnimation(){
    String imageName = "%s_"+"%05d"+".%s";
    String picturePath="t093760/diploma/view/styles/images/pink_frames/"+String.format( imageName,"pink" ,frameCount,"png");
    programButton.setStyle("-fx-background-image:url('"+picturePath+"')");
    frameCount++;
    if(frameCount>=120){
        programButtonAnimation.stop();
        frameCount=0;
    }
}

A:

Since I already wrote the code and James_D was faster with informing you about you blocking the UI, I still like to add that if you have multiple AnimationTimers of different timings you should create a dedicated class for that. If each of them runs at a different speed, you could implement it like that:
import javafx.animation.AnimationTimer;

public abstract class AnimationTimerExt extends AnimationTimer {

    private long sleepNs = 0;

    long prevTime = 0;

    public AnimationTimerExt( long sleepMs) {
        this.sleepNs = sleepMs * 1_000_000;
    }

    @Override
    public void handle(long now) {

         // some delay
        if ((now - prevTime) < sleepNs) {
            return;
        }

        prevTime = now;

        handle();
    }

    public abstract void handle();

}

Which means that the handle() method is invoked at least after sleepMs milliseconds have passed.
Or you change the parameter and specify the fps, whatever you need.
You can use the above code like this:
AnimationTimerExt timer = new AnimationTimerExt(100) {

    @Override
    public void handle() {

        System.out.println( System.currentTimeMillis());

    }
};

timer.start();

Also, loading the picture over and over again is not the best choice. If you'd like to do animations, I suggest you take a look at Mike's Blog about Creating a Sprite Animation with JavaFX.


Community-based care: an alternative to institutionalization.
By focusing on the deinstitutionalization of the physically, mentally, and developmentally impaired, the public's attention is too frequently diverted away from the greater need for the development of community-based services.


Hey, I just spent hours typing an essay for school to find out my floppy drive is acting silly. I can't think of another way to get it to school, other than burn it to a CD. I would prefer NOT to waste an entire CD on 12kb of text lol! If you have any suggestions, please feel free to toss em at me.

It could be the "floppy" disk. If sector 0 gets damaged the "floppy" will stop working.. Never keep "floppies" near cordless phones, microwaves, TVs, or your monitor. They don't last too long when they obtain interference.


Q:

Make liferay portlet non instanceable

How can I make my portlet non instanceable accross the liferay instance. I have read about it in the forum but there was no mention of how to do it.

A:

You can specify a portlet as non instanceable by putting
<liferay-portlet-app>
    ...
    <portlet>
        ...
        <instanceable>false</instanceable>
        ...
    </portlet>
    ...
</liferay-portlet-app>

in the file
liferay-portlet.xml
Beware of the right order of tags, according to the dtd (linked the dtd version 5.2, shouldn't have changed much though)
Also have a look here
Liferay docu


Pulse consumption in Canadian adults influences nutrient intakes.
Pulses (dry beans, peas, lentils) are nutrient-dense foods that are recommended as good choices in either the vegetable or meat and alternative food groups in Canada's Food Guide. To examine the prevalence and the effect of pulse consumption on nutrient intake in Canadian adults ( ≥ 19 years), we analysed cross-sectional data (n 20,156) from the 2004 Canadian Community Health Survey, Cycle 2·2. Participants were divided into non-consumers and quartiles of pulse intake. Sample weights were applied and logistic regression analysis was used to explore the association of nutrient intakes and pulse consumption, with cultural background, sex, age and economic status included as covariates. On any given day, 13 % of Canadians consume pulses, with the highest consumption in the Asian population. The pulse intake of consumers in the highest quartile was 294 (se 40) g/d and, compared with non-consumers, these individuals had higher intakes of carbohydrate, fibre and protein. As well, the micronutrient intake of pulse consumers was enhanced, resulting in fewer individuals who were below the estimated average requirement for thiamin, vitamin B6, folate, Fe, Mg, P and Zn, compared with non-consumers. Although pulses are generally low in Na, its intake also was higher in pulse consumers. Among the higher quartiles of pulse consumers, fruit and vegetable intake was one serving higher. These data indicate that pulse consumption supports dietary advice that pulses be included in healthful diets. Further studies elucidating the sources of increased Na in pulse consumers will be necessary so that dietary advice to increase consumption of pulses will maximise their nutritional benefits.


Comparison of sevoflurane volatile induction/maintenance anaesthesia and propofol-remifentanil total intravenous anaesthesia for rigid bronchoscopy under spontaneous breathing for tracheal/bronchial foreign body removal in children.
Foreign body aspiration is a life-threatening condition, with children under 3 years of age most at risk. This study was designed to compare the clinical characteristics of sevoflurane volatile induction/maintenance anaesthesia (VIMA) and propofol-remifentanil total intravenous anaesthesia (TIVA) for children undergoing rigid bronchoscopy under spontaneous breathing for tracheal/bronchial foreign body removal. Sixty-four children undergoing rigid bronchoscopy were allocated randomly to receive sevoflurane (Group VIMA; n = 32) or propofol-remifentanil (Group TIVA, n = 32) between 2007 and 2009. Respiratory rate, heart rate and mean blood pressure were compared at the time points including baseline level (T 0); laryngoscopy (T lary); insertion of rigid bronchoscope (T bron); 5, 10 and 20 min during procedure (T 5 min, T 10 min, T 20 min); the end of procedure (Tend) and discharge (T dis). Induction time, emergence time, intubating condition scores and the incidence of adverse events were compared. Time for loss of consciousness (Group VIMA 95.6 ± 15.2 s vs. Group TIVA 146.2 ± 26.9 s, P < 0.05), time of Bispectral Index value decreased to 40 (Group VIMA 115.3 ± 16.5 s vs. Group TIVA 160.4 ± 25.8 s, P < 0.05) and emergence time (Group VIMA 10.5 ± 2.6 min vs. Group TIVA 16.9 ± 3.1 min, P < 0.05) in Group VIMA were significantly shorter than those in Group TIVA. Intubating condition scores between the two groups were comparable (8.1 ± 0.9 in Group VIMA vs. 8.1 ± 1.0 in Group TIVA). The incidence rates of breath holding (Group VIMA 6.25% vs. Group TIVA 31.25%, P < 0.05) and desaturation (Group VIMA 15.63% vs. Group TIVA 37.50%, P < 0.05) in Group VIMA were significantly lower than those in Group TIVA. Heart rate, mean blood pressure and respiratory rate were significantly higher in Group VIMA than in Group TIVA. Compared with propofol-remifentanil TIVA, sevoflurane VIMA provides more stable haemodynamics and respiration, faster induction and recovery and higher incidence of excitement in paediatric patients undergoing tracheal/bronchial foreign body removal under spontaneous breathing.


Čilić in Doubt for Australian Open

Usually in the first week of January you would find Croatian tennis star Marin Čilić in the sun down under in Australia preparing for the year’s first Grand Slam, but on Friday the US Open champ was in a very cold Zagreb…

Čilić, who was in Zagreb at a press conference ahead of this month’s Zagreb Indoors tournament (31 January – 8 February), said that a niggling shoulder injury may force him out of Australian Open in Melbourne which starts in just over a fortnight.

“My shoulder is bothering me. I will have to test it a few more times to see if I will be able to play at all in the Australian Open,” said the World Number 9, adding that he will not risk further injury to his shoulder that could rule him out for a longer period, and that he will have to be 100% fit to take part in Melbourne.


Q:

Get the sum by file extensions in python

Newbie question here!
I'm trying to get the sum of file sizes by file extension in a directory. So far I'm using a modified version of this (via Python - Acquiring a count of file extensions across all directories) to count them.
Trying to use os.path.getsize() then use sum() to add them up, but I either get zero or errors.
What am I missing?
The code I copied is this:
import os
import collections
extensions = collections.defaultdict(int)

place = input('Type the directory path: ')

for path, dirs, files in os.walk(place):
   for filename in files:
       extensions[os.path.splitext(filename)[1].lower()] += 1

for key,value in extensions.items():
    print ('Extension: ', key, ' ', value, ' items')

A:

Did you try this?
import os
import collections
extensions = collections.defaultdict(int)
size = collections.defaultdict(int)

for path, dirs, files in os.walk('/'):
   for filename in files:
       extensions[os.path.splitext(filename)[1].lower()] += 1
       size[os.path.splitext(filename)[1].lower()] += os.path.getsize(path+os.sep+filename)

for key,value in extensions.items():
    print 'Extension: ', key, ' ', value, ' items'

for key,value in size.items():
    print 'Extension: ', key, ' ', value, ' size'

this is based on your link


using CIIP.Module.BusinessObjects.SYS.Logic;
using DevExpress.Data.Filtering;

namespace CIIP.Designer
{
    public static class BusinessObjectQuickAddExtendesion
    {
        #region quick add
        public static Property AddProperty(this BusinessObject self,string name, BusinessObjectBase type, int? size = null)
        {
            var property = new Property(self.Session);
            property.PropertyType = type;
            property.Name = name;
            if (size.HasValue)
                property.Size = size.Value;
            self.Properties.Add(property);
            return property;
        }

        public static Property AddProperty<T>(this BusinessObject self,string name, int? size = null)
        {
            return self.AddProperty(name,
                self.Session.FindObject<BusinessObjectBase>(new BinaryOperator("FullName", typeof(T).FullName))
                , size
                );
        }

        //public static CollectionProperty AddAssociation(this BusinessObject self, string name, BusinessObject bo, bool isAggregated,Property relation)
        //{
        //    var cp = new CollectionProperty(self.Session);
        //    self.Properties.Add(cp);
        //    cp.PropertyType = bo;
        //    cp.Name = name;
        //    cp.Aggregated = isAggregated;
        //    //cp.RelationProperty = relation;
        //    return cp;
        //}

        #endregion
    }
}


Having trouble starting tractor. When starting the tractor I turn on the switch, advance the throtle about 1/3 and pull the starter and pull the choke. Starter does its job but does not fire. After 2 or 3 tries, I pull the throtle back to minimum. I try again but when I let go of the starter there is a single cylinder firing. If I can respond quick enough and advance the throtle only one or two notches it sometimes will fire to more cylinders. After it has been running (warmed up) it most often will start normally. About 2 years ago, I changed the electric system from 6 volt to 12 volt, but I had to install an "Exciter Button" and everything has worked fine until about 6 months ago. Now I have to re-charge the battery before starting. I can't find anything wrong. Any help would be appreciated.I hope I did this right. This is my first time posting anything.

its possible that you have some sticking valves (old gas). I had one do the same thing and found that the valves were sticking enough to cause these issues and once it "did" start it would run ok. then once it sat for a while and cooled off, the varnish would set up again and valves would stick. I put some seafoam in the engine oil and fuel tank.ran it for awhile and problems ceased. just a thought.

Need more information on the "exciter" problem. Alternator used? How wired? Following is a link to a common Delco 10SI alternator conversion. Battery discharging is a common fault in that the wires are mixed up on terminals 1 and 2 - and or a diode or resistor not used in the #1 terminal wire.

Edit: Charging battery problem. Charge up battery and have checked at auto parts store. If battery is still good you will need to start checking for a short, the battery drain, when engine not running. Previously thought "exciter" button was not disconnecting after energizing alternator, which still could be the problem.

Question. Did you install a resistor in line with the coil, or coil with internal resistor, when converted to 12 volts?

Last edited by Eugene on Thu Jan 10, 2013 5:08 am, edited 1 time in total.

hayseed235 wrote:when I let go of the starter there is a single cylinder firing

This suggests that there is a problem in the ignition system. It could be that there is not enough current getting through to run both the starter and give enough to the coil for a spark. Or, there could be a problem in the ignition system itself (points, condensor, etc.) When the starter stops drawing, then you get a good enough spark, or enough current to overcome a weak ignition component.

I had these symptoms more than once. One time it turned out to be a weak battery, another time it was old plugs.

Michael CummingsEddie - a 1959 International Lo-Boy named after my father in law, who who bought her new.


/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.permissioncontroller.role.ui;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.NonNull;

/**
 * Dummy activity in place of
 * {@link com.android.permissioncontroller.role.ui.specialappaccess.SpecialAppAccessActivity}
 */
public class SpecialAppAccessActivity extends Activity {

    /**
     * Create an intent for starting this activity.
     */
    @NonNull
    public static Intent createIntent(@NonNull String roleName, @NonNull Context context) {
        return new Intent(context, SpecialAppAccessActivity.class);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        finish();
    }
}


Girl, 16, wounded in South Side shooting in Heart of Chicago neighborhood

A16-year-old girl is in stable condition Tuesday after being shot in the upper chest. Witnesses say she was simply walking with a friend down a sidewalk when the gunfire began.

March 18, 2014 9:07:46 PM PDT

March 18, 2014 (CHICAGO) --

A teenager was shot in the chest while walking on the city's South Side in the Heart of Chicago neighborhood.

A16-year-old girl is in stable condition Tuesday after being shot in the upper chest. Witnesses say she was simply walking with a friend down a sidewalk when the gunfire began.

On Tuesday night, bullet holes mark the spot where the shooting ended this food market that was full of customers.

"It was like one after another. Like he was standing literally outside, and I was looking at him. And he was shooting inside," said Norma Yanez, store employee.

It happened around 4 p.m. Tuesday afternoon at the corner of 18th and Wood.

Witnesses say it began with a foot chase, the teenage gunman firing at another young man. As they ran east on 18th Street, a stray bullet instead hitting a 16-year-old girl in the upper chest.

"She looked stable. She didn't look like she was, like with her eyes closed and wasn't moving," said Federico Yanez, witness.

"She was lying down on the stairway. So she was responsive, but yet in pain," said Sonia Yanez, owner, Meztisoy Food Market.

But the shooting didn't stop. Store employee Norma Yanez was outside, a bullet whizzing by her head.

"Some guy was coming towards me shooting, so I came into the store. And then the guy they were shooting at came in after me," said Norma Yanez.

After the man who was the intended target ran into the store, the gunman stood outside firing a handful of shots through the window. The bullets hitting this sign, a coffee machine and other items on a front table, but missing the 15 or so people in the store.

"He was thinking about coming in, but he ran off," said Sonia Yanez.

"I just didn't think it was happening. I didn't think it was happening. I was just like in shock," said Norma Yanez.

Police have not offered a motive for the shooting, but some neighborhood residents believe it may have been gang-related, perhaps retaliation for another shooting that they say happened in the neighborhood Monday.


Alain Resnais, director of 'Hiroshima, Mon Amour', dies aged 91

Reuters Staff

2 Min Read

PARIS (Reuters) - The French film director Alain Resnais, known for classics such as “Hiroshima, Mon Amour”, “Last Year at Marienbad” and the documentary “Night and Fog” about Nazi concentration camps, died on Sunday at the age of 91.

Resnais, who was born in 1922 in northwestern France and started his career with mid-length films in the 1940s, rose to fame with “Night and Fog” and “Van Gogh”, a short that won an Oscar in its category in 1950.

In 1959, with author Marguerite Duras as scriptwriter, he directed “Hiroshima, Mon Amour”, a feature about a love affair between a French woman and a Japanese architect that secured his reputation as a feature-film director.

French President Francois Hollande joined a chorus of condolences for Resnais, described as a highly original and influential film-maker steeped in the pre-war cinema culture of the United States.

Director Alain Resnais reacts after receiving the Lifetime Achievement award during the award ceremony at the 62nd Cannes Film Festival in this May 24, 2009 file picture. REUTERSEric Gaillard/Files

“He constantly broke codes, rules and trends while appealing to a vast audience,” Hollande’s office said in a statement.

The director won a lifetime achievement award at the Cannes Film Festival in 2009, while the Berlin Film Festival awarded him the Alfred Bauer prize for his last film, “Loving, Drinking and Eating”, to be released in France this month.

One of his favorite actors, Pierre Arditi, hailed the director as extremely original.

“There is nothing that less resembles a Resnais film than another Resnais film,” Arditi told BFM TV. “He always tried to avoid copying what he had done before, he didn’t want to use any formula.”

Thierry Fremaux, director of the Cannes Film Festival, hailed a director whose films have influenced generations of film-makers.

“He hit hard from the start with his short films in the 1950s and when the Nouvelle Vague arrived, he was sort of a big brother.”


Synthesis of scroll-type composite microtubes of Mo2C/MoCO by controlled pyrolysis of Mo(CO)6.
Composite microtubes of Mo(2)C/MoCO have been synthesized for the first time under well-controlled conditions by thermal decomposition of Mo(CO)(6) at about 600 degrees C. Here, thermal stability and phase transition of the products, as well as the influence of reaction temperature and argon flow rate, have been carefully investigated. All samples were characterized by X-ray powder diffraction (XRD), scanning electron microscopy (SEM), and X-ray photoelectron spectroscopy (XPS). The reaction model and rolling mechanism were proposed on the basis of the experimental facts.


Q:

How long had Box been running amok when Logan discovered him?

Originally, in Logan's Run, the killer robot "Box" was programed to freeze and store sea food. How long had the abandoned "Box" been been running amok when encountered by Logan 5 and Jessica 6 in the Logan's Run franchise?

A:

I'm not sure we have any way to arrive at a clear answer from the evidence of the movie. I'm not sure it's even clear whether Box predates the City or not -- it's been a while since I've seen it and I've already read two different interpretations while trying to write this answer (Wikipedia's entry seems to suggest that Box was processing food for the city, while The World of Logan's Run seems to believe Box predated the City and was more or less left to his own fate when the City was created).
I'm also not sure that "running amok" is quite right. It implies an active rampage, whereas in the movie, people come to him, believing they're fleeing to safety!

A:

Box' original purpose was to freeze and preserve food for storage. "[The food] stopped, and they (the runners) started", it explains. This suggests that the delivery system for the food ended, followed by people escaping the City of Domes.  It's possible that the process he was built for was to (pre)supply the City of Domes, which could explain why there seemed to be a direct route between them, one that seemingly every runner found.
We don't know how long he sat inactive - presumably it was a long time; long enough to make the decision that humans were an acceptable replacement for food in his process.


The Advantage, by Patrick Lencioni

Patrick Lencioni is a well-known management consultant and author, known for books like The Five Dysfunctions of a Team. I haven’t gotten around to reading his books, but somebody recently recommended The Advantage, subtitled Why organizational health trumps everything else in business, so I picked it up.

Lencioni views this book as the synthesis of the work described in his other books – a simple guide to creating more effective organizations. His opening sentence reads:

The single greatest advantage any company can achieve is organizational health. Yet it is ignored by most leaders even though it is simple, free, and available to anyone who wants it.

Lencioni defines organizational health as integrity: “when it is whole, consistent, and complete, that is, when its management, operations, strategy, and culture fit together and make sense.” In other words, even if an organization hires all of the smartest people, it will not be able to effectively use them without making sure they are all aligned and pulling together in the same direction. The leaders of the organization also need to be able to receive the intelligence and wisdom from their people, and not waste the teams’ efforts by working at odds to each other. In other words, the opposite of a healthy organization is what we all deride as corporate politics, and none of us want to be part of such an organization.

The deceptively simple aspect is that I read this book and said “Yes, that all makes sense”, but then realized I have never been part of an organization that consistently prioritizes and executes these health initiatives. And even when I have been part of the management team, I do not prioritize these, instead getting distracted by the fire drill du jour. So this book is a reminder to focus on these important basics, rather than the urgent distractions.

Step 1 is to build a cohesive leadership team. Lencioni believes that an effective leadership team must be small enough (3-10 people) so that each member feels personally responsible for the success of the whole organization. Some behaviors he describes of such a leadership team are:

Trust and vulnerability – being able to make mistakes and discuss them so everybody can improve.

Constructive conflict – if difficult decisions need to be made, all sides of the issue must be discussed vigorously and without rancor, which can’t happen without the trust established above.

Collective accountability – once decisions are made, all take responsibility for executing on the decision, even if they argued against the decision.

Focusing on organization results – success is defined as the whole organization succeeding, not just a particular department. There should be no situation where sales can say “My team did its job” if the organization did not hit its goals.

Once the leadership team is established, then the next step is to Create Clarity on what the organization is for, and what it is focused on. Lencioni outlines six questions which every organization should be able to answer:

Why do we exist? (mission)

How do we behave? (no more than 3 differentiating core values)

What do we do?

How will we succeed? (what is our strategy and differentiator?)

What is most important, right now? (what is our thematic goal? What defining objectives are necessary to achieve that goal? What metrics will show progress towards those objectives?)

Who must do what?

What I particularly like about Lencioni’s formulation is that if the leadership team can reach clarity on the answers to these questions, they can write down the whole vision for the organization on a single page, which Lencioni calls the organizational playbook. He suggests having the playbook be available in every meeting to review how actions being considered in the meeting align with the overall mission, values and strategy.

Once the leadership team is aligned, and the playbook is defined, it still remains to ensure that the entire organization is informed and aligned with the playbook. This is step 3, Overcommunicate Clarity. Lencioni notes that what feels like overkill repetition by the leaders is probably the minimum required communication for organization members to internalize the message. Each member of the leadership team should be able to articulate why it makes sense, and what their team has to do to execute on the vision. I once worked for a VP at Google who started each monthly all hands meeting with a slide of the same three metrics, and a plea for anybody on the team working on something that wasn’t focused on improving one of those metrics to contact her personally so she could sort out the misalignment. It was extremely powerful in driving agreement across the team on what mattered.

Such misalignments across the organization detract from clarity, which brings us to step 4, Reinforce Clarity. Lencioni is making the point that every structure and process within the company must also reinforce the playbook. For instance, if the playbook says that one of the core values is teamwork, but performance review and bonuses are awarded individually, that’s a misalignment. If core values are not included as part of the interview process, that’s a misalignment. The organization must live and breathe its values and playbook to be effective and healthy, and part of what the leadership team must do is drive consistency across all aspects of the company. Any discordant element can destroy the synergistic effects of organizational health.

One last great point that Lencioni made was that organizational health starts at the top. A cohesive leadership team will never develop trust, vulnerability, and accountability unless the leader/CEO goes first. And a CEO that doesn’t trust his or her people will never want to create and disseminate clarity in the way Lencioni describes. This reminds me of something that Patrick Pichette (former CFO of Google) once said: “Your CEO is your culture” – the person at the top sets the tone for the whole organization. His point was that an important consideration when deciding whether to take a job is how you align with the CEO’s values, because their values will set the culture.

I liked this book for having a clear, simple plan for improving organizational health. When I’ve been on healthy teams, I’ve seen elements of what Lencioni describes, and it makes a huge difference in making each team member more productive and effective. And yet, I have rarely seen this sort of clarity from a leadership team – I suspect that it almost seems like a waste of time to focus on these basics when there are more urgent and complex matters to address. Lencioni suggests the leadership team should be doing an offsite once a quarter to review and update the playbook, as he feels creating clarity for the organization is one of the most important and valuable responsibilities of the leadership team. I suspect he might be right, and I will be thinking how I can incorporate these ideas into the work I do.

As homework for my coaching certification program, I wrote up this book as a resource for coaching, and was intrigued by how easily these practices for organizational health map to individual health.

I believe that we, as individuals, are often like organizations in the sense that we are not “whole, consistent, and complete”. We say we have one set of values, but act in a way that is contrary to those values sometimes, and are in relationships that pull us in different directions. Learning to act congruently such that we are whole and consistent and say what we mean is one of the reasons that I believe people need coaching. So I think there is an opportunity here to apply the principles of organizational health from this book to the individual to improve their ability to act congruently.

Lencioni posits that a healthy organization has a leadership team that behaves with four characteristics, and I’ll explain how I think these can apply to the individual.
— Trust and vulnerability – we must trust ourselves, and be willing to be vulnerable and admit our shortcomings before we can address and improve upon them
— Constructive conflict – we must consider potential outcomes without giving in to our Inner Critic that tears us down without providing constructive input
— Collective accountability – we must hold ourselves accountable for our decisions, and not let part of ourselves (even an unconscious part) undermine carrying out those decisions
— Focusing on results – similar to the above

The six questions to Create Clarity map cleanly for individuals – I just did the exercise for myself, and it was helpful to write down my mission, values, and current priorities.

Overcommunicating Clarity can apply in two ways to individuals. One is journaling daily to see how we are doing relative to the plan we outlined and the answers to the six questions. The other is overcommunicating that plan to others – for instance, I’ve started to introduce myself as a coach at social gatherings rather than as a business strategy analyst, and that is helping to reinforce a new vision for myself.

Reinforcing Clarity also applies to individuals, in creating new practices and processes for ourselves that help us achieve our vision. It can also apply in ending old relationships and starting new relationships that are more in line with our newfound Clarity.

Anyway, I thought it was interesting to see that these principles can apply almost directly to individuals as well as organizations.