Subscribe: Workbench
http://www.cadenhead.org/workbench/rss.xml
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
bizar  blog  confidence pool  game  games  server  smarty >assign  smarty  story  time  web  wordpress  years  zimmerman 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Workbench

Workbench



Programming, Publishing, Politics and Popes



 



News Sites Try to Load Malware from Eclampsialemontree.net

Mon, 30 May 2016 09:01:37 -0400

For the last four days, my anti-virus software has been blocking a possible virus when I visit some popular news sites. The URL flagged as a virus is a subdomain of eclampsialemontree.net that has a long string of random characters and looks highly suspicious. A report on VirusTotal indicates two anti-virus providers are blacklisting that domain as a malware site.

The latest site where I encountered this virus alert was a story on Stars and Stripes. I'm not embedding a link for obvious reasons, but it has the headline "Veteran, one of 4,200 mistakenly declared dead by VA, feels 'resurrected.'"

In the Google Chrome developer console, I can see that when the story is read, the URL is being loaded in an XmlHttpRequest by this JavaScript code on the news page:


This code is provided by Press Plus, a company that manages newspaper subscription paywalls. I think the purpose of the script is to superimpose a box above the story that urges a reader to subscribe to the site.

The script does not have any reference to eclampsialemontree.net, so I don't know why it is attempting to make a connection to one of its subdomains.

I've encountered this 24 times on different news sites. I'd like to figure out why it's happening. I post a lot of links to news stories on the Drudge Retort and I can't link to a site I believe might have been compromised by a virus.

(image)



First Post On This New Web Server

Sat, 28 May 2016 11:23:53 -0400

Six months ago I retired a web server I had been using for 11 years. I commemorated the occasion because I was paying for a server to host my sites that had become a museum piece.

Linux is so good at running Apache, MySQL and PHP that your hardware can become a decade out of date without performance becoming an issue.

My other two web servers were almost as old. The company I use for hosting, SoftLayer, recently offered me a deal to upgrade. A sales rep told me, "After reviewing your account we noticed that you are still are on our older legacy platform. Many of our customers have migrated off this platform, and you are one of the few who still remain on it."

I just completed that move. My sites are running on new servers over 20 times as fast and my monthly hosting costs have dropped from $652 to $326. That will save me almost $4,000 a year.

If you see this post, it worked! One bug down, many more likely to go.

(image)



Villains & Vigilantes Creators Win Settlement to Publish Game

Thu, 14 Apr 2016 20:45:17 -0400

