Thursday, December 10, 2009

CSS Hell

Cascading Style Sheets can be very powerful tools. However debugging them when things do not go according to plan can be a real pain.

I decided to try my hand at a little Drupal theming and I am off to a rocky start. Some of the important files are:


  • themename.info — A required file that is new to Drupal 6 which provides information about the theme.
  • page.tpl.php — The main template that defines the content on most of the page.
  • style.css — The CSS file that sets the CSS rules for the template.
  • node.tpl.php — This file defines the content of the nodes.
  • block.tpl.php — Defines the content of the blocks.
  • comment.tpl.php — Defines the content of the comments.
  • logo.png — Your logo, if you are using one.
  • screenshot.png — This is a screenshot of your theme that is used in the admin panel and in the user account settings if you have enabled more than one theme so that visitors can choose which theme they want to use.
  • box.tpl.php — puts a box around things like comments.


How to make a Drupal theme
.

Scientific Method

Scientists should use the scientific method and publish all of the source data and methods. It is not science if it is not reproducible.

I love this quote:

University research is the closest thing to legalized prostitution that exists in this country today. Scare the crap out of enough Congresscritters and you’ve got funding for your research group to last your entire career, data be damned.


Understanding Climategate's Hidden Decline


Climate Model Hoaxing for Dummies

Because Computers Do Lie When Humans Tell Them To

Thursday, December 3, 2009

Climate Comedy

As someone who writes code for a living and a hobby I was interested in the source code downloaded from the University of East Anglia's Climate Research Unit (CRU).

The comments in the code make for enlightening reading. The HARRY_READ_ME.txt contained some nice comments about the quality of the code and was summed up nicely by one of the commenters.

Simplified code for CRU to use (from an average programmer with no climatology expertise):

For intYear = 1400 to 2009;
floatGlobalMeanTemerature = floatGlobalMeanTemperature + WHATEVER_THE_HELL_YOU_WANT_IT_TO_BE;
intYear++
next

Print “Holy Crap! We’re all going to die!”


After reading through some of the comments and code it is entirely clear that all of the data has been manipulated to fit an agenda.



Wattsupwiththat has some more in depth coverage of some of the code comments.

For your viewing pleasure.



Even John Stewart gets it.

My favorite Comment.
Poor Al Gore, Global warming debunked by the very Internet he invented.


The Daily Show With Jon StewartMon - Thurs 11p / 10c
Scientists Hide Global Warming Data
www.thedailyshow.com
Daily Show
Full Episodes
Political HumorHealth Care Crisis

Friday, November 20, 2009

Climate Collusion


In one of the last episodes we saw that some climate "scientists" selectively chose samples that supported their theory and ignored those that did not. Additionally the way the data was calculated was found to be flawed. Flawed is a nice way to put it.

Now we are seeing that many scientists have colluded to manipulate data to enforce their flawed theories. E-mail messages between high-ranking scientists appear to indicate a conspiracy by some of the world's leading global warming alarmists to falsify temperature data in order to exaggerate global averages.

Thursday, November 5, 2009

Beta Master Chrony Review

I have been reloading for a long time but it was usually just to save money for target practice, so I usually just used the starting load in many of the books. Sometimes I would modify a few things to see what would happen but for the most part if went boom when I pulled the trigger it was good.

For a number of reasons I wanted to collect some data on how my reloads were performing, so I decided to buy a chronograph. I was doing a lot of research on what kind to buy and I was leaning towards a particular model when I received an email from Midway and the Shooting Chrony Beta Master was on sale for $99!. The one I was considering was quite a bit more and that was why I was hesitating. For $99 I went for it.

Shooting Chrony has quite a number of different models available. The three main models are the Alpha, Beta, and the Gamma. The biggest difference between the three is the amount of memory for storing velocity readings. Each of the three models are available in the base model and the Master model. The base model has the LCD screen on the unit and the Master model comes with a remote control that housed the LCD screen and about 15 ft of phone cable to connect the remote to the main unit.



On opening up the box I was amazed at how small the box was. I had imagined that it would be larger but apparently that is one of the selling points of the chrony. It folds up into a small package.







As I mentioned earlier I opted for the Beta Master. This means that I have room for storing the velocities of 60 shots divided into six strings of 2 to 10 shots each.








I opened up the box to see what was inside. The obligatory instructions, the chrony itself, the multi-part diffusers, and the support rods.







I unfolded the Chrony to take a look at the inside. You can see the remote unit and the phone cord rolled up nice and neat. I was not able to get the cable and remote rolled up tight enough to fit back in there once I took it out. You can also see the two sensors that detect the bullet passing over them.





