code logs -> 2008 -> Fri, 19 Dec 2008< code.20081218.log - code.20081220.log >
--- Log opened Fri Dec 19 00:00:26 2008
00:51 You're now known as TheWatcher[T-2]
00:53 You're now known as TheWatcher[zZzZ]
01:02 Derakon[AFK] is now known as Derakon
05:32 Vornicus-Latens is now known as Vornicus
06:21 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Orientis princeps Beëlzebub, inferni ardentis monarcha, et Demogorgon, propitiamus vos, ut appareat et surgat Mephistophilis.]
06:40 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
06:40 mode/#code [+o Reiver] by ChanServ
06:43 Derakon is now known as Derakon[AFK]
07:00
<@ToxicFrog>
akgj;srgjiwa hgius gvklsjigQTPO;ITUQ3'PORjfsgh ikslkgsz;hgjskf;a;gio jae lfaj :LFJIAKSIHAKLSH AIHGIAEYfglusgKGNchbkvzyesbguk W
07:00
<@Reiver>
??
07:02
<@Vornicus>
okay.
07:02 * ToxicFrog points at #lua on Freenode
07:03
<@ToxicFrog>
<hachque__> Argh, __index doesn't work properly and lua->C callconvs are inconsistent and annoying!
07:04
<@ToxicFrog>
<ToxicFrog and Snogglethorpe> Actually, __index is working as designed, you're just using it wrong; and lua->C callconvs are entirely consistent, you just don't understand what : does. Perhaps you should read the manual?
07:04
<@ToxicFrog>
<hachque__> No, no, I'm right.
07:05
<@Vornicus>
ah
07:26
<@ToxicFrog>
Oh god
07:26
<@ToxicFrog>
"If I call getargument on argument 0, and 0 is incorrect, it complains that 0 is incorrect! It should be complaining that 1 is incorrect!"
07:27
<@ToxicFrog>
This is wrong even before we get into the fact that 0 is never a valid stack index in Lua ;.;
07:27
<@Vornicus>
uh...huh.
07:28
<@Reiver>
Congratulations, you found a moron!
07:28
<@ToxicFrog>
No, he found us
07:28
<@Reiver>
Size it to see if it's of legal catchment size, then either keep it or tag it and throw it back.
07:30
<@ToxicFrog>
I think I'll just sacrifice it to Yog-Sothoth instead.
07:30
<@Reiver>
That'd be part of tagging it, yes~
07:32
<@ToxicFrog>
In fairness, we hardly ever get people like this, and this is the worst I can recall offhand.
07:32
<@ToxicFrog>
But when we do...oy vey.
07:32
<@ToxicFrog>
This is why I believe that public school teachers are insane, incidentally.
07:33
<@Reiver>
For putting up with such insanity?
07:33
<@Reiver>
Nah. Merely masochistic~
07:33
<@ToxicFrog>
Yes. Because no matter how lucky you are, there will be at least one person like this in each class, and probably several.
07:34
<@ToxicFrog>
Someone who clearly hasn't given the material even the most cursory of glances, but figures that their encyclopedic (read: infinitesmal) knowledge of something at best tangentially related to the topic at hand gives them an unassailable measure of knowledge and authority.
07:34
<@ToxicFrog>
And is then shocked and offended when they get an F on everything.
08:31 You're now known as TheWatcher
09:17
<@Serah>
When is the pastebin cleared?
10:54 AnnoDomini [~farkoff@Nightstar-29718.neoplus.adsl.tpnet.pl] has joined #Code
10:54 mode/#code [+o AnnoDomini] by ChanServ
11:20
<@AnnoDomini>
I'm getting a lot of "X was not declared for this scope" errors. What's the cure?
11:32
<@ToxicFrog>
Make sure X is declared for this scope. *rimshot*
11:33
<@ToxicFrog>
More seriously, make sure you #included the right headers, and check the output of gcc for "cannot find header" errors.
11:38
<@AnnoDomini>
I'm only #including "SDL/SDL.h". I need something else, too, yes?
11:43
<@AnnoDomini>
http://pastie.org/343117
11:43
<@ToxicFrog>
What symbols is it freaking out about
11:43
<@ToxicFrog>
?
11:44
<@ToxicFrog>
Oh hey there's your problem
11:44
<@ToxicFrog>
<SDL/SDL.h> and "SDL/SDL.h" are not the same thing.
11:44
<@ToxicFrog>
The former is "look for it in all configured include paths" (ie, all the builtin ones plus everything specified with -I)
11:44
<@ToxicFrog>
The latter is "look for it in the same directory as the file that #included it"
11:45
<@ToxicFrog>
And if you look at the output of gcc as I suggested you should indeed see it complain that it can't find "SDL/SDL.h"
11:46
<@AnnoDomini>
Uh... how do I look at the output of gcc?
11:47
<@AnnoDomini>
Changed it, still the same errors.
11:47
<@AnnoDomini>
How did I specify where to look, again? -Ipath?
11:48
<@AnnoDomini>
And where would it go, the options portion of the arcane incantation?
11:49
<@ToxicFrog>
....what do you mean, "how do you look at the output of gcc"?
11:49
<@ToxicFrog>
It's what vomits all over the terminal when you run it.
11:49
<@AnnoDomini>
But I included all it threw at me in the pastie.
11:49
<@AnnoDomini>
At the end.
11:49
<@ToxicFrog>
If you're using an IDE, look for "build errors" or "compiler output" or something of that nature, but it's generally a large obvious pane at the bottom of the screen.
11:49
<@ToxicFrog>
Oh? Sorry, I missed that.
11:49
<@ToxicFrog>
It's 0700 here.
11:50
<@ToxicFrog>
Oh.
11:50
<@ToxicFrog>
It would probably help if you declared and wrote those functions, no?
11:51
<@AnnoDomini>
Oh, I see.
11:51
<@AnnoDomini>
I'm copying from a tutorial.
11:54
<@ToxicFrog>
Aah. It should, presumably, mention something about "these functions to be filled in by the user" or "we'll cover what these do in step N+1" or something that effect, no?
11:54
<@AnnoDomini>
It didn't. I assumed they were SDL functions.
11:55
<@ToxicFrog>
Anyways. In general, "X not declared in this scope" means exactly what it says: you're using something (a function, variable, whatever) without having declared it ahead of time. Usually this means a typo (fopem rather than fopen) or that you left out a header (fopen but you forgot <stdio.h>) or that you had the wrong header name or search path (say, <stdop.h>, in which case the first message from gcc will be a complaint that it can't find
11:55
<@ToxicFrog>
that header, followed by lots of other complaints about declarations).
11:56
<@ToxicFrog>
This is the relatively rare case where you're using something that not only isn't declared, but doesn't exist in any form because it has yet to be written.
11:56
<@ToxicFrog>
And now, I'm going to sleep. Enjoy your SDLing.
11:57
<@AnnoDomini>
How did I declare functions again? type name(parameters);?
11:57
<@ToxicFrog>
...I thought you'd worked with C/++ before?
11:57
<@ToxicFrog>
But yes, just like that. Same as a definition except with ; instead of {...}
11:58
<@AnnoDomini>
It was a long time ago, and I always thought needing to declare silly.
11:59
<@AnnoDomini>
I mean, if the same information is already given in the actual function code, why write it again?
11:59
<@ToxicFrog>
...because there's no guarantee that information is available. Consider two cases.
12:00
<@ToxicFrog>
(1) You see this every day: standard library functions like fopen. You don't have the source for these, only the object code (in, say, libc.a). The only information the compiler has is the declarations in the headers, which it uses to type check your code and generate the correct machine code for the calls.
12:02
<@AnnoDomini>
I see.
12:02
<@ToxicFrog>
(2) main.c calls foo(), which is defined in foo.c. The compiler has no way of knowing that that's where foo() is; the files are processed seperately and only come together at link time (which, if you're building a static library, may be a long time in the future) - and, again, the object code doesn't contain that information. When compiling main, it has to rely on the declaration in foo.h in order to type check.
12:02
<@ToxicFrog>
Some other languages where this is not necessary, and why:
12:03
<@ToxicFrog>
- Java. Java also does static type checks, but unlike C/++ the file containing each class can be derived from the class's name, and furthermore the necessary information remains even after the .java file has been compiled to a .class file. Java requires that at least one of those be available at compile time, and the compiler will find it automatically.
12:04
<@ToxicFrog>
- Python, Lua: these languages don't do static typing and are interpreted; the compiler can get away without knowing type information and type or signature mismatches become runtime errors.
12:06
<@ToxicFrog>
Basically, it's a combination of two factors: C does static type checking and thus needs the type information available at compile time (as well as to generate the correct machine code!); and furthermore there is no guaranteed mapping between symbol names and file names, nor do object files retain the necessary information with any degree of reliability.
12:09
<@AnnoDomini>
I see. Thanks.
12:09
<@ToxicFrog>
And now, I really am going to bed.
12:33 GeekSoldier_ [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has joined #code
12:34 GeekSoldier [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has quit [Ping Timeout]
14:43 grossroot[idle] is now known as grossroot
15:03
<@Consul>
Man, am I glad I don't have to go anywhere today. It's pretty nasty out.
15:03
<@Consul>
I was thinking about hoofing it to the homebrew store down the road, but I think I'll wait.
15:28
<@jerith>
Evening.
15:28 * jerith has just been reading about the apt vs rubygems fight on the interwebs.
15:30
<@jerith>
I tried to be open-minded while reading the gems peoples' arguments.
15:31
<@jerith>
That didn't last long. They don't seem to have a single sane argument that doesn't boil down to "I want to code on a Mac and deploy on Gentoo".
15:39
<@Consul>
Bah. Real programmers edit the production code directly. Pansies. :-P
15:41
<@AnnoDomini>
It's beyond me why anyone would want to even use a Mac.
15:42
<@Consul>
Oh, Macs are good enough. It's why anyone would want to use Ruby that puzzles me.
15:42 * Consul ducks and runs.
15:55
<@TheWatcher>
Consul: no argument from me, there.
15:55
<@Consul>
Heh
15:56
<@Consul>
Actually, playing with Ruby was the first time in my life where OO started to make sense.
15:56
<@Consul>
I know that's probably weird and scary sounding to you experienced programmers.
15:58
<@TheWatcher>
If there's one thing that teaching programming has taught me, it's that different people pick things up in different ways, some languages make more sense to them than others, and some concepts click better for them in one language than another.
16:01
<@Consul>
I still can't figure out the value to OO in Python.
16:01
<@Consul>
To me, one of the most useful things I can do with classes is new data types and associated functions.
16:01
<@Consul>
ADTs, I guess/.
16:02
<@Consul>
Those are a puzzle I like solving, often leading to situations where I use a screwdriver to hammer a nail, but hey. :-)
16:04 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
16:04 mode/#code [+o gnolam] by ChanServ
16:12
<@AnnoDomini>
SDL_gfx is something I have to download and install if I want to use pixelColor(), yes?
16:38
<@AnnoDomini>
Is there a built version somewhere?
17:02
<@jerith>
Consul: I don't like Ruby, but it's the day job until the end of January.
17:02
<@jerith>
Then I go work at a place that does Python.
17:02
<@Consul>
Hey, at least you have some work.
17:03
<@jerith>
I tend to bounce between hating everything about Ruby and just hating a few things about it.
17:03
<@jerith>
But rubygems are thoroughly broken.
17:04
<@jerith>
Or rather, they don't play nice with any other package manager.
17:04
<@Consul>
So... What is the value of OO in Python? Is it there just to make large multi-contributor projects easier?
17:04
<@jerith>
OO is a tool for managing complexity.
17:05
<@jerith>
What did you find valuable about it in Ruby?
17:05
<@Consul>
I didn't necessarily find it valuable, I just said I finally started to understand it. ;-)
17:05
<@jerith>
Ah.
17:06
<@jerith>
The point of an object is to package data and code together.
17:06
<@Consul>
Remember, I started out my advanced programming days in assembler.
17:06
<@Consul>
After a long break from computers after that, I learned Perl.
17:06
<@jerith>
Rather than having a chunk of data and a bunch of functions to manipulate it, you have smart chunks of data that can manipulate themselves.
17:07
<@jerith>
Consider numbers.
17:07
<@Consul>
So all of my discipline is with procedural structures.
17:07
<@jerith>
Integers and floats tend to be basic data types.
17:07
<@jerith>
But say you wanted complex numbers.
17:08
<@Consul>
I understand ADTs already. But Python doesn't do ADTs very well, by their own admission.
17:08
<@jerith>
Oh, right.
17:08
<@jerith>
Think bigger scale, then.
17:08
<@jerith>
Instead of a complex number, you want a database connection.
17:08
<@Consul>
ADTs seem to make the most sense in strongly-typed languages.
17:09
<@jerith>
What's an ADT, by the way?
17:09
<@Consul>
Although I can see wanting to define a data type to do math operations on, even in a weakly-typed language.
17:09
<@jerith>
I think I've glorked it from context, but I want to make sure.
17:09
<@Consul>
Abstract data type.
17:09
<@Consul>
Okay, I think I'm starting to get it.
17:09
<@jerith>
Python et al aren't weakly typed.
17:09
<@jerith>
They're dynamically typed. Big difference.
17:10
<@Consul>
Let's say I want to create a matrix data type.
17:10 * jerith nods.
17:10
<@jerith>
It would have methods on it that let you transpose it or find eigenvalues or something.
17:10
<@Consul>
And we want to define addition, scalar multiplication, matrix multiplication, and inversion.
17:11
<@Consul>
Yes, and transposes.
17:11
<@jerith>
Side note: Operator overloading isn't essential for this, but it can help.
17:11
<@jerith>
A + B can just be syntactic sugar for A.add(B).
17:12
<@Consul>
Storing the values of the matrix itself is easy enough, it's a 2D array.
17:12
<@jerith>
Maybe.
17:12
<@jerith>
Perhaps you have a sparse array type.
17:12
<@Consul>
Well, yes, you can do a 3D matrix, I suppose.
17:12
<@jerith>
s/array/matrix/
17:13
<@jerith>
Your matrix may be huge, but it might only have a handful of nonzero elements.
17:13
<@Consul>
So, the matrix multiplication method would have to know when matrix multiplication is defined (certain dimensions have to match up).
17:13 You're now known as TheWatcher[afk]
17:13
<@jerith>
The important thing is that when you use it, you don't need to care about the internals. They're abstracted away.
17:13
<@Consul>
Oh, I see what you're getting at.
17:13
<@jerith>
You have this thing that's a matrix that supports certain operations.
17:14
<@jerith>
A linked list and an array are very similar data structures.
17:14
<@Consul>
Of course, I'm sure there's already a good Python matrix class out there, but this is a good exercise for me.
17:14
<@Vornicus>
VB is weakly typed: if you give it a thing that doesn't suppot the methods that it needs, it tries to convert to a type that /does/ support the methods.
17:15
<@jerith>
They support pretty much the same operations (assuming you can resize an array) but they have different properties.
17:15
<@Consul>
Right, Python's duck typing. I keep forgetting about that.
17:15
<@jerith>
Duck typing is different also.
17:15
<@jerith>
It's a way of thinking about behaviour rather than naming.
17:16
<@jerith>
A thing doesn't have to be a kind of file for you to write data into it, it just has to support the same kinds of operations.
17:17
<@jerith>
(That partially just shuffles the problem around, so I prefer interfaces and adapters a la Twisted, but that's beside the point.)
17:17
<@jerith>
So, back to the matrix.
17:18
<@jerith>
If you're implementing a matrix, you need to worry about how to store it and how to invert it and such.
17:19
<@jerith>
If you're using a matrix, you only need to know that you can invert it and that it knows what its elements are.
17:19
<@Consul>
And certain operations need to be restricted to certain types of matrix. Determinants can only be done on square matrices, etc.
17:19
<@jerith>
This abstraction is leaky, though. Sometimes you need to know what the memory footprint is or what the runtime complexity of various operations are.
17:20
<@jerith>
Indeed.
17:20
<@Consul>
Some matrices are not invertable.
17:20
<@jerith>
Now, you *can* do a lot of this stuff without objects and classes.
17:20
<@Consul>
One might also build certain matrices in, like any N-dimension identity matrix.
17:20
<@jerith>
I've been reading a lot about the Erlang standard library recently.
17:21
<@jerith>
Erlang doesn't do OO.
17:21
<@jerith>
So, it has a dict library.
17:21
<@jerith>
You can call dict:new() to get a new empty dict.
17:22
<@jerith>
(A dict is just a map from one thing to another. Like a Python dict or a Perl hash, only implementation isn't specified.)
17:22
<@Consul>
Right. I actually find I like functional languages. It looks more like math. :-)
17:23
<@jerith>
Then you call dict:insert(Dict, Key, Value) to add a key/value pair.
17:23
<@jerith>
And it returns the new dict.
17:23
<@Consul>
Of course, some things are less intuitive, like sending output to stdout.
17:23
<@jerith>
But, you can't look at an arbitrary thing and know it's a dict.
17:24
<@jerith>
You also have to juggle semi-opaque identifiers all over the place.
17:25
<@jerith>
In Erlang, this isn't really a problem.
17:25
<@jerith>
You tend to manage complexity by running "servers" that do things for you rather than slinging objects around.
17:26
<@jerith>
But that's optimised for a different class of problem.
17:26
<@Consul>
I've looked into using things like Erlang to do DSP work. The thing is, saving state is actually kinda essential to some DSP problems.
17:27
<@jerith>
Look at ets and the process dictionary. You can get mutable state with those.
17:27
<@Consul>
A lot of DSP functions are differential equations in discrete time (difference equations, I think they're called).
17:27
<@jerith>
You lose a lot of the benefits immutability gives you, though.
17:27 * jerith nods.
17:28
<@Consul>
So previous inputs and outputs have to be stashed in a stack somewhere.
17:28
<@jerith>
I did a bunch of DSP stuff. Just not enough to stick hard and too long ago to remember the details.
17:30
<@Consul>
Faust is a functional language for DSP. It has a facility for implementing difference equations directly (and very elegantly, too). But it compiles to C code.
17:30
<@jerith>
Why is that a problem?
17:31
<@Consul>
Well, in C you can do all the state-saving tricks needed.
17:31
<@Consul>
But I guess Erlang does, too, from what you're saying. I didn't look too closely at it.
17:32
<@jerith>
Most of my DSP work was targeting DSP hardware.
17:32
<@Consul>
Ah, yeah, that's a different world.
17:32
<@jerith>
You can keep state around, you just need to pass it in.
17:32
<@Consul>
I'm trying to make softsynths and a guitar amp sim.
17:32
<@jerith>
Most long-running servers need to keep state.
17:32
<@Consul>
As plugins on computers.
17:33
<@jerith>
Generally you keep it in a structure that you modify and pass to the next recursion.
17:35
<@Consul>
But Faust is a great option exactly because it compiles to C wrapped in a C++ class. Things like LADSPA, LV2, JACK, and ALSA are all C APIs.
17:37
<@jerith>
Most of the DSPs I've coded for use a sort of dialect of C.
17:38
<@jerith>
It's standard C, but many of the DSP functions are written as inlined functions.
17:38
<@Consul>
It's really quite easy to implement difference equations in C.
17:38
<@Consul>
The hard part is deriving the equation to begin with.
17:38
<@jerith>
MAC is a useful example. It's a single-instruction multiply and accumulate.
17:38
<@jerith>
Very common in filters, at least.
17:39
<@jerith>
So rather than writing a loop which multiplies and adds, which the compiler may not be smart enough to optimise, you call the mac() library function which inlines the asm instruction.
17:39
<@jerith>
Or something like that.
17:40
<@Consul>
Yeah, a typical DSP chip has a single multiply-add instruction.
17:40
<@Consul>
Makes things a lot easier.
17:41
<@Consul>
But again, I have no experience with chips, just plugins.
17:42
<@Consul>
Another thing I like about Faust is it can automatically write vectorizable code.
17:42 * jerith considers a DSP OO example.
17:42
<@jerith>
Consider a filter.
17:43
<@jerith>
An easy one. Low pass only, you set a couple of parameters.
17:43
<@jerith>
You can write a low pass filter class that implements a particular kind of filter.
17:45
<@jerith>
You initialise it with the parameters (rolloff, boundary frequency, pass-band attenuation, etc.) and get a filter object.
17:45
<@jerith>
All this filter object knows how to do is filter a PCM stream.
17:46
<@jerith>
But to use it you don't need to grok the implementation details. You just give it the parameters and use it.
17:46
<@jerith>
(Although abstractions leak.)
17:47
<@Consul>
There are a few C libraries floating around that do stuff like this.
17:47 * jerith nods.
17:47
<@Consul>
There's one for implementing oversampling that I want to look at.
17:47
<@Consul>
But part of the idea for music-making plugins is to model imperfections in analog circuits.
17:48
<@Consul>
That's where the non-linear modeling part come sin.
17:48
<@Consul>
comes in*
17:48
<@jerith>
But typically you need to pass around an opaque handle or give it your parameters and stuff all the time. Objects encapsulate all that stuff for you.
17:49
<@jerith>
I quite like OO in general, but I violently disagree with most of the zealots.
17:49
<@jerith>
Java does it pretty badly, IMHO.
17:49
<@jerith>
Python does it reasonably well.
17:49
<@Consul>
And you can also define a PCM stream as a data stream type and get another level of abstraction.
17:49
<@jerith>
Yeah.\
17:49
<@Consul>
I have no clue how to do that, though. Friend functions in C++ frighten me.
17:50
<@Consul>
It seems, I don't know, very hacky somehow.
17:50
<@jerith>
C++ terrifies me.
17:50
<@jerith>
The solution is worse than the problem.
17:51
<@Consul>
I don't mind C++, really.
17:51
<@Consul>
And it's what I have to work with, given my other choices.
17:51
<@jerith>
I can't fit enough of it in my head to do anything useful.
17:52
<@Consul>
Oh, I have to keep the references open at all times.
17:52
<@jerith>
There's too much syntax, too much context and too many built-in edge cases.
17:52
<@jerith>
And it doesn't even give me garbage collection.
17:53
<@gnolam>
C++ is a maze of twisty little corner cases, all alike.
17:53
<@gnolam>
Danged useful language, still.
17:53
<@Consul>
For real-time stuff like softsynths, it works better than most other options.
17:54
<@jerith>
I'll take C over C++ for pretty much anything.
17:54
<@Consul>
Assembler would be the best if I could be arsed to learn how to optimize every algorithm by hand. I'd rather hand that off to a compiler that gets it 90% of the way there for me.
17:56
<@jerith>
I'll take C over asm in a heartbeat.
17:56
<@Consul>
I also don't feel like building GUIs in assembler.
17:56
<@gnolam>
ASM just isn't worth the bother except in some extremely special cases.
17:57
<@Consul>
Hell, I freaking hate GUI-building in *any* language.
17:57
<@Consul>
But I like a well-built GUI, especially for synths
17:57
<@jerith>
The only cases asm is worth the bother is when your device is small and simple enough that instruction-level timing is important.
17:58
<@jerith>
Even then, it's only important for the bits that matter. Inline asm for those and C for the rest.
17:58
<@Consul>
But building synth GUIs requires an artistic flair that I lack.
17:58
<@jerith>
GUIs need a high-level language.
17:58
<@jerith>
I like a client-server architecture for that.
17:59
<@gnolam>
These days, you can do a whole lot of embedded programming without ever touching assembly.
17:59
<@jerith>
Either they're separate processes or the GUI calls a well-defined library and is just a thin wrapper.
17:59
<@Consul>
There's one guy who built a guitar effects processor with an Arduino. Low-fi, but very cool.
18:00
<@Consul>
http://www.vimeo.com/1460684
18:00
<@jerith>
The arduino's an 8-bit AVR with a bit of kit wrapped around it, no?
18:01
<@Consul>
32-bit processor, 12-bit AD/DA built-in.
18:01
<@jerith>
Hmm.
18:02
<@jerith>
I must get back into embedded stuff again.
18:03
<@Consul>
And yes, it has a built-in bootloader with USB and a development environment based on Processing using a form of C.
18:04 * jerith hates IDEs with an all-consuming passion.
18:05
<@jerith>
None of them have a halfway-decent editor.
18:05
<@jerith>
Although Eclipse wrangles Java well enough that it's less painful than writing Java in emacs.
18:06
<@jerith>
The various "tools" for embedded work are the worst.
18:08
<@Consul>
Anyway, time to go shower. Thanks for the lessons. :-)
18:14
<@jerith>
Any time.
18:14
<@jerith>
Enjoy!
18:37 You're now known as TheWatcher
19:16 McMartin [~mcmartin@Nightstar-14680.dsl.pltn13.sbcglobal.net] has quit [Quit: Reboot]
19:33
<@ToxicFrog>
AnnoDomini: yes it is, yes there is, I believe I linked you to it earlier but if not I have one you can use
20:30 McMartin [~mcmartin@Nightstar-14680.dsl.pltn13.sbcglobal.net] has joined #code
20:30 mode/#code [+o McMartin] by ChanServ
20:51
<@AnnoDomini>
ToxicFrog: I got http://www.ferzkopp.net/joomla/content/view/19/14/ but it seems to me that's the source there. Which one of them is a built version?
20:57
<@ToxicFrog>
None of them.
20:57
<@ToxicFrog>
Try http://blog.ryara.net/wp-content/uploads/2008/10/sdl_gfx-2017.zip
20:58
<@ToxicFrog>
Or google "SDL_gfx windows build".
20:58
<@ToxicFrog>
Or build it yourself.
20:59
<@AnnoDomini>
Where does the .lib file go?
21:00
<@AnnoDomini>
Or is that for some other compiler?
21:02
<@ToxicFrog>
That's for Visual Studio.
21:02
<@ToxicFrog>
It's the equivalent of a .a
21:02
<@ToxicFrog>
I note that if that build doesn't work for you (ie, it's VS-only), I have a gcc-compatible version you can use.
21:03
<@AnnoDomini>
What's the main include file? SDL_gfxPrimitives.h?
21:07
<@ToxicFrog>
Yep
21:08 Serah [~Z@87.72.35.ns-26506] has quit [Quit: Be right back, got some smiting and righteous justice to attend to.]
21:10
<@AnnoDomini>
Since I have SDL .h files in a subdirectory, is it okay to change the SDL_gfx .h files include them, because they seem to think the SDL files are in the main include directory?
21:14 GeekSoldier_ is now known as GeekSoldier
21:22
<@AnnoDomini>
Something tells me this version doesn't work for me. Errors pertain undefined references within object files.
21:23
<@AnnoDomini>
http://pastie.org/343538
21:24
<@gnolam>
You're not linking with SDL_gfx.
21:25
<@AnnoDomini>
I need to add -lSDL_gfx at the end/
21:25
<@AnnoDomini>
*?
21:26
<@ToxicFrog>
Yes.
21:26
<@ToxicFrog>
Also, the reason the SDL_gfx files think that the SDL files are in the main include directory is that the way you're meant to use them is:
21:26
<@ToxicFrog>
#include <SDL.h>
21:26
<@ToxicFrog>
gcc <stuff> -I/usr/include/SDL
21:30
<@AnnoDomini>
http://pastie.org/343547 <- Why can't it find it?
21:49
<@ToxicFrog>
AnnoDomini: did the binaries come with a .a?
21:49
<@ToxicFrog>
if not, try placing -lSDL_gfx with the path to the DLL
21:50
<@ToxicFrog>
If that doesn't work, I'll send you the gcc build.
21:52
<@AnnoDomini>
They did not come with an .a. The DLL I put in C:\MinGW\bin so it should have been found via PATH, no?
21:54
<@ToxicFrog>
PATH is checked at runtime, not link time.
21:54
<@ToxicFrog>
Really, the DLL should go in both bin and lib; it only goes in PATH at all because windows uses that for both executable and dynamic library searches >.<
21:57
<@AnnoDomini>
Yay! It compiled after I put the DLL in lib.
21:57
<@AnnoDomini>
Funny how the SDL DLL only needs to go into bin.
21:58
<@ToxicFrog>
Because SDL comes with a .a as well.
21:58
<@ToxicFrog>
So when gcc looks in lib, it finds libSDL.a.
21:59
<@AnnoDomini>
Is there any character limit for the arcane incantation?
22:01
<@ToxicFrog>
There's a system-specific command line length limit.
22:01
<@ToxicFrog>
I think it's around 32k on linux?
22:01
<@ToxicFrog>
No idea what it is on windows.
22:08 Serah [~Z@Nightstar-5401.atm2-0-1041217.0xc329e232.boanxx12.customer.tele.dk] has joined #Code
22:08 mode/#code [+o Serah] by ChanServ
22:15
<@AnnoDomini>
http://pastie.org/343581 <- What am I doing wrong? I want to draw some stuff, and the screen is as black as it was when the drawing function calls weren't there.
22:18
<@Vornicus>
I don't see calls to tell it that you're done drawing and so it should flip.
22:19
<@AnnoDomini>
Oh. How do I flip?
22:19
<@Vornicus>
I don't know the function in the C lib.
22:19
<@AnnoDomini>
SDL_Flip(screen);?
22:20
<@Vornicus>
sounds right
22:20
<@AnnoDomini>
VICTORY!
22:20
<@Vornicus>
you have to call that every time you finish painting a frame.
22:20
<@AnnoDomini>
Thank you.
22:20
<@Serah>
I need help.
22:20
<@Serah>
From you english speakers.
22:20
<@AnnoDomini>
Yes?
22:21
<@Serah>
What the hell is "Key business accomplishments?
22:21
<@Serah>
[231355] ( Frictor ) So ZLOK I've got a form from a staffing service, and they want me to list 3 key business accomplishments. What the frell do they mean?
22:23
<@AnnoDomini>
Key business accomplishments sounds like completing doing something important. IMO, it would be finishing a project the company got paid big money for, accomplishing a restructuring that lowered costs and increased profits, etc.
22:26
<@Serah>
Thanks!
22:26 * Serah hugs AnnoDomini
22:27 * AnnoDomini hugs Serah.
22:36 grossroot is now known as grossroot[idle]
23:05
<@McMartin>
YAY BLUESCREENS
23:05 * McMartin busts out serial-port kernel debuggers
23:14 * ToxicFrog turns the awesome power of parsing expression grammars on this problem
23:15
<@Vornicus>
what's the problem?
23:15
<@ToxicFrog>
Writing a parser where you can easily edit the language it accepts at runtime.
23:16
<@ToxicFrog>
(yes, I am writing yet another macro system for Lua. I had an epiphany sometime around 0730 (?last night).)
23:17 Tarinaky[Lose] [50e51fec@Nightstar-14595.mibbit.com] has joined #Code
23:18
< Tarinaky[Lose]>
Hi. Anno told me to ask here. I'm having trouble with Video Games in Windows XP. I experience random slow downs.
23:19
< Tarinaky[Lose]>
I'm currently using a fresh install of Windows XP and I'm using Audiosurf to provoke the slowdowns.
23:19
<@ToxicFrog>
...this is a channel concerning programming, so I'm not sure why he would direct you here unless you have the source.
23:19
< Tarinaky[Lose]>
I don't know why he directed me here either.
23:20
<@ToxicFrog>
That said, first step is always to eye the task manager with suspicion and watch for things chewing on the CPU or for memory exhaustion. Beyond that, I can't really help you.
23:25
<@ToxicFrog>
Vornicus: anyways, the goal is to have something where you can, say, do this:
23:25
<@ToxicFrog>
lua = require "grammar.lua"
23:25
<@AnnoDomini>
I directed him here because you lot are more competent with computers than myself.
23:25
<@ToxicFrog>
lua.stat = { 'try', lua.block, 'catch', lua.Name, 'with', lua.block, 'end' }
23:26
<@ToxicFrog>
function lua.gen.stat(tryblock, exname, catchblock) ...function that emits valid lua code for that construct... end
23:26
<@ToxicFrog>
lua:commit()
23:27
<@ToxicFrog>
And have something where lua:parse() will generate an AST from code include that form, and lua:parse():gen() will emit value Lua 5 source based on the original form and the provided translators.
23:27
<@ToxicFrog>
Where all grammatical constructs have an implicit identity translator if none is provided.
23:30 You're now known as TheWatcher[T-2]
23:34 You're now known as TheWatcher[zZzZ]
23:38
<@ToxicFrog>
...oh, balls.
23:38 * ToxicFrog reaches for the Dragon Book
23:44
<@McMartin>
That's a bad sign, often
23:45
<@ToxicFrog>
The Lua grammar is left-recursive in at least two places.
23:45
<@McMartin>
Planning on refactoring by hand? =/
23:45
<@ToxicFrog>
lpeg cannot handle left-recursive grammars. I'm not sure if this is fundamental limitation of PEGs or just of the lpeg library.
23:46
<@ToxicFrog>
If it's sufficiently simple, refactoring by hand will produce an easier to work with grammar than automatically rewriting it.
23:46
<@ToxicFrog>
And if it's not, I need the Dragon Book to look up the algorithm anyways.
23:46
<@McMartin>
Yes.
23:46
<@McMartin>
THe auto algorithm is a nightmare, though.
23:47
<@ToxicFrog>
Yes.
23:49
<@ToxicFrog>
Hmm. The first issue:
23:49
<@ToxicFrog>
prefixexp -> var | functioncall | '(' exp ')'
23:49
<@ToxicFrog>
functioncall -> prefixexp args | prefixexp ':' Name args
23:49 Tarinaky[Lose] [50e51fec@Nightstar-14595.mibbit.com] has quit [Quit: http://www.mibbit.com ajax IRC Client]
23:50
<@ToxicFrog>
var -> Name | prefixexp '[' exp ']' | prefixexp '.' Name
23:50
<@McMartin>
Looks like you have a great deal of inlining to do, sir~
23:50
<@McMartin>
There's a Gaussian-Elimination like step.
23:51
<@McMartin>
That said, it also looks like you probably want to have prefixexp be late in that list, so that it is wildly personally recursive and inlines everyone else.
23:51
<@ToxicFrog>
(the other issue is in math/logic expressions, which I need to apply the Refactor Tractor to in any case in order to get precedence working right)
23:52
<@McMartin>
(Ah yes.)
23:57 * ToxicFrog gnaws
23:58
<@Consul>
What is the Refactor Tractor, anyway?
--- Log closed Sat Dec 20 00:00:38 2008
code logs -> 2008 -> Fri, 19 Dec 2008< code.20081218.log - code.20081220.log >