HR-XML Integration in Human Resources Software

Most of the programming and architecture work I do is in the human resources space. I write software for paperless onboarding and acculturation, personell change management, background checks and verification services, new employee requisitioning, and the like. As you can imagine, I spend a great deal of time and effort integrating with human [...]

Categories: Agile Programming | Computer Humor | Computers | CSharp | Dot Net | Emerald Software Group | Humor | Onboarding | Patrick Caldwells Blog | PHP | Programming | Project Management | Service Oriented Architecture | SOA | SQL Server | Technology | Web Development | Web Services | Windows Programming
Writing Anonymous Methods with Lambda Expressions

I like using Lambda expressions for anonymous methods. I don’t really have a good reason for it, but I like it, so here’s the difference. Let’s say you have a class exposing the following delegate: public delegate bool CheckExpirationDelegate(); public CheckExpirationDelegate CheckExpiration; The normal anonymous delegate would look like this: di.CheckExpiration += delegate() { return true; }; But, [...]

Categories: Agile Programming | Computer Humor | Computers | CSharp | Dot Net | Emerald Software Group | Humor | Onboarding | Patrick Caldwells Blog | PHP | Programming | Project Management | Service Oriented Architecture | SOA | SQL Server | Technology | Web Development | Web Services | Windows Programming
Souvenir Potpourri: The Steak Dinner

Ever since the first Free Sticker Week ended back in February '07, I've been sending out WTF Stickers to anyone that mailed me a SASE or a small souvenir. More recently, I've been sending out the coveted TDWTF Mugs for truly awesome souvenirs. Nothing specific; per the instructions page, "anything will do." Well, here goes anything, yet again! (previous: A Crapton of Candy).


It's not every day that one is treated to a nice, steak dinner. Even rarer is when said dinner shows up at your front door, completely randomly and unexpected. Brandon "galgorah" Leach (Boston, MA) wrote, "here's at least one lunch you shouldn't be able to complain about. Well, unless you eat this all in one sitting."

What makes steaks by mail so exciting -- in addition to the fact that they're steaks by mail -- is the fact that they're shipped with dry ice. Nothing is more ominous than opening a package and watching smoke pour out. If you have yet to experience such a treat, this is exactly what it's like.

As for the contents... filet-fricken-mignon and some awesomely delectable sides. Brandon, you rock -- I'll definitely send a couple extra stickers your way and a TDWTF mug, too!


Not pictured: seasoning packet, cutting board, 4 steak knives, ensuing knife fight over the steaks, victorious me,
bloodied coworkers, and steak dinner with lawyer to discuss subsequent lawsuit(s)

 

A.B. Hollar (Harrisonburg, VA) sent this empty Cuban cigar box, happy birthday napkin, Rosetta Stone sticker, and evil lego dude.

 

"To help you with the dire food situation," wrote Daniel Quadros (Sao Paulo, Brazil) "here are some take-out menus. Some of them even offers free delivery!" How exciting! I called up Engenharia Do Hamburguer to place an order. Of course, they spoke some kind of Spanish, so I repeated myself a few times very loudly and slowly. I'm pretty sure those burgers will be on their way soon.

 

Jeremy D. Pavleck sent this massive set of Minnesota souvenirs and randomness, including: invitation to his wedding, which took place at the Science museum on 2^10; orange pencil favor from said wedding;combo pen/pencil from HP; and an itemized list of the contents.

 

This TFT-screen cleaning towel and a two-euro coin is from Matthias Leeb (Wien, Austria).

 

Not to many people can say that they've done the Quebec microbrewery tour. Thanks to Martin King (Quebec, Canada), now I can not only fake it, but prove that I was there, too.

 

Kirby Stirland sent over WTF?: How to Survive 101 of Life's Worst F*#!-ing Situations. Since I'm still entrenched in my insult book, I only had a chance to flip through a few pages. The Amazon excerpts are pretty representative.

 

Alex Garner (S Melbourne, Australia) sent over the chip that started it all: the 8086-2 Microprocessor

 

Jeff Mercer (Raleigh, NC) traded in some refrigerator art for a few TDWTF stickers.

 

A reader from Kansas City, MO sent some swag from around their office, including the Office XP clip foreshaddowing the death of Clippy and Rocky.

 

