« first day (975 days earlier)      last day (3973 days later) » 

7:00 PM
@EvgenyPanasyuk that reason is called being dumb.
 
@BartekBanachewicz no, I mean, I don't want to write a program, I thought notepad++ could do it
 
@ShuklaSannidhya static_cast<unsigned long>(-1)
 
calculating maximum value for long is impossible
 
@BartekBanachewicz not quite
 
@MooingDuck it is implementation defined.
 
7:01 PM
@BartekBanachewicz yes
 
so you can't do that without using implementation-specific code
thus, you can't do that.
 
There's a big difference between "can't do X" and "can't do X portably"
 
there's no difference for me
either we stick to the standard, or I start talking about C or C++ compiler I have developed that supports unicorns
2
 
@BartekBanachewicz there's a big difference between "implementation specific" and "non-conforming" as well.
 
sigh
I am going to take a shower.
 
7:04 PM
does anyone know how to use a dbg file to debug in eclipse?
 
-1UL did the trick. Also (unsigned long)-1
 
@Aboutblank step 1. : don't use Eclipse
 
@BartekBanachewicz You're so helpful.
 
@ShuklaSannidhya I don't think that's the biggest long value...
 
@ScottW do you use CD???
 
7:06 PM
@ScottW what eclipse cd
 
@ShuklaSannidhya yeah, that does seem to work (implementation defined)
 
@BartekBanachewicz suggest another ide to use in ubuntu?
 
step 7: Hunt ScottW and kill him.
@MooingDuck Where will it break?
step 8: Don't forget Bartek (He started all this).
step 9: Re-install Eclipse.
But why isn't this: 1UL << (sizeof(long) * 8 - 1) same as ULONG_MAX?
 
@ShuklaSannidhya sizeof(char) is 1
 
7:13 PM
my bad.
 
Also, my char has 9 bits. So it isn't.
And even if it was
You get
1UL << (4 * 8 - 1)
Assuming sizeof(long) == 4
 
Xeo
@ShuklaSannidhya Protip: It isn't.
 
Which is 1000000000...
in binary
 
Which is same as 2^(32-1). So it should be ULONG_MAX... right?
 
Xeo
And is still wrong
 
7:16 PM
@Xeo isn't 2^(sizeof(long) * 8 - 1) same as ULONG_MAX?
 
Xeo
no
 
@ShuklaSannidhya No.
 
Because no.
 
@Aboutblank one might say that ubuntu is an IDE
I love how he (and C programmers) like to hack around instead of thinking
if they thought for a while, they would stop using C
 
7:18 PM
Mah ULONG_MAX can has 9999999999999999999999999
 
Let X = 2^(sizeof(long) * 8 - 1), in how many bits does X+1 fit?
 
@LucDanton sizeof(long) * 8 bits
 
@milleniumbug no, it can't
 
@ShuklaSannidhya Then that means it fits in a long.
 
@milleniumbug Not possible.
 
3.9.1/4: "Unsigned integers, declared unsigned, shall obey the laws of arithmetic modulo 2^n where n is the number of bits in the value representation of that particular size of integer"
 
Oh misread that.
 
@EvgenyPanasyuk Ooops. My mistake.
 
@EvgenyPanasyuk long is signed
 
@ShuklaSannidhya Who says there are 8 bits in a char?
 
7:20 PM
i like how char is neither signed nor unsigned
 
@ShuklaSannidhya 2^(n - 1) + 1 isn't 2^n
 
Xeo
@BartekBanachewicz Wrong
It is either signed or unsigned (implementation defined), but it's a distinct type from signed char and unsigned char.
 
ah, that's the correct wording
 
@ShuklaSannidhya But it still can has 2**128-1
 
7:21 PM
props to Xeo.
 
@LucDanton I know. But 2^(n-1) will fit in n bits.
 
@ShuklaSannidhya Why?
 
@ShuklaSannidhya Eh, I suppose I'm after a tightest fit. But bringing up logs kinda defeats the point. Sorry, I'm afraid that line of inquiry isn't ideal.
Do it on paper. 2^k + 1 I mean.
 
@BartekBanachewicz Looking good.
 
@ShuklaSannidhya if long is not using two's compliment, or if long is larger than int, or probably other scenarios. In reality, probably nowhere you care about
 
7:26 PM
@ShuklaSannidhya If you have 10000000 in binary, then it's not the largest number 8 bits can represent.
 
damn you apt-get...why are you installing old versions. no wonder the documentation don't match
 
