Evil Little Thing

January 20th, 2012

Jessica Alhquist has taken a lot of flack from neighbors and classmates (and even elected officials) because she asked her school to take down a prayer banner. She’s blogged about the experience and for the most part the comments are supportive. That’s not the case in the comments on the local news sites. Most of the commenters who attack her don’t understand the First Amendment. Many confuse the Constitution with the Declaration of Independence. And many of the commenters are just downright nasty. Sabine however, gets it.

Jessica stood up for everyone by doing what she did. Including christians.
As you presumable know, christians come in many variations, some are hateful (Westboro Baptists), some are oppressive (mormons), some are violent (abortion clinic bombers, the norwegian terrorist), some are whacky (Harry Camping), many are immoral (catholic priests, mega church leaders), most are hypocrites (personal observation), many are bullies (just read the threats directed by CHRISTIANS at Jessica), many are uneducated (read the posts here), and some are christian in name only.
The Separation of Church and State protects us ALL from ALL of them.

And what’s ironic about this is that this all takes place in Rhode Island—the state that was founded by Roger Williams after he was expelled from the Plymouth colony, by the government-run General Court of Massachusetts, for “diverse, new, and dangerous opinions”. Many of the comments in the papers and from the people protesting at the school board meeting are along the lines of “We’ll she doesn’t have to look at it.” or “If she doesn’t like it she can move.” What they don’t seem to understand is that the First Amendment was put in place by the founders because they knew firsthand the dangers of allowing the government to impose religion on the citizens. And this isn’t a gray area. The banner is clearly in violation of the First Amendment, which applies to the states because of the 14th Amendment.

More MySQL goodness

January 11th, 2012

It can be tricky to update records in a MySQL database using regular expressions because the stock install doesn’t support replacement strings. Occasionally, you get lucky and your data can be manipulated with a combination of REGEXP and strings. This is one case.

My phonemes field is constructed of phonemes separated by spaces. e.g.


b ɛ,i n
bl æ,ə n tʃ
br æ,ə n t æ,ə

I want to update the Initial and Final sounds fields with the sounds IF they are consonants but not if they are vowels. My REGEXP selects all of the consonants—including sh (ʃ) and th (θ or ð) at the beginning ‘^’ or end ‘$’ of the phoneme. Then I split the phonemes field by the first or last space and place that value into the Initial or Final sound field. Along the way I convert it to lower case. Also note that I want initial the initial w to count as a consonant, but not if it occurs at the end—but my phoneme rules should have caught most of those.


UPDATE `words_for_slps` 
SET `I` = LOWER(SUBSTRING_INDEX(phonemes,' ', 1)) 
WHERE `phonemes` REGEXP '^[ʃθðbcdfghjklmnpqrstvwxz]+'


UPDATE `words_for_slps` 
SET `F` = LOWER(SUBSTRING_INDEX(phonemes,' ', -1)) 
WHERE `phonemes` REGEXP '[ŋʃθðbcdfghjklmnpqrstvxz]$'

REGEX and MySQL

December 23rd, 2011

I’m working on my words database using phpMyAdmin and thought others might benefit from some of the search expressions.

Find words that start with ‘Wr’ or ‘wr’ and the CVC category is not null.


SELECT *  FROM `words` WHERE `word` REGEXP '^[Ww]r[a-z]*' 
AND `CVC` IS NOT NULL

This gives me words like, Rhoda, Rhone, rhyme because I’m asking to start at the beginning of the word ‘^’ then look for either a capital or lowercase w ‘[Ww] followed by an ‘r’ and then any letter ‘[a-z]‘ that occurs zero or more times ‘*’. I’m further restricting the search to words that have an entry in the CVC category. In phpMyAdmin you can paste this into the SQL editing field or just use the REGEX in the word field and set it to REGEXP.

Here’s one looking for all the words that end in the letters mb and the CVC category is not null.


SELECT *  FROM `words` WHERE `word` REGEXP 'mb$' 
AND `CVC` IS NOT NULL

The ‘$’ means the end of the word.

This search yields words like climb, plumb, thumb.

This search looks for words like gnome and gnat. If you want you can leave out the [a-z]* and you’ll get the same result.


SELECT *  FROM `words_for_slps` WHERE `word` REGEXP '^[Gg]n[a-z]*' 
AND `CVC` IS NOT NULL

This one’s a little more complicated, I’m looking for words like tongue and dengue but don’t know if there are words with gue in the middle—like tongues.


SELECT *  FROM `words_for_slps` WHERE `word` REGEXP '^[a-zA-z]*ngue[a-z]*' 
AND `CVC` IS NOT NULL

You can’t do OR queries in phpMyAdmin interface everything is an AND. But if you do a query, then edit the SQL it is easy to make the query into an OR.

This is the original query to find words where the grade and level are NULL.


SELECT *  FROM `words_for_slps` WHERE `level` IS NULL AND `grade` IS NULL 
AND `CVC` IS NOT NULL

And here is the same code where all I changed is the AND to OR and just to be sure I’m getting the right results, I grouped the OR with parentheses. (I can never the default rules for the different languages so I always use parentheses so I’m sure I get what I want.)


SELECT *  FROM `words_for_slps` WHERE (`level` IS NULL OR `grade` IS NULL) 
AND `CVC` IS NOT NULL

I like this result but want to look deal with the shorter words first and then work my way up to the harder ones. I also want to skip the words that do not follow the rules (DNFR). Use <> for not equal.


SELECT *  FROM `words_for_slps` WHERE (`level` IS NULL OR `grade` IS NULL) 
AND `CVC` IS NOT NULL AND `CVC` <> 'DNFR' ORDER BY LENGTH(word)

Here’s the code I use to find all of the conosonants


