« first day (882 days earlier)      last day (4082 days later) » 

5:00 PM
@AndyProwl Python has something called list comprehensions that make that relatively easy. I'm not sure If something similar exists for standard C++.
@CatPlusPlus Besides the cable?
 
@AndyProwl, yeah sorry, my brain just turned off there
 
@FredOverflow I don't think it matters how often it happens, the possibility should be there
 
@Insilico No obviously I haven't noticed that I can't plug one to the other
 
Then make your own range adaptor.
:P
 
@CatPlusPlus DVI is ~digital~ and stuff.
 
5:01 PM
@Rapptz That's not standard, but yes, you can do it. I still don't see why std::for_each should be deprecated though
 
@rubenvb Yeah and it makes no fucking difference whatsoever
 
because it's verbose as fuck
 
@CatPlusPlus how long is your non-digital cable?
 
@CatPlusPlus I've heard VGA gives you cancer.
 
Fuck do I know
I haven't measured it
It was included with the monitor
 
5:01 PM
roughly.
 
I'd rather do for(auto& i : range<0,3>(vec)) than write a for_each with a lambda
 
I have no idea because I don't care
 
@rubenvb Are we comparing lengths now?
 
Probably 1,5m or something
Maybe less maybe more I don't know
It's not terribly long
 
@Insilico github.com/pfultz2/Linq similar
 
5:02 PM
@FredOverflow I don't know. Not much to compare it seems.
 
My HDMI cable is 1.8m long.
 
HDMI at least has that shitty encryption gimmick
 
@Rapptz It would be even better if you could just provide a pair of iterators
 
But really the only difference between D-Sub and DVI I ever noticed was cables
 
@CatPlusPlus That's HDCP. HDMI just happens to be one cable used for that shit.
 
5:03 PM
@Insilico I know it's HDCP
 
@AndyProwl It's literally std::begin(vec)+n and std::begin(vec)+m
:|
I didn't do anything for iterators because I feel like.. it defeats the purpose.
 
I'm pretty sure HDCP isn't required for HDMI to work. Unless the state of consumer video technology is more retarded than I thought.
 
@Rapptz, what's range<int, int>? std?
 
@Rapptz I mean it would be better if we could do for (auto x : make_pair(b, e)) { ... }.
 
@Rapptz for (auto&& i : vec | sliced(0, 3))
 
5:04 PM
Apparently you can run Ethernet over HDMI cables. Which I guess is an interesting feature.
 
@Jueecy no something I wrote for ranges
 
@AndyProwl That's really trivial and non-interesting range
When you go all ranges you don't really need iterators for anything anymore
 
@CatPlusPlus b and e are not necessarily the begin and end of a container. That was just an example
 
I know it's not
It's still uninteresting and more of a range building block than something you'd use directly
for (auto&& x : vec | sliced(0, 3) | transformed(f) | filtered(g))
 
@CatPlusPlus Yeah that's basically what it is. Similar, just without the pipe operator.
 
5:06 PM
@CatPlusPlus My point is that with something like that std::for_each could be deprecated because there is a standard-only solution to use range-based for instead
 
Ranges are cool
Yeah for_each was never terribly useful
 
@AndyProwl it's not the same thing.
 
@Insilico No, it's not required -- but quite a few BD players, for one example, will only work with a display that supports HDCP.
 
for_each can do more than range-based for.
 
No, it really can't
 
5:08 PM
@rubenvb. what? a part from calling a function x number of times based on a container?
 
It's exactly equivalent
 
@CatPlusPlus it can iterate partially over a container
 
And so can range for
 
Exactly my question from before
@CatPlusPlus in standard C++?
You could in theory pass a 'skipping iterator' to a for_each.
one that only covers half the items in a container....
 
There's no tools for building ranges in standard library but that doesn't mean range-for is less powerful than for_each
 
