Brainwashed

People do weird things. Often these are due to the operant conditioning or classical conditioning inflicted on them. Its funny I’ve been seeing references lately to these to describe….

  • Email – Like Skinner’s pigeons, we hit the button to check for new messages hoping to get something. The intermittent reinforcement of not getting a new message with every click just helps strengthen the behavior.
  • Twitter – Similar to email, click the button and hope for something good.
Are we our habits? Or are we something more?

Division Issue in YAPB

Problem PHP in Yet Another Photoblog causes “Warning: Division by zero in exifReader.inc on line 859” (the problem line is in bold):

 

case TAG_SHUTTERSPEED:
  // More complicated way of expressing exposure time, so only use
  // this value if we don’t already have it from somewhere else.
  if ($this->ImageInfo[TAG_EXPOSURETIME] == 0){
    $sp = $this->ConvertAnyFormat($ValuePtr, $Format);
    // Temporary Workaround for divizion by zero problem
      if (!empty($sp[0])) {
        $this->ImageInfo[TAG_SHUTTERSPEED] = (1/exp($sp[0]*log(2)));
      } else {
        $this->ImageInfo[TAG_SHUTTERSPEED] = 0;
      }
    }
    break;

 

Looks like YAPB is attempting to create a value if one doesn’t exist for TAG_EXPOSURETIME by inventing a new value. In my problem picture, the exposure time is 0.003 seconds which != 0. So why is the ($this->ImageInfo[TAG_EXPOSURETIME] == 0) condition evaluated as true? 

