« first day (740 days earlier)      last day (4206 days later) » 

3:00 AM
partial assignments are not nice
 
@Cheersandhth.-Alf exactly
 
is "rule of 0" to always use objects that clean up in destructors?
 
@MooingDuck Well, nothrow copy assignment primitives does imply nothrow copy assignment compounds :p
 
can't have nothrow copy assignment unless no dynamic allocation
 
Hence the ':p'!
 
3:02 AM
 
ah, guess whether i'm wide awake or pretty much asleep
 
so the rule of 3 is far less awesome than I'd assumed, and I should go back to copy-and-swap.
 
Hold your horses.
 
if I make a copy assignment, I have to make a move assignment too don't I?
 
You can implement construct-and-swap strong copy assignment, but leave the rest as is. Not even a need to implement swap.
That is acceptable, isn't it?
@MooingDuck foo(foo&&) = default; and you're good to go.
 
3:03 AM
i think it's more clean to implement swap
because that supports building new higher level stuff
 
@LucDanton oh right, keep forgetting that
@LucDanton yes, but seems like the easiest way to copy and swap is with a swap function.
 
what's needed is a new language that has swap as a primitive! :-)
 
@MooingDuck What's wrong with default swap?
 
@LucDanton I presume it uses the assignment operator.
 
Did meta just go down?
 
3:06 AM
@MooingDuck What's wrong with that?
Oh sorry.
It uses move assignment.
 
@LucDanton Implement copy using swap using copy?
@LucDanton oh right
no problems then
Also the code I posted was a terrible example and this is better: codepad.org/WUWLkbfn
 
but, easy way to implement move assignment is with swap
 
@Cheersandhth.-Alf easiest way for move assingment is =default
 
@melak47 Watchya mean
 
@CatPlusPlus I..have no clue how I tell scons I want to link openGL32.lib
 
3:08 AM
@Cheersandhth.-Alf Some object to do it this way around because it 'delays' destruction of the right operand.
 
It should pull that stuff already.
 
@CatPlusPlus for windows, too?
 
My personal take is that either can be implemented in terms of either, and as just pointed out, I can default move assignment. Laziness is a virtue!
 
Xeo
@MooingDuck Woah, I just noticed that codepad uses GCC 4.1.2 for C++ code.
 
If not, it should be somewhere in SConstruct
 
3:09 AM
ah, I see the line
 
do you mean 4.7.2?
 
and DIST_LIB is where I put the lib path if necessary?
 
No, dist dirs are where our built files go.
 
Xeo
@Cheersandhth.-Alf That would be LWS. Codepad has 4.1.2
 
@CatPlusPlus hm.
 
Xeo
3:10 AM
> C++: g++ 4.1.2
 
yes found it
old
:(
 
Xeo
*ancient
 
@Xeo Woa, and I thought GCC 4.2 was old.
 
Python 2.5.1 lol
 
Hint: nobody uses codepad
 
Xeo
@CatPlusPlus Well, the duck seems to.
 
Here I am, all nightering all night second time in 3 days
 
sound slike fun :)
argh, what have I done...
 
Probably screwed up PATH
 
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
%SystemRoot%\system32
%SystemRoot%
%SystemRoot%\System32\Wbem
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
C:\tools\
C:\Program Files\Common Files\Autodesk Shared\
D:\Dev\Qt-4.8.3-msvc\bin
C:\Program Files\TortoiseHg\
D:\Dev\MinGW64\bin
C:\Program Files\Python27
C:\Program Files\Python27\Lib
 
3:23 AM
nice path lol
 
?
 
Not being sarcastic. It's just a lot larger than mine.
 
@Xeo I use codepad when ideone freaks out, because lws is useless in chrome and firefox
 
How is lws useless?
 
@Rapptz linewrap and resizing are broken
 
Xeo
3:24 AM
Eh
 
Use a text editor..?
 
@Rapptz I'm typing like 20 lines, I should be able to use the text box
 
Codepad doesn't even indent for me.
 
Xeo
What kind of lines are you writing that you have to worry about linewrap?
 
@Xeo at work I keep the window quarter of screen size so coworkers are less likely to notice it when walking by
 
3:26 AM
@CatPlusPlus any idea how I screwed up PATH? it was building earlier..
 
Xeo
Also, fuck the editor, it got GCC 4.7.2 and Boost!
 
