Click here to Skip to main content
15,898,849 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: A Well-Documented Piece of....*bleep* Pin
Jim Crafton26-Oct-07 14:41
Jim Crafton26-Oct-07 14:41 
GeneralRe: A Well-Documented Piece of....*bleep* Pin
Blake Miller31-Oct-07 3:26
Blake Miller31-Oct-07 3:26 
GeneralRe: A Well-Documented Piece of....*bleep* Pin
John R. Shaw23-Oct-07 16:47
John R. Shaw23-Oct-07 16:47 
GeneralRe: A Well-Documented Piece of....*bleep* Pin
dwilliss31-Oct-07 4:31
dwilliss31-Oct-07 4:31 
AnswerRe: PROLOG on LISP Pin
NimitySSJ29-Nov-07 20:47
NimitySSJ29-Nov-07 20:47 
GeneralRe: A Well-Documented Piece of....*bleep* Pin
Draugnar31-Oct-07 8:09
Draugnar31-Oct-07 8:09 
GeneralRe: A Well-Documented Piece of....*bleep* Pin
Dan Neely31-Oct-07 9:12
Dan Neely31-Oct-07 9:12 
GeneralRe: A Well-Documented Piece of....*bleep* Pin
Draugnar31-Oct-07 10:01
Draugnar31-Oct-07 10:01 
The one used by the apps it built... And the buffer was the problem. Boy is thi staking me back to that project 20+ years ago...

I was a new developer and just knew that I needed to rapidly catch the keystrokes for processing. There weren't any standard "input" type fields on the application as it was a real time graphing system for statistical process control that processed data coming in through the keyboard buffer from various data-collection devices. Being a public/purchased application, we couldn't guarantee the devices would be configured with 40ms delays between simulated keystrokes. This was in the day when user's who bought the software put requirements on the software, not the other way around.

There were several modules to the application.

One was the device interface which would capture the input and push it into the keyboard buffer. The requirement was that the floor users had to be able to upload this data as fast as possible as well as be able to do near real-time input from the collection devices.

The second module also ran in the background and collected that data from the keyboard buffer and wrote it to the datastore (a custom designed fixed-length flat file system with a unique indexing algorithm written by the senior developer). He was having a hard time with the buffer overflowing on large uploads and losing data, so he asked me to research alternatives. I came up with a cheap custome keyboard handler with a large (8K I think) buffer which would hold everything the largest device we supported at the time. At the same time, it sped up the processing of the data as the TP-based keyboard handler would type into a text field at a very slow paste. I could type 70 WPM at the time and I could make the simplest input field drop characters.

The third and final part would continually update the various control graphs from the flat files. I did plenty with that eventually as well, but that's another topic.

This was 1986 and the PC/AT was the latest and greatest thing. Windows 286 wasn't even dreamed of (much less 3.0, 3.1, Workgroups, or the future OSs) and the Mac was viewed as a "toy" for graphics designers and the like, not a serious machine for floor production systems. Instead, factory floors had ultradurable (and super-expensive for their day) PC or XT 8086/8088 based computers from Compaq or IBM. In short, creative "get it done" solutions that could do things quicker and with little overhead were the best. I think the assembler code took less than 1K so the whole thing was under 9K and our entire package could run on a 512K XT very reliably.

-Draugnar
GeneralRe: A Well-Documented Piece of....*bleep* Pin
Dan Neely31-Oct-07 10:37
Dan Neely31-Oct-07 10:37 
GeneralRe: A Well-Documented Piece of....*bleep* Pin
Draugnar31-Oct-07 10:51
Draugnar31-Oct-07 10:51 
GeneralRe: A Well-Documented Piece of....*bleep* Pin
Draugnar31-Oct-07 10:54
Draugnar31-Oct-07 10:54 
GeneralCHOTD [modified] Pin
leppie21-Oct-07 23:22
leppie21-Oct-07 23:22 
GeneralRe: CHOTD Pin
DavidNohejl21-Oct-07 23:28
DavidNohejl21-Oct-07 23:28 
GeneralRe: CHOTD Pin
originSH21-Oct-07 23:29
originSH21-Oct-07 23:29 
GeneralRe: CHOTD Pin
J4amieC21-Oct-07 23:38
J4amieC21-Oct-07 23:38 
GeneralRe: CHOTD Pin
Tristan Rhodes22-Oct-07 3:08
Tristan Rhodes22-Oct-07 3:08 
GeneralRe: CHOTD Pin
Vasudevan Deepak Kumar22-Oct-07 3:27
Vasudevan Deepak Kumar22-Oct-07 3:27 
GeneralRe: CHOTD Pin
leppie22-Oct-07 5:18
leppie22-Oct-07 5:18 
GeneralRe: CHOTD Pin
Vasudevan Deepak Kumar29-Oct-07 0:03
Vasudevan Deepak Kumar29-Oct-07 0:03 
GeneralRe: CHOTD Pin
Xiangyang Liu 刘向阳22-Oct-07 6:09
Xiangyang Liu 刘向阳22-Oct-07 6:09 
GeneralRe: CHOTD Pin
leppie22-Oct-07 6:39
leppie22-Oct-07 6:39 
GeneralRe: CHOTD Pin
RGSeeds23-Oct-07 9:54
RGSeeds23-Oct-07 9:54 
GeneralRe: CHOTD Pin
Pete O'Hanlon23-Oct-07 1:54
mvePete O'Hanlon23-Oct-07 1:54 
GeneralA class on UI design... Pin
Dave Kreskowiak12-Oct-07 4:44
mveDave Kreskowiak12-Oct-07 4:44 
GeneralRe: A class on UI design... Pin
Paddy Boyd12-Oct-07 5:07
Paddy Boyd12-Oct-07 5:07 

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.