« first day (355 days earlier)      last day (3961 days later) » 

15:00
@SimonAndréForsberg never liked the question, the answer is decent.
@rolfl Yeah, the question was lacking a bit of context IMO, hence my comment to it. I think that overall, it seemed more complex than it really was -- which incidentally was exactly what was the problem with the code as well. K I S S.
@Malachi Apparently, we also try to run out of them as we're starring your message.
2
@skiwi I thought code would normally shrink with time..
@Mat'sMug Unless you start from scratch... I mean... if you have no lines of code, it's impossible to make that shrink...
2
Unless you're looking for a NegativeArraySizeException
@Mat'sMug But if you don't pay attention to it, then it multiplies.
Well, actually this is the real code I run into. I just changed values and put it into standalone context since original context is small and not worth mentioning. — nekome 54 mins ago
^^^^ reopen?
15:07
someone needing a nickname or something
how about programmers for this one? ▼▼▼▼
0
Q: Why does double brackets notation escape strings in bash?

chrisopediavar="foo" if [[ ${var} != 'bar' ]]; then... If you run this piece of code in bash debug mode (bash -x), it reads out as follows: [[ foo != \b\a\r ]] It still passes correctly, but why does it show the escapes? Is there a better way to do this?

Well, isn't that interesting. This feature that I had been thinking might be useful in the future has suddenly become absolutely necessary now.
@Malachi Why would it be on-topic on programmers?
@rolfl because it is about a programming concept that is accepted in Bash Programming?
@rolfl gotcha
15:13
- software requirements
- software architecture and design
- algorithm and data structure concepts
- development methodologies and processes
- software engineering management
- quality assurance and testing
- software licensing
@Malachi Seems to me like pretty much a mainstream Stack Overflow question.
@JerryCoffin yeah, I read the help page link that @rolfl posted. makes sense.
@Malachi - what are you up to in root-access .... huh?
strangers crossing in the night .... ;-)
@rolfl there was a link involving a pornstar and privacy, but I don't want to click the link at work
in Root Access, 21 hours ago, by jokerdino
@Bob This piece actually reminded me about your preference for privacy.
well, that was an unexpected TMI ... ;-)
15:20
how did you know I was in Root Access?
I was just there...
I just looked and didn't see your Monkey Mug in the guest list
86 to 2k
in Root Access, 12 mins ago, by rolfl
@OliverSalzburg done.
@Vogel612 With 2K comes great responsibility......
@rolfl I have that responsibility on another site already, and I think I'm managing it...
15:23
let me be a witty/snarky monkey....
2k is a baby step.
@rolfl *confused*
Oh dear... I decided to write a review on a Zombie that's a couple of days old, but the more I look at the code the more I want to cry... Why, user, why!? This is just.... wrong!
@Vogel612 it's a weak reference to this:
^^^ spiderman.
0
Q: Javascript Class Class that Builds Itself vs Inheritance