Here you can see the remote unit and the phone cable pulled out. For normal use the battery is plugged into the main housing. But you can take the remote unit and plug in the battery and read off you velocities at home without having to hook everything up.




In this closeup of the remote unit I have plugged in the battery and turned it on. It is displaying BE for Beta. Once it has passed its power on test it displays the BE and it is ready for business.





To test the chrony I set it up on a camera tripod so that it was level with the rifle rest on the shooting bench and the center of the two sensors was 10 ft away from where I was shooting. The instructions stated that 10ft away should be far enough away to avoid issues with the muzzle blast causing erroneous readings. I plugged in the remote unit and set it on the shooting bench and prepared to have some fun. For these tests the temperature was 48 degrees Fahrenheit and it was overcast.


Due to the fact that I only have one chronograph I could not directly compare reading between two different models. I figured the next best thing to test the accuracy of the chronograph was to use some factory ammunition for which I had published velocity information available. I also had some reloads that I wanted to try out along with the factory ammunition.


In order to familiarize myself with the operation of the chrony and make sure that I could shoot with out hitting it I decided to start with my Kimber 82G .22 rifle first. This rifle has a 25" barrel and I was firing .22 long rifle that I purchased from the CMP. Supposedly the CMP currently gets its 22 ammo from Aquila and what I am using is Golden Eagle Target with a velocity of 1100fps out of a 20" barrel. I fired my first shot and the chrony displayed the velocity of 1301fps. A little high but I fired nine more for the following results.

Kimber 82G
10 Shots
Mean Velocity: 1262 fps
Standard Deviation: 27.4 fps


Now 1262fps is a little over the published velocity of 1100fps but my barrel is 5 inches longer than the test barrel. These velocities are comparable to what this guy in the CMP forums is getting with this ammo. I have also read that a standard deviation of 30 is normal for factory ammunition.

Next I tried the same ammo out of my Ruger 22/45 with a 4.5" barrel and we see that the velocities are quite different out of the shorter barrel.

Ruger 22/45
10 Shots
Mean Velocity: 979 fps
Standard Deviation: 29.5 fps



I then wanted to try some 223 out of my AR15 that I recently put together. For the first string of shots I fired 10 rounds of M193. If I read the specification correctly M193 should have a velocity of 3250fps out of a 20" barrel.

AR15 18" Barrel
M193 55gr
10 Shots
Mean Velocity: 3213 fps
Standard Deviation: 32.7 fps

Not bad at all. 10 rounds with an average velocity of 3213 fps.

The next string is some Bulk Black Hills 223 that I got on sale back before the 2008 election. It is rated at 3200fps.

AR15 18" Barrel
Black Hill 55gr
10 Shots
Mean Velocity: 2983 fps
Standard Deviation: 34.9 fps

Looks like the Black Hills stuff is a little slower than advertised.

For a twist I have some Prvi Partizan 75gr Match ammo that is advertised as 830m/s. Converting that to fps by multiplying by 3.28 yields a velocity of 2722fps.

AR15 18" Barrel
Prvi PPU 75gr Match
10 Shots
Mean Velocity: 2584 fps
Standard Deviation: 15.3 fps

Again my readings are a bit lower than advertised although I am firing these shots out of a barrel that is 2 inches shorter than the test barrels.

Time to move up in the caliber world. I am going to fire some surplus HXP M2 ball out of my Garand. The M2 ball is supposed to be 2805fps. I am only going to fire 8 shot strings out of the Garand.

M1 Garand
HXP
8 Shots
Mean Velocity: 2810 fps
Standard Deviation: 23.9 fps

That is looking pretty good.


Now for the first of my reloads. I have a 168gr Sierra Match King over 44gr of IMR 4895. This should be a little on the light side of a full power load but this is one of the reasons I wanted a chronograph.

M1 Garand
168gr SMK 44gr IMR 4895
8 Shots
Mean Velocity: 2549 fps
Standard Deviation: 21.3 fps

The velocities are higher than I expected but I am pleased with the results.

Now for another rifle that prompted me to buy a chronograph. My 1899 Krag Carbine is over 110 years old now and I do not want to push the envelope on this one. These loads are 220gr Round Nose on top of 40grs of H4350.

30-40 Krag
220gr RN 40gr H4350
5 Shots
Mean Velocity: 1830 fps
Standard Deviation: 21.7 fps


