« first day (781 days earlier)      last day (3240 days later) » 

10:02 PM
Nope, not really.....
For example, JDOM has multiple sub-packages..... which one should be the name?
org.jdom2, org.jdom2.input, org.jdom2.xpath, ......
 
and now don't say "the top level"
 
Yes, top level usually works.
 
I have a lot of peeves with maven but the artifactid is OK.
 
Anyway, you could always add some simple qualifier.
 
aka. the groupId ??
 
10:05 PM
Here's an interesting one, @maaartinus - and it's a somewhat serious question... consider JDOM... it's a mess, and I hate it, but follow this: search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jdom%22
 
What could go wrong with saying (gradle style) org.jaxen::1.1.6 instead of jaxen:jaxen:1.1.6?
 
0
Q: Ball Entity for a Entity/Component/System Soccer Game

alexpfxHere is a code snippet of a class that I be interested to refactor. I was in doubt on how to proceed with the process of instantiation. The original ask was here. After think about it and heard some opinions I end up refactoring and splitting the instantiation in several constructors, one public ...

 
JDOM is hosted at www.jdom.org
because the API changed between JDOM 1.x and JDOM 2.x (generics does that...), and because JDOM is used in a lot of places, it became apparent that projects needed to have references to both versions.
To solve that, you can now import either/both org.jdom and org.jdom2
So, there's the org.jdom groupid (and the jdom group ID which is grandfathered).
 
The hosting doesn't matter, does it? I mean, it should be included in the package name and the package name obviously matters.
 
then there's the jdom artifact, and the jdom2 artifact
so, org.jdom:jdom and org.jdom:jdom2
 
10:09 PM
But this is all simply solvable. What's the package of the things in ord.jdom2?
 
org.jdom2
 
Then what does you the same groupId buy? It's not compatible, it's just related.
 
the administration of the artifacts is access-controlled by the group-id
 
@maaartinus isn't that the whole point?? grouping related stuff??
isn't that why it's called groupId??
 
So the jdom2 guys would need two accounts. Or the repository would need more flexibility.
 
10:11 PM
That would work... yes, but then, for example, JDOM distributes "contrib" files a separate jar...
 
TTGTB, night folks
 
those contrib files are in org.jdom2.contrib and in the jar jdom2-contrib
 
@Vogel612 Night!
TTQW
 
"isn't that why it's called groupId??" - no idea. This stuff forces thousands of people to search for jars.
 
It's a mess, I agree.... but that's why there's search.maven.org
 
10:14 PM
contrib. If they're placed in the same package, then org.jdom:contrib:version_id, otherwise org.jdom.contrib::version_id.
 
As I say, I have issues with maven, the groupid is actually the least of them, though.
Far worse is that I can't delete an artifact (or 3).
 
I know... the search works rather well. Though it took me a while till I found all my jetty-* stuff.
I'm trying to optimize codereview.stackexchange.com/q/94407/14363. Interested? My approach from root works much better than the other way round, but neither is satisfactory.
 
I am... distracted... have not looked at any CR questions properly in a few days
 
I'm voting to close this question as off-topic because it belongs on another Stack Overflow site. Perhaps Code Review? — Paulie_D 56 secs ago
 
For me, maven is a disaster. It's XML programming at its worst. You can't do anything without either spending weeks with learning or googling something out. But the optimization theme is much more interesting.
 
10:19 PM
When I first saw that I figured it would be great for my IntSet class.
 
Move this question to codereview.stackexchange.com — LcSalazar 9 secs ago
 
A smarter BitSet, I guess?
 
yeah... but, actually, the domain of the problem is small, a bitset would be better than my IntSet
My intset is for sparse (and negative) ints
 
I was using a boolean[], which is good as long it doesn't get too big. And it doesn't as the optimum for size=10 is
2144
1044 1100
579 465 635
355 224 241 394
229 126 98 143 251
149 80 46 52 91 160
95 54 26 20 32 59 101
58 37 17 9 11 21 38 63
33 25 12 5 4 7 14 24 39
18 15 10 2 3 1 6 8 16 23
and it took 50 minutes to compute.
 
