Categories
meta pictures technology

Similarity

I have been using Darren’s Related Posts plugin (DRPP) for a long time. For my purposes it was the best plugin for showing related posts that I had encountered. After a while I decided that I was not completely satisfied with the way that it seemed to favor more recent posts. I developed a new algorithm that I felt would not give preference to newer posts unless they were actually more related.

When I learned that WordPress would be adding native tag support in version 2.3 I decided that I would create my plugin to work with tags after they arrived. Life got busy so I never worked on the plugin until version 2.5 came out (partly because I wanted to convert the post_meta “keywords” from DRPP to tags). I finally buckled down and created my Similarity plugin this week. I have tested it on version 2.3.3 and version 2.5 (I assume it will work with any version of 2.3). I will continue to test it on new versions of WordPress as they are made public. (Przeczytaj opis wtyczki po polsku)

Latest Version 2.13.1 (September 9, 2009)

New options make it possible to layout and style the php function generated lists (for sidebars) independent of the auto-generated list. – Version 2.13 was released with an incomplete development copy of the plugin so it did not have the promised functionality. (In other words, “Pay attention Miller.”)

To install it simply unzip the file linked above and save it in your plugins directory under wp-content. In the plugin manager activate the plugin. Settings for the plugin may be altered under the Similarity page of the Options menu (version 2.3) or Settings menu (version 2.5 or later).

Options include:

  • Number of posts to show – this is a maximum, it won’t invent connections that don’t exist, set it to 0 (or less) and it will display all matches.
  • Minimum match strength – enter a number between zero and one (one being a perfect match) and items related weaker than the number indicated will not be included – this limit is ignored for the one extra if that option is used.
  • Default Display if no matches – if there are no matches this is what will be displayed, this is not displayed if there are matches, but fewer than the set maximum.
  • Text and Codes before the list – assuming you want to do a list this is where you would place the <ul> or <ol> You may also place any other code you would like to have preceeding the list. (There are two boxes here – one for function calls in your template and one for auto-generated lists.)
  • Text and Codes after the list – this would be the place for </ul> or </ol> You may also place any other code you would like to have following the list.(There are two boxes here – one for function calls in your template and one for auto-generated lists.)
  • Output template – this would be where you place the <li> tags. (There are two boxes here – one for function calls in your template and one for auto-generated lists.) There are also 4 template tags you may use (in any configuration you can imagine) to define how the results are displayed
    • {link} – provides a link – equivelent to <a href=”{url}”>{title}</a>
    • {strength} – outputs the calculated degree of relatedness
    • {url} is the permalink for the related post
    • {title} is the title for the related post
  • Display format for similarity strength – Value displays the {strength} in a decimal format (0.873), Percent displays the {strength} in a percentage format (87.3%), Text displays {strength} as a word (Strong, Mild, Weak, and Tenuous are the defaults), and Visual displays a color block (Green for 100% fading to Yellow and then to Red for weak connections)
  • Relative mixing weights – these values determine the ratio given to the weight of tags vs categories when using the sim_by_mix function. Invalid ratios are treated as a 1 to 1 balance.
  • Custom text for strength – allows you to insert custom text (including markup) for the strength indicator when using the text display format. (Hint: using markup allows for the possibility of showing custom images.)
  • Show one more random related post – dig deeper into the related post list with one random selection (you can set a minimum strength for these random items).
  • Auto-display a Similarity list at the end of a single post – without modifying any templates.

The plugin allows for three function calls anywhere in your page templates or their shortcodes in text widgets (all use the same options):

  • <?php sim_by_tag(); ?> – determines similarity based on the tags applied to the posts (shortcode: SIM-BY-TAG)
  • <?php sim_by_cat(); ?> – determines similarity based on the categories assigned to the posts (shortcode: SIM-BY-CAT)
  • <?php sim_by_mix(); ?> – determines similarity based on the tags and the categories with the relative weights determined by the relative mixing weights setting (shortcode: SIM-BY-MIX)

Alternately you may choose to auto-display any of the similarity lists at the end of posts on single-post pages without getting into the php by selecting the function you wish to auto-display on the Similarity options page.

Categories
culture pictures politics

Our Chinese Finger Trap

Socialism is like a Chinese finger trap. Playing with it just a bit look harmless and even fun, but once you start on that road it much easier to get further trapped than it is to free yourself.

Chinese Finger Trap

Image based on stuck for lyfe by Chris Martin.

I read a great example of this in the comments on an article about some proposed seatbelt legislation – specifically the following interchange:

No mandate please | 8:43 a.m. Feb. 14, 2008

If I don’t want to wear a seatbelt, that’s my business. But the sponsors of this bill will cry…”it’s about safety”. Let’s all be honest. Bottom line…it’s not about safety. It’s about revenue. It’s about mining the drivers in Utah for more money over a silly (soon to be) law.

Legislators should stick to real issues. Seatbelt laws are unconstitutional.

Anonymous | 9:06 a.m. Feb. 14, 2008

How many people out there are not willing to wear a seatbelt but more than willing to sue the insurance company for injuries sustained for not wearing a seatbelt.

