Click here to Skip to main content
16,014,294 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Sorry, .. I forgot to comment ... Pin
Chris Meech31-Jul-07 6:10
Chris Meech31-Jul-07 6:10 
GeneralRe: Clever code Pin
m@u31-Jul-07 6:26
m@u31-Jul-07 6:26 
GeneralRe: Clever code - Here is why it may have been used... [modified] Pin
Pualee31-Jul-07 7:00
Pualee31-Jul-07 7:00 
GeneralRe: Clever code - Here is why it may have been used... Pin
Dario Solera31-Jul-07 7:28
Dario Solera31-Jul-07 7:28 
GeneralRe: Clever code - Here is why it may have been used... Pin
Pualee31-Jul-07 7:30
Pualee31-Jul-07 7:30 
GeneralRe: Clever code Pin
sngbrdb31-Jul-07 7:55
professionalsngbrdb31-Jul-07 7:55 
GeneralRe: Clever code Pin
StevenWalsh4-Aug-07 5:40
StevenWalsh4-Aug-07 5:40 
GeneralJust how many formats can we use to represent the same data? Pin
martin_hughes26-Jul-07 11:58
martin_hughes26-Jul-07 11:58 
As those of you who have read my other horrors may have guessed, I work for a bunch of loons with a penchant for Heath Robinson design. You might think I'm being a little bit harsh, but let me justify myself by explaining the current data flow I'm looking at:

1.) Data is exported from a "legacy" Dos application, and written to a fixed width format file
2.) Legacy Win32 app picks up the data, looks at it briefly, and then writes it to another, but different!, fixed width format file
3.) Legacy Win32 app picks up the file it has just written, and wraps it in EDI - the resulting file is called blah~date.edi (where blah is a meaningful name and date is the date in yymmdd format). Note the ~.
4.) Legacy Win32 app picks up the EDI file it just created, inserts a "header" and "footer" to the file (I understand this breaks EDI conventions), and saves the file, changing alll the ~'s to +'s in the file name to show that the header and footer insertion has happened.
5.) Legacy Win32 app transfers the file to an FTP server

***For the sake of your sanity, I'm going to ommit details of the hellish "Interchange Mechanism"***

6.) WinCE app contacts FTP server, finds work to download, and downloads and saves.
7.) Newly downloaded file is opened, header and footer are removed and file is saved replacing all +'s with ~'s.
8.) Edi file is now extracted to fixed width format as seen in 2.
9.) User performs work on file.

***Again, for your sanity, I'll ommit the actual work process, and we'll go straight to the completed and sending back stage***

10.) WinCE app picks up fixed width file and surrounds content with EDI tags and saves in the blah~date.edi format.
11.) WinCE app picks up newly created file, inserts a header and footer and saves the file replacing all the ~'s with +'s/
12.) WinCE app transfers file to FTP server

***More nastiness ensues - look away!***

13.) Legacy Win32 app contacts FTP server, finds file, downloads and svaes
14.) Newly downloaded file is opened, header and footer are removed and file is saved replacing all +'s with ~'s.
15.) EDI file is now extracted to a fixed width format (as seen in 2) and saved.
16.) Saved file is now opened, extraneous data removed and saved to another fixed width format as seen in 1.
17. File is presented to legacy Dos app.

Do you know what they said when I suggested this was a perfect (and actually, for once, legitimate) use for XML? "XML will never take off - EDI is where it's at!"!




"It was the day before today.... I remember it like it was yesterday."

-Moleman


GeneralRe: Just how many formats can we use to represent the same data? Pin
Patrick Etc.26-Jul-07 15:30
Patrick Etc.26-Jul-07 15:30 
GeneralRe: Just how many formats can we use to represent the same data? Pin
QuiJohn27-Jul-07 2:24
QuiJohn27-Jul-07 2:24 
GeneralRe: Just how many formats can we use to represent the same data? Pin
Chris Maunder27-Jul-07 3:40
cofounderChris Maunder27-Jul-07 3:40 
GeneralRe: Just how many formats can we use to represent the same data? Pin
codemunkeh27-Jul-07 6:38
codemunkeh27-Jul-07 6:38 
GeneralRe: Just how many formats can we use to represent the same data? Pin
martin_hughes27-Jul-07 7:21
martin_hughes27-Jul-07 7:21 
GeneralRe: Just how many formats can we use to represent the same data? Pin
Ian Shlasko27-Jul-07 11:10
Ian Shlasko27-Jul-07 11:10 
GeneralRe: Just how many formats can we use to represent the same data? Pin
ne0h27-Jul-07 7:31
ne0h27-Jul-07 7:31 
GeneralRe: Just how many formats can we use to represent the same data? Pin
Paul Conrad27-Jul-07 20:12
professionalPaul Conrad27-Jul-07 20:12 
GeneralRe: Just how many formats can we use to represent the same data? Pin
pbraun27-Jul-07 14:14
pbraun27-Jul-07 14:14 
GeneralRe: Just how many formats can we use to represent the same data? Pin
John R. Shaw27-Jul-07 23:30
John R. Shaw27-Jul-07 23:30 
GeneralWell is it SQL or isn't it? Pin
PIEBALDconsult26-Jul-07 10:38
mvePIEBALDconsult26-Jul-07 10:38 
GeneralRe: Well is it SQL or isn't it? Pin
Rob Graham26-Jul-07 11:14
Rob Graham26-Jul-07 11:14 
GeneralRe: Well is it SQL or isn't it? Pin
Dario Solera27-Jul-07 7:30
Dario Solera27-Jul-07 7:30 
GeneralRe: Well is it SQL or isn't it? Pin
Paul Conrad27-Jul-07 20:14
professionalPaul Conrad27-Jul-07 20:14 
GeneralRe: Well is it SQL or isn't it? Pin
Dave Kreskowiak27-Jul-07 11:39
mveDave Kreskowiak27-Jul-07 11:39 
GeneralRe: Well is it SQL or isn't it? Pin
PIEBALDconsult27-Jul-07 13:35
mvePIEBALDconsult27-Jul-07 13:35 
GeneralRe: Well is it SQL or isn't it? Pin
Dave Kreskowiak27-Jul-07 14:19
mveDave Kreskowiak27-Jul-07 14:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.