Here 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 ...
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).
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.
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.
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
I 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...
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.
Please 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...
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 Mug21 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()
}
Previous 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:
...
I'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...
I'm voting to close this question as off-topic because questions about reviewing/revising working code should be asked on CodeReview.SE — psubsee200319 secs ago
The 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 ...
I 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...
I'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...