I also wanted to test my 9mm and see how the velocities compared. The first ten shots are Federal HST 124gr and should have a velocity of 1150fps out of a 4" barrel. Today I am using a M&P9C that has a 3.5" barrel.

S&W M&P9C
Federal HST 124
10 Shots
Mean Velocity: 1083 fps
Standard Deviation: 23.2 fps

The velocity is pretty close.

While I was at it I tried a string of Federal HST+P 124gr that should have a velocity of 1200fps.

S&W M&P9C
Federal HST 124+P
10 Shots
Mean Velocity: 1164 fps
Standard Deviation: 7.7 fps


For comparison I shot some factory Federal American Eagle that should have a velocity of 1150 fps.

S&W M&P9C
Federal American Eagle 124
10 Shots
Mean Velocity: 1053 fps
Standard Deviation: 20.7 fps

That was lower than I expected but this is the "value" ammo from Federal.

Now I want to try one of my pet reloads for the 9mm. I like to use 4.0 grs of Titegroup under a 124gr FMJ. This should make power factor for IDPA and it is a nice shooting round that won't kill my hand after shooting a few hundred rounds.

S&W M&P9C
124gr FMJ 4.0gr Titegroup
10 Shots
Mean Velocity: 983 fps
Standard Deviation: 11.8 fps


Out of my 3.5" barrel M&P9C my reload is making 983fps. I need to reach 1009fps to meet the Power Factor for IDPA. Since the rules call for measuring the velocity out of the longest legal barrel allowable, I think that these reloads will reach 1009fps in a 5" barrel but I will have to test and make sure.

Most chronographs work by sensing a disturbance in the amount of light entering the sensors. Since it was overcast the day I did the testing the light was rather diffuse and I did not use the diffusers. On a sunny day or if there are partial clouds the amount of light entering the sensors can change and cause erroneous readings. The diffusers are there to help eliminate the problems caused by erratic lighting. I have even seen some people put a white piece of poster board of cardboard over top of the entire chronograph so that only reflected light gets to the sensors instead of direct light.

Overall I am rather pleased with the Shooting Chrony Beta Master. If I had to pick one thing to complain about is that to get the velocity statistics out of the unit you have to press a combination of buttons that is just not intuitive at all. I ended up entering all of the velocities into a spreadsheet and calculating the results there. I understand that they probably used less buttons to keep the costs down but the menu system was kind of convoluted.

I am going to continue using the chrony and see what some of my other firearms and loads can do. I would like to get out to the range with some one that has a different chronograph ans set the two of them up serially. Then fire through both at the same time and compare velocity readings to see if they both read the same or if there are differences.

Thursday, October 29, 2009

Intelligent Editorial

An Intelligent Editorial from the News Tribune.

Felonious behavior is becoming more dangerous, if two recent incidents are any indication.

During a home invasion on Oct. 5, one of the intruders was shot and killed by one of the occupants of the mobile home.

And an armed assailant is recovering from wounds after he was shot Oct. 13 by one of the people he was attempting to herd into a building housing law offices on East Capitol Avenue.

In the first case, the weapon was kept in the home, which always has been allowed to defend people and property.

In the second incident, the assailant was shot by someone who qualifies under the conceal and carry law.

Sheriff Greg White is a proponent of the conceal and carry law, passed by lawmakers in 2003 after Missouri voters rejected a similar law in 1999.

The law requires people to attain a standard of proficiency with weapons before they are permitted to carry a concealed gun. Proponents of the law believe it offers a greater sense of security and decreases crime by prompting felons to consider the consequences of armed confrontation.

We confess to harboring some reservations about the concealed carry law. Our fear was an increase in guns in public would result in more guns being displayed prematurely and/or more accidents.

White said recently: “All the fears over conceal and carry have never manifested.”

We concede the point.

Anecdotal evidence does not suggest an increase in accidents or unprovoked gunplay.

The evidence, however, does show people defending themselves from harm.

The message being sent to felons is don't bring a weapon to a crime unless you're prepared to accept the risk.

Thursday, October 22, 2009

Government Run Healthcare

The Virginia Pilot is reporting that Senator Webb is calling for an investigation of the Hampton VA Medical Center.

Webb said that since 2007 his office has received 149 complaints about the facility, ranging from abusive patient treatment to wrongful death. A 2008 assessment by the VA's inspector general found that the center failed to comply with a number of policies and guidelines, he said, and its scores on a patient-perception survey did not meet targets.


