TooMuchBlue

My collection of rants and raves about technology, my kids and family, social/cultural phenomena, and inconsistencies in the media and politics.

2006-04-21

Performance War

Quick hit on coding techniques.

From Rico Mariani's blog about performance, a nicely thought out method for eeking more performance out of an already properly tuned application.

#4 Restate the various counts in terms of input and output
Once you've done the counting, trends tend to appear. "This function is called once per byte", "This function is called 3 times per byte", "There are two registry reads per line of input" etc. Some of these will probably leap right off the page: e.g. "Why do we call the process character function twice for every byte of input, that can't be right." These are the kinds of things you're looking for. But let's move on to...

#5 Characterize each of the costs as either "real forward progress" or "bookkeeping"
A lot of what we do in any given program is bookkeeping, some of which is ultimately necessary but is nonetheless bookkeeping. We can't get rid of work that is fundamentally necessary to solve the problem but we can target the bookkeeping for simplification or eradication.

[via Eric Willis]

0 Comments:

Post a Comment

Links to this post:

Create a Link

2006-04-18

The Iron Laws of Software Development

The Iron Laws of Software Development

  • You can't give an estimate until you've come up with a design.
  • You can't come up with a design until you understand the requirements.
  • You won't really understand the requirements until you've finished the project.
  • By the time you finish the project, the requirements will have changed.

[thanks/apologies to Scott McKellar of SWBell]

1 Comments:

Post a Comment

Links to this post:

Create a Link

Just stupid enough to sue

Perhaps you've already heard about Lee Paige, the DEA agent who shot himself in the foot while giving a gun safety presentation to a classroom of children? If not, watch the video, taken by a member of the audience and then handed over to the DEA.

This is wrong on so many levels:

  • The officer comes off as a blowhard. Sounds like he's trying to impress them with himself, not the danger of guns.
  • He's just talking about how he's the only one in the room professional enough to carry the gun he's showing when it goes off, shooting himself in the foot.
  • What in the world was he doing, giving a presentation on gun safety with (a) a loaded gun, and (b) the safety off? The firearm safety presentations I've heard always say "treat every gun as if it's loaded at all times."
  • Having lost all credibility about how to safely handle a gun, he decides to go on with the presentation. After recovering a bit he says, "did you see how that accident happened?"
  • In one breath, he says "now I'll probably never be able to show guns again", and then asks for someone to hand him another gun. Anybody who was still listening is now either yelling "no!" or rolling on the floor. (That's not all you won't be doing again, Officer Paige.)
  • When the video starts to make the rounds, rather than let it go he files a lawsuit, claiming that his career has been crippled and he's become a laughingstock. Seems to me, that course of action was set in motion as soon as the hammer hit the pin.
  • In his lawsuit, Paige points out he will be unable to work undercover anymore. If he was worried about protecting his cover, why was he allowing a member of the audience to videotape him at all? Apparently, the DEA isn't too concerned about breaking his cover or they wouldn't have released the video.
  • For that matter, nothing says "look at me!" like filing a frivolous lawsuit. It's only when the lawsuit made news that Paige really became well known. Before that, he was an anonymous curiousity, like so much other random strangeness you find on the web.

Hopefully, Paige was exaggerating when, in the lawsuit, he claims he was "once regarded as oen of the best undercover agents, if not the best, in the DEA." If he represents the best of the best, it's no wonder the war on drugs has taken so long.

[via Office Pirates]

Labels:

1 Comments:

Post a Comment

Links to this post:

Create a Link

2006-04-16

Passion?

There's nothing quite so depressing as a Passion Play without passion.

0 Comments:

Post a Comment

Links to this post:

Create a Link

2006-04-14

The faithful servant

A friend sent this to me. I generally find inspirational email forwards to be syrupy and over-the-top, but this one is especially fitting right before Easter.

There was a certain Professor of Religion named Dr. Christianson, a studious man who taught at a small college in the western United States.

Dr. Christianson taught the required survey course in Christianity at this particular institution. Every student was required to take this course his or her freshman year, regardless of his or her major.