After the longest court battle in the history of tabletop roleplaying games -- four years, eight months and 16 days -- the creators of Villains & Vigilantes have secured the rights to publish the game they created as teens in the 1970s. On Tuesday night, Jeff Dee and Jack Herman of Monkey House Games uploaded a version of the game to DriveThruRPG that included some new text in the copyright indicia (emphasis mine):The Monkey House Games logo is a trademark owned by Monkey House Games. All characters, character names, and the distinctive likenessesthereof are trademarks owned by Monkey House Games. Villains and Vigilantes is a trademark of Scott Bizar, used with permission.This language is the first official sign that a settlement has been reached. I asked Dee for details, but all he was ready to say is that they are "pretty happy."On July 27, 2011, Dee and Herman sued Bizar, the publisher of Fantasy Games Unlimited, for copyright infringement, asserting that his contractual right to publish their game had expired many years earlier and he kept this fact from them. The lawsuit began in Florida, moved to Arizona and ultimately reached the U.S. Court of Appeals Ninth Circuit. I covered the case in detail in two posts on this blog:Villains & Vigilantes Creators Sue Game's Publisher, Aug. 4, 2011Villains & Vigilantes Creators Win Rights to Game, March 18, 2013Dee and Herman signed a 1979 contract with Bizar that gave them the game's copyright. A contract three years later to publish a comic book stated that Fantasy Games Unlimited owned the trademark. After Bizar stopped being a full-time game publisher in 1987, Dee and Herman tried for years to reach a deal to publish the game under the trademark, to no avail. Then in 2010, a fan of the game who is also an attorney discovered that Bizar had dissolved Fantasy Games Unlimited Inc. in 1991.Under the contract, this reverted all rights to Dee and Herman, so they published the game as the newly formed Monkey House Games. Bizar disputed their right to do this, and thus began the titanic battle of the lawyers.Dee and Herman prevailed in court when an Arizona judge ruled in 2013 that Bizar lost all of his rights to the game by selling zero copies of it from 1990 to 1994. The judge also ruled that Bizar never had rights to publish electronic editions or derivative works, two things he's been doing the past six years on the Fantasy Games Unlimited website.Bizar filed an appeal and the case was taken up by the Ninth Circuit Court of Appeals, which affirmed in a July 7, 2015, ruling that Bizar had lost the rights to publish the game over 20 years ago:[T]he contract expressly provided that the agreement would terminate by operation of law if FGU, Inc., ceased to do business for any reason. The agreement also prohibited the assignment of any rights under the contract without the written consent of the other parties. By the terms of the agreement, when FGU, Inc., was dissolved in 1991, allrights to the 1979 and 1982 Rulebooks reverted to Dee and Herman. Accordingly, all sales after the 1991 dissolution of FGU, Inc., of the 1979 or 1982 Rulebookswere infringing acts.Despite this finding, the appeals court sent part of the case back to Arizona to decide whether Bizar still owned the trademark.Dee, an artist well known for his illustrations on early Dungeons & Dragons books and supplements, has been producing new games and Kickstarter projects in recent years at a prodigious pace -- which I assumed was due to the costs of fighting this court battle. In September of last year, Dee asked fans for help with legal expenses on GoFundMe, receiving $26,755 from 523 people. He wrote this in the fund-raising appeal:Our claim that the publishing rights reverted to us has been upheld in court, but our opponent still claims to own the trademark to our game's name and he's suing us for using it. If he wins on that count, he'll be able to seize our creation and financially ruin us. We've been fighting for our rights for several years, and frankly we nee[...]



Fix a 'Missing: Updated' Error in Google Search on WordPress

Fri, 08 Apr 2016 20:02:19 -0400

Google Search Console reported a bunch of structured data errors in a new WordPress blog I began recently. This was a surprise, because I didn't know I was offering structured data. The WordPress theme I've been using, Twenty Twelve, includes CSS styles in blog posts to support the hAtom microformat, which helps search engines recognize the components of a blog post such as the title, author and tags.

When Google crawled the blog, the Structured Data section of Search Console flagged 20 pages with the error "missing: updated," which indicated the data should have an element called updated that isn't there.

(image)

I did some digging and found that WordPress bloggers are solving this problem in some complicated ways, like adding a plugin just to filter the structured data out. But I found an easier solution.

The updated style indicates when a blog post was last updated. In every page that displays a blog entry, updated should be in the HTML where the post time is displayed. Here's an example prior to the fix:

Any blog post can include hAtom structured data by adding class names to the tags that surround an element. The updated class should be added to the time tag, turning the HTML into this:

In the folder for my blog's theme, I found the file I needed to edit to add this fix: functions.php. This file is a collection of PHP functions to enhance the theme and modify WordPress functionality.

In a function called twentytwelve_entry_meta(), I found the line where the blog post's time is displayed. I edited the line to add the reference to updated. Here's the line after the change:

$date = sprintf( '',esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);

I'm still learning about WordPress and not ready to make major changes to a theme's PHP code, but this fix is a minor adjustment to the HTML output, so I thought it would be safe to attempt. The fix was successful: When I test my blog's pages in Google's Structured Data Testing Tool they pass.

The fix I've described works in the Twenty Twelve theme -- and probably some of the other basic themes for WordPress. Because each theme has different HTML, you may find the code that displays the time someplace else.

(image)



Fix a 'No HTTP Transports' Error in WordPress

Sun, 27 Mar 2016 17:53:28 -0400

(image) I recently installed WordPress on this server for a new blog. I've been using homebrew software for years, but I want to see whether I like WordPress enough to switch this blog and others to the platform. I need all of my sites to be usable on mobile devices, a goal that is a long way from being true today. The new blog is far better out of the box on mobile than anything I've created on my own.