David Clay (Fairhope, AL) sent some mardis gras throws.

 

Enclosed in Lassi Marttala's (Alavusas, Finland) packet was a few random items, including an unused Geocache logbook, some flypaper, and a box of Pantteri drops. Now I couldn't quite tell if the Pantteri was salmiak candy or dried-up panther turds, and tasting them didn't help identify things one way or another. But either way, I don't think they're intended to be eaten.

 

And finally, a small pile of random souvenirs from around the world. Note that the ugly-ass babies are tasmaian devils.

 


Don't forget to snail-mail in your own souvenirs for some TDWTF stickers. Ultra-awesome souvenirs (like, say, steak) could even get you a TDWTF mug.




Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
Error'd: $50 Cash Fast

I don't know, Dexter, I don't see anything weird about getting $50 fast cash...

...oh, now I get it:

 

This is the error message John R. gets whenever he has a typo in his password. I'm pretty sure his password isn't actually "injustice."

 

Brendan Nee observed some children at a Hong Kong airport enjoying one of my favorite passtimes – dancing on a projected DOS prompt!

 

Vivek Thomas got this error when he clicked the "Forgot Password" link. It's nice that they consider it such a serious issue, but still, I think this is probably bad advice.

 

I don'tunderstandwhy youstruggledwith thisPaolo Tresso.




Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
The Hangar Management System

Photo Credit: 'amber :)' at Flickr Back in 1998, at the Department of Informatics at the University of Umeå in Sweden, the professors had decided that instead of the final exam being solely a regurgitation of knowledge gleaned from text books and lectures, it would be a good idea for students to venture out into the real world to complete their bachelor's degrees. In teams of two, they would spend time with a local business, learn how Information Technology fit in with their daily work, and present it back to the professors.

While most students received mundane case studies, the one that Niclas Olovsson and his teammate were assigned became the envy of the other students - the usage of IT tools for supporting flight mechanics at a local airport. Upon receiving their assignment, Niclaus figured that any modern airport would require a state-of-the-art system to keep their airplanes in the air. He imagined hand held smart terminals that received work orders over an intranet, sent data back over an extranet to a VB application over the internet! The synergistic combinations of buzzwords were endless! However, on the morning of their arrival, much to their chagrin, all they found was a greasy old PC...and Klaus.

Klaus was the head of maintenance for the airline, but you wouldn't know it by looking at him. Smelling like a combination of jet fuel and Camels, he sure didn't look like management. Probably the only thing that made him different than a car garage "grease monkey" was the wings and airline logo on his grease-stained overalls.

Scratching his week old stubble, Klaus began, "So, ya boys wanna learn about how we use computers in the high tech field of modern avionics? C'mon - step into my office - pull yerselves up a chair!" by office he meant the corner of the hanger with the porta potties and by chair, Klaus meant "oil canisters".

Niclas, carefully perched on a canister, started "So, do you have an intranet that you use to..."

"Whoa, slow down...Save your questions for the end - got a lot to cover." 

And in their sessions in the following two weeks, cover he did. Apparently, aviation mechanics are very much into exposing the granular details of everything, from the Airline's Employee Time Entry System to the web page that showed what was for lunch in the cafeteria. 

"Did I show you guys our state-of-the-art, custom CMS yet?"

Niclas perked up - "Er, um, no, not yet - go on!"

Content Management Systems are indeed buzzword-worthy - this would make for a fine bullet point in his presentation and just had to be more interesting than another hour covering the minute details of the airline's phonebook application.

However, when Klaus said "CMS", what he really meant was "Folder on the hanger's computer labeled CMS". Some time ago, the airline had paid a one man company to convert the written manuals into PDFs. And so he did. One by one. As pictures. Luckily the Adobe files were roughly covering a chapter each, so the page numbering in the table of contents was somewhat aligned with the page numbers in the PDF for the first chapter, but for any other chapter, the mechanic had to calculate page numbering difference or scroll through the file to find the right section. 

"I know it seems strange to you guys, but we just sort of know where to go in the electronic manuals." grunted Klaus.

"But, what about those binders?" asked Niclas' teammate.

"They're the updates we get from the airplane manufacturers."

