« first day (1057 days earlier)      last day (3898 days later) » 

1:01 PM
ok can some one tell me vector size is same as vector length?
 
@Catty std::vector doesn't have a member function called length(). Only(?) std::string has that one. Use size().
@Catty Yes it is (length doesn't exist but that's what you're looking for, yes).
 
I'd say use Google
 
@melak47 It does the latter. It could have a better name, though, like not starting with is.
 
cause surely someone has already asked that question
 
1:03 PM
Eh probably, I answered him anyway since I have some free time and it's really simple. :p
 
@Tuntuni I googled but could not find it. thanks Tuntuni
 
random_device rd;
mt19937 eng(rd());
uniform_int_distribution<uint32_t> dist(1, 100);
ofstream file("random_numbers_1-100.txt");

generate_n(ostream_iterator<uint32_t>(file, "\n"), 100, bind(dist, eng));
The STL is so awesome. :3
 
no.
 
@DeadMG aw. :(
 
7 hours ago, by Borgleader
I hope DeadMG doesn't read this, since he already has cancer, but I think his goal is to standardize something à la Cinder.
lol
 
1:14 PM
I don't like Google autocompleting my searches.
It went from "Cinder" to "Cinderella".
 
@Pawnguy7 lol you are so gay
 
Hm?
Are you implying I search for cinderella? :D
 
At least Google thought you would :P
 
I don't remember last time I used google dot com the page.
 
What does it suggest for you with "Cinder"?
 
1:23 PM
Amnesia gets to all of us sooner or later.
 
Use your browser Luke.
 
@Pawnguy7 "cinderella man"
 
And, of course, you can guess what it likes to do when I search for standard library things :\
@StackedCrooked likewise. Whatever that is?
 
I guess Google thinks I'm even more gay.
@Pawnguy7 About a boxer apparently.
And it has Renée Zellweger.
 
Actually, I guess technically this is chrome. It seems to select something automatically, rather than arrow down.
 
1:33 PM
Vlad is back
 
Vlad III, Prince of Wallachia (1431–1476), was a member of the House of Drăculești, a branch of the House of Basarab, also known by his patronymic name: Dracula. He was posthumously dubbed Vlad the Impaler (Romanian: Vlad Țepeș ), and was a three-time Voivode of Wallachia, ruling mainly from 1456 to 1462, the period of the incipient Ottoman conquest of the Balkans. His father, Vlad II Dracul, was a member of the Order of the Dragon, which was founded to protect Christianity in Eastern Europe. Vlad III is revered as a folk hero in Romania for his protection of the Romanian population both ...
This one?
 
He's one of the characters in that hit show The Asylum.
 
Thoughts on Cinder?
 
@R.MartinhoFernandes never heard of it :E
 
I was trying to find those short games in the talk, but google thinks I want to play a cinderella game.
 
1:38 PM
@Pawnguy7 give in!
 
Never.
 
@melak it's std-proposals
 
@R.MartinhoFernandes hm? cinder is going to be in the standard? o.O
 
I hope not.
 
by the way
I've been working with that LLVM toolchain on Windows thing
don't bother; it's not usable.
@R.MartinhoFernandes Their sample code gave me cancer too.
 
1:45 PM
Not usable to what extent?
 
@DeadMG yeah I noticed :(
 
@R.MartinhoFernandes Fails to compile stdlib headers kind of unusable.
 
I don't care much about VS integration to be honest.
Oh that is bad
 
yes
 
@R.MartinhoFernandes installer is fail, install batch file is fail, platformtoolset thing screws up your project properties, needs VS2010 stdlib to work (or so I've heard)
 
1:46 PM
frankly, I suspect they could really have used another week or two but wanted to release it for GN.
@melak47 That was yesterday. I already encountered, reported, and they issued a fix for all of those things.
 
@DeadMG and today?
 
Well it's alpha, so... I mailed the link to my team abd we certainly want to keep an eye on it as that would make cross platform support a matter of compiling with clang, which right now only the Windows guy cannot
 
@melak47 It's still unusable, but all of those issues are fixed.
 
Yeah I suppose they rushed the announcementbecause of GN
 
@R.MartinhoFernandes If you're happy to ignore errors coming from the stdlib headers, you can compile with Clang now.
 
1:50 PM
Also pups, thanks for mentioning ranges on the push back thread and saving me the hassle of doing it from my phone
 
no probs
not that I don't have sympathy for anyone who claims that expressing your average loop as a range is too difficult.
 
@DeadMG we use the std and boost extensively
 
I doubt that Boost will have an issue.
well.
the core issue, I feel, is that Clang does not yet accept everything MSVC accepts.
so all of the VS-specific code guarded out by #ifdef _MSC_VER is going to be somewhat unfortunate.
 
Yeah but the more people realise that that is a pain that needs to be overcome, the more likely we get decent ranges.
 
I concur.
 
1:53 PM
Anyway I'll probably try it out on Monday anyway, or get the Windows guy to do it.
 
is there any chance of getting the clang-format plugin to work in VS2013? :E
 
if you are lucky the Clang guys will have fixed that parser error
 
We already have a xode formatting script running as a hook , so I don't care much for clang-format
 
I never cared much for automatic formatting tools
 
it's very good at removing white space lines. :)
 
1:58 PM
Well it was already in place and it seems unobtrusive enough so I'm fine. I'll complain loudly as soon as it messes up something
 
user1804599
Hmm.
 
user1804599
I need to do pagination in JavaScript.
The horror.
 
@DeadMG the installer still doesn't create the registry keys used by the props file for me :/
 
I don't recall the props file using any registry keys.
 
user784668
@not-rightfold You need to do JavaScript? The horror.
 
1:59 PM
I'm new but my word carries a lot of value for our dev team :)
 
:11664057   <PropertyGroup>
    <LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM 3.4.svn)</LLVMInstallDir>
    <LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM 3.4.svn)</LLVMInstallDir>
    <ExecutablePath>$(LLVMInstallDir)\msbuild-bin;$(ExecutablePath)</ExecutablePath>
    <LibraryPath>$(LLVMInstallDir)\lib\clang\3.4\lib\windows;$(LibraryPath)</LibraryPath>
  </PropertyGroup>
 
@R.MartinhoFernandes meaning ... they suck?
They are also vegetarians if I remember correctly.
 
@melak ugh they should use env vars
 
@R.MartinhoFernandes woot, it compiled, even though I included <memory>! :o
 
You can use env vars everywhere but not registry keys.
 
2:01 PM
compiled != runnable
 
You canuse the in PS but it's still silly
@melak cool!
 
@Telkitty猫咪咪 right you are...it never ever enters main
 
I'm out now. Keep me posted on any further developments
 
@R.MartinhoFernandes it doesn't run main ._.
 
vegetable on steak? hay, it is saturday (NSFW)
 
2:05 PM
> CL : error : cannot mangle RTTI descriptors for type 'codecvt' yet
:(
alright, stepping through in VS seems to be...pretty broken :)
 
File all the bug reports!
 
I don't even know what to file. VS just steps through crtexe.c and never enters my code :p
 
2:24 PM
@Borgleader yes
 
user1804599
Blewrg.
 
user1804599
I want to work on Lounge<Chat>. :<
 
Then do
 
also r value is confusing
 
user1804599
@Borgleader I need to fix this website for client first. :<
 
2:29 PM
@A.H. yeah, I changed it.
 
0
Q: Why can I call function templates without forward declarations?

FredOverflowIf a normal function calls a function that has not been declared yet, I get a compile-time error: void foo(int x) { bar(x); // ERROR: bar has not been declared yet } void bar(int x) { std::cout << x << '\n'; } The fix is to either forward-declare the called function, or to switch th...

^ low hanging fruit, any takers? :)
 
GCC 4.7? I don't recall if this was definitively fixed or not.
 
4.6.3
 
@FredOverflow is it because you never instantiate the templates? :p
 
@FredOverflow Ctrl-F 'lookup' in there and see if it applies.
 
2:38 PM
@melak47 I do, see update.
 
Does it need to be both? Just foo? Just bar?
 
user784668
@FredOverflow Upgrade you compiler, GCC 4.6 is not supported anymore.
 
@Fanael g++ 4.6.3 is what comes with my Xubuntu, and I don't know how to update cleanly ;)
 
hey rightfold
thanks for linking this
 
2:41 PM
I'd almost forgotten how fucking awesome I am
 
user784668
@FredOverflow What version your Xubuntu is?
 
@Fanael The latest LTS. I think it is from April 2012 or something.
 
user784668
No GCC >= 4.7 in repos for you then.
 
@R.MartinhoFernandes That's a very nice position. This is one of the more appealing aspects of the job position I'm considering :)
 
11
A: How to update gcc to the latest version(in this case 4.7) in Ubuntu 10.04?

WitchCraft12.04 Add the toolchain ppa test repository, then do apt-get update, and apt-get dist-upgrade sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install g++-4.7 c++-4.7 This is only available in 12.04 - older ubuntu versions cannot be updated to this same ver...

 
user784668
2:45 PM
@FredOverflow By "repos" I meant "official repos".
 
user784668
But sure, you can try and find a PPA with 4.7 or 4.8.
 
WARNING: It work for me on quantal (12.10), but it removed acroread, broke xpdf, valgrind no longer works and I couldn't attach gdb to a running process. — sehe 3 secs ago
 
user1804599
Hey.
 
@not-rightfold [a] Work in the weekends. [b] the site is broken --> two sure signs you're in the wrong a dubious job
 
user1804599
2:50 PM
It's not for my job, you fool.
 
@not-rightfold Phew. That was a good save, then
 
@Fanael or you could build it
 
@Fanael Oh, I didn't realize 4.8 was out already. Now I got 4.6, 4.7 and 4.8 installed :)
 
@FredOverflow its in debian testing
 
Is 4.8.1 somehow "worse" than 4.7.3? Is it less stable or something?
 
2:53 PM
@FredOverflow Less tested/proven. That's common sense, of course
 
its testing from the POV of debian if I am not mistaken
 
In that case, I'd better revert back to gcc 3 :D
 
user784668
@FredOverflow New circum-register-allocation stuff that's still kinda beta.
 
user784668
OTOH, the C++ frontend has complete support for C++11.
 
any news on when libstdc++ will have regex?
 
user784668
2:56 PM
@A.H. 4.9
 
@A.H. I know someone's working on it, but I haven't checked the pace of progression.
Or is it just 'pace'?
 
user784668
But C++ regex has terribad Unicode support.
 
I thought it was modeled after boost's
 
> This is a "why is the sky made out of bricks" type question.
 
@Fanael You mean 'it has none'?
 
2:58 PM
awesome :)
 