In the two weeks I've been running WordPress 4.4.2, I encountered several problems where it could not connect to resources on other Internet sites. I could not install themes or plugins in the web interface because of this error message:

There are no HTTP transports available which can complete the requested request.

I also could not use the Customize page or make the WP to Twitter plugin send messages to Twitter. I could avoid the problem with themes and plugins by installing them on my own, but the Twitter problem had no workaround.

I have PHP configured with Curl, so I didn't expect a problem making HTTP requests to other sites. But WordPress now requires SSL support in Curl. My version of the software lacked SSL. I compile my web server software from source on Linux instead of relying on package managers, so I needed to recompile Curl with SSL support. I thought that would be easy.

After much weeping and gnashing of teeth, here's what I had to do:

  1. Compile and install OpenSSL.
  2. In directories from which I installed past versions of Curl, run the command make uninstall in each one to remove it from the server.
  3. Recompile Curl with the configuration option --with-ssl, which found OpenSSL.
  4. Recompile PHP with the configuration option --with-curl, which found the new SSL-enabled Curl.
  5. Reboot Apache.

The last thing I figured out was Step 2. Before that, when I compiled PHP it found a version of Curl on my server that did not support SSL and used it by mistake. This made WordPress angry.

WordPress is now mostly happy and can post to Twitter successfully. Customize works, as do themes and plugin downloads.

There are easier solutions if you use a package manager and the right versions of these programs are available. But I've been compiling source code by necessity across my LAMP stack for years. There were features I needed that weren't offered in packages.

I anticipate more posts like this one as I kick the tires on WordPress.

(image)



Jake Tapper Asks Trump 7 Straight Horse Race Questions

Sun, 21 Feb 2016 16:08:15 -0500

I began watching the Sunday talk shows again last weekend because of Antonin Scalia's death, which propelled the U.S. into an exceptional time in our history. We'll be living with the consequences of how the next Supreme Court appointment is made for a long time. Watching one of the shows today reminded me of how terrible political reporting on television can be.On CNN's State of the Union, host Jake Tapper asked Donald Trump 10 questions:Mr. Trump, congratulations on your victory. What do you think this means for the race going forward? Are you unstoppable?Your campaign manager, Corey Lewandowski, said that you have not gotten the credit you deserve from the party for leading the race. Why do you think that is? Do you think some Republicans still don't take you seriously?Last week, Senator Rubio said he didn't think a brokered convention would necessarily be a bad thing. Are you concerned at all that party leaders might try to block your nomination at the convention?Senator Cruz says that you attack him every day because you know he's the only one who can beat you. Is that right?Governor Jeb Bush dropped out last night. He was once the front-runner, once expected to win the nomination. Many would point to you as the primary reason his campaign sputtered. Do you think, by labeling him low-energy and targeting him so quickly, do you think that's what did him in?You also took on Jeb's brother President George W. Bush in South Carolina, a state that he won in 2000. And then you won it handily, even though you took on George W. Bush. Do you see Jeb's loss and your victory in South Carolina as a vote on the entire Bush legacy, in a way?There's a lot of concern, as you know, among Republican Party leaders in Washington about, can you win a general election? Let's talk about demographics for a second. If the next Republican nominee wins the same share of the white vote that Mitt Romney did in 2012 -- that was 59 percent -- that nominee would need to win 30 percent of the non-white vote. Now, with all due respect, sir, a lot of Republican leaders in D.C. struggle to envision you accomplishing this, especially given the fact that there are white supremacist groups and individuals like that who support you, some of whom you have even retweeted.I want to get some clarification on comments you made this week at the CNN town hall about Obamacare. Take a listen. ... So, sir, what did you mean when you said, "I like the mandate"?But -- but, just to clarify, you're saying now that you would not support requiring every individual in America to have health insurance? You wouldn't support that?Last question, sir. We heard from your wife, Melania, last night, which doesn't happen a tremendous amount. Are we going to hear more from her going forward?By my count that's seven straight horse-race questions that are solely about who's leading and who's trailing, one policy question with a follow-up and then a nice softball question that lets him say something nice about his wife.Trump is the Republican front-runner and the favorite to win the GOP nomination. There's a great deal of importance in the media getting beyond his vague policy statements to pin him down on actual things he would do as president. Making America Yuge Again is not a concrete policy objective.Tapper had an opportunity to do this, but he thought the bulk of his time with Trump was better spent with such queries as "Are you unstoppable?"That's the kind of dumb-ass question a non-journalist would never ask. Political reporters ask them all day long.The one time Tapper delved into Trump's actual policies on health care and the individual mandate, we got to see that Trump is completely out of his depth. After he took insurance away from millions of Americans by killing ObamaCare, the only things Trump could suggest are to let states compete and offer healthcare savings accounts.The answer Trump gave was as floundering and repetitive as the Mar[...]