Niclas and his teammate learned that airplane manufacturers regularily update their manuals, and each release supersedes any previous editions. Therefore, even if details of a procedure are on the computer, the mechanic still had to check the update binders before performing any maintenance.

Once their two-week overview was completed, the information was compiled into a very clean presentation of what the mechanics used to do their daily jobs and was presented to a panel of professors. When asked what, if any, recommendations they would make in regards to the situation, Niclas simply responded "we advise taking the train."




Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
Error'd: Y2K Pedaling

"Thank goodness this bicycle I'm borrowing still works after Y2K," Robin Sheat notes, "I can't even imagine the programmer-hours required to bring it up to spec."

 

Google's CSS How-To didn't inspire a whole lot of confidence in Stephen Schwarz.

 

"This error pops up every now and then," Jeff Pitcrew writes, "and this one in particular happened on May 1st. I do respect that they programmed their licensing to be flexible enough for two millennia in, presumably, either direction."

 

"Hmmmm," Jeremy Vanderburg pondered, "I've never heard of this sequel before... but who can keep up with such things these days."

 

Tyler Menezes notes, "apparently null wasn't the answer."

 

"I normally wouldn't send in all-too-common 500-Error," Brian Reiter wrote, "but this error from the website of Chicago Public Radio's This American Life is a head-scratcher on several levels."

 




Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
Statistical Method for Estimating Software Projects

As the Vice President for Research and Development at Emerald Software Group, a large part of my job comprises managing software projects from conception to completion. As a programmer in a management position, I’ve discovered a few things. First, I am very good at estimating how many human hours of programming time it [...]

Categories: Agile Programming | Computer Humor | Computers | CSharp | Dot Net | Emerald Software Group | Humor | Onboarding | Patrick Caldwells Blog | PHP | Programming | Project Management | Service Oriented Architecture | SOA | SQL Server | Technology | Web Development | Web Services | Windows Programming
CodeSOD: Stupid Coding Tricks: The T-SQL Mandelbrot

The bar for entry into CodeSOD is pretty straight forward: professionally-developed code that elicits that certain What The— reaction. Though there have been a few exceptions over the years, generally speaking, student code, hobbyist code, and amateur code need not apply. That said, I'd like to try something a little different today. Today's example is not technically professionally-developed, it's a Stupid Coding Trick.

"So I was bored at work one day," Graeme Job explains, "and wondered, what's the most useless thing I could do with my time without actually doing anything. Then it hit me. I could use T-SQL to generate... Mandelbrot."

Graeme continued, "Following is a single T-SQL SELECT statement that generates a text-representation of a Mandelbrot Set. The results are best viewed in text-mode."

-- AUTHOR: GRAEME JOB
-- CREATED: 12-OCT-2008
-- BECAUSE: SINGLE SQL COMMAND < 50 LINES. JUST BECAUSE.
WITH 
      XGEN(X, IX) AS (              -- X DIM GENERATOR
            SELECT CAST(-2.2 AS FLOAT) AS X, 0 AS IX UNION ALL
            SELECT CAST(X + 0.031 AS FLOAT) AS X, IX + 1 AS IX
            FROM XGEN
            WHERE IX < 100
      ),
      YGEN(Y, IY) AS (              -- Y DIM GENERATOR
            SELECT CAST(-1.5 AS FLOAT) AS Y, 0 AS IY UNION ALL
            SELECT CAST(Y + 0.031 AS FLOAT) AS Y, IY + 1 AS IY
            FROM YGEN
            WHERE IY < 100
      ),
      Z(IX, IY, CX, CY, X, Y, I) AS (           -- Z POINT ITERATOR
            SELECT IX, IY, X, Y, X, Y, 0
            FROM XGEN, YGEN   
            UNION ALL
            SELECT IX, IY, CX, CY, X * X - Y * Y + CX AS X, Y * X * 2 + CY, I + 1
            FROM Z
            WHERE X * X + Y * Y < 16
            AND I < 100
      )