Oh... if map_range has mapping_functor and mapped_range members, then how does that work for split_range?
 
mm does anyone know if flex has unicode support ? :O
 
user784668
@MartinJames No, it has lousy minimal support if and only if you use UTF-32.
 
user784668
If you don't use UTF-32, you're right.
 
who uses UTF-32 ?
 
3:02 PM
splitted_range it is. I'll put it right next to concated_ranges.
 
user784668
@LucDanton split_range
 
That would name a constructor.
 
user784668
English is awesome, isn't it?
 
Jawohl.
 
user784668
The past participle of the verb "split" is "split".
 
3:07 PM
Why would it need to be? This looks like unnecessary complication to me. apply_visitor expects a static_visitor<> derived class, with a public interface. Just supply it :/ — sehe 18 secs ago
 
3:19 PM
@Fanael So, I split hairs, because you split hairs ?
 
user784668
Yes.
 
3:42 PM
@LucDanton concated? ew I'd prefere concatenated_ranges with the user doing the relevant ugly shorthand aliases if he so pleases
 
@sehe The result type of concat(a, b, c) is concat_range<A, B, C>, which has a concated_ranges member (so that a caller can retrieve the ranges after processing should they need to). The name is dumb, but the scheme is consistent.
That's funny. I was going to make an example with auto s = take(n, r); but that's implemented via slice so you'd need to do s.sliced_range.
 
