Talk:Text processing/Max licenses in use: Difference between revisions

added comments about times (should be through and inclusive). ~~~~
(document assumptions)
 
(added comments about times (should be through and inclusive). ~~~~)
 
(19 intermediate revisions by 7 users not shown)
Line 1:
== AssumptionsFile hosting ==
We might be better able to compare code if we document our assumptions.
 
Not that I have anything against Google Documents, but would I'd like to put the file on RC's server. --[[User:Short Circuit|Short Circuit]] 04:11, 4 October 2008 (UTC)
=== J ===
:Please, please please, please please please please. Thanks :-)
:Could you also update the problem statement to show how to get the relocated file, thanks. --[[User:Paddy3118|Paddy3118]] 04:27, 4 October 2008 (UTC)
::Is there a story to this document? Where did it come from? What's its copyright? --[[User:Short Circuit|Short Circuit]] 06:02, 4 October 2008 (UTC)
:The file is of directed random data generated by me and to a file format that I created. Please feel free to re-host under your normal RC terms. --[[User:Paddy3118|Paddy3118]] 09:40, 4 October 2008 (UTC)
 
The [http://rosettacode.org/mlijobs.txt link to mlijobs.txt] returns a 404 --[[User:Daonlyfreez|Daonlyfreez]] 12:01, 31 July 2009 (UTC)
The J solution makes assumptions to allow the interesting code to stand out (rather than the drudgery). This obviously comes at the cost of some robustness (and, incidentally, optimizes for speed).
:Not sure about the RC copy, but I still have the original [http://docs.google.com/View?docid=dxbvd2v_4fg4pr8dg here].
: Whoops! Must have mised that in the MediaWiki upgrade. I'll get it fixed this evening; I still have all the old files. --[[User:Short Circuit|Short Circuit]] 12:36, 31 July 2009 (UTC)
:: Alright; It (and several other files) may now be found at http://rosettacode.org/resources/ --[[User:Short Circuit|Short Circuit]] 02:51, 3 August 2009 (UTC)
 
== Name change needed ==
* Assumes the file exists in the working directory. Could easily reference another path. Could check for file existence.
This new name is really awful. It tells you so little about the task, and is '''boring'''. Please revert the change, Max licenses in use is much better. --[[User:Paddy3118|Paddy3118]] 15:17, 14 February 2010 (UTC)
:Yes, it's unexciting and it isn't as informative as it might be. But it does give one a much better idea of what the task is about than "Max licenses in use". That's why I consider it an improvement. If you can think of an further improvement, I welcome you to '''[[wp:Wikipedia:Be bold|be bold]]''' and move the page again. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 21:01, 14 February 2010 (UTC)
 
I agree that a serial-numbered name is bad. However, the old name has a problem; when I first saw it I assumed it was a task about ''implementing license restrictions'', i.e. tracking the number of copies of your program running on a network. So maybe something like Text processing/Max licenses in use. —[[User:Kevin Reid|Kevin Reid]] 16:01, 14 February 2010 (UTC)
* Assumes the format of the file is fixed (there will always be spaces in columns <tt>7 11 13 33 37 41</tt>). This can be changed easily to find columns of all spaces and cut there; doing so would actually make the program shorter and simpler, but obviously slower.
 
* Assumes columns 3 and 6 are Date and Job ID respectively. Could easily be checked; pattern matching would permit the code to identify the columns heuristically.
 
==times THROUGH times==
* Assumes a license will be checked out before it's checked in, and checked in before it's checked out, and that initially all licenses are checked in.
I noticed that most programmers did not treat the time as steady-state, but discontinous with the times being descreet only at job INs and OUTs, that is, the times --between-- INs and OUTs also exist, but are never listed, nor are the times shown as THROUGH (start) to (end). The maximum is not just AT two times, but all times in between (inclusive) those times listed.
 
<br><br>
* Does *not* assume the file contains any data (i.e. the file may be 0 bytes long). For example, if the file is empty, you get this:
If one looks at the actual input file, you'll see job 1837 logging at OUT starting at 08:40:40, but the next job doesn come IN until 08_40_47 (records 3577 and 3578). [[User:Gerard Schildberger|Gerard Schildberger]] 09:28, 14 March 2012 (UTC)
Maximum simultaneous license use is 0 at the following times:
:Note that I didn't have to do any special checks to get this behavior, it just fell naturally out of the code. (This happens a lot in J.)