« first day (1205 days earlier)      last day (3757 days later) » 

user2260218
8:00 PM
In C, do you have to assign parameters to new variables in functions? Or can you directly use them?
 
quick, reverse the polarisation of the cloaking field
 
classes like this make me wonder why I ever decided to major in compsci...
 
@Anthony Do we look like a C room?
 
user2260218
In C++
 
user2260218
:P
 
user1804599
8:01 PM
@Anthony Yes.
 
user2260218
Why do you have to?
 
user1804599
You do not have to.
 
user2260218
Oh.
 
user2260218
Why do people?
 
user1804599
Because they either are idiots or because they need a copy.
 
8:02 PM
room topic changed to Lounge<Cloak>: Reverse the polarisation immediately! [c++] [c++11] [c++1y] [c++-faq]
 
Guys, anyone remembering the codepoint for that character in that elaborated version of o_o?
 
so... are symbol tables, for all intents and purposes, basically just a dictionary?
 
Google "o_o with eyebrows" for the rescue.
 
user1804599
ಠ_ಠ
 
Ell
TIL ruby has func = ->(a, b){puts a, b} syntax now
 
user1804599
8:06 PM
Is that an alternative to lambda { |a, b| puts a, b }?
 
@Ell That arrow placement is insane.
 
Ell
@rightfold yeah
 
user1804599
Meh.
 
user1804599
lambda worked just fine.
 
Ell
I think so too
 
Xeo
8:07 PM
@Griwes but our lambda sytax must be unique!
 
user1804599
I wonder if I can use ಠ_ಠ; in Perl without getting a syntax error.
 
user1804599
> Unrecognized character \xE0; marked by <-- HERE after use <-- HERE near column 5 at t/mem_index.t line 7.
 
user1804599
ಠ_ಠ
 
user3010322
@R.MartinhoFernandes Sorry, I just got back home. =/
 
user3010322
@ScarletAmaranth I have a class like this that I'm in now. It's called "The Art of Engineering." It's basically a bunch of people from various industries or departments talking to you about their problems.
 
8:21 PM
@Griwes Doesn't really affect debugging. The decompression happens between memory and the CPU, so by the time the CPU sees anything, it's just normal instructions. The CPU itself doesn't really need to know or care that it's happening at all.
 
user3010322
Because they come from all disciplines of engineering, 95% of the information you're told -- while interesting -- is completely useless to what you actually want to do with your life, or what you're learning.
 
@JerryCoffin How do you represent the address of current instruction, then?
It must be something you can follow back to memory.
 
@Griwes Just like always. The compressor deals with translating that address to whatever gets fed to memory.
 
why the fuck does git push ask me for my Github.com password?!
that always worked until now
 
I just don't like the concept of address given in form of "0x0000001111:3"
@KonradRudolph Because you cloned with https address instead of ssh one?
 
8:23 PM
@Griwes I didn’t clone anything, this is the first push to a new repo
But I always use https – I thought
 
I need 50 more rep to reach 15k.
 
From what I recall, I could never get https to work for w/e reason it had.
 
nope, obviousy I’m wrong
bizarre
Anyway, cheers @Griwes, that probably saved me quite some time
(Or not, google is awash with answers to this …)
 
hm so I know what I want to do if it was javascript or python... but have no idea how or if it could be implemented in C or C++
 
@Crowz hm?
 
8:35 PM
@EtiennedeMartel I only need about 400K more to reach second place overall--if nobody else made any while I did that, of course! :-)
 
I simplified it down to basically nothing though
 
I need to stop getting angry at silly questions and answer them =/
 
@Borgleader Answer them or ignore them, but yes, getting angry at them is pretty much a waste of energy.
 
Also I keep answering in comments =/
 
@Crowz a map<unsigned, function<T(T,T)>> or what?
 
8:42 PM
@Borgleader I do too sometimes, especially for short, seemingly trivial answers. For a while @Chris was doing that a lot (and probably still does quite a bit).
 
@Crowz melak is right, a simple unordered map would be ok.
 
Ell
Why does class T { static const char* s = "hi";}; need const char, but out of class it doesn't?
(begins googling)
 
wat do you mean
 
Ell
> error: invalid in-class initialization of static data member of non-integral type ‘const char*’
but when you do it outside of a class, it's all fine
@BartekBanachewicz Ahh I see
 
8:45 PM
@Ell Because of special rules for initialization of a static const T inside a class. Or, looking at it a little differently: because inside a class, it's associated with a class instance unless it's static. Outside a class, it's not associated with a class instance regardless.
 
