code logs -> 2008 -> Fri, 29 Feb 2008< code.20080228.log - code.20080301.log >
--- Log opened Fri Feb 29 00:00:35 2008
00:10 Brother_Willibald [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code
00:11 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Ping Timeout]
00:13 Serah [~Z@87.72.35.ns-26506] has quit [Connection reset by peer]
00:13 Serah [~Z@87.72.35.ns-26506] has joined #Code
00:31 GeekSoldier|pub [~Rob@Nightstar-10414.dip.t-dialin.net] has joined #code
00:31 GeekSoldier|pub is now known as GeekSoldier|slightlyDrunk
00:34 Reltzik [Reltzik@Nightstar-15817.dsl.pltn13.sbcglobal.net] has joined #code
00:41 GeekSoldier|slightlyDrunk is now known as GeekSoldier
00:49 Brother_Willibald is now known as gnolam
00:56 GeekSoldier [~Rob@Nightstar-10414.dip.t-dialin.net] has quit [Ping Timeout]
00:57 GeekSoldier [~Rob@91.18.119.ns-4537] has joined #code
01:04 GeekSoldier is now known as GeekSoldier|bed
01:11 C_tiger [~c_wyz@96.232.26.ns-11798] has quit [Quit: And away she goes!]
01:15 C_tiger [~c_wyz@96.232.26.ns-11798] has joined #code
01:46 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?]
--- Log closed Fri Feb 29 02:21:24 2008
--- Log opened Fri Feb 29 02:21:57 2008
02:21 TheWatcher[zZzZ] [~chris@82.71.33.ns-26612] has joined #code
02:21 Irssi: #code: Total of 18 nicks [11 ops, 0 halfops, 0 voices, 7 normal]
02:21 mode/#code [+o TheWatcher[zZzZ]] by ChanServ
02:22 Irssi: Join to #code was synced in 44 secs
02:26 * McMartin APIdives the Javadocs.
02:27
<@McMartin>
It's a little unfortunate that Really Doing This Right would take a lot of work, but I suspect I can at least get basic effects...
02:27 * McMartin can just blame Sun for some of it - fortunately, GTK+ users aren't quite as rabid as Apple users.
02:27 * Reltzik ponders programming a class-tester type thing. Anyone knows if one already exists? Probably does.
02:28
<@McMartin>
JUnit is the traditional set of applications for doing this.
02:28
<@McMartin>
Eclipse has a plugin for it
02:29
< Reltzik>
Oh, hey, I should have finished downloading that by now...
02:29
<@McMartin>
That said, if it's class level and these aren't main programs, an easy way to do tests is to put the test routines in public static void main.
02:29
<@McMartin>
And then you run a class to test it.
02:29
<@McMartin>
JUnit you'll need tutorials for; it's essentially a set of classes you extend to put all your unit tests in one place
02:31 * Reltzik plays around with Eclipse.
02:38
< Reltzik>
Eclipse have anything to help with GUI implementation specificly?
02:39
<@McMartin>
I don't know if there's an official one.
02:39
<@McMartin>
I've been doing my Swing development "by hand".
02:39
<@McMartin>
But I wouldn't be surprised if there were such a thing.
02:40 * Reltzik doesn't much like counting pixels left, right, up, and down before coding in the location of such-and-such item, and then doing that over and over and over again until he gets it right.
02:40
< Reltzik>
..... lemme guess, there's an easier way.
02:40
<@McMartin>
Uh
02:41
<@McMartin>
Well, there's a different way
02:41
<@McMartin>
It is, at best, up for grabs whether or not it is easier.
02:41
<@McMartin>
Java hand-coded GUIs tend to rely on semi-automated layout managers that are also royal pains in the ass.
02:41
<@McMartin>
I'm getting around this by only using three widgets. =P
02:42
< Reltzik>
.......
02:42
<@McMartin>
http://www.stanford.edu/~mcmartin/misc/blorple-4.png
02:42 * Reltzik ponders coding a layout manager.
02:42
<@McMartin>
No, you don't code the layout manager.
02:42
< Reltzik>
No?
02:42
<@McMartin>
You use one of the seven or eight standard ones.
02:42
<@McMartin>
And feed it widgets that it then lays out.
02:43
<@McMartin>
Possibly even in some semblance of the layout you wanted, but this is kind of iffy.
02:43
<@McMartin>
Let me find some documentation that's actually readable.
02:43
<@McMartin>
But absolute layout is a royal pain becausey ou have to properly handle window-resize.
02:43
<@McMartin>
(The linked pic is of a BorderLayout being severely abused.)
02:44
<@McMartin>
By loading it with a JSplitPane that itself has a JSplitPane at the bottom, and all three subcomponents using their own BorderLayouts, each of which carries one widget at Center.
02:45
< Reltzik>
..... wow. Just reading those last two lines brings SO MUCH back...
02:45
<@McMartin>
Yeah.
02:46
<@McMartin>
So, most of the incredible ugliness of java.awt.* has been pushed away.
02:46
<@McMartin>
java.awt's layouts still live, as does its event model
02:46
<@McMartin>
But its event model has been plugged into a publish-subscribe model *very similar* to what you want with your character sheets.
02:48
<@McMartin>
=/
02:48
<@McMartin>
The official tutorial is useless
02:48 * Reltzik was just looking at the Swing tutorial.
02:48
<@McMartin>
http://java.sun.com/docs/books/tutorial/uiswing/index.html looks better
02:49
< Reltzik>
That's what I'm browsing now.
02:49
<@McMartin>
The other Swing tutorial is just "OMG LOOKA T ALL THESE SCREENSHOTS!!!11!!"
02:49
<@McMartin>
Yeah, that looks like a start.
02:49 * McMartin learned from the O'Reilly book, but he isn't at all sure he can recommend it.
02:49
< Reltzik>
Why didn't I learn this before? I had a "learn enough to pass the test, then forget" mentality.
02:49
<@McMartin>
... my mouse wheel broke.
02:49
< Reltzik>
.....
02:49 * Reltzik does NOT want to know how McM overstressed it.
02:49
<@McMartin>
... Swing was introduced in Java 1.3. How old is your knowledge?
02:49 * Vornicus has the O'Reilly book, and failed miserably.
02:50
<@McMartin>
It's a dinky little pocket mouse for the laptop.
02:50
< Reltzik>
1.4, I think, but it was never that good.
02:50
<@McMartin>
Yeah
02:50
<@McMartin>
So, that was when Swing was Brand New and Not Experimental Anymore
02:50
<@McMartin>
And before that, it was java.awt
02:50
<@McMartin>
Which basically had DO NOT USE THIS YOU FOOLS stamped all over it.
02:50
<@McMartin>
That, and I was using my mouse wheel to scroll through documentation
02:50 * Vornicus couldn't get any layouts to work. All the buttons sat on top of each other despite all the boundary stuff I put in.
02:50
< Reltzik>
And lots of people depricating it.
02:51
<@McMartin>
Vorn: Yeah, so, in Blorple, each component has its own pane~
02:51
<@McMartin>
This probably isn't the Generally Recommended Approach, but it's appropriate for this app.
02:52
<@McMartin>
By which I mean mine.
02:52
<@McMartin>
You'll be wanting multiple edit fields per unit, at least.
02:52
< Reltzik>
I'm playing with the notion of letting the user customize layout. Won't decide until I get some notion of just how freaking impossible that is.
02:52
<@McMartin>
Some of it's actually automatic.
02:52
<@McMartin>
Other bits -- you may be better off with some kind of MDI.
02:53
<@McMartin>
That's... JDesktop, IIRC.
02:53
<@McMartin>
Don't Start There.
02:54 * McMartin is currently setting up the UI hooks to be able to resort the game list by clicking on column headers.
02:54
<@McMartin>
However, reorganizing columns by dragging them is automatic.
02:54 * McMartin would almost have preferred turning that off, but he's leaving it in and just being more flexible.
02:55
< Reltzik>
...... and I think the user NEEDS to be able to customize the layout, if I'm going to be including suppliments and whatnot. *I* certainly don't want to make a new layout for each possible combination of suppliments.
02:55
<@McMartin>
Well
02:55
<@McMartin>
If the relevant stuff is just shoved into scrollable lists, You Win.
02:56
<@McMartin>
Or generic tables.
02:56
<@McMartin>
My app is basically a Table with a bunch of previewing stuff that reacts to changes in it.
02:56 * Reltzik COULD shove it into expandable/minimizable lists...
02:56
<@McMartin>
JTree.
02:56
<@McMartin>
Will automatically handle epansion/minimize, lets you write out path expressions, etc.
02:56
<@McMartin>
But
02:56
<@McMartin>
That's view.
02:56
<@McMartin>
Get the model *first*
02:57
< Reltzik>
Might work. The intended users would scream bloody murder, though, if I left it at that.
02:57
< Reltzik>
Model?
02:57
< Reltzik>
Clarify, please? I'm thinking 3 or 4 different things when you say that.
02:57
<@McMartin>
The part of your program that is the UI should not contain any applicatation-critical information in it.
02:57
<@McMartin>
All of that should be in its own separate set of classes.
02:57
<@McMartin>
The "Model" is the data you're processing
02:58
<@McMartin>
The "View" is what the user sees; the interface to the model.
02:58
<@McMartin>
The "Controller" is the code that translates user actions into manipulations of the model, and translates changes in the model so that they may be reflected in the view.
02:58
< Reltzik>
Okay, yeah. Problem is, model can change at run-time.
02:58
<@McMartin>
Then you're defining the model too tightly.
02:58
<@McMartin>
The model is everything that is the computation.
02:59
<@McMartin>
Including the commands that change what it is.
02:59
< Reltzik>
Okay, then.
02:59
<@McMartin>
Basically, if you were to take your application code, and then change it so that it was actually being served as CGI instead...
02:59
<@McMartin>
the Model is the part of code that you wouldn't have to change.
02:59
<@McMartin>
This should be most of it.
03:01
< Reltzik>
So in that case, my model is a bunch of stats. The controller is.... sort of a queue of IO-events waiting for control of the model. And the view would be what sends, receives, and interprets those I/O events?
03:01 * Reltzik doesn't think that sounds right.
03:02
<@McMartin>
Your list of "controller" and "view" comprises the controller.
03:02
<@McMartin>
Though large chunks of that are basically handled by the OS and the Java runtime.
03:02
<@McMartin>
The view is the code that draws the windows, is the buttons and text fields and whatnot.
03:03
< Reltzik>
Okay, and those are coupled to the controller through the various events?
03:03
<@McMartin>
Right.
03:03
< Reltzik>
Okay then.
03:03
<@McMartin>
The OS turns raw I/O into Events.
03:03
<@McMartin>
The controller throws these events at the appropriate View classes.
03:03
<@McMartin>
In Swing, most of that is automated.
03:04
< Reltzik>
((Throw in a generic sense, not the java-specific sense.))
03:04
<@McMartin>
Yeah.
03:04
<@McMartin>
You write, say, a class that extends ActionListener
03:04
<@McMartin>
And it implements a method actionPerformed
03:04
< Reltzik>
Now THAT looks familiar.
03:04
<@McMartin>
You can then take a JButton, and call addActionListener with an instance of that class.
03:04
<@McMartin>
You can then take the same class, and have it listen to a JMenuItem
03:04
< Reltzik>
And usually you make those listeners inner-classes, IIRC.
03:05
<@McMartin>
And then that menu option and that button are the same thing
03:05
<@McMartin>
Yeah
03:05
<@McMartin>
I definitely tend to.
03:05
<@McMartin>
I've found myself needing to kick out to MouseAdapters instead for a lot of my stuff, but that's unlikely to be needed for you.
03:05
< Reltzik>
Yeah, this is all sounding VERY familiar.
03:05
<@McMartin>
OK
03:05
<@McMartin>
Sounds like you had some level of formal Swing training, then.
03:05
<@McMartin>
I didn't.
03:06
<@McMartin>
So then
03:06
<@McMartin>
View: Stuff that extends or contains classes in javax.swing
03:06
<@McMartin>
Controller: Stuff that extends classes in java.awt.event
03:06
<@McMartin>
Model: Everything else, which should be all the Important Application Code
03:06
< Reltzik>
Okay!
03:07
<@McMartin>
Keep the actual computation out of the listeners, keep the important data out of the Swing classes, basically.
03:07
<@McMartin>
That way your unit tests can just start faking user operations by making method calls.
03:07
< Reltzik>
Oh, yeah, definitely.
03:07
<@McMartin>
Blorple is really bad about this at present and I need to fix that
03:07
<@Vornicus>
...Wow that's a mess.
03:07 * Reltzik knows next to nothing about testing, short of "use it and try to break it".
03:07
<@McMartin>
But first I need to work out how to actually make my desired gestures work, so the View is the hard bit for me.
03:08
<@McMartin>
Vorn: What in particular?
03:08 * Reltzik is actually pretty good at "use it and try to break it", but.
03:08 * Vornicus writes code to generate stars in the integer model. Lots of little maintenance tasks.
03:08
<@McMartin>
Relt: Yeah. A good heuristic is to look at your if statements and switches and get a set of inputs that will at least hit every branch of code that isn't a Can't Happen.
03:09
<@McMartin>
Code coverage isn't a very good metric, but it's easy to measure and unlike path coverage, it doesn't have exponential blowup
03:10
<@McMartin>
You should certainly at least provide input that should trigger every failure mode you look for, and insist on the appropriate error code being returned/exception being thrown.
03:10
<@Vornicus>
valid_locations = filter(lambda k: k not in banned_locations and min(len(stars), STAR_CONNECTIVITY_MINIMUM) <= len(location_density[k]) <= STAR_CONNECTIVITY_MAXIMUM, location_density.iterkeys())
03:10
< Reltzik>
Failure mode as in, you want the user to give you a non-empty string, and you get an empty one instead?
03:11
<@McMartin>
Right.
03:11
<@McMartin>
So you'd do a test like this
03:11
<@McMartin>
try P
03:11
<@McMartin>
Er
03:11
<@McMartin>
try {
03:11
<@McMartin>
doSoemthing(""); fail();
03:11
<@McMartin>
} catch (IllegalArgumentException _) { succeed(); }
03:12
<@McMartin>
I forget how precisely JUnit marks failure and success, but fail() and succeed() may be considered replacements for that
03:12
<@McMartin>
woot, column clicking now works in the presence of draggable columns.
03:12 * McMartin commits changes, goes to dinner
03:12
< Reltzik>
....... why the hell does "commit changes" look like "commit suicide"?
03:12
<@Vornicus>
http://rafb.net/p/XavNi261.html <--- the full function.
03:13 * Reltzik is python illiterate, tries to figure it out anyway.
03:13
<@McMartin>
OK
03:14
<@McMartin>
I can't go any further without breaking out the model and view
03:14
<@McMartin>
Right now it's all living in BlorpleFrame.
03:14
<@Vornicus>
IntegerVector is a class that's badly named. The main trick it has is a disc_around method, which returns a pile of items that are within a certain number of units of the vector.
03:15
<@Vornicus>
{key1: value1, key2: value2} is a dictionary; you can talk to it vaguely like an array: d[key1] -> value1
03:17
<@Vornicus>
dict() also creates a dictionary.
03:18
<@Vornicus>
filter is a thing that given a function and an iterable (like the return value of dict.iterkeys()) will produce a list of all things in that iterable that return true when passed to hte function
03:18
<@Vornicus>
lambda creates an anonymous function that all it does is return the result of its expression.
03:20
< Reltzik>
Opinions on Net Beans?
03:20
<@Vornicus>
Most of the rest of the stuff is pretty clear, I think
03:20 * Vornicus has never used Beans, but has heard that it's a hell of a lot of boilerplate.
03:21
< Reltzik>
..... that's a bad thing, right?
03:21
<@Vornicus>
Generally.
03:22
<@Vornicus>
Well, pretty clear as to what it's trying to do. The code is a horrible awful mess.
03:28
<@McMartin>
NetBeans is an IDE.
03:28
<@McMartin>
I've never used it.
03:29
<@McMartin>
Enterprise JavaBeans are a horrendously bad approach to web application servers that even Sun has disavowed.
03:29
<@McMartin>
Beans with no extra buzzwords in a Java context is a standard for naming your accessor methods.
03:30
< Reltzik>
Yet there Swing tutorial still seems to.... oh, okay, it's just the one section.
03:30
<@McMartin>
In short, the getter and setter for a String field named foo should be getFoo() and setFoo().
03:30
<@McMartin>
And the Swing Tutorial refers to NetBeans, the IDE.
03:30
<@McMartin>
Which has an interface builder in it, it looks like. I've never used it, don't know what it's like.
03:30
< Reltzik>
So, Use At Own Risk.
03:30
<@McMartin>
Well, it's Official(tm)
03:30 * Reltzik might go with it in the future, wants to learn how to do it himself for now.
03:31
<@McMartin>
Sounds good
03:31
<@McMartin>
Also, let me know how it turns out, etc.
03:31
< Reltzik>
If I ever use it, sure.
05:06 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Operation timed out]
05:06 Reltzik2 [Reltzik@Nightstar-15817.dsl.pltn13.sbcglobal.net] has joined #code
05:06 Reltzik [Reltzik@Nightstar-15817.dsl.pltn13.sbcglobal.net] has quit [Killed (NickServ (GHOST command used by Reltzik2))]
05:07 Reltzik2 is now known as Reltzik
05:07 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
05:07 mode/#code [+o ToxicFrog] by ChanServ
05:07 McMartin [~mcmartin@Nightstar-9474.dsl.pltn13.sbcglobal.net] has quit [Operation timed out]
05:09 Netsplit Troika.TX.US.Nightstar.Net <-> DeepThought.NY.US.Nightstar.Net quits: @MyCatVerbs, Reltzik, C_tiger, Julia, Attilla, Serah, @ToxicFrog
05:09 GeekSoldier|bed is now known as GeekSoldier
05:10 Netsplit over, joins: MyCatVerbs, Julia, Serah, C_tiger, ToxicFrog
05:10 McMartin [~mcmartin@Nightstar-9474.dsl.pltn13.sbcglobal.net] has joined #code
05:10 mode/#code [+o Chalain] by ChanServ
05:10 mode/#code [+o jerith] by ChanServ
05:10 mode/#code [+o Pi] by ChanServ
05:10 mode/#code [+o Reiver] by ChanServ
05:10 mode/#code [+o Chalcedon] by ChanServ
05:10 mode/#code [+o Vornicus] by ChanServ
05:10 mode/#code [+o TheWatcher[zZzZ]] by ChanServ
05:10 mode/#code [-o Raif] by ChanServ
05:10 mode/#code [-o EvilDarkLord] by ChanServ
05:11 Reltzik [Reltzik@76.252.223.ns-21976] has joined #code
05:12 Attilla [~The.Attil@194.72.70.ns-11849] has joined #code
05:21 AnnoDomini [AnnoDomini@83.21.7.ns-21068] has joined #Code
05:21 mode/#code [+o AnnoDomini] by ChanServ
05:57 Goddess [Jennet@Nightstar-20631.216-254-250.iw.net] has joined #code
05:57 GeekSoldier [~Rob@91.18.119.ns-4537] has quit [Ping Timeout]
05:57 Julia [Jennet@Nightstar-20631.216-254-250.iw.net] has quit [Ping Timeout]
05:58 jerith [~jerith@IRCop.Nightstar.Net] has quit [Quit: reboot]
06:01 GeekSoldier [~Rob@Nightstar-7625.dip.t-dialin.net] has joined #code
06:05 jerith [~jerith@67.18.198.ns-4695] has joined #code
06:37
< GeekSoldier>
quick Java SWT question: how can I get a floating point number from a textbox, or is there another widget for numbers?
06:40 mode/#code [+v ToxicFrog] by ToxicFrog
06:40
<+ToxicFrog>
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Float.html#parseFloat(java.lan g.String)
06:41
<+ToxicFrog>
So, something like: float f = Float.parseFloat(the_text_box.getContents()); /* or however you get the contents of the textbox as a String */
06:45
< GeekSoldier>
ohh. I was trying it backwards. Thanks, TF!
06:48 Vornicus is now known as Vornicus-Latens
07:16 Reltzik [Reltzik@76.252.223.ns-21976] has quit [Quit: DEATH TO THE UNDEAD!]
07:36 Netsplit Troika.TX.US.Nightstar.Net <-> DeepThought.NY.US.Nightstar.Net quits: MyCatVerbs, C_tiger, Attilla, GeekSoldier, McMartin, Serah, Goddess, +ToxicFrog
--- Log opened Fri Feb 29 08:58:00 2008
--- Log opened Fri Feb 29 09:05:00 2008
09:40 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code
09:40 mode/#code [+o gnolam] by ChanServ
10:19 McMartin [~mcmartin@Nightstar-9474.dsl.pltn13.sbcglobal.net] has joined #code
10:19 mode/#code [+o McMartin] by ChanServ
10:34 Attilla [~The.Attil@194.72.70.ns-11849] has quit [Quit: <Insert Humorous and/or serious exit message here>]
11:21 Chalain [~chalain@Admin.Nightstar.Net] has joined #Code
11:21 mode/#code [+o Chalain] by ChanServ
11:21 EvilDarkLord [~jjlehto3@130.233.228.ns-13022] has joined #Code
11:21 Pi [~sysop@76.104.130.ns-21570] has joined #Code
11:21 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
11:21 mode/#code [+o Pi] by ChanServ
11:21 Vornicus-Latens [~vorn@Admin.Nightstar.Net] has joined #Code
11:21 AnnoDomini [AnnoDomini@83.21.7.ns-21068] has joined #Code
11:21 jerith [~jerith@IRCop.Nightstar.Net] has joined #Code
11:21 mode/#code [+o Reiver] by ChanServ
11:21 mode/#code [+o AnnoDomini] by ChanServ
11:21 Attilla [~The.Attil@194.72.70.ns-11849] has joined #Code
11:21 ServerMode/#code [+o Vornicus-Latens] by Troika.TX.US.Nightstar.Net
11:21 mode/#code [+o jerith] by ChanServ
11:21 mode/#code [-o Vornicus-Latens] by ChanServ
11:49 GeekSoldier [~Rob@Nightstar-7625.dip.t-dialin.net] has quit [Ping Timeout]
11:49 GeekSoldier [~Rob@Nightstar-8831.dip.t-dialin.net] has joined #code
11:59 Vornicus-Latens [~vorn@Admin.Nightstar.Net] has quit [Ping Timeout]
12:49 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
12:56 Reiv [~reaverta@Admin.Nightstar.Net] has joined #Code
13:04 AnnoDomini [AnnoDomini@83.21.7.ns-21068] has quit [Ping Timeout]
13:11 AnnoDomini [AnnoDomini@83.21.47.ns-4083] has joined #Code
13:11 mode/#code [+o AnnoDomini] by ChanServ
14:12 Serah [~Z@87.72.35.ns-26506] has joined #Code
16:44 Vornucopia [~vorn@Admin.Nightstar.Net] has joined #code
16:48 Vornucopia is now known as Vornicus
17:11 You're now known as TheWatcher[afk]
17:33 GeekSoldier [~Rob@Nightstar-8831.dip.t-dialin.net] has quit [Ping Timeout]
17:33 GeekSoldier_ [~Rob@Nightstar-10230.dip.t-dialin.net] has joined #code
17:38 GeekSoldier_ is now known as GeekSoldier
17:45
<@McMartin>
Do Mac applications keep per-user information in ~/.$APPNAME, as per POSIX-like systems?
17:45
<@jerith>
Dunno. Never looked.
17:46
<@jerith>
Doesn't appear so.
17:46
<@McMartin>
There are a bunch of them in my own ~ on my MacBook, but they're largely in Unix-like apps
17:46
<@McMartin>
(.Xcode, .macports, .ssh, .subversion, .uqm...)
18:16
< Vornicus>
~/Library/Application Support
18:17 * Vornicus /eyes/
18:17
< Vornicus>
That's nowhere near the performance I expected.
18:17
<@McMartin>
Vorn: ... for per-user information?
18:18
<@McMartin>
Oh, ~/
18:18
<@McMartin>
Right.
18:18 * Vornicus watches his program come to a screeching halt because the processing required for his integer thing is about a second per star...
18:19
< GeekSoldier>
yikes.
18:19
< Vornicus>
oops, now it's about 3 seconds per star, at 30 stars.
18:19
<@McMartin>
Oddly, I have a ~/.Xcode and a ~/Library/Application Suport/Xcode.
18:19
<@McMartin>
Vorn: You aren't reblitting the circle all n^2 times each time you consider a candidate, are you?
18:20
< Vornicus>
Candidates are chosen by random.choice - I blit three circles per candidate, and all candidates are guaranteed to be correct.
18:20
< Vornicus>
guaranteed to be valid.
18:21
<@McMartin>
Hum
18:21
<@McMartin>
Profile
18:22
< Vornicus>
I'm pretty sure the main problem is that the filtering is taking n^2 time instead of n time. I need to rejigger so it uses sets instead of lists.
18:22
< Vornicus>
Which sucks, because I keep having to bounce back and forth between sets and lists because random doesn't understand sets.
18:22
<@McMartin>
Boo
18:22
<@McMartin>
Can you use fake-sets?
18:22
<@McMartin>
And then feed random the keys?
18:23
< Vornicus>
My problem is that the current thing goes valid_locations = filter(lambda k: k not in banned_locations... , location_density)
18:24
< Vornicus>
And so it's checking n^2 where a proper set difference would be I think n
18:26
<@McMartin>
Nog
18:33 You're now known as TheWatcher
18:34
< Vornicus>
...let's see. I'm rejecting 2/3 of mapped locations by connectivity failures.
18:35
< Vornicus>
I don't know how many of those are due to saturation.
18:35
< Vornicus>
As opposed to there not being enough.
18:39 * Vornicus fiddles.
18:39
<@McMartin>
Rargh
18:39
<@McMartin>
Foolish TextEdit
18:40
< Vornicus>
...on the other hand, it /does/ tell me when it fails.
18:46
< Vornicus>
What did it do this time?
18:46
<@McMartin>
I am just reminded of its inability to save as text.
18:47
< Vornicus>
uh
18:47
< Vornicus>
it... does?
18:47
<@McMartin>
Really?
18:47
<@McMartin>
The closest I seem to be able to get it to text is RTF.
18:47
< Vornicus>
Format -> Make Plain Text
18:48
<@McMartin>
Aha
18:48
< Vornicus>
also, if you want it to default to plain text: Preferences -> New Document -> Format -> Plain Text
18:48
<@McMartin>
I still dock points for this.
18:48
< Vornicus>
yes, that's kinda lame.
18:48
<@McMartin>
Since when I have a pick of formats, this should include all available formats.
18:56 * Vornicus fiddles. Doesn't think he'll be able to improve the performance enough to get it to work.
19:17
< Vornicus>
Yeah, this is a dead end. The reliability improvements do not even begin to make up for the speed drain.
19:21 * Vornicus wonders if there's another way to check for failures.
19:23
< Vornicus>
...well, the most common would be when all existing stars are saturated, and the others don't intersect outside of saturated areas.
21:18 GeekSoldier is now known as GeekSoldier|bed
21:53 GeekSoldier|bed [~Rob@Nightstar-10230.dip.t-dialin.net] has quit [Ping Timeout]
21:55 GeekSoldier|bed [~Rob@91.18.126.ns-12084] has joined #code
22:09 Chalcedon [~Chalcedon@Nightstar-10679.ue.woosh.co.nz] has joined #code
22:09 mode/#code [+o Chalcedon] by ChanServ
22:23 GeekSoldier|bed [~Rob@91.18.126.ns-12084] has quit [Ping Timeout]
23:49 GeekSoldier|bed [~Rob@91.18.99.ns-4994] has joined #code
--- Log closed Sat Mar 01 00:00:40 2008
code logs -> 2008 -> Fri, 29 Feb 2008< code.20080228.log - code.20080301.log >