« first day (778 days earlier)      last day (4172 days later) » 

7:08 PM
0
Q: Comparing Integers in Java

user1870819I got the following code from a Java book that didn't have explanation about the results. I ran it and got the results noted below inline, but I need help understanding the results: 1. Integer i = -10; 2. Integer j = -10; 3. System.out.print(i==j); // ==> true 4. System.out.print(i.equals(j...

srsly wtf java...
 
lol
 
The famous Integer cache.
 
I think you mean "Bug inducing cache"
 
No, bug inducing equality operator.
Integer cache is not the issue, it's comparing by identity as ==.
 
To be fair, if the integer cache wasnt there, at least the test would fail in a consistent and predictable manner
now it works for a range and not for the rest of the values
that makes things even less clear
 
7:16 PM
Cache being there only exposes the underlying problem.
Which is Java being designed by morons.
CPython caches integers, too, but you'll never see nonsense like 1000 != 1000 being true.
 
@CatPlusPlus Shame Mark deleted his answer. I was just posting this comment:
> Calling this an optimization strangely urges me to put my foot into my mouth
 
It is an optimisation.
The rationale is that small numbers are more commonly used than large ones.
 
Yup I know that. And it strangely makes me want to say strange things like that. Nerver-the-less.
@CatPlusPlus Who'd have known
 
Anyone on WebFaction?
Since VPSes are not less expensive than my dedicated server for some inexplicable reason, I'm thinking about migrating there.
 
^ I can tell that VS2012 designers have been taking UX courses lately
 
7:21 PM
"reduce the chance" haha.
 
You've got to love the phrase.
> Please close Visual Studio now to reduce the chance that a computer restart will be required later
5
It's sad that it is such an accurate description (b.t.w. that's starboard material ^)
 
7:38 PM
Anyone willing to review my next blog post?
 
@R.MartinhoFernandes Count me in.
 
There's compilable code that matches the post here rmartinho.github.com/code/tuple/tuple.h++.
 
@sehe Strange thing is that VS' target audience are people who can easily understand why it's that way. Why the sugar coating?
 
7:44 PM
@EtiennedeMartel Because Purrty
 
@sehe It's all the Cat's fault.
Because it's always his fault.
Always.
 
Now for food.
 
@EtiennedeMartel Ask Ell about 'purrty'. The Cat is not a little girl, IIRC
 
Oh, right, food. That might be a good idea too.
@Ell What's that "purrty" thing?
 
@EtiennedeMartel Also, I can understand. But I wouldn't say "easily". And essentially I don't understand it too well. I mean, why is it so restrictive on windows? Why does it need shutdowns whenever someone passes gas?
Ah, it must be the mechanism by which they make the OS outperform all the competition by such a wide margin. (Hint: it is a rather large margin. A negative one too)
 
7:49 PM
@sehe Probably has something to do with the DLL Hell.
 
Very little, actually
 
Oh, wait.
 
It has to do with memory mapping and keeping the backing files locked
 
Windows requires all executables currently mapped into memory have a corresponding object on the filesystem.
 
7:49 PM
That's why you can rename them, but not delete.
 
@R.MartinhoFernandes "The types will be based on their alignment.": missing a 'sorted' here?
 
@CatPlusPlus UNIX does have the same restriction. Only, UNIX doesn't require the inode to be named in a directory
@LucDanton or 'ordered' :)
 
> append at start
append/prepend?
If it's intentional then nevermind.
> I think switching the iteration order requires more code than instead building our result in reverse, so I am going to switch the construction order of the result.
I understand the code, I understand the context, but I don't understand that particular sentence.
 
@LucDanton Yeah, it is intentional
@LucDanton lol
Yeah, that one is confusing.
 
Do you mean you prefer building the result in reverse than reversing the result?
 
7:56 PM
I am trying to handwave away some decisions for reasons I don't want to waste time explaining.
 
Anyone familiar with photoshop?
 
