--- Log opened Wed Dec 19 00:00:32 2012 |
00:45 | | You're now known as TheWatcher[T-2] |
00:53 | | You're now known as TheWatcher[zZzZ] |
01:19 | | RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has quit [[NS] Quit: Leaving] |
01:39 | | syksleep is now known as Syk |
01:43 | | Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has joined #code |
01:43 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
02:02 | | himi-cat [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds] |
02:07 | | himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code |
02:07 | | mode/#code [+o himi] by ChanServ |
02:38 | | auREAX [mark@42F7BC.C2C1CC.B64DF6.88F7A5] has quit [Ping timeout: 121 seconds] |
03:05 | <@celticminstrel> | Why is it that, despite going into Spelling and Grammar sentences and telling Word to ignore passive sentences, it insists on putting a green squiggly underline under them anyway... |
03:05 | <@celticminstrel> | I can't write without passive sentences! |
03:07 | <@Reiv> | Clearly you need to be more assertive. |
03:07 | | * Reiv nods sagely. |
03:07 | <@celticminstrel> | Pfft. |
03:08 | <&ToxicFrog> | The passive voice is the devil, FYI. |
03:08 | <@celticminstrel> | Is not. |
03:10 | <&ToxicFrog> | "In general, limit passive verb use to one or two per book. [...] Common reason for using a passive? To avoid saying who or what did it. Don't trust people who use a lot of passives. Alternative reason: to focus attention on the window rather than the ball, the result rather than the action. There's artistic reason for passives, but they're baroque, convolute, and rob the sentence of factual information. Limit your use of them." -- Cherryh, |
03:10 | <&ToxicFrog> | C.J., Writerisms and Other Sins |
03:12 | <@celticminstrel> | It's true that it can be overused. |
03:12 | <@celticminstrel> | And I know it should be avoided in formal writing when possible. |
03:13 | <@celticminstrel> | But in casual/informal writing, it's indispensible. |
03:14 | <@Namegduf> | "It can be overused." |
03:14 | <@Namegduf> | Snirk. |
03:17 | <@celticminstrel> | It's true! |
03:17 | <@celticminstrel> | Even if a little of an understatement. |
03:18 | <@Namegduf> | I was amused because that statement was passive. |
03:18 | <@celticminstrel> | Oh, yeah. XD |
03:18 | <@Namegduf> | It's a very standard form, though, that one. |
03:18 | <@Namegduf> | Describing what people can do with a thing as if it was a property of the thing. |
03:18 | <@celticminstrel> | Maybe this is proof of what I said about it being indispensible. :P |
03:19 | <@Namegduf> | "People can overuse it." would be the active form. |
03:19 | <@Namegduf> | It's much more awkward. |
03:20 | <@celticminstrel> | Mmhm. |
03:20 | <@Namegduf> | Or "One can overuse it." |
03:20 | <@Namegduf> | I tend to use the word "one" heavily. |
03:20 | <@celticminstrel> | Yeah. |
03:20 | <@celticminstrel> | I don't use "one" much, but sometimes. |
03:20 | <@celticminstrel> | As a pronoun that is. |
03:20 | <@celticminstrel> | As a number, that does not apply. :P |
03:21 | <@Namegduf> | Yeah. |
03:21 | <&ToxicFrog> | (I was being - somewhat - facetious. Use of the passive voice in formal writing should be sparing, and use of it in news reporting should be grounds for forfeiture of one's kneecaps. In conversational writing it's fine.) |
03:21 | <@celticminstrel> | News reporting? |
03:22 | <@celticminstrel> | Why so? |
03:22 | <&ToxicFrog> | celticminstrel: because it is almost always used to separate actions from actors in cases where the reporter is sympathetic to the actors but doesn't want to overtly appear biased. |
03:22 | | McMartin_ [mcmartin@Nightstar-ddd201a8.pltn13.sbcglobal.net] has joined #code |
03:22 | <@celticminstrel> | Ah. |
03:23 | | VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: night all] |
03:23 | <&ToxicFrog> | So, e.g., you have "the suspect fled. Officer Bob's sidearm was discharged and a bullet struck the suspect." rather than "the suspect fled. Officer Bob fired at, and hit, the suspect." |
03:23 | <&ToxicFrog> | (it is in fact extremely common in reportage of police brutality, which is where I first started noticing its overuse in news reporting) |
03:24 | <@celticminstrel> | I see. |
03:26 | | McMartin [mcmartin@Nightstar-98f68822.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
03:26 | | McMartin_ is now known as McMartin |
03:26 | | mode/#code [+ao McMartin McMartin] by ChanServ |
03:26 | | Kindamoody[zZz] is now known as Kindamoody |
05:52 | | celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
06:24 | <@EvilDarkLord> | Great physics bugs. My own car is currently stuck in a bunch of levitating rocks, and an opposing vehicle managed to flip itself sideways and is frantically spinning its wheels in the air. |
06:26 | < Syk> | what game is this? |
06:27 | < Syk> | (at least I am guessing it is a game - if it is IRL I would be very afraid) |
06:32 | <@EvilDarkLord> | Alan Wake. |
06:37 | | ErikMesoy|sleep is now known as ErikMesoy |
07:32 | | himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds] |
07:43 | | You're now known as TheWatcher |
09:15 | < simon`_> | when writing optimized assembler, is there a trade-off point between using jumps and sorting stuff out without using jumps? |
09:15 | < simon`_> | e.g. checking if an array index is out of bounds, I would check both if it's less than 0 or more than the array's length. |
09:16 | < simon`_> | I could jump twice, and I could construct the result and jump once, but I might use a few more instructions. |
09:16 | <~Vornicus> | Jumps can be problematic if they invalidate your cache, in general |
09:16 | < simon`_> | yes |
09:17 | < simon`_> | I want to avoid jumps because of the cost of bad branch prediction. |
09:17 | <~Vornicus> | Also don't forget to count cycles. |
09:17 | < simon`_> | I assume MIPS32, so all instructions have more or less the same cycle cost, I think. |
09:17 | <~Vornicus> | And branch prediction means in particular that you'll want to run statistical tests on your code. |
09:28 | | Kindamoody is now known as Kindamoody|brunch |
09:38 | | AbuDhabi [annodomini@Nightstar-cd7a3942.adsl.tpnet.pl] has joined #code |
09:47 | | ReivDriod [Reiver@Nightstar-2aaa792a.vf.net.nz] has joined #code |
10:11 | | McMartin [mcmartin@Nightstar-ddd201a8.pltn13.sbcglobal.net] has quit [Client closed the connection] |
10:15 | | McMartin [mcmartin@Nightstar-6fd1d918.pltn13.sbcglobal.net] has joined #code |
10:15 | | mode/#code [+ao McMartin McMartin] by ChanServ |
10:15 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
10:16 | | mode/#code [+o himi] by ChanServ |
10:19 | | RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has joined #code |
10:49 | | Kindamoody|brunch is now known as Kindamoody |
10:54 | | AbuDhabi_ [annodomini@Nightstar-4cc7c7c5.adsl.tpnet.pl] has joined #code |
10:56 | | AbuDhabi [annodomini@Nightstar-cd7a3942.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds] |
11:07 | | Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has quit [[NS] Quit: ] |
12:04 | < AbuDhabi_> | I'm looking for a cheapo tablet that nonetheless is a worth the money. Any recommendations? |
12:04 | < Syk> | AbuDhabi_: nexus 7 |
12:08 | < AbuDhabi_> | I'm actually looking for something like half that price, tops. |
12:13 | < RichyB> | There's a really sharp knee in the utility function. The Nexus 7 is about as good as everything twice its price. |
12:14 | < RichyB> | Everything even slightly cheaper than the N7 is utter gash, nothing more expensive is worth the extra money. |
12:15 | < Syk> | AbuDhabi_: yeah |
12:15 | < Syk> | you won't get anything good below the N7's price |
12:16 | < Syk> | the N7 is THE budget tablet (also the high-end, to be honest, it's friggin brilliant) |
12:16 | | Kindamoody is now known as Kindamoody|afk |
12:16 | < Syk> | the only decent tabs on the market are the nexus 7 and the ASUS Transformer series (any one, really) |
12:16 | < Syk> | everything else is bad, too expensive, too old or just isn't good |
12:17 | < Syk> | the nexus 10 MAY be an exception, but apparently the screen is the only good thing about it |
12:28 | | * AbuDhabi_ checks the polish price. |
12:28 | < AbuDhabi_> | 1000-1300 PLN is not something I want to spend on this. |
12:29 | < AbuDhabi_> | If I am to spend that kind of money, I'd rather pick up a custom desktop that I can play CK2 on. |
12:30 | < AbuDhabi_> | The kind of tablets I've been investigating are the Manta and Goclever things, which cost like 250-350 PLN. |
12:31 | < Syk> | wat |
12:31 | < Syk> | AbuDhabi_: where are you getting 1000-1300 pln from |
12:31 | < Syk> | the Australian price, converted, is ~807 |
12:32 | < AbuDhabi_> | The American price is like 199 USD, translating into ~600 PLN before shipping. In Poland, you can get those things for 1000-1300 PLN. |
12:33 | < Syk> | this is assuming 250 AUD |
12:33 | < Syk> | which is 260 USD |
12:33 | < Syk> | because AUSTRALIA GETS FUCKED YAY |
12:34 | < AbuDhabi_> | I don't need to do anything fancy with a tablet. I just want internet when I'm visiting people, so I don't have to haul my Inspiron 1525 laptop with me and sweat like a sonuvabitch. |
12:36 | < Syk> | well everything cheaper than the nexus 7 will have fuck-all processing |
12:36 | < Syk> | power |
12:36 | < Syk> | will have build quality problems |
12:36 | < Syk> | or will have battery life problems |
12:36 | < Syk> | cheap tablets? 2-4 hours |
12:36 | < AbuDhabi_> | That's much better than my laptop. |
12:36 | < Syk> | Nexus 7? mine was sitting for /six days/ and it still had charge |
12:36 | < Syk> | under active use it's easily 8 hours |
12:41 | < AbuDhabi_> | Also, like I said, I don't need to be playing Dwarf Fortress on this thing. I want wifi and a USB port for a potential keyboard. And (optionally) some way of connecting a monitor to it. |
12:44 | < RichyB> | You won't get any of those except for the wifi on any Android tablet that I have ever seen. |
12:46 | < AbuDhabi_> | I see USB ports on the Manta MID04. |
12:49 | < RichyB> | Good luck with that. |
13:13 | | ErikMesoy [Erik@A08927.B4421D.FE7332.A86588] has quit [Ping timeout: 121 seconds] |
13:13 | | ErikMesoy1 [Erik@A08927.B4421D.FE7332.A86588] has joined #code |
13:53 | <@Azash> | http://www.codeofhonor.com/blog/whose-bug-is-this-anyway |
14:04 | <@Pandemic> | Hey RichyB, remember my file issue and scritping from yesterday? |
14:05 | <@Pandemic> | microsoft has a built in utility to do it now |
14:05 | <@Pandemic> | I was reinventing a wheel when I needed not do so |
14:05 | <@Pandemic> | http://technet.microsoft.com/en-us/library/cc753551(v=ws.10).aspx |
14:05 | <@Pandemic> | why reinvent a wheel when one perfectly round already exists? |
14:07 | | * Tamber swaps out all the wheels on Pandemic's car for cart-wheels. |
14:07 | | ErikMesoy1 [Erik@A08927.B4421D.FE7332.A86588] has quit [Ping timeout: 121 seconds] |
14:07 | <@Pandemic> | its a ford focus, I'm not sure it would notice...... |
14:08 | | * Pandemic sepnds the other half of his transportation budget on two wheel modes |
14:09 | <@Pandemic> | spends* |
14:24 | | McMartin [mcmartin@Nightstar-6fd1d918.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
14:24 | | Syk [the@Nightstar-7d752098.lnk.telstra.net] has quit [[NS] Quit: leaving] |
14:24 | | Syka [the@Nightstar-7d752098.lnk.telstra.net] has joined #code |
14:26 | | McMartin [mcmartin@Nightstar-7c3b8d73.pltn13.sbcglobal.net] has joined #code |
14:26 | | mode/#code [+ao McMartin McMartin] by ChanServ |
14:28 | | ErikMesoy [Erik@A08927.B4421D.FE7332.A86588] has joined #code |
14:30 | | ErikMesoy [Erik@A08927.B4421D.FE7332.A86588] has quit [Connection reset by peer] |
14:47 | | McMartin_ [mcmartin@Nightstar-0027c20d.pltn13.sbcglobal.net] has joined #code |
14:50 | | McMartin [mcmartin@Nightstar-7c3b8d73.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
14:52 | | RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has left #code ["Leaving"] |
14:52 | | RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has joined #code |
15:08 | | celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code |
15:08 | | mode/#code [+o celticminstrel] by ChanServ |
15:33 | | ErikMesoy [Erik@Nightstar-be32adc8.80-203-17.nextgentel.com] has joined #code |
15:36 | | McMartin_ [mcmartin@Nightstar-0027c20d.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
15:42 | | McMartin [mcmartin@Nightstar-0027c20d.pltn13.sbcglobal.net] has joined #code |
15:42 | | mode/#code [+ao McMartin McMartin] by ChanServ |
15:57 | | McMartin_ [mcmartin@Nightstar-35fb9524.pltn13.sbcglobal.net] has joined #code |
16:01 | | McMartin [mcmartin@Nightstar-0027c20d.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
16:05 | | Kindamoody|afk is now known as Kindamoody |
16:07 | | celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
17:15 | | Syka is now known as syksleep |
17:54 | <@iospace> | lady fucking damn i hate Tcl syntax |
18:19 | | harlow [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code |
18:38 | < RichyB> | Why are you even using Tcl anyway? |
18:38 | < RichyB> | Also, which Lady? |
18:38 | | McMartin [mcmartin@Nightstar-a682fef2.pltn13.sbcglobal.net] has joined #code |
18:38 | | mode/#code [+ao McMartin McMartin] by ChanServ |
18:38 | <@iospace> | RichyB: for expect |
18:39 | <@iospace> | and our lady of that which is in between |
18:39 | < RichyB> | Are you referring to the same Lady that Rincewind worships and fears or someone else? :D |
18:41 | <@iospace> | someone else :P |
18:41 | <@Azash> | The lady in reeeed |
18:41 | <@iospace> | nope! |
18:41 | | McMartin_ [mcmartin@Nightstar-35fb9524.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
18:51 | | Reiv [NSwebIRC@A3BDC3.5BE3EC.B8847E.5ADB9D] has quit [Ping timeout: 121 seconds] |
18:52 | | Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has joined #code |
18:52 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
19:04 | < AbuDhabi_> | Is there some kind of function in standard C that uppercases the first letter of a C-string? |
19:08 | <~Vornicus> | There should be one that gives you the uppercased version of a letter. From there it's a one-liner. |
19:08 | <~Vornicus> | I don't think there's one built in, that seems relatively niche |
19:09 | < AbuDhabi_> | I see. Thanks! |
19:11 | | Kindamoody is now known as Kindamoody[zZz] |
19:18 | <@Tarinaky> | AbuDhabi_: if (string[0] >= 'a' && string[0] <= 'A') string[0] += 'A' - 'a'; |
19:18 | <@Tarinaky> | Disclaimer: only works for ASCII. |
19:19 | <@Tarinaky> | Also: should be strictly less than 'A'. |
19:19 | <@Tarinaky> | Not LEQ. |
19:20 | | celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code |
19:20 | | mode/#code [+o celticminstrel] by ChanServ |
19:21 | <@rms> | AbuDhabi_: use ctype.h toupper on str[0] |
19:23 | | celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
19:23 | | celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code |
19:23 | | mode/#code [+o celticminstrel] by ChanServ |
19:26 | <@Azash> | Tarinaky: if (string[0] >= 'a' && string[0] <= 'z') |
19:27 | | Courage [Moltare@583787.FF2A18.190FE2.4D81A1] has joined #code |
19:27 | | mode/#code [+o Courage] by ChanServ |
19:27 | | RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has quit [[NS] Quit: Leaving] |
19:27 | <@Tarinaky> | Azash: <= 'z' is identical to <= 'A'. |
19:28 | | Moltare [Moltare@583787.FF2A18.190FE2.4D81A1] has quit [Ping timeout: 121 seconds] |
19:28 | <@Azash> | Hardly |
19:28 | <@Tarinaky> | Gah |
19:28 | <@Tarinaky> | I've done it again! |
19:28 | <@Tarinaky> | Azash: <= 'z' is identical to == 'A'. |
19:28 | <@Tarinaky> | Err |
19:29 | <@Tarinaky> | Fuck me I can';t type |
19:29 | <@Tarinaky> | Azash: <= 'z' is identical to < 'A'. |
19:29 | <@Tarinaky> | There! |
19:29 | <@Azash> | ..XYZ[\]^_`abc.. |
19:29 | <@Tarinaky> | Finally! |
19:29 | <@Tarinaky> | Oh. I thought it was abcd...Abcd... |
19:29 | <@Tarinaky> | Err |
19:29 | <@Azash> | http://www.asciitable.com/ |
19:29 | <@Tarinaky> | Oh whatever. |
19:29 | <@Azash> | Your one-stop shop |
19:29 | <@Tarinaky> | I'm wrong today. |
19:29 | <@Azash> | This site has saved me probably a hundred times by now |
19:30 | <@Tarinaky> | Should be += 'a' - 'A' then. |
19:30 | <@Tarinaky> | Otherwise you'll get a negative. |
19:33 | <@Tarinaky> | Anyway. I'm trying to figure out something game-grid/geometry related. |
19:34 | <@Tarinaky> | If you have an infinite plane of tesselating hexagons. But you permit tokens to exist either in side a cell, or in the middle of an edge between two cells. |
19:34 | <@Tarinaky> | Would this, in fact, be identical to a different tesselating pattern. |
19:39 | <@Azash> | Guess so |
19:41 | <@Tarinaky> | What pattern? |
19:43 | < ErikMesoy> | Tesselating hexagons. |
19:43 | < ErikMesoy> | AFAICT, this just doubles effective hexagon density. |
19:44 | <@Tarinaky> | *inside a cell |
19:45 | <@Tarinaky> | I might just abandon this idea and go with a continuous field. It's just that introduces other problems >.< |
19:50 | < ErikMesoy> | Tarinaky: http://i45.tinypic.com/2hxvd4o.png |
19:51 | <@Azash> | ErikMesoy: If you put two triangles horizontally back to back |
19:51 | <@Azash> | <|> |
19:51 | <@Azash> | And repeat those, that's the grid formed by Tarinaky's idea |
19:52 | < ErikMesoy> | I think my illustration shows why hexagons + hexagon edges = hexagons |
19:53 | <@Tarinaky> | What are the yellow lines? |
19:54 | < ErikMesoy> | Showing that things line up. |
19:54 | <@Azash> | Well sure ErikMesoy, but those overlap, which I thought was not included |
19:55 | <@Tarinaky> | ErikMesoy: Ah, I think there's a misunderstanding. |
19:56 | <@Tarinaky> | ErikMesoy: If you're in a hexcell you can move in to the cneter of an adjacent hex cell. |
19:56 | <@Tarinaky> | Or you can 'follow an edge'. |
19:56 | <@Tarinaky> | For example, horizontal movement. |
19:56 | < ErikMesoy> | So it's like moving 2 tiles? Pattern still holds |
19:57 | <@Tarinaky> | I see. |
20:11 | | ReivDriod [Reiver@Nightstar-2aaa792a.vf.net.nz] has quit [Client closed the connection] |
20:12 | | Reiv [Reiver@Nightstar-2aaa792a.vf.net.nz] has joined #code |
20:12 | | mode/#code [+o Reiv] by ChanServ |
20:18 | < AbuDhabi_> | Is sprintf(foo,"%s%s",foo,bar) a valid way to concatenate C-strings? |
20:18 | <@Tarinaky> | Trying to walk through, in my head, a squad based mech game. |
20:18 | <@Tarinaky> | So far I have (woefully incomplete) https://docs.google.com/document/d/1v-7vxM-dr6Vqe8V770YfpwrVbIFRiCCMVcxumjV0jQ8/ edit |
20:20 | <@TheWatcher> | AbuDhabi_: No, because you're not using snprintf |
20:20 | <&McMartin> | AbuDhabi_: No, because it is made of buffer overruns. |
20:21 | <&McMartin> | snprintf will do that, but I'm not sure offhand why you'd use that instead of strncat. |
20:21 | <&McMartin> | Though I do seem to recall that strncat has some silliness in it too |
20:21 | <@Tarinaky> | I thought in C you just did a memory copy. |
20:21 | <&McMartin> | In *correct* C you do a *bounded* memory copy. |
20:22 | <@Tarinaky> | Heh. There;s any other kind? |
20:22 | <&McMartin> | snprintf and strncat bound on "N bytes copied or you hit a null byte, whichever comes first" |
20:22 | <&McMartin> | Why yes! |
20:22 | <&McMartin> | strcat is "until you hit a null byte", which may be "never" and is QUITE LIKELY to be "after the end of the buffer allocated for your destination" |
20:23 | <&McMartin> | sprintf in that form has similar behavior. |
20:23 | <@TheWatcher> | McM: yeah, strncat has the interesting gotcha that it actually needs strlen(dest) + n + 1 bytes of space |
20:23 | <@Tarinaky> | ah. I'm thinking of memcpy. |
20:24 | <@TheWatcher> | (as opposed to snprintf() and chums that include the nul in the n you give it, strncat doesn't) |
20:24 | <@Tarinaky> | Although yes, that does require knowing how big the two strings are... |
20:24 | <@TheWatcher> | (which is often overlooked, hilariously so) |
20:25 | <&McMartin> | TheWatcher: OK, so, that means snprintf is better than strncat because strncat has to do as much work as snprintf spends doing the recopy. |
20:25 | <&McMartin> | ... though is it safe for it to use itself as an argument like that? |
20:26 | <&McMartin> | A quick mental simulation says "yes but only because it is the absolute first thing output" |
20:26 | <@Tarinaky> | Stupid question. What's wrong with getting the size of the string and using memcpy? |
20:26 | <&ToxicFrog> | The underlying weirdness in strncat, looking at the man page, actually seems to be that n is "the maximum number of characters, not counting null termination, to take from the string being appended" rather than "the total size of the output buffer" as it is in everything else. |
20:27 | <@TheWatcher> | (and this is why using something like bstring even in C is a Good Idea~) |
20:27 | <&ToxicFrog> | Tarinaky: because that doesn't actually address the problem, which is "you can easily end up writing more bytes to the destination buffer than it has room for" |
20:27 | <&ToxicFrog> | If you allocate 256 bytes for an input buffer and then try to memcpy() a 1024-byte string into it, you are boned, even if that 1024-byte string is properly null terminated and all. |
20:28 | <@Tarinaky> | Missing half the string off the end doesn't seem like a solution since you still haven't done the original desired action. |
20:28 | <@Tarinaky> | If the destination buffer is to small then concaternating the two strings is impossible. |
20:28 | <@Tarinaky> | Allocate a bigger buffer. |
20:28 | <&ToxicFrog> | Yes. |
20:28 | <&McMartin> | The "desired action" - string concatenation - cannot actually be directly expressed in C. |
20:28 | <&ToxicFrog> | Correct. |
20:28 | <&McMartin> | That means it's not memory copy, it's "possibly allocate an entirely different buffer and copy stuff somewhere else" |
20:29 | <&McMartin> | If you want that to be conceptually invisible, don't write in C. |
20:29 | <@Tarinaky> | Heh. |
20:29 | <&McMartin> | C++ is right there and mostly source compatible and has std::string *right there*, with a provably-correct ownership-based implementation of memory allocation. |
20:29 | <@Tarinaky> | So shouldn't the bounds checking be done /before/ you attempt to perform the concatenation? |
20:29 | <&ToxicFrog> | However, if it is too small, "the string is truncated", whether or not you subsequently detect this and handle it, is still strictly superior to "unpredictable corruption of memory leading to, at best, an immediate crash" |
20:30 | <@Tarinaky> | And if you've already done that checking, and know the buffers are the correct size, isn't it redundant to check as part of the concatenation? |
20:30 | <&McMartin> | (a) People don't check |
20:30 | <&McMartin> | (b) C has no exception mechanism |
20:30 | <&McMartin> | (c) C has a tradition of, if you're going to return failure, also doing as much useful work as possible first |
20:30 | <&McMartin> | In this case, "returning failure" is returning the total number of bytes written |
20:31 | <&McMartin> | Which is not in fact the sum of the two original strings |
20:31 | <&McMartin> | Don't think of C as an HLL - this is a huge mistake, except for its formula translator. |
20:31 | <&McMartin> | C is an assembler and its data structures are tuned to match. |
20:33 | <&McMartin> | This is also setting aside "the string being copied may be modified between time of check and time of use, good luck with that" |
20:34 | <@froztbyte> | question |
20:34 | < AbuDhabi_> | answer |
20:34 | <@froztbyte> | amongst the PHP/Perl/C/... people I know, I've noted a strong tendency of "I don't care about errors, just do what I tell you" |
20:35 | <@froztbyte> | is this a prevalent mindset, or just coincidental that the people I know have it? |
20:35 | <@froztbyte> | and I should clarify that it's not "erf, error, lemme handle in code to handle that" |
20:35 | <@TheWatcher> | Probably the former |
20:35 | <@froztbyte> | it's "argh, errors. where's the suppression function for this scope" |
20:35 | <&McMartin> | It means something different in PHP and Perl |
20:35 | <&McMartin> | None of those three have the Visual Basic mindset which is rendered in code as ON ERROR RESUME NEXT |
20:35 | <@froztbyte> | s/handle in/add in/ |
20:35 | <&ToxicFrog> | ...as in, whatever the local equivalent of try { ... } catch {} is? |
20:35 | | Reiv_ [NSwebIRC@A3BDC3.5BE3EC.B8847E.5ADB9D] has joined #code |
20:36 | <&McMartin> | That's the PHP approach, actually, I think |
20:36 | <&McMartin> | Perl is "do what I say and I trust you to not fuck anything up because you're sandboxed" |
20:36 | <@Tarinaky> | What about try { /*...*/ } catch ( Exception e) { e.printStackTrace; } /*continue*/ ? |
20:36 | <&McMartin> | C is "This program is being written for the *express purpose* of fucking things up, get out of my goddamned way" |
20:36 | <@froztbyte> | Tarinaky: printing errors?! |
20:37 | <@Tarinaky> | It's the default for most autogenerated code. |
20:37 | <@froztbyte> | (intentionally put as is) |
20:37 | <&ToxicFrog> | Tarinaky: not the same thing. I believe froztbyte is talking about outright hiding errors. |
20:37 | <@froztbyte> | basically, what I've noted is that these people literally try to make errors become dead quiet |
20:37 | <@froztbyte> | and presenting them to the user is A Crime |
20:37 | <&ToxicFrog> | Ie, "there is an error in this code, rather than fixing it or writing code to handle it sanely at runtime I will prevent it from being reported and move on" |
20:38 | <&ToxicFrog> | In programs with try-catch this is the empty catch block, in PHP I think there's a function you can call to universally disable error reporting |
20:38 | <@Tarinaky> | Java programmers tend to leave it being reported. |
20:38 | <@froztbyte> | yeah |
20:38 | <@Tarinaky> | The error messages become part of /normal operation/ |
20:38 | <&ToxicFrog> | Ha ha ha ha ha ha ha haha hhahaaaa |
20:38 | <&ToxicFrog> | ha |
20:38 | <&ToxicFrog> | hahahaha |
20:38 | <&ToxicFrog> | :suicide: |
20:38 | <@froztbyte> | but java is a different flavour ;P |
20:38 | <@froztbyte> | Java dudes just give you stacktraces |
20:38 | <@froztbyte> | oh, wait, sorry |
20:38 | <&ToxicFrog> | I have a lot of examples of terrible java code that say otherwise |
20:38 | <@froztbyte> | Java just gives you stacktraces. |
20:38 | <@froztbyte> | also |
20:38 | <@froztbyte> | <ToxicFrog> In programs with try-catch this is the empty catch block, in PHP I think there's a function you can call to universally disable error reporting |
20:38 | <@froztbyte> | nein. |
20:39 | <@Tarinaky> | printStackTrace() only helps if you're running in some kind of console mode. |
20:39 | <&ToxicFrog> | In fact, the very first time I saw "catch(Exception e) { /* do nothing */ }" was Java. |
20:39 | <@froztbyte> | it's got about 5 knobs. that all interact in special contexts. |
20:39 | <@Tarinaky> | Printing to a standard output that goes nowhere is... well... |
20:39 | <@Tarinaky> | Silent. |
20:39 | <@froztbyte> | haha |
20:39 | <@froztbyte> | yeah |
20:39 | <@froztbyte> | well, just wanted to confirm |
20:39 | <@froztbyte> | not entirely sidetrack things :) |
20:40 | <&ToxicFrog> | This is a failure mode that you see in programmers in all languages; Java is not immune. |
20:40 | <@TheWatcher> | Indeed |
20:41 | <&jerith> | <@froztbyte> it's got about 5 knobs. that all interact in special contexts. |
20:41 | <@TheWatcher> | (often a matter of "more variation between different programmers within a language than there is between languages" really) |
20:41 | <&jerith> | That's PHP. |
20:41 | <&McMartin> | 12:37 <@Tarinaky> Printing to a standard output that goes nowhere is... well... |
20:41 | <&McMartin> | 12:37 <@Tarinaky> Silent. |
20:41 | <@froztbyte> | jerith: indeed |
20:41 | <&McMartin> | Protip that came up from Steam: |
20:41 | <&jerith> | Five's probably fewer than normal. |
20:41 | <&McMartin> | "silent" may mean "appended to .xsession-errors" |
20:41 | <@froztbyte> | jerith: which is what I was referring to with the paste just lines above it :) |
20:41 | <&McMartin> | Which can lead to 600+GB files if you go a little too nuts |
20:41 | <@froztbyte> | that post by eevee is a really good read about what's wrong with PHP |
20:41 | <@froztbyte> | even if not the language (!)design, then the ecosystem |
20:42 | < AbuDhabi_> | Printing to a standard output can take a hell of a long time, especially in Java. |
20:42 | <@froztbyte> | <McMartin> "silent" may mean "appended to .xsession-errors" |
20:42 | <@froztbyte> | first time I ever found out about this file was actually due to java |
20:42 | <@froztbyte> | firing up brokenly in the browser on an intranet site at an old employer |
20:42 | <&McMartin> | The correct way to do this in Java is to use log4j or similar to have configurable priority-based logging |
20:42 | <@Azash> | For me it was due to XFCE |
20:42 | <&jerith> | I know *very* few highly competent PHP developers. |
20:42 | <@froztbyte> | `ncdu -x /` helped me find it :D |
20:42 | < AbuDhabi_> | When I was writing my master's thesis, I often had to hunt down a rogue System.out.println before my program could work even reasonably fast. |
20:43 | <&jerith> | Mostly because anyone who reaches that level of skill switches to something less painful. |
20:43 | <&McMartin> | I'm unfamiliar with ncdu |
20:43 | <@froztbyte> | jerith: two of the guys who work with me are at quite a notable skill level, but not good enough to acknowledge that PHP is a piece of shit, and use other things |
20:43 | <@froztbyte> | McMartin: well, then I'll recommend you check it out, along with nload |
20:44 | <@froztbyte> | nload is like iftop/iptraf, just more "interface" than actual IP traffic |
20:44 | | * jerith opens a second beer, because it's been that kind of day. |
20:44 | <&McMartin> | froztbyte: keen |
20:44 | <&McMartin> | Yeah, I ended up using a stock disk analyzer that came with Ubuntu |
20:45 | <@froztbyte> | there used to be a non-crap one in gnome, years ago |
20:45 | <@froztbyte> | then it got replaced with something else |
20:45 | <@froztbyte> | baobab, I think the first one was called? |
20:45 | <&jerith> | I don't think there's anything non-crap left in gnome these days. |
20:45 | <@froztbyte> | was one of a very few pieces of gnome/gtk software that wasn't a complete shitpile |
20:46 | | * Tarinaky nose colas. |
20:46 | <@Tarinaky> | How do you get 600 GB plain text? |
20:46 | <&ToxicFrog> | baobab and it's still awesome and still awesome. |
20:46 | <&ToxicFrog> | *still around |
20:46 | <@Tarinaky> | That's 600,000,000,000 characters. |
20:46 | <@froztbyte> | spew errors extensively, Tarinaky |
20:46 | <@Tarinaky> | At 5 characters a word that's... |
20:46 | <~Vornicus> | 600GB plaintext: 600,000 novels |
20:46 | <&ToxicFrog> | There's also kdirstat which I don't like the visualizer on as much but is also decent. |
20:46 | <@Tarinaky> | Yeah. What Vorn said. |
20:47 | <&McMartin> | Tarinaky: It involved running Steam overnight with a chain-crashing download in the beta client. |
20:47 | <&McMartin> | I did not review the logs. |
20:47 | <@TheWatcher> | And it'd still be better written than most things on fanfiction.net~ |
20:47 | <@froztbyte> | ToxicFrog: I haven't used kdirstat since Backtrack ... 2, I think |
20:47 | <&McMartin> | It turns out the bug had already been fixed by the time I encountered it, I just hadn't taken the update |
20:47 | <@Tarinaky> | Note to self: nohup steam >/dev/null |
20:47 | <&McMartin> | Since that point it hasn't cracked 30k of output |
20:48 | <&McMartin> | And yeah, this is only if you start it from an X launcher, not if you type "steam" into a terminal |
20:48 | <@froztbyte> | there was some also thing that did a square-fill, with the size of squares representing the portion that given filepath takes up on your drive |
20:48 | <&ToxicFrog> | froztbyte: kdirstat is old. It's the one that all the windows-based usage analyzers are clones of, and those have been around for a long time. |
20:48 | <@froztbyte> | I quite liked that for a quick review of things |
20:48 | <&ToxicFrog> | Yeah, that's kdirstat. |
20:48 | <@froztbyte> | ToxicFrog: yus |
20:48 | <@froztbyte> | nah, there was another one |
20:48 | <@froztbyte> | that I first saw in DamnSmallLinux |
20:48 | <&ToxicFrog> | baobab does a radial one, which I rather prefer. |
20:48 | <@froztbyte> | but I could never find the name again :P |
20:48 | <&McMartin> | The thing I was using was radial |
20:48 | <&jerith> | I used to use xdiskusage, because it had a memorable name. |
20:48 | <@froztbyte> | the radial is nice |
20:48 | <&McMartin> | I didn't catch its name |
20:48 | <@froztbyte> | but |
20:49 | <@froztbyte> | one of my two problems with it, iirc, was that it didn't "zoom" nicely for multiple layers of depth |
20:49 | <&ToxicFrog> | McMartin: if it was the default disk usage analyzer in GNOME, that's baobab |
20:49 | <@froztbyte> | the other one was that small files seriously made it slow |
20:49 | <@froztbyte> | lots of* small files |
20:49 | <&McMartin> | I *assume* it's that, but of course this is using Unity, not GNOME directly |
20:50 | <&ToxicFrog> | It's still baobab in unity. |
20:50 | <&McMartin> | OK, that's what I was using, then |
20:50 | <&ToxicFrog> | froztbyte: that's an issue with every analyzer including du and *dirstat |
20:50 | <@froztbyte> | it shouldn't really be :/ |
20:51 | <&jerith> | froztbyte: |
20:51 | <@froztbyte> | I mean, you don't need to render 1312313123132 files around one parent dir |
20:51 | <&jerith> | froztbyte: Lots of inodes take a while to scan. |
20:51 | <@froztbyte> | you could just render a shaded area saying "many things here" in a chinese accent |
20:51 | <@froztbyte> | jerith: I'm talking post-scan |
20:51 | <&jerith> | It's reading the stats from the filesystem that takes the time. |
20:51 | <&jerith> | Ah. |
20:51 | <@froztbyte> | also, non-shitty filesystems scan a lot faster :P |
20:51 | <@froztbyte> | xfs, for instance |
20:51 | <@froztbyte> | and jffs |
20:52 | <@froztbyte> | the latter might not always be practical for one's uses though |
20:52 | < AbuDhabi_> | Hmm. I want to initialize an array of C-strings. What I have now is "char vowels[6] = {'a','o','e','u','i','y'};" but that runs into conversion difficulties. How do I make that into an array of C-strings properly, instead of an array of chars? |
20:52 | <@froztbyte> | (xfs is pretty damn nice though) |
20:52 | <&jerith> | AbuDhabi_: char *vowels[] = {"a", "o", "e", "u", "i", "y"}; ? |
20:53 | <&jerith> | Disclaimer: It's been a while since I worked on C code seriously. |
20:55 | <&ToxicFrog> | That's the puppy. |
20:56 | <&ToxicFrog> | Declare it as an array of char* rather than an array of char, use string instead of character constants, stop using C^W^W^W |
21:00 | < AbuDhabi_> | Warnings pop up about 'deprecated conversion from string constant to char*', and then an error about 'invalid conversion from char to char*' when I try to "snprintf(temp[counter],1,vowels[rand()%6]);". |
21:02 | < AbuDhabi_> | Hmmm. I think I see what I'm trying to do wrong, but am unsure how to fix it. |
21:05 | <&ToxicFrog> | Oh |
21:05 | <&ToxicFrog> | const char * |
21:05 | <&ToxicFrog> | That's the "deprecated conversion", I think; string constants are constant and casting them to non-const is unsafe |
21:06 | <&ToxicFrog> | The "invalid conversion from char to char*" - what's the type of temp[counter], too? |
21:13 | | * AbuDhabi_ fixes it by actually making arrays of chars rather than char*s, then "snprintf(temp,8,"%s%c",demp,vowels[rand()%6]);" where demp is a copy of temp. It turns out it isn't right to use temp twice here. |
21:15 | < AbuDhabi_> | ToxicFrog: I use C because even with all this faffery with string use, I wind up wasting less time than in C++. For some reason, using C++ makes me get lost in namespaces, classes, inheritances and dependancies. |
21:16 | <&ToxicFrog> | ...pastebin your code because this sounds really messy |
21:16 | <&ToxicFrog> | AbuDhabi_: there was an implied "and start using a HLL" there, but I'm not being entirely serious; I assume you're working in some domain that requires low-level work. |
21:17 | < AbuDhabi_> | ToxicFrog: http://pastie.org/5554491 |
21:17 | < AbuDhabi_> | Naw, this is hobby work. |
21:19 | <&McMartin> | Not only is it unsafe, on modern systems it's likely to segv you if you try to write to one. |
21:19 | <&McMartin> | In the past they often just lived in the .data segment as ordinary writable data but memory protection has since improved~ |
21:21 | <&ToxicFrog> | Ok, now I'm wondering why you ever wanted them as strings in the first place |
21:22 | < AbuDhabi_> | No particular reason. I wanted them in any form that would work. |
21:25 | < ErikMesoy> | AbuDhabi_: You inspire me. Now I have written a line of a game of my own. (No more of this "I want to" stuff, I have started! :p) |
21:25 | < AbuDhabi_> | :D |
21:26 | < AbuDhabi_> | Hmmm. I'm leaking memory somewhere. The used memory expands at about 0.2Mb/s. |
21:26 | < AbuDhabi_> | Or is that normal for SDL apps? |
21:26 | <&McMartin> | That is not normal. |
21:26 | <&ToxicFrog> | I don't offhand see where, but I do see that you should be using strncpy() rather than sprintf() for the temp-to-demp copy |
21:27 | <&ToxicFrog> | And, um |
21:27 | <&ToxicFrog> | Is it just me, or are you doing sprintf(demp,temp); with the contents of temp uninitialized? |
21:27 | <&ToxicFrog> | DANGER WILL ROBINSON |
21:27 | <&ToxicFrog> | DANGER |
21:28 | < AbuDhabi_> | Ah, yes. Yes, I am. I should go fix that. |
21:28 | < ErikMesoy> | Why does Python require "global foo \n foo=10" rather than "global foo=10" ? |
21:29 | < ErikMesoy> | If you look carefully, you can see remnants of my previous studies rubbing off me. Before Python, my university had a course where I learned public static void main Java. :p |
21:30 | <&McMartin> | Because globals are bad and you shouldn't be using them |
21:30 | <&McMartin> | Some of that friction is deliberate |
21:31 | < AbuDhabi_> | Hmm. Thing is, I'm not using any dynamic memory allocation in my code. At least, I don't think so. I've definitely not used any 'new'. |
21:31 | <@gnolam> | If you're using C, there is no 'new'. |
21:32 | < AbuDhabi_> | I'm not using any mallocs either. |
21:35 | <&ToxicFrog> | Or anything that implicitly invokes malloc like asnprintf? |
21:35 | < ErikMesoy> | Lol. Python style guide refers to Strunk and White for comment style. |
21:36 | < AbuDhabi_> | ToxicFrog: I'm not using that particular one, no. I use a lot of sprintf. |
21:40 | < ErikMesoy> | If I have a Python function that returns nothing, is proper style to a) return None, b) have no return statement, c) rewrite it because functions should return something ? |
21:41 | | * celticminstrel would say b) |
21:41 | <@froztbyte> | yeah, b |
21:41 | <@froztbyte> | it doesn't strictly have to return anything |
21:41 | <@celticminstrel> | I'd keep "return None" for cases where it sometimes returns something and sometimes doesn't. |
21:42 | <@froztbyte> | \o |
21:43 | <&ToxicFrog> | I would prefer 'return None' just for consistency's sake and to make it clear that I haven't forgotten the return statement |
21:43 | <&ToxicFrog> | But I also don't recall if, in python, there is a semantic difference between returning None and returning nothing. |
21:46 | <@Tarinaky> | ToxicFrog: There is not. |
21:46 | <@celticminstrel> | Yeah, they're the same. |
21:50 | <@Tarinaky> | Okay... Anybody want to read through what I've got so far? |
21:50 | <@Tarinaky> | I'm not sure if it's fun. |
21:50 | < ErikMesoy> | Sure. |
21:51 | <@Tarinaky> | ErikMesoy: https://docs.google.com/document/d/1v-7vxM-dr6Vqe8V770YfpwrVbIFRiCCMVcxumjV0jQ8/ edit |
21:51 | | * ErikMesoy mutters at his primitive RPG code. Decisions, decisions... whether to laboriously hand-code a bunch of maps, or to write a map-generator... |
21:51 | < ErikMesoy> | Tarinaky: At first sight, the OODA calculation is breakable. |
21:52 | <@Tarinaky> | It doesn't actually get you more actions/doesn't let you attack faster. |
21:52 | < ErikMesoy> | No, but it may end up spamming "my OODA is done, new action?" |
21:53 | < ErikMesoy> | possible catch: 5 seconds + (15/[Reaction+Skill]) seconds? |
21:53 | <@Tarinaky> | Alright. |
21:53 | < ErikMesoy> | Numbers are from my ass, since I don't know the timescale |
21:53 | <@Tarinaky> | Neither do I, really. |
21:54 | <@Tarinaky> | 3 to 5 seconds is probably fair. There will probably be a 'sleep until woken' button for gunners at some point |
21:55 | <~Vornicus> | ErikMesoy: do a hybrid route, where you draw your rpg maps approximately and let the generator fill in the details. |
21:55 | < ErikMesoy> | Vornicus: whaaaaat |
21:55 | < ErikMesoy> | that requires a drawing-reader module in addition to doing both the work of the two others! :p |
21:56 | <&ToxicFrog> | ErikMesoy: IMO, "laboriously hand-code a bunch of maps" is never the right answer, even if you want hand-crafted maps the answer is "write a map editor and then use that" |
21:56 | <&ToxicFrog> | Or use someone else's editor, depending. |
21:57 | < ErikMesoy> | Lazy option: refrain from mapping areas. |
21:57 | < ErikMesoy> | Text-adventure descriptions! |
21:57 | <@Tarinaky> | Then you have to laboriously hand-code a graph. |
21:58 | <~Vornicus> | I've done maps in a text editor and it's a pain inthe ass. |
21:58 | < ErikMesoy> | Didn't feel like that much of a pain when I did them for Wesnoth. |
21:58 | < ErikMesoy> | Even though that was /hex/ and I had to mentally adjust as I went along. |
21:58 | <~Vornicus> | I've also done them in Excel and that was much less of a pain in the ass. |
21:58 | <~Vornicus> | A proper map editor will do amazing things for you. |
22:00 | <~Vornicus> | McM is building a thing that will turn less detailed maps into more detailed maps, using a bunch of CA/kernel rules. |
22:01 | < ErikMesoy> | Tarinaky: Your design document looks interesting so far. I'd worry about doing too much from the wrong end, and suggest you get writing on some simple features. |
22:01 | <@Tarinaky> | I've been having bad luck trying to code before I have a design document of late. |
22:01 | < ErikMesoy> | Ah. |
22:02 | < ErikMesoy> | I've usually had it the other way: too much planning of Nice Things I Want and too little implementing |
22:02 | | * ErikMesoy goes back to his print("You are in generictown") prompt, now with one line of interactivity! |
22:03 | <@Tarinaky> | I'd probably have a complete nightmare if I tried to figure out the equations for top speed while trying to write them at the same time. |
22:04 | <@Tarinaky> | Since it's very simulationist with components and resources all up in this :/ |
22:04 | | * ErikMesoy writes in a placeholder function: #make wonderful things happen here |
22:09 | <@Tarinaky> | //This is not the greatest function in the world, this is just a placeholder. |
22:09 | <@Tarinaky> | //Couldn't debug~ the greatest function in the world. This is just a placeholder. |
22:09 | <@Azash> | //Placeholder, more than meets the eyes |
22:09 | <@Tarinaky> | ///Woooah~ |
22:10 | <@Azash> | s/s$// |
22:10 | <@Tarinaky> | Nah. That's Lambdas. |
22:10 | <@Tarinaky> | Labdas! Functions in disguise! |
22:11 | <~Vornicus> | you people are all silly. |
22:11 | < ErikMesoy> | So is my dad. |
22:11 | < ErikMesoy> | He will point me at problems around the house and say "Erik, make wonderful things happen". |
22:11 | <@Tarinaky> | Maybe if I try hard enough at being funny someone will finally love me :p |
22:14 | < AbuDhabi_> | Last time I was at Erik's place, Erik's dad had a tech support problem for me. It turned out to be a simple matter of emitting some cluons. |
22:14 | <@Azash> | Emitting some what? |
22:14 | < AbuDhabi_> | (Whatever he had a problem with worked in my presence. Problem solved!) |
22:15 | < AbuDhabi_> | Azash: Lusers emit bogons. Bogons make technical stuff not work. Admins and other technical personnel emit cluons, which self-annihilate with bogons. |
22:16 | <@Azash> | I think I remember this being an arc in some webcomic |
22:23 | < AbuDhabi_> | Ah, procedurally generated words. Miumbjo! Enfoxtt! Wjeegrg! Oilbuvl! |
22:27 | < ErikMesoy> | I think you might want some special rules to avoid "Wj" and the like. |
22:27 | < ErikMesoy> | Run a hundred names and weed out the worst combinations to ban? |
22:28 | < ErikMesoy> | Maybe split the consonants into subgroups and make rules about which ones can follow others. |
22:28 | <@Tarinaky> | How much energy is released in a Bogon-Cluon annihilation? |
22:28 | < ErikMesoy> | Empirical testing suggests that it's usually less than the amount required to reboot the device. |
22:29 | < ErikMesoy> | Since even after bogon destruction, the cluon emitter usually has to start the previously malfunctioning device. |
22:32 | < AbuDhabi_> | ErikMesoy: It'll do for now. |
22:32 | <@Tarinaky> | Also, I think I need to work on my 'pick-up strategy' I'm arguing Quantum Mechanics with someone on OKCupid :/ |
22:33 | <@Tarinaky> | I'd mind less but I don't really know QM very well - I failed that module. |
22:33 | <@Tarinaky> | I don't even remember the lectures >.< |
22:33 | <&ToxicFrog> | That sounds like an awesome way to meet someone, TBQH |
22:33 | <&ToxicFrog> | (my first conversation with Symbol was an extended discussion of esoteric programming languages) |
22:35 | <@Tarinaky> | Fair enough. It just turns in to an argument for me. |
22:36 | <&ToxicFrog> | Debates are fun. Arguments less so. |
22:36 | | * AbuDhabi_ loves both! |
22:36 | <@Tarinaky> | I'm bad with people, lol. |
22:37 | <&ToxicFrog> | (I have never had so interesting a conversation on OKC, FWIW) |
22:38 | <@Tarinaky> | I've been spam messaging basically everyone registered as gay/bi, in northern europe. |
22:39 | <@Tarinaky> | That's totally how it works right? |
22:39 | <~Vornicus> | That's a lot of people. |
22:39 | < AbuDhabi_> | Tarinaky: That's how internet dating works, yes, according to the manosphere. |
22:40 | | * AbuDhabi_ snickers at himself: http://pastie.org/5554851 |
22:40 | <@Alek> | every male, I'd think. XD |
22:41 | < ErikMesoy> | >internet dating |
22:41 | < ErikMesoy> | >works |
22:41 | | * ErikMesoy mumbles darkly about Gresham's Law. |
22:41 | < AbuDhabi_> | ErikMesoy: >implying that a barrage of copypasta will not yield someone stupid enough eventually |
22:43 | <@Tarinaky> | > dating |
22:43 | <@Tarinaky> | > works |
22:43 | <@Tarinaky> | ErikMesoy: Gresham's Law? |
22:45 | <&ToxicFrog> | Gresham's Law? |
22:45 | < AbuDhabi_> | ErikMesoy: Yes, explain how bad money driving out good when the exchange rate is set by law is relevant here. |
22:45 | <&ToxicFrog> | Tarinaky: if you do that a lot, OKC's anti-spam systems will probably whack you. |
22:46 | < ErikMesoy> | AbuDhabi_: I read a generalization of Gresham's Law combined with The Market For Lemons. Basically, wherever bad product is hard to distinguish from good product within a market, such as due to lack of quality assurance, bad product drives out good product. |
22:47 | < AbuDhabi_> | And that is relevant how? |
22:47 | < ErikMesoy> | And so we get internet dating sites, where quality assurance is... uhh... "Would fuck again"? |
22:48 | <@Tarinaky> | I exagerated slightly. |
22:48 | < AbuDhabi_> | Slightly more on topic, what is "zero-length gnu_printf format string"? And why am I being warned? |
22:49 | <&ToxicFrog> | It means the format string you are passing to printf is "" |
22:49 | <&ToxicFrog> | You're passing some uninitialized or zero-initialized buffer to printf as the format string, aren't you |
22:49 | <&ToxicFrog> | bad programmer |
22:49 | <&ToxicFrog> | bad |
22:49 | <&ToxicFrog> | Use "%s", buf |
22:50 | <@Tarinaky> | Pfft, at least if I was straight I'd have a much larger market to ruin with my bad product :p |
22:50 | <&McMartin> | Nonconstant format strings are an attack vector due to the %n format code, added, AFAICT, for the express purpose of making printf an attack vector. |
22:51 | < AbuDhabi_> | I'm initializing! "sprintf(temp,"");" |
22:51 | <&ToxicFrog> | strncpy |
22:51 | <&McMartin> | You want "temp[0] = 0" |
22:51 | <&ToxicFrog> | Or just temp[0] = '\0' |
22:51 | < AbuDhabi_> | Okay. |
22:52 | < AbuDhabi_> | That is actually shorter! Very good! |
22:53 | < simon`_> | if I want to compare two registers $t0 and $t1, I can do: xor $t2, $t0, $t1 ; xori $t2, $t2, 1 ; andi $t2, $t2, 1 |
22:54 | < simon`_> | (using MIPS32) |
22:54 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Client closed the connection] |
23:27 | | ErikMesoy is now known as ErikMesoy|sleep |
23:34 | | Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has quit [[NS] Quit: ] |
23:35 | | gnolaptop [lenin@Nightstar-bb103c17.cust.bredbandsbolaget.se] has joined #code |
23:50 | < AbuDhabi_> | I'm using integers for property flags. What is the number of bits I can use nowadays? I mean, on a 32 bit machine that's at least within forlorn-look distance of the bleeding edge. |
23:57 | < gnolaptop> | Clarify? |
23:57 | < gnolaptop> | You can use as many bits as the integer in question has. |
23:57 | < AbuDhabi_> | Yeah, that's what I'm trying to find out. How many bits can I expect in this integer? |
23:58 | < AbuDhabi_> | I remember that C is not very precise about this. |
23:59 | <@Namegduf> | 15. |
23:59 | <@Namegduf> | Realistically, 31. |
23:59 | <@Namegduf> | But compilers are legally allowed to use short ints on a 32-bit machine, it'd just be slow and kind of silly. |
--- Log closed Thu Dec 20 00:00:00 2012 |