3 ms·
Situations like this make me sad. 1000 characters is not the same as 150 words. It's very easy to strip out punctuation and then count the number of words in a
by asnyder 16y ago
Situations like this make me sad. 1000 characters is not the same as 150 words. It's very easy to strip out punctuation and then count the number of words in a string. Really really careless.
I love the quote:
Asked why the problem had not been fixed, Mr. Killion said, “Believe me, if there’s a way to do it, we’d do it. Maybe there’s a way out there we don’t know about.”
- fendrak 16y agoThis reminds me how most people seem to see programming as some sort of black magic that only happens when the stars align just-so. If only they were aware of how different things actually are... Python solution: def under_the_limit(response): return len(response.split()) <= 150
- joeld42 16y agoThis is wrong. They're not checking for 150 words. They need to check that, once typeset on the printable form, the text fits in a box of a certain size. Still, whatever they are using to typeset the form should be able to easily give them that info. Even if, god forbid, they are doing it with HTML they can get that info. Much simpler would be to design the form with a monospaced font for the essay. This is a big reason why manuscripts are still submitted in Courier even though few people use typewriters anymore.
- ghshephard 16y agoYES - I was wondering why nobody had brought up the painfully straight forward solution of "Fixed Width Font" - Then your bounding area is a simple function of the number of characters you typed in, and an error message can pop up if the student exceed it.
- chc 16y agoIt's not quite that simple even with a monospace font unless you wrap words unnaturally. For example, the word "heterochromatic" repeated over and over with a space between fills up the HN comment box in 288 characters, but "I DO" makes it to 359.
- rflrob 16y agoThere's actually a lot more that could go into figuring out whether a given passage will fit, but arguably a gold standard solution exists, and is freely available: to wit in TeX. While it's probably not trivial to adapt the relevant code, it's not like no solution exists, as the quote implied.
- waterlesscloud 16y agoI really don't understand how an error that fundamentally fails the target use-case can stand for a decade. And how they just can't figure it out. That just seems insane.
- deleted 16y ago[deleted]
- URSpider94 16y agoI don't think you're understanding the essence of the problem. It's not that they don't know how to count words, it's that the actual limit they are trying to enforce is an x,y bounding box on the page. At the end of the day, this application has to print out on a specified number of pages, in a specified format. If your limit is x,y space, then any "x number of words" limit will, by definition, not match up to reality some fraction of the time. One thing that they could do is switch to a monospace font for the text box, then at least they could specify a fixed number of characters. Now that I think about it, that wouldn't necessarily work either, because of word wrapping. The best case would probably be to tweak the font size to allow a fixed number of words to fit in the box.
- asnyder 16y agoI see, I still don't see an issue. Is there a reason why they can't push text that doesn't fit into another page. I remember when I was younger I did work for a heating company that did boiler inspections in NY. The NYC DOB has specific forms that you had to fill out and specific places for your text. In cases where the text overflowed beyond the 8 or so alloted lines, we were able to create a duplicate page and continue in a copy of the form with the remainder of information. We could this as much as we needed to, so long as the information was in the proper form. This seems like the same logic would be applicable here too. Limit to 150 words, and if it's beyond the page, simply finish on another page. Alternatively, like you said, you could figure out the necessary font-size based on the word-count, length, or even client's sizing information.
- tibbon 16y agoOr better yet, figure out the rough maximum worse case scenario for word length and just leave extra space on the printed area. If every word was 8 characters, and you had 150, then leave room for 1500 characters instead of 1200 on the print area. If it still goes over, dynamically scale the font size down on that section by up to 1pt to make it fit. Or like you said, offer logic to have additional pages printed if needed.