@LucDanton No, I mean that switching 0-max/max-0 takes more code than switching append/prepend.
More points of change.
 
Is this a good layout for a professional site for a computer scientist?
http://eng.utah.edu/~frazer/
 
> Bool<alignof_indexed<Head>::value == Align>
Bool<> isn't referenced in the post.
 
Is on a previous one :P
I guess I could add a link.
 
7:58 PM
You use std::integral_constant<bool, (alignof(T) > alignof(U))> somewhere higher up.
 
Ah, that's the part that I am considering cutting out.
 
More than once.
 
scrubbinses!
 
You know I'm kinda on the fence about that 'alignments are powers of two'. Is this derivable from the Standard?
 
@LucDanton Yes.
 
8:01 PM
that motherfucker library chair still hasn't given me a document number
 
> Alignments are represented as values of the type std::size_t. Valid alignments include only those values returned by an alignof expression for the fundamental types plus an additional implementation-defined set of values, which may be empty. Every alignment value shall be a non-negative integral power of two.
3.11p4
 
Okay. There's even a meaning given to alignments, I'm not sure how I missed that.
That makes the whole algorithm quite fun.
 
@DeadMG Have a document number: N666.1
 
Fun in what sense?
 
useful and non-exponential?
 
8:05 PM
Multipass linear thingy without comparing is fun I think.
 
man
WGP are worthless
sent me an email insisting I reply in the next fifteen hours
 
@DeadMG Tautologies are tautological.
 
but, well, that was like, nearly 72 hours ago
fuck em with a red hot poker
 
You could declare sort in one go I think. Opting for clarity here?
 
8:08 PM
@LucDanton The implementation on wheels uses insertion sort, which is better than the functional quicksort in a non-optimized environment like TMP. But the other day we discussed it here and I realized I could really get that sub-linearithmic.
@LucDanton Yes.
 
linearithmic?
 
N log N.
I did not make this up.
 
you know, it's way easier just to say O(nlogn) than linearithmic
 
Not as fun, though.
I have also seen "quasilinear", but "sub-quasilinear" looks very weird.
 
I've used 'quasilinear' but apparently that has a variety of meanings.
> Turns out we did not need our predicate after all, because our sorting algorithm is not based on comparisons between elements.
Yeah that's quite the WTF moment. I can see why you'd want to change that.
 
8:11 PM
Yeah.
Also, argh, syntax highlighting on this is messed up. There are three different nested languages in this file.
Can't blame vim for freaking out.
 
kay, I think I'm done reading your post. Didn't look at the separate code though.
If it's the same as in the post and is compilable, well.
 
@LucDanton It's the same one, but with all the exercise-for-the-reader bits.
 
I'm kinda on the fence with the macro and implementation bit.
 
As an exercise, it's only necessary to assume one particular order.
Because the tone is really didactic, in a very good way. So it feels like an exercise.
 
8:17 PM
I guess could just mention how it can be adapted for a different order and not show the uglies.
 
8:33 PM
HIDE ALL THE UGLIES!!!
 
How on earth...
 
Ok, diff here github.com/rmartinho/rmartinho.github.com/commit/…. Sorry about the noisy stuff with the code snippet unindents; I don't want extra indentation to show on the post.
Also, copy paste fail.
 
I'm becoming quite a happy user of the GitHub For Windows convenience. Somehow this isn't the worst experience to get things like PoCo or a Vim plugin on windows. I still don't feel at home though
 
8:45 PM
@R.MartinhoFernandes I like it a lot.
 
Ok. Will publish now. Which basically means renaming the file :S I need to set up a nicer way to do this.
 
Lol. Continuation passing linking style
@R.MartinhoFernandes Why? You want a Enterprisey button with three signoffs instead? And a VB GUI?
 
@sehe Because I need to write the date myself manually in the file name.
 
