Mike,

Here is the problem description that I put up on the challenge page. This isn't an extremely hard challenge, but it is a fun problem. Also, you can spend additional effort trying to shave off the last few milliseconds.

-Jim

http://www.openg.org/tiki/tiki-index.php?page=OpenG+Coding+Challenge+-+Remove+Backspace


Background


When you are typing at a terminal (telnet for example) and you press the backspace key, a "\b" (0x08) character is sent via TCP-IP. The server that is parsing the text must interpret this string and remove the preceding character, which may have already been transmitted over the network. If the server receives a string like "This is a test\b\b\b\bgood test for removing backspaces.", it should remove the backspaces and the preceding characters so that the string becomes "This is a good test for removing backspaces." Since there were four (4) backspaces we have to remove the backspaces and the four preceding characters "t", "e", "s", and "t". Easy, huh? But how do you do it quickly? Notice that the example shown above uses both a "Build Array" and "Delete From Array" in a loop. This is a performance no-no. It works but we can do a lot better.

*Hint* - don't build/delete an array (or concatenate/split strings) in a loop.

Ross, Michael wrote:

I am curious, what makes this an intersting problem?  What makes it hard?
Also, what would be the application of this vi?  These are not meant to
be rhetorical questions, though they can certainly sound that way in an
email.  I have done just enough screwing around with strings to see that
they are irritating, but I haven't had any intractable problem.  In other
words I am pretty ingnorant of the subject.

Mike

-----Original Message-----
From: jkring [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 27, 2004 1:07 AM
To: info-labview
Subject: OpenG Coding Challenge - Remove Backspace



Hello Info-LV'ers,

I have started a contest to create a high-performance VI that removes
backspace characters (and the characters preceding them) from a string.
The wining entry will become part of the OpenG Toolkit. (Note that VI
Icons will be judged separately).

Visit http://openg.org page for more info and download the example.
Entries must be received by April 31st.

http://www.openg.org/tiki/tiki-index.php?page=OpenG+Coding+Challenge+-+Rem
ove+B
Backspace

Regards,

-Jim Kring







Reply via email to