user1634074I find that in Javascript there are many methods of creating an object so what would be the appropriate approach for constructing an object and why. parent = { init: function(option){ if (option == 1) _.extends(this, sub1) else _.extends(this, sub2) }, greet: function()...

15:46
anyone want to stand up for me to become a Superuser Moderator?
Friendly competition with myself to get nominated
@Malachi Sorry, but considering your activity on SU, I can't really...
This is probably the most harsh review I've written in a long time, but the code was also one of the worst I've read in a long time:
0
A: Improving a system calculator application

Simon André ForsbergI scanned through your code and also stepped through it with a debugger, line-by-line. The more I looked, the more things I found that I wanted to point out. Let's start by looking at some unnecessary comments: // BASE PRICE private static String BASE_PRICE = "$1299.99"; // Number of People ...

@SimonAndréForsberg I know what you mean. have you read my arguments about the activity thing? (in chat)
I would be afraid to go anywhere near SU for fear of being struck by lightning.
Some questions around here perhaps have a few mistakes in the code, this question was like a combination of them all...
@Malachi What arguments?
@SimonAndréForsberg I changed some wording a little bit
in Super User 2014 Election, 11 mins ago, by Malachi
@Sathya I have all of these things on Code Review. the only reason I don't have them here was a lack of activity ( or what I perceived as a lack of activity )
15:55
@SimonAndréForsberg nice review overall ;)
@SimonAndréForsberg I hope he follows up, I think i can learn alot from that question
@Vogel612 Thanks, I wish I could have said the same about the code.
If anyone wants to btw, I'm sure there's more things to point out in the system calculator application :)
@Malachi I must say that that pornstar and privacy thing was an interesting read, I can recommend others to read it as well!
@SimonAndréForsberg I am waiting until I get home, hopefully my Wife won't freak out....lol
good thinking :)
Python lovers might want to take a look at this question and answer: (I'm not sure if the answer is good or not)
1
Q: Reverse and Add: find a palindrome

Nikolay DerkachThis is one of codeeval challenges Challenge Description: Credits: Programming Challenges by Steven S. Skiena and Miguel A. Revilla The problem is as follows: choose a number, reverse its digits and add it to the original. If the sum is not a palindrome (which means, it is no...

16:26
non-working code? I reviewed it anyway...
1
Q: Execute edit in a stored procedure based on database value

indofraiserI have code below which is set to check the date of DateToComplete, and if the date is 2 weeks or more ago, change the status of Complete from 3 to 2. Is this the best way? USE [DB] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create PROCEDURE [dbo].[spChanger] AS BEGIN Execute ('UPDA...

@Mat'sMug I just commented like 8 times on your answer
I don't think that I expressed everything clearly though.
If there are permissions to be scripted, I'd rather have them explicitly scripted alongside the CREATE part, for explicitness. — Mat's Mug 18 secs ago
ALTER is just a quick-and-dirty way of getting the work done. I know, it's used all the time over here... ;)
Hi!
i strongly suggest you post this code on codereview.stackexchange.comnjzk2 3 hours ago
16:42
0
Q: OnActivityResult not working properly

marjanbazSo, I have this quiz game and I have bunch of popup screens (for wrong answer, for game end, for time's up and so on). My game has 15 level, each level different number of question, different time and so on. I want when I finish level 1 for example, to present popup with some info, and when a use...

@Jamal I almost would have gotten snarky..
@njzk2 Furthermore suggesting a cross-post is not the correct action to take. Instead you should flag this for moderator attention with a custom reason and let them handle this. — Vogel612 25 secs ago
He didn't even give a reason why it belongs on CR...
but prepend something along the lines of: "I strongly suggest you RTFM"
New competing answer to another hot question (hey @NiallSzalkai )
0
A: Countdown Code: 'League of Legends'

rolfl(relatively critical review ... apologies in advance) The two issues I feel are most incorrect about your code is the buggy switch statement, and the poor choice of timing mechanism. The decision to use these mechanisms has lead to a poor OOP design. Switch First, though, the switch bug: swi...

sweet...
as it stands this should probably steal the first place..
16:49
Hey @Jamal ;-) greets.
Hey!
Software engineering final in about half an hour...
Oh, so you have time to answer another C++ question?
I don't think so. I'm about to prepare to leave.
about to prepare...
well good luck ;)
Thanks. I hope I spent enough time on it. Luckily, it'll be the easiest of my four finals.
16:52
all the best.
@Jamal : I am sorry if you can't see anything at all that can be reviewed in this conception. — njzk2 1 min ago
That's not what I meant?
+100
You've earned a bonus of 100 reputation because we trust you on other sites in the network
graphic design site
@rofl Thanks! I really like that answer, definitely gives me something to implement.
I really like all the answers, who gets the magical green tick o.O
Maybe a strange or an obvious question, but why do some questions have alot more attention than others? Is it because my questions are java based and its a popular language?
how is graphicdesign.stackexchange.com/questions a full site? they only have 7k questions?
It's because I gave it a catchy title, and it hit the hot-questions on Stack Exchange:
17:06
@Jamal : I am sorry if you can't see anything at all that can be reviewed in this conception. — njzk2 6 mins ago
@NiallSzalkai - I said this in a private chat room a few minutes ago:
I have taken it as a personal challenge to edit bad question-titles on Code Review to 'catchy' ones ... it's a bit of a game, really, and I have about a 75% hit rate of my catchy-titles hitting the Hot Questions list.... currently the top-2 are:
- Countdown Code: 'League of Legends'
- Questions & Responses: Let me tell you about you
people don't realize what a difference it makes....
@Mat'sMug Gotta love SO's snark.
Aren't you preparing? ;)
@rolfl That seem's to be really efffective, I will make sure to take some more time to think of a better title!
@NiallSzalkai - the real truth, is that, by being on Code Review, and in the chat, you get a couple of answers when you post a question....
17:08
I'll be leaving in a few minutes.
good luck!
@Jamal Good luck sir
(not like you need any)
That is all it takes for the question to be 'hot' in the SE network.... because it is unusual for questions to get voted/answered quickly on other sites.
Once it hits a couple of answers, and about 2 upvotes for each answer and a few on the question, it starts hitting the hot-list.
When it's on the hot-list, I think the title makes a big difference.
@rolfl Fair enough, and yes the title would make a huge difference when having a bigger audience
17:10
Compare:
- please suggest edits
vs.
- Questions & Responses: Let me tell you about you
2
@njzk2 please be more clear in your commenting. Of your comment one could take: "take this question, and post it (exactly the same) on CR". As the code in this question is not working it is off-topic. That is why our Mod asked you to read through our on-topic help. This comment looked like a misguided migration attempt to me. That is why I commented, mentioning the "correct" behavior in such a case. Sure, as soon as this is fixed, OP is welcome to ask a question with the fixed code on CR, but if he comes to us now, we'd have to close it and send him back here. That leads to frustration ;) — Vogel612 9 secs ago
Questions & Responses: Let me tell you about you - is ofcourse much better
@marjanbaz Great! If you got it to work as intended, I think you should take the working code to Code Review, njzk2 is right, this code could really benefit from a peer review ;) — retailcoder 16 secs ago
(CR link points to [help/on-topic] ;)
17:31
Lucky me... PC crashes earlier this afternoon, lost all my open tabs, etc.
The standard backup wasn't working, but I found a backup from 14 march that seems to be working on firefox
@skiwi if you use Chrome there is a way to keep all your tabs intact when reloading
options -> settings -> on start settings
Well it's also on firefox
Though a real hard crash on the PC doesn't like that
the restore should bring back all the tabs on either chrome or firefox
9 out of 10 times it does
I have had my ubuntu computer battery go dead and it came back (firefox)
17:34
I should check the reason for the crash (was connected remotely to my pc) after dinner
hadn't seen that one.. interesting...
I'd question the design of the thing, a password manager should treat passwords as first-class citizens - if it's just another text field, you have a potential security issue. — Mat's Mug 55 secs ago
pretty pictures and all
5
Q: Manually Populate DataGridView With Accounts/Credentials

BreemsI'm designing a small account/password manager using C# and SQL Server CE. LINQ to SQL is my ORM of choice. Here's the data model representing how the SQL Server CE database is set up: And here's my GUI with a cheesy color-coding system to show how the data is mapped to the GUI: Since the ...

AHHHHH
I need to work!
monking
@chillworld Eveking!
@chillworld 'king!
17:43
what is this whole monking thing?
monkey+morning = monking. Or monkey is king. whatever ;)
@Mat'sMug ok
I wonder how you can add monkey + afternoon?
monkernoon?
I am going to have to take a ride to quebec this summer when I get my new bike and steal your coffee mug. I am jealous I want one
Monkeyround
17:51
hello
hey @janos
hi @Mat'sMug :)
Hello @Janos
hi @Malachi :)
@Vogel612 And what about evening?
17:53
same rule applies...
monkening
If you don't mind, could we keep to English or some other recognizable language? It's a issue for new users.
@Vogel612 Isn't that too similar to Monking?
@SimonAndréForsberg just thought the same..
mong? moning?
monkning?
meh.
gets worse by the minute..
Eveking?
Yeah, it does indeed..
@200_success Monking isn't English? Or what do you mean?
Google leads to Urban Dictionary, which says:
> Monking off is a broad term used when someone does something non-positive such as anything stupid, rude or simply wrong.
18:00
oh gosh, I didn't even know it was an actual word!
3
it's urban-dictionary..
don't call it an "actual word" please.
that's as if you were calling macs a "superior race"
So here's this zombie:
0
A: django/python: is one view that handles two sibling models a good idea?