0
Q: Speeding up Python script that downloads 2 tables from db, does calculation and uploads resulting table

CeleritasI have written this script that downloads two tables from the db, preforms an intersection on them and adds 2 new columns to the resulting table, and uploads the resulting table to the db. It's a bit slow and I realize my code is messy (I'm new to python and GIS). I suspect more steps can be done...

 
10:23 PM
I guess for non-optimal solving of big instances, a combination would be useful. A boolean[] for small entries (bottom rows) and something sparse for the remainder.
 
I have sme kid duties... off for a bi
 
@Duga Code from a screenshot. Absolutely okay.
Too late. Already posted.
 
-2
Q: How can I better my code?

user249240Please note that I am not looking for answers, rather I am looking for advice. I am a novice and I am learning off treehouse videos and I really want to understand this. Please dont downvote me and if you do please explain why that way I can ask better questions in the future. Here are my quest...

 
is there any reason to have 1 public constructor, and chain it with 3 private ones? I don't think so
@CaptainObvious A: Start with having code in your post. Then give your post a title that's not applicable to every single on-topic question around here...
 
10:39 PM
0
Q: I want to connect my database in java

Rasel Ahmedpackage connectionmysql; import java.sql.DriverManager; import java.sql.*; import com.mysql.jdbc.Connection; public class Connect { public static void main(String args[])throws Exception{ Class.forName("com.mysql.jdbc.Driver"); java.sql.Connection con=DriverManager.getConne...

 
@CaptainObvious I want to edit your title
 
@CaptainObvious First post was a code-only answer. Another user to educate.
 
PreparedStatement statement=con.prepareStatement("select * from info where dept= 'cse' ");
That doesn't look prepared to me...
 
Please add a bit of descriptive context, voice any concerns you may have... a code-only question is essentially "unclear what you're asking" if we're in a good mood, or taken as "here, review this!" if we're not. Either way, it explains the downvotes. — Mat's Mug 21 secs ago
isn't there something like an array initializer syntax in Java?
Array<Component> components = new Array<Component>();
components.add(PositionComponent.newInstance());
components.add(CameraFollowerComponent.newInstance(camera));
components.add(SpriteComponent.newInstance(ball));
components.add(BodyComponent.newInstance(ballBody));
components.add(BallContextComponent.newInstance());
var components = new [] {
    PositionComponent.newInstance(),
    CameraFollowerComponent.newInstance(camera),
    SpriteComponent.newInstance(ball),
    BodyComponent.newInstance(ballBody),
    BallContextComponent.newInstance()
}
ah
so yes then
well that was C# syntax
thanks :)
 
Someone pinch me... look at this...
import groovy.sql.Sql

def dbUrl      = "jdbc:postgresql://localhost/test-db"
def dbUser     = "test"
def dbPassword = "test"
def dbDriver   = "org.postgresql.Driver"

def sql = Sql.newInstance(dbUrl, dbUser, dbPassword, dbDriver)
^^ DB connector in Groovy
That's just....... Groovy?
 
10:54 PM
any guy (/gal) can confirm where my foot is here? (ground || mouth)
 
 def map = [id:20, name:'Grails', url:'http://grails.codehaus.org']
 sql.execute "insert into PROJECT (id, name, url) values ($map.id, $map.name, $map.url)"
^^ prepared statement :o
 
0
Q: Brainf**k to Ruby interpreter -- v3

QPaysTaxesPrevious iteration. I think this is about as good as it's gonna get, but just for kicks, let's do one more round of iterations. As before, it's a very simple substitution from Brainfuck to Ruby, with fancy things like joining duplicate lines into one and indentation. Some things that bug me: ...

 
 def params = [10, 'Groovy', 'http://groovy.codehaus.org']
 sql.execute 'insert into PROJECT (id, name, url) values (?, ?, ?)', params
^^ also prepared statement
Which brings the question... WHY THE F___ DO PEOPLE EVER USE PHP??
 
@QPaysTaxes fixed
 
@Mat'sMug I maybe could, if I knew what you're asking.
 
10:57 PM
@Phrancis blame WordPress
@maaartinus is this legal?
public Array<Component> getComponents() {
    Component[] components = {
        PositionComponent.newInstance(),
        CameraFollowerComponent.newInstance(camera),
        SpriteComponent.newInstance(ball),
        BodyComponent.newInstance(ballBody),
        BallContextComponent.newInstance()
    };
    return components;
}
 
@Mat'sMug IANAL! :D:D:D
 
@Mat'sMug no mention of creating new objects in the constructor?
 
This should have been funny: "is this legal?" -> "I am not a lawyer".
But the answer is yes, apart from `Array<Component>`.
 
@RubberDuck indeed
ah!
so this is then
public Component[] getComponents() {
    return new Component[] {
        PositionComponent.newInstance(),
        CameraFollowerComponent.newInstance(camera),
        SpriteComponent.newInstance(ball),
        BodyComponent.newInstance(ballBody),
        BallContextComponent.newInstance()
    };
}
@RubberDuck factory sounds like a good idea
+200!! Woohoo!!
 
11:02 PM
To be clear... Whatever Array<T> means, it's surely not T[].
 
0
Q: Creating a Bidirectional ManyToMany Relationship for Django Models on Admin Page

snavienI'm using the Django tutorial for 1.8 & Python 3.4 and right now the page has Questions that can add multiple Choices, but Choices cannot access its corresponding Question: #models.py class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTim...

 
T[] isn't an array of T?
dammit, Java!
 
Lol
 
Sure it is. But what is Array<T>?
 
I'd pronounce it as array of T
 
11:03 PM
I know no commonly used class called Array.
Yes, phonetically, it may be the same. But this doesn't mean much.
 
added a note to that effect
 
The OP may mean a Component[], an ArrayList<Component>, or maybe they really have a class called Array.
 
hey that trailing comma feature is pretty cool
[epic: 45/50]
 
I'm voting to close this question as off-topic because questions about reviewing/revising working code should be asked on CodeReview.SEpsubsee2003 19 secs ago
 
With array initializers, you can even put a comma after the last element, which makes rearranging them much easier. — maaartinus 1 min ago
maybe last time you tried was in C#?
 
11:09 PM
Lol. That ^
I did for a class. They made me do it.
 
private static readonly arrays are handy for making a quick list of enum values you're using all over a class to determine if x is one of them
 
Looks like I'm gonna fall a bit short today. Can't find something I feel like answering.
Why wouldn't you just use an Enum?
 
> Last time I tried it threw an error
This wasn't always the case. No idea which version in came with. Long long ago.
 
I've spent way too much time fiddling with code based on stuff I've read here in the past few days
 
11:15 PM
_memberTypes = new HashSet<DeclarationType>(new[]
{
DeclarationType.Function,
DeclarationType.Procedure,
DeclarationType.PropertyGet,
DeclarationType.PropertyLet,
DeclarationType.PropertySet
});
 
@QPaysTaxes It's probably not so much learning, as going "that's a really bad way to do it", and then writing a better way
...and then not posting an answer because it's a few hours later and I can't be bothered
 
learning? yes. scoring rep for it? no.
 
I've seen some horrendous crap in my time, I don't think I need to learn about that :)
 
