Paul M. Jones

Don't listen to the crowd, they say "jump."

Aura.Micro: Experimental Replacement for Silex

Stan Lemon writes on the Aura Project for PHP 5.4+ blog about an experiment he's trying:

I was recently working on a small project that used Silex. As I browsed my vendor folder, I realized how much extra “stuff” I had inherited with Silex. There were a bunch of other components required when all I wanted was some quick and easy routing, micro-framework style.

When I think about going lean I always find myself coming back to Aura. Micro-frameworks are not a new to idea to Aura, so I wondered if I could take the elegance and ease of Silex by wrapping up Aura.Router and exposing it through a similar API. The result is Aura.Micro, a light wrapper for Aura.Router to get a Silex-style API.

Read the whole thing here: Aura.Micro -- Experimental Replacement for Silex.


Unions Begin Long War After Stunning Blow in Michigan

Labor has two options now that its ability to extract mandatory dues from workers as a condition for employment is gone. It can fight the law or try to persuade workers to voluntarily pay up.

Union bosses aren't accustomed to the second approach, so until the next elections in 2014 they can be expected to try everything to overturn the law and to stop the right-to-work fever from spreading to neighboring states.

via Unions Begin Long War After Stunning Blow in Michigan - Bloomberg.


Assaulted By Union Thugs In Michigan

Video here: http://www.youtube.com/watch?feature=player_embedded&v=u_F3oev06i0

ASSAULTED BY UNION THUGS IN MICHIGAN. Crowder emails: “The video is self explanatory. I was sucker-punched 4 times on camera, without retaliation, choked, and the AFP tent is torn to the ground with women and children inside of it. Extremely violent footage. Please post for truth.” It’s also rich listening to the union guy yell about “parasites” and “freeloaders.” Don’t they know those words are racist?

The video shows numerous union representatives engaging in violent, illegal conduct. Their faces are clearly identifiable. I hope they will be prosecuted, and sued.

And will President Obama condemn this violent behavior?

If this was the Tea Party, it would be evidence of their violent extremist nature. Via Instapundit » Blog Archive » STEVE CROWDER SENDS THIS FOOTAGE OF HIM BEING ASSAULTED BY UNION THUGS IN MICHIGAN. Crowder emails:….


Civil Rights Victory: Federal appeals court tosses state ban on carrying concealed weapons

In a huge win for gun-rights groups, a federal appeals court in Chicago Tuesday tossed the state's ban on carrying concealed weapons and gave Illinois' Legislature 180 days to craft a law legalizing concealed carry.

"The debate is over. We won. And there will be a statewide carry law in 2013," said Todd Vandermyde, a lobbyist for the National Rifle Association.

In a split opinion, the 7th Circuit Court of Appeals reversed a lower court ruling in two cases downstate that upheld the state's longstanding prohibition against carrying concealed weapons.

via Big win for gun-rights groups: Federal appeals court tosses state ban on carrying concealed weapons - Sun-Times Politics.


Aura: More Decoupled Than Symfony 2 and Zend Framework 2

The guys at PHPMagazin have posted a followup question about the Aura Project for PHP. Here is our original English conversation.


I'd like to follow up on the last point where we talked about other frameworks. I think that the second generations of symfony and Zend Framework have gone through a huge decoupling process. This becomes evident when you look at symfony2 components being used in Drupal 8 or web tutorials which show you mixed use of zend- and symfony components.

So I think we could elaborate further on that last bullet point we discussed. Does the above change your angle in this regard?

Not in this case. Being able to use Symfony2 components or ZF2 modules is not quite the distinction I am making. The distinction is that all Aura packages (with the exception of the Framework package) are completely independent, and have no cross-package dependencies, whereas at least some of the components from Symfony2 and ZF2 have dependency requirements.

By way of comparison, let's examine something that ought to be relatively straightforward: input validation and filtering. We'll start with ZF2, then move on to Symfony2, and end with Aura. In each case, we will try to download the package and run its tests; this should be a good indicator of whether or not the package can be used independently. We will discover that you can't do it at all with ZF2, you can kind of do it with Symfony2, and that it's trivially easy with Aura.

Zend Framework 2

Let's start by downloading the ZF2 InputFilter package. It doesn't appear to be available for download by itself -- there is the main ZF2 repository at Github https://github.com/zendframework/zf2 but that's the whole framework, not just the InputFilter.

OK then, we can at least use Composer to incorporate the InputFilter into a project. We will set up a Composer file per the ZF2 instructions and install the InputFilter package. Our composer.json file looks like this:

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.zendframework.com/"
        }
    ],
    "require" : {
        "zendframework/zend-inputfilter" : "2.0.*"
    }
}

After downloading Composer into the same directory, we run the installer, and this is what we see:

$ ./composer.phar install
Loading composer repositories with package information
Installing dependencies
  - Installing zendframework/zend-stdlib (2.0.5)
    Downloading: 100%

  - Installing zendframework/zend-servicemanager (2.0.5)
    Downloading: 100%

  - Installing zendframework/zend-filter (2.0.5)
    Downloading: 100%

  - Installing zendframework/zend-i18n (2.0.5)
    Downloading: 100%

  - Installing zendframework/zend-validator (2.0.5)
    Downloading: 100%

  - Installing zendframework/zend-inputfilter (2.0.5)
    Downloading: 100%

zendframework/zend-stdlib suggests installing pecl-weakref (Implementation of weak references for StdlibCallbackHandler)
zendframework/zend-servicemanager suggests installing zendframework/zend-di (ZendDi component)
zendframework/zend-filter suggests installing zendframework/zend-crypt (ZendCrypt component)
zendframework/zend-validator suggests installing zendframework/zend-db (ZendDb component)
zendframework/zend-validator suggests installing zendframework/zend-math (ZendMath component)
Writing lock file
Generating autoload files
$

In order to use input filtering from ZF2, six other packages are required, and a few others are suggested.

Now that we've installed it, where are the tests? They're not provided with the Composer package, although I suppose they are available with the framework as a whole. It appears the Zend offering is not entirely self-contained.

