--- Log opened Thu Jul 25 00:00:09 2013 |
00:09 | | You're now known as TheWatcher[T-2] |
00:18 | | You're now known as TheWatcher[zZzZ] |
00:34 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
00:40 | | Typh|offline is now known as Typherix |
00:42 | | Derakon[AFK] is now known as Derakon |
00:52 | < [R]> | ... |
00:53 | < [R]> | Why do sites have "Javascript:void(0)" as the href when using onclick? |
00:53 | < [R]> | It's like... "I'm going to call some JS to this event doesn't screw up my JS" |
00:54 | <&McMartin> | IIRC it's because having event processing code return a value fucked with some browsers |
00:54 | <&McMartin> | So by ending your processing code with void(0) your code returned no value, and thus was fine |
00:55 | < [R]> | You realize that "Javascript:eventHandler()" works too right? |
00:55 | <&McMartin> | You're expecting code idioms that lasted for decades to change everywhere? |
00:56 | <&McMartin> | Well, a decade, anyway |
00:57 | <&McMartin> | I have no real JS experience, but I would guess on no other information that "Javascript:eventHandler()" doesn't work on IE6 and be about 85% confident in the answer~ |
01:00 | <&McMartin> | I suppose I should also point out that firefox *prints out* "javascript:void(0);" even when that is not the entire text of the script. |
01:00 | < [R]> | IE has supported it for a long while. |
01:01 | <&McMartin> | I do not pretend to understand FF's UI decisions. |
01:01 | <&McMartin> | That said |
01:01 | <&McMartin> | I'm surprised that you are boggled by having functions end with void(0) |
01:01 | <&McMartin> | Everything I *have* read about JS says that this is an idiomatic way of saying "this function returns no value" |
01:02 | <&McMartin> | And it doesn't seem unreasonable given everything else about JS and the languages it inherits syntax from. |
01:02 | < [R]> | It's not that |
01:02 | <&McMartin> | (A similar technique is used in C to say "No, really, I don't make use of this parameter", for instance) |
01:02 | < [R]> | It's that they're using onclick with javascript:void(0) as the href. |
01:02 | <&McMartin> | Are you looking at the source code, or at the status bar in Firefox? |
01:02 | < [R]> | Statusbar in Chrome |
01:02 | <&McMartin> | Because the later says that even when there are statements that do things in front of it. |
01:02 | <&McMartin> | *latter |
01:02 | <&McMartin> | Chrome may be mimicking that. |
01:03 | < [R]> | <a style="font-size: smaller; font-weight: bold" class="button" id="more_t1_cb99xnx" href="javascript:void(0)" onclick="return morechildren(this, 't3_1iy79d', 'cb99xnx,cb99s7l,cb9bdnr,cb9bxmn', 6, '')">load more comments<span class="gray"> (8 replies)</span></a> |
01:04 | < [R]> | Nope. Unless it's mutating the source on the fly. |
01:04 | <&McMartin> | Having no-op JS in the href and real JS in the onclick looks like "idiom to look right in more browsers" to me. |
01:05 | <&McMartin> | And that stuff has longevity long past its practical use, because everyone knows that somebody out there never upgrades ever and there's "no reason" to lock them out |
01:08 | < [R]> | *Shrugs* |
01:08 | < [R]> | As far as I can tell, it's as old as JS itself |
01:08 | <&McMartin> | Again, this is pure speculation on my part, but it's really ubiquitous so I assume there's at least a historical reason for it. |
01:08 | < [R]> | NS2 supported them. |
01:16 | | Derakon is now known as Derakon[AFK] |
01:56 | | Derakon[AFK] is now known as Derakon |
02:19 | | VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
02:25 | | Karono [Karono@9C034E.4BE65E.E00AF8.FDA077] has joined #code |
02:28 | | himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code |
02:28 | | mode/#code [+o himi] by ChanServ |
02:29 | | Serah [Z@Nightstar-b920a19c.cust.comxnet.dk] has joined #code |
02:54 | | RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has quit [[NS] Quit: Gone.] |
02:57 | | RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has joined #code |
03:35 | | Karono [Karono@9C034E.4BE65E.E00AF8.FDA077] has quit [Ping timeout: 121 seconds] |
04:06 | | Zandramus [Zandramus@9C034E.4BE65E.E00AF8.FDA077] has joined #code |
04:10 | | Zandramus [Zandramus@9C034E.4BE65E.E00AF8.FDA077] has quit [[NS] Quit: ] |
04:36 | | Kindamoody[zZz] is now known as Kindamoody |
05:04 | | Serah [Z@Nightstar-b920a19c.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
05:19 | <&McMartin> | ... oh good, I can use arrays as hashtable keys. That will make things much easier. |
05:20 | | Derakon is now known as Derakon[AFK] |
05:23 | < [R]> | ... |
05:24 | < [R]> | That sounds like part of the ritual for summoning Codethulu |
06:06 | | Typherix is now known as Typh|offline |
06:06 | | Typh|offline is now known as Typherix |
06:09 | | ErikMesoy|sleep is now known as ErikMesoy |
06:24 | | celticminstrel [celticminst@Nightstar-3d915c28.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
07:10 | | Vornicus [Vorn@Nightstar-221158c7.sd.cox.net] has joined #code |
07:10 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
07:11 | | You're now known as TheWatcher |
07:23 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has joined #code |
07:35 | | himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds] |
08:08 | | Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
08:09 | | You're now known as TheWatcher[afk] |
08:09 | | Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code |
08:09 | | mode/#code [+o Syloq] by ChanServ |
08:28 | | Kindamoody is now known as Kindamoody|out |
08:47 | | ktemkin is now known as ktemkin[awol] |
09:00 | | Turaiel is now known as Turaiel[Offline] |
09:23 | | AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has joined #code |
09:57 | | You're now known as TheWatcher |
10:14 | | AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has quit [[NS] Quit: Leaving] |
10:30 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has quit [Ping timeout: 121 seconds] |
10:36 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has joined #code |
11:21 | | abudhabi is now known as AnnoDomini |
11:38 | | Serah [Z@Nightstar-b920a19c.cust.comxnet.dk] has joined #code |
11:53 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
11:53 | | mode/#code [+o himi] by ChanServ |
12:31 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has quit [Ping timeout: 121 seconds] |
12:57 | | Kindamoody|out is now known as Kindamoody |
13:29 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has joined #code |
13:43 | | Serah [Z@Nightstar-b920a19c.cust.comxnet.dk] has quit [Client closed the connection] |
13:51 | | Vornicus [Vorn@Nightstar-221158c7.sd.cox.net] has quit [Client closed the connection] |
13:57 | | You're now known as TheWatcher[d00m] |
14:05 | | Kindamoody is now known as Kindamoody|out |
14:06 | <@iospace> | quote of the day: "DOUBLE BIOS CROSS THE FLASHES!" |
14:44 | | You're now known as TheWatcher |
14:54 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
14:57 | | You're now known as TheWatcher[afk] |
15:03 | | celticminstrel [celticminst@Nightstar-3d915c28.dsl.bell.ca] has joined #code |
15:03 | | mode/#code [+o celticminstrel] by ChanServ |
15:07 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
15:07 | | mode/#code [+o himi] by ChanServ |
15:10 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has quit [[NS] Quit: ] |
15:10 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has joined #code |
15:10 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has quit [Client closed the connection] |
18:03 | | Turaiel[Offline] is now known as Turaiel |
18:23 | | celticminstrel [celticminst@Nightstar-3d915c28.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
19:01 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
19:14 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
19:14 | | mode/#code [+o himi] by ChanServ |
20:07 | | celticminstrel [celticminst@Nightstar-3d915c28.dsl.bell.ca] has joined #code |
20:07 | | mode/#code [+o celticminstrel] by ChanServ |
20:19 | | Kindamoody|out is now known as Kindamoody |
20:53 | | Kindamoody is now known as Kindamoody[zZz] |
21:47 | | ktemkin[awol] is now known as ktemkin[work] |
22:17 | <&McMartin> | Much belated |
22:17 | <&McMartin> | "Wait a minute, iospace. I thought crossing the flashes was bad." |
22:37 | <&ToxicFrog> | Welp |
22:37 | <&ToxicFrog> | I just learned about chunked sequences in clojure |
22:37 | <&ToxicFrog> | Short version: fuck chunked sequences |
22:37 | <&ToxicFrog> | Long version: don't try to implement recursive data structures |
22:38 | | * McMartin sends in the daleks. |
22:38 | <&McMartin> | CONCATENATE. |
22:38 | <&McMartin> | I don't remember chunked sequences. |
22:38 | <&McMartin> | xml-seq is adorably brain-damaged, but xml-zip was, IIRC, relatively sane, and zippers are used for all kinds of tree navigation |
22:39 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has joined #code |
22:39 | <&ToxicFrog> | They are not documented anywhere except in a few paragraphs in The Joy of Clojure and the comments in the clojure implementation. |
22:39 | <&ToxicFrog> | Basically, some types of lazy seq will pre-compute some number k of elements when you realize part of them |
22:40 | <&ToxicFrog> | But those elements are not realized until all k of them have been computed |
22:40 | <&ToxicFrog> | Which means that if the computation of s[n] is defined in terms of s[n-1], and chunking occurs, you will get garbage results because s[n-1] has not yet been realized when s[n] is being computed. |
22:41 | | Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds] |
22:41 | <&ToxicFrog> | This results in situations where, e.g., (f (range)) and (f (iterate inc 0)) give different results. |
22:41 | <&McMartin> | Oof |
22:42 | <&McMartin> | Hmmm |
22:42 | <&ToxicFrog> | There are ways around this involving letfn and single recursive definitions and whatnot |
22:42 | <&ToxicFrog> | But if you are doing mutual recursion of the form, e.g., (declare the-list) (defn in-list? [n] (something using list)) (def list (filter in-list? (range)) |
22:43 | <&McMartin> | Hrm |
22:43 | <&McMartin> | That looks weird to me but I learned this trick in Haskell first |
22:43 | <&McMartin> | And I can't find my horrorshow version of Fibonacci that used it in Clojure. |
22:44 | <&ToxicFrog> | You're boned unless in-list? never refers to elements in list closer than 32 entries behind. |
22:44 | <&ToxicFrog> | Yeah, apparently the correct way to do this is something like |
22:44 | <&ToxicFrog> | (def fib (lazy-cat [0 1] (map + fib (rest fib)))) |
22:44 | <&ToxicFrog> | And when I get home I'm going to try to rewrite my test case in that form |
22:45 | <&McMartin> | Oooh, that's better than what I did |
22:45 | <&McMartin> | Which I still can't find |
22:45 | <&McMartin> | But I was using cons and lazy-seq directly |
22:50 | | Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code |
22:50 | | mode/#code [+o Pandemic] by ChanServ |
22:55 | | ErikMesoy is now known as ErikMesoy|sleep |
23:03 | <@iospace> | McMartin: no, as in "double rainbo cross the sky" |
23:13 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has quit [Client closed the connection] |
23:15 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has joined #code |
23:18 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has quit [[NS] Quit: ] |
23:24 | | ktemkin[work] is now known as ktemkin[awol] |
23:46 | | VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code |
23:59 | | Karono [Karono@9C034E.4BE65E.E00AF8.FDA077] has joined #code |
--- Log closed Fri Jul 26 00:00:25 2013 |