code logs -> 2013 -> Sat, 28 Dec 2013< code.20131227.log - code.20131229.log >
--- Log opened Sat Dec 28 00:00:31 2013
00:13 Kindamoody|out is now known as Kindamoody
00:38 Kindamoody is now known as Kindamoody[zZz]
01:12 Vornicus [Vorn@Nightstar-sn7kve.sd.cox.net] has quit [Connection closed]
01:17 Orth [orthianz@Nightstar-5m8.1ee.224.119.IP] has quit [Ping timeout: 121 seconds]
01:18 Orthia [orthianz@Nightstar-5m8.1ee.224.119.IP] has joined #code
01:18 mode/#code [+o Orthia] by ChanServ
01:24 Turaiel is now known as Turaiel[Offline]
01:26 You're now known as TheWatcher[t-2]
01:28 You're now known as TheWatcher[zZzZ]
01:28 Turaiel[Offline] is now known as Turaiel
01:38 Turaiel is now known as Turaiel[Offline]
01:40 Turaiel[Offline] is now known as Turaiel
03:04 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
03:14 Turaiel is now known as Turaiel[Offline]
03:15 Turaiel[Offline] is now known as Turaiel
03:30 Turaiel is now known as Turaiel[Offline]
03:33 Turaiel[Offline] is now known as Turaiel
03:34 Turaiel is now known as Turaiel[Offline]
03:36 Turaiel[Offline] is now known as Turaiel
04:05 Turaiel is now known as Turaiel[Offline]
04:06 Turaiel[Offline] is now known as Turaiel
04:11 * Thalass|snakey aughs at python lists, looks into the csv module
04:11
<&Derakon>
What's wrong with lists?
04:32
< Syka>
why would you need to look at csv
04:32
< Syka>
that is generally the last thing you ever need to do
04:41
< Thalass|snakey>
heh
04:44
< Thalass|snakey>
I'm bodging together a flashcard program in python. Taking a list of english words from one text file, and french words from another, and then trying to turn them into a pair of lists, so that it can call up item 3 in both lists, show me one word and compare my answer to the corresponding word in the other list.
04:46
< Thalass|snakey>
What i get is either a blank output pair, or "string index out of range"
04:47
<&ToxicFrog>
This is not a problem with Python lists, but with your code.
04:47
<&ToxicFrog>
That said
04:47
<&ToxicFrog>
You probably want to zip() the lists together to get one list, which will be easier to work with.
04:48
<&ToxicFrog>
>>> zip(["hello", "goodbye"], ["bonjour", "au revoir"])
04:48
<&ToxicFrog>
[('hello', 'bonjour'), ('goodbye', 'au revoir')]
04:49
<&McMartin>
++
04:52
< Syka>
McMartin++, now with templates
04:53
<&Derakon>
"String index out of range" means you're trying to index into a string, not a tuple or list.
04:53
<&Derakon>
Like, "foo"[0] == 'f'
04:54
<&Derakon>
But yeah, you should be able to generate your list via zip(open('file1.txt', 'r').readlines(), open('file2.txt', 'r').readlines())
04:54
<&Derakon>
Assuming each word is on its own line.
04:55
<&Derakon>
Mind, that'll keep the newline at the end of the line, but I'm sure you can fix that yourself.
04:55
<&McMartin>
When I've done similar things, I've used something like | for a divider in one file and then used split()
04:55
<&McMartin>
It makes it easier to keep the two files in sync
04:56
<&Derakon>
Ah, yeah.
04:57
<&Derakon>
Just one file, lines are like "hello|bonjour", "goodbye|au revoir".
04:57
<&Derakon>
pairs = [line.split('|') for line in open('file.txt', 'r').readlines()]
05:05
< Thalass|snakey>
I figured it was my code, but wasn't sure where. Lots of reading to do
05:07
< Thalass|snakey>
also: augh midnight
05:07 Thalass|snakey is now known as Thalass|slep
05:09 Derakon is now known as Derakon[AFK2]
05:11 Kindamoody[zZz] is now known as Kindamoody
05:30 Vornicus [Vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
05:30 mode/#code [+qo Vornicus Vornicus] by ChanServ
05:38 iospace is now known as io\passed_out
05:54 harlow [harlow@Nightstar-2dbe3d64.il.comcast.net] has joined #code
06:30 Turaiel is now known as Turaiel[Offline]
06:42 Kindamoody is now known as Kindamoody|afk
06:46 RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.]
06:49 RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has joined #code
08:39 ErikMesoy|sleep is now known as ErikMesoy
09:10 AbuDhabi1 [AbuDhabi@Nightstar-q2urfa.adsl.tpnet.pl] has quit [[NS] Quit: leaving]
09:19 Stalker [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
09:28 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code
09:29 harlow [harlow@Nightstar-2dbe3d64.il.comcast.net] has quit [[NS] Quit: BED]
10:03 You're now known as TheWatcher
10:04 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
10:16 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
10:16 mode/#code [+o himi] by ChanServ
10:17 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving]
12:16 Vornotron [Vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
13:26 Vornotron [Vorn@Nightstar-sn7kve.sd.cox.net] has quit [Connection reset by peer]
13:27 Vornicus [Vorn@Nightstar-sn7kve.sd.cox.net] has quit [Connection closed]
13:47 Thalass|slep [thalass@Nightstar-bce70i.eastlink.ca] has quit [Ping timeout: 121 seconds]
14:26 io\passed_out is now known as iospace
14:34 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
15:20 Orthia [orthianz@Nightstar-5m8.1ee.224.119.IP] has quit [Ping timeout: 121 seconds]
16:32 ErikMesoy1 [Erik@Nightstar-3kot9q.80-203-17.nextgentel.com] has joined #code
16:32 ErikMesoy [Erik@Nightstar-3kot9q.80-203-17.nextgentel.com] has quit [Ping timeout: 121 seconds]
17:25 harlow [harlow@Nightstar-b902fba7.chi.megapath.net] has joined #code
17:27
< harlow>
This morning I realized how what little effort you can put in to programming a guitar hero look a like. Absolutely astounding, ~600 lines of code + use of the sfml library.
17:27
< harlow>
how* (ignore what)
17:42 ErikMesoy1 is now known as ErikMesoy
17:51 marcus [marcus@Nightstar-vos.jd4.223.179.IP] has joined #code
17:52 marcus is now known as arcius
17:58
< arcius>
Tarinaky, may i ask you one question? I am googling the entire day about one problem I'm facing and it seems you had one very similar in the past... I found your problem on google, actually, which brought me here to this channel on IRC. The problem I have is related to SDL_ttf. The link I saw your problem was here http://starforge.co.uk/irclogs/code/code.20110319.log.html
17:59
< arcius>
around 4 o'clock
17:59
< arcius>
you and ToxicFrog were working together to solve it... if anyone can help me I would appreciate a lot!
18:00
<@Tarinaky>
Is it SDL1 or SDL2?
18:00
< arcius>
SDL2
18:01
< arcius>
I'm using ubuntu 13.10... it's working SDL2_main and SDL2_image. I was trying to put some text on the framework I'm working on, but then this weird error appeared... "Couldn't load font file"
18:01
<@Tarinaky>
Then I'm not sure I ever got it working. This was about as far as I ever really got with sdl2 http://reservedmemoryblog.blogspot.co.uk/2012/08/sdl20-to-create-modern-opengl-c ontext.html
18:02
< arcius>
:(
18:03
< arcius>
Ok, thanks anyway
18:03
<@Tarinaky>
I'm rereading the log.
18:03
< arcius>
ok.. =)
18:03
<@Tarinaky>
Ahah!
18:04
<@Tarinaky>
I'm not sure if this solves your problem but:
18:04
<@Tarinaky>
Hmm, won't paste nicely into the chat.
18:04
<@Tarinaky>
Hang on
18:05
< arcius>
ok!
18:05
<@Tarinaky>
05:07 <@ToxicFrog> read(5, "\n \n\n \n\n<!DOCTYPE html>\n<html"..., 4096) = 4096
18:05
<@Tarinaky>
05:08 <@ToxicFrog> What's the output of 'file assets/a_d_mono.ttf'?
18:05
<@Tarinaky>
05:08 < Tarinaky> Hmm. HTML. :/
18:05
<@Tarinaky>
05:10 <@ToxicFrog> Welp.
18:05
<@Tarinaky>
05:10 < Tarinaky> Don't say it.
18:05
<@Tarinaky>
05:10 < Tarinaky> :p
18:05
<@Tarinaky>
05:10 <@ToxicFrog> See if it works with an actual TTF.
18:05
< arcius>
yeah, I didn't understand in the log this solution. That's why I came here
18:05
< arcius>
^^
18:06
<@Tarinaky>
I think I had downloaded the font from a website and probably tried to use wget to fetch it.
18:06
<@Tarinaky>
And consequently had downloaded a web page.
18:06
<@Tarinaky>
No doubt telling me what a naughty boy I was.
18:06
<@Tarinaky>
So it's a garbage in garbage out error.
18:07
<@Tarinaky>
TTF files are not web-pages.
18:07
< arcius>
Hum... darn... that's not what I have...
18:07
<@Tarinaky>
What's the output of file <your font>?
18:07
< arcius>
I just copied from /usr/share/fonts/truetype/freefont/
18:08
<@Tarinaky>
Try 'file <font path>'
18:08
< arcius>
FreeSans.ttf: TrueType font data
18:09
<@Tarinaky>
Okay. Well... Try strace -o program.log <executable>
18:10
< arcius>
TTF_OpenFont: Couldn't load font file
18:10
< arcius>
open("/usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
18:10
< arcius>
open("/usr/share/fonts/truetype/freefont/FreeSans.ttf", O_RDONLY) = 3
18:10
< arcius>
write(1, "TTF_OpenFont: Couldn't load font"..., 38) = 38
18:10
<@Tarinaky>
Find the first occurence of the string 'ttf' in program.log and pastebin everything ater that point.
18:10
< arcius>
I used grep
18:10
< arcius>
ok...
18:10
<@Tarinaky>
That's how we diagnosed my idiocy last time :p
18:11
< arcius>
http://pastebin.com/wrrRyRRd
18:13
<@Tarinaky>
And now you wait for someone better at this than me to divine what that means >.<
18:14
< arcius>
I download the dependencies I think I must have, I checked the permission for the file and it's saying I can either read or write... I really hate to set up anything
18:14
<@Tarinaky>
Can you try a different font file? I /think/, if I understand this correctly (I probably don't) that it's openning the ile and choking on it.
18:16
< arcius>
I know the SDL_ttf2 used the freetype 2.4.8 I downloaded it, but idk if I did the "make and configure" well
18:16
< arcius>
so i used apt-get install freetype6-dev...
18:16
< arcius>
I tried different fonts...
18:17
<@Tarinaky>
It's just it keeps seeking the start of the file and re-reading the same character string over and over.
18:18
<@Tarinaky>
read(3, "\0\251\0\255\0\1\0\257\0\257\0\f\0\263\0\263\0\6\0\264\0\270\0\1\0\273\0\276\0\ v\0\277"..., 2680) = 2680
18:20
< arcius>
Indeed
18:21
< Shiz>
can I just say I love strace
18:21
< Shiz>
and/or dtruss
18:22
< arcius>
this was supposed to be so simple... gosh...
18:24
<@Tarinaky>
There's a reason I gave up on SDL2 before getting very far with it :V
18:24
< Shiz>
arcius: it seems to believe the TTF is malformed
18:24
< Shiz>
that's what I get from this
18:24
< Shiz>
(and maybe it is)
18:24
< Shiz>
isn't there a TTF_GetLastError or something?
18:24
< Shiz>
oh
18:25
< Shiz>
there is TTF_GetError()
18:25
< Shiz>
but Iassume that actuallysays "Couldn't load font file"
18:25
< arcius>
yes, I'm using TTF_GetError and it is saying that I couldn't load the file
18:26
< arcius>
I just used SDL because I wanted to use OpenGL after... I wanna do a simple game and later I might play with OpenGL
18:26
< arcius>
or even keep working with 2D games just for fun
18:26
<@Tarinaky>
arcius: If I were you I'd skip SDL and start with OpenGL.
18:26
< Shiz>
error = FT_Open_Face( library, &font->args, index, &font->face );
18:27
< Shiz>
so freetpe reports itcan'topen the font
18:27
<@Tarinaky>
You can always load the non-graphics portions of SDL on their own.
18:27
< Shiz>
well the error isn't in SDL here
18:27
< Shiz>
it's in freetype2
18:27
<@Tarinaky>
And OpenGL is /awesome/ for 2D stuff.
18:28
< Shiz>
https://github.com/cmakified/SDL2_ttf/blob/master/SDL_ttf.c#L432
18:28
< Shiz>
this is where it fails
18:28
< arcius>
I did apt-get freetypes2-demos... do you think was that then? haha
18:28
< Shiz>
and SDL_TTF passes an error number but an appropriate format string
18:28
< Shiz>
nah
18:29
< Shiz>
inappropriate*
18:29
< Shiz>
to TTF_SetError
18:29
< Shiz>
(aka SDL_SetError)
18:30
< Shiz>
you should try using freetpye manually
18:30
< Shiz>
and see what the error it returns is
18:30
< arcius>
omg
18:31
< Shiz>
or try using a different font file
18:31
< Shiz>
:p
18:31
< arcius>
hehehe
18:31
< arcius>
the thing is that I already used some font files... I downloaded 2 and tried others from the system
18:31
< arcius>
/usr/share...
18:34
< arcius>
guys, thanks a lot
18:34
< Shiz>
well my earlier suggestion of using FT yourself still stands
18:34
< Shiz>
maybe your system freetpye library is borked
18:35
< arcius>
idk how I would use that. I'm very nb...
18:35
< arcius>
I just downloaded freetype6
18:36
< arcius>
or something like that
18:36
< Shiz>
try to replicate the FT_ calls in this function
18:36
< Shiz>
https://github.com/cmakified/SDL2_ttf/blob/master/SDL_ttf.c#L369
18:36
< Shiz>
(yeah it's pretty long)
18:36
< arcius>
yeah, i did... libfreetype6-dev
18:44
< arcius>
I'm gonna remove and install freetype
18:44
< arcius>
2.4.8
18:44
< arcius>
ops, i cant remove...
19:12 Derakon[AFK2] is now known as Derakon
19:33 arcius [marcus@Nightstar-vos.jd4.223.179.IP] has quit [Ping timeout: 121 seconds]
19:36 arcius [marcus@Nightstar-vos.jd4.223.179.IP] has joined #code
19:43 harlow [harlow@Nightstar-b902fba7.chi.megapath.net] has quit [[NS] Quit: BED]
19:50 Turaiel[Offline] is now known as Turaiel
20:08 Turaiel is now known as Turaiel[Offline]
20:08 Turaiel[Offline] is now known as Turaiel
20:16 Vornicus [Vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
20:16 mode/#code [+qo Vornicus Vornicus] by ChanServ
20:40 Turaiel is now known as Turaiel[Offline]
21:07 * Derakon ponders spellbooks for Pyrel.
21:08
<&Derakon>
Each spell is just an "object" that, currently, can only be generated within a spellbook (which in turn is a container object that is only allowed to contain spells).
21:08
<&Derakon>
I need to attach the spellcasting information to the spell object.
21:09
<&Derakon>
I already have objects that have on-use procs; spells ought to work similarly.
21:09
<&Derakon>
But I need to handle spell costs and failure rates too.
21:09
<&Derakon>
Mm...as procs, presumably.
22:19 Orthia [orthianz@Nightstar-5m8.1ee.224.119.IP] has joined #code
22:19 mode/#code [+o Orthia] by ChanServ
22:20 ErikMesoy is now known as ErikMesoy|sleep
22:29 celticminstrel [celticminst@Nightstar-qargh6.dsl.bell.ca] has joined #code
22:30 mode/#code [+o celticminstrel] by ChanServ
22:57 Turaiel[Offline] is now known as Turaiel
22:59 celticminstrel [celticminst@Nightstar-qargh6.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
23:00 celticminstrel [celticminst@Nightstar-qargh6.dsl.bell.ca] has joined #code
23:00 mode/#code [+o celticminstrel] by ChanServ
23:09 Thalass|slep [thalass@Nightstar-bce70i.eastlink.ca] has joined #code
23:15 Thalass|slep is now known as Thalass
23:31 gnolam [lenin@Nightstar-lgrapr.tbcn.telia.com] has joined #code
23:31 mode/#code [+o gnolam] by ChanServ
23:32
<@gnolam>
Note to self: if I ever meet the people who wrote Python's sqlite module, punch them in the face.
23:33
<@gnolam>
Hard.
23:34
< Syka>
hee
23:34
<@gnolam>
With knuckle dusters.
23:34
< Syka>
whyfor
23:35
<@gnolam>
For example, there's multithreading: "Older SQLite versions had issues with sharing connections between threads. Thatās why the Python module disallows sharing connections and cursors between threads. If you still try to do so, you will get an exception at runtime."
23:36
<@gnolam>
Translation: "Older versions couldn't do this. New versions can, but we won't let you because fuck you."
23:37
<@gnolam>
The extension support is the same. "A platform exists where the standard SQLite libraries aren't compiled with this feature. Therefore, we disable it for everyone because fuck you."
23:37
< Syka>
rofl
23:39
<@gnolam>
Note that "lowest common denominator" /isn't/ the standard practice for dealing with platform differences in Python. It's "available on: [list of platforms]".
23:39
<@gnolam>
I can only conclude that they've done this out of pure spite.
23:44
<@gnolam>
Oh, and did I mention that extensions are necessary for free text search support?
23:45 * gnolam adds "with a fucking trench spike" to his note.
23:50
< Turaiel>
When completing a programming challenge for a company I'm applying for, if they haven't specified that I cannot use third party code, do you think it would be fair to use an algorithm implementation from Rosetta Code?
23:54
<@Tarinaky>
It's not so much a question of 'fair' so much as whether you adequately demonstrate the skills they're looking for you to demonstrate.
23:55
<@Tarinaky>
If your entire program consists of int main() { return solve_problem(7); }
23:55
<@Tarinaky>
You're not demonstrating a lot.
23:55
< Turaiel>
What they told me: "Keep in mind the goal of this challenge: impress us with your skills of problem solving, learning to apply new tools to a tricky situation, and delivering something of value to the customer. Complete software is less important to us than understanding what you've learned, challenges you faced, and seeing your approach to the situation."
23:56
< Turaiel>
I have adequate programming skills, but the challenge has me working with a new language and I'm not familiar with ray-casting
23:56
<@Tarinaky>
Well, then it probably isn't verboten to use third party code in and of itself (that's properly attributed and licensed~)
23:57
<@Tarinaky>
But frankly, I can't answer that question without reading the mind of the person who set it.
23:57
<@Tarinaky>
So do what you want.
23:57
< Turaiel>
I attributed it by URL. It doesn't appear to have a license associated with it other than GNU FDL
23:57
< Turaiel>
Which is not a code license
23:58
<@Tarinaky>
If you think using third party code is the correct thing to do then do it - to demonstrate that you think that's the correct thing to do.
23:58
<@Tarinaky>
I'd be... cautious about using code you can't license adequately though.
23:58
< Turaiel>
I know, but it's the only ray casting algorithm available for Racket
23:58 Stalker [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
23:59
< Turaiel>
Or rather, the only implementation
23:59
<@Tarinaky>
Well. I'd be tempted to fall on the other-side of the knife to you I think.
23:59
<@Tarinaky>
But that doesn't mean you're wrong.
23:59
< Turaiel>
I feel really iffy about it.
--- Log closed Sun Dec 29 00:00:00 2013
code logs -> 2013 -> Sat, 28 Dec 2013< code.20131227.log - code.20131229.log >

[ Latest log file ]