|
May 7, 2008
The fat lady is warming up
I'll give Clinton points for toughness, this has been a marathon of grueling disappointment. For much of the race she was the Democratic front runner but coming to the wire gets to watch Obama pull ahead while she gasps for air, now left to her own millions in purchase of enough oxygen bottles to keep the campaign competitive. I mean, when the money flows in support of the other guy and you have to break out the inhaler, well... A reasonable person could deduce the writing on the wall but this is where politics can get weird and often does. Hillary says she'll drag this to the bitter end. We are reminded that bitterness and endings can be close at hand.
It is no longer a matter of winning outright for Hillary, she can't. She will have to woo a far greater number of super delegates than have already committed to her and considering the numbers aboard with Obama this does not seem likely. For the Clinton campaign, the momentum has been lost and it is getting late.
Although she's a fighter, the problem for Hillary is she can't fight Obama because he is protected. Whenever a turd falls out of the mouth of a Militant Michelle or the Reverend Jeremiah Wrighteous, Obama simply butters over and carries on. It's ok really, we understand. It's not as though these people are spiritual advisors, chosen sleeping companions or life partners within the inner most circle of confidants; the essence of the man as it were. With free passes handed out like that she was foolish to try. That said, if Hillary couldn't define herself any better than John McCain with tits, perhaps it just as well her candidacy suffers a hull rupture and sinks.
• • • • •
May 5, 2008
A quick look at Biodiesel
According to Wikipedia if all arable land in the US was converted to soybean production, the oil extracted and converted to biodiesel, we would have just enough transportation fuel and home heating oil to cover current levels of domestic consumption. Obviously oilseed biodiesel alone will not get us very far but I do like the option as an alternative fuel within the confines of practicality. We might not be able to fuel every vehicle or heat every home but if we could ensure the viability of trains, fleet trucks, ships, boats and buses, then I would think adequate production of biodiesel would be in the greater interest of all.
Are soybeans the better oilseed for conversion? From a practical standpoint it would seem so, especially at scale. Rapeseed (canola oil) has somewhat higher yields although the better oil producing soybeans near match them and produce the greater overall value when considering protein and fiber byproducts. The upper limit of yield for either oilseed as currently defined is about 98 gallons/acre give or take and it takes about 9 gallons/acre to produce it.
On occasion we hear about the potential of algae as a biodiesel feedstock with the USDA proclaiming 30X greater yields per acre. Theirs as it turns out is the most conservative estimate, others claim much higher yields than that, all without utilizing arable land. Much research remains to be done on algae however, some strains are better than others concerning lipid production (the oily part) so there is that aspect of the discovery process that needs sorting out. Research that has been hampered by lack of ongoing programs due the rise and fall of political tides. Then there are issues with DNA modifications to scale once identified and processes to develop in harvesting at megaton volumes. There is significant promise that might be realized, but the study of algae involves development cycles that take months per test so it is important that we get to the task and stay with it until all is proven one way or another.
It all boils down to energy which in many cases are not economically desirable or even tractable. Really, the only energy source that meets most of the criteria is nuclear and that might put me at odds with a great many but such is the brutal truth. We are woefully behind the necessary build out. Of course it is not all that needs doing.
We are reminded of this due all the talk about rising prices at the grocery store since we have opted to burn food for fuel and I am amazed that this seems to have caught people by surprise. With farmers increasing corn production as an ethanol feedstock, soybean prices have escalated with their lesser availability and construction of the Evansville (WI) biodiesel plant has been halted due declines of economic viability in result.
Meanwhile a guy in Clinton Iowa is making biodiesel 100 gallons/day in his garage at a cost of a dollar per gallon. All it takes is some methanol (or ethanol) and lye plus waste cooking oil, water and a residential hot water heater. Nothing more than plumbing and a recipe.
Of course he's not paying any mandated motor fuel taxes either which segues into the great RV bust at Daytona International Speedway during the run up to last years Daytona 500. Seems a good many RV's are clandestinely fueled and inspectors were checking tanks at the gate. I don't know what the test was but I suppose if an RV drove past smelling like french fries the jig was pretty much up.
I guess I live a sheltered life not being aware of that previously. I hear such inspections are increasingly common but also wonder why the DOE/DOT guys would even bother with it. On the other hand it was just recently I looked up at a price sign and noticed that diesel was significantly more money than gasoline and wondered why that was. Isn't diesel cheaper to manufacture given reduced processing requirements?
Apparently the difference is in the tax and therein lies the reason why we don't manufacture diesel automobiles domestically or given instances when we do are not for domestic consumption. You would think it the better choice since the modern diesel is a low polluter (even less with bio-diesel) with significantly enhanced fuel mileage, but such is the tax, pushing up operational costs which drives such options from the marketplace.
Even though biodiesel might only be part of the solution perhaps we need to rethink our regulatory stance on such alternative fuel options given the humble diesel is much more fuel flexible than spark ignition gasoline engines. We need to keep moving, preferably forward.
• • • • •
May 2, 2008
ImageMagick w PHP
Here is a chunk of known working test code for checking the PHP interface (imagick) to ImageMagick.
From: PHP Tutorials - Create Horizontal Gradient With PHP Imagick.
<?php
/*** new imagick object ***/ $im = new Imagick();
/*** a new image with gradient ***/ $im->newPseudoImage( 24, 240, 'gradient:red-black' );
/*** rotate the image ***/ $im->rotateImage(new ImagickPixel(), 270);
/*** set the image format to png ***/ $im->setImageFormat('png');
header( "Content-Type: image/png" ); echo $im;
?>
In my case it didn't work out of the box and trying to run this code pitched a "Class 'Imagick' not found" error. A quick Google on the error provided the solution; apparently I didn't have enough stuff.
apt-get install make php5-dev php-pear apt-get install libmagick9-dev pecl install imagick /etc/init.d/apache2 restart
If I had followed the instructions provided a bit closer it would have saved some headache but I assumed (incorrectly) that I already had 'make' and 'pear' installed. I didn't and do note the original issue was an older thus incompatible version of the 'imagick' PHP interface as installed from the Debian repositories. Happens.
Here is the updated installation sequence:
apt-get install imagemagick apt-get install php5-imagick apt-get install make php5-dev php-pear apt-get install libmagick9-dev pecl install imagick /etc/init.d/apache2 restart
Is "php5-imagick" needed?
Probably not, but it did update "php.ini" with the proper entry and what else I'm not sure. I didn't remove it and has caused no problems I'm aware of -- in all likelihood it got replaced. I'm also not sure that "php.ini" gets updated as necessary (some have reminded to do this) when going the pecl "compile from source" route, so I left the install sequence as how eye got to Tipperary.
Otherwise the "php.ini" entry was simply:
extension=imagick.so
Now I can go play.
• • • • •
May 1, 2008
What I forgot to say
Free Spirit Spheres
Sometimes the problem writing these posts is turning the corner and not finding your way back which is what happened yesterday. Nothing wrong with writing about the link script but the original intention was to comment on 'preparing to get started' with programmed image manipulation. A matter of choices between the GD2 library or ImageMagick, neither included with the base web server installs here and no experience with either. Ultimately I decided on ImageMagick having looked at the command structures of both and finding that one less cryptic.
In line with the general scheme, I want to bring more automation to the image aspect as well. I have had an image download/uploaded script that auto-creates the image tags for some time but sizing images to fit or creating thumbnails remained a manual operation. Something that need not be under typical circumstances if one is willing to learn how. Having changed the directory structure with the last update here, the original code - such as it was - would need adapting to suit. It seemed like a good time to investigate alternative possibilities.
First we had to install ImageMagick and the PHP interface with a web server restart at the end. I'm running a late model Debian OS with Apache2 and PHP5, all of which is all fairly up to date. The installation went without a hitch.
apt-get install imagemagick apt-get install php5-imagick /etc/init.d/apache2 restart
Next I wanted to see if the thing worked and went looking for some test code. In the process of doing that, found that we can run things directly from the command line. Cool, PHP can wait. The first thing I wanted to try was converting some test images between GIF, PNG and JPG formats since those are essentially the staples, particularly with web sites.
Hey, it works!
After that I moved on to resizing. That worked too and if you just enter one dimensional value the program will auto calculate the other. Sweet. Photographs are almost always in JPG format so the next thing tested was compression adjustability. No problem. Unsharp mask? Yup, pick your poison.
convert eryn.jpg -resize 538 -quality 80 -unsharp .50x.25 -bordercolor black -border 1x1 eryn_small.jpg
So far I'd tested on relatively small files in the range of 1024x768 or there abouts (apprx 1-2 second processing times) and wondered how it would fare on the bigger stuff. A 12 megapixel camera might put out 4000x3000 JPG's around 5 MB each. On a Pentium III 800 with 256MB memory the same sequence of operations - read, resize, apply an unsharp mask, add border, recompress and write - took ten seconds on such an image. A 2000x1500 pixel image processed in about 3 seconds, roughly 1 second per megapixel.
I can live with the time having found it difficult to bitch, after all, what was the expectation. How long would it take to do those operations by hand? Besides, there are other fish to fry and one of those is the default PHP file size upload limit of 2 Megabytes. A couple possible solutions; increase the limit or use an uploader written in Perl for example. At any rate it is working from the command line which means the next step is fashioning code to perform the functions programmatically.
• • • • •
April 30, 2008
Preparing to get started
Tonight I knobbed on the link script which starts as a Bookmarklet (or Javascript bookmark if you will) on my browsers link bar. From any web page I might wish to create a link to, say for incorporation into this web page, I simply click on the bookmark. I think I've written on this before but anyway... the Javascript'd bookmark sends the HTML Encoded URL of the web page to the receiving script for processing.
[Here is the Bookmarklet code - broken into three lines to fit available space - it's really just one long line.]
javascript:void(location.href= 'http://192.168.12.202/links/?link=' +encodeURIComponent(location.href))
In this instance the javascript'd bookmark sends the URL to the links subdirectory at 192.168.12.202 which is one of the home servers here. Index.php then picks up the passed information for processing.
[Note: index.php is implied in this instance. I'll put it in if it makes you feel better.]
javascript:void(location.href= 'http://192.168.12.202/links/index.php?link=' +encodeURIComponent(location.href))
On the receiving end (index.php) we pick up the passed URL thusly:
<?php
/* Bookmarklet link passing test */
$link = $_GET['link'];
echo "<b>Link Target:</b> $link";
?>
And what you would get out of that for example:
Link Target: http://webpages.charter.net/daynotes/index.html
So we received the URL and now we need to make a link out it. Simple to wrap it up in "A HREF" tags and call it done but what about the descriptor? We can type the descriptor in by hand but wouldn't it be easier to start with the page title and edit that if necessary? I thought so and created code to download the raw HTML of the target into memory looking for a set of title tags like:
<TITLE>My Awesome Web Page</TITLE>
If we don't find a set of title tags we're left with bupkis but if we do find a valid title then we just extract the juicy middle and use that for our descriptor. This page for example would result in the following:
<a href="http://webpages.charter.net/daynotes/index.html">Hot Links to Hell Town - Beloit Wisconsin</a>
For the past couple years the link script has been used to produce most of the page links here. If you typed as many links as I have over the past decade you'd know why I like cutting that to a minimum. The repetition can be mind numbing to the point of loathsome. Now the question becomes how much additional work can the computer be instructed to do so I don't have to. Something that is up for investigation in relation to links.
•
Threat Level from Wired.com Declassified NSA Document Reveals the Secret History of TEMPEST
We've unofficially known about Signals Intelligence TEMPEST technology for a long time but at least somewhat revealing how far back it went. Now we have the various forms of Total Information Awareness (TIA) to contend with as covert operations branch into overt and the NSA in conjunction with Homeland Security (DHS) turns its searchlight of surveillance upon the American people themselves.
We don't know how advanced "state of the art" has become within spook central, certainly the lack of general public knowledge often leads to rather wild speculation, otherwise remaining out of sight and mind. I would doubt emmisive signals intelligence in the classic sense continues to be a preeminent technology of three letter acronyms although it most probably remains a very suitable and effective tool depending on circumstance.
Today the emphasis is on data collection, retention, dissemination and mining by massive clusters of supercomputers, their programs under constant refinement as they sort, sift and correlate the individual progress of people through time and space, constantly updating the internal map of relationships we all have one to another. With each passing bill, the Congress allows the tentacles of these machines to reach ever deeper into warehouses of information for its sustenance and growth.
All this but a matter of progressive implementation, current research and experimentation involves algorithms of predictive analysis as weighed against evolving models in the cause and effect of human behavior. Like most of you, I will likely live to see the day when pseudo cyborg warriors in full battle regalia kick down doors in the darkness with their warrants in execution of preemptive arrest. Reflexive remediation directed by a prime cypher of statistical probability in its robes of computational consideration, it will be the human hand in its torture that extracts the confessions.
I once stood before technology of the day and wondered aloud in its future if man had the capacity to control it. I doubted it then and I doubt it now, for therein lies the extremes of perversion, providence of power and profit.
• • • • •
April 29, 2008
The beaver pushed back
This morning I pushed the development code back to the 'beaver' which was summarily uneventful. There was a minor quibble with symlinks being static instead of relative. Easily fixed and I had to edit out two demo lines from the upload code. The whole process took less than ten minutes.
Later in the evening I started a significant update to the code converter which is responsible for preparing code segments for display primarily, but gets pushed into other roles as well. There is now a functional framework in place that allows me to specify operations on the code blocks as desired. This is enabled by marking various check boxes either singularly or in combination at the time of conversion and is something that can be expanded as future needs arise. Very pleased with that.
Also spent some time updating the menus in this area. Clickable links need to follow desired work flows, or perhaps more accurately stated as allowing desired process and procedure. From wherever I'm at to wherever I might want to go as a next step, I'd like that to be one click away and we are quite close to having that.
Stand alone link buttons need not be in a form.
<input type="button" value="home" onclick="window.location.href='index.php'">
Right around the corner I need to clean cobwebs from the upload script and am thinking of an improvement or two I might do there as well.
In the meanwhile:
• • • • •
April 28, 2008
Getting there
Last week I pushed a copy of the website creation code to an experimental server and have been knobbing on that as time permits. It turned out to be a significant organizational change since I would like to use the code base for more than just this place. Specifically I'd like to deep six Wordpress which I've been using locally as a note-taking/personal-storage application. Wordpress does work well for that but in comparison it's damn heavy, not near as easy to relocate and all my stuff is tied to the format.
Another part of the change was to unclutter the mix of code, graphics, images, content source files and html templates that had been dumped into one common directory. Now each has its own area based on function and all is much more manageable. Not so much as one module escaped modification and of course every feature had to be tested in every possible combination.
Along the way I got to toss a good bit of built up cruft and abandoned code otherwise while added some new features, notably 'one button' publishing of the two different views into daynotes. In the first version the 'helltown' page was templated but the original 'daynotes' page was not. Now they both are. In addition both are dynamically generated on the fly by default (locally) with static representations created within the publishing module at the time of upload. The result of that was significant streamlining of code while dropping two modules outright and rolling three other functions into one. No more five mouse clicks to publish the two pages, it truly is 'one click' publishing.
One problem I ran into was with the zip program in the backup module when encountering symlinks I had installed to help recreate the directory structure as found on charters server. Whenever the zip program encountered the symlinks it would archive them as though they were regular directories causing duplication. The -y option was supposed to prevent this but that too was problematic. I wound up switching formats to tar.gz with the added benefit of preserving ownership and permissions on the individual files.
Below is the modification to 'backup.php' along with the standard warning.
<?php /* Web Backup for Helltown Experimental */
$sizeofFiles = "-1"; $fileName = "badger_experimental_".date('ymd.Hi').".tar.gz"; $backUp = "tar -cf -"." ../helltown | gzip -c";
header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=$fileName"); header("Content-Length: $sizeofFiles"); passthru($backUp,$err);
echo $err; ?>
"It would be insane to use this on a public facing production machine."
Does work good though...
Moving forward there are a few more improvements I'd like to make with the next big thing to be added automation of image handling. The primary function of uploading images and their incorporation into the web page has been a feature since day one so what I would like to do is automate resizing, sharpening, bit depth and format conversions as desired. Thumbnailing wouldn't hurt either. Don't hold your breath on that one however, it's liable to be a while.
For now I need to consider when I might push the development code back to the computer that normally does this. Tomorrow maybe.
• • • • •
|