Archive for the ‘Odd’ Category

Error’d: CAPTCHA’d

posted by Admin
Sep 7

What’s that, you say? We should have an entire Error’d dedicated to CAPTCHA images? Sure, why not!


Alex van Herwijnen spotted this interesting problem presented…

 

… which, of course Dan Ferrante noticed that ESPN provided a solution for.

 

You’re right though, spousal abuse is not funny. But I know what is! Bathroom humor, like what Scott Lewis found at Ticketmaster!

 

See? Even Avast! anti-virus software is getting a peece of that action (from Viront).

 

"Really?" Justin Self wrote, "I have to type this? I just needed some help with Java!"

 

Well Justin, help was out there… but not for your Java. Matt found this combo, which seems to help with the previous pain in the butt.

 

I guess I’ll take the advice that Tim Gourley saw, at keep it clean from now on.

 

Moving on, Andy wondered if Bloglines really wanted their CAPTCHA to be linked to the KKK.

 

"Admittedly, this took me a lot longer to solve than usual," wrote Dan Thompson, "but when I finally got to upload my image, I felt a real sense of achievement."

 



Go to Source



The Best (from Chris)
A while back, I helped interview for a programmer position on the web team. After talking to a number of candidates, we finally settled on an older gentlemen, probably in his late 50s. It wasn’t an easy decision. Not only were his salary requirements above what we planned to pay, he had a few personality quirks. For example, a large part of his interview entailed him describing how he was a master composer of music, and had published songs in nearly every genre, including country, rap, pop, etc. But no matter, his experience and technical skills were top-notch.

After making an offer that met his salary requirements, the candidate made a counter offer: fifteen-thousand dollars more annually plus a signing bonus. Unfortunately, our budget couldn’t accommodate that, and we declined. Negotiations after that failed, so we formally rescinded the offer for employment so we could talk to more candidates.

Later that day, the CEO of company received a rather childish email from the gentleman. He rambled on about age discrimination, made other accusations, and stated that he "knew" that we were hiring the "other" man that he had met when leaving his interview. His closing words were: "you could have had the best, now you’ll just have the rest!"

The "other" man he referred to was in his early 30s, and was interviewing for an entirely different position (business analyst) in an entirely different department. Looking back, we were all pretty happy that he didn’t accept the position.

The TDWTF Interview (from Christian Riesen)
Two years ago, I was on the job hunt, and one company that looked interesting was a university spinoff. At the interview, I learned that they dealt with some specialization software that had to talk to a few different systems. Most of the code was in PHP, but there also were some .NET and Java components that were used to interface with the hardware’s proprietary drivers.

One thing they were particularly proud of was the fact that the system was recently rewritten from Perl into PHP. Their pride came from the fact that none of them had coded PHP before that, but they had a strong theoretical knowledge, being university guys and all.

Next, they told me about the environment that they work in. As it turned out, the five-man crew worked all in the same room we were interviewing in: a factory attic converted loft style, with one wall made of glass in it so the conference "room" we sat in wouldn’t disturb the others. Each employee had their own desk that was about twenty feet from another, which meant there was a lot of yelling going on. In addition, everyone used whatever the hell they wanted to code on whatever operating system they wanted: Windows, Linux, Mac OSX and one even swore on FreeBSD.

Then came the general technical part of the interview: how I would setup a class, what I would do with a certain language construct, how I would solve a certain problem or assess a situation, all the fun things. Then they showed me two half pages of code in PHP. They told me to look at the code carefully and, if I wanted to change anything, write on the paper what I would change and why. As that would take some time, they left me to it for about twenty minutes. I was certain that they had set me up with a TDWTF-style interview, where they’d pick out a fun code WTF (actually, it looked like this one) and have me turn a convoluted two-page mess into a two lines of code.

When they came back, I complimented them on the clever examples of bad code and presented them with my rewrite. One of interviewers — the chattier of the two — didn’t say another word; he was clearly upset, and I was half-concerned it might get physical. The other guy was a bit better, but he also wore a rather large frown on his face. "This is from our production code", was the reply.

