Archive for the ‘meta’ Category

My ranking, from best to worst.

Doctor Strange
Guardians of the Galaxy
Iron Man
Marvel’s The Avengers
Guardians of the Galaxy Vol. 2
Thor
Iron Man 2
Avengers: Age of Ultron
Ant-Man
Spider-Man: Homecoming
Iron Man 3
Thor: Ragnarok
Black Panther
Captain America: The First Avenger
Thor: The Dark World
Captain America: The Winter Soldier
Captain America: Civil War
The Incredible Hulk

This January, I finally left the Republican party and switched to Independent. I’ve never felt like any party has ever matched my own thoughts, and the GOP has moved a long way from the ideals that President Lincoln started with when he founded it.

Frankly, I think the Democratic party more closely matches me than the GOP. I agree more with the Democrats when it comes to things like immigration, health care and living wages. However, there’s one thing that will prevent me from ever voting for a Democrat for President or Governor: the responsibility for those offices to appoint judges.

I think that generally, the executive and judicial branches of the government work fairly well. There are some big problems: such as the President going to war without the appropriate declaration of war from Congress. And there are problems with a President who will decide which laws to enforce, rather than enforcing all of the laws passed by Congress.

The recent marijuana enforcement shift by the Trump Adminstration is most welcome: they are saying that they will enforce the law as passed by Congress. DACA is similar. Whether I agree with those laws or not, they are the law and therefore should be enforced.

The real problem lies with the deadlocked legislature. I recently saw a criticism of the decision to enforce the drug laws by a Congressman. I mean come on! You are responsibile for changing that law! If you think marijuana should be legal, then pass the law rather than criticize a President that chooses to enforce the law.

Same with DACA – it’s the responsibility of Congress to allow the dreamers to stay, and they should allow it. Stop worrying about huge sweeping changes in health care or taxes, and just do your jobs with the little things.

And speaking of Health Care, the President again should enforce the law as written. How can he just make a declaration and eliminate a law he doesn’t like?

We’re living in a crazy time, where the status of the wealthy defines the economy, where some laws are not enforced, and where the legislature won’t pass laws but will complain when the laws their predecessors passed are enforced. Judges are left to change the law to be better or more appropriate, or executives must sign what are essentially illegal proclamations that overturn existing laws.

We live at the crux of Inalienable Rights and Societal Rights. Inalienable Rights are those which are always there unless taken away. They are rights that require resources to remove, and don’t require resources to grant. Things like Freedom of Speech or the Press. Freedom to Bear Arms or practice Religion.

Societal Rights are often confused for Inalienable Rights – such as Health Care or Living Wage. You can’t just declare them to be a right and be done with it – such “rights” must be supported by a society dedicated to providing them. Obamacare is doomed to fail, because it attempts to provide a Societal Right to Health Care, and then depends on non-governmental organizations to provide that right. Companies are beholden to their shareholders, and they will discontinue programs like participating in the Obamacare exchanges that aren’t profitable. No, the only way to provide Health Care as a Societal Right is with a single payer system, paid for by taxes, and to the detriment of insurance companies. Properly providing health care for everyone will decimate the health insurance industry. We, as a society, must determine if it’s a “right” that we want to support.

And for crying out loud, climate change GOP? If 1,000 engineers told you that a bridge was about to fail, and 10 said it was okay to drive on, would you ignore the 1,000? It’s real, it’s measurable, and the science points to people as the major cause. Let’s make good policy while we can. If India or China or whoever is a big polluter and reducing our emissions will result in a weaker economy, then by all means create economic incentives for those nations, but stop pretending it’s fake.

One final rant on Pro-Life and Pro-Choice, which goes to my original assertion about judges: I believe that we can all agree that we cannot determine medically when “life” begins. Therefore Pascal’s Wager applies: when the consequence of choosing one path is disproportionately bad, then you should always choose the path that is less bad. If “life” begins at conception, then the consequence of abortion is murder. If “life” begins after birth, then abortion eliminates the temporary inconvenience and risks of pregnancy and lack of bodily control, and the permanent changes that can also occur. Clearly, murder is far and above worse than the temporary inconvenience, risks and lack of control. Does anyone seriously disagree with that assertion? Obviously Pro-Choice supporters don’t believe it’s murder, but they don’t know it isn’t since they don’t know when life begins.

