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

added comments about times (should be through and inclusive). ~~~~
(added comments about times (should be through and inclusive). ~~~~)
 
(12 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)
:Not quite sure what you mean here? Assume that you have the 10000 line file as given. You could check on char 8 by scanning the file beforehand, but I could just say that it is like the example in the header where apart from the width of the last field in a line, then other fields are fixed width, and in fixed order. But again, you could write code to verify this too. The last line of the file may or may not end in a newline depending on how it was grabbed from the URL. (I take it that you were successful DanBron, thanks. It's the first time I've used google docs to distribute data in this way - If Rosetta Code could possibly upload a zipped version??? )
: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)
:As for assuming the file exists, I would expect examples to '''not''' check whether the file exists or if it was zero length. for the purpose of the ''exercise'', just run on the data and report a result. If you have a different algorithm to those present then you might want to start a discussion in this talk section, for example - given the size of the input, someone might slurp in the whole file in one go rather than accumulating data line-by-line. --[[User:Paddy3118|Paddy3118]] 04:24, 4 October 2008 (UTC)
: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)
 
=== JName change needed ===
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)
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).
 
* Assumes the file ends in a newline.
 
==times THROUGH times==
* Assumes the format of the file is fixed (that char 8 of each line is 'I' or 'O' as the license is checked in or out, respectively, and that the date is chars 14-32 of each line).
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 exists or, if it exists, that it contains any data (i.e. it may be zero 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.)
 
== File hosting ==
 
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)
: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)