SELECT REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
      REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
      REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
      (X0+X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+X11+X12+X13+X14+X15+X16+X17+X18+X19+
      X20+X21+X22+X23+X24+X25+X26+X27+X28+X29+X30+X31+X32+X33+X34+X35+X36+X37+X38+X39+
      X40+X41+X42+X43+X44+X45+X46+X47+X48+X49+X50+X51+X52+X53+X54+X55+X56+X57+X58+X59+
      X60+X61+X62+X63+X64+X65+X66+X67+X68+X69+X70+X71+X72+X73+X74+X75+X76+X77+X78+X79+
      X80+X81+X82+X83+X84+X85+X86+X87+X88+X89+X90+X91+X92+X93+X94+X95+X96+X97+X98+X99),
      'A',' '),   'B','.'),   'C',','),   'D',','),   'E',','),   'F','-'),   'G','-'),
      'H','-'),   'I','-'),   'J','-'),   'K','+'),   'L','+'),   'M','+'),   'N','+'),
      'O','%'),   'P','%'),   'Q','%'),   'R','%'),   'S','@'),   'T','@'),   'U','@'),
      'V','@'),   'W','#'),   'X','#'),   'Y','#'),   'Z',' ')
FROM (
      SELECT 'X' + CAST(IX AS VARCHAR) AS IX,
      IY,   SUBSTRING('ABCDEFGHIJKLMNOPQRSTUVWXYZ', ISNULL(NULLIF(I, 0), 1), 1) AS I
      FROM Z) ZT
PIVOT (
      MAX(I) FOR IX IN (
      X0,X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18,X19,
      X20,X21,X22,X23,X24,X25,X26,X27,X28,X29,X30,X31,X32,X33,X34,X35,X36,X37,X38,X39,
      X40,X41,X42,X43,X44,X45,X46,X47,X48,X49,X50,X51,X52,X53,X54,X55,X56,X57,X58,X59,
      X60,X61,X62,X63,X64,X65,X66,X67,X68,X69,X70,X71,X72,X73,X74,X75,X76,X77,X78,X79,
      X80,X81,X82,X83,X84,X85,X86,X87,X88,X89,X90,X91,X92,X93,X94,X95,X96,X97,X98,X99)
) AS PZT

 

As for the aforementioned results, I've taken the liberty of pasting them into notepad and snapping a screenshot.

Have any of your own stupid coding tricks to share? Then send 'em on in. The goal of a stupid coding trick isn't obfuscation per se... just, well, stupid awesomeness. Kinda like a quine, except even more useless.




Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
CodeSOD: The Toggle that Wouldn't

"I work for a software development house that creates business software, maintaining legacy MFC applications," Graf writes. "We recently received an issue where a filter-toggle wouldn't switch back and forth, never changing from its default value. It's was a small utility function, rarely used, so we were a bit surprised to see it come up. Taking a quick glance at the code revealed the following:

#define ENABLE_FILTER

void CReport::ToggleFilter()
{
#if defined(ENABLE_FILTER)
   #undef ENABLE_FILTER
#else
   #define ENABLE_FILTER
#endif
}

bool CReport::IsFilterEnabled()
{
#if defined(ENABLE_FILTER)
     return true;
#else
     return false;
#endif
}



Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
Health Care, Elections, and Media — Oh My!

I was trying to learn more about the McCain health care plan today and I ran across this article.   Now, I’m not a professional writer like Paul Krugman by any stretch of the imagination, but I did stay in a Holiday Inn last night, and I have had several articles published in peer-reviewed professional and [...]

Categories: Agile Programming | Computer Humor | Computers | CSharp | Dot Net | Emerald Software Group | Humor | Onboarding | Patrick Caldwells Blog | PHP | Programming | Project Management | Service Oriented Architecture | SOA | SQL Server | Technology | Web Development | Web Services | Windows Programming
Status, Please

“Just give me a damn status!” growled Murray, the aging IT project manager who everyone thought would have been retired by now. In fairness, the fifty-nine year old’s job performance hadn’t waned one bit through his decades-long tenure at Bell Labs. In fact, some would even say that in his later years, he traded some of his trademarked ferocity for geniality. “Dammit,” Murry barked two seconds later at Tom Limoncelli, one of the developers sitting around the conference table, “I don’t have all day! Give me a status!”

“Okay, okay,” Tom nervously responded, flipping through some papers, “we’re… uh, 30% through AMQ, 60% percent towards AMA-2, and… err… 100% for DBD.” Murray frowned and gruffly murmured something unintelligible. That was his way of saying “thank you.”