Of course, it only matters from a personal/societal perspective if there is no God, and murder is simply survival of the fittest, and society determines whether punishments are necessary for different types of murder. But again, Pascal’s Wager: can you afford to guess wrong?

Forest Flight is my first iPhone game. It’s localized in 10 different languages.

Fly your bug through five forests, avoiding or shooting down spiders and bats. Earn up to 3 simultaneous shots and use 1 huge shot per level.

Swipe up to fly up and back, swipe down to fly down and forward. Tap to shoot, and press and hold to fire a Big Shot.

Unlock levels when you finish the previous level, or purchase Chaos to unlock all levels, use up to three Big Shots per level, and play trillions of Chaos levels on Easy, Medium or Hard, created with the unique, built-in Randomizer Engine.

Includes the ability to disable sound effects or music for quiet play, and localization in 10 languages.

View in the US App Store

For support, enter your question or comment below.

Ask me about Unit Testing and I’ll probably say, “nice to have”. Unit tests are very nice to have … but sometimes the project schedule doesn’t include time to build the unit tests — which often take nearly as much time as writing the functional code. But when I have time, I really like good unit tests.

I’ve never found a PHP unit test framework that I like, so I roll my own. It’s evolved over time from “call functions and see if they fail” to “test all scenarios and track complete coverage”. Here’s the basic framework I use:

  1. All PHP files can conduct their own unit tests by simply executing them from the command line, e.g.
    • ]# php Project.php
  2. A script will run all unit tests
    • ]# ./unitTests.sh
  3. All PHP functions declare their usage so that coverage can be tracked

A “hello world” class of mine looks something like this:

require_once('unitTests.php');
class HelloWorld {
  function findWorld() {
    unitTestCoverage(__METHOD__);
    return "Earth";
  }
  function findGalaxy() {
    unitTestCoverage(__METHOD__);
    return "Milky Way";
  }
}
// Unit Tests
doUnitTests_HelloWorld();
function doUnitTests_HelloWorld() {
  // Only run tests when executed from the command line
  if (!(php_sapi_name() == "cli")) return;
  // Only run tests when it's THIS file that's executed from the command line
  global $argv;
  if (pathinfo(__FILE__, PATHINFO_FILENAME) != pathinfo($argv[0],PATHINFO_FILENAME)) return;
  // Create coverage arrays
  global $__localAllCoverage, $__localCoverage;
  $__localAllCoverage = [
    "HelloWorld::findWorld"
    ,"HelloWorld::findGalaxy"
  ];
  $__localCoverage = [];

  echo "HelloWorld.php unit tests\n";

  $msg = "findWorld test";
  $hw = new HelloWorld();
  if ($hw->findWorld() != 'Earth') {
    unitTestFailed($msg,[$hw]);
  } else {
    echo "Success $msg\n";
  }

  $msg = "findGalaxy test";
  if ($hw->findGalaxy() != 'Milky Way') {
    unitTestFailed($msg,[$hw]);
  } else {
    echo "Success $msg\n";
  }

  $diff = array_diff($__localAllCoverage,$__localCoverage);
  if (count($diff) != 0) {
    unitTestFailed('Tests did not have complete coverate.',[$__localAllCoverage,$__localCoverage,$diff]);
  }

  echo "\n\033[32m Success! \033[0m \n";
  exit(0);
}

And the unit test functions in unitTests.php look like this:

function unitTestCoverage($__f) {
  if (!(php_sapi_name() == "cli")) return;

  // Running unit tests!
  global $__localCoverage;

  if (!in_array($__f,$__localCoverage)) {
    array_push($__localCoverage,$__f);
    echo " .. {\033[94m" . end($__localCoverage) . "\033[0m} .. ";
  }
}
function unitTestFailed($msg,$data) {
  foreach ($data as $d) {
    print_r($d);
  }
  echo "\n \033[31m FAILED $msg \033[0m \n";
  exit(1);
}

In my script that runs every unit test, I check for the failure exit codes:

#/bash/bin

cd www/api/classes

files[0]=HelloWorld.php

