code logs -> 2006 -> Sat, 12 Aug 2006< code.20060811.log - code.20060813.log >
--- Log opened Sat Aug 12 00:00:02 2006
00:01 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
00:01 mode/#code [+o Chalcy] by ChanServ
00:45 Joseph is now known as EvilDarklOrd
00:45 EvilDarklOrd is now known as EvilDarkLord
00:48 Chalcy is now known as Chalcedon
00:52 Syloq [Syloq@NetAdmin.Nightstar.Net] has quit [Connection reset by peer]
00:56 AdmiralDrake is now known as Reiver
01:54 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has quit [Quit: ]
02:31 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
02:31 mode/#code [+o Chalcy] by ChanServ
02:31 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
03:02 Vornicus [~vorn@Nightstar-25742.veracitycom.net] has joined #code
03:02 mode/#code [+o Vornicus] by ChanServ
03:07
<@Vornicus>
Hokay. Dave wants me to write him a lua function that, given a point, and a point/radius circle, the intersection points of the tangent lines of the circle through the point.
03:07
<@Vornicus>
I still haven't seen the sample that gives me an idea of what I'm aiming at, but.
03:08
<@Vornicus>
Coincidentally, my Lua books arrived today.
03:08
<@Vornicus>
er.
03:09
<@Vornicus>
Euclid books.
03:12
<@Mahal>
http://www.rabid-monkeys.com/index.php?file=0042
03:13
<@Vornicus>
ISTR that the prototype was something like tangent_points(cx, cy, r, px, py) ->{{x, y} {x, y}}
03:15
<@Vornicus>
...now if I knew Lua I could do this.
03:32
<@Vornicus>
...arg. that makes the inputs and outputs in different formats.
04:35 Reiver is now known as ReivOut
05:14 ReivOut is now known as Reiver
05:14 * Vornicus attempts to get TF's attention.
05:17
<@Reiver>
TF! We need your Mad Skillz0r
05:17
<@Reiver>
ToxicFrog ToxicFrog|AFK TF ? >.>
05:18
<@ToxicFrog>
?
05:18
<@ToxicFrog>
What's the problem?
05:18
<@Vornicus>
Not that hard. It's midnight there.
05:18
<@Vornicus>
heh
05:20
<@ToxicFrog>
If you're asking for the algorithm, I don't remember it~
05:20
<@Vornicus>
I am writing a function... or, uh. ten. In Lua. And if I follow Dave's prototype I've got inputs of one paradigm (passing in x and y as individual parameters) and outputs of another (structures)
05:21
<@ToxicFrog>
Right. And you want to return multiple values instead?
05:21
<@Vornicus>
(I have the algorithms and all that shit figured out, actually)
05:21
<@Vornicus>
I want to, uh
05:22
<@Vornicus>
I want to partly beat Dave with a stick for doing this to me.
05:22
<@ToxicFrog>
...apart from that.
05:22
<@Vornicus>
And then I want to figure out how I can make that awful conversion nice.
05:22
<@ToxicFrog>
Do you want to be able to do x1,y1,x2,y2 = tangent_points(cx, cy, r, px, py)
05:22
<@ToxicFrog>
Or point_struct = tangent_points(arg_struct) ?
05:22
<@ToxicFrog>
Or something else?
05:23
<@Vornicus>
Actually I don't know that, is part of the problem.
05:23
<@ToxicFrog>
...
05:24
<@Vornicus>
Right now the prototype as given by Dave is point_struct_a, point_struct_b = tangent_points(cx, cy, r, px, py)
05:24
<@ToxicFrog>
But you're writing this to someone else's spec, I thought.
05:24
<@ToxicFrog>
Aah.
05:24
<@Vornicus>
It is inconsistent.
05:24
<@Vornicus>
oh, and the point structs are named, not arrayish.
05:24
<@ToxicFrog>
Right. But that's just a minor detail.
05:24
<@Vornicus>
mm
05:26
<@Vornicus>
And the problem is that I have about half a dozen things I need to do first - getting midpoints, drawing circles through points, intersecting circles, getting canonical-basis points from line-basis coordinates... that if I follow the same prototype throughout I'm going to have to do a lot of converting.
05:26
<@ToxicFrog>
How so?
05:27
<@Vornicus>
Because the prototype is unstructured in, structured out.
05:27
<@ToxicFrog>
Either you're going to convert from unstructured to structured when you enter the function, or when you leave it.
05:27
<@ToxicFrog>
That's not, IMO, "a lot"
05:28
<@ToxicFrog>
Anyways, for the prototype as written, you want something like:
05:28
<@ToxicFrog>
struct_a = { x = x_1; y = y_1; }
05:28
<@ToxicFrog>
struct_b = { x = x_2; y = y_2; } -- x_*, y_*n calculated earlier in the function
05:28
<@ToxicFrog>
return struct_a,struct_b
05:29
<@ToxicFrog>
Or, alternately, pack them into an array and [[ return unpack(array_of_structs) ]]
05:29
<@Vornicus>
okay, and the conversion, assuming I'm doing it when I enter the functions?
05:29
<@ToxicFrog>
local point = { x = px; y = py; }
05:30
<@ToxicFrog>
local circle = { x = cx; y = cy; r = cr; }
05:30
<@Vornicus>
er
05:30
<@ToxicFrog>
?
05:30
<@Vornicus>
fron structured to unstructured
05:30
<@ToxicFrog>
Oh.
05:30
<@ToxicFrog>
tangent_points(circle.x, circle.y, circle.r, point.x, point.y)
05:30
<@Vornicus>
oh, ok.
05:30
<@Vornicus>
so, not too bad.
05:30 * ToxicFrog nods.
05:31
<@ToxicFrog>
(this is actually a syntactic sugar for circle["x"], circle["y"], etc, under the hood)
05:31
<@ToxicFrog>
But for this purpose it's basically:
05:32
<@ToxicFrog>
Declaration: local foo = {}; or local foo = { field = value; field2 = value2; ... };
05:32
<@ToxicFrog>
Access: structure.field
05:32
<@ToxicFrog>
Assign: structure.field = value
05:33
<@ToxicFrog>
And a multiple return is just return val1,val2,val3,val4,...
05:33
<@ToxicFrog>
unpack(array) is equivalent to array[1],array[2],...,array[#array]
05:34
<@Vornicus>
ok
05:34
<@ToxicFrog>
(and # is the sizeof operator; for arrays it returns the number of contiguous elements starting from 1)
05:34
<@ToxicFrog>
Note also that since 'structs' are actually associative arrays + syntactic sugar, you can add and remove fields on the fly.
05:35
<@ToxicFrog>
so [[ point = { x = 1; y = 2; }; ]] and [[ point = {}; point.x = 1; point.y = 2; ]] are both completely legal.
05:36
<@Vornicus>
okay.
05:37
<@ToxicFrog>
If there is anything else, you'll have to either ask now, consult the Reference, or wait until tomorrow, because I'm about to crash~
05:38
<@Vornicus>
I think that solves it all. Thank you.
05:38
<@ToxicFrog>
No problem.
05:45 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
06:28 You're now known as TheWatcher
08:01
<@Vornicus>
shit, it's 1AM
08:09
<@Reiver>
Ni Vorn!
08:09
<@Reiver>
(Are you at home or at work still?)
08:10
<@Vornicus>
Home.
08:11
<@Vornicus>
I have intarnewbs here now, but no publicly routable IP. I should have that Monday though.
08:12
<@Reiver>
Woo!
08:12 * Reiver huggles Vorn!
08:12
<@Reiver>
So you will be staying?
08:12
<@Vornicus>
?
08:12
<@Vornicus>
staying where?
08:12
<@Reiver>
Here.
08:12
<@Reiver>
On the internets.
08:12
<@Vornicus>
yes.
08:12
<@Reiver>
Yay!
08:13
<@Reiver>
We did miss our Vorny, so.
08:24 You're now known as TheWatcher[afk]
08:38 Vornicus is now known as Vornicus-Latens
10:29 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
10:29 mode/#code [+o Chalcy] by ChanServ
10:32 Chalcy is now known as Chalcedon
10:45 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Quit: ]
10:55 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
10:55 mode/#code [+o Chalcedon] by ChanServ
11:25 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Quit: ]
11:29 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
11:29 mode/#code [+o Chalcedon] by ChanServ
12:11 You're now known as TheWatcher
12:23 Mahal is now known as MahalZzz
13:28 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
13:31 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
14:11 Reiver is now known as ReivZzz
14:48 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
14:49 mode/#code [+o Chalcy] by ChanServ
14:50 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
15:36 MahalZzz [~Mahal@Nightstar-5192.worldnet.co.nz] has quit [Quit: This computer has gone to sleep]
17:26 You're now known as TheWatcher[afk]
17:28 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
18:35 Vornicus-Latens is now known as Vornicus
18:36 You're now known as TheWatcher
19:08 Lukhan [~Sotek@Nightstar-5062.hsd1.de.comcast.net] has quit [Ping Timeout]
19:14
<@Vornicus>
What does unit testing do for you?
19:14
<@Vornicus>
Well, that's simple.
19:14
<@ToxicFrog>
?
19:14
<@Vornicus>
It makes it so, when you wake up stupid, you can still write code.
19:18
<@TheWatcher>
Heh
19:21
<@Vornicus>
and, TW,I can't seem to reproduce your problems with iTunes. I can edit in place without difficulty.
19:23
<@TheWatcher>
See my comment
19:24
<@TheWatcher>
Essentially - whoever wrote the windows version should be crushed to death under a crate of UI design textbooks.
19:25
<@Vornicus>
....that's just strange.
19:26
<@TheWatcher>
Quite. Utterly inexplicable to me, given that windows patently /can/ support multicolumn lists with editable cells.
20:56 * EvilDarkLord raises hand. It is time for... More Bumbling Newbie Questions *drumroll*. Would anyone know how easily Recovery CDs, specifically for a Windows Home Edition Fujitsu-Siemens laptop are gotten?
21:28
<@ToxicFrog>
Typically one comes with the laptop.
21:34 Mahal [~Mahal@Nightstar-5192.worldnet.co.nz] has joined #code
21:34 mode/#code [+o Mahal] by ChanServ
21:39
< EvilDarkLord>
Yar, TF. It seems to be the one CD I cannot locate though, thus the question of alternative ways of aquisition. Also, would a CD from a similar laptop with the same OS work?
21:40
<@TheWatcher>
Depends how similar. In theory you could just use a standard windows install, the killer is the drivers.
21:41
< EvilDarkLord>
The exact same laptop, actually. My main concern is that Windows would get all angsty about not using my own Cd for this.
21:41
< EvilDarkLord>
(Different Windows id numbers or something)
21:42
<@TheWatcher>
Hm
21:45
<@Vornicus>
!! mailtime!
23:13 EvilDarkLord is now known as EvilLBTWUTSARLord
23:21 You're now known as TheWatcher[T-2]
23:28 You're now known as TheWatcher[afk]
--- Log closed Sun Aug 13 00:00:02 2006
code logs -> 2006 -> Sat, 12 Aug 2006< code.20060811.log - code.20060813.log >