0
A: Passing Stack to Function

Cheers and hth. - AlfThe name DisplayStack indicates that the function only displays the stack, not changing it in any way. So then the argument can be a reference to const. However, the suffix Stack in the name is redundant since it is implied by the argument, so I’d do it like this: #include <iostream>...

^ ICE me here and ICE me there.
 
@Xeo when I need those features and ideone is down I find my way there
 
Xeo
@MooingDuck New window :P Having code in a window shouldn't be suspicious, right?
@MooingDuck With Ideone, you get either an old C++0x or Boost
 
@Xeo if I have more than 30 lines or so I use VS and then copy paste
@Xeo I virtually never use boost
 
3:27 AM
@MooingDuck Me too.
 
> Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information
Also known as "Fuck you".
 
@melak47 Dunno
 
@CatPlusPlus well, crap.
I'm not even sure what file it's not finding :/
 
VERBOSE_BUILD=1 always
 
Sometimes, I hate being tall.
 
3:33 AM
 
Yup no compiler.
I have no idea why the fuck it uses 'o' when it can't find shit, but it does.
scons CC=gcc CXX=g++
Also no idea why it even tries to find MVSC
 
oops. too many MinGWs
must've broken it when I was swapping them around trying to get eclipse to like the 64 bit one
 
Hullo folks.
Anyone here know physics?
 
@CatPlusPlus alright, now I'm back to the undefined references to the wgl functions
 
I'm trying to code up some basic physics math into a Physics engine.
 
3:38 AM
vOv
 
 Files are often of great help to get responses and support from Microsoft and other community members regarding your feedback.
The following files were not successfully attached.

    Stack.h
 
Is it bad practice to typedef units and their plurals?
 
bug in the bug reporting, how unremarkable!
 
a) Use Boost.Units.
b)
 
but they're supposed to be in opengl32.lib
 
3:39 AM
Which ones are undefined?
Also VERBOSE_BUILD again
@Moshe typedefing anything that's supposed to be distinct is bad practice
Don't typedef think of the children
 
@CatPlusPlus typedef double scalar
 
Scalar is not an unit
 
@Moshe scalar is not a unit
 
@CatPlusPlus looks like every single one I used
 
@CatPlusPlus typedef scalar meter
 
Now that's bad.
 
@Moshe that's bad
 
Why?
 
@CatPlusPlus you type faster
 
Makes my code more readable.
 
3:41 AM
I'm sleep deprived.
@Moshe It doesn't make your code more correct.
 
@MooingDuck Oh, I know, but it's a type.
 
a) Use Boost.Units dammit
 
@CatPlusPlus Really? That's slightly absurd.
@CatPlusPlus Me?
 
typedef scalar feet;
meters length = 3;
feet area = length * 4; //wtf  units LIE
@Moshe use boost::units, it will make your code correct for you
 
@Moshe Really? All typedefed types are exactly the same.
 
3:42 AM
@MooingDuck Fair enough.
 
Name doesn't matter, it won't stop you treating 5 metres as 5 hours.
 
@MooingDuck This is an Objective-C library, not C++. :P
 
:getout:
 
@CatPlusPlus lol
 
Also stop using Obj-C seriously
 
3:43 AM
@Moshe oh, well at least make the types distinct and not implicitly convertible.
 
@MooingDuck How so?
 
Use crappy Obj-C magic
Like for anything in Obj-C
 
@Moshe I dunno objective C, but make converting from meters to feet (explicitly of course) do the conversion automatically.
 
@MooingDuck Like an operator overload or something?
 
@CatPlusPlus is this the same kind of linking problem @thecoshman is having with glload?
 
3:44 AM
I don't know.
 
:S
 
What's the command line
Also bah, they're not opengl32 references
 
@Moshe I don't know objective C, so I can't be more specific.
 
huh?
 
SetPixelFormat is gdi32
SwapBuffers too
 
3:46 AM
@MooingDuck Obj-C is C and then some, so if it's C, it's Obj-C.
 
The rest is glload, which you don't get because it hasn't been pulled into main repo yet
 
well, okay, but wglBlargh is opengl32
 
@Moshe C doesn't have classes/objects, so none of this applies to C. That's why C is a bad language.
 
@MooingDuck Not really true
 
3:46 AM
C is a bad language because it doesn't have classes? Hah.
 