@RubberDuck how short?
 
11:19 PM
-8 then ;)
 
Oh! @Mat'sMug I get it! It's a subset. Gotchya.
 
Can you inject a constant string value into another string using interpolation? I'm sure you can. I'm just not sure you can. — RubberDuck 13 secs ago
51
Q: Why does string interpolation work in Ruby when there are no curly braces?

Charles CaldwellThe proper way to use string interpolation in Ruby is as follows: name = "Ned Stark" puts "Hello there, #{name}" #=> "Hello there, Ned Stark" That is the way I intend to always use it. However, I've noticed something odd in Ruby's string interpolation. I've noticed that string interpolation ...

string interpolation is probably the main reason I'm eventually going to install VS2015 and try some C# 6.0 - that and the null-propagation operator
wait, did I score over +600 in 3 days?! woah that's been forever!
 
Yes. it's just a string of text, right?
 
it's called the rep cap
 
Checkmarks and bounties don't count towards it.
 
11:28 PM
@Mat'sMug my favourite new feature is getter-only auto properties
 
that's pretty cool too
 
@Mat'sMug string interpolation and expression bodied members are sexiest imo
null propagation looks fancy but meeeeh
 
@JeroenVannevel BS. we all know what you think is sexiest iyo ;-)
JV ♥ JV
4
 