If a project was progressing on time and on budget, Murray’s mood would be best described as a grumpy indifference. But if things went awry, his demeanor became more threatening than rabid pack of wolves. With firearms. And laserguns. Murray wouldn’t hesitate to publically lambast a colleague simply for knowing someone that knew someone who was holding up the project. And unfortunately for everyone at the weekly meeting, someone was holding up the project.

Although Tom’s rapidly-delivered, precise status report spared him from Murray’s wrath, someone else sat squarely on his warpath. “And you,” he seethed, pointing at the junior developers, “you didn’t give me a status! I asked for status yesterday, where is it? I need a status from you, now!”

The junior grimaced. “We’re… not yet at,” he uncomfortably swallowed, “at… 30% of AMA-3.”

Murray’s face turned a bright red. He closed his eyes and tightly clenched his fists, forcibly and calmly saying “that status is unacceptable. This will put us behind.”

“I know,” he nervously responded, “we’ll stay late, come in on the–”

Murray cut him off, responding with a crescendo of anger. “You should have come in LAST WEEKEND! I NEEDED A BETTER STATUS FROM YOU!” By the time he got to his last words, his fist was pounding on the table.

As Murray continued to berate the developer who had fallen behind, Tom noticed that Chris, one of the other developers attending the meeting, was uncomfortably biting his lip. He couldn’t quite tell if he was holding out for the restroom or holding back a lionesque roar of laughter.

“This status is meaningless to me now,” Murray shouted, apparently trying to make the junior cry, “I needed this status three days ago! What can I do with this status now? Go back in time and assign more resources to get me a better status for today?”

This time, someone let out a rather loud snort. Murray was far too engaged too notice, but Tom’s eyes shifted towards Chris. He was definitely holding back laughter, as evidenced by the uncontrollable shakes and the rather ineffective attempts at covering it up with a series of “cough-ha’s”.

Thirty minutes later, after Murray had thoroughly chewed out the junior and picked each and every bone clean, the meeting ended with a somber reminder to all, “the sooner you get me a status, the better it is for everyone.”

Later that day, Tom’s curiosity got the better of him and he walked towards Chris’s cube to see what he was laughing at during the meeting. After a bit of cajoling, he finally agreed to let Tom in on the joke.

“Okay,” he explained, “so, you know how Murray is always demanding the status? Well, whenever he says the word ‘status’, just replace it with…”

Chris looked over his shoulders and then leaned into Tom, whispering something in his ear.

 “Glow job?” Tom questioned, envisioning the brightly-colored neon lights that some people put on the underside of their car.

His response was met with a blank stare.

“Ooooh,” Tom realized, slapping his palm against his forehead. “You mean bl—” he quickly moved his hand to his lips, stopping mid-syllable as not to utter the not-safe-for-work word.

Chris subtly nodded and smiled.

“Uuuuhhh,” cringed Tom as he tried to repress any thoughts of that particular activity, especially as it related to Murray.

Tom didn’t think much of the joke until the following week, at their weekly meeting. Generally speaking, the meetings with Murray were painfully difficult to sit through. Even when Murray wasn’t furious, listening to everyone say, “I’m blah-blah percent complete on some-blah-task” was almost unbearable.

That week, however, the meeting was difficult to survive for an entirely different matter. As Murray went around the room with his usual criticisms – “why can’t you give me a better status than that?” and “again, this problem is caused by a lack of status!” – it became painful to hold back the laughter.

When it came time to once again lash-out at the junior developer, Tom was afraid he wouldn’t make it. “If you don’t give me a good status right now,” Murray fumed at the junior, “I swear… I’m going to explode!”

Try as he might, Tom couldn’t bite his lip hard enough to hold back a few snort-filled laughs. Almost instantly, Murray shot his head towards Tom and stared daggers through him. “What’s so funny?” he shouted, “you’re still at 30% AMQ! Your status was terrible!”

This time, Chris couldn’t help himself. His laughter made Murray even more upset, and he just kept harking on about how everyone’s status was behind.

It didn’t take too long after that for the word to spread across the team and then across the floor. Eventually, it made its way to other projects and teams throughout Bell Labs.

Although Murray has long since retired, to this day, Tom still avoids the word “status” in his meetings.




Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
Hidden Tax Moves