My Web Server is Older Than Your Web Server

Sat, 19 Dec 2015 20:26:28 -0500

This post is dedicated to the dedicated server I just shut down. A single Linux box at a server farm in Dallas was for many years the center of my one-man media empire. Over time I moved sites and services off of it, but it remained the home of my weblog [...]



SportsFilter's NFL Pick 'Em Contest

Tue, 08 Sep 2015 12:53:09 -0400

(image)



Orlando Sentinel Disappears Column on George Zimmerman

Sat, 16 May 2015 10:55:07 -0400

The Orlando Sentinel has dropped into the memory hole a commentary published Friday evening that called for the community to stand its ground against George Zimmerman. The piece, written by sports columnist George Diaz and titled "Time for Zimmerman to pull a Casey Anthony and vanish," was published at 5:43 p.m. and archived by Google two minutes later. As of 10 a.m. Saturday morning the commentary was gone with no explanation.Zimmerman, who killed unarmed teen Trayvon Martin in Sanford, Florida, on Feb. 26, 2012, during a physical altercation and was acquitted of second-degree murder a year later, was shot at this week in a road rage incident in Lake Mary but escaped serious injury. The alleged shooter, Matthew Apperson, has been charged with aggravated assault with a deadly weapon.The Diaz column included a sentence and headline that could be interpreted as advocacy of violence against Zimmerman. After quoting a jury instruction suggesting that Zimmerman could "stand his ground and meet force with force," Diaz wrote, "Perhaps the entire Central Florida community should file a motion to Stand Its Ground against Zimmerman."The column had the subhead, "Central Florida should stand its ground against George Zimmerman."Here's the full text of the spiked article:George Zimmerman is the gift that keeps on giving, but not in a good way. He is a fruitcake way past its expiration date, which should have been right after a jury found him not guilty in the death of Trayvon Martin in the summer of 2013.Zimmerman should have cashed in his chips that day after winning the lottery in the controversial spectacle of his trial.By legal standards, the jury got it right based on the evidence that was presented. By the court of public law's accounting, Zimmerman burned up his "Get Out of Jail Free Card."Most reasonable people have tried to move past the anger, despair and confrontational name-calling. Unfortunately, Zimmerman is not one of them.The latest incident involving his road-rage dance partner, Matthew Apperson, only amplifies the controversial noise of the George Zimmerman soundtrack.We've all dabbled in pop psychology when it comes to Zimmerman. Anger issues. Confrontational issues. Misunderstood Community Watchdog issues.Whatever. All I know is that I am sick of him. Like that pesky cockroach, Zimmerman is always a step ahead of the big sandal bearing down on him. Annoying little fella, isn't he?There are those who will whoop it up, celebrating that karma is catching up with a man whose reputation is forever stained with the blood of a dead teenager.I'd humbly suggest the bad karma is on everyone who lives in Central Florida. Zimmerman won't leave, dooming us to eternal damnation. Our streets aren't safe with Zimmerman behind the wheel. Anybody could get nicked by a stray bullet intended for him. Any woman who is clueless enough to date him seems destined to end up in a contentious, volatile breakup.Maybe Zimmerman is the unluckiest man in the world. Misunderstood. A Real American Hero.In three domestic-violence cases over the years, the women involved either refused to cooperate with police or refused to press charges. Most recently, Zimmerman and Apperson added another chapter to their wild history that includes three incidents. Flying glass scrapped Zimmerman's face after Apperson fired a shot. Apperson claims that he had been threatened by Zimmerman. No charges have been filed against either man.But a basic fact is that the common denominator involving these forms of mayhem is Zimmerman. Innocent or not, he is a magnet for trouble.So let me offer up a "Get Out of Central Florida Free Card."Here's a thought: Pull a Casey Anthony. She also wiggled free after standing trial in 2011 for the death of her 2-year-old daughter, Caylee. But at least Anthony had the good sense to jettison herself into a self-imposed Witn[...]