Although Dr. Christianson tried hard to communicate the essence of the gospel in his class, he found that most of his students looked upon the course as nothing but required drudgery. Despite his best efforts, most students refused to take Christianity seriously.

This year, Dr. Christianson had a special student named Steve. Steve was only a freshman, but was studying with the intent of going onto seminary for the ministry. Steve was popular, he was well liked, and he was an imposing physical specimen. He was now the starting center on the school football team, and was the best student in the professor's class.

One day, Dr. Christianson asked Steve to stay after class so he could talk with him.

"How many push-ups can you do?"

Steve said, "I do about 200 every night."

"200? That's pretty good, Steve," Dr. Christianson said. "Do you think you could do 300?"

Steve replied, "I don't know. I've never done 300 at a time."

"Do you think you could?" again asked Dr. Christianson.

"Well, I can try," said Steve.

"Can you do 300 in sets of 10? I have a class project in mind and I need you to do about 300 push-ups in sets of ten for this to work. Can you do it? I need you to tell me you can do it," said the professor.

Steve said, "Well, I think I can. Yeah, I can do it."

Dr. Christianson said, "Good! I need you to do this on Friday. Let me explain what I have in mind."

Friday came and Steve got to class early and sat in the front of the room.

When class started, the professor pulled out a big box of donuts. No, these weren't the normal kinds of donuts, they were the extra fancy BIG kind, with cream centers and frosting swirls. Everyone was pretty excited it was Friday, the last class of the day, and they were going to get an early start on the weekend with a party in Dr. Christianson's class.

Dr. Christianson went to the first girl in the first row and asked, "Cynthia, do you want to have one of these donuts?"

Cynthia said, "Yes."

Dr. Christianson then turned to Steve and asked, "Steve, would you do ten push-ups so that Cynthia can have a donut?"

"Sure." Steve jumped down from his desk to do a quick ten. Then Steve again sat in his desk. Dr. Christianson put a donut on Cynthia's desk.

Dr. Christianson then went to Joe, the next person, and asked, "Joe, do you want a donut?"

Joe said, "Yes." Dr. Christianson asked, "Steve would you do ten push-ups so Joe can have a donut?"

Steve did ten push-ups, Joe got a donut. And so it went, down the first aisle, Steve did ten pushups for every person before they got their donut.

Walking down the second aisle, Dr. Christianson came to Scott. Scott was on the basketball team, and in as good condition as Steve. He was very popular and never lacking for female companionship.

When the professor asked, "Scott do you want a donut?"

Scott's reply was, "Well, can I do my own pushups?"

Dr. Christianson said, "No, Steve has to do them."

Then Scott said, "Well, I don't want one then."

Dr. Christianson shrugged and then turned to Steve and asked, "Steve, would you do ten pushups so Scott can have a donut he doesn't want?"

With perfect obedience Steve started to do ten pushups.

Scott said, "HEY! I said I didn't want one!"

Dr. Christianson said, "Look!, this is my classroom, my class, my desks, and these are my donuts. Just leave it on the desk if you don't want it." And he put a donut on Scott's desk.

Now by this time, Steve had begun to slow down a little. He just stayed on the floor between sets because it took too much effort to be getting up and down. You could start to see a little perspiration coming out around his brow.

Dr. Christianson started down the third row. Now the students were beginning to get a little angry. Dr. Christianson asked Jenny, "Jenny, do you want a donut?"

Sternly, Jenny said, "No."

Then Dr. Christianson asked Steve, "Steve, would you do ten more push-ups so Jenny can have a donut that she doesn't want?"

Steve did ten; Jenny got a donut.

By now, a growing sense of uneasiness filled the room. The students were beginning to say "No" and there were all these uneaten donuts on the desks.

Steve also had to really put forth a lot of extra effort to get these pushups done for each donut. There began to be a small pool of sweat on the floor beneath his face, his arms and brow were beginning to get red because of the physical effort involved.

Dr. Christianson asked Robert, who was the most vocal unbeliever in the class, to watch Steve do each pushup to make sure he did the full ten pushups in a set because he couldn't bear to watch all of Steve's work for all of those uneaten donuts. He sent Robert over to where Steve was so Robert could count the set and watch Steve closely.