I left the interview shortly after that, with a short bye from the one guy, and just a short nod with some nasty stares from the once-chatty guy.

 

The Storm-out (from Joshua Armstrong)
I’ve always dreamed of storming out of an interview, but I’ve never actually realized that goal. That is, until my interview with a certain "tech recruiting" firm.

First things first, I was lured in under the guise that I’d be actually interviewing for a job, not being primped for another interview. The firm’s client was, as the technical recruiter put it, "an ISP like Yahoo! or Google." I thought to myself, neither of those companies are ISPs, but I didn’t say anything.

When we moved on to the technical portion of the interview, his first question was "do you had any experience working at a server." And just to be extra clear, those were his actual words: "working at a server."

"Well, yeah of course," I diplomatically responded, "I am a network admin, after all… and I’m physically at servers all the time. That’s what you meant, right?"

"No no," he clarified, "were any of the businesses you’ve worked at servers? That is, would you consider them to be a server?"

I said, "Err, uhh…. I don’t know," and things went downhill from there.

"Have you ever connected to the database?" he asked next.

"Huh? Do you mean in code? Admin tools? Which database platform do you mean?"

He paused for a moment and said, "sounds good to me. Do you have experience working at an ISP?"

"I think you’re using a different definition of ISP than me," I responded, "what I mean is… I wouldn’t have considered Google to be an ISP, but a search engine. Can you clarify?"

"No, no. They’re actually both ISPs, as they allow people to access websites. Would you consider any of the companies you worked at to be an ISP?"

"Uhh… I guess not."

He scribbled something down on his paper mumbling something about how a bank is probably an ISP and added, "have you troubleshot IIS?"

"Not, but I have maintained several Apache servers."

"Oh good, then you have since Apache is IIS. Moving on, what’s the diff—"

"Err," I cut him off, "they’re both web servers, but Apache is not IIS."

"No, no. It is. Apache is actually a kind of IIS, so yes, you have troubleshot IIS. Anyway, what’s the difference between layer 7 routing and layer 4 routing?"

Finally, an answer I was prepared for. "Layer 7 is the Application Layer, and routing focuses on requests to resources that will be fulfilled in the shortest time. Layer 4, the Transport Layer, routing focuses on ensuring that all paths to a host are utilized proportionally to their bandwidth and response"

"Actually," he gave a confused look, "I was looking for an answer involving, uh, DNS pools and host headers. Shall we just say that was your answer?"

I was pretty frustrated by that point, as I knew this interview was going nowhere, and the "technical recruiter" was grasping at straws and hoping to get me in front of thier "ISP" client. I said, "actually, I was just looking for the door," and got up and left.

Later that day, I just got an e-mail from him thanking me for his time, and asking me to forward two references from each job. He also said that he’d taken the liberty of rewriting my resume to include a couple of things about my experience troubleshooting IIS, and that he was planning on submitting it to his client as soon as I got the references. I ignored the email.

 


Have tales from your own interview? Then be pal and share them!



Go to Source


Sep 7

"I was recently assigned to work on a team that maintains a fairly large product," writes Aaron, "at first, I was a bit overwhelmed by the complexity of the architecture. There were countless layers of abstraction, thousands and thousands of classes, and design patterns galore. Since it was such a large project – and my first large project – I figured that the architectural complexity was simply par for the course."

“Then I started looking at the code a little more closely. If I had two words to describe it, they’d be ‘unnecessary complexity.’ And if I had one snippet to describe it, it would be this.”

private void SetAccount(RequisitionData.RequisitionItem requisitionItem,
                        AccountData.Account account, bool automation)
{
    bool allowSetAccount = false;

    if(account != null)
    {
        // if the account entry is being set by automation, ensure that
	// the user hasn't already set a value
        if (automation)
        {
            if (!requisitionItem.IsAccountCodeNull())
            {
                if (requisitionItem.AccountCode == string.Empty)
                    allowSetAccount = true;
                else
                    allowSetAccount = true;
            }
            else
                allowSetAccount = true;
        }
        else
            allowSetAccount = true;

        if (allowSetAccount)
        {
            requisitionItem.AccountID = account.ID;
            requisitionItem.AccountCode = account.Code;
        }
    }
}

