I know the articles have been terrible this week, but…Pandas!
I recently just installed the Bad Behavior and WP-minify plugins. In the past, I’ve had a lot of spam-bots peruse the site and make obnoxious work of the place. Bad Behavior should help block a lot of that traffic from getting through. Wp-minify is used to condense some of the page coding to help improve load times. I’ve never really any speed issues with servusamanu, but every little bit helps, especially on slower connections.
In other news, I just finished reading Dostoevsky’s Notes from Underground. It’s definitely not quite the masterpiece of Crime and Punishment, the psychological musings of the protagonist are not nearly as visceral, but you there’s a similar appraisal of pride, morality, and justice within the piece. In total, I found the work entirely confusing. Sentence by sentence it seemed muddled and without any direction. By the end of section and the work as a whole it somehow came together. It’s a nightmare to try to dissect, because the individuals parts don’t seem to really contribute to the whole at all. If you take any individual paragraph out of the story and read it, you’d be hard-pressed to construct from that any sort of narrative at all. So much time is spent pulling out bit of the protagonist’s personality, but not directly and not even through interesting anecdotes. Rather, a paragraph of nothing gives up a phrase or a ‘tik’ in the wording that suggests part of the narrators mental state and history, but even that is nothing unless compared against similar giveaways later. The individual hints come across as nothing and only the aggregation makes any sense. It’s fascinating, and mind-boggling.
In a complete departure from Dostoevsky, the next book in the queue is Pattern Recognition by William Gibson (of Neuromancer fame). I’m only a chapter or two in so I’ll save that for next week.
I’m also playing Napoleonic Total War. Excellent game, but my computer is choking on the battles. I need to toss some more RAM in, I think. Maybe soon, but not this week. I’ll be in New Orleans soon and it can wait till after that. I’m excited for the vacation. Images soon forthcoming…
Despite all the phenomenal stories, it turns out you can’t prevent yourself from being born…
I recently wrote a short story involving a shared electronic universe, something akin to a world of warcraft that people would upload themselves into. In my story, individual member’s minds were functionally virtualized into the world.
In this sort of existence, the potential for apparent paradox exists. If memory becomes digitized than the record could be altered beyond the knowledge of the memory itself and no temporal continuity needs to be maintained. Paradox cannot truly happen, but the definition of a paradox can be stretched broader than necessarily apparent. For example, it would be entirely possible for a person to go back in time, kill themselves, and yet till exist. The solution to the paradox is, of course, that the real world has changed the functional rules of the world in ways fully consistent with a larger existence.
That’s my general take of the article. We don’t know what the larger rules are, but through an appraisal of how things appear to be, we can derive what our more localized rules must be. Unfortunately, we don’t have any obvious capacity to confirm them. If some greater body of rules is set to disallow the appearance of paradox, than we would have no ability to comprehend that; the rules would change to adapt any new information. It’s sort of the ultimate Heisenberg Uncertainty Principle.
Yep…fun stuff.
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.
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/
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.
Wordpress 2.8 Widget/Plugin Design
Robert Drake on February 25, 2010 in Technology, Web Design | No Comments »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.
Privacy Law and Cloud Computer
Robert Drake on February 16, 2010 in Politics, Technology | No Comments »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.
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.