Anonymous | 9:18 a.m. Feb. 14, 2008

It is your business as long as you don’t expect Utah taxpayers to pick up your medical bills if you are out of work or disabled. Sort of like a smoker. Do it if you want but don’t expect me to pay your bills if you end up with cancer.

Really? | 9:18 a.m. Feb. 14, 2008

Do you really think that not wearing a seat bealt is just your business? Let’s say you don’t have insurance, like many Utahns, who is going to pay your medical bills? You will probably end up on Medicaid and the tax payers will have to pay for you… now let’s say you do have insurance. Do you think there is a possibility that my insurance rates will go up because of your expensive medical bills? Now let’s say you have a wife and kids, and you die due to your neglect, what happens to them? They may go on public assistance as well. They start getting Social Security death benefits. Can you see that more is at stake than “your business”?

YES REALLY | 9:38 a.m. Feb. 14, 2008

Hey Really… Yes I think it is just my business or whoever it is that chooses to not wear a seatbelt. You have a good point on the insurance statement, but that is just one of many things that could make your rates go up or have people get on public assistance. People can start getting Social Security death benefits from anything that might take someones life. I have to agree with the above comment, I do believe its not about safety, it really is about the money. We should have a choice whether or not to wear a seatbelt. Remember this is America.

Sagacious Inquisitor | 9:58 a.m. Feb. 14, 2008

To Really.
Sadly, your comments are based on the Socialistic notion that somehow society is responsible for me. Granted, Socialism is the dangerous system into which we have already slipped too far.

Once we already have a little socialism – such as government paying the costs of health care for those who can’t afford the choices they have made – it gets easy to use that as a lever to argue that the choices they make are no longer theirs to make but are within the reach of government to make those choices for them. The problem is that each time such an argument is made it becomes that much more difficult to be free to make our own choices – responsible for the consequences of our choices, and not responsible for the choices of others.

It is too easy to paint proponents of individual responsibility as uncaring towards those who are less fortunate than they are, but that is an unfair characterization of the position. I am fully in favor of helping someone in need. I absolutely desire that doctors be paid for their time and effort on behalf of people who cannot afford the health care they need.

The difference is that I believe we do a disservice to those who receive such help when the help comes from a nameless, faceless, impersonal government agency rather than coming from caring neighbors or relatives. Not only do they feel no urgency to improve their situations or to repay the kindness they have received in their time of need when aid comes from such an impersonal source, but it is impossible for government to fully tailor that aid to their specific situation which opens up the misfortune of some people to be used as an opportunity for gain by other unscrupulous people. With caring individuals involved in rendering the needed assistance there are greater safeguards against those who would take such advantage and more incentive for those receiving aid to lift themselves as much as possible.

If the vehicle of government could be used to eliminate social ills such as poverty or homelessness we would have found that solution after decades of government intervention. For all the efforts to use government for those noble ends we show little if any progress.

Categories
life pictures State

So Long HCT

I just went and saw my last show as a season ticket holder at Hale Center theater. I really enjoyed it as I have so many shows there, so why not get season tickets as I have ever since I moved back to Utah? Because HCT is a perfect example of what happens when the government hammer gets overused.

Back in May it was reported that HCT received state grant money in excess of $100,000. Nothing wrong with that except that the five top executives at HCT each earn more than $100,000 annually while the actors are paid no more than $60 per performance (that’s $180 per week unless they are double cast). There was a minor uproar over this when it was first reported. (Here is a copy of the original article from May.)

Before that time I had considered donating money to HCT beyond my annual season ticket price. Afterwords I had second thoughts about that idea. Laura did as well and she wrote to HCT explaining our concerns with taking government money while maintaining such a disturbing pay rate for top executives. Mark Dietlein, the President and CEO of HCT took the time to personally call us and respond to our concerns. In essence he argued that they had done nothing illegal and that the top executive pay was fully disclosed in applying for the grant money. (Kent Collins – a member of the HCT Board of Trustees – offered a similar defense in the Deseret News.)

Some people will argue that the government has a place in supporting the arts, others will argue that funding the arts is not the place for government. Regardless of which side of that argument you fall on I think it would be hard to argue that the government should need to fund an organization that can afford to pay their top executives $100,000 per year – not counting any money they earn through other business deals with the organization (read the original articles if you want to know what I mean there). If the organization needs government grants then they should be paying their top executives a more pedestrian salary (I would say nothing over $60,000 which would save them more money than they received from the grant). This is what happens when the government does things – everything is done by static rules and so long as you follow the rules you may reap the reward without regard to actual need. The rules are never so precise that all in need receive while all without need are turned away.

To the best of my knowledge, Dietlein spoke truly that they had done nothing illegal. But legal is not the final arbiter of right. Collins stated that:

Public funding for HCT is used exclusively to improve HCT’s product by increasing pay for cast and crew, and obtaining technical equipment, sets, scenes and costumes.

He does not seem to recognize that public money has no more buying power than whatever money they are using to pay their top executives six-figure salaries.

I now face the task of finding shows to see at places other than HCT.

Categories
life National pictures

HSA Figures