I needed to get MRIs done on both of my knees. I called to make an appointment and was told that I needed to see my primary care person before getting a consult for the MRIs. So I ask to make an appointment and four months away is the soonest I can get in. A few weeks later I get a letter in the mail telling me to report to the Lab two to ten days prior to my appointment for bloodwork.

A week prior to my appointment I drive up to Hampton and and go to the lab. I take a number and stand in line and wait for the lady to call my number (Think DMV). Once my number is called I exchange pleasantries with the lady and she looks me up in the computer. After a few minutes of clicking she starts to mumble to herself about people not having orders. I ask if that she is referring to me and she says, "there is no order for lab work so I can't help you". I show her the letter telling me to come to the lab and she shrugs and tells me to go to primary.

Now that I am left standing there I look around and head over to the sign that says "Primary Two" and stand in line again. After a while the lady calls out, "Next Veteran" and it is my turn to approach the counter. I show her the letter and explain that the lab did not have an order. She tells me that, " she cannot do anything until I see the Care Provider. So I guess that the letter telling me to report to the lab is meaningless.

A week later on the day of my appointment I am an hour early and I go to check in at the front counter and stand in line. It appears that only a few people are working at the check in counter and there are a number of empty spots but I am not sure and it is not lunch time. After about 20 minutes it is my turn and the gentleman looks me up in the computer. He is rather polite and nice but he appears a bit harried. He prints out two lines on a piece of paper, hands it to me and points to Primary Care. I walk over to primary care and stand in line. Once it is my turn I hand over my letter and paperwork and tell the lady I am here for my appointment. She looks me up in the computer and gestures over to the waiting seats and tells me someone will call my name.

So I sit with all of the coughing and sneezing people and wait for about 45 minutes. It is about 30 minutes past my appointment time now and I finally get called back. The Nurse takes my vitals and asks a bunch of questions,typing my answers into the computer. She is rather nice and explains that they are short of help. While in the room another nurse comes in and asks to borrow one of the machines because there are not enough for all of the rooms. The nurse now directs me to another waiting room, called the Green Room. There are no empty seats so I stand in the corner and try not to breathe in from the guy coughing on the other side.

After about another 20 minutes a different person call my name. This lady is a physicians assistant. She will be the one that takes care of me. She asks a bunch of questions and types the answer into the computer. Offers me a consult for cane, a Hepatitis C test, a Flu Shot, some other tests and what have you. What I really came here for is the MRIs for my knees. Oh well we have to schedule another appointment for that and the wait is about NINE MONTHS!!

So at best it will be 13 months from the time I called to even get to the MRI machine. We cannot afford Government Run Healthcare. Anyone stupid enough to think that we should have Government Run Healthcare should be required to get their health care from the VA and see how it really works.

Thursday, October 15, 2009

MySql Update Select From

I have had to solve this same issue a number of times. It seems that every time I have to do it I cannot remember exactly how to do it. I then end up searching the Internet to find the solution so I am going to post an example here so that I do not have to search for it and hopefully it will help someone else.

The problem I have encountered is Updating a table in MySql with data Selected from the same table. It appears that MySQL doesn’t allow referring to a table that’s targeted for update in a FROM clause.

The latest issue was normalizing a table in a database I inherited. This had started out as a small database that served its purpose but as the organization grew it created more problems. In this example each person's entire name was stored in a single column.


+--------------------+
| name |
+--------------------+
| John Doe |
| Billy Joe Bob |
| James \"Jim\" Dean |
+--------------------+


I wanted to split this into first, middle, last and nick names for different purposes. So first let us define a table.


create table people ( id int primary key, name varchar(45) );

insert into people values( 1, 'John Doe'),
( 2, 'Billy Joe Bob'),
( 3, 'James \"Jim\" Dean');


For now I want to split the first and last names into separate columns.
First we need to define those columns so we will add them to the existing table;



alter table people add column fname varchar(20) after id;

alter table people add column lname varchar(20) after fname;



Now that the columns are added we can split the names and insert them into the same table.



UPDATE people p SET fname=(
SELECT SUBSTRING_INDEX(name,' ',1)
FROM ( SELECT * FROM people ) AS X where p.id=X.id );


The Substring Index splits the first name. Then select from the table as X works because MySql materializes subqueries in the FROM clause as temporary tables. This allows us to bypass the problem.

Thursday, October 8, 2009

Console Vault Review