for i in "${files[@]}"
do
  php $i
  if [ $? -ne 0 ]
  then
    echo -e "\n\nFAILURE in ${i}\n"
    exit 1
  fi
done

echo -e "\n\nALL TESTS PASSED!\n"

exit 0

I hope you like this framework as much as I do! It has ensured full unit test coverage and cut way down on bugs that get to a test or production stage.

I enjoy watching “reality documentaries” such as Alaska: The Last Frontier, Mountain Men, Yukon Men and Ice Lake Rebels. But I really don’t like “fake” shows, especially when they go out of their way to seem real.

That’s why I stopped watching Dual Survivor. Without Cody Lundin, the show lost its credibility in my eyes. I usually watch a show or two, then do some research to find out how legit it is.

Alaska: TLF and MM are, as far as I can tell, solid and real. I haven’t researched Yukon Men yet.

Today, I researched Ice Lake Rebels. The first thing I checked was the “remoteness” factor. The show portrays the people as far from civilization, far from help and resources. I was disappointed to see that they were within walking distance (or rowing if the lake wasn’t frozen) of a fairly large city. They can probably hit the Canadian equivalent of a 7-11 for a box of Twinkies. Check out the picture below – that island at the top right is the one on the show.

image

The city of Yellowknife is right there. In this case, I don’t think less of the people on the show, unlike the apparently very fake and scripted Alaskan Bush People. But I do think that the producers are being a bit deceptive. Some shots are high views of the island, and the developed mainland next to it are blurred, obscuring the docks and boats and buildings.

That’s NOT good television… but I am still watching the show. The Rebels clearly face some real dangers and some tough conditions. But I’m watching a bit more… skeptically than before.

EDIT
I did quit watching quite a while ago. It took a couple more shows for me to decide Ice Lake Rebels most likely wasn’t real.

I think scripted reality shows belong on network/dramatic television, NOT on purported “science” channels like Discovery, History or TWC. ILR has been replaced with Prospectors on TWC for me. 🙂

Every family has its customs, from eating dinner at the Outback Steakhouse on Sunday nights to the family vacation trip during the summer. There are special rituals that stand out in my memory: the coming of age ceremonies that transformed my cousins and me from boys into men.
 
My grandmother’s farm was the focus of the family while I was growing up. We’d visit almost every weekend, often staying the night during the summer. Their property and surroundings were in Midland, Texas, near the outskirts of the city. Oil pumps and mesquite bushes dotted the dry, dusty landscape. Randy and Ronnie, my two closest cousins, lived nearby. It was our Adventure Land and could easily rival staid, packaged and sanitized parks like Disneyland.
 
There we would find snakes, mice, jackrabbits, and our favorite: horned lizards. We called them horny-toads, and they were all over the place in West Texas. I’d put one in my pocket and it would kind of flatten out. They aren’t fast like other lizards, so I could easily catch them. Grabbing one of these was brave when you were only five years old. I’d carry them around for a few hours and let them go.
 
Grandmother’s house had this rock and weed garden in the front where the horny toads could be found. They also owned wide swaths of land around their house. I remember cows, a few horses, some chickens, a mean old bull and lots of alfalfa. That’s what they mostly farmed: alfalfa. My cousins and I came to know those fields very well. We would be assigned the task of moving the irrigation pipes during the hot summer months. They just lay on the ground, so we’d have to move them from one part of the field to another. That was a real chore. I’d remove the connection collar, then slide the big pipe out. The pipes were twenty feet long and had a nine-inch diameter. They weren’t too terribly heavy – at least I didn’t dare show they were heavy in front of anyone. One of us would pick up an end to dump out the water, and possibly dump out any rabbits that may have wandered into the nice, cool, water-filled pipe. We’d carry the pipes about fifty yards to a new spot and hook them back up, then walk back to the next set of pipes and do it again. Over and over. Hour after hour. All three of us were about eleven years old at the time, and it sure seemed like a lot of work for a couple of silver dollars. We were happy to do it: you knew you were “growing up” when grandpa invited you into his truck for a day in the fields.
 
