code logs -> 2012 -> Tue, 22 May 2012< code.20120521.log - code.20120523.log >
--- Log opened Tue May 22 00:00:53 2012
00:03
<&McMartin>
That still wouldn't work, because you'd have to pick the overload based on the contents of a string that isn't even guaranteed to be constant
00:03
<&McMartin>
But you can still do printf-like things - I give you QString::arg()
00:08
< Rhamphoryncus>
It looks like you can template the overload
00:10
< Rhamphoryncus>
qstring::arg is ugly
00:11
<&McMartin>
It's clean in practice, though
00:11
<&McMartin>
QString("formatstring %0 %2 $1").arg("zeroth").arg(1).arg(2.5);
00:12
< Rhamphoryncus>
err.. it has both % and $?
00:12 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Client closed the connection]
00:12
<&McMartin>
I may have confused % and $.
00:13
< Rhamphoryncus>
ah okay
00:17
<&McMartin>
But it's dynamically-typed in the arg function, there's just one arg function, and it does positional replacement so that you don't have the standard printf-internationalization trap.
00:18
< Rhamphoryncus>
That's why I want one like python3's .format()
00:18
< Rhamphoryncus>
Which is actually extensible
00:22 maoranma [nbarr@Nightstar-9e797a1c.pools.spcsdns.net] has joined #code
00:24 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
00:25 ShellNinja [abudhabi@Nightstar-300ad1ff.adsl.inetia.pl] has joined #code
00:25 Noah [nbarr@Nightstar-9e797a1c.pools.spcsdns.net] has quit [Ping timeout: 121 seconds]
00:32 Attilla [Obsolete@Nightstar-3f363270.as43234.net] has quit [Ping timeout: 121 seconds]
00:32 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [[NS] Quit: Well, most things get better when I kick them!]
00:35 iospacedout is now known as iospace
00:36 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
00:54 Derakon[AFK] is now known as Derakon
00:56 maoranma is now known as Noah
00:59 eckse_ [eckse@Nightstar-0a8171a4.dsl.sentex.ca] has joined #code
01:02 eckse [eckse@Nightstar-44362701.dsl.sentex.ca] has quit [Ping timeout: 121 seconds]
02:01
<&McMartin>
Oh god this code is terrible
02:01 * McMartin is filled with shame
02:01 * McMartin excises it with fire and sword
02:13 Kindamoody[zZz] is now known as Kindamoody
03:02 Kindamoody is now known as Kindamoody|coding
03:11 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
04:27 eckse [eckse@Nightstar-5f2dc230.dsl.sentex.ca] has joined #code
04:27 mode/#code [+o eckse] by ChanServ
04:30 eckse_ [eckse@Nightstar-0a8171a4.dsl.sentex.ca] has quit [Ping timeout: 121 seconds]
04:30 Kindamoody|coding is now known as Kindamoody
04:32
< celticminstrel>
Ooh, I can declare a variable as "auto&" and it works just as I expect.
04:50
< celticminstrel>
Okay, boost::multi_array doesn't seem to like being assigned...
05:01 Kindamoody is now known as Kindamoody|out
05:04 * celticminstrel decides to try destructor+placement new.
05:07
< celticminstrel>
...now I need to deal with making a deep copy of a vector of polymorphic pointers. :|
05:10
< celticminstrel>
...oh hey, I don't need to save the multi_array after all because it never ever changes once initialized.
05:22
< celticminstrel>
Okay, so I just need to define copy constructors and have clone() defer to them, it seems.
05:31
<&McMartin>
God, auto
05:31
<&McMartin>
C++ has needed that since 1998.
05:32
< celticminstrel>
Yeah, that and enhanced-for are the main new things I'm using.
05:33
< celticminstrel>
Actually probably more enhanced-for than auto, but that's just because there's not much point updating old code to use auto.
05:34
<~Vornicus>
what's auto do?
05:37
< celticminstrel>
Wait a second, I don't need to define a copy constructor if all it does is a straight-forward "defer to super and then copy over all extra fields", because that's the default behaviour, right?
05:38
<&McMartin>
Vornicus: a variable declared auto is declared based on type inference on its initializing expression.
05:38
<&McMartin>
Not so meaty for double
05:39
<&McMartin>
Pretty nice for, say, std::map<std::string, std::vector<string> >::const_iterator&
05:39
< celticminstrel>
Yes indeed.
05:39
< celticminstrel>
I don't need to define these copy constructors, right?
05:40
<&McMartin>
From what you describe, nah
05:40
<&McMartin>
But you said you wanted to deep-copy *pointers*
05:40
<&McMartin>
pointers will be shallowcopied
05:40
<&McMartin>
Or rather the pointer will be deepcopied. All 64 bits of it. Not the thing pointed at.
05:41
< celticminstrel>
I have a vector of pointers.
05:41
< celticminstrel>
The things pointed to don't have any further pointers (I think).
05:42
<&McMartin>
What's being copied here, though, the vector?
05:42
<&McMartin>
Because if so the only copy constructor that's gonna get called is the vector's.
05:44
< celticminstrel>
Yeah, the vector is what's being copied.
05:45
< celticminstrel>
So instead of just naively assigning I need to iterate through and clone every element.
06:29 iospace is now known as iospacedout
06:30 Derakon is now known as Derakon[AFK]
06:32 celticminstrel [celticminst@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:59 eckse [eckse@Nightstar-5f2dc230.dsl.sentex.ca] has quit [Ping timeout: 121 seconds]
07:10 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
07:12 Attilla [Obsolete@Nightstar-3f363270.as43234.net] has joined #code
07:36 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Connection closed]
07:50 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Thunderbolts and lightning, very very frightening]
08:26 Reiver [reiverta@5B433A.F67240.A412A8.CE8081] has joined #code
10:24 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
11:08 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
11:08 mode/#code [+o himi] by ChanServ
11:56 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
12:01 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
12:30 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
12:40 McMartin [mcmartin@Nightstar-bc7067be.pltn13.sbcglobal.net] has quit [Operation timed out]
12:52 iospacedout is now known as IOfficespace
12:52 celticminstrel is now known as celmin|away
12:52 IOfficespace is now known as iOfficespace
12:59 McMartin [mcmartin@Nightstar-e4a532c9.pltn13.sbcglobal.net] has joined #code
12:59 mode/#code [+ao McMartin McMartin] by ChanServ
14:17 Kindamoody|out is now known as Kindamoody
14:45 Reiver [reiverta@5B433A.F67240.A412A8.CE8081] has quit [Client closed the connection]
15:22 Kindamoody is now known as Kindamoody|afk
15:51 celmin|away is now known as celticminstrel
16:04 Noah [nbarr@Nightstar-9e797a1c.pools.spcsdns.net] has quit [Client closed the connection]
16:04 Noah [nbarr@Nightstar-9e797a1c.pools.spcsdns.net] has joined #code
16:53 gruber [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
16:53 gnolam is now known as NSGuest52
16:53 gruber is now known as gnolam
16:53 NSGuest52 [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [Ping timeout: 121 seconds]
16:57 eckse [eckse@Nightstar-0523d800.dsl.sentex.ca] has joined #code
16:57 mode/#code [+o eckse] by ChanServ
17:16 EvilDarkLord is now known as Maze
17:21 eckse [eckse@Nightstar-0523d800.dsl.sentex.ca] has quit [Ping timeout: 121 seconds]
17:40 eckse [eckse@Nightstar-c383bbe3.dsl.sentex.ca] has joined #code
17:40 mode/#code [+o eckse] by ChanServ
18:03 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has joined #code
18:03 mode/#code [+o Vash] by ChanServ
18:16
< gnolam>
https://www.youtube.com/watch?v=zmO06_MpnMk
18:24
<~Vornicus>
that is crazy awesome
19:00 eckse_ [eckse@Nightstar-6604bb2a.dsl.sentex.ca] has joined #code
19:01
< gnolam>
That it is.
19:02
< gnolam>
I've seen many C64 instrument hacks, but that one's the coolest I've seen yet.
19:03 eckse [eckse@Nightstar-c383bbe3.dsl.sentex.ca] has quit [Ping timeout: 121 seconds]
19:04 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
19:12 eckse [eckse@Nightstar-837b03ce.dsl.sentex.ca] has joined #code
19:12 mode/#code [+o eckse] by ChanServ
19:12 Kindamoody|afk is now known as Kindamoody
19:14 eckse_ [eckse@Nightstar-6604bb2a.dsl.sentex.ca] has quit [Ping timeout: 121 seconds]
19:20 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
19:20 mode/#code [+o ToxicFrog] by ChanServ
19:21 Kindamoody is now known as Kindamoody[zZz]
19:28 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
19:35
< celticminstrel>
I should either make a better level format, or make a level editor...
19:36
<@Tamber>
Or both?
19:36
< celticminstrel>
True.
19:37
< celticminstrel>
The current one was supposed to be human-readable, but then stuff got out of hand.
19:58
< sshine_>
I'm trying to prove a lower bound on the number of elements in a set.
20:00
< sshine_>
I've got a dynamic programming algorithm that has the subproblems characterised by {(i,j) in n^2 | i < j}. it is easy to reason that its size is O(n^2) because it is a subset of {(i,j) in n^2}.
20:01
< sshine_>
but how I say that it has Omega(n^2), I don't know.
20:02
< RichyB>
If it's a dynamic programming algorithm, doesn't it *always* hit *all* of its subproblems?
20:02
< sshine_>
RichyB, yes, in the worst case.
20:02
< RichyB>
and that's (mostly) the definition of DP as opposed to divide and conquer with memoization.
20:02
< sshine_>
I didn't know there was a difference between DP and divide-and-conquer with memoization.
20:03
< sshine_>
oh
20:03
< sshine_>
I suppose you may say that DP always calculates the whole table...
20:03
< RichyB>
DP works upwards from the base cases.
20:03
< sshine_>
hm
20:03
< RichyB>
D-C works downwards from the complete problem.
20:03
< sshine_>
the TAs do refer to top-down DP algorithms, but I don't care much when it's one or the other... it's all DP to me. =)
20:03
< sshine_>
ah
20:03
< sshine_>
good point
20:04 Maze is now known as EvilDarkLord
20:04
< sshine_>
so what I want to do is determine how many subproblems there are
20:04
< sshine_>
I want to come to Theta(n^2) but so far I only have O(n^2) and Omega(n).
20:05
< sshine_>
basically, not all subproblems of the form (i,j) in NxN are subproblems that my algorithm will address because it only recurses while i < j.
20:05
< RichyB>
oh
20:06
< RichyB>
{ (i,j) for i <- [1..n], j <- 1..n, i < j }
20:06
< sshine_>
I could say that (i,j) where i >= j are symmetric to subproblems that I am looking at, but that doesn't say that my algorithm doesn't have a lower bound than n^2.
20:06
< RichyB>
draw that, it's a triangle
20:06
< sshine_>
yeah, it is a triangle. do I say "proof by triangle"? :D
20:06
< RichyB>
It has n*n/2 elements.
20:06
< sshine_>
ah
20:06
< sshine_>
yeah, ok
20:06
< sshine_>
I suppose I could consider that informal induction.
20:06
< RichyB>
Well, you can break it into levels.
20:07
< RichyB>
It's sum(sum([1..j]) for j in [1..n])
20:07
< RichyB>
er
20:07
< RichyB>
worry
20:07
< RichyB>
sorry
20:07
< RichyB>
It's sum(length([1..j]) for j in [1..n])
20:08
< RichyB>
which is of course sum(j for j in [1..n])
20:08
< RichyB>
which is (j) + (j-1) + (j-2) + (j-3)... + 1.
20:08
< sshine_>
it's a lower triangle, too, isn't it?
20:08
< sshine_>
yeah.
20:08
< sshine_>
thanks!
20:09
< RichyB>
Yeah. There are j terms in that sum and their mean value is j/2. :)
20:09
< RichyB>
No worries.
20:13
<@ToxicFrog>
RichyB: see, I think of DP as being top-down as well. Yeah, the base cases are the results that actually get calculated first, but the same is true of D+C
20:13
<@ToxicFrog>
When you get down to it, DP is just memoized overlapping D+C.
20:13
< sshine_>
divide-and-conquer kind of has to be top-down, otherwise it would be conquer-and-assembly. ;-P
20:14
< RichyB>
FWIW, the wikipedia article basically disagrees with my distinction that DP is bottom-up.
20:15
< RichyB>
I happen to think of the distinction as being that DP is bottom-up filling out of arrays with subproblem answers because that was how DP was demonstrated to me in lectures.
20:16
< RichyB>
D&C-memoised isn't really different enough in runtime or structure to be worth caring much about the distinction.
20:16
< RichyB>
and the general consensus (as measured by wikipedia) is that D&C-memoised *is* DP.
20:38
<&McMartin>
Yeah
20:38
<&McMartin>
My experience and discoveries matched yours
20:38
<&McMartin>
D&C-memoized is *better* >_>
20:39
< RichyB>
It's usually shockingly easier to write. I don't know about better.
20:40
< RichyB>
Filling out dense arrays in a sequential order tends to have smaller constants than filling out entries of a hash table keyed on a complicated tuple.
20:43
<&McMartin>
Absent evidence that it's constant-factor and not programmer time and maintenance cost you need to optimize...
20:45
< RichyB>
Point taken.
20:45
< RichyB>
Swim, swim, hungry!
20:45 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [[NS] Quit: Leaving]
20:47
<~Vornicus>
oh, derp
20:47
<~Vornicus>
I was wondering what happened to MyCatVerbs and there indeed he is
20:48 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
20:48 mode/#code [+ao Derakon Derakon] by ChanServ
20:51 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Operation timed out]
20:57 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has joined #code
20:57 mode/#code [+o Vash] by ChanServ
21:05 Noah [nbarr@Nightstar-9e797a1c.pools.spcsdns.net] has quit [Connection reset by peer]
21:05 maoranma [nbarr@Nightstar-9e797a1c.pools.spcsdns.net] has joined #code
21:06 maoranma is now known as Noah
21:19 Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
21:21 Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: shutting down!]
21:37 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
21:38 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
21:38 mode/#code [+ao Derakon Derakon] by ChanServ
21:59 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
21:59 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
21:59 mode/#code [+ao Derakon Derakon] by ChanServ
22:36
< celticminstrel>
Is it just me or does SDL_ttf not understand kerning?
22:37
< Rhamphoryncus>
That would suck but I haven't touched it yet
22:37
< Rhamphoryncus>
At a minimum I need to learn opengl textures first, heh
22:39
< celticminstrel>
Well, it has to be either SDL_ttf or Arial Unicode, right?
22:39
< celticminstrel>
And I imagine the latter is unlikely.
22:42
< Rhamphoryncus>
yeah
22:42
< Rhamphoryncus>
Or you're misusing it somehow
22:42
< gnolam>
ISTR SDL_ttf being rather primitive.
22:43 * gnolam gave up on it and rolled his own FreeType layer.
22:43
< gnolam>
And on the topic of FreeType I have only one thing to say: disguised pointers. >:(
22:44 Attilla [Obsolete@Nightstar-3f363270.as43234.net] has quit [[NS] Quit: ]
22:45
< gnolam>
Yes. They really do that nasty shit of misusing typedef to try to hide the pointer status of types.
22:48
<&McMartin>
Well
22:48
<&McMartin>
Like int_ptr_t, or typedef void *foo;?
22:55
< gnolam>
typedef foo* bar;
22:55
< gnolam>
With no clue that bar is actually a pointer.
22:56
<&McMartin>
... it's right there in the *?
22:56
<&McMartin>
I mean, yes, this is one of the few places where I'm completely OK with Hungarian
22:57
< gnolam>
Right. Which you only discover when you go snooping around in the headers.
22:57 * McMartin nods
22:57
< gnolam>
Which you should not have to do.
22:58
<&McMartin>
It's OK if everything's a pointer, I guess. I'd have to check in UQM to see how we did that.
22:58
<&McMartin>
But that used total encapsulation
22:58
<&McMartin>
I don't recall if we just did "struct foo;" or "struct foo_impl; typedef foo_impl *FOO;"
23:09 Attilla [Obsolete@Nightstar-3f363270.as43234.net] has joined #code
--- Log closed Wed May 23 00:00:08 2012
code logs -> 2012 -> Tue, 22 May 2012< code.20120521.log - code.20120523.log >

[ Latest log file ]