Aaron continued, "the beauty of it is that the method is private within the class, and has an ‘automation’ boolean parameter. This parameter is always passed as true."



Go to Source


Fast Fix

posted by Admin
Sep 7

"Do you think it’s wise to have consultants running our IT department?" Holger asked. It was an honest question, worded as diplomatically as possible. Holger’s company had more consultants on hand than actual IT staff.

"Holger, these folks are experts," his manager replied. "It isn’t cost effective to hire-on this level of expertise full time. We may pay a little more up front, but when we don’t need the consultants anymore, we can hand it off to our internal people."

Holger left that discussion pretty sure he had just been called incompetent. Maybe I should ask the consultants if they’re hiring, Holger wondered to himself, thinking of the big money they pulled down relative to his salary. The thought was still percolating in his head when he sat down with the two newest consultants, Zack and Jack for their status meeting.

Holger hooked his laptop up to the projector and ran through a few recent changes in the configuration database, discussed the implications, and then moved onto other topics. He stopped paying attention to the computer, and it eventually dropped to its screensaver. Moments later, there was some snickering from Zack.

"Having some computer trouble?" Jack asked, mockery in his tone.

Holger glanced at the projection screen and saw that his screensaver was was running merrily. It merrily painted a BSOD to the screen, with plausible driver dumps, merrily churned the disk a little, like it was saving the contents of RAM, and merrily ran through a simulated reboot sequence. After which, the process repeated itself, merrily. "Oh," Holger said, "that happens sometimes. I’ve got it under control. No worries."

"Yeah, whatever," Jack said. The meeting continued.

The product of the meeting, like too many other meetings with consultants, resulted in the need for another meeting. "Let’s see what my calendar looks like," Holger said. He grabbed the mouse, killed the screensaver, and called up his email client.

Zack gasped. "How did you do that?" Jack marveled.

"Oh, that?" Holger said. With his best deadpan, he said, "I got tired of waiting for the reboots to complete. I put together a tool that does an automatic fix and restart, letting me just continue right from where I left off."

Holger waited a beat. After a moment, he was certain that these consultants would realize he was pulling their leg.

Zack was up in a flash and quietly closed the door. Jack leaned across the table towards Holger and asked, "Did you make that on company time? And does anyone here know if you did? Because before we go back into that hallway, I want to buy this off of you."

"You don’t have that kind of cash," Holger said.

"No, but I can put it on the expense account and then pay it off when I get VC funding," Jack said.

Holger spent the next fifteen minutes declining their offers to buy his tool. In the process, he discovered that the consultants had creative and unethical ideas about how to quickly get funding, and that one of them had a trophy wife that would do anything for the kinds of profits they were talking about. "And I do mean anything," Zack said with a leer.

Finally, Holger "confessed". "Look, you guys are generous and all, but I’ve already signed a contract with another company. Even if you could beat their offer, I can’t break a contract."

"Sure you can!"

Holger left the meeting without any interest in finding out if their company had any openings.



Go to Source



It’s time for an update on my 30 day challenges. Here’s what I’ve done the last few months:

June: I didn’t respond to email after 10 p.m. and I read the New Testament of the Bible. Both were interesting in different ways. It turns out that 10 p.m. is a pretty good time for me to turn off email (I’ve tried 9 p.m. in the past and that didn’t work–Google can be a very email-heavy place at times). I’d like to get back to this habit, because it made me distinctly more mellow at night. I noticed that I slipped pretty quickly back into the “email anytime I’m awake” habit.

Reading the Bible was more work. I’ve mentioned before that I grew up the son of an evangelical Christian and a physics professor, which was helpful to learn how to respect other people’s opinions. I hadn’t read the Bible in recent years, so it was enlightening to read it as an adult. If I had to sum up the New Testament in a sentence, it would be “do unto others as you would have them do unto you” (the golden rule). However, for all the talk about mercy and compassion in the New Testament compared to the Old Testament, there was still quite a bit of fire/brimstone/judging. I enjoyed reading some books (e.g. Acts and Romans) that I didn’t remember much from growing up. Other parts I enjoyed less. But I got a lot out of reading the New Testament, including some appreciation of the text as literature and as history.