@milleniumbug it is 11111111.
 
@EtiennedeMartel aha. Zerglings were cool, but kinda old
 
@ShuklaSannidhya 2^(n-1) will be something like 10000000
 
they have really nice, vivid colors
 
7:28 PM
hmm... so ~0 << (sizeof(long) * 8 - 1) should work right?
 
tweaked on purpose, no doubt, but the effect is nice
 
@ShuklaSannidhya no, that'd be the same
 
@Aboutblank Maybe "damn you debian"?
That would explain the old versions thingy.
 
@ShuklaSannidhya also, CHAR_MAX
 
I don't know if I dropped this one here before:
> Yo mommas so old, Debian added her to the stable repository.
 
7:29 PM
long max = 1ull<<(sizeof(long)*CHAR_BIT-1)-1; I think
 
@Griwes Actually that would make her pretty young.
 
long max?
 
@Griwes erm, yes
 
@StackedCrooked Psst, you're ruining a perfectly good joke.
 
7:31 PM
I'm enhancing it.
 
@bamboon He did leave comments on some answers …
 
@ShuklaSannidhya it's a long variable with the name max?
 
You're assigning ul to long...
 
@ShuklaSannidhya yes I am
 
I've given up on Clang. GCC 4.8.1 just works.
 
7:33 PM
He obviousy is.
@milleniumbug Clang just works too.
 
user142019
Time to implement the = operator.
 
libcxx with libcxx-abi just works, too!
 
@Griwes Not on windows, unfortunately.
 
Nah, windows.
Like I gave a shit about windows.
 
@MooingDuck Hmm...
 
7:34 PM
@milleniumbug you can use a VM on windows
 
@ShuklaSannidhya you said you wanted the maximum value for a long right?
long cannot hold the value ULONG_MAX.
wait, wtf
 
Do you think JavaScript is a viable alternative to Lua as an embedded scripting language in a game?
 
I wanted max value for u long.
 
Not sure why the difference of 10, though.
 
7:36 PM
@ShuklaSannidhya oh
 
@BartekBanachewicz That will work.
 
@ShuklaSannidhya For unsigned long?
 
@Griwes yeah.
 
static_cast<unsigned long>(-1).
 
7:37 PM
no wait, what am I doing
unsigned long m = ~0ul;
 
Or that.
 
@ShuklaSannidhya also, if you want the maximum for an unsigned long, don't store the value in a long. You're corrupting your data.
 
@MooingDuck great. Can you please explain that OR ing part?
 
@ShuklaSannidhya unsigned long m = ~0ul;
46 mins ago, by ShuklaSannidhya
1UL << (sizeof(long) * 8 - 1); should be the maximum possible value for long right?
 
@ShuklaSannidhya The value after shifting was just the highest bit.
 
7:40 PM
unsigned long, and long are different. If you could use the right terms, people would be less confused.
 
My bad.
 
@StackedCrooked it's much harder to embed, but it can be if put enough effort into. That's the key: is JS really that important to use JS to make that effort
 
Anyway, std::numeric_limits FTW.
 
But I also wrote
28 mins ago, by ShuklaSannidhya
But why isn't this: 1UL << (sizeof(long) * 8 - 1) same as ULONG_MAX?
 
@BartekBanachewicz and much less good :P
 
7:41 PM
Just wondering.
 
@ShuklaSannidhya yes you did, but I didn't notice
 
@thecoshman ECMA 6 is imho a step in very good direction
so actually I think that JS is evolving nicely
 
@BartekBanachewicz it's going to take more than a step :P
 
however, I think that from the major 3 of script langs (JS, Py, Lua), each has its uses
and it's best to just know all 3 and use when appropriately
 
I just went to the dentist
I really hate going.
 
7:42 PM
I write in all 3 and all 3 have their perks and quirks, pros and cons
YES Lua HAS CONS
6
 
I am blushing.
1 min ago, by Bartek Banachewicz
so actually I think that JS is evolving nicely
 
@Rapptz I tend to postpone it always. But when I go it's usually not so bad.
 
Xeo
@Rapptz Me too. They cut open my palate thrice.
 
so right now I expect more a decision between hybrid script+native and managed
 
They cut my tongue everytime.
 
7:44 PM
And I am rather on the former side.
 
grumble grumble try going to the dentist in the UK grumble grumble
 
At least it's cheaper in the UK.
Hopefully anyway. I hope no one has our prices.
 