Up for review this month is the Console Vault by Unique Security Solutions, billed as the Ultimate High Security In-Vehicle Storage System. For those times when you need to secure your personal items in your vehicle, and stuffing them under the seat just doesn’t seem like the smartest idea in the world, the console vault may be just what you need. The Console Vault is advertised as a specially designed insert that fits into the console space of your truck or SUV while still allowing the console to close normally. The vault is constructed of 12 gauge steel and has a five point high security locking mechanism with a spring assisted lid. The manufacturer claims that the unit can be installed in under 10 minutes without any modification to the vehicle. Models are currently available for over 26 different trucks and SUVs.

In the past I have owned some of the other in car safe like containers. Most were built from rather flimsy metal and did not hold up well. One container in particular that comes with a long cable for securing the container into the car and can be purchased for about $29.95, was not very secure at all. I was able to pry it open in under five minutes with a large screwdriver. Still it is better than nothing.

My first impression of the Console Vault is that it is a solid bit of kit. It is rather hefty and does not feel cheap at all. Time to take a look and see if it holds up to scrutiny.


Rolling the vault over and getting an overall look, one of the first things that catches my eye is one of the mounting holes in the bottom was not punched all of the way out. You can see that the top right hole in the picture was not punched all of the way out. I was able to knock it the rest of the way out with a hammer and a punch.




Continuing to look the vault over I noticed that from the inside I could see daylight through some of the joints. Taking a better look at the welds on some of the joints that you can see in the picture on the right. I don't think that I would expect this thing to be watertight but I think some of these welds could have been better.



I measured the thickness of the steel at the side of the vault. At the point that I measured the steel is folded over on itself to form the edge. Therefore I should measure a thickness that is twice the normal value of 12 gauge steel. As you can see in the picture I measured a thickness of 0.184 inches and according to The Engineers Edge the thickness of 12 gauge sheet steel is 0.1046 and since this edge is doubled over it should measure 0.2092 inches. It looks like it is a little thinner than 12 gauge. 13 gauge sheet steel should be 0.0897 which is 0.1794 inches doubled over. I am not positive about the tolerances in measuring the thickness of sheet steel but it seems a lot closer to 13 gauge that 12 gauge steel. Now in reality is the difference between 12 and 13 gauge steel going to make much of a difference.


My curiosity was piqued by the description of the five point locking mechanism and the spring assisted lid, so taking a better look at the underside of the lid we have the picture on the right.

I can make out the spring assisted hinge and in fact the lid does open rather smoothly. With small bumpers under the lip. the lid opens and closes without a metallic sound, a very nice touch. As far as a five point locking mechanism, unless they count every part of the hinge I have to wonder where they learned to count.



Enough looking at it, lets get it installed. The only thing in the box was the vault itself and a skimpy set of instructions. Most of the instructions were about how to change the combination. Since there were no screws in the box we should probably use the ones already in the vehicle and indeed there are four screws in the console of my truck that line up nicely with holes in the bottom of the vault. After taking the screws out I was a little disappointed to to see that the four screws are your typical automobile dashboard screws. I don't think that they would provide much in the way of holding force so I went a little further and took the console even further apart and found a few brackets underneath that are spot welded to the body and I used a longer carriage bolt to bolt the vault down to the bracket. This ended up taking me more than 10 minutes but I won't hold it against Ford or the console vault because I wanted to be a bit more secure with my install.



I put the console back together and secured the last few screws. The vault came with a piece of fabric to lay in the bottom of the vault to cushion your belongings. On the left is picture of the vault installed in my truck. Overall the fit into the vehicle is nice. There is plenty of room in this model. Enough to fit at least two 1911s and a GPS with room to spare. Although if you have a different model truck your console size may be different.



Here is a shot of the vault closed. You can see the combination lock which uses a three digit combination. I prefer a combination lock to a key as I don't have to worry about losing the key.








I can close the console all the way without any problem.











Overall I am impressed with the fit and functionality of the Console Vault. The finish quality left a bit to be desired and I still don't get the "five-point" locking mechanism but once it was installed it blends in nicely and usage on a daily basis is very nice with no complaints. It did take me longer than 10 minutes to install but again I went further than I needed to because I did not have confidence in the screws that were already in place.

Most of the time you will find the Console Vault listed at about $250 online. At that price I was hesitant to buy it. However I found it at Costco's online store for less that $200 shipped during a sale. It is normally $250 at Costco but I have seen it on sale two different times now and Costco's sale items seem to repeat every quarter or so.

There are a few quality issues that I may be overly picky about, but this appears to be one of the best ways to secure personal items in you vehicle with the possible exception of a steel box welded into your trunk. It is definitely better than most of the other options out there.

Thursday, September 17, 2009

Transportation Funding Theory

