Tuesday, October 28, 2008

ImageMagick is cool

Command line for images? What?

OK, so I have this .png file that makes a bevel on a picture:
except I don't *really* want to take the time and effort to load GIMP/Photoshop every time I want to apply this bevel/bezel. Now, I take ImageMagick's convert and composite and make my button from the command line:

convert -resize 244x132! originalpic.jpg resizedpicname.jpg
composite bevel.png resizedpicname.jpg buttonizedfilename.jpg



Original: Trent Original Photo
Resized: Trent resized Photo
Bevel/Bezel: Trent buttonized

Wednesday, October 8, 2008

The Devil you know

Better the devil you know... that means that people would rather vote for someone decisive in what they believe (even if they think he's lying) than to vote for ambiguous policies.

You know Obama is feeding you a load of junk. He's cute and he explains the junk he's selling. It's still junk. But then you have McCain saying stuff. You don't know what he's selling. You don't know what you can do with what he's selling. You're not even certain HE knows what he's selling. All he wants to do is call you "my friends." You're wary about what he wants to do. "The devil you know" may lead you to the path of destruction. "The devil you don't know" perhaps can't or won't lead you anywhere.

In essence, you're the Gingerbread Man, Obama's the fox who'll carry you across the water. He'll probably eat you, but you're dry and in motion away from the other doom. McCain is the river. You could jump in the river. You could be safe, but then you could be a soggy mess.

Monday, October 6, 2008

New Monty Hall Puzzle(s)

Based upon some comments in the other Monty Hall puzzle, I propose the following scenarios:

Three doors which the host knows the location of a car and two goats. Two contestants get to choose SEPARATE doors.

  • Scenario 1: The host always opens the non-chosen door, regardless of car or goat. A car shown means both contestants lose immediately. No choice offered.
  • Scenario 2: The host always opens either goat door that does not declare a winner, but can declare a loser (random goat 1/2)
  • Scenario 3: The host always opens the non-chosen door if it's a goat (2/3), but chooses a random contestant's door if the non-chosen door is a car.
  • Scenario 3a: The contestants do not know this rule
  • Scenario 3b: The contestants do know this rule

In each scenario, the option to switch is given, not forced. In what cases is it advantageous to switch?


The billion door equivalencies:

  • Scenario 1: The host always opens the 1 billion minus 2 remaining doors
  • Scenario 1a: There is one remaining door and 1 billion minus 1 contestants

As I'm running through the permutations of this in my head, I realize that adding multiple contestants greatly convolutes the problem. With two contestants head to head, the math is indicative that at least one of the contestants is likely to have chosen the car (2 contestants out of 3 choices). More contestants means it's more likely that one of the contestants have already won the car. With multiple contestants already knowing that one of their set has the car, there appears to be little incentive to change even if the host shows a goat. However, if the host starts showing known losers the set of unopened doors plus shown losers increases the probability that the subset of unopened doors more likely contains the car than the original probability of the set of original choice of doors versus the set of total doors.

Thursday, September 18, 2008

Excel Fix a Phone list

Occasionally, you'll have a list of phone numbers that need a little fixing. This code fixes many things as long as the last 8 digits are like 555-1212 and there's three digits of area code either preceded by "(" or flush left as in "(555)555-1212" or "555-555-1212". The result will always be formatted as (555) 555-1212, unless an area code is given.

A2 represents where the broken number is stored.


=CONCATENATE("(",IF(LEN(A2)<9,"555",IF(LEFT(A2,1)="(",MID(A2,2,3),LEFT(A2,3))),") ",RIGHT(A2,8))


You should change 555 to your local area code.

Sunday, August 24, 2008

Diebold and the voting (NON) fiasco

I don't exactly know why people need to be told this, but all the comments blaming Diebold for the election problems miss very important points.


  1. The problem of dropped votes is because the memory cards got switched too fast.


    Imagine using a funnel to fill a canister, and you switched your source material before it was finished. The data transfer rates of memory cards are only so fast, and people are in such a hurry that they don't wait for the data to transfer fully.
    Or, if you're wanting a real-world application: You didn't transfer all of your pictures from your memory card before swapping to another.
  2. "Antivirus on a voting machine? Are you serious?"


    No, silly. Antivirus isn't necessarily on the voting machine. It's on the server that handles (receives and tabulates) the data. Misconfigured or not optimally configured, it could delay or delete data coming from memory cards as it scans the data transfer in real time. This *IS* the function of antivirus software and it does have the potential to cause issues with data transfer *at the server.*
  3. Diebold is in cohoots with the Republicans


    Of course they are. And the democrats who are in charge of the House and Senate have done nothing to stop Diebold from continuing to place touchscreen machines.
  4. ATMs don't have these problems.


    And Diebold is involved with ATMs. ATMs are not necessarily used for gathering data from several thousand people in one day by volunteers. It doesn't mean that ATMs don't gather data and transfer it, but I bet it's likely that the ATMs handle transactions with the servers in real time, rather than hand inputed memory card swapping at the end of a long day.

Disclaimer: I shouldn't need one. I am a computer guy. I have no real or imagined association with any of the parties involved, except that I vote touchscreen and I use ATMs with Diebold logos. If you don't want to vote touchscreen, get an absentee ballet. If you disagree with my observations, that's fine. I'm not telling you to believe me. This *is* my blog.

Saturday, August 23, 2008

xorg.conf multiple users compiz issue

OK, here's the deal. I figured out how to turn off the TV "Unknown" and it worked.
I tested it in an alternate user logon.
Thing was, I couldn't get compiz to work -- but compiz works on just on ONE login. Mostly, it was "Can't do that" or "checking for XGL not present" on the other login. Making multiple changes back and forth... nothing.

Well, the answer is stupid and *for me* has absolutely nothing to do with drivers, even though I have an "unsupported" Intel card. The answer was staring me in the face from a little other error message: "No GLXFBConfig for default depth". Why this login and not the other?

The answer: alternate switch-user logons have new display numbers (see /var/log/Xorg.#.log) and by default, you don't have an Xorg.20.conf. Sure, sure, xorg.conf is supposed to handle it for you, right? nah. I have to put this to the test, but in the mean time, additional Section "Screen"s are the likely fix in xorg.conf.

Friday, August 22, 2008

Fixing the small screen on my laptop


My beloved Gateway MT6730 had one fatal flaw when converting to Ubuntu: The screen resolution.
It appears that the xrandr logic insisted I had a TV connected to my laptop and therefore would overlap two screens: one at 1024x768 which everything resized to, and one at my laptop's preferred resolution: 1280x800. It looks like this image. I'm certain if you're here, you know EXACTLY what this is.

From a command line, I found out I could do this: xrandr --output TV --off which kind of worked, except didn't survive reboots.

Here's the answer:
Edit your /etc/X11/xorg.conf and add these lines:

Section "Monitor"
Identifier "TV"
Option "Ignore" "true"
EndSection

Exit and do a ctrl-alt-backspace to reload X, and you, like me, don't have to worry about this any more.

Also, the "Unknown" display disappeared from the gnome-display-properties, as well as it fixed the same issue with the logon screen.

Blog Archive