Time to turn off Twitter
 
but someone else might want to use it
 
@KonradRudolph ...permanently!
 
lest we be inundated by zee Americans
 
'murica
 
user3010322
8:49 PM
@EtiennedeMartel You look like you're at 15K to me. Congratulations!
 
@ThePhD If that's all you, it's gonna get reverted soon.
 
I've tricked my GF into making assets for me
 
Xeo
@Borgleader basically all I've been doing for the past 6 months. I've only written 8 or 9 actual answers in that timeframe
 
user3010322
I just reached 15K(x10^-2) myself. :D
 
user3010322
8:50 PM
@BartekBanachewicz How?
 
user3010322
@Xeo How was the game?!
 
user3010322
Was DeadMG the spy?
 
Xeo
wasn't in it, leg etc
 
user3010322
Or did Cat turn out to be the horrible monster?
 
user3010322
Whaat? D:
 
user3010322
8:51 PM
Noooo. u.u
 
Time to figure out that intermittent seg fault im getting with nonius
 
it's still going on
I'm currently trying to murder thecoshman
 
user3010322
That kind of ruins your plan now that you've said it here, yeah? ._.
 
nope
he already knew that I tried to fire
in fact, I already shot him once.
he's kind of ... crawling at me.
since I shot him in the leg.
I'm the team leader and he wasn't being a team player.
 
user3010322
So.... non-cooperation is met with capital punishment?
 
8:54 PM
welcome to Alpha Complex.
frankly my character had it in for his character ever since she showed up late to the briefing.
and tried to whore out like a slut.
and my character just vapourized her like a total baws.
she was a traitor you see.
 
user3010322
Sounds... complicated.
 
@Borgleader I got some access violations in release mode on windows
 
My problem is I have 2 ways of doing the same thing. They should be equivalent AFAIK, but one gives a segfault, the other doesn't
 
Why are you casting?
 
8:59 PM
Where?
 
In placement new
 
er
of course they're not equivalent because they perform the same operation on two different addresses.
 
@Rapptz Because it doesn't compile if I don't
 
wut
 
user3010322
Yeah.... data by itself decays to the pointer. &data is the address of the array, which is like the pointer to a pointer, so...
 
9:01 PM
@ThePhD The array doesn't have an address really.
 
user3010322
If you wanted it to work, you'd do &data[0]
 
error: no matching function for call to ‘operator new(sizetype, const TStorage*)’
new (&data) T(std::get<Idxs>(args)...);
 
user3010322
Anywho.
 
@Borgleader You need new (data) ...
 
@Borgleader const TStorage*
 
user3010322
9:01 PM
Why are you giving a const pointer?
 
user3010322
const is your issue here, IIRC. o.0
 
but frankly
 
@DeadMG What? Of course it does.
 
How do you see constructing something in place of a const object?
 
this is why you don't use C-style arrays.
 
9:02 PM
@ThePhD The name of an array does not decay to a pointer when it's used as the operand of & or sizeof.
 
just declare one object.
 
user3010322
 
Xeo
@Borgleader &data -> T (*)[N]
 
user3010322
@JerryCoffin Well, yeah, that's why I said you needed &data[0] to get a T*
 
Xeo
also,cast to void* for placement new (not necessary but good practice)
::new ((void*)&data[0]) T(...)
 
user3010322
9:04 PM
In his example, though, data shouldn't be made into an array.
 
user3010322
It should just be TStorage data;
 
@Xeo The array version works though, it's the version with just TStorage data; that segfaults >.>
 
user3010322
Since TStorage is already std::aligned_storage<...>::type
 
Xeo
oh
 
oh god you guys I hate doing bitwise operations
 
user3010322
9:07 PM
@Borgleader Updated and refactored: gist.github.com/ThePhD/e44dec26911808e18f03
 
user3010322
Just a quick method to isolate the problem to one line of code (or two, if you ever happen to use the const version).
 
