« first day (354 days earlier)      last day (3962 days later) » 

20:00
Show this user some love: he already has 2 good answers : codereview.stackexchange.com/a/47883/14625
yup, nice answer
Decent, but I worry about the hypodermic link .... in this case it appears innocuous.... and disclaimer has been applied, so OK.
@rolfl Do you have some thoughts about Java-8-ifying JDOM yet?
I have had thoughts, do you have requirements?
JDOM is a stable product, with 'slow moving' customers.... (banks, etc.).
I don't think I can set any requirements, when I'm just glancing at JDOM
20:08
It does not have an 'agile' development cycle, but the Java8 changes are significant, and could have a distinct impact on JDOM usage. I need to understand it.
btw as a sidestep
(what the impact will be).
When companies upgrade a component of their software, they will always recompile the code and check for issues, right?
An update in which the API changes*
Depends what you mean....
Companies take JDOM as a jar file, they do not compile it.
I get that,
20:09
They may recompile their code, but not JDOM.
But let's say you have a banking program with 30+ jar dependencies, and they update from JDOM 2.0.0 to 2.1.0 (yes, they're lazy people in that company)
On the other hand, they may have components that are internally managed as jars anyway...
Can you expect a reasonble company to actually recompile all their code?
Every major Java product/Project I have worked on has always rebuilt their complete code-base from scratch (not iterative build) for each release.
programmers and some test systems may use an iterative build process, but that can introduce unexpected things, sometimes.
But of course developers will not be happy at all if they suddenly see all red lines because some guy decided to remove functionality from an API
20:12
Correct.... that will set off alarm bells, and it required JDOM to chang package names from org.jdom.* to org.jdom2.*
Because, when you have complicated projects, some of your dependencies use JDOM 1.x and others use 2.x and you need both sets of API's in your classpath.
And I totally understand that you've been fairly recently doing that process and don't want to do it again soon
I do not believe there is a need to introduce API/compatibility problems with Java8 support.
(for JDOM).
The Java8 support can be introduced by extending, not changing the current API.
I think so aswell, yes
(and it will be a no-go to change the current API)
But, I am at the point where I can say that JDOM1 is end-of-maintenance, and that JDOM 2.0.x will support Java and later, and JDOM 2.1.x will support Java8 and later.
I have tried out JDOM2 a little bit this afternoon, but found myself busy mostly with making the other bunch of stuff
List<Element> pages = document.getRootElement().getChild("html").getChild("body").getChildren("div");
Stream<Element> filteredPages = pages.stream().filter(predicateByAttribute("class", "ocr_page"));
20:16
You should learn XPath.
I was thinking as example, it might be nice to have a getChildren(String cName, Predicate<Element> filter)
was just a first thougth I got there
I see
I'd definately need a way closer look to see what could use improvement with Java 8
The actual Filter instance can be customized from AbstractFilter: jdom.org/docs/apidocs/org/jdom2/filter/AbstractFilter.html
It would be cool to add a Predicate<Element> option wherever there's a Filter now, but then you do have much more options to choose form which may be confusing
20:21
But, XPath would still be the standard way ....
XPathExpression<Element> xpe = factory.compile("/html/body/div[@class='ocr_page']", Filters.element());
It might be better if I'd have some looks at existing code and see where redundancy is and if it could be fixed somehow
List<Element> filteredPages = xpe.evaluate(document);
Difference is that you know JDOM like the back of your hand ^^
^^^ it helps , yes
Are there any full examples available? Which represent a real usecase
20:26
Hmmm .... put that way, not that I am aware of that I can share.... let me think about that... Eclipse uses it...
I think there's some oppurtunity for internal cleanups
But it might be limited by preserving existing API's
However internal Java 8 can decrease performance, so it's not that trivial either
There could well be.... I know I never hit all of it when I revamped everythng in 20012
Is there any obvious way to integrate lambdas? Are there places where you'd want them?
Internally in JDOM, or as part of the API?
Internally, I don't think it will be necessary.
As part of the API, then exposing streams and being able to process them, seems reasonable.
Cisco uses JDOM in their logging.
As part of API I meant there
Ah cool, you can see who uses it there
Also lambdas don't imply streams immediatly
Consider List.replaceAll
Though I do not know if there's any direct usecases in inline manipulating Elements
20:35
Here's the download Graph for JDOM from maven central repository .....
90% of it is still JDOM 1.x .... because of legacy usage in all sorts of places.
12K downloads per month of JDOM 2.0.5
That's a cool number of downloads
The thing is, that those downloads are unrelated to actual usage ... for example JDOM 2.0.5 is in both debian, and centos.
I'm unfamiliar with Linux and variants, do they all pull during installation?
.... I suspect there's millions of people using JDOM all the time.
Puppy is totally self-contained.
20:38
@skiwi No, the way maven works, is that many people will pull it only once, and cache it on their local mirror repository
(Puppy linux that is)
a single download from maven could represent something like "eclipse many versions ", or "Microsoft".
There is no way to know.
Ah, I thought you were implying that the actual usage is way lower than the 12K downlaods, but you actually meant the other way around ;)
I do know that IBM uses JDOm in many products that are have thousands of installations.
Also, the maven downloads only represent a subset of the actual downloaded content.... there are people who build from source (the linux distro's do), and others who download from jdom.org/downloads/index.html
But also not only developers use it, also the customers
20:41
Yes, the JDOM gets shipped as part of whatever the developers 'build', and those shipped things are not counted.
I've got to go though now, it was an interesting conversation :)
Learned a lot of new things today
And.... JDOM is on android too....
who knows how many in there ;-)
Well, the regular shipped jars aren't counted, but if someone else dveloped a program that relies on the JDOM dependency. ANd an user installs it and figures out he needs it, then he might still need to pull it himself/herself
20:58
It looks like Academia SE has recently graduated.
0
Q: Wrote a package in Go. What did I do wrong? What did I do right?