Once all that alfalfa turned into hay bales in the fields, I worked hauling it onto a flat bed. Attached to the trailer was a hay elevator. It picked up square bales of hay and carried them way up in the air where they dropped out of the top. Sometimes they became stuck in the top. I’d pull them out with big hooks that resembled the ones used by that homicidal rain slicker slasher guy in I Know What You Did Last Summer. I’d stack them neatly on the trailer, hour after hour, layer after layer, until I was perched on top of five layers of hay bales on a rickety, swaying flatbed and hoping not to fall into the hay elevator the next time the wheels hit a bump.
 
Near the fields were some rent houses that my grandparents owned. At the end of the block was an old fireworks stand that we would operate around the fourth of July. It wasn’t a big stand: not much demand for fireworks out there in the sticks. What was really cool was to light a bottle rocket and hold it until just before it went off, then toss it high into the air. If I timed it right, the rocket would gain extra altitude from the boost. If I didn’t, the rocket would be pointed randomly at the dry grass, someone’s car, the house, or the person who threw it into the air. Then there was a mad scramble to avoid the widely careening firework before it exploded. I don’t think we burned too many things down.
 
Grandmother’s house needed burning down anyway. It was built in the 50’s, but it wasn’t vacuumed until the 90’s, if then. The pipes were almost totally corroded away from the super-hard water. I think they pumped it straight out of limestone or something. We didn’t dare drink the stuff. Using it to brush your teeth was torture enough. I’m not sure if I got cleaner or dirtier taking a shower, but I certainly gained a nice, shiny coating.
 
The backyard wasn’t any cleaner. There were random holes, snakes, flies and bits of unrecognizable metal lying around: farm implements that had seen better days. The fence was made of concrete blocks but it had no top. That made for empty holes where the blocks were with unknowable creatures living inside. Only the bravest of us would dare to walk on or near that fence. There was a rickety old wooden gate at the back. It led into the barnyard and the fields beyond. Sometimes the bull would get into the yard. I think. Maybe that’s just vivid nightmares of the bull getting into the yard or something, but I know there were bees around the side, near the extra front porch. If you had to mow over there, well, just make sure you were a fast runner.
 
On the opposite side from the bees and way in the back, there was a big hay barn. When we were old enough to go exploring on our own, probably about twelve, we could walk through the field with the bull to go play in the barn. I’d stay close to the fence, but there was a problem with that strategy. The entrance to the barn faced the road, and we came up on the backside of the barn. Therefore, I had to either risk the run in the field with the bull or else climb over the fence. The climb wasn’t a big deal; it’s where I was climbing to that was the problem.
 
Bees. Lots of bees. Hives of bees. They were kept at the end of that field behind the barn. I guess they helped pollinate the fields of alfalfa. Maybe that hive on the side of the house was founded by Columbus Bee. All I knew back then was that: 1) Bees made honey, and 2) Bees stung little boys. However, they were near the hay barn, and although it was a good walk from the house, it was fun to play in the stacks and stacks of hay. It was also the shortest path to the gravel pit.
 
After working in the fields all day, we’d go down to The Pit and play around. It was big, probably a football field in length and forty feet deep. It had a mucky, yucky, water-filled end where we would swim, usually with cousins and sisters from five to fifteen. We had to wear these ratty old shoes because the bottom of the “pond” had the sort of trash you’d expect in a gravel pit: old tires, rusting re-bars and other pointy, infectious objects. There was a sort of platform (too generous to actually call it a “dock”) on one side. It was just barely possible to jump off and sort of dive into the water, but we first had to walk around out there to make sure we wouldn’t impale ourselves on something. Usually we had to aim to the side to avoid hitting an underwater obstacle, and it seems like only we twelve-year-old boys made that leap of faith. The water was only about four feet deep, and we couldn’t see the bottom.
 
All of these adventures helped shape the boys in our family, but there was one final exam before you could say that you ran the gamut and survived.
 
Grandmother’s house was near, way too near, a sewage treatment plant. When the wind was just right, which was all too often, the smell would waft over the house and fields. We boys were drawn to that place like flies to carrion. We just had to go see what a sewage treatment plant was like. It was at the outer edge of walking distance, just past one of the fields and across a highway. I don’t know why the plant drew us, but draw it did. We would talk about it almost every weekend.
 
“Let’s go to the plant!”
 
“Nahh, I saw a truck and a bunch of people when we came up. They’re doin’ somethin’ over there.”
 
“Let’s go see what they’re doin’!”
 