All this time I thought I knew something about fiscal policy.

I am still trying to figure out this persons policy.



It sounds like a similar policy to this guy.



I am really speechless at this point so I will just leave it alone.

Thursday, July 9, 2009

Cow and the Ice Cream

From an forwarded email but it has substance.

--From a teacher in the Nashville area

"We are worried about 'the cow' when it is all about the 'Ice Cream.'



The most eye-opening civics lesson I ever had was while teaching third grade this year...

The presidential election was heating up and some of the children showed an interest.


I decided we would have an election for a class president.

We would choose our nominees. They would make a campaign speech and the
class would vote.

To simplify the process, candidates were nominated by other class members.

We discussed what kinds of characteristics these students should have.

We got many nominations and from those, Jamie and Olivia were picked to run for the top spot.

The class had done a great job in their selections. Both candidates were
good kids.


I thought Jamie might have an advantage because he got lots of parental support.

I had never seen Olivia's mother.

The day arrived when they were to make their speeches.

Jamie went first.

He had specific ideas about how to make our class a better place. He ended by
promising to do his very best.


Everyone applauded and he sat down.

Now is was Olivia's turn to speak.


Her speech was concise.

She said, "If you will vote for me, I will give you ice cream."

She sat down.

The class went wild.
"Yes! Yes!

We want ice cream."

She surely would say more. She did not have to.


A discussion followed. How did she plan to pay for the ice cream?


She wasn't sure.

Would her parents buy it or would the class pay for it.

She didn't know.


The class really didn't care.

All they were thinking about was ice cream.


Jamie was forgotten. Olivia won by a landslide.

Every time Barack Obama opened his mouth he offered ice cream and


52 percent of the people reacted like nine year olds.


They want ice cream.

The other 48 percent know they're going to have to feed the cow and clean up the mess."


This is the ice cream Obama promised us!


Remember, the government cannot give anything to anyone --


that they have not first taken away from someone else.

Thursday, June 25, 2009

MySql Root Password Recovery

A few of my Linux machines only get accessed remotely from a shell or web interface. Since they are usually very reliable and don't give me any problems I have a tendency to forget about them and all the different passwords that I use on them.

Now being a somewhat security conscious person I use unique and complex passwords for every account and machine that I have control over. I also do not have the best memory in the world so I have used a few of the password manager utilities. I am currently using KeePass and experimenting with LastPass to manage some of my passwords.

But as life would have it I must not have entered or forgotten to update the password for one of my MySql instances and here is how I solved the problem.

This method will take down the MySql daemon for a short time so I first made sure that no important services would be interrupted. Then I stopped the server.


[root@localhost /]# /etc/rc.d/init.d/mysqld stop
Shutting down MySQL: ... [ OK ]


Then start the server skipping the grant table.


[root@localhost /]# mysqld_safe --skip-grant-tables


If the server does not start you probably have other issues but assume that the server started up correctly. Now you need to reset the password. Login to the MySql server.


[root@localhost /]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 33
Server version: 5.1.34 - MySQL Standard Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> update user set Password=PASSWORD('new-password') where user='root';

mysql> flush privileges;

mysql> exit


Now the password has been reset so you need to kill the mysqld process and start the server normally. To kill the server I just grepped for the process number.


[root@localhost /]# ps aux | grep mysql
mysql 8856 ....deletia...
[root@localhost /]# kill -9 8856
[root@localhost /]# /etc/rc.d/init.d/mysqld start
Starting MySQL: ... [ OK ]


Now you should be up and running with a new password and DO NOT forget to update the password manager with the new password.

Thursday, June 18, 2009

SBS2008 Library Event Warning

I have been seeing an error in the Event Viewer of my SBS 2008 server for a while but I have ignored it until now.

The error is event id 2003, Performance Library Availability.

The configuration information of the performance library "C:\Windows\system32\sqlctr90.dll" for the "MSSQL$SBSMONITORING" service does not match the trusted performance library information stored in the registry. The functions in this library will not be treated as trusted.


The Technet entry seems recent but it says to use the lodctr command.

After opening a command prompt with Administrator privileges the command I used was lodctr /t:sqlctr90.dll.

I will check the event log again in a few days to see if the event is still appearing. Now I need to solve the annoying event 10009 and event 10010 DCOM errors.

Thursday, June 11, 2009

Do the Right Thing

The fact that traffic sucks is one thing that most people can agree on. What to do about the traffic is another matter entirely. Everyone wants the government to fix the problem but no one wants to pay for it.

