« first day (1274 days earlier)      last day (3670 days later) » 

fge
12:35 AM
0
Q: How to dump the bytecode of an ASM generated class?

fgeI am tackling an issue with regards to code generation with parboiled (link to the issue). The problem is that the bug seems to be not in the Parser class itself but in the bytecode generated by parboiled for its rules and one in particular, as the beginning of the stacktrace seems to indicate: ...

Open to ideas...
 
 
2 hours later…
2:41 AM
@fge: I thought the taglet idea was adding a lot of work to my library, but since I no longer have to do the file/Javadoc parsin, (and no longer have to duplicate the entire source directory, it turns out to be less work and a lot more elegant code. Really great. Thinking the rest of the project through now. It's been about two months since I've felt on a programming roll. Finally starting to feel on the downhill side of this thing.
Spent today splitting the Insert Example sub-library off from my overall library.circular dependant, so a bit crazy. And @Michael's idea for syntax highlighting is going to more value to this. Have a great night.
 
fge
@aliteralmind you too!
 
 
4 hours later…
6:52 AM
hi
gud aftrnn
<img src="img/pro.png" alt="Proceedings" title="Proceedings" value="<%=rs1.getString(1)%>" height="30" width="30" ></img>
this is not working can any one suggest me
the user click on image, that ask for file "save" or "download"
 
 
7 hours later…
1:44 PM
Good morning, Java!
 
fge
Good morning milord
Familiar with parsers?
 
A bit.
 
2:10 PM
@fge Dang. Looks complex. >.<
 
fge
@Michael what a euphemism that is
 
I try. xD
Is it a problem with ASM?
 
fge
2:26 PM
I don't beliebe it is at this point
I rather believe it is a problem with ProxyMatcher
 
@Hareesh The <img> tag doesn't use a "value" attribute for anything. Also, <img> tags do not have bodies, so they are usually written in the format: <img src="..." />
 
fge
The problem is to reproduce it with a smaller grammar
 
Yeah, that's a huge test case you have lol.
 
fge
The most difficult was to obtain the "source code" of the generated parser
But it is doable!
Which reminds me, I should write a wiki page or something about it
 
The source code is not available? Are you decompiling byte code?
 
fge
2:45 PM
Yes
It is generated by ASM
And I have just found a potential fix
 
Nice!
 
fge
The problem is, I'm not sure it is correct
 
Why not?
 
fge
Well, I am not sure the existing tests in -core and -java cover everything
I'd need to set up several things, and not only code coverage because it does not tell much ultimately
 
Have you tried running the test case that chbussler posted?
 
fge
2:47 PM
I can't remind the name of the other test mechanism
Yes, and it works
 
So there are other parts of the library that need to be tested, and that the existing tests do not cover?
 
fge
I don't know at the moment
Hey, I have only hosted the project for 3 days ;)
And here what I was looking for: mutation testing
I need it for this project and for all my other projects in fact
 
So I guess it would make sense to familiarize yourself with it, then.
 
fge
I have already written grammars in the past with it
Including a full CSS3 grammar
 
Oh nice.
 
fge
2:57 PM
But I have never delved into its internals...
Also, lombok uses it, and I am in contact with the lombok creator on IRC
He knows it better than I do, probably
 
Cool, you should throw a few questions at him.
 
fge
He says he'll talk about it with the other main dev
 
Ah, nice.
 
 
2 hours later…
fge
5:17 PM
OK, I need to write that friggin debugging page
Maybe even code that "debug the bytecode" in
 
5:30 PM
2
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....

Any help would be appreciated. Bountied.
 
I have a question, when using: public boolean addNewText(String newText) {
text = newText;
return messages.add(newText); Do I have to declare that this could be a sentence?
 
@PaulSkinner: "declare that this could be a sentence" What does that mean?
 
@aliteralmind do I need to tell it how many letters
Is Boolean even correct? I might have the statement wrong. I am trying to add a text to my message board which is an array list.
 
What is messages? It's not in java.text. Related? docs.oracle.com/javase/tutorial/i18n/format/messageintro.html
 
public class Billboard {
private String text;
private List<String> messages = new ArrayList<String>();

public Billboard() {
super();
messages.add("We are friends");
messages.add("We need help");
messages.add("Are we having fun yet.");
}
public List<String> getMessages() {
return messages;
}

public boolean addNewText(String newText) {
text = newText;
return messages.add(newText);
}

public String getText() {
return text;
}
Every time I try to add a message, so long as it is one word no problem, more than one word problem.
 
fge
5:44 PM
@PaulSkinner do you realize that in .getMessages() you return a reference to a mutable collection?
 
? What does that even mean?
I'm looking it up
 
fge
@PaulSkinner I can .getMessages().clear()
@PaulSkinner see the problem now? ;)
Slightly offtopic: what is your preferred code coverage library?
 
No big words please only one syllable at a time :) preferred code coverage?
 
