code logs -> 2008 -> Sun, 17 Feb 2008< code.20080216.log - code.20080218.log >
--- Log opened Sun Feb 17 00:00:10 2008
--- Day changed Sun Feb 17 2008
00:00
< Vornicus>
Relt, I think you're going into Mad Science land again.
00:00
< Reltzik>
BWAHAHAHAHA!
00:00
< Reltzik>
.... or is the mad scientist laugh MWAHAHAHAHA? I always get those two mixed up......
00:01
<@AnnoDomini>
I prefer the Laharl laugh.
00:01
<@AnnoDomini>
Haaaaahahahaha!
00:02
< Jeff>
I thought Laharl started with an a.
00:03
< Reltzik>
Vorn: I'm not into Mad Science land until I make my design depenent upon implementing a strong AI.
00:04
< Reltzik>
And I refuse to do that for anything save a common kitchen appliance, such as a toaster.
00:07
< Reltzik>
(I maintain that a strong AI can't be merely implemented. It must be grown, and even bread.)
00:08 * Vornicus wants an RSS toaster.
00:37 GeekSoldier|gone [~Rob@91.18.111.ns-3163] has joined #code
00:38 GeekSoldier|gone is now known as GeekSoldier|bed
00:45 AnnoDomini [AnnoDomini@83.21.50.ns-4024] has quit [Quit: The purpose of writing is to inflate weak ideas, obscure poor reasoning, and inhibit clarity.]
00:53
<@McMartin>
Hmm
00:53
<@McMartin>
Once again I am struck by the General Unpleasantness of GUI Programming.
00:54
<@McMartin>
Though in this case I'm going to have to do low-level input hacking.
00:54
<@McMartin>
This should arguably be in the library to begin with, but the fact that I can do low-level input hacking without having to do any subclassing jackassery is nice.
00:58 You're now known as TheWatcher
01:16
< Reltzik>
If it's General Unpleasantness, what does the I stand for?
01:16 William__ [~JPL@Nightstar-764.dsl.sndg02.pacbell.net] has joined #code
01:16
<@McMartin>
......
01:16
<@McMartin>
[javac] /Users/michaelmartin/Development/blorple/src/java/net/sf/blorple/gui/BlorpleFram e.java:57: illegal character: \8224
01:16
<@McMartin>
[javac] public void mouseClicked(MouseEvent e) {
01:16
<@McMartin>
[javac]
01:16
<@McMartin>
Pointing at the {
01:16 Jeff [~JPL@Nightstar-764.dsl.sndg02.pacbell.net] has quit [Ping Timeout]
01:18 * McMartin turns on Invisible Characters, determines that the flaw is actually in some whitespace he copied from the Javadocs.
01:18
< Reltzik>
See, if that was C(original, ++, or other), I might think that you'd gone and try to define (rather than just declare) the mouseclicked function within a scope.
01:18
<@McMartin>
Reltzik: I did. That isn't the error. Java permits this.
01:18
< Reltzik>
That explains it.
01:18
<@McMartin>
In fact, I'm defining the function inside a class definition as an argument to a function invocation.
01:18
<@McMartin>
It's not quite a Lambda Expression, but 'tis enough, 'twill serve
01:19
< Reltzik>
Yeah, but that was my first instinct, before reminding myself that java's different.
01:19
<@McMartin>
It's the \8224 "illegal character" that's baffling.
01:19
<@McMartin>
{ has a code under \80, after all =P
01:20
<@McMartin>
Aha, TextWrangler has a "Zap Gremlins" button for exactly this situation.
01:21 * Vornicus was about to point that out.
01:27
<@McMartin>
All right. Double-clicks and ENTER now work the way I want.
01:29
<@McMartin>
There totally should be a rowSelected() event-handler method in JTable by default, but life is, as they say, hard.
01:30
<@McMartin>
(And ENTER apparently means "edit this cell" by default to too many widget kits anyway *glares at Zoom*)
01:30
<@McMartin>
(Zoom keeps thinking I want to edit the title of a game whenever I launch it)
01:31
<@McMartin>
> PITY FOOLS
01:35
< Vornicus>
Heh
01:38
<@McMartin>
(from my sample game SCIENCE)
01:38
<@McMartin>
http://www.stanford.edu/~mcmartin/if/science/source.html
01:40
<@McMartin>
Reltzik: You were asking about defeasible logic systems before (albeit not by that name): this is a language that does it.
01:40
<@McMartin>
Observe how "check pitying" is overridden by the "Instead of pitying the fools" rule.
01:41
<@McMartin>
The ML family of languages has a similar construct, in which function dispatch is handled via a pattern-match on the arguments. Haskell borrowed it in its design and extended it some.
01:42
<@McMartin>
OCaml is probably the fastest and most compact of these if you're looking for something that's running at production-code speed; any other ML implementation or any Haskell implementation will work fine for prototypes.
01:42
<@McMartin>
OCaml's syntax for it is way uglier though.
01:43
< Reltzik>
Thanks! *goes to check up on all of that*
01:43
<@McMartin>
Here's factorial in OCaml:
01:43
<@McMartin>
let rec factorial x = match x with
01:43
<@McMartin>
1 -> 1
01:44
<@McMartin>
| n -> n * factorial (n - 1);;
01:44
<@McMartin>
With the ML/Haskell approach you do have to group them together, because it's basically secretly a switch/multiple-dispatch-vtable.
01:48
< Reltzik>
*reading the Science program* Oh, and in case I've never said it before, you have a warped mind.
01:48
< Reltzik>
((This is meant as praise.))
01:48
<@McMartin>
It's a horrible pun based on both Mad Science and standard text adventure semantics.
01:48
<@McMartin>
If you actually run the game, it goes...
01:48
<@McMartin>
> SHOW THEM ALL
01:48
<@McMartin>
Kitten: shown.
01:48
<@McMartin>
Dynamo laser: shown.
01:48
<@McMartin>
.....
01:48
<@McMartin>
Magnetized iron filings: shown.
01:49
<@McMartin>
(If you weren't around for it, I actually do have a complete, full-scale adventure game written in this, based on my old webcomic)
01:49
<@McMartin>
More Swing madness, in which I pretend that Java is Lisp: http://blorple.svn.sourceforge.net/viewvc/blorple/src/java/net/sf/blorple/gui/Bl orpleFrame.java?revision=32&view=markup
01:50
<@McMartin>
In particular, lines 51 through 72.
02:02
< Vornicus>
McM: madness
02:03
<@McMartin>
Actually, I can't complain, since this is About Right for setting such a thing up
02:03
<@McMartin>
And in fact means that you can hook stuff into a GUI without top-level control. You'll notice I'm never subclassing anything from the GUI library.
02:03
<@McMartin>
Since I despise inheritance, this actually makes me Very Happy
02:04
< William__>
McMartin- why do you hate inheritance? I'm curious.
02:05
<@McMartin>
William__: My architecture instincts tend more towards composition and views than inheritance.
02:05
<@McMartin>
Inheritance always struck me as a way to safely do casts that Should Never Be, and the insanely deep inheritance trees that a lot of frameworks produce as a result give me hives.
02:05 William__ is now known as Jeff
02:05 * McMartin tends to think that if your inheritance tree is more than three or four deep, You're Doing It Wrong.
02:05
< Jeff>
Sorry for the name issue.
02:06
< Jeff>
Also, McMartin- the rec you gave isn't tail recursive.
02:06
<@McMartin>
Indeed it was not, as I felt no need to complicate the definition.
02:06
< Jeff>
You want let rec factorial x curr match x with 1 -> curr | n -> ... alright, fine.
02:07
<@McMartin>
And no, you don't want that, you want let factorial x = let rec aux y curr match y with 1 -> curr | _ -> aux (y-1) (y*curr) in aux x 1;;
02:07
<@McMartin>
No sense in exposing your internal variables.
02:09
<@McMartin>
(My objection to inheritance is more that I feel it should only be used to express subtyping, and it is widely abused for many other things, including "Oh, these two distinct tasks share a couple funtions")
02:09
<@McMartin>
(Which should be handled by making those shared functions utilities separate from both)
02:09
<@McMartin>
(IMO, of course)
02:10
<@McMartin>
(This also means that mixins make me twitch but I freely admit that this is irrational)
02:12
<@McMartin>
(I've justified Interfaces and Duck Typing with my hatred of multiple inheritance and mixins by thinking of them as Views which require no computation to generate)
02:39
<@McMartin>
Hmm.
02:39
<@McMartin>
My L&FMenu actually doesn't work right.
02:39 * McMartin changes its API a bit.
03:19 * Reltzik decides, to hell with it, he'll just implement it with a language he knows. Probably java. How hard could it be?
03:21
< Reltzik>
And, more to the point, what could possibly go wrong?
03:25
<@ToxicFrog>
*** You are entering a world of pain ***
03:26
< Reltzik>
Yup!
03:27
< Reltzik>
It's not like I know that many languages in the first place. At least Java's got the built-in concurrency stuff.
03:28
< Vornicus>
In the end I don't think you really need concurrency for this.
03:29
< Reltzik>
Need? No, not really.... except for the GUI, of course. But it makes a certain derranged sense.
03:29
<@ToxicFrog>
...
03:29
<@ToxicFrog>
No, it doesn't.
03:31
< Reltzik>
Sure it does. Look, there are a bajillion and one stats which, when they change, affect other stats. Modifiers dependent upon powers which are in turn of limited duration. Change one thing, and likely as not three other things are affected.
03:31
< Vornicus>
Yeah, you're going about this the wrong way.
03:31
< Vornicus>
This is called "accessor methods" and you should know that.
03:31 * Reltzik probably is.
03:32
< Reltzik>
I don't, actually. School pumped me full of theory (which drained out like a sieve) and very little in the way of practical skills.
03:32
<@ToxicFrog>
...what does concurrency have to do with any of that?
03:32
< Reltzik>
The event monitors.
03:32
<@ToxicFrog>
What events?
03:32
< Vornicus>
What TF said.
03:33
< Vornicus>
These are methods on the player class.
03:33
< Reltzik>
Set it up so that changes in the key stats are events?
03:34
<@ToxicFrog>
...you could do that, but again, generally event handlers are synchronous.
03:34
< Reltzik>
Oh, right, accessor methods. Okay, know the concept, just forgot the name.
03:35
< Reltzik>
Those don't make sense here.
03:35
<@ToxicFrog>
In either case, however, you set it up so that when you change, say, a character's strength, it calls a function - either as part of the STR acessor method, or as part of the event handler - which automatically recalculates everything that STR depends on.
03:35
<@ToxicFrog>
Er, that depends on STR.
03:35
<@ToxicFrog>
Why not?
03:35
< Reltzik>
Er, wait. You meant inserting a trigger for the changes INTO an accessor method. Okay, yeah, that could work.
03:38
< Reltzik>
But there are situations where you don't know all those things at compile time -- for example, who's within the radius of an anti-magic field. And other things which break the rules, like str modifying to-hit except when you have the Weapon Finesse feat. So, you'd have to keep a DYNAMIC list of things to do when strength gets modified, and be able to change it at runtime.
03:38
<@ToxicFrog>
And?
03:39
< Reltzik>
And that's pretty much what monitors do in the first place.
03:39
<@ToxicFrog>
(1) this is entirely possible, (2) how would concurrency make this at all easier?
03:39
<@ToxicFrog>
Yes. A monitor is a function you attach to a variable. When the value of the variable changes, the monitor is called.
03:39
<@ToxicFrog>
No need for multiple threads of execution at all.
03:40
< Reltzik>
Ah. Okay, not concurrency per se. Sorry, I've just got monitors categorized in my head as "concurrency stuff".
03:40
<@ToxicFrog>
Coroutines may be helpful when writing stateful monitors, but are hardly necessary.
03:40
<@ToxicFrog>
Concurrency is "multiple parts of the program running at the same time"
03:40
< Reltzik>
Yeah, I know. Just been a while since I did anything with it, I'm a bit fuzzy.
03:41 * Reltzik is da newb.
03:42
< Reltzik>
But, still. Java's got the monitors built-in.
03:42 * Vornicus thinks, fiddles. Wonders how easy it would be to write a character module in Python
03:42
< Vornicus>
On the other hand, Relt, you could dynamically calculate a lot of these things.
03:42 * Reltzik doesn't know Python, unfortunately. And as this conversation demonstrates, he REALLY needs a refresher course in java. One of the reason he wants a project, actually.
03:44
< Reltzik>
Vorn: Can I get an antecedent for "those things"?
03:45
<@ToxicFrog>
Maybe this would be a good time to learn, then~
03:45
< Vornicus>
It looks to me like what you're trying to do is make everything - say, skill bonuses - an attribute where it should actually be a thing that gathers information and calculates on the fly.
03:45
< Vornicus>
Don't Store When You Can Calculate
03:46
< Reltzik>
Probably is. Maybe once I've finished/given up with the java version, I'll use it to learn Python.
03:49
< Reltzik>
Well, that'd work well with skill bonuses, so let me choose another example -- your basic melee attack bonus. This is both a derivative stat, and one from which other quantities (like attack bonus with a specific weapon) are dependent.
03:49
<@ToxicFrog>
So?
03:49
< Reltzik>
...... I was going somewhere with this. Hang on, lost my train of thought.
03:50
<@ToxicFrog>
When attack bonus with a weapon needs to be calculated, it grabs a bunch of input values. One of these is the base attack bonus.
03:50
<@ToxicFrog>
When it asks for the base attack bonus, this is in turn caculated based on character level, class, str/dex, etc.
03:50
< Vornicus>
Sure. And you'll be reading the attack bonus from an accessor, not directly from the property value; once you've got the accessor, you can /actually remove/ the property underneath it.
03:50
< Vornicus>
This is why you use accessors.
03:51
<@McMartin>
Indeed
03:51
<@McMartin>
Also, what with all the Swing stuff I'm tossing around here, I'd like to namecheck "listeners"
03:51
<@ToxicFrog>
(as an aside, I must question the sanity of your school in (a) starting you off with Java and (b) not teaching you anything else)
03:51
< Vornicus>
TF: all too common.
03:51
<@McMartin>
((a) is only a mistake compared to starting with Scheme)
03:52
<@McMartin>
(Well, or assembly language, depending on curriculum)
03:52
< Vornicus>
(or a P language)
03:52
< Reltzik>
Actually, they started me off with C++, then hit me with 8086 assembler. I also got exposed to Lisp/scheme, prolog, and SQL, though none of those really stuck.
03:52
<@ToxicFrog>
(or Python or any other high-level, REPL-equipped language which will let you teach the students concepts without the language constantly getting in the way)
03:52
<@McMartin>
(P language?)
03:53
< Reltzik>
None.
03:53
<@McMartin>
(Yeah, see, until quite recently far too many places started you out on C.)
03:53
<@McMartin>
(C and C++ lie about making sense unless you already know an assembly language)
03:53
< Reltzik>
That's what I learned in jr. College. I'm pretty good at C, actually. It's the only language I'm really confident in.
03:53
<@ToxicFrog>
Many places still do.
03:54
< Vornicus>
(Perl/PHP/Python. Something you can use in the LAMP stack)
03:54
<@McMartin>
Anyway, Relt, the general problem you have, generalized, looks something like this, am I right?
03:54
<@ToxicFrog>
(Guelph starts with Java, then quickly expands into MC68K ASM, C, and Python)
03:54
<@McMartin>
- There's an object, and it has values that can change.
03:54
<@McMartin>
- When it changes, some set of objects care about this, so it needs to notify them.
03:54
< Reltzik>
Yeah, I know. I don't have a P-language. Or any part of LAMP, really.
03:54
<@McMartin>
- The set of objects that care varies at runtime.
03:54
<@McMartin>
Is that all about right?
03:55
< Reltzik>
Yeah, though "objects" can include methods.
03:55
< Reltzik>
((Not that big a deal, theoretically, though the reflect things are sometimes a pain to implement with.))
03:55
<@ToxicFrog>
Reltzik: I highly recommend picking up a high-level language. It will come in handy and change the way you think about things.
03:55
<@McMartin>
A method is a verb.
03:55
<@McMartin>
Verbs cannot care.
03:56
<@McMartin>
If you need them to, you have a class called, say, Action that implements a single method.
03:56 * Vornicus obviously recommends Python.
03:56
<@McMartin>
And then it cares.
03:56 * McMartin also recommends Python.
03:56
<@McMartin>
Anyway
03:56
<@McMartin>
There's a standard solution to this problem.
03:56 * ToxicFrog recommends any one of Lua, Python, or Scheme.
03:56
<@McMartin>
Player (or, more probably, some superclass) has the following methods in it:
03:57
<@McMartin>
addListener (ListenerType l)
03:57
<@McMartin>
removeListener (ListenerType l)
03:57
<@McMartin>
And ListenerType has a method in it like playerAttributeChanged
03:57 * Reltzik nodnods.
03:57
<@McMartin>
And then the accessor method is Player.setStrength goes through the set of currently registered Listeners and calls playerAttributeChanged on each of them in turn.
03:58
< Reltzik>
Yeah, that's what I'm talking about, though I'd probably want to hang listeners on individual stats rather than entire character sheets.
03:58
<@McMartin>
That ust means you have more methods.
03:59
<@McMartin>
(Or that you pass an attribute and filter inside, depending)
03:59
<@McMartin>
This is basically how Swing handles UI control - you can register an ActionListener on anything that is a "momentary select" widget
03:59
<@McMartin>
Which means the same object can handle, for instance, pressing a hotkey, selecting a menu item, or pressing a button.
03:59
<@McMartin>
Because those are all ActionListeners.
04:00
< Reltzik>
Okay, I think I follow, and this all sounds VERY familiar.
04:00
<@McMartin>
There are various possible buzzwords for it.
04:00
<@McMartin>
Listener is one.
04:00
<@McMartin>
Publish/Subscribe is another.
04:02
< Reltzik>
Right.
04:02 * McMartin doesn't have the Design Patterns book handy, but it probably has yet a third name for it.
04:02
< Reltzik>
Those're what I was calling monitors. Right concept, wrong word.
04:03 * Reltzik thinks.
04:03
< Reltzik>
Wait.... not sure they're the right concept.
04:03
< Reltzik>
But it's close.
04:03
<@McMartin>
"Monitor" usually means "locks"
04:03
<@McMartin>
Well. In java.
04:04
<@ToxicFrog>
Monitor is a thread synchronization system.
04:04
<@ToxicFrog>
Java monitors are based on, but not identical to, the general Monitor design.
04:04
< Reltzik>
Okay, yeah, what I was thinking of is closer to listeners, if not the same. Okay.
04:04
<@ToxicFrog>
(I note that listeners in general, and hanging listeners on individual stats in specific, is probably going to be easier in a language in which reflection is not a pain in the ass~)
04:05
< Reltzik>
(Well, at least it's comforting to know that I'm not the only one who dislikes the java reflect stuff.)
04:05
<@McMartin>
(At least it exists at all)
04:05
< Reltzik>
(Yes. It's like the DMV.)
04:06
<@McMartin>
(Also, you can get a vast amount of mileage out of judicious use of newInstance(), which is pretty easy to use)
04:07
<@ToxicFrog>
(Oh, it's certainly very useful. It's just kind of unwieldy to use.)
04:08 * Reltzik never really got over his pointer addiction from his C days. The most recent program he wrote started off by declaring a variable with 6 levels of indirection.
04:08
<@ToxicFrog>
...
04:08 * Reltzik hasn't coded in a while. Sigh.
04:09
< Reltzik>
There was a good reason. It was C. It was a dynamically allocated ragged 6-dimensional array.
04:09
<@ToxicFrog>
"ragged"?
04:09
<@McMartin>
(Yeah, see, I'm considering the rest of java.lang.reflect's obscurity a mixed curse, since it means that reflection's potential for incredible evil is less likely to manifest in the hands of noobs)
04:09
< Vornicus>
Ragged: not all the arrays were the same size.
04:09
<@ToxicFrog>
And this means that conceptually, it wasn't a variable with six levels of indirection.
04:09
<@ToxicFrog>
It was a six-dimensional array.
04:09
< Vornicus>
I still don't know why the hell he did it.
04:10
<@McMartin>
Struct mor e serious.
04:10
<@McMartin>
Man, the wireless ping here is awful.
04:10
< Vornicus>
Struct more serious?
04:10
<@ToxicFrog>
(This Is Not A Feature. Bad programmers will produce bad code no matter what tools you give them, noobs will learn, and programmers who do know what the hell they're doing should not have to jump through hoops to do it.)
04:10
<@ToxicFrog>
(This is one reason I dislike all B&D languages and Java more than most.)
04:12 * Vornicus fiddles with Character
04:13
<@McMartin>
(Well, more seriously, newInstance() lets you mix reflection with strong compile-time type checking, which I'm fond of)
04:13 * Vornicus fiddles, specifically, with the constructor. It's big and nasty! ;_;
04:13
<@McMartin>
(The fact that in Python, typoing a method name can only be caught at run time, Is Not A Feature In My Book.)
04:13
<@McMartin>
Vorn: "Make more significant use of structs" = struct more serious
04:14
< Vornicus>
ah
04:14
<@ToxicFrog>
I'm in favour of compile-time checks. I just don't agree with either (a) explicitly treating the programmer as the enemy or (b) creating huge, unwieldy interfaces for simple operations.
04:15 * Reltzik finally figures out where newinstance() is. Okiedokie.
04:15
<@ToxicFrog>
I'm not so heavily in favour of them that I'll take them instead of most other things, which is one reason I favour Lua.
04:17
<@McMartin>
For me it depends on how complex the task is.
04:17
<@McMartin>
It doesn't seem to take much to get complicated enough that I want an army of robots to help.
04:17
<@McMartin>
And for setting up the initial restraints I usually write a Python script to spit out skeletal Java code~
04:17
<@McMartin>
Well.
04:18
<@McMartin>
"Usually" = "I've been doing this for Blorple, the first major Java project I've done from scratch in four years"
04:18
<@McMartin>
I did something similar for PQL, IIRC, though there I got to fully pick naming conventions and got a lot more mileage out of simple search-and-replace.
04:19 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?]
04:20
<@McMartin>
Then again, PQL was based heavily around Visitors, which are fantastically ugly in any language that doesn't provide multiple dispatch.
04:20
<@McMartin>
They're a little bit cleaner in reflection-simple languages like Python, but then you have to be careful to not allow data to start calling methods you didn't intend.
04:21
<@ToxicFrog>
Someday I'm just going to snap and wake up a week later to find out I've written the bastard offspring of Lua, Haskell and Scheme.
04:24 You're now known as TheWatcher[zZzZ]
04:25
<@McMartin>
Oh, good, autogenerated dialog boxes match their container's appearance.
04:31 * Vornicus runs into trouble figuring out how to give a character all the data it needs.
04:32
<@McMartin>
What's your project here?
04:32
< Vornicus>
D&D character
04:32
<@McMartin>
Aha.
04:33
< Vornicus>
Ability scores, race, class(es), skills, feats, class-specific goodies like cleric domains, equipment, spells...
04:34 * Reltzik has been going over this fairly closely over the past few days.
04:34
< Reltzik>
((Oh, and Jen "requests" that you fix Schlock, Vorn.))
04:34
< Vornicus>
Jen can come back when she has done a high level statistical analysis.
04:35
< Vornicus>
Oh, it's gone.
04:35 * Vornicus can't fix that.
04:36 * Reltzik won't repeat Jen's reply to that, but it's ammusing.
04:38
< Reltzik>
And that's just the character-sheet, Vorn. Also, don't forget temporary status effects like being the target of, say, Bless.
04:38
< Vornicus>
Yeah. I think getting all the data you need is really the hardest part here.
04:39
< Reltzik>
Yeah, that's why I was wanting something which comformed more naturally to the problem, like a logic language.
04:39
< Reltzik>
Would make ENTERRING all the stuff so much easier.
04:40
<@McMartin>
You want a text-processor.
04:40
<@McMartin>
It will probably be faster to learn Python and write a scanner for semi-structured text data in it.
04:40 * Reltzik assumes McM doesn't mean a text-editor.
04:40
<@McMartin>
Then have the scanner learn what it needs and spit out representation code in the language of your choice.
04:40
< Reltzik>
((Though that's what I thought when I first read it. Was worth a laugh.))
04:41
<@ToxicFrog>
A text processor is a piece of code which reads text and translates it into manipulable data structures.
04:41
<@McMartin>
As has been famously said many times by many programmers, "I'd rather write programs that write programs than write programs."
04:41
< Vornicus>
Relt: a logic language doesn't make any sense here. We're just talking, "here is a blank object. Fill in all the fields. Now."
04:41
<@McMartin>
Yeah.
04:41
<@McMartin>
Once you get the class hierarchy set, Hibernate will let you jam all this stuff into a SQL database for (nearly) free.
04:41
<@McMartin>
But that means getting the structure right first
04:42
<@McMartin>
And it's probably easier to do that as semistructured text.
04:42
<@McMartin>
Which you can then process into (a) Java code, and (b) Hibernate configuration goo.
04:42 * Reltzik is VERY weak on SQL.
04:43 * Vornicus can see how the SQL backing would look, for much of this.
04:43
<@ToxicFrog>
Doesn't have to be SQL, but presumably uou'll want some kind of persistency.
04:43
<@McMartin>
Reltzik: The whole point of Hibernate is that it does persistency for you without you having to mess with SQL.
04:43
<@McMartin>
That said, yeah, some kind of persistency.
04:43
<@McMartin>
If nothing else, your fields should be Serializable.
04:44
<@McMartin>
Then you can toss them around with ObjectInputStreams and such
04:44
< Vornicus>
The trick here is, I am making a new character in the code.
04:46
< Vornicus>
Which my instincts say should go something like a lot of PostScript's stuff, throwing dictionaries around.
04:53
< Reltzik>
Yeah, that's important, but I don't see a lot of pitfalls there, so I haven't been focussing on it.
04:54
< Vornicus>
I'm seeing pitfalls - how do I scream about bad dictionaries without making it inflexible.
04:55 * Reltzik was referring to the storage/persistency thing.
04:56
< Vornicus>
Once it's /stored/, everything is easy; the problem is creating the data and loading it in in the first place.
04:57
< Reltzik>
Yup.
04:59 * Reltzik is currently (well, concurrently) plowing through the DnD rules to see all the things he has to account for. He's almost to the spell lists. 8-(
05:00
< Vornicus>
There's a whole lot, but a lot of it can be left undone until you need to implement a segment that uses it.
05:01
< Vornicus>
You don't need to implement any spells, for instance, until you start throwing wizards and clerics around on the battlefield.
05:01
<@McMartin>
Wewt!
05:01
< Vornicus>
All you need until then is a /list/ of spells.
05:02
< Reltzik>
Sort of, but those effects will need to be able to get their proverbial hands on elements within the object.
05:02
<@McMartin>
My directory scanner works, so you can now add and delete entries from the list.
05:02
< Reltzik>
Which means those elements need to be accessible in the first place.
05:02
< Vornicus>
That's not too hard.
05:02
< Reltzik>
No, but better to figure it out ahead of time.
05:03
< Reltzik>
((For extra fun, ask yourself this: How well does your schema handle the Leadership feat?))
05:04
< Vornicus>
((nothing handles the Leadership feat well.))
05:04
< Reltzik>
Not to mention the various "pets" which half the classes have.
05:05
< Vornicus>
In the end, that's not that hard.
05:05
< Vornicus>
Familiars and animal companions are pretty much just plain old characters.
05:05
< Vornicus>
Simplified, but
05:06
< Reltzik>
Except for things like channelling touch spells through them, shared spells, dependent hit-die advancement...
05:06
< Vornicus>
Not too bad. I can see how it's done.
05:07
< Vornicus>
Anyway, you're multiplying entities prematurely. Sure, there's a lot that you want to do, but if you're trying to stuff it all in now, you'll never get out of the analysis step.
05:07
< Reltzik>
Yeah, I can too, I'm just saying it's not really simple.
05:08 * Vornicus knows this, he's done it.
05:09
< Reltzik>
Darkness, concealment miss-chances, and darkvision/lowlight vision, THAT is tricky.
05:09
< Vornicus>
ANd you're still chasing rainbows. Do One Thing. Then worry about something else.
05:09 * Reltzik IS going to do one thing. He just wants that one thing to be upgradable.
05:10
< Vornicus>
And you act like this is hard. It's really not.
05:10
< Vornicus>
Well, okay, it is. But making it 'upgradable' when you're not even sure the direction your program is going to take in the first is harder.
05:12
< Reltzik>
Okay, you're right. Screw it. No more planning, I'll just start coding. ((Well, I'll do a bit of planning on THAT level first, but...))
05:12
< Vornicus>
Right. Pick a place, do all the work you need to get /that one little thing working/.
05:12
< Vornicus>
Everything else right now is beyond your reach.
05:13 * Reltzik needs a list of "little things" first, but yeah.
05:16
<@McMartin>
http://www.stanford.edu/~mcmartin/misc/blorple-3.png
05:20 * Reltzik starts with the core mechanic -- virtual rolls, or more specificly the strings indicating WHAT to roll. Gets to work coding that.
05:44
<@McMartin>
"The Spirit of Speed-IF is universally regarded as the most formidable dirigible battle platform in East Africa, if not the world; its india-rubber gussets alone cost half the annual revenues of the Ottoman Empire. Its recent loss to the French, therefore, can scarcely be countenanced."
05:45
< Reltzik>
Where's THAT from?
05:45
<@McMartin>
Djibouti Dirigible Discombobulation.
05:57
<@McMartin>
http://www.ifwiki.org/index.php/Djibouti_Dirigible_Discombobulation
06:42 GeekSoldier|bed is now known as GeekSoldier
08:56
<@McMartin>
Argh
08:57 * McMartin kicks JScrollPane in the teeth
08:57 NSGuest-5087 [~Z@87.72.35.ns-26506] has joined #Code
08:58
< Vornicus>
What'd it do to you today?
08:59
< jerith>
I'm guessing a better question would be "What /didn't/ it do today?" with the answer "work".
08:59
<@McMartin>
Oh, no, it works fine.
08:59
<@McMartin>
Indeed, it works *too well*
08:59
<@McMartin>
I want it to *stop* working.
08:59 Reltzik [Reltzik@76.252.223.ns-21976] has quit [Quit: DEATH TO THE UNDEAD!]
08:59
< Vornicus>
Heh
08:59
< jerith>
In which case my question falls away and my answer still stands. :-)
08:59
< Vornicus>
It doesn't stop scrolling?
08:59
<@McMartin>
Specifically, when I change the text to be something larger than the current viewport, I want it to *stay where it is*.
08:59
<@McMartin>
Instead, it is autoscrolling to the bottom.
08:59
<@McMartin>
And I can find no way to actually say "Set vertical scroll to 0, plz"
09:01
<@McMartin>
OK, that's in JScrollBar.
09:05
<@McMartin>
Aaaand, setting it by force does nothing, presumably because it hasn't gotten a chance to repaint it at that point.
09:08 You're now known as TheWatcher
09:08 * McMartin looks through the superclasses.
09:11
<@McMartin>
Aha, found it.
09:11
<@McMartin>
(JTextComponent.setCaretPosition)
09:12
< Vornicus>
...That seems wrong.
09:12
<@McMartin>
Not really.
09:12
<@McMartin>
I'm using an document-display field here.
09:12
<@McMartin>
With editing turned off.
09:12
<@McMartin>
So scroll is being dictated by where the caret is.
09:12
<@McMartin>
The caret being what we mortals would call a "cursor" =P
09:13
<@McMartin>
After doing an append I need to setCaretPosition(0).
09:13
<@McMartin>
And then it behaves precisely as I intend.
09:13
< Vornicus>
You want it to always go to the top?
09:13
<@McMartin>
Yes.
09:13
< Vornicus>
ok.
09:14
<@McMartin>
Essentially, if the back cover copy for an IF game is too long to fit in the window, it should let you scroll down
09:14
<@McMartin>
But it should initially display the top of it, because, you know, you presumably haven't read that bit yet.
09:15
< Vornicus>
Right
09:16
< Vornicus>
I was thinking more the "hey look, more stuff showed up" thing, where you'd want it to sit still
09:16
<@McMartin>
Well, there, I'd want it to autoscroll to the new stuff.
09:16
< Vornicus>
Only if you're at the bottom, imo
09:17
<@McMartin>
That's one more if check based on where the caret currently is.
09:21 * McMartin is an idiot, gets kicked in the teeth by a well-earned NPE
09:21
<@McMartin>
Find the bug, kids...
09:22
<@McMartin>
x = map.get("blah").toString();
09:22
<@McMartin>
if (x != null && x.length() > 0) { ... }
09:22
< jerith>
map.get("blah") -> null
09:22
<@McMartin>
Ding ding ding!
09:23 * jerith has done that too.
09:24 * Vornicus has done that, but not in that language
09:26
<@McMartin>
It wasn't actually map.get in this case, but a fairly deeply buried call to it.
09:26
<@McMartin>
That at the top level involves accessing a field that's allowed to be null.
09:36
<@McMartin>
There we go.
09:36
<@McMartin>
That leaves two tasks left before I'm back to the state I was in in the Python version for browsing.
09:36
<@McMartin>
Though This Time It Will Be Better.
09:36
<@McMartin>
Displaying cover art, and sorting based on columns.
09:37 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code
09:37 mode/#code [+o gnolam] by ChanServ
10:12 jerith [~jerith@67.18.198.ns-4695] has quit [Quit: leaving]
10:12 jerith [~jerith@67.18.198.ns-4695] has joined #code
10:16 Netsplit Troika.TX.US.Nightstar.Net <-> Blargh.CA.US.Nightstar.Net quits: @gnolam
10:19 mode/#code [+o gnolam] by ChanServ
10:19 Netsplit over, joins: gnolam
11:31 AnnoDomini [AnnoDomini@83.21.50.ns-4024] has joined #Code
11:31 mode/#code [+o AnnoDomini] by ChanServ
12:18
< jerith>
Someone +v me please?
12:18 mode/#code [+o jerith] by ChanServ
12:18
<@jerith>
http://developer.amazonwebservices.com/connect/thread.jspa?threadID=19714&start= 89&tstart=0 <-- So, it turns out building a scalable system is /hard/. Who'd've thought?
12:19 mode/#code [+oooooo Attilla C_tiger GeekSoldier Jeff Raif Vornicus] by Vornicus
12:19
<@jerith>
I forgot I had chanserv-ops here. :-)
12:19 mode/#code [+o NSGuest-5087] by Vornicus
12:19
<@Vornicus>
jerith... you're an oper. You can op yourself anyway. :)
12:19
<@jerith>
Vornicus: I'm not an oper at the moment. My o-line doesn't like me.
12:20
<@jerith>
I think for some reason the reverse DNS lookup isn't happening, and I suspect my o-line is based on a hostname rather than an IP.
12:20
<@Vornicus>
ah so.
12:20
<@Vornicus>
Beat Reiver.
12:20
<@jerith>
Either that or my box's IP has changed. I'm pretty sure I'd've heard about that, though.
12:21
<@Vornicus>
Possibly with sticks, possibly with haddock.
12:21
<@Reiver>
meep?
12:21
<@Reiver>
jeriths o-line is borken?
12:21
<@Reiver>
tsk.
12:21
<@Vornicus>
Personally, I would prefer the haddock, just for the funny noise.
12:22
<@Reiver>
I prefer bribery via haggis.
12:23 * jerith sends Reiver a haggis by snail-mail.
12:23 * Reiver gets a foul smelling rotten pile of once-meat?
12:23
<@Vornicus>
heh
13:00 AnnoDomini [AnnoDomini@83.21.50.ns-4024] has quit [Ping Timeout]
13:01 AnnoDomini [AnnoDomini@83.21.68.ns-3427] has joined #Code
13:01 mode/#code [+o AnnoDomini] by ChanServ
13:24 Vornicus [~vorn@ServicesOp.Nightstar.Net] has quit [Ping Timeout]
13:26 Vornicus [~vorn@Admin.Nightstar.Net] has joined #code
13:26 mode/#code [+o Vornicus] by ChanServ
15:25 Attilla [~The.Attil@194.72.70.ns-11849] has quit [Quit: <Insert Humorous and/or serious exit message here>]
15:47 Attilla [~The.Attil@194.72.70.ns-11849] has joined #code
16:59 Vornicus is now known as Vornicus-Latens
17:09 You're now known as TheWatcher[afk]
17:51 Derakon[AFK] is now known as Derakon
18:36 You're now known as TheWatcher
19:51 GeekSoldier is now known as GeekSoldier|bed
20:42 Reltzik [Reltzik@76.252.223.ns-21976] has joined #Code
20:56 Jeff [~JPL@Nightstar-764.dsl.sndg02.pacbell.net] has quit [Ping Timeout]
21:28 GeekSoldier|bed [~Rob@91.18.111.ns-3163] has quit [Ping Timeout]
22:55 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?]
22:57 AnnoDomini [AnnoDomini@83.21.68.ns-3427] has quit [Quit: The screams are not loud enough.]
23:54 JeffL [~JPL@Nightstar-764.dsl.sndg02.pacbell.net] has joined #code
--- Log closed Mon Feb 18 00:00:23 2008
code logs -> 2008 -> Sun, 17 Feb 2008< code.20080216.log - code.20080218.log >