Interestingly, just prior to this is some code dealing with TAG_EXPOSURETIME which seems to be affecting this. Changing the 0.5 to 0.0005 (less than my current value removes the problem.

case TAG_EXPOSURETIME:
  // Simplest way of expressing exposure time, so I trust it most.
  // (overwrite previously computd value if there is one)
  $tmp = $this->ConvertAnyFormat($ValuePtr, $Format);
  $this->ImageInfo[‘h’][“exposureTime”] = sprintf(“%6.4f s (%d/%d)”,(double)$tmp[0],$tmp[1][0],$tmp[1][1]);
  if ($tmp[0] <= 0.5){
    $this->ImageInfo[‘h’][“exposureTime”] .= sprintf(” (1/%d)”,(int)(0.5 + 1/$tmp[0]));
  }

  break;

With this conditional, the exposure time is “0.003 s (1/400) (1/400)” without “0.003 s (1/400)”. Didn’t see a reason to have it twice, so I’ve dropped it.

Also, I figure it would be better to call ImageInfo[‘h’][“exposureTime”] instead of ImageInfo[TAG_EXPOSURETIME]. With this change, it seems to have resolved the issue for me.

Tale of Defeating the Crazy Woman

Babies are fascinated by me. When the two of us are in a room, they often find me the most interesting thing in the room. Usually, it is mutual.

So, a mutual friend of a friend, Mojan has a fantastic blog. The past year or so has been about being pregnant and most recently figuring out how to be a parent for the first time. Well, a crazy woman set up a ‘blog” which hotlinks images from Mojan’s blog and falsely represents the child in the photos. Ick. I offered to help with this identity theft issue.

Once upon a time, I was annoyed with people taking images from my last employer’s web site. Since I was the campus web designer, I created an image which said, “All your image are belong to VSU.” Also, as the web server administrator, I figured out how to defeat hotlinking with .htaccess by using mod_rewrite to give them my annoyance rather than their content. For the next couple days I watched the perpetrators try and figure out what was wrong. The hate mail I got was fantastic! I recommended Mojan do the same. When she agreed, I went researching to do what I did once upon a time. This is the .htaccess file I recommended she try.

# Basics
Options +FollowSymlinks
RewriteEngine On

# Condition is true for any host other yours
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mojansami\.com/ [nc]

# What to change gif, jpg, png to which target. In this case does not exist.
RewriteRule .*\.(gif|jpg|png)$ http://mojansami.com/images/stolenpic.jpg [nc]

My directions were not all that specific. So the next thing I know, her site is sporting an Internal Server Error. *headdesk* She used Dreamweaver to create the .htaccess file and upload it to her site. She reported the file she uploaded disappeared. Eventually, it did occur to me to look for the error.log and see what it said. The log complained about DOCTYPE in the .htaccess file in the home directory. A file which did not show in the FTP listing. So, replacing the bad .htaccess file with a blank one fixed the Internal Server Error.

The .htaccess file in the right place, of course, resolved the issue with the crazy woman hotlinking.

Nothing can fix the pain of another person committing identity theft against you or your loved ones. I really hope Mojan doesn’t become discouraged and abandon blogging entirely. Between moderation and authentication she might find a better balance.

Do you have any stories of online identity theft?

Waste Not

Lately I’ve been seeing a lot of forwarded or group invites for kinds of things about not buying gas for a day, not buying gas from the two largest oil companies, or even everyone not using electricity for an hour (One Hour NO Power). These are ambitious endeavors for problems I agree are present.

My power consumption is fairly conservative, I think. Everything is electric rather than gas. My are turned off computers every night. The shredder, coffee maker, cell chargers, computer speakers, scanner, two printers, and external hard drive all remain turned off unless I need them. I wash clothes in decent size loads. I avoid running heat, air conditioning, or long showers. Admittedly, some devices remain on all time which bother me: TiVo, DVD player, range clock, cordless phone charger, and microwave. I can be better about the DVD player and maybe microwave.

My gasoline consumption is defintitely high. I don’t carpool, but I do live close to work. If I’d picked a better location and were in better shape I might could ride a bike to work. Downtown isn’t anywhere near walking distance. Nor are those state parks and historical landmarks.

Chain letters are worthless. People rarely get so excited that they think All my friends and even strangers must absolutely hear about this! Instead, its a few who continue it on. Chain letters are a numbers game. You have to hit a large number of people who are going to ignore it in hopes of reaching a few who will pass it along. You have hit a massive amount of people for any of these initiatives to work. Maybe I’m wrong about this means of communication? Anyone have numbers on how many people you can reach using chainletter emails? I’m thnking they are a massive waste of electricity.

Let There Be Life!

Discovery Channel :: News – Space :: Did Viking Lander Kill Alien Life?

Last month, scientists excitedly reported that new photographs of Mars showed geologic changes that suggest water occasionally flows there — the most tantalizing sign that Mars is hospitable to life.

In the ’70s, the Viking mission found no signs of life. But it was looking for Earth-like life, in which salt water is the internal liquid of living cells. Given the cold dry conditions of Mars, that life could have evolved on Mars with the key internal fluid consisting of a mix of water and hydrogen peroxide, said Dirk Schulze-Makuch, author of the new research.

That’s because a water-hydrogen peroxide mix stays liquid at very low temperatures (-68 degrees Fahrenheit), doesn’t destroy cells when it freezes, and can suck scarce water vapor out of the air. The Viking experiments of the ’70s wouldn’t have noticed alien hydrogen peroxide-based life and, in fact, would have killed it by drowning and overheating the microbes, said Schulze-Makuch, a geology professor at Washington State University.

One Viking experiment seeking life on Mars poured water on soil. That would have essentially drowned hydrogen peroxide-based life, Schulze-Makuch said. A different experiment heated the soil to see if something would happen, but that would have baked Martian microbes, he said.

So maybe we killed the microbes? Doh! Such Terracentric creatures are we!

MIT Fraternity Accused Of Robot Hazing

The Onion made me smile tonight.

MIT Fraternity Accused Of Robot Hazing | The Onion – America’s Finest News Source

Several members of the Massachusetts Institute of Technology chapter of the Theta Tau fraternity are in campus-police custody today following a brutal hazing incident in which one robot remains missing and two others are in critical condition with extensive circuitry and servo-motor injuries, sources revealed Monday.

The robots, experimental prototypes recently devised at MIT’s prestigious Artificial Intelligence Laboratory, were participating in an apparent initiation exercise that police say involved butyl alcohol and compressed air.

MIT Fraternity Accused Of Robot Hazing

The Onion made me smile tonight.

MIT Fraternity Accused Of Robot Hazing | The Onion – America’s Finest News Source

Several members of the Massachusetts Institute of Technology chapter of the Theta Tau fraternity are in campus-police custody today following a brutal hazing incident in which one robot remains missing and two others are in critical condition with extensive circuitry and servo-motor injuries, sources revealed Monday.

The robots, experimental prototypes recently devised at MIT’s prestigious Artificial Intelligence Laboratory, were participating in an apparent initiation exercise that police say involved butyl alcohol and compressed air.

Creating Gravity

Brian Greene mentioned this might be only a few years away in Fabric of the Cosmos. Assuming others validate this is true, this is a great step forward for String Theory.
Researchers create gravity in lab experiment | Science Blog

Scientists funded by the European Space Agency have measured the gravitational equivalent of a magnetic field for the first time in a laboratory. Under certain special conditions the effect is much larger than expected from general relativity and could help physicists to make a significant step towards the long-sought-after quantum theory of gravity.

Some quotes

Richard Feynman Quotes – The Quotations Page

Physicists like to think that all you have to do is say, these are the conditions, now what happens next?


Voltaire Quotes – The Quotations Page

A witty saying proves nothing.


Samuel Butler Quotes – The Quotations Page

Genius might be described as a supreme capacity for getting its possessors into trouble of all kinds.


Bill Cosby Quotes – The Quotations Page

I don’t know the key to success, but the key to failure is trying to please everybody.