Brad Torgersen's 'Science Fiction Civil War'

Mon, 20 Apr 2015 13:20:07 -0400

Since 2008 I have voted in the Hugo Awards, the science fiction/fantasy honors that have the most prestige. The ballot for this year's awards has been hijacked by three right-wing authors -- Larry Correia, Brad Torgersen and Vox Day -- who ran bloc-voting campaigns that put their nominations all over the ballot to the exclusion of everyone else's. For months, they campaigned for people to vote for their slate of nominees by saying this act would stick it to a secret cabal of "social justice warriors" who had been keeping conservatives like them from winning.There is no cabal.Anyone can vote for the Hugos by buying a $40 supporting membership in the next Worldcon. That's what I did seven years ago, and since then I've been nominating works I liked without outside interference from anybody else, just like thousands of other fans.To give you an idea of how cynical and politically motivated the bloc-voting campaign was, Correia reached out to GamerGate for support in his attack on the Hugos. ("I think GamerGate has been awesome," he declared yesterday on Twitter.)Rather than cover the entire mess a week later than everybody else, I'll direct you to the blog of Game of Thrones author George R. R. Martin, who has written an excellent series of posts as an author who has participated in the Hugos since the 1960s and loves the institution of Worldcon.There's a lot about this situation that gets me all het up, but I'm beginning to savor the insane grandiosity of Torgersen (pictured above), a previously obscure SF/F author who led the bloc-voting campaign this year and dubbed it "Sad Puppies 3." On April 8, Torgersen wrote a blog post on his personal site called "The Science Fiction Civil War" that he later deleted.Here's the text of that post, which offers a fantastic glimpse into the preening self-regard that inspired him to lead a culture war against a much-loved SF/F award that fans of all political beliefs have nurtured since 1953:A personal note, from a guy who has been trying hard of late to recapture some of the sense-of-wonder he felt for science fiction, when he was a boy.The cannon have been fired. There's no doubting it now. Decades of simmering tension are being unleashed in an emotional struggle for the future of the field. The Hugo award is just a thing; a mere football. These divisions go far beyond a silver rocketship. They are drawn along political lines -- liberal, and conservative; progressive, and libertarian -- as well as along artistic lines -- taste, expression, and the desire for meaning. If one side has announced angry shock that Sumter got shelled, it's because that side had the luxury of ignoring the other side. At least until now. The grays have thrown off their teeth-grit veneer of second-class citizenship, and the blues are rallying to the status quo. Voices long quiet, have erupted with the yell of rebellion. And there is every sign in the world that the blues will stop at nothing to put down the grays.I remember when I used to think science fiction was this happy, fraternal place. If there were disagreements, they were small things, and no adult would let them stand in the way of a rousing all-for-one-and-one-for-all cheer. A round on the house for everybody, ladies and gentlemen! Hip-hip-hooray!I believe there may have been a time when the reality at least approached this naive impression -- an idea planted in my imagination, and fueled by the dreams of ambitious youth.Now I am no longer green. This year finds me a veteran. I have seen the quiet hate in the eyes of so many colleagues. For each other. For the other guys. For the people beyond the next rise of mountains. It is a hate bred by a thousand slights and prejudices, snobberies and injustices and cuts which have bled quietly into the night. You see it every time one professional's celebration is con[...]



Tackled Ohio State Student Was Wearing Booze Panties

Mon, 29 Sep 2014 13:17:27 -0400

(image)

There's a video going viral of a student running onto the field at the Ohio State/Cincinnati game Saturday night and receiving a ferocious open-field tackle by Ohio State strength and conditioning coach Anthony Schlegel to the roaring approval of the home crowd.

