code logs -> 2010 -> Thu, 01 Apr 2010< code.20100331.log - code.20100402.log >
--- Log opened Thu Apr 01 00:00:53 2010
00:09 Attilla [Attilla@FBC920.480E8C.5BCE21.9EB64C] has quit [[NS] Quit: ]
00:24 You're now known as TheWatcher[T-2]
00:25 Orth [orthianz@Nightstar-fc5ddd44.xnet.co.nz] has joined #code
00:25 Derakon[AFK] is now known as Derakon
00:27 Orthia [orthianz@Nightstar-cc502d8b.xnet.co.nz] has quit [Ping timeout: 121 seconds]
00:30 You're now known as TheWatcher[zZzZ]
00:55 celticminstrel [celticminstre@1AB00B.855209.A256BB.B16D09] has quit [Client exited]
01:32 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds]
02:20 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
03:35 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
03:44 * Vornicus wonders, randomly, what various programming languages consider to be false.
03:44
< Namegduf>
Hmm.
03:44
< Namegduf>
C: 0
03:44
< Namegduf>
With the bool extension, false as well.
03:44
< Namegduf>
C++, 0 and false.
03:44
<@Vornicus>
I mean, you often see: false (obviously), null, 0, empty strings, empty containers...
03:45
<@Vornicus>
C technically gets null, 0, false, and empty, and doesn't have any sense of empty containers.
03:46
<@Vornicus>
Python gets all five, Javascript gets all those except empty containers...
03:49
< celticminstrel>
...how does C get empty?
03:49
<@Vornicus>
empty strings? null termination, of course
03:49
< celticminstrel>
Hm. I guess.
03:53
<@Derakon>
Well, an empty string is identical to a 1-word int with the value 0, isn't it?
03:54
< Namegduf>
Vornicus: Not really true.
03:54
< Namegduf>
NULL is literally an alias for 0
03:54
< Namegduf>
So it isn't a separate thing it gets.
03:54
< celticminstrel>
Not true.
03:54
< Namegduf>
Yes, true.
03:54
< celticminstrel>
Or at least, it depends on the compiler.
03:54
<@Derakon>
!true is false~
03:54
< Namegduf>
Nope.
03:54
<@Vornicus>
Namegduf: well, yes, it's not a separate thing, but the thing is that it is one of the effects you get from the way C works.
03:54
< Namegduf>
Pointers are defined such that their zero value will never be valid.
03:54
< celticminstrel>
With GCC, null is of type void*
03:54
< Namegduf>
NULL is (void*)0
03:55
< Namegduf>
It is a 0 of type void*
03:55
<@Derakon>
I wouldn't be surprised if Python has a __bool__ function or something that allows you to evaluate any object as a boolean.
03:55
< celticminstrel>
Yes, but that's not quite the same as just 0.
03:55
< Namegduf>
Yes it is.
03:55
< celticminstrel>
Nope.
03:55
<@Vornicus>
Der: __nonzero__ and then __len__
03:55
< Namegduf>
Listing NULL separate is like listing (char)0 and (int)0 separate.
03:55
< Namegduf>
Pointers are defined such that their 0 value is never valid, even if that means the bit pattern for it isn't all zeroes.
03:55
< celticminstrel>
And yet, false is listed separate. So it's not much of a stretch.
03:55
< Namegduf>
And NULL is an alias for that.
03:55
<@Derakon>
Types stop mattering in C once you compile the code, right?
03:56
<@Derakon>
I mean, after that point you'll get segfaults and bus errors instead of type mismatches.
03:56
< Namegduf>
Yes.
03:56
< Namegduf>
C doesn't do RTTI
03:56
<@Derakon>
So I wouldn't worry about differentiating types in this context.
03:56
<@Vornicus>
Namegduf: in languages like Python, where strings can perfectly well contain nulls, a string starting with null doesn't render as false. And False isn't the same as 0 isn't the same as None.
03:56
< Namegduf>
Vornicus: Yes, but I was listing C's.
03:57
<@Vornicus>
I'm ignoring the fact that C really only has 0 but that that 0 shows up in pointers (which many languages don't have, in so many words) and as the end of a string.
03:57
< Namegduf>
Which are actually fairly contrasting to the others.
03:57
< Namegduf>
Yeah.
03:57
< Namegduf>
Actually, though, I wonder if the empty string would evaluate as false.
03:57
<@Vornicus>
and so I'm aiming at somewhat higher level constructs.
03:57
< Namegduf>
Because a pointer to a 0 value isn't essentially 0.
03:57
<@Vornicus>
Namegduf: if you dereference it, it will.
03:58
< Namegduf>
If you dereference it, yes.
03:58
< celticminstrel>
An empty string would evaluate as ... what he said.
03:58
< Namegduf>
Er, if you deference it, it's no longer a string.
03:58
< Namegduf>
It's a char.
03:58
< Namegduf>
And quite distinct from if("")
03:59
< Namegduf>
I'd consider 'if("")' as having to be always false to consider the empty string as false, and I'm not sure that's true.
04:02
< Namegduf>
What're the languages where only "false" is false?
04:02
< Namegduf>
And everything else has to be explicitly checked?
04:02
<@Vornicus>
Dunno if there are any.
04:02
< Namegduf>
I know there's one I've used.
04:02
<@Vornicus>
I know there's at least one where it's only false and null, but I don't remember which one -- it's, once again, one I've used.
04:03
< Namegduf>
Hmm, that could be it.
04:04
<@McMartin>
Java is one such.
04:04
<@McMartin>
Boolean is a type and if() only takes booleans.
04:04
< Namegduf>
Aha.
04:04
<@McMartin>
Unless this has changed, but I kinda doubt it.
04:05
< Namegduf>
I'm a bad programmer for forgetting that, given the amount of time I semi-unwillingly spend with Java.
04:05
< Namegduf>
(It's wonderfully statically typed and checked exceptions make writing safe code 'easy', but the cost and the way naming and class hierarchies tend to go make it painful to write)
04:06
< Namegduf>
Yeah, Java would have been the one I was thinking of.
04:06
<@Vornicus>
Ruby: nil and false.
04:06
< Namegduf>
Ruby doesn't allow empty strings to be false?
04:07
< Namegduf>
Huh.
04:07
<@Vornicus>
http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Control_Structures
04:07
< Namegduf>
I have to say, I prefer "null or false".
04:08
< Namegduf>
At least, if implicit string to number conversions are allowed.
04:08
<@Vornicus>
Yeah, I cannot stand, in any sense, implicit string->number
04:08
< Namegduf>
Yeah, I hate that.
04:08 * Derakon strands Vorn in Perl.
04:08
<@Vornicus>
number->string is sensible when trying to concat stuff, but even that can get hairy.
04:08
< Namegduf>
Yeah.
04:08
< Namegduf>
I don't mind number->string
04:09
< celticminstrel>
McMartin: I could be misremembering, but I thought Java automatically converted an if() condition to boolean.
04:09
<@Derakon>
I wouldn't be surprised if there were situations in which you could just say "if(){print}" in Python.
04:09
<@Derakon>
Er. Perl.
04:09
< Namegduf>
You can say whatever you want in Python so long as that code path doesn't get executed
04:09
<@Derakon>
Ahem.
04:09
< Namegduf>
Relatedly, Python without unit tests, at least, is a pain in the ass to work with other people's code in.
04:11
<@Vornicus>
Java: boolean and Boolean only; it deosn't look like even /null/ counts.
04:11
< Namegduf>
Because it's remarkably hard to get everything right the first time when you don't know the codebase and it lacks tests or formal documentation, and to test even the most basic stuff, each time you have to manually make that specific bit of code run.
04:11
< Namegduf>
Yeah, I remember having to write explicit checks for null.
04:11
<@Derakon>
Namegduf: uh, yeah, welcome to my world. ._.
04:11
< Namegduf>
I actually prefer that, if and only if you make booleans nullable.
04:11
< Namegduf>
If booleans are nullable, I prefer "just false".
04:12
<@Derakon>
Namegduf: go here, and search for "getframe": http://docs.python.org/library/sys.html
04:12
<@Derakon>
Then imagine what you could do with that function and exec.
04:12
<@Derakon>
I've seen things, man.
04:12
<@Vornicus>
so, so far I've seen: false only, false and null, false null 0 emptystring, and false null 0 emptystring emptycontainer
04:12
< Namegduf>
Oh god.
04:12
< Namegduf>
That's horrible.
04:13
< Namegduf>
That sounds accurate to my experiences, although I couldn't say for sure I've seen the third.
04:13
<@Vornicus>
The third is Javascript.
04:14
< Namegduf>
Ah.
04:14
< Namegduf>
I've written JavaScript, but I don't really know it.
04:14
< Namegduf>
I've come to the conclusion given the dreadful state of documentation for it online that the only way to learn it is by experiment.
04:14
<@Vornicus>
technically C could be false null 0 or false null 0 emptystring depending on how generous you're feeling.
04:14
< Namegduf>
I don't think it's emptystring.
04:15
< Namegduf>
Because "" would have to evalute to a valid char* pointing at a '\0' for it to be used.
04:15
< Namegduf>
And that char* could thus not equal NULL.
04:35
< celticminstrel>
I would likewise not give C empty string.
04:37 Kazriko [kaz@Nightstar-e09690fa.client.bresnan.net] has quit [[NS] Quit: Leaving]
04:37
< celticminstrel>
As for JavaScript, I usually rely on Mozilla's documentation, which seems to be fairly decent.
04:43 Searh [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
04:43
<@Vornicus>
I also use Mozilla's docs.
04:43
<@Vornicus>
I think they're also the maintainer of the language as a whole, so I think they're the Official Documentation
04:43 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Client closed the connection]
04:44
<@Derakon>
Wait what?
04:44
<@Derakon>
Really?
04:44
<@Derakon>
Oh hey, so they are.
04:44
<@Derakon>
At least, Wikipedia has the Mozilla Foundation listed as the developer.
04:46 Kazriko [kaz@Nightstar-e09690fa.client.bresnan.net] has joined #code
04:46 mode/#code [+o Kazriko] by Reiver
04:48
< Namegduf>
http://cappuccino.org/discuss/2010/04/01/solving-the-javascript-memory-managemen t-problem/
04:48
< Namegduf>
^ A good read.
04:50 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
04:52
< Tarinaky>
"Rather than focus on developing new features or fixing bugs in the issue tracker, we hope that all Cappuccino contributors will spend their time writing memory management" << Hahahahaha.
04:52
< Tarinaky>
Love it!
04:55
< Namegduf>
It's quite the proposal.
04:55
< Namegduf>
:P
05:00 Orthia [orthianz@Nightstar-5ad41e0b.xnet.co.nz] has joined #code
05:03 Orth [orthianz@Nightstar-fc5ddd44.xnet.co.nz] has quit [Ping timeout: 121 seconds]
05:12
< Namegduf>
Oh god, is that an actual implementation of that "manual memory management"?
05:12
<@Vornicus>
Just give us a modern gc and we'll be happy.
05:12
< Namegduf>
Vornicus: Take a look at that link
05:13
< Namegduf>
Then consider that this... appears to be an actual implementation of it
05:13
< Namegduf>
It's horrifying
05:13
<@Derakon>
Define "this"?
05:13
<@Vornicus>
nooooooo
05:13
< Namegduf>
Their link to Github.
05:13
< Namegduf>
http://github.com/280north/cappuccino/commit/6678bba94f7778b245d8219292b3a6ac85d 31678 <-- More precisely.
05:13
<@Derakon>
You looked at the code and they actually did it? ;_;
05:14
<@Derakon>
I figured since it was April Fools' they'd just made the blog post.
05:14
< Namegduf>
I'm pretty sure it is.
05:14
<@Vornicus>
chrrriist
05:14
< Namegduf>
"elegant simplicity of C" "spend time writing memory management instead of bug fixes or features"
05:14
<@Vornicus>
Some people have waaaay too much damn time on their hands.
05:14
< Namegduf>
Can we make this much spare time illegal?
05:14
< Namegduf>
I mean, this is terrifying
05:15
<@Vornicus>
No, because then somebody /else/ will ask me to write a textbook.
05:31 * Derakon ponders calling in sick tomorrow.
05:31
<@Derakon>
If I don't I'll just spend all day writing documentation...which doesn't really sound all that much fun. ¬.¬
06:00
<@McMartin>
That sounds like WFH fodder anyway
06:02
<@Derakon>
Boss doesn't believe in working from home. *shrug*
06:05
< Orthia>
Vorn!
06:06
< Orthia>
I have an Interesting Problem for you.
06:06
< Orthia>
Lecturer said that the hard part is comprehending the challenge, but 'It'll be easy if you're a math major or the like, apologies to the rest of ya'.
06:07
<@Vornicus>
Fire away!
06:07
< Orthia>
http://www.cs.waikato.ac.nz/~tcs/COMP317/Assignments/assign2-2010.html
06:07
< Orthia>
Dynamic Programming. No, you can't use integers. ^.^
06:08
<@Derakon>
If the inputs have fixed, limited precision, you could just use ints and print them as if they were floating point.
06:09
<@Vornicus>
Oh, look
06:09
<@Vornicus>
Dynamic programming.
06:09
<@Vornicus>
I've never done that before.
06:09
< Orthia>
... Is that sarcasm?
06:09
<@Derakon>
Dynamic programming is a bit like recursion where you cache the results of calls you've made before.
06:09
< Orthia>
Derakon: Floating points.
06:09
< Orthia>
As in, the Reliability Problem.
06:10
<@Derakon>
I don't recognize the reliability problem by name. *shrug*
06:10
<@ToxicFrog>
Vornicus: it's a fancy name for memoization, in languages that don't have language level support for it.
06:11
< Orthia>
Derakon: A subset of the Knapsack Problem. You have Budget X, and parts that have Price Y and reliability Z.
06:11
< Orthia>
Make up a system wherein it calculates the most reliable combination of redundant components to maximize the overall systems Z.
06:12
< Orthia>
http://www.macs.hw.ac.uk/~alison/ds98/node122.html - this is the integer knapsack problem
06:12
<@ToxicFrog>
Or, rather, it's specifically the application of memoization to problems with recursive overlapping subproblems.
06:12
<@ToxicFrog>
Orthia: er, the "reliability problem" is exactly the knapsack problem.
06:12
< Orthia>
TF: OK
06:13
<@ToxicFrog>
You have a set of objects each with weight (cost) Wn and value (reliability) Vn. Find the subset with maximal value that does not exceed a given weight.
06:13
< Orthia>
He described it as 'the same thing, but with floating points, and multiplication making life a pain'
06:13
< Orthia>
This may have been his overenthusiastic rephrasing however; he's getting a bit chronic at it.
06:13
<@ToxicFrog>
Doing a find/replace weight -> cost and value -> reliability does not actually alter the problem.
06:14
< Orthia>
OK, didn't know that, cheers.
06:15
< Orthia>
Or rather he implied that the Reliability Problem was a commonly accepted subset with subtle constraints (Non-integer, must have X of each, etc)
06:15
< Orthia>
And that this in turn means you can't just run a two dimensional array, you need to do list searches and subsuming.
06:16 * Orthia suspects he was getting a little overexcited though. He's a great lecturer but also not used to teaching undergrads, and tries to Be Helpful, often confusing matters in the process. >_<
06:23 AnnoDomini [annodomini@Nightstar-b4171f7f.adsl.tpnet.pl] has joined #code
06:24 mode/#code [+o AnnoDomini] by Reiver
06:40 Vornicus is now known as Vornicus-Latens
06:40 Derakon is now known as Derakon[AFK]
06:55 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
06:55 Attilla [Attilla@FBC920.173C5E.203556.7F1065] has joined #code
06:55 mode/#code [+o Attilla] by Reiver
07:50 Vornicus-Latens [vorn@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
07:51 Vornicus-Latens [vorn@ServerAdministrator.Nightstar.Net] has joined #code
07:52 mode/#code [+o Vornicus-Latens] by Reiver
08:15 Bobsentme [Bobsentme@Nightstar-bdfa14c4.try.wideopenwest.com] has quit [Connection reset by peer]
08:16 cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has quit [Connection reset by peer]
08:31 Orthia [orthianz@Nightstar-5ad41e0b.xnet.co.nz] has quit [Ping timeout: 121 seconds]
09:14 You're now known as TheWatcher
09:19 Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has quit [Client exited]
09:23 AnnoDomini [annodomini@Nightstar-b4171f7f.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
09:25 AnnoDomini [annodomini@Nightstar-40752a90.adsl.tpnet.pl] has joined #code
09:25 mode/#code [+o AnnoDomini] by Reiver
09:59 You're now known as TheWatcher[afk]
10:12 McMartin [mcmartin@Nightstar-3c130f1a.pltn13.sbcglobal.net] has quit [[NS] Quit: z]
10:33 Orthia [orthianz@Nightstar-ccd9e07e.xnet.co.nz] has joined #code
11:52 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
14:07 Zed [Zed@Nightstar-d7ade99d.or.comcast.net] has joined #code
15:53 Vornicus-Latens is now known as Vornicus
16:01 AnnoDomini [annodomini@Nightstar-40752a90.adsl.tpnet.pl] has quit [[NS] Quit: Switching OS. Time for DF 0.31.01.]
16:46 Derakon[AFK] is now known as Derakon
17:03 Zed [Zed@Nightstar-d7ade99d.or.comcast.net] has quit [Connection reset by peer]
17:07 Zed [Zed@Nightstar-d7ade99d.or.comcast.net] has joined #code
--- Log closed Thu Apr 01 17:33:52 2010
--- Log opened Thu Apr 01 17:36:54 2010
17:36 TheWatcher [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code
17:36 Irssi: #code: Total of 18 nicks [5 ops, 0 halfops, 0 voices, 13 normal]
17:36 mode/#code [+o TheWatcher] by Reiver
17:37 Irssi: Join to #code was synced in 53 secs
17:43 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
17:54 Searh [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
18:21
< jerith>
http://www.makinggoodsoftware.com/wp-content/uploads/2009/09/bug_vs_feature.gif
18:27 McMartin [mcmartin@Nightstar-3c130f1a.pltn13.sbcglobal.net] has joined #code
18:27 mode/#code [+o McMartin] by Reiver
18:32
<@Vornicus>
pff
18:38 Netsplit *.net <-> *.split quits: @Vornicus, @Attilla, @McMartin, PinkFreud
18:39 Netsplit over, joins: PinkFreud, @McMartin, @Vornicus, @Attilla
19:00 AnnoDomini [annodomini@Nightstar-40752a90.adsl.tpnet.pl] has joined #code
19:00 mode/#code [+o AnnoDomini] by Reiver
19:19 Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has joined #code
19:27 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
20:08 Orthia [orthianz@Nightstar-ccd9e07e.xnet.co.nz] has quit [Connection reset by peer]
20:15 Orthia [orthianz@Nightstar-ccd9e07e.xnet.co.nz] has joined #code
20:17 Orthia [orthianz@Nightstar-ccd9e07e.xnet.co.nz] has quit [Client closed the connection]
21:01 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Client closed the connection]
21:01 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
21:27 Orthia [orthianz@Nightstar-4a9e5651.xnet.co.nz] has joined #code
22:07 Orthia [orthianz@Nightstar-4a9e5651.xnet.co.nz] has quit [[NS] Quit: ]
22:55 * AnnoDomini wonders why Linux produces a beep every time he uses Backspace to go up a directory.
22:56
< Serah>
It thinks you're doing it wrong.
23:26 AnnoDomini [annodomini@Nightstar-40752a90.adsl.tpnet.pl] has quit [[NS] Quit: DOOM.]
23:47
< PinkFreud>
actually, linux does no such thing.
23:47
< PinkFreud>
the kernel couldn't care less :
23:47
< PinkFreud>
:)
23:48
< PinkFreud>
he might want to check his shell, or whatever filemanager he's using.
23:48
< celticminstrel>
Obviously not a shell.
23:49
<@Derakon>
It's always bugged me when backspace is used for navigation.
23:49
<@Derakon>
Backspace is for deleting!
23:50
<@Derakon>
Arrow keys are for navigation!
23:52
< PinkFreud>
indeed
--- Log closed Fri Apr 02 00:00:43 2010
code logs -> 2010 -> Thu, 01 Apr 2010< code.20100331.log - code.20100402.log >