I grew up on the King James version of the Bible. But newer translations are a lot more readable in my opinion. I enjoyed the New Living Translation. By the way, I really enjoyed an Android app called CrossConnect Bible (here’s more info on the app on AppBrain). CrossConnect Bible has really solid spoken-word audio of the Bible. It’s perfect for listening on commutes.

One meta-lesson I learned is that for some people, any discussion of a religious book in any context (even as literature or its role in history) is considered as rude as farting. That was something that I didn’t expect in oh-so-open-minded California. Heck, a few people may complain that I discussed the Bible (without endorsing or condemning it) even this much on my personal blog. Sorry if I’ve offended.

July: I tried to use only cloud-based software. For the most part, this was pretty easy, but in a few instances I wasn’t completely in the cloud. I needed to open a terminal window from time to time to type various UNIX commands, and I had to take and crop a few screenshots. Side-note: for taking Chrome screenshots, I now recommend Screen Capture by Google because it can save in .png format really well, with a close second-place of Awesome Screenshot.

After about a year of conscious effort, I pretty much live in the cloud at this point, and I love it. My data is usually in the cloud, so I can get to it from any computer. I’ve switched all my daily software and operating systems to open-source projects such as Linux/UNIX, Chrome, and GIMP. I try to live by the principle “don’t put data where you can’t get it out,” which means that I don’t give my data to some companies and I try to avoid proprietary file formats or things locked down with DRM. I don’t use any pirated software. The latest version of Ubuntu (Lucid Lynx) is fantastic, by the way. This was mostly an easy, fun month. I think lots more people will live more in the cloud in a few years.

August: I took a picture a day. I knew that I’d be climbing Kilimanjaro in August and wouldn’t be near a computer, so I decided to take a picture a day. On the plus side, I started to be more aware of unusual sights around me. On the negative side, I missed a few days and I haven’t posted the pictures anywhere yet. I think reviewing each day’s photos (and posting them for public comments) would be a much better way to improve my sense of composition and photography skills. I still hope to post my favorite daily pictures though.

September: This month, I plan to meditate or quietly reflect for 15 minutes a day. I started today, and quickly learned that quieting my thoughts is pretty hard. I lasted about 2.5 minutes before so many to-do items were bouncing around in my brain that I had to take a break and write a bunch down before restarting. But I did enjoy my first session. I also managed to get my pulse rate pretty low. Now I have to avoid the trap of seeing how low I can get my pulse to go and just enjoy the quiet.

Feel free to join me in my challenge this month–at only 15 minutes a day, it’s a pretty good way to try out a 30 day challenge! :)


Go to Source



Kristján writes, "I agree. No, wait…"

 

"I got this while doing my online homework for a calculus class I am taking," wrote Chase P., "I mean, it’s freaking 42 of all numbers – how could it NOT be correct??."

 

In order to take over the earth, the Brain hatched a plan where he would sieze control of the world’s banking system. The plan was true genius, but like all big plans, he had to start somewhere which, in this case, was to take control of OneWest Bank’s QuickPricer.


 

"I know that folks in Texas have strong feelings about where they live," wrote Reinier, "but I had NO idea that people in South Africa did too!"

 

"I wasn’t exactly sure what to do here so," writes Johann, "I figured it safest to click on the "X" to close the window, manually restart, and pray for the best"

 

"The text translates roughly "Some tray icons can’t be shown. There isn’t enough space to show all objects in system tray. Uninstall some programs or try to use larger display resolution.," writes Maar, "I guess that I’ll be able to justify that larger monitor purchase after all!"

 

"I think I’m going to take my chances and say ‘no’ the extended warranty," writes Stewart.

 



Go to Source


Stoned!

posted by Admin
Aug 31

When Greg was shopping for jobs at his college’s career fair, there was a whole lot of business as usual.