And so the dialog went, always discussing but rarely taking the chance until the need to visit overcame the obstacles of distance, highway and danger. First we’d plan the attack.
 
“Right after lunch,” I’d whisper to Ronnie, “We’re goin’ to the plant.”
 
“What are we gonna tell Mom?”
 
“Nuthin’, let’s just go to the other block and play around. We’ll head off down the road when the coast is clear.”
 
“I’ll tell Randy.”
 
It was rare that we’d attempt the trip when the wind was blowing the stench across the farm. It couldn’t really be that much worse close up, right? We’d work our way toward the plant, down the road and across the highway. It was at least a twenty minute walk. We ignored the “Keep Out!” signs and clambered over the low fence to stare at the pools of ooze before running out of stench range.
 
This was the pinnacle of our coming of age rituals: visiting the sewage plant and getting the blast full on. It was our final family test of manhood.

I think that my best apps are the ones I create in order to fulfill my own needs. PhotoKiosk is one of them – I wanted a nice way to view and discover photos. I set it to view the Flickr public feed, Utata Pool, my own feed, plus a variety of tags. It’s cool!

I recently saw new toy prototypes for the next Batman movie, beautiful snowscapes from around the world, and even a ladies’ roller derby team party. It’s also cool watching what people tag as “iPad”. It’s usually a drawing created on the iPad, but sometimes it is children using the device or a new case. I saw a sort of stick on peel off case that created a form-fitted protective cover around the iPad.

I updated PhotoKiosk, so check out the Lite and paid versions in the App Store.

Here’s the Feed list I use on mine:

  • public feed
  • Utata Pool
  • wildlife (tag)
  • tiger
  • guitar
  • toys
  • iPad
  • batman
  • snow
  • landscape
  • funny
What’s your feed?

 PhotoKiosk turns your iPad or iPad 2 into a gorgeous kiosk, displaying photos from an unlimited number of Flickr photo feeds or compatible URLs. Also works with the iPhone and iPod Touch.

A password-protected setup screen allows you to add feeds using an individual ID, a group ID, tags, the public feed, or a custom feed URL, or any combination. Feeds can be easily switched on or off, and a description of each feed can be optionally displayed on the kiosk.

Feeds are automatically cycled based on the refresh time you set, and the number of photos to display can also be changed. Touch a photo to zoom in, triple tap the screen to access the settings (after also entering your password), or quadruple tap to refresh the page and move to the next feed.

Older pictures are smaller and/or more transparent, while the newest pictures show up larger and opaque. Tap any picture to zoom in to the fullest size possible.

Works in either landscape or portrait mode and automatically compensates when you rotate the iPad. Use it in conjunction with iPad kiosk hardware that hides the Home button to turn it into a photo display for trade shows, non-profits or other businesses.

In this version:
* Customize the kiosk name
* Custom kiosk description or per-feed descriptions
* Unlimited feeds
* Select the number of photos
* Select the refresh timeout
* Change the password

Available now in the App Store!

Updated to version 1.2 – fixed a bug introduced by a Flickr API call change. Also removed the interruptive error messaging.

Super Conversions/SuperConvert

SuperConvert is the iPad/iPhone/iPod version of the popular Super Conversions Windows application, with over 20,000 conversions possible in 18 categories: Distance, Area, Volume, Weight, Power, Pressure, Temperature, Time, Energy, Force, Acceleration, Illuminance, Concentration, Electrical Current, Hydraulics, Density, Velocity and Viscosity.

Now Available! Click here to view it in the App Store.

Updated to version 8.2, fixed a problem where it was ignoring decimal places.

 

 

 

 

 

 

 

 

 

 

 

December 2008. The snow turned to rain, falling steadily throughout the night, coating the forest surrounding my house with tons of ice. A layer of warm air, high above the surface, melted the falling snow. The air at the surface was still below freezing, causing the ice storm. I live down a one lane gravel road, tall trees guarding the road and the power lines that snake up the hill. Both mighty oak and tall pine trees were broken by the onslaught of ice, yanking the phone line from our home with a loud tearing noise, snapping heavy power lines in two. The grid went down at around 2am.