janosYou could avoid the "is Image or Video" checks in media_list, by passing in some extra arguments, for example in image_list: def image_list(request, rel_model_tag, rel_object_id, mode): get_star_media = lambda rel_object: rel_object.star_image return media_list(request, Image, get_star_m...

oh, I meant to paste the zombie, not the answer.... bah, doesn't matter
any Django/Python lovers care to take a look?
@Vogel612 I suspect that they new Mac Pro is one of the fastest commercially available desktops, but it still doesn't have any legs, so no racing.
2
@janos sorry I was writing an answer
@Malachi hah, competition!
18:07
oh, this room has been Malachi'd
2
Oh wow, something just struck me (no, not thunder)
on superuser
The Event Viewer in windows is called eventvwr.exe because in early MS-DOS file names were maximum 8 characters and extension max 3?
0
A: VS11 Black Background when printing

MalachiI don't know if you are still interested in finding an answer to this, but it looks like in Visual Studio 2008 at least you can set the printing format separate from the text editor format by going into the settings. go to this link How to: Print Code in the Editor under the section labeled colo...

@skiwi Probably.
18:08
@Donald.McLean Get out.
@Donald.McLean JK
same with iexplore.exe
funny, I don't think iExplore would make a very MS-like browser name nowadays...
back
doughter won't sleep :s
@chillworld LOL Are you the Pillsbury Dough Man?
2
@Malachi when you search monking on google you got also a funny explication
Pillsbury doughter haha
18:10
ah damn daughter
zombie down!
check this one out
0
A: Teamviewer remote computer 640x480 screen?

MalachiThere is no Screen, so Windows Detects that there is no screen. all you have to do is connect a monitor to it, you don't have to use it, just connect it.

thanks @Mat'sMug !
@janos huh? for what? not posting a link to it? ;)
pffft how dumb you can be
18:15
@Mat'sMug I thought you killed my zombie ...
@Mat'sMug Congratulations, you're on the first page here: area51.stackexchange.com/proposals/11464/code-review
w00t w00t!!
@janos what zombie?
that whill take a while when I'm there :)
ah, no, mine was much younger ;)
18:18
TTQW guys..
later!
sittin here since 3 hours doing nuthing..
just watching chat.
and reading "A certain magical index"
damned be you, internet.
mhhh investigating here also something from work
a guy who couldn't log in to our application
I corrected his ldap account
got the mail he could enter the application
and does not find him back in logging :s
even his account is not linked to his ldap account
strange things happens :D
18:37
@chillworld Not strange, so much as evil. Computers are minions of The Infernal Power, after all.
3
Final done. Didn't seem too bad.
congrats then
@Jamal Go Team Jamal.
The easiest question: verification vs. validation.
That's easy. One has an 'e'.
18:46
That was my answer! :D
0
A: Countdown Code: 'League of Legends'