@Pubby among other things
 
C is a bad language, because it's a bad language.
 
Obj-C is a strict superset of C.
 
@CatPlusPlus pft details
 
@MooingDuck C has an object model :p
 
3:47 AM
C is a bad general purpose language.
 
*C doesn't have operators
 
@CatPlusPlus I guess then I'll wait til you make glload werk?
 
GObject isn't much more terrible than Obj-C implementation of classes.
 
Aaaaand I've started another argument. runs out
 
@CatPlusPlus I don't believe you lol.
 
3:48 AM
Does anyone here even know ObjC besides Moshe?
 
Yes
It's terrible
@melak47 Point VENDOR_REPO to coshman's fork.
 
@CatPlusPlus already have :/
 
Did you run scons vendor again
 
yea
 
With VENDOR_REPO changed
 
3:50 AM
yes
pointing it to cosh's repo was the first thing I did
 
Remove vendor directory first
 
there was no vendor directory
 
Remove vendor directory, run scons VENDOR_REPO=coshman_fork_url vendor
 
oh ffs....CreateProcess cannot find the file specified
mercurial/TortoiseHg is in my path
 
7 more hours
 
3:59 AM
til?
 
Sleep
 
is there a way to cirucmvent your "shame on you" message?
 
Ok, better question.
What's a good way to represent a Vector with an unknown number of directions in a C family language as a class?
 
vendor directory needs to be there and needs to be a vendor repo clone
If you can't do it from command-line, clone it manually otherwise
What the hell is vector with unknown number of directions
 
wait...was VENDOR_REPO=coshman_fork_url supposed to be literal or replaced by the url? :p
 
4:02 AM
 
lol 404
 
Oh hey Dropbox failed
 
I see your facepalm :)
but I already replaced the url in the SConstruct anyway..
 
I thought the zooming didn't work, but one just has to click on "close" first.
Just as logical as clicking "Start" to exit Windows.
 
@Cheersandhth.-Alf I'd rather click start to exit windows, than have to go find a hot corner and some power options menu :p
 
4:05 AM
oh i haven't tried windows 8
but isn't there a chance that it could work well with laptop's mouse pad?
 
@Cheersandhth.-Alf that's nice, but this one looks a little prettier IMHO media.skysurvey.org/openzoom.html
 
ah better zoom functionality
but it's not the same picture is it?
 
I don't think so.
 
well thanks anyway!
 
4:09 AM
that guy made the photos himself with a regular camera, not with an observatory
 
i post that on facebook
all 1 billion+ facebook accountants will see it
 
why do you have accountants as friends D:
 
well bbc reported 1 billion+ facebook accounts a week ago or so
 
accounts != accountants :p
 
Nick Risinger put his name in the at first sight most interesting part of the picture :-)
 
4:17 AM
@Cheersandhth.-Alf he put it all over
 
but to no avail
 
I simply downloaded all the tiles of the highest zoom level, and merged them, and downsampled it to a manageable size. name's largely gone/invisible :)
 
And anyone who saves code in Microsoft Word should be shot, on-the-spot. — Jonathon Reinhart 2 mins ago
 
4:20 AM
@Mysticial lol
 
What a n00b. (Your professor, that is.) — Jonathon Reinhart 3 mins ago
 
@Mysticial Reminds me, when I was in college, my teachers liked to tell us stories about students who turned in their homeworks with source code in .doc files.
 
also infuriating if they put code in PDFs, and if you try to get it out of there it has a billion whitespaces between the letters
 
try sumatra pdf
it's better than adobe re the spaces
also try stern warning to students
 
@melak47 You could put a link in the pdf to link it to an online paste.
Though then again, why would you put it in a pdf to begin with.
 
4:23 AM
@Rapptz I wouldn't
 
Well, I actually put some code in PDF so the solution I said is one I use :P
 
4:35 AM
@CatPlusPlus alright, cosh's vendor fork is built. still getting the undefined references though. (adding gdi32 in SConstruct leaves just the glload ones)
anyway, 6:37 so I gotta go sleep :)
 
4:49 AM
-3
Q: Regular expression for "CTRL+ M"

Bala MuruganNeed to match ctrl+M character in string using java api

 
5:30 AM
Anyone has experience with slices? Any kind of slices, any language. I'm somewhat familiar with Python and R myself. I'm looking to write some slicing tools for tuple-like classes but I'd like to know what's the state of the art, so to speak.
 