In my observations I would say that one of the most prevalent problems is oblivious drivers in the passing lanes talking or texting on phones, eating food, putting on makeup or even all three at the same time. These self centered ignorant people think that they own the road and everyone else should just deal with it. This behavior forces the impatient people behind them to do stupid thing like swerving across multiple lanes of traffic and cutting off other people to try and get around the ignoramus in the left lane.

A survey of state laws shows that most states follow the Uniform Vehicle Code which requires slower vehicles to keep right. In particular Virginia State Code 46.2-842.1 states that:
§ 46.2-842.1. Drivers to give way to certain overtaking vehicles on divided highways.

It shall be unlawful to fail to give way to overtaking traffic when driving a motor vehicle to the left and abreast of another motor vehicle on a divided highway. On audible or light signal, the driver of the overtaken vehicle shall move to the right to allow the overtaking vehicle to pass as soon as the overtaken vehicle can safely do so. A violation of this section shall not be construed as negligence per se in any civil action.


The National Motorists Association has a great concept called Lane Courtesy where the advantages of moving over are "self-evident".
If people would "do the right thing" and show a little courtesy by moving over then the people who want to drive faster can and people who want to go slower can do it in the right lane without having to complain about somebody tailgating them.

Thursday, June 4, 2009

Model 1917 Ejector Replacement


The Model 1917 Enfield was actually issued to more Soldiers during World War 1 than the M1903 Springfield. The short history is that in the early years of WW1 U.S. manufacturers were making the British Enfield P14 rifle and when the U.S. entered the war there were not enough M1903s to meet demand. It would have taken too long to retool the factories to start building the M1903 so it was decided to rechamber the P14 from 303 British to 30-06, giving birth to the Model 1917.

Enough history for now, the other day I was shooting my 1917 in a match when I ran into a problem ejecting the empties during the prone slow fire stage. I finished the stage by pulling the empty out of the chamber after each shot. Not that hard but it blew my concentration a bit.

After the stage I took a look at the rifle and found that the ejector was not popping out when I pulled the bolt back. I took the ejector housing off and of course the ejector spring was broken. Not one to give up, I scavenged a spring from a ball point pen, cut it to length and put everything back together.

Everything worked well and I was able to finish the match, including the rapid fire stages without any problem. Even though my score was not that great I left feeling pretty good that I was able to fix the rifle in the field and continue.

Once I got home, I got on the Internet and started looking for a replacement ejector spring. I found one at Numrich for a decent price and ordered it. I had it in my hands about 4 days later and now it is time to replace the spring.

Here is the left side of the receiver showing the ejector housing and the screwdriver in position to remove the one and only screw needed for this repair.


After removing the screw and pulling the housing off of the receiver I laid the parts out so I would not lose any. Sorry this one is a bit blurry.


And now a shot of a new ejector spring next to the ball point pen modification I made. The one on top is the normal leaf spring type ejector spring and on the bottom is the modification I made to finish the match. If you look closely you can see the little nib where the old leaf spring broke off.


Putting it back together was not hard. It seemed like a third hand would have helped trying to push against the spring to get the screw hole lined up but I got it back together and tested the ejector to make sure it worked. Now I just need to find time to go out and test it at the range!!

Thursday, May 21, 2009

Memorial Day

Over the years the meaning of Memorial Day has faded too much from the public consciousness. From a solemn day of mourning, rememberance, and honor to our departed loved ones, it has degenerated into a weekend of Bar B Q's, shopping bargains and beaches where only token nods toward our honored dead is given, if at all. Too many don't know what the day stands for.

Memorial Day used to be a sacred day that was reserved for the remembrance of those who paid the ultimate price for our freedoms. Businesses closed for the day. Towns held parades honoring the fallen, the parade routes often times ending at a local cemetery, where Memorial Day speeches were then given. People took the time that day to clean and decorate with flowers and flags the graves of those the fell in service to their country.

It is human nature to avoid the unpleasant. But we need to remember the cost of war, we need to remember the price paid for our freedoms, we need to not let those who died, die forgotten and in vain.

When Congress made the day into a three-day weekend in with the National Holiday Act of 1971 (P.L. 90 - 363), it made it all the easier for us to be distracted from the spirit and meaning of the day.

We need to teach our children the day's meaning. Show others by our actions that we will not forget. You don't have to believe in war to honor our family, friends and neighbors who died in service to their country.

Have a safe weekend with your families.

Tuesday, May 12, 2009

DVD Library in Vista Media Center