I would deny it, but I can't
 
lol
 
11:31 PM
I'm straight up fabulous
 
@mjolka mine too! <3
 
hi @paulbica!
 
hi !!!
 
@QPaysTaxes LOL
 
sorry about the comment...
 
11:32 PM
I do like the string interpolation in 6 though. It was always one of my favorite Ruby features.
 
should I remove it?
It's fun reading all the nitpicking and semantics (should I feel guilty for considering it fun?) — paul bica 29 mins ago
 
Nah. It's cool mate. Just didn't want OP getting pinged because we're being chatty.
 
what's wrong with that?
...comment is on @RubberDuck's post, OP wouldn't be pinged, no?
 
ok, I'll leave it alone then
 
@JeroenVannevel you're really not psyched about null propagation? I am.
 
11:34 PM
@RubberDuck I found it very unintuitive to use so far, actually
though maybe that's just because of this particular API
 
Idk. I thought OP got pinged for comments on answers too.
 
i would be psyched if nulls were removed entirely
 
I just write everything out in full and then let R# convert everything to N-P
 
Maybe. Just seems like it takes a lot of fuss out of null checking.
Unfortunately, I don't think they'll be removing nulls any time soon.
 
@JeroenVannevel eh, that's pretty much how I learned LINQ
 
11:35 PM
So, yeah. Hi @paulbica! Welcome to the 2nd Monitor!
R# taught me Linq.
 
did someone say interpolation and null pointer are sexy?
LOL :)
 
Interpolation certainly is. =;)-
 
hahaha
too funny :)
I feel out of place - the only thing I know is VBA...
 
Hate to pimp, but one vote short today.
2
A: Recursively merge dictionaries with generic types in C#

RubberDuckI think it's important to remember that T is not always the best name for generic types. This is definitely important to remember when you start numbering them... public static Dictionary<T1, T2> UnionDictionaries<T1, T2>(Dictionary<T1, T2> D1, Dictionary<T1, T2> D2) To make matters worse, y...

@paulbica that's all I knew a year ago.
 
you're fast
 
11:39 PM
@paulbica is a full-fledged, badgeable tag on this site :)
BTW you did see this, right?
50
Q: Graduation update: it's election season!

PopsI'll start off by addressing the elephant in the room. It's been the better part of a year since the announcement that Code Review was graduating. In all those months, there haven't been any visible indications of change from us on the team. There are a few reasons for that, but they all come dow...

 
hi mat!
 
We've done some really abusive things in that poor ancient language.
Nothing like @Blackhawk's StringBuilder though. That thing is voodoo magic.
 
^^
 
i really like janos's reply re the graduation
 
Thanks Santa!
 
11:41 PM
I don't know what that is
 
@paulbica StringBuilder? or SE elections?
hmm
 
StringBuilder (I just looked it up - aha)
 
my longest post is 27,933 characters!
 
Yeah. So, String in VBA is immutable, right? A guy we know made a string builder for VBA. It's pretty cool.
Anyway Dad duty. Bbl
 
^^ same here
 
11:46 PM
thanks - finally a way to be more efficient with strings
 

« first day (781 days earlier)      last day (3240 days later) »