--- Log opened Tue Sep 06 00:00:14 2011 |
00:02 | | Vash [Vash@Nightstar-f03c5637.sd.cox.net] has joined #code |
00:34 | < Phox> | Hey, is there an easy way to pause program flow in C? I'm using while(getchar() != '\n');, but that means only the enter button continues |
00:35 | < Derakon> | What are you looking for, exactly? |
00:36 | < Phox> | Well, it's a program to simulate a game of war, and I'd like it to stop after every turn and wait for any keypress before showing the next turn |
00:36 | < ToxicFrog> | Phox: if you're looking for "pause until the user presses any key at all", this is harder than it looks and, as a rule, not portable. |
00:36 | < Phox> | Yeah, that's what I've been reading |
00:36 | < ToxicFrog> | Your best bet is something like curses, I think. |
00:36 | < Phox> | And getch()? |
00:36 | < gnolam> | Not portable. |
00:36 | < Phox> | Hmm |
00:36 | < ToxicFrog> | Possibly? It's been years since I actually used curses. |
00:36 | < gnolam> | Not standard. |
00:37 | < ToxicFrog> | gnolam: there is no portable solution to what he wants. |
00:37 | < gnolam> | True dat. |
00:37 | < ToxicFrog> | As you would know if you bothered to actually read the conversation rather than randomly shitting all over it. |
00:37 | < Derakon> | Doesn't SDL have some event handling abstractions? |
00:37 | < Phox> | Anywhoo, it's gotta be standard, because it's not going to be compiled for marking on my machine |
00:38 | < Phox> | Which, as far as I know, limits me to getchar, getc, and system("PAUSE") |
00:38 | < Phox> | The first two are alright-ish. I can live with only pressign enter |
00:38 | < Phox> | I'd just prefer better |
00:38 | < ToxicFrog> | Phox: "not marked on your machine" does not necessarily imply "standard"; here it means "your program will be compiled and tested on the lab systems". |
00:38 | < Phox> | And system is just bad form |
00:39 | < ToxicFrog> | (which, since they run linux, basically means anything in linux + any library you can plausibly include in your source tree is fair game, provided it doesn't violate other constraints of the assignment) |
00:39 | < Phox> | Right, except he's built a specific development environment. Code::Blocks, mingcw |
00:40 | < Phox> | I don't think he's got anything fancy in there |
00:40 | < ToxicFrog> | But yeah, if you're looking for something that works anywhere, you either need something heavy (curses, SDL, etc) or something crude (press enter to continue) |
00:40 | < Phox> | Hmm |
00:45 | < Phox> | Oh, lucky. I re-read the assignment, and he wants teh whole project folder, not just the source code. Means I can totally include curses |
00:45 | < Phox> | *the |
01:07 | < celticminstrel> | XD |
01:15 | | gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Z?] |
01:37 | | Phox is now known as Phox|BBQ |
02:17 | | Phox|BBQ is now known as Phox |
02:42 | | Kindamoody[zZz] is now known as Kindamoody |
03:23 | | Omega [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code |
03:24 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Ping timeout: 121 seconds] |
03:29 | | Omega [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Ping timeout: 121 seconds] |
03:31 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code |
03:39 | | kw-sleep-n is now known as kwsn |
03:45 | | cpux is now known as shade_of_cpux |
03:50 | | Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.] |
03:53 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Ping timeout: 121 seconds] |
03:53 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code |
04:29 | | Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code |
05:08 | | gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code |
05:34 | | shade_of_cpux [chatzilla@Nightstar-c5874a39.dyn.optonline.net] has quit [Connection closed] |
05:58 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Ping timeout: 121 seconds] |
06:00 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code |
06:01 | | kwsn is now known as kw-sleep-n |
06:09 | | Omega [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code |
06:10 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Ping timeout: 121 seconds] |
06:15 | | Omega is now known as Alek |
06:26 | | celticminstrel [celticminstre@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
06:38 | | Derakon is now known as Derakon[AFK] |
06:55 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Ping timeout: 121 seconds] |
06:56 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code |
08:05 | | Vornicus is now known as Vornicus-Latens |
08:59 | | Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has joined #code |
09:02 | | Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds] |
09:20 | | Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has joined #code |
09:28 | | Vash [Vash@Nightstar-f03c5637.sd.cox.net] has quit [[NS] Quit: BWAHAHAHAHHA! ] |
11:54 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Ping timeout: 121 seconds] |
11:54 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code |
12:39 | | Kindamoody is now known as Kindamoody|out |
13:10 | | celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code |
14:40 | | kw-sleep-n is now known as kwsn |
15:17 | | AnnoDomini [annodomini@60F158.737D66.CA1918.CC7562] has joined #code |
15:46 | | AnnoDomini [annodomini@60F158.737D66.CA1918.CC7562] has quit [Ping timeout: 121 seconds] |
15:47 | | AnnoDomini [annodomini@60F158.737D66.CA1918.CC7562] has joined #code |
17:13 | | AnnoDomini is now known as MandatumGwyn |
17:31 | < kwsn> | SEMICOLONS D< |
17:36 | < MandatumGwyn> | What do you have against semicolons? |
17:38 | | Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Connection reset by peer] |
17:39 | | Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code |
17:40 | < kwsn> | i forget them now and then |
17:40 | <@froztbyte> | \o/ pythons |
17:40 | <@froztbyte> | etc |
17:40 | <@froztbyte> | I hate php and friends for the semicolons and dollarsigns |
17:45 | < kwsn> | i'm on C right now |
17:46 | <@froztbyte> | g'luck :/ |
18:10 | < gnolam> | Hmm |
18:10 | < gnolam> | I don't suppose any good free electronics design programs have magically appeared in the last couple of years? |
18:19 | | MandatumGwyn [annodomini@60F158.737D66.CA1918.CC7562] has quit [[NS] Quit: Reconnecting] |
18:20 | | MandatumGwyn [annodomini@60F158.737D66.CA1918.CC7562] has joined #code |
18:36 | <@froztbyte> | gnolam: not sure, but I'd check the blogs of megaohm, hack-a-day and such to find out |
18:36 | <@froztbyte> | Hack-A-Day, Mighty Ohm, Openschemes, Dangerous Prototypes, RepRap |
18:36 | <@froztbyte> | those are the ones in my feedreader |
18:37 | <@froztbyte> | Sparkfun and adafruit as well, I guess? |
18:51 | < gnolam> | Ugh. Hack-a-Day. I refuse to give their uncapitalized blog any page hits. :P |
18:56 | < kwsn> | oh? |
18:56 | < kwsn> | are you that much of a snob gnolam? |
18:59 | | Kindamoody|out is now known as Kindamoody |
19:01 | < gnolam> | Snob? It's fucking painful to read. |
19:11 | | RichardBarrell [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code |
19:32 | | Kindamoody is now known as Kindamoody[zZz] |
19:39 | <@froztbyte> | there are worse things out there |
19:41 | < gnolam> | I have very little patience with people who intentionally mangle their communication. |
19:46 | | RichardBarrell [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [Client closed the connection] |
19:58 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Client closed the connection] |
19:58 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code |
20:03 | | RichardBarrell [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code |
20:08 | | Omega [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code |
20:08 | | Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Ping timeout: 121 seconds] |
20:17 | | MandatumGwyn [annodomini@60F158.737D66.CA1918.CC7562] has quit [[NS] Quit: NANANANANANA BATMAN.] |
20:21 | < gnolam> | Anyway. I got KiCad recommended to me. |
21:01 | < kwsn> | 15:52:50 <franny> "Richard Stallman & GNU Present Richard Stallman's GNU/Linux Featuring GNU" |
21:01 | < kwsn> | 15:53:06 * kwsn bludgeons you with EMACS |
21:01 | < kwsn> | :P |
21:01 | < kwsn> | 15:53:15 <kwsn> i would use Vim, but it's not as heavy and bloated |
21:01 | < kwsn> | 15:53:34 <franny> It comes close. :) |
21:01 | < kwsn> | 15:53:43 <kwsn> and my name is Sven :P |
--- Log closed Tue Sep 06 21:10:50 2011 |
--- Log opened Tue Sep 06 21:14:47 2011 |
21:14 | | TheWatcher [chris@Nightstar-3762b576.co.uk] has joined #code |
21:14 | | Irssi: #code: Total of 25 nicks [7 ops, 0 halfops, 0 voices, 18 normal] |
21:15 | | Irssi: Join to #code was synced in 38 secs |
21:17 | < kwsn> | i'm making a joke |
21:18 | < kwsn> | on how EMACs is bloated and hueg |
22:17 | <@jerith> | Emacs is just the right size. :-) |
22:22 | | * TheWatcher gets out the official Barge Pole |
22:23 | | * McMartin tends towards the "Emacs is only huge if you charge the entirety of /etc to the size of bash" school. |
22:34 | <@Namegduf> | Yeah, and KDE is only huge if you count its libraries. |
22:34 | <@Namegduf> | :P |
22:35 | <@Namegduf> | And busybox is the size of the kernel! |
22:35 | < gnolam> | kwsn: yes, the first part I got. But the Sven thingy? |
22:36 | < gnolam> | Also, I stick to my opinion that emacs's sole virtue is its near universal availability on unices. |
22:36 | <@McMartin> | That is usually offered as vim's sole virtue |
22:38 | < gnolam> | Emacs and vim are pretty much the same to me. Needlessly complicated editor relicts. |
22:52 | <@McMartin> | Hm. |
22:53 | | * McMartin renames procedural programming Imperative-Oriented Software Architecture |
22:53 | <@McMartin> | ALL SHALL FALL BEFORE IOSA THE INVINCIBLE |
22:54 | < simon_> | in Haskell, is there a built-in name for filtering Nothings out of a list? |
22:54 | <@McMartin> | Yes, sec |
22:55 | <@McMartin> | (You can of course write one in two lines, but there's something in Prelude for it) |
22:55 | < simon_> | that's what I'm thinking. |
22:55 | | * McMartin was looking for something else - unwords, IHRC - and skimmed over something that looked like that |
22:56 | < simon_> | there's a built-in for swapping the args of a curried function, right? |
22:56 | < simon_> | swap f x y = f y x |
22:56 | <@McMartin> | Hrm. I don't see it |
22:57 | <@McMartin> | There it is. |
22:57 | <@McMartin> | Data.Maybe.catMaybes :: [Maybe a] -> [a] |
23:00 | < simon_> | cool! |
23:02 | <@McMartin> | I credit working in Java for six years or so for superior API docwalking skills |
23:03 | < simon_> | ;-) |
23:03 | < simon_> | and the swap function, do you know if it has a name? |
23:04 | <@McMartin> | Prelude.flip :: (a -> b -> c) -> b -> a -> c |
23:04 | < simon_> | ah, flip. |
23:04 | <@McMartin> | Oh neat, "until" |
23:04 | | * McMartin was unaware of that. |
23:09 | | * simon_ is taking an "Advanced Programming" course now |
23:09 | < simon_> | it's basically Haskell, Erlang and Prolog in 7 weeks. |
23:10 | <@McMartin> | That's quite a trek |
23:10 | < simon_> | with a focus on specifical features of those languages. |
23:10 | < simon_> | specific |
23:10 | <@McMartin> | This is also kind of weird, because IIRC I mostly learned Haskell from you. ;-) |
23:10 | < simon_> | uh |
23:10 | < simon_> | I think you've got the wrong Simon. :) |
23:10 | | simon_ is now known as Simon_Shine |
23:10 | < Simon_Shine> | :) |
23:11 | <@McMartin> | Ah, so I do. I had you confused with the Simon who also went by MCV. |
23:11 | < Simon_Shine> | ok. |
23:11 | < Simon_Shine> | I just love how my exercise answers end up being point-free one-liners. |
23:12 | <@McMartin> | I have an unhealthy fascination with point-free programming >_> |
23:13 | < Simon_Shine> | morse = flip Map.lookup $ morse_map |
23:13 | < Simon_Shine> | encode = concat . Maybe.catMaybes . map morse |
23:13 | <@McMartin> | \o/ |
23:13 | <@McMartin> | (My most recent Silly Haskell thing was to implement a graphical cellular automaton with the rendering engine being a map-reduce operator) |
23:14 | < Simon_Shine> | I'm not sure of the implications, but it sounds fun. |
23:14 | <@McMartin> | It's just mapping a traditionally imperative system into a functional paradigm, and in practice it didn't work out too well. |
23:14 | < Simon_Shine> | for decode, the assignment is to return the list of all possible decodings of a bunch of dots and periods. it sounds like a job for combinator parsers, don't it? |
23:15 | < Simon_Shine> | right. |
23:15 | | Vornicus-Latens is now known as Vornicus |
23:15 | <@McMartin> | Parsec is fun, but nuclear-powered. |
23:18 | < Simon_Shine> | I did a pretty-printer for simple mathematical expressions trying to reduce the number of parentheses: http://pastie.org/2494108 -- it didn't end up very high-level, and I'm not sure how to do that. I'll ask a TA. |
23:19 | <@McMartin> | Yeah, I'd suggest doing that |
23:19 | <@McMartin> | I like your code style, though~ |
23:20 | < Simon_Shine> | I've done Standard ML, so I end up relying on pattern matching a lot. |
23:21 | <@McMartin> | The only thing I might point out is somethign I suddenly realize I'm not clear on... |
23:22 | <@McMartin> | you have opt_paren (Add e1 e2) = .... |
23:22 | <@McMartin> | and then reuse (Add e1 e2) |
23:22 | < Simon_Shine> | yeah, I don't know how the 'as' feature works in Haskell. |
23:22 | <@McMartin> | Can you use the form op@(Add e1 e2) and then use "op" as the reference to the whole thing, or does that trick only work on lists? |
23:22 | < Simon_Shine> | in SML I'd do opt_paren (e as Add _) = ... |
23:23 | < Simon_Shine> | sounds like @ is SML's as. |
23:23 | <@McMartin> | Yeah |
23:23 | <@McMartin> | let foo l@(h:t) = h:l |
23:24 | <@McMartin> | Then foo "abc" -> "aabc" |
23:24 | < Simon_Shine> | cool, then I learned that bit of syntax, too. |
23:24 | < Simon_Shine> | thanks. and good night. :) |
23:24 | <@McMartin> | But I've only ever used that on lists |
23:25 | <@McMartin> | Looksl ike it works with Maybe, too, so yeah, that's "as" |
23:37 | | shade_of_cpux [chatzilla@Nightstar-c5874a39.dyn.optonline.net] has joined #code |
23:38 | | shade_of_cpux is now known as cpux |
23:40 | | You're now known as TheWatcher[T-2] |
23:42 | | You're now known as TheWatcher[zZzZ] |
--- Log closed Wed Sep 07 00:00:37 2011 |