Hello! Is there anybody here who can help me to use Vim :make?
 
user1804599
Yes.
 
I completely fail to understand what you wanted to say there. For entertainment value, here's a version that even 'lifts' noexcept-ness of the wrapped visitor :) — sehe 3 secs ago
@LucDanton I got that part :/ It's still ... cheesy
 
Please check my question stackoverflow.com/questions/18674226/… if you're willing to help me.. Thanks!
 
3:51 PM
@LucDanton sliceed_range :/
 
That doesn't make any sense :v
 
@Servant Strangely that is so polite I'll even go and have a look
@LucDanton Butttttt - it's consistent!
 
Well since you said 'butt' I suppose you do have a point.
 
@FredOverflow I'm watching the Quicksort lectures. I'm so not convinced that the shuffling is needed. =/
 
@LucDanton Nobody criticize my buttttt!
 
3:54 PM
@sehe Committed.
 
@LucDanton Thanks for the warning
 
Well, you know how I ask all the time about names. I genuinely care about that stuff.
 
Naming is one of the two hard problems.
 
I'll think about splitted_range another time though, I'm getting tired.
 
Is it possible to disguise a header file with another file extension and still make it compile?
 
4:01 PM
Yes.
 
"Header files" are a convention.
 
$ cat whatever.bat.exe.tiff.avi
struct foo {};
$ cat main.cpp
#include "whatever.bat.exe.tiff.avi"

int main()
{
    foo f {};
}
$ g++ -std=c++11 main.cpp && ./a.out
 
Also extensions.
Valley Without Wind is cool.
 
hi does anyone of you know what this error means? "uncaught exception thrown by method through reflection"
 
4:04 PM
Alright, I drank way too much yesterday.
I feel like my head is gonna split in two.
 
@Borgleader Is it about degeneration? Haven't watched it yet.
 
in visual studio :-)
 
(Do you mean shuffling the whole array or swapping the first with the pivot?)
 
Does anybody here know how to use Vim?
 
