Links to know aboutMusic The Chiara String Quartet Chiara Quartet (MySpace) Greenwood Music Camp UNL School of Music PHP PEAR Installer Manifesto phpDocumentor PEAR phar docblock PHP_Parser PHP_Parser_DocblockParser PHP_ParserGenerator PHP_LexerGenerator PEAR_PackageFileManager PHP_Archive Games_Chess Blogs Joshua Eichorn Paul M. Jones Davey Shafik Popular EntriesSetting up your own PEAR channel with Chiara_PEAR_Server - the official way
(32) Do you develop a website? It is infinitely better to synchronize live and development sites using the PEAR Installer(25) doing the PEAR thing(19) Using PEAR 1.4.0 to install PEAR packages on a remote host(19) PEAR now fits in a bottle: meet go-pear.phar(17) CategoriesSyndicate This BlogPowered by |
Sunday, June 28. 2009How to manage all that noise? Where PHP development and chamber music rehearsal meetLately, there have been many well-intentioned but I would contend misguided ideas proposed to handle noise on public programmer mailing lists. The premise is that in fact there are very important messages being drowned out in a chorus of irrelevant messages from ill-informed developers. Warnings of inefficiencies have been tossed about quite a bit as the curse of "bike shedding." To understand what they mean by "bike shedding," one must know the bike shed parable. Once upon a time, a group of people got together to build a nuclear reactor to power the city. Everyone in the town said "great, we need more power," and so they got to work designing the plant. Everything was going great, the design of the reactor sailed by until one day, one of the citizens said "hey, let's build a bike shed for the workers so they don't have to come to work in cars and can get exercise." Everyone agreed until an argument broke out over whether to paint the shed blue or red. Eventually, the whole process broke down, and the plant was never built because they couldn't choose a color to paint the bike shed. The moral of the story: everyone agrees on the complex important things, but the process breaks down over arguments about irrelevant details. I think we can all agree that this is a tragic parable, illustrating what happens when the process for decision-making breaks down. When there is a problem of signal-to-noise ratio on a mailing list, the problem has to do with the process for accepting public input, I completely agree with this. However, I am troubled by the implication that having unmoderated mailing lists is the intrinsic problem with open source that must be solved. There is a crucial balance between rewarding quality and being open to the outsider that is the life blood of open source. You could even think of it as the "affirmative action" of the programming world: we recognize that amateur programmers who do not come from the establishment of the temples of programming in academic computer science departments or even computing careers, may have ideas that are better than the most learned highest karma achiever. For my musician reader: Open source thrives on meritocracy: the idea that those who can do junk have more influence than those who can't do as much junk. Karma is the thing with which these individuals are rewarded. Only those with karma are able to actually make changes to the source code. It doesn't matter who you are, or what your background is, if you demonstrate good coding and community, you get karma. String quartet rehearsal is similar, the best ideas get more weight regardless of whether the person who has them is playing the melody. Why am I talking about string quartet rehearsal in a post about moderated programmer mailing lists? I come from a profession (professional chamber music) where "karma" is a fluid object, and unlike the programming world tends to break down when we attempt to nail it down. My string quartet has found that rather than try to decide who will be "the decider" for tough decisions, it's not just friendlier, but is also far more efficient to devote our individual energies to two essential things:
Sometimes they are crackpot, but most of the time, the reason they just seemed crackpot because they were outside the boundaries of our collective imaginations. An example: in our first years together, we occasionally would get into endless arguments in my quartet about whether to play a particular musical section faster or slower (PHP developers: think endless namespace separator arguments). After a long time of arguing about this, it usually turned out that we were asking the wrong question, until one day we would find the right question, which was something like "how long are the phrases?" (PHP developers: the right question turned out to be "how do we solve the ambiguity between static methods and namespaced functions?"). After finding the right question, we stopped arguing nearly as much, and the music sounded much better after we all re-adjusted our thinking. This illustrates an important distinction: the question of how fast to play was not an irrelevant "bike shedding" detail, it was a crucial part of the solution. We still had to choose a speed to play, just as the nuclear power plant people still would need a place to put their bikes. By changing the question from "How fast?" to "How long is the phrase?" we were actually solving the question of what color to paint the bike shed at the same time we solved the question of how to design access to the nuclear reactor, not ignoring it. The best solution is for those with the most karma to use this power to redirect unfruitful arguments towards larger questions that can lead to a more natural solution to the problem, not to limit external input and even conflict. Perhaps the principal designers of the ill-fated hypothetical nuclear power plant would have done better to instead suggest that the bike shed be integrated into the reactor building. This would protect the bikes from the elements, and also require any bike thieves to go through security to get to the bikes - and eliminated the question of what color to paint the shed entirely without ignoring it. It takes hard work and more than a little gut-wrenching conflict to resolve a truly important, difficult problem, and I for one, am willing to tolerate a little noise to find that gem which would otherwise be missed. Monday, April 13. 2009code coverage reporting using PEAR, PEAR2, phar, and sqlite3I've recently become enmeshed in developing Pyrus, PEAR's next generation installer (code coverage is moving up, 20% more coverage than my last blog post). This blog post details my journey in making the process of verifying the correctness of the development via testing and code coverage smoother, exponentially faster and more robust as a result. One of the problems I found when designing the new code for PEAR 1.4.0 (back in the day) was that it was very difficult to determine whether changes would break things. The main problem revolves around the colossal size of the test suite. Because of the complexity of some of the tests (they must download files from a fake internet and then install them into a fake registry and then verify it actually works), the suite takes between 15 and 35 minutes to run, depending on your hardware configuration and PHP version. This is a real problem when trying to develop with any kind of flow. If, after every change, one needs to sit through 35 minutes of tests, one will never develop anything of substance. Thus, typically I ran a subset of the tests, develop quickly, and then do a run of the entire test suite to make sure there are no unintended breaks in the other code. In addition, I had to simply assume that new tests I design actually execute the code in question, as it is not always possible to verify this directly in a passing or failing test. The obvious solution here is to generate a code coverage report and go by that. This, however, still does not fix the problem of accidentally not running tests that are affected by a change, and generating a code coverage report for the entire project is even more time consuming. What to do? There are a couple of solutions. One is to set up a continuous integration server, and simply do minimal testing at home, and then commit-and-hope, fixing issues as they appear. Although this is a process that is used at php.net very successfully (see gcov.php.net), it doesn't fit my needs: I need to know right away whether I am testing the code I intend to test, and whether I am breaking anything else. The solution I am toying with is a step beyond what PHPUnit has to offer currently (yes I am aware of other testing frameworks, for all of you doubters out there, and have nothing against them except that I personally find my development to be more lithe with the phpt test style). PHPUnit offers xdebug code coverage reports, and an option to do some fancy logging, to xml and to a database. PEAR's run-tests command offers xdebug code coverage raw data, saved as a var_export()ed array, but no reporting. PHP's buit-in run-tests.php runner for phpt tests does not offer xdebug code coverage at all. Neither of these solves the problems I mentioned above. What I dream of is a program that can automatically determine what files - test suites or code - have been modified, and automatically run tests that are affected by the changes, and then create a coverage report that I can view instantly. Well, the dream is now a reality. Using a combination of the old and new, it is now possible to do near-instantaneous super-targeted test execution and instant code coverage reporting. There are 4 simple steps and 1 bigger step involved in making this a reality:
Once you have done these four, you need to grab test-modified.php from http://cvs.php.net/viewvc.cgi/pear-core/test-modified.php?view=co&revision=1.4&content-type=text%2Fplain and change the paths for $codepath and $testpath to point at the project you are testing. Next, run test-modified.php --norender. This will run the phpt tests, and create a pear2coverage.db sqlite3 database in the tests directory. Finally, browse to pear2coverage.phar.php in your browser, enter the /full/path/to/pear2coverage.db and voila - a fully working instant coverage report. This setup is the most involved part. As you develop, when you're ready to run tests, simply re-run php test-modified.php --norender, and the tests will be re-run, re-processed, and you will have a full coverage report available within about a minute's time. I've been using this to develop Pyrus (located in your all checkout at all/Pyrus), and it's been great. I have plans to examine the feasibility of processing the XML files that PHPUnit outputs, as this would allow generating coverage reports from phpunit-based tests as well. Unfortunately, I'm not sure the database format PHPUnit supports is simple enough to work for my needs, as it has much more detail (such as which classes/methods are declared in files), in order to support more abstract coverage reporting. Thus, I'm not likely to add support for that into this coverage reporter, unless I can be convinced otherwise. This also demonstrates the phar extension's power. The web application is entirely contained within a phar archive, but web requests can be made for individual files directly, thus the generated html requests a .css file from within the phar, and it is served up by ext/phar with the correct mime type without any additional programming. It's an exciting time to be developing in PHP, if you ask me. Saturday, February 14. 2009Pyrus, PEAR2 and web code coverage report for phpt-based testsIt's been a while since I reported on any of my PHP activities, and this update is long overdue. I must apologize to Davey for not doing my 7 things, and to all of the facebook people for whom I didn't write 25 things. I am somehow not at all motivated to do this... In any case, now that work on ext/phar has shifted primarily to maintenance mode, and namespaces are finally ancient history, I've shifted all of my coding energy to getting Pyrus, PEAR's next-generation installer, ready to ship. Pyrus is basically the PEAR installer completely redesigned for PHP 5.3, and it takes advantage of as many of PHP's new bells and whistles as makes sense. Some of the exciting features:
There are many other great features for users who would like to extend Pyrus, including a seamless API for accessing package.xml which is identical regardless of whether the package.xml is from an .xml file, an archive, or an installed package's registry. Of course, all of these features only matter if they work, and to move along that path, I've been spending my time unit testing up a storm. Using the run-tests command of the old PEAR installer, I'm writing and refining tests. With the addition of xdebug code coverage (pear run-tests -rx does the trick), it is possible to see where stuff is being executed. Unfortunately, I don't like the existing reporting tools (call me a snob), so I whipped up a very simple coverage analyzer and popped it into the subversion where all of PEAR2 is stored. When I say simple, I mean here is the script for generating the source (svn link): <?php namespace { function __autoload($c) { $c = str_replace('PEAR2\Pyrus\Developer\CoverageAnalyzer\\', '', $c); include __DIR__ . '/' . $c . '.php'; } } namespace PEAR2\Pyrus\Developer\CoverageAnalyzer { $a = new Aggregator(realpath('../../../../../Pyrus/tests'), realpath('../../../../../Pyrus/src')); if (file_exists(__DIR__ . '/test')) { foreach (new DirectoryIterator(__DIR__ . '/test') as $file) { if ($file->isDot()) continue; unlink($file->getPathName()); } } else { mkdir(__DIR__ . '/test'); } $a->render(__DIR__ . '/test'); } ?> Highlighting is a little wonky because this is PHP 5.3+ code, but my blog is running 5.2. The output is at http://pear.php.net/~greg/coverage/. This is a dumbed-down version of gcov.php.net, which I found extraordinarily helpful when writing the unit tests for ext/phar, but unlike gcov, there are some fantastically helpful features. The short list:
the lines in PackageFile/v2.php that are executed by the file.phpt test. This last part is extremely useful to me, I have already used it to determine when a test is not executing the lines I expect it should be, and to fix problems such as using isset() instead of array_key_exists(), which would otherwise be very difficult to track down. As you can also see, only 30% of the source to Pyrus is covered by the current tests, and so there is a long ways to go to full coverage. If any of this work interests you, feel free to contribute, PEAR2 has a much lower barrier to entry than PEAR, and as you can see, we need all the help we can get to bring this baby off the ground. Tuesday, December 9. 2008Music, PEAR, phar, namespaces and Macs. Oh my!Why the tri-partite title? I've been silent for a while on the blog, but the title sums up my life for the past several months. What have I been doing? Aside from some crazy music work learning a blisteringly difficult Elliot Carter String Quartet No. 4 as well as Steve Reich's Different Trains, Bartok's 6th Quartet, bringing back Korngold 3rd Quartet, learning Carter's Figment for solo cello, and performing Bach's 5th Suite for Unaccompanied Cello for the first time, I've also been pretty active in coding. I acquired a new Macbook Pro with VMWare Fusion running Windows XP and Ubuntu, and it has made development super-easy. I also put in a significant effort on the phone getting Barack his electoral vote in the Omaha area, which seems to have paid off. So, here's the long version of what I've been doing. Music and Macsfirst the musicThe past month has seen my time consumed learning Elliot Carter's 4th String Quartet for the 100th birthday thing in Boston. Although I have not learned the others, a few veterans have reported that it is the most difficult. I certainly found it to be the most difficult thing I've ever learned by a long shot. It took me almost 15 hours of work to be able to play the first page (only 15 measures of music) at 3/4 of the printed tempo, and the piece is 35 pages in the cello part. To contrast, page 35 of the 10 Celebrated Mozart Quartet cello part is the third movement of 6th string quartet in the book. Carter 4th's cello part is as long as 6 Mozart quartet cello parts. However, it is shorter than some of the 4 page Mozart quartets, because it is frickin fast and there are lots and lots of notes. It is the most holy s*** hard piece I've ever learned, and for a while, I was scared it just wasn't going to be possible. In addition, one of Carter's big compositional inventions is the metric modulation in which a tempo change has a distinct rhythmic relationship. He uses some pretty normal ones in the first movement (the 16th note becomes the new triplet), but the other movements have fun ones such as the 16th note becoming the new septuplet. Because most of my part is written in septuplets, this can be difficult to do. Speeding up septuplets so that you fit 7 into what used to be the space of 6 septuplets is not an easy thing to learn at all. ...then the mac...unless you have a metronome that can do the metric modulation. We had been using a web-based metronome to plug into our studio's stereo to rehearse, because it had a more pleasing beat than any of our metronomes have, and it occurred to me that I could probably pretty easily write a metronome that is capable of doing metric modulations on my new Macbook Pro. So, I took it upon myself to learn Objective-C and the Cocoa framework in Xcode to write a metronome. It took me just over a day to learn Objective-C; it's very easy for a C coder to pick up, and the syntax is pretty simple. Learning Cocoa fully took quite a bit longer, but after 3 days I had a working metronome that could do metric modulations (http://chiaraquartet.net/ChiaraMetronome1.0.0.dmg). It had several flaws, not the least of which was the inability to insert a measure group, no way to save your work, and some odd behavior on the first beat (sometimes it is late and fast). After a few more days of digging, I had figured out most of the quirks (and discovered bindings and Core Data, which simplified things) and had the interface greatly simplifed (http://chiaraquartet.net/ChiaraMetronome1.2.2.dmg). I added the ability to start at any measure in the piece, and to have lead-in measures (which allow you to start the metronome, sit down, find the beat, and then start playing). Then, I discovered document-based Core Data, which allowed saving files, resulting in the next generation (http://chiaraquartet.net/ChiaraMetronome2.0.0.dmg). Finally, not to leave an unturned stone, I added the final features, the ability to specify whether a beat is accented, beated or silent, which allows implementation of uneven compound meters (like 5/8), and the ability to accelerate or decelerate tempo, and we have the final version http://chiaraquartet.net/ChiaraMetronome3.0.0.dmg. This version contains 3 sample metronomes, the complete Elliot Carter 4th quartet we used to practice the tempo changes, a sample demonstrating accelerando/ritardando, and a sample demonstrating how the metronome can be used to practice complex polyrhythms like 6 against 7. In my potentially humble opinion, the metronome is my crowning glory as a programmer, it is incredible for learning complex tempo relationships for composers like Carter and Bartok who call for it. It's also important to note that this metronome should NEVER be used for learning music by composers such as Brahms or Mozart. If I hear of anyone using it for that, I will hunt you down and make you listen to Beethoven 9 with your eyelids peeled back watching Teletubbies. Short feature list:
PEARToday, I upgrade pear.chiaraquartet.net to the latest version, 0.19.0, which Brett Bieber has been working hard to perfect. The look is a bit cleaner, and I also replaced the defunct Crtx_Frontend_Chiara (or whatever it was called) with the newly minted Chiara_Pear_Server_Frontend_Web which is a direct port over of the old frontend with bugfixes and visual tweaks. PEAR and pharA high priority for PEAR is minting its next-generation installer, Pyrus. Pyrus is based on PHP 5.3+, and thus I expended a tremendous amount of energy on the new phar extension,which will be enabled by default in PHP 5.3. The phar extension provides several must-have features for Pyrus:
I'm very pleased this will be built into PHP 5.3, it cuts out oodles of code from Pyrus, and will significantly affect both its performance and memory footprint. PEAR and namespaces. Oh MY!Also important for PEAR2 is making it easier to work with the names, so I've been fighting in the namespace wars. For a while there, it was looking like namespaces would go the way they had in the PHP 5 beta cycle: to the trash can. With a little bit of work, we found a solution no one is 100% happy with, but having tried out several possibilities, I must say the solution we chose is something we can be proud of. There have been many complainers, but the irony I have seen is that most assert they never planned to use namespaces in the first place, which begs the question: why flap your trap if you have no plan to use the thing? In any case, you know where I stand on the issue. I wrote the new manual as well as the first draft of the patch that made it possible to end the bickering on internals. A big thanks to Dmitry Stogov and Stanislav Malyshev for their patience, and especially persistence in working out the solution. Also thanks to many others who fielded opinions on-list, on IRC, and through private email. Anyone who contributed a real concern rationally and sometimes forcefully deserves credit for the final implementation, and time will prove that it is a very good one for those who need it. I am, of course, referring to the now infamous decision to use the backslash (\) as the namespace separator in PHP's implementation of namespaces. I won't go into the rationale, except to say that PHP, unlike other languages, implements a very loose autoload implementation, which makes it impossible to do the most common solution to resolving a name conflict between a static method and a namespaced function - disallow that. In other words, it's not possible to detect the conflict unless autoload is called on every potential namespaced function call, which introduces a potentially exponential hidden performance loss. As Stanislav so eloquently put it, name conflicts have not caused major websites to go down, but performance issues have. Thus, anything that calls autoload where it may be unnecessary is an unacceptable solution, and the only way to safely handle the ambiguity is to eliminate it. That is what using the backslash does, because the syntax is different between a namespaced function call and a static method. Complain or ridicule if you'd like, the rest of us will simply shut up and code. This decision has several other benefits too, including the ability to audit someone else's code and figure out what you should grep for, a namespace or a class name. This also translates into better autocomplete in future IDEs, and so on. Wrap upSo, it's been a long blog post, but a lot has happened in the past several months, and it's time to get cracking on the future. More will follow as time allows.
Posted by Greg Beaver
in Chiara Quartet, Mac Development, Music, PEAR, PHP
at
21:00
| Comments (4)
| Trackbacks (0)
Tuesday, November 4. 2008pear.chiaraquartet.net back online
For those of you who were wondering where pear.chiaraquartet.net went, we suffered the same fate as Josh Eichorn's blog and other sites, but all has been restored.
Sunday, August 24. 2008What do "Batman, the Dark Knight" and Barack Obama have in common?Last night, I saw "Batman, the Dark Knight" for the first time. Aside from being a great movie and featuring ridiculous good performances from the late Heath Ledger and others, it got me thinking. I've noticed a huge shift in the way movie makers are portraying both reality and fantasy since 9/11. First, there is the obvious increase in the number of movies about governmental intrigue, CIA spy junk, invasion of privacy and other things reflecting and amplifying reality. However, yesterday I noticed that the Joker was referred to as a "terrorist" several times in the movie. Let's think about this: a comic book villain whose sole motivation is to sow chaos and destroy civilization is being equated directly with people who reap violence in order to achieve a political or military goal. The last time we saw the Joker, he was a brilliant but somewhat goofy character in Jack Nicholson who when killing people turned them into caricatures of death in a grotesquely cute way with exaggerated smiles burnt into the corpses faces. Contrast this to Ledger's Joker who tells conflicting and gory stories of how he got his smile scars before cutting people's faces open with a knife. Nicholson's Joker wants to create chaos, but for him it's all a big joke. Ledger's Joker is just scary. He enjoys chaos because it causes good people to do evil things and even become evil embodied, and says this explicitly in one scene. The scene that got me thinking about the connection to politics was (cover your eyes if you haven't seen the movie yet) when the massive prisoner seems to be about to blow up the innocents' ferry boat and instead throws the detonator out the window, showing one of the only moments of redemption and hope. What has exploded Barack Obama's political stature from non-existent to presidential nominee of the Democrats is "Hope" as political platform. Go back 8 years to the post-Lewinsky election. Can you imagine any politician even being able to raise the slightest amount of money based on "hope," let alone win the nomination of either party? What gives Barack's message such potency is that it is the extreme opposite to what we see from the Dick Cheney camp. Continuous war against an enemy that has neither a defined name, a defined country, or a clear target is a guaranteed recipe for despair and extreme paranoia. Especially when the only unifying things for this enemy is that they are a few thousand people amongst the 1 billion plus who practice the world's most populous religion, and they are out to get us. Barack's successful message of hope is a direct extreme opposite of the fear and militarism practiced by the establishment, and thus it is very, very important for us to understand what this could mean to us as citizens. Why? Extremes sometimes balance each other out by pulling towards the middle, but when they remain separate and intensely opposite, they create what we used to know as "extremists," those who cling to the far fringes of an idea where the air is thin, intense and rational thought disappears into distant memory. To be blunt, if you support Barack because he makes you feel hopeful, this is only slightly less scary to me than supporting Bush because he makes you feel safe. These emotions have the same root: escaping fear. I happen to personally enjoy both feeling safe and feeling hopeful, but more important to me as a voter is how the candidates will handle themselves in day-to-day workings. Do they have the intellect to differentiate between opinion and fact? Can they understand the importance of peer-reviewed science and how to translate this into public policy? How do they handle conflict amongst the people around them, and how do they handle external conflict imposed upon them by circumstance? Do they have the ability to see long-term consequences and understand short-term methods of handling them? Answering these questions for me means looking both at their positions, how they have evolved (especially convenient changes in the past 2 years based on polling), news on how their campaign has been run, and what was important to the candidates before they had any idea of burnishing their public image in order to run for political office. Returning to the movies, the best example of how our psyche has changed with regards to thrillers comes from the 1998 movie "The Siege" starring Denzel Washington, Annette Benning and Bruce Willis with Tony Shaloub in a supporting role years before he hit it big time with "Monk." Willis plays the evil power-hungry general who takes the law into his own hands and is ultimately punished by the strength of the Constitution. The movie starts out with terrorist bombings in New York City that escalate from a bus to destruction of a building by a car bomb. In a key moment, Washington walks in on an interrogation of an Arab who is sitting naked in a shower room of a Brooklyn football stadium and Willis starts to discuss "alternative protocols" like waterboarding. Washington here delivers his big speech that concludes with "what if what they really want is for us to bend the law a little bit, shred the constitution just a little bit? Because if you torture this man, they will have won. They have already won!" At the time, this seemed to be the most remote, horrendously extreme possibility, that an American would even consider torturing a detainee, and it is this act (and the subsequent execution of the prisoner by Willis) that Washington cites in the arrest warrant at the conclusion of the movie (sorry to spoil another one). Fast forward to today, where in the Republican primary, all but a couple of candidates publicly supported using torture as an interrogation method - and tried to use it to become the nominee for president, and torture was authorized by the Justice Department, the vice president and the president, none of whom have faced even a trial for their decisions. Is it any wonder hope has been transformed from an ideal into a powerful political tool? Thursday, August 14. 2008Macbook Pro lives up to expectationsWell, it's been a long and practically empty summer for me in terms of coding, what with hardly any internet access and even less time. I did manage to have time to improve the scheduling program I wrote for Greenwood Music Camp where we are in residence, but that was it. Now, a new leaf has been turned over. The Chiara Quartet has a residency at the University of Nebraska-Lincoln that began in 2005 for a 3-year term. Much to our delight, the residency was renewed for another three years, and converted into a permanent residency. None of this has much to do with programming, but a perk of this job is that every 3 years, we get a new computer to replace the old one. This cycle, I requested a Macbook Pro, my first Mac, as I have been using a PC for years. I had the tech peoples set up VMWare Fusion for me, and so I am currently running Mac OS X, Ubuntu Linux, and Windows XP simultaneously with noticeable performance gain over any previous computer I have owned, including my custom 64-bit Kubuntu desktop. The screen is beautiful (15 inch Matte) and speakers far superior to other Macs I've heard as well as the Toshiba laptop I will soon return. I was able to very quickly set up a working PHP 5.3 with xdebug and Komodo in Mac and linux, and almost have the windows side compilation of PHP working, which will greatly accelerate my development. The ability to share changes with the shared folders between all 3 boxes will be a tremendous boon to my development, this will be fantastic. It feels good to drop Windows as the native platform too, it's been a long time coming. Friday, June 20. 2008PHP namespaces become much better (Derick take note)Recently noted by Derick Rethans in an informative blog post, there is (now was) a problem in the implementation of namespaces in the soon-to-be-released PHP 5.3. I quote:
This morning, I realized that this would be very easy to fix, and posted a patch to internals@ with a brief explanation. Dmitry committed a fix to PHP_5_3 and HEAD very quickly. The issue raised by Derick is now obsolete, making namespaces not just more useful, but even more powerful than they were. For instance, it is possible to "override" an internal class, perhaps to add missing functionality that will be present in a future release or fix a bug: mydate.php: <?php Those who were lamenting the implementation of namespaces in PHP should take note: if you have a solution to make them better, the turnaround time between proposal to the list and commit can be on the order of a few hours if the idea clearly solves a major problem. Thursday, May 29. 2008php|tek PEAR/phar/Pyrus talk slides
I've had a few slide requests, so here is a link to the pdf of my slides that Sean Coates put up on the phparch site
http://tek.phparch.com/mats/slides/greg_beaver-pear_phar.pdf Friday, May 23. 2008fixing stupid sound breaking on upgrading kubuntu packagesSo I use kubuntu on my desktop, and it works great most of the time. However, periodically on upgrading a package automatically, the sound just stops working. Twice I've fixed it after extensive search, but I never remember how. This post is sort of a public post-it note. Here's how you fix this thing if you have a system like me. Open alsamixer in a terminal, use the right arrow key to go all the way to the right, and mute (not unmute) the Audigy A line by hitting "M" on the keyboard. This works for Soundblaster Audigy Hope this is helpful to some other person tearing out their hair. Monday, May 19. 2008phar is near at php|tekOK, so my selection of puns is not exactly "funny" per se, but it is true: php|tek is all about phar and variant spellings of the 4 letter word, such as "pear". If you're in the audience for my talk about smart PHP application deployment using phar, PEAR and Pyrus, come say hello, I'm looking forward to meeting just about everyone I've argu^H^H^Hconversed with over the years, and of course you can also check out a copy of my book, I'll stuff a few into the luggage. In other news, phar is tentatively enabled by default in PHP 5.3, marking the exciting next phase in all of the back-breaking work that has gone into it. Check out the complete manual at http://php.net/phar. Although I perform all the time as part of my day job as cellist of the Chiara Quartet, this will be a very different kind of performing experience and I'm looking forward to the challenge of revealing the true dynamism and excitement that I see in app deployment stuff I've been working on the past several years. See you in Chicago! Wednesday, March 26. 2008behold pecl/phar and mighty PHP 5.3, also php|arch and php|tekI've been a bit busy, my last PHP post was in October (!) but I do have very good news. Following on the heels of my first php|arch article about the Phar extension in the January issue (http://phparch.com/c/magazine/issue/65), I've been extremely hard at work on perfecting this extension. As a testament to the strength and excitement surrounding the upcoming 2.0 release of the phar extension, my editor at php|arch became a developer on the phar extension after reading and working on the article (hi Steph). Today, I released phar version 2.0.0a1, the first release of the newly upgraded extension. This extension is a wholly different animal from the last release, 1.2.3. While maintaining BC with the 1.2.x version of pecl/phar, this version adds unimaginable new facilities. The phar extension has transformed from something of a sideshow to a major player, and is being actively considered for inclusion in the core of PHP 5.3. Major new features in phar 2.0:
In other words, phar 2.0 is the "holy crap" release of phar. The manual (which is currently almost fully updated to the API, but not yet rebuilt) is at http://www.php.net/phar. Another way to get to know phar is through the unit tests, which are included in the pecl tarball. The current release can be downloaded from http://pecl.php.net/get/phar-2.0.0a1.tgz or installed via pecl install phar and windows dll can be downloaded from http://pecl4win.php.net/ext.php/php_phar.dll although it looks like building is having a few hiccups lately. There are a few known issues to be worked out. One is compatibility with xdebug, which is a trivial problem involving extension load order. Once we work this out, xdebug will support stepping through the source of files within a phar archive in your IDE, a killer feature for those who need to debug things. In PHP 5.3, phar requires a small patch to support the phar stream wrapper in include_path. ...This brings me to PHP 5.3. I've been working hard with Dmitry Stogov, Marcus Boerger (the other phar lead) and a few other list contributors to perfect a patch that will bring stream wrapper support to include_path. This will mean that you can write a userspace stream wrapper, put its url in your include_path and start using it with relative includes such as what PEAR uses to load its code. This powerful feature will allow you to write your code in one way, and run it from several different locations. Expect to see this feature committed in the next week or so, barring major problems. Lastly, I'm happy to announce that I will be a speaker at this year's php|tek conference in Chicago. It is the first time I've been able to pull myself away from a crazy-busy quartet schedule to attend a conference, and I look forward very much to meeting as many of you as possible while there. My talk will be on smart PHP application deployment, and covers PEAR, Phar, and the new Pyrus installer for PEAR2 (http://tek.phparch.com/c/schedule/talk/d2s6/1). Unfortunately, the talk is at the same as Josh Eichorn's talk on PEAR2 (http://tek.phparch.com/c/schedule/talk/d2s6/0), so we may need to work out some way to shuttle folks back and forth, we'll have to see Progress of the highest order is being made here, expect to hear more about the goings-on behind phar and PEAR2 as time permits. Saturday, December 1. 2007an example of responsible government from a guy I don't even like much
Here is an interesting example of how screwed up the political process is: Mike Huckabee, Republican of Arkansas, is being heavily criticized for having raised taxes during his term as governor. For years, the rallying cry of so-called "fiscal conservatives" has been decreasing taxes, under the premise that government is always less efficient than private enterprise at solving problems.
Of course, as with all one-sided issues, the question of taxation versus private enterprise is a canard. It is more than foolish to blame high taxes for all of the problems in this world. For example, Huckabee raised taxes approximately $500 million net (once you take into account taxes eliminated) as a governor. However, at the same time, the state's $200 million budget deficit turned into a $844 million surplus in the same time. Tax advocates might argue that the increase would be even greater had taxes been lowered, but let's look at the truth of the matter. Reagan and both Bush presidents cut taxes, and the deficit rose in both cases. Clinton raised taxes, and the deficit decreased at the same time as the economy flourished. For citations, see here, here, here, and here. The last citation is particularly interesting, as it discusses the long-term effects of budgets based on deficit spending (living off the government credit card is another way of thinking of it). The standard economic effect is that as you borrow, your interest rates climb to compensate. An interesting side note is the end of the article predicting that interest rates will only rise 1.12% after 2004's record deficit spending. In fact, the sub-prime mortgage lending crisis we currently find ourselves in was caused by a very slight increase in the interest rate as dictated by the Federal Reserve. The rate increase itself should have been harmless, but when combined with the obsessive anti-regulatory credo our current administration lives and breathes, we have thousands of unethical predatory adjustable rate mortgages suddenly increasing monthly payment by several hundred dollars, and foreclosures by the thousand affecting the entire economy with a ripple effect. Another interesting side note is that the only reason our economy continues to function is because China is literally supporting our system by buying huge numbers of government bonds. The new question nobody is asking is what does this really mean? The obvious answer is that should China wish to do so, it could squeeze the U.S. government and shift our policies in its favor just by threatening - behind the scenes - to stop this process. What it really means is that very quietly, and unnoticeably, the control over the U.S. economy and even policy is shifting to Asia. This is not intrinsically bad, and in a perfect world, allows our economy to function with the help of our benevolent neighbors. What it also does do is allow a bad apple government to exert undue control over the U.S. from afar, much as a bad apple U.S. government has run amok over the Iraqi people, but in a far more subtle way with profound implications for everything here, including the military and other national security issues. So, coming back to our main story, Huckabee raised taxes to fix horrendously ill-maintained state highways, to pay for nursing homes for poor seniors, to pay for strapped school districts, supporting tuition breaks for children of illegal immigrants, and improving the state parks system. In case you've been living in a hole, these are all liberal issues, and yet they all passed with huge bi-partisan support in Arkansas. So why don't I like him much? Actually, much of what he says on his issues page resonates with what is really important. His views that the environment actually kind of matters, that education is a serious priority for providing vectors to move from a poorer life to a richer one, faith as a non-prescriptive but important part of life - all of these sound great. However, he then proceeds to turn right around and say it is just fine to proscribe that his personal view of homosexuality and faith allows him to legislate the lives of gay people in a highly intrusive and discriminatory way. He also blindly lumps together Iraq in with Al Qaeda, conveniently ignoring the fact that it was the United State's own imperial hubris that led to the creation of "Al Qaeda in Mesopotamia" - an organization that did not exist prior to 2003. His demonification of illegal immigrants, pandering to white racists who see "those Mexicans" as a problem and finally have an excuse to get rid of them is pure opportunism, especially considering his actual stance as governor supporting the children of illegal immigrants. Ultimately, however, this is a candidate who understands that government has a purpose that serves to rectify the natural inequities inherent in the capitalistic system. I'd never vote for the guy because it takes more than an effective manager to unify a country that has thrived on division under the worst manager in the history of the nation, but it is comforting to see that even social conservatives are starting to recognize that the Bush/Reagan paradigm of economic management and governmental anarchy is the worst thing to ever happen to the United States economy. It would give me no end of pleasure to be *only* arguing about domestic issues of personal privacy, health insurance, education, and all the other things that really matter to day-to-day living. With an effective manager at the helm, the United States can finally pull out of this tremendous quandary that is the Bush legacy. Thursday, November 1. 2007"The torture presidency," why impeachment is the only remedyMore fuel for the fire - it appears that the CIA, under the explicit direction of the executive branch of the U.S. Government (translate: Bush administration) tortured at least three suspects in interrogation. The "technique" used is waterboarding, a medieval torture technique designed to convince the person experiencing it that they are drowning and about to die a horrible death. This in turn is expected to convince the person being waterboarded to give up information on terrorists. The Attorney General nominee explicitly says in his testimony before Congress:
That's right - the Department of Justice explicitly authorized waterboarding. Mukasey is right on one point - the CIA operatives carrying out orders will not be expected to answer to their crime of following orders on this earth, as Congress has passed a law forbidding prosecuting of interrogators following protocols set forward by their bosses. This, incidentally, was the most common defense by Nazis in the Nuremberg trials after World War II: "I was just following orders when I pulled the trigger and shot men, women and children over a trench they had dug." This leaves us with only one recourse: prosecuting their bosses, namely the Bush administration people who authorized the torture. At this point, that leaves us with one recourse - impeachment. On what grounds can the House impeach? The Constitution, Article II reads:
Treason is explicitly defined as waging war against the U.S., or aiding an enemy of the U.S., and it must be explicit, so that is out of the question. Bribery is not a known problem, so that is out as well. This leaves high crimes and misdemeanors. What's that? It's intentionally vague. For a guideline of precedent, Nixon was indicted for illegal wiretapping, misuse of the CIA, perjury, bribery, obstruction of justice, and other abuses of executive power. This raises another question: is torture even illegal? The Bill of Rights reads:
This, unfortunately, does not discuss interrogation, only punishment. However, this Amendment is quite explicit:
Unreasonable search of person can be construed clearly to mean interrogation techniques that are unreasonable, as the purpose of interrogation is to search a person's memory for wrongdoing or information on other wrongdoers. In other words, the Bill of Rights does not explicitly mention torture by name, but it does explicitly forbid its use as an interrogation technique. The truth is that president Bush has already explicitly authorized warrantless searches of American citizens, and most likely had to approve the torture techniques used to interrogate terror suspects. Cheney is famous for micro-management, look at his pre-Iraq war intelligence manipulation efforts. Rumsfeld is obviously directly implicated in these schemes as is Gonzales. Rove most likely was not involved as his role was purely political horror shows. The evidence is clear: our president and vice president are guilty of high crimes and misdemeanors, and there is no one in the legislature stepping up to the plate with the guts to propose an article of impeachment. Some might argue that impeachment is "bad for the country" but the fact is that injustice is far worse. When a private citizen commits a high crime such as murder, there must be a trial and justice, or it rips a hole in the fabric of society. For years, the United States has been able to take a high road when dealing with other countries that have perpetrated terrible human rights abuses. By avoiding punishment for the crimes of the Bush administration in the name of "the good of the country" we will be encouraging unscrupulous leaders of other countries to use the United States's conduct as justification for their own evils, and they would be right. If we fail to appreciate this dilemma as a nation, then we do are implicitly authorizing foreign powers to torture our soldiers and CIA operatives when they are captured, as well as private citizens who are mistakenly accused of spying or terrorism like the Canadian citizen the United States mistakenly arrested and tortured in Syria. Once again, this is not a liberal versus conservative issue, it's a basic fact: we don't torture people in the United States. Those who do it and those who authorize it are criminals. In fact, it could very well be more of a conservative than a liberal issue, as ignoring this torture implies a kind of relativistic view of morals. If it is OK for the president of the United States to authorize torture of terrorism suspects, but it is not OK for a police officer to torture a burglary suspect, and not OK for parents to torture their children, we have a moral dilemma that can only be explained by saying that the concept of right and wrong is incorrect, that there are cases where "wrong" is "right." You don't need me to explain why that is the path to absolute evil. Please call your representatives in Congress and let them know that you expect them to uphold the law independent of political considerations, and that you want impeachment and justice for the American people to rectify the egregious abuses of executive power by this administration. Tuesday, October 30. 2007Bush administration bungles an obvious choice AGAIN
I just read in the New York Times that the head of the Consumer Product Safety Commission, Nancy A. Nord, has written to Congress asking that current legislation to double the size of the CPSC be scrapped. This is in the wake of great ideas like selling children's toys from China that were painted with lead-based paint, putting industrial waste into pet food and toothpaste, and other fantastic situations.
This brilliant idea from Nancy Nord follows the consistent pattern of the Bush administration's goal to eliminate government altogether. The theory is that by systematically dismantling the government, all of our lives will be simpler, better, and happier. Unlike other administrations, Bush's has even extended this theory to the military, outsourcing "security" in a warzone to companies like Blackwater. Perhaps the theory is correct. After all, for the first time ever, the standard deviation from the median income in the United States is nearly zero - there are no poor people, and no super-rich people! Our military is spending less money and less time in conflict zones, inspiring other governments to follow the United States' lead and hire mercenary forces to do their dirty work for them! For the first time, all products and chemicals brought to market are being evaluated for their potential detrimental effects. Also, surprisingly, every American has full access to health care and private insurance with no danger of bankruptcy from a single hospital stay. In fact, every small child has guaranteed access to essential care, cutting down dramatically on future health care costs when these children get ill later in life. Perhaps the next best step is to turn over our interstate highway system to private companies, so that we can truly reap the benefits of lower taxes. Oh wait, scrap that, for the first time since the late 1800s, we have a huge disparity of the super-rich and the poor, a shrinking middle class, and the U.S. is the only "rich" country in the world experiencing this fact. The stock market is at an all-time high, and yet millions of new home owners are about to lose their homes. Private security firms contracted by the U.S. government to do the military's job do so at double the cost or more, with no oversight or accountability, resulting in callous disregard for the lives of civilians in the countries they work in. The European Union is leading the way in safety of chemicals on the market, forcing U.S. manufacturers like Dow to conform to standards much higher than those in the U.S., and the U.S. dollar continues to drop relative to the Euro, suggesting that these increased safety standards don't hurt economic development at all. The EU is also leading in environmental regulation. Health care is obviously a disaster because it is private - compare costs and benefits to any other country with systemic government-sponsored health care for your evidence. What most self-described conservatives fail to appreciate is the total cost of things. Taking into account only taxes and regulations is short-sighted at best, and dangerous at worst. When comparing costs, one must take into account how much things would cost if you have to pay for them yourself. Health insurance is a good example. Your employer can take advantage of economy of scale to get you a much lower rate for the same thing than you can get yourself, sometimes hundreds of dollars lower. The government is on an even larger scale, and can therefore smooth over large differences between groups with minimal pain to those on the extreme edges. For an obvious example of how government works successfully, the interstate freeway system was entirely government-funded, and has worked with minimal interruption or problems with thousands more miles of concrete than other countries. The truth is that saving a few bucks now by reducing the size of government has a huge impact on the cost of living, especially for lower-income brackets, resulting in not only worse living conditions for low-income households, but increasing unstable political environments as a result. Organized crime or corruption/fiefdoms steps in to fill the void of an absent government, much as we have seen in countries like the former Soviet Union. It's time for Americans to wake up and smell the toxic waste. Voting "for the other guy" is the knee-jerk reaction, but won't do anything substantive. You need to contact your current representatives in the government, your senator and representative, and let them know that you understand the importance of government as a service to the people, and oppose dismantling government as a principle. Take some time out of your day to do some research into how smart people who have studied the effects of government versus privatization have documented the way the world actually works, don't take my word for it. Be a real citizen already!
(Page 1 of 14, totaling 197 entries)
» next page
|
PEAR Installer ManifestoCalendar
QuicksearchMy Latest ReleasesTop Exitspear.php.net (311)
www.php.net (154) php.net (97) pear.chiaraquartet.net (80) chiaraquartet.net (74) Blog Administration |
|||||||||||||||||||||||||||||||||||||||||||||||||