width="560" height="315" src="//www.youtube.com/embed/POL-4Kg_H4c" frameborder="0" allowfullscreen>

Press reports indicate that the student is Anthony James Wunder, a 21-year-old senior in mechanical engineering who is an Evans Scholar, a full tuition and housing scholarship for golf caddies based on grades, character and financial need.

If you're wundering what would make a college student put his academic career in peril so close to graduation with such a goofy stunt, the answer probably can be found in one of the photos of the incident from The Lantern, the student newspaper at Ohio State.

Take a look at the weird fanny pack Wunder is wearing as he's marched off by stadium security:

(image)

The distinctive red cap indicates that it's a Freedom Flask, secret plastic panties that hold 32 ounces of "your favorite beverage." The photo appears to indicate that Wunder's booze briefs were running on empty before his dash to infamy.

The Freedom Flask, invented by a former University of Georgia student who tired of sneaking alcohol into sporting events, requires pouring yourself a drink through your pants. The site offers this reassurance to potential purchasers: "If you think it may be awkward pouring a drink from your fly -- it's not. What's awkward is being the guy who gets his flask taken by security. To be honest, we wish we would have thought of this sooner."

(image)



M.C. Moewe and the Story That Got Away

Mon, 14 Jul 2014 15:35:24 -0400

You know how on cop shows there's often a veteran detective who can't let go of an unsolved case for years? My wife M.C. Moewe has been like that because of a story she reported that no publication will touch.She's a former investigative reporter who worked at the Daytona Beach News-Journal, Fort Worth Star-Telegram and other newspapers.Around a decade ago a big assignment was dropped on her desk: Family courts were giving custody of kids to a parent accused of sexual abuse and denying custody to the parent who alleged abuse -- even when credible evidence and experts raised alarms. Judges were delegating their responsibility to investigate to custody evaluators, experts shielded from legal liability who claimed that the concerned parent suffered from Parental Alienation Syndrome, a discredited psychiatric theory employed to completely dismiss allegations a child is being abused by a parent.Twice her story was accepted by editors, prepared for publication and then killed right before it saw print.It's the kind of story that needs a big media organization behind it. She tried several times to get it published, learning more each year about the subject as she heard from desperate mothers who lost custody of their children once they reported concerns about possible abuse. By her count, she now knows 30 women who've suffered this fate. I've heard her take long phone calls with these moms many times, and twice she attended the Battered Mother's Custody Conference. She's become an expert on a subject she never got to report on.Last month, M.C. decided to tell the story of the scandal in the family courts as a weekly series for Daily Kos. She isn't running the specific story that got spiked, but instead writes about the entire system. The first installment explains her reasoning:If I couldn't shine a light on a problem as bad as this one, then journalism just didn't fit with me anymore.So I decided to come here and write what I normally call thumbsuckers –- stories that explain how a system is broken –- about our family court system.She filed the sixth story in the series today, and it's a huge one: Mandatory reporters who tell the authorities about child abuse, as required by law, are losing their careers for coming forward:After two preschool children indicated their father was abusing them and one child tested positive for a sexually transmitted disease, a health care professional treating the youngsters followed her state's mandatory reporting law -- but now she's the one in trouble."They act like I made it all up," the professional, who agreed to be interviewed on the condition of anonymity, said of her state licensing board. "I have lost business and I'm having trouble getting back into a couple of insurance networks."She's confident she made the right decision to report the suspected sexual abuse but is baffled why a state agency has joined the alleged abuser in questioning her motives. "Less than five percent of children who report sex abuse are telling lies," said the professional.Child psychologists and others who work to protect abused children say this is a common scenario -- they report abuse and suffer retaliation when the alleged abuser files a complaint against them. They say the actions taken to punish them by government agencies speak louder than the mandatory child abuse reporting laws.Within minutes of posting the story, she started hearing from mandatory reporters who fear the consequences of doing the right thing. One said, "After reporting, in Pennsylvania, I hold my breath for a month."[...]



Programming a Confidence Pool for the World Cup

Wed, 11 Jun 2014 11:49:47 -0400