@EtiennedeMartel Lol, same for me. Yesteday was the first time i ever experienced feeling hungover before even going to bed.
@Servant Yes. You press Esc, then type :q
 
4:07 PM
@DavidKron No I have a question about that..
@DavidKron Do you know how to use :make?
 
@wangdongchaine but I'll wager your code isn't C++.
 
its c :-)
 
@DavidKron Hehehe..
 
it's C*
 
@FredOverflow It's about avoiding the worst case. Because avg case is ~2NlgN and the worst is ~(1/2)N^2. Thing is in practice shuffling an array of size N is going to be slow as hell methinks.
 
4:10 PM
@Borgleader shuffling is O(n)
 
does anybody here know JM? (for H.264/AVC)
 
Is it true that Vim is the hardest text editor?
 
user1804599
Vim is the text editor that makes my dick the hardest.
 
user1804599
Also, Notepad is much more difficult to use than Vim (look at undo oh God).
 
@FredOverflow I know, I'm saying in practice the operations involved in shuffling (that is swapping objects) might be heavy enough compared to just reading memory (compares) that it's not worth it. idk, I'm just not totally convinced. I'd have to test it and see.
 
4:12 PM
In Java, you're just swapping references.
 
@not-rightfold Hehehe.. Yeah, there is only 1 undo history with Notepad..
 
@FredOverflow Yeah, in Java :P
 
And this course uses Java.
 
I guess that's why algorithm classes pick Java as a language, because in Java all operations are born equally slow and this maps well to theoretical models.
 
Well, all assignments are very fast in Java.
 
user1804599
4:14 PM
What?
 
Assignment is not a member function in Java.
You just change a single machine word.
 
user1804599
My homework assignments took ages because of the terrible language that doesn't collaborate with my brain.
 
user1804599
@FredOverflow Not much different from assignments in C++.
 
@DavidKron Please check this question: stackoverflow.com/questions/18674226/…
 
user1804599
4:16 PM
You can't compare it to anything but pointer assignments because the semantics would be different.
 
WTF, Java has no standard library facilities to copy parts of an array into another array or merge two slices??
 
user1804599
Java hasn't got anything useful at all.
 
user1804599
Use C#.
 
@FredOverflow Nope, but you should know that already we had to copy arrays manually for the last assignment
 
@FredOverflow Java's collections algorithms are terrible, especially arrays.
 
4:17 PM
@not-rightfold If you write a generic method that sorts an array of T, then you know assignment just changes a single machine word. In C++, you don't know that.
 
user1804599
@FredOverflow It does it you sort an array of pointers.
 
@Borgleader No, I used Arrays.copyOf which generates a fresh array.
 
user1804599
You can't compare Java ArrayList<MyClass> to C++ std::vector<MyClass> because they have completely different semantics.
 
@not-rightfold Yes, but you don't know what T is in general.
 
user1804599
Write a sort function that accepts only collections of pointers.
 
user1804599
4:19 PM
Woop!
 
user1804599
Because that's what you do in Java too.
 
user1804599
You can't compare anything else to it.
 
You can't compare Java ArrayList<MyClass> to C++ std::vector<MyClass*> either, because Java references and C++ pointers are not exactly the same thing.
 
@FredOverflow o.O even their code used a raw for loop to copy stuff. good to know i guess
 
private void setCapacityToTwiceTheSize()
{
    items = java.util.Arrays.copyOf(items, 2 * size);
}
 
user1804599
4:20 PM
@FredOverflow That difference is insignificant in the current context.
 
user1804599
@FredOverflow doubleCapacity :V
 
@not-rightfold No, the capacity is not doubled. I also use the method to shrink the array.
 
user1804599
Oh wait lol.
 
user1804599
I don't like how member functions in Java are implicitly virtual. :(
 
user1804599
And how classes are implicitly inheritable. :(
 
4:22 PM
Right, they got the defaults wrong.
But you can't really blame them. Back in 1995, overriding like there's no tomorrow was the norm.
 
user1804599
In Go you can do this:
 
user1804599
type Foo struct { x int }
type Bar struct { y int; Foo }
bar := Bar{}
fmt.Printf("%v\n", bar.x)
 
user1804599
Composition ftw.
 
Any Vim master here?
 
> splitWhen (== 0) []
[[]]
Kinda didn't expect that.
 
user1804599
4:32 PM
@Servant de ijsbeer.
 
@not-rightfold What?
 
user1804599
@LucDanton why not?
 
4:54 PM
@not-rightfold nice
@Borgleader ...no programming assignment for week3? :(
 
Havent checked, I just finished the lectures
 
shit
all I had was a cheese sandwich.
and now I feel like utter shit.
 
Anybody Vim expert here?
 
dude, go away
what do we look like, a fucking helpdesk?
 

« first day (1057 days earlier)      last day (3898 days later) »