code logs -> 2010 -> Thu, 20 May 2010< code.20100519.log - code.20100521.log >
--- Log opened Thu May 20 00:00:05 2010
00:01 Orth [orthianz@Nightstar-d0fae587.xnet.co.nz] has joined #code
00:03 Reiv[Graduate] [orthianz@Nightstar-ec195f1d.xnet.co.nz] has quit [Ping timeout: 121 seconds]
00:04 Derakon [Derakon@Nightstar-1ffd02e6.ucsf.edu] has quit [[NS] Quit: Leaving]
00:19 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
00:41 Derakon[AFK] is now known as Derakon
00:43 You're now known as TheWatcher[T-2]
00:48 You're now known as TheWatcher[zZzZ]
00:55 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
01:51 Orth [orthianz@Nightstar-d0fae587.xnet.co.nz] has quit [Connection reset by peer]
01:57 Reiv[Graduate] [orthianz@Nightstar-d0fae587.xnet.co.nz] has joined #code
02:13 Reiv[Graduate] [orthianz@Nightstar-d0fae587.xnet.co.nz] has quit [Connection reset by peer]
02:20 Reiv[Graduate] [orthianz@Nightstar-d0fae587.xnet.co.nz] has joined #code
02:22 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
02:38 Reiv[Graduate] [orthianz@Nightstar-d0fae587.xnet.co.nz] has quit [Client closed the connection]
02:40 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
02:41 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
02:45 Reiv[Graduate] [orthianz@Nightstar-d0fae587.xnet.co.nz] has joined #code
03:15 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
03:16 Syloq is now known as Syloqs-AFH
03:54 Orth [orthianz@Nightstar-66723e38.xnet.co.nz] has joined #code
03:56 Reiv[Graduate] [orthianz@Nightstar-d0fae587.xnet.co.nz] has quit [Ping timeout: 121 seconds]
04:00 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
04:22
<@Derakon>
Hrm...now I can't install Numpy because it's trying to pass -Wno-long-double to gcc, which doesn't recognize that option.
04:27 * Derakon symlinks gcc-4.0 to gcc, and now it works.
04:27
<@Derakon>
I shouldn't have to pull this kind of crap. ¬.¬
04:31
<@Derakon>
And after all that, I've gotten PyOpenGL-accelerate installed and I still get terrible performance.
04:37 Orth [orthianz@Nightstar-66723e38.xnet.co.nz] has quit [Connection reset by peer]
04:45 Reiv[Graduate] [orthianz@Nightstar-66723e38.xnet.co.nz] has joined #code
05:00 * Derakon logs onto #python on Freenode to ask a question, ends up answering other peoples' questions instead. ¬.¬
05:04
<@Vornicus>
Funny how that happens.
05:04 * Rhamphoryncus finds himself trying to reinvent alias analysis. Weeee
05:06
<@McMartin>
You know, there's like 30 years of research on this.
05:07
<@McMartin>
How precise do you need it? Steensgard is fast, simple, and is often good enough if you just need to make sure you're not missing any possibilities.
05:08
< Rhamphoryncus>
Well, I'm applying it to python. I need to start out knowing nothing of the code (not even what functions will be called or what possible types are), then expanding as I explore more
05:09
< Rhamphoryncus>
Incremental
05:09
< Rhamphoryncus>
And I need to do it alongside the other evaluations, so I can use it to determine what mutations affect what variables
05:12
< Rhamphoryncus>
Plus my math background is weak, so an overly technical explanation goes over my head
05:13
<@Derakon>
That reminds me. Topic seen on GameDev.net's forums: "Mathematics and Programming: Are they related in some way?"
05:13
< Rhamphoryncus>
heh
05:13
< Rhamphoryncus>
Not as much as some people think :P
05:19
<@McMartin>
Apparently, MS's HR researchers found that the strongest correlation to programming skill is musical ability.
05:25
<@Vornicus>
Which explains the operatic tenor at Resmark.
05:54
<@McMartin>
Rhamphoryncus: Steensgard is an algorithm, not a program.
05:54
<@McMartin>
Target language is irrelevant, except to the extent of what makes a pointer count as a pointer.
05:55
< Rhamphoryncus>
I realize that
05:55
<@McMartin>
Python's easier than C that way because there's no need to model arithmetic, but it's worse than C in that Everything Is A Pointer.
05:55
< Rhamphoryncus>
No need to model arithmetic?
05:56
<@McMartin>
For any indexable object, you know its bounds, or at least that it has them. You can do various abstractions on that without polluting The Entire Heap.
05:57
< Rhamphoryncus>
hrm
05:57
<@McMartin>
I would suggest collapsing - that is, treating as potentially aliased - anything that goes into the same list.
05:59
< Rhamphoryncus>
For lists I want to treat a certain number of elements as distinct. Same as tuples
05:59
<@McMartin>
Modeling pop() will suck for you
05:59
< Rhamphoryncus>
yup
06:00
<@McMartin>
This is why I'd start with something a little simpler
06:00
< Rhamphoryncus>
and append
06:00
<@McMartin>
Append is easy since it doesn't change who's indexed as what; it's just an assignment, assuming you know the length of the list.
06:00
<@McMartin>
If you *don't*, because the append is in a list, you seriously shouldn't be doing this as a static analysis.
06:00
<@McMartin>
*in a loop
06:00
< Rhamphoryncus>
I don't think I'm on the same page
06:01
<@McMartin>
Append is much easier than pop, because it does not change aliasing.
06:01
< Rhamphoryncus>
I don't think I understand steensgard yet :P
06:01
<@McMartin>
Basically, it's a progressive union operation
06:02
< Rhamphoryncus>
An eager merging of them
06:02
<@McMartin>
The first alias analysis you write should be neither flow- nor context-sensitive.
06:02
<@McMartin>
This is because you want it to finish before the next Presidential election.
06:03
<@McMartin>
Also, a friendly reminder that working, efficient, accurate, novel pointer analysis techniques are still the kinds of things that people get Ph.D.s for working out
06:04
< Rhamphoryncus>
I'm trying to avoid being novel, within my limitations ;)
06:04
< Rhamphoryncus>
I don't understand what you said about append. Append is a mutation of the list, just the same as pop
06:05
<@McMartin>
If you have an optional a.pop(), then a[0] and [1] suddenly can alias, where with an optional append, this is not true
06:05
<@McMartin>
I don't suppose you've run into the http://www.cs.sunysb.edu/~liu/papers/Alias-TR10.pdf paper yet~
06:05
< Rhamphoryncus>
that's a.pop(0). a.pop() defaults to the last element
06:06
< Rhamphoryncus>
nope
06:06
<@McMartin>
Oh. Yeah, pop(None) is boring~
06:07 * McMartin flips through the cited works list on that paper (first hit for "Python alias analysis")
06:07 * McMartin finds himself.
06:07
<@Derakon>
How zen.
06:08
< Rhamphoryncus>
My concern is that "x = []; x.append(7)" creates an alias, so that the append would show up under the original assignment to x, which then propagates to the append...
06:08
<@McMartin>
whatever node is modeling x there shouldn't change...
06:09
< Rhamphoryncus>
Why wouldn't it? It's in the list of aliases.
06:09
< Rhamphoryncus>
s/list of/set of/
06:09
<@McMartin>
Aliases for what? x, x[0], or 7?
06:09
< Rhamphoryncus>
x
06:10
<@McMartin>
x is assigned once in that code, with a constructor, basically.
06:10
<@McMartin>
x.append doesn't make a new x, it changes some internals.
06:10
<@McMartin>
x may cause its elements to relate to each other, btu they're never aliased with x unless you assign x as one of its own elements
06:10
< Rhamphoryncus>
x.append looks up the aliases for x and mutates all of them
06:11
<@Derakon>
Wouldn't that be expected of any alias of a pointer object?
06:11
<@McMartin>
Er
06:11
<@McMartin>
If you're doing this right, once two things alias, they become the same thing.
06:11
< Rhamphoryncus>
What I'ms aying is that "x = []; x.append(7)" becomes "x = [7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]" and so on, as well as all shorter versions
06:12
<@McMartin>
You're not using the word "alias" right.
06:12
< Rhamphoryncus>
Quite possible :)
06:12
<@McMartin>
You're trying to do symbolic execution or something.
06:12
< Rhamphoryncus>
I'm doing a lot of things simultaneously
06:13
<@McMartin>
Yes, this is because you can't represent the results of an alias analysis alone sanely, but you need pointer information to do anything fun in any real language.
06:13
<@McMartin>
It's better to cast it as "points-to"
06:13
<@McMartin>
"given a pointer variable x at a program point y, which memory cells can it be referencing"
06:13
<@McMartin>
For the code you just gave, there's exactly one answer to that; "an array"
06:14
<@McMartin>
You seem to want to answer the question "what is inside x"
06:14
<@McMartin>
In the general case this is of course undecidable
06:15
< Rhamphoryncus>
no, what I want is to treat it like the tuple-equivalent when possible: "x = []; x = x + [7]"
06:15
<@McMartin>
Forest. Trees.
06:15
<@McMartin>
Top level, what are you trying to do.
06:15
<@McMartin>
Why does it need pointer information.
06:16
<@McMartin>
How can you make it, when it inevitably, as is philosophically mandatory, approximates, approximate in a direction that won't wreck your results
06:16
< Rhamphoryncus>
And I'm trying to establish that NOT doing so is normal behaviour for alias analysis. I want to make sure I understand it right, so I can deviate appropriately
06:16
<@McMartin>
Alias analysis doesn't work at that level
06:16
<@McMartin>
Alias analysis is the question "given a program point p and two pointer variables x and y, can x and y point to the same thing"
06:16
< Rhamphoryncus>
does work meaning? It sucks and produces useless info?
06:17
< Rhamphoryncus>
doesn't*
06:17
<@McMartin>
That depends entirely on what you're doing!
06:17
<@McMartin>
No, as in "it works on an entirely different level from the problem you ask"
06:17
<@McMartin>
works as in "operates, does its job, thinks, has concepts relating to this"
06:18
<@McMartin>
This is why I'm asking what your top level question/problem is, so you can drill down and maybe we'll see why you think you need this, and thus what sort of analysis you need.
06:18
<@McMartin>
Note that you're probably fucked if you actually need program understanding levels of precision, as this paper I pulled up is work from a team of five graduate-level CS program analysis researchers and the results here are at most a month and a half old
06:19
<@McMartin>
Which is to say "the state of the art for dynamic languages like Python simply isn't there yet"
06:19
<@McMartin>
That doesn't mean the actual problem you want to solve isn't soluable, but it may need alternate techniques
06:20
< Rhamphoryncus>
I'm doing abstract interpretation. I can do immutable types, like ints and tuples, but the same approach won't work for lists which are mutated in place
06:20
< Rhamphoryncus>
Well yeah, that's why I'm doing it
06:20
< Rhamphoryncus>
Everybody acts like you can't do a python compiler, but nobody can back it up with a reason why. So I'm doing one
06:21
<@McMartin>
What you can't do yet without several Ph.Ds worth of work is an optimizing Python compiler.
06:21
<@McMartin>
That has more than peephole optimizations
06:22
<@McMartin>
Which could be significant! Especially if your code is single-threaded
06:22
< Rhamphoryncus>
Yeah, I really should publish some of my ideas :P
06:22
<@McMartin>
Well, you need a prototype
06:23
< Rhamphoryncus>
building it
06:23
<@Vornicus>
YOu can certainly write a thing that takes your Python source code, follows its paths through CPython, and turns that into a runnable machine code program. But proving the types of things in even the simplest of functions is an exercise in shrieking horror, possibly illustrated by Bosch and Giger at the same time.
06:23
< Rhamphoryncus>
Vornicus: it's fun.
06:24
<@McMartin>
I would suggest various simplifying assumptions
06:24 AnnoDomini [annodomini@Nightstar-40f51dd9.adsl.tpnet.pl] has joined #code
06:24
<@McMartin>
"The global namespace is reassignable dynamically" is a good reason why most traditional optimizations can't function sensibly in the presence of multithreaded or dynamically loaded classes.
06:24 mode/#code [+o AnnoDomini] by Reiver
06:24
<@McMartin>
So there are some reasons for you
06:24
< Rhamphoryncus>
naw, I've got that covered already
06:25
< Rhamphoryncus>
I can handle globals just as well as locals
06:25
<@McMartin>
Well, it means that you can't snap pointers, a usual major advantage to type analysis in something like C++.
06:25
< Rhamphoryncus>
Well, that's a little terse. They use a different approach with different strengths and weaknesses
06:25
< Rhamphoryncus>
snap pointers?
06:26
<@McMartin>
Basically, if you have something like a.f() in C++ or Java, and f() is a virtual function, you have to load an address and then jump to it, which is a longish process and it trashes your execution cache.
06:26
<@McMartin>
(It also greatly complicates things like pointer analyses)
06:27
< Rhamphoryncus>
Oh, that I should handle just fine
06:27
<@McMartin>
If you can prove that a is exactly one specific type, then you can treat a.f() as if it were a static method invocation, because you know exactly where it goes.
06:27
<@McMartin>
If you can reliably do that for Python - and the stock Python interpreter is known to be horrible at this - you can remove a huge amount of wasted work just in the terp.
06:28
< Rhamphoryncus>
Unless the entire heap gets merged into one alias class, which of course would ruin everything
06:29
<@McMartin>
That's a common risk, yes, and which is also why I was asking what your goal was
06:29 * Rhamphoryncus nods
06:29
<@McMartin>
In your case, it's safer to say "anything from outside the function could be fucking anything"
06:29
<@McMartin>
And then focus deeply on intraprocedural work, being at minimum flow-sensitive and maybe even path-sensitive (but don't start with path sensitivity!)
06:30
<@McMartin>
Not having to perform two typechecks when evaluating 2+2 alone would be a plus
06:30
<@McMartin>
Of course, this has already been done elsewhere
06:30
<@McMartin>
http://code.google.com/p/unladen-swallow/wiki/ProjectPlan
06:30
< Rhamphoryncus>
I'm doing whole program. It's fundamental to my project
06:30
< Rhamphoryncus>
There's far too little benefit to just JITing 2+2
06:31
<@McMartin>
Do you have any intent of finishing within the next five years?
06:31
<@McMartin>
Or are you misusing "whole program"
06:31
<@McMartin>
If you want to do whole-program python analysis, apply to grad school, they'll pay you to work on it
06:31
< Rhamphoryncus>
Then I'd have to go to school. Maybe if I got medicated I'd see that as a decent option, but for now I'll continue on my own
06:32 Derakon is now known as Derakon[AFK]
06:33
<@McMartin>
I would continue to urge you in the strongest terms to find a Python optimization project and try to affiliate yourself with it; it will give you a much stronger baseline to work with and provide a reasonable chance that what you do will be actually used
06:33 * Vornicus tries to figure out where they went - there isn't a q4 '09 release for unladen swallow yet, apparently
06:33 * Rhamphoryncus has aspergers as well as some undiagnosed social phobia and depression issues
06:33
< Rhamphoryncus>
McMartin: "it's hard, don't even try"
06:34
<@McMartin>
That's no reason not to be using their codebase.
06:35
<@McMartin>
Then if you finish 10 years later it becomes a plausible patch instead of "this doesn't fit anyone's workflow, into the trash with it"
06:35
< Rhamphoryncus>
Their codebase does nothing for the ideas I want to explore
06:37
<@McMartin>
OK; just don't be surprised if you're the only person who uses your end product.
06:37
<@McMartin>
Anyway, if you're doing abstract interpretation, your life is actually quite a bit easier.
06:37
<@McMartin>
Since at any point in the "state" all variables have values of some kind - you *know* the aliasing information at that point in your simulation.
06:37
< Rhamphoryncus>
I know full well it's an insane project, making it incredibly risky in that it's unlikely to produce a viable result
06:39
<@McMartin>
You don't need a traditional alias analysis because you're getting the relevant information as a side effect already - some alias analyses basically are abstract interpreters that pay attention to nothing but pointer assignments.
06:39
< Rhamphoryncus>
yeah
06:39
<@McMartin>
That said, "whole program" and "abstract interpreter" don't mix sensibly; when they do we just call it an "interpreter" and it runs the program. Where's your abstraction happening?
06:40
< Rhamphoryncus>
when they do we?
06:41
<@McMartin>
comma between "do" and "we"
06:41
< Rhamphoryncus>
It's abstract in that my values are sets of possible values, only occasionally just one possible value
06:41
<@McMartin>
we here is the editorial we
06:41
<@McMartin>
This implies that you're doing some bits intraprocedurally and then combining those later in a separate analysis
06:41
<@McMartin>
Building method summaries or something
06:42
< Rhamphoryncus>
In a sense, but it's not separate. It's simultaneous and functions feed back on each other
06:43
<@McMartin>
The usual way this is modeled is as two analyses that iterate together to a fixed point
06:43
< Rhamphoryncus>
kinda like that, yeah
06:44
<@McMartin>
The classical model here is:
06:44
<@McMartin>
- start with the most conservative possible summaries
06:45
<@McMartin>
- use those to build your first more precise summaries, having your analysis "throw out" things that can't be possible. Apply your base summaries at first.
06:45
<@McMartin>
- Now you haev a new, better set of summaries. Keep doing this until they stop getting better or you get too impatient to continue.
06:46
<@McMartin>
One major danger here is that representing the summaries can start requiring absurd amounts of space.
06:46
< Rhamphoryncus>
conservative as in assuming everything is possible?
06:46
<@McMartin>
For some limited value of "everything"
06:47
< Rhamphoryncus>
Yeah, I'm doing the opposite. I start with assuming nothing is possible, then expand on that
06:47
<@McMartin>
Then your intraprocedural part can say "no, this isn't everything, it's one of these three things"
06:47
<@McMartin>
Same deal; just changes what "everything" means~
06:47
<@McMartin>
In the alias analysis world, that's the distinction between "may-alias" and "must-not-alias" - there isn't one.
06:48 * Rhamphoryncus nods
06:48
<@McMartin>
"may-alias" vs. "must-alias", on the other hand, are worlds apart, and must-alias analyses basically always produce useless results.
06:49
<@McMartin>
Meanwhile, the cousin analysis points-to, "let's only pay attention to points-to sets of size 1" turns out to yield lots of bennies.
06:49
<@McMartin>
Things like Rapid Type Analysis end up being based on that, and they have *huge* benefits for virtual method resolution &c
06:50
< Rhamphoryncus>
yeah
06:50
<@McMartin>
That's "do a may-alias analysis and then only look at part of the results"
06:50
<@McMartin>
Must-alias turns out to be the wrong question, as it were.
06:51
< Rhamphoryncus>
I can see uses for must-alias, but there's much simpler ways to get the same result
06:51
< Rhamphoryncus>
hrm, getting things swapped around, heh
07:08 * Vornicus args. Housesitting was supposed to get him away from the distractions at home so he could concentrate on the things that he actually wanted to do, but it doesn't seem to be working at all, because he's missing all his /tools/
07:57 * Vornicus examines his existing Settlers art, anyway. Really don't like the "shield" for Soldier.
08:11
<@Vornicus>
Nor, really, either trophy - they should be more colorful.
08:31 Alek [omegaboot@Nightstar-c5f3565b.il.comcast.net] has quit [Ping timeout: 121 seconds]
08:35 Alek [omegaboot@Nightstar-c5f3565b.il.comcast.net] has joined #code
08:48 You're now known as TheWatcher
09:17 Vornicus is now known as Vornicus-Latens
09:29 AnnoDomini [annodomini@Nightstar-40f51dd9.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
09:32 AnnoDomini [annodomini@Nightstar-40f51dd9.adsl.tpnet.pl] has joined #code
09:32 mode/#code [+o AnnoDomini] by Reiver
10:58 Orth [orthianz@Nightstar-b1e79952.xnet.co.nz] has joined #code
11:01 Reiv[Graduate] [orthianz@Nightstar-66723e38.xnet.co.nz] has quit [Ping timeout: 121 seconds]
11:07 Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has quit [Client exited]
12:47 Orth [orthianz@Nightstar-b1e79952.xnet.co.nz] has quit [Connection reset by peer]
12:55 Reiv[Graduate] [orthianz@Nightstar-b1e79952.xnet.co.nz] has joined #code
13:03 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
13:11 Reiv[Graduate] [orthianz@Nightstar-b1e79952.xnet.co.nz] has quit [Connection reset by peer]
13:25 Reiv[Graduate] [orthianz@Nightstar-b1e79952.xnet.co.nz] has joined #code
13:28 Reiv[Graduate] [orthianz@Nightstar-b1e79952.xnet.co.nz] has quit [Client closed the connection]
13:40 Reiv[Graduate] [orthianz@Nightstar-93775660.xnet.co.nz] has joined #code
13:45 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
14:06 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
14:20
<@ToxicFrog>
Vornicus-Latens: keep all of your tools on a server you can get into from anywhere.
14:21
< Reiv[Graduate]>
I should really do that with Eclipse at some point.
14:22 * Reiv[Graduate] wonders vaugely whether there's some way to have a file kept synchronised with a web app via HTTP/HTTPS or the like.
14:22
< Reiv[Graduate]>
(SVN is great, but not when you cannot get hold of fancy software or defeat arcane firewalls)
14:23
< Namegduf>
I'd suggest getting your own laptop or something if you're often in such a situation.
14:23
< Namegduf>
And you can't use your own software.
14:24
< Reiv[Graduate]>
Lovely wishful thinking on that one, but the general principle is good.
14:28
<@ToxicFrog>
Reiv[Graduate]: run ssh on your home machine listening on the HTTPS port.
14:28
<@ToxicFrog>
This lets you use git/X11/sshfs directly, and if you must use SVN you can tunnel it over that.
14:28
< Reiv[Graduate]>
TF: How would I use that to, eg, rig my Eclipse working directory to be autosync'd
14:29
< Reiv[Graduate]>
I've been living off pastie, but that solution is very fragile.
14:29
<@ToxicFrog>
I'm not sure I understand the question; when I say "keep all your tools on the server" I mean all of your programs + files are on one remote machine, and you just display the programs wherever you happen to be.
14:30
<@ToxicFrog>
You're talking about running stuff locally, but storing the files centrally, syncing them down when you start working and back up when you're done?
14:30
< Reiv[Graduate]>
Oh! I see.
14:31
< Reiv[Graduate]>
Yes, the latter - Eclipse does not SSH well, and I admit I rather like its utilities.
14:31
<@ToxicFrog>
If your remote system is running Linux (or Solaris), look into using NX.
14:31
<@ToxicFrog>
Eclipse works just fine in that, and the nxclient plays nice with portableapps.
14:31
<@ToxicFrog>
(or, well, the windows and linux versions do; the OSX version is screaming madness)
14:32 * celticminstrel idly wonders how one goes about writing an IRC bot in python...
14:32
<@ToxicFrog>
However, that doesn't really answer the question you actually asked~
14:32
< PinkFreud>
OSX in general is screaming madness, unless you do things Apple's Way.
14:35
<@ToxicFrog>
And to that - like I said earlier, if you set up your sshd to listen on https, you may be able to get at it. At that point, if you're running linux you can just mount your home system directly, and if not you can still use stuff like filezilla to transfer files - or, better yet, do your version control over ssh. (git supports ssh:// repos, svn may need tunneling)
14:37
<@ToxicFrog>
If we assume you're working on (say) lab machines where you don't have install or mount rights, sshfs is out, but you can still fit enough tools on a USB key to reach home - if the lab machines are running windows just slap cygwin-portable on there and rock out.
14:41 * ToxicFrog pokes Reiv[Graduate]. What resources do you have to work with?
14:41
< Reiv[Graduate]>
Uh. Windows XP.
14:42
< Reiv[Graduate]>
On which I've recieved permission to have Eclipse installed, and can probably run software on my USB stick so long as it goes via HTTP.
14:43
<@ToxicFrog>
And at home?
14:43
< Reiv[Graduate]>
Windows XP, but the freedom to install what I want.
14:43
<@ToxicFrog>
(do they expect you to keep all of your stuff on a USB stick or something?)
14:43
< Reiv[Graduate]>
(No, they give me a home drive, but its web access is /severely/ clunky.)
14:44
<@ToxicFrog>
(aah)
14:44
< Reiv[Graduate]>
(Else I'd just save everything onto there and map it as a network drive.)
14:44
<@ToxicFrog>
And you mentioned having SVN set up?
14:44
< Reiv[Graduate]>
No, I mentioned being afraid of SVN, as in my experience it seems highly fragile unless you've got a really solid server behind it.
14:45
< Reiv[Graduate]>
AKA: Having it constantly fall over for inexplicable reasons any time the IP changed, etc. (Dynamic IP = woe.)
14:46
<@ToxicFrog>
(you don't have dyndns? Or you do, but svn broke whenever the IP it resolved to changed?)
14:46
< Reiv[Graduate]>
(The latter, though the former is now true also. I should get that re-established~)
14:47
< Reiv[Graduate]>
This was mostly a general grumble that was vaugely hoping there was an Obvious Solution I'd Missed; if I wanted to set it up properly I should probably have done it weeks ago, not when I have a final assignment I'm working on. >_>
14:49
<@ToxicFrog>
Well, my Obvious Solution is "store nothing on the lab machine, not even tools; install NX at home and nxclient on a USB stick and just use the lab machines as dumb terminals"
14:49
<@ToxicFrog>
But this rather depends on having linux at home.
14:49
< Reiv[Graduate]>
Alas, yes.
14:50
< Reiv[Graduate]>
Also being proficient in the damn thing~
14:50
< Serah>
Dualboot?
14:50
<@ToxicFrog>
However, Cygwin does come with an ssh server.
14:50
<@ToxicFrog>
(NX is really, really easy to set up)
14:51
<@ToxicFrog>
As Serah points out you could always set up your home machine to dual boot and then proceed as above.
14:51
<@ToxicFrog>
Failing that, what I'd probably do is:
14:51
<@ToxicFrog>
- install cygwin on your home machine if you haven't already. Make sure sshd and git are installed.
14:51
< Namegduf>
SSH tunnel rdesktop?
14:52
<@ToxicFrog>
- enable the ssh server. Confignure it to listen on 443 so the campus firewall lets it pass as https traffic.
14:52
<@ToxicFrog>
- put cygwin-portable on your USB stick.
14:52
<@ToxicFrog>
Now you can:
14:52
<@ToxicFrog>
(a) use git to keep your stuff in sync remotely
14:53
<@ToxicFrog>
(b) use ssh to log in remotely if more control is needed
14:53
<@ToxicFrog>
(b.1) use ssh to tunnel other protocols if needed
14:57
< Reiv[Graduate]>
hn.
14:57
< Reiv[Graduate]>
I shall bear this in mind.
14:58
< Serah>
I think the easiest way to do anything is probably to tunnelt the protocols as TF and NGD suggests.
14:59
< Reiv[Graduate]>
OTOH given I am not actually /at/ home, I shall for the moment busy myself with the vagaries of setting up a proper Regular Grammar.
14:59
<@ToxicFrog>
Right.
14:59
<@ToxicFrog>
I do think that long-term, setting it up to dual boot (or scavenging an old P2 and turning it into a version control/file server) is the right answer.
14:59
< Reiv[Graduate]>
Or possibly the Context Free Grammar first. *dives into the paperwork to work out which one you do first*
14:59
< Reiv[Graduate]>
I am inclined to agree, but it's a little beyond my current quickfix capabilities.
15:00
<@ToxicFrog>
I don't think it's as hard as you think it will be :)
15:00
< Reiv[Graduate]>
Well, once I have the grammar, I write the parser
15:00
<@ToxicFrog>
But the quickest way, if only because you don't need to wait for the partitions to resize, is to install cygwin and enable sshd.
15:00
< Reiv[Graduate]>
Once I write the parser, I write the compiler
15:00
< Reiv[Graduate]>
Once I have the compiler, it has to actually run the FSM correctly~
15:00
<@ToxicFrog>
Writing the regexes first is generally the way to go, because then you can write a lexer and make sure it's splitting the input into tokens properly.
15:01
<@ToxicFrog>
Or, well, no, I lie
15:01
< Reiv[Graduate]>
I do have an elderly PIII laptop; it may be that I eventually set /that/ up as a server if only becaus AFAICT a laptop is going to suck less juice and take up less space than my old compaq desktop.
15:01
<@ToxicFrog>
Writing the lexer before the parser is good. When designing the actual language, writing the grammar first is probably the way to go, but I'm not willing to state that as a universal rule.
15:01
<@ToxicFrog>
Are you compiling an existing language, or designing your own?
15:03
< Reiv[Graduate]>
http://www.cs.waikato.ac.nz/~tcs/COMP317/Assignments/assign4-2010.html
15:04
< celticminstrel>
...flying spaghetti monster compiler?
15:04
<@ToxicFrog>
Finite State Machine.
15:05
< Namegduf>
I prefer celticminstrel's interpretation
15:05
< celticminstrel>
Is finite state machine what most of those esoteric languages are?
15:05
< Reiv[Graduate]>
I have every expectation my code will get plenty spagetti'd, yes. ¬¬
15:06
< Reiv[Graduate]>
FSMs = regex
15:06
<@ToxicFrog>
Reiv[Graduate]: ok, your lexer is going to be really simple (basically just handling \escapes). I'd start with the CFG - take the definition of regex format they give there and translate it into a grammar.
15:07
<@ToxicFrog>
Then you do the lexer, then you do the parser on top of that, then you get it to generate and execute an FSM.
15:07
< Reiv[Graduate]>
Righto. Hm.
15:08 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
15:08
<@ToxicFrog>
celticminstrel: a finite state machine is a machine that at any point is in one of a finite number of states. It chooses the next state to assume based on the current state + the input.
15:09 * celticminstrel wants to say "Turing machine".
15:09
< Namegduf>
It's a very generic and flexible model for most kinds of system or software; gets ridiculously complex for a lot of software as a whole, though.
15:10
<@ToxicFrog>
A turing machine is a finite state machine, yes.
15:10
<@ToxicFrog>
Most regular expression matchers are implemented as FSMs, too, because they translate very naturally to each other.
15:12
< celticminstrel>
But not all FSMs are Turing machines then.
15:14 * Reiv[Graduate] thinks. Context Free Grammars allow sillyness like (E) and FE, yes?
15:14
< Reiv[Graduate]>
While Regular Grammars must have only one terminal, and it must indeed be at the end.
15:16
<@ToxicFrog>
Reiv[Graduate]: you're going to have to expand on "sillyness like (E) and FE", I think
15:17
< Reiv[Graduate]>
Expression and Factor, there. Give me a few while I have an actual stab at this thing.
15:19
<@ToxicFrog>
With CFGs, your basic operations are:
15:19
<@ToxicFrog>
nonterminal -> [list of terminals and nonterminals]
15:21
< Reiv[Graduate]>
(Oh, sorry. Nonterminal, my bad.)
15:21
<@ToxicFrog>
and ? mates the empty string.
15:21
<@ToxicFrog>
(your terminals are typically defined by the lexer)
15:21
<@ToxicFrog>
So you might have something like:
15:21
<@ToxicFrog>
S -> ? # the empty string is a valid program
15:22
<@ToxicFrog>
S -> expr-list
15:22
<@ToxicFrog>
expr-list -> expr expr-list
15:22
<@ToxicFrog>
expr-list -> ?
15:22
<@ToxicFrog>
expr -> expr OP expr
15:22
<@ToxicFrog>
expr -> '(' expr ')'
15:22
<@ToxicFrog>
expr -> NUMBER
15:23
<@ToxicFrog>
That could probably be cleaned up a bit, and in practice you'll also see it written as:
15:23
<@ToxicFrog>
expr -> expr OP expr | '(' expr ')' | NUMBER
15:27
< celticminstrel>
... I notice the assignment doesn't mention +
15:28
<@ToxicFrog>
celticminstrel: a+ is equivalent to aa*
15:28
< celticminstrel>
True.
15:29
<@ToxicFrog>
We're rocking formal proper regular expressions here, not the everything-but-the-kitchen-sink versions present in most languages/programs
15:29
< celticminstrel>
POSIX-style rather than Perl-style, right?
15:29
<@ToxicFrog>
Er, no
15:29
<@ToxicFrog>
POSIX BREs and EREs contain a lot of extensions.
15:30
< celticminstrel>
Well, anyway, the "everything-but-the-kitchen-sink" ones are the Perl-style ones.
15:30
<@ToxicFrog>
...
15:30
<@ToxicFrog>
You're missing my point
15:30
< celticminstrel>
No, I get your point.
15:30
< celticminstrel>
This is an implementation of just basic regular expressions.
15:30
< celticminstrel>
Such as the ones supported by Apache.
15:31
< celticminstrel>
...though without backreferences.
15:31
<@ToxicFrog>
...
15:32
< celticminstrel>
...fine. If you think I've missed your point, explain. 9_(
15:32
< celticminstrel>
9_9
15:32
<@ToxicFrog>
Regular expressions have exactly four operations: concatenation, alternation, grouping, and the Kleene star.
15:33
<@ToxicFrog>
Regular expressions as implemented in most programs add a lot of stuff not present in the formal definition.
15:33
< celticminstrel>
This assignment also includes the anchors and the ? operator though.
15:33
< celticminstrel>
Plus wildcards and [a-z] types.
15:33
<@ToxicFrog>
These include convenience macros like ? $ ^ + [] .
15:34
<@ToxicFrog>
And stuff that makes it not regular anymore, like backrefs.
15:34
< celticminstrel>
How does it include ^ and $ ? I can understand how it includes ? + [] .
15:34
< celticminstrel>
Oh, never mind.
15:34
< celticminstrel>
I misinterpreted that sentence.
15:34
<@ToxicFrog>
formal regex abc == program regex ^abc$
15:35
< celticminstrel>
Um.
15:35
< celticminstrel>
So, your "formal regex" matches the entire input by definition?
15:35
<@ToxicFrog>
...yes? The regular expression "abc" describes the language consisting of the single string "abc".
15:36
<@ToxicFrog>
The regex "aa*" describes the laguage consisting of all strings of one or more "a" characters.
15:36
< celticminstrel>
Well, anyway, that assignment clearly isn't implementing formal regex.
15:37
<@ToxicFrog>
I'm pretty sure it's still regular.
15:37 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
15:37
< celticminstrel>
What?
15:38
< Namegduf>
You should use an NFA
15:38
< Reiv[Graduate]>
celticminstrel: It mentions + by way of using []
15:38
< Reiv[Graduate]>
And also |, though I am honestly a little puzzled by that one
15:39
< celticminstrel>
What?
15:39
< celticminstrel>
What do you mean by that, Reiv?
15:39
<@ToxicFrog>
celticminstrel: I believe that the set of languages describable by what that assignment is exactly equivalent to the set of languages describable by Kleene regexes.
15:39
< Reiv[Graduate]>
Fri[02:27] <celticminstrel> ... I notice the assignment doesn't mention +
15:39
<@ToxicFrog>
Whereas, say, PCREs can describe languages which are not regular.
15:40
< celticminstrel>
Oh, "regular" is an adjective that describes a language type. Gotcha.
15:40
<@ToxicFrog>
Although it appears I was wrong and POSIX (B|E)REs are regular as well.
15:40
< celticminstrel>
I can certainly imagine a function to transform the regex of that assignment into Kleene regex.
15:40
<@ToxicFrog>
Yes. The set of regular languages is the set of languages describable by Kleene regular expressions.
15:40
<@ToxicFrog>
Similarly, the set of context-free languages is the set of languages describable by context free grammars.
15:41
< celticminstrel>
Reiv: Yes, but I didn't get what you just said?
15:41 Reiv[Graduate] [orthianz@Nightstar-93775660.xnet.co.nz] has quit [Client closed the connection]
15:41
< celticminstrel>
ToxicFrog: Isn't C neither of those?
15:41
<@ToxicFrog>
Pretty sure C is context-free.
15:42
<@ToxicFrog>
C++ might not be~
15:42
<@ToxicFrog>
(but don't quote me on that)
15:42
< celticminstrel>
Oh. Does context-free means what it sounds like? That is, a given token has the same meaning no matter where it appears?
15:45
<@ToxicFrog>
No.
15:45
<@ToxicFrog>
I can't really explain it clearly.
15:46
<@ToxicFrog>
Basically, in a context-free grammar, all productions are of the form:
15:46
<@ToxicFrog>
nonterminal -> expansion
15:46
<@ToxicFrog>
Whereas in a context-sensitive one, they can be:
15:46
<@ToxicFrog>
context nonterminal context -> expansio
15:48
<@ToxicFrog>
The wikipedia page on context-sensitive grammar explains it better than I can, really.
15:53 Reiv[Graduate] [orthianz@Nightstar-c43533f9.xnet.co.nz] has joined #code
15:53
< Reiv[Graduate]>
http://pastebin.starforge.co.uk/287 - Attempt #1 at a CFG that fufills the spec.
15:54
< Reiv[Graduate]>
... I missed wildcards, lol. Oops.
15:54
< Reiv[Graduate]>
And Infix, but that was because I wasn't sure how I'd do those.
15:54
< celticminstrel>
You mean | ?
15:54
< Reiv[Graduate]>
Pretty sure you're not allowed to have S -> E|E in a CFG.
15:55
<@ToxicFrog>
S -> E | E is meaningless.
15:55
<@ToxicFrog>
S -> E '|' E is perfectly legal.
15:55
< Reiv[Graduate]>
Uh. I meant | as being the infix operator.
15:55
<@ToxicFrog>
Yes.
15:55
<@ToxicFrog>
"one of the possible expansions for the nonterminal S is: the nonterminal E; a '|' character; the nonterminal E."
15:56
<@ToxicFrog>
Also.
15:56 * ToxicFrog beats Reiv[Graduate] with a keyboard
15:56
<@ToxicFrog>
NAMES
15:56
<@ToxicFrog>
SPELL 'EM OUT
15:56
< Reiv[Graduate]>
TF: Erk.
15:56
<@ToxicFrog>
DON'T USE SINGLE LETTERS FOR YOUR TERMINAL AND NONTERMINAL NAMES
15:56
< Reiv[Graduate]>
We were taught to use letters?
15:56
< Reiv[Graduate]>
In fact I'd never ever seen names used until you did it above?
15:57
<@ToxicFrog>
If you will lose marks for using more than one letter per nonterminal, then quietly edit it before handing it in.
15:57
<@ToxicFrog>
I will say that if I had given my compilers prof a grammar like that, even if it were 100% correct, he would have sent me a box of angry scorpions.
15:58
< Reiv[Graduate]>
snerk
15:58
<@ToxicFrog>
And you will note that if you read the reference manual for just about any language, the CFG will use full names for terminals and nonterminals.
15:58
<@ToxicFrog>
With the possible exception of the starting symbol S.
15:59
<@ToxicFrog>
Anyways. Rant over.
15:59
< Reiv[Graduate]>
Sorry, TF
15:59
<@ToxicFrog>
Concerning <Reiv[Graduate]> Pretty sure you're not allowed to have S -> E|E in a CFG.
15:59
< Reiv[Graduate]>
"11. | is an infix alternation operator such that if r and e are regexps, then r|e is a regexp that matches one of either r or e"
16:00
< Reiv[Graduate]>
I had thus presumed no '' thingies were needed.
16:00
<@ToxicFrog>
In the regex, no
16:00
<@ToxicFrog>
However, when specifying the grammar, | is usually special just as -> or epsilon are
16:00
< Reiv[Graduate]>
Oh.
16:00
<@ToxicFrog>
Eg, S -> expr | stat
16:00
<@ToxicFrog>
Is equivalent to:
16:00
<@ToxicFrog>
S -> expr
16:00
<@ToxicFrog>
S -> stat
16:00
< Reiv[Graduate]>
Aha. Did not know that.
16:01
<@ToxicFrog>
The typical convention is:
16:01
< Reiv[Graduate]>
(Yet another thing we weren't told. Yey.)
16:01
<@ToxicFrog>
terminal
16:01
<@ToxicFrog>
NONTERMINAL
16:01
<@ToxicFrog>
'exactly this text'
16:01
<@ToxicFrog>
So, for example, you get expr -> '(' expr ')' | expr BINARY_OPERATOR expr | NUMBER
16:02
<@ToxicFrog>
S -> E '|' E indicates "an S can produce an E, followed by a literal | character, followed by another E"
16:02
<@ToxicFrog>
As distinct from S -> E | E, which is "an S can produce an E, or it can produce an E" and a baffled look from your TA~
16:04 * TheWatcher arghs at browser DOM shit
16:04
< Reiv[Graduate]>
I think it is safe to assume that our TA will know the meaning, given this guy is the only guy that teaches this course, but duly noted at least in general terms.
16:05
< Reiv[Graduate]>
But a CFG can have S -> E '|' E ?
16:05
< Reiv[Graduate]>
I had thought you were only allowed the one of each thingy on a line.
16:05 * TheWatcher suspects he has broken something in opera, again
16:06
< Reiv[Graduate]>
Though in this case, I think it should actually be T -> E '|' E. That way you can parethenthesize and have, I dunno, abc([hjk]|h*)z?.
16:07
<@ToxicFrog>
That's totally legal.
16:08
<@ToxicFrog>
Well, it's legal as a CFG; some tools that take a CFG and generate a parser from it (or, rather, some algorithms for doing so) disallow it.
16:09
<@ToxicFrog>
Generally speaking, "the set of CFGs" is larger than "the set of CFGs accepted by my favorite parser generator"~
16:13 * Reiv[Graduate] is mostly trying to figure out precidence. Also whether he got the ^ and $ in the right place.
16:13
< Reiv[Graduate]>
Pretty sure they're right, but.
16:14
<@ToxicFrog>
I can't tell, because I can't read your grammar.
16:14
< Reiv[Graduate]>
Fair enough, let me expandinate it for you~
16:15
< Reiv[Graduate]>
It's NONTERMINAL -> Terminal ?
16:15
<@ToxicFrog>
terminal -> NONTERMINAL is the tradition I'm used to
16:15
< Reiv[Graduate]>
OK
16:15
<@ToxicFrog>
Err
16:15
<@ToxicFrog>
Sorry
16:15
<@ToxicFrog>
nonterminal -> TERMINAL or nonterminal -> Terminal
16:15
<@ToxicFrog>
But as long as you're consistent it doesn't matter a great deal which style you choose
16:20
< Reiv[Graduate]>
gah, routerboot
16:21 Orth [orthianz@Nightstar-ecead68a.xnet.co.nz] has joined #code
16:22
< Orth>
http://pastebin.starforge.co.uk/288
16:22
< Orth>
Is that better?
16:24
<@ToxicFrog>
...Term? TermExpr? Factor?
16:24 Reiv[Graduate] [orthianz@Nightstar-c43533f9.xnet.co.nz] has quit [Ping timeout: 121 seconds]
16:24
<@ToxicFrog>
Also, Factor* Closure? I'm having trouble distinguishing comments from grammar (and I think you mean Factor '*' there in any case)
16:25
< Orth>
OK, I probably need to put a '' around every single non-character there, yes.
16:25
< Orth>
Er. Non letter.
16:25
< Orth>
TermExpr was T -> TE, aka concatenation.
16:27
<@ToxicFrog>
Why is it called "TermExpr", and why is it a terminal?
16:27
< Orth>
It's a Term followed by the rest of an Expression.
16:27
<@ToxicFrog>
What is a Term?
16:27
<@ToxicFrog>
What is an Expression?
16:27
<@ToxicFrog>
What do these mean in the context of regular expressions?
16:28
<@ToxicFrog>
I mean, plausibly Expression == regex, but in that case why is it a terminal?
16:28
<@ToxicFrog>
(for that matter, why do you have a nonterminal expr and a terminal Expr?)
16:29
< Orth>
http://www.cs.waikato.ac.nz/~tcs/COMP317/pattern.txt
16:29
<@ToxicFrog>
I suspect that, at minimum, we have some terminology confusion :/
16:29
< Orth>
Phrase Structure Grammars deals with the stuff we were taught, you may be able to parse it into TFese.
16:30
<@ToxicFrog>
PSGs are a superset of context free grammars.
16:30
<@ToxicFrog>
They're basically all gramamars of the form: nonterminal -> expansion
16:31
<@ToxicFrog>
...a question. In the CFG you gave, is Expr meant to be the same thing as expr?
16:31
< Orth>
Other than possibly having buggered up my capitalisations, yes?
16:33
<@ToxicFrog>
Ok. Then we do have some terminology confusion.
16:33
<@ToxicFrog>
A terminal is something that cannot be broken down any further.
16:33
< Orth>
Also: It starts off on phrase structure, then the third paragraph after the example is CFGs, then after that is RGs just before the next heading for Regexs.
16:33
<@ToxicFrog>
Anything you get from the lexer is a terminal.
16:33
<@ToxicFrog>
A nonterminal is something that can be expanded further, and thus appears (somewhere) on the left side of a -> production.
16:33 Stryker [c0mand@Nightstar-bec1add2.dyn.optonline.net] has joined #code
16:34
<@ToxicFrog>
Take the simple grammar for parsing infix + expressions:
16:34
< Orth>
Righto. I've been having trouble keeping the terminology on those two clear; apologies.
16:34
<@ToxicFrog>
S -> expr
16:34
<@ToxicFrog>
expr -> expr + expr | '(' expr ')' | Number
16:34
<@ToxicFrog>
S and expr are nonterminals.
16:34
<@ToxicFrog>
'(' ')' and Number are terminals.
16:34
< Orth>
Aha! Righto.
16:34 * TheWatcher establishes that his popups work fine, except when the popup div structure appears inside a <p>...</p>, at which point opera completely fucks up the offsetWidth and offsetHeight and breaks everything ;.;
16:35
< Orth>
Carry on then
16:35
<@ToxicFrog>
Concerning PSG vs RGs vs regexes: PSGs, as noted, are any grammar of the form nonterminal -> expansion
16:35
<@ToxicFrog>
CFGs are a type of PSG
16:35 Stryker [c0mand@Nightstar-bec1add2.dyn.optonline.net] has quit [[NS] Quit: IRcap 8.6 ]
16:35
<@ToxicFrog>
RGs are also a type of PSG
16:35
<@ToxicFrog>
regexes are a more concise way of writing RGs
16:36
< Orth>
Right.
16:36
< Orth>
I was showing you that particular heading so you could see the bit I was trying to point you to, in order to make sure you could parse what I kept insisting on writing~
16:37
< Orth>
The syntax he uses in the example is the exact syntax we were expected to use. (Though he did mention 'you could just as cheerfully use triangles and squares for all that matters; it was the structure that was key, so what the heck')
16:37
<@ToxicFrog>
Syntax for PSGs, you mean?
16:38
<@ToxicFrog>
Ok, so it looks like the convention in use is NONTERMINAL, terminal, 'literal'
16:38
<@ToxicFrog>
Or possibly NONTERMINAL, Terminal, literal
16:38
<@ToxicFrog>
But that encounters disambiguation problems.
16:39
<@ToxicFrog>
And no |; that is to say, the above math example would have to be written as:
16:39
<@ToxicFrog>
S -> expr
16:39
<@ToxicFrog>
expr -> expr '+' expr
16:39
<@ToxicFrog>
expr -> '(' expr ')'
16:39
<@ToxicFrog>
expr -> Number
16:39
< Orth>
Right. (Though our assignment introduces us to |; it's the first we'd actually seen it.)
16:39
< Orth>
(This was apparently deliberate, to ensure We Were Kept On Our Toes.)
16:41
<@ToxicFrog>
The whole "a bit exhaustive to write out longhand' bit you have is generally the sort of thing considered the lexer's responsibility, btw
16:41
< Orth>
I realise that
16:41
< Orth>
I was just making sure I didn't get asked "Oi, what is V?"
16:44
<@ToxicFrog>
Well, having a proper name for it makes that anonissue :P
16:44
<@ToxicFrog>
Your grammar looks like matches 'a^b'
16:45
< Orth>
It's meant to only match '^b'
16:45
< Orth>
or '^betc'
16:45
<@ToxicFrog>
Well, let's work it out
16:45
<@ToxicFrog>
expr # by s -> expr
16:45
<@ToxicFrog>
term expr # by expr -> term expr
16:46
<@ToxicFrog>
term term # by expr -> term
16:46
<@ToxicFrog>
term '^' expr # by term -> '^' expr
16:46
<@ToxicFrog>
And I'm sure you can work the reduction from there.
16:48
< Orth>
Sod.
16:48
< Orth>
It needs to be higher then?
16:48
<@ToxicFrog>
"higher"?
16:48
< Orth>
S -> ^expr ?
16:48
<@ToxicFrog>
That would work, yes.
16:48
< Orth>
S -> expr$ ?
16:48 * ToxicFrog checks
16:48
<@ToxicFrog>
I have:
16:48
<@ToxicFrog>
S -> start regexes end
16:48
<@ToxicFrog>
start -> '^' | epsilon
16:49
<@ToxicFrog>
end -> '$' | epsilon
16:49
<@ToxicFrog>
Your approach also works; you end up with:
16:49
<@ToxicFrog>
S -> expr | '^' expr | expr '$' | '^' expr '$'
16:51
< Orth>
Oh, of course. Need the one with both. *nods*
16:51
< Orth>
And we were taught one mustn't have a new nonterminal if it has only one pathway(?).
16:52
< Orth>
(My terminology sucks; and I only bloody studied this this week >.<)
16:53
<@ToxicFrog>
(once you have a bit more time it might be worth reading the Dragon Book)
16:54
< Orth>
(No, I mean, we were taught all these terms over the last two weeks. I've forgetten the lot of them already.)
16:54
<@ToxicFrog>
(my point stands. It is a brutally thourough grounding on this stuff.)
16:54
<@ToxicFrog>
(It covers both the theory, and practical algorithms for CFG optimization, LALR parser construction, and the like)
16:54
< Orth>
grauble
16:55 * Orth scratches his head.
16:56
< Orth>
Highest precidence goes first, yah?
16:56
< Orth>
So infix decleration is higher precidence than anchor operators
16:56
< celticminstrel>
This would make sense to me...
16:58
< Orth>
This means that the regular grammar I am describing will accept, hrm, ^abc|xyz$ as "abc or xyz, must be the start and end of the string", not "abc at the start or xyz at the end", correct?
16:58
< Orth>
But (^abc)|(xyz$) will do the latter.
16:58
<@ToxicFrog>
It shouldn't interpret it as either of those.
16:59
<@ToxicFrog>
It's 'start of string, a, b, c or x, y, z, end of string'
16:59
< Orth>
Okay. The former, but I said it poorly.
16:59
<@ToxicFrog>
Oh wait no
16:59
<@ToxicFrog>
Sorry, I read the spec wrong; it gives concat higher precedence than alternate o.O
17:00
< Orth>
You'd hope it did
17:00
<@ToxicFrog>
-What you said is correct.
17:00
< Orth>
If I want a, b, c or x, y, z, I would type ab[cz]yz
17:00
< celticminstrel>
^ [cx]
17:01
< celticminstrel>
?
17:01
< Orth>
er. Yeah.
17:01
< Orth>
Anyway.
17:01
< celticminstrel>
I don't see how that works though..
17:02
< Orth>
So: (^abc)|(xyz$) should be a legal statement, of "StringStart,a,b,c, or x,y,z,StringEnd" yes?
17:03
< Orth>
Unfortunately, using S -> ^expr and S -> expr$ does not allow this - the highest I can go is
17:03
< Orth>
(expr)
17:03
< celticminstrel>
Shouldn't you have spaces between the things after the -> symbol?
17:04
< celticminstrel>
Like, S -> '^' expr and S -> expr '$'
17:04
<@ToxicFrog>
Hmm
17:04 * ToxicFrog pokes the spec
17:04
<@ToxicFrog>
Going by a close reading of the spec, a^b is actually legal
17:04
<@ToxicFrog>
It just won't match any input, ever
17:06
< Orth>
Is this because it's not specifying that it must have ^ at the start of the line, even if you'd be foolish otherwise?
17:07
<@ToxicFrog>
Well, it just says that "^ matches the empty string at the start of input". Nothing about where ^ is valid.
17:07
<@ToxicFrog>
A regex that has ^ anywhere but at the start is useless because it won't match anything, and thus most tools will reject it as ill-formed.
17:07
<@ToxicFrog>
But this one apparently shouldn't!
17:08
<@ToxicFrog>
So we actually end up with a definition that looks something like:
17:08
<@ToxicFrog>
S -> regex
17:08
<@ToxicFrog>
regex -> '^' | '$' | ...other stuff...
17:09
< Orth>
Idly, how /does/ your version of regular grammars describe concatenations?
17:10
< Orth>
We just went E -> TE
17:10
< Orth>
Which indicated a term followed by an expression.
17:10
< Orth>
When using whole words though, it starts to get less meaningful.
17:12
<@ToxicFrog>
expr -> term expr
17:12
< celticminstrel>
Actually, a^b is well-formed in some regexes, and (I believe) can even match something; this is because it's re-defined to mean "start-of-line" instead of "start-of-input", though.
17:13
< Orth>
Yeah, we're reading it as start-of-line here too
17:13
< Orth>
With the minor wobble that we're only reading individual lines. Aheh.
17:13
< Orth>
So you can't actually use it to wrap around, but what the heck~
17:14
<@ToxicFrog>
Yeah, for the purposes of this assignment start of line == start of input, no?
17:17 * celticminstrel shrugs.
17:19
< Orth>
right
17:28 * ToxicFrog noodles around with the CFG
17:35 * Orth should probably go to bed soon; his brain is starting to fog with tireds, and he's a little worried it's hard to doublecheck the CFG while in such a state.
17:40
<@ToxicFrog>
Possibly.
17:40
<@ToxicFrog>
I have a CFG here but I'm not confident that it gets all the precedence right.
17:41
< Orth>
http://pastebin.starforge.co.uk/291 - is this on the right track, or do I need $ and ^ to be on the expr line?
17:41
< Orth>
And then the bit that really bothers me is \
17:41
< Orth>
Pretty certain \vocab is wrong as hell.
17:41
< Orth>
Needs to be \<whatever>.
17:42
< Orth>
Though that may be a lexer detail that I needn't panic about.
17:42
<@ToxicFrog>
I think you're on the right track, although it also looks unnecessarily long
17:42
< Orth>
Bear in mind I've not bothered with expr -> X | Y | Z
17:43
< Orth>
As I wasn't taught that, so don't plan to use it, to keep it recognisable to me and my lec.
17:43
<@ToxicFrog>
No, I mean, it feels like the whole expr-term-factor thing is unecessary
17:44
<@ToxicFrog>
Although I guess if precedence isn't implcit in ordering it might be
17:45
< Orth>
precedence is implicit, but only very weakly.
17:45
<@ToxicFrog>
cat ~/tmp/regex
17:45
<@ToxicFrog>
Whops
17:46
< celticminstrel>
Ugh, there seem to be a whole lot of IRC modules for Python. Does anyone have a recommendation for bot-writing?
17:46
<@ToxicFrog>
Never done IRC in python, sorry
17:47
<@ToxicFrog>
Someday I want to remove the UI from xchat and just use the core as a bot framewrk.
17:47
<@ToxicFrog>
It already has bindings for everything and the API is nice
17:47
< celticminstrel>
Would that be a lot of work?
17:48
<@ToxicFrog>
No ieda.
17:48
<@ToxicFrog>
*idea.
17:48
<@ToxicFrog>
I've never looked at the xchat internals.
17:48
<@ToxicFrog>
If it's well written, it should be nearly trivial, but I don't know if it is.
17:49
<@ToxicFrog>
I mean, you can always use xchat-with-the-gui as your bot framework, but then you need an X server for it to connect to
17:50
<@ToxicFrog>
Oh hey
17:50
<@ToxicFrog>
There's a ./configure option to build xchat with a minimal text interface
17:50
<@ToxicFrog>
Sweet
17:54
< Orth>
OK, nini folks
17:54
< celticminstrel>
Bye.
17:58
< celticminstrel>
On pypi.python.org, I have found python-irclib and pysimpirc. (Closer inspection reveals that most of the other results were actually IRC bots, not just frameworks.)
18:01
< celticminstrel>
How bad is "Data is not written asynchronously"?
18:02
<@ToxicFrog>
...do you want an explanation of synchronous vs asynchronous IO, or just an assessment of which is better for an IRC bot?
18:02
<@ToxicFrog>
Because in the latter case, the answer is "it depends"
18:03
< celticminstrel>
The latter, yes. What does it depend on?
18:03
<@ToxicFrog>
What the bot does.
18:03
< celticminstrel>
Okay, can you give an example of one that would be better with synchronous IO?
18:03
< celticminstrel>
^ sorry, async
18:04
<@ToxicFrog>
Also, whether they're talking about the framework or the API is exposes
18:04
<@ToxicFrog>
If they're talking about the API, they probably mean "all writes will block you until they complete or error"
18:04
< celticminstrel>
Yes, that's what it said just after the bit I quoted.
18:04
<@ToxicFrog>
If they're talking about the framework, they probably mean "if the framework is doing IO none of your event handlers will trigger"
18:05
< celticminstrel>
"the write() may block if the TCP buffers are stuffed."
18:06
<@ToxicFrog>
What are you writing the bot for?
18:06
< celticminstrel>
Why am I writing it? Or what do I want it to do?
18:09
<@ToxicFrog>
Both.
18:16 Attilla [Attilla@Nightstar-b0b10ed3.threembb.co.uk] has joined #code
18:16 mode/#code [+o Attilla] by Reiver
18:22 Attilla [Attilla@Nightstar-b0b10ed3.threembb.co.uk] has quit [Ping timeout: 121 seconds]
18:26 Derakon [Derakon@Nightstar-1ffd02e6.ucsf.edu] has joined #code
18:26 mode/#code [+o Derakon] by Reiver
18:27 * Derakon gets sidetracked by the line "Y.vd(id)" into taking a quick look at the "library" that the code he curates occasionally talks to.
18:27
<@Derakon>
Which has reminded me why I avoid looking at this library as much as possible.
18:27
<@Derakon>
17k lines of Python, with much less structure than the cockpit program had even before I started working on it.
18:28
<@Derakon>
Some sample module names: splitND.py, splitND2.py, useful.py, usefulP.py, usefulX.py, usefulX2.py (that one's 2700 lines long), viewer.py, viewer2.py, viewerCommon.py...
18:28
<@Vornicus-Latens>
That doesn't sound very useful.
18:28
<@Derakon>
As an added bonus, since the "seb" module is always imported as "X", when you import usefulX2 you rename it to Y.
18:29
< celticminstrel>
...
18:31
< celticminstrel>
What does "binding a socket" mean?
18:32
<@Derakon>
It means you tell the OS "Okay, send content that you receive on this socket to me, please."
18:35
< celticminstrel>
What happens if socket.bind() is not called in Python?
18:44
<@ToxicFrog>
...nothing, unless it was called somewhere else?
18:44
<@ToxicFrog>
Can you rephrae the question?
18:45
<@Derakon>
Sockets are an OS-level concept.
18:45
<@Derakon>
Different languages have different ways of accessing the API provided by the OS for accessing sockets, but the OS does the same thing regardless.
18:46
< celticminstrel>
Well, this class takes an optional local_address parameter, which is passed to socket.bind() if present, but socket.bind() doesn't seem to be called if the argument is not present.
18:47
< celticminstrel>
Judging by the sample code, though, this isn't a problem, since the local_address parameter is not passed.
18:49
<@ToxicFrog>
This seems a lot lower level than I would expect from a bot framework.
18:49
<@ToxicFrog>
Also, is this for a listen socket or a client socket?
18:50
< celticminstrel>
I don't know. (Keep in mind that I'm looking at the implementation of the class because there's literally no documentation.)
18:50
< celticminstrel>
(Apart from comments, that is.)
18:50
<@ToxicFrog>
...
18:51
<@Derakon>
Why are you doing this?
18:51
< celticminstrel>
For fun?
18:51
<@ToxicFrog>
<celticminstrel> Why am I writing it? Or what do I want it to do?
18:51
<@ToxicFrog>
<ToxicFrog> Both.
18:51
<@ToxicFrog>
You never did answer that.
18:51
<@ToxicFrog>
Anyways. bind. I suspect that this is a client socket.
18:52
<@ToxicFrog>
In that case, if you're on a machine with multiple network interfaces, you use bind before connect so it knows which one to use for that connection.
18:52
< celticminstrel>
Yeah, I was thinking of an answer and then got distracted and forgot.
18:52
< celticminstrel>
It's using bind after connect...
18:52
<@ToxicFrog>
If you only have a single interface (or if there's no ambiguity WRT routing) you can skip that step and connect() will autobind it to something sane.
18:52
<@ToxicFrog>
o.O
18:53
<@ToxicFrog>
Show me the code?
18:53
<@ToxicFrog>
Also, why are you using this bot framework specifically and not a better documented one?
18:53
< celticminstrel>
I did not find a better documented one.
18:57
<@ToxicFrog>
Build xchat with text interface. Use python scripting API.
18:57
< celticminstrel>
I suppose I could try that. Do you have a quick URL?
18:57
< celticminstrel>
For xchat.
18:58
< celticminstrel>
Or I could Google it if not.
18:58
< celticminstrel>
...I'll Google it, because I'm impatient. <_<
18:59
<@ToxicFrog>
xchat.org, which is the first google hit AFAIR
19:00
< celticminstrel>
It is, yes.
19:00
< celticminstrel>
Since I don't want the X interface, I need to compile it from source, right?
19:01
<@ToxicFrog>
Yes. Unless you can find prebuilt binaries somewhere with the text interface (I can't)
19:02 Attilla [Attilla@Nightstar-cd123d8b.threembb.co.uk] has joined #code
19:02 mode/#code [+o Attilla] by Reiver
19:03
<@ToxicFrog>
Anyways. Since the xchat website is shit, here's the docs for the python scripting API: http://xchat.org/docs/xchatpython.html
19:04
< celticminstrel>
I was thinking roughly the same thing.
19:05
< celticminstrel>
Also, what's the ./configure option?
19:05
<@ToxicFrog>
No idea. Try ./configure --help
19:05
< celticminstrel>
...why didn't I think of that?
19:06 * celticminstrel greps, finds "--enable-textfe"
19:07
< celticminstrel>
...needs more glib.
19:07
< celticminstrel>
...or...
19:11
<@Derakon>
9100+ 10*c +1
19:11
<@Derakon>
I just...don't understand that spacing.
19:11
< celticminstrel>
Nor I.
19:11
<@Derakon>
Usually I think he just had a broken spacebar, but this must be intentional; it's too symmetrical.
19:12
<@Vornicus-Latens>
I have determined that seb is a scary guy
19:13
< celticminstrel>
Well, maybe make will work despite not finding glib...?
19:13
<@Derakon>
I try to think of him as being like the tap-dancing dog. It's not impressive because he's good; he isn't. It's impressive because he does it at all.
19:14
< celticminstrel>
Oh, right.
19:15
< celticminstrel>
So, what is glib?
19:16 * celticminstrel finds it.
19:16
< Namegduf>
I think it's a library that contains whatever functionality they feel like they want
19:16
< Namegduf>
"GLib provides the core application building blocks for libraries and applications written in C. It provides the core object system used in GNOME, the main loop implementation and a large set of utility functions for strings and common data structures."
19:17
< Namegduf>
A little better defined than I thought, then.
19:18
< Namegduf>
The Wikipedia article on it is full of useless.
19:18
<@ToxicFrog>
Basically it's an object system and general utility library for C.
19:18
< Namegduf>
"On an elementary level GLib provides type definitions replacing the C primitive types char, int, float, and so on in order to improve portability; since the C standard doesn't define any minimal byte size of those types" <-- Abysmally wrong.
19:19
< celticminstrel>
...why doesn't it have a download link anywhere!?
19:20
<@Derakon>
http://www.gtk.org/download.html
19:21
< celticminstrel>
Thank you.
19:21
<@Derakon>
Found by googling "glib", clicking on the first link, and clicking on the "download" link from there.
19:22
< celticminstrel>
...what? There was a download link? I must've missed that.
19:22
<@ToxicFrog>
It's on the nav bar at the top of the page, along with "About", "Screenshots", etc
19:24
< celticminstrel>
...wait, do I need to download GTK in order to get glib?
19:24
<@ToxicFrog>
No.
19:24
<@ToxicFrog>
GTK+ is built on top of glib.
19:27
< celticminstrel>
I''m only finding download links for GTK. Nothing for glib.
19:27
< celticminstrel>
^I'm
19:28
< Namegduf>
Arghddfg
19:28
<@ToxicFrog>
...what OS are you building under?
19:28
< celticminstrel>
OSX
19:28
< Namegduf>
Oh.
19:29
<@ToxicFrog>
Oh.
19:29
< Namegduf>
You may want to just try cloning it with git and seeing if that works.
19:29
<@ToxicFrog>
Yeah.
19:29
< celticminstrel>
'which git' doesn't print anything.
19:29
< Namegduf>
If it doesn't, you may wish to consider either not using GLib, or not using OS X for development/running
19:29
< Namegduf>
This looks a little painful
19:30
< Namegduf>
I'm afraid I can't tell you how to get git on OS X, either.
19:30
<@ToxicFrog>
Isn't there some sort of package manager for OSX?
19:30
<@ToxicFrog>
macports or something?
19:31
<@Vornicus-Latens>
macports and fink.
19:31
< Namegduf>
There's another one, hold on
19:31
< celticminstrel>
Actually... yes, two of them.
19:31
<@Vornicus-Latens>
I never got fink to work.
19:31
< Namegduf>
http://mxcl.github.com/homebrew/
19:31 Vornicus-Latens is now known as Vornicus
19:31
< Namegduf>
I mention it because dislike of Ruby aside, it actually looks like it might not suck horribly
19:31
< celticminstrel>
Fink worked for me at one point, but then it stopped working.
19:31
<@ToxicFrog>
Anyways, if one of those has glib binaries + development headers, just whack those in
19:31
< Namegduf>
It doesn't come with one and they tend to suck.
19:32
<@Derakon>
Guess what the play() function does!
19:32
<@ToxicFrog>
Or, as Namegduf suggested, develop on a different platform
19:32
<@ToxicFrog>
Derakon: starts the Tetris easter egg.
19:32
<@Derakon>
Heh. I wish.
19:32
<@Derakon>
Then its name would actually have something to do with its functionality.
19:32
<@Derakon>
What it actually does is create the panel that holds experiment status information.
19:33
< Namegduf>
I'm not an OS X user, and my knowledge of cross-platform compilation and development on OS X is solely derived from the screams of the damned.
19:33
<@Derakon>
The "p" means "progress" and the "lay" means "layout".
19:33
< Namegduf>
So I can't help much.
19:33
< Namegduf>
Haha.
19:33
< Namegduf>
playout too long?
19:33
<@Derakon>
(This goes with "clay" for cameras, "klay" for keypad controls, "mlay" for motor position information...)
19:34
<@Derakon>
Namegduf: this guy creates short-named aliases for functions he only calls once.
19:34
<@ToxicFrog>
I'm also not an OSX user, and my knowledge of development of any kind on OSX is based on two semesters of using an OSX lab and praying for the sweet embrace of death~
19:34
< Namegduf>
Derakon: You need to kill him before he strikes again
19:34
< Namegduf>
Derakon: Who knows if the maniac could find another compiler
19:34
<@Derakon>
Interpreter, you mean.
19:34
<@ToxicFrog>
That said, a quick perusal of the GTK+OSX site leaves me with NFI how to get glib for osx either
19:34
< Namegduf>
Or interpreter.
19:34
< Namegduf>
Yeah.
19:35
< celticminstrel>
What is git, anyway?
19:35
<@ToxicFrog>
So yeah, check macports/fink/whatever for glib, failing that check for git
19:35
<@ToxicFrog>
A version control system
19:35
< celticminstrel>
Oh. So that could work.
19:35
< Namegduf>
Well, I know some other stuff about OS X
19:35
<@ToxicFrog>
Once you have it installed, try 'git clone git://...'
19:35
< Namegduf>
But that's mostly based on totally ignoring bugs in OS X compilation of the server software
19:36
<@ToxicFrog>
Since this is just a one-off build, if you don't care about history or trying different versions, you might also try 'git clone --depth 1 git://'
19:36
< Namegduf>
Because Apple would like to charge us to be able to support them, and no one with a shred of sanity runs production servers on OS X.
19:36
<@ToxicFrog>
Which will be faster.
19:36
< Namegduf>
:P
19:39
< celticminstrel>
Fink doesn't seem to like me.
19:39
<@ToxicFrog>
I've been spoiled by linux, possibly.
19:39
<@ToxicFrog>
sudo (zypper|apt-get) install glib glib-doc glib-devel
19:44 * Derakon invokes REFACTORING, watches a little red "-71 lines" float away from Sebastian and fade out.
19:45
< celticminstrel>
MacPorts and Fink both work that way too.
19:47
< Namegduf>
XD
19:48
< Namegduf>
celticminstrel: That implies they work
19:48
<@Derakon>
My, aren't we hostile today.
19:48
< Namegduf>
Derakon: 18:39 <celticminstrel> Fink doesn't seem to like me.
19:49
< Namegduf>
It was related. :P
19:49
<@Derakon>
You were going off on an anti-OSX diatribe well before that~
19:50
< celticminstrel>
I just installed MacPorts, and it appears to work. At least, it prints a not found message when I type 'port info glib'.
19:50
< Namegduf>
Well, it's progress. Try git?
19:50
< celticminstrel>
Same message, but I did 'port list | grep glib' and found it under glib2.
19:50
< Namegduf>
Ah.
19:50
< Namegduf>
That might work.
19:51
< Namegduf>
Macports compiles from source, I think, so if it works, you might be lucky.
19:51
< celticminstrel>
And then 'port info glib2' reveals the homepage to be gtk, so it looks like it'll work.
19:51
< Namegduf>
Derakon: I wouldn't say I've put out nearly enough lines to qualify as a diatribe, but I'll admit I've been specifically critical about cross-platform development about
19:51
< Namegduf>
s/about/on it in particular.
19:51
< Namegduf>
Memo to self, go back in time, kill whoever put backspace near return.
19:51
<@Derakon>
Heh.
19:52
<@Derakon>
And yeah, my experience with MacPorts is that it's generally pretty reliable.
19:52
< celticminstrel>
It's installing dependencies now.
19:53
< Namegduf>
Sounds good.
19:53 * Derakon replaces all instances of the standalone word 'p' with 'panel' in this module. 55 instances. *sigh*
19:53
< celticminstrel>
Now I wish I had installed MacPorts earlier.
19:54
<@Derakon>
Heh.
19:54
< Namegduf>
My experience with MacPorts is nil- but the OS X users who talked to me about it originally were very iffy about it.
19:55
< Namegduf>
I'll yield to actual experience, of course. :P
19:56
<@Derakon>
My experience is fairly minimal, but on the occasions that I've turned to it it's worked fine.
19:56
< celticminstrel>
The only reason I never installed it before is because I thought, "Oh, I have Fink; I don't need another package manage". That was when Fink worked, though.
19:56
<@Derakon>
I'm generally a "download the tarball and build it myself" kind of guy.
19:56
< celticminstrel>
^manager
19:56
< Namegduf>
I would probably do something crack
19:56
< Namegduf>
Or just... I don't know, really.
19:57
< Namegduf>
OS X is a nicely polished *nix, but I'd need to figure out what I'd do without apt at the time.
19:57
<@Derakon>
Heh.
19:57
< celticminstrel>
Oddly, 'man apt-get' didn't say "no manual entry".
20:00
<@Derakon>
Sure you aren't scrolled up in your terminal~?
20:03
<@Derakon>
...damnation. "s" both means "sizer" and "string" to Sebastian.
20:03
<@Derakon>
(No, "s" doesn't mean "Sebastian". That's what "X" is for)
20:04
< PinkFreud>
Derakon: I used to be. Maintaining that tends to be a nightmare, though.
20:04
< PinkFreud>
you eventually wind up with differing versions of libraries scattered all over, etc.
20:05
< celticminstrel>
Derakon: What about my terminal?
20:05
<@Derakon>
Celticminstrel: I was suggesting that you didn't see the "no manual entry for apt-get" message because you were scrolled up one line in your terminal.
20:05
< celticminstrel>
Oh. No, I saw an actual manual entry.
20:05
<@Derakon>
PF: as long as you aren't attaching specific versions to specific projects, you should be fine.
20:06
< celticminstrel>
...glib has way too many dependencies.
20:06
<@Derakon>
Heh.
20:06
< PinkFreud>
Nowadays, I prefer package management first, and compile from source as a last resort.
20:06
<@Derakon>
Just watch: in two hours your computer will reboot itself and you'll be staring at a penguin once the BIOS exits.
20:06
< PinkFreud>
Hell, I'll create a binary package from a source package first.
20:06
< celticminstrel>
Plus, I could've sworn I already had some of those.
20:07
< celticminstrel>
I don't think Macs have a BIOS... or if they do, it's not noticeable.
20:07
< celticminstrel>
As in, it doesn't do anything onscreen.
20:07
<@Derakon>
They do. It's used to boot up the actual operating system.
20:08
< celticminstrel>
But it doesn't output anything to the screen then.
20:08
<@Derakon>
No, it doesn't.
20:08
< PinkFreud>
modern macs use EFI
20:08
< celticminstrel>
Yes.
20:08
< celticminstrel>
Unlike Windows computers, which have a BIOS which can set various settings.
20:09
< celticminstrel>
Many of which are accessible in the system preferences on a Mac.
20:09
< PinkFreud>
you *can* change things in EFI, though it's not done via a clean menu interface like a bios
20:09
< PinkFreud>
celticminstrel: yep.
20:09
< PinkFreud>
you can also affect, for instance, how the computer boots by hoding down various keys.
20:10
< celticminstrel>
Oh yes, that's true on Mac.
20:10
< PinkFreud>
but no, there's no clean menu interface.
20:11 * celticminstrel idly wonders if it's possible to make the Dock only launch on double-click.
20:15
<@Derakon>
Not AFAIK.
20:15 aoanla [AndChat@Nightstar-4fd72213.range217-43.btcentralplus.com] has joined #code
20:17 aoanla [AndChat@Nightstar-4fd72213.range217-43.btcentralplus.com] has quit [[NS] Quit: ]
20:18
<@Derakon>
Phooey, you can't just start indenting a block of code in Python.
20:18
<@Derakon>
So much for making this layout code more legible.
20:18
<@Vornicus>
...ad-hoc indentation making it /more/ legible?
20:19
<@Derakon>
Yeah, so I can visually indicate which objects are attached to which sizer.
20:19
< celticminstrel>
Finally the dependencies are all fetched.
20:19
<@Derakon>
Take this code, for example: http://pastebin.starforge.co.uk/294
20:19
< celticminstrel>
Vornicus: There are situations where it makes sense to indent the code for other than a standard language structure.
20:20
<@Derakon>
I'd like to be able to indent the code that attaches things to buttonSizer, but I can't.
20:20
<@Derakon>
I guess my other option is to set it apart with comments, but that can get hard to read.
20:20
<@ToxicFrog>
Does python have anonymous blocks?
20:20
<@ToxicFrog>
Like, can you do:
20:20
< celticminstrel>
Pity there isn't a bundle: keyword or something.
20:20
<@ToxicFrog>
do: -- begin button sizer attachment code
20:21
<@ToxicFrog>
first thing
20:21
<@ToxicFrog>
second thing
20:22
<@Vornicus>
There isn't really an anonymous block in Python; you can do if True:, I guess, but there isn't a semantic point to it.
20:22
<@Derakon>
I could co-opt the "with" statement.
20:22
< celticminstrel>
...yes. do: would be better.
20:22
<@Derakon>
with buttonSizer = wx.BoxSizer(wx.HORIZONTAL):
20:22
<@Derakon>
first thing
20:22
<@Derakon>
second thing
20:22
<@Vornicus>
Variables are function-scoped, so anonymous blocks wouldn't actually do anything.
20:22
<@Derakon>
(I wish variables were block-scoped. ;_;)
20:23
<@Vornicus>
I don't. Then you'd need to declare them.
20:23
< celticminstrel>
Vornicus: That's an idea; something like if 'attach object' might be better in some situations, though you can always indicate that in comments.
20:23
<@Derakon>
For the matter at hand, I'm not entirely certain I want to embark on reformatting all the layout code in this program just now~
20:24
<@Derakon>
But it would be nice from time to time.
20:28
<@ToxicFrog>
Vornicus: I'd rather have the occasional declaration than function scope, tbqh.
20:29
< celticminstrel>
Well, glib is installed, but now I have build errors on xchat...
20:29
<@ToxicFrog>
It ./configured fine now?
20:29
< celticminstrel>
Yeah.
20:30
<@Derakon>
It should build fine if ./configure doesn't find problems.
20:30
< celticminstrel>
There's an undefined symbol.
20:30
<@ToxicFrog>
Details.
20:31
<@Derakon>
Hee
20:33
< celticminstrel>
It seems to be a problem in the text-chat interface...
20:34
<@ToxicFrog>
...
20:35
<@ToxicFrog>
Ok, kneecap confiscation time now
20:35 * ToxicFrog goes to borrow a crowbar from the IT guys
20:37 * PinkFreud loathes licensed software
20:38 * ToxicFrog returns and begins removing celticminstrel's kneecaps
20:40 * celticminstrel adds a prototype to a file, tries again.
20:40
< celticminstrel>
Hm. Right, linker error, of course that wouldn't work.
20:40
< PinkFreud>
hee!
20:40
< PinkFreud>
comp2:~# free
20:40
< PinkFreud>
total used free shared buffers cached
20:40
< PinkFreud>
Mem: 49561404 247880 49313524 0 416 73324
20:40
< PinkFreud>
-/+ buffers/cache: 174140 49387264
20:40
< PinkFreud>
Swap: 1949688 0 1949688
20:41
< PinkFreud>
that's just a *little* memory.
20:41
<@Derakon>
...50GB?
20:41
<@Derakon>
I must be misreading that.
20:42
< Namegduf>
It... looks like 50GB to me, too.
20:43
< PinkFreud>
48GB, but close enough
20:44
<@ToxicFrog>
celticminstrel: what symbol is it failing on? What library? Do you have that library? If so, what version? If it's an internal linker error, what symbol, what files?
20:44 * ToxicFrog flails. What is it about error messages that causes people to stop thinking?
20:44
< Namegduf>
What ToxicFrog means to say is
20:44
< Namegduf>
Pastebin the damn error
20:44
< PinkFreud>
ToxicFrog: it doesn't work. plz fix it. kthx.
20:44
< Namegduf>
As well as looking at those questions. :P
20:45
< celticminstrel>
ToxicFrog: _fe_userlist_update
20:45
<@Derakon>
TF: what it is is people not wanting to have to learn how something works just so they can use it.
20:45
< celticminstrel>
Do you want a pastebin of the output?
20:45 * ToxicFrog smacks Derakon
20:45
<@Derakon>
Ow!
20:45
<@Derakon>
What was that for?
20:46
< Namegduf>
Willingness to understand or at least pass on the error messages is generally the definition, for me, of what level of knowledge someone is expected to have to use a program.
20:46
<@ToxicFrog>
There is a difference between "not wanting to learn how something works" and "there's an error message, I don't know what it says because I didn't bother reading it, now you're going to have to spend half an hour interrogating me only to find out that the error message tells me exactly how to solve the problem"
20:47
< Namegduf>
If a program is intended to be used without understanding how it works, the error messages generally shouldn't require that knowledge if they're not intended to be just passed on.
20:47
<@ToxicFrog>
Granted, this isn't that bad
20:47
<@ToxicFrog>
But it's a difference of degree, not kind
20:47
<@ToxicFrog>
"It doesn't work" or "there is an error" are the two most worthless ways of reporting problems or asking for help known to mankind, and every time I see them or any variation thereof I become slightly more bitter and slightly less helpful.
20:48
<@ToxicFrog>
I also seem to be a bitchier mood than normal today, for which I apologize.
20:48
<@Derakon>
I've given up on expecting better error reporting. It's just asking to be disappointed.
20:48
<@McMartin>
Solution: write your error dialogs as lolcats
20:48
<@McMartin>
This makes users pay attention real fast~
20:48
< PinkFreud>
I eated your memory. :(
20:49
<@ToxicFrog>
It does not seem unreasonable to expect, at the very minimum, that developers be capable of reading, comprehending, and relaying an error message
20:49
<@Derakon>
McM: actually, ISTR reading that some website somewhere had attached various cute pictures to their different error messages, so they could just ask which kitten was shown.
20:49
< Namegduf>
XD
20:49
< Namegduf>
Hahaha.
20:49
<@ToxicFrog>
Derakon: "the tabby. That's the kind with the brown blotches, right?"
20:49
<@Derakon>
TF: well, cat, dog, seal, etc.
20:49
<@ToxicFrog>
(note: actual kitten depicted is siamese)
20:49
<@Derakon>
Presumably each image was visually distinct.
20:50
<@Derakon>
( http://cuteoverload.com/2010/05/19/baby-lemur-at-busch-gardens/ )
20:50
< celticminstrel>
If I say "It doesn't work" or "there's an error" it's usually because I'm simply reporting status and am about to try to fix it. But true, it's not very useful.
20:51
<@Derakon>
Oh hey, lunchtime~
20:52 Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has joined #code
20:52
< celticminstrel>
Anyway, since someone asked for a pastebin of the error: http://pastebin.starforge.co.uk/295
20:54
<@ToxicFrog>
...there doesn't appear to be an error in that paste.
20:58
<@Vornicus>
Indeed, I see a bunch of miscellaneous things, but that is by no means a full make run, and there's no error.
20:58
< celticminstrel>
...oh. Oops.
20:59
< PinkFreud>
that was annoying
20:59
< PinkFreud>
I heard a 'click', and then the netbook quit responding. applets were still updating, but keyboard, mouse, and network were completely unresponsive.
21:00
< PinkFreud>
the click could have been anything from the desk shifting to the hard disk telling me to go f*ck myself.
21:00
< celticminstrel>
Try this one: http://pastebin.starforge.co.uk/296
21:00
< celticminstrel>
I redirected stdout but not stderr.
21:00
< celticminstrel>
And it's not a full make run because I didn't do make clean first; should I do that?
21:01 AnnoDomini [annodomini@Nightstar-40f51dd9.adsl.tpnet.pl] has quit [Operation timed out]
21:01 * Rhamphoryncus introduces xchat to prefixed symbols
21:01
< celticminstrel>
?
21:02
<@ToxicFrog>
celticminstrel: add the line "void fe_userlist_update (session *sess, struct User *user){}" to the end of fe-text.c
21:03
<@ToxicFrog>
The text mode doesn't have a userlist, so it just needs a stub for fe_userlist_update.
21:03
< celticminstrel>
...oh right! I knew there was a prototype for it in fe.h, but forgot that that's insufficient.
21:04
<@ToxicFrog>
This appears to be fixed in XChat Aqua as of 2008 or something, incidentally; what version/release are you building?
21:04
< celticminstrel>
Or something. Anyway.
21:04
< celticminstrel>
Um.
21:05
< celticminstrel>
2.8.6
21:05 AnnoDomini [annodomini@Nightstar-32801df0.adsl.tpnet.pl] has joined #code
21:05
<@ToxicFrog>
2.8.6 main? aqua? something else?
21:05 mode/#code [+o AnnoDomini] by Reiver
21:05
< celticminstrel>
Um.
21:05
< Rhamphoryncus>
celticminstrel: non-static symbols in C (including functions and global variables) share a single global namespace, so it's easy to have conflicts. The common behaviour is to prefix all your externally visible names with something, maybe XChat_* in this case
21:06
< celticminstrel>
I don't know if it's main or aqua or what. It's what was available from xchat's download page.
21:10
<@ToxicFrog>
celticminstrel: main, then.
21:10
<@ToxicFrog>
Rhamphoryncus: er, fe_* isn't externally visible.
21:10
< celticminstrel>
I got another error of some kind, but it involved perl so I just re-configured to omit that. So, it seems to have worked.
21:10
<@ToxicFrog>
All of the fe_* functions are UI-related and not exposed to external code.
21:11
<@ToxicFrog>
Allof the stuff in the plugin API uses an xchat_ prefix.
21:11
< celticminstrel>
...okay, now how do I run it...
21:12
<@ToxicFrog>
./xchat-text, I believe
21:12
< celticminstrel>
Ah, okay.
21:12
<@ToxicFrog>
Try /py once it's running
21:12
< celticminstrel>
I assumed it'd be just xchat. Duh.
21:12
< celticminstrel>
Okay.
21:12
<@ToxicFrog>
If you get help text rather than "unknown command", the python interface is working.
21:14
< celticminstrel>
...backspace inserts ^H
21:14
< Rhamphoryncus>
ToxicFrog: doh, I misread the output. Obviously it doesn't say that _userlist_add_hostname and _userlist_set_away are externally visible x_x
21:14 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
21:15
<@Vornicus>
x-chat aqua is nigh on 4 years old now.
21:16 celmin [seanachi@Nightstar-f8b608eb.cable.rogers.com] has joined #code
21:16 celmin [seanachi@Nightstar-f8b608eb.cable.rogers.com] has left #code ["Leaving"]
21:16
<@ToxicFrog>
celticminstrel: not sure if that's a terminal issue or an xchat issue
21:16
<@ToxicFrog>
That said, the text mode is very primitive
21:16
< celticminstrel>
I'm not sure either.
21:17
<@ToxicFrog>
It's not meant to be used as an IRC client, but as a bot platform, or in a pinch as a way of getting bash scripts to talk to IRC.
21:18
< celticminstrel>
How do I set username?
21:18
<@Vornicus>
There should be a bunch of preferences files.
21:18
<@jerith>
ToxicFrog: Do you still have your PostScript-and-bash IRC client?
21:19
<@ToxicFrog>
celticminstrel: edit config files in ~/.xchat2, or use the /set command (try /set * for a list of settings)
21:19
<@ToxicFrog>
Alternately, /nick
21:20
< celticminstrel>
No, that's nickname not username.
21:20
<@Vornicus>
If I had the skills to update it there's a lot of bugs I'd fix.
21:20
<@ToxicFrog>
Arguably, your bot should ignore the xchat configuration entirely and use /set to configure everything before /connecting
21:20
< celticminstrel>
There's nothing in ~/.xchat2 to set that...
21:20
<@ToxicFrog>
jerith: sadly not :( I never took it home, and my sandbox repo from those years is gone
21:20
<@ToxicFrog>
Mike might still have an image of the machine I used, but probably not
21:21
<@jerith>
celticminstrel: What are you trying to do here, by the way?
21:21
<@ToxicFrog>
celticminstrel: there should be an xchat.conf
21:21
<@ToxicFrog>
jerith: write an IRC bot in python
21:21
<@Vornicus>
TWISTED, FOOL
21:21
<@jerith>
launchpad.net/ibid and launchpad.net/eridanus are the two Python ircbots I'm involved with.
21:22
<@ToxicFrog>
Vornicus: isn't Twisted a generic networking library?
21:22
<@jerith>
They both use the Twisted IRC library, which is awesome. (Although it's flexible enough that you have to do a bunch of setup.)
21:22
<@jerith>
ToxicFrog: It is, but they have a bunch of protocols already implemented.
21:23
<@jerith>
If your bot doesn't do anything that can take more than a few milliseconds, you probably won't even have to mess about with Deferreds and the other Twisted mind-benders.
21:23 * ToxicFrog looks at the documentation for Twisted's IRC support
21:24
<@ToxicFrog>
...yeah, if I were to implement an IRC bot in python, I think I'd still use xchat.
21:24
<@jerith>
ToxicFrog: Read the protocol handler code rather.
21:25
<@ToxicFrog>
twisted.words.protocols.irc?
21:25
<@jerith>
I think so.
21:26
<@ToxicFrog>
Aaha. twisted.words.protocos.irc.IRCClient
21:27
< celticminstrel>
So, must I have xchat already running to run the bot?
21:28
<@ToxicFrog>
Hmm. Looks like it has way more special-purpose functions. ...and no message splitting or flood control, wtf
21:28
<@ToxicFrog>
celticminstrel: er, yes? The bot runs inside xchat. It tells xchat to do things, xchat tells it when things happen.
21:29
<@ToxicFrog>
Possibly you might wrap the bot in a command that does something like:
21:29
<@ToxicFrog>
xchat-text --cfgdir=/path/to/bot-specific/config/files --command="/load bot.py"
21:30
<@ToxicFrog>
(alternately, write the bot main to exec() xchat-text in that manner)
21:31
< celticminstrel>
Okay, so then I'd put an xchat.conf in that config directory.
21:32 * Derakon does the happy coder dance as he rips out one of Sebastian's more offensive bits of code.
21:32
< celticminstrel>
Yay!
21:32
<@Derakon>
(This one uses a string the user selected to construct a function name, which is called using exec)
21:33
<@Vornicus>
D:
21:34
<@Derakon>
The sad thing is, he had all of the data needed to avoid that. Each function just sets three values, and there's a list of valid strings already, along with the values they correspond to.
21:35
<@Derakon>
(In fact, he'd written a function in another module that looked up the appropriate settings!)
21:38
<@ToxicFrog>
celticminstrel: yes. In fact, I suspect that if the bot itself is stored in "plugins" in the bot's config dir, you don't even need --command
21:38
<@ToxicFrog>
I haven't tested this, though
21:40
< celticminstrel>
Apparently I can't load modules with spaces in their path...
21:44 Orth [orthianz@Nightstar-ecead68a.xnet.co.nz] has quit [Ping timeout: 121 seconds]
21:46
<@ToxicFrog>
celticminstrel: /load "foo bar baz.py"
21:48 * Derakon goes through, finds all the imports scattered about this module, and moves them up to the top.
21:48
<@Derakon>
There goes 18 redundant import statements!
21:48
< celticminstrel>
...wow.
21:55 * celticminstrel struggles to get a simple "hello world" test bot working.
21:58
< celticminstrel>
I can get it to connect, and I can get it to send me a message... but it won't do both.
21:58
< celticminstrel>
I suppose that's not really a major issue.
21:58
<@ToxicFrog>
How does it fail?
22:00 * Derakon sighs at this:
22:00
<@Derakon>
def shTimeClick(event):
22:00
<@Derakon>
eventObject = event.GetEventObject()
22:00
<@Derakon>
def OnM(event):
22:00
<@Derakon>
Yes, let us compound our event names even further!
22:00
< celticminstrel>
It connects, and then does nothing.
22:00
< celticminstrel>
I basically have a connect command directly followed by a msg command, though.
22:01
< celticminstrel>
But if I comment out the connect, the msg works.
22:07
<@ToxicFrog>
...works as in reaches you?
22:07
< celticminstrel>
Yes.
22:07
<@ToxicFrog>
Without connecting to the server you're on?
22:07
< celticminstrel>
No, after I've connected in xchat.
22:08 * Derakon vaguely wishes for an ordered dict.
22:08
<@ToxicFrog>
Ok...so what you're saying is that if you manually connect, then load the script, it works?
22:09
<@ToxicFrog>
But if you load the script and leave it responsible for both connecting and sending, it doesn't?
22:09
<@Derakon>
This would be a dict where I could iterate through the keys in the order in which they were added to the dict.
22:09
<@ToxicFrog>
And the script is just something like:
22:09
< celticminstrel>
Basically.
22:09
<@ToxicFrog>
xchat.connect(foo)
22:09
<@ToxicFrog>
^W
22:09
<@ToxicFrog>
xchat.command("/connect foo")
22:09
<@ToxicFrog>
xchat.command("/privmsg person bar")
22:09
< celticminstrel>
Something like that, yes.
22:10
<@ToxicFrog>
I suspect that it's doing the command before it finishes connecting, or after the connection is established but before the server has acknowledged them. Although I wouldn't have thought that was actually possible. Hmm.
22:11
< celticminstrel>
That was what I suspected too.
22:11
<@ToxicFrog>
Oh wait, yes, it totally is. Nvm.
22:11
< Namegduf>
Derakon: Do we have any data structures that can do that?
22:11
<@Derakon>
Namegduf: not to my knowledge.
22:11
< Namegduf>
I mean, a binary tree can't do it.
22:12
<@ToxicFrog>
celticminstrel: try writing a function to send the message, and then using xchat.hook_print on "Motd"
22:12
< Namegduf>
Perhaps you could use a dict AND a list?
22:12
<@Derakon>
Typically my use case for this involves showing things to users in a specific order, though, and such cases are not generally performance-bound.
22:12
< Namegduf>
Just insert and delete from both at once?
22:12
<@Derakon>
So it'd be fairly straightforward to rig up something that would work, even if it weren't all that fast.
22:12
< Namegduf>
Create a wrapper class, have two views on the information?
22:12
<@Derakon>
Basically, yeah.
22:12
<@Derakon>
But I want Python to do it for me. >.>
22:12
<@ToxicFrog>
Eg, def notify: xchat.command("/privmsg celticminstrel testing"); xchat.command("/disconnect");
22:12
<@ToxicFrog>
xchat.hook_print("Motd", notify)
22:13
<@ToxicFrog>
xchat.command("/connect irc.nightstar.net"
22:14
< Namegduf>
Derakon: On thought, it'd perform like suck even with that
22:14
< Namegduf>
Derakon: Deletion would STILL be O(n)
22:15
< celticminstrel>
This seems to cause a segfault...
22:15
< Namegduf>
Hmm.
22:15
< Namegduf>
You could get better than that with a hybrid structure.
22:15
<@Derakon>
Namegduf: sure, but my use case is generally "build up object, display it in order, do one lookup, then chuck the entire thing."
22:15
< Namegduf>
But Python really would have to do that for you.
22:15
<@jerith>
Derakon: List of pairs?
22:16
<@Derakon>
Jerith: that's what I went with, yeah.
22:16
<@Derakon>
Problem is that I have to manually iterate over the list to find the match.
22:16
< Namegduf>
It seems kinda specialised to need language support
22:16
<@Derakon>
Which is a whole extra line of code!
22:16
< Namegduf>
All considered, I think it'd be a bad feature- not because it'd perform like suck, hide said performance cost, and lead to silly people using it for no reason
22:17
< Namegduf>
But because simplicity in a language is good
22:17
<@Derakon>
Heh.
22:17
<@Derakon>
So what you're saying is, I should do it in Perl instead~
22:18
< Namegduf>
Not really, I'm saying it's better to have a few lines explicitly doing things here and there than complicate the language with additional data structures and functionality
22:18
<@jerith>
There are already several ways to do it in Perl. Half of them are regex-based.
22:18
< Namegduf>
Haha
22:18 * jerith hides.
22:18
< Namegduf>
I know you weren't serious, though.
22:18
< Namegduf>
:P
22:19
<@Vornicus>
connect is also not the correct /command for that! it's /server. /connect is used by opers to link two irc servers.
22:20
< celticminstrel>
Yes, I knew that.
22:20
< celticminstrel>
I was using server all along.
22:20
< Namegduf>
(gasp)
22:21
< celticminstrel>
The other thing ToxicFrog got wrong is that it expects xchat commands, not raw IRC commands.
22:21
< celticminstrel>
So, why does an attempt to use the hook system result in a segfault->crash... :|
22:24
< celticminstrel>
Hm, suddenly it works without crashing.
22:24
< celticminstrel>
But without sending the message.
22:26
< celticminstrel>
(I changed from hook_print to hook_server)
22:31 * Derakon slaps Sebastian in the face with enumerate()
22:31
<@Derakon>
I can't think of a reason why you'd ever want to do "for i in range(len(list))"
22:32
<@Vornicus>
enumerate didn't exist? It's a new enough feature that when I started it didn't.
22:32
< Tarinaky>
Hmm. Are Steampunk mecha going too far for a Fantasy game or is it still protected by Rule of Cool?
22:33
< Tarinaky>
:/
22:33
<@Vornicus>
Final Fantasy 3/6
22:33
< Tarinaky>
Final Fantasy sucked though.
22:34
< Tarinaky>
I mean... Steamtanks, fair enough since there've been designs for ox-powered tanks.
22:34
< Tarinaky>
But Steam Mecha :/ Not sure.
22:34
< Namegduf>
Tarinaky: It has to be very cool
22:34
< Namegduf>
The downside is that rule of cool to that level will be permanent.
22:35
< Tarinaky>
Permanent?
22:35
< Namegduf>
That is, unless you use handwavey stuff, you will forever have a setting in which steampunk mechas exist.
22:35
< Tarinaky>
It's for a Fantasy 4x game :/
22:35
< Namegduf>
And all the appropriate tech.
22:37
< Tarinaky>
I -think- stuff's balanced because I think everything's cool except for the stuff that's deliberately meant to suck.
22:37
< Tarinaky>
:/
22:37
<@Derakon>
Why do you have stuff that's deliberately meant to suck?
22:37
< Namegduf>
To contrast with the cool!
22:37
< Tarinaky>
Derakon: Pointy sticks.
22:37
< Tarinaky>
Derakon: Guns beat pointy sticks.
22:38
<@Derakon>
Oh, wait, 4x.
22:38
<@Derakon>
That implies that there are units that are strictly better than other units.
22:38
< Namegduf>
Tarinaky: You should do it.
22:38
< Namegduf>
You will be forever known as "Steampunk Mechas, fuck yeah!"
22:38
< Namegduf>
Having memorable things which are fun is good.
22:39
< Tarinaky>
Namegduf: To be honest. Once I turn my eye to the Magic that'll probably start being equally cool as well.
22:39 Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has quit [Connection closed]
22:39
< Namegduf>
Tarinaky: Sounds like a lot of fun
22:39
< Tarinaky>
(Lovecraftian Magic \o/)
22:40
< Tarinaky>
Hence my concern about whether Steampunk Mecha with steam-driven gattling guns might be a bit... too much awesome >.>
22:40
< Namegduf>
Nah.
22:41 Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has joined #code
22:43
< Rhamphoryncus>
Welp, considering I don't have a lightbar, I think segfaulting X is the end of my wii remote experiment
22:46
< Rhamphoryncus>
It's cool, but all the internal motion sensors turn out to be a little low fidelity for desktop use
22:46
<@Derakon>
Yeah, desktop cursor control requires very fine resolution.
22:48
<@Vornicus>
there's a wii motion thingy that gives you better resolution. but... how the hell did you segfault x?
22:48
< Rhamphoryncus>
It only has pitch and roll, no yaw. Understandable, as that requires a frame of reference to give an absolute measurement, but it still sucks
22:48
< Rhamphoryncus>
This actually is a wii motion plus remote :/
22:48
< Rhamphoryncus>
Maybe it's not utilized by default. Dunno
22:49
<@Derakon>
Maybe the drivers you're using aren't updated for the Motion Plus yet?
22:50
< Rhamphoryncus>
Who knows? Only stuff I installed was in ubuntu 10.04 already
22:50
< Rhamphoryncus>
http://pastebin.starforge.co.uk/297
22:51
< Rhamphoryncus>
The trigger was me hitting multiple buttons simultaneously while running nexuiz
22:57
< celticminstrel>
Any idea why this doesn't work? http://pastebin.starforge.co.uk/298
22:57
< celticminstrel>
No wait.
22:57
< celticminstrel>
Don't click that.
22:57
< celticminstrel>
http://pastebin.starforge.co.uk/299
22:58
< celticminstrel>
Anyway, I want it to a) identify upon connecting and b) do something (as yet unspecified) when a message is received.
22:58
< celticminstrel>
a) doesn't happen, and b) causes a segfault and xchat crashes.
22:59
<@Derakon>
You should probably change your password~
22:59
< celticminstrel>
Yeah. <_<
23:00
<@Derakon>
Anyway, no idea what's wrong with it. *shrug*
23:01 AnnoDomini [annodomini@Nightstar-32801df0.adsl.tpnet.pl] has quit [[NS] Quit: SLEEP.]
23:17 Reiv[Graduate] [orthianz@Nightstar-ddda213d.xnet.co.nz] has joined #code
23:26
< celticminstrel>
Well, I think I'm going to go with that other framework I found (the one with no documentation), because it seems to work.
23:28
< celticminstrel>
If my arglist is (self, host, (fromWho, msg) ), is it an error to pass something like ['quack'] as the third parameter?
23:28
< celticminstrel>
(Python)
23:28
< celticminstrel>
(def func (self, host, (fromWho, msg) ) )
23:41 Alek [omegaboot@Nightstar-c5f3565b.il.comcast.net] has quit [Ping timeout: 121 seconds]
23:42 Alek [omegaboot@Nightstar-c5f3565b.il.comcast.net] has joined #code
23:43 Attilla [Attilla@Nightstar-cd123d8b.threembb.co.uk] has quit [[NS] Quit: ]
23:45
< celticminstrel>
Hm. I wonder what \x01 indicates...
23:45
<@Vornicus>
in IRC? a CTCP.
23:45
< celticminstrel>
CTCP?
23:46
<@Vornicus>
PRIVMSG \x01ACTION yadda\x01
23:46 * Vornicus yadda
23:46
< celticminstrel>
So, \x01 is the marker for action messages.
23:46
< Namegduf>
No.
23:46
<@Vornicus>
Also ping, version, time, and rather a few others.
23:46
< Namegduf>
Google for the Client to Client Protocol RFC
23:47
<@Vornicus>
well, okay. PRIVMSG :\x01ACTION yadda\x01
23:47
<@Vornicus>
But the point is: \x01 in IRC is the marker for a message taht requires further interpretation by the irc client. /me is one of the more common of those, but there's many others.
23:49
< celticminstrel>
Ah.
23:51
<@Vornicus>
you'll see them both in PRIVMSG and NOTICEs - the second is called a CTCP reply, and is used for responses to things that require it.
23:52
< Rhamphoryncus>
isn't CTCP client-to-client-protocol?
23:53
<@ToxicFrog>
Yes.
23:53
< Rhamphoryncus>
ergh. Brain no workie. Didn't read the scrollback properly :P
23:55 * Vornicus still got it wrong. PRIVMSG #code :\x01ACTION yadda\x01
23:55
<@ToxicFrog>
Also, celticminstrel: my bad on connect vs. server, I have it aliased locally because I always mix those up. Don't know what you mean by "it expects xchat commands and not raw irc commands". xchat.hook_server isn't working for you because "MOTD" isn't what the server sends; you want the 372/375/376 numerics instead.
23:56
<@ToxicFrog>
I don't know why xchat.hook_print would crash, unless (a) our xchat versions disagree on the list of valid text events (you did check, right?) and (b) it doesn't do any error checking.
23:56
<@ToxicFrog>
...aaand that's all irrelevant because you aren't using xchat anymore. Welp.
23:58
< celticminstrel>
Well, I might consider trying xchat again later. But yeah, I got something working with another framework. Thanks for the suggestions, too.
23:59
< celticminstrel>
By "it expects xchat commands and not raw irc commands", I meant that I needed to use "msg" instead of "privmsg".
23:59
< Namegduf>
It's probably unwise to use a client as a framework in general
23:59
< celticminstrel>
?
23:59
< Namegduf>
They're generally not structured well for it.
--- Log closed Fri May 21 00:00:06 2010
code logs -> 2010 -> Thu, 20 May 2010< code.20100519.log - code.20100521.log >