Text processing/Max licenses in use: Difference between revisions

Content added Content deleted
(Found incorrectness.)
Line 1,244: Line 1,244:


=={{header|Java}}==
=={{header|Java}}==
{{improve|Java|Unproductive tests.
* Redundant test if count is decreased.
* Superfluous test if line is an "OUT" case.}}
{{works with|Java|1.5+}}
{{works with|Java|1.5+}}
<lang java5>import java.io.BufferedReader;
<lang java5>import java.io.BufferedReader;
Line 2,021: Line 2,024:
PrintN(#CRLF$+"Press ENTER to exit"): Input()
PrintN(#CRLF$+"Press ENTER to exit"): Input()
CloseConsole()</lang>
CloseConsole()</lang>
<pre>99 license(s) used at ;
<pre>
99 license(s) used at ;
2008/10/03_08:39:34
2008/10/03_08:39:34
2008/10/03_08:40:40
2008/10/03_08:40:40


Press ENTER to exit
Press ENTER to exit</pre>
</pre>


=={{header|Python}}==
=={{header|Python}}==
{{incorrect|Python|Invalid assumption of a (third party) licensing daemon. If a line is not a "OUT" signal it could be a (lead or trailing) empty line or e.g. a comment. In the task description is ... is meant as any line. It not so hard to make this example more robust for all eventualities.}}
<lang python>out, max_out, max_times = 0, -1, []
<lang python>out, max_out, max_times = 0, -1, []
for job in open('mlijobs.txt'):
for job in open('mlijobs.txt'):
Line 2,042: Line 2,044:


{{out}}
{{out}}
<pre>Maximum simultaneous license use is 99 at the following times:
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:39:34
2008/10/03_08:40:40
2008/10/03_08:40:40
</pre>


=={{header|R}}==
=={{header|R}}==
Line 2,654: Line 2,655:
2008/10/03_23:51:05
2008/10/03_23:51:05
</pre>
</pre>



{{omit from|GUISS}}
{{omit from|GUISS}}