@R.MartinhoFernandes Oh that sucks. Understanding happened at once
@R.MartinhoFernandes --ignore-all-space to the rescue:
C:\Users\User\Documents\rmartinho.github.com [master]> git log -
1 -p --ignore-all-space | wc -l
    164
C:\Users\User\Documents\rmartinho.github.com [master]> git log -
1 -p  | wc -l
    298
 
@sehe Can't show that on GitHub.
 
8:48 PM
@R.MartinhoFernandes No. GH sucks. A little
I think I remember Trac having this option in the Web UI all the way since TracSVN
 
Would anyone mind if I pinned an announcement about the CS Games?
 
@EtiennedeMartel What is it?
 
dude
 
Perhaps just pin it, we've been warned
 
the fuck you think this place is, a democracy?
 
8:50 PM
I also need to set up Jekyll so I can build the pages locally when experimenting with stuffs.
@DeadMG lol
 
@DeadMG Not on my lawn
 
just pin it and if people don't like it, they'll unpin it if they can and not if they don't matter
 
demcoracy is the tirany of the ignorants
because they are mayority
 
Completely agree. Demcoracy is the bane of our existence
Like liquoracy.
 
I blame Home Demcorators.
 
8:52 PM
Zing
 
I neglected to show my program since I'm just after the principle. I do send parameters when creating the different classes, can you do that with structs? Don't know much about them yet, except they're confusingly alot like classes, but uglier. — XistenZ 18 mins ago
 
@sehe That reminds me. Liquorish is terrible and possibly the worst so-called "food" ever invented.
 
democracy is lacking like any demo
 
^ I would downvote the question except that now it would look a bit weird to do that.
demo-cracy
hm
 
@XistenZ But uglier? I'm all ears (Hint: "C++" != "C#", not even string.Equals("C++", "C#", StringComparison.UniversalPolyglotIgnoreKnowledge)) — sehe 1 min ago
 
8:54 PM
@R.MartinhoFernandes I made myself Fabric script that creates a new file and opens up gvim.
 
@R.MartinhoFernandes That's okay. Just hand it to me
 
I don't exactly use it, but there you go
 
To any CS or SE student in Canada or the US, the registrations for the 2013 edition of the CS Games, at the Laval University in Quebec City, Canada, are now open! Get the info and register your team! Trust me, it's the funniest programing related sausage fest this side of the Atlantic.
3
 
@Cheersandhth.-Alf Wait. Cheers&HTH cares about public opinion/appearance?
 
8:55 PM
@CatPlusPlus I am not sure what that means, but as is I cannot change what the server runs. I have considered changing to building locally and publishing the build output, but lazy.
 
This runs locally
 
> @send good point. I did not read your question closely enough. – Yakk 2 mins ago
^ (10k) bwahahaha - he apparently read it so flimsily he didn't even notice it wasn't my question!?
 
You could create with xxxx-xx-xx and have another command to change it to current date, too
 
well for a teaching about good/bad it's perception that matters, i think
 
@sehe I hear he even applies a little eau de toilette.
 
8:57 PM
@sehe WTF, how can you like that thing?
 
@R.MartinhoFernandes He's a bear.
 
@StackedCrooked actually that's a sore point with me right now. due to open wounds it's difficult to maintain personal hygiene.
 
@R.MartinhoFernandes It's easy. Think of it as liking coffee. Or beer. IOW: pure discipline
 
it's a bit of a paradox
 
It's the worst thing I ever tasted. If they had not warned me that I "might not like it", I might have reacted violently against them.
And even then, "might not like it" is a bit of an understatement.
 
8:58 PM
@Cheersandhth.-Alf Open wounds? That sounds scary.
 
That thing is so foul it would be worth fighting wars to eradicate it.
 
@CatPlusPlus Derp. Assuming a commandline finishes the debate. It could be :!mv % $(date -T "posts/%y-%m-%d-%:n.md") or something arcane like :exec "saveas " . expand('..%..')
 
