code logs -> 2011 -> Tue, 15 Nov 2011< code.20111114.log - code.20111116.log >
--- Log opened Tue Nov 15 00:00:22 2011
--- Day changed Tue Nov 15 2011
00:00 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
00:05
<@Tarinaky>
God damn you Java and your complete lack of a decent debugger.
00:08
<@TheWatcher>
But you don't need a debugger! The elegance and simplicity of the language, and its robust and reliable standard library, makes any task so simple as to made a debugger obsolete!
00:09
<@Tarinaky>
I've got a two dimensional array that's, for some reason, transposed.
00:09
<@Tarinaky>
I can't tell why.
00:09
<@Tarinaky>
By transposed I mean as in a transposed matrix.
00:09
<@TheWatcher>
(And if you believe that, I have a bridge in Brooklyn you might be interested in purchasing)
00:10 Derakon [chriswei@Nightstar-f68d7eb4.ca.comcast.net] has quit [[NS] Quit: Lost terminal]
00:18 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [[NS] Quit: Well, most things get better when I kick them!]
00:22 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
00:29 Derakon[AFK] is now known as Derakon
00:43 You're now known as TheWatcher[T-2]
00:46 You're now known as TheWatcher[zZzZ]
01:19 gnolam [quassel@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Z?]
01:33 Kindamoody[zZz] is now known as Kindamoody
01:43 k-work-sn is now known as kw|G0_PACK
02:14 Attilla [Obsolete@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
02:55 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
03:40 Vornicus-Latens is now known as Vornicus
03:40
<@Tarinaky>
Help!
03:40<~Vornicus> HALP
03:40<~Vornicus> WHyfor help
03:40
<@Tarinaky>
How are you supposed to remove elements from a list in Java if you can't modify a list you're iterating over?
03:40
<@Tarinaky>
The whole point of a list is you iterate over it.
03:41
<@McMartin>
Er
03:41<~Vornicus> Check if your iterator has a remove() method on it
03:41<~Vornicus> Many do
03:41
<@Tarinaky>
It does.
03:41
<@McMartin>
Pretty sure Java's do.
03:41<~Vornicus> I think that's what it's called.
03:41
<@Tarinaky>
But using it causes my program to throw an Exception.
03:41<~Vornicus> what the shit
03:41
<@McMartin>
What kind of list is this?
03:41
<@McMartin>
Also, which exception.
03:41
<@Tarinaky>
LinkedList. java.util.ConcurrentModificationException
03:42
<@McMartin>
Where are you getting these iterators?
03:42
<@McMartin>
Calling remove() should invalidate every other iterator on the object
03:42
<@Tarinaky>
listIterator()
03:42
<@McMartin>
Short answer is "you're doing it wrong" but it's not immediately clear how
03:42
<@Tarinaky>
It's a single threaded program.
03:42
<@McMartin>
Not quite what I mean
03:42
<@Tarinaky>
There's only one iterator anyway.
03:42<~Vornicus> (Expertise alert: McM has a PhD in Doing Spectacularly Untoward Things To The Java Runtime. Yes really.)
03:43
<@Tarinaky>
I just want my code to work :p
03:44
<@McMartin>
Removes from the list the last element that was returned by next or previous (optional operation). This call can only be made once per call to next or previous. It can be made only if ListIterator.add has not been called after the last call to next or previous.
03:44
<@Tarinaky>
I'm aware what the documentation says.
03:44
<@McMartin>
Post the relevant code?
03:45
<@McMartin>
Otherwise, yeah,t here's that and "modifying the list mid-iteration breaks all your iterators, and you aren't allowed to cache them"
03:46
<@Tarinaky>
http://pastebin.com/mJ2HzvZX
03:46
<@Tarinaky>
If I'm not allowed to iterate and update my list what the merry hell am I allowed to do.
03:46
<@McMartin>
You fucked up your for loop initializer.
03:46
<@McMartin>
I think.
03:46
<@McMartin>
No, wait.
03:47
<@Tarinaky>
I copies it out of an example.
03:47
<@Tarinaky>
*copied
03:47
<@McMartin>
Which line throws the exception, 6 or 12?
03:47
<@Tarinaky>
it.remove()
03:47
<@McMartin>
That line appears twice in your code. Which line throws the exception
03:48
<@Tarinaky>
I am unsure if it is one or both due to non-deterministic code.
03:48
<@Tarinaky>
There's a PRNG involved.
03:48
<@McMartin>
Do you have a stack trace?
03:48
<@McMartin>
You should have a stack trace, it's Java
03:48
<@Tarinaky>
It definately does it on the second one.
03:48
<@Tarinaky>
I'm not sure about the first.
03:49
<@Tarinaky>
The stack trace says line 77.
03:49
<@Tarinaky>
Which isn't helpful for you ;)
03:49
<@McMartin>
Is it the first or the second one, then -_-
03:49
<@Tarinaky>
Line 77 is the second one.
03:49
<@Tarinaky>
I'm trying to produce one on the first line as well.
03:49
<@McMartin>
Do check_collision or hunter.think() have access to "hunters"?
03:50
<@McMartin>
The code pasted looks OK, but if check_collision or think() add or remove items from hunters you will get the error you get.
03:50
<@Tarinaky>
They do not.
03:50
<@McMartin>
Then the code as written works. :D
03:50
<@McMartin>
>_>
03:51
<@McMartin>
The one oddity in that code is that you've declared a ListIterator but are only using it like an Iterator.
03:51
<@Tarinaky>
The internet said that was my problem.
03:51
<@Tarinaky>
I started off using an Iterator.
03:51
<@McMartin>
OK, so, I'm several years out of date on Java
03:51
<@Tarinaky>
Evidently not.
03:51
<@Tarinaky>
it didn't fix the problem.
03:51
<@McMartin>
But ListIterator, AFAIK, only adds the ability to backtrack in your iteration.
03:52
<@McMartin>
ConcurrentModificationException is "somebody's dicking with the hunters array"
03:52
<@Tarinaky>
hunter.think() modifies some attributes but doesn't do anything to the list.
03:52
<@McMartin>
"modifies some attributes"?
03:52
<@Tarinaky>
Integers.
03:52
<@McMartin>
As in, changes the values inside Hunter?
03:52<~Vornicus> of hunter
03:52
<@McMartin>
That should be fine, then.
03:53
<@McMartin>
I would put a watch on hunters, or dump the value of hunters at every iteration (with an iterator of my own)
03:53
<@McMartin>
And then catch ConcurrentModificationException and do it *again*, to make sure nothing squirrely's going on.
03:53
<@McMartin>
Because the CME is a very *specific* error.
03:53
<@Tarinaky>
I don't have a decent debugger.
03:53
<@Tarinaky>
It's part of what I hate about Java.
03:53
<@Tarinaky>
jdb is utter wank.
03:54
<@McMartin>
So write to System.err.
03:54
<@McMartin>
Or println to it.
03:54
<@Tarinaky>
I have no idea how to dump the value of a list.
03:54
<@Tarinaky>
+Add air quotes
03:55
<@McMartin>
Iterate through it, like you've been doing, but print the values with System.err.print
03:55
<@McMartin>
Maybe print a "[" at the front and a "]\n" at the end
03:55
<@Tarinaky>
What do you mean by values?
03:56
<@McMartin>
If you don't have a toString() for Hunter, you could, I suppose, use System.identityHashCode(hunter) as such.
03:56
<@McMartin>
You just want something that lets you see if the contents of the list have changed.
03:57
<@McMartin>
I mean
03:57
<@McMartin>
Are you actually clear on why this is useful?
03:58
<@Tarinaky>
Not -really-.
03:58
<@Tarinaky>
I'm doing it anyway though.
03:58
<@McMartin>
OK, so, that's not the way
03:58
<@McMartin>
Let's back up a bit.
03:59
<@McMartin>
You're getting an error that says "this list I'm iterating over was changed by something else"
03:59
<@McMartin>
You're sure this isn't happening
03:59
<@McMartin>
Your reaction appears to be "throw a tantrum"
03:59
<@McMartin>
I'm suggesting a reaction of "verify that this isn't happening"
03:59
<@McMartin>
And one way to do that is by printing out the contents of the list being iterated over, in some form that lets you verify that this is the case.
04:00
<@McMartin>
System.identityHashCode gets you a unique* number that corresponds to a specific object. If you change the fields, the identityHashCode doesn't change even if the hashCode would.
04:00
<@Tarinaky>
Ahah. Just... I can tell you that there's only two isntances of 'remove' in the whole code base >.>
04:00 AD[Shell] [abudhabi@9D46A2.088371.A474A5.6EEC27] has quit [Client closed the connection]
04:00
<@McMartin>
Adding something to the hunters list will *also* trigger a CME.
04:01
<@McMartin>
As will replacing it outright with a different object, but I do not recall offhand if Java rolls like that.
04:01
<@Tarinaky>
Yeah. add(E) is only used on one line...
04:01
<@Tarinaky>
It's not a big code base.
04:02
<@McMartin>
Do you have any fancy output yet or is this just a sim?
04:02
<@McMartin>
Actually, I have to take off for a bit
04:02
<@McMartin>
But if it's small enough that you can post the *whole* code base we can trace through it by hand.
04:03
<@Tarinaky>
I have no idea how to post a bunch of java files.
04:03
<@McMartin>
My guess is "something with reference aliasing is reaming you in one of these routines"
04:03
<@McMartin>
zip them up, host them somewhere?
04:06
<@Tarinaky>
Sure. What's the command for creating an archive again >.<
04:08
<@Tarinaky>
andimiller.net/~tarinaky/exception.zip
04:18
< Alek>
http://pastie.org/2865297
04:19
<@Tarinaky>
Yup.
04:19
<@Tarinaky>
The British census does the same thing with Jedi.
04:20
<@McMartin>
Tarinaky: OK, so, which class was the original pasted code from?
04:21
<@Tarinaky>
PlayingArea.think()
04:21
<@McMartin>
check_collision can modify hunters.
04:22
<@Tarinaky>
How?
04:22
<@McMartin>
Line 47.
04:22
<@Tarinaky>
Oh.
04:22
<@Tarinaky>
Derp.
04:22
<@Tarinaky>
That'll be exactly what's causing the problem.
04:23 * Tarinaky deletes line 47 >.>
04:24
<@Tarinaky>
So we all agree that we didn't see that~
04:26
<@McMartin>
You probably also ought delete line 39 while you're at it
04:26
<@McMartin>
*oughta
04:27
<@Tarinaky>
Yeah.
05:34 ErikMesoy|sleep is now known as ErikMesoy
05:53 * ToxicFrog pokes R with a stick
05:53 * jerith sics Q on ToxicFrog.
06:05 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
06:06 Syloqs_AFH is now known as Syloqs-AFH
06:57 Stalker [Z@2C3C9C.B2A300.F245DE.859909] has quit [Ping timeout: 121 seconds]
07:43 Kindamoody is now known as Kindamoody|out
07:45 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
08:05 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:09 AD[Shell] [abudhabi@9D46A2.088371.A474A5.6EEC27] has joined #code
08:57 You're now known as TheWatcher
09:08 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
09:10 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
09:11 Syloqs_AFH is now known as Syloqs-AFH
09:50 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
10:27 gnolam [quassel@Nightstar-202a5047.priv.bahnhof.se] has joined #code
11:20 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has quit [Ping timeout: 121 seconds]
11:21 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has joined #code
11:21 Attilla [Obsolete@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
11:48
< gnolam>
Hmm. Quassel isn't actually that awful.
11:53
<@TheWatcher>
the IRC client?
11:54
< gnolam>
Yes.
11:55
<@TheWatcher>
Looks weird >.>
11:56
< Lingerance>
It has a nice styling engine :)
12:11 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has quit [Client closed the connection]
12:12 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has joined #code
13:50 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
14:48 kw|G0_PACK is now known as kwsn
15:55 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [Operation timed out]
16:04 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
16:17 * TheWatcher ponders which station to use for the next release of this system (current on is Edgware Road). Might use Aldgate, but suspects that might actually require a double-crossover.
16:19
< ErikMesoy>
I'm not sure if you're playing Mornington Crescent or if the arcane techspeak really has stations named that way.
16:24
<@TheWatcher>
The former; the final release version will be Mornington Crescent. Actually getting there will be an achievement~
16:25
< kwsn>
oh VXWorks,
16:25
< kwsn>
your shell is made of win and awesome at times
16:49 ErikMesoy is now known as Harrower
16:59 EvilDarkLord is now known as Maze
17:35 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has quit [Client exited]
18:50 Harrower [Erik_Mesoy@Nightstar-f7eedefa.80-203-17.nextgentel.com] has quit [Client closed the connection]
19:15 Kindamoody|out is now known as Kindamoody
19:16 Harrower [Erik_Mesoy@Nightstar-f7eedefa.80-203-17.nextgentel.com] has joined #code
19:16
< Harrower>
Man. I just wrote "ecks" for "x" in my maths assignment.
19:20
< gnolam>
http://tcengineering.wordpress.com/2011/11/13/hat-coil/
19:21
< Harrower>
Definitely a really bad idea.
19:25 Kindamoody is now known as Kindamoody[zZz]
19:37 Stalker is now known as NegaScarlet
20:11
< gnolam>
http://insidesearch.blogspot.com/2011/11/search-using-your-terms-verbatim.html <- oh hey, I might actually switch back to Google sometime soon then
20:11
< Harrower>
I liked +.
20:11
< Harrower>
:/
20:12 * gnolam shivs Harrower.
20:12
< Harrower>
What.
20:13
< gnolam>
You liked it?
20:14
< gnolam>
You liked having to type extra goddamned characters for every goddamned word just to make it search for /what you actually wanted/ instead of something irrelevant?
20:15
< kwsn>
gnolam: we all know of your hatred of google
20:15
< Harrower>
It's shorter than "" and the obscurity made it less prone to people with good intentions adding autocorrect for the lusers.
20:15
< kwsn>
give it a rest hun
20:15
< gnolam>
Yeah. It's better than "". But it's still worse than simply not searching for irrelevant shit.
20:16
< Harrower>
I am starkly aware that I am not like most users. I search for obscure search terms and I reliably spell correctly. Considering the number of people that don't, I am fine with a near-public service hinting to common search terms and spelling corrections on the first pass, and giving me literal search *one character* behind.
20:23
< gnolam>
Of course, knowing Google, they'll probably fuck this up somehow.
20:24
< gnolam>
Like not rolling it out on https, or making it some javascript abomination.
20:24
< Harrower>
READEEEEEER! *shakesfist*
20:30 NegaScarlet is now known as Stalker
20:53 Tamber [tamber@furryhelix.co.uk] has quit [Client closed the connection]
20:57 Tamber [tamber@furryhelix.co.uk] has joined #code
20:59 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
21:01 Harrower is now known as ErikMesoy
21:02 Maze is now known as EvilDarkLord
21:05 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
21:06 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
21:06 Syloqs_AFH is now known as Syloqs-AFH
21:11
< gnolam>
And continuing today's spamming, https://www.youtube.com/watch?v=JENdgiAPD6c <- quite interesting and well-presented talk on email... and why it's broken.
21:53 Stalker [Z@2C3C9C.B2A300.F245DE.859909] has joined #code
21:59 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
22:04
< ToxicFrog>
ErikMesoy: the problem arises because there is no way to turn that behaviour off.
22:05
< ToxicFrog>
Or the behaviour where it wraps each link in something that redirects through Google's servers.
22:05
< ToxicFrog>
Or the behaviour where it erases itself from your browser history.
22:17 ErikMesoy is now known as ErikMesoy|sleep
23:01
<@McMartin>
ToxicFrog: So, Google Verbatim was apparently just announced, at least on my twitter feed. Looking for confirmation
23:01
<@McMartin>
http://www.webpronews.com/google-verbatim-search-launched-2011-11 looks vaguely legit
23:24
< ToxicFrog>
Yeah, and that should fix issue #1, although I maintain that it should be a flag in user settings rather than a different search interface entirely.
23:32
< celticminstrel>
Google Verbatim?
23:39
< AD[Shell]>
How do I enable it? I don't see the requisite link in the google sidebar.
23:42
<@McMartin>
I don't think it's finished rolling out yet
23:42
< gnolam>
[21:11:07] <gnolam> http://insidesearch.blogspot.com/2011/11/search-using-your-terms-verbatim.html <- oh hey, I might actually switch back to Google sometime soon then
23:46
< AD[Shell]>
I'd better keep it in mind, then.
23:47 * AD[Shell] is somewhat pissed at Google for neutering Google Reader.
23:47 * AD[Shell] was actually using the sharing features of that, you boobs! I don't want to use Google+, you morons!
23:48
<@McMartin>
You are insufficiently profitable to them without it.
23:49
< AD[Shell]>
Obviously.
23:49
< AD[Shell]>
Well, they have failed to make me more profitable.
--- Log closed Wed Nov 16 00:00:47 2011
code logs -> 2011 -> Tue, 15 Nov 2011< code.20111114.log - code.20111116.log >

[ Latest log file ]