Dr. Christianson started down the fourth row. During his class, however, some students from other classes had wandered in and sat down on the steps along the radiators that ran down the sides of the room. When the professor realized this, he did a quick count and saw that now there were 34 students in the room. He started to worry if Steve would be able to make it.

Dr. Christianson went on to the next person and the next and the next.

Near the end of that row, Steve was really having a rough time. He was taking a lot more time to complete each set.

Steve asked Dr. Christianson, "Do I have to make my nose touch on each one?"

Dr. Christianson thought for a moment, "Well, they're your pushups. You are in charge now. You can do them any way that you want." And Dr. Christianson went on.

A few moments later, Jason, a recent transfer student, came to the room and was about to come in when all the students yelled in one voice, "NO! Don't come in! Stay out!"

Jason didn't know what was going on. Steve picked up his head and said, "No, let him come."

Professor Christianson said, "You realize that if Jason comes in you will have to do ten pushups for him?"

Steve said, "Yes, let him come in. Give him a donut"

Dr. Christianson said, "Okay, Steve, I'll let you get Jason's out of the way right now. Jason, do you want a donut?"

Jason, new to the room, hardly knew what was going on. "Yes," he said, "give me a donut."

"Steve, will you do ten push-ups so that Jason can have a donut?"

Steve did ten pushups very slowly and with great effort. Jason, bewildered, was handed a donut and sat down.

Dr. Christianson finished the fourth row, and then started on those visitors seated by the heaters. Steve's arms were now shaking with each push-up in a struggle to lift himself against the force of gravity. By this time sweat was profusely dropping off of his face, there was no sound except his heavy breathing. There was not a dry eye in the room.

The very last two students in the room were two young women, both cheerleaders, and very popular. Dr. Christianson went to Linda, the second to last, and asked, "Linda, do you want a doughnut?"

Linda said, very sadly, "No, thank you."

Professor Christianson quietly asked, "Steve, would you do ten push-ups so that Linda can have a donut she doesn't want?"

Grunting from the effort, Steve did ten very slow pushups for Linda.

Then Dr. Christianson turned to the last girl, Susan. "Susan, do you want a donut?"

Susan, with tears flowing down her face, began to cry. "Dr. Christianson, why can't I help him?"

Dr. Christianson, with tears of his own, said, "No, Steve has to do it alone, I have given him this task and he is in charge of seeing that everyone has an opportunity for a donut whether they want it or not. When I decided to have a party this last day of class, I looked at my grade book. Steve here is the only student with a perfect grade. Everyone else has failed a test, skipped class, or offered me inferior work."

"Steve told me that in football practice, when a player messes up he must do push-ups. I told Steve that none of you could come to my party unless he paid the price by doing your push-ups. He and I made a deal for your sakes."

"Steve, would you do ten push-ups so Susan can have a donut?"

As Steve very slowly finished his last pushup, with the understanding that he had accomplished all that was required of him, having done 350 pushups, his arms buckled beneath him and he fell to the floor.

Dr. Christianson turned to the room and said. "And so it was, that our Savior, Jesus Christ, on the cross, plead to the Father, 'into thy hands I commend my spirit.' With the understanding that He had done everything that was required of Him, He yielded up His life. And like some of those in this room, many of us leave the gift on the desk, uneaten."

Two students helped Steve up off the floor and to a seat, physically exhausted, but wearing a thin smile.

"Well done, good and faithful servant," said the professor, adding "Not all sermons are preached in words."

Turning to his class, the professor said, "My wish is that you might understand and fully comprehend all the riches of grace and mercy that have been given to you through the sacrifice of our Lord and Savior Jesus Christ. He spared not only His Begotten Son, but gave Him up for us all, for the whole Church, now and forever. Whether or not we choose to accept His gift to us, the price has been paid."

"Wouldn't you be foolish and ungrateful to leave it lying on the desk?"

Be sure to remember the reason for this season.

0 Comments:

Post a Comment

Links to this post:

Create a Link

2006-04-13

Peace

There is more peace in a God-led life upheaval than in all the "comforts" the world has to offer.

Josie Oxendale, new missionary

It is at once obvious and profound. And yet, if we want peace and truly believe this, why are we not consumed with the goal of seeking God's will and the upheaval it brings?

I'm about halfway through reading "God's Debris", the fictional thought-experiment of Douglas Adams of Dilbert fame. It's not for the faint of heart - the book explains an alternative view of the world (not Adams' own, perhaps nobody's), and asks the reader to consider how such a view may affect their own world view.

One particular passage was especially hard for me to read:

"Four billion people say they believe in God, but few genuinely believe. If people believed in God, they would live every minute of their lives in support of that belief. Rich people would give their wealth to the needy. Everyone would be frantic to determine which religion was the true one. No one could be comfortable in the thought that they might have picked the wrong religion and blundered into eternal damnation, or bad reincarnation, or some other unthinkable consequence. People would dedicate their lives to converting others to their religions.

"A belief in God would demand one hundred percent obsessive devotion, influencing every waking moment of this brief life on earth. But your four billion so-called believers do not live their lives in that fashion, except for a few. The majority believe in the usefulness of their beliefs-an earthly and practical utility-but they do not believe in the underlying reality."

"They say that they believe because pretending to believe is necessary to get the benefits of religion. They tell other people that they believe and they do believer-like things, like praying and reading holy books. But they don't do the things that a true believer would do, the things a true believer would have to do.

"If you believe a truck is coming toward you, you will jump out of the way. That is belief in the reality of the truck. If you tell people you fear the truck but do nothing to get out of the way, that is not belief in the truck. Likewise, it is not belief to say God exists and then continue sinning and hoarding your wealth while innocent people die of starvation. When belief does not control your most important decisions, it is not belief in the underlying reality, it is belief in the usefulness of believing."

Wow! It's not very often you hear a non-Christian echoing the words of Jesus, but I think this is such a case. His analogy only goes so far, though. I don't believe God calls for Christians to give away every penny they have as long as one person on Earth is undernourished, nor to spend it on today's food at the expense of an engine for delivering food more regularly. Giving a fish vs. teaching to fish, and all that.

But I digress.

It is refreshing to see word in the media of at least one school with both standards and a backbone. University of the Cumberlands in Williamsburg, KY has expelled a student (Jason Johnson) because he admitted to being gay, in violation of the standards of conduct.

There is, without a doubt, a time for war as well as peace. The UoC could have chosen the way of peace and closed their eyes to this situation, but that would have been wrong. I don't believe every school should operate in this way, nor even every Christian college, but I do believe a school should stick to its policies if it believes in them. I also believe that gays have the right of access to higher education, just as gossips, liars and other sinners are. I am pleased that UoC has enforced their policies, even knowing there would be a reaction.

"He is being asked to leave the university because he is gay," [his boyfriend] Dreyer wrote Thursday on the Web site MySpace.com, the same site school officials used to confront Johnson. "Help get the story out there so that all the gays and lesbians at the university will no longer have to live in secrecy, in fear of having their dreams crushed in front of them."

I have to wonder, is it their dream to graduate from a school which disallows homosexual behavior?

The policy under which Johnson was dismissed states "Any student who engages in or promotes sexual behavior not consistent with Christian principles (including sex outside marriage and homosexuality) may be suspended or asked to withdraw." If the school expels a student for having sex outside marriage, should the other sexually active students "get the story out there so that all the heterosexuals at the university will no longer have to live in secrecy, in fear of having their dreams crushed in front of them"??

While the press is castigating a school for doing what it is designed to do (teach difficult lessons), a madman in Iran is making thinly veiled overtures of war in the name of peace. President Mahmoud Ahmadinejad announced Tuesday that Iran has joined the club of nuclear nations, having produced a significant quantity of enriched uranium. Just last week, Iran announced a flying boat, an orbiting satellite, a multiple warhead missile, and an underwater missile that can outrun any ship in the sea. Ahmadinejad insists the timing of these developments is coincidental, and the nuclear capabilities will only be used for electrical generation.