5:09 PM
arbitrary limits :(
 
And the same is trivial to do with ranges
 
you can write things yourself to make range-for useful and powerful
 
for_each and range-for are exactly equivalent
 
@CatPlusPlus Using the return from for_each you can use it like a mediocre imitation of std::accumulate (not that I'm recommending it -- I don't, at least as a rule).
 
Doing accumulate with range for is not exactly hard either
 
5:12 PM
@jrok I expect many people to have a range function in their toolbox by now. (i.e. for(auto& x : range(first, last))) — R. Martinho Fernandes Jan 10 at 13:15
 
@CatPlusPlus Not terribly hard, no -- but then it's not terribly hard to write essentially all your loops using only if and goto instead of a loop construct.
 
@Jueecy yep
 
I'm surprised they didn't provided a std::random<int, int> (container) in std.
 
@JerryCoffin Sure, that's why they're equally powerful constructs
 
szx
how do I properly join two std::thread? I'm doing like t1.join(); t2.join(); but getting an abort error (stacktrace: pastebin.com/QAJMpM5k)
 
5:15 PM
@Jueecy what would that do?
 
@Rapptz, return a ranged copy of the container
 
@szx t1.join(); t2.join() seems correct to me
just make sure they're joinable
 
@Rapptz, oh god. I meant std::range. FML
 
lol
I'm going to expand my range thing since I'm bored
 
Xeo
What range thing?
 
5:17 PM
ranges
reinventing the wheel and all that jazz
 
Xeo
mhm
Tip: Try to stay clear of iterators.
 
That reminds me. Anybody here watch/watched Mythbusters? Not sure where that is show outsid the US.
 
How would you create a function that except as first parameter any class that has begin(), end(), operator+and operator- defined?
 
I'm using std::begin and maybe now I'll use std::end.
 
@Pawnguy7 I used to
 
user784668
5:19 PM
@Pawnguy7 I do.
 
Is that bad?
 
Ah. Anyway, I remember, they tested square wheels once. Apparently, once you get up to speed,it is actually fairly smooth.
 
Xeo
@Jueecy *accepts, and why would a range require operator+ or operator-?
 
Well... I suppose more smooth is a better description.
 
@Pawnguy7 They tested wheels made out of wood too
 
Xeo
5:20 PM
@Rapptz Try and implement ranges without going the "pair of iterators" route
 
@Borgleader As in, for car? Otherwise, I don't know why this would be that extraordinary.
 
@Xeo Not sure I understand. How would you make it work with range-based for without begin() and end() returning iterators?
 
Yeah I'm confused :(
 
@Xeo, because I need to do something like vec.begin() + a to return a ranged versions of a container
 
Iterators are fine as an implementation detail for ranges
 
Xeo
5:21 PM
@Jueecy But then vec itself doesn't need operator+. You want the iterator to be a random-access iterator.
 
You shouldn't need to touch them in client code though
 
@Pawnguy7 Yeah, they replaced the car tires with wood "tires", they also tried sewer manhole covers
 
@Xeo, yeah the iterator sorry
 
@Borgleader I recall the manhole covers. Something about not enough traction... oh, wait, the log tires? I was thinking more... crafted wood, but I think I have seen that, yes.
 
We should create a SO standard implementation of so::range<int, int>(container).
 
user784668
5:23 PM
Why the ints?
 
@Fanael, do you want iterators?
 
szx
could there be anything wrong with spawning a thread from within another recursively?
 
I think he meant size_t
 
@Pawnguy7 git clone --no-checkout --depth 1 ... and then git read-tree --prefix 'fragment' -u HEAD:path/to/some/directory/
@TonyTheLion Thx, I guess :)
 
@szx Each thread gets its own stack (1 MB by default, I think), so you would very quickly overflow the stack if your recursion is too deep.
 
5:24 PM
That looks complex...
 
@Pawnguy7 Oh well...
 
How would I... use such a command via Github?
 
@Pawnguy7 I just remembered:
 
szx
but what if it's not too deep, is it ok? given that the thread gets joined with the parent thread at each level (actually there are two child threads)
 
git archive --remote=git://remoteserver/bla HEAD:path/to/some/subdir/ -o archive.tar
^ that should be ok, right?
Replace HEAD with the requested branchname too
 
5:28 PM
@sehe I have no idea... new to git and Github.
 
@Pawnguy7 Why don't you ask these questions on Stack Overflow, where others can learn/contribute and profit?
 
I didn't think it was programming related at the time.
I was just glancing at a repository, and wanted to download a specific folder.
 
@StackedCrooked I just made an advert for you:
@llonesmiz You might be interested to know that there is Coliru now, which allows you to pipe the output through c++filt for much easier demangling: coliru.stacked-crooked.com/…sehe 11 mins ago
 