([bcdfghjklmnpqrstvwxz]|ch|sh|zh|th|wh|ng|qu|wh|tch|ph)

And this finds all the vowels.


(a|e|i|o|u|aw|ow|ie|ae|oe|oy|oo|uu|y)

And this finds all of the CVCCV words. Note the {2} that finds exactly two occurrences of the previous search string.


SELECT *  FROM `words_for_slps` WHERE `word`
^([bcdfghjklmnpqrstvwxz]|ch|sh|zh|th|wh|ng|qu|wh|tch|ph)
(a|e|i|o|u|aw|ow|ie|ae|oe|oy|oo|uu|y)
([bcdfghjklmnpqrstvwxz]|ch|sh|zh|th|wh|ng|qu|wh|tch|ph){2}
(a|e|i|o|u|aw|ow|ie|ae|oe|oy|oo|uu|y)$

Roxio Toast – Crashes

October 4th, 2011

We’re redoing all of our software so that it works on OSX Lion so that means lots of Toasting. A couple of times I went home without quitting Toast and the next morning it was frozen. Force quitting got out of the app but it wouldn’t launch. I tried removing the preferences files. Still no luck. On two occasions, I reinstalled the app and it would still not open. The only solution I have found is very un-Mac like—reboot the computer. It’s worked the last two times so I think that’s the solution to freezes.

Hybrid Disc Problems with Toast and Director

September 20th, 2011

We’ve been using Toast to burn Hybrid CDs since 1994. When I first purchased the new version I was a bit upset that they took out the ability to burn old-style hybrid CDs. However, they didn’t remove the functionality, they just turned it off. Go into the preferences and enable “Show legacy formats and settings” and it will behave just like it did before. Well, almost. Now it has some really annoying animation, but otherwise it works the same. One other difference was a bit harder to track down and fix.

All of our software current software titles were made with Macromedia Director and with the introduction of OSX Lion they no longer work. The transition to Adobe Director 11.5 has been relatively painless except for some old Flash code in Actionscript 1.0 that hasn’t updated nicely to ActionScript 2.0.

However, when we gave the discs to some people in the office to test they got two errors. When they tried to run program from the disc, an application alert came up telling them “This application requires Adobe Shockwave 11, which can not be found. Click to download it.” If they try to copy it to the hard drive, they get a different error. “The alias “Gamename” cannot be copied to the destination, perhaps because the destination does not support this type of alias.” Our development machines don’t give any errors—even the alias one.

It turns out that the problem is in the way Toast handles (or rather doesn’t handle) aliases in the app bundle.

The app bundle looks like this

Hybrid CD Error

If you follow the aliases you’ll find that
DPLib ==> /Contents/Frameworks/DPLib.framework/Versions/A/DPLib
Resources ==> /Contents/Frameworks/DPLib.framework/Versions/A/Resources

Replace the aliases with the source files, and do the same thing in IMLLib.framework and ProjLib.framework. As near as we can tell the Current alias isn’t necessary and can be deleted from all three locations.

Once you have all your aliases replaces and successfully burned a test CD, make a copy of the Frameworks folder. You can replace the Frameworks folder in new apps with the one that you have working.

The solution was tested on OSX 10.3.9, 10.4.11, 10.5.8, and 10.6.8. We haven’t had access to a Lion machine yet.

Color Depth

September 17th, 2011

We started out making games with Director 4 back when Windows only supported 8 bit palettes and monitors were 640×480. We chose a background color from the Mac Palette that is hex #0066FF. About 5 years ago we updated our movies so that they would fill the whole screen on larger monitors. Most of the backgrounds and menus Flash .swf files. They scale nicely at all resolutions. We had a bunch of backgrounds masks that are solid colors so we just transformed them to 16 bit bitmaps.

We’re updating a bunch of Director movies to D11.5 so that they will run on OSX Lion and our graphic designer noticed that the backgrounds weren’t exactly the right color. It turns out that Director, for its usual inscrutable reasons, didn’t map the Mac Palette color to #0066FF and they ended up being #0063FF instead. Transforming them back to 8 bit and then to 32 bit fixed the problem.

What Were They Thinking – Fall 2011

September 11th, 2011

Apparently the algorithm that the ad network is using to match ads to the content of posts needs some work. An ad for these jokers showed up on a post bashing the religious right on its bigoted stance on gay marriage. I clicked to see why they would possibly want to advertise on a site that consistently bashes them. They seem to be missing a few choices.

WWTT Mingle

Is this really what christian women look like?
WWTT Date

It Gets Better

August 22nd, 2011

If you haven’t seen them, President Obama and Vice-President Biden each made a video for the “It gets better” project.

They can be found at WhiteHouse.gov

President Obama

And on a related note, Tony Perkins is a bigoted asshole—but you already knew that.

Tony Perkins is a bigoted asshole

Sorry to subject you to that. Here’s a video that brought tears to my eyes.

It gets Better—The White House Staff

What Were They Thinking – Summer 2011

August 5th, 2011

Who schedules maintenance for 4 o’clock in the afternoon on a Wednesday?
WWTT Maintenance

I think UPI might want to work on the spacing of their captions.

WWTT UPI Ramadan

I guess keyword matching isn’t a strong suit of Cafe Press.
WWTT Freethought Blog

I’m pretty sure they aren’t being ironic.
WWTT No God

I guess the add server doesn’t understand sarcasm.
WWTT No God

Random Music

July 23rd, 2011

Rodrigo y Gabriela

And something for Fred’s Detroit roots.

Sharon Jones & the Dap-Kings

Sharon Jones & the Dap-Kings

And for something completely energetic.

Learn to Fly

Cherokee
Gas prices are way down so now is the time to get up in the air. This economical trainer is so easy to fly you'll be out on your own in no time!