code logs -> 2014 -> Thu, 12 Jun 2014< code.20140611.log - code.20140613.log >
--- Log opened Thu Jun 12 00:00:13 2014
00:02 Xires is now known as ^Xires
00:02 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
00:15 KiMo|autorejoin [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code
00:15 ^Xires is now known as Xires
00:16 Kindamoody[zZz] [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
00:20 KM|autorejoin [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code
00:20 KiMo|autorejoin [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
00:21 KM|autorejoin is now known as Kindamoody
00:29 KiMo|autorejoin [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code
00:31 Serah [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
00:31 Kindamoody [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
00:31 KiMo|autorejoin is now known as Kindamoody
00:33 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
00:44 Kindamoody is now known as Kindamoody[zZz]
00:52 macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [[NS] Quit: âªRainbow Dash always dresses in style~âª]
01:25 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
01:27 Nemu [NeophoxProd@Nightstar-kpuumf.gv.shawcable.net] has joined #code
01:32 Xires is now known as ^Xires
01:46 ^Xires is now known as Xires
01:58 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
02:01 macdjord [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
02:01 mode/#code [+o macdjord] by ChanServ
02:03 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
02:13 celticminstrel [celticminst@Nightstar-42flbc.dsl.bell.ca] has quit [Ping timeout: 121 seconds]
02:21 celticminstrel [celticminst@Nightstar-tnvh3n.dsl.bell.ca] has joined #code
02:21 mode/#code [+o celticminstrel] by ChanServ
02:31 celticminstrel [celticminst@Nightstar-tnvh3n.dsl.bell.ca] has quit [Ping timeout: 121 seconds]
02:34 Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
02:36 celticminstrel [celticminst@Nightstar-m2a422.dsl.bell.ca] has joined #code
02:36 mode/#code [+o celticminstrel] by ChanServ
02:59 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
03:04 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
04:00 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
04:05 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
04:09 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:31 HotShot [fake@Nightstar-2cq4jk.sfldmi.sbcglobal.net] has joined #code
05:01 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
05:05 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
05:06 Derakon is now known as Derakon[AFK]
05:13 Turaiel[Offline] is now known as Turaiel
05:21 RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.]
05:23 * McMartin prints out two pages of 25-year-old assembly code. SURRENDER UNTO ME YOUR SECRETS
05:24 * Alek monocles McMartin.
05:24 * Alek passes him the red pen.
05:24 RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has joined #code
05:29
<&McMartin>
Oh man, I may use it
05:29 * McMartin writes VERY POOR, SEE ME AFTER CLASS with it.
05:29
<&McMartin>
The whole reason for looking at this was to see how they handled the NMI problem, and as best I can tell, it was "by bricking the machine if the user hits RESTORE at the wrong time"
05:31
<~Vornicus>
;_;
05:31
<~Vornicus>
"The NMI problem"?
05:32
<&McMartin>
The C64's equivalent of a BIOS can be swapped out for RAM.
05:32
<&McMartin>
So (a) w00t, that's a free 8K of storage space, but (b) wait a sec, that's where the interrupt vectors are, and (c) the RESTORE key is physically wired to the NMI signal
05:32
<&McMartin>
(b.2) that's also where the interrupt *handlers* are
05:34
<&McMartin>
So here we have a little BASIC-enhancement routine that's intended to swap out all the ROM chips to give you an extra 16KB of RAM... but that code has no defence against an NMI hitting while the BIOS-equivalent is swapped out.
05:35
<&McMartin>
Which will hard-loop the CPU on a BRK statement
05:35
<&McMartin>
It also appears to not be using the BASIC ROM's floating point interop routines.
05:35
<&McMartin>
I bet I can drop the size of this routine by a factor of 16 and have it still be safer than the original.
05:49
<@Reiv>
Is this a physical chip swap?
05:53
<&McMartin>
No, it's bankswitching
05:54
<&McMartin>
My rewrite is 22 instructions long compared to the original 99. So not 16 instructions shorter, I guess~
05:54
<@macdjord>
So swap out, then restore the critical bits?
05:54
<&McMartin>
Er, 16x
05:54
<&McMartin>
You can "write to" the ROMs and it writes to the underlying RAM
05:55
<&McMartin>
So before I swap out the BIOS I write a new NMI vector and point it to a one-instruction handler that is just "return from interrupt"
05:55 Turaiel is now known as Turaiel[Offline]
05:56
<&McMartin>
Another plus: I have no branches or jump instructions to stuff that is not somewhere in the ROM, so my version is completely relocatable.
05:56
<@macdjord>
Which, of course, has the side-effect of disabling the reset button.
05:59
<&McMartin>
Sure.
06:00
<&McMartin>
But you're only doing this for about a fiftieth of a millisecond at a time.
06:00 * McMartin runs his version through an assembler.
06:00
<@Reiv>
McMartin: ... how'd they write so 'badly' then?
06:00
<@Reiv>
I mean it sounds like you just refactored the code to a fraction of the size in a couple hours.
06:00
<&McMartin>
My version is 44 bytes long, compared to the original's 228.
06:01
<~Vornicus>
woo, 5x reduction
06:01
<~Vornicus>
Reiv: having seen the sheer number of ways people can screw up fullscreen in Windows...
06:01
<&McMartin>
Reiv: I'm exploiting two things.
06:01
<&McMartin>
Possibly 3
06:02
<&McMartin>
There are three problems with their code, and two of them are inexcusable
06:02 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
06:02
<&McMartin>
But the big one is excusable, because I'm exploiting a Dangeroud Forbidden Technique~
06:02
<&McMartin>
*Dangerous
06:02
<@Reiv>
... oh go on then, courter of the apocalypse
06:02
<&McMartin>
To wit, I am exploiting the fact that there is a specific routine in a specific place in the BASIC ROM that does about 80% of what I want here
06:02
<@Reiv>
... that's a forbidden technique?
06:03
<&McMartin>
If the guy who wrote this 25 years ago didn't have that disassembly available, he would not have been able to do that.
06:03
<&McMartin>
Hrm
06:03
<&McMartin>
Actually, the book I got that from is dated 1984.
06:03 * McMartin checks some publication dates~
06:03
<&McMartin>
Anyway, if he didn't have This One Book, he didn't have that
06:03
<@Reiv>
Well, fair enough then I guess
06:04
<&McMartin>
However, then doing that in reverse at the end is somethign that *is most certainly* documented and was in the standard reference
06:04
<&McMartin>
So he totally should have used that
06:05
<&McMartin>
So that is inexcusable
06:05
<&McMartin>
And as for the NMI problem, well, presumably he figured "what are the odds that the user hits that key exactly when he's in the middle of this routine?"
06:05
<&McMartin>
viz. every software rant ever~
06:06 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
06:07
<@macdjord>
Huh. Yeah, I would not consider a 0.0002s window of opportunity for failure to be a major issue.
06:12
<&McMartin>
It concerns me mainly because the consequences of failure are so drastic.
06:12
<&McMartin>
(I use a similar technique in my C64 equivalent of crt0.s)
06:12
<&McMartin>
(That is, the stuff that runs before and after main())
06:13 * macdjord shrugs
06:13
<@macdjord>
Still sounds like a Don't Do That Then to e.
06:13
<&McMartin>
Also because What The Hell Dude It Is Like Seven Instructions~
06:28
<&McMartin>
There is a minor issue in that my code seems to not be working~
06:29
<@celticminstrel>
Such a minor issue.
06:29
<@celticminstrel>
The most minor of all.
06:33
<&McMartin>
OK, some of this is me being a dummy
06:36
<&McMartin>
Now I've got 2/3s of it working by incrementing one constant by 1
06:40
<~Vornicus>
hooray, off by 1 errors
06:47 Kindamoody[zZz] is now known as Kindamoody
06:59 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code
07:02 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
07:08 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
07:09
<&McMartin>
This is still super-bizarre
07:10
<&McMartin>
It's successfully swapping out the BASIC and BIOS ROMs, but it's not successfully swapping *in* the character ROM.
07:10
<&McMartin>
There seems to be no good reason for that.
07:11
<&McMartin>
... and setting a debug breakpoint makes the entire system hang. Good job, Linux porters of VICE.
07:15
<&McMartin>
Oh, I see.
07:15
<&McMartin>
I misunderstood what that register did
07:16
< simon_>
has anyone here implemented differential equations in haskell? I end up with a *lot* of zip4s and folds and the like.
07:16
<&McMartin>
And as a result instead of adding 16K of RAM and also exposing the character ROM, I instead exposed 24KB of RAM.
07:16
<&McMartin>
So that *will* complicate the logic some if I want it to do that.
07:17
< simon_>
(I'm basically pretending to do for-loops that index arr[i], arr[i-1], arr[i+1] or something similar.)
07:18
< simon_>
so I quickly end up with something like: zipWith3 f xs (x:xs) (tail xs)
07:18
<~Vornicus>
wait are you doing runge-kutta?
07:18
<~Vornicus>
If so, can you show me how?
07:18
< simon_>
I'm thinking maybe there are some nicer patterns.
07:19
< simon_>
Vornicus, I recently did Runge-Kutta in Python..
07:19
<~Vornicus>
GIVE TO ZIIIIIIM
07:20
< simon_>
https://gist.github.com/sshine/7271208e54177daa3e0e
07:23
< simon_>
I'm not sure if using arrays in Haskell is preferrable because at least I can index wildly without folding like crazy.
07:23
< simon_>
using arrays in haskell is so close to coding imperatively I begin to wonder if there's any benefit ;)
07:25
<~Vornicus>
that code is a lot simpler than I've been led to believe.
07:28
< simon_>
yes, I even understand it!
07:29
< simon_>
it is very convenient to define the formula in terms of those F1, F2
07:46 celticminstrel [celticminst@Nightstar-m2a422.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:51
<&McMartin>
Aha, got it working
07:51
<&McMartin>
If I don't put in the NMI defenses, it's now 32 bytes exactly
07:52
<&McMartin>
I do have one branch, but it's relative
07:52
<&McMartin>
... and into the middle of an instruction. :D
08:00
<@macdjord>
Er, why?
08:00
<~Vornicus>
YOu are a terrible person
08:01
<@macdjord>
I don't find him particularly scary.
08:04
<&McMartin>
LDA #$32; BIT $30A9
08:04
<&McMartin>
That $30A9 is secretly LDA #$30
08:04
<&McMartin>
And BIT is normally a comparison instruction that's kinda a no-op
08:05
<&McMartin>
so I can branch past the first LDA and into the second to do a "set accumulator to one of these two values" things
08:05 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
08:05 macdjord is now known as macdjord|slep
08:07
<~Vornicus>
so what's BIT actually do
08:08
<&McMartin>
It performs a logical AND of the accumulator and the specified value/memory location
08:08
<&McMartin>
If the result is 0, it sets the zero bit
08:08
<&McMartin>
it copies the sign bit of the value/memory location to the negative bit
08:09
<&McMartin>
And it copies the next-most-significant bit into the overflow bit.
08:09 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
08:11
<&McMartin>
CMP, meanwhile, does a subtract of the value/memory from the accumulator without modifying anything but the sign and carry bits.
08:27
<~Vornicus>
so it may mangle the math bits but if you're not using it
08:34 Serah [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
08:34 mode/#code [+o Serah] by ChanServ
08:35 Nemu [NeophoxProd@Nightstar-kpuumf.gv.shawcable.net] has quit [Ping timeout: 121 seconds]
08:49
<&McMartin>
Right. It's basically poor man's conditional execution
08:59 HotShot [fake@Nightstar-2cq4jk.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 4hrs 27mins 37secs]]
09:06 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
09:10 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
09:18 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving]
09:18 Kindamoody is now known as Kindamoody|afk
10:06 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
10:11 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
10:21 gnolam_ [lenin@Nightstar-lca497.cust.bredbandsbolaget.se] has joined #code
10:21 gnolam [lenin@Nightstar-lca497.cust.bredbandsbolaget.se] has quit [Ping timeout: 121 seconds]
10:49 mode/#code [+o RchrdB] by ChanServ
10:58 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
11:02 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
11:08 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
11:30 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
11:45 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
12:26
<@Azash>
http://i.imgur.com/K8BQxfH.png
12:27
< simon_>
haha
12:27 * TheWatcher facepalm
12:48 gnolam_ [lenin@Nightstar-lca497.cust.bredbandsbolaget.se] has quit [Connection closed]
12:49 gnolam [lenin@Nightstar-lca497.cust.bredbandsbolaget.se] has joined #code
12:49 mode/#code [+o gnolam] by ChanServ
13:29 Kindamoody|afk is now known as Kindamoody
13:53 macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [[NS] Quit: Off]
14:05 Serah [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
15:14 Serah [Z@Nightstar-ro94ms.balk.dk] has joined #code
15:14 mode/#code [+o Serah] by ChanServ
16:07 Kindamoody is now known as Kindamoody|afk
16:08
<@Azash>
http://lifeofasoftwareengineer.tumblr.com/post/55789573990/git-reset-hard
16:12 celticminstrel [celticminst@Nightstar-m2a422.dsl.bell.ca] has joined #code
16:12 mode/#code [+o celticminstrel] by ChanServ
16:14 You're now known as TheWatcher[afk]
16:23 Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Connection closed]
17:11 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
17:11 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
17:11 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
17:11 mode/#code [+ao McMartin McMartin] by ChanServ
17:38 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
17:38 mode/#code [+qo Vornicus Vornicus] by ChanServ
18:07 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
18:11 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
18:12 Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has joined #code
19:07 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
19:12 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
19:21 HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code
20:08 You're now known as TheWatcher
20:08 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
20:10
<&McMartin>
OK, after doing a little bit more research from last night:
20:10
<&McMartin>
(a) the really long program I drastically improved was published six months before the reference book I used to drastically improve it
20:11
<&McMartin>
(b) that program is credited to someone with the same first and last name as the crazy-awesome A/V tech at my high school back in the early 90s o_O
20:11 Kindamoody|afk is now known as Kindamoody
20:12 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
20:27 HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed]
20:43
<~Vornicus>
Coincidence? I THINK NOT.
20:57 Kindamoody is now known as Kindamoody[zZz]
21:04
<&McMartin>
That would also indicate that (c) dude was probably like 15 when he wrote it
21:04
<&McMartin>
So these are all good excuses for my AUGH WHY questions.
21:09 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
21:13 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
21:23
<~Vornicus>
Indeed.
21:39 HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code
22:10 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
22:12 Serah [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds]
22:14 Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code
22:14 mode/#code [+o Reiv] by ChanServ
22:14 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
22:30 Derakon[AFK] [Derakon@Nightstar-5fqf0m.ca.comcast.net] has quit [Connection reset by peer]
22:31 Derakon [Derakon@Nightstar-5fqf0m.ca.comcast.net] has joined #code
22:31 mode/#code [+ao Derakon Derakon] by ChanServ
22:38 Serah [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
22:38 mode/#code [+o Serah] by ChanServ
22:55 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds]
22:59 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
22:59 mode/#code [+o Orthia] by ChanServ
23:09
< simon_>
heh
23:09
< simon_>
I'm in this small, newly started import cooperative
23:09
< simon_>
we import vegan products from germany and sweden because none are produced in denmark
23:10
< simon_>
almost all of the people involved do it for the cause and have no business experience
23:10
< simon_>
one guy stands out, though. he's this ex-professor who now works as the leader of a huge investment bank
23:10 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has joined #code
23:11
< simon_>
also, his social skills are a little limited, so as far as I understand, what he has contributed is writing the bylaws, making a webshop and shouting at people on facebook for not living up to his expectations
23:11
< simon_>
so I made this mistake when I was in the shop and accidentally sold something that had been reserved through the webshop
23:11
< simon_>
the guy who'd reserved it didn't mind, but this one guy was upset about it because it undermines his effort.
23:13
< simon_>
but his way of saying that was "there's no possible way that you can derive your sales results without having served the guy who reserved his order, according to set theory [and then he gives a pretty decent proof of that]. also, if you look at the cosine similarity of your sales vector and his order vector, it seems like you did serve him. I'm not going to bother making the actual calculations."
23:14
< simon_>
so I thought, why not make them. :) (it *does* suggest that I did sell to him even though I didn't.)
23:16 Syka [the@Nightstar-b1fuls.vividwireless.net.au] has quit [Ping timeout: 121 seconds]
23:16
< simon_>
> (order %*% sales) / (length(order) * length(sales))
23:16
< simon_>
0.3884298
23:16
< simon_>
but shouldn't those vectors be normalized before this makes any sense?
23:17
< simon_>
(that's my question. the rest was ranting.)
23:17
< simon_>
he might've ordered 2 burgers and 2 hot dogs, and I might've sold 5 burgers and 7 hot dogs, and that's pretty similar.
23:17 Serah is now known as JetpackWearingFireBreathingTRex
23:20
< simon_>
but shouldn't I normalize each vector according to something? like... if I served 5 people (who buy in the same way), maybe I should divide the sales vector by 5. or maybe I should consider some underlying distribution for each element in the vectors. I'm not even sure exactly... the only things I ever normalized, I knew were normally distributed. but we don't have the same amount of each item, and they're not equally popular.
23:26
<~Vornicus>
I'm so confused
23:28
< simon_>
hehe
23:29
< simon_>
ok. summary: I've got two vectors and I want to find the cosine similarity for them, but I suspect I need to normalize the vectors.
23:29
< simon_>
unfortunately, I have no idea how the vectors' underlying distribution is, but I think it's a mixture model of ten gaussian distributions.
23:31
< simon_>
this is our very first order on our very first day, though, so estimating the means (for normalizing them) is a trivial operation.
23:56 JetpackWearingFireBreathingTRex [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
--- Log closed Fri Jun 13 00:00:29 2014
code logs -> 2014 -> Thu, 12 Jun 2014< code.20140611.log - code.20140613.log >

[ Latest log file ]