The larger banks were on-hand looking to swoon the upcoming Financial grads. Several representatives from a few big name manufacturing corporations were there to interview the Chemistry majors and a few IT firms were on the lookout for the soon-to-be CS grads, like Greg, to add to their ranks. However, amid the ocean of pamphlets and  suits there was one aerospace corporation with one particular position that caught Greg’s attention. The position that he applied and was ultimately hired for could be summed up in one sentence:

“You’ll be testing laser tag games for the military.”

A Dream Come True!…kind of

Actually, Greg’s official title was “QA Analyst for Battlefield Training Simulation Systems” but the idea of the system being a great big laser tag game really wasn’t all that far off the mark.

The way the existing setup worked was that sensors on a soldier’s body vest would detect a “hit” during the simulation, and would then set off an annoying alarm that could only be turned off with a special key. Once deactivated, the solder was ‘dead’ for the rest of the training scenario. It all worked, but one big problem with the whole setup was that, to the displeasure of many, a few enterprising soldiers managed to get their hands on and started selling tester keys (also known as “God Keys”) that allowed soldiers to resurrect themselves and get back into the battle.

After a number of years of trying to prevent soldiers from exploiting the system and a host of other technical headaches, the military was finally able to replace their system with something a little newer.

New features like the addition of GPS tracking units, RF data modules reporting hits and their locations and a slew of backend upgrades meant that military trainers could execute more extensive and complex training scenarios and, over time, recoup the costs because the new system was designed to rely on “off the shelf” 3rd party solutions, but first, these solutions would need to be vetted by QA guys like Greg.

Getting Stoned

Like any new hire, Greg was completely pumped and ready to contribute and shake things up his first week, but as time went by, Greg’s excitement dwindled when he found that doing QA analysis didn’t really involve shooting co-workers with laser guns, but instead was a lot of tedious, hard work with project managers and piled on bureaucracy for good measure.

In one particular situation they received a firmware update for one of the GPS systems being used in the Player Unit modules.

While trying to figure out why the latest hardware revision was failing immediately after the first test he noticed that the GPS receiver would send out a burst of garbage every few seconds.

Puzzled by this he checked and re-checked the connections and tried one of the spare units only to find the same result. Everything seemed like it should fine and the supplier swore there was nothing wrong with their system. Not able to let something like this go, Greg spent many late-night hours pouring through raw dumps of the results and along the way, he began to notice a pattern of the same Hex data repeating in the noise. As he painstakingly translated the hexadecimal into ASCII, he was genuinely surprised upon being greeted with a curious snippet of text.

Your PC is now Stoned!

After a quick search on the message, it all made sense. Somehow, the firmware upgrade for the GPS system had become infected with a disk boot sector virus, which ran perfectly fine on the embedded processor. Since this virus couldn’t write itself to a disk, as there were no floppy drives on the GPS card, it instead sent itself out through the RS-232 port once every 5 seconds in hopes of infecting another computer.

Greg wrote up his analysis and forwarded it off to the vendor, who quickly (and quietly) issued another update to their firmware, identical to the last except without the virus.

Upon loading of the updated firmware, Greg noticed the difference immediately and was pleased to see that the vendor’s "fix" resolved the "data issue" that he’d reported, however, there was a small catch to this tiny update. You see, preliminary testing for military equipment is a long and detailed process that makes the most draconian corporate processes look positively streamlined.  Also, since the magic keyword "virus" had been uttered, QA testing couldn’t just pick up where it left off, and couldn’t just be for the GPS module.  In fact, Greg had to start over at step 1 with added "anti-virus" steps add in for good measure just to be sure.



Go to Source


Aug 31

"While digging through some inherited code," writes Joe "M2tM" Smith, "I encountered a conditional masquerading as a loop."

"Thankfully, the fellow responsible is ‘no longer with us’, and I suppose this type of code stands as silent testament to why. This interesting loop is only created so the break keyword can be used as an elaborate GOTO."

bool bCreateModel = false;
for (;;)
{
    if (!pModel)
    {
        bCreateModel = true;
        break;
    }

    if (asModelParts.GetSize() != asModelPartsToLoad.GetSize())
    {
        bCreateModel = true;
        break;
    }

    for (UINT32 i = 0; i < asModelPartsToLoad.GetSize(); ++i)
    {
        if (asModelPartsToLoad[i] != asModelParts[i])
        {
            bCreateModel = true;
            break;
        }
    }

    break;
}



