code logs -> 2013 -> Wed, 11 Dec 2013< code.20131210.log - code.20131212.log >
--- Log opened Wed Dec 11 00:00:00 2013
00:00
<~Vornicus>
I really should look into learning c#
00:00
<@Tarinaky>
Never trust a wizard who doesn't have a beard? (Women are allowed to wear beard-wigs)
00:12 Derakon[AFK] is now known as Derakon
00:16 celticminstrel [celticminst@Nightstar-gj43l1.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
00:16 celticminstrel [celticminst@Nightstar-gj43l1.dsl.bell.ca] has joined #code
00:16 mode/#code [+o celticminstrel] by ChanServ
00:17 celticminstrel [celticminst@Nightstar-gj43l1.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
00:17 celticminstrel [celticminst@Nightstar-gj43l1.dsl.bell.ca] has joined #code
00:17 mode/#code [+o celticminstrel] by ChanServ
00:25
< Shiz>
>coffeescript
00:26
<~Vornicus>
are you greentexting at us
00:26
< Shiz>
no, only at myself
00:26
< Shiz>
:(
00:26
<@celticminstrel>
Greentexting?
00:27 Turaiel[Offline] is now known as Turaiel
00:27
<~Vornicus>
celticminstrel: on 4chan and others, lines of text that begin with ">" are printed in green; ostensibly it's for quotations (like email quotation) but more people use it as, um. A device to say "i'm telling a story now"
00:28
<@celticminstrel>
Okay then.
00:38
< RichyB>
Pleasingly similar idea to green ink.
00:39
<&McMartin>
#CODE IS CORRUPTING OUR PRECIOUS BODILY FLUIDS BECAUSE IMMIGRANTS
00:39 * Vornicus patpats mcm
00:39
<@Tarinaky>
Is McMartin going to order his airbase to radio silence and launch the bombers?
00:39
<@Tarinaky>
To save his precious bodily fluids from soviet usurpation?
00:40
<&McMartin>
because immigrants, not because flouridation.
00:40
<&McMartin>
(But yeah, that's what green ink is, right?)
00:44 Orthia [orthianz@Nightstar-avg.1ee.224.119.IP] has quit [[NS] Quit: Going dooooown...]
00:55 Vornicus [Vorn@Nightstar-28h42k.sd.cox.net] has quit [[NS] Quit: Leaving]
01:05
< RichyB>
McMartin, yes.
01:11 redwire [redwire@Nightstar-27dppb.nl.bellaliant.net] has quit [Ping timeout: 121 seconds]
01:12 redwire [redwire@Nightstar-27dppb.nl.bellaliant.net] has joined #code
01:13 Orthia [orthianz@Nightstar-avg.1ee.224.119.IP] has joined #code
01:13 mode/#code [+o Orthia] by ChanServ
01:55 gnolam [lenin@Nightstar-skg971.cust.bredbandsbolaget.se] has quit [Connection closed]
01:55 gnolam_ [lenin@Nightstar-skg971.cust.bredbandsbolaget.se] has joined #code
02:01 gnolam_ is now known as gnolam
02:01 mode/#code [+o gnolam] by ChanServ
02:08 Vornicus [Vorn@Nightstar-28h42k.sd.cox.net] has joined #code
02:08 mode/#code [+qo Vornicus Vornicus] by ChanServ
02:31 redwire [redwire@Nightstar-27dppb.nl.bellaliant.net] has quit [[NS] Quit: Textual IRC Client: www.textualapp.com]
02:47
<~Vornicus>
...derp. I wrote a bunch of data in and then forgot to save it because I also did a bunch of analysis I didn't need to keep.
02:49 * Vornicus feels silly now!
02:49
<@Tarinaky>
You sausage!
02:51 * ToxicFrog takes a chainsaw to ifirc's networking code
02:55
<&ToxicFrog>
Responsive bidirectional networking is hard.
02:55
< Shiz>
tell me about it
03:02 Orthia [orthianz@Nightstar-avg.1ee.224.119.IP] has quit [[NS] Quit: Going dooooown...]
03:08
<&ToxicFrog>
Holy shit
03:08 Trystan [tslee@Nightstar-csfqfg.slkc.qwest.net] has joined #code
03:08
<&ToxicFrog>
So, I wanted to ditch Saturnine because it's kind of overcomplicated and hard to debug
03:08
<&ToxicFrog>
But now I'm looking at the underlying Java API for sockets and there is no god
03:09
<~Vornicus>
heh. yeah, I can't name any java api that made sense to me when I went looking at it.
03:09
<&ToxicFrog>
Here are the first few lines of the documentation for Java's select() equivalent:
03:09
<&ToxicFrog>
"A multiplexor of SelectableChannel objects.
03:09
<&ToxicFrog>
A selector may be created by invoking the open method of this class, which will use the system's default selector provider to create a new selector. A selector may also be created by invoking the openSelector method of a custom selector provider. A selector remains open until it is closed via its close method.
03:09
<&ToxicFrog>
A selectable channel's registration with a selector is represented by a SelectionKey object."
03:09
<&ToxicFrog>
Note that sockets do not implement SelectableChannel, you have to wrap them somehow, like all java IO.
03:10
<@Alek>
yeaaaah no.
03:10 Trystan [tslee@Nightstar-csfqfg.slkc.qwest.net] has left #code []
03:15
< Shiz>
that would be too easy
03:15
< Shiz>
you surely want to keep it modular
03:21 Orthia [orthianz@Nightstar-avg.1ee.224.119.IP] has joined #code
03:21 mode/#code [+o Orthia] by ChanServ
03:23
<&ToxicFrog>
This is a compelling argument that I should stick with Saturnine, I think.
03:24
<~Vornicus>
what are you doing in java anyway?
03:25
<&ToxicFrog>
I'm not, I'm doing in Clojure
03:25
<&ToxicFrog>
But there isn't a convenient wrapper around the networking library that gives me a BSD sockets style API, so I thought, well, I'll just use the Java socket API directly, how hard can it be?
03:25
<&ToxicFrog>
I now see why there isn't such a wrapper and people tend to just implement entire network message handling framework libraries.
03:25
< Shiz>
bad idea
03:26
< Shiz>
have to say bsd sockets aren't a lot fun in general
03:26
< Shiz>
when you're working in higher level code
03:26
<&ToxicFrog>
So, for this project, basically all I need is:
03:26
<&ToxicFrog>
- select() on two sockets
03:26
<&ToxicFrog>
- pass the result to a function
03:26
<&ToxicFrog>
- write the result to one of the sockets
03:26
<&ToxicFrog>
- if any io error occurs, exit()
03:27
< Shiz>
seems easy enough in the languages I'm familiar with
03:27
< Shiz>
sadly, clojure nor java is one of them when it comes to sockets
03:27 Vornicus [Vorn@Nightstar-28h42k.sd.cox.net] has quit [[NS] Quit: Leaving]
03:27
<&ToxicFrog>
So, this is quite easy indeed in Clojure using Saturnine, but it's a bit too magical for my taste, in that when something goes wrong it's hard to figure out where
03:28
<&ToxicFrog>
And it's also considerably heavierweight than I thought I needed
03:28
<&ToxicFrog>
I now realize that anything using the Java sockets API is going to be a cthonian nightmare of sanity-devouring madness and that Saturnine is doing quite well indeed just by keeping that madness mostly contained.
03:30
<&McMartin>
Based on things our server leads bitch me out about, the Java Sockets API has more greebly bits than libcurl
03:30
<&McMartin>
(In that he is quite put out that I can't find configuration knobs for things he thinks we should be able to trivially handle)
03:39
<&McMartin>
But it turns out that while you can, in libcurl, yoink the connect timeout and configure it independently of a total timeout, you cannot do the same with read timeout
03:39
<&McMartin>
("Can't I just set the total timeout to the connect timeout plus the read timeout?" "Why should you need workarounds like that?")
03:40
<&McMartin>
On the other hand, there is one place where Java beats the equivalent C interface; it's a lot easier to just chuck an InflaterInputSteam into your filter chain for yoru IO wrappers than it is to contend with zlib~
03:41
<&McMartin>
Er, InflaterInputStream, your
03:45 Vornicus [vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
03:45 mode/#code [+qo Vornicus Vornicus] by ChanServ
04:13 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:30 Derakon is now known as Derakon[AFK]
04:32 Kindamoody[zZz] is now known as Kindamoody
04:56 Derakon[AFK] is now known as Derakon
05:01 Stalker [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
05:08 Orthia [orthianz@Nightstar-avg.1ee.224.119.IP] has quit [Ping timeout: 121 seconds]
05:10 celticminstrel [celticminst@Nightstar-gj43l1.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
05:15 Orthia [orthianz@Nightstar-b15tt2.callplus.net.nz] has joined #code
05:15 mode/#code [+o Orthia] by ChanServ
05:18 Derakon is now known as Derakon[AFK]
06:17 ErikMesoy|sleep is now known as ErikMesoy
06:19 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
06:44 Turaiel is now known as Turaiel[Offline]
06:52 You're now known as TheWatcher
07:03 RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.]
07:06 RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has joined #code
07:14 Kindamoody is now known as Kindamoody|afk
08:09 You're now known as TheWatcher[afk]
09:50 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code
10:03 gnolam [lenin@Nightstar-skg971.cust.bredbandsbolaget.se] has quit [[NS] Quit: Das Reboot]
10:21 gnolam [lenin@Nightstar-skg971.cust.bredbandsbolaget.se] has joined #code
10:21 mode/#code [+o gnolam] by ChanServ
10:31 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving]
11:14 You're now known as TheWatcher
11:31 redwire [redwire@Nightstar-27dppb.nl.bellaliant.net] has joined #code
11:50 dmiles_akf [dmiles@Nightstar-hdcn1r.or.comcast.net] has joined #code
12:02
< AnnoDomini>
How I used PGP?
12:03
< AnnoDomini>
I mean, I just received a request that I send a guy my PGP key, because he wants to send me something Google shouldn't know about.
12:03
< AnnoDomini>
What I do?
12:04
< Shiz>
google pgp for one
12:06
< redwire>
Thunderbird + Enigmail should make your life a little easier, too.
12:06
< RichyB>
AnnoDomini, http://futureboy.us/pgp.html â some person wrote a tutorial about PGP.
12:06
< AnnoDomini>
redwire: I use web interfaces exclusively.
12:06
< redwire>
Do you use Chrome, too?
12:06
< AnnoDomini>
Yeah.
12:07
< redwire>
Sigh...
12:07
< RichyB>
OpenPGP is a standard for encrypting email (or other data too). GPG (or GnuPG, whichever you call it) implements OpenPGP.
12:07
< redwire>
Well, there's a chrome extension that handles PGP keys or some shit
12:07
< redwire>
Mailvelope, I think.
12:07
< redwire>
I remember seeing it on Hak5.
12:09
<@TheWatcher>
AD: 1: install gnupg if it isn't already. 2: create a key using 'gpg --gen-key' 3: export your key with 'gpg --output ad.key --export your@email', send that file, when you get the encrypted data back, save it and then run 'gpg --output decryptedfoo --decrypt encryptedfoo' *shrug*
12:12
< AnnoDomini>
TheWatcher: Thanks! I will attempt to follow these directions.
12:14
<@TheWatcher>
AnnoDomini: http://www.gnupg.org/gph/en/manual/c14.html and the next two pages should get you going, anyway
12:16 thalass [thalass@Nightstar-2vl6a3.bigpond.net.au] has joined #code
12:31 * TheWatcher eyes this
12:33
<@TheWatcher>
How did this code ever actually work? WTF?!
12:33
< AnnoDomini>
Magic.
12:48 gnolam [lenin@Nightstar-skg971.cust.bredbandsbolaget.se] has quit [[NS] Quit: Gone]
12:57 * AnnoDomini improves his very inefficient pathing to not waste so much time on an impossible path, and also to take into account creatures in the way.
12:58
<~Vornicus>
anno: what algorithm are you using?
12:59
< AnnoDomini>
I think it's effectively Dijkstra with inefficient node cost assignment.
12:59
< AnnoDomini>
Vornicus: http://pastie.org/8544545
12:59
<~Vornicus>
Might i recommend an upgrade to A*?
13:00
< AnnoDomini>
There's no noticable slowdown.
13:00
<~Vornicus>
hotdamn that's a big function
13:00
<~Vornicus>
well, at least it's got relatively sufficient comments.
13:02
<~Vornicus>
What I notice actually is you're using costings to find your way back; might I recommend instead prev pointers?
13:02 * AnnoDomini will try to make it priorize vertical/horizontal steps over diagonals, because the current algorithm seems to prefer diagonals.
13:03
< AnnoDomini>
Vornicus: You mean another grid of Points that get assigned the same time as the cost grid?
13:03
<~Vornicus>
gneh, I think I missed something.
13:04
<~Vornicus>
I'll have a look when I get up, right now I require sleep.
13:04
< AnnoDomini>
Sov godt.
13:04
<@Tarinaky>
Isn't A* Dj-I-can't-spell-the-name algorithm with arbitrary cost heuristics (that obey the triangle inequality).
13:04
<@Tarinaky>
+?
13:04
< Shiz>
grid[i][j] = minimum(minimum(minimum(minimum(minimum(minimum(minimum(grid[i+1][j+1],grid[i+1] [j]),grid[i+1][j-1]),
13:04
< Shiz>
grid[i][j+1]),grid[i][j-1]),
13:04 * Tarinaky hasn't done AI for a while.
13:04
< Shiz>
grid[i-1][j+1]),grid[i-1][j]),grid[i-1][j-1])
13:04
< Shiz>
+10;
13:04
< Shiz>
i think you need more minimum.
13:04
< AnnoDomini>
Do I?
13:04
< Shiz>
maybe throw in a maximum for variety
13:05
< RichyB>
That's *not* Dijkstra's algorithm.
13:05
< AnnoDomini>
I *think* I got all the parens matched.
13:05
< RichyB>
Tarinaky, pretty much.
13:05
<~Vornicus>
Tarinaky: dijkstra traverses an edge-weighted graph; A* traverses an edge-weighted graph and has a distance-to-goal heuristic.
13:05
<@Tarinaky>
Ah, right. Yes. I remember.
13:06
<@Tarinaky>
There's a distance-to-goal metric and a distance-to-start-from-here metric.
13:06
<@Tarinaky>
And there's some constraints on what they can be in order to guarentee optimality but otherwise 'have fun'.
13:07
<@Tarinaky>
One can't be an over-estimate and the other can't be an underestimate I think?
13:07
<~Vornicus>
A*'s distance to goal can't be an overestimate
13:07
< RichyB>
AnnoDomini, your pathfinding algorithm is more like breadth-first search, only it touches every square on the map every iteration.
13:07
<~Vornicus>
There's no heuristic for distance to start except "I've travelled this far"
13:08
<~Vornicus>
edge weights must be nonnegative.
13:08
< Shiz>
it's also.. fairly awful.
13:08
<~Vornicus>
...I'll let the other nutbars help you. nini.
13:08
<@Tarinaky>
Vornicus: I've 'travelled this far is a metric'.
13:08
< AnnoDomini>
RichyB: Really? This is my interpretation of Dijkstra, replacing efficient but difficult-to-code bits with inefficient but simple-to-code bits.
13:08
<~Vornicus>
Sure, but it's exact. it's not a heuristic.
13:09
<@Tarinaky>
I didn't call it a heuristic.
13:09
<@Tarinaky>
And it might not be accurate if the graph only models a problem.
13:09
<~Vornicus>
wellok.
13:09 Vornicus [vorn@Nightstar-sn7kve.sd.cox.net] has quit [[NS] Quit: ]
13:09
< Shiz>
yeah this is just a naive O(n^3) algorithm
13:09
< Shiz>
not particularly efficient
13:10
< RichyB>
AnnoDomini, no. Dijkstra maintains: 1: a set of nodes that we have already found the shortest path to, 2. a priority queue of the nodes that should be visited next.
13:10
< Shiz>
priority queue isn't inherent to dijkstra
13:10
< RichyB>
If you don't have a heap structure anywhere then you definitely haven't implemented Dijkstra.
13:10
< Shiz>
it is inherent to an efficient implementation though
13:10
<@Tarinaky>
Which is the point of being able to come up with arbitrary heusristics - you can consider problems that aren't about graphs by simplifyng them to a graph problem.
13:11
< Shiz>
it's really not a big of a point (pun intended) in this example
13:11
< Shiz>
but in general you don't want to return structs by value
13:11
< Shiz>
or pass them by value
13:11
< RichyB>
Shiz, a priority queue, as in a class PriorityQueue<Node>, which has operations extract_min() and decrease_metric(node_id), is inherent to Dijkstra.
13:11
< Shiz>
it really isn't.
13:11
< RichyB>
Shiz, the bit that is required if and only if you want your implementation to go fast is for that abstract data type to be implemented by some kind of heap.
13:12
< Shiz>
well
13:12
< Shiz>
I suppose you're right.
13:13
< RichyB>
Thank you.
13:13
< Shiz>
?
13:13
< RichyB>
Shiz, oh you're rigt that â<RichyB> If you don't have a heap structure anywhere then you definitely haven't implemented Dijkstra.â was not a correct statement.
13:14
< RichyB>
It's a priQ that you need, not necessarily a heap.
13:14
< Shiz>
yeah.
13:14
< RichyB>
s/rigt/right/
13:15
< RichyB>
To be fair to AnnoDomini, the algorithm is labelled "babbys_first_pathfinder"
13:15
<@Tarinaky>
What is the difference between a priority queue and a heap?
13:15
< Shiz>
one is a data structure
13:15
< Shiz>
the other is a memory space in a process
13:15
< Shiz>
:P
13:15
<@Tarinaky>
*binary heap
13:16
< Shiz>
priority queues don't have to be implemented as trees
13:16
< RichyB>
Tarinaky, priority queue is the interface, there are a number of different data structures called "heaps" (such as binomial heaps, binary heaps, fibonacci heaps) which implement a priority queue with varying efficiency at different operations.
13:16
< Shiz>
priority queues are an abstract data type
13:16
< Shiz>
not necessarily an implementation
13:16
< RichyB>
A flat array and "reduce(min)" is also a (really-slow) implementation of the priority queue interface, too.
13:16
< Shiz>
I can implement a PQ as a simple array or linked list and have find-min-value() be O(n)
13:17
<@Tarinaky>
Okay.
13:17
< Shiz>
and we're basically saying the same thing
13:17
< Shiz>
:P
13:17
< RichyB>
Oh and "heap is a memory space in a process" is slightly confusing, this is one of those annoying places where computer science has thought to helpfully use the same word for several different things.
13:17
< Shiz>
stack, too.
13:18
< RichyB>
The term "heap" sometimes refers to the set of memory from which malloc() will parcel out bytes and sometimes to the data structure, just to annoy you.
13:18
< RichyB>
It's said that the two hardest problems in computer science are cache invalidation, agreeing upon names for things and off-by-one errors.
13:19
< Shiz>
i think the antispam answer for http://pastebin.starforge.co.uk/ should be changed to FILE_NOT_FOUND
13:44
<@Tarinaky>
I overslept massively today. Missed revision lectures for Agile Methodologies and Linear Programming :(
13:44
<@Tarinaky>
I blame stress.
13:44
< AnnoDomini>
Don't you have alarm clocks?
13:44
<@Tarinaky>
Yes.
13:45
< AnnoDomini>
Why don't you use them?
13:45
<@Tarinaky>
It was set. It... probably went off.
13:46
<@Tarinaky>
One of the songs they probably played on the radio station my alarm is set to is now stuck in my head.
13:46
< AnnoDomini>
Try a non-musical/voice alarm clock.
13:46
< AnnoDomini>
They can be slept through.
13:46
<@Tarinaky>
They can all be slept through.
13:47
< AnnoDomini>
If it doesn't emit the most annoying and shrill sound possible, it isn't a good alarm clock.
13:47
< Shiz>
I can sleep right through my alarm clock unleashing hell right besides me
13:47
<@Tarinaky>
Nothing is more annoying than Chris Evans :V
13:48
<@Tarinaky>
Anyway, I didn't go back to sleep. I just didn't stir.
13:48
< AnnoDomini>
Get more alarm clocks.
13:50
<@Tarinaky>
I'm going to get dressed and bu
13:51
<@Tarinaky>
+buy some subway
13:56 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
13:57 gnolam [lenin@Nightstar-eqqtqa.addr.tdcsong.se] has joined #code
13:57 mode/#code [+o gnolam] by ChanServ
14:09 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
14:09 mode/#code [+o himi] by ChanServ
14:10 Stalker [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
14:15 celticminstrel [celticminst@Nightstar-gj43l1.dsl.bell.ca] has joined #code
14:15 mode/#code [+o celticminstrel] by ChanServ
14:30 You're now known as TheWatcher[afk]
14:31 thalass is now known as Thalasleep
14:46 homestat [ujian@Nightstar-srt730.tm.net.my] has joined #code
15:00 Stalker [Z@Nightstar-ro94ms.balk.dk] has joined #code
15:05
< ErikMesoy>
https://twitter.com/SQLRockstar/status/410606489628209152 <-- My present job is basically cleanup after this.
15:06
<@Tarinaky>
What's a Sharepoint?
15:07
< Syka>
microsoft thing
15:07
< Syka>
like a CMS/wiki/etc
15:07
< Syka>
corporate knowledge silo?
15:10
< ErikMesoy>
Document storage... thing.
15:11
< ErikMesoy>
It allows for storage, linking and versioning of word docs, outlook emails, and txt files. Very nice for a big corporation to have.
15:16
< Syka>
it's also lulz
15:16
<@Tarinaky>
Can you explain the joke?
15:16
<@Tarinaky>
ELI5
15:18
< Syka>
the joke is that it costs more than staff do
15:18
<@Tarinaky>
Ahah.
15:18
< Syka>
and that it's a proprietary microsoft silo
15:19
< Syka>
and that once your data is in there, well, it's not exactly interop'in with anything else
15:19
< ErikMesoy>
Which is possibly what my employer has figured out, and hired me and my fellow consultants to fix.
15:19
< ErikMesoy>
"Get these documents out of Sharepoint."
15:19
< ErikMesoy>
"And update those links in the documents that point to Sharepoint."
15:19
< Syka>
what are you putting them in instead?
15:20
< ErikMesoy>
Meridio
15:20
< Syka>
never heard of it
15:20
< Syka>
is it less bad?
15:21
< ErikMesoy>
It is different.
15:29
< AnnoDomini>
Gnar. I'm not sure how to do diagonal costing in my setup. Trying to do it naively leads to a mishap where due to the order of operations, the right side gets assigned proper values, and the left side does not.
15:30
< AnnoDomini>
Well, order of actions. Not */+- stuff.
15:39 homestat [ujian@Nightstar-srt730.tm.net.my] has quit [[NS] Quit: ]
15:43 Thalasleep [thalass@Nightstar-2vl6a3.bigpond.net.au] has quit [Ping timeout: 121 seconds]
16:01
<@Tarinaky>
Okay! I think I have code to generate a graph of rooms now.
16:02
<@Tarinaky>
I'm... not sure this is useful...
16:02
<@Tarinaky>
>.<
16:02
<@Tarinaky>
I need a better plan :/
16:15
<&ToxicFrog>
graphs \o
16:15
<&ToxicFrog>
\o/
16:16
<@Tarinaky>
I'm currently thinking I should make this more L-System like with room/corridors and change the methods to apply different rules.
16:23
< AnnoDomini>
OK. I don't see any way to properly do diagonal pathing under my silly pathing system. Not without bloating the calculation time needlessly.
16:23
< AnnoDomini>
For now, it's sufficient as it is. It paths. Not the shortest way, but without fail.
16:23
< ErikMesoy>
How is it off? Does it take the long wayaround corners?
16:24
< AnnoDomini>
It prefers diagonal movement to vertical/horizontal even when going vertically or horizontally.
16:24
< AnnoDomini>
I'll show you on Saturday.
16:25
< AnnoDomini>
Well, sometimes.
16:25
< AnnoDomini>
It's a bit arcane.
16:38
<@Tarinaky>
Python question...
16:38
<@Tarinaky>
45 Type_ = prng.choice([Room, CorridorSection])
16:38
<@Tarinaky>
46 self.connect(Type_(self.dungeon) )
16:39
<@Tarinaky>
yields the error: self.connect(Type_(self.dungeon) )
16:39
<@Tarinaky>
TypeError: object() takes no parameters
16:39
<@Tarinaky>
I'm clearly doing something silly here...
16:40
< ErikMesoy>
what's the connect() method like?
16:40
< ErikMesoy>
What's the Type_() method like?
16:40
<@Tarinaky>
Room and CorridorSection both inherit from the same abstract class that defines their __init__ method.
16:40
<@Tarinaky>
Type_ is a variable.
16:41
< ErikMesoy>
If Type_ is a variable, what's Type_(self.dungeon) doing here?
16:41
<@Tarinaky>
Because Type_ is being assigned with a class.
16:41
<@Tarinaky>
Either Room or CorridorSection.
16:41
<@Tarinaky>
Instead of having an if statement.
16:42
< ErikMesoy>
I don't understand the answer.
16:42
< ErikMesoy>
It sounds to me like Type_() is what's giving your error.
16:42
<@Tarinaky>
Yes. And I don't understand why.
16:42
<@Tarinaky>
Because Type_() should be half the time identical to Room() and the other half CorridorSection()
16:43
< ErikMesoy>
If Type_ is a variable, it sounds as though it shouldn't have any methods.
16:43
< ErikMesoy>
So what is Type_()?
16:43
<@Tarinaky>
Because in Python classes are objects too.
16:44
<@Tarinaky>
If Type_ == Room, then Type_() == Room()...
16:44
<@Tarinaky>
If Type_ == CorridorSection, Tyoe_() == CorridorSection()...
16:45
< ErikMesoy>
Do you perhaps mean to initialize these as Type = Room() rather than Type() = Room()?
16:45
< ErikMesoy>
I dunno mang, at this point I'm guessing wildly
16:46
<@Tarinaky>
No.
16:46
<@Tarinaky>
I mean to create a new Room() object half the time, and a new CorridorSection() half the time.
16:46
< ErikMesoy>
Type_ = prng.choice([Room(), CorridorSection()]) ?
16:47
<@Tarinaky>
I could. But that doesn't change the fact that I don't understand why the code doesn't work as it is.
16:47
<@Tarinaky>
Which I feel is an error that should be corrected.
16:47
<@Tarinaky>
Because otherwise I'm not learning anything.
16:47
<@Tarinaky>
And I'd rather not be doomed to ignorance forever.
16:48
<@Tarinaky>
Actually, I can't do choice([Room(self.dungeon)...]) because that'll have some sideeffects.
16:49
<@Tarinaky>
I'd need to if choice([True, False]) { a = Room(self.dungeon) } else { a = CorridorSection(self.dungeon) }
17:12 redwire is now known as redwire|afk
17:12 redwire|afk [redwire@Nightstar-27dppb.nl.bellaliant.net] has quit [[NS] Quit: My MacBook has gone to sleep. ZZZzzzâ¦]
17:16
<@Tarinaky>
Okay. Turns out that's not the solution either :/
17:22
<@Tarinaky>
Ah!
17:22
<@Tarinaky>
Found the problem.
17:22
<@Tarinaky>
I am an idiot.
17:24
<@iospace>
PEBKAC!
17:25
<@Tarinaky>
I'm in bed, not a chair.
17:25
<@Tarinaky>
Hammock Driven Development~
17:25
<@Tarinaky>
I forgot to set the CorridorSection to actually inherit from the base class.
17:28 gnolam [lenin@Nightstar-eqqtqa.addr.tdcsong.se] has quit [[NS] Quit: Gone]
17:35
<@Tarinaky>
Okay.
17:35
<@Tarinaky>
I had a problem.
17:35
<@Tarinaky>
I've applied L-Systems to create graphs.
17:35
<@Tarinaky>
I now have two problems :V
17:50
< RichyB>
I didn't think you could use an L-System to create a graph that isn't also a tree.
17:50
<@Tarinaky>
It is a tree.
17:50
<@Tarinaky>
I just didn't feel that information was important.
17:50
< RichyB>
That sounds like a perfectly reasonable thing to do.
17:53
<@Tarinaky>
RichyB: On reflection - it totally is possible to use an L-System to create a graph that isn't a tree.
17:54
<@Tarinaky>
RichyB: You just have a rule to replace one of your tree nodes with a graph structure.
17:54
<@Tarinaky>
*non-tree graph
17:54
< RichyB>
oh aye
17:55
<@Tarinaky>
I'm not entirely sure if it's still strictly an L-System when you're manipulating graphs instead of text symbols.
17:55
<@Tarinaky>
But whatever.
17:55
< RichyB>
The other thing I was just thinking was, if these undirected graphs are going to be, say, rooms and corridors in a videogame level, it'd probably be quite fun to generate a tree with an L-system and then pick a couple of nodes at random to add loops between.
17:56
<@Tarinaky>
That was my thinking.
17:56
<@Tarinaky>
But I'm not that far yet.
17:56
< RichyB>
Has the nice property that you get only a couple of loops, because levels with *lots* of loops are confusing to navigate.
17:56
<@Tarinaky>
I say I have two problems because now I can convert an integer to a graph I need a process to convert a graph to a level.
17:57
< RichyB>
hee, but one of your problems (âconvert an integer to a levelâ) is solvable for free if the other one is solved.
18:07 Serah [Z@Nightstar-ro94ms.balk.dk] has joined #code
18:07 Stalker [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds]
18:10
<@Tarinaky>
Oh cock. My L-System is still f-ed
18:10 * Tarinaky goes back and revises -.-
18:11 * Tarinaky adds test-case first -.-
18:14 Orthia [orthianz@Nightstar-b15tt2.callplus.net.nz] has quit [Ping timeout: 121 seconds]
19:07
<@Tarinaky>
Dumb geometry question:
19:07
<@Tarinaky>
I have a line in 2D defined by 2 points.
19:07
<@Tarinaky>
I want an angle that is perpendicular to that line.
19:08
<@Tarinaky>
Man, I haven't done any basic geometry in ages :/
19:09
<@Tarinaky>
So... the product of the gradients of two perpendicular lines is... 1 right?
19:09
<@Tarinaky>
Or do I mis-remember this?
19:10
< Ogredude>
funny thing, I know how to give you a perpendicular on the midpoint with a compass and straightedge, but I have no idea how to compute it
19:10
< ErikMesoy>
I don't think "gradient" is what you want
19:11
< ErikMesoy>
That denotes color shade transitions, AFAIK.
19:11
<@Tarinaky>
What's the word for m in y = mx + c?
19:11
< ErikMesoy>
Rise? Angle? Slope?
19:12
<@Tarinaky>
Gradiant? Gradient?
19:12
<@Tarinaky>
http://en.wikipedia.org/wiki/Gradient
19:12
< ErikMesoy>
Anyway, what I would do is subtract one end of the line from the other, rotate the result 90 degrees (switch the values and multiply one of them by -1), and add that to one end of the line.
19:12
< ErikMesoy>
This should get a 90 degree angle, unless I fucked up somewhere
19:13
<@Tarinaky>
Pretty sure 'switch the variables and multiply one of them by -1' means the same as m_1 m_2 = 1
19:14
<@Tarinaky>
Given that m_1 = y / x
19:14
<@Tarinaky>
m_2 must equal - (x / y)
19:14
< ErikMesoy>
Suppose you have a line between (0,2) and (7,8).
19:14
< ErikMesoy>
You subtract the first from the second to get (7,6).
19:14
< ErikMesoy>
You turn this into (-6,7) and add that to (0,2).
19:14
< ErikMesoy>
the line from (0,2) to (-6,9) should be at 90 degrees to the original line.
19:18
<@Tarinaky>
m_1 m_2 = -1 or m = -1 / (dy/dx) :p
19:18
<@Tarinaky>
I find the algebra easier to deal with than the geometry :/
19:27
<@celticminstrel>
Actually ErikMesoy, "gradient" also means slope.
19:27
<@celticminstrel>
It might be a more British usage...
19:28
<@Tarinaky>
Well we did stea^Winvent the language :V
19:28
<@celticminstrel>
Lies.
19:29
<@Tarinaky>
Bigup British English. :V
19:30
<@Tarinaky>
(That was supposed to be irony: 'big up' is carribean in origin~)
19:30
<@Tarinaky>
I'm gonna go get something to drink, do my TDD/Pair Programming retrospective and play a video game.
19:30
<@Tarinaky>
Later.
19:33 redwire [redwire@Nightstar-27dppb.nl.bellaliant.net] has joined #code
20:12
< Xon>
interesting. my exchange 2010 instance boots so fast DHCP can't respond fast enough before it attempts to bring the cluster node up. Which fails because the adapter doesn't yet have an IP. I think the clustered windows DHCP is introducing too much delay betweek the discover request & ACK =p
20:25 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has quit [[NS] Quit: back in a while?]
20:31 You're now known as TheWatcher
20:32 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has joined #code
20:32 mode/#code [+o Alek] by ChanServ
20:32 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has quit [[NS] Quit: ]
20:59 Derakon [chriswei@Nightstar-4k2ccr.ca.comcast.net] has joined #code
20:59 mode/#code [+ao Derakon Derakon] by ChanServ
20:59 * Derakon dives into the camera exposure timing code, can tell this is the last productive thing he'll be doing today.
21:00
<&Derakon>
It's not so much that the code is hairy as that it's very, very precisely timed (to achieve maximum framerate) and getting it wrong creates rather opaque bugs.
21:07
<&Derakon>
(Counting comments, the function is 89 lines long; not counting them, it is 47...and I wish I'd written more)
21:11 Orthia [orthianz@Nightstar-avg.1ee.224.119.IP] has joined #code
21:11 mode/#code [+o Orthia] by ChanServ
21:12 gnolam [lenin@Nightstar-lgrapr.tbcn.telia.com] has joined #code
21:12 mode/#code [+o gnolam] by ChanServ
21:17
<&jerith>
Derakon: That sounds like something that should maybe be written in C rather than Python?
21:18
<&jerith>
(Precise timing being a thing that C does better than Python at that kind of scale.)
21:20
<&Derakon>
Jerith: nah, we set up the timings in advance and then hand them off to dedicated hardware to execute.
21:20
<&Derakon>
It's not even in the OS.
21:20
<&Derakon>
My main problem right now is that I have three different triggering modes for our cameras.
21:20
<&jerith>
Ah. That's even better. :-)
21:20
<&Derakon>
In the first, they're exposing continuously, and when we trigger them they send us a dump of everything they've acquired, wipe their sensors, and start acquiring again.
21:21
<&Derakon>
In the second, they expose when the trigger line is high, stop when it goes low, and send us the image and wipe the sensor.
21:21
<&Derakon>
In the third, they start exposing when the trigger goes high, and stop after a predetermined duration, send us the image and wipe.
21:21
<&Derakon>
I have to set up the trigger lines properly, while ensuring of course that there's as little wasted time as possible.
21:22
<&Derakon>
And, ideally, get cameras with different exposure regimes to work together.
21:22
<&Derakon>
(And naturally none of this is what my boss expects me to be working on this week; it's merely a prerequisite for that work...)
21:22
<&McMartin>
SHAVE ALL THE YAKS
21:22
<&Derakon>
?
21:23
< AnnoDomini>
Hahaha.
21:23
< AnnoDomini>
Derakon: You need to go to the store to buy milk, but a bunch of linked problems leads to you shaving a yak to proceed.
21:24 * jerith hands Derakon a very small ceremonial razor and badger hair brush.
21:24
<&Derakon>
...ah.
21:25 Kindamoody|afk is now known as Kindamoody
21:25
< ErikMesoy>
Out of milk, so you have to go to the store. Local store's closed, so you decide to drive to the next store over. Car has a flat tire, so you go to get the pump. Pump was lent to the neighbor in exchange for a fancy pillow, so you need to return the pillow.
21:25
< ErikMesoy>
Pillow was peed on by your four year old, so you need to wash the pillow. Washing spilled all the contents, so you need to refill it. Pillow was stuffed with yak hair, so you need to go shave a yak first.
21:26
< ErikMesoy>
And then you find yourself wondering how the hell you ended up shaving a yak in order to get some milk.
21:26
<&Derakon>
Right, gotcha.
21:27 * jerith has shaved a lot of yaks.
21:30
< AnnoDomini>
I didn't know yaks were indigenous to Africa.
21:32
<&McMartin>
Huh, neither did I. I associate them with South Asia.
21:32
<&Derakon>
I think of Tibet.
21:33
<&McMartin>
...
21:33
<&McMartin>
Yak
21:33
<&McMartin>
For the Nigerian footballer, see Yakubu Aiyegbeni. For the Russian footballer, see Pavel Pogrebnyak. For other uses, see Yak (disambiguation).
21:33
<&Derakon>
Yak is also a slang term for cocaine.
21:33
<&Derakon>
Yak is also a slang term for cognac.
21:33
<&Derakon>
Yak is also a slang term for talking.
21:33
<&Derakon>
Yak is also a slang term for vomiting.
21:33
<&McMartin>
" found throughout the Himalayan region of south Central Asia, the Tibetan Plateau and as far north as Mongolia and Russia"
21:34
<&McMartin>
Right, but *those* don't show up as the subheading, and two footballers do~
21:35 Serah [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds]
21:37 * Derakon rewrites his exposure logic, thinks it looks okay, but also is getting that sort of reeling feeling he gets when trying to hold too much logic in his head.
21:41
<@froztbyte>
hmm
21:41
<@froztbyte>
question
21:42
<@froztbyte>
who has had the realization of why it's called yak shaving?
21:42
<&McMartin>
I never dug that deep into it
21:42
<&Derakon>
According to Google it's from a Ren & Stimpy episode.
21:42
<&ToxicFrog>
I didn't until now/
21:42
<@froztbyte>
well
21:43
<@froztbyte>
ToxicFrog: ah, did you get it?
21:43
<&Derakon>
From what I remember, that seems a plausible explanation.
21:43
<&ToxicFrog>
froztbyte: ...it was just explained, in this channel, ten minutes ago
21:43
<@froztbyte>
eh, no
21:43
<@froztbyte>
I mean the actual composition/wording ;p
21:44
<@froztbyte>
basically, because you first need to shear off all the hair before you can continue with the shaving
21:44
<@froztbyte>
:D
21:45
<&jerith>
froztbyte: I've seen various different chains of events, but they all culminate in shaving a yak to stuff a pillow with the hair.
21:45
<@froztbyte>
that's the worst possible reason :(
21:45
<@froztbyte>
for shaving a yak, I mean
21:45
<@froztbyte>
just live inside its carcass
21:45
<&Derakon>
Most people don't know anything about yaks.
21:45
<@froztbyte>
it worked in Star Wars.
21:45
<&jerith>
"Shearing" is the more correct term.
21:47 dmiles_afk [dmiles@Nightstar-hdcn1r.or.comcast.net] has quit [Ping timeout: 121 seconds]
21:48
<@celticminstrel>
That sequence of events makes me think of adventure games...
21:51 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has joined #code
21:51 mode/#code [+o Alek] by ChanServ
22:03 Omega [omegaboot@Nightstar-qa936g.il.comcast.net] has joined #code
22:03 Omega [omegaboot@Nightstar-qa936g.il.comcast.net] has quit [[NS] Quit: ]
22:05 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has quit [[NS] Quit: SOON(tm)]
22:08 Kindamoody is now known as Kindamoody[zZz]
22:12 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
22:23 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has joined #code
22:23 mode/#code [+o Alek] by ChanServ
22:42
< AnnoDomini>
Are there any good tutorials on random dungeon generation?
22:43 Turaiel[Offline] is now known as Turaiel
22:55
<&Derakon>
\o/ it runs and gets 366FPS!
22:56
<&Derakon>
No idea if the timing is right for taking actual image data; I've probably introduced horrible bugs.
22:56
<&Derakon>
But I can do the speed test!
22:57 Turaiel is now known as Turaiel[Offline]
22:59 You're now known as TheWatcher[T-2]
23:00
<&Derakon>
Aaaand there goes my brain. Yep.
23:00
<&Derakon>
At least next time I have to touch this code maybe it'll go more smoothly.
23:01
< AnnoDomini>
Derakon: Where did you get ideas on how to generate stuff for your procedural transformer?
23:01 ErikMesoy is now known as ErikMesoy|sleep
23:02
<&Derakon>
Anno: from my brain.
23:02
< AnnoDomini>
And now it's gone. Such a shame.
23:03
<&Derakon>
Yep.
23:03 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has quit [[NS] Quit: SOON(tm).1]
23:04
<&Derakon>
What are you trying to do?
23:04
< AnnoDomini>
Generate a 2D dungeon. Or cave.
23:05
<&Derakon>
Define "dungeon or cave".
23:05
<&Derakon>
What games have you played that you're trying to emulate?
23:06 You're now known as TheWatcher[zZzZ]
23:06
< AnnoDomini>
Nethack, Dwarf Fortress Adventure Mode, Tales of Middle Earth, Dungeon Keeper, Diablo...
23:06
<&Derakon>
Right, okay.
23:07
<&Derakon>
The simplest way to get you started then is to throw down a bunch of rectangles at random (optionally without being allowed to intersect), and then connect the rectangles with corridors.
23:07
< AnnoDomini>
The Nethack way, I see.
23:07
<&Derakon>
It's how most of these systems get started.
23:07
< AnnoDomini>
What's the philosophy behind connecting rooms?
23:07
<&Derakon>
You can then permute how you place things and add style and so on to change how the dungeon feels.
23:08
<&Derakon>
Connecting rooms is another thing you can tweak stylistically.
23:08
< AnnoDomini>
I mean, I don't know how to do that.
23:08
<&Derakon>
Again, to get you started, just order the rooms (arbitrarily) and then connect the center of room 0 to the center of room 1, etc.
23:08
< AnnoDomini>
Oh.
23:08
<&Derakon>
...ah
23:08
< AnnoDomini>
That's easy!
23:08
<&Derakon>
Okay, good.
23:09
<&Derakon>
(This will get you a lot of intersections and corridors going through rooms that they don't "theoretically" connect to, but again, just getting you started).
23:09
<&Derakon>
You could also look into A* search as a means of finding paths between two locations on your grid.
23:09
<&Derakon>
It's not very hard to implement.
23:09
< AnnoDomini>
Thank you!
23:09
<&Derakon>
NP
23:10
< AnnoDomini>
Derakon: Well, I already have a... pathing algorithm. It can be called that! It paths.
23:10
<&Derakon>
Awesome, you can adapt that to placing your corridors then.
23:10
< AnnoDomini>
Derakon: http://pastie.org/8544545 <- Not Safe For Brain.
23:10
< AnnoDomini>
Mhm.
23:11 * Derakon eyes the 7-deep stack of "minimum" calls.
23:12
< AnnoDomini>
This was the least effortful out of "figure out why the compiler is whining about min()", "write an 8-argument minimum" and "just write a 2-argument minimum and use that repeatedly".
23:13
<&Derakon>
Have you considered switching to Python~?
23:13
< AnnoDomini>
Yes. I've tried to write stuff at one point but found it difficult to learn without, well, comprehensive instruction in proper usage.
23:14
<&McMartin>
Learn Python the Hard Way is based on, as near as I can tell, drill
23:14
<&McMartin>
I'm not equipped to evaluate it personally but it has been recommended by many
23:15
<&McMartin>
I would say that it's not great for Windows in that it wants you to run ActivePython in Powershell instead of Python like a normal person, but oh well
23:17
<@Reiv>
Actually, if you connect to rooms that you don't theoretically connect to, that can work pretty well
23:17
<@Reiv>
Gives you loops in the terrain, etc.
23:17
< AnnoDomini>
Yes.
23:17
< AnnoDomini>
Anyway. I'mma need to sleep. I'll have a go at implementing dungeon terrain tomorrow, after cramming a foreign language into my brain.
23:17
<&Derakon>
Reiv: though depending on your ultimate goals, having loops that you don't know about can be problematic.
23:18
<@Reiv>
Derakon: Truth, but as you say, that's a tweaking thing
23:18
<&Derakon>
Yep.
23:19 * Derakon sets the microscope to generate a 1.2TB file of raw 256x240 images of static.
23:19
<@Reiv>
That's a pretty rubbish resolution
23:19
<&Derakon>
10 meeelion images.
23:19
<&Derakon>
It's a speed tradeoff.
23:20
<&Derakon>
At this size we can hit 365 frames per second.
23:22
< Shiz>
&McMartin â I'm not equipped to evaluate it personally but it has been recommended by many
23:22
< Shiz>
I've seen it discouraged by many
23:23
< Shiz>
(haven't read it personally either)
23:33
<&McMartin>
I looked at it just enough to realize that it would teach windows users an alien environment, and that it was more interested in teaching the discipline of programming than anything else.
23:33 * Derakon overhears his boss asking a coworker "Is there a possibility that coming in over Dropbox, a bit could be flipped?"
23:33
<&McMartin>
An awful lot of hackers assume that programming discipline is innate. I'm kind of one of them, but I recognize it as a baseless assumption~
23:41 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has joined #code
23:41 mode/#code [+o Alek] by ChanServ
23:50 Derakon [chriswei@Nightstar-4k2ccr.ca.comcast.net] has quit [[NS] Quit: leaving]
23:51 Vornicus [Vorn@Nightstar-28h42k.sd.cox.net] has joined #code
23:52 mode/#code [+qo Vornicus Vornicus] by ChanServ
23:58 himi [fow035@Nightstar-q9amk4.ffp.csiro.au] has joined #code
23:58 mode/#code [+o himi] by ChanServ
--- Log closed Thu Dec 12 00:00:16 2013
code logs -> 2013 -> Wed, 11 Dec 2013< code.20131210.log - code.20131212.log >

[ Latest log file ]