It was fall of 1995 and everyone was gearing up for the 1996 tax season. After years of maintenance of a DOS-based tax application, TaxQuik -- as we'll call the company -- had to get with the times. New, spunky companies were building tax software for Windows with fancy GUIs, integrated help and even Internet-enabled features, while TaxQuik was still in the text-based stone age of DOS.

The one thing that the new companies all lacked was the name recognition and brand loyalty of TaxQuik's customers. The company developed an aggressive plan to continue to support the DOS version, while simultaneously building a Windows version of the software. And by all accounts, the plan worked like a charm.

Some of TaxQuik's larger clients were given a preview version of the new Windows version, and the feedback was almost universally positive. An interactive 1040 form that could be printed on any sheet of paper without needing blank copies of the form? It was the kind of thing that tax accountants' dreams were made of.

Trouble in Paradise

As testing continued, the initial appeal of the software started to wear off. One day, a user called to complain his network connection kept dropping whenever he was using the Windows version. The following day, two more reports of the same problem came in. Eventually TaxQuik received more issue reports than it could handle, so the network infrastructure group was called in to help.

Bruce W. and the rest of the infrastructure team got to work right away, first setting up a test installation on a small network with a sniffer running on one of the machines. They entered 1040 information for Joe Employee at 123 Fake St. and took a deep breath as they hit ENTER.

There was barely a blip in the network traffic.

Returning to the machine, they loaded the tax form, tabbed through, changed a few fields and hit ENTER again. Again, hardly any traffic was generated.

"Wait, let me try," Bruce said, grabbing the mouse.

"Whoa, what just happened?" a teammate exclaimed. "What did you do? A ton of traffic just came through!"

"Uh, nothing, I think."

Bruce hadn't done anything but sit down at the table and put his hand on the mouse. "Let me see if I can reproduce whatever just happened," he said. Bruce dragged the cursor to the file menu and was about to reload the form.

"You just did reproduce it! What the heck are you doing?"

This gave Bruce an idea. "I have to ask the lead developer about something."

The Source

"Oh, I think I might know what the problem is," the lead developer said, when Bruce questioned him. "We wanted the operations to be quick so it would feel like a Windows app instead of a DOS app ported to Windows, so we spent a lot of time on optimization and hiding reads and writes."

"So ..."

"So, we decided to put a lot of the background logic in the application's MouseMove event."

Bruce summoned all of his self control to keep from slapping himself on the forehead. "What kind of 'background logic'?"

"You know -- database reads and writes, re-calculations."

Windows Next Season

After several meetings, it was decided that it wasn't the best idea to put critical code in an app's MouseMove event. Realizing that users of the DOS version were probably accustomed to keyboard navigation sealed the deal. TaxQuik quietly stopped describing the Windows version as a "preview" -- probably because "harbinger of doom" would've been more apt -- and instead called it a "limited beta." Large sections of code were reworked to perform smaller tasks in little bursts, rather than unleash a series of dozens of commands and queries while the mouse was moved around the screen, but it wasn't enough. TaxQuik didn't have a shippable Windows version of the software for the 1996 tax season. The following year, it managed to put out a Windows version that still had some performance issues, but by 1998 the company had hit its stride. At this rate, TaxQuik will hopefully have a Windows Vista version by 2012.

Hidden Tax Moves was originally published in Alex's DevDisasters column in the Sep 15, 2008 issue of Redmond Developer News. RDN is a free magazine for influential readers and provides insight into Microsoft's plans, and news on the latest happenings and products in the Windows development marketplace.




Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
A Table Valued Function to Split Strings

– the function CREATE FUNCTION SplitString (       @TargetString NVARCHAR(MAX),       @Delimeter NVARCHAR(MAX) )   – the part repository RETURNS @Parts TABLE (       PartId INT IDENTITY(1, 1),       Part VARCHAR(MAX) ) AS BEGIN         – just some variables to keep track of things       DECLARE             @CurrentIndex INT,             @DelimeterIndex INT,             @PartLength INT;         – initialize the loop       SELECT             @CurrentIndex = 0,             @DelimeterIndex =CHARINDEX(@Delimeter, @TargetString, 0),             @PartLength = @DelimeterIndex - @CurrentIndex;         – [...]