I’ve already admitted that Health Savings Accounts are not the full solution to our health care system, but they are among the most powerful tools that we have today. The example of Whole Foods grocery really illustrates the point.

Five years ago, the Whole Foods grocery chain switched to a high-deductible plan. If an employee has a sore throat or a sprained ankle, he pays. But if he gets cancer or heart disease, his insurance covers it.

Whole Foods puts around $1,500 a year into an account for each employee. It’s not charity but part of the employee’s compensation. It’s money Whole Foods would have otherwise spent on more-expensive insurance. Here’s the good part for employees: If they don’t spend the money on medical care this year, they keep it, and the company adds more next year.

It’s called a health savings account, or HSA.

CEO John Mackey told me that when he went to the new system, “Our costs went way down.”

Yet today, some workers have $8,000 in their accounts.

The same articles states that:

If people paid their own bills, they would likely buy high-deductible insurance (roughly $1,000 for individuals, $2,100 for families) because on average, the premium is $1,300 cheaper. But people are so conditioned to expect others to pay their medical bills that they hate high deductibles: They feel ripped off if they must pay a thousand dollars before the insurance company starts paying.

From my own experience when people really understand the program they like it. Here are the numbers that our company found as we have been shopping for insurance lately. We chose one high deductible plan and one standard plan that each employee could choose from. The high deductible plan was $2500 a year cheaper in premiums. We calculated that the worst case scenario for the high deductible plans – paying every penny of the deductible without receiving a cent from the insurance company – would cost $884 more than the same medical care under the standard plan (this assumes that much of the deductible is used in preventive care where the standard insurance charges a copay for each visit, if it were some accident that cost the whole deductible for the HD plan the difference is no more than $700). On the other side – the person on the HD plan has to spend a minimum of $3900 (okay it came out to $3899.99) before they have spent as much – including premiums – as the person on the standard plan.

When we started discussing the plans as employees there were 2 of us who were already planning on getting HD plans. By the time we made the decision on what plans to offer 70% of the company had decided to switch to HD plans.

Categories
life pictures

Crazy Storms

Most of the people in Utah know about the crazy storms that we have had the past 2 days (mostly yesterday). I thought I would share just two pictures showing the results in our yard.

Sunflowers after a windstorm

These are our sunflowers. They were already bending under the weight of their ripening heads, but they were over 9 feet tall. I’m surprised to see that two of them are still standing.

 Fence hit by pool

This is our fence, which we just put up this year. The wind caught a plastic pool in our backyard and blew it around the house and into the fence. The toprail is bent and will have to be replaced, and we have to  pour more cement around the gatepost so that it can be secure again.

It could have been worse – we could have lost our trees like the four trees that were downed in our church parking lot.

Categories
pictures technology

Snooping Around

While reading through my feeds today I learned from Kim Cavanaugh’s Brain Frieze about the official Library of Congress blog. I went over to have a look and got curious about what software they had running the blog. Maybe it was something about the familiar format of the postmetadata section that got me looking. I looked at the bottom of the page to see if there was a footer stating that it was powered by WordPress. I was not surprised to find no such mention – it’s easy to take that out. I then looked at the page code and found that the meta tag named generator was also gone – another place that WordPress identifies itself unless you change it – but I did find that the code looked very familiar again. I quickly spotted a reference to the “wp-content” folder – it is a WordPress blog running the Library of Congress blog. Here’s proof:Library of Congress Blog code
Screenshot of the code to the Library of Congress blog

By way of comparison, here is a screenshot of the code from my WordPress blog:My WordPress blog code

For anyone who might still be skeptical (or who might care) I later found a more obvious reference to WordPress in their blog code:Library of Congress Blog code with WordPress comments

Categories
life pictures

Too Busy

Yesterday was one of those days. I wanted to get the Christmas lights up on the house and possibly write another candidate endorsement. Instead my day went something like this:

  • Get up with Isaac for night feedings at 2:00am and 5:30am
  • Run 6 miles at 6:00am
  • Help get breakfast on the table for the kids who have kept Laura up since I left to run
  • Talk about what the girls want to do today
  • Start putting clips on the house to hang the lights
  • Run to the store for extension cords and light socket adapters (skipping lunch)
  • Have a friend over for games
  • Finish getting the lights up
  • Go to a dinner/Christmas party
  • Put the girls to bed
  • Feed Isaac for his late feeding
  • Fall in bed – looking forward to the night feedings

I would love to show a picture of the lights on the house but, thanks to a shortage of lights at the store, I only have half the lights I wanted so it still looks a little weak – even by my meager standards. I guess you’ll have to settle for a picture of what my hair looks like after a six mile run once I have run my fingers through it and it has had time to dry.

Hair after 6 mile run plus drying time.

Categories
life pictures

My Sign


I thought it would be fun to show the sign I made for our front lawn announcing Isaac’s arrival.

Categories
life pictures

Pictures as Promised

Here is the first picture I took of Isaac.

This picture was two experiments combined – first, use the self timer on the camera (I had never done that with this camera before); and second, get four children to look at the camera at the right time. I cropped the image, but this is us, today, after I brought the girls to the hospital from church.

One more of Isaac – lest we forget who’s day it is.