user3010322
(Which I don't think you ever will, but just in case).
 
user3010322
@Borgleader Did it work out?
 
Ell
@Crowz what are you trying to do?
 
@ThePhD Nope, no known conversion for argument 2 from ‘const std::basic_string<char>*’ to ‘void*’
I think I have to cast in the call to placement new
 
9:20 PM
Damn, I need to store sorted arguments, and they are currently an unordered_list
 
Ell
lel spend a few hours on a feature then realised after I didn't need it at all
 
user3010322
@Borgleader Which line? :o
 
user3010322
Wait
 
user3010322
WTF
 
user3010322
Why is operator()() const?
 
9:21 PM
@Borgleader Track the source of that const.
Realize that you are doing something that tries to break const correctness.
???
Profit!
 
Oh... wait... I think i made it const because void call() const override { fun(); }
 
user3010322
And why is make const either?!
 
user3010322
Well
 
I was tired xD
 
user3010322
Once you fix that, you should be good to go. :D
 
9:22 PM
Wait...
god damnit
I have to think =/
 
Were you also tired the last time we told you that the const is the problem?
 
void call() const override { fun(); }
Fun fun;
 
@Xeo condoning a c-style cast, are we? :)
 
Pretty sure operator() has to be const because of call()
 
Xeo
@StackedCrooked fuck the system!
 
9:25 PM
@Borgleader All aboard the mutable train, then! :D
 
Xeo
(typing out a real cast is annoying on touch)
 
@Griwes Mut muut
4
 
I wonder why the robot made call() const in the first place =/
 
Because ~const correctness~
 
user1804599
cunt currectum
 
9:30 PM
guys
what do you think about the comment
@Nye thanks for commenting, so that I can cleanup with the misunderstanding. I told him that the syntax says that "= 0" is expected. I specifically did not say "because that's how it is", because I myself will downvote such answers. — Johannes Schaub - litb 3 hours ago
 
9:41 PM
@JohannesSchaub-litb I need to think really long about this.
 
@StackedCrooked why did you have to think long about it?
 
I'm just a little slow. But also, why is "because that's how it is" wrong?
 
because that's how it is wrong
lol
 
I thought that it really was how it is like that.
or something along those lines
 
user1804599
Parsing in Perl is fun.
 
Ell
9:47 PM
and impossible!
 
user1804599
Just us regex for everything. :D
 
Perl regex are nice.
 
user1804599
Perl regex best regex.
 
user1804599
Everything else is crap.
 
user1804599
9:48 PM
Well, and PCRE.
 
One teacher once wanted us to parse CSS with ECMA script regular expressions
 
user1804599
You can determine whether a string is a palindrome using Perl regexen.
 
user1804599
Also using .NET regexen IIRC.
 
Ell
Is inheritance for code reuse bad?
for anti-repetition
 
9:50 PM
It's more like a last resort imo.
 
user1804599
@Ell In what programming language?
 
Ell
@rightfold Ruby
 
user1804599
@Ell Use include, not inheritance.
 
@rightfold And n^2 regex101.com/r/gB8qN7 :D
 
Ell
@rightfold Of course! Thank you
 
user1804599
9:51 PM
High-level object-oriented languages often have other means than inheritance for this.
 
user1804599
C++ has private inheritance, which is an implementation detail and thus not evil.
 
user3010322
Composition is usually good too (if you can mark it private).
 
user1804599
Do not make is-a relationships things are not other things.
 
Damn. I have two functions, f(std::string) and f(std::vector<std::string>). I can call the function like this: f({"foo", "bar"}), but the call f({"foo"}) is ambiguous – is there a way to avoid this without having to specify the type name?
 
public inheritance for code reuse doesn't have to be bad either
 
9:52 PM
Palindroooomes regex101.com/r/iF7yM8
 
for writing traits or something and if you don't want to rewrite the functions
 
Xeo
@ThePhD private inheritance is a form of composition
@KonradRudolph don't think so.
 
@Ell inheritance is meh in general
 
user3010322
@Xeo True. Also less typing!
 
Meh :/
 
Ell
9:53 PM
I quite like inheritance
 
Xeo
why the single string overload in the first place, though?
 
@Xeo Because it does something different. ;-) Cf. (lambda (x) expr) vs. (lambda args expr).
 
Xeo
oh right, you were doing that lisp thing
 
user1804599
Meh, lambda.
 
user1804599
fn :F
 
9:59 PM
And this, right here, is why size_type should be signed:
assert(static_cast<decltype(formals.size())>(std::distance(a, b)) == formals.size());
 
user1804599
Use Java.
 
(also, it fails.)
 
why would you do that
 
user1804599
Or Perl.
 
the problem here is that you explicitly cast to a potentially unsigned type.
just don't do that.
 
10:01 PM
@Ell basically, I have a long and I want to take each 4 bit component and make it its own variable
 
@DeadMG … and do what, instead?
 
@KonradRudolph Why not simply compare it directly?
 