This works for me (added a main and tostring for debugging)` import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Billboard {
private String text;
private List<String> messages = new ArrayList<String>();
public static final void main(String[] ignored) {
Billboard messages = new Billboard();
messages.addNewText("Hello");
messages.addNewText("We are friends");
messages.addNewText("We need help");
messages.addNewText("Are we having fun yet.");
System.out.println(messages);
What problem are you having?
Mutable means "can be changed"
 
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:909)
at java.util.Scanner.next(Scanner.java:1530)
at java.util.Scanner.nextInt(Scanner.java:2160)
at java.util.Scanner.nextInt(Scanner.java:2119)
My errors
 
5:55 PM
What line is causing it? messages.add(newText)?
 
fge
Ah, Scanner
A boon when everything goes well, a nightmare otherwise
 
If I add a single word it works no error, when I place two words problem comes
@fge I do not understand?
 
I really dislike Scanner. Not from experience, because I have none directly, but from all the misuse I see from newbie questions on SO. You have to enter in every single thing every single time? No thanks.
 
fge
@PaulSkinner Scanner is extremely convenient to use when your inputs are always well formed; but as soon as discrepancies may exist, dealing with errors is an outright nightmare
@PaulSkinner I personally prefer to read a whole line and check by other means that the input is what I expect
 
CS profs should be teaching the concept of having permanent testing data, to avoid scanner in development, but apparently none do.
 
6:01 PM
If not scanner then what?
 
fge
@PaulSkinner a BufferedReader to read one full line, for instance, and then use whatever is necessary to assess the format of the line you have just read
@PaulSkinner but as always, it depends on the situation
There is not one good solution, and Scanner is certainly not that solution
 
I don't mean "don't use it". I mean you should have always have a set of testing data, so that when you're stressed during development, you don't have to use it. For user input during live/production/actual use, it is sometimes okay.
 
Too late stress is here!
 
fge
@aliteralmind I certainly would never, ever use Scanner in a production CLI program in Java
Anyway
I am head deep into projects here
 
"so that when you're stressed during development, you don't have to enter in every single piece of information by hand."
 
6:04 PM
Luckily this is not product just class. :(
 
@fge, well, as I said, I have no personal experience...
 
fge
@aliteralmind InputMismatchException is an unchecked exception
Enough said :p
 
fge
@aliteralmind by the way, maybe you may be interested in it, or you know people around you who would be: github.com/parboiled1/project-info
 
I guess I just need to keep trying and looking for the right code that will help me.
Thanks for the help:)
 
6:06 PM
Scanner seems to be not directly related to your problem. I just like to rant about it. ;)
 
fge
@PaulSkinner try with a BufferedReader
 
@PaulSkinner: You should post a question to get real help.
 
Doctors can't even give me real help I am beyond that! :)
 
@fge: For parsing taglets?
 
fge
@aliteralmind anything you can think of
@aliteralmind I wrote an entire CSS3 parser with it
 
6:09 PM
@fge: Hm. Will take a look.
Do you see my bountied taglet question in the main SO "feed"? Under interesting or featured or anything? It's my first bounty. I don't see it anywhere yet.
Only been an hour or so, though.
 
fge
@aliteralmind let us say that it is very close to JavaCC and ANTLR, except your grammars are written entirely in Java
No need for any preprocessing of any kind
 
Very interesting. I might have a use for that in other stuff, too. Never did that level of parsing before, though.
 
fge
@aliteralmind it is ultimately very simple; there is an examples package too
 
You have to use Scala with the new version.
 
hi im trying to remove | from a string with the following code String step1 = s.replaceAll("|",""); it not working any suggestions
 
fge
6:16 PM
@aliteralmind which is why I kickstarted that project
@aliteralmindI don't do scala and don't want to do scala
@aliteralmind what is more, as far as bytecode generation goes, this project has stopped to 1.5; and in 1.7 there is indy
(which is one of the core mechanisms of 1.8's lambdas
 
Indy?
@fge: So you're keeping the original version alive. Nice.
 
fge
@aliteralmind indy == invokedynamic
@aliteralmind and yes, this is what I do
I don't want parboiled for Java to die
It's that simple
And I already fixed a bug ;)
 
Awesome.
 
@fge: Show off ;)
 
fge
@aliteralmind if you want to debug parboiled this is pretty much a necessity
 
It seems like really great stuff. I will likely use it.
@fge: Is largetext finished now?
 
fge
6:51 PM
@aliteralmind no release yet
 
@fge: Going good?
 
fge
@aliteralmind yup, I beat python soundly
And I am on par with perl
 
I'll take another look through the docs before you release.
 
fge
@aliteralmind if you are interested in some hacking, I have a task for you
 
I can't right now, I'm about to put #2 to bed, and play with #1 outside. But I may be able to later today.
 
fge
6:53 PM
@aliteralmind OK well, I'll post the details nevertheless, it's not long
@aliteralmind SingleTextRangeCharSequence is useless; it only wraps a single CharBuffer which itself implements CharSequence. Goal: to alter CharSequenceFactory and maybe one or two other paths (can't remember at the moment) so that a CharBuffer or .subSequence() of it be returned directly
 
@fge: Hey, I'll tell you what, if you're not in a rush to release largetext, it'd be pretty amazing if you wait for my IXC library and use it embed your example code with it.
I'd do whatever you needed to help.
 
fge
@aliteralmind go all the way and use your library on this project :) It misses tests
@aliteralmind and don't say "whatever I need" -- you'd have work for a century
 
@fge: A decade is all I can offer, unfortunately.
 
can some help i need to split a string and make an array the string consists of numbers like 10|122|11
 
fge
@NasirShiraz either use String.split("\\|") or use Guava's Splitter.on('|')
@NasirShiraz if you can afford Guava, go for it -- its Splitter is much faster than anything else out there
@aliteralmind let us not go there ;) But if you can I'd really appreciate
 
7:02 PM
thanks fge il try that now something like line.split("\\|");
 
@fge: IXC will be all over my main library, so it will be reasonably tested. The build is pretty complicated because of it. My main library compiles fine without it, but I can't run the JavaDoc until IXC is compiled. I gotta copy jars between the projects and then update the jars and recopy... all before publishing.
 
thanks rge that worked :-)
 
That's sort of my thing: Writing code to help you write code.
 
fge
@aliteralmind remind of the talk we've had some weeks ago about meaningful names
@aliteralmind not sure how you'd name such a library but IXC for "Insert eXample Code", well...
@aliteralmind maybe codeInsert?
Or code-insert
Or doc-code-insert
Well, something like that
And a snappy headline like "provide running code in your documentation" or something
 
I've made a ton of changes based on your advice. Some pretty fundamental ones. I like IXC. You can't make me!!!
 
fge
7:13 PM
Well, OK, it can do the trick, I admit
Just make sure to document well ;)
 
@fge: It's documented out the wazoo. No worries on that one.
@fge: Working on the configuration file today.
And the ability to define templates in which the source code/output/plain text (input) will go.
 
fge
@aliteralmind I think we talked over that already
@aliteralmind at first don't give a choice, dump the way you want
@aliteralmind after that you will be able to refactor using templates and make your default, initial rendering a template as well
 
It's invisible. There are default templates. Trivial things really. If you want to override them, you can by defining your own and using them. Otherwise the defaults are used. It's pretty seamless.
 
fge
OK then
 
The default template is, in its entirety: <BLOCKQUOTE><PRE>%body%</PRE></BLOCKQUOTE>
@fge: I'm using stringtemplate.v4
@fge: I changed list.ify and list.er to list.listify and list.lister. I don't think I'll ever get over it. :.'...(...
 
fge
7:57 PM
@aliteralmind sorry to disappoint you but I prefer Guava here ;)
@aliteralmind for instance, I can do Joiner.on(...).skipNulls() or Joiner.on(...).useForNull(...) and feed it with an Iterable; it even has an .appendTo(Appendable)
 
8:09 PM
@fge: For templates?
Oh. For lister. That's what you mean?
Use Guava instead of lister. Just use IXC before google rolls their own ;)
 
9:01 PM
2
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....

Grrrr... Why isn't this showing up in any of the question feeds??? Did I mention bountied?
 
fge
@aliteralmind my first guess would be that the SO crowd either doesn't care (most) or doesn't know (experienced) -- and for the latter, well, SO doesn't encourage comments like "Sorry, I have no idea"
@aliteralmind but anyway you can always do your stuff and say that "in order to use it, you have to use a Sun/Oracle JVM, sorry", that will be the case of 90+% of people out there anyway
 
@fge: Hm. I'll somehow take that as a compliment, I guess.
en.wikipedia.org/wiki/List_of_Java_virtual_machines. That's a heck of a lot of virtual machines, if that's the ten percent remaining.
 
fge
10:09 PM
@aliteralmind meh, I'm no reference and I don't pretend that I am ;)
 

« first day (1274 days earlier)      last day (3670 days later) »