Not in vim
Also git mv
 
@CatPlusPlus ? Note that the first is actually a shell command...?
 
Yeah, okay
 
9:02 PM
@CatPlusPlus Also, in what else? Of course he is in vim. The point is: if there is commands, there is automation
 
Liquorish is so foul we should eradicate it completely #robotrebellion
 
:!fab publish %
 
@CatPlusPlus fab? Is that git in rot13?
 
@CatPlusPlus Oh. Looks okay then. Send link to robot
 
9:03 PM
@CatPlusPlus :set makeprg=fab\ publish\ %
 
Yeah, whatever. I don't run commands from within vim, I don't know.
 
The point is Fabric is cool.
 
> These spiritual rapists, as Adams describes them in her book, Consequences, often prey on people by performing sexual acts through nightmares and erotic dreams. Some people become so dependent upon these demonic experiences that they actually look forward to them.
Twisted souls
@CatPlusPlus Why not. It is okay to look outside the window :)
 
Shines most when combined with SSH, but not having to do argument-parsing boilerplate helps even if you do just local tasks.
@sehe Ahahaha oh god
 
9:06 PM
Hey guys. Question unrelated. How do you set photoshop to metric?
 
Tons? Oh, n.m. The question is unrelated. Proceed
 
No like when I make a marquee it gives me the measurement in inches. I want it in centimeters.
 
@Crowz Preferences > Units and whatever.
 
@sehe ... Wat. o_O;
 
@EtiennedeMartel > The Holy Spirit has to reprogram you. If you're not programmed for obedience, it's hard to do so,
 
9:09 PM
some mpi experts here?
 
Some comments there are precious
 
"Fail and fail" :)
 
@bamboon i agree
 
> WAKE UP. This is REAL.
:catdrugs: all around
 
erm, sorry if I can't follow you guys right now
 
9:11 PM
I'm slightly lost myself.
 
@ThePhD The point of the article is, "LOL christian morons"
 
> although I am not pleased that some product of nature are homosexuals but I do respect them if they act responsible
 
@CatPlusPlus Hey I respect you too, if you act responsible
But that's a big if
 
Yeah we have pictchers.
 
If this was anywhere else, I'd say most of those comments are trolls.
But here, no idea.
 
9:15 PM
Additional responsibility depots are required.
 
Damn, r/cpp be slow. R. Martinho’s posts are still frontpaging …
 
@CatPlusPlus Still true. The whole article is troll. Look at comment charismamag.com/spirit/spiritual-warfare/…
@KonradRudolph That must mean all cpp activity has moved to isocpp.org
 
I've seen that. Still not convinced.
 
@KonradRudolph lol
 
OP might very well be one of those crazy people.
 
9:18 PM
@sehe I used to be in an evangelical church and people there believed this to be true.
 
@StackedCrooked I was raised in evangelische kringen. Tell me something. However, I've never heard someone claim demonic rape (as in actual rape, 'violation', yeah)
 
@KonradRudolph They're at the bottom.
 
@sehe something
 
fucknuggets
I want to strangle someone
@sehe 1 + 1 = 2
 
@LucDanton Thanks. I needed that
@DeadMG :)
 
9:19 PM
"actual rape"? That's a new one, right? I don't remember that one.
 
@R.MartinhoFernandes It's on the list
 
enjoyable rape is my favourite kind
 
Oct 26 at 14:32, by sehe
yesterday, by R. Martinho Fernandes
user image
 
me and my mates often head down to the park for some enjoyable rape
 
Oh damn. They stole it. It is no longer on the list. Now. "Honest rape" - I think I'm going to try that next time
 
9:21 PM
@DeadMG Reminds me of my childhood.
It's nice to be young.
 
@sehe It's where you tell the victim "I'm raping you and here's my personal details so you can prosecute me" whilst you rape them
 
Speaking of crazy politicians, one of ours had a brilliant idea to ban contraception for a year.
I don't even
 