chillworld@Dford is completly wright with putting the time event to an seperatly method. I still find it more readable when you use the switch in combinations with readable final's private static final int MINUTES_4 = 240; private static final int MINUTES_3 = 180; private static final int MINUTES_2 = 120...

Now I have to leave for another hour for some computer security presentations.
sorry was writing an answer
woted it first in notepad++ so I hope the syntax is correct :)
wroted
@jamal intresting
0
Q: Controller Best Practice

The Mini JohnI have a Cards Controller where I need to set up categories. Because the views for this Controller would get pretty heavy to oversee, I divided everything into folders. routes.rb resources :cards do collection do get 'druid' get 'hunter' get 'mage' get 'paladin' ...

@chillworld wrote ;)
18:59
ah damn
just saw a fault in mine code, was printing constant the message
added an if to it
but now tv time :)
in Root Access, 3 mins ago, by Blog bot
Abby T. Miller on April 24, 2014

Welcome to Stack Exchange Podcast #57, recorded Friday April 11, 2014 with your hosts Jay Hanlon, David Fullerton, and Joel Spolsky. Today’s podcast is brought to you by the Heartbleed bug.

We have lots to talk about (which makes Joel scared), starting with Community Milestones (after we discuss 2048 strategy, that is)!

Expats is newly in public beta. It’s a site for people that are dealing with the bureaucratic messes involved in living outside your home country. Check out their top-voted questions. Can I lose my US citizenship for accepting employment within a foreign government?  …