I think I'm lucky. Last time I visited the dentist I hadn't gone in six years. Turns out my teeth were in perfect shape.
 
in theory, we have free dentistry via NHS, LOL
 
@BartekBanachewicz Lisp too: (cons 1 2)
 
7:45 PM
@milleniumbug hehe
 
@MooingDuck So ORing n with n-1 sets all bits to 1?
 
Taking out Wisdom teeth costs about $1500+ for 4 teeth I think.
 
@Rapptz Wow.
 
insurance?
 
Ya
 
7:46 PM
In Belgium it's virtually free.
 
Regular clean up is covered by insurance, i.e. "free".
 
oh right, it's one of those deals
sure, we will cover you for this, but if you actually want to make use of anything you will have to pay for it
 
And wisdom teeth are not covered by insurance?
 
@StackedCrooked They take care of a bit of the costs. To be fair I think that price includes numbing.
I'm just mad because I'm paying ~$2k
 
o_0 you have to pay extra for aesthetic?
 
Xeo
7:47 PM
lol, 1.5k without numbing - "Yes, please just pull them out like that, I don't have the money for numbing."
 
@KonradRudolph oh indeed, he could have just posted his answer.
 
and they want me to take out my wisdom teeth too which is about $1.5k
But I have no issues with my wisdom teeth so >_>
 
Are you paying this or your parents?
 
No I am.
 
Damn.
 
7:48 PM
Dental insurance here is fubar.
Some dental places only take certain insurance. It's fucking insane.
 
You should come to Belgium. Even without insurance it's cheap.
That's not an option I suppose.
 
I don't like going :(
I've always hated the dentist.
 
@Rapptz Sup! First meal after waking up was mashed potatoes and sausages.
 
Sounds good.
I haven't eaten yet. Just swallowed a bunch of blood and spit.
 
@Rapptz lol
 
7:53 PM
@thecoshman Yeah anaesthesia is actually very expensive here.
 
man
I'm pissed off, but the shop is shut so I can't buy chocolate
I hate living in a fucking swamp
 
At least you won't be sick tonight.
 
I find this little consolation
 
I still can't figure out why certain foods make your stomach hurt.
 
Xeo
@DeadMG Eh, nothing here has open anymore too.
 
7:58 PM
well I didn't read anything about gallstones being so specific
besides, don't gallstones take a bunch of time to form?
 
grr, having an online discussion about the alleged benefits of static type checking and getting absolutely nowhere
my opponent is completely stonewalling
 
Xeo
@KonradRudolph Didn't you already do this?
 
@Xeo About twice a week, by my count ;)
Well no, but I already had this discussion more times than I can count
 
Xeo
If they don't want to learn... ┐( ̄ー ̄)┌
5
 
8:04 PM
@ShuklaSannidhya yes, iff n is a power of two (is the format 1000000 in binary)
 
user142019
Hurray.
 
user142019
Variables somewhat work!
 
user142019
~/gear [ cat hello.gear                                       master ] 10:05 pm
greeting = 'Hello, world!';
puts(greeting);

~/gear [ ./gear.out hello.gear                                master ] 10:05 pm
Hello, world!
 
iff = if and only if
Not a lot of people know that. Well at least people I've talked to outside of this room.
 
user142019
Also, I should really rewrite my parser using monads.
 
8:08 PM
@Xeo :O what a smiley
 
yay my program now crashes and burns correctly
6
 
user142019
I wonder how I'm going to implement if.
 
user142019
Or just jumps in general.
 
thought I had a bug that only appeared in release, but It didn't appear in debug mode because it's slower ._.
 
@bamboon … aaand he posted the answer, and what’s more, I like it: stackoverflow.com/a/17154645/1968
 
8:19 PM
...lads.
@rightfold I thought you abandoned the project
 
@MooingDuck Thanks a lot.
 
user142019
@Jeffrey Why?
 
@rightfold They told me you never finish your projects and you often just abandon them.
 
user142019
lol
 
user142019
I do.
 
8:22 PM
@Rapptz Not required. We study math.
 
@KonradRudolph yup, it got some interesting posts.
 
Hm.
I guess I'm using Lua...
@BartekBanachewicz What's the license for Lundi?
 
@ThePhD fairly sure it says
 
"Use only on mondays"
 