Categories: Agile Programming | Computer Humor | Computers | CSharp | Dot Net | Emerald Software Group | Humor | Onboarding | Patrick Caldwells Blog | PHP | Programming | Project Management | Service Oriented Architecture | SOA | SQL Server | Technology | Web Development | Web Services | Windows Programming
CodeSOD: A Touch of Genius

“I recently started on a new contract,” Vedran R writes, “and the experience has been rather… interesting. The project I’ve been assigned to is a VB .NET 1.1 web application, and the code is rather… bad. Now, I know that developers make all kinds of compromises because of lack of time or experience but this is just… well, here’s some of the code.”

“Why fix the problem where it originates, it’s much simpler to handle it this way!”

sSql = GetSql(sTypeCurrency, sWHERE, sOrder)

If bGroup = True Then
    sSql = Replace(sSql, "WHERE  and", " WHERE ")
    sSql = Replace(sSql, "WHERE and", " WHERE ")
    sSql = Replace(sSql, "WHERE  AND", " WHERE ")
    sSql = Replace(sSql, "WHERE AND", " WHERE ")
    ...snip...
End If

"So how do you to determine if an object is null in JavaScript? Simple...

if (top.arrLisAdjCodEmp[f] != 0 && top.arrLisAdjCodEmp[f] + "" != "undefined")

... first we check if the object equals 0 and then we check if it not null by casting it to a string and comparing it to 'undefined'. Nice one!"

 

"Classes? We don't need no stinking classes!"

Private Function fWhere(ByVal bGroup As Boolean, ByVal lCodCompany As Integer, 
ByVal sCodAutonomy As String, ByVal sCodProvince As String, ByVal sCodArea As 
String, ByVal sCodDelegation As String, ByVal sDateFrom As String, ByVal sDateTo 
As String, ByVal iDate As Integer, ByVal sCodClients As String, ByVal sCodClientFrom 
As String, ByVal sCodClientTo As String, ByVal sDesClientFrom As String, ByVal 
sDesClientTo As String, ByVal sCodclientRange As String, ByVal iUte As Integer, 
ByVal iOrderEst As Integer, ByVal dOffer1 As Double, ByVal dOffer2 As Double, 
ByVal sCodGroup As String, ByVal sCodSubGroup As String, ByVal aDivision As 
Array, ByVal aCodTypoLicita As Array, ByVal aCodGroups As Array, ByVal 
aCodCompanies As Array) As String

 

"How to execute a „complicated“ SQL in a stored procedure? Piece of cake!"

DECLARE @QUERY AS VARCHAR(1000)