And yet, the press and the U.N. still think we should explore the diplomatic option ad infinitum. Fredrick the Great (an otherwise not very admirable person) once observed that diplomacy without arms is like music without instruments. Unless the diplomacy is backed up by military might and the will to use it, it means nothing.

From where I'm sitting, this all looks like a well-coordinated, multinational attack on Christianity, but that perhaps is a topic for another day.

3 Comments:

  • At 11:16 AM CDT , Anonymous said...

    Adams' theory, that God annihilated himself in order to exist as the Universe, that is pandeism. So his analysis of the irreligiosity of the masses makes sense because truly Jesus was a pandeist, one who was in touch with the pandeistic God of which we are all made at the deepest of levels. And if you don't think Jesus was advocating that people give every penny as long as one person is starving in the world, then you should get to know Jesus better, because that is EXACTLY what he is saying. Letting another suffer when you can prevent it, that is a sin; inflicting pain on another, no matter what they have done, that is a sin as well... It is a sin because God is the universe and the pain and suffering we allow or even inflict on each other, that is pain and suffering we are inflicting on God, thus on ourselves. Let's get over the sinning and help each other.

     
  • At 3:16 PM CDT , Bruce said...

    So you're saying that I should buy a man a fish today, and ignore the idea that I might teach him to fish tomorrow by instead giving the money to someone who specializes in teaching people to fish?

     
  • At 2:39 PM CDT , Anonymous said...

    Or you could become someone who specializes in teaching people to fish, and learn to find your greatest joy in the success of each student. I try to teach people to want to specialize in teaching people to fish.

     

Post a Comment

Links to this post:

Create a Link

2006-04-07

Internet Radar

Ever longed for a single place you could check to see if all was well on the internet?

Talisker Computer Network Defense has a cool page which pulls together updates from a variety of other sites. The page uses Java, so be forewarned if you have a slow computer.

The site has scrolling news items, links to several "state of the net" gauges (Internet Storm Center, for example), and also tracks all the major Antivirus vendors for updates and patches. The page self-updates every 20 minutes.

The National Security Agency has this projected on a big screen TV. At least, it would appear this way, judging by a picture taken during President Bush's visit to the NSA this January. More info here.

[via the Nmap homepage]

0 Comments:

Post a Comment

Links to this post:

Create a Link

2006-04-04

Matthews making news

Literally.

MSNBC Matthews Declares Himself Winner Of DeLay Scoop-stakes
Tue Apr 04 2006 09:53:05 ET

Late yesterday evening, TIME magazine's White House correspondent Mike Allen broke the story online that former House Majority Leader Tom DeLay (R-TX) was resigning his House seat after the congressman provided the reporter with an exclusive interview in Sugar Land, Texas.

However, in an effort to break the news first, MSNBC's Chris Matthews broke into his cable network's SCARBOROUGH COUNTRY via phone shortly after 10 PM eastern time to announce the "breaking news" that DeLay would step down from his House seat.

Matthews excitedly declared: "I just was on the phone… with U.S. Congressman Tom DeLay of Texas, who is fighting for reelection. And he told me tonight, just a moment ago, that he's going to withdraw from the race tomorrow. He's not going to seek reelection."

This morning, TIME's Mike Allen was interviewed by CNN's Miles O'Brien to discuss his exclusive with DeLay. CNN's O'Brien opened the interview by saying: "Mike Allen, the White House correspondent for TIME magazine broke the story. Glad to have you with us."

Meanwhile, on NBC's "TODAY SHOW," host Katie Couric introduced Matthews during the show's DeLay package by describing the flamboyant cable host as the person "who broke the story." The interview closed with Couric saying "Congratulations on breaking the story." Matthews replied "Thank you very much."

Yes, that's right. He declared himself the newsbreaker even though someone else released it first. It could be excused when he broke in on Scarborough Country, but by the next morning, he should have known that someone else released it first.

Unless you're not into checking facts, of course.

[via Drudge]

0 Comments:

Post a Comment

Links to this post:

Create a Link