jsanc623I wrote a Player package in Go. It builds correctly, but I would love a review on what I did and did not do "the Go way". I'm new to coding in the language, although I've gotten about halfway through Ivo Balbaert's "The Way To Go". The code consists of a struct and a bunch of setters and getters...

21:19
was there a fancy name for old-ish questions with no answer?
... and for answering those?
7
Q: Connecting to EC2 instances using the instance name instead of IP

Uri AgassiI'm an intensive user of AWS EC2 instances, many instances are launched, stopped, repurposed, etc. To connect to any instance using SSH I must keep track of their IPs. The bash script I wrote (following the question I asked on SO) uses aws-cli to do the heavy lifting for me, leaving me to remem...

zombies, and killers.
ha! thanks @rolfl
headshot!
so that was the zombie. And the killer is:
1
A: Connecting to EC2 instances using the instance name instead of IP

janosIt's mostly fine, but I would suggest some minor improvements. Give a proper name to $1 early on, for example: host=$1 if [ -z $host ]; then echo "Please enter machine name" return 1 fi You use it in several places later and it will make the code more readable. These kind of if conditi...

technically, 'killer' is not part of the meme...... but, yes, you hunted that zombie, and, it is confusing, because actually my upvote (ammo) killed the zombie, because zombies are questions without an upvoted answer.
Still, you posting the question here is a 'killcam' (come see what I did)
and, the next vote in is the double-tap.
21:26
lol, makes sense ;)
so you're the killer, I'm just the instrument then :p
uh-huh.
And, one more vote till the revival.
oh, I thought it takes 3 to revive. that's great
I believe we can break out in the revival song now .... any second....
:)
Two for Revival and five for Necromancer.
21:30
3 is for something else..... 3-down for peer pressure, and 3 up for disciplined.
3 for self-taught too.
hope the OP will like it too
I don't remember seeing him in this room
 
1 hour later…
22:52
0
Q: Refactoring & Optimizing Go Code

