« first day (1280 days earlier)      last day (3659 days later) » 

12:06 AM
Anyone have a good grasp on inversion of control?
 
12:59 AM
@fge: How about JavaDoc Example Code: JDXC? I think the package would be named com.github.xbn.jdexample
 
1:17 AM
@fge: Yeah. Liking it. More informative but still catchy.
 
 
2 hours later…
3:12 AM
@Tuga: THAT'S HYSTERICAL!!! :D
 
@Kevin what is your question
 
 
2 hours later…
5:11 AM
@manan thanks for your reply..
i got class not found exception..
 
5:42 AM
@all i need help in executing java jar file in ubuntu terminal
 
 
6 hours later…
11:42 AM
5
Q: How to make inline taglets (which require com.sun) more cross-platform? Is there a non-Oracle/more-cross-platform javadoc parser?

aliteralmindI'm writing a library that inserts already unit-tested example code (its source-code, output, and any input files) into JavaDoc, with lots of customization possibilities. The main way of using this library is with inline taglets, such as {@.sourceAndOutput my.package.AGreatExample} {@.source my....

Last chance: One more day for 200 bounty. Please take a look and help if you can. One answer so far.
 
 
5 hours later…
fge
4:22 PM
YESS
grappa now works with Java 8!
 
 
2 hours later…
fge
6:08 PM
There, grappa can now work on CharSequences
Which means I can use it with largetext!
 
 
2 hours later…
fge
7:55 PM
grappa 1.0.0-beta.1 released!
 
8:31 PM
Good work today, ay, @fge?
 
fge
@aliteralmind you bet
@aliteralmind I can now use grappa with largetext to boot
 
@fge: What's the benefit?
 
fge
@aliteralmind which means I can use grammars on very large files -- parboiled cannot do that
 
Oh! Wow. largetext has a bigger purpose now.
@fge: Was that planned or a surprise?
 
fge
@aliteralmind I need to write grammars now ;)
@aliteralmind planned
 
8:33 PM
Smart :)
 
fge
@aliteralmind parboiled's InputBuffer had versions for reading Strings and char arrays, but slurped the whole thing into memory...
Not anymore
And since String implements CharSequence as well... And so does CharBuffer
No drawbacks, only benefits ;)
 
@fge: What came first, the regex idea, or parboiled?
 
fge
@aliteralmind ah, OK, I didn't understand your question -- no, at the beginning this was not planned
@aliteralmind but the InputBuffer interface was easy enough
So I told to myself "well, Just Do It(tm) then" ;)
 
Happy coincidence. The overcommital for largetext for the regex idea paid off. :)
 
8:39 PM
That's awesome.
 
fge
@aliteralmind and that's the first version only ;)
I have many ideas for this package
 
@fge: What's a basic practical use of writing a grammar for a multi-GB file?
 
fge
Hmwell, without going multi GiB, parsing very big log files for instance
Extracting stack traces from them, etc -- and even analyze them at runtime
Or big CSVs too
 
Log files. Of course.
 
fge
There are many more such files than one might think
List<StackTrace> stackTraces = Grappa.run(myParser).on(myFile).getResult();
This is the interface I want to do
Or even .get()
Heh, I just made that up
But yummy
 
9:04 PM
@fge: yummy like your pyramid breakfast pastry.
 
fge
@aliteralmind yeah, I have strange tastes ;)
And by the way, what about the "programming assignment" I gave you? ;)
Oh yeah, also, I use AssertJ for this project
I'll use it for others
The thing is, also, for now, it is only a char parser
 
@fge: Give it to me again, please.
 
fge
9:31 PM
@aliteralmind give what?
Ah
Get rid of SingleTextRangeCharSequence
Sorry, reading the javadoc for Guava again
 
@fge: Give me the assignment again.
 
fge
OK, let me grab a link
The SingleTextRangeCharSequence is useless here
Lines 62-67 to be precise
Here we could return a simple CharBuffer
The only thing to be careful about is the offsets
 
9:59 PM
And what is my assignment, should I choose to accept?
 
fge
To change, and test the correctness of, the aforementioned lines ;)
I must admit this package lacks quite a few tests
 
@Fge: The line numbers don't line up. Line 63 is private final LoadingCache<TextRange, CharBuffer> cache;
 
fge
@aliteralmind it is the next link I posted
 
Both links are the same: Lines 62-67: ` */
private final LoadingCache<TextRange, CharBuffer> cache;

public TextCache(final FileChannel channel, final Charset charset)
{
this.channel = channel;
`
 