(If we look closely, we see that InputFilter is composed of at least two other packages that might suit our needs, zend-filter and zend-validator. However, when you examine them, they're not comparable to Aura.Filter and Symfony2 Validator.)

Symfony 2

Let's do the same thing with Symfony. This time it is downloadable through Github: https://github.com/symfony/Validator

Let's clone the package and run the tests.

$ git clone https://github.com/symfony/Validator.git
Cloning into Validator...
remote: Counting objects: 3459, done.
remote: Compressing objects: 100% (672/672), done.
remote: Total 3459 (delta 2708), reused 3451 (delta 2700)
Receiving objects: 100% (3459/3459), 621.73 KiB | 730 KiB/s, done.
Resolving deltas: 100% (2708/2708), done.
$ cd Validator/Tests/
$ phpunit
[phpunit fails]

It appears we can't just download the package and run the tests. The README states we need to use Composer and install all the --dev dependencies, so we'll do that. First we download Composer into the cloned repo, then:

$ ./composer.phar install --dev
Loading composer repositories with package information
Installing dependencies
Nothing to install or update
Loading composer repositories with package information
Installing dev dependencies
  - Installing symfony/yaml (dev-master bed4fdd)
    Cloning bed4fddc24392513e01b32a78d600b1272ed9a6c

  - Installing symfony/locale (dev-master 2dceded)
    Cloning 2dcededb060dfb6289ad8bb3f2a7a4e00929c4dc

  - Installing symfony/http-foundation (dev-master 067c310)
    Cloning 067c310fe4d0691a24adc97f39500233a58e42cb

Writing lock file
Generating autoload files

Interesting: in order for the tests to run we need three other packages. It looks to me like there are cross-package dependencies. Examining the codebase reveals this to be true:

  • If you want to use the YAML loader included with the Validator, you need that YAML package after all.

  • If you want to validate against anything related to locales or languages, you need the Locale package. For example, the LangaugeValidator.php file makes a static call to SymfonyComponentLocaleLocale::getLanguages().

  • If you want to use Annotations with the Validator, it looks like you need Doctrine, which isn't a part of the Symfony vendor hierarchy at all. Goodness knows what that will require.

Anyway, now we can run the tests; I have omitted the test progress output.

$ phpunit
PHPUnit 3.7.9 by Sebastian Bergmann.
...
Time: 8 seconds, Memory: 17.75Mb

OK, but incomplete or skipped tests!
Tests: 987, Assertions: 1091, Skipped: 12.
$

12 tests have to be skipped because of missing dependencies. When we run phpunit --verbose we discover that:

  • 3 tests are skipped are because APC is not loaded for the command line, which is not such a big deal;

  • 6 are skipped because "The Doctrine Common library is not available";

  • 3 are skipped because "Annotations is required for this test".

As with the ZF2 InputFilter component, it looks like the Symfony2 Validator component is not entirely self-contained. It has external dependencies that must be fulfilled in order for it to be fully useful.

Aura.Filter

Finally, we have the Aura.Filter package. It is downloadable through Github at https://github.com/auraphp/Aura.Filter. Let's try to clone it and run the tests; I have again omitted the test progress output.

$ git clone git@github.com:auraphp/Aura.Filter.git
Cloning into Aura.Filter...
remote: Counting objects: 1105, done.
remote: Compressing objects: 100% (373/373), done.
remote: Total 1105 (delta 631), reused 1076 (delta 602)
Receiving objects: 100% (1105/1105), 725.94 KiB | 606 KiB/s, done.
Resolving deltas: 100% (631/631), done.
$ cd Aura.Filter/tests/
$ phpunit
PHPUnit 3.7.9 by Sebastian Bergmann.

Configuration read from /Users/pmjones/Aura.Filter/tests/phpunit.xml
...
Time: 4 seconds, Memory: 9.75Mb

OK (1009 tests, 1443 assertions)
$

No external dependencies, and nothing extra is needed for the tests to run. The package is completely self-contained, independent, and decoupled. Now compare the memory use and time taken to that of Symfony2: about half the memory used, and about half the time taken, to complete about 30% more assertions in the tests. (Incidentally, we have 100% test coverage of the source classes, but I don't know how that compares to Symfony and Zend.)

Conclusion

None of the above is to meant to say that Zend Framework or Symfony2 are poorly architected, not useful, or any other negative thing. They are good projects, and the components appear to be good too.

The only thing I am saying is that their offerings of separate components are not always very well decoupled. This is because they started with a framework and tried to extract pieces from it. (To be fair, some components from both of those projects really are dependency-free, but not all of them.)

But in Aura, with its "libraries first" approach, every package is truly decoupled, independent, and self-contained, with zero cross-package dependencies. That is the major difference I want to emphasize.


How To Behave At A Funeral

I understand funerals can be awkward for those not directly grieving, but over-exaggerating your pretend sadness is of no benefit to anyone, it merely obligates the survivors to manage your fake concern.  If you feel compelled to speak in all caps or explain how terrible this all is to a person who knows first hand and way better than you how terrible it all is, don't.  Stay home.  When you find yourself in the presence of mourning, simply say,  "I'm sorry for your loss.  If there's anything I can do for you, please let me know," and if he happened also to have been a great man you can add, "he was a great man," then bow your head and fade to back.   That's all that's necessary.  The system will take care of the rest.

via The Last Psychiatrist: Funeral.


Government-Caused Inequality

Something else is odd about the sociology of the anti-inequality crowd. They seem to be unfazed by inequality created by government.

Take the recent Powerball outcome. At $588 million, it was the largest lottery prize in history ? to be shared by two ticketholders. In essence, hundreds of millions of dollars are being transferred from mostly low-income families in order to create a few super rich individuals.

via The Anti-Capitalist Mentality | John Goodman's Health Policy Blog | NCPA.org.


I Am The Eye In The Sky, Looking At You

Today EFF posted several thousand pages of new drone license records and a new map that tracks the location of drone flights across the United States.  These records, received as a result of EFF’s Freedom of Information Act (FOIA) lawsuit against the Federal Aviation Administration (FAA), come from state and local law enforcement agencies, universities and--for the first time--three branches of the U.S. military: the Air Force, Marine Corps, and DARPA (Defense Advanced Research Projects Agency).

Perhaps the scariest is the technology carried by a Reaper drone the Air Force is flying near Lincoln, Nevada and in areas of California and Utah. This drone uses "Gorgon Stare" technology, which Wikipedia defines as “a spherical array of nine cameras attached to an aerial drone . . . capable of capturing motion imagery of an entire city.” This imagery “can then be analyzed by humans or an artificial intelligence, such as the Mind's Eye project” being developed by DARPA.

via Vox Popoli: Federal spies in the sky.


Blaming the Person Offering you the Best Deal

I saw a woman on Stossel tonight who works for McDonald's. She said she was paid $8 an hour, but felt she deserved $15. I thought: Wait a minute, McDonald's isn't the only company not paying you $15 an hour: neither you nor I are aware of anyone willing to pay you that much. So why is your problem with McDonald's?

via Blaming the Person Offering you the Best Deal, David Henderson | EconLog | Library of Economics and Liberty.


Tennessee will not set up Obamacare exchange

Gov. Bill Haslam announced Monday that Tennessee will not set up its own health insurance exchange under the Affordable Care Act.

Haslam said in a speech to Nashville’s Downtown Rotary Club that he’s decided not to set up an exchange because he’s received insufficient information about how it would operate from the federal government. In just the last month, officials in Washington have released more than 800 pages worth of draft regulations, Haslam said, leaving him unclear whether Tennessee would be better off operating its own exchange or leaving the task to the federal government.

“I'm more and more convinced that they are making this up as they go,” Haslam said. “We weren’t told enough to be able to run this on our own.”

The decision comes days after tea party groups rallied near the state Capitol to oppose a health insurance exchange. Speakers, including a few Republican lawmakers, said Tennessee should block the exchange to send a message that the state continues to oppose the Affordable Care Act.

Right on. Via Haslam says Tennessee will not set up health care exchange | The Tennessean | tennessean.com.