code logs -> 2006 -> Sat, 14 Oct 2006< code.20061013.log - code.20061015.log >
--- Log opened Sat Oct 14 00:00:59 2006
00:01
<@ToxicFrog>
dieeeeeeeeeeeeeeeeeeeeeeeeeeeee windows
00:01
<@ToxicFrog>
die die die die die die
00:02
< Janus>
It's what it does best.
00:03
<@ToxicFrog>
At the moment, what it's doing best is utterly failing to build Scintilla.
00:04
< Janus>
I would give it something easier to build first, so it can gain some confidence.
00:13 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
00:14 ReivZzz is now known as Reiver
00:16 * ToxicFrog kills the windows dynamic linker with its own entrails
00:16
<@ToxicFrog>
I am making a DLL. This means you do not have to statically link with every library it references.
00:48 * Vornicus ljposts.
01:07 * ToxicFrog foams at the brain
01:07
<@ToxicFrog>
Does anywhere here know where mingw keeps regexec() and regcomp()?
01:27 Reiver [~reaverta@IRCop.Nightstar.Net] has quit [Ping Timeout]
01:29 Reiver [~reaverta@IRCop.Nightstar.Net] has joined #Code
01:29 mode/#code [+o Reiver] by ChanServ
01:37
<@ToxicFrog>
Aaaaaaaaaaaaaaaaaaaaaaaaaargh
01:37
<@ToxicFrog>
This code works perfectly in Linux, segfaults in Windows
01:41 Chalcedon is now known as ChalcyOut
01:46
<@ToxicFrog>
...
01:47
<@ToxicFrog>
regcomp() is segfault.
01:47
<@Vornicus>
?
01:47
<@ToxicFrog>
How the hell?
01:47
<@Vornicus>
heh
01:47
<@ToxicFrog>
How is this possible unless I'm giving it bad arguments?
01:48
<@ToxicFrog>
...
01:48
<@ToxicFrog>
Ok, this is fairly impressive in a deeply unsettling way.
01:48
<@ToxicFrog>
The Linux build works fine.
01:48
<@ToxicFrog>
The Windows build, new stops working after creating five linked list elements.
01:49
<@Vornicus>
...on drugs.
01:50
<@ToxicFrog>
Now, since I'm just swapping in a new SciLexer.dll rather than replacing the whole thing, I suppose it's possible that I've generated a DLL that's subtly incompatible with the official build.
01:50
<@ToxicFrog>
Which, given the amount of persuasion I had to apply to get the damn thing to build at all in windows, is plausible.
01:53 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has quit [Quit: ]
01:54 ChalcyOut [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
01:57
<@ToxicFrog>
You know, I really want to see this project finished, but I'm on the verge of saying "fuckit" and just scrapping the whole thing.
01:58
<@ToxicFrog>
If I can't generate a working windows build, I can't use it, and I can't generate a working windows build when the allocator mysteriously commits suicide.
02:00
<@McMartin>
Death to C++, etc
02:01
< Ev3>
[171212] <ToxicFrog> This of course assumes that iexplore keeps working without explorer. If not, you end up without taskbar *or* desktop.
02:01
< Ev3>
[171456] <ToxicFrog> (out of curiosity, what's the memory footprint on iexplore while it's running the desktop, compared to explorer? I'm seeing about 9MB on explorer, providing desktop, taskbar, and fs browser, and 3MB on Litestep, providing hotkeys and multiple desktops.)
02:01
< Ev3>
It keeps working.
02:01
< Ev3>
And I'm not entirely sure, alot less in XP compared to 98 now that it's native, and not "active desktop"
02:01
<@ToxicFrog>
McM: the linux build works perfectly!
02:02
< Ev3>
Besides, what makes you think my IE is unmangled? :p
02:02
<@ToxicFrog>
Well, not perfectly, since about a third of the feature set hasn't been implemented yet, but the bits that are implemented work perfectly!
02:02
<@ToxicFrog>
So, I think this is less "death to C++" and more "death to windows' c++ stdlib and/or the Scintilla-win32 build system"
02:03
< Ev3>
Death to windows as a compiling platform, it was never built to handle that.
02:04
<@McMartin>
I think it's more "using C++ makes a mockery of any claims to portability"
02:04
<@McMartin>
Ev3: UQM compiles on WIndows just fine, under at least three compilers
02:04
< Ev3>
Besides, MS isn't competent to build coding languages as we've seen with VB, and .net, and more expressively in Sharepoint.
02:04
<@McMartin>
C 4tw here.
02:04
< Ev3>
Thank the compilers, not windows.
02:04
<@ToxicFrog>
Ev3: this would be why I'm not using their languages or compilers.
02:04
<@McMartin>
That includes MSVC as one of the three, though.
02:05
<@McMartin>
(C# does, strictly speaking, clean up a lot of Java's warts)
02:05
<@McMartin>
(As well as the C++ stupidities that Java itself removed)
02:07
<@ToxicFrog>
Anyways. I'm sorely tempted to just toss this entire project out the airlock and use the builtin lexers.
02:07
< Ev3>
I wish I had an intelligent assembler.
02:07
< Ev3>
Redundant code makes me cringe.
02:22 takyoji [~caleblang@Nightstar-25427.dhcp.roch.mn.charter.com] has joined #code
02:22
< takyoji>
need help with apache
02:22
< takyoji>
I have the console running, and I have a firewall exception for httpd.exe
02:23
< takyoji>
but when I type 'localhost' in my internet browser, it fails to find it
02:24
< takyoji>
well?
02:26
<@ToxicFrog>
More information, like the exact error returned by the browser, what happens when you telnet to localhost 80 and request /, and what's in Apache's logs, would be helpful.
02:27
<@ToxicFrog>
Along with some politeness.
02:27 * Ev3 pets TF.
02:28 * ToxicFrog purrs
02:28
< Ev3>
Hmm, not retroactive.
02:29
< Ev3>
No effect at all, may be why.
02:29 * Ev3 fiddles some more.
02:29
< Ev3>
Anyone remember the alt code for the nonbreaking space? ( The space that isn't a space )
02:29
< takyoji>
&nbsp;
02:30
< takyoji>
or %20
02:30
< Ev3>
>_<
02:30
< takyoji>
of what I remember
02:30
< Ev3>
ALT CODE I know my HTML, thank you though.
02:30
<@ToxicFrog>
&nbsp;
02:30
<@ToxicFrog>
Oh.
02:30
<@ToxicFrog>
Right.
02:30
<@ToxicFrog>
Well, a normal space is alt+040 on a windows box.
02:30
< takyoji>
Here's what was in the error log:
02:31
< takyoji>
[Fri Oct 13 20:17:06 2006] [notice] Apache/2.2.3 (Win32) configured -- resuming normal operations
02:31
< takyoji>
[Fri Oct 13 20:17:06 2006] [notice] Server built: Jul 27 2006 16:49:49
02:31
< takyoji>
[Fri Oct 13 20:17:06 2006] [notice] Parent: Created child process 3220
02:31
< takyoji>
[Fri Oct 13 20:17:06 2006] [notice] Child 3220: Child process is running
02:31
< takyoji>
[Fri Oct 13 20:17:06 2006] [notice] Child 3220: Acquired the start mutex.
02:31
< takyoji>
[Fri Oct 13 20:17:06 2006] [notice] Child 3220: Starting 250 worker threads.
02:31
< takyoji>
[Fri Oct 13 20:17:06 2006] [notice] Child 3220: Starting thread to listen on port 8080.
02:31
<@ToxicFrog>
^shift+20 on a *nix box that supports raw hex entry.
02:31
< takyoji>
sorry for the big paste btw
02:31
<@ToxicFrog>
takyoji: and you're accessing http://localhost:8080/?
02:31
< Ev3>
Oh, and you were right about explorer, it won't let me use my HTML without an explorer.
02:31
<@ToxicFrog>
And you're bound to localhost or 127.0.0.1 as well as your eternal interface?
02:32
<@ToxicFrog>
*external
02:32
<@ToxicFrog>
Hmm. This problem may be solvable after all.
02:32
<@ToxicFrog>
I need only percieve it differently.
02:32
< takyoji>
127.0.0.1 doesn't work either
02:34
<@ToxicFrog>
"Either"? What were you binding the httpd to before?
02:34
<@ToxicFrog>
And you still haven't answered my first question.
02:34
< takyoji>
it's because I don't funlly understand..
02:34
< takyoji>
I've never used Apache before
02:35
< takyoji>
fully*
02:35
<@ToxicFrog>
Ok. The first question is me asking what you are typing into the browser to test the httpd.
02:35
< takyoji>
In standard detail, I set the server address to http://caleb870-test.com
02:35
<@ToxicFrog>
As for the binding question, Apache should have an option that controls what interfaces it binds to - that is to say, which network cards it listens for connections on.
02:35
< takyoji>
I use 'http://localhost'
02:36
<@ToxicFrog>
If these don't include 127.0.0.1 or INADDR_ANY, you might not be able to connect using localhost.
02:36
<@ToxicFrog>
Just that?
02:36
<@ToxicFrog>
Not http://localhost:8080 ?
02:36
< takyoji>
oh whoops, I guess http://localhost:8080 works
02:36
<@ToxicFrog>
Because, according to that log, you have it configured to listen on 8080, not the default HTTP port of 80.
02:37
< takyoji>
actually, that's what it was be default
02:37
< takyoji>
be > as*
02:37
<@ToxicFrog>
Aah.
02:38
<@ToxicFrog>
Well, by default, port 80 is used for HTTP, and if you don't specify a port that's what the browser tries to use.
02:38
< takyoji>
so otherwise, you believe I won't be able to accept incoming requests
02:38
<@ToxicFrog>
8080 is meant to be used by cacheing proxies.
02:38
< takyoji>
ah
02:39
<@ToxicFrog>
You can use 8080 (or, indeed, any other port) instead of 80, but any links to your server will have to specify the port as well.
02:39
< takyoji>
or do you think the installation actually found the network card to use
02:39
<@ToxicFrog>
Based on the fact that you were able to connect to it using the right port, you should be fine on that count.
02:39
<@ToxicFrog>
I believe it binds to INADDR_ANY by default.
02:39
< takyoji>
ahh k
02:39
<@ToxicFrog>
But to test, try http://(your real IP):8080/
02:40
< takyoji>
but it won't work with the sever address I specified
02:40
< takyoji>
k
02:40
<@ToxicFrog>
That's not a registered hostname.
02:40
<@ToxicFrog>
; <<>> DiG 9.3.2 <<>> caleb870-test.com
02:40
<@ToxicFrog>
;; global options: printcmd
02:40
<@ToxicFrog>
;; Got answer:
02:40
<@ToxicFrog>
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 42717
02:40
<@ToxicFrog>
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
02:41
< takyoji>
and sadly http://68.190.158.25:8080 failed
02:42
< Ev3>
160
02:42
< takyoji>
to be found in IE
02:43
< takyoji>
failed
02:43
<@ToxicFrog>
To start with, you might want to try using a real browser, in particular one that gives you informative error messages.
02:43
<@ToxicFrog>
IE reports everything as a DNS failure.
02:43
< takyoji>
such as?
02:44
< takyoji>
ah
02:44
<@ToxicFrog>
Opera, or Firefox if you have lots of RAM to burn. Or elinks, or wget if you're more interested in testing - which you are at the moment - than web browsing.
02:44
< takyoji>
Firefox can't establish a connection to the server at 68.190.158.25:8080
02:44
<@ToxicFrog>
Curl also makes an acceptable alternative to wget.
02:45
<@ToxicFrog>
You appear to be behind some kind of firewall.
02:45
< takyoji>
I made an exception for httpd.exe
02:45
<@ToxicFrog>
You will have to configure it to permit inbound TCP connections on the port you have your webserver configured for.
02:45
< takyoji>
do I need to make an exception for port 8080 as well?
02:45 Vornicus-Latens is now known as Vornicus
02:46
< takyoji>
k
02:46
< takyoji>
I'll be back
02:46
<@ToxicFrog>
Not necessary the windows firewall.
02:46
<@ToxicFrog>
Are you using any kind of external firewall, router, gateway or NAT device?
02:47
<@ToxicFrog>
(and I refer here to the point that attempting to connect to your system on tcp/80 or tcp/8080 returns "no route to host", although 25 times out normally and traceroute and ping work fine.)
02:48
< takyoji>
oh duh *smack head against wall* I forgot about my router
02:50
< takyoji>
hmm, its enabled within my router
02:52
<@ToxicFrog>
port tcp/8080 inbound to the system you're running Apache on?
02:52
<@ToxicFrog>
Try using port 444 instead. You'll need to reconfigure the router and apache, then restart apache.
02:52
< takyoji>
it has just 80 though
02:52
< takyoji>
not 8080
02:52
<@ToxicFrog>
Oh. Try that first then.
02:53
<@ToxicFrog>
If the httpd is listening on 8080, the firewall has to be configured accordingly. It can't magically realize that it's actually meant to be forwarding connections on 8080 instead of 80.
02:53
< takyoji>
"Port range conflit with "Remote Managment http Server"."
02:53
< takyoji>
I'll be back in a few minutes
02:53 takyoji [~caleblang@Nightstar-25427.dhcp.roch.mn.charter.com] has left #code []
02:55 * Ev3 is screwing her system up even more.
03:00 Janus is now known as Jan[bubblybath]
03:00 takyoji [~caleblang@Nightstar-25427.dhcp.roch.mn.charter.com] has joined #code
03:00
< takyoji>
back
03:00
< takyoji>
sorry for the wait
03:01
< Vornicus>
http://unspeakablevorn.livejournal.com/25985.html
03:06
< takyoji>
Any suggestions?
03:07
<@ToxicFrog>
takyoji: it's still not working?
03:08
<@ToxicFrog>
Tell me what error it returns when you connect using telnet, and if it's "no route to host", try port 444 instead.
03:12
< takyoji>
I actually don't know how to use telnet >.<
03:13
< takyoji>
just type in the url?
03:13
< Vornicus>
on the command line: telnet <host>
03:13
<@ToxicFrog>
Well, telnet <host> <port>
03:13
<@ToxicFrog>
In your case, telnet 68.190.158.25 8080
03:15
< takyoji>
connection failed
03:16
<@ToxicFrog>
...that's it?
03:16
<@ToxicFrog>
No reason?
03:16
<@ToxicFrog>
Wow, windows telnet sucks more than I remembered.
03:16
< takyoji>
that's all it says
03:16 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
03:16 mode/#code [+o Chalcedon] by ChanServ
03:16
<@ToxicFrog>
You don't have Cygwin installed, by any chance?
03:16
< takyoji>
don't think so
03:17
<@ToxicFrog>
You'd know if you did.
03:17
<@ToxicFrog>
Well, try port 444.
03:17
<@ToxicFrog>
Based on the results I'm getting, I suspect your ISP may have some kind of firewall in place.
03:18
< takyoji>
I have charter as a service provider
03:18
< takyoji>
connection failed again
03:19
<@ToxicFrog>
You changed the httpd configuration, and the firewall configuration, and restarted the httpd?
03:19
< takyoji>
yes
03:20
<@ToxicFrog>
And localhost:444 works?
03:20
< takyoji>
localhost:8080 works, but localhost:444 doesn't
03:21
<@ToxicFrog>
Then you haven't changed the httpd configuration properly, or it's not reading its configuration files properly when you restarted it.
03:22
< takyoji>
in the configuration file its set to listen to 8080
03:23
<@ToxicFrog>
...so, when you said "yes" when I asked if you'd changed the httpd configuration, you actually meant "no"?
03:23
< takyoji>
yea
03:24
< takyoji>
should I also have it listen to 444?
03:24
<@ToxicFrog>
...
03:24
< takyoji>
Sorry that I'm pothetic to work with..
03:24 Chalcedon is now known as ChalcyOut
03:25
< takyoji>
what would have to be changed within the configuration file?
03:26
<@ToxicFrog>
I don't remember, it's been years since I used apache.
03:27
<@ToxicFrog>
Look for wherever it's configured to listen on 8080 and change that to 444.
03:28
< takyoji>
works
03:29
< takyoji>
for localhost:444
03:29
< takyoji>
now
03:29 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
03:29 mode/#code [+o Chalcy] by ChanServ
03:29
< Ev3>
Astonishing, switching hotkeys in your task manager is rather easy.
03:29
<@ToxicFrog>
And what about 68.190.158.25:444 ?
03:30
<@ToxicFrog>
Ev3: does task manager even _have_ hotkeys, apart from the one that invokes it?
03:30
< Ev3>
I would've assumed that since it was a MS product, it'd be distinctively Arcane.
03:30
< Ev3>
Sure, like End process.
03:30
<@Pi>
03:30
<@ToxicFrog>
Aah.
03:30
< Ev3>
Which I've aptly renamed "Kill"
03:30
<@Pi>
Ctrl+Alt+Delete <-- hotkey
03:30
< Ev3>
I have a ? on my laptop, that's my hotkey.
03:31 ChalcyOut [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
03:31
< Ev3>
It also isn't called task manager anymore *giggles*
03:31
< Vornicus>
"No wonder rubyists are so nice! We can't say RTFM, because there IS no effin' manual!
03:31
< Ev3>
And there's no "help" file, nor function.
03:31
< takyoji>
68.190.158.25:444 failed
03:32
< takyoji>
so obviously there's something wrong with recieving requests from outside of my server
03:32
< takyoji>
right?
03:32
<@ToxicFrog>
Check the inbound logs on your router?
03:33
< takyoji>
hmm
03:33
< takyoji>
Oct/13/2006 19:26:29 SYN Flood Attack Detect Packet Dropped
03:33
< takyoji>
but its currently 9:33
03:33
< takyoji>
erm
03:34
< takyoji>
the most recent is:
03:34
< takyoji>
Oct/13/2006 20:07:26 DHCP Request 68.190.158.25
03:34
<@ToxicFrog>
...hmm. Check the logs on the httpd and the windows firewall?
03:35
< takyoji>
under the access log:
03:35
< takyoji>
127.0.0.1 - - [13/Oct/2006:21:30:11 -0500] "GET / HTTP/1.1" 200 150
03:36
< takyoji>
but I believe that was when I did localhost:444
03:36
<@ToxicFrog>
Hmm. So it never saw the request to the external IP.
03:36
<@ToxicFrog>
Yes. It is.
03:37
< takyoji>
and I'm unaware of the a windows firewall log
03:38
< takyoji>
oh, I think I know the location now
03:39
< takyoji>
hmm doesn't exist
03:40
< takyoji>
And I think Windows Defender might actually be getting in the way
03:40
< takyoji>
but in the history, it's allowed everything
03:42
< takyoji>
and in Windows Defender it says its listening to 0.0.0.0:444
03:42
< takyoji>
and its allowing it to run
03:45
< takyoji>
running out of ideas
03:47
< takyoji>
so it could be a firewall problem, router problem, and/or my service providers problem?
03:49
< takyoji>
its not a firewall problem on my computer for certain now
03:51
< takyoji>
hmm, I believe I came across something
03:51
< takyoji>
"Drop UDP packet from WAN" in my log for my router
03:51
< takyoji>
Source- 204.16.208.50:48638 68.190.158.25:1027
03:52
< takyoji>
Note- Rule: Default deny
03:52
<@ToxicFrog>
No, HTTP doesn't use UDP.
03:52
<@ToxicFrog>
Indeed, it would be an absolute nightmare if it did.
03:52
<@ToxicFrog>
As you will know after doing some socket programming.
03:53
< takyoji>
What would a possible solution be?
03:55 Jan[bubblybath] is now known as Janus
03:55 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
03:56 mode/#code [+o Chalcedon] by ChanServ
03:56
< Ev3>
Taskmgr.exe done, moving on to explorer.exe
03:57 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Quit: yay! cat!!]
03:57 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
03:58
< takyoji>
so, how would I allow it to stop dropping the requests?
03:59
<@ToxicFrog>
We don't even know if that's what it's doing.
03:59
<@ToxicFrog>
Certainly it's not in the logs.
04:00
< takyoji>
everytime I try it says "Drop TCP packet from WAN" in the log
04:00
< takyoji>
so wouldn't it be my router?
04:00
<@ToxicFrog>
Oh.
04:00
<@ToxicFrog>
You didn't mention this.
04:00
<@ToxicFrog>
Yes, that would be the problem.
04:01
< takyoji>
And the solution is?
04:02
< takyoji>
allow it how?
04:02
< Ev3>
Anyone who can tell me the function of alt+m in explorer?
04:03
< takyoji>
it appears to do nothing
04:03
< Ev3>
Do you have Win XP Pro?
04:04
< Ev3>
Because it may be OS version specific.
04:04
< Ev3>
I can't discern what it does, and it appears to do nothing to me too.
04:04
< takyoji>
xp
04:04
< Ev3>
But checking explorer.exe, I can see it calls function 419
04:09
< Janus>
One could only assume it does something lame, such as open MS Outlook. The only thing it does on mine though, is make the pinballish "blump" sound.
04:14 takyoji2 [~caleblang@Nightstar-25427.dhcp.roch.mn.charter.com] has joined #code
04:14
< takyoji2>
sorry got disconnected
04:15 takyoji [~caleblang@Nightstar-25427.dhcp.roch.mn.charter.com] has quit [Ping Timeout]
04:15
< takyoji2>
so ya, would I still be able to run php?
04:15
<@ToxicFrog>
takyoji: configure the router to accept and forward connections on 444/tcp to the machine running apache, same as you were doing before with 8080.
04:15 * ToxicFrog facedesks.
04:16
<@ToxicFrog>
Why wouldn't you be able to?
04:16
<@ToxicFrog>
I mean, I have no idea if PHP will build or run on Windows, so many things don't, but if it does...
04:16
< takyoji2>
I've been running it, but it hasn't been changing the code
04:17
<@ToxicFrog>
...by which you mean?
04:18
< takyoji2>
I have php.exe running, I open index.php which contains '<?php echo "test" ?>' and it appears as it is, it doesn't only show 'test'
04:18
<@ToxicFrog>
...ok.
04:18
<@ToxicFrog>
First of all, php does not change the code, nor are you meant to run it as a standalone program.
04:18
< takyoji2>
otherwise, for enabling connections through 444 on the firewall, I need a 'private IP' to specify
04:19
<@ToxicFrog>
If you are running a properly configured webserver, when you access a PHP page, it will run php.exe automatically and use the output as the page to send to the client.
04:19
<@ToxicFrog>
Yes, that's the internal IP of the system running apache.
04:19
< takyoji2>
oh
04:19
<@ToxicFrog>
As in, the one returned by ipconfig -all
04:19
< takyoji2>
so just write my ip?
04:19
<@ToxicFrog>
_not_ your external IP.
04:19
<@ToxicFrog>
Also, I don't think the code you pasted above is valid PHP in any case, but my php-fu is weak so I may be wrong on that point.
04:20
< Ev3>
Enough hacking for one day ^_^ Nighters.
04:20
<@ToxicFrog>
'night
04:21
< takyoji2>
so... 192.168.0.1?
04:21
<@ToxicFrog>
That sounds like the IP of the router, but depending on how you have things configured it could plausibly be the IP of the system running apache instead.
04:21
< takyoji2>
which is 68.190.158.25
04:21
< takyoji2>
right?
04:21
<@ToxicFrog>
No, that's your external IP.
04:22
< takyoji2>
127.0.0.1?
04:22
<@ToxicFrog>
That's the loopback interface.
04:22
< takyoji2>
I'm not sure otherwise
04:22
<@ToxicFrog>
Ok. I'm going to ask a question here, and while it may sound somewhat harsh, bear in mind that I have had a long, frustrating day filled with broken windows C++ libraries and a room that's always five degrees too hot.
04:22
< takyoji2>
heh, what a wonderful life you live
04:23 * Janus dives for cover.
04:23
<@ToxicFrog>
Do you, in fact, know anything about IP and TCP networking, routing, network address translation, CGI, maintaining and administering an http daemon, network interface configuration, socket programming, and PHP?
04:24
< takyoji2>
I don't nessasarily have any background with running my own server, I have little experince with networking (IE, setting up wireless modes), and have quite a decent background of programming in PHP
04:25
< takyoji2>
modems*
04:25
<@ToxicFrog>
Setting up wireless networks, but not IP routing, NAT, or TCP socket programming?
04:25
< takyoji2>
and my local library doesn't have shit for books on networking
04:25
< takyoji2>
correct
04:26
<@ToxicFrog>
Ok. Quick overview of NAT, then.
04:26
< takyoji2>
any idea of online education resources?
04:27
< takyoji2>
go ahead
04:27
<@ToxicFrog>
None!
04:27
<@ToxicFrog>
I picked up most of this stuff in the field, as it were, or on IRC.
04:27
< takyoji2>
ooo, I feel smarter alread
04:27
< takyoji2>
ahh
04:27
<@ToxicFrog>
Ok. Your router actually has two IP addresses.
04:27
< takyoji2>
yea, I learn from IRC, w3schools.com, and some documentation
04:28
<@ToxicFrog>
One of these is outward-facing. It is the IP address the rest of the world sees and the means by which they route packets to your network.
04:28
<@ToxicFrog>
In your case, it is 68.190.158.25
04:29
< takyoji2>
and so your saying I need to find the inward facing ip, right?
04:29
<@ToxicFrog>
It also has an inward-facing IP. This is the address that all the systems on your local network see. It's usually 192.168.0.1 or 192.168.1.1, at least for most commercial router-appliances.
04:29
<@ToxicFrog>
Furthermore, each system on your network also has an IP.
04:29
<@ToxicFrog>
Typically, these are either assigned automatically by the router, or configured by hand when you set them up.
04:30
<@ToxicFrog>
A typical sample would be Orias, my development system and daemonlord, which has IP 192.168.1.202.
04:30
<@ToxicFrog>
The important thing to realize is that these IPs are completely internal.
04:30
<@ToxicFrog>
From the outside, your entire network looks like a single computer with IP address 68.190.158.25.
04:31
< takyoji2>
ahh
04:31
<@ToxicFrog>
So. This is the network layout. The actual NAT mechanism is next.
04:31
<@ToxicFrog>
Say one of your systems, let's call it 192.168.1.100, wants to talk to a system in the outside world.
04:31
<@ToxicFrog>
It carefully constructs a packet and sends it to the router (via the router's internal IP).
04:32
<@ToxicFrog>
The router, in turn, modifies the packet so that it looks like it came from the router's external IP - 68.190.158.25 - and not the IP of your internal system.
04:32
<@ToxicFrog>
Then it sends it on.
04:32
<@ToxicFrog>
When a reply comes back, it takes the packet and forwards it on to the system inside the network that's the real originator of the connection.
04:33
<@ToxicFrog>
This part, when a system inside the network is connecting to a system outside, happens pretty much automatically.
04:33
<@ToxicFrog>
This is Network Address Translation, or NAT.
04:33
< takyoji2>
ahh
04:33
<@ToxicFrog>
Where it gets interesting is where you want to run a server of some kind, and thus, have systems outside your local network connect to a system on the inside.
04:34
<@ToxicFrog>
So! Say you're running Apache on 192.168.1.100:80
04:34
<@ToxicFrog>
Stuff inside your network can use that IP, since it's your internal IP, and it just works.
04:34
<@ToxicFrog>
Stuff outside your network, however, needs to connect to 68.190.158.25:80.
04:34
<@ToxicFrog>
So, a packet arrives at the router on port 80.
04:35
<@ToxicFrog>
What does it do now? The packet is part of a new connection, not a reply along an outbound connection. It has no idea which system in your internal network should recieve the packet, if any.
04:35
<@ToxicFrog>
So it drops it.
04:35
< takyoji2>
oh
04:35
<@ToxicFrog>
This, in turn, leads us to port forwarding.
04:36
<@ToxicFrog>
A port forwarding entry consists of a port (or range of ports) and an internal IP to forward to.
04:36
<@ToxicFrog>
In the above example, you would set up an entry that forwards port 80 to internal IP 192.168.1.100
04:36
<@ToxicFrog>
With that in place, a packet arrives at the router on port 80, triggers the port forwarding rule, and it sends the packet on to internal system 192.168.1.100
04:37
<@ToxicFrog>
And, if everything else is working properly, the httpd on 192.168.1.100 gets the packet, the connection is set up and matters proceed from there.
04:37
<@ToxicFrog>
All clear?
04:37
< takyoji2>
Yes
04:37
< takyoji2>
one sec
04:38
<@ToxicFrog>
Now, as to why I suggested port 444, as opposed to the traditional port 80...
04:38
<@ToxicFrog>
I tried connecting to your system earlier on ports 80 and 8080.
04:38
<@ToxicFrog>
They came back with the error "no route to host" - ie, it can't find a path from my system to that IP address.
04:38
<@ToxicFrog>
However, I know a path exists.
04:39
<@ToxicFrog>
And if I try connecting on other ports, it works just fine.
04:39
<@ToxicFrog>
It doesn't actually /connect/, but it times out, which is consistent with no server listening on that port.
04:39
<@ToxicFrog>
This leads me to believe that, in an effort to prevent people from running http servers or proxies on their network, your /ISP/ has a firewall in place.
04:40
< takyoji2>
crap..
04:40
<@ToxicFrog>
Any attempt to connect to their customers on port 80 or 8080 returns an ICMP No Route To Host message, even if a route exists.
04:40
<@ToxicFrog>
However, port 444 appears not to have this restriction.
04:40
<@ToxicFrog>
(as to why I chose 444 /specifically/, it's one more than 443, which is the port used for https - encrypted HTTP.)
04:41
< takyoji2>
yea, I noticed in my settings that it accepts through 443 for shttp
04:42
< takyoji2>
but basically, when someone connects to a website it goes through port 80 or 8080 by default, and thus, even though if port 444 in enabled, it won't be able to notice it or...?
04:42
<@ToxicFrog>
It goes through port 80 by default.
04:43
<@ToxicFrog>
Whenever you enter http://www.google.ca/, it's connecting to www.google.ca:80
04:43
< takyoji2>
otherwise it'd have to be the addres with ':444' in order to connect through port 444, right?
04:43
<@ToxicFrog>
You can force it to use a different port in the link by putting :port after the hostname, as seen above.
04:43
<@ToxicFrog>
Yes.
04:44
<@ToxicFrog>
http://68.190.158.25/ won't work, but http://68.190.158.25:444/ - assuming that the server is configured properly, the router has the right port forwarding set up, windows firewall behaves for once, the ISP doesn't have some other firewall rules in place we don't know about, etc, etc...will work.
04:44
< takyoji2>
but if my isp blocks 80, wouldn't someone still be able to connect to it through port 444 if they tell it to?
04:45
<@ToxicFrog>
Yes.
04:45
< takyoji2>
and for the private IP i need the NAT?
04:45
<@ToxicFrog>
Clarify the question, please.
04:45
<@ToxicFrog>
The NAT is what gives the private IP its distinction from your public IP and allows you to host multiple systems on a network behind one router.
04:46
< takyoji2>
For enabling me to allow connections through tcp/444 in my firewall settings, it also requires a 'private ip'
04:46
<@ToxicFrog>
Yes. That is the internal IP to forward connections on that port.
04:46
<@ToxicFrog>
*on that port to
04:46
<@ToxicFrog>
To find out what it is, on the system running apache, run "ipconfig"
04:47
< takyoji2>
so 192.168.0.100?
04:47
<@ToxicFrog>
And read the line labeled "IP Address"
04:47
<@ToxicFrog>
That sounds correct.
04:47
< takyoji2>
ah yea
04:47
< takyoji2>
I remember using ipconfig for setting up a router
04:47
< takyoji2>
for troubleshooting
04:49
<@ToxicFrog>
I can now go into detail on the interactions between Apache, PHP, and CGI in general if you like~
04:49
< takyoji2>
sure
04:50
< takyoji2>
otherwise it still fails to connect though 68.190.158.25:444 even after chaning that setting
04:50
< takyoji2>
changing*
04:50
<@ToxicFrog>
Hmm.
04:50
< takyoji2>
let me check the log again
04:51
<@ToxicFrog>
Works perfectly fine for me.
04:51
< takyoji2>
hmm?
04:51
< takyoji2>
does the page show up?
04:51
<@ToxicFrog>
[root@leela tmp]# telnet 68.190.158.25 444
04:51
<@ToxicFrog>
Trying 68.190.158.25...
04:51
<@ToxicFrog>
Connected to 68-190-158-25.dhcp.roch.mn.charter.com (68.190.158.25).
04:51
<@ToxicFrog>
Escape character is '^]'.
04:51
<@ToxicFrog>
GET / HTTP/1.1
04:51
<@ToxicFrog>
Host: 68.190.158.25
04:51
<@ToxicFrog>
Connection: close
04:51
<@ToxicFrog>
HTTP/1.1 200 OK
04:51
<@ToxicFrog>
Date: Sat, 14 Oct 2006 03:50:56 GMT
04:51
<@ToxicFrog>
Server: Apache/2.2.3 (Win32)
04:51
<@ToxicFrog>
[...]
04:51
<@ToxicFrog>
<html><body>
04:51
< takyoji2>
hmm
04:51
<@ToxicFrog>
<h1><span style="font-weight: 400"><font size="3" face="Arial">Test document.
04:51
<@ToxicFrog>
Hopefully it works.</font></span></h1>
04:51
<@ToxicFrog>
</body></html>Connection closed by foreign host.
04:51
<@ToxicFrog>
[root@leela tmp]#
04:51
< takyoji2>
oooo
04:52
<@Pi>
Dynamically typed languages and Design by Contract are mutually exclusive.
04:52
< takyoji2>
try index.php
04:53
<@ToxicFrog>
Pi: not necessarily, but I fail to see
04:53
<@ToxicFrog>
Err.
04:53
<@ToxicFrog>
<html><body>
04:53
<@ToxicFrog>
<h1><span style="font-weight: 400"><font face="Arial" size="3">&lt;?php echo &quot;hello
04:53
<@ToxicFrog>
world&quot; ?&gt;</font></span></h1>
04:53
<@ToxicFrog>
</body></html>
04:54
<@ToxicFrog>
That's not PHP, it's HTML with a fragment of PHP code in the middle.
04:54
<@ToxicFrog>
Probably shows up in the browser as <?php echo "hello world" ?>
04:55
<@ToxicFrog>
Anyways! CGI.
04:55
< takyoji2>
ahh, so it wasn't originally in the form of a true triangle bracket
04:55
<@ToxicFrog>
No, it's HTML.
04:55
< takyoji2>
yea, that's what I mean
04:55
<@ToxicFrog>
Anglebrackets in HTML are reserved symbols.
04:56
<@ToxicFrog>
So. CGI. Bear in mind that I am speaking here from the perspective of running servers on *nix (Linux, in my case); for windows, the general concepts are the same but the implementation details may be quite different.
04:57
<@ToxicFrog>
You have a webserver. The server is asked to serve up some file, it dumps the contents of the file into the socket and closes the connection. Static pages, nothing to see here.
04:57
<@ToxicFrog>
Say, however, that the server is configured for CGI execution, and the file is marked as executable, and is in an area that the server knows contain CGI scripts.
04:58
<@ToxicFrog>
In this case, it will run the script in one of two ways, passing in its arguments (the query-string - for example, the ?foo=bar at the end of the URL) in a well defined way, and whatever the script outputs is sent to the client instead.
04:59
<@ToxicFrog>
If it's a standalone binary - a .exe, on windows - it simply runs it directly. It's not commonly done, but you _can_ write CGIs in C (or C++, or assembler, or whatever) and deploy the binaries.
04:59
<@ToxicFrog>
If it's a script, it reads the first line of the script and/or the file extension to determine what interpreter it should use.
05:00
<@ToxicFrog>
It then executes that interpreter and feeds it the script.
05:00
<@ToxicFrog>
So, in the case of a properly configured webserver with PHP CGIs, it goes something like this:
05:00
<@ToxicFrog>
- client requests /index.php
05:00
<@ToxicFrog>
- httpd looks in /var/www/index.php
05:00
<@ToxicFrog>
- index.php is executable
05:00
<@ToxicFrog>
- /var/www can contain CGIs
05:01
<@ToxicFrog>
- httpd looks at first line and sees "#! /usr/bin/php"
05:01
<@ToxicFrog>
- httpd then executes /usr/bin/php and passes in /var/www/index.php as the script to execute
05:01
<@ToxicFrog>
- the output of this command is sent to the client
05:02
<@ToxicFrog>
In the case of windows, I have no idea how it decides what interpreter to use; presumably the apache documentation has something to say on this subject.
05:02
<@ToxicFrog>
But that's the general idea. You install the interpreter, configure the webserver to run it as needed when it encounters the appropriate type of script, and let it go.
05:05
< takyoji2>
ahh
05:07
<@ToxicFrog>
On Linux I find this kind of happens automatically. It's been...five years? Six? since I tried setting it up on windows, but it was an ugly, evil task and is unlikely to have improved since.
05:07
< takyoji2>
and now I changed the anglebrackets properly, and now I open index.php and now it shows nothing...
05:07
<@ToxicFrog>
There are several possible causes, but one underlying reason.
05:08
<@ToxicFrog>
The underlying reason is that it's being sent to the browser as, and thus rendered as, HTML.
05:08
< takyoji2>
so otherwise, your saying I have to configure httpd to send the data through php.exe before sending it to the requester?
05:08
<@ToxicFrog>
<?php> is not a valid HTML tag, so the browser simply doesn't display it...and there's nothing else to display, so the page appears blank.
05:08
< takyoji2>
ahh
05:08
<@ToxicFrog>
The reason for this is that Apache isn't running it through php before sending it to the client, or if it is, php isn't doing anything with it, just passing it through.
05:09
<@ToxicFrog>
The reason for /that/...well, there's a number of possibilities.
05:10
<@ToxicFrog>
Three most likely are probably: Apache isn't configured to use php; Apache is configured to use php but only in certain directories, and index.php isn't one of them; or Apache is configured to use php and index.php is in one of the directories it uses PHP in, but is missing some property - like the executable flag, or a PHP shebang in the first line - that would allow Apache to realize it's a PHP script.
05:10
<@ToxicFrog>
Like I said, you'll have to read the Apache and PHP documentation to determine how to configure Apache to use PHP properly. I can't help you there.
05:11
<@ToxicFrog>
And now, I'm off to bed.
05:11
<@ToxicFrog>
Good luck.
05:11
<@ToxicFrog>
Being on windows as you are, you'll almost certainly need it.
05:17
< takyoji2>
well, goodnight
05:28 Mahal is now known as MahalOUT
05:37 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: "ughsakji" --Japanese for 'dkfajdksk' You're lucky numbers today are 32, 12, 42, 22, and 2. (nighty-nite)]
05:51 Syloq [Syloq@NetAdmin.Nightstar.Net] has quit [Connection reset by peer]
06:36 takyoji2 [~caleblang@Nightstar-25427.dhcp.roch.mn.charter.com] has quit [Quit: ]
07:12 You're now known as TheWatcher
07:37 Vornicus is now known as Vornicus-Latens
07:44 You're now known as TheWatcher[afk]
08:07 You're now known as TheWatcher
08:30 * Reiver wakes up.
08:30 * Reiver decides now is a good time to start doing the days code. ¬¬
08:31
<@McMartin>
zomghax!
08:32
<@Reiver>
Well, I /was/ going to do it this morning and onwards, and all.
08:32
<@Reiver>
Only, uh.
08:32
<@Reiver>
I sort of spent most of the night coughing, and then losing my dinner. So!
08:32
<@Reiver>
Starting late is better than not at all, right? >.>
08:32 You're now known as TheWatcher[swim]
08:32
<@Reiver>
Bye, TW!
08:32 * Reiver gives TW a fish.
08:33 * TheWatcher[swim] bludgeons things to death with it
08:33
<@Reiver>
:(
08:33
<@Reiver>
But it was a swimmy fish!
08:33
<@Reiver>
'cuz you were swimming.
08:34
<@Reiver>
And stuff.
08:34
<@TheWatcher[swim]>
thanks, but I'm in a seriously bad mood right now
08:34
<@Reiver>
:(
08:34 * Reiver hugs.
08:34
<@Reiver>
Good luck, then.
08:34
<@Reiver>
See you later?
09:15
<@jerith>
Morning all.
09:15 * jerith ponders being an hour later than planned.
09:18 * jerith prods Reiver.
09:54 You're now known as TheWatcher
10:05
<@Reiver>
Hi jerith!
10:05 * Reiver appears unexpectedly.
10:07
<@jerith>
Hey Reiver.
10:07
<@jerith>
How's the Java?
10:07
<@Reiver>
Um.
10:07
<@Reiver>
Very very bad because I've been ill all day?
10:07
<@Reiver>
*cough*
10:09 * jerith huggles.
10:16
<@Reiver>
So.
10:16
<@Reiver>
Because I am ill, and thus feeling stupid.
10:17
<@Reiver>
I vaugely remember that it is better OO-programming to have the apptCalendar object keep tract of what Appointments it owns, rather than each Appointment storing which apptCalendar it belongs to?
10:17
<@Reiver>
It does, however, seem very clumsy.
10:17
<@jerith>
Hmm...
10:17
<@Reiver>
I am wondering how one would do it.
10:17
<@McMartin>
The question is really "How do you get at individual Appointments"?
10:17
<@jerith>
The way I see it, you could do it either way.
10:17
<@jerith>
Or both.
10:17
<@McMartin>
Yeah, this isn't an OO question per se.
10:17
<@jerith>
Yes, what hea said.
10:17
<@Reiver>
Oh. Okay.
10:18
<@Reiver>
Um. I haven't really worked out how I'm getting at individual appointments, yet, either.
10:18
<@McMartin>
Solve that first.
10:18
<@McMartin>
If you have the Calendar track Appointments, this is easy, since the Calendar is essentially a top-level object.
10:18
<@jerith>
Do appointments need to be shared by calendars?
10:19
<@Reiver>
http://www.cs.waikato.ac.nz/Teaching/COMP209B/assignments/Assignment2.pdf
10:19
<@jerith>
If you're going to be displaying calendars more often than individual appointments with lots of parent calendars, you're probably better off having the calendars keep track.
10:20
<@Reiver>
It doesn't appear so.
10:20
<@Reiver>
Your calendar is like, 'school' or 'work'. Really more a category, but.
10:22
<@jerith>
Hmm...
10:24 * Reiver really is falling over the very fundamentals here. It's driving him nuts, because it should be obvious.
10:24
<@Reiver>
...Which means it probably is, but.
10:24
<@jerith>
Well, we're looking at design issues here.
10:24
<@Reiver>
Simple ones. You'd think.
10:24
<@Reiver>
>.>
10:24
<@jerith>
And there isn;t a solution that immediately jumps out at me,
10:25 * jerith rearranges his punctuation.
10:25
<@McMartin>
These things are so fundamental they've really stopped being CS.
10:26
<@jerith>
You may want a calendar class that keeps track of its appointments while the appointments /also/ keep track of the calendars they belong to.
10:26
<@jerith>
Although you need to be careful that you don't end up with data corruption there.
10:26
<@Reiver>
That's the bit that worries me.
10:27
<@jerith>
Then don't do it. It's something of a performance hack anyway.
10:27
<@Reiver>
Also it's probably more easy to end up with orphaned appointments than orphaned calendars.
10:27
<@Reiver>
But I dunno.
10:27
<@McMartin>
If an appointment is orphaned, does this not mean it has been deleted?
10:27
<@Reiver>
Um...
10:27
<@jerith>
Not necessarily.
10:28
<@McMartin>
Or, well, not fully initialized yet
10:28
<@McMartin>
But every appointment exists as part of some calendar, right?
10:28
<@McMartin>
(I mean, does it? These are part of the problem statement)
10:28
<@jerith>
Perhaps orphaned appointments are just "uncategorised".
10:29
<@McMartin>
... If so, we have a fairly Large Problem with only getting at appointments through their controlling Calendar.
10:29 * TheWatcher sugests not overcomplicating matters and writing something that meets the exercise requirements and no more
10:29
<@TheWatcher>
If this means not handling some borderline 'would be nice if's, so be it.
10:30
<@jerith>
Creating appointments "in a given calendar" implies that appointments will always be associated with a calendar.
10:30
<@McMartin>
TW is right.
10:30
<@McMartin>
I suggest a top-down design.
10:30
<@jerith>
And not to more than one.
10:30
<@McMartin>
Which means restating the problem as a class structure, then stating it ever more specifically until you have a complete program.
10:31
<@Reiver>
Ok?
10:31
<@jerith>
Ignoring the GUI requirement for now, this looks like a Calendar class and an Appointment class.
10:31
<@Reiver>
Right.
10:32
<@Reiver>
With multiple apptCalendar objects, each holding... um... an arraylist of Appointments.
10:32
<@McMartin>
Answering the wrong question, Reiver.
10:32
<@jerith>
Don't go to that level of specifics yet.
10:32
<@Reiver>
(I am using apptCalendar as "Calendar" is a Java object itself, and one I will be using extensively. >.<)
10:32
<@McMartin>
The question isn't "what do they contain"
10:32
<@McMartin>
The question is "what can objects of this class be asked to do?"
10:32
<@Reiver>
Um...
10:33
<@jerith>
The Appointment class is pretty much specified in the assignment.
10:33
<@McMartin>
OK, so Appointment essentially holds data
10:33
<@Reiver>
Appointments are straightforward, yeah. Be able to effectively get or set a bunch of data.
10:33
<@jerith>
Calendar is the interesting one.
10:33
<@Reiver>
A Calendar needs to be able to, um, keep track of a bunch of Appointments, and a name.
10:33
<@jerith>
Yes.
10:34
<@jerith>
What is involved in "keep track of"?
10:34
<@McMartin>
Now, what does it mean to "keep track of", here?
10:34
<@Reiver>
"These appointments belong to me."
10:34
<@Reiver>
I think?
10:34
<@McMartin>
There's a very important entity we've not discussed here.
10:34
<@McMartin>
The user.
10:34
<@jerith>
How do they get there?
10:35
<@McMartin>
What does user wish to command this application to do, and which class is best suited to carry out those commands?
10:35
<@McMartin>
(different answers for different commands, obviously)
10:35
<@Reiver>
Set an appointment, view an existing appointment, delete or shift an appointment between calendars.
10:35
<@Reiver>
Hrm.
10:35
<@McMartin>
OK. Let's break those down.
10:36
<@McMartin>
When he views an existing appointment, what information does he give?
10:36
<@Reiver>
And then set/view calendars, with each calendar displaying multiple appointments.
10:36
<@Reiver>
He gets, uh, all the data for that appointment.
10:36
<@McMartin>
Not what he gets.
10:36
<@McMartin>
What he gives.
10:36
<@McMartin>
You don't go a browser and say "I would like to view an existing web page."
10:36
<@McMartin>
You give it a URL.
10:36 * Reiver pauses.
10:36
<@Reiver>
Right.
10:37
<@Reiver>
I was thinking he gives... um...
10:37
<@Reiver>
He starts by choosing a calendar.
10:37
<@McMartin>
OK then.
10:38 * McMartin enters lecture mode, unless he is stopped
10:38
<@Reiver>
And, via the magic of clicky buttons or similar, a timeframe for appointments within that calendar. (Year/month/week/day views, all effectively just variations on the same theme).
10:38
<@Reiver>
He then chooses an appointment that is already there.
10:38
<@McMartin>
If the user starts by choosing a calendar, then you'll want to ask the calendars for the appointment, and so the internal ArrayList is wise.
10:38
<@Reiver>
By, well, clicking a GUI button or something. I've not yet thought exactly how each button will reference each Appointment object just yet, though. >.>
10:39
<@McMartin>
Ignore the G for now.
10:39 * Reiver nods.
10:39
<@McMartin>
We're just worried about the UI in any form. It will eventually become an API instead.
10:39
<@McMartin>
But the I is key.
10:39
<@McMartin>
Note that if the intended interaction went "give me any event that happens at 3 PM", say...
10:39
<@McMartin>
With no reason to sort by anything first...
10:40
<@McMartin>
Then having a single, global arraylist of Appointments that you filtered as necessary (and which named their Calendars) would be the way to go.
10:40 * Reiver nods.
10:41
<@McMartin>
Note that if your interface is consistent, the story of "this user uses the application to perform action X" should all end up implying the same underlying structure.
10:42
<@Reiver>
I... keep having a personal bias to the latter, but the assignment doesn't appear to actually have that requirement. It's kinda vauge, though, so...
10:43
<@jerith>
So, what do we have so far?
10:45
<@Reiver>
An appointment class that is going to be either stored in the apptCalendars themselves, or in a single, global AppointmentList.
10:45
<@Reiver>
Depending on how we wish the program to behave.
10:47
<@jerith>
I think we need to make that decision now.
10:47
<@Reiver>
Indeed.
10:48 * Reiver tries to think.
10:48 * McMartin avoids pressure, other than to note that Reiver has indicated a subconscious preference for the global AppointmentList.
10:48 * Reiver really wants to do what leads to the most straightforward code, really.
10:49
<@jerith>
There are two somewhat conflicting requirements. We only really want to manipulate appointments through the calendar, but we also want to be able to search for them globally.
10:49
<@McMartin>
Also, if you keep the appointments globally, deleting calendars and all they contain is going to be obnoxious.
10:50
<@McMartin>
But if you keep them in calendars, searching global will be obnoxious.
10:50
<@McMartin>
Both are always, of course, possible.
10:50
<@McMartin>
And you'll need a global CalendarList under all circumstances.
10:51 * Reiver ponders.
10:51
<@jerith>
Searching across a bunch of calendars is likely to be less obnoxious than getting appointments from a global list every time you need one, however.
10:51
<@Reiver>
...You think?
10:52 You're now known as TheWatcher[afk]
10:52
<@jerith>
Searching through a bunch of little lists is not much more difficult than searching across one big list.
10:53
<@jerith>
You just do the search a bunch of times (one for each list) and collate the results.
10:53
<@Reiver>
Hrm.
10:53
<@Reiver>
Let's think about what else we need to do - alarms.
10:53
<@jerith>
That now becomes a timing issue.
10:54
<@Reiver>
We need to be able to set an alarm for each appointment, and have it pop up and go BING when it is needed.
10:54
<@Reiver>
Is this relevant at all to which design model we use?
10:54
<@jerith>
You can either run through the list every $time-period looking for alarms about to expire or you can keep a separate list of alarms.
10:55
<@McMartin>
One of the things you need to do, thus is "determine which appointment happens next"
10:55
<@jerith>
In the one case, looking up the alarm is difficult. In the other, setting and removing it is difficult.
10:55
<@McMartin>
Well, not that difficult. SortedSet *is* a basic type, after all.
10:55 * Reiver eyes.
10:55
<@Reiver>
So...
10:56
<@jerith>
s/difficult/a little more work in this case/ perhaps?
10:56
<@jerith>
Basically looking at the pros and cons of each approach.
10:56
<@McMartin>
jerith: Fair enough.
10:56
<@McMartin>
Yeah
10:56
<@McMartin>
I think I know how I'd do it
10:57
<@Reiver>
Four options. Big Appt List with Big Alarm List, Big Appt List with Search Each Minute, Calendars Store Appts with Big Alarm List, and Calendars Store Appts with Search Each Minute, so to speak...
10:57
<@jerith>
Likewise. But then I've been trained to think in terms of big systems so my preference may not be applicable here.
10:58
<@Reiver>
The second and third seem superficially more straightforward than the first and last, but other than that I couldn't really pick.
10:58 * Reiver frown.
10:59 * McMartin pokes jerith in the /msg
11:00
<@Reiver>
The second would be easy to search, messy to modify. The third would be easier modified, but messier to search through for data... I think?
11:00 * Reiver eyes McM curiously.
11:02
<@McMartin>
I believe you got those backwards.
11:03
<@McMartin>
The second is easier to modify because there is no need to keep two independent chunks of data consistent.
11:04
<@Reiver>
And the third?
11:04
<@McMartin>
The third divides the data up neatly so that lookup is fast.
11:05
<@Reiver>
Hrm. I see.
11:06 * Reiver tries to think how one would code either version, so he can get an idea of which is the most straightforward.
11:07
<@Reiver>
I suppose the advantage of dividing the data up is it means you can just have an AlarmTimes object that does it all for you, and you then treat it as a seperate object.
11:07
<@Reiver>
So... marginally more OO, but it would be referencing other objects a lot, so possibly not.
11:08
<@McMartin>
This may not be part of your class, but I will say it anyway.
11:08
<@McMartin>
Object Orientation Is Not A Virtue In Its Own Right.
11:09
<@McMartin>
Oh
11:09
<@McMartin>
jerith and I have been talking out-of-band, and a point has come up
11:09
<@McMartin>
These alarms
11:09
<@McMartin>
Are they the same things as appointments?
11:09
<@McMartin>
That is, does the app say "Hey, it's time for lunch", or are alarms like "You've got a meeting with Janet in an hour"?
11:11
<@Reiver>
I had been planning on having an alarmTime as an instance variable seperate to appointmentStart.
11:12
<@Reiver>
Defaulting to the same value unless otherwise specified.
11:12
<@McMartin>
Mmm. I see.
11:12
<@Reiver>
Does this changed things?
11:12
<@McMartin>
Well, my first shot at a solution assumed that appointments disappeared when they happened.
11:18
<@jerith>
The simplest implementation (although possibly not the best) would be to iterate through all the appointments and look for alarms that have expired since you last checked.
11:19
<@jerith>
Scales linearly with the number of appointments (which is fine for a project this size) and you're going to have to do the iteration each time anyway.
11:20
<@jerith>
Umm, no.
11:20
<@jerith>
You're going to have to do the iteration each time you search.
11:21
<@McMartin>
It is 0320, and I must therefore sleep
11:22
<@jerith>
G'night McMartin,
11:23
<@jerith>
Reiver: What do we have so far?
11:24 * Reiver considers.
11:24
<@Reiver>
Thanks, McM
11:24
<@Reiver>
Nini.
11:25
<@Reiver>
Iterating through the appointments would imply that it would be preferable to have all the appointments in one big list, no?
11:26
<@jerith>
Not necessarily. You can iterate over each calendar and then iterate over each appointment in each calendar.
11:27
<@jerith>
Let's look at the whole big list vs. small lists thing a little more closely.
11:28
<@jerith>
If you have a big list, you need a way to associate an entry in the big list with a calendar.
11:30
<@jerith>
There are a bunch of ways of doing this but they all have subtle problems.
11:31
<@jerith>
You could either let each appointment decide which calendar it's in. This is simple, but means you have to traverse the entire list very frequently.
11:31
<@jerith>
-either.
11:31
<@jerith>
You could store a reference to each appointment in the calender.
11:31
<@jerith>
Which means that you now have a big list in addition to a lot of small lists.
11:34
<@jerith>
Of course, iterating through the big list every time you need to do something with a calendar might not be that bad.
11:38 * jerith prods Reiver.
11:44 * Reiver apologises, got distracted by dinner.
11:44
<@Reiver>
Hrm.
11:44
<@Reiver>
So... Either a big list, or a big one and several small ones?
11:49
<@jerith>
Or just several smaller ones.
11:50
<@jerith>
The big and several small option offers many exciting opportunities for misduplicated data.
12:01 * Reiver ponders.
12:02
<@Reiver>
So... either big, or small.
12:02
<@Reiver>
This makes sense.
12:03
<@jerith>
Either works.
12:04
<@jerith>
It just depends if you want to optimise for operating on calendars or appointments.
12:09 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
12:10
<@jerith>
Why the latency?
12:10
<@jerith>
Sleepy? Sick? Busy?
12:10
<@jerith>
(Just wondering if I should be worried or not.)
12:21 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
12:23
<@Reiver>
Er. The first two, primarily.
12:23
<@Reiver>
Apologies, I should really be making the most of the help while I have it...
12:24
<@Reiver>
As for optimising on calendars or appointments, what parts would optimise for each?
12:26
<@jerith>
An appointment list per calendar would optimise for dealing with each calendar separately.
12:26
<@jerith>
Displaying and managing one at a time.
12:26
<@jerith>
A big list would optimise dealing with all appointments.
12:26
<@jerith>
Searching/alarming, etc.
12:27
<@Reiver>
Hrm.
12:27 * Reiver nods.
12:28
<@Reiver>
Performance wise, not much diff; merely simplicity-of-code stuff, yes?
12:28
<@jerith>
That depends on the implementation and what you're doing with it, really.
12:28
<@Reiver>
Well.
12:28
<@jerith>
But we can more or less ignore performance issues here.
12:28
<@Reiver>
I am doing a GUI-based calendar organiser. ;)
12:29
<@Reiver>
(Bloody vauge descriptions that it has.)
12:29
<@jerith>
And deal straight with the code simplicity.
12:29 * Reiver nods.
12:29 * Reiver tries to think which would... better way of thinking about it:
12:29
<@jerith>
I meant along the lines of keeping lists sorted by time or alarms or something.
12:29
<@Reiver>
The simple bits are, I must assume, going to be simple.
12:30
<@Reiver>
How complicated are the complicated bits in the other options? >.>
12:30
<@jerith>
For the alarms, you're going to have to grovel through the whole list anyway, since sorting it for alarms doesn't help anywhere else.
12:30 * Reiver nods.
12:30
<@jerith>
Same with the text search.
12:31
<@jerith>
So you don't really win much by going for a big list.
12:31
<@Reiver>
So... calendar-based, then?
12:31
<@jerith>
Whereas keeping them sorted by time in each calendar makes things much simpler dealing with the calendars.
12:31
<@jerith>
Which is where most of your code is going to be, if not most of the runtime.
12:31 * Reiver nods.
12:32
<@jerith>
So calendar-based lists looks like a good plan.
12:32
<@jerith>
And you can have a "give me all the appointments" method on the CollectionOfCalendars class.
12:33
<@Reiver>
...Which means when I /do/ need a big list, I can just call that on the calendars and construct the big fat list as required?
12:33
<@jerith>
Yes.
12:33
<@Reiver>
Handy.
12:33
<@Reiver>
Right, so.
12:34
<@jerith>
And then throw it away afterwards.
12:34
<@Reiver>
Calendars are going to store the appointments individually.
12:34
<@jerith>
Technically, you don't need the big list, just something that looks like one.
12:34
<@Reiver>
I think.
12:34
<@jerith>
But let's not go there just yet.
12:34
<@jerith>
So now you need to decide what the three classes look like.
12:35
<@jerith>
You can more or less write the Appointment class now.
12:35
<@jerith>
What does the Calendar class need?
12:35
<@Reiver>
It needs to have a name feild (instance variable).
12:36
<@Reiver>
It needs to have some way of knowing what appointments belong to it.
12:36
<@Reiver>
And, uh.
12:36
<@Reiver>
I don't know if it should be the Calendar object that does the search functions on the Appointments, or whether or not that should be another class entirely, but.
12:37
<@jerith>
The search is global, right?
12:37
<@jerith>
Or do you want to search per-calendar?
12:38
<@jerith>
There are a bunch of different ways to do the search.
12:38
<@jerith>
Globally, you could make it live on the CollectionOfCalendars class.
12:39
<@Reiver>
Hrm.
12:39
<@Reiver>
There needs to be a per-calendar time-based search, if nothing else.
12:39
<@Reiver>
That's how you'll be able to work out the appointments to be displayed each day/week/month/etc
12:40
<@Reiver>
And then the apparently generalised search-any-feild search - or whether it searches every feild, or just the ones visible, I am not entirely sure yet. This bears thinking about further, mayhap.
12:40 * Reiver looks it up.
12:41
<@jerith>
So, Calendar probably wants a "give me all appointments between these two times" method.
12:41 * Reiver nods.
12:41
<@Reiver>
This is different to the "Give me all appointments that have the following string in any of their variables" method, I am assuming?
12:41
<@jerith>
Very different.
12:41 * Reiver nods.
12:42
<@jerith>
And much simpler if you keep them sorted by time in the list.
12:42
<@jerith>
You may want to display everything that ends after start time, though.
12:43
<@jerith>
For multiday appointments and such.
12:43 * Reiver nods.
12:43
<@jerith>
Which means you can't direclty map start time.
12:43
<@Reiver>
...Hrm.
12:44
<@Reiver>
You actually almost end up mapping /end/ time.
12:44
<@Reiver>
Or...
12:44
<@jerith>
So you'll have to search from the start of the list until the last appointment that starts within the range.
12:44
<@Reiver>
No, not that either.
12:44
<@jerith>
Why not?
12:44 * Reiver tries to think.
12:44
<@Reiver>
You need to map both start and end time.
12:44
<@Reiver>
I think.
12:45
<@Reiver>
Wait.
12:45
<@Reiver>
Hrm. /Can/ it be ordered, at all?
12:45
<@jerith>
Not by both start and end time.
12:46
<@jerith>
But that's fine.
12:47
<@jerith>
You'll want to return a list anyway. So you just iterate through the calendar's list, adding anything that ends after your start time until you get to an appointment that starts after your end time.
12:48 * Reiver ponders. Nods.
12:48
<@Reiver>
So the list is ordered by start time.
12:48
<@jerith>
Yes, that makes the most sense.
12:48
<@Reiver>
Because that's the order it will need to be listed in anyway.
12:52
<@Reiver>
Right. So. I think.
12:56
<@Reiver>
The Calendar class has... an instance variable called 'Title'.
12:56
<@Reiver>
For the title of the Calendar.
12:56
<@Reiver>
It then has a... thingy.
12:56
<@Reiver>
ArrayList that stores the appointments? Or is this a Sorted List?
12:56
<@jerith>
You probably want a sorted list of some kind.
12:57
<@jerith>
Although I'm not entirely sure how you make the Appointments sort the way you want them to.
12:58
<@Reiver>
Collections.sort()!
12:58
<@Reiver>
(I failed a question in the test over that.)
13:01
<@Reiver>
(...Not that this indicates I know how to actually do it correctly /now/. But.)
13:05
<@jerith>
Hmm...
13:05
<@jerith>
For the SortedList, I mean.
13:05
<@jerith>
Anyways, that's an implementatio ndetail you can google.
13:06 * Reiver nods.
13:06
<@Reiver>
So tomorrow I write the sorting thingy. Er. And hope like buggery it works. Hm.
13:07
<@Reiver>
Also the search thingy, which should be... oh.
13:07
<@Reiver>
Urk.
13:07
<@jerith>
You probably want a doesThisMatch(String searchString) type method on Appointment.
13:08
<@Reiver>
Yeah. Not entirely sure how to do that one yet, unless there's a search method inside String already. (I just need to look that up and hope it exists, coff.)
13:08
<@jerith>
Then Calendar or CollectionOfCalendars (or both) has a method that iterates over the list and calls it.
13:08
<@jerith>
There should be.
13:09
<@jerith>
I seem to recall a whole bunch of them.
13:11 * Reiver tries to remember how one uses the for(something : ListOfSomethings) { stuff; } syntax again.
13:12
<@jerith>
for (Appointment app : Calendar.getAppointments) {doSomething(app);}
13:12
<@jerith>
IIRC.
13:12
<@Reiver>
Ah!
13:13
<@Reiver>
So we have, er.
13:16
<@Reiver>
for(Appointment app : this.getAppointment) { if(app.getStart < startTime && app.getEnd > startTime && app.getStart < endTime && app.getEnd > endTime) returnAppointmentList.add(app); }
13:16 * Reiver is pretty sure he got that wrong. There should be some || in there...
13:17
<@jerith>
for (Appointment app : this.getAppointments()) {
13:17
<@jerith>
if (app.getStart() < endTime) { break; }
13:18
<@jerith>
if (app.getEnd() > startTime) { apps.add(app); }
13:18
<@jerith>
}
13:18
<@jerith>
Umm, s/</>/ in the second line.
13:19
<@jerith>
Umm, I'm looking at the wrong problem.
13:19
<@jerith>
I think.
13:19
<@jerith>
What are we doing there?
13:19 * Reiver ponders.
13:19
<@Reiver>
We are trying to search through and make a list of all relevant appointments to display.
13:20
<@Reiver>
We display them if they are: Ending after the start of the time range, or starting after the start of the time range.
13:20
<@Reiver>
And
13:20
<@jerith>
Nonononono.
13:20
<@Reiver>
No?
13:20
<@jerith>
It's a boundary constraints thing.
13:21
<@jerith>
We display them if they overlap the time period at all.
13:21
<@jerith>
Are we assuming a list sorted by start time?
13:21
<@Reiver>
Yes.
13:22
<@jerith>
OK.
13:22 You're now known as TheWatcher
13:22
<@jerith>
So, the overlap means that we want any appointment that ends after the start of our time period but does not start after the end of our time period.
13:23
<@jerith>
Does that make sense?
13:23 * Reiver nods.
13:24
<@jerith>
Since it's sorted by start time and we're running from the front of the list, we know that the first appointment with a start time later than our end time means there are no more appointments that fit.
13:24
<@jerith>
Which is my first check.
13:24
<@Reiver>
Aha. Okay.
13:24
<@jerith>
Umm, my second check there is incomplete.
13:25
<@jerith>
It should include both condition, not just the one.
13:25
<@jerith>
Want to fix it?
13:25
<@Reiver>
if (appt.getEnd() > startTime && appt.getstart < endTime) {apps.add(app); }
13:25
<@Reiver>
?
13:26
<@Reiver>
...No, that's wrong.
13:26
<@Reiver>
We checked that already.
13:26
<@jerith>
No -- it's OR, not AND.
13:26 * Reiver ponders.
13:27
<@Reiver>
I got it wrong anyway, didn't I?
13:27
<@jerith>
Just the &&.
13:27
<@Reiver>
Because if appt.getstart < endTime resolves to true, then the program has already break'd on the previous line.
13:27
<@jerith>
No, my first test was broken.
13:28 * Reiver considers.
13:28
<@jerith>
Umm, I'm confused.
13:28 * jerith thinks a little harder.
13:29
<@jerith>
How about just excluding the ones we don't want?
13:29
<@jerith>
if (app.getStart() > endTime) {break;}
13:30
<@Reiver>
...That would be logical.
13:30
<@jerith>
if (app.getEnd() < startTime) {continue;}
13:30
<@jerith>
apps.add(app);
13:30
<@jerith>
That way we leave this iteration on anything not overlapping our time period.
13:31
<@jerith>
And we break the loop after our period, so we don't check all the useless later stuff.
13:31 * Reiver nods.
13:32
<@Reiver>
Wait.
13:32 * jerith waits.
13:32
<@Reiver>
"Continue" was actual syntax?
13:33
<@jerith>
Perhaps it's "next".
13:33
<@jerith>
I forget.
13:33
<@jerith>
Most languages use one or the other.
13:34
<@Reiver>
I couldn't just place the apps.add(app); into that if statement instead of the continue; whatsit?
13:35
<@jerith>
No.
13:36
<@Reiver>
Oh.
13:36
<@Reiver>
Why not? >.>
13:36
<@jerith>
Draw the karnaugh map of possibilities perhaps?
13:37
<@Reiver>
The whatnow?
13:37
<@jerith>
If you want to set the appointment in the conditional, you need a more complex conditional.
13:37
<@Reiver>
Oh.
13:39
<@Reiver>
Oh, wait.
13:39
<@ToxicFrog>
jerith: it's "continue" in C and C++ and I think in Java.
13:39
<@Reiver>
continue; is the syntax to 'skip the rest of this loop, but don't actually stop the for loop completely', yes?
13:40
<@ToxicFrog>
Yes.
13:40
<@jerith>
You need to check (a.end > start || a.start < end && a.end > start).
13:40 * Reiver suddenly has the dim memory erupt out of his mind from somewhere. He's never actually used the command in his life. *cough*
13:40
<@jerith>
Yes.
13:41 * jerith suddenly groks Reiver's confusion.
13:41
<@Reiver>
Yeah. I'd forgotten what 'continue;' actually /did/. :)
13:42
<@Reiver>
I think it was one of those things we actually used to lose marks for using, back in the day.
13:42
<@Reiver>
As it was 'halfway to a goto, and if you start using them heaven help us.'
13:42
<@ToxicFrog>
...
13:42
<@ToxicFrog>
So is every other branching and looping construct, Reiv.
13:42
<@Reiver>
(You also got an automatic 0 on your work if you used a GOTO command in your C++.)
13:43 * jerith ponders.
13:43
<@Reiver>
We don't have that continue; and break; restriction anymore.
13:43 You're now known as TheWatcher[afk]
13:43
<@jerith>
"continue" is limited anough and useful enough that there's no reason to avoid it.
13:43
<@jerith>
GOTO is dangerous, but has its place.
13:43
<@jerith>
Jumping out of nested loops, for example.
13:44
<@Reiver>
But we /used/ to.
13:44
<@Reiver>
I guess getting us into 'good habits' was rather the point, though~
13:44
<@ToxicFrog>
Or jumping directly to pre-return cleanup, which is how it's used in SGOS.
13:45
<@ToxicFrog>
(unless it's DocumentStorageAndTransport, but we don't talk about that)
13:46
<@Reiver>
Oddly enough, I suspect both of those were considered beyond the scope of 1st year C++ teaching when they announced the rule.
13:46
<@ToxicFrog>
Anyways. Avoiding break and continue is not a good habit.
13:47
<@ToxicFrog>
Indeed, it is a habit that will sooner or later lead you to a while loop containing six unreadable, interlocking if statements, and no-one wants this.
13:47
<@Reiver>
We could probably get away with a GOTO at 2nd/3rd year level without trouble. The idea was mostly so we didn't get into the habit of using them - GOTOs and, err, I forget the other thing were 'auto 0', break; continue; and global variables were 'frowned on'. >.>
13:47
<@ToxicFrog>
Your teachers must be beaten with lobsters.
13:48
<@Reiver>
...
13:48
<@Reiver>
I have visions of the papers the next morning.
13:49
<@Reiver>
"Programming Professor Brutally Beaten By Savage Seafood!"
13:49
<@Reiver>
...Okay, so the /tabloid/ papers. But.
13:49
<@jerith>
Big lobsters.
13:49
<@Reiver>
Anyhoo!
13:49
<@Reiver>
Okay, so. That code makes sense.
13:50
<@ToxicFrog>
Forbidding use of break and continue because "they're kind of like GOTO" is definitely worthy of a lobster-beating.
13:52
<@Reiver>
Oh, wasn't forbidden.
13:53
<@ToxicFrog>
Because either the prof is a moron, or a coward, or a sadist, but in either case LOBSTERS
13:53
<@Reiver>
Merely trying to encourage people to use properly structured while and do-while loops with actually relevant conditions.
13:53
<@Reiver>
Instead of having every loop as while(true) and then working out a breakpoint with an if statement /after/.
13:54
<@ToxicFrog>
See, what this tells me is that your prof is both sadistic and lazy.
13:55
<@Reiver>
Well, he /was/ teaching six hundred 1st year comp sci students.
13:55 Thaqui is now known as ThaquiSleep
13:56
<@Reiver>
There's a tendancy for that sort of person to enjoy pain and suffering, yes, because they're certainly not in it for the thrill of expounding academia to the interested masses...
13:59
<@ToxicFrog>
Ok. Here are two loops from my latest project. They are semantically equivalent.
14:00
<@ToxicFrog>
The first one uses break and continue:
14:00
<@ToxicFrog>
while(regex) {
14:00
<@ToxicFrog>
if( regex->atsol && buffer != line )
14:00
<@ToxicFrog>
continue;
14:00
<@ToxicFrog>
if( regcomp(regex->regex, buffer, 1, &match, 0) == 0 )
14:00
<@ToxicFrog>
break;
14:00
<@ToxicFrog>
regex = regex->next;
14:00
<@ToxicFrog>
}
14:00
<@ToxicFrog>
The second one doesn't:
14:00
<@ToxicFrog>
while( regex && ( (regex->atsol && buffer != line) || regcomp(regex->regex, buffer, 1, &match, 0) ) )
14:00
<@ToxicFrog>
{
14:00
<@ToxicFrog>
regex = regex->next;
14:00
<@ToxicFrog>
}
14:00
<@ToxicFrog>
Which of these is more readable?
14:01
<@Reiver>
The former.
14:01
<@Reiver>
But I'd write the latter out of habit.
14:01
<@Reiver>
>.> <.<
14:01
<@ToxicFrog>
...
14:01
<@ToxicFrog>
See, I /told/ you your prof wasn't instilling good habits in you.
14:01
<@Reiver>
Swiftly, this becomes apparent.
14:01 * Reiver cough.
14:01
<@ToxicFrog>
(the latter is also harder to write and much easier to get syntactically correct but semantically wrong)
14:02
<@Reiver>
(I had that in my last java program, too. Heh.)
14:04
<@Reiver>
Right!
14:04
<@Reiver>
Now.
14:04
<@jerith>
Am I misreading the first or does it have an infinite loop bug in the first condition?
14:04
<@ToxicFrog>
No.
14:04
<@ToxicFrog>
At the end, regex = regex->next
14:05
<@jerith>
But you're continuing past that.
14:05
<@ToxicFrog>
...whups, you're right. Dropped a line.
14:05
<@jerith>
:-)
14:05
<@ToxicFrog>
if( regex->atsol && buffer != line ) {
14:05
<@ToxicFrog>
regex = regex->next; continue;
14:05
<@ToxicFrog>
}
14:06
<@jerith>
I work with a guy who used to be a compsci prof.
14:07
<@jerith>
And he was telling me about a language he used that had an accept/reject block.
14:07
<@ToxicFrog>
accept/reject?
14:07
<@jerith>
Kind of like a try/finally block.
14:08
<@jerith>
Except the try bit was full of conditions to either jump to or skip the finally bit.
14:08
<@jerith>
I think the keyword was "guess", actually.
14:09
<@jerith>
guess {
14:09
<@jerith>
if (foo == bar) accept;
14:09
<@jerith>
if (baz > quux) reject;
14:09
<@jerith>
} do {
14:09
<@jerith>
// code
14:09
<@jerith>
}
14:10
<@jerith>
Something like that.
14:10
<@jerith>
Not used all that often, but incredibly useful where it was.
14:11 * ToxicFrog idly strangles SciTE.
14:12
<@ToxicFrog>
One day I will meet this program's creator and shake him warmly by the throat.
14:12
<@jerith>
:-)
14:18
<@ToxicFrog>
...
14:19
<@jerith>
I tried to use a python syntax highlighting library based on scite once...
14:19
<@jerith>
So I'll lend you any weapons you may require.
14:19
<@ToxicFrog>
Heh.
14:20
<@ToxicFrog>
I haven't used the python one, obviously, but all the lexer modules I have used are actually pretty good.
14:20
<@ToxicFrog>
The problem comes when you want to modify them.
14:20 You're now known as TheWatcher
14:23
<@Reiver>
Anyhoo, my brain is brokken.
14:23
<@Reiver>
Being 2:30AM will do that, alas.
14:23 * Reiver collapse.
14:24
<@jerith>
G'night.
14:24
<@Reiver>
Ni!
14:24
<@jerith>
I'll be around tomorrow same time if you want me.
14:24
<@Reiver>
(Being sick will also do that even more, but...)
14:24
<@ToxicFrog>
'night, Reiv.
14:24
<@Reiver>
(Well. We'll see if I manage to feel better tomorrow.)
14:24
<@Reiver>
Thanks for the help, guys.
14:24 Reiver is now known as ReivZzz
14:24
<@jerith>
Any time.
14:24
<@jerith>
Well, Any time I'm awake and available...
14:28
<@ReivZzz>
Was going to say. :p
15:19 MahalOUT [~Mahal@Nightstar-11770.worldnet.co.nz] has quit [Ping Timeout]
15:19 MahalOUT [~Mahal@Nightstar-11770.worldnet.co.nz] has joined #Code
15:25 You're now known as TW[cleaning]
15:49 MahalOUT [~Mahal@Nightstar-11770.worldnet.co.nz] has quit [Ping Timeout]
15:52 MahalOUT [~Mahal@Nightstar-11770.worldnet.co.nz] has joined #Code
16:14 aoanla [~sam@Nightstar-19071.range81-156.btcentralplus.com] has joined #code
16:14 You're now known as TheWatcher
16:30 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
16:41 ThaquiSleep [~Thaqui@Nightstar-8486.adsl.xtra.co.nz] has quit [Ping Timeout]
16:41 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
16:47 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Quit: Installing kernel-2.6.17-1.2187]
16:47 ThaquiSleep [~Thaqui@Nightstar-8486.adsl.xtra.co.nz] has joined #code
16:56 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
16:56 mode/#code [+o ToxicFrog] by ChanServ
17:27 You're now known as TheWatcher[afk]
18:06 takyoji [~caleblang@Nightstar-25427.dhcp.roch.mn.charter.com] has joined #code
18:08
< takyoji>
I've got apache working through every port now.. it's just that if I try typing the servername, it doesn't work
18:09
<@ToxicFrog>
If this is the same hostname you mentioned last night, that would be because it's not in DNS.
18:09
<@ToxicFrog>
How much do you know about DNS and hostname resolution?
18:09
< takyoji>
not a whole lot..
18:09
< takyoji>
heres what I have in the config though "ServerName caleb870-test.com:8080"
18:10
< takyoji>
otherwise no other changes related to that part
18:11
< takyoji>
And stupid me wasn't able to realize it that my router was still actually was blocking the requests, so NOW I've got the damned thing workin
18:11
<@ToxicFrog>
Ok. First of all, you must understand that at the IP layer - and, by extension, the TCP layer - there is no concept of hostnames.
18:11
<@ToxicFrog>
It only understands IP addresses.
18:11
<@jerith>
[jerith@jerith-lap0 ~]$ host calbe870-test.com
18:11
<@jerith>
Host calbe870-test.com not found: 3(NXDOMAIN)
18:11
<@ToxicFrog>
Thus, to open a connection to a system specified by hostname, you need some means of translating hostnames into IP addresses. Enter DNS, the Domain Name Service.
18:11
<@ToxicFrog>
jerith: yes, I mentioned that already. Twice.
18:11
<@jerith>
It looks like the DNS hasn't propagated yet.
18:12 * aoanla eyes jerith.
18:12
< aoanla>
Is this not what TF just said?
18:12
<@ToxicFrog>
takyoji: so. You enter a hostname, say, www.google.ca.
18:12
<@jerith>
It is indeed. Sorry, I missed tht bit.
18:12
<@ToxicFrog>
Your computer queries your local DNS server, which replies with the IP address corresponding to that name.
18:12
<@ToxicFrog>
And then it connects to it using that IP address.
18:13
<@ToxicFrog>
This, of course, requires you to actually register the domain name, and bind it to your IP address.
18:13
<@ToxicFrog>
This typically costs money.
18:13
< takyoji>
ohh..
18:13
< takyoji>
crap
18:13
<@ToxicFrog>
There are, of course, free options.
18:13
<@jerith>
Not all domains cost money, however.
18:14
<@ToxicFrog>
Dyndns.org, for example, allows you to register a *.dyndns.org hostname and use that.
18:14
< takyoji>
ah those
18:14
< takyoji>
just subdomains?
18:15
<@jerith>
You could get a .za.net domain, but that has a waiting time of a couple of weeks usually and it implies South Africa.
18:15
<@ToxicFrog>
Dyndns only allows subdomains, although they have several different hostnames to choose from (*.dyndns.org, *.homeip.net, perhaps 30-40 others). There may be others.
18:15
<@jerith>
I'm sure there are also other options.
18:15
< takyoji>
ahh
18:15
<@ToxicFrog>
Also!
18:15
<@ToxicFrog>
You are misusing the ServerName directive.
18:15
< takyoji>
otherwise the primary purpose of this server is for testing
18:15
< takyoji>
oh
18:16
< aoanla>
In principle, could you not just tell your router to act as a local DNS (and to associate your DN with the right IP)? Or is that bad, for some reason?
18:16
<@ToxicFrog>
As it says in the documentation, it is meant to be the canonical hostname of the server. Not the IP address, not the reverse DNS, and definitely not the URL-with-port.
18:16
<@ToxicFrog>
aoanla: it works, but only in your LAN. No-one else uses that router as a DNS server, is the thing.
18:17
<@jerith>
You could always toss it in /etc/hosts (or the win32 equivalent) if you only care about local testing.
18:17
< aoanla>
TF: Indeed. Are we looking at making things visible on the Wider Internets in this application, then?
18:17
<@ToxicFrog>
aoanla: well, he appears to want it accessible from outside.
18:17
< takyoji>
ah, so when you buy the domain, the domainname gets registered with the ip address among all the internet service providers
18:17
<@ToxicFrog>
Otherwise fiddling with the router wouldn't be necessary.
18:17
<@ToxicFrog>
takyoji: roughly, yes.
18:18
< aoanla>
TF: True, but I was hoping that it was "outside" as in "LAN", not "outside" as in "Internets".
18:18
<@ToxicFrog>
Anyways, ServerName is what the server thinks of itself as, and is what the server uses when generating redirects and suchlike.
18:18
<@ToxicFrog>
It has no effect on DNS, and if it's not a valid hostname it won't work.
18:19
<@ToxicFrog>
If you registered, say, caleb870 with Dyndns, you would set this to caleb870.dyndns.org
18:19
< takyoji>
ahh
18:19
<@ToxicFrog>
When it generates a redirect URL, it will automatically combine this with the Port setting; appending Port to ServerName as you did above will not work.
18:20
<@ToxicFrog>
Again, this is all in the apache/core docs.
18:20
< takyoji>
so just use my DNS address for that or something?
18:21
<@ToxicFrog>
Yes. Or omit it entirely, and the server will work it out itself.
18:22
<@jerith>
Although it will complain about it if it can't find one.
18:22 * Vornicus-Latens fiddles with texture-filtering.
18:23
<@jerith>
And then use 127.0.0.1 which won't work off the box.
18:23
<@jerith>
Hey Vorn.
18:23
< Vornicus-Latens>
(UseCanonicalNames No)
18:23 Vornicus-Latens is now known as Vornicus
18:23 * jerith reblings the Vorn and rolls him in chocolate sprinkles.
18:32
< takyoji>
but wouldn't I still be able to access myself by a hostname on my network anyway?
18:33
< Vornicus>
meep
18:36
< Vornicus>
argl. I need a thing that tells me the area of a section of sphere defined by two latitudes and two longitudes.
18:37 * Vornicus fiddles.
18:37
<@jerith>
You can get the angles from lat/long.
18:37
<@jerith>
From that, you can get steradians.
18:38
< Vornicus>
latitude lines aren't great circles though
18:38
<@jerith>
No, but they are evenly spaced angles.
18:38
< Vornicus>
"evenly spaced angles"?
18:38
<@jerith>
Umm.
18:39
<@jerith>
The angle between 0 and 10 is the same as the angle between 80 and 90.
18:39
<@jerith>
And 45 to 55.
18:39
< Vornicus>
true, but I don't see how that gets me anywhere
18:42
<@jerith>
Hmm, I think I may be mistaken.
18:42
<@jerith>
Or, at least, not fully thinking this out.
18:43
< Vornicus>
problem is that 0lat-10lat and 0long-180long is a lot bigger than 80lat-90lat and 0long-180long
18:43
<@jerith>
You may need to do this in two stages.
18:43 * Vornicus applies calculus.
18:44 You're now known as TheWatcher
18:45
< Vornicus>
...wicked.
18:45
<@jerith>
Wicked?
18:45
< Vornicus>
http://mathworld.wolfram.com/Zone.html <--- equation 8.
18:46
< Vornicus>
then just multiply by the angle between the longitudes instead of 2pi, and...
18:47
<@jerith>
You'll need to do some trig to get the height from the lats, though.
18:47
< Vornicus>
OH NOES SINE
18:47
<@jerith>
Indeed.
18:53 * Vornicus fiddles.
18:53
< takyoji>
I'm trying to install php, but when I add the lines required in the configuration to run php, it says it can't find the file
18:53
< takyoji>
LoadModule php5_module "C:/php/php5apache2.dll"
18:53
< takyoji>
AddType application/x-httpd-php .php
18:53
< takyoji>
PHPIniDir "C:/php/"
18:53
< Vornicus>
hey, look.
18:53
< Vornicus>
that's spectacularly graceful.
18:54
< takyoji>
and when I load apache it says it can't find c:/php/php5apache2.dll
18:54
< takyoji>
I know! ;D
18:54
< Vornicus>
so it php5apache2.dll in the expected place?
18:54
< takyoji>
yep
18:54
< takyoji>
yet it says it can't find it
18:55
<@jerith>
Vorn: the solution to your equations?
18:55
< Vornicus>
yeah
18:56
< Vornicus>
I mean, holy crap that's easy.
18:56
< takyoji>
although php5apache2.dll says its for Apache 2.0 should I just downgrade to version 2.0? ;P
18:56
< takyoji>
I have 2.2
18:57
<@jerith>
takyoji: If it's compiled against 2.0 there may have been API changes that break it.
18:57
<@jerith>
But that shouldn't be a problem with not finding the file.
19:00
< takyoji>
httpd.exe: Syntax error on line 69 of (yada yada): Cannot load C:/php/php5apache2.dll into server: The specified module cannot be found.
19:00
< takyoji>
brb
19:00
<@jerith>
Hmm...
19:00
<@jerith>
Does it want the full path to the dll?
19:01
< takyoji>
how else would it be able to find it??
19:02
< takyoji>
I've also tried having the php folder in the same folder as apache is and tried loading it but still didnt work
19:02
<@jerith>
LoadModule php5_module modules/libphp5.so
19:02
<@jerith>
(From mine.)
19:03
<@jerith>
I would imagine it has a directory it likes to keep these things in...
19:03
< takyoji>
couldn't find it
19:03
<@jerith>
/usr/lib/httpd/modules/libphp5.so
19:03
< takyoji>
I probably dont have that file anyway
19:04
<@jerith>
No idea where it lives on Windows.
19:04
<@jerith>
But a good bet would be looking where it installed itself for a "modules" directory.
19:04
< takyoji>
yea, and I don't have tat file which is the point I'm stating
19:04
< takyoji>
that*
19:05
< takyoji>
its not in my modules folder
19:05
<@jerith>
Which file?
19:05
<@jerith>
php5apache2.dll?
19:05
< takyoji>
libphp5.so
19:05
<@jerith>
Oh, that's the unix version.
19:05
< takyoji>
oh
19:06
< takyoji>
all my module files are so files
19:06
< takyoji>
*.so
19:06
<@jerith>
Hmm...
19:06
<@jerith>
I really have no experience with this stuff under Windows. :-/
19:08
< takyoji>
do you have version 2.2?
19:10
<@jerith>
httpd-2.0.54-10.4
19:10
<@jerith>
According to RPM.
19:12
< takyoji>
I'll try version 2.0 just incase anywa
19:12
< takyoji>
because maybe somethings in version 2.2 are depricated
19:12
<@jerith>
You may want to find an easy-to-install all-in-one package...
19:12
< takyoji>
I am using an installer
19:13
<@jerith>
Does it do apache and php?
19:14
< takyoji>
only apache
19:14
< takyoji>
where would a php and apache installer be?
19:14
<@jerith>
No idea.
19:14
< takyoji>
or php, apache, mysql and so on
19:14
<@jerith>
But I have seen references to entire WAMP stacks.
19:15
<@jerith>
http://www.apachefriends.org/en/xampp.html <-- looks good.
19:16
<@jerith>
May be a little big for you, though.
19:16
< takyoji>
ooo
19:17
<@jerith>
Since it comes with the kitchen sink /and/ the bathtub.
19:17
<@jerith>
As I said, though, I've never used it myself.
19:17
<@jerith>
So I can't really vouch for it.
19:18
< takyoji>
ahh
19:18
< takyoji>
sounds very interesting though
19:18
< takyoji>
it'd basically exactly what I need
19:19
< takyoji>
crap, I need to clean up my harddrive a little bit though
19:19
< takyoji>
only 1gb left
19:20
< takyoji>
on a 80gb hd
19:21
<@jerith>
That much?!?
19:21 * jerith boggles.
19:21
<@jerith>
I had to severly clean up my new 160Gb to get enough space to transcode these xvids for use on a dvd player.
19:21
< takyoji>
heh
19:22
< takyoji>
well, I haven't really spent much money on this computer
19:22
< takyoji>
eMachine
19:22
<@jerith>
And I had to get the 160Gb because all the drives on all three of my machines were full. :-/
19:22
< takyoji>
heh
19:23
< takyoji>
I've just got so many programs
19:23
< takyoji>
like friggin 60
19:24
<@jerith>
My problem is mostly too much data.
19:24
<@jerith>
Or code.
19:25
< takyoji>
basically, 3gb of stuff from emule, about 5gb for games, 11 gb for pictures, and so on
19:26
<@ToxicFrog>
Hmm. I have...1.5GB of code, and perhaps 270GB of data + stuff I've burned to disc.
19:26
< takyoji>
stupidly enough, my computer doesn't have a DVD burner
19:27
<@ToxicFrog>
And 65GB of games on the windows box.
19:27
< takyoji>
heh oh lord
19:27
<@ToxicFrog>
Hmm. Another 60GB of data and I'm going to have to enlarge /static again.
19:28
< takyoji>
heh
19:28
<@jerith>
One of these days I need to get a slimline box with a basic mobo+proc and a set of big drives in it.
19:28
<@ToxicFrog>
And use it as a fileserver?
19:28
<@jerith>
RAID them and I have a decent backup solution.
19:29
<@ToxicFrog>
I've just set that as one of the myriad duties of Orias.
19:29
<@jerith>
ToxicFrog: Probably.
19:29
<@ToxicFrog>
It runs all my servers, and since it also has all the big drives and the RAID6 array, this includes smbd.
19:29
<@jerith>
I'm debating whether it needs to talk smb.
19:30
<@jerith>
All I really use the Windows box for is games.
19:30 Syloq [Syloq@NetAdmin.Nightstar.Net] has joined #code
19:30
<@jerith>
But it would be nice to be able to back up my saves.
19:30
<@jerith>
Hey Syloq
19:30
<@ToxicFrog>
Mine has to, since Orias is headless.
19:30
<@ToxicFrog>
The monitor is attached to the windows box, as are the speakers and suchlike.
19:31
<@ToxicFrog>
And since there are no NFS drivers for windows...
19:31
<@jerith>
I have a KVM between the gentoo box and the multiboot win/debian/plan9 box.
19:31
<@jerith>
Which reminds me, I need to fiddle with plan9 again.
19:32 * ToxicFrog nods.
19:32
<@jerith>
It was rather shiny when I last used it, but I still hadn't got to the level of creating myself a user...
19:32
<@ToxicFrog>
KVM is kind of impractical, since Orias is on the other side of the house.
19:32
< Vornicus>
I want a two-output KVM.
19:32
<@ToxicFrog>
(in the laundry room/network closet, specifically. I am not keeping something with nine fans in my bedroom.)
19:34
<@jerith>
I have nowhere else to keep my boxen. :-(
19:34
<@jerith>
I have some vague plans to acquire a short rack and some rackmount cases for it.
19:35
<@ToxicFrog>
A rack would be lovely, especially since Orias is, in fact, designed for rackmounting.
19:35
<@ToxicFrog>
And then I can stack the hedgehogs on top of it.
19:35
< takyoji>
Whats FileZilla FTP?
19:35
< takyoji>
Just an FTP protool for the server?
19:35
<@ToxicFrog>
takyoji: FileZilla is an FTP and SFTP client. Open-source, quite food.
19:35
< takyoji>
protocol*
19:35
<@ToxicFrog>
*quite good.
19:35
< takyoji>
k
19:36
<@ToxicFrog>
FTP is the File Transfer Protocol, a common means for trasferring files between systems.
19:37
<@jerith>
ToxicFrog: I believe one can acquire much better priced racks by looking at audio equipment.
19:38
<@ToxicFrog>
...so, audio racks, despite being identical to server racks, cost less?
19:38
<@jerith>
They're built to about the same specs and it's easier to get them in smaller sizes.
19:38
<@jerith>
Something like that, yes.
19:40
<@ToxicFrog>
Huh.
19:41
<@ToxicFrog>
(I have considered trying to glom a spare rack from work, but we never have spare racks. Ever.)
19:41
<@jerith>
The racks we have at work are too big for me.
19:41
<@ToxicFrog>
(if we ever have a rack with nothing in it, it's because we only just finished installing it and Mike's coming down the hall /right now/ with a dozen machines to attach to it)
19:41
<@ToxicFrog>
That too.
19:43
<@jerith>
I just can't really afford more boxen to put in a rack at the moment.
19:45 takyoji [~caleblang@Nightstar-25427.dhcp.roch.mn.charter.com] has quit [Quit: ]
20:25 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #code
20:36 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: ~]
22:22 Syloq is now known as Syloqs-AFH
22:37 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
22:37 mode/#code [+o Chalcedon] by ChanServ
22:56 takyoji [~caleblang@Nightstar-25427.dhcp.roch.mn.charter.com] has joined #code
22:56
< takyoji>
:D here's the progress on my test server: http://68.190.158.25/
22:58
< takyoji>
just the header
23:00 ThaquiSleep is now known as Thaqui
23:32 MahalOUT [~Mahal@Nightstar-11770.worldnet.co.nz] has quit [Quit: It's hard to be mad at someone who misses you while you're asleep. ]
23:32 Mahal [~Mahal@Nightstar-11770.worldnet.co.nz] has joined #Code
23:32 mode/#code [+o Mahal] by ChanServ
23:33 aoanla is now known as caps[t-2]
23:36 caps[t-2] [~sam@Nightstar-19071.range81-156.btcentralplus.com] has quit [Quit: Leaving]
23:41 Thaqui is now known as ThaquiWork
23:50 GeoTube [~Someone@Nightstar-2556.cable.ubr01.dund.blueyonder.co.uk] has joined #Code
23:57 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
--- Log closed Sun Oct 15 00:00:59 2006
code logs -> 2006 -> Sat, 14 Oct 2006< code.20061013.log - code.20061015.log >