19:31
@Jamal Verification vs. validation? Honestly I'm not sure what I would answer myself on that question...
0
Q: How to repeat function exclude one method

user41260var myfunction = function(){ $('.menu').delay(3000).slideDown("fast").attr('style', 'color:#fff') return false; }); How to repeat myfunction without delay(3000)?

0
Q: Python - Unsatisfied with the loop

user2285948I am currently developing a touchless lightswitch via a Raspberry Pi, an ultrasonic module and a nice radio module. However, I am quite a very beginner in Python and it was a hard time (at least for me) to accomplish my goal. Whenever the measured distance is falling below the limit the switch is...

@Malachi I wonder if the podcast has mentioned us at any time?
@SimonAndréForsberg I don't know, I haven't ever looked at these blog posts let alone listen to the podcasts
Ain't nobody have time to listen to podcasts.
@SimonAndréForsberg Did you start with your TCG aswell?
This has not been closed yet? :
0
Q: Controller Best Practice

The Mini JohnI have a Cards Controller where I need to set up categories. Because the views for this Controller would get pretty heavy to oversee, I divided everything into folders. routes.rb resources :cards do collection do get 'druid' get 'hunter' get 'mage' get 'paladin' ...

I go in to a meeting and, no-one does anything ;-)
19:44
didn't bother to read, don't know ruby :s
I wasn't there.
Ok, so both Graphic Design and Academia graduated this month. Great...
@skiwi Technically, I already have a completed implementation of Castle Wars 2, and I have a semi-complete Hearthstone and Magic: The Gathering.
I have an idea for a brand new original game I'd like to do for this challenge though :)
@SimonAndréForsberg However... Whenever someone mentions the word "Technically", something inside me starts to itch.
Hmm, sadly this is an old question (was looking at the top voted questions of CR)
48
Q: Remove-Last-Comma-Problem

Jonasis there a more elegant way to solve this problem? List<String> paramList = new ArrayList<String>( ); paramList.add( "param1" ); paramList.add( "param2" ); StringBuilder result = new StringBuilder(); for ( String p : paramList ) { result.append( p ).append( ", " ); } String withoutLastComma ...

Could use some Java 8
11 answers. Damn.
I'll refrain from it though, as it wouldn't fit the question
19:52
@rolfl Could you add a comment to the question stating what's wrong with it? It doesn't really ask about how to write code. At the moment I'm leaning towards "Unclear what you're asking" because I can't simply understand it.
Answering a non Java 8 question with Java is ok... If the question got asked after Java 7 got released
@skiwi OK, then. Let me rephrase that: I have a completed Castle Wars 2 implementation.
@skiwi I think some Java 8 would fit great on that question. That question is still relevant today, IMO.
Or it could be a CR question :)
+190 rep today, thanks Santas!
I'd need some concensus on that then... I mean I could revisit all Java questions and start answering them with Java 8 and beat every other answerer.
Last part is heavy assumption ^^
@SimonAndréForsberg capped, congrats ;)
Thanks, Santa Mug!
19:56
off-by-one:
9
Q: Password Manager UI: Populating DataGridView is Painfully Slow

BreemsI'm designing a small account/password manager using C# and SQL Server CE. LINQ to SQL is my ORM of choice. Here's the data model representing how the SQL Server CE database is set up: And here's my GUI with a cheesy color-coding system to show how the data is mapped to the GUI: Since the ...

@SimonAndréForsberg Looking at it again, there actually is code on it.....
just 95% description, and 5% code.
And the code is just 'declatations/imports'.
@skiwi Could be a good question for MSO (the real MSO)
@rolfl I think the question then is: Is it reviewable?
Does it have to do with MSO if it is about CR? ^^
@SimonAndréForsberg I am guessing, but a ruby person would possibly say 'yes'.
Could I get some eyes (and rep love?) on this one:
1
A: Find intersecting rectangle