@DeadMG Because that’s illegal (well, -Wnarrowing). Hence the cast
 
so it's completely not illegal at all.
and you replaced a narrowing conversion with a completely broken conversion instead.
 
@rightfold lol
 
10:04 PM
@DeadMG What part of “possible loss of precision” is not broken, exactly?
 
Ell
I really need to learn how to use vim to copy to the X clipboard!
 
@KonradRudolph Depends on the exact types involved.
 
@CatPlusPlus your own mod pack?
 
I wouldn't expect distance_type to be wider or narrower than size_type.
 
10:05 PM
Not mine, but I like it
 
though
 
Xeo
@KonradRudolph I'd actually rather question why std::distance returns a signed type, but oh well
 
@CatPlusPlus a metric butt tonne of mods :S
maybe another time
 
Xeo
since first has to be before last, making negative distances ill-formed
 
@Xeo Okay, point taken
 
10:06 PM
I might compile my own once I get a grasp on what mods I want, and what mods I don't want
 
Negative distance … snerk
 
It's not as heavy as that Mindcrack crap
 
user1804599
$hit = 2; # hihi
 
Xeo
@KonradRudolph what?
 
I'll write some getting started guides
 
user1804599
10:07 PM
@CatPlusPlus I want to play tomorrow evening. Could you whitelist ubergeekkiller?
 
@Xeo Well, I, like you, question the sanity of such a concept. Physics training kicking in
 
btw I enabled /gamemode for everyone, so you don't have to mine shit, you can just switch to creative+ and spawn whatever
Less tedium, more playing with cool shit
 
user1804599
Oh, meh, nevermind then.
 
I mean, you can mine if you want, survival is still default
There's some new types of dungeons for adventurin'
 
is it just me
 
Xeo
10:11 PM
@KonradRudolph well, it conveniently encodes the direction of the vector into a single value, and makes sense if a > b (random access iterators), but std::distance doesn't allow that case
 
or is the combat in Starbound deeply dissatisfying
 
Xeo
@DeadMG it's a bit stale, yeah
especially since enemies tend to kill you pretty quick
but hey, it's a beta
 
eh
I don't have any complaints about that per se.
but I do think the enemies are too dangerous and not numerous enough.
but for example, both melee and ranged weapons feel gimped, and the physics issues with moving (especially jumping) are really bad.
and there are no apparently available interesting weapons or technology.
and I also think the death effects and lack of maps is quite broken, as well as a lack of being able to pause.
 
Ell
gah why can't I copy to x clipboard!
I'm selecting some stuff in visual mode then doing :"+y"
 
user1804599
10:20 PM
I should learn Tcl.
 
Tcl is not a nice language.
 
user1804599
It seems simple.
 
user1804599
And I like things that are simple.
 
you should work for my company then, plenty of Tcl there
 
user1804599
I don’t know Tcl.
 
10:24 PM
nobody does
 
user1804599
How about C++, JavaScript or Perl?
 
what about them?
 
user1804599
Is there plenty of that there?
 
meeeh. who's good with bits? I want to read individual words of a long
 
Plenty of C++ (some of it really bad).
There is some Perl code AFAIK.
 
user1804599
10:26 PM
@Crowz my_long & (1l << n)
 
Not much JavaScript though.
I'd like more JavaScript.
 
@rightfold what does n stand for? The size of a word?
 
user1804599
No, the index of the bit you want to read.
 
user1804599
@StackedCrooked I like Perl.
 
user1804599
I like Perl, Scala and Clojure a lot.
 
user1804599
10:28 PM
I also like Go and Erlang and some other languages that nobody uses.
 
user1804599
Not to mention APL. I should learn J.
 
Currently Python is taking over the role that Perl used to have.
 
@rightfold wouldn't my_long & (1 << n) suffice ?
 
@Ell Without :
It's a normal mode command
 
what does the 1l do?
 
user1804599
10:29 PM
1l is a long.
 
user1804599
1 is an int.
 
oooh, I see.
 
I'm not sure what you mean by that... the number of bits?
 
user1804599
1L << 0 is 0b1L, 1L << 1 is 0b10L and 1L << 3 is 0b100L.
 
@Crowz long = 64 bits, int = 32 bits
 
user1804599
10:30 PM
@HamZa Implementation-defined. Never depend on it.
 
user1804599
@StackedCrooked Meh.
 
user1804599
I don’t like Python. It is too dynamic.
 
wait... so wouldn't my_long & (sizeof(long) << n) make sense?
 