@CatPlusPlus Babies. Babies everywhere.
 
@DeadMG No? That's naive. It's just "I'm not going to ly to you: I don't care whether you consent. I really don't."
 
@ThePhD Black market. Black market everywhere.
 
9:23 PM
@CatPlusPlus Time to make them a European MP hey?
 
Roflmao.
 
@CatPlusPlus Semen. Semen stains everywhere
 
"Hey man, Condoms pretty cheap, only 20 bucks a pop."
 
@CatPlusPlus For a year? WTF.
 
Whimps
 
9:23 PM
@CatPlusPlus Lol, that's political suicide.
 
@R.MartinhoFernandes To increase fertility rate, because it's totally selfish that women don't want to have babies.
 
@R.MartinhoFernandes Yeah, it'd only need to be nine months.
 
You can't shout MORON loud enough.
Thankfully it wasn't any official plan, just personal moronic comment on Twitter or something.
I mean, seriously. Where do these people come from.
 
A previous major prime minister candidate in Portugal once ruined any chances she ever had at winning the elections by saying we should "suspend democracy for six months".
 
9:26 PM
 
Like a baus.
 
Some people are so incredibly dumb, it hurts my brain to think about it.
 
@CatPlusPlus DeadMG for President of the World!
so the whole room's now a baus, huh?
 
I actually just started working again on my Dispatch system.
 
@StackedCrooked Would you think it fair for me to expect a little snippet like this to compile on Coliru? stacked-crooked.com/view?id=2d4d0fbba375dc9c73662dee9d1ac46d
@ThePhD "Brace yourselves"
 
9:38 PM
I wish I knew where that quite was from. :c
 
> This game is revolutionary! I wish someone had thought of it before. Now I can play one of my favorite cell phone games with people in real life. It would be a shame if someone were to sue them. I love words with friends so much.
 
@ThePhD Oh fuckdiddlies.
 
It also hurts my brain to think about uni assignments.
 
@sehe Interesting. Maybe it got skilled by one of the sandboxing mechanisms.
 
@DeadMG on the "man" question, I should have created a MenManager :D
 
@emartel lol
 
and make it a singleton obviously :)
 
@StackedCrooked Well obviously. It takes over ... what, maybe 1.5 seconds?
 
@DeadMG It's a bad thing? :c
 
Timout is set to 10 seconds.
 
9:40 PM
The smiley is
@StackedCrooked Well I didn't think it took that long...?
 
@ThePhD More like, "Expecting deluge of questions" :P
 
@DeadMG Hey hey hey, I've figured it out mostly. Just about to give it a kick to see if it all works out.
 
@sehe Simply including the header already crashes it.
 
@ThePhD Well, gz then, I am pleasantly surprised.
 
The only errors left are because VC++ still eats shit when dealing with Variadics and functions.
 
9:42 PM
use the CTP?
 
It's a cake I can't have and eat.
No, I am using the CTP. The compiler internally errors when I use a function declaration with a variadic template.
 
oh
 
@DeadMG Buggyadics.
 