I was thinking it would be simple as a button somewhere...
 
@StackedCrooked However, there is still an issue with 'execution expired' whenever I use c++filt?!
@Pawnguy7 lololol. What's your point? Or are you just sulking?
 
5:32 PM
@sehe ? I just said my point. I figured it would be pretty localized, not programming related, among others things. And the infamous "you didn't search for it", which I dislike because I did.
OR, I worded it badly, perhaps.
 
@Pawnguy7 Oh. Well, no it's not. You might still ask it. Perhaps people would appreciate it (it's an original question and it exposes a use case which many people tend to forget)
@Pawnguy7 Yeah, I felt you were just complaining about it being "hard"...
afk
 
@Rapptz, can I see you range thing?
 
cough. indecent proposals!
 
-.-
 
I once saw a Java program, where a function simply returned true. Is this odd design, or is that actually useful?
 
5:39 PM
bool retTrue() { return true; } seems useful to me</sarcasm> (I'm sorry that was not really needed)
 
Hm...
While we are at it...
int getRandomNumber() {return 6;}
 
Xeo
4, it's 4! Noob
 
user784668
5
 
4 based on what?
 
Yeah pawnguy
 
user784668
5:40 PM
@Pawnguy7 xkcd
 
way to ruin it
 
@Pawnguy7, it's a reference
 
Apparently I don't know the reference...
 
Xeo
 
Ah... I see. Although, I was not thinking of dice.
 
Xeo
5:41 PM
You still failed.
 
same function name and everything
 
What else would you call it? I thought of getRandomNum, but I prefer having the whole words, for some reason.
 
lol wat
 
Like. I would prefer a getVertex() to a getVert()
 
Where is that Stack Overflow question were the question had that XKCD comic for the question and one of the most up-voted answers had a Dilbert cartoon strip (both being relevant to randomness)?
 
5:44 PM
best jokes perhaps?
 
@Pawnguy7 No, it was a question specifically asking about the above XKCD comic.
 
Oh.
 
At stackoverflow.com/questions/84556/…, there is the same one, near the top, also. What is there to ask about the comic?
10k what?
 
@Pawnguy7 It's a deleted question, so you need 10k rep to see it.
 
5:47 PM
Ah. I don't like those. While some probably are good to delete, I have seen many questions I found useful, with many favoring to delete. And the ever-infamous broken link, often from a related SO question.
 
Lemme get a screenshot
 
Ahahaha
 
@Jueecy I don't get it... sigh.
 
user142019
Oh wonderful. LLVM exposes functions that are static and inline.
 
user142019
5:53 PM
Yes, very useful if I want to use it from Haskell.
 
@Insilico, why was that deleted? with all that rep?
 
user142019
Time to write glue in C. :L
 
user784668
@Jueecy because Atwood.
 
Ah. Nice thread, @Insilico. Although... how did you take the screenshot?
 
Can an automaton have no end?
 
user784668
5:55 PM
@Pawnguy7 print screen?
 
@Griwes I think Pawnguy7 wants to know how I managed to take a screenshot that spans several monitors.
@Pawnguy7 I used this: getfireshot.com
 
I see. I was thinking, it kind of reminded me of one of those panoramic picture things.
 
There's tons of webpage screenshot thingies you can download for pretty much any browser. What they all basically do is to automatically scroll the webpage and do a print screen each time then stitches the screenshots together.
 
I wonder how long we will have the print screen key. It has kind of lost its original purpose... still serves a new purpose, though.
 
@Zoidberg I meant one that has auto-complete, syntax highlighting, and let you debug your shaders by stepping through lines and seeing the pixel changes. :D
 
user142019
5:58 PM
Vim.
 
user142019
Write a Vim plug-in noob.
 
Vim has the capability to integrate with a debugger? o_O
 
@Pawnguy7 We will have the print screen key as long as we want to take screenshots. :-)
 
user142019
@ThePhD why wouldn't it. T_T
 
user142019
You can extend it however you like.
 
5:59 PM
Hm.Oh.
 
@Insilico Probably. That being said, being able to take pictures of individual windows would be useful. Some future OS should add in a little utility to do just that, you think?
Or,perhaps, and/or a rectangle. And of course, a full screen option.
 
@Pawnguy7 Alt+Print Screen
 

« first day (882 days earlier)      last day (4082 days later) »