10:12 PM
So a little background here. What's the worry with offsets?
 
fge
The range argument is what the user requested
The textRange line 63 is the text mapping found by the loading cache containing that range
Now, textRange spans a larger, or equal, range than range
The appropriate arguments must therefore be calculated from these two elements as arguments to feed the CharBuffer's .subSequence(), which is what will be returned
 
CharBuffer is an abstract class. What is being returned?
 
fge
Well, a CharSequence
And CharBuffer implements CharSequence
And CharSequence's .subSequence() also returns a CharSequence
QED ;)
And yes, CharBuffer is abstract; if you look at the javadoc, it only has static factory methods to build new instances
 
10:29 PM
@fge: In TextRange, getCharRange() is the indexes of characters, which may be one or multibyte, and getByteRange() is the...byte range. The indexes of raw information, regardless the encoding. Correct?
 
fge
@aliteralmind yes
More precisely, the byte range is the range in the backing file
 
I don't understand "backing file".
 
fge
The file which contained the text in the first place
When you load a character range and it is not in cache already, the loader will map this byte range, decode it and return a CharBuffer
 
And the char-range does not reflect the backing file?
 
fge
It reflects the range of characters, which may differ!
Consider a file encoded in UTF-8
Depending on the code point, it may be encoded using from one to four bytes
Therefore you cannot map from x to y if you want characters at offset x and y in the file
 
10:44 PM
But it reflects the potentially-multi-byte characters in that file, though.
 
fge
Yes
 
So it seems you want to return buffer.subSequence(start, end), instead of new SingleTextRangeCharSequence(range, textRange.getCharRange(), buffer).
I don't get which range 'start' and 'end' should be. the int-range or text-range.
 
fge
The range argument is what the user wants
And textRange.getCharRange() gives the range actually covered by the buffer
Note also that the upper bound in an IntRange is exclusive, and that the end argument to .subSequence() is also exclusive
 
So replace this `return new SingleTextRangeCharSequence(range, textRange.getCharRange(), buffer);
with
 
fge
Yup
 
10:48 PM
IntRange charRange = textRange.getCharRange();
return buffer.subSequence(charRange.getLowerBound(), charRange.getUpperBound());
 
fge
No
Since this is not what the user wanted
And the ranges in charRange() are absolute
And so are the ranges in the range argument
OK, I'll do a crude drawing
 
What do you mean by "absolute"? Min inclusive max exclusive?
 
fge
This is the file, | denotes what is covered by charRange (which is what the buffer contains and < and > is what the user wants:
`--------------------|----<------->--|-----------------
(for instance)
The first | is charRange.getLowerBound()
< is range.getLowerBound()
> is range.getUpperBound() (exclusive)
And the second | is charRange.getUpperBound()
 
So return buffer.subSequence(range.getLowerBound(), range.getUpperBound()); ?
Meaning
    if (textRanges.size() == 1) {
        final TextRange textRange = textRanges.get(0);
        final CharBuffer buffer = loader.load(textRange);
        return new SingleTextRangeCharSequence(range,
            textRange.getCharRange(), buffer);
    }
 
fge
As to the buffer itself, it has indices from zero to charRange.getUpperBound() - charRange.getLowerBound() (exclusive as well)
 
10:54 PM
can be replaced with
    if (textRanges.size() == 1) {
        return  buffer.subSequence(range.getLowerBound(), range.getUpperBound());
    }
 
fge
No it cannot, read above
The buffer's index starts at 0
 
Oh.
So the range is relative to the buffer-range.
It's not absolute to the backing file.
 
fge
No, it is the opposite
It is the buffer's ranges which are relative
 
Okay, so range is the range they want, but it's the index-range of the backing file's chars/bytes.
 
fge
OK, for instance, the client requests [23, 47); you load a buffer, it gives you a text range with char range [20, 60); that means the buffer has ranges [0, 40)
Not at all
It is the requested character range
 
10:59 PM
I think we're saying the same thing.
And if I'm correct, this is what you need:
 
fge
So, in my example above the arguments to buffer's .subSequence() should be 3, 27
 
if (textRanges.size() == 1) {
int lowerIncl = range.getLowerBound() - textRange.getLowerBound()
int upperExcl = range.getUpperBound() - textRange.getLowerBound()
return buffer.subSequence(lowerIncl, upperExcl);
}
 
fge
Yep, exactly
You need to .get(0) from textRanges but otherwise that's it
 