I have been looking around for a integrated way to store movies on the server and allow all of the computers in the house to access those movies. I think I found a good solution in this Microsoft Knowledge Base Article.

It details how to enable the built in DVD Library support in Vista Media Center. All of the movies are stored in individual folders located in a shared folder on the server in the VIDEO_TS format.

Then on each of the client Vista machines, open regedit and navigate to the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Media Center\Settings\DvdSettings subkey.
Locate the ShowGallery key and modify the value from Play to Gallery.

Then launch Media Center and you should see DVD Library under TV & Movies.



This worked fine on my rig but when I tried it for my wife the registry setting did not change the GUI and the DVD Library did not show up.
I fixed this by giving her account temporary local admin, made the registry change, made sure it worked , and then removed her from the local admin group.

Once the DVD Library shows up in the gui click on it and then right click and select add a shared folder from another computer and then select the share with the movies.

The movies should start appearing in the Library. There are still a few issues for me to sort out. One is that the information such as the cover art and meta data is not cached and it needs to be looked up every time. As the number of movies increases this can take a bit of time. You can place an image called folder.jpg in each movies folder and that will take precedence over the download. Another issue is the dvdid.xml, and I have been doing a bit of reading and cam across this site that appears rather interesting.

Thursday, May 7, 2009

Vista DRM Issue

Never one to pass up a good deal, I was able to get a new Q9650 Quad Core processor at a good price. I replaced the E8400 Dual Core in my main Rig, updated the bios and fired her up. I am running Vista Ultimate x64 in this machine and it started right up and I just had to open Task Manager and see all four cores looking good.

After the obligatory re-activation, I ran the Vista performance benchmark for the experience Index and I am now 5.9 across the board with 8 Gig RAM, 8800GTS video, and a WD Raptor 150 Gig Drive.

Then I opened up Media Center and I encountered the first of my issues. Error windows popped up about the receiver service not working and Digital Cable device registration application stopped working errors started opening up.

As it turns out Vista DRM is tied to the CPU so you need to delete the DRM cache. Open up an explorer window and go to the tools menu on the toolbar. If you do not see the toolbar, hit the alt key and it should appear. Go to folder options and choose the "view" tab.

Select the show hidden folders and unselect the Hide Protected Operating System Files. Then go to C:\ProgramData\Microsoft\Windows\DRM. Make sure it is the correct DRM folder, there is another DRM folder one level up and it is empty. If I am feeling cynical I think it is a decoy to confuse people. Inside the correct DRM folder there should be some files like this.





Now delete all of the file inside of the DRM folder but not the DRM folder itself. Then log off and reboot for good measure. You may want to reset the folder view options back to their default options. Now the annoying errors should be gone Media Center should be working fine again.

Thursday, April 30, 2009

SD Card Partitioning

A week or so ago my wife mentioned that she was having a problem with her digital camera. Given the importance of the requester I stopped what I was doing and listened to her describe the problem.

It seemed that the camera was having problems writing to the SD Card and after turning the camera off and on it wanted to reformat the card. This is not a new camera or card so this is something that should not be happening at this point.

I popped the card into my pc and Windows showed that it as a One Gig partition. This was strange because it is a Two Gig card. Opening up Disk Manager showed that indeed there was a One Gig partition and the rest was unused space. I attempted to resize the partition and even create a second partition in that unused space but Disk Manager wasn't going to let me do it.

So I tried inserting the card into my Linux laptop to see what I could do. Mandriva detected the card and auto mounted it as "NEW VOLUME". That was a good sign so dropped to the shell and issued a "fdisk -l" to see what was there but only the hard drive ( sda ) showed up. Then I poked around in /dev/ to see what I can find and didn't notice anything. I issued a "ls" on /mnt and there was nothing there.

After a moment of inspiration I checked /media and there was NEW VOLUME and then after a bit of googling I issued a"cat /etc/mtab" and was rewarded with:

/dev/mmcblk0p1 /media/NEW\040VOLUME vfat rw,nosuid,nodev,uhelper=hal,uid=501,utf-8

Now I was able to unmount using "unmount /dev/mmcblk01p1"

Then I used "fdisk /dev/mmcblk01p1" and selected "d" to delete the partition

Then "w" to write the table to the card.

Then I selected "n" for new partition.

Then "p" for primary.

Then "1" to make it the first partition.

Then "enter" to accept the default first cylinder.

Then "enter" again to accept the default last cylinder.

Then "w" to write the table.

Now the card is partitioned into one partition again and after formatting and putting it back in the camera and taking a few pictures my wife is happily taking pictures again.