=[
Guess I'll have to....
ROLL MY OWN WRAPPER. <33
 
8:29 PM
@KonradRudolph Damn, that guy is bad and wrong.
his entire answer is a typical "OMG SHARED PTR SLOW" failbucket
 
Woo, moar problem solving.
It's like I'm paid for that shit.
 
no fair consideration of the many downsides of GC, no consideration of any other smart pointers, misleading statements about the benefits of GC compared to RAII
 
@DeadMG I don’t think so. His answer is definitely incomplete and paints a one-sided picture – but then, the question was essentially “why would I ever use a GC” and I think that answer works
 
Xeo
Hm... my connection is borken
I only get ~20mbit up
that's just .. wrong
but 10mbit down
 
@KonradRudolph Well, it doesn't, since he paints a completely inaccurate and incomplete picture of the downsides of RAII.
 
8:32 PM
@DeadMG He hardly mentions RAII, and rightly so, because in situations where RAII can be used (which are most) a GC would obviously not be beneficial
 
I can't believe I'm so bored I'm playing that stupid candy game
 
@KonradRudolph He spends about three quarters of his answer whining about shared_ptr.
 
@DeadMG Well shared_ptr’s utility is pretty limited, and it’s the direct contender of many GC applications
 
@KonradRudolph My response is that it is against the idioms we have come to accept and in some instances like.
 
not saying it’s never useful, nor that I would usually use a GC over shared_ptr, but it does have the downsides he mentions. I agree with you though: he doesn’t mention its upsides.
@CaptainGiraffe “idioms we have come to accept” sounds an awful lot like Stockholm syndrome to me … at any rate it’s not a technical argument
 
8:36 PM
well guess what, turns out those evil pointers that aren't worth clearing because it costs cycles and has no benefit are fucking things up ^_^
 
@KonradRudolph It's more about the fact half the negative points he brings up are either not fundamental to RAII, or plain wrong.
 
@KonradRudolph Well, the design of c++ has given us those directions.
 
> Secondly, destructors injected at the end of scope can incur unnecessary-and-expensive virtual function calls
"Gee, how could anyone write code that uses type erasure? MUST BE SO SLOW! Obviously it would be IMPOSSIBLE to write a shared_ptr analogue that doesn't have type erasure!one!11"
 
Xeo
Eh, you still have the indirection to the shared counter. Can't do shit about that.
 
8:37 PM
@EtiennedeMartel The guy that got this rolling; Stanley Jordan youtube.com/watch?v=JmdHaJRF0dU
 
true enough
and I'm not saying that isn't true
but I am saying that the above quote is disingenous.
 
Is there a reason why we are commenting on a five year old question, besides that the answer is new and not awesome?
 
Butter chicken poutine.
 
@CaptainGiraffe A bad answer is a fair enough reason to comment
 
@EtiennedeMartel Butter chicken?
 
8:43 PM
@CaptainGiraffe But that wasn’t the question here – the question was whether this might change, or why it might be desirable to change it
 
Also, I pulled put my laptop at work to check something, and a song from Love Live started playing at max volume.
Suffice to say, I've now basically suffered mortal embarassment. It can't get anymore downhill from here. :D
 
Butter chicken or murgh makhani is a classic Indian recipe that originated in the restaurant Moti Mahal Delux in Delhi, India. Preparation Many versions of the recipe exist for the recipe, typically dressed chicken (with or without bones) is marinated overnight in a yogurt and spice mixture usually including garam masala, ginger, garlic paste, lemon or lime, pepper, coriander, cumin, turmeric and chili. The chicken is traditionally cooked in a tandoor, but can also be grilled, roasted or pan fried. The sauce, is made by heating and mixing butter, tomato puree, Khoa and various spic...
 
@KonradRudolph Including GC or not? (Y/n).
 
Xeo
@EtiennedeMartel nom
 
Ell
oh I love butter chicken
 
8:48 PM
@BartekBanachewicz You're growing up.
 
Hungry and I can't eat :(
 
@EtiennedeMartel Fucking delicious and easy to do yourself
 
@KonradRudolph Indian food in general is so fucking tasty.
 
@EtiennedeMartel Agreed, I cook some sort of curry every week, and I’ve got a roommate who does curries almost every day … never getting tired of it
 
currying
 
8:53 PM
@milleniumbug Not an accident =)
 
@Rapptz Now you know how I feel! :D
 
Hm.
std::function with std::bind should be suitable to call a function that has the same signature for multiple types, with some kind of this placeholder, right?
 
yuppers
usually you just use a lambda
 
Lambdas sound good.
 

« first day (975 days earlier)      last day (3973 days later) »