I did some coding yesterday to run a 2014 World Cup confidence pool on SportsFilter. The way a confidence pool works is you assign points to teams based on how confident you are they will win. In this contest, you get point values from 32 down to 1 and assign them to the 32 World Cup teams. The more points you assign a team, the more you are awarded when that team wins or ties a match.Anyone can sign up for a SportsFilter account and play. A prize will be awarded to the winner: the Adidas replica version of the official World Cup ball. The deadline for entries is shortly before the first match Thursday.I wrote the web application in PHP, stored the database in MySQL and used the Smarty PHP template engine for the presentation. This was a project I had to complete in a single day, so I didn't think I'd go to the trouble of using Smarty. I figured I would just kludge together some ugly PHP pages that had code and HTML markup mixed together.But Smarty makes it easier to present the HTML output of a PHP web application. I find that I write better PHP code when I use it and there's less debugging required to get things right.The way Smarty works is you write a PHP script that does the work such as collecting user input and storing data, make some variables from that script available to Smarty and tell it to load a template file that contains HTML and some simple code to present information.Here's the last part of the script that displays the contest entry form and validates what the user has submitted:// make data available to templates$smarty->assign('spofi', $spofi);$smarty->assign('page_title', "Enter the SportsFilter World Cup 2014 Confidence Pool");$smarty->assign('spofi', $spofi);$smarty->assign('form_output', $form_output);$smarty->assign('error_message', $error_message);$smarty->assign('random_team', $random_team);$smarty->assign('submit_widget', $submit_widget);// display output$smarty->display('header.tpl');$smarty->display('confidence-pool.tpl');$smarty->display('footer.tpl');Those three .tpl files are templates. The header and footer contain the SportsFilter layout and the main body of the page is in confidence-pool.tpl.Here's a portion of that template:{$error_message}

{$form_output}{$submit_widget}
Smarty's template language can do more than display variables. It has for loops to display every element in an array and formatting functions that can do things such as control how the elements of a date are displayed.I also used it on Wargames.Com. Here's some template code from the state directory pages:{foreach from=$stores item=store}

{$store.name}
{if $store.phone neq ''}{$store.phone}
{/if}{$store.city}, {$store.statename} {$store.zip}

{/foreach}The $stores variable is an array with link, name, phone, city, statename and zip elements.The ultimate goal of today's project is to make it possible for a website's users to create and run their own confidence pools for any sporting event that lends itself to this type of contest. One sport it would be ideal for is the NFL, with players ranking the teams playing that weekend and competing all season.[...]



Who Would Steal a Honda Odyssey?

Fri, 11 Apr 2014 15:00:48 -0400

(image)

I got up this morning to take my son to school and our minivan was missing from the driveway. It had been stolen. I kept pushing the key fob buttons expecting it to magically reappear.

Somewhere in Florida today there is a thief who appreciates the flexible cargo space and peppy car-like handling of the 2012 Honda Odyssey.

(image)



Ghost of Computer Author Past

Mon, 24 Mar 2014 17:00:13 -0400

(image)

You could tell a lot about an author or conference speaker by tracking the changes made to that person's short bio over the years. Here's how I described myself in 1996 for Java Unleashed, Second Edition, a frankenbook written by 24 authors in the book publishing rush after Java was launched:

Rogers Cadenhead is a web developer, computer programmer and writer who created the multi-user games Czarlords and Super Video Poker. Thousands of readers see his work in the Fort Worth Star-Telegram question-and-answer column "Ask Ed Brice." Rogers has developed Java applets for Tele-Communications Inc. and other clients, and is the coauthor of Teach Yourself SunSoft's Java Workshop in 21 Days. Rogers wrote Chapters 1, 5, 17 and 18 and contributed to Chapter 2.

It didn't take long for me to drop references to Czarlords and Super Video Poker, two online games I created for bulletin board systems. My friend Mark Terrano and I started a company to create multi-user BBS games right before the Web came along and killed the businesses of every potential customer. Our total earnings were $180.

Terrano did a little bit better on his next game venture. He was lead designer of Age of Empires II and is a founder of Hidden Path Entertainment.

(image)