I ventured out every time a falling branch or tree shook the house, just wanting to check the integrity of our shelter. I didn’t venture far, and I wore a protective… well… a bike helmet… just in case. The crash of falling branches sent me scurrying back under the roof. Trees continued falling all through the night and even into the next afternoon. I wasn’t too worried – I was reasonably prepared for an extended power outage lasting, oh, three or four days.

I had a small generator – enough power for lights, a small electric burner, and a fireplace blower. I had 15 gallons of fuel, bought in advance of the storm.

I had a stockpile of good wood, enough to last maybe a week of solid burning. It was dry and underneath a tarp.

Our water comes from a well, but I had enough – we began conserving as soon as the power went out – even filling containers before going to bed.

The house is reasonably well insulated – it would keep warm enough without even a fire for several days, especially after I got out the duct tape and made sure the recessed can lights weren’t leaking warmth into the attic.

But this was no ordinary outage, and it showed me how little I was prepared to be off the grid for an extended period.

There were about 6 very large trees blocking the driveway, and about 30 smaller ones. My neighbor and I went through two chain saws clearing them. We just picked up the power lines and moved them out of the way as best we could – no way there was any juice running through them!

The family moved into our warm room, closing the door and putting a towel under it. We had a light from the small generator, plenty of heat from the air-blown fireplace, board games and plenty to eat. We put a table on the deck and emptied the fridge onto it, covering it with a tarp. We didn’t need no stinkin’ fridge! Not with the outside temperature peeking at 45 or so during the day.

The true extent of the disaster unfolded during the next few days. Power wasn’t just “out”, the entire grid infrastructure was broken. Hundreds of miles of power lines had to be rebuilt all over the Northern counties of Mass and some Southern New Hampshire areas.

Not only were we dead center in the disaster zone, but our house is one of the last ones on the grid. We were hosed. And we couldn’t even drive out of the disaster area – there was a huge tree hanging off a powerline in the middle of the road.

After six days, I began running out of wood. Water wasn’t too big a deal, and the food supply was still okay. But the nights were going to get really cold without a fire. The generator ran out of gas, too, so no fireplace blower. My wife had already left for a hotel in Burlington, Ma, with the kids, where her car window was shattered by a GPS thief. I stuck it out for a while longer and prepared the house to be on its own for a while. I left after, I think, day 9 without power.

It takes a lot of work to become prepared for an extended period off the grid. The best book I know of is Cody Lundin’s “When All Hell Breaks Loose”. It’s practical, not fanatical, and Cody lives what he teaches, having been off the grid for (correct me if I’m wrong) decades. I had some big basic things I wanted to do to be prepared for the next time it happens, and Cody’s book has done a great deal to fill in the blanks and give me confidence that I’ve taken the right steps.

Cody teaches the rule of 3’s – you can live 3 weeks without food, 3 days without water, but only 3 hours without warmth.

  1. Core body temperature.
    This means a simple fireplace isn’t good enough, nor is a six day supply of fuel. So, wood stove and lots and lots of wood. Better overall insulation in the house – plug the gaps. Quality sleeping bags – for everyone. No more SpongeBob overnight bags, might as well buy the good stuff.
  2. Water.
    Stored potable water – enough immediately on hand for a month for 3 people, plus enough in a backup source, plus the means to make it potable, for as long as 100 days for 4 people. In addition to the 50 gallons in our regular water tank. And then there’s the lake down the road, and several year’s worth of disinfectant for water. Yeah, we got that covered now.
  3. Food.
    Okay, so this one seems to be the hardest for some reason. Looking at all the food options, things that seem to make it easy……. Cody makes it pretty clear – just buy more of what you eat right now, and rotate it. That’s a little harder when you eat a lot of fresh stuff. But, some things are easy – more rice, more spaghetti, more spaghetti sauce, lots of Pop Tarts and cereal. Okay, maybe not as hard as I thought! Plenty of bullion cubes and hot chocolate mix and some instant coffee. And, well, go ahead and get that 10 pound box of powdered milk, but put it in a food safe plastic container!

It’s not too hard, and it’s mostly cheap – even an installed wood stove is less than $2,000. You don’t need to go crazy, or be crazy, to prepare for a disaster, or at least prepare for an extended time of living off the grid. It’s happened to me, and tens of thousands of others around me.

Be ready.