code logs -> 2006 -> Fri, 20 Oct 2006< code.20061019.log - code.20061021.log >
--- Log opened Fri Oct 20 00:00:03 2006
00:02 * Reiver flails at Swing.
00:02
<@Reiver>
How do you get an OK button to close a JFrame?
00:03
<@ToxicFrog>
First, you assassinate everyone involved with Swing's development.
00:03
<@ToxicFrog>
Then you use Glade.
00:04
<@McMartin>
Not appropriate for this assignment.
00:04
<@McMartin>
Especially since he needs to do dynamic widget modification.
00:04
<@McMartin>
Which, ANIACT, Glade cannot do
00:04 ChalcyVet [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
00:05
<@Reiver>
(We're also hand-coding, and were taught Swing.)
00:05 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
00:05 mode/#code [+o Chalcedon] by ChanServ
00:06
<@McMartin>
In any event, have the ActionListener for that button call the close method for the relevant JFrame.
00:06
<@McMartin>
The name of which escapes me
00:06
<@Reiver>
.dispose() isn't working.
00:06
<@McMartin>
You probably want to set that JFrame to DISPOSE_ON_CLOSE.
00:06
<@McMartin>
Dispose isn't the same thing as close.
00:06
<@Reiver>
...Hm
00:08 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: do do, do-do-do-do, * 2; do do do do dooo dooo do--]
00:09
<@Chalain>
Does JFrame *have* a close() method? (Doesn't appear to...)
00:09
<@McMartin>
Alternatively, try just hiding the damned thing.
00:09
<@Reiver>
Needs to be closed so it can reopen again later.
00:09
<@Chalain>
This is an edit popup, won't that eventually leak?
00:09
<@Chalain>
The other fascinating thing here is that setVisible(false).... doesn't.
00:10
<@McMartin>
Window Closing appears to be specifically the X button.
00:10
<@McMartin>
But I know it's possible to dismiss a window with a button
00:10
<@Reiver>
You can't get an OK button to do it?
00:10
<@McMartin>
Please see what I wrote~
00:10
<@Reiver>
Simultaneous, sorry
00:12
<@McMartin>
I'm seeing setVisible(false) followed by dispose() on the JWindow class.
00:12
<@McMartin>
I'm pretty sure JFrame extends JWindow, so...
00:14
<@Chalain>
...according to your calculations, this bug is not actually happening? :-)
00:15
<@Chalain>
setVisible(false); dispose(); <-- Copied straight from FrameDemo2. Code IS running. Window isn't going away. BIH-zarre.
00:15
<@McMartin>
Uh
00:15
<@McMartin>
Isn't that the button demanding it be destroyed?
00:15
<@Chalain>
I don't think so
00:16
<@Chalain>
The JFrame extends ActionListener, and calls buttonOk.addActionListener(this).
00:16
<@Chalain>
The code above is in TheFrame.actionPerformed()
00:16
<@McMartin>
OK. But, uh, you know as well as I do that if C&P'ed code doesn't do the same thing in two different apps, something Not Copied is significant.
00:17
<@Chalain>
Mm.
00:21
<@Chalain>
So desu ka. Copying the entire block of code works. Time to forward splice the code.
00:25 * Vornicus applies whompings to whoever decided to hardcode unit test passwords.
00:28
<@Chalain>
Vornicus: You have to in many cases. The general password should probably be in a props file, but a) there is code to test mangling that prop file and b) there is no provision in the props file for changing passwords. Note that this second case is only important for writing tests that prove (in)accessibility for a given db user.
00:29 * Reiver breaks out his second bottle of coke.
00:29
<@Vornicus>
least you could do is yoink the original props file password and run using /that/.
00:30
<@Vornicus>
:P
00:30
<@Chalain>
It's an edge case, to be sure, but: if you put the unit test passwords in a props file, and then change the db password, you have to open the props file and edit it to make the unit test work. This is effectively nothing more than an additional level of indirection/complexity over hardcoding the password....
00:31
<@Chalain>
It *does* let each tester change their unit test user password, however. Then again, I think that's probably a v.bad thing. UT's should be fairly standard.
00:31
<@McMartin>
Also, my knowledge of Japanese particles is weak. "So desu ka" means that something is, but that's all I can work out.
00:31
<@Chalain>
McM: Loosely, "it is so."
00:31
<@Vornicus>
(I just spent two hours trying to fix the CI machine, and trying to figure out why the heck it wasn't reading the right data from the properties file, and so on and so forth. There was moaning, and gnashing of teeth)
00:32
<@Chalain>
Note that the English so has nothing to do with the japanese so. :-)
00:32
<@Chalain>
Mostly I was agreeing: a faithful C&P led to worky code.
00:32
<@McMartin>
Uh, if you work out the nature of this mystery, do let me know, I am curious~
00:32
<@Vornicus>
(we didn't get to the rending of flesh, but it was getting there)
00:33
<@Chalain>
Vornicus: What happened? I assume that the UT's blew up?
00:33
<@Vornicus>
the UTs blew up.
00:33
<@Chalain>
When, how and why?
00:33
<@Chalain>
...if I may ask.
00:34
<@Vornicus>
Instead of bothering to blow up nicely, they instead throw up a dialog box saying "I can't connect to the database"
00:34 * Reiver abubbleflrumbs at Timer(), tries to work out if there is not a less painful subclass somewhere.
00:34
<@Chalain>
Yeah, that bit of code hasn't ever been civilized.
00:34
<@Vornicus>
ANd instead of bothering to /show/ that dialog box, it's a pop-UNDER
00:35
<@Chalain>
Civilizing it would give us two things: 1. When it blows up it wouldn't kill Breya, which would be nice but I could make an argument for just living with it. 2. It would let us auto-test failure to connect. Currently the blow-up-with-dialog approach is sufficient for customer needs. :-(
00:35
<@Chalain>
LOL
00:35
<@Chalain>
Um
00:35
<@Chalain>
Actually, no.
00:35
<@Vornicus>
SO you don't even know that it's actually blown up except by noticing that it hasn't changed in a while, and then you don't know WHY until you log in move all the windows out of the way.
00:35
<@Chalain>
Your browser window sets AlwaysOnTop.
00:35
<@Chalain>
EVERYTHING is a popunder when it's running.
00:36
<@Vornicus>
Even when the browser window is closed, it appears under console and explorer windows.
00:36
<@Chalain>
Oh. That's... really weird.
00:36
<@Vornicus>
yes.
00:36
<@Vornicus>
Yes, it is.
00:36
<@Chalain>
Perhaps we should go find that screen and make it System Modal. :-)
00:36
<@Vornicus>
That would be a good idea.
00:37
<@Reiver>
%$#@!
00:37
<@Vornicus>
Reiver: my sentiments exactly.
00:37 * Reiver tries to learn how to set a Timer to run testAlarms() on the second, every second.
00:37
<@Chalain>
If you're going to blow up the test machine, BLOW UP THE TEST MACHINE. Don't just lobotomize it and then prop up the drooling body so that passersby think it's fine.
00:37 * Reiver tries to learn this in a /hurry/. ¬¬
00:38
<@Chalain>
Vornicus: so, how did Breya break? Did somebody change a DB password?
00:38
<@Vornicus>
Yeah, but it was working fine this morning.
00:38
<@Chalain>
weeeyurd.
00:38
<@Reiver>
Oh, it doesn't need to run on the second exactly
00:39
<@Reiver>
The alaramShouldFire method resolves against true time, so all this has to do is run often enough to detect it.
00:39
<@Vornicus>
THe current theory is that when nick changed the schema, one of the things he changed was the unittest password, and since it's not what's in the top-level test case...
00:40 * Chalain nods
00:40
<@Vornicus>
Yeah.
00:40
<@Chalain>
...so does setup_new_users fix it?
00:40
<@Vornicus>
Now it does.
00:40
<@Chalain>
ok.
00:40
<@Vornicus>
It did not, because it was out of sync with the hardcode.
00:41
<@Chalain>
sweeeeeeeeeeeeet.
00:41
<@Vornicus>
(and people wonder why DRY and db normalization are good things. hah)
00:42
<@Chalain>
Heh
00:43
<@Vornicus>
Anyway, in fiddling with it, I also found out that I was /not/ in fact getting the aqua screen to show up, because I forgot the name of it in the 30 seconds between making the aqua screen and adding the line that moves it to the script.
00:43
<@Reiver>
...TimerTask throws me. Hrm.
00:43
<@Chalain>
McMartin: Ahhh, I found it. I extracted Reiver's code from a method that created its own JFrame, to a class that extends JFrame. It was creating a JFrame inside a JFrame.
00:43
<@Vornicus>
shiny.
00:43
<@Reiver>
...Whoops
00:43
<@Reiver>
>.>
00:44 * Reiver pokepokes TimerTask. Okay, so you run a task. /how/?
00:44
<@Vornicus>
(but it wasn't screwing up too badly, because I had also forgotten the third slash in my sed command, so nothing was being done at all)
00:48
<@Reiver>
Setting AlarmHandler, which calls a Timer method, to Runnable is self-referencing that will kill me, right?
00:48
<@Reiver>
I should have the timer in my main. I think. ...No, that's not it either. arg
00:48 * Reiver stab Timer() and threads in general.
00:49
<@ToxicFrog>
Mmm, threads.
00:49
<@Reiver>
TF: Do you mind giving an Idiots Guide To Timer() syntax?
00:49
<@Vornicus>
tasty threads.
00:50
<@Vornicus>
(unlike sheets, programs with a 400 thread count are not very good)
00:50
<@Vornicus>
(well, that, or they're very very busy.)
00:51
<@ToxicFrog>
Reiver: I don't do Java, I do pthreads and SGOS threads. Sorry.
00:51 * Reiver weeps piteously.
00:51 * Reiver would probably actually get it done faster starting from scratch, because he knows how to implement, run and use a thread. He hasn't messed with Timer() before, and it's throwing him, even though it's theoretically better than handwriting his own timer purely so he knows how to initialise/instruct it. ¬¬
00:51
<@ToxicFrog>
What's it meant to do?
00:52
<@Reiver>
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html
00:52
<@Reiver>
What I want it to do is run .checkAlarms() every second.
00:52
<@Reiver>
(Yes, it's messy and unkind. It's also easiest so hush.)
00:53
<@ToxicFrog>
Hmm. Ok, that seems easy enough.
00:54
<@ToxicFrog>
- create a Timer object
00:54
<@ToxicFrog>
- create a class that extends TimerTask (and thus implements Runnable). It should have a method, run(), which simply calls CheckAlarms.
00:54
<@ToxicFrog>
- call Timer::Schedule(task, 0, 1)
00:55
<@ToxicFrog>
...err.
00:55
<@ToxicFrog>
(task, 0, 1000)
00:55
<@ToxicFrog>
milliseconds, not seconds.
00:55
<@Reiver>
Different class to the AlarmHandler class that implements the Timer?
00:56
<@ToxicFrog>
Quite straightforward, except for the Javaism of creating a new class that implements a specific interface and then passing an instance of that class in because Java doesn't have function closures argh die die die die die
00:56
<@ToxicFrog>
AlarmHandler?
00:56
<@Reiver>
AlarmHandler is my main class that will be creating the Timer(), and stores the ArrayList of alarm times.
00:57
<@ToxicFrog>
Aah.
00:57
<@Reiver>
I'm assuming I don't want to be using /that/ as my extends TimerTask object?
00:57
<@ToxicFrog>
What's the ArrayList for?
00:57
<@Reiver>
It's storing all the alarmTimes, nicely sorted.
00:58
<@ToxicFrog>
Well, you /could/. Have it implement runnable, wrap run() around checkAlarms(), pass this to Timer::Schedule(). Can't see anything immediately wrong with it.
00:58 * Reiver nod.
00:58
<@ToxicFrog>
Ok, what are the alarmTimes?
00:58
<@Reiver>
GregorianCalendar objects. (Date objects with a fancy wrapper.)
00:59
<@ToxicFrog>
Because if what you're doing is "check every second to see if an event has gone off, and if it has, take action"...this is the problem Timer{} exists to solve.
00:59
<@ToxicFrog>
At least, for values of the problem where the detonation time of the event is known in advance.
00:59
<@Reiver>
Right?
00:59
<@Reiver>
So I shouldn't be iterating through the list?
00:59
<@ToxicFrog>
I'm just trying to get a handle on what you're trying to do here.
01:00
<@ToxicFrog>
If you have some event that occurs at a fixed time in the future, checking every second to see if that time has passed will work, but registering a timer to be called exactly at that time will work better.
01:00
<@Chalain>
ToxicFrog: THe detonation time is known, but the list of alarms could be very large. (For this demo, size can probably be ignored, however.)
01:00
<@ToxicFrog>
This also means that if you have an /Event/ object, you can make it implement Runnable and pass it to Timer with scheduling values derived from the event itself.
01:01 * Chalain can't remember how many Timers Windows will let you have.
01:01
<@ToxicFrog>
And then, when the event occurs, it executes itself.
01:01
<@ToxicFrog>
Chalain: presumably, as many as the underlying realtime threads interface in windows supports.
01:01 * Reiver considers this.
01:02
<@ToxicFrog>
Chalain: however, this is not a problem.
01:02
<@Chalain>
Ahh, does Java implement its own timer threading? Okay.
01:02
<@ToxicFrog>
You don't need one thread per scheduled event.
01:02
<@ToxicFrog>
You need one thread per /timer/.
01:02
<@Vornicus>
Java implements one thread per timer.
01:02
<@ToxicFrog>
And a timer can hold as many events as you want.
01:02
<@Reiver>
So I just need it to... um... right...
01:02
<@ToxicFrog>
In this case, you create one timer, and feed all your events to it.
01:02 * Reiver tries to think how you implement this.
01:02
<@Vornicus>
Which is sensical, because it means you can do whatever the heck you want with a timer.
01:02
<@Chalain>
Oh, wild. Okay. So Windows timers very much != Java timers.
01:03
<@ToxicFrog>
Chalain: a Java timer is a wrapper around a seperate thread of execution that has a list of events.
01:03
<@Reiver>
I have an ArrayList of all the alarm times (Via .getAlarmTime() anyway).
01:03
<@Vornicus>
-- you don't have to worry about timer firing methods being expensive, in particular
01:03
<@ToxicFrog>
It executes these events in sequence.
01:03
<@Chalain>
At least as of Win2k, windows system timers were allocated from the system global resource pool, and there only 65536 such resources, and every program on the machine shares them.
01:04
<@Vornicus>
...incoming pain.
01:04
<@ToxicFrog>
Reiver: how is this arraylist derived?
01:04
<@Chalain>
Can the events list be modified easily as alarms are created and destroyed?
01:04
<@ToxicFrog>
Does each event know what time it goes off, and the arraylist is constructed by interrogating the list of events?
01:04
<@Chalain>
Vornicus: guh?
01:04
<@Vornicus>
the win2k thing
01:04
<@Vornicus>
is pain.
01:04
<@Reiver>
ToxicFrog: It's a collation of all the Appointments from the various ApptCalendars in the program.
01:04
<@ToxicFrog>
Ok.
01:05
<@ToxicFrog>
My initial thought of how to implement this is thus:
01:05
<@Chalain>
ah. Sorry "incoming" parses as an attention/alarm announcement for me. :-)
01:05
<@ToxicFrog>
- an Appointment implements Runnable, that is to say, it knows how to execute itself (and sound an alarm or whatever)
01:05
<@Vornicus>
heh
01:05
<@ToxicFrog>
- you create a Timer
01:06
<@ToxicFrog>
- you pass each Appointment into the timer as a TimerTask object
01:06
<@ToxicFrog>
- when the Appointment's time comes around, the Timer calls appt.run()
01:06
<@ToxicFrog>
Problem solved.
01:06 * Reiver nods. Pauses, frowns. Do we have to worry about TargetLock? These appointments are used everywhere else, too. He was going to be keeping the AlarmHandler in sync via a Refresh() method that rebuilt the Timer each time.
01:06
<@Reiver>
Er. s/TargetLock/Object Lock/
01:07
<@ToxicFrog>
Object Lock?
01:07
<@Reiver>
Um
01:07
<@Reiver>
Things fiddling with the Appointments while their references are being stored in the Timer() object.
01:07
<@ToxicFrog>
You speak of threading coordination constructs?
01:07
<@Reiver>
Probably!
01:07
<@ToxicFrog>
Well, this depends on what you mean by "fiddling with"
01:08
<@ToxicFrog>
And how careful you are with your mutexes.
01:08
<@Reiver>
Well, anything that /changes/ an Appointment should probably be calling AlarmHandler.refresh() as part of the activities.
01:08
<@Reiver>
But as long as one can still .getDescription and such from the object without the threads screwing with it?
01:08
<@ToxicFrog>
TimerTasks cannot be rescheduled per se, but they can be safely cancelled and then re-added with a different timer of execution.
01:09 * Reiver nod.
01:09 * Reiver sets his refresh() to do that. >.>
01:09
<@ToxicFrog>
What you do is, set up Appointment such that:
01:09
<@ToxicFrog>
- when its execution date is changed, it cancels itself, then reschedules itself with the new date
01:09
<@ToxicFrog>
- when it is deleted, it cancels itself
01:09
<@ToxicFrog>
With appropriate mutexes and suchlike to avoid THREAD EXPLODEY
01:10
<@ToxicFrog>
...indeed, passing appointment into timer is not the way to go.
01:11
<@ToxicFrog>
You pass timer into appointment. Appointment passes itself to timer as needed.
01:11
<@Reiver>
Lemme guess.
01:11
<@Reiver>
...?
01:11
<@Vornicus>
...sweet
01:11
<@ToxicFrog>
Ok, something like this.
01:11
<@Vornicus>
you give appointment a reference to timer.
01:11
<@ToxicFrog>
Appointment foo = new Appointment(myTimer);
01:11
<@ToxicFrog>
// foo now knows what timer it should be using
01:11
<@ToxicFrog>
foo.SetExecutionDate(whatever)
01:12
<@Vornicus>
then when the appointment is scheduled, the appointment takes care of updating the timer; similarly when the appointment is rescheduled, and when it is cancelled.
01:12
<@ToxicFrog>
// foo calls myTimer.schedule(this, whatever);
01:12
<@Reiver>
Hrm.
01:12
<@ToxicFrog>
foo.SetExecutionDate(newwhatever);
01:12
<@Reiver>
So my base data object is referencing AlarmHandler, yes?
01:12
<@ToxicFrog>
// foo calls this.cancel(), myTimer.purge(), and myTimer.schedule(this, newwhatever);
01:12
<@ToxicFrog>
delete foo;
01:12
<@ToxicFrog>
// foo calls this.cancel() and myTimer.purge()
01:12 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #code
01:12
<@ToxicFrog>
There is no AlarmHandler.
01:13
<@ToxicFrog>
Unless you name your Timer that.
01:13
<@Reiver>
...I see.
01:13 * Reiver frowns, tries to think where all this will be going, then.
01:13
<@ToxicFrog>
?
01:13
<@Reiver>
Is it a static Timer? Or does each Appointment create its own Timer individually?
01:13
<@Reiver>
If Timer isn't sitting off in a seperate class, I mean.
01:13
<@Reiver>
Er. s/class/object/
01:14
<@ToxicFrog>
It's shared between all Appointments, so not the latter.
01:14
<@ToxicFrog>
Whether you want it static is up to you.
01:14
<@ToxicFrog>
But there's only one. So probably yes.
01:14
<@Reiver>
Hrm.
01:14 * Reiver fiddles.
01:15
<@ToxicFrog>
bbiab
01:15
<@Reiver>
(BRB)
01:18
<@ToxicFrog>
Back.
01:23
< Janus>
Hee-hee~ Finally managed to iron out that randomarsed bug, and the attack mechanism works like a charm, complete with animation, collision checking, and Recoil Action(tm).
01:24
<@Reiver>
Roight.
01:24 * Reiver tries to think how one implements this in the context of his current work. In something of a hurry. >.>
01:25 * Reiver ponders he may need to leave it in the clumsy current implementation, and... hrm. Just use a sleep() would be the most direct way, but that would involve implementing a full thread system.
01:27 * Reiver /likes/ TF's code. He'd just have to rewrite a bunch of stuff to make it go. >.>
01:32
<@ToxicFrog>
But it's so simple and elegant!
01:32
<@ToxicFrog>
Well, for Java.
01:38
<@Reiver>
I know it is, TF
01:38
<@Reiver>
Alas my code is set up all wrong to actually use it. >.>
01:40
<@Vornicus>
It is quite simple and elegant.
01:49
<@Reiver>
What methods would I need to write? I need a new instance variable for Timer inside Appointment, or do I still have an AlarmHandler that stores one Timer, and all the Appointments reference it?
01:50
<@ToxicFrog>
Either. This is an implementation question~
01:50
<@Reiver>
I can do the latter. I have a CalenderManager already set up. Er.
01:51
<@Reiver>
I also have ~3 hours to get the guts of it working, so. *cough*
01:51
<@Reiver>
I think this is really the last gnarly bit, though, and most of the rest of it is written...
01:51
<@ToxicFrog>
As for what methods you need to write - Appointments need to have a run() method that executes them. They also need to be modified to automatically schedule and cancel themselves when modified, but this is perhaps eight lines of code total.
01:53
<@Reiver>
And Appointment.run() will... trigger the notification stuff.
01:54 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has quit [Quit: ]
01:54
<@ToxicFrog>
Yes.
01:54
<@ToxicFrog>
Whatever is meant to happen when it happens, IOW.
01:54
<@ToxicFrog>
...so to speak.
01:54 MSminion [~sysop@Nightstar-6915.hsd1.or.comcast.net] has joined #code
01:54
<@Reiver>
The current plan had been for AppointmentHandler to tell the Gui to trigger.
01:55
<@Reiver>
Er. Trigger a notification.
01:55
<@ToxicFrog>
Yeah. With this, the Appointment itself does.
01:55
<@Reiver>
Okay.
01:56
<@Reiver>
And to get the Appointment creating, setting, and updating the timer properly (Which I will keep in AlarmHandler for the moment), I need to have it... er...
01:56 * Reiver swigs coke, eats chocolate, takes more meds and tries to doublecheck the backscroll.
01:57
<@ToxicFrog>
It needs to schedule() itself when created, cancel() itself and purge() the timer when deleted, and do the latter followed by the former when modified.
01:57
<@Reiver>
...I think I get it.
01:57
<@ToxicFrog>
Gory details are all in the API docs.
01:58
<@Reiver>
AlarmHandler creates its Magical Appointment List of all Appointments (Which implement the Runnable interface), and feeds them in as TimerTasks to the Timer().
01:58
<@Reiver>
Which then runs and triggers as needed.
01:58
<@Reiver>
And the list is kept updated, and is used to cancel(), purge(), and then recreate itself on a timerRefresh.
01:59
<@Reiver>
Okay, that can be crowbar'd into the current code without too much trouble.
01:59
<@Reiver>
...Assuming I work out how to get an Appointment being accepted as a TimerTask, anyway...
02:00
<@ToxicFrog>
This is less elegant than what I planned but should work.
02:01
<@ToxicFrog>
What is the purpose of timerRefresh()?
02:02
<@ToxicFrog>
Why is it necessary?
02:03
<@Reiver>
Um
02:03
<@ToxicFrog>
Wrong answer~
02:03
<@Reiver>
So the Timers are reset when an Appointment is modified?
02:03
<@ToxicFrog>
...
02:03
<@Reiver>
Or is the Appointment meant to do that whenever a .setXYZ method is called?
02:03
<@ToxicFrog>
(1) Timer singular. Not timers plural.
02:03 Chalcedon is now known as ChalcyNap
02:03
<@ToxicFrog>
(2) The appointment handles that itself.
02:04
<@ToxicFrog>
Furthermore, it doesn't need to be modified except when the datetime of the appointment is, if you write Run() properly.
02:04
<@ToxicFrog>
(well, datetime and/or recurrence)
02:04
<@Reiver>
Hm.
02:04
<@ToxicFrog>
When that is modified, the Appointment's own setFoo() method takes care of updating the timer.
02:04
<@Reiver>
I'm... honestly still not entirely sure what exactly Run() will do, but.
02:05
<@ToxicFrog>
...
02:05
<@Reiver>
Nono. Er.
02:05
<@ToxicFrog>
What it will do, or how it is invoked?
02:05
<@Reiver>
Mostly because it's a void, and the Appointments always return something to other objects, to date, so it's going to have to actually directly reference another object, and it's the first place an Appointment will be strictly aware of anything other than itself.
02:06
<@ToxicFrog>
...um?
02:06
<@Reiver>
Um.
02:06
<@ToxicFrog>
That didn't make any sense to me.
02:06
<@Reiver>
the primary purpose of an Appointment is to store data and return it when requested.
02:06
<@Reiver>
(In various forms, but.)
02:06
<@ToxicFrog>
run() is the function that the timer calls when the appointment's time is at hand, and presumably generates flashing lights for the user or something.
02:07 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
02:07 mode/#code [+o Chalcy] by ChanServ
02:07
<@Reiver>
Appointments are stored in an arraylist in ApptCalendar, which is then stored in arraylists in CalendarManager.
02:08 ChalcyNap [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
02:08
<@ToxicFrog>
and?
02:08
<@Reiver>
CalendarManager is at the top of the data heirachy, and also contains the main() method which creates a CalendarManager object (For data), and proceeds to create GuiHandler, AlarmHandler, and FileHandler objects which manage, well, the GUI, Alarms, and File IO.
02:09 * ToxicFrog does not see where you're going with this...
02:09
<@Reiver>
Everything usually references an Appointment via CalendarManager.getCurrentCalendar(calendar).getAppointment(appt).getSomething (Though not usually that verbose).
02:10
<@ToxicFrog>
Ok.
02:10
<@Reiver>
The Appointments don't usually directly reference any other object other than their instance variables. I now need to figure out how to get an Appointment to, say, tell the GuiHandler to do something. Which requires it knowing the GuiHandler exists?
02:11
<@Reiver>
(Or the AlarmHandler. Which I could make static if needed, but statics are generally a bit ugly.)
02:12
<@ToxicFrog>
Well, you /will/ only have one of each.
02:12
<@Reiver>
Quite.
02:13
<@ToxicFrog>
Personally, I think that having a few statics referenced by the appointments is a worthy tradeoff.
02:13 * Reiver nods.
02:14
<@Reiver>
So... run() { AlarmHandler.triggerAlarm(this); isTriggered = True; }
02:14
<@Reiver>
Kind of deal?
02:15
<@Reiver>
(isTriggered being a local thingy that records whether or not the Appointment's alarm has been previously triggered.)
02:16
<@ToxicFrog>
Yes. And presumably the AlarmHandler then calls GuiHandler.ShowAlarmPopup() or something.
02:17
<@Reiver>
Right.
02:19 Raif [~corvusign@Nightstar-7918.hsd1.mn.comcast.net] has quit [Connection reset by peer]
02:21 * Reiver murders statics.
02:22 Raif [~corvusign@Nightstar-7918.hsd1.mn.comcast.net] has joined #Code
02:22 mode/#code [+o Raif] by ChanServ
02:23
<@Reiver>
...Okay, so... how does one turn an ArrayList of Appointments into TimerTask's?
02:23
<@Reiver>
Is this an inner class trick, or?
02:24
<@Reiver>
TimerTask tTask = new TimerTask(); as an instance variable inside of Appointments?
02:24
<@ToxicFrog>
No. You alter Appointment to extend TimerTask.
02:28
<@Reiver>
Hokay.
02:31
<@Reiver>
...So they depcreciate Date. Then they make things have errors when you try to pass a GregorianCalendar object to them instead. >.<
02:31
<@Reiver>
The method schedule(TimerTask, long) in the type Timer is not applicable for the arguments
02:31
<@Reiver>
(Appointment, GregorianCalendar)
02:32
<@ToxicFrog>
If you can upcast a GregorianCalendar to a Date, that will work.
02:33
<@ToxicFrog>
Well, the latter half of it I mean.
02:33
<@ToxicFrog>
The former half still has to extend TimerTask.
02:33
<@Reiver>
It extends TimerTask.
02:33
<@Reiver>
...Well, it says Appointment extends TimerTask implements Comparator, Runnable { anyway
02:33
<@McMartin>
Ew.
02:34
<@Reiver>
Quite. >.>
02:34 * McMartin dislikes mixins.
02:34
<@Reiver>
mixins?
02:34
<@McMartin>
You can't actually do them in Java
02:34
<@McMartin>
But things like Comparator come close.
02:35
<@Reiver>
The code is swiftly becoming sorta elder horror. Er. But.
02:35 * MSminion randomly stabs ToxicFrog.
02:35
<@Reiver>
How does one, um, get Appointment to register as a TimerTask?
02:36
<@Reiver>
Oooh!
02:36
<@Reiver>
I had done a Stupid.
02:36 * Reiver adds on .getTime to the end of the time. >.>
02:37 * Ev3 turns Reiver into a toad.
02:37 * Reiver croaks.
02:37 Vornicus-Latens is now known as Vornicus
02:41
<@Chalain>
Fut the whuck?
02:41
<@Chalain>
Vornicus...?
02:41
<@Chalain>
Did you change something in subversion today...?
02:42
< MSminion>
Vorn is a pretty subversive fellow.
02:42
<@Chalain>
"svn: This client is too old to work with working copy "C:\Documents..."; please get a newer Subversion client
02:47
<@Vornicus>
I didn't touch it at all.
02:47
< MSminion>
See what I mean! Subversive.
02:48
<@Vornicus>
I did a lot of other crap, but I didn't touch subversion.
02:58 * Chalain installed WinMerge today, and it asked if I wanted to integrate with TortoiseSVN, so I suspect that. But I'm a bit weirded, because TortoiseSVN still works. It's just Subclipse that doesn't work.
02:59 Thaqui [~Thaqui@Nightstar-8486.adsl.xtra.co.nz] has quit [Quit: Leaving]
02:59
<@Vornicus>
bizarre.
03:00
<@Chalain>
Hmmm
03:00
<@Chalain>
I wonder. I used Tortoise to tweak my project after installing WinMerge.
03:00
<@Chalain>
I bet it upgraded the contents of the .svn folder.
03:01
<@Vornicus>
...possibly WinMerge upgraded your TortoiseSVN version, which uses a slightly newer version of the SVN client software.
03:02
<@Vornicus>
And since svn generates its metadata files client-side...
03:03 * Reiver broke his Eclipse. Again. >.>
03:05
<@Chalain>
Vornicus: Oh megabarf if that's the case. That means I cannot use TortoiseSVN to fix Subclipse bugs. Drat.
03:06 * Chalain vomits 1,048,576 times.
03:07
< MSminion>
That's a lot of barf.
03:08
<@Chalain>
It's a megabarf!
03:08 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: Jouets de Dieu, jouets de jouets, et les jouets de me, fait naître Clairvoire.]
03:12 * Ev3 PatPats Chalain.
03:13
<@Chalain>
In other news, I have been watching the SICP videos from MIT.
03:13
<@Chalain>
Holy Freaking Crap.
03:14
< MSminion>
Disturbing mental image alert.
03:14
<@Chalain>
You should NOT be able to do Towers of Hanoi in six lines of code.
03:14
<@Reiver>
...
03:14
<@Reiver>
Abuh?
03:15
<@Reiver>
LISP or something?
03:15
<@Chalain>
Yeah
03:15
<@Reiver>
Heh
03:15
<@Reiver>
Are they big lines?
03:15
<@Chalain>
(define (move n from to spare)
03:15
<@Chalain>
(cond ((= n 0 ) "done!")
03:15
<@Chalain>
(else
03:15
<@Chalain>
(move (-1+ n) from spare to)
03:15
<@Chalain>
(print-move n from to)
03:15
<@Chalain>
(move (-1+ n) spare to from))))
03:16
<@Reiver>
...Nice.
03:16
<@Chalain>
I wrote a friendly version of print-move. It's 8 lines.
03:16
<@Chalain>
(define (print-move n from to)
03:16
<@Chalain>
(display "move disc ")
03:16
<@Chalain>
(display n)
03:16
<@Chalain>
(display " from ")
03:16
<@Chalain>
(display from)
03:16
<@Chalain>
(display " to ")
03:16
<@Chalain>
(display to)
03:16
<@Chalain>
(newline))
03:17
<@McMartin>
That's Scheme, not Common LISP
03:17
<@McMartin>
Otherwise you could have used format~
03:17
<@Chalain>
Yeah, it's MIT Scheme. I've downloaded it but haven't installed it. So far Guile is worky enough.
03:18
<@Chalain>
I suspect I could write a display method that takes a list instead of one argument. By "could", of course, I mean "one day I will be able to".
03:18
<@Chalain>
I have never met a programming language so dang hard to learn as Scheme/Lisp.
03:19
<@Chalain>
I have spent literally 10 hours studying this language, and though I can do math and can pick apart the hanoi program and understand it, I cannot write the language yet.
03:20
<@Chalain>
McMartin: also, back in 1986, apparently they didn't make a distinction between Lisp and Scheme.
03:21
<@Chalain>
Though perhaps the distinction is not between Lisp and Scheme so much as *Common* Lisp and Scheme.
03:22
<@Chalain>
But yeah. This language is seriously a headjob.
03:22
<@McMartin>
I'm supposed to be writing something else, don't make me hunt down when Scheme and CLISP are done
03:22
<@Chalain>
Hehehe
03:22
<@McMartin>
Actually, if you're going to play with mind-breaking LISP-like languages, I'd suggest SML or OCaml.
03:23
<@Chalain>
Really. Why?
03:23
<@McMartin>
The ML languages are statically typed (and use type inference to handle declarations), and OCaml, at least, will compile to native code that rivals C++.
03:23
<@Chalain>
Ooh, cool.
03:23
<@McMartin>
Different class from the LISPs, though.
03:24
<@McMartin>
Scheme is the traditional one you learn to gain Enlightenment with. Or, uh, work through SICP.
03:24
<@McMartin>
(I also recommend Bigloo)
03:24
<@Chalain>
I will put them on my "to look at" languages then. Right now I'm doing Lisp for my head, not for my computer. I've been told by several people over the course of the year that my Java/Python/Ruby/C++/etc coding will benefit immensely from learning Lisp.
03:24
<@McMartin>
Yes.
03:24
<@Chalain>
Bingo
03:24
<@McMartin>
Python in particular, since it actually has lets you do a lot of the list tricks directly.
03:25
<@McMartin>
s/has//
03:25
<@McMartin>
map and filter both translate to Python as various kinds of list comprehensions.
03:25
<@Chalain>
I made Vornicus choke on his ice cream yesterday. I suggested that perhaps it would be fun to write a Scheme interpreter in Java and include it in our product... as an easter egg.
03:25
<@McMartin>
The problem with a full Scheme interpreter is that you have to actually understand call/cc.
03:26
<@McMartin>
I know how to use call/cc to implement exceptions, but that is only a tiny fraction of its Awesome Power.
03:26
<@Chalain>
Yeah, I learned Python back in the 2.1 days before lc's were really robust, so for me Python was basically C++ without ::'s or ;'s.
03:26
<@Chalain>
But when I got into Ruby, WOW there was some serious power and the beginnings of enlightenment... then people told me "That's the lisp showing through".
03:26 * McMartin has a tendency to do things like "take this file, parse its contents, and sum the relevant columns into a list" in a single Python comprehension.
03:27
<@McMartin>
That's really bad form, though. One should use three or four comprehensions for that~
03:27
<@Chalain>
Heh
03:30
<@Chalain>
Actually, I can kind of visualize it. Heh.
03:30
<@Chalain>
File(foo).readlines().map(...).reduce(col[2])...
03:31
<@McMartin>
There's a strip() and an int() in there, too
03:31 * Vornicus <3 Ruby.
03:32
<@McMartin>
And then I wrote the accumulation operation as a loop because I forgot how to do it in Python generically.
03:32
<@McMartin>
If it's even a builtin.
03:33
< MSminion>
Vorn is less than three Rubys?
03:35
<@Chalain>
OH
03:35
<@Chalain>
We got to see Matz yesterday.
03:35
<@Chalain>
I got a picture with him (need to upload it) and he signed my Programming Ruby book.
03:35
<@Chalain>
I'll never wash my Ruby book again!
03:35
<@Reiver>
Vorn
03:36
<@Reiver>
Oh. NM.
03:36
< Ev3>
NM ... Oh, Vorn.
03:38
< MSminion>
Eww. I always wash my Ruby book in the dishwasher with extra bleach.
03:39 * Reiver recruits Ev3 to 'distract' his lecturer for a couple hours. And sabotage his computer. And mailserver. Yes.
03:39
< Ev3>
HAMMER! FIRE! EXPLOSIVES!
03:39
< Ev3>
I'm good at distractions and destructions.
03:39
< Ev3>
I've had much practice.
03:42
<@Reiver>
Excelent.
03:45 * ToxicFrog really should play seriously with Scheme someday, I just need a problem to solve with it.
03:48 * Chalain shakes his head.
03:48
<@Chalain>
Scheme doesn't work that way.
03:48
<@Chalain>
:-)
03:49
<@Chalain>
It's the most powerful language you never use.
03:49
< MSminion>
You can't solve problems with it?
03:49
<@McMartin>
Oh, you can
03:49
<@McMartin>
You just generally don't, because it's an interpreted language that doesn't have a huge library backing it the way Java does
03:49
<@McMartin>
So it's almost never actually the best tool for the job
03:49
<@McMartin>
But knowing how to use it makes you better with everything else.
03:49
<@McMartin>
OCaml is actually used occasionally, typically for program analysis or switching code
03:50
<@McMartin>
ML in general is very very good at stuff that OO stumbles over because most OO languages lack Multiple Dispatch
03:50
< Ev3>
Java is just ewsome :p
03:50
<@McMartin>
Java solved the DLL problem in the most general possible way. As a result, it's great for middleware.
03:50
<@McMartin>
It also, uh, has a much nicer standard library than C++'s.
03:50
< MSminion>
03:50
<@McMartin>
The STL can die in three fires.
03:51
<@Chalain>
Ev3: ROFL
03:51
< Ev3>
I don't like Java.
03:51
<@ToxicFrog>
OCaml is, um.
03:51
< Ev3>
42% :p
03:52
< Ev3>
42% of symantec's threats are smuggled in through Java.
03:52
< MSminion>
Where I live, C++ comes with an extremely extensive standard library, far more useful than Java.
03:52
<@Chalain>
McMartin: Heh. It's funny how times and (my own) opinions change. I loved the STL. Not because it was wonderful, but because it made a lot of really painful things stop hurting.
03:52
<@ToxicFrog>
I like it until I realize there is a different way of writing basic operators depending on what type the operands is.
03:52
< Ev3>
Or was that Trend Micro's?
03:52
< MSminion>
http://en.wikipedia.org/wiki/Windows_API <-- C++ standard library
03:52
< Ev3>
Anyways.
03:52
<@ToxicFrog>
Then I run away screaming.
03:52
< Ev3>
And it's very slow. >_<
03:52
< Ev3>
Smart? Sure, but it's not able to draw two lines without hogging your system.
03:52
<@McMartin>
MSminion: Let us assume that we want our code to run on any kind of useful server~
03:53
< MSminion>
Yes, yes. Doesn't your religious symbol chafe?
03:53
<@McMartin>
No, actually. Java binaries actually do run on all the systems at Stanford.
03:53
<@McMartin>
This isn't a "religious symbol" issue.
03:53
<@McMartin>
Ev3: That's because Java's being used, in part.
03:53
<@ToxicFrog>
Also, ocaml's habit of snarfing one bit from each primitive for garbage collection looks...irritating.
03:53
< MSminion>
Not in the way you're thinking.
03:53 * ToxicFrog wanders off to look at ML to see if it's any more palatable.
03:54
<@McMartin>
MSminion: Uh, if you're assuming that people only don't use Windows because of "religious issues", I'd like to direct you to my entire last 10 years in various universities
03:54
< Ev3>
And don't get me wrong. Java is incredible. I just wouldn't touch it.
03:54
< MSminion>
I'm not saying that "people" are driven by religious issues. I'm saying that YOU are.
03:55
< Ev3>
I am.
03:55
<@McMartin>
Also, my summer job in 1995 involved rewriting an ActiveX control because mistakenly used Win32's vector classes, which didn't actually behave like the spec said.
03:55
< Ev3>
But it's more wondering quizzically why people still believe in religion.
03:55
< MSminion>
You, and several other people on this network who won't bother to look past your hatred for whatever it is that you hate.
03:55
<@ToxicFrog>
...ok, clausal function definitions are tasty.
03:55
< Ev3>
I hate the blue M&Ms!
03:56
<@McMartin>
Everything I detest in languages and APIs is typically as a result of having had to work with or around them.
03:56
< Ev3>
They make your tongue go blue too.
03:56
<@McMartin>
In C++'s case particularly, it's because the language has changed incompatibly three times over my span of dealing with it.
03:56
<@ToxicFrog>
MSM, if you have nothing interesting to contribute, please take a break from what you've been doing the past week in here and stop trolling.
03:56
<@ToxicFrog>
Chalain: if Scheme doesn't work that way, what do you /do/ with it?
03:57
< Ev3>
Noodles?
03:57
< Ev3>
:p
03:57
< Ev3>
Ok, I'll go back to being bong somewhere else.
03:57
<@ToxicFrog>
Other than noodles.
03:57
<@ToxicFrog>
Although those are a worthy goal.
03:57
< Ev3>
:p
03:57
<@McMartin>
That reminds me, I need to go grocery shopping. Back later.
03:58
< MSminion>
ToxicFrog: My apologies. I had forgotten that, upon hearing statements like this, it had to obviously be ME the one trolling.
03:58
< MSminion>
<@McMartin> MSminion: Let us assume that we want our code to run on any kind of useful server~
03:58 Chalcy is now known as Chalcedon
03:58
<@ToxicFrog>
MSM: you started it.
03:58
<@ToxicFrog>
As you have done previously.
03:58
<@Chalain>
ToxicFrog: Mostly you learn amazing ways of thinking about problems and how to solve them, that you can then use in other languages.
03:58
< Ev3>
Both of you, please stop it.
03:58
< MSminion>
Not that a born-again FOSS zealot would notice anything wrong with the statement.
03:58
<@ToxicFrog>
I am not saying McM is blameless, I'm saying that you are deliberately antagonizing people.
03:58
<@McMartin>
(a) IIS has been losing market share for a long time
03:59
<@ToxicFrog>
(he's /right/, but this is a seperate issue~)
03:59
<@McMartin>
(b) Win32 is Not A Standard because it only runs on one OS series
03:59
< MSminion>
Indeed.
03:59
<@ToxicFrog>
So, if all you are doing in here is trying to piss people off and foster discord, why are you here?
03:59
<@McMartin>
(c) Code written to SDL, OpenGL, or in Java runs on all three OSes you're likely to run into in the world at large.
03:59
< MSminion>
The separate issue was what amounted to exactly the same statement last night from ToxicFrog with regards to Raif talking about DirectX. I don't have the logs (a power outage took out my comp), but the statement was essentially "I won't use DirectX because it doesn't run on a real OS"
04:00
<@McMartin>
(d) In fact, in Reasonably Real Conditions like Major Universities, Win32 and DirectX machines Are Not Available At All.
04:00
<@ToxicFrog>
Chalain: the problem is, without something to do with it, I have a hard time coming up with motivation to play with the language.
04:00
<@McMartin>
All that's necessary for that statement to be true, MSM, is for there to be a "real OS" on which it does not run.
04:00
< MSminion>
I do think I'm in the wrong place, though. I had made the mistaken assumption that a channel called #code would actually be a place to talk about coding, and not where people would casually fling their prejudices and agendas.
04:01
<@McMartin>
"Cry more, n00b."
04:01
< Ev3>
People...
04:01
<@ToxicFrog>
MSM: actually, it was "I don't use Direct3d because I don't use 3d, period, and I don't use DirectX at all because I require my software to run on Linux and OSX as well as windows"
04:01
< MSminion>
Woo. n00b. There's one I haven't been shown in a while.
04:01
< MSminion>
Very creative.
04:01
< MSminion>
Bravoo.
04:01
<@Chalain>
ToxicFrog: I know. I said exactly the same words to Reg over at Raganwald. He recommended I learn JavaScript. I was so humiliated that I went out and started learning Scheme immediately.
04:01
<@McMartin>
In case you haven't been paying any attention at all, the past three days have been devoted almost entirely to Swing APIs.
04:01
<@ToxicFrog>
And based on the way you're acting, I would think that you believed the converse.
04:01
< MSminion>
I bow to your superior wit.
04:01 * Ev3 sighs.
04:01
<@ToxicFrog>
Chalain: Javascript is not useful to me, I have no motivation to learn it~
04:01
< Ev3>
Asshats, all of you.
04:01
<@ToxicFrog>
(plus, I've used it before, so I have motivation to set it on fire)
04:01
< Ev3>
Go wear eachother.
04:02
<@Chalain>
ToxicFrog: Actually, he was serious; apparently JavaScript allows you to do "some serious functional programming" as he put it.
04:02
<@McMartin>
TF: JavaScript uses delegation-based inheritance, which is kind of cool, so I have to learn it at some point.
04:02
<@ToxicFrog>
What is delegation-based inheritance?
04:02
<@McMartin>
Er
04:02
<@McMartin>
Prototype-based.
04:03
<@ToxicFrog>
Chalain: I /should/ solve the pocket problem in Scheme at some point, though.
04:03
<@McMartin>
Instead of defining classes, you say "make me something like this object over here."
04:03
<@ToxicFrog>
McMartin: oh. I implemented that in Lua ages ago.
04:03
<@McMartin>
And then tweak that.
04:03
<@McMartin>
Yeah
04:03
<@McMartin>
But Lua, unlike JS, is not yet a major language~
04:03
<@McMartin>
And actually, before learning this, I believed the only language that did it as a core semantics thing was Self.
04:04
<@McMartin>
(Also, Lua doesn't have it as part of the core language, AIUI. I'm pretty sure you can implement it in anything with smalltalk-like objects, which should include Lua and Python)
04:04
<@McMartin>
But, uh, I need to learn JS or Self before I can be sure of this.
04:04
<@ToxicFrog>
No, it's not part of the core language.
04:04
<@Chalain>
ToxicFrog: There is an amazing set of lectures on Scheme over at http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/ .
04:04
<@Chalain>
They're about 9GB of video if you have Divx (~25GB in mpeg)
04:05
<@Chalain>
I'm on about the 3rd hour, and it's pretty cool stuff.
04:05
<@ToxicFrog>
I implemented it with a modified deep-copy function I wrote last year and some tricks to make following inheritance chains easier and stuff.
04:05 * Vornicus decides not to use the very last of his hard drive.
04:05
<@McMartin>
TF: Sounds about right.
04:05
<@McMartin>
Chalain: That was actually my first CS class at Berkeley, albeit with different lecturers.
04:05
<@McMartin>
But CS 61A is based on MIT's 6.001
04:05
<@ToxicFrog>
It was a about 50 lines, compared to the 400+ of my (unfinished!) 'classic' OO framework, too.
04:05
<@Chalain>
Cool
04:06
<@McMartin>
So, yeah, good stuff all around.
04:06 * McMartin is very much in favor of people being SICP'd.
04:06
<@ToxicFrog>
Aah, S&IoCP.
04:06
< Ev3>
Like noodles.
04:06
<@ToxicFrog>
I seem to recall McM waving the book at me some time ago.
04:07
<@McMartin>
The running joke for the entire rest of the CS program was "We don't really need to cover this, because it was in 61A"
04:07
<@ToxicFrog>
Hmm. I don't seem to have it in /static/Book
04:07
<@ToxicFrog>
s
04:07
<@ToxicFrog>
McM, was it online?
04:07
<@McMartin>
Yeah, it has its own page.
04:07
<@ToxicFrog>
Linkplz!
04:07
<@ToxicFrog>
I really should read it seriously.
04:07
<@McMartin>
Google for it; I need food.
04:08
<@ToxicFrog>
Aah.
04:08
<@Chalain>
They SICP book? The text is online
04:08
<@ToxicFrog>
And finish Lists and Lists.
04:08
<@Chalain>
Hang on, I've got it in my bookmarks.
04:08
<@Chalain>
http://www-mitpress.mit.edu/sicp/
04:08
<@McMartin>
Lists and Lists covers some evil Lexical Scope tricks that require quite a bit of pre-existing knowledge, imo.
04:08
<@ToxicFrog>
The problem with Lists and Lists is that it got to the pocket problem, and then I went "oh, I think I see how to implement this in Lua" and wandered off and forgot about L&L~
04:09
<@ToxicFrog>
pocket() may count as either lexical scope tricks or function closure tricks.
04:09
<@ToxicFrog>
Or both.
04:09
<@Vornicus>
Chalain, could you, like, burn me a copy of the lectures onto DVD?
04:09
<@Vornicus>
Please?
04:09
<@ToxicFrog>
And, er, didn't you suggest L&L as a soft introduction to Scheme?
04:09
< Ev3>
Burn me too!
04:09
<@Chalain>
Yes... but not on ONE DVD... heh.
04:09
< Ev3>
And my noodles.
04:09 * Chalain burns Ev3.
04:09 * Ev3 blazes.
04:09
<@Chalain>
WITH THE HEAT OF A THOUSAND SUNS.
04:10 * Ev3 ashes instead, then.
04:10 * Chalain laughs maniacally.
04:12 MSminion [~sysop@Nightstar-6915.hsd1.or.comcast.net] has left #code []
04:13 Ev3 [~Shemhazai@Nightstar-8502.ds1-ba.adsl.cybercity.dk] has left #Code []
04:15
<@Reiver>
TOMORROW
04:15
<@Reiver>
HAHAHAHA
04:15
<@Chalain>
WOOOOOOOOOOOT!
04:15 * Raif looks up
04:15
<@Chalain>
You got another 24 hours?
04:16
<@Raif>
DirectX is not available? I don't think I've ever been anywhere you couldn't get your hands on a windows box.
04:16
<@Reiver>
Yes.
04:16
<@Reiver>
He asked when my brother left, I said yesterday, he went "Oh. That's fine. How long do you need?" >.>
04:16
<@Reiver>
He's cool.
04:17
<@ToxicFrog>
Raif: few of the CIS labs at UG run windows.
04:17
<@ToxicFrog>
None of the servers do.
04:18
<@ToxicFrog>
Most of the labs are dual Linux/BSD, a few are dual Linux/windows or triple Linux/windows/BSD.
04:18
<@Raif>
Why would you need to run 3D on a server, out of curiosity/
04:18
<@ToxicFrog>
You wouldn't, but I figured, for completeness...
04:18
<@Raif>
ah. :)
04:19
<@Raif>
I actually wrote a kickass little game server that ran on my linux box at home for a windows game we demo'd at school.
04:19
<@Raif>
(It was my intention to demonstrate matchmaking)
04:20
<@ToxicFrog>
Heh.
04:20
<@ToxicFrog>
Here I'd probably just snag one of the CIS linux servers.
04:20
<@ToxicFrog>
That is after all what they're there for.
04:21
<@Raif>
Our ever wise (read: incompetent) admins at school decided that linux servers were too hard to administrate.
04:21
<@Raif>
By they, I mean he, we had one.
04:21
<@Raif>
So he switched to what he was comfortable with: Windows... sadly, he was equally incompetent with this.
04:22
<@Raif>
He was fired about 6 months later and replaced by a competent admin who spent the better part of a year and a half fixing the network... and eventually moving it back to linux.
04:22
<@Raif>
So we've never really had a stable linux server to shanghai. :)
04:23 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code
04:23
<@ToxicFrog>
Aah.
04:24
<@ToxicFrog>
As far as I know, the entire CIS network has one admin, but it works fine and is Linux-based.
04:24
<@ToxicFrog>
The engineering network, sadly, is entirely windows-based.
04:24
<@ToxicFrog>
It is noticeably less...useful. And responsive.
04:25
<@Raif>
Yes. This has been my experience, and the reason why our admin ended up spending an entire semester carefully pulling down servers and rebuilding them with a new OS. :P
04:26
<@ToxicFrog>
(it takes something like ten minutes to log into one of the boxes in the digital systems lab, and you can't remote into them at all from off campus)
04:26
<@Raif>
Yeah... ours was the same, though it was also partially a load balancing issue.
04:26
<@Raif>
They subnetted the school by room and not by volume.
04:26
<@Raif>
So each subnet (room) had its own dedicated pipe.
04:27
<@Raif>
The freshman lab (~200-300 machines, I think?) was invariably unusable. All the other labs worked fine.
04:27
<@Raif>
Of course, the administration, to save cost, kept trying to force us into the smelly freshman lab (I'm not kidding, there were days where I couldn't enter the room it was so pungent).
04:27
<@Raif>
So all the other ones had crap chairs and 3 year old machines. :P
04:28
<@Raif>
(3 year old machines that HADN'T BEEN MAINTAINED!)
04:28
<@Raif>
Needless to say, I don't think much of my school's administrative office.
04:34
<@ToxicFrog>
...oh man.
04:34
<@ToxicFrog>
Yeah, I can see.
04:35
<@ToxicFrog>
(oddly, the generic engineering computer lab, with 50+ computers, is much more responsive than the digital systems lab with 20 or so.)
04:35
<@ToxicFrog>
(maybe they accidentally ran 10Mbps to the digital systems lab or something)
04:42
<@ToxicFrog>
...a google for "scheme compiler" returns "www.call-with-current-continuation.org" as the first result.
04:45 * ToxicFrog idly ponders call/cc.
04:45
<@ToxicFrog>
It's a portable longjmp().
04:46
<@ToxicFrog>
Ideal for implementing coroutines, I think.
04:46
<@ToxicFrog>
And for doing hideous, mind-breaking things.
04:47
<@ToxicFrog>
Right. Not thinking about that until I'm more comfy with Scheme.
04:47
<@ToxicFrog>
And now, bed!
04:52
<@Reiver>
OK, going to reboot. My JVM has eaten my computer.
04:52
<@Reiver>
(And with it, my sanity.)
04:53
<@McMartin>
TF: It's good for exceptions, too
04:53
<@McMartin>
The thing about call/cc is that said continuation can be invoked multiple times.
04:53 Reiver [~reaverta@IRCop.Nightstar.Net] has quit [Quit: Rebooting. Java ate my brain and my RAM.]
04:56
<@ToxicFrog>
Yes.
04:56
<@ToxicFrog>
Must write this down before I sleep.
04:57
<@ToxicFrog>
Solution to parent-following problem in oolua is abuse of function closures to bind this[".parent"] to the functions at finalization time.
04:57
<@ToxicFrog>
Should have thought of this months ago.
04:58
<@ToxicFrog>
this has all kinds of implications for inheritance and how the fiddling of __index works, though.
04:58
<@ToxicFrog>
Must think on this more tomorrow, or on the weekend.
04:58
<@ToxicFrog>
And now slwwp.
04:59
< Janus>
God Speed Mr. Frog.
05:00 Reiver [~reaverta@Nightstar-3791.ubs-dsl.xnet.co.nz] has joined #Code
05:01 mode/#code [+o Reiver] by ChanServ
05:04 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: Jouets de Dieu, jouets de jouets, jouets de Clairvoire. To the world, awaken, the one just for --]
05:23 EvilAwayLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
05:36
<@Reiver>
Y'knwo.
05:36
<@Reiver>
I am suddenly wondering why I'm not just trashing the entire TimerHandler object and recreating it instead of having methods inside to trash and recreate each variable every time~
05:38 EvilAwayLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
05:40
<@Reiver>
...Because that is sorta tricky to set up in the current structure, that's why. Right.
05:51 MahalWORK is now known as Mahal
06:05 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Killed (NickServ (GHOST command used by Forjeh))]
06:06 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
06:20 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
06:20 mode/#code [+o Chalcy] by ChanServ
06:20 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Killed (NickServ (GHOST command used by Chalcy))]
06:23 ChalcyGone [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
06:23 ChalcyGone is now known as Chalcedon
06:24 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Killed (NickServ (GHOST command used by Chalcedon))]
06:42 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
06:42 mode/#code [+o Chalcy] by ChanServ
06:42
<@Vornicus>
Dammit. I can't help Reiver with his program because I can't get java 5 for osx panther
06:44 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
06:44 EvilAwayLord is now known as EvilDarkLord
07:00 Chalcy is now known as Chalcedon
07:02 You're now known as TheWatcher
07:19 Thaqui [~Thaqui@Nightstar-8027.adsl.xtra.co.nz] has joined #code
07:20 Vornicus is now known as Vornicus-Latens
07:30 EvilDarkLord is now known as EvilInTransitLord
07:52
<@Reiver>
McMartin? I hate to ask, but a Timer() is giving me grief of a most arcane kind.
07:54
< Thaqui>
does anyone have an opinion on Anjuta?
07:54
<@Reiver>
?
07:55
< Thaqui>
a C++ IDE
07:55
<@TheWatcher>
been ages since I tried it, so not really
07:55
< Thaqui>
Well, I'd like to program in an IDE.
07:55
< Thaqui>
linux would help
08:15 You're now known as TheWatcher[afk]
09:32 Chalcedon is now known as ChalcyZzz
09:42 You're now known as TheWatcher[wr0k]
10:30
<@Reiver>
ToxicFrog, I have no idea when you wake up so I am poking you anyway.
12:27 ChalcyZzz [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
12:33 Thaqui [~Thaqui@Nightstar-8027.adsl.xtra.co.nz] has quit [Client exited]
13:05 Ev3 [~Shemhazai@Nightstar-8502.ds1-ba.adsl.cybercity.dk] has joined #Code
13:15 EvilInTransitLord is now known as EvilDarkLord
13:16 Thaqui [~Thaqui@Nightstar-8486.adsl.xtra.co.nz] has joined #code
13:30 Thaqui is now known as ThaquiSleep
14:26
<@ToxicFrog>
MY ORGANS!
14:27
<@ToxicFrog>
Hmm. I think this actually results in a performance increase in classic OO.
14:28
<@Reiver>
TOXIC!
14:28
<@Reiver>
You mean the fact it Doesn't Work(tm) and thus craps out?
14:28
<@Reiver>
:p
14:31
<@Reiver>
Um
14:31
<@Reiver>
I did the code like you suggested
14:31
<@Reiver>
And it broke.
14:31
<@Reiver>
Utterly.
14:31
<@Reiver>
Um.
14:31
<@Reiver>
You able to give a hand?
14:31
<@Reiver>
I just need to get it fixed so I can commit, and then go to bed.
14:31
<@Reiver>
Before Chalain eviscerates me with a spork for being up late.
14:31
<@Reiver>
>.>
14:37
<@ToxicFrog>
No, no the idea I just came up with last night.
14:37
<@ToxicFrog>
About using function closures to bind super.
14:37
<@Reiver>
...Oh. Ok.
14:38
<@Reiver>
Um
14:38
<@ToxicFrog>
Anyways. How is the Java not working?
14:38
<@TheWatcher[wr0k]>
Timer appears to lie like a lying thing
14:38
<@Reiver>
The bug is this:
14:38
<@Reiver>
public static void renewTimer() {
14:38
<@Reiver>
t.cancel();
14:38
<@Reiver>
t.purge();
14:38
<@Reiver>
t = null;
14:38
<@Reiver>
t = new Timer();
14:38
<@Reiver>
}
14:38
<@Reiver>
(t being a Timer() object)
14:39
<@Reiver>
First run through of the alarm object, when everything is set up, it's fine.
14:39
<@Reiver>
Second time through, when that has supposedly wiped the Timer object completely, it gives an error:
14:39
<@Reiver>
"Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Task already scheduled or cancelled"
14:39
<@Reiver>
AKA: The old timer, bespite being .cancel()'d, .purge()'d, turned to null and a new object created entirely, is still apparently in the system, and jamming up the works. >.<
14:39
<@Reiver>
Or at least AFAICT.
14:39 * Reiver really has no idea.
14:39
<@ToxicFrog>
What's the code actually doing?
14:39
<@ToxicFrog>
Oh.
14:39
<@ToxicFrog>
There's the problem.
14:40
<@ToxicFrog>
...wait, no, that's not the problem.
14:40
<@ToxicFrog>
Hrm,.
14:40
<@Reiver>
It is Woe!
14:40
<@Reiver>
Woe and spiders
14:40
<@ToxicFrog>
Well, ok, we have two things.
14:40
<@Reiver>
We do?
14:40
<@ToxicFrog>
(1) Why are you destroying and recreating the timer in the first place?
14:41
<@ToxicFrog>
(2) does Java have some way to explicitly delete stuff rather than waiting for the garbage collector? I can't remember.
14:41
<@Reiver>
So it is renewed!
14:41
<@Reiver>
Um
14:41
<@Reiver>
Because once you've changed data and need to refresh the timer, you need to purge what is in it already.
14:41
<@TheWatcher[wr0k]>
TF: 2 - no. you can advise the gc to run using System.gc(), but simply setting somethign null doesn't force removal
14:41
<@Reiver>
But once you .cancel a timer, it appears to not like being restarted.
14:42
<@Reiver>
So I was trashing the old one and starting with a new one.
14:42
<@Reiver>
And I tried .gc() to no avail.
14:42
<@TheWatcher[wr0k]>
The operative word here being "advise"
14:42
<@Reiver>
Alas.
14:42
<@Reiver>
;_;
14:42
<@ToxicFrog>
TW: I know setting it to null won't work, I mean a delete operator to force calling the destructor or something.
14:42
<@TheWatcher[wr0k]>
Nope
14:42
<@ToxicFrog>
Reiver: ...butbutbutbut.
14:43
<@ToxicFrog>
Why are you deleting the /entire timer/
14:43
<@ToxicFrog>
?
14:43
<@ToxicFrog>
If you've changed a task you need to refresh /that task/
14:43
<@TheWatcher[wr0k]>
Becuase you can't add events back onto a cancelled one apparently
14:44
<@TheWatcher[wr0k]>
and if he removes an event then he needs to do it anyway - there's no way to unschedule something from a timer, only cancel the whole thing
14:44
<@ToxicFrog>
....yes there is.
14:45
<@ToxicFrog>
As stated in my earlier design.
14:45
<@ToxicFrog>
TimerTask tt;
14:45
<@ToxicFrog>
Timer tr;
14:45
<@ToxicFrog>
tr.schedule(tt, tt.timedateofexecution);
14:45
<@ToxicFrog>
tt.cancel()
14:45
<@ToxicFrog>
tr.purge()
14:45
<@TheWatcher[wr0k]>
Ah
14:45
<@Reiver>
You can't do that.
14:45
<@Reiver>
...Oh, wait
14:46
<@ToxicFrog>
Calling TimerTask::cancel() cancels that task.
14:46
<@TheWatcher[wr0k]>
right
14:46
<@ToxicFrog>
Calling Timer::cancel() cancels everything registered with that timer.
14:46
<@Reiver>
We're cancelling the TimerTask
14:46
<@ToxicFrog>
Yes!
14:46
<@Reiver>
I, um.
14:46
<@Reiver>
Missed that bit. >.<
14:46 * Reiver hangs head in shame.
14:46 * ToxicFrog facedesks
14:46
<@Reiver>
I got the rest of it!
14:46
<@Reiver>
Just not that bit. Er.
14:46
<@ToxicFrog>
Also, I just realized the documentation is ambiguous.
14:46
<@TheWatcher[wr0k]>
no shit
14:46
<@ToxicFrog>
It might not be possible to cancel a TimerTask and then readd it.
14:46
<@Reiver>
And the documentation said it should be okay and... yes...
14:47
<@Reiver>
...I'll try.
14:47
<@ToxicFrog>
You might need to cancel it, then create a new one and add that.
14:47
<@Reiver>
Where am I canceling the old timertask again?
14:47
<@Reiver>
Stupid question, but I want to get this right
14:47
<@ToxicFrog>
In which case, Appointment should own a pet TimerTask rather than being one.
14:47
<@Reiver>
hrmm.
14:47 * TheWatcher[wr0k] really, really thinks this would be far easier just to make a class that simply sits in a sleep() loop and scans the appointment list periotically
14:47
<@ToxicFrog>
When a modification is made that requires it to be removed or rescheduled.
14:48
<@ToxicFrog>
TW: it's not.
14:48
<@ToxicFrog>
Or at least, it wouldn't be if it was written using Timer from the start.
14:48
<@ToxicFrog>
...and if the documentation didn't suck.
14:48
<@TheWatcher[wr0k]>
yes
14:48
<@TheWatcher[wr0k]>
exactly
14:48
<@TheWatcher[wr0k]>
however, it wasn't,. it does, and Reiv has to have this in a 5pm tomorrow
14:48
<@Reiver>
me has been fighting the documentation all along, if that helps exonerate anyone at all. >.>
14:48
<@ToxicFrog>
Which is why we have pthreads!
14:48
<@Reiver>
So, uh
14:49 * ToxicFrog eyes yum.
14:49
<@Reiver>
Which bit of the whatnow is the timertask being cancelled from? My Appointments are my timertasks, so...
14:49
<@ToxicFrog>
There's a Scheme IDE, but not a plain Scheme terp?
14:49
<@Reiver>
I'm cancelling my appointments, right?
14:49
<@ToxicFrog>
Reiver: something like:
14:49
<@ToxicFrog>
Appointment::changeTimeDate(timedate) {
14:49
<@ToxicFrog>
// fiddle internal data structures
14:50
<@ToxicFrog>
this.cancel()
14:50
<@ToxicFrog>
T.schedule(this, timedate)
14:50
<@ToxicFrog>
end
14:50
<@Reiver>
Oh. Nice.
14:50
<@Reiver>
OK.
14:50
<@ToxicFrog>
Assuming that cancel-and-readd is possible.
14:50
<@Reiver>
We're about to find out!
14:50
<@ToxicFrog>
Which, as stated earlier, the docs leave undefined.
14:55 * Reiver ponders.
14:56
<@Reiver>
Is that all the code I need? Or does my AppointmentHandler still need to be able to handle the timer at the other end in various ways?
14:56
<@ToxicFrog>
"at the other end"?
14:57
<@Reiver>
Er. when the program initially loads, when things finish, etc
14:59
<@ToxicFrog>
Um. When the program starts up, the Timer needs to be created and any saved appointments loaded. When an appointment is loaded or created, it needs to call T.schedule() to schedule itself. But you know that already.
14:59
<@ToxicFrog>
When things finish I believe it needs to call T.cancel() to shut down the timer thread or it'll stay running in the background with wacky side effects.
15:00 * Reiver nod.
15:00
<@Reiver>
OK.
15:00
<@Reiver>
I just wanted to check this.
15:00
<@Reiver>
Just in case, kinda deal. >.>
15:01 * Reiver has had enough of missing stupid little things, like cancelling the wrong object. >.<
15:05
<@ToxicFrog>
Hmm.
15:05
<@ToxicFrog>
The official build of MIT Scheme DFW.
15:05
<@TheWatcher[wr0k]>
woe
15:06
<@Reiver>
Nope!
15:06
<@Reiver>
"Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Task already scheduled or cancelled"
15:06 * Reiver woe.
15:06
<@Reiver>
So we need to do something a little more complicated.
15:06
<@ToxicFrog>
Indeed.
15:06 * Reiver pokes TF hopefully?
15:07 * Reiver also offer cookie by way of bribery.
15:07 You're now known as TheWatcher[afk]
15:07
<@ToxicFrog>
By any chance, has Java suddenly gained support for function closures in the past five minutes?
15:07
<@Reiver>
Probably not!
15:07
<@Reiver>
Java is fun like that.
15:07
<@ToxicFrog>
Well, fuck.
15:07
<@Reiver>
>.>
15:07
<@ToxicFrog>
Ok then, we have something like this.
15:07
<@Reiver>
I gather that was plan B?
15:07
<@Reiver>
ok
15:07
<@ToxicFrog>
It was plan A.
15:08
<@ToxicFrog>
"Use Java" is somewhere around plan L.
15:08
<@ToxicFrog>
"Use Java with Timer/TimerTask" is plan L(a).
15:08
<@ToxicFrog>
- Appointment no longer extends TimerTask
15:08
<@ToxicFrog>
- there is a very simple class that extends TimerTask. It has a reference to Appointment. run() simply calls Appointment::run()
15:09
<@ToxicFrog>
- each Appointment owns one of these, recreating it each time it's scheduled.
15:09
<@ToxicFrog>
So we get something like:
15:09
<@ToxicFrog>
class ATT extends TimerTask {
15:09
<@ToxicFrog>
Appointment owner;
15:09
<@ToxicFrog>
ATT(Appointment _owner) { owner = _owner; }
15:09
<@ToxicFrog>
void run() { owner.run(); }
15:09
<@ToxicFrog>
}
15:10
<@ToxicFrog>
And then, inside Appointment:
15:10
<@ToxicFrog>
// on creation
15:10
<@ToxicFrog>
MyPetATT = new ATT(this);
15:10
<@ToxicFrog>
T.schedule(MyPetATT, MyTimeAndDate);
15:10
<@ToxicFrog>
// on reschedule
15:10
<@ToxicFrog>
MyPetAtt.cancel();
15:10
<@ToxicFrog>
MyPetAtt = new ATT(this);
15:11 You're now known as TheWatcher[wr0k]
15:11
<@ToxicFrog>
T.schedule(MyPetATT, MyTimeAndDate);
15:11
<@ToxicFrog>
Basically, each Appointment owns a very tiny AppointmentTimer that just calls the Appointment's run() method.
15:11
<@ToxicFrog>
When it needs to reschedule, it cancels that, deletes it and creates a new one and schedules that.
15:15
<@Reiver>
...Right.
15:16
<@Chalain>
Uh oh.
15:16
<@Chalain>
Somebody's still awake at 3:16am.
15:16
<@Reiver>
So we are in fact back to having an Alarm object, like Chalain suggested two days ago but I pointed out there was no OO reason for it because they'd map one-to-one with Appointments~
15:16
<@Reiver>
No I'm not!
15:16
<@Reiver>
I'm sleepwalking!
15:16
<@Reiver>
>.> <.<
15:16
<@Chalain>
Heh
15:16
<@Chalain>
Sleepcoding?
15:16
<@Reiver>
It would explain all the bugs.
15:16
<@Reiver>
*cough*
15:17
<@Reiver>
I got a pretty calendar mostly done, though.
15:17
<@Reiver>
It needs two more ActionListeners, and to actually, err, search appointments properly, but
15:17
<@Reiver>
It's /pretty/
15:17
<@Reiver>
That's the main thing right? *cough*
15:18
<@Chalain>
That's a big part of it, yes.
15:20
<@Reiver>
Um
15:20
<@Reiver>
I'm just trying to get the timers working.
15:21
<@Reiver>
ANd then I'm going to bed honest.
15:21
<@Reiver>
...Not that I actually trust myself to write origional code at the moment...
15:21
<@Reiver>
So maybe I should leave TF's suggestions (Thankyouthankyou TF!) until morning, and sanity?
15:22
<@TheWatcher[wr0k]>
sanity? wassat?
15:22
<@Reiver>
...Yes, I'll do that. It's no more broken now than it was earlier this evening, so what the hell.
15:24
<@ToxicFrog>
Reiver: yes, we are back to having an Alarm object.
15:24
<@ToxicFrog>
Java 4tl.
15:24
<@ToxicFrog>
And yes, sleep would probably be good.
15:24
<@Reiver>
Hrm.
15:25
<@Reiver>
You liable to be around in ~8 hours?
15:27
<@ToxicFrog>
Yes.
15:27
<@ToxicFrog>
That's ~1830 local.
15:27
<@Reiver>
Awesome.
15:27
<@ToxicFrog>
I'll be here fiddling with either Scheme or Lua.
15:27
<@Reiver>
I may, er, need to bug you for more help on the Timer() stuff.
15:27
<@Reiver>
You seem to be one of the few people that know what the hell the thingy class needs to do to work, so >.>
15:27 * Reiver huggles the frog.
15:28
<@Reiver>
Nini!
15:28 Reiver is now known as ReivZzz
15:28
<@ToxicFrog>
Which is kind of depressing since I don't like Java and haven't used it in...three years.
15:28
<@ToxicFrog>
(and haven't used it /willingly/ in eight)
15:30
<@ReivZzz>
TF: I suspect most people avoid such things in Java, and use another language when such matters are actually needed~
15:31
<@ReivZzz>
And now? SLEP
15:32
<@ReivZzz>
(Thank you for the help java augh sigh *flomp*)
15:34 * TheWatcher[wr0k] does still wonder how people write real applications in Java and remain sane, tried it twice, never again
15:37
< EvilDarkLord>
You have met these people after the time of writing?
15:37
<@TheWatcher[wr0k]>
Um, no actually
15:37
<@TheWatcher[wr0k]>
Only heard that such creatures exist
15:38
< EvilDarkLord>
Must be a rumor spread by Sun.
15:38
<@TheWatcher[wr0k]>
Sssh, not so loud or they'll co...arrgh
15:38 You're now known as TheWatcher[afk]
15:40
< Ev3>
Reivs: Java.swing.timer and action listener he says.
15:49
<@ReivZzz>
Ah. We were using that, Ev3. Thank you anyway.
15:49
<@ReivZzz>
Note to self:
15:49
< Ev3>
I got more tomorrow.
15:49
<@ReivZzz>
When removing an old .zip so you can create a new one from a folder tree
15:49
<@ReivZzz>
Delete the zip, not the folder
15:50 * ReivZzz is for once in his life actually glad there is a recycle bin. o.o
15:50 * ReivZzz has never needed it before, blames it on tired. :p
15:50 * ReivZzz collapse! Ni.
15:50
< EvilDarkLord>
Ni.
15:55
<@ToxicFrog>
...why would you need to remove the old archive in the first plcaE?
16:02 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
16:12 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
16:26
<@Vornicus-Latens>
...why is it that the moment I say something about how SGI is dying, they finish a reorg and come out from under chapter 11 bankruptcy?
16:36
<@ToxicFrog>
Sweet.
16:41
<@Vornicus-Latens>
...though with only $100M in revenue last year, I don't know how they're going to get anything awesome done.
17:13 You're now known as TheWatcher
17:18
<@McMartin>
They could, like, actually update OpenGL~
17:29 * Chalain pokes McMartin
17:29
<@Chalain>
Question for you.
17:30
<@McMartin>
I need to run soon, but shoot
17:31
<@Chalain>
You've mentioned that you don't like mixins; I'm taking this as a sign that you have a workaround for not having them. Consider the Observer design pattern. The Subject has three methods: addObserver(O o) { obs.add(o); }, removeObserver(O o) { obs.remove(o); } and notifyAll() { for (O o: obs) { o.notify(); }
17:31
<@Chalain>
Now, Observer has to be an interface because you can't specify notify() beforehand; but Subject is completely canned.
17:31
<@Chalain>
This would be a perfect place for a mixin.
17:32
<@Chalain>
Is there a good way to not have to just cut and paste that code every time you implement Subject?
17:32
<@McMartin>
I tend to do things that "require" mixins with Views or with flags.
17:32 * Chalain notes that he already has a huge class hierarchy going pretty much back to Object, and it doesn't make sense for everything to inherit for SubjectObject, so single inheritance kind of scroodles that line of attack)
17:32
<@Chalain>
views?
17:33
<@McMartin>
I'd have to study the Observer pattern (which I actually don't use a whole lot) to know if that trick applies here or not.
17:33
<@McMartin>
What you describe sounds like a place for parameterized types on my first blush at it.
17:33
<@Chalain>
Well, it's a general case; in C++ you'd use a self-template (class Foo : public Subject<Foo>).
17:34
<@McMartin>
Right
17:34
<@McMartin>
I'll get back to you on that; I need to (a) get to lab, and (b) order pizza for the lab, in rapid succession
17:35
<@McMartin>
Then I'll actually, like, have access to my GOF book, too.
17:35
<@Chalain>
kk
17:35
<@Chalain>
GOF just uses an interface
17:38
<@Chalain>
Also, once you address "views?", my next question is "flags?" :-)
17:39 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has joined #code
17:39 mode/#code [+o Vornicus] by ChanServ
17:41 * Chalain squeaks the Vornicus.
17:41
<@Chalain>
Do we have any blank DVD's lying around?
17:42
<@Vornicus>
Not unless you have a pile of them; the only thing we have in the cabinet is CDs.
17:44
<@Vornicus>
(I'd looked for DVDs first until I realized that the SVN dump could be zipped - and at 80% compression)
17:46
<@Chalain>
HEH
17:46
<@Chalain>
ok.
17:46
<@Chalain>
Well, what I may just do is put these videos up on Petey
17:46
<@Chalain>
Then you can snag 2-3 (they're an hour apiece) and cart them home.
17:47
<@Chalain>
They are all under 620MB (but most are ~500+ so you won't get 2 on a CD)
17:49
<@Vornicus>
Eh. If that's the choice, I'll just download them at home - my problem is capacity, not bandwidth.
17:49
<@Chalain>
Ah, ok
17:50
<@Chalain>
They're 8.9G
17:50
<@Chalain>
Also, I'm probably going to start showing them here at work.
17:50
<@Vornicus>
Yeah - I only have 3G of space left. I needs me a new hard drive.
17:50
<@Chalain>
They're just knocking my head right off my shoulders.
17:50
<@Vornicus>
Impressive stuff, then.
17:50
<@Chalain>
Lecture 2A, which is THE SECOND DAY OF CLASS...
17:51
<@Chalain>
he says, "So we can write a function to take a derivative easily enough... but what if we could abstract the process of deriving?" and ZOOP! He writes a function that take f() as an argument and returns THE FUNCTION f'().
17:51
<@Chalain>
And I said,
17:51
<@Chalain>
!!!!!!!!
17:51
<@Vornicus>
Awesome, ain't it.
17:57 You're now known as TheWatcher[afk]
18:38 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code
18:53
<@McMartin>
Higher order functions rule.
18:53
<@McMartin>
And I misremembered where my GOF book is.
18:53
<@McMartin>
But!
18:53
<@McMartin>
Views.
18:54
<@McMartin>
One of the reasons I dislike mixins is that they tend to make people cast their model classes to 14 different types as needed.
18:55
<@McMartin>
I prefer to have buffer classes that can be returned with methods like asType1(modelClass) and asType2(modelClass)
18:55
<@McMartin>
For Observers specifically, I have recalled that different listeners are listening for different things, so if you go about it the Java way you don't really even get a master Observer/Listener class at all, much less a Subject one.
18:56
<@McMartin>
The "flags" thing is more my irritation with the TADS 3 library.
18:56 * Vornicus shuts down so he can replace his computer's plug so he can get another outlet available.
18:56
<@McMartin>
If you've got Thing, and its two subclasses LockableThing and Container, and then you find yourself defining a new type LockableContainer, you shouldn't have been using inheritance at all
18:57
<@McMartin>
Because clearly Lockable and Container are boolean fields inside Thing.
18:57 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has quit [Quit: ]
19:09 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has joined #code
19:09 mode/#code [+o Vornicus] by ChanServ
19:11
<@Vornicus>
there.
19:11
<@Vornicus>
Now I have two monitors plugged into computers.
19:13 You're now known as TheWatcher
19:20 * Syloqs-AFH golf claps
19:21
<@Vornicus>
:P
19:44
<@ToxicFrog>
Chalain: higher-order functions are the kind of thing that are really awesome the first time you see them, and then after using them for a year you find it confusing that they could be at all surprising~
19:47 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
19:47 mode/#code [+o Chalcedon] by ChanServ
19:50
<@Chalain>
ToxicFrog: Yeah.
20:03 Misses4ever [~misses4ev@Nightstar-16493.adsl-212-72-153-237.sanet.ge] has joined #Code
20:07 * ToxicFrog pokes Scheme with a stick.
20:08
<@ToxicFrog>
Why is (let ((foo 2)) (define bar foo)) invalid?
20:10
<@ToxicFrog>
Aah, there we go.
20:11
<@ToxicFrog>
Now why can't newpocket refer to itself?
20:11
<@ToxicFrog>
Clearly there is some subtlety in Scheme's lexical scoping rules at work here that I don't understand.
20:17
<@ToxicFrog>
Hah!
20:18
<@ToxicFrog|Lab>
(define pocket (let ()
20:18
<@ToxicFrog|Lab>
(define (newpocket store)
20:18
<@ToxicFrog|Lab>
(lambda (x)
20:18
<@ToxicFrog|Lab>
(cond ((= x 0) store)
20:18
<@ToxicFrog|Lab>
(else (newpocket x)))))
20:18
<@ToxicFrog|Lab>
(newpocket 8)))
20:18
<@ToxicFrog>
Victory is mine!
20:20
<@Vornicus>
victoly
20:21
<@ToxicFrog>
Sweet function-closure-flavoured victory.
20:22 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
20:22 mode/#code [+o Chalcy] by ChanServ
20:23 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Killed (NickServ (GHOST command used by Chalcy))]
20:23 * ToxicFrog staples Chalcy to the network
20:23 Chalcy is now known as chalcedon
20:23
<@chalcedon>
thanks TF, I don't know that it'll work that well though
20:24
<@ToxicFrog>
Have a function closure.
20:24
<@chalcedon>
...a function closure?
20:24 * Vornicus gets out the stoatburger cannon.
20:24 * Vornicus fires stoatburgers to the thronging crowd.
20:24 chalcedon is now known as Chalcedon
20:25 * EvilDarkLord nroms.
20:25 * Chalcedon grabs and nroms a stoatburger
20:25
< EvilDarkLord>
(I'm still completely mystified by the concept of a stoatburger)
20:26 * Chalcedon eyes her connection
20:26
<@ToxicFrog>
Chalcy: Umm. How can I explain this.
20:26
<@Vornicus>
It's a burger. made of stoat.
20:27
<@Chalcedon>
do you mean the bracket on the end of a function?
20:27
<@ToxicFrog>
It's a function defined in a scope where it has access to local variables, but called from outside that scope, while still having access to those variables.
20:27
<@ToxicFrog>
Eg,
20:27
<@ToxicFrog>
function foo()
20:27
<@ToxicFrog>
local bar = 5; -- can't be accessed from outside foo
20:28
<@ToxicFrog>
local function moby()
20:28
<@ToxicFrog>
print(bar);
20:28
<@ToxicFrog>
end
20:28
<@ToxicFrog>
moby(); -- displays '5'
20:28
<@ToxicFrog>
return moby;
20:28
<@ToxicFrog>
end
20:28
<@ToxicFrog>
global_moby = foo(); -- foo returns the internal local function moby
20:29 * Vornicus tries winamp's command line music playing ability.
20:29
<@ToxicFrog>
print(bar); -- displays 'nil' because bar isn't defined except inside foo
20:29
<@Vornicus>
sweeeeeeeeeeeeeeeeet
20:29
<@ToxicFrog>
global_moby(); -- displays '5' because it is associated with the bar inside foo
20:29
<@Chalcedon>
ok, I think I get that.
20:30
<@ToxicFrog>
Moby is a function closure binding 'bar' as it is seen inside foo - the scope where moby was declared - rather than as it is seen in the global scope - the scope where moby is called.
20:30
<@Chalcedon>
global_moby calls foo() and thus the local functions within it, but you cant call the local functions from within foo() (because they're local and not global)
20:30
<@ToxicFrog>
No.
20:30
<@ToxicFrog>
global_moby is the function returned by foo.
20:30
<@ToxicFrog>
Hence the name.
20:30 * Chalcedon rereads
20:31
<@ToxicFrog>
foo() returns moby when called.
20:31
<@ToxicFrog>
Moby is a function declared inside foo.
20:31
<@ToxicFrog>
Moby refers to bar, which is a variable local to foo. It can do this because it was declared inside foo as well.
20:31
<@ToxicFrog>
However, by calling foo(), it returns moby, and this lets you call moby from /outside/ foo.
20:32
<@ToxicFrog>
And when you do this, you still get the value of bar from inside foo.
20:32
<@ToxicFrog>
Familarity with the ideas of first-class functions and higher-order functions helps here.
20:32
<@Chalcedon>
yes :)
20:33
<@Chalcedon>
I think I get it.
20:33
<@ToxicFrog>
The idea is basically that a function closure is a function that carries with it, in a sense, the scope in which it was declared.
20:33 * Chalcedon needs to do some more formal learning on programming
20:33
<@ToxicFrog>
So it can refer to variables inside that scope, even if that scope isn't accessible from where the function is actually called.
20:33 * EvilDarkLord needs to grasp the simplest of details in C++. Anyone know of a good starting place?
20:34
<@ToxicFrog>
Lua or Python~
20:34 * Chalcedon gives TF a cookie
20:34 * ToxicFrog nibbles it
20:34
< EvilDarkLord>
A pox on you.
20:35
<@ToxicFrog>
EDL: in all seriousness, I don't know of any good places to learn C or C++.
20:35
<@ToxicFrog>
I know of good /reference texts/, mostly section 3 of the Manual.
20:35
<@ToxicFrog>
But none of those are any good if you don't already know the language, since they're references for the standard libraries and not the language itself.
20:36 * Janus learned all he knew on the syntax from Dev-C++'s manual; blame it.
20:37 * Vornicus has a blarg sound, me now needs a yay sound!
20:37
<@TheWatcher>
EDL: go to a book shop, look through the programming section, read through several different books
20:37
<@TheWatcher>
Each book will have a different style, one might suit you while anohter doesn't
20:38
<@ToxicFrog>
I /do/ know of good places to learn Lua and Python, and for general programming they are generally superior to C++, hence the suggestion.
20:38
<@TheWatcher>
Deitel and Deitel's 'C how to program' isn't bad.
20:38
<@ToxicFrog>
If you have some problem that specifically needs C++ (device drivers?) you can safely ignore me.
20:39 aoanla [~sam@Nightstar-17202.range81-156.btcentralplus.com] has joined #code
20:39
< EvilDarkLord>
I am specifically attempting to learn enough to use the MySQL C API.
20:39
<@TheWatcher>
And And I know any numbe rof perl refs, if you want to try something Elder Horror-like
20:39
<@TheWatcher>
... why?
20:39
<@ToxicFrog>
Aah. Why the C API? What language are you working in now?
20:39 * Vornicus recommends Learn To Program, which is for Ruby, and great if you're a new programmer
20:40
< aoanla>
C, I'd assume, TF.
20:40
<@ToxicFrog>
!caps: but then why would he need to learn C++, when he's working in C to access a C API?
20:40
<@ToxicFrog>
Presumably he's working in something other than C and wants to learn C++ to bind the C API to that language.
20:40
<@TheWatcher>
EDL: there's a good chance there's some way of talking to MySQL from any language you care to choose, many of them easier than using the C API
20:41
<@ToxicFrog>
Vornicus: Ruby /still/ freaks me out.
20:41
<@ToxicFrog>
For no reason I can accurately articulate.
20:41
< EvilDarkLord>
My current programming experience is limited to... dare I say it? One course worth of java.
20:42
< EvilDarkLord>
And a bit more in scripting php.
20:42
<@TheWatcher>
.... jdbc >.<
20:42 * TheWatcher eyes Ruby
20:42 * EvilDarkLord hides?
20:42
<@TheWatcher>
Um... is it /supposed/ to be a Rebol copy?
20:42
< aoanla>
...why would Ruby freak you out?
20:43
<@ToxicFrog>
Rebol?
20:43
<@ToxicFrog>
EvilDarkLord: "jdbc"?
20:43
< Janus>
Ruby seemed like a good language I thought... what with it's objects... and variables. (for unarticulatable reasons too, supposedly.)
20:43
<@ToxicFrog>
Err.
20:43
<@ToxicFrog>
TW: "jdbc"?
20:44
< EvilDarkLord>
Java Database Connectivity.
20:44
<@ToxicFrog>
Janus: that statement applies to almost every interesting programming language and a large number of unintersting (or interesting for the wrong reasons) ones, too~)
20:44 * aoanla likes Python, personally.
20:44
<@TheWatcher>
TF: the thing used to talk to databases form Java
20:44
<@ToxicFrog>
And what's Rebol?
20:44
<@ToxicFrog>
aoanla: I don't know! Partly it's that it reminds me of Perl, but that's not all of it.
20:44
<@Vornicus>
"rebol"?
20:44
< aoanla>
http://www.rebol.com/
20:45
<@TheWatcher>
Rebol is a programming language created by Carl Sassenrath (of AmigaOS fame) http://www.rebol.com/
20:45
<@ToxicFrog>
It may be that it reminds me of Perl /and/ you can do all kinds of freaky shit with it like changing the way integers behave, so the potential for write-only code is /even greater/.
20:45
< aoanla>
Well, to be fair, most scripting languages are a little Perl-like.
20:46 * Vornicus looks at rebol
20:46
<@Vornicus>
it is guified.
20:46
<@Vornicus>
and... I can't read it.
20:47
<@ToxicFrog>
aoanla: "a little".
20:47
<@TheWatcher>
I learnt Rebol befor ePerl - in fact I used to use rebol for th ething sI use perl for, I ended up learning perl because at the time rebol's database support was crap
20:47
<@ToxicFrog>
Look at, say, lua or python.
20:47
<@ToxicFrog>
Then look at perl.
20:47
<@ToxicFrog>
Then look at Ruby.
20:48
<@ToxicFrog>
Some of this is probably irrational (the warts, for example, are used in Ruby to indicate scope, which is much more sane), but still. Freaky.
20:58
<@Vornicus>
Ruby can make some pretty scary code.
20:58
<@Vornicus>
codegolf.com has Ruby beating Perl rather more often than should be legal.
20:59
<@TheWatcher>
So can any language
20:59
<@TheWatcher>
programmers write scary coe, the language just facilittes it.
20:59
<@TheWatcher>
*facilitates
20:59
<@TheWatcher>
*code
21:00
<@TheWatcher>
(I think I'll just give up now..)
21:00
<@ToxicFrog>
Well, (1) Ruby and Perl make it much, much easier than most other languages (although RAFT probably has them beat) and (2) not every language can produce equally scary code even with deliberate effort.
21:02
<@ToxicFrog>
Python, for example, with indentation to indicate scope (may it rot in hell), prevents you from using deceptive (or no!) linebreaks and indentation.
21:03
<@ToxicFrog>
Lua uses keywords for block start/end and function overloads act as fallbacks, not replacements, so "5 + 5" always does exactly what it appears to.
21:03
<@ToxicFrog>
Etc.
21:05
< Janus>
I couldn't imagine using white space in code again, less the right margin by a mile long.
21:06
< aoanla>
It's actually rather painless.
21:06
< aoanla>
Since most people intend their code blocks anyway.
21:06
<@Vornicus>
indent?
21:07
< aoanla>
that too.
21:07
< Janus>
Aye, but it's one thing to do it to be neat, and another to be forced to it.
21:07
<@Vornicus>
If you worked for me and didn't indent your code, I would be filling out a pink slip.
21:08
< aoanla>
Janus: except that, of course, if you do it already, you don't /notice/ you're being forced to.
21:09
<@TheWatcher>
aoanla: I don't mind indenting code so much, I /do/ mind not having obvious block markers
21:10
< aoanla>
Other than the intentation, you mean?
21:10
< aoanla>
...dent.
21:10
<@TheWatcher>
yes
21:10
< aoanla>
Fair enough; and to be honest, it looks odd to me, as an originally C coder.
21:10
<@ToxicFrog>
All of my code is indented.
21:10
<@ToxicFrog>
What I object to is:
21:10
<@ToxicFrog>
(1) Having to use the indentation scheme preferred by the language designers.
21:11
<@ToxicFrog>
(2) Inheriting code from someone else who used space-indenting, or worse, mixed tab and space indenting.
21:11
<@TheWatcher>
IMO relying just on indentation is a recipe for easy logic errors
21:11
<@ToxicFrog>
The latter is vastly irritating even in languages that aren't whitespace sensitive and in Python it's hi2u billions of lines of parse errors!
21:12
< aoanla>
...what indentation scheme preferred by the language designers?
21:12 * Vornicus wants an editor that gives me 2 1/2 spaces per tab.
21:12
<@Vornicus>
four spaces
21:12
< aoanla>
You can use space or tabs or whatever you want.
21:13
<@ToxicFrog>
aoanla: Python! Your indenting has to have exactly the mapping to scope they want or your program breaks.
21:13
<@ToxicFrog>
And I know you can use either spaces or tabs.
21:13
<@ToxicFrog>
The problem is when you have multiple people working on a project, or you're taking over a project from someone else.
21:13
<@ToxicFrog>
Person A used 1 tab -> 4 space characters
21:13
<@ToxicFrog>
Person B uses 1 tab -> 4 space widths
21:14
<@ToxicFrog>
It looks fine in the editor until B tries to run it, at which point it blows up.
21:14
< aoanla>
True.
21:14
< aoanla>
And yes, that /is/ annoying.
21:14
<@ToxicFrog>
Note that of my Python experience, at least 60% has involved either:
21:14
<@ToxicFrog>
- whitespace hell as noted above
21:15
<@ToxicFrog>
- indentation hell that is perfectly readable but not valid Python because things in the same scope have been given different indents for emphasis
21:15
<@ToxicFrog>
- library hell caused by python official libraries behaving in a non-deterministic manner
21:16
<@ToxicFrog>
This has not left me well disposed to the language, or to whitespace sensitivity in general.
21:19 * aoanla is well aware of the whitespace issues.
21:19
< aoanla>
To be honest, though, it is the only problem I've had with it, ever.
21:20 * TheWatcher will just stick to perl
21:20 * ToxicFrog will, similarly, stick to Lua.
21:21 * Janus will stick with C++, in tandium.
21:21
<@TheWatcher>
(if nothing else, I find perl fits the way my mind works well.)
21:21
<@ToxicFrog>
...hmm. Something that's never really occurred to me: does Perl support first-class and high-order functions?
21:21
<@TheWatcher>
(this probably says a lot about my mind)
21:21
<@ToxicFrog>
(that scares me greatly)
21:23
<@TheWatcher>
and yes, perl certainly supports first class functions and I believe higher-order too
21:24
<@TheWatcher>
although I have never tried messing with higher ordr functions in perl, so I can not absolutely guarantee it
21:25
<@TheWatcher>
I know for certain that Perl 6 does, though
21:26
<@TheWatcher>
http://search.cpan.org/~dconway/Perl6-Currying-0.01/lib/Perl6/Currying.pm for example
21:26 Misses4ever [~misses4ev@Nightstar-16493.adsl-212-72-153-237.sanet.ge] has quit [Ping Timeout]
21:26
<@TheWatcher>
.. actually, that's a module for doing it in perl 5, so, yes
21:28 Misses4ever [~misses4ev@Nightstar-16493.adsl-212-72-153-237.sanet.ge] has joined #Code
21:39 Chalcedon is now known as ChalcyOut
21:41 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has quit [Ping Timeout]
21:55 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
21:55 mode/#code [+o Chalcy] by ChanServ
21:56 ChalcyOut [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
22:16 Ev3 [~Shemhazai@Nightstar-8502.ds1-ba.adsl.cybercity.dk] has quit [Connection reset by peer]
22:16 Ev3 [~Shemhazai@Nightstar-8502.ds1-ba.adsl.cybercity.dk] has joined #Code
22:17 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has joined #code
22:17 mode/#code [+o Vornicus] by ChanServ
22:21
<@Vornicus>
So my power went out.
22:22
<@Vornicus>
Just mine, and Jacob's, and the microwave and toaster (pop quiz! What blew the breaker?). Then just now, my power came back on.
22:22
<@Vornicus>
I have four computers next to my desk, all set to restart after a power outage.
22:22
<@Vornicus>
it goes
22:22
<@Vornicus>
WHOOOOAAAAAA
22:23
<@Vornicus>
it was /so cool/
22:23
< aoanla>
...
22:23
<@ToxicFrog>
Hee.
22:23
< aoanla>
Yes, I can imagine it is.
22:23
<@ToxicFrog>
You should see the lab at work after a power outage.
22:24
<@Vornicus>
...that must be entertaining.
22:26
<@Vornicus>
(also, there's a KVM that beeps when it changes screens, so really it went beepWHOOOAAAAAA
22:26
<@McMartin>
Hmm.
22:26
<@McMartin>
I think I have a new project.
22:26
<@Vornicus>
Is it to make the world go WHOOOOOAAAAAA and Show THem All?
22:27
< aoanla>
I hope it is.
22:27
<@McMartin>
No
22:28
<@McMartin>
It's to actually do something about something that I used to rant about in 10th grade.
22:28
<@Vornicus>
Is there any Showing THem All involved?
22:28
<@McMartin>
And which David Brin apparently ranted about in Salon a few months back.
22:28
<@Vornicus>
Well, tell us!
22:28
<@McMartin>
It used to be that in order to use a computer you had to have at least a vague freaking clue about how computers worked.
22:29
<@Vornicus>
Oh, yes.
22:29
<@McMartin>
You fire up a computer, you get a BASIC prompt.
22:29
<@McMartin>
Now, I'm not particularly fond of BASIC
22:29
<@McMartin>
I do like Python, though.
22:29 * Vornicus waves his brand-new Ruby flag
22:29
<@McMartin>
However! Python is missing most of the primitives you'd need to do the kind of stuff I did at age 12 in GW-BASIC.
22:29
<@ToxicFrog>
(or a Bourne prompt)
22:30
<@McMartin>
(Not in 1984. Not on a personal machine.)
22:30
<@McMartin>
So the goal is to make a Pygame module that provides the graphics and sound toys we had then, and make them be playable-with interactively.
22:30
<@ToxicFrog>
(in 1985 we had an AT&T UNIX system with two dumb terminals on the second floor, using the Bourne shell)
22:31
<@McMartin>
(That's not a personal machine.)
22:31
<@ToxicFrog>
(yes it was!)
22:31
<@McMartin>
(No it's not. Even if you own a Cray and are the only one who uses it, it is not a personal machine.)
22:31
<@ToxicFrog>
(we have a definition conflict, then. Moving on...)
22:32
<@McMartin>
(Stuff that was actually sold in stores to consumers, directly. The C64 and Apple ][e, at the age level I'm talking about. The ][gs, the Amiga, and a 286 running DOS 3.3 by the time I was starting high school.)
22:32
<@ToxicFrog>
(Aah.)
22:32
< aoanla>
(A PC, then.)
22:33 * Vornicus had a C64, and his first serious book was the How To Use It book for same.
22:33 * McMartin had a C64, and recovered his Programmers Guide some years ago. It holds a spot of honor on his tech bookshelf.
22:33 * Vornicus always thought the balloon sprite looked like more a skull.
22:33
<@McMartin>
Hee
22:33
<@Vornicus>
more like*
22:33 * McMartin used a hand-compiled version of that as his testbed for P65.
22:34 * ToxicFrog has never used a C64, but I approve of skull-balloons
22:34 * McMartin may have screencaps!
22:34
<@ToxicFrog>
Hell, I'm not sure I've ever /seen/ a C64.
22:34
<@ToxicFrog>
In the flesh, anyways.
22:34
<@McMartin>
http://www.stanford.edu/~mcmartin/spriteedit/screenshots/spriteedit2.png
22:35
<@ToxicFrog>
Hmm.
22:35
<@McMartin>
I kind of miss the Light-Blue On Blue.
22:35
<@ToxicFrog>
It looks more like a lightbulb that's suffered a tragic filament failure than like a balloon or a skull, IMO.
22:36
<@McMartin>
Then there was the multicolor sample sprite. The Hot Air Gorf.
22:36
<@McMartin>
http://www.stanford.edu/~mcmartin/spriteedit/screenshots/spriteedit3.png
22:36
<@ToxicFrog>
o.O
22:36
<@ToxicFrog>
(personally, I'm of two minds on the whole you-had-to-understand-computers-to-use-them thing.)
22:37
<@Vornicus>
(me too)
22:37
<@McMartin>
(I favor special-purpose machines for most things, and this claim does not apply to it.)
22:37
< aoanla>
(I note that this can be analogised to the Guns are Bad because you had to understand Bows to use them argument.)
22:37
<@ToxicFrog>
(on the one hand, a lot of the people I talk to on IRC as a matter of course wouldn't be here. On the other hand, my blood pressure would be lower and I wouldn't be constantly plotting to burn the world.)
22:38
<@ToxicFrog>
aoanla: no you didn't. Arrow goes here, hold like this, pull, release. No understanding of the underlying physical principles necessary.
22:38
<@ToxicFrog>
And yes, McM makes a compelling point.
22:38
<@McMartin>
I'm not entirely sure that programming skill causes you to actually be able to think straight, but it can't hurt.
22:39
<@McMartin>
This is also eliding the point that modern machines are actually more complicated.
22:39
<@McMartin>
The ability to juggle WinAmp, IRC, Trillian, a web browser, and your email client is a learned skill too.
22:39
<@ToxicFrog>
And, for that matter, it's a flawed analogy because a gun is not simply a more user-friendly interface for a bow, it's a fundamentally different device in the same class ("things that make holes in things at a distance")
22:40
<@McMartin>
And one, I note, that my mom hasn't picked up on, yet, and single-tasks just about everything.
22:40
<@ToxicFrog>
I had not thought of that.
22:40 * ToxicFrog tries to work out when he stopped single-tasking.
22:41
<@McMartin>
Also, the default is for programs to not take over the whole system anymore.
22:41
<@ToxicFrog>
...hmm. About the same time I started programming.
22:41
<@Vornicus>
My grandmother says "see you later" when she switches from instant messages to email in AOL.
22:41
<@McMartin>
Which is one reason the Python-GW-BASICy environment is going to be tricky.
22:41
<@ToxicFrog>
However, until then, basically all I used the system for was gaming. Which is by its nature single-tasking.
22:42
<@McMartin>
Because ideally I'd have a graphics output window and let you evaluate stuff in the normal REPL window.
22:42 * Vornicus was multitasking in 1993.
22:42
<@McMartin>
I'm pretty sure I had a few random TSRs I liked to use
22:42
<@McMartin>
But I don't think that counts.
22:42
<@ToxicFrog>
(well, ok, gaming, mail, and - following the dawn of the internet - web browsing.)
22:42
<@Vornicus>
"Hey, I can open Excel and my video games at the same time!"
22:43 * McMartin tries to recall when he got a machine capable of Win 3.1
22:43
<@McMartin>
... Wait, no.
22:43 * TheWatcher ponders, can't actually remember ever single-tasking IRL, but on a machine, Amiga500 days, so, what, 87?
22:43
<@McMartin>
It would be when I got Scream Tracker.
22:43
<@McMartin>
I'd cue up a bunch of tracks, then tell it to give me a DOS shell, and do homework with music playing
22:43
<@ToxicFrog>
For me it would have to be after we got X11, but I can't remember when that was.
22:44
<@ToxicFrog>
I know I was multitasking by 96, because at that point I had to juggle an editor, a language reference and a music source.
22:44
<@McMartin>
Yeah, 96 would about when I Knew It, too.
22:44
<@McMartin>
But before that, I think it was mostly TSRs
22:44
<@McMartin>
And occasional experiments with Not Really All That Functional Linux Distros.
22:45
<@McMartin>
Which I used mainly to play Robots and with a Common LISP system.
22:45
<@McMartin>
But '96 was when I got a system that ran Win95 and I got a real Internet connection
22:46
<@ToxicFrog>
TSRs are for single-tasking operating systems~
22:46
<@McMartin>
Yes, but you could still shell-out
22:46
<@ToxicFrog>
Hmm. I was programming deathbots in TCL before 95, but I don't know if I was multitasking at that point.
22:48
<@Vornicus>
"deathbots"?
22:49
<@ToxicFrog>
A nifty little UNIX program that had TCL-controlled deathbots duel it out with radar and grenades.
22:49
<@ToxicFrog>
I believe the actual program was "robots"
22:50
<@ToxicFrog>
I spent many a happy hour trying to make new and improved deathbots in it.
22:50
<@Vornicus>
aha
22:50
<@McMartin>
Ah, yes.
22:50 * McMartin did that in Pascal
22:50 * McMartin may in fact still have Tempest and Tracer-V floating around here somewhere.
22:51
<@ToxicFrog>
I'm fairly certain I don't have them here, but they might still be in ~ben on Ancilla.
22:52
<@ToxicFrog>
Pascal was I think my first programming language that I actually thought of as a programming language.
22:53
<@ToxicFrog>
As opposed to sh, logo, TCL, etc.
22:53
<@McMartin>
Later versions of P-Robots let you spend points on making the robots have differing characteristics.
22:53
<@McMartin>
Lower radar signatures, better sensors, faster engines, etc.
22:53
<@McMartin>
Tempest-Bot tended to die through smashing into walls, but it could outrun a lot of the missiles of other bots.
22:53
<@ToxicFrog>
Hee.
22:54
<@ToxicFrog>
This had no differing characteristics (apart from the robot's on-screen icon) and no missiles.
22:54 You're now known as TheWatcher[T-2]
22:55
<@McMartin>
Wait
22:55
<@McMartin>
What did they attack with?
22:55
<@ToxicFrog>
Grenades.
22:56
<@McMartin>
I suspect this is merely a terminology difference, viz. you specify a range and angle, and there is an explosion there after your projectile gets there?
22:56
<@ToxicFrog>
Yes.
22:56
<@McMartin>
Yeah, same thing
22:56
<@ToxicFrog>
Aah. To me, "missile" implies a seeking projectile.
22:56
<@McMartin>
The energy bombs were a different thing only in the later versions.
22:57 You're now known as TheWatcher[zZzZ]
22:57
<@McMartin>
You dropped them and could detonate them later.
22:57
<@ToxicFrog>
In particular, grenades are unguided, and furthermore travel above the battlefield, so a bot between the launcher and the target point won't set it off.
22:57
<@McMartin>
I recall somebody in my APCS class had the "Hamasbot" which ran someone down, then dropped and immediately detonated bomb payloads.
22:57
<@McMartin>
Hmm. I *think* P-Robots missiles could be intercepted, but I am not positive.
22:58
<@Vornicus>
I had a similar game for Mac, except that you had bullets and no explosives
22:58 * McMartin has a CD marked "Data Archaeology" which holds the contents of all the machines from the pre-Pentium era.
22:59
<@ToxicFrog>
I should put together something like that.
22:59
<@McMartin>
Well
22:59
<@ToxicFrog>
At the moment, we have the hard drives (still working last time we checked) in cold storage.
22:59
<@McMartin>
All the PC machines.
22:59
<@McMartin>
The Commodore disks mostly died of bit rot
22:59
<@McMartin>
But I re-pirated most of them~
23:00 * Vornicus sold two boxes full of C64 disks for $200 in 1997.
23:00
<@ToxicFrog>
Although, in truth, I can't think offhand of anything from pre-Linux Ancilla that I'd really like to still have.
23:02
<@ToxicFrog>
Oh, McM.
23:02 Misses4ever [~misses4ev@Nightstar-16493.adsl-212-72-153-237.sanet.ge] has quit [Connection reset by peer]
23:02
<@ToxicFrog>
(1) I solved the pocket problem in L&L, but I'm not sure my solution is the most elegant.
23:02
<@ToxicFrog>
(2) I remember why I stopped reading SICP last time.
23:04
<@McMartin>
L&L?
23:04
<@ToxicFrog>
Lists and Lists.
23:04
<@McMartin>
Ah
23:04
<@McMartin>
And as for (2)?
23:05
<@McMartin>
(Also, did you try reading the win message out loud?)
23:05
<@ToxicFrog>
Oh, I haven't actually entered it into the game.
23:05
<@ToxicFrog>
I just fired up mzscheme and tested it there.
23:05
<@McMartin>
Ah
23:05 * McMartin totally recommends winning Lists and Lists.
23:05
<@ToxicFrog>
(I did this while on campus earlier, so)
23:06
<@ToxicFrog>
And as for (2)...it's because the entire first fifth of the book is "here is something totally awesome you can do. We will demonstrate this in the most boring and math-heavy way possible."
23:08
<@McMartin>
Ah
23:08
<@McMartin>
So, my solution for pocket is five lines.
23:08
<@McMartin>
I could make it smaller if I got to use all of Scheme instead of L&L's subset.
23:08
<@ToxicFrog>
Hmm. Mine is six.
23:12
<@McMartin>
Pocket is mainly fun because it's essentially Everything You Need For OO.
23:17
< Syloqs-AFH>
My solutions for pocket is PANTS.
23:19 * ToxicFrog ponders that.
23:20
<@ToxicFrog>
I cannot prove the correctness of this but it feels right.
23:20
<@McMartin>
What, pants, or OO?
23:20
<@ToxicFrog>
OO.
23:20
<@McMartin>
It's one of the SICP chapters.
23:20
<@McMartin>
It was, uh, Project 3 in CS 61A~
23:21
<@ToxicFrog>
The bit on using function closures to implement data structures amuses me greatly.
23:21
<@McMartin>
Lexical upvalues kick ass~
23:22
<@ToxicFrog>
Yes.
23:22
<@McMartin>
Actually, now that I have a decent Scheme compiler, I should probably play with that stuff some more.
23:22
<@ToxicFrog>
I knew them in Lua first, but they're essentialy the same in both.
23:23
<@ToxicFrog>
I might want a link to that Scheme compiler at some point.
23:24
<@McMartin>
bigloo? It's in yum.
23:24
<@ToxicFrog>
Also, is it just me, or the do the official Linux/x86 binaries of MIT Scheme not work?
23:24
<@McMartin>
Haven't tried it
23:24
<@ToxicFrog>
Aah. You use mzscheme, or...?
23:24
<@McMartin>
I used bigloo for playing before.
23:24
<@McMartin>
Before that was, uh, 1996 and I used SCM on HP-UX.
23:24
<@ToxicFrog>
Aah,
23:26
<@McMartin>
And one heavily modified by Brian Harvey so as to have the string processing features Berkeley Logo used.
23:27 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
23:29 * Vornicus misses Save New York.
23:31
<@McMartin>
... dude, I remember that game.
23:32
<@Vornicus>
It was the second C64 game I ever played.
23:32
<@McMartin>
It's on C64.com, it seems.
23:33 * Vornicus also misses having even halfway-decent C64 emulation.
23:33
<@McMartin>
Bah! Real C64 Emulators run full-screen!
23:33
<@Vornicus>
(the only ones for Mac have either 1. non-c64 keyboard layout, or 2. totally impossible user interface.)
23:34 ThaquiSleep is now known as Thaqui
23:34
<@McMartin>
See, since the only time the UI should show up is when you're "swapping disks", I'm not seeing how (2) is a problem.
23:34
<@McMartin>
This goes double if you're autoloading the disk from the command line, too.
23:35
<@Vornicus>
I have to hold down the button to get anywhere, have to go through three submenus, oh, and if I leave the menu for even a moment it goes away and I have to start over.
23:35
<@Vornicus>
And then the file selection UI was nigh indecipherable.
23:36
<@McMartin>
At least on the X11 version, "x64 omg.prg" is all you need.
23:37
<@Vornicus>
Unless of course you have no idea at all how to get to the thing via the command line. Oh, and it started up in X11, which has been incredibly unreliable on my machine.
23:37
<@Vornicus>
Oh and and the joysticks were unconfigured and unconfigurable.
23:37
<@McMartin>
OK, that's unusual, especially if the Mac version is a port of the X11 version.
23:38
<@McMartin>
As I recall that being, like, a prominent radio button of some kind.
23:38
<@Vornicus>
the mac version /is/ x11.
23:38
<@McMartin>
Well, the current Unix version is a fairly clean GTK-based system, while you're still using context-menus, it sounds like.
23:38
<@Vornicus>
THe problem is that it has no menus at all unless you /left/ click, and then it's nazi-unnavigable.
23:38 * ToxicFrog eyes TT. This is not possible.
23:39
<@Vornicus>
TT?
23:39
<@ToxicFrog>
Two Thrones.
23:39 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
23:39
<@McMartin>
And, uh, I navigated it fine back before it got a Real UI, so I'm skeptical of "OMG COMPLETELY UNUSABLE" claims.
23:40
<@Vornicus>
My problem is that every time i left the menu by even a pixel it went away, and that was waaay too easy to do.
23:41
<@Vornicus>
especially while holding down the mouse button to keep the menu there - something Mac learned to get rid of a long time ago.
23:42
<@McMartin>
See, I can't tell whether this is "Everything that isn't the Mac UI is unusable" claims, or actual inability to perform the gestures.
23:42
<@McMartin>
Because I didn't really do the whole mouse-based-FPS thing.
23:42
<@McMartin>
But I still never, ever, ever ran into this issue.
23:43
<@ToxicFrog>
At least it's not like some Litestep themes, where (1) the menu vanishes if you leave it and (2) the 1px gap between a menu and a submenu counts as "leaving it"
23:44
<@Vornicus>
it's more along the lines of "it is the least forgiving UI I ever used ever in my entire life, and I have kinda bad aim"
23:44
<@Vornicus>
Well, actually, it's exactly like that, but there's no 1px gap
23:45
<@McMartin>
The problem, such as it is, is that everything is in menus instead of a deeply nested set of dialog boxes
23:45
<@McMartin>
It does have the humongous config file, but you aren't supposed to edit it by hand.
23:45
<@ToxicFrog>
Right, see, with this theme, moving the mouse from a menu to a submenu would cause both to vanish unless you did it faster than the poll speed of the mouse driver.
23:46
<@Vornicus>
...ow
23:47 * Vornicus hunts around for the location of the "click" sound that plays when IE refreshes a page.
23:51
< Janus>
C:/WINDOWS/Media (?)
23:54
<@Vornicus>
Rather, the location of the thing that controls what it is
23:54
<@Vornicus>
Control Panel -> Sound -> Sounds
23:54
< Janus>
Ah.
23:54
<@Vornicus>
-> WIndows Explorer -> Start Navigation
--- Log closed Sat Oct 21 00:00:03 2006
code logs -> 2006 -> Fri, 20 Oct 2006< code.20061019.log - code.20061021.log >