code logs -> 2014 -> Mon, 27 Oct 2014< code.20141026.log - code.20141028.log >
--- Log opened Mon Oct 27 00:00:24 2014
00:04 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds]
00:25 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
00:25 mode/#code [+o Checkmate] by ChanServ
00:42 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code
00:42 mode/#code [+o Alek] by ChanServ
00:52 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
00:58 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds]
01:02 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code
01:02 mode/#code [+o Alek] by ChanServ
01:04 Vorntastic [Vorn@Nightstar-vsm28r.sub-70-215-20.myvzw.com] has quit [Connection closed]
01:08 Vorntastic [Vorn@Nightstar-vsm28r.sub-70-215-20.myvzw.com] has joined #code
01:18 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
02:11 gnolam_ [lenin@Nightstar-utbkuh.cust.bredbandsbolaget.se] has joined #code
02:14 gnolam [lenin@Nightstar-utbkuh.cust.bredbandsbolaget.se] has quit [Ping timeout: 121 seconds]
02:15 thalass is now known as Thalass
02:40 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [[NS] Quit: bbs]
02:48 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code
02:48 mode/#code [+o Alek] by ChanServ
03:14 Vornlicious [Vorn@Nightstar-5ovr0t.sub-70-215-8.myvzw.com] has joined #code
03:15 Vorntastic [Vorn@Nightstar-vsm28r.sub-70-215-20.myvzw.com] has quit [Ping timeout: 121 seconds]
03:25 Vornlicious [Vorn@Nightstar-5ovr0t.sub-70-215-8.myvzw.com] has quit [Ping timeout: 121 seconds]
03:27 Kindamoody[zZz] is now known as Kindamoody
03:29 Vorntastic [Vorn@Nightstar-uen1kh.ct.comcast.net] has joined #code
03:42 celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has quit [Ping timeout: 121 seconds]
03:42 celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has joined #code
03:42 mode/#code [+o celticminstrel] by ChanServ
03:46 Vornlicious [Vorn@Nightstar-6ohtef.sub-70-215-19.myvzw.com] has joined #code
03:46 Vorntastic [Vorn@Nightstar-uen1kh.ct.comcast.net] has quit [Connection closed]
03:47 Vorntastic [Vorn@Nightstar-uen1kh.ct.comcast.net] has joined #code
03:50 Vornlicious [Vorn@Nightstar-6ohtef.sub-70-215-19.myvzw.com] has quit [Ping timeout: 121 seconds]
04:15 Vorntastic [Vorn@Nightstar-uen1kh.ct.comcast.net] has quit [[NS] Quit: Bye]
04:21 Kindamoody is now known as Kindamoody[zZz]
04:40 celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
06:06 Thalass is now known as Thalass|AFK
06:09 Harlow [harlow@Nightstar-pq0497.il.comcast.net] has joined #code
06:34 Harlow [harlow@Nightstar-pq0497.il.comcast.net] has quit [[NS] Quit: This computer has gone to sleep]
06:59 Thalass|AFK is now known as Thalass|martialartses
07:09 Kindamoody[zZz] is now known as Kindamoody
07:44 macdjord [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
07:50 Netsplit *.net <-> *.split quits: Xon, Julius, @Tamber, JBeshir, @himi, grindhold, RchrdB, [R], Turaiel
07:53 [R] [rstamer@Nightstar-d7h8ki.org] has joined #code
07:53 PinkFreud [WhyNot@Pinkfreud.is.really.fuckin.lame.nightstar.net] has quit [Ping timeout: 121 seconds]
07:53 grindhold [quassel@Nightstar-uufabm.zebra.fastwebserver.de] has joined #code
07:55 Namegduf [namegduf@Nightstar-rjh.rpa.226.188.IP] has joined #code
07:55 mode/#code [+o Namegduf] by ChanServ
07:55 Julius [abudhabi@Nightstar-7nkq9k.de] has joined #code
07:57 Xon [Xon@Nightstar-j72.ku7.252.119.IP] has joined #code
07:59 Turaiel [Brandon@Nightstar-vku52k.resnet.mtu.edu] has joined #code
08:01 macdjord [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
08:01 mode/#code [+o macdjord] by ChanServ
08:06 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
08:07 RchrdB [RichardB@Nightstar-v5j366.understood.systems] has joined #code
08:07 Tamber [tamber@furryhelix.co.uk] has joined #code
08:07 mode/#code [+o Tamber] by ChanServ
08:11 PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code
08:11 mode/#code [+o PinkFreud] by ChanServ
08:20 gnolam_ is now known as gnolam
08:20 mode/#code [+o gnolam] by ChanServ
08:23 macdjord is now known as macdjord|slep
08:38 Kindamoody is now known as Kindamoody|afk
08:58 Orthia [orthianz@Nightstar-d1j.f2h.224.119.IP] has quit [Ping timeout: 121 seconds]
09:02 Orthia [orthianz@Nightstar-1oh.59a.184.203.IP] has joined #code
09:02 mode/#code [+o Orthia] by ChanServ
11:14 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
12:41 Thalass|martialartses is now known as Thalass
13:07 * TheWatcher blinks at javascript
13:07
<@TheWatcher>
I can distinctly see the 1000 in that setTimeout, so why is it firing instantly?!
13:09 * TheWatcher ups it to 30 seconds, just to be sure
13:09
<@TheWatcher>
.. nope, still listant
13:09
<@TheWatcher>
Javascript hairs my hair
13:10
<@TheWatcher>
*hates
13:10
<@TheWatcher>
gah
13:11
< Julius>
Does your hair have hair?
13:11
<@Tamber>
His javascript has hair on its hair.
13:11
<@TheWatcher>
It's hair raising, anyway
13:13
< Julius>
Hmm. Java. Are there any precision loss problems when converting Doubles to Longs? The numbers I mean aren't supposed to have decimals.
13:17
<&McMartin>
Java doubles are IEEE 754 - as long as the result is exact in the Double and would fit in a long (which is a signed 64 bit integer) you are fine.
13:18
<&McMartin>
However, you only have 50-odd bits of mantissa, so there are numbers that can be converted to long that will have been "rounded" in the low digits.
13:25
< Julius>
Right. I'd probably want to avoid a potential future problem with those.
13:26
< Julius>
What's the proper way of parsing a string such as "100.0" to Long without going by way of Double?
13:28
<@froztbyte>
TheWatcher: try 100000
13:29
<&McMartin>
Julius: Well, first things first. does Long.valueOf() not work there?
13:29
<@TheWatcher>
It'll throw NumberformatException
13:29
<&McMartin>
If not, I'd hunt for the decimal point, confirm everything after it is 0, and then substring it.
13:29
< Julius>
I've been using parseLong, which doesn't.
13:34
<@TheWatcher>
You could use NumberFormat to parse to a Number, and then use intValue()
13:34
< Julius>
But won't that return an int, not a long?
13:35
<&McMartin>
Well, OK, then use longValue()~
13:35
<@TheWatcher>
Um, yeah, that. Sorry, brain is in the middle of ajax tomfoolery
13:39
< Julius>
Cool, thanks. This works.
13:41 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code
13:46 celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has joined #code
13:46 mode/#code [+o celticminstrel] by ChanServ
13:54 * Tarinaky complains, generally, of the difficulties of people emailing you bits of .c code that don't have half the #defines or typedefs they're supposed to have.
13:55
<@TheWatcher>
Reply with half the gcc errors they need to work out what's broken~
13:55
< Julius>
Sounds like the problem exists between the chair and the keyboard.
13:55
<@Tarinaky>
I need to figure out who's chair and whose keyboard first.
13:55
<@Tarinaky>
Before I get snarky.
13:56
< Julius>
Reply with a request for the missing content?
14:46 Thalass [thalass@Nightstar-1ag50k.bigpond.net.au] has quit [[NS] Quit: augh have to wake up at 3am. >.<]
14:55 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [Ping timeout: 121 seconds]
14:56
<@Tarinaky>
Can anyone tell me what stdafx stands for?
14:57
<@TheWatcher>
AFX = Application Framework eXtensions, the original abbreviation for MFC
14:57
<@Tarinaky>
What is its purpose?
14:57
<@Tarinaky>
In 'modern' VS projects
15:01
<@TheWatcher>
http://www.codeproject.com/Articles/789703/StdAfx-h-for-Novices - it's a precompiled header, basically. Speeds up compiling if you have a lot of includes that change very little
15:08
<@iospace>
guys, I have found it, a testiment to all our database query sins (so far!)
15:08
<@iospace>
a 210 line select statment
15:09
<@Tamber>
*wince*
15:09
<@iospace>
and yes, there are interior selects
15:11
<@TheWatcher>
... wtf
15:12
<@iospace>
the inside select? 116 lines
15:12
<@TheWatcher>
What in Yog-Sothoth's name is it doing?!
15:12
<@iospace>
things
15:15
<@iospace>
(no really, I can't go into details beyond "things", sorry ^^;;)
15:15
<@Tarinaky>
Openning one of its many maws and burrowing deep through the fabric that seperates tables.
15:15
<@Tarinaky>
Selecting that dark ephemera that exists in the space between.
15:15
<@iospace>
TheWatcher: let's make this more wtfux worthy: this is Oracle SQL
15:16
<@Tarinaky>
And bringing forth the spawnlings of the black goat across your harddisk
15:16
<@Tarinaky>
Before singing the select query that will end your session.
15:18
<@TheWatcher>
HE COMES
15:18
<@iospace>
I love you guys :3
15:21
<&McMartin>
We may not be able to help, but we give good chant
15:21
<@iospace>
indeed
15:22
<@Tarinaky>
Does anyone have advice for how to fit programming as a hobby around working full time and having a girlfriend?
15:22
<@Tarinaky>
I'm finding it kinda difficult.
15:22
<@Tarinaky>
Particularly finding the time to debug and fix issues.
15:22
<@iospace>
teach her how to code!
15:23
<&McMartin>
Some days are just polish days
15:23
<@Tarinaky>
She already knows how.
15:23
<@iospace>
then work on code with her? :3
15:23
<@Tarinaky>
Polish days?
15:24 Lambo [thelambo@Nightstar-ic6koa.fl.comcast.net] has joined #code
15:24
<&McMartin>
Days in which your hobby work will only be bugfixing and cleanup, not making new stuff
15:24
<@Tarinaky>
Except the bugs are hard.
15:24 * iospace waves at Lambo
15:24
< Lambo>
Help Help! I've been kidnapped by an iospace!
15:25
<@iospace>
JOIN US
15:25 * Tarinaky shrugs.
15:25
<&McMartin>
Did she collapse your wave function with that wave?
15:25
<@Tarinaky>
iospace: Is this your gender-non-specified missus?
15:25
<@iospace>
I collapsed all the things :<
15:25
<@iospace>
what?
15:25
<@iospace>
._.
15:25
<@iospace>
Tarinaky: i'm single atm
15:25
<@Tarinaky>
Oh.
15:25
< Lambo>
McMartin, it became a killer sawtooth wave that I distorted into an Acid Line
15:25
<@Tarinaky>
Well I was applying context.
15:26
< Lambo>
I'm just a fellow programmer who deals with horrific legacy code (VBA in Access 2002)
15:26
<@iospace>
Tarinaky: no... I wasn't the one complaining about girlfriends...
15:26
<@iospace>
that was you
15:26
<@Tarinaky>
Touche.
15:27
<@Tarinaky>
Do you /want/ me to bring my gf here?
15:27
<@iospace>
up to you
15:27
<&McMartin>
Lambo: Well, hello, as it were
15:27
< Lambo>
iospace seems to have stolen a Xon
15:27
< Lambo>
Hi!
15:28 * McMartin will be going silent for awhile as the workday starts, is more a C++/systems guy
15:28
<&McMartin>
But it's always nice to see some new names out and about
15:28
< Xon>
hi Lambo
15:29
< Lambo>
I mainly do C#
15:30
< Xon>
<iospace> guys, I have found it, a testiment to all our database query sins (so far!)
15:30
< Xon>
<iospace> a 210 line select statment
15:30
< Xon>
eh, seen worse
15:30
< Lambo>
I said the same ;p
15:30
<@TheWatcher>
Wait, question: how wide are those lines?
15:31
< Lambo>
if they're not 80 characters max, I'm leaving.
15:31
< Xon>
Lambo, rofl
15:33
<&McMartin>
PUNCH ALL THE CARDS
15:33
<@iospace>
they don't exceed 80 chars
15:34
<@iospace>
but they also... USE TABS T_T
15:34 * iospace also flips off Xon
15:34
<@iospace>
^_^
15:34 Xon is now known as Xoff
15:34
<@iospace>
yay flow control :3
15:35 Xoff is now known as Xon
15:35
< Xon>
^_^
15:35
<@iospace>
actually, let me rephrase that
15:35
<@iospace>
it uses bothtabs and spaces
15:35
< Xon>
oh god
15:35
< Xon>
BURN IT
15:36
<@froztbyte>
:% s/\t/ /g
15:36
<@froztbyte>
fuck the police
15:36 * froztbyte drops a mic and runs
15:37
< Lambo>
\t can burn in hell!
15:37
< Lambo>
monospace fonts ftw, tabs can go away
15:37
<@celticminstrel>
Bah.
15:38
< Lambo>
you know Consolas is the One True Font(tm)
15:38
<@celticminstrel>
Tabs forever.
15:39 * celticminstrel tends to use Courier... though apparently my TextWrangler is set to Anonymous Pro.
15:40
<@celticminstrel>
Hm, I wonder if I could load all scripts in a subdirectory without explicitly including every one in a script tag in the HTML file...
15:41
<@iospace>
see, I have less of a problem with tabs if that's /the only thing used/ for indentation
15:41
<@iospace>
but this is mixed
15:41
<@TheWatcher>
...
15:42
<@iospace>
(though spaces for life)
15:42
<@celticminstrel>
It'd be nice if you could do something like <script src='subdir/*.js' />.
15:42
<@TheWatcher>
iospace: apply fire. Vast quantities of fire and radioactive doom.
15:43
< Xon>
celticminstrel, that would imply JS wasn't a hacked together thing which had the *concept* of includes in the langauge
15:43
<@celticminstrel>
Heh.
15:43
< Xon>
TheWatcher, ++
15:43
<@iospace>
TheWatcher: oh, I want to
15:45
<@iospace>
wait
15:45
<@iospace>
Lambo: there is a wrapped line here :V
15:46
<@celticminstrel>
Mixing tabs and spaces is bad, yes. Either alone works fine.
15:46
<@iospace>
oh, and they use tabs for alignment
15:49
<&McMartin>
I was unfamiliar with Consolas before this; it is a fine-looking font.
15:52
< Lambo>
awesome
15:54 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
15:54 mode/#code [+o Checkmate] by ChanServ
16:15
<@iospace>
the nice thing with single SQL statements is error checking them is easy V:
16:16
<@iospace>
The bad thing is IT'S A 200+ LINE SQL STATEMENT
16:17 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
16:17
< RchrdB>
iospace: whose fault is that? o_O
16:20
<@iospace>
not mine
16:20
<@iospace>
(this is all the outsourced code)
16:22
<@iospace>
http://i.imgur.com/oiifnQh.gif I want to do this to whoever wrote this
16:23
< RchrdB>
oh dear that poor hcild
16:23
<&McMartin>
>_<
16:23
< RchrdB>
*child
16:23
< RchrdB>
what is that from? it's making my eyes water
16:24
<@iospace>
I have no clue
16:24
<@iospace>
I've touched my eyes after handling peppers before
16:38
<@Tarinaky>
Also, for those keeping score at home, the problem was between my keyboard and chair.
16:38
<@Tarinaky>
I was supposed to copy out a single function from the file I received.
16:38
<@Tarinaky>
I did not read the instructions.
16:43 * iospace pats Tarinaky
16:49
< Lambo>
nrgg
16:49
< Lambo>
i'm gonna kill our dba
16:56
<@iospace>
o rly
16:56
<@iospace>
ours is always cranky
16:57
< Lambo>
our SQL Server HA cluster changed primary nodes
16:57
< Lambo>
and he never configured them to use my failover utility
16:57
< Lambo>
so their elastic IPs are now out of sync
16:57
< Lambo>
which is causing some clients to try and write to a read only replica
16:57
<@gnolam>
RchrdB: some German comedy show: https://www.youtube.com/watch?v=z-KzGKoLHXk
16:57 * Lambo mutters
17:20
<@simon_>
Boyer-Moore vs. Knuth-Morris-Pratt... not having implemented either, which one do people prefer?
17:21
<&jeroud>
What are those things?
17:21
<@froztbyte>
string matching algorithms, I'd guess
17:21
<@simon_>
they're linear-time algorithms for determining if one string is within another.
17:22
<@froztbyte>
ah, close
17:22
<@simon_>
yeah, string matching is right :)
17:22
<@froztbyte>
well, overall. :D
17:22
<@froztbyte>
but that's a bit more specific
17:22
<@froztbyte>
simon_: I found a post recently, sec. not sure if it'd be useful but it might maybe be something you can make a call from
17:22
<@froztbyte>
http://engineering.chartbeat.com/2014/10/17/robot-traffic-filtering-in-real-time /
17:23
<@froztbyte>
that appears to derp with state machines though
17:23
<@froztbyte>
but maybe if you're somewhat familiar with either algorithm some of that might be useful
17:23
<@froztbyte>
(I can't personally comment, I haven't had to care enough just yet. been able to get away by just tweaking ES and lucene)
17:25
< Lambo>
I once implemented Knuth's algo
17:25
< Lambo>
long ago
17:25
< Lambo>
don't even remember why lol
17:26
<@simon_>
froztbyte, yeah, there was some pseudocode and a hint that Aho-Corasick is better when having many search patterns and not simply long input strings.
17:26
<@simon_>
I only have one search pattern, but it's nice to know.
17:39 HotShot [fake@Nightstar-0r416k.sfldmi.sbcglobal.net] has joined #code
17:58 Xires [xires@Nightstar-joe.cv9.106.91.IP] has joined #code
18:32 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [[NS] Quit: "Beware the fury of a patient man." -- John Dryden]
18:35 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code
18:35 mode/#code [+o Alek] by ChanServ
18:41 Kindamoody|afk is now known as Kindamoody
18:43 macdjord|slep is now known as macdjord
20:16 Kindamoody is now known as Kindamoody[zZz]
20:26 Attilla [sid13723@Nightstar-ed0oqj.irccloud.com] has quit [Ping timeout: 121 seconds]
20:27 Attilla [sid13723@Nightstar-ed0oqj.irccloud.com] has joined #code
20:27 jeroud [sid10043@Nightstar-a1k27g.irccloud.com] has quit [Ping timeout: 121 seconds]
20:28 jeroud [sid10043@Nightstar-a1k27g.irccloud.com] has joined #code
20:28 mode/#code [+ao jeroud jeroud] by ChanServ
20:53
<@iospace>
things io finds amusing
20:53
<@iospace>
by most conventions, 0 as a return code represets success
20:54
<@iospace>
yet 0 in terms of booleans in C/C++ means false.
20:54
<&McMartin>
Yep
21:00
< Lambo>
most painful thing: in my datastructures class, we had to create a queue using two stacks which were my professor's implementation
21:00
< Lambo>
the fun bit!
21:00
< Lambo>
on the Pop method, if the stack was empty... it would call exit(1);
21:01
< Lambo>
(this was C++)
21:01
< Lambo>
bbiab, hometime
21:03
< RchrdB>
Lambo: wat
21:04
< RchrdB>
C++ has exceptions...
21:04
< RchrdB>
Hell, you could at least have the courtesy to call abort() instead and then your students would get a core dump.
21:04
< RchrdB>
heh
21:05
<@Azash>
RchrdB: I see you're pro-implementation choice
21:05
< RchrdB>
Implementation choice beats the Hell out of undefined behaviour.
21:05
< RchrdB>
abort() is guaranteed not to carry on regardless, isn't it?
21:07
< RchrdB>
Yep, the C spec defines abort() as not returning.
21:08
<@macdjord>
iospace: Really, 0-as-success is the only convention that makes sense. See, you generally only need one sucess value, whereas differentiating different error conditions is important. However, you also want to be able to test for success as easily as possible. With 0-as-success, you can do that with 'if (retval)'.
21:09
<@iospace>
yeah
21:09
<@iospace>
i know in UEFI, it was "if(EFI_ERROR(status))"
21:09
< Julius>
#define true false
21:09
< Julius>
:V
21:11
<@macdjord>
Or, more succinctly, there are many error types, but only one success, and there are many true values, but only one false. The mapping os obvious.
21:25
<@Tarinaky>
Lambo: I hope this was a deliberately shit implementation to encourage the student to implement a wrapper and stuff...
21:25
<@Tarinaky>
And generally be a teaching opportunity~
21:25
<@Tarinaky>
If not: well fuck him.
21:38
< Lambo>
Tarinaky, well, this professor
21:39
< Lambo>
was originally a high school math teacher
21:39
< Lambo>
then got his PhD
21:39
< Lambo>
and started teaching Computer Science
21:39
< Lambo>
I HOPE it was intentional in the "read the source before you start working"
21:39
< Lambo>
but with the way this professor wrote the rest of his code, I don't think it was.
21:40
<@Tarinaky>
So. I've got /most/ my unit-tests working for this math-parser/(compiler?) but I'm having trouble expressing the associativity in Parsley
21:41 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
21:41 mode/#code [+o Checkmate] by ChanServ
21:42
<@Tarinaky>
Let me c+p stuffs
21:42
< Lambo>
like, this professor told me "I use single letter variables because I can't follow longer variable names"
21:43
< Lambo>
I had to control my snark after hearing that
21:43
<&McMartin>
Math dude
21:43
<&McMartin>
There are a very few places where you can kinda get away with this
21:43
<&McMartin>
Haskell and the ML family have this convention where "x" means "generic object" and "xs" means "list of generic objects"
21:43
<&McMartin>
You can't really get away with that one in something like C#
21:43
< Lambo>
or C++
21:43
< Lambo>
unless counters
21:44
<&McMartin>
Yeah, "i" is pretty pro
21:44
<@Tarinaky>
https://gist.github.com/Tarinaky/7db13d290712e791a9a0
21:44
<@macdjord>
The only single-letter variable names you should be using in modern code are loop indexes and looped pointers.
21:44
< Lambo>
the only time I ever do single letter is counters and in LINQ, eg: .Select(x => /*stuff*/);
21:44
<@Tarinaky>
What about iterators used as loop indexes?
21:44
<&McMartin>
Yeah, I'd say there is absolutely a tradition of "x" as "generic object" in certain languages.
21:45
<&McMartin>
But if you aren't in one of those langauges, dance with the one that brought you
21:45
<@Tarinaky>
Sometimes with math, if you want to split a big formula into multiple lines, there isn't really anything sensible to call it
21:45
<@macdjord>
And even then only if no more descriptive name presents itself.
21:45
<@Tarinaky>
And k can be as sensible as anything else
21:45
< Lambo>
well, at least the variables weren't hungarian notation
21:45
<&McMartin>
Now that you mention it
21:46
<&McMartin>
I assign Meaning to 'k'
21:46
<@Tarinaky>
What, no iK :P
21:46
<&McMartin>
That's "configurable integer"
21:46
<&McMartin>
We're talking parsers here, so yeah, 'k' is the number of tokens of lookahead your grammar requires~
21:46 macdjord is now known as WebChat
21:47 WebChat is now known as macdjord
21:47 RchrdB [RichardB@Nightstar-v5j366.understood.systems] has quit [[NS] Quit: WeeChat 1.0.1]
21:47
<@Tarinaky>
Anyway.
21:47
<@Tarinaky>
WTF is wrong with my parsley :/
21:47
<&McMartin>
I'm afraid I've never used Parseley, so.
21:47
<@Tarinaky>
(Girlfriend is distracting me by talking about an MMO I don't care about >.<)
21:48
<@Reiv>
(You have a girlfriend?)
21:48 RchrdB [RichardB@Nightstar-v5j366.understood.systems] has joined #code
21:48
<@macdjord>
Tarinaky: If I knew annything about the culinary uses of parseley, I'd make a joke here.
21:48
<@Tarinaky>
There's a 70s-ish kids show with a Cowardly Lion called parsley
21:49
<@Tarinaky>
https://www.youtube.com/watch?v=cYY5w4rBbGs
21:49
<@Tarinaky>
(Reiv: Not for long if she keeps talking about Aion)
21:50
<@Reiv>
(I did not think you, uh, were the sort to want girlfriends)
21:50
< Lambo>
ahah
21:50
< Lambo>
found my professor's code: http://lambo.privatepaste.com/df93b579dc
21:50
<@Tarinaky>
(Reiv: I'm bi)
21:50
<@gnolam>
Lambo: heh. I had a professor who, on the first lecture, showed us a slide with a function definition in the style of "(define (x y z w) (+ (* y z) ..." and then leaned forward and said "and if you /ever/ hand in a piece of code that looks like this... I will HUNT YOU DOWN AND I WILL KILL YOU."
21:50
<@Reiv>
(Carry on then)
21:51
< Lambo>
gnolam: hah
21:51
< Lambo>
enjoy my professor's code!
21:52
<@gnolam>
(He was a very love him or hate him kind of professor.)
21:52
<@iospace>
I joke with one of my co-workers that a mutual prof of ours would destroy the company who wrote our code
21:52
<@Azash>
gnolam: Reminds me of Eckel's "thinking in C++" and its examples of function pointer syntax
21:52
< Lambo>
if my professor worked at my company, he'd probably be fired for writing code like that
21:53
< Lambo>
then again, my professor doesn't have any real-world experience so!
21:53
<@Azash>
gnolam: /* 3. */ typedef double (*(*(*fp3)())[10])();
21:53
<@iospace>
Azash: WHAT THE FUCK
21:54
< Lambo>
you broke iospace
21:54
<@iospace>
and I've been looking at shitty code all day T_T
21:54
<@Azash>
iospace: http://www.cs.helsinki.fi/u/lindert/ticpp/ <-- Chapter 3 and find "complicated declarations"
21:54
< Lambo>
I swear I heard a head crash
21:55
<@iospace>
then again, I have worked with CHAR** and CHAR***
21:55
<@iospace>
V:
21:55
<@gnolam>
Azash: and this is where I point out that "Eckel" is a homophone for "disgust" or [applied to a person] "creep" in Swedish.~
21:55
<@Azash>
Yep
21:55
<@Azash>
iospace: âAn fp3 is a pointer to a function that takes no arguments and returns a pointer to an array of 10 pointers to functions that take no arguments and return doubles.â
21:56
< Lambo>
wait
21:56
< Lambo>
so
21:57
< Lambo>
basically: Func<Func<double>[]>
21:57
<@Azash>
If I understand that syntax correctly, yes
21:59 HotShot [fake@Nightstar-0r416k.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 4hrs 19mins 49secs]]
21:59
< Lambo>
heh, that typedef makes... sense
22:06
<@macdjord>
Uhg. I have found, to date, 3 things in the C language I consider unambiguous /mistakes/. That typedef demonstartes 2 of them.
22:08
<@macdjord>
Namely, expressing pointer types by adding '*' to the /variable name/ instead of to the type, and the whole mess of anonamous function syntax.
22:08
<@macdjord>
(The third error is the lack of named break/continue.)
22:08
< Lambo>
int *ptrMySpecialInt; instead of int* ptrMySpecialInt; ?
22:09
<@celticminstrel>
The first is why I never declare another variable on the same line as a pointer.
22:09
<&McMartin>
Lambo: more that int* p, q; declares a pointer to int p, and an int q.
22:09
<@macdjord>
Lambo: If I had my way, it would be '*int ptrToInt;'.
22:09
<@celticminstrel>
What's that about function syntax?
22:09
< Lambo>
ahh
22:09
<@celticminstrel>
macdjord: "int* p" would still be workable if the * bound to int instead of to p, though.
22:11
<@macdjord>
celticminstrel: Yeah, but putting '*' first a) reads better (*int -> "pointer to int"), b) is less ambiguous, and c) makes the const keyword work intutively.
22:11
<@celticminstrel>
If you mean that "const*int" would be a const pointer and "*const int" would be a pointer to const, then yeah.
22:12
<@celticminstrel>
What's the 3rd mistake you've identified?
22:13
<@macdjord>
celticminstrel: The three mistakes are pointer types, function pointer syntax, and lack of named break/continue.
22:13
<@celticminstrel>
Ah.
22:13
<@celticminstrel>
Named break is doable with goto, not sure about named continue.
22:14
<@macdjord>
celticminstrel: As for function syntax... I'm not sure to /fix/ it, but that typedef dhoul look something like 'typedef [blah] fp3'.
22:14
<@celticminstrel>
I'd agree they'd both be useful though.
22:15
<@celticminstrel>
C++ "fixes" the typedef syntax by introducing a new use for "using".
22:15
<@celticminstrel>
using fp3 = blah;
22:15
<@macdjord>
Named continue is also doiable; jump to a label just /before/ the closing brace. But I'd like to do it without goto.
22:15
<@celticminstrel>
Is that really semantically the same?
22:15
<@celticminstrel>
Oh wait.
22:15
<@celticminstrel>
Just before the end.
22:15
<@celticminstrel>
I guess it is then.
22:17
<@celticminstrel>
I think when I found myself needing named continue I just rewrote it in terms of named break.
22:19
<@macdjord>
'using fp3 = blah;' doesn't help; what I object to isn't the order inwhich the terms appear.
22:19
<@macdjord>
My objection is that that statement, semantically, means "define the name 'fp3' to mean 'a pointer to a function ... returns a double'". Therefore, the line should have 2 elements: "fp3" and something which means 'a pointer to a function ... returns a double'.
22:19
<@macdjord>
As it is, the line consists of the elements 'double' and... that mess.
22:22
<@macdjord>
I suppose, really, this and the pointer thing are just two elements of the same objection: I think that modifyers should be attached to the thing they are modifying, not the name that thing is beaing bound to.
22:23
<@celticminstrel>
True, the mess would be pretty much the same with using (just remove "fp3" from the middle).
22:42 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
22:42 mode/#code [+qo Vornicus Vornicus] by ChanServ
23:12
< [R]>
<macdjord> Namely, expressing pointer types by adding '*' to the /variable name/ instead of to the type, and the whole mess of anonamous function syntax. <-- char *str; char * str; and char* str; are the same.
23:13
<@macdjord>
[R]: Yes. But '*char str' would be better than any of those.
23:13
< [R]>
Fair enough
--- Log closed Tue Oct 28 00:00:40 2014
code logs -> 2014 -> Mon, 27 Oct 2014< code.20141026.log - code.20141028.log >

[ Latest log file ]