Go to Source


Large Blockage

posted by Admin
Aug 31

The words "Enterprise Integration" strike fear into the most stalwart of developers. When coupled with "in-house developed" and "B2B", one is almost guaranteed to find complex code, arcane requirements, and a thicket of poorly understood file formats. Dan was made of sterner stuff. When the contract was explained to him, he didn’t flinch. There were between 40 and 80 partners that used a web app to extract data about multimedia assets? Gigantic recordsets of them? In formats ranging from Excel to iTunes-compatible databases? No problem.

Steve, the project manager, explained: "Our original lead developer was one of those rockstar types. Real cutting edge, pushing the envelope type guy. He’s since moved on to bigger and better things, so we’ve just muddled on the best we could. We really need you to step up and take on that rockstar role for us, because there are a few problems we’d like you to fix. And we need a real quick turn-around on this."

"What sort of problems?" Dan asked.

"Well, these exports take hours. That’s expected- it’s a huge pile of data- but some of our partners are complaining that it crashes on them near the end of the job. So they have to start all over. Hours wasted. That’s the big thing, but some of our other developers suggest that you try and do a little ‘refactoring’?" Steve used air-quotes and a look of incomprehension to convey the question. "They said it should help make maintenance cheaper. Is that right?"

"It could," Dan said. "Let me see your documentation and the code, and I’ll see what I can do."

They only had code. Dan opened the solution up in Visual Studio and started poking around. He looked for any classes that were responsible for exporting. He expected to see a whole family of them tied together through inheritance, probably named something like "XMLExport", "ITunesExport", or something equally transparent.

He didn’t find a family of classes. In fact, he didn’t find any classes. The entire project was lacking in any code or code behind files- not a single ".cs" in sight. Not even a ".vb". The only likely candidate was "Export.aspx".

"Do I have the right code?" Dan wondered, thinking there must be some class library he was missing. Dan double-clicked on "Export.aspx" and waited for the file to open. And waited. The HDD rattled away; its noise covered up the faint sound of Visual Studio sobbing to itself. By the time Dan finished his cup of coffee, the file appeared on the screen. Dan skipped down to the postback event handler, which was wedged in-line between the opening <body> and the page heading. It took Visual Studio over a minute to repaint the screen.

At four levels of indentation under the event handler, there was a switch statement. This statement simply checked which button was clicked. The first case, for "__exportButton" contained a twenty-five thousand line block of if/else statements.

"Oh, this can’t be right," Dan wished. "This must be old code. Or some obscure branch used for… for… for hazing the new guy." He checked SVN. There was only one branch and the most recent check-in was from the day before, with the comment, "changed XML date format for iTunes export."

Dan patted Visual Studio’s shoulder and tried to console it by closing every other application running, to free up some RAM. He and Visual Studio, both on the verge or crashing, struggled to read through the document together.

At the start of the event handler was this:

//Server.ScriptTimeout = 3600;
//Server.ScriptTimeout = 10800;
Server.ScriptTimeout = 21600; //six hours should probably be enough. If it keeps crashing, raise this.

The code went downhill from there. The actual export logic in the twenty-five thousand line block contained batches of hard-coded SQL queries- they all varied slightly, but not much, and it was hard to spot the differences. For each SQL query executed, a new database connection was opened. The block responsible for closing them all, was near the end, and looked something like this:

oldCnon.Dispose();
db1a.Dispose();
dbMain.Dispose();
db1.Dispose();
connCore.Dispose();
newConn.Dispose();

Once a connection was opened, it stayed opened until the export job completed. There were copy/pasted blocks that repeated the same code again and again, although over time, they had drifted apart so they weren’t exactly the same anymore, but mostly. The web page itself handled all of the file I/O, the communication with Excel Interop libraries. One of the XML formats was generated, not by using the XmlWriter object, but by concatenating a pile of strings together. The entire pile was topped off with a bow- the "bow" meaning "only one exception handler for the entire block". The single catch(Exception ex) responded to any error that could possibly happen in that 25,000 line thicket. Its response was to simply print out the informative, "An error has occured(sic). Please correct your request and try again."

