code logs -> 2009 -> Thu, 10 Dec 2009< code.20091209.log - code.20091211.log >
--- Log opened Thu Dec 10 00:00:23 2009
00:00
< Derakon[work]>
If Baz had thrown a DivideByZeroException instead, say, and you hadn't set your catch statement to look for those, then Foo would also stop and keep going up the call stack.
00:00
< Derakon[work]>
Eventually you either run out of call stack (causing the program to crash), or you reach a top-level catch that handles your exception.
00:01
< Derakon[work]>
Make sense?
00:01
< SmithKurosaki>
Yes
00:01
< SmithKurosaki>
Thank you
00:02
< Derakon[work]>
Note that you can make general "catch any exception" catchers, but this is generally frowned on.
00:02
< SmithKurosaki>
Makes sense
00:03
< Derakon[work]>
Also, IIRC Java will require you to state what kinds of exceptions your function can throw, which, if you don't catch them, includes all the exceptions that functions you call can throw.
00:03
<@McMartin>
This is mostly true.
00:03
< Derakon[work]>
Queue McM with more accurate, less glossy responses. :)
00:03
< Derakon[work]>
Er, cue.
00:03
<@McMartin>
It's true of the "Checked Exceptions", which are all subclasses of java.lang.Throwable that are not also subclasses java.lang.RuntimeException.
00:03
<@McMartin>
For the most part, RuntimeExceptions are supposed to crash your program unless you are explicitly processing untrusted data.
00:04
<@McMartin>
It's a matter of style whether you should check to ensure that a!=null before using a, or if you should instead just have straight-line code that eventually catches NullPointerException.
00:06
< Derakon[work]>
(Note that this behavior, of short-circuiting the call stack, is a big reason why you shouldn't write code that expects to throw exceptions in "normal" execution -- it screws up compiler and CPU optimizations and causes your code to run slowly)
00:06
< Derakon[work]>
(Exceptions are slow. They shouldn't happen regularly)
00:08 * Derakon[work] closes IRC to get some more stuff done before heading home.
00:08 Derakon[work] [Derakon@Nightstar-d44d635e.ucsf.edu] has quit [[NS] Quit: Leaving]
00:19
<@McMartin>
There are some languages for which exceptions are insanely fast; you are unlikely to ever be using them.
00:46 MyCatSchemes [mycatverbs@Nightstar-f43ca811.blueyonder.co.uk] has quit [[NS] Quit: Leaving]
00:46 MyCatSchemes [mycatverbs@Nightstar-f43ca811.blueyonder.co.uk] has joined #code
00:49 You're now known as TheWatcher[T-2]
00:55 You're now known as TheWatcher[zZzZ]
01:05 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
01:05 Vornicus-Latens [vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
01:05 mode/#code [+o Vornicus] by Reiver
01:30 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ]
01:36 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
01:36 mode/#code [+o Vornicus] by Reiver
01:48 Derakon[AFK] is now known as Derakon
02:43 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
02:44 Syloqs_AFH is now known as Syloqs-AFH
02:59 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ]
03:03 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
03:03 mode/#code [+o Vornicus] by Reiver
03:03 Finale [c0cb88fe@Nightstar-14e5d099.mibbit.com] has quit [[NS] Quit: http://www.mibbit.com ajax IRC Client]
03:57
< Rhamphoryncus>
Java's checked exceptions are essentially a failed experiment in language design. It'd be much better if, rather than forcing you to catch them (and silently ignore them 90% of the time), it would automatically wrap them in a RuntimeException which is only caught by generic error handlers
03:57
<@McMartin>
I do rather like the idea of the split of "reasonable to compiler-check" and "not reasonable to compiler-check".
03:58
< Rhamphoryncus>
Thus, you'd have expected ones that your program handles gracefully (IO errors and the like), and unexpected ones that end up aborting half or all of your program
03:58
< Rhamphoryncus>
Heck, even having a simple way to explicitly wrap them in RuntimeException would be better
03:59
<@McMartin>
I'd be fine with it being a warning instead of an error
03:59
< Rhamphoryncus>
so you'd do this: try { blah blah; } unhandled (IOError, ValueError, WhateverJavaError) catch ExpectedError { .. do something; }
04:00
< Rhamphoryncus>
I'm not fond of warnings. Either it is an error or it isn't. The only grey area is something that wasn't an error but will be in future versions
04:05 SmithKurosaki [Smith@Nightstar-f933638e.dsl.teksavvy.com] has quit [Connection closed]
04:07 SmithKurosaki [Smith@Nightstar-e2478917.cable.rogers.com] has joined #code
04:09 * simon` is implementing parts of a compiler for the Janus programming language as part of an assignment.
04:09
< simon`>
this stuff is so exciting.
04:10
< simon`>
(that is, making compilers. I haven't completely grokked reversible languages yet.)
04:13
< simon`>
Rhamphoryncus, that reminds me of a 'warning' I get occasionally from evince that says something about a CRITICAL ASSERTION THAT FAILED. still, I don't notice the program crashing.
04:15
< Rhamphoryncus>
I think because C doesn't have proper exceptions that can be caught that gnome software has a policy exiting the function semi-gracefully on assertion failures
04:15
< Rhamphoryncus>
Much like checked exceptions, come to think of it.. but at least they print something out
05:09 * Derakon sends a helpful email to the owners of a hang gliding company, whose online inventory page is over 48MB.
05:10
< Derakon>
Mostly because they're creating their thumbnail images by using <img src="path-to-raw-digicam-image.jpg" width="100" height="75">
05:10
< Rhamphoryncus>
heh
05:11
< Derakon>
A very basic resize job would cut their page size by a factor of 100.
05:11
< Derakon>
If you were willing to do some image optimization you could easily get it much lower.
05:14 AnnoDomini [annodomini@Nightstar-9b577ddb.adsl.tpnet.pl] has joined #code
05:14 mode/#code [+o AnnoDomini] by Reiver
06:22 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
06:33 Derakon is now known as Derakon[AFK]
07:11 * Rhamphoryncus thinks openoffice's help menu needs to have a link to a suicide hotline
07:16
< Rhamphoryncus>
I think learning SQL (and programming in general) forever ruined openoffice for me. I simply can't the spreadsheet/table model knowing there's a much better way to do it
07:17
< simon`>
heh
08:59 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has quit [Client exited]
09:31 You're now known as TheWatcher
09:59 MyCatSchemes [mycatverbs@Nightstar-f43ca811.blueyonder.co.uk] has quit [Ping timeout: 121 seconds]
10:20 MyCatSchemes [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
11:36 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
11:38 MyCatSchemes [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [Ping timeout: 121 seconds]
11:54 MyCatSchemes [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
12:52 MyCatSchemes [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [Ping timeout: 121 seconds]
13:08 MyCatSchemes [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
13:55 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
13:55 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
13:55 mode/#code [+o ToxicFrog] by Reiver
14:01 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
14:30
<@AnnoDomini>
"< Rhamphoryncus> I think learning SQL (and programming in general) forever ruined openoffice for me. I simply can't the spreadsheet/table model knowing there's a much better way to do it" <- You can't do WHAT to the spreadsheet/table model?
14:31
< Tarinaky>
Stand/Use I imagine.
14:38
<@TheWatcher>
The question you have to ask at this point: do you really want to know?
14:42
< Tarinaky>
No.
14:53 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Reboot]
14:58 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
15:32 AbuDhabi [annodomini@Nightstar-48aea1d4.adsl.tpnet.pl] has joined #code
15:34 AnnoDomini [annodomini@Nightstar-9b577ddb.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
16:23
<@Vornicus>
I like spreadsheets, actually
16:23
<@Vornicus>
they're good for stuffing together commands and seeing what comes out of each step.
16:24
< gnolam>
Indeed.
16:24
< gnolam>
They're awesome for parameter tweaking.
16:24
<@Vornicus>
Often I will prototype my stuff in spreadsheets before actually programming.
16:24
<@Vornicus>
That, and drawing graphs in PostScript can be rather a pain.
16:36 Tarinaky [Tarinaky@Nightstar-b1c005b5.adsl.virginmedia.net] has quit [Operation timed out]
16:50 Tarinaky [Tarinaky@Nightstar-98d53088.adsl.virginmedia.net] has joined #code
16:51 SmithKurosaki [Smith@Nightstar-e2478917.cable.rogers.com] has quit [Ping timeout: 121 seconds]
16:52 SmithKurosaki [Smith@Nightstar-e2478917.cable.rogers.com] has joined #code
17:00 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has joined #code
17:15 Tarinaky [Tarinaky@Nightstar-98d53088.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
17:29 Tarinaky [Tarinaky@Nightstar-4b66a187.adsl.virginmedia.net] has joined #code
17:54 Tarinaky [Tarinaky@Nightstar-4b66a187.adsl.virginmedia.net] has quit [Operation timed out]
18:08 Tarinaky [Tarinaky@Nightstar-566f8fe4.adsl.virginmedia.net] has joined #code
18:32 Finale [c0cb88fe@Nightstar-14e5d099.mibbit.com] has joined #code
18:47
< simon`>
Vornicus, gnuplot!
18:48
<@TheWatcher>
ahahahahaha
19:02 Derakon[gonk] [Derakon@Nightstar-d44d635e.ucsf.edu] has joined #code
19:04
< Derakon[gonk]>
I think this is quite a bit worse than the "C-style templating in Python" that we saw yesterday.
19:04
< Derakon[gonk]>
http://paste.ubuntu.com/338863/
19:05
< Derakon[gonk]>
sys._getframe([depth]): "Return a frame object from the call stack. If optional integer depth is given, return the frame object that many calls below the top of the stack."
19:05
< Derakon[gonk]>
PROTIP: if you are directly interacting with the callstack, YOU ARE DOING IT WRONG.
19:05
< Derakon[gonk]>
Whyyyyyyyyyyy. :( :( :( :( ;_;
19:06
<@TheWatcher>
... Dear, sweet, merciful Cthulhu...
19:11
< Derakon[gonk]>
The code I've seen up to now has been bad, but I never really thought of it as a travesty. But I'm pretty sure this violates international conventions somehow.
19:14
<@jerith>
That's....
19:14
<@jerith>
There must be easier ways to drive one insane.
19:40 MyCatSchemes [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [[NS] Quit: Leaving]
19:51
< Derakon[gonk]>
I'm not sure if it's better or worse that the only places I've found so far that use the hdrEval argument pass the exact same string to it every time.
19:51
< Derakon[gonk]>
They could simply pass the two arguments they're setting instead. :(
19:51
< Derakon[gonk]>
(Let alone the lambda approach!)
19:54
< Derakon[gonk]>
I guess it wouldn't be Sebastian if the WTFs were just bad. They have to be gratuitous too.
19:54 Attilla [The.Attilla@FBC920.58502B.1ADD6E.CC89EF] has quit [Connection reset by peer]
19:54 Attilla_ [The.Attilla@FBC920.58502B.1ADD6E.CC89EF] has joined #code
19:55
<@TheWatcher>
I'd be suggesting that you keep some kind of log of these, for your memoirs or something... but I suspect it'd be easier to just quote the whole codebase...
19:56
< Derakon[gonk]>
I've started tagging my LJ entries with "wtf".
19:56
< Derakon[gonk]>
Alternatively I can just grep my ljdumps for "Sebastian".
20:05 Attilla_ [The.Attilla@FBC920.58502B.1ADD6E.CC89EF] has quit [Ping timeout: 121 seconds]
20:05 Attilla [The.Attilla@FBC920.58502B.1ADD6E.CC89EF] has joined #code
20:05 mode/#code [+o Attilla] by Reiver
20:13 Attilla [The.Attilla@FBC920.58502B.1ADD6E.CC89EF] has quit [Client closed the connection]
20:13 Attilla_ [The.Attilla@FBC920.58502B.1ADD6E.CC89EF] has joined #code
20:14 Attilla [The.Attilla@FBC920.58502B.1ADD6E.CC89EF] has joined #code
20:14 mode/#code [+o Attilla] by Reiver
20:14 Attilla_ [The.Attilla@FBC920.58502B.1ADD6E.CC89EF] has quit [Connection reset by peer]
21:01
< AbuDhabi>
This is frustrating. Somehow, I've managed to break the virtual machine's internet.
21:01
< AbuDhabi>
I can access its webserver from the host machine, but can't run apt-get update from within.
21:12
< AbuDhabi>
Any ideas how to fix this?
21:13
< Derakon[gonk]>
Not I, said the man who knows relatively little about VMs.
21:18
< AbuDhabi>
This bastard even gets an IP from my router.
21:18
< AbuDhabi>
Could it be that my newly configured firewall is the cause of this?
21:41
< AbuDhabi>
Yep. It's the firewall.
21:51
< Derakon[gonk]>
Bah. diff gets badly confused when the only points where the new code matches the old code is at blank lines.
21:51
< Finale>
ahahahaa
21:52
<@TheWatcher>
Ow
21:53
< AbuDhabi>
Oh, BTW. I heard the teacher asks people to restart the services they're doing for the Linux thing... without rebooting the entire box.
21:54
< Derakon[gonk]>
And?
21:54
<@TheWatcher>
Um, so?
21:54
< AbuDhabi>
I assume there's an easy way to do this for apache, mysql and ssh?
21:54
< Derakon[gonk]>
Yep.
21:54
<@TheWatcher>
`/etc/init.d/<servicename> restart` often
21:54
<@TheWatcher>
Or some variation thereon
21:54
< AbuDhabi>
Thanks.
21:57 * Finale headbangs
21:58
< Finale>
added Like Humans Do and Goodnight Moon to my playlist
22:01
< AbuDhabi>
Awright. I have connectified.
22:14 * Finale EYES this one.
22:17 You're now known as TheWatcher[afk]
22:17
< Finale>
http://mibbit.com/pb/MKJ2GT
22:18 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
22:20
< Finale>
http://mibbit.com/pb/YfeipQ
22:20
< Finale>
what are YOU doing here? >_>
22:20
< celticminstrel>
Me?
22:21
< Finale>
yes, you
22:21 VidTheKid [dexter@Nightstar-d983785a.clmboh.sbcglobal.net] has joined #code
22:21
< celticminstrel>
Is there some reason I shouldn't be here?
22:23
< VidTheKid>
if anyone wants to test my date/time parsing function, there's a test page here http://vidthekid.info/misc/datetest.php
22:23
< Finale>
not particularly, but it IS rather surprising. <_<
22:23
< Derakon[gonk]>
Finale, I could ask the same thing of you.
22:23
< celticminstrel>
Why?
22:23
< Derakon[gonk]>
Since all you seem to do here is post irrelevant jokes and laugh at people.
22:24
< Finale>
um. at?
22:24
< Derakon[gonk]>
At what they say.
22:24
< celticminstrel>
Why is it surprising?
22:24
< Finale>
hm.
22:24
< Finale>
sorry if I'm bothering you. would you prefer me to leave?
22:25
< Derakon[gonk]>
I'm mostly just pointing out that the channel is for discussing code; as a non-discussor of code, you don't really have much right to question other peoples' presences here.
22:25
< Derakon[gonk]>
(I wouldn't mind if you didn't post irrelevant jokes, though)
22:26
< celticminstrel>
I'm still wondering why you are surprised to see me here.
22:26
< Finale>
sorry. thought they were code-related. -_-
22:26
< Finale>
cm: forget it. -_-
22:26
< celticminstrel>
Grr.
22:27
< Derakon[gonk]>
VidTheKid: any particular reason you felt you needed to write a date/time parsing function?
22:27
< Derakon[gonk]>
Practice?
22:28
< VidTheKid>
1) when i started, i wasn't aware PHP had one built in, and 2) now that i've written it, it seems to work with more formats than PHP's built-in function does
22:28
< Derakon[gonk]>
Really? Try this: http://vidthekid.info/misc/datetest.php?t=June+first%2C+2003
22:28
< Derakon[gonk]>
Or http://vidthekid.info/misc/datetest.php?t=2+hours+ago
22:29
< Finale>
I'm sorry, but
22:29
< Finale>
BWAHAHAHAA
22:29
< VidTheKid>
alright, it works with *different* formats than strtotime
22:29
< celticminstrel>
XD
22:29
< Derakon[gonk]>
Date/time parsing is a mess of spiders, and while I wouldn't necessarily trust the PHP implementation to be complete, I'd bet they've spent more time on it.
22:29
< Derakon[gonk]>
Still, congrats on making something functional.
22:29
< VidTheKid>
strtotime fails miserably at http://vidthekid.info/misc/datetest.php?t=June+4%2C+%2784+09%3A30pm and http://vidthekid.info/misc/datetest.php?t=June+4%2C+84+0930pm
22:30
< Finale>
compare http://vidthekid.info/misc/datetest.php?t=13%2F12%2F09 http://vidthekid.info/misc/datetest.php?t=12%2F13%2F09
22:31
< Finale>
european format works in yours but breaks strtotime... >_>
22:32
< Finale>
but really, european format vs american format is ANNOYING
22:32
< Derakon[gonk]>
Which, if you'd read the documentation, would make perfect sense.
22:32
< Derakon[gonk]>
"The function expects to be given a string containing a US English date format and will try to parse that format into a Unix timestamp"
22:32
< VidTheKid>
actually with mine you'll get it a bit mixed results with slashes and all 2-digits; if it works as US, it'll treat it as us
22:32
< Finale>
June 7 vs July 6, stuff like that.... if you don't have context, how do you tell?
22:32
< VidTheKid>
mine takes cues from the separator
22:32
< Finale>
yeah
22:32
< Finale>
separator?
22:33
< VidTheKid>
- and / tend towards US, wheras . will make it assume YMD...
22:33
< celticminstrel>
Here's another one that breaks strtotime... http://vidthekid.info/misc/datetest.php?t=June+1%2F04
22:33
< Derakon[gonk]>
Ah. Heuristics.
22:33
< Derakon[gonk]>
I tend to be disturbed by software that's apparently clever. All too often its cleverness causes maddeningly hard-to-debug failures.
22:33
< VidTheKid>
wow i'm actually surprised June 1/04 works, i hadn't thought of it
22:34
< VidTheKid>
i'll have to re-enable the string transformation output to see why lol
22:36
< VidTheKid>
i may add support for writing the date as "4th" for example, and some relative-to-now functionality
22:37
< VidTheKid>
and i will definitely add some limited time zone / DST support
22:38
< Derakon[gonk]>
Oh, you're definitely going to regret that.
22:38
< VidTheKid>
limited.
22:38
< Derakon[gonk]>
Timezones are a nest of spiders that are made of other spiders.
22:38
< VidTheKid>
as in, EST, EDT, ET, GMT, UTC, and maybe CST, CDT, and CT
22:38
< VidTheKid>
this is for an Ohio-based thing
22:39
< celticminstrel>
Don't forget GMT?n
22:39
< VidTheKid>
so there's no need for worldwide timezone support
22:39
< Derakon[gonk]>
Are you using this for a serious project?
22:39
< celticminstrel>
Or I suppose it doesn't really matter.
22:39
< celticminstrel>
But wouldn't GMT?n be the easiest timezone thing to implement?
22:40
< VidTheKid>
but that's not what my users are going to enter
22:40
< VidTheKid>
this is for coordinating events for a group of mostly middle-aged folks around Ohio
22:41
< Derakon[gonk]>
Then I really recommend going with the standard library implementation rather than trying to roll your own.
22:41
< Derakon[gonk]>
Just tell your users to use a specific date format.
22:41
< Derakon[gonk]>
You'll have much fewer problems than trying to write your own parser that will accept anything that looks vaguely like a date and try to guess what the user means.
22:42
< VidTheKid>
that makes sense, to a point
22:43
< VidTheKid>
is there a way to override strototime's idea of what time zone i want? i don't have access to PHP settings or stuff like that
22:43
< Derakon[gonk]>
http://php.net/manual/en/function.date-default-timezone-set.php
22:44
< VidTheKid>
yeah, but i'm working with PHP4
22:44
< Derakon[gonk]>
The PHP documentation is generally quite good, and easily-searchable.
22:46
< Derakon[gonk]>
...don't work with PHP4?
22:46
< Derakon[gonk]>
I mean seriously, PHP5 has been out for years now.
22:47
< VidTheKid>
my host (actually my dad's host) offers PHP5 as an "upgrade" for free...
22:47
< VidTheKid>
but for some reason i'd rather accomplish things with PHP4 if possible
22:48
< Derakon[gonk]>
...what.
22:48
< Derakon[gonk]>
No.
22:48
< Derakon[gonk]>
Use the latest version.
22:48
< Derakon[gonk]>
The only reason to continue using out-of-date versions of PHP is because you have a large entrenched codebase that relies on obseleted or modified library calls.
22:49
< Derakon[gonk]>
This isn't a matter of "not using features you don't need". This is a matter of "not using a language that has hundreds of known attack vectors".
22:49
< Derakon[gonk]>
"and is buggy as hell"
22:50
< Derakon[gonk]>
Anyway, I gotta get some work done. Good luck with your project.
22:50
< VidTheKid>
thanks for the advice, though i haven't decided whether i'll take it
22:52
< AbuDhabi>
Damn it.
22:52
< AbuDhabi>
It's like the ssh_
22:52
< AbuDhabi>
It's like the ssh_config file isn't taken into consideration at all.
22:53
< AbuDhabi>
The debian tutorials for securing ssh also use some options not present, by default, in the file.
23:02 VidTheKid [dexter@Nightstar-d983785a.clmboh.sbcglobal.net] has quit [[NS] Quit: wanders off]
23:39
< AbuDhabi>
Argh. Stupid SSH is stupid. I'm going to sleep.
23:42
<@Vornicus>
PHP4 and PHP5 are quite different languages.
23:45 You're now known as TheWatcher
23:46 AbuDhabi [annodomini@Nightstar-48aea1d4.adsl.tpnet.pl] has quit [[NS] Quit: DEATH.]
--- Log closed Fri Dec 11 00:00:34 2009
code logs -> 2009 -> Thu, 10 Dec 2009< code.20091209.log - code.20091211.log >