Numpy slices?
I know a bit about those
 
Not familiar with those I think. Anything sexy about them?
 
Numpy arrays are multidimensional
so they are multidimensional slices, e.g. a[:, i] to get the ith column
all components support Python's extended slices, so you can do e.g. a[::2, ::2] to subsample an array
 
Ah, I've done slices of the sort with R. Badly.
 
you can also index using coordinate arrays, e.g. a[[1,2,3], [2,5,1]] to get elements (1,2), (2,5), and (3,1)
 
5:34 AM
@nneonneo Get topmost leftmost element of every 2x2 submatrix in this case?
 
Yep, precisely
 
Can't imagine multilevel tuples. To be fair std::array does conform to the tuple interface though.
 
hm, what else? you can index with a boolean array to do a filter
this supports usage like a[a<50]
you can index with a tuple of arrays to do advanced coordinate selection (which essentially lets you build arbitrarily-shaped arrays using arbitrary elements of a matrix)
 
I was just looking at that in the docs. Seems similar to R as well.
 
and, as a bonus, basically every slicing mode supports assignment
combined with Numpy's array broadcasting, you get a lot of flexibility.
anyway, most of this is important because of Numpy's multidimensionality
for simple 1-D tuples, you probably don't have to go overboard :)
 
5:40 AM
Aye. To give you an idea I'm still investigating if I want to support negative indices, and if so, with what semantics.
Doesn't seem super useful tbh.
 
negative indices?
they are super useful in Python
because it beats writing "x[len(...)-1]" over and over again
though you could also use the MATLAB approach and use a magic "end" variable (though that is, IMHO, a bit ugly)
similarly I guess it could save you from having to write tup.size() often (though I don't know what your API looks like :P)
 
You know if I provide that kind of functionality I could foresee abusing slice<-1>(tup) to get the last element(ish, as a 1-tuple), because std::get<-1> doesn't let you do that, hah.
 
hm, that's also an interesting question
 
1
Q: What is bandwidth demand?

Divine CosmosWhat do you mean by bandwidth demand? The context is: " Memory must be distributed among the processors rather than centralized; otherwise the memory system would not be able to support the bandwidth demands of a large number of processors without incurring long access latency"

I hope I didn't answer an OT question...
 
in Python, a[-1] means the last element, as a scalar
@Mysticial: warms up the close votes >:D
 
5:45 AM
dammit, I can't find a way to put a language tag on it.
Otherwise, nobody's gonna see it. lol
 
language-agnostic
lol
 
good one
 
Tuples also support equality and relational operators. Convenient to get lexicographical ordering without hassle.
 
right. I do understand now why negative indices are less useful for a tuple class
 
Aye. Not so much numerical stuff as shuffling things around to match parameter declarations and so on.
I'm getting the need because I've implemented utility to e.g. expand a tuple to use its elements as parameters to a functors.
 
5:52 AM
mhm. I think in this case I'd emphasize slicing by index array
e.g. index_slice<1,0,2>(tup) to rearrange it into tup[1],tup[0],tup[2]
if that's even remotely reasonable in C++ (I am nowhere near proficient in it)
 
I've got as much so far.
I need some kind of 'protocol' for repeated indices, because something like slice<0, 0>(std::make_tuple(foo, bar, baz)) is a bit unsafe.
 
yeah...which is somewhat unfortunate.
another thought: could you have parameters to create new tuple slots?
it could be handy to make a new tuple from another one with some empty (typed) slots, and then fill those in (imagine e.g. adding an argument)
 
I'd recommend something like std::tuple_cat(tuple, std::make_tuple(foo, bar)) to e.g. put two arguments at the end. If you combine with slicing you can surgically put stuff in the middle.
 
do your slices support assignment? can I do slice<1,0,2>(tup) = slice(3,2,1)(othertup)?
Luc: maybe I want to surgically insert elements? mwehehe
 
@nneonneo That would compile, and it is useful insofar as the tuples are shallow views. Like the example that involves std::tie.
I'm still looking for concise ways to express the kind of syntax of i:j:s.
 
5:59 AM
slice_range<a,b[,c]>?
 

« first day (740 days earlier)      last day (4206 days later) »