code logs -> 2009 -> Wed, 06 May 2009< code.20090505.log - code.20090507.log >
--- Log opened Wed May 06 00:00:40 2009
00:15 You're now known as TheWatcher[T-2]
00:21 You're now known as TheWatcher[zZzZ]
00:23 * McMartin digs through the guts of libobjc.
00:38 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
00:39 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
00:39 mode/#code [+o Attilla] by ChanServ
01:14 Consul [~consul@Nightstar-3183.dsl.sfldmi.ameritech.net] has quit [Quit: Leaving]
01:20 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Z?]
02:01 Consul [~consul@Nightstar-3183.dsl.sfldmi.ameritech.net] has joined #code
02:01 mode/#code [+o Consul] by ChanServ
02:02
<@Derakon>
Hrm. Dealing with this climbing animation is going to be a pain.
02:02
<@Derakon>
Because the animation intrinsically involves changing the player's location.
02:37 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Quit: <Insert Humorous and/or serious exit message here>]
02:42 Vornicus-Latens is now known as Vornicus
03:14 Netsplit DeepThought.NY.US.Nightstar.Net <-> Blargh.CA.US.Nightstar.Net quits: NSGuest-306, crem_, @GeekSoldier
03:14 crem [~moo@Nightstar-28703.adsl.mgts.by] has joined #code
03:53 Vornicus is now known as Vornicus-Latens
04:02 EvilDarkLord [~jjlehto3@Nightstar-9591.cs.hut.fi] has joined #code
04:03 EvilDarkLord is now known as NSGuest-320
05:03
<@Derakon>
Seen in another channel: "pythong 2.4".
05:24 Reiv [~82d94c4d@Nightstar-29731.dsl.in-addr.zen.co.uk] has joined #Code
05:25
< Reiv>
halp
05:26
< Reiv>
I need a script/thingy to remove the newlines from strings in a csv file.
05:27 * Reiv is bamboozled by this.
05:32
<@Derakon>
So there should be no newlines at all?
05:33
<@Derakon>
If that's the case, open the file in vim, and type :%s/\n//g
05:33
<@Derakon>
Then type :wq to close the file.
05:37
< Reiv>
Alas: 1) .csv files need each row of data on a single line. 2) I'm on windows >.<
05:37
< Reiv>
...although there /is/ a linux box accross the room...
05:38
<@Derakon>
For the former, if there's a character you know won't appear in the file ('|', say), you can do :%s/$/| to mark the desired newlines, and then re-insert them after.
05:38
< Reiv>
So if I get the command right I might almost be desperate enough to give it a shot~
05:38
<@Derakon>
Also, you should be able to get vim on Windows.
05:39
< Reiv>
Probably, but these are lab machines,, so
05:44
< Reiv>
...ooh.
05:45
< Reiv>
How can I find a newline using a regex?
05:45
<@Derakon>
\n and \r are the usual suspects.
05:45 * Reiv just got ConTEXT running off a USB stick.
05:45
< Reiv>
blarg, no dice
05:46 * Reiv screams. This is worth 7% of his final grade, and he /can't even start because the data is dodgy/
05:46
<@Derakon>
How much data?
05:47
<@Derakon>
If it's not too much, you could fix it by hand.
05:47
< Reiv>
And the instructions given - "Use Excel for a find&replace" do not work.
05:47
<@Derakon>
Excel probably has a bunch of settings for importing CSVs since there's so many ways to make them.
05:47
<@Derakon>
I know OOO does.
05:47
< Reiv>
I have 648 lines for 274 entries.
05:48
<@Derakon>
Hm. So about fifteen minutes' work, sounds like.
05:48
<@Derakon>
Annoying, but doable.
05:48
< Reiv>
File 1/3.
05:49
<@Derakon>
Ahh.
05:49
< Reiv>
>.>
05:54
< Reiv>
According to Excel, every instance of Alt+010 is fixed on the file.
05:54
< Reiv>
Ha.
05:55
<@Derakon>
How do you tell the difference between a newline in the middle of an entry and one at the end?
05:55
<@Derakon>
Count the commas?
05:57
< Reiv>
Newline in the middle is inside a string.
05:58
<@Derakon>
Ah, so your delimiter is properly ","
05:58
<@Derakon>
(That is, a comma surrounded by quotation marks)
05:58
< Reiv>
data,"data",data,"Data \n data2",\n
05:58
<@Derakon>
Oh.
05:59
<@Derakon>
I was about to say "Okay, maybe you can make a regex that searches for newlines that aren't at the end of lines" but then I realized what I was saying.
05:59
< Reiv>
(data that is non-text is not in a string - flat numbers, etc)
06:00
<@Derakon>
What you could do is only eliminate newlines that are not immediately preceded by a comma
06:01
<@Derakon>
In vim, :%s/[^\(,\)]\n/\1/g
06:01
< Reiv>
That could work.
06:01
<@Derakon>
...no, wait, that's broken.
06:01
< Reiv>
Can I have them repaced by a space?
06:02
<@Derakon>
It's not properly preserving the preceding character.
06:02
<@Derakon>
Sure, you can replace the newline with anything you want.
06:02
< Reiv>
I want the unwanted newlines to turn into spaces.
06:02
<@Derakon>
Ah, there we go.
06:02
<@Derakon>
:%s/\([^,]\)\n/\1 /g
06:02
<@Derakon>
Had my parens in the wrong place.
06:03
< Reiv>
So how do I load files into vim?
06:03 Syloqs-AFH [Syloq@ServicesAdmin.Nightstar.Net] has quit [Connection reset by peer]
06:03
<@Derakon>
Um, I usually do "vim filename" from the commandline. If you have a graphical client it probably has a file browser.
06:04
< Reiv>
Okay.
06:04 * Reiv attempts to login to the linux machine.
06:05
<@Derakon>
Here's an explanation of the command, by the way: http://paste.ubuntu.com/165299/
06:05
<@Derakon>
I should note that it's entirely possible that you're dealing with Windows newlines here, in which case \n may not capture them. But it's worth trying.
06:10 Vornicus-Latens [~vorn@ServicesOp.Nightstar.Net] has quit [Ping Timeout]
06:26 Vornicus [~vorn@ServicesOp.Nightstar.Net] has joined #code
06:26 mode/#code [+o Vornicus] by ChanServ
06:56 Reiv [~82d94c4d@Nightstar-29731.dsl.in-addr.zen.co.uk] has quit [Quit: CGI:IRC (EOF)]
07:02 Derakon is now known as Derakon[AFK]
08:05 Bob_Work [c6b3e33b@Nightstar-14595.mibbit.com] has joined #Code
08:05
< Bob_Work>
Javascript help, anyone?
08:14 AnnoDomini [~farkoff@Nightstar-29333.neoplus.adsl.tpnet.pl] has joined #Code
08:14 mode/#code [+o AnnoDomini] by ChanServ
08:17 Namegduf [namegduf@86.29.157.ns-3965] has quit [Quit: Time to go, see you all this evening.]
08:34 You're now known as TheWatcher
08:38
< Bob_Work>
nm, fixed it.
08:38 * Bob_Work shakes fist at FF and it's inherent hatred of javascript.
09:14 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
09:14 mode/#code [+o gnolam] by ChanServ
09:32
<@TheWatcher>
FF doesn't have javascript. Javascript is just a dozen subtly different, excementally badly documented implementations of a nigh-unspecified language.
09:45
< Bob_Work>
Still...3 hours to figure out I have to wrap a button inside a form to get a function to work properly in FF?
09:47
< Bob_Work>
bah. At least I can take comfort in knowing I have the best. damn. boss. ever.
09:48
< Bob_Work>
While frustrated and trying to figure out the aforementioned problem, I asked the boss if she needed help with anything. The response? "No, get back to your homework! It's due tomorrow!"
10:11
< simontwo>
former school teacher?
10:12
< Bob_Work>
Nope.
10:16 You're now known as TheWatcher[afk]
10:29
< simontwo>
former boss? ;-)
10:32
< Bob_Work>
Hopefully not. :P
10:56 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
10:56 mode/#code [+o Attilla] by ChanServ
11:01 Bob_Work [c6b3e33b@Nightstar-14595.mibbit.com] has quit [Quit: http://www.mibbit.com ajax IRC Client]
11:50 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
12:00 You're now known as TheWatcher
12:50 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
12:51 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
12:51 mode/#code [+o Attilla] by ChanServ
13:51 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
14:06 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
14:06 mode/#code [+o Attilla] by ChanServ
14:11 AnnoDomini [~farkoff@Nightstar-29333.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
14:15 AnnoDomini [~farkoff@Nightstar-29510.neoplus.adsl.tpnet.pl] has joined #Code
14:15 mode/#code [+o AnnoDomini] by ChanServ
14:17 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
14:20 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
14:20 mode/#code [+o Attilla] by ChanServ
15:31 NSGuest-320 is now known as EvilDarkLord
15:31 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
16:02 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
16:02 mode/#code [+o Attilla] by ChanServ
16:04 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
16:05 Syloqs_AFH is now known as Syloqs-AFH
16:33
<@gnolam>
Can you use SDL to load textures without setting a graphics mode?
16:40
<@TheWatcher>
SDL_Image's IMG_Load should work without setting a graphics mode, IIRC
16:42
<@gnolam>
Good.
16:43
<@gnolam>
Because SDfaiL apparently can't set a decent graphics mode to save its own life.
16:43
<@gnolam>
So we have to find another library to take its place. :P
17:00 Derakon[AFK] is now known as Derakon
17:09 Namegduf [namegduf@86.29.157.ns-3965] has joined #code
17:25 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
17:26 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
17:26 mode/#code [+o Attilla] by ChanServ
17:36
<@gnolam>
Oh for fuck's sake.
17:46 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
17:48
<@McMartin>
Generally speaking, X will not let you set any graphics mode that it doesn't feel like letting you set.
17:50
<@gnolam>
I know. But it fails under Windows as well. :P
17:51
<@McMartin>
There's an option to force the shift, but I don't remember what it is offhand, and I don't know if it requires UAC/RaA
17:51
<@McMartin>
We ran into this for UQM too, and even there I think X just gave us a tiny little window surrounded by blackness
17:52
<@McMartin>
... let me see if it force-respects aspect ratio, since I remember VirtualBox tended to die horribly under those circumstances
17:53
<@McMartin>
... yup, UQM successfully set 320x240 on a 16:10 screen, while VBoxSDL crashes when set to fullscreen with a 4:3 monitor.
17:55
<@gnolam>
We're forced to use bloody /GLUT/ here.
17:55
<@gnolam>
Since SDL just plain fails at setting any usable mode.
17:55
<@McMartin>
Anyone who voluntarily uses GLUT deserves what they get~
17:55
<@gnolam>
Fuck you,
17:56
<@gnolam>
I'm sick and tired of this.
17:56
<@gnolam>
We've lost bloody days because of this shit.
17:56
<@McMartin>
SDL_Video = SDL_SetVideoMode (ScreenWidthActual, ScreenHeightActual, 32, SDL_SWSURFACE | SDL_ANYFORMAT | SDL_FULLSCREEN);
17:56
<@gnolam>
Yeah. Now try that with OpenGL.
17:56
<@gnolam>
Under no OS does it give us a double buffered mode.
17:56
<@McMartin>
One moment while I consult the OpenGL version of that file.
17:57
<@gnolam>
Under Windows, /one/ of us gets a usable mode - one that doesn't tear itself apart.
17:57
<@McMartin>
Call SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
17:57
<@McMartin>
before SDL_SetVideoMode
17:58
<@gnolam>
Now why didn't I think of that? Oh wait, I did. It doesn't. Fucking. WORK.
17:58
<@McMartin>
You will also want to set SDL_GL_RED_SIZE, GREEN, and BLUE.
17:58
<@gnolam>
It creates a window, but refuses to update it.
17:58
<@gnolam>
SDL_Flip or no SDL_Flip.
17:58
<@McMartin>
gnolam: Given your vast, echoing ignorance of the basics of the library already demonstrated, I have to assume you don't know anything.
17:58
<@McMartin>
Do Sable or UQM in OpenGL mode even run on your machines?
17:58 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
17:59 mode/#code [+o Attilla] by ChanServ
17:59
<@gnolam>
And yes, we've tried any conceivable combination of SDL_GL_*_SIZEs.
17:59
<@gnolam>
Do not know.
17:59
<@Derakon>
Try.
18:00
<@Derakon>
And if they do work, you can copy their code, and if that doesn't work, then you're doing something wrong elsewhere.
18:00
<@McMartin>
SDL_GL_SwapBuffers().
18:01
<@McMartin>
Actually, Sable may be difficult to acquire at the moment since I think my homepage was taken down yesterday.
18:01
<@McMartin>
Hm, nope. Still up for now. http://www.stanford.edu/~mcmartin/sable/sable-1.0-src.tgz
18:04
<@McMartin>
(Root URL there also includes Windows Binaries)
18:04
<@Derakon>
To be quite honest, in your situation I'd've resorted to code theft long ago~
18:06 * TheWatcher notes that code theft isn't required, when, say, almost every NeHe tutorial past 6 has SDL versions that demonstrate double buffering
18:07
<@Derakon>
That was what I meant.
18:07
<@Derakon>
Copy something that works, tweak it towards your use case, testing after every change to make certain it still works.
18:08
<@McMartin>
That said, I again from UQM experience know for a fact that certain versions of SDL have buggy routines in their SIMD blitters. Shouldn't affect OpenGL, but.
18:08 You're now known as TheWatcher[afk]
18:11
<@Derakon>
"Organized protest groups are generally considered a sign of bad usability, but I guess therešs a limit to how much you can expect from a $14 million system. And of course, the dryers still donšt dry." -- The Daily WTF
18:21 Syloqs-AFH [Syloq@ServicesAdmin.Nightstar.Net] has quit [Connection reset by peer]
18:26 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
18:28 Syloqs_AFH is now known as Syloqs-AFH
19:25 You're now known as TheWatcher
19:26 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
19:26 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
19:28 * jerith ponders runtime switching of libraries in a test suite and the least horrible way of doing it.
19:30
<@jerith>
Here's the backstory: Said library is heavily dependent on a third-party web service. The unit tests currently make calls to said service.
19:30
<@jerith>
Well, the test version of said service.
19:31
<@jerith>
They're one of the few places nice enough tp provide a public sandbox.
19:31
<@jerith>
Which is about the best thing I can say about them, really.
19:32
<@jerith>
But anyway, this test service is sometimes broken which makes tests fail. Also, tests run at build time and the build machine should not have external deps.
19:32
<@jerith>
So, I want to stub out the library for the common case.
19:33
<@jerith>
But I still want to hit it when I'm testing by hand, to make sure that I haven't broken something that my stubs don't catch.
19:34
<@jerith>
However, given the amount of tests involved, I really don't want to have to write everything twice.
19:35
<@jerith>
So I want to somehow inject something into the system that will switch between stubs and live.
19:35
<@jerith>
My question: Am I utterly insane?
19:36
<@jerith>
Also, has anyone done this kind of thing and can perhaps provide warnings or advice?
19:47 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
19:52 crem [~moo@Nightstar-28703.adsl.mgts.by] has quit [Quit: Ep0xa 1.2v]
20:32 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
21:33
<@Derakon>
Thoughts on this approach to handling bounding polygons for animations? http://paste.ubuntu.com/165681/
22:44 AnnoDomini [~farkoff@Nightstar-29510.neoplus.adsl.tpnet.pl] has quit [Quit: Reading is tech.]
23:25
<@Consul>
BSOD has to be the best Linux screensaver ever.
--- Log closed Thu May 07 00:00:55 2009
code logs -> 2009 -> Wed, 06 May 2009< code.20090505.log - code.20090507.log >