New Servusamanu!
I finally broke down and picked up a new theme for Servusamanu. As much as I’d like to take credit, this design isn’t my own. It’s a stock wordpress template called parchment draft with some modifications. I’m trying to really concentrate on writing (and reading) and, well, I wasn’t going to make anything much better than this.
The redesign also let me clean up a lot of things on the back-end that should make everything better overall. The downside: all the registered users were deleted so if you registered for any reason, you’d have to do so again. At the moment, I’ve got anonymous commenting turned on so for the moment there’s not much benefit to signing up really.
I hope everyone enjoys the redesign. More things to come.
~Robert
Bride Pop?
I don’t know either. It’s a slow day and I’m a sucker for infographics.
http://bridepop.com/everything-else/true-cost-of-average-wedding/
SuperScience Law
PsyOrg.com has published an interesting article on lawyer’s attempt to provide a methodology for dealing with ’super science’, that is, scientific experiments that could threaten humanity at large or at least significant sections thereof. I haven’t read through the paper it references, but the quote at the end is quite striking:
Courts must develop tools to deal meaningfully with such complexity. Otherwise, the wildly expanding sphere of human knowledge will overwhelm the institution of the courts and undo the rule of law – just when we need it most” Eric E. Johnson
Science and Law don’t always work well together just like technology and law. The people with the training and experience to understand the issues being questioned aren’t necessarily in an ethical position to appropriately rule on them.
Classically, science has been a relatively solitary profession or at least a contained one. This is still true for 99% of every experiment done, but our knowledge base has grown to a level that some genuinely frightening and dangerous discoveries could take place. How many thousands of movies have looked at that exact issue?
In a perfect future, these dangerous experiments can be secluded and quarentined, probably in space, thus minimizing the dangerous and capacity for liability present. Until then, however, Earth laws will hold sway over Earth science.
The article outlines many of the dangerous of science overstepping its bounds, such as miscalculations, professional and financial incentives to minimize security risks, etc. On the hand, reading this article I see an equally worrisome development. When science is subservient to law, science is forced to make a case for itself and this isn’t a fair fight. On any given day how much of the public will support research for research’s sake, the pursuit of knowledge for the sake of knowledge alone? Not enough to pass a vote. Even worse, the public at large has the scientific sensibilities of a sleeping gerbil. No one is worse prepared to understand and evaluate the truth, validity, or function of science more than the general public. How then, do we find the specialists and knowledge few who could make an informed decision either way? There’s no easy answer to that question.
I am a pessimist. I am a pessimist because I think the public is complacent and cowardly. If anyone can argue that there is any risk whatsoever than the public will be sufficiently alarmed to pass an injunction. Science will lose that battle every time, whether justified or not, simply out of fear and ignorence. My fear is that the future of humanity and human understanding will someday rest on the precarious scientific jurisprudence of a man with a high school chemistry class under his belt.
As much as I can empathize with the legal conundrum of allowing expert testimony from the very parties involved in an experiment, I think that’s unavoidable. The usual standards of the adversarial system have to be reappraised to prevent research becoming as bureaucratically slow as our laws. Even worse, a public indisposed to science cannot harrass and subdue research with an irrational fear of progress. There aren’t always two sides and the presumption of truth needs to fall to science.
That said, the law has its say and preventative injunctions must be considered even when illegal conduct isn’t necessarily about to take place. I would just want to see the bar placed high and the court strict against fearmongers, junk scientists, and superstition.
Curling Stones
Oh no?! Curling has only been an Olympic Sport since 1998, but it’s already almost out of curling stones. Apparently, the world’s best curling stones are made from blue hone granite, not to be confused with Welsh granite that makes distinctly sub-elite curling stones. Blue Hone Granite can only be found on Ailsa Craig, a puffin inhabited protected habitat. What a terribly strange fate for the sport of ice shuffleboard. Luckily, the stones should last decades at a time so I think Curling still has time left…
Wordpress 2.8 Widget/Plugin Design
I’ve made my first handful of widget plugins using wordpress. The first one took me a little over an hour. The others went by after about twenty minutes. Once you get the hang of the first one the pattern sets in and the process gets pretty easy. That isn’t to say that there aren’t some amazingly complex plugins, but the general develop is simple enough to justify using plugins for much smaller tasks.
In my situation, I’m supporting thirty odd websites that all use similar layouts, but they all have a different look and feel. The individual site owners customarily have a strong say it what goes on their site and how it is to be displayed. Because these sites are all separate and distinct and may need to be developed independently, I’ve chosen not to unify them as pages of a larger site. Instead, each site is a separate wordpress. At current, each site uses the same wordpress theme (developed by me), but that may change.
In this situation, widgets have been invaluable. They let the individual site owners customize their website but moving the widgets up and down or adding/removing them entirely. While this arrangement has been amazingly beneficial a few problems have arisen with some of the standard content items between pages. Every site, for example, has a link to a search tool that exists on a different site. The obvious solution is to create a text widget, drop the search html code in, and call it a day. This works…but it requires the site owners, (non-technical) to drop this code in and not drop anything else that might cause problems…that itself is a problem.
I knew early on that an adequate solution would be to “templatize” these common widgets. For example, I created the search widget with the proper html already included. I’ve dropped this template into each of the site directories and activated them, so all the directors have to do is move the widget around as necessary. I’ve done something similar with an ‘hours of operation’ widget, except I’ve given the owners a web form where they can input their actual hours. The public facing formatting is taken care of by the widget itself and the theme specific stylesheets.
Overall, I was pleasantly surprised to find out that widget development is simple enough that using it as a solution to easy but non-trivial issues is worth the time and effort.
As an example, I’ll break down my hours of operation code:
<?php /* Plugin Name: Library Hours Description: Widget with Control Panel Author: Robert Drake Version: 1.0 Date: 1/21/2010 Author URI: RobertDrake.net */
This is just a stock comment block to describe the code below, but the name and description are used in wordpress’ backend plugin management so make them useful.
class MHLS_LibraryHours_Widget extends WP_Widget {
By surrounding the rest of the code in this wrapped you take advantage of a whole bunch of code built into wordpress 2.8 that does a lot of the widget stuff for you. Older guides tend to include this code and the systems are backwards compatible (but not forward, meaning my code wont work prior to 2.8).
function MHLS_LibraryHours_Widget() {
$widget_ops = array('classname' => 'widget_mhls_libraryhours', 'description' => 'Library Hours' );
$this->WP_Widget('mhls_librarywidget', 'MHLS_Library_Hours', $widget_ops);
}
This block is honestly pretty confusing and as far as I can tell most of the names dont really matter all that much as long as you match the function name with the init at the end. Otherwise you specify a few look and feel type of things in the widget control panel and setup what prefix will go with your variables. Luckily, all that stuff is handled for you.
function widget($args, $instance) {
extract($args, EXTR_SKIP);
echo $before_widget;
$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
$monday = empty($instance['monday']) ? ' ' : apply_filters('widget_monday', $instance['monday']);
$tuesday = empty($instance['tuesday']) ? ' ' : apply_filters('widget_tuesday', $instance['tuesday']);
$wednesday = empty($instance['wednesday']) ? ' ' : apply_filters('widget_wednesday', $instance['wednesday']);
$thursday = empty($instance['thursday']) ? ' ' : apply_filters('widget_thursday', $instance['thursday']);
$friday = empty($instance['friday']) ? ' ' : apply_filters('widget_friday', $instance['friday']);
$saturday = empty($instance['saturday']) ? ' ' : apply_filters('widget_saturday', $instance['saturday']);
$sunday = empty($instance['sunday']) ? ' ' : apply_filters('widget_sunday', $instance['sunday']);
echo $before_title . $title . $after_title;
echo '<div id="libraryhourswidget">';
echo 'Monday: <span>' . $monday . '</span><br>';
echo 'Tuesday: <span>' . $tuesday . '</span><br>';
echo 'Wednesday: <span>' . $wednesday . '</span><br>';
echo 'Thursday: <span>' . $thursday . '</span><br>';
echo 'Friday: <span>' . $friday . '</span><br>';
echo 'Saturday: <span>' . $saturday . '</span><br>';
echo 'Sunday: <span>' . $sunday . '</span><br>';
echo '</div>';
echo $after_widget;
}
This is really the meat of the plugin. Extract takes the data (which is set elsewhere), assigns it to variables, and displays in straight html/css. This is what will ultimately be output to the screen so whatever you want to see needs to go here. Throughout the code you’ll notice a $instance being used frequently. Basically, when the variable names you use aren’t the full variable name. When I work with the variable monday, I’m actually working with the variable ‘widget_mhls_libraryhours 3 monday’ The first part of the name is specific to the widget name, and the second part is specific to the widget instance. In order to have multiple copies of the same widget you need to use the instance name to separate one copy from another.
The rest of that function is fairly boring. The $monday = part uses the tertiary operator in php to assign the variable to a non breaking space if there is no data in the variable. In another plugin, I had it assign a 0 so I could test for false later and restrict my output. Otherwise the filters are just sanitizing the user inputs for anything that looks like code.
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['monday'] = strip_tags($new_instance['monday']);
$instance['tuesday'] = strip_tags($new_instance['tuesday']);
$instance['wednesday'] = strip_tags($new_instance['wednesday']);
$instance['thursday'] = strip_tags($new_instance['thursday']);
$instance['friday'] = strip_tags($new_instance['friday']);
$instance['saturday'] = strip_tags($new_instance['saturday']);
$instance['sunday'] = strip_tags($new_instance['sunday']);
return $instance;
}
Easy function. When the user changes the data in the form fields this function updates the variables with the new values. That’s it. Cake!
function form($instance) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'entry_title' => '', 'comments_title' => '' ) );
$title = strip_tags($instance['title']);
$monday = strip_tags($instance['monday']);
$tuesday = strip_tags($instance['tuesday']);
$wednesday = strip_tags($instance['wednesday']);
$thursday = strip_tags($instance['thursday']);
$friday = strip_tags($instance['friday']);
$saturday = strip_tags($instance['saturday']);
$sunday = strip_tags($instance['sunday']);
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('monday'); ?>">Monday: <input id="<?php echo $this->get_field_id('monday'); ?>" name="<?php echo $this->get_field_name('monday'); ?>" type="text" value="<?php echo attribute_escape($monday); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('tuesday'); ?>">Tuesday: <input id="<?php echo $this->get_field_id('tuesday'); ?>" name="<?php echo $this->get_field_name('tuesday'); ?>" type="text" value="<?php echo attribute_escape($tuesday); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('wednesday'); ?>">Wednesday: <input id="<?php echo $this->get_field_id('wednesday'); ?>" name="<?php echo $this->get_field_name('wednesday'); ?>" type="text" value="<?php echo attribute_escape($wednesday); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('thursday'); ?>">Thursday: <input id="<?php echo $this->get_field_id('thursday'); ?>" name="<?php echo $this->get_field_name('thursday'); ?>" type="text" value="<?php echo attribute_escape($thursday); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('friday'); ?>">Friday: <input id="<?php echo $this->get_field_id('friday'); ?>" name="<?php echo $this->get_field_name('friday'); ?>" type="text" value="<?php echo attribute_escape($friday); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('saturday'); ?>">Saturday: <input id="<?php echo $this->get_field_id('saturday'); ?>" name="<?php echo $this->get_field_name('saturday'); ?>" type="text" value="<?php echo attribute_escape($saturday); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('sunday'); ?>">Sunday: <input id="<?php echo $this->get_field_id('sunday'); ?>" name="<?php echo $this->get_field_name('sunday'); ?>" type="text" value="<?php echo attribute_escape($sunday); ?>" /></label></p>
<?php
}
}
This function (and I’ve included the closing bracket of the starting class) looks kind of obnoxious but its really just setting up the user form in the backend. The top half sets the variables and the second half sets a form. You may be wondering why there is no <form> in there. Wordpress actually takes care of that stuff so no worries. It’ll drop your code into its own form and use the standard formatting of the admin panel so everything looks uniform.
add_action( 'widgets_init', create_function('', 'return register_widget("MHLS_LibraryHours_Widget");') );
This is the last line. It’s used when activating the plugin and registers everything in the appropriate places for wordpress to work with. Simple plugin. Simple code.
That’s it. I’m looking forward to coding up some more and more interesting plugins. I’ve already got a few ideas in mind for things that would help me. I’ll try to post things periodically as they become interesting.
Modern Network Specialist
I am the very model of a modern network-specialist
I am a PC service anesthesiologist
When I find a bug, I am something of an exorcist
From windows to a Macintosh, full service, nothing missed
I’m well-acquainted, too, with matters technologist
I understand the programs as an open-source idealist
About technologic theorem I’m teeming with some google news,
With many cheerful facts about the printer cartridge fuse
I’m very good at javascript and a wizard with firefox three
I know the acronyms of things, right from A and then all to Z
In short, a PC service anesthesiologist
I am the very model of a modern network-specialist
I know our website history from yahoo to old ask dot com
I cable fast ethernet, takes two fingers in sync with my palm
I type in obfuscated code to build artificial sentience
A broken line can cause peculiarities or bad events
Some times I prefer microsoft to Linux but dont let that spread
I know the groaning screeches of a hard drive an-ni-hi-lay-ted
Then I can hum a fugue of which I’ve heard on login screens before
and whistle all the beeps from that infernal windows welcome tour
Then I write a ticket out in technologic cuneiform
and tell you ev’ry detail of wikiped-ya misinform
In short, a PC service anesthesiologist
I am the very model of a modern network-specalist
In fact, when I know what is meant by jpg and php
when I can tell at sight a hewlet packard from a dvd
when such affairs as brown-outs and patch tuesday, I am more wary at,
and when I know precisely what is meant by meebo instant chat
When I have learnt what progress has been made in futurology
when I know more of networks than a novice in a library
in short, when I’ve a good reason to believe I should disagree
You’ll say a better network-specialist has never took a knee
for my electronic knowledge, though I’m plucky and creatively
has only been brought down to the beginning of windows XP
But still, a PC service anesthesiologist
I am the very model of a modern network-specialist.
Privacy Law and Cloud Computer
First, an article on the Fourth Amendment.
As a network administrator for a library system and a technical advisor for a cloud computer company, I have a certain vague relationship with electronic law. More often, technical necessity and security best practices determine how things should be done, but beyond all this there are legal requirements that do have to be met and further legal protections that should be protected.
The key paragraph in that link is:
In order for enough trust to be built into the online cloud economy, however, governments should endeavor to build a legal framework that respects corporate and individual privacy, and overall data security. While national security is important, governments must be careful not to create an atmosphere in which the customers and vendors of the cloud distrust their ability to securely conduct business within the jurisdiction, either directly or indirectly.
Laws must be appraised on a few points. Most importantly, how and why does a law infringe upon the rights of its citizens. Do the law’s protections provide an adequate compensation for the freedoms infringed? Finally, does the law provide a mechanism of recourse for those parties that have been affected.
As I see it, any law regarding cloud computing needs to make data within the cloud fundamentally private, or private by default with a handful of acceptable cases for disclosure. First, any non-intentional, non-targeted access by network administrators need to fall under a sort of ‘technician’s freedom’. If an account is having problems and a technician logs in to figure out the problem and happens to see some emails, this should not count as a privacy breach, assuming that this was a reasonable response to the problem and that reasonable precautions were taken to prevent that sort of disclosure. As usual, any sort of warrent of subpoena should be honored, but the standards of access need to be held high otherwise the integrity of the cloud are lost.
The idea that data must be encrypted to be considered secure seems faulty. Certainly data that is put up for public or open access is not ‘protected’. An open facebook page has no assumption of privacy, but an uploaded google doc does and should, regardless of encryption. Forcing encryption might be good technically (and probably is), but it does not serve any particular useful legal standard. Rather, saying that only encrypted documents are private within the cloud, suggests that the cloud, regardless of any user access that a customer would logically or contractual expect, has no protections whatsoever. A different analogy than the ‘locked briefcase’ should be considered.
‘I smelled something’ type police work should not be encouraged on the internet. Crime inevitably leaves a trial, usually a financial trail, and that’s where police work needs to start and end whether it be common fraud or the terrorism that will inevitable be used to justify some overarching data-mining operation that won’t actually help anyone. Any terrorist dumb enough to put any easily found keywords in his online documentation probably would have gotten caught anyone, and anyone more clever than that is going to be lost within the the billions of terabytes of data online. That’s another argument altogether, but as far as fledging cloud computer is concerned, some decent privacy laws are an absolute requirement both to reassure the customer and to bind the providers into a respect for privacy and security that, thus far, has been noticeably lax, as the frequent data breaches suggest.
St. Patrick’s Day 2
I will grudgingly admit that today is holiday, but if I’m going to celebrate some unnecessary Saint’s day I’d prefer to do St. Patties…again, but before. This other holiday people celebrate is a damn stupid thing, but comes with an interesting roman background. Romantic stuff, eh? Where can I buy a Valentine’s Day card with a picture of the Lupercal Cave on it… Guess I’ll have to stick to my usual 2/14 decoration.
Night Shots
I must have played Sim City 2000 for five years straight. I made a thousand cities, some small farmer villages other suburban burgs lined with trees and schools. I made epic metropolises that covered the ground like moss and rose into the sky, well beyond the long lost streets. The later simcity games were even more visceral. Simcity 4 was practically a city planning guide and my cities, all interconnected and interdependent, were amorphous and uncontrollable. They ate away at the land and leveled entire mountains, expanding without any particular guide or reason. Some cities I let flounder, others I forced higher and wider, hungry organisms intent on becoming organisms of their own.
While the later games, simcity 3000 and simcity 4, were visually stunning and phenomenal games, they lacked part of what made simcity 2000 special and not the least of that was the extended manual that came with the special edition (or perhaps commemorative edition, I don’t remember anymore.) It was a standard game manual (back when games actually came with those. Allow me a moment to weep over my long lost Baldur’s Gate manual, a dusty tome with faded pages and gold ink. That was a masterpiece.) The simcity 2000 manual came with a dozen essays and a similar number of images written about cities. They described cities as homes of people and their lives and similarly as mindless corporate jails where the inhabitants are little more than guests. They applauded the glorious gentrification of a decaying, forgotten neighborhood and bemoaned the crime infested grime of the city center.
Simple as that manual was, those writers are really what gave me an interest in ‘the city’ as something more than a crowded nuisance, a place to live while hoping to live elsewhere. The photos found at . A ghostly Big Ben, the Eiffel Tower looming over a darkened city, bright streets dizzying with activity, all cities as lived in and inevitably forgotten as Rome. It is history, like a textbook, but it is current history and so it is very alien and tells a story without ignoring the details.
I am currently Evil IT Guy
Does this mean I’m getting some article reviewers and wordpress designers on staff soon?