if (textRanges.size() == 1) {
   final TextRange textRange = textRanges.get(0);
   int lowerIncl = range.getLowerBound() - textRange.getLowerBound();
   int upperExcl = range.getUpperBound() - textRange.getLowerBound();
   return  buffer.subSequence(lowerIncl, upperExcl);
}
 
fge
Hehe
Send me a pull request? ;)
 
11:03 PM
So give me a tip on running and testing this.
 
fge
Uhwell, at the moment the code is not really fit for testing, so just send it to me as is
I'll test it later myself -- before I release
Well, you can test a runtime
 
My assignment is, which I chose to accept it, is "To change, and test the correctness of, the aforementioned lines ;)"
Yet now you say "Uhwell, at the moment the code is not really fit for testing, so just send it to me as is"
;)
 
fge
Yes, I know :/
But this package still needs work
The other problem I have is much more complicated
 
Here's the code in its entirety. You really want me to pull it and do it myself?
/*
//Original:
if (textRanges.size() == 1) {
final TextRange textRange = textRanges.get(0);
final CharBuffer buffer = loader.load(textRange);
return new SingleTextRangeCharSequence(range,
textRange.getCharRange(), buffer);
}
*/
if (textRanges.size() == 1) {
final TextRange textRange = textRanges.get(0);
int lowerIncl = range.getLowerBound() - textRange.getLowerBound();
int upperExcl = range.getUpperBound() - textRange.getLowerBound();
return buffer.subSequence(lowerIncl, upperExcl);
}
 
fge
Hmm, you forget to load the buffer :p
 
11:10 PM
I don't understand.
 
fge
In the original code the buffer is loaded, you don't do it here
buffer won't exist
Well, you'll notice quickly enough if you try to complie ;)
 
No, I confirmed it's not needed here. Because of the interface.
 
fge
Eh?
 
Because of the interface. The CharBuffer. So you don't need to.
 
fge
That has nothing to do
buffer must exist
 
11:14 PM
I'm joking ;)
 
fge
Also, please rename lowerIncl and upperExcl to start and end
And make them final too
And that will be perfect ;)
 
/*
         //Original:
        if (textRanges.size() == 1) {
            final TextRange textRange = textRanges.get(0);
            final CharBuffer buffer = loader.load(textRange);
            return new SingleTextRangeCharSequence(range,
                textRange.getCharRange(), buffer);
        }
 */
        if (textRanges.size() == 1) {
           final TextRange textRange = textRanges.get(0);
           final int start = range.getLowerBound() - textRange.getLowerBound();
           final int end = range.getUpperBound() - textRange.getLowerBound();
I've actually never done a pull, and I'm curious. But it seems like overkill for this.
 
fge
And the buffer? :)
OK, as you wish
I'll git commit --author= then ;)
 
Heh.
/*
         //Original:
        if (textRanges.size() == 1) {
            final TextRange textRange = textRanges.get(0);
            final CharBuffer buffer = loader.load(textRange);
            return new SingleTextRangeCharSequence(range,
                textRange.getCharRange(), buffer);
        }
 */
        if (textRanges.size() == 1) {
           final TextRange textRange = textRanges.get(0);
           final CharBuffer buffer = loader.load(textRange);
           final int start = range.getLowerBound() - textRange.getLowerBound();
 
11:36 PM
@fge: I like this a little better:
/*
         //Original:
        if (textRanges.size() == 1) {
            final TextRange textRange = textRanges.get(0);
            final CharBuffer buffer = loader.load(textRange);
            return new SingleTextRangeCharSequence(range,
                textRange.getCharRange(), buffer);
        }
 */
        if (textRanges.size() == 1) {
           final TextRange textRange = textRanges.get(0);
           final int start = range.getLowerBound() - textRange.getLowerBound();
           final int end = range.getUpperBound() - textRange.getLowerBound();
 
fge
So, what do I put in --author? :p
 
Jeff Epstein -- aliteralmind-github@yahoo.com
This was fun.
 
11:51 PM
Folks ... for the life of me, I cannot get Java upgraded to 8 on OSX. I have tried LOTS. If anyone in here can help, I'd be extremely grateful -- also, there's 150 rep in it for ye...

`java --version` shows 1.8, but `javac --version` shows 1.7.

http://stackoverflow.com/questions/23202516/after-upgrading-to-java8-javac-still-shows-1-7
 
fge
@aliteralmind: 16 million matches in 12 seconds :p
That will be interesting to compare with grappa
 

« first day (1280 days earlier)      last day (3659 days later) »