@StackedCrooked ... :(
 
I've also noticed it errors if I use a Move Constructor inside of a Delegated Constructor.
 
9:44 PM
@DeadMG Doesn't really alter the 'eating shit' part. Allthough, pre-CTP the variadics exhibited far fewer flaws
 
@sehe The general timeout is 10 seconds, but CPU time is more limited.
root@stacked-crooked:~/coliru/TestSuite/Spirit# cat main.cpp
#include <boost/spirit/include/qi.hpp>
namespace qi = boost::spirit::qi;
int main() {
    qi::rule<char*,int()> parser = qi::int_;
}
root@stacked-crooked:~/coliru/TestSuite/Spirit# time g++ main.cpp
^C
real	1m10.452s
user	0m0.004s
sys	0m0.004s
 
@StackedCrooked oh aha. A bit tooo limited for my programs...
 
@sehe It didn't have variadics pre-CTP
 
@R.MartinhoFernandes Yeah. The webserver isn't root though :)
 
9:45 PM
@DeadMG That's only one flaw. Hence "far fewer".
 
@StackedCrooked You send it... SIGINT?! Why not SIGKILL or even just SIGXCPU, you know... it was made for it?
 
lol
 
@DeadMG cough that's interesting news :) lolol
 
@sehe I Ctrl-C'd it because it took over one minute.
 
@StackedCrooked Oh wait. How does that happen? I can't really see you using MSVC (with a g++ frontend ?!) so, there must be another reason why this is so inexplicably slow?
 
9:47 PM
fuckshitballs
 
@sehe Maybe a GCC bug. Or another process claiming CPU. Let me check that.
 
Ugh. I'm gonna have to create Dispatch0, Dispatch1, Dispatch2, .... DispatchN For all this nonsense @___@
 
CPU is idle, so that's not the problem.
 
@StackedCrooked One of the other 20 people using Coliru? Or do you have queueing?
@ThePhD BOOST_PP
 
@sehe I have no Boooost ;~;
 
9:48 PM
@sehe It's queued. Only one request at a time is processed.
 
2
Q: Faux variadics in Visual Studio 2012

Mathias Vorreiter PedersenI'm trying to create a constructor that takes a variable number of arguments and I would very much like to keep things type-safe. I googled around and kept finding the term "Faux variadics" (Example: http://msdn.microsoft.com/en-us/library/hh567368.aspx) However I'm not able to find any examples ...

@ThePhD but you do have a preprocessor right?
 
VS2012 supports variadic templates now I thought
 
6 mins ago, by R. Martinho Fernandes
@DeadMG Buggyadics.
 
@Rapptz A watereddown, kinda dumb version of them that blows up the compiler when dealing with function templates and some indices-based stuff.
 
Gotcha.
 
9:50 PM
@ThePhD Some? All indices-based stuff as far as I could establish
 
@sehe I have limited test cases (e.g., what I use), so I don't want to just shoot blanket statements out and then get PLINKED to death with corrections.
 
Ow. No indices is a big failure.
Indices are pretty useful.
 
@sehe And uh, yeah. I got a preprocessor. Whys?
 
@ThePhD Because that's what you need
 
@sehe Weird it seems to work on my local VM. However it fails with: main.cpp:4: error: ‘int_’ is not a member of ‘qi’.
 
9:52 PM
@ThePhD I wasn't solliciting
@StackedCrooked Old version of Spirit?
 
It might require too much RAM to compile.
@sehe Could be, I just quickly installed boost-1.40 on my local VM using apt-get.
 
@sehe Erm. Okay. (I don't quite udnerstand though)
 
@StackedCrooked That's... weird. You run Dapper Drake on you VM?
@ThePhD See the post with the 'foreign' word in the title (Faux variadics)
 
hmmmm
perhaps I should simply alter my simulation to ban a projectile hitting multiple objects
 
Hm. So I just have to include the boost preprocessor files (or roll my own, which I'm not going to do because that much I know is a waste). I guess I don't have to install all of Boost for that...
 
9:57 PM
is this true? xDDD
 
@sehe My local VM is an old Ubuntu 10.04.4 because systrace didn't work on newer release (which have linux 3 headers). I'm no longer need systrace now so I should probably upgrade. However, the public VPS that runs coliru is a recent Ubuntu with 3.2 kernel. (Ubuntu 12.04.1 LTS)
 
He's having a hard time with kunyomi and onyomi
I guess. o.O
 
@StackedCrooked "probably". You bet. If you want anything resembling security
 
After you get used to the radicals they follow a pattern so it's easy
 
@sehe My local VM is not a public server.
 
9:59 PM
@StackedCrooked good. I hope that means the rest is a little bit more uptodate
 

« first day (778 days earlier)      last day (4172 days later) »