why is that a bad thing?
 
user1804599
No.
 
user1804599
10:31 PM
You want 1.
 
user1804599
You want to create a mask that has all bits set to zero except for one bit. Then you AND with that mask and you get the bit you want.
 
okay... I am also doing this in java (unfortunately) so not sure of the implementation differences
 
user1804599
@StackedCrooked The more errors the compiler finds for you, the better.
 
459
Q: Absolute Beginner's Guide to Bit Shifting?

John RudyI've been attempting to learn C in my spare time, and other languages (C#, Java, etc.) have the same concept (and often the same operators) ... What I'm wondering is, at a core level, what does bit-shifting (<<, >>, >>>) do, what problems can it help solve, and what gotchas lurk around the bend...

 
@rightfold But Perl isn't compiled, is it?
 
user1804599
10:32 PM
@Crowz for signed integers it shouldn’t make a difference.
 
user1804599
@StackedCrooked Perl has clear distinction between compilation and interpretation.
 
Oh wait, we may have some compiled Perl.
 
user1804599
You can even run code explicitly at compile-time using BEGIN.
 
user1804599
Perl also has compile-time scoping, which is good.
 
Because they were paranoid about outsiders seeing our code.
@rightfold Interesting.
 
user1804599
10:34 PM
Like most interpreters, code is compiled to in-memory bytecode and that is interpreted. Perl and Python both do this.
 
user1804599
In Python you can do this (see the bug?):
 
user1804599
if …:
    a = 1
print(a)
 
user1804599
In Perl you cannot do that without declaring a above the if statement first.
 
@JerryCoffin I remember why I stopped answering noob questions. It kills my accept rate =/ (It's a silly thing to care about I know)
 
user1804599
I.e. this is a compile-time error:
 
user1804599
10:35 PM
if (…) {
    my $a = 1;
}
print $a;
 
user1804599
Fucking SSH.
 
user1804599
+--[ RSA 2048]----+ is so ugly.
 
user1804599
Dat uncenteredness. Dat missing space.
 
operation: 15060
opcode: 1 Op1Mode: 5 Op1GPR: 60 Op2Mode: 6 Op2Gpr: 0
why doth thou torment me so, bitwise operations?
 
Ell
10:43 PM
@catplusplus ah okay thank you, I'll try tomorrow
 
@rightfold cool
 
> Need inspiration? How about spawncamping-octo-tyrion.
WTF Github.
 
When a question is in the related list that means it was one of the suggestions while it was being written right?
 
@rightfold So, I'm guessing Perl is your current flavor of the month?
 
hello
 
Ell
10:54 PM
I need a factory function
I think that's what its called. maybe not o.o
 
think they call it factory method but same thing
 
does it factorize things?
 
factory? it's easy to have one in Python:
def factor(y):
i = 2
while i * i < y:
while y%i == 0:
y = y / i
yield y
i = i + 1
also, fuck markdown ;0
 
tee(hee)
 
I'm excavating lava
 
10:58 PM
hope you brought a bucket
 
Bucket? Pfah
Who needs buckets when you have pumps dl.dropboxusercontent.com/u/26824/temp/mc/…
 
:E
 
It currently holds 302000 millibuckets
Max capacity is 2240000 :v
 
your lava looks like candy
you made me hungry
 
11:10 PM
@Ell such pun
 
wow
 
@Borgleader much* pun, FTFY
 
Fuck the doge meme
 
yes
 
@Rapptz very fuck, such doge, much meme
 
11:23 PM
never liked it
 
Ell
fuck all memes really
 
yeah, they are so 2009
 
I think Earth is prettier than the other planets. Blueness covered with white clouds is much nicer than the bland colors of the other planets.
 
it doesn't have cool rings
 
11:29 PM
True.
 
A friend asked me to help recover password for a rar file. I started to ask how long etc, and he says, in the meantime he found the password, but can't download it. I followed the link to see "Password The Elder Scrolls V Skyrim.doc" before my eyes :|
 
Ell
I think earth is pretty too
I tried mountain dew for the first time
tastes like aqueous sherbert
 
11:52 PM
Is there a reason the instructions to install MediaWiki would fail on a VM?
 
Ell
network not setup correctly?
might need forwarding or some sho
shiz*
are you trying to access guest hosted website from host?
 
I mean I can't even see the setup page from inside the VM :(
@Ell No, guest hosted from guest
 

« first day (1205 days earlier)      last day (3757 days later) »