janosInstead of putting unit tests in the main method, create proper JUnit tests. At least one of your unit tests is incorrect: assertEquals(new RectangleWithPoints(15, 25, 25, 5), fecthIntersectingRectangle(new RectangleWithPoints(10, 35, 25, 15), new RectangleWithPoin...

19:58
I get the impression it is like reviewing import statements in Java, though.
@skiwi I was thinking of a MSO question like: "Is it OK to answer old Java questions with new Java 8 solutions?"
@rolfl In that case, I don't think it really deserves to be closed.
fecthIntersectingRectangle you sure you are not talking about fetch... @janos?
I don't see much point about actual Q&A's though which are simply done, emphasis should then be on questions with loads of votes, traffic and answers
@janos - you dicovered the JDQs?
returning customer!
1
Q: Looking to speed up this method

James WilsonThe old code I had before was atrociously slow but after some advice and research I was able to take a 2-5 minutes run time down to about 5-30 seconds. That is acceptable, but still looking to have it run as quickly as possible. I'm still cleaning it up, like there shouldn't be two seperate PP...

19:59
@SimonAndréForsberg I may have jumped the gun...
TTGH .... back in a bit./
1
Q: Looking to speed up this method

James WilsonThe old code I had before was atrociously slow but after some advice and research I was able to take a 2-5 minutes run time down to about 5-30 seconds. That is acceptable, but still looking to have it run as quickly as possible. I'm still cleaning it up, like there shouldn't be two seperate PP...

monsterCard.increaseHitpoints(0_0);
What annoys me though is that neither the down-voter nor the close-voter (possibly the same user) did not comment.
@rolfl JDQs ? what's that?
@Vogel612 didn't get what you mean
I have an awesome intersection function that somehow uses exceptions for flow control...
A line and a sphere intersecting at a single point is an exceptional case, so I throw a Point.
And people scream in their head :o
20:02
@Morwenn Wait, what? That is odd
The intersection functions returns a std::optional of a normal intersection type (here, a pair of points) and throws exceptional results.
I like to look at people screaming when they read code.
@Morwenn Consider yourself lucky there ^^
@Morwenn that's the fun part about zombie-hunting - you never know what you can wake up!
20:07
He has a quite reasonable SO account
How am I on 1406 rep already here on CR... I just occasionally answer and occasionally ask
In unit tests, should I also validate all 'public' (accessible via getters) attributes that I pass on in the constructor?
@skiwi unit tests should be an automated check that the unit's contract is adhered to. So checking that the constructor successfully sets some attributes and that getters work as expected is sensible.
@skiwi Probably because we occasionally vote...
Well fair enough @amon, it's just something I realised here in this testing code
@skiwi Just don't use this:
markupControllerObject.setBasePrice(BASE_PRICE);
(...a few lines later...)
BASE_PRICE = markupControllerObject.getBasePrice();
That BASE_PRICE stored as String, itching starts.
When code needs so much commenting, it also hurts
20:17
The code doesn't need that much commenting!
Don't look further. Trust me, it will only itch more. You have been warned.
I hate it when teachers tell us: "Comment every piece of your code"
yeah, that's just ridiculous...
No, no, no! Writing understandable code is not about writing comments on ununderstandable code, but it is about writing understandable code in the first place!
4
They don't seem to grasp it.
String local = ...;
//switching on the customer name
switch (local) {
}
Hmmm, I've got something tricky
A MonsterCard has an immutable name, attack, maximumHitpoints, but has mutable hitpoints and modus
Currently the equals and hashcode are implemented on name, attack and maximum hitpoints, is that seemingly correct?
sounds about right
Hmm, I think I shoudl prevent that two cards can exist with the same name...
I should use a binary tree there on the hash code of a string I think
O(log n) lookup time should be fine
20:27
@skiwi Many of them have never actually worked in industry.
I might need to rethink this
two different strings, can have the same hashcode, right?
@skiwi Yes, but it is very unlikely.
If the hash algorithm is designed correctly.
But most hash tables use a chaining algorithm to handle collisions.
I'm just thinking a bit theoretical, how would a binary tree behave with multiple identical (same hashcode) elements?
You would have to use chaining, just like in a hash table.
You would probably have to make it a tree of lists, just to be safe.
Hmm, default Java doesn't have a binary tree?
Atleast am not able ot find it seemingly
20:32
Yes, but I don't know how it handles the circumstance of two equal elements.
Might need to think really hard on this one
TreeMap and TreeSet
Other problem: If I were to force the name to be unique (which is very very reasonable), then equals() would always return false?
Unique names would mean that comparing the name of two instances representing different items would always return false.
And thanks for the TreeSet, forgot about tis existance, that's probaby a binary tree there
20:36
TTQW - later!
MonsterCard monsterCard = new MonsterCard("Test", 5, 5, MonsterModus.HEALING);
MonsterCard monsterCard2 = new MonsterCard("Test", 5, 5, MonsterModus.HEALING);
assertTrue(monsterCard.equals(monsterCard2));
Asking the above would not be possible though
@Mat'sMug laters
@skiwi That should work, if you write equals correctly.
So only thing I could check is MonsterCard monsterCard2 = monsterCard;, but that should be true as they refer the same object
@Donald.McLean Agreed, the equals() will work, but you would never be allowed to create a second MonsterCard.
That's an assignment.
It could perhaps be tested using two classloaders?
20:39
Well, I was just thinking of a case where an item is independently fetched from a DB in two different places. They would be equal in that they refer to the same thing, but they would not be the same object according to Java.
Ah yes, it depends on what one means with refer
btw, should this code be frowned upon?
public TreeMap(SortedMap<K, ? extends V> m) {
    comparator = m.comparator();
    try {
        buildFromSorted(m.size(), m.entrySet().iterator(), null, null);
    } catch (java.io.IOException cannotHappen) {
    } catch (ClassNotFoundException cannotHappen) {
    }
}
I'm not ready to go second guessing the folks who wrote Java.
It's just that swallowing exceptions seems real sketchy to me
@skiwi Why shouldn't it be possible to have two cards with the same name and stats, but that they are still not equal? Think of a simple Magic: The Gathering situation where a player has two "Forest" lands on the battlefield. Same card name, same abilities / stats / properties. Is it the same card? No.
@SimonAndréForsberg Actually, you are correct..
20:47
@skiwi Depends on what buildFromSorted is/does.
I keep getting confused
@skiwi Yes, but clearly, the author doesn't believe that those exceptions will happen and they have to be caught. That's one of the things I like about Scala.
I had an older TCG trial (about a year ago?), where I literally loaded cards from a file on the PC, and then stored the cards in some map, and allowed them to be retrieved from there
@skiwi Personally, I haven't overriden equals on my Card class. The default one from Object works fine enough for me
Also, I'm really stupid, this implementation I had in mind wouldn't even allow two players to use the same cards.
20:49
I write .equals implementations when I feel that I need them, I don't write the implementation first and then try to create a situation in which I would need it later.
@Donald.McLean How is it in Scala then?
@skiwi You don't have to worry about declared exceptions.
Though obviously, if you think that they could be thrown, it would be good to handle them, but it isn't required.
I agree with that approach
Truthfully though, there are ways to outright prevent some of the more common and painful Java exceptions.
I currently cast all Exceptions to RuntimeExceptions in the Java program I'm building for work.
20:54
What IDE?
Nevermind that part there
It was basically asking for checked exceptions, but then forced by the IDE instead of the compiler
which makes no sense
I got that. I was just curious what IDE you're using.
Netbeans 8.0 here
You?
Ah and now I just noticed why you commented on the Hubble Space Telescope, after reading your profile
I tried Netbeans, back in like the 2.0 or 3.0 days. It was ok, but didn't have the full featured majesty of IDEA.
Yes. I was bummed that I missed the party at work.
Eclipse and I just don't get along. At all.
IntelliJ seems promising (or should I call it IDEA?), but I don't exactly fancy switching IDE's, in fact I have never done it so far, unless you find switching away from Notepad++ (amateuristic PHP long ago) a switch
@Donald.McLean If you can't get along with Eclipse, then I think we should be able to get along

« first day (355 days earlier)      last day (3961 days later) »