user3566539I'm pretty new to go, and I do not know the best or idiomatic ways to do most of the stuff, so I'd appreciate feedback on how to make my code better, faster or more idiomatic. My program is a set of methods/functions to parse an infix notation expression then convert it to reverse polish notatio...

HI! *just saying
@BlueBug Hello
much joy! to hear voice echo back from depth of internet.
@BlueBug I am autonomous...
0
Q: Project Euler 23: Non Abundant Sums

TwooeyHere is my solution to Project Euler 23: Non Abundant Sums. I know I'm doing the Divisors function brute force, I can't seem to get it to work any other way. Any improvement's are welcome. #include <iostream> #include <vector> //Calculates divisors void Divisors(unsigned number, std::vector<uns...

23:01
echo back, I mean, to be answered back by sweet/beautiful internet souls.
Heh, rob0t doesn't have a soul. :P
Do either of you know much about python?
@AwesomeUser I don't, but @200_success or @Corbin may be able to help you out.
Ok thanks
@AwesomeUser Just ping one of them with your question, I'm sure they'll get back to you eventually (if it isn't too long).
Hey @MattS.
23:15
Ok
@200_success @Corbin I am trying to export JSON data out of earthquake.usgs.gov/earthquakes/feed/v1.0/summary/… with python on a RPi and I am running pastebin.com/usTM71KK . I just cannot seem to replace 'type' with something like mag or magType
0
Q: Simple event management system. Am I missing something

willlmaIn an effort to rid my code of jQuery, I wrote a custom global event management/handling system. I was expecting this to be hard as, from what I've read, most people don't create their own. It's far simpler than most libraries I've seen. Is there a flaw in this method? What are the benefits of us...

@nhgrif - long time... monkey
Yeah.
This guy posted a huge question and didn't leave much of a comment at first... but it did make me feel better when I saw him come back with more comments: codereview.stackexchange.com/questions/46357/…
@AwesomeUser that's because magType is specific to a Feature
Makes it at least seem like he'd been giving the answers some thought
Hey, now I'm one vote away from a Nice Answer!
23:34
Sorry, BTDT:
How would I run that then?
@AwesomeUser here's a little sample to get you started pastebin.com/UbNsDY9h
Ok thanks
@AwesomeUser ie. FeatureCollection -> Feature -> Properties -> magType
@rolfl that's killcam... noob (@CallOfDuty, that is - we all know you're a veteran Zombie Killer) ;)
23:40
Does EOL when
does EOL while scanning string literal mean anything to you
you are missing a single quote before features
EndOfLine?
Yes that fixed it. Thanks
Hmm. So, I know a bit about a few different languages... but I spend 40+ hrs a week writing mostly Objective-C (some C and some SQL). With that said, most of the time I'm able to see someone trying to do something they're used to in one language in Objective-C, and I can say "Wait--here's the Objective-C way to do that."
But now I've found something that's stumped me... abstract classes. Objective-C doesn't have abstract classes.
has interfaces?
23:44
An "interface", as I know it from Objective-C, is just a list of method and property declarations for the class.
Objective-C has protocols, which I think is like Java's interface.
@Mat'sMug hey there
I think ... two things ... one, "What?", and two: you should consider putting together Blog:phase4
Who are you talking to?
what's phase 4?
23:46
Phase 1 was stealing underpants. And we're past phase 3, so obviously we have $$$$$ right?
right, obviously. I thought "the next step" was in GraceNote's hands..
also:
2 hours ago, by rolfl
Still, you posting the question here is a 'killcam' (come see what I did)
Just saying.
(EMP applied).
Anyway, an Abstract Class in Java could implement some of its methods, right? Like foo could be defined, and bar is only declared. A class inheriting the abstract class has to define bar, but wouldn't have to define foo, as it's already defined, right?
I sense unfair mod powers being used...
23:48
Correct.
There's nothing like this in Objective-C.
EMP - Evil Mod Power ;-)
shhhhh
@grovesNL is there a way to take that data and analyze it in a variable instead of print it?
23:49
There is inheritance from what Java would consider a concrete class.
And there are "protcols" in Objective-C, which I think is what Java would call an "interface".
@nhgrif so.. is objective-c object-oriented? where's polymorphism?
@AwesomeUser What have you tried? You should just be able to loop through it and assign a new value like blah["magType"] = blah["type"] and then just remove the type key. I'm not very familiar with Python though, so no idea on the specifics.
As for the blog, I think we should prepare phase 4 anyway ..... (I have not heard anything from GraceNote... perhaps I should reach out.... but it has been busy in SE land recently, I don't want to push).
That makes sense. Thanks.
There's still polymorphism. You can have a single base class with several subclasses.
23:50
don't push (yet) - I think we should discuss what the first post ought to be about
In fact, nearly everything in Cocoa inherits from NSObject.
@AwesomeUser Try pretty-printing the JSON (with indentation) and you will probably figure it out.
@nhgrif - Yes, Java has the interface, and, abstract classes, and classes.
And all the UI elements inherit from UIView.
@Mat'sMug Which is why I think a phase4 post may be appropriate... but, not sure whether I should drive it, or not.....
23:51
And for example, UIView has an array of subviews. I can do something like
for (UIView *subview in myView.subviews) { subview.hidden = YES; }
@nhgrif I'd think that's describing inheritance... is there a way to "override" a given method from the base class, in the derived class?
You can override methods yes.
But you can't have abstract classes.
You can't have a class that declares a method without defining that method.
so it's like a beefed-up VB6 then! (kidding)
From what I understand, interfaces and abstract classes aren't a big deal in Objective C since duck typing works.
oh, well that changes quite a lot of things then!
23:53
@Mat'sMug - in Phase 3, you are the only person (apart from a half-way-committed monkey), to offer to coordinate the blog. All the others are offers to write occasional items, and to review/edit posts.
At best, you could use preprocessor statements to prevent init from being called, declare your methods, and then just return nil in them all.
@rolfl so I'm the designated driver then?
The question is really more about how I tell someone who is coming from Java what to use in place of abstract classes
I'm an Objective-C programmer. I don't even think about Abstract classes.
The problem is more for how I help out someone who comes from a background like Java and want to continue using abstract classes.
@Mat'sMug I am not sure... all I am saying, is that, if you want to drive it, then it is yours for the taking.
Nothing prevents you from writing abstract classes. You just aren't obligated to mark them as such.
23:56
Hrmm, that's an interesting line of thought. I've never even slightly felt the need for abstract classes in ObjC. Seems like the correct response 99% of the time would be "if you think you need an abstract class, you're actually looking for a protocol"
I've never thought about going from Java to ObjC. That would be a rather jarring jump.
imagine C# to Objective-C. Jarring?
Hmm, if you're okay with compiler warnings, nothing prevents you from writing abstract classes, I guess.
Yeah. That'd be pretty jarring too :/
M$ => iCode
And you do have to go out of your way to mark them as abstract actually... you have to prevent them from being created.
Otherwise they're not abstract in the Java sense of the word. You can't create an object of an abstract class type.
23:58
ObjC feels a lot less rigid than Java, and I think that's a good example of it.
@Mat'sMug I have a bad track record for keeping up the momentum on things like blogs.... (and new-year resolutions, and keeping journals, etc.). I can step up and help/facilitate as needed, and, if nudged and bumped along (carrot&stick type thing) then I can be useful.
You could make an abstract class, but it'd be either by documentation or horrid hacks.
It wouldn't be that horrid.
@rolfl so, what, I just start writing? and post on meta?
- (id)init __unavailable__(("This class is abstract"));
23:59
Yeah, I guess so. It wouldn't be nearly as clean as a built in language feature though.
And actually... I think that'd be problematic...
because as soon as you subclassed it and called self = [super init];...

« first day (354 days earlier)      last day (3962 days later) »