SET @QUERY = 'SELECT NUMTASK, YEARTASK, DATEOPEN '
SET @QUERY = @QUERY + 'from TaskStudio '
SET @QUERY = @QUERY + 'WHERE ( '
SET @QUERY = @QUERY + 'CODCOMPANY = ' + CONVERT(VARCHAR,@CODCOMPANY) + ' AND '
SET @QUERY = @QUERY + 'DATEOPENINGS = ''' + CONVERT(VARCHAR,(CONVERT(DATETIME,@ DATEOPENINGS,103))) + ''' AND '
SET @QUERY = @QUERY + 'CODCLIENT = ' + CONVERT(VARCHAR,@CODCLIENT) + ' AND '
SET @QUERY = @QUERY + 'OFFEREURO = ' + CONVERT(VARCHAR,@OFFEREUROVAR) 
SET @QUERY = @QUERY + ' ) '

PRINT (@QUERY)
EXEC (@QUERY)

 

"If the variable contains an empty string, then assign an empty string to the field; else assign the value of the variable to the field."

If sCompanyGroup = "" Then
  Field46 = ""
Else
  Field46 = sCompanyGroup
End If

 

"If the variable contains an empty string, don’t do anything; else don’t do anything."

If bResult = "" Then

Else

End If

 

"Here's a first class if."

If bGroup1 = 0 Then
  bGroup = False
ElseIf bGroup1 = 1 Then
  bGroup = True
ElseIf bGroup1 = 2 Then
  bGroup = True
EndIf

 

"More JavaScript. Is it a string or an integer?"

if (obj.value>="9000" && obj.value<=9999)

 

"Ugh, I love my job."




Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
CodeSOD: Keep it Simple and Stupid

Diego G. lives in Argentina and is working with a developer from the USA on a PHP project. Recently they were discussing the merits of handling the communication from the backend to the frontend via XML or JSON. The system used XML elsewhere already, but for the new work it looked like it'd be quicker and easier to work with JSON in the PHP pages.

The contact in the US didn't like one solution more than the other, and in the interest of getting the project done quickly, sent an email with his solution.

We choose to keep it simple. Hope this makes sense. Please feel free to add any
additional info you feel is needed. thanks.

Please let me know if you have any questions.

Following is a sample of what we've been asked to do.

<response>
    <content id="account-item-data">
        <items>
            <item>
                <JSON>
                    {"id":"5078","confidential":"false","sort-date":"20081027200000",
                    "save-date-mmdd":"Oct 27","save-date-yyyy":"Oct 27","type":"N",
                    "allow-remember":"true","keys":{},"vendor":
                    {"first-name":"Johann Sebastiann","last-name":"Bach"}}
                </JSON>
            </item>
            <item>
                <!-- ... -->



Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
Providing both Authentication and Anonymity

I was reading a little tgdaily today and I found an article about a new iPhone app that may be showing up in the app store in the near future. The new application is called Trapster and it’s a “social-networking speed trap warning website.” I know what you’re asking. Well, I don’t actually know [...]

Categories: Agile Programming | Computer Humor | Computers | CSharp | Dot Net | Emerald Software Group | Humor | Onboarding | Patrick Caldwells Blog | PHP | Programming | Project Management | Service Oriented Architecture | SOA | SQL Server | Technology | Web Development | Web Services | Windows Programming
CodeSOD: Now I Have Two Hundred Problems

-rw-r--r--. If that looks familiar to you, skip this and the next paragraph.

OK, now that it's just you and me, Bill Gates, it is an example of Unix file permissions. The example given means that the user (owner) can read/write to the file, and others can only read it. Checking these permissions in Perl is simple; just use the stat method to check its mode (the file type and permissions). For example, if you wanted to check read permissions, you'd check bits 4 (owner read), 32 (group read), and 256 (other read). This is 292 in decimal, 0444 in octal. Compare that to the mode, and you'll know whether you can read the file. In code, stat($path)->mode & 0444. Easy peasy!

Ed's colleague hated built-in functions. Why trust mode when you can roll your own permission checking algorithm?

my $perms = stat($path);
my $permsbin = unpack("B32", pack("N",$perms->mode & 0777));
$permsbin =~ s/.*(.)..(.)..(.)../$1$2$3/;
if ($permsbin != 111) {
   # file is not readable
   # ...
}

So first, the value is packed into a 32 bit unsigned long (that's what the pack("N") means), then he converts it into a string of bits. That is, literally, a string of ones and zeros. Then he uses a regex to parse out the specific bits in the read positions for owner, group, and other, and turns it into its own string of bits, hoping the resulting string is "111". Finally, he has Perl compare "111" to 111, forcing his new string to be magically converted into an integer. Clearly, this guy is a fan of Rube Goldberg machines.

You know the famous quote about regular expressions?

Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. — Jamie Zawinski

I think it's safe to say that Ed's colleague has more than two problems in his oft-copied-and-pasted permissions checking routine.




Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF
Error'd: Act Fast!

Go ahead Michael Fulker, make your move. I'll count to one.

 

"I was obeying my wife and doing some research into what would happen to our daughter who had swallowed a penny (because, you never know, she might not poop it out)" P. James wrote, "and I came across this interesting... Culinary Development?"

 

Jon was looking forward to punching some dudes in Oni, when suddenly...

 

Ben spotted this ad that was run on a web site that I won't name here. Whatever web site it was, it seems their QA or ad department was asleep at the wheel.

 

"I encountered this page while trying to use a web-based library catalog," Konrad Zielinski writes. "Having to not use the navigation buttons on your browser seems like a little bit of a WTF to me."

 

Based on these two ads spotted by Claudio in Milan, I'd say Playlife has a better ad than Microsoft.





Brought to you by the Non-WTF Job Board:





Categories: Computer Humor | Computers | Humor | Programming | Technology | The Daily WTF