Dan wasn’t even sure where to start. For the heck of it, he upped the script timeout from 21600 to 43200. He checked that minor change in with the comment, "This should fix timeouts for the foreseeable future," and then started trying to get a grip on how to pry this pile of spaghetti apart and turn it into supportable code.

The next day, he was elbow deep in "Export.aspx"’s entrails when Steve interrupted. "Hey, Dan!" Steve beamed. "Great work on fixing that bug. I saw your check-in, gave it a spin, and promoted it to production. Fantastic turn-around time on that. Look, since you’re done, we’ve got a lot of other projects that could use some TLC- can I move you onto one of those?"



Go to Source


CodeSOD: Command 696

posted by Admin
Aug 30

Think of all those old applications you’ve had to maintain. You know the type: the ones written by long-forgotten developers in long-lost languages. The ones that, after spending days searching for that one line of code that needs to be changed, you frustratingly decree “this f%*#@ thing needs to be rewritten.” And, naturally, the ones that never are, nor never will be rewritten.

Call it luck or persistence, but after dozens and dozens of maintenance requests over the years, Israel Brewster finally was given the opportunity to rewrite an application. From scratch. And the right way, this time. No shoddy VB6 front-end; no horribly-designed SQL Server 2000 (only) database; and certainly no Microsoft Access-based administration tool.

Though, after his third straight week of digging through form validation logic requirements – many of which were quadruplicated (or more), inconsistent, and often incorrect –he’s started to question if a rewrite is even possible. Consider, for example, Command 696: a method named that simply because Command1 through Command695 were already taken.

Private Sub Command696_Click()

  On Error GoTo Err_Command696_Click

  Dim stDocName As String
  Dim Response As Integer

  If Frame500 = 1 And pax > 37 Then
     MsgBox "CHECK PAX DASH 8 LIMIT 37 SEATS", vbOKOnly
  Else
  End If
  If Frame500 = 2 And pax > 29 Then
     MsgBox "CHECK PAX DASH 8 LIMIT 29 SEATS", vbOKOnly
  Else
  End If
  If totalload1 > 2000 Then
     MsgBox "OVERWEIGHT Fwd Shelf ", vbOKOnly
  Else
  End If
  If ttshelf > 1000 Then
     MsgBox "OVERWEIGHT Aft Shelf ", vbOKOnly
  Else
  End If
  If totalload1 + ttshelf > 2000 Then
     MsgBox "OVERWEIGHT Aft Compartment max 2000 lbs ", vbOKOnly
  Else
  End If
  If Frame500 = 1 And totalloadsecd > 0 Then
     MsgBox "DASH 8 WITHOUT SECTION D ", vbOKOnly
  Else
  End If
  If Frame500 = 2 And totalloadsecd > 2150 Then
     MsgBox "OVERWEIGHT SECTION D ", vbOKOnly
  Else
  End If
  If Remaining < 0 Then
    MsgBox "DASH 8 OVERWEIGHT REDUCE LOAD !!!!", vbOKOnly
  Else
  End If
  If ttload <= 0 Then
    Response = MsgBox("ARE YOU SURE AFT CARGO COMPARTMENT IS EMPTY!!!!", vbYesNo)
  Else
   Response = 6
  End If
  If Frame500 = 1 And pax <= 37 And totalload1 <= 2000 And _
     ttshelf <= 1000 And totalloadsecd = 0 And _
     Remaining >= 0 And totalload1 + ttshelf <= 2000 And Response = 6 Then
    stDocName = "csaprintinfo37seats"
    DoCmd.OpenReport stDocName, acPreview
  Else
  End If
  If Frame500 = 2 And pax <= 29 And totalload1 <= 2000 And _
     ttshelf <= 1000 And totalloadsecd <= 2150 And _
     Remaining >= 0 And totalload1 + ttshelf <= 2000 And Response = 6 Then
    stDocName = "csaprintinfo29seats"
    DoCmd.OpenReport stDocName, acPreview

  Else
  End If



Go to Source