Monday, December 30, 2013

2013: Year in Review

Here are a few select highlights from my 2013.
  • I ended a six-year relationship.
  • My granddaughter was born.
  • I went on vacation to New Jersey with my daughter and got to see much of the family. On the way back, I moved my daughter's stuff AND HER CAT to Colorado.
  • I played my first ever Magic: the Gathering pre-release tournament (didn't win).
  • I competed in my first ever area Toastmasters speaking contest (didn't win).
  • I fell off the stage while posing nude for art students, nearly landing on the front row student's desk.
  • I started sketching - I'm such a newb at it.
  • I went camping. Repeatedly.
  • I made and wore two different Halloween costumes: Scarecrow, and a thrift store special.
  • I read 21 books, not including the many times I read and re-read ones that I wrote.
  • I went to a drive-in!
  • I finished my sixth NaNoWriMo - hit 50,000+ words, but still need to finish the story.
  • I moved from Longmont to Aurora.


Tuesday, June 18, 2013

Magic Styles

Someone on the NaNoWriMo list mentioned wanting different types of magic, and I remembered a document I put together a long time ago about that very thing. I don't have the web site it was on any more, so I'll post it here for reference.

Read more »

Wednesday, January 02, 2013

Vegetarian Moroccan Stew

1 T olive oil
A) 1 yellow onion, diced
A) 4 cloves garlic, minced
A) 1 1/2 T cumin
A) 2 t cinnamon
A) salt and pepper to taste

B) 1 lb butternut squash - peeled, seeded, cut in 1/2" cubes
B) 4 lg red potatoes cut in 1/2" cubes
B) 2 c vegetable broth
B) 1 can diced tomatoes with juice
B) (1 can garbanzos, drained)
B) (shredded carrots)
B) (cauliflower)

1 3/4 c water
1 box couscous

C) 1 c pitted, brine-cured green olives
C) 1/2 t lemon zest

D) 6 T plain yogurt
D) 6 T chopped fresh cilantro

Heat oil in large frying pan.
Add A. Cook 5 minutes.
Add B. Bring to boil. Simmer 20 minutes, stirring occasionally until squash and potatoes are tender.
Remove from heat. Stir in C.
Serve over couscous. Garnish with D. Serve with mint tea.

I don't think I've ever made this strictly according to the recipe. Stuff in (parenthesis) might be there, might not. Amounts get adjusted based on what's on hand. It's still tasty, though!

Wednesday, May 02, 2012

Sparkling!

My sister sent out a chain letter asking that you make a wish and read a prayer. It included a sparkly angel picture in it:



Is it bad that this is what leapt to mind immediately?


Thursday, April 12, 2012

Cascading Select Lists in WordPress (sometimes called chained selects)

Let me preface this by saying I'm pretty new to WordPress. I've not done anything with jQuery. I've used php for years, but only off and on. My hobby web site, www.OrcSports.com, was written using php.

I have been working on a project for a while now that makes use of custom post types. For these custom post types I wanted to include specific fields. Enter the Advanced Custom Fields plugin. I'm using version 3.1.7. Using this robust plugin, I was able to define the list of fields I wanted to display including select lists. Unfortunately there wasn't an easy way to have the options presented in a select list dependent on a previous select list. So I started working on that.


I found an example of cascading select boxes and tried to incorporate the script there into the output from Advanced Custom Fields. After losing a weekend and then some, in part because of the conflict between WordPress and using $() for jQuery that causes your functions to not work, here's what I came up with (file edits below refer to changes in Advanced Custom Fields files).

In js/input-actions.js:
After validation for select (line 96) add:
// parent_select
if ($(this).find('parent_select').exists())
{
if ($(this).find('parent_select').val() == "null" || !$(this).find('parent_select').val())
{
validation = false;
}
}


// child_select
if ($(this).find('acf_child_select').exists())
{
if ($(this).find('acf_child_select').val() == "null" || !$(this).find('acf_child_select').val())
{
validation = false;
}
}

In acf.php:
After add_meta_box in admin_head() (line 432) add:
if ($show == 'true')
{
$this->script_cascading_selects($acf['fields']);
}

After adding the select field (line 125) add:
include_once('core/fields/child_select.php');
include_once('core/fields/parent_select.php');

After instantiating the select field (line 140) add:
$return['child_select'] = new acf_Child_select($this);
$return['parent_select'] = new acf_Parent_select($this);

Add the following method:
/*--------------------------------------------------------------------------------------
*
* script_cascading_selects
*
* @author Brett Paul
* @since 3.1.7
*
*-------------------------------------------------------------------------------------*/


function script_cascading_selects($fields)
{
$cascade = array();
$field_keys = array();
if($fields)
{
foreach($fields as $field)
{
if ($field['type'] == 'parent_select')
{
$field_keys[$field['name']] = $field['key'];
}
if ($field['type'] == 'child_select')
{
$field_keys[$field['name']] = $field['key'];
if (isset($field['parent_field_name']))
{
$cascade[$field['name']] = $field['parent_field_name'];
if (!isset($cascade[$field['parent_field_name']]))
{
$cascade[$field['parent_field_name']] = "*";
}
}
}
}


if (count($cascade) > 0)
{
echo "<script type=\"text/javascript\" defer=\"defer\">
function cascadeSelect(parent, child)
{
var childOptions = child.find('option:not(.static)');
child.data('options',childOptions);


parent.change(function(){
  childOptions.remove();
  child.append(child.data('options').filter('.sub_' + this.value)).change();
})


childOptions.not('.static, .sub_' + parent.val()).remove();
}\n";


$cascade_function_header = "jQuery(function(){
cascadeForm = jQuery('form.post');
";
$cascade_function_body = '';
// Need to include javascript to handle cascading


foreach ($cascade as $key => $parent_name)
{
$cascade_function_header .= $key . "Select = cascadeForm.find('." . $field_keys[$key] . "Class');\n";
if ($parent_name != '*')
{
$cascade_function_body .= "cascadeSelect(" . $parent_name . "Select, " . $key . "Select);\n";
}
}
echo $cascade_function_header . $cascade_function_body . '});</script>';
}
}
}

Finally, add these two files (child_select.php and parent_select.php) to the core/fields folder. These started out as copies of select.php and were modified for specifics around parent and child selects.

Now that the file changes have been made, go into your Advanced Custom Fields interface in WordPress and set up your fields. The big distinctions here are:
For parent_select, your key values should only contain alphanumeric characters.
For child_select, you will include three columns. The first is the parent key associated with the select value and must match exactly to what you entered for the parent. A "*" here will show that selection for all parent values.

When you open up a post with a set of Advanced Custom Fields attached to it, you will see your select lists. Child select lists are not populated at the start. You have to select something from the parent before you will see options in the child select.

It seems to work pretty well, but I really just got done making changes for it. It's got to be tested!

Labels:

Thursday, March 22, 2012

Be Careful What You Call It (Prestige)


pres·tige/presˈtēZH/

Noun:
  1. Respect and admiration felt for someone or something on the basis of their achievements or quality.
  2. Denoting something that arouses such respect or admiration.


It was recently announced that on EverQuest II that the level cap is moving from 90 to 92, but that in order to get into those levels, you have to have at least 280 AA points. Then you get to start earning "prestige points" every other mini-ding.

Okay, now that I've lost just about everyone who doesn't play EQ2 or a similar game...

Can I just say that killing everything that's killable just to get experience points and AA points should not qualify you for something called "prestige?" Maybe consider a name change. I like "Minmax Points," "Raider Points" or "Munchkin Points." That way you don't have people who create characters that fit themselves into the game world, work to further their chosen cause, and refuse tasks that go against that character's belief being marginalized since they likely don't qualify for "prestige."

They don't necessarily need a name. They're already called "role players." That's what "RP" stands for in "MMORPG." But to think that they shouldn't be considered for or deserve prestige because they haven't killed enough mobs or done enough grinding makes no sense.

I am wondering if SOE is going to change the rules for Veteran Bonus. Currently you get a 10% Veteran Bonus for each character at the level cap. Now that the level cap is moving to 92 with a barrier for entry, I'm not likely to even have a Veteran Bonus any time soon. I'm not far off at 90/253 - 27 AA to go - but what's between 253 and 280 but a grind?

Labels:

Monday, March 12, 2012

Censoring Radio

Speaking of censorship... Wait, who was speaking of censorship? I was, over in my other blog (http://nanobrett2008.blogspot.com/2012/03/7-dirty-words-reading.html) talking about George Carlin. It annoys me when radio stations censor words that aren't expletives. Most recently that happened with "crystal meth" in the song Semi-Charmed Life by Third Eye Blind. Pretty much the whole song is about crystal meth, but heaven forbid we say those two words together! I guess that's why that radio station doesn't play anything by The Crystal Method.

Another example that is very similar is censoring "nuts" in the song The Bad Touch by Bloodhound Gang. I mean, c'mon, like the rest of the song has no double entendre or suggestive lyrics? Really? It makes me stop listening to that station.

Going a step further, there was the Aerosmith song, Jamie's Got a Gun, where the lyric, "and put a bullet in his brain" was replaced by another section of the song so that the lyric didn't sound as censored. Trouble is, it's the wrong lyric. It's noticeable and annoying.

What I really hate, though, is when the tempo of the song is thrown off so that the offending section can be removed from the whole. This happens with Rage Against the Machine and several others. The end of Killing in the Name, starting around 4:10, gets completely hacked or excised in its entirety, leaving behind a jump cut to the song's closing.

If you feel you have to censor songs like that, you might reconsider even playing the censored version in the first place. Maybe stick to some light rock from the 70's when these topics were never even broached. Oh, wait, maybe they were. Afternoon Delight, anyone?