« first day (2 days earlier)      last day (891 days later) » 
00:00 - 18:0018:00 - 00:00

user142019
12:00 AM
From Yon Yonson.
 
@sehe I give up.
 
@JohanLarsson "I'm a lumberjack and " ...
 
google session
... I'm ok?
 
Yay!
 
user142019
Is it allowed to have a credit card under a different name?
 
12:03 AM
Prepaid, maybe
 
user142019
Say I want a credit card with "Insane Zoidberg" instead of my real name.
 
Never liked Monty Pyton really
 
user142019
@JohanLarsson The first episode is funny. With the Italian class. :)
 
user142019
Man.
 
user142019
If only dried apricots weren't so fucking sweet.
 
12:05 AM
I'm gonna have to watch them again some time
 
user142019
Is it possible in C++ to tell the system to never do a context switch on its own (within the same process)? I want to explicitly control this.
 
user142019
As in, std::thread.
 
@JohanLarsson Why do you ask?
 
@FredOverflow Something went wrong before ^
 
To learn
 
12:08 AM
Learn Monty Python V3
 
@sehe how do you do that?
 
@Zoidberg What is a "context switch"? Oh, you want cooperative multi-threading instead of preemptive? Are you insane?
 
@CCInc Za Gimp
 
I no good at za gimpz
 
user142019
@FredOverflow the CPU state is saved and execution time is given to another thread.
 
12:09 AM
@Zoidberg (a) processor/core affinity (AKA thread affinity) (b) realtime kernel (c) root permissions :)
 
user142019
@sehe :(
 
@ScottW I simply forgot this is not the lounge
 
user142019
@FredOverflow I am insane, yes.
 
user142019
So it's not possible to do something like this?
 
user142019
std::thread a{foo};
std::thread b{bar};
a.halt();
b.halt();

a.unhalt();
a.halt();
b.unhalt();
a.halt();
 
12:12 AM
@ScottW Also, the lounge had a bad case of the trolls. Doing gratuitous codez for random leeches, rudeness, entitlement, Perl and even script-kiddie-level web scraping. All in one dialog.
 
user142019
Something like that.
 
user142019
Where the CPU doesn't try to do context switches when a thread is halted.
 
See
@Zoidberg I think asio has something like strands. All you have to do is make sure your process "owns" a core (well, besides kernel...)
 
user142019
Assume single core and all within one process.
 
user142019
I mean context switches between threads within the same process.
 
user142019
12:14 AM
@ScottW Depends on flags.
 
user142019
So, I want to control when threads run or not.
 
user142019
@sehe youtube.com/watch?v=mCqyNAxmxYo - 1:20, you're famous!
 
user142019
Because VC is bad?
 
@Zoidberg Keep working on it. The puns will improve
 
user142019
@ScottW lol cool thanks
 
user142019
12:17 AM
@sehe lol
 
user142019
I'm thinking of starting a hand-written blog.
 
user142019
With hyperlinks and videos in it and whatnot.
 
0
Q: Lazy initialization for free

FredOverflowIn an article on the double-checked locking idiom, I found this quote: One special case of lazy initialization that does work as expected without synchronization is the static singleton. When the initialized object is a static field of a class with no other methods or fields, the JVM effectiv...

@Zoidberg You may be interested in this before you pwn your teacher ;)
 
user142019
Oh thanks.
 
user142019
Though I'll have a new teacher from now on (thank God, I disliked the previous guy).
 
user142019
12:28 AM
Y u no . :P
 
user142019
Also oh gawd I upvoted a Java question.
 
@Zoidberg Oh right, updated. Let's see if Feed picks up on it :)
 
user142019
:P
 
@Zoidberg You did it for the greater good of pwning your ex-teacher.
 
user142019
He was the kind of guy that always tries to prove you wrong.
 
user142019
12:33 AM
I'd like to discuss getters and setters with him.
 
in Lounge<C++>, 31 mins ago, by FredOverflow
Page 24: "Getters and Setters are evil". I already like this book!
 
user142019
Except he probably doesn't like it when I call him an "idiot" or a "moron", which I usually do in the Lounge when people advocate things I dislike.
 
user142019
@FredOverflow omg weasoem.
 
user142019
Node.js has a fucking bug.
 
user142019
Text buffers don't read beyond fucking null characters. T_T
 
user142019
12:37 AM
T___________________________________________________________________________T
 
user142019
DEVELOPERS OF NODE.JS Y U NO UNDERSTAND C STRINGS.
 
user142019
Why is all software so terrible. I blame C since all the things are based on it.
 
user142019
C is bad and must be fixed.
 
user142019
And not fixed by basing something on it like C++.
 
@Zoidberg I thought you loved C? :)
 
12:44 AM
3
Q: Lazy initialization for free

FredOverflowIn an article on the double-checked locking idiom, I found this quote: One special case of lazy initialization that does work as expected without synchronization is the static singleton. When the initialized object is a static field of a class with no other methods or fields, the JVM effectiv...

 
@Zoidberg Aha! That was (relatively) quick.
 
@FredOverflow Lemme find you an article explaining the meaning of "past tense"
And then, the meaning of bipolar
(And maybe young. And a little bit of attention deficit)
 
@sehe He practically has his own room, what more could he possibly want? ;)
 
ketchup flavoured crisps
(inb4 bacon)
 
1:06 AM
@Zoidberg incoming (you didn't ragequite because of nodejs, did you)
 
@Zoidberg As Bjarne has pointed out repeatedly, there are lots of languages that aren't based on C, and are much nicer in many ways than C++. Nobody uses most of them though.
 
 
1 hour later…
2:26 AM
hi guys
 
 
2 hours later…
4:32 AM
0
Q: Removing observer of NSNotificationCenter in Singleton Objective C

banditKingQuick question: I have a singleton class which is a registered for several NSNotifications. Since Singletons last over the app's lifetime. Do I have to implement [NSNotificationCenter defaultCenter] removeObserver:self] In my singleton class? Whats the right way to deal with NSNotifica...

 
 
5 hours later…
user142019
9:47 AM
@FredOverflow I think it just checks at regular intervals.
 
10:19 AM
why is this:
class A{
	private int i,j;
	public void setij(int i,int j)
	{
		this.i=i;
		this.j=j;
	}
	public int geti(int i){
		return i;
	}
	public int getj(int j){
	    return j;
	}
}
class B extends A{
	int total;
	void sum(){
		total=geti(i)+getj(j);

	}
	}

public class Ex {

    /**
     * Creates a new instance of <code>Ex</code>.
     */
    public Ex() {
    }


    public static void main(String[] args) {
        B b=new B();
        b.setij(10,12);
        b.sum();
       System.out.println("Sum is: "+b.total);
 
user142019
Because Java is terrible, perhaps?
 
11:58 AM
@blackbee Because in the line with total=geti(i)+getj(j);, there are no i and j in scope. Why do your getters have parameters, anyway? That way, you're just returning the parameters, which doesn't make any sense. Change public int geti(int i) to public int geti() (same for j) and it should work.
@blackbee Also, "Why is this not working?" is not a very good question. At least post the compiler error message.
 
12:26 PM
@sehe Nice! He never told me what he thought about it, though :(
 
user142019
This is the best room.
 
We need more beginners posting their nonsense code here.
 
user142019
We should post a link to this room somewhere so it gets more attention.
 
user142019
Hacker News. xD
 
user142019
12:41 PM
Bad idea.
 
I'm fine with the room as it is.
 
user142019
Me too.
 
Did you ask the C singleton question yet? :)
 
user142019
No.
 
Chicken!
 
user142019
12:42 PM
I could ask a Clojure one. xD
 
user142019
Or assembly.
 
Ask if there is a Zeroton that not even Chuck Norris could instantiate.
 
user142019
abstract?
 
user142019
In iOS there is a twoton.
 
user142019
MPMusicPlayerController can only ever have two instances.
 
user142019
12:46 PM
I wish the iOS SDK had a Haskell interface rather than an Objective-C one.
 
user142019
Apple y u no Haskell.
 
Is it possible to write a templatized Nton that has exactly n instances? :)
 
user142019
If I were to release a smartphone OS, the APIs would all be in Haskell.
 
user142019
@FredOverflow yes.
 
How about an Anyton that can have an arbitrary number of instances? ;)
 
user142019
12:47 PM
@FredOverflow that's called a normal class.
 
user142019
template<class T, std::size_t N>
class nton {
public:
    nton() = delete;

    T& get_instance(std::size_t i) {
        return instances[i];
    }

private:
    static T instances[N];
};
 
user142019
Use with CRTP.
 
user142019
Also needs laziness and private dtor and whatnot. All that crap.
 
Right, I was just thinking that an nton is basically an array.
@Zoidberg Would the entire array be lazy as a whole, or each instance?
 
user142019
12:49 PM
For each instance.
 
But then a normal array won't do...
 
user142019
Instantiate instance i only when needed.
 
user142019
You need an array of pointers.
 
An array of boost::optional would probably be more efficient.
 
user142019
template<class T, std::size_t N>
class nton {
public:
    nton() = delete;

    T& get_instance(std::size_t i) {
        return instances[i] == nullptr ? *(instances[i] = new T) : *instances[i];
    }

private:
    static T* instances[N];
};
 
12:51 PM
@Zoidberg Can't you "factor out" the dereferencing so you only write it once? ;)
 
user142019
I can.
 
return *(instances[i] ? instances[i] : (instances[i] = new T));
 
user142019
You know
 
user142019
have there ever been popular computers that didn't follow the conventional Von Neumann architecture?
 
There were those SK-combinator machines that did LISP natively.
 
user142019
12:53 PM
Cool.
 
Lisp machines were general-purpose computers designed (usually through hardware support) to efficiently run Lisp as their main software language. In a sense, they were the first commercial single-user workstations. Despite being modest in number (perhaps 7,000 units total as of 1988), Lisp machines commercially pioneered many now-commonplace technologies – including effective garbage collection, laser printing, windowing systems, computer mice, high-resolution bit-mapped graphics, computer graphic rendering, and networking innovations like CHAOSNet. Several companies were building and s...
 
user142019
You know, Haskell would still have been useful without I/O. As long as it had the FFI.
 
user142019
(And then you can implement I/O. :))
 
How do you do FFI without Monads?
 
user142019
FFI doesn't need monads.
 
user142019
12:54 PM
And monads don't need I/O.
 
user142019
What are you aiming at?
 
user142019
foreign import ccall "sin" c_sin :: CDouble -> CDouble
 
How do I use a C function correctly without Monads and in the presence of lazyness?
 
user142019
No monads!
 
Yeah, but sin is pure. (The church would probably disagree.)
 
user142019
12:55 PM
@FredOverflow the function is called lazily.
 
user142019
Oh, seq.
 
user142019
seq enforces its argument to be fully evaluated.
 
Okay, let's say you have a Haskell function f that calls an impure C function via seq. Now every caller of f needs to remember to also apply seq, right?
 
user142019
Yes.
 
user142019
But the point is, you can implement IO using C and the FFI.
 
user142019
12:59 PM
>>= for IO can then be implemented with seq.
 
user142019
And laziness problem solved.
 
I don't have enough Haskell foo :(
 
-2
Q: Error in singleton class in java

user1658644public class SingletonDemo { public static void main(String[] args) throws Exception { Singleton service = Singleton.getInstance(); service.doSomething(); } } when I create singleton object then obtain error Singleton can not be resolved to a type.

 
user142019
I wish Haskell did this in base package:
 
user142019
class Functor a => Monad a where
 
user142019
1:00 PM
(And Applicative and whatnot.)
 
Where is your Singleton class? — Rohit Jain 2 hours ago
^ awesome
 
user142019
seq can never ever be implemented in Haskell without language extensions.
 
user142019
In GHC's implementation it's just there because magic. It isn't defined in any Haskell code.
 
@Zoidberg I think I had a question about this on stack overflow like "What are Hakell's greatest mistakes" or something, but it appears it was deleted, since I cannot find it under my Haskell questions.
 
user142019
1:04 PM
Also Arrow; all monads are arrows.
 
user142019
Also, fail is an epic fail.
 
user142019
Pattern match failure should be exception IMO, not a function call.
 
72
Q: What are Haskell's strictness points?

Dan BurtonWe all know (or should know) that Haskell is lazy by default. Nothing is evaluated until it must be evaluated. So when must something be evaluated? There are points where Haskell must be strict. I call these "strictness points", although this particular term isn't as widespread as I had thought. ...

I need to read this in order to understand seq and stuff.
@Zoidberg Isn't it already too late to change that? Not that Haskell has a thousand users? :)
 
user142019
seq evaluates its first argument to head-normal form. IOW, until it's a term that cannot be evaluated any further (evaluation would make no difference at all).
 
user142019
@FredOverflow Make it a compiler warning for a few releases and deprecate the current situation, then enforce.
 
1:06 PM
You could design a manlier version of Haskell and call it Mascul.
 
user142019
:P
 
user142019
Or you know, just release a package base-fixed that fixes the base package..
 
If your question is about C, why did you tag it with Java??? — Stephen C 50 mins ago
 
user142019
lol
 
user142019
BS.concat [BS.singleton 0xFF, reasonLength, reasonString] I USE SINGLETONS! :D
 
user142019
1:13 PM
The singleton is bullshit, though.
 
@Zoidberg What?
 
user142019
@FredOverflow BS.singleton
 
What is BS? Bjarne Stroustrup? Bullshit?
 
user142019
import qualified Data.ByteString as BS
 
1:33 PM
Does anyone here ever use JSLint?
wtf
I thought this is the Javascript room
BTW hey! you suck!
C# wankerz!
 
1:51 PM
@TemporaryNickName What made you think that?
 
2:03 PM
oh no
I wanna delete my embarassing messages
But not anymore =(
 
0
Q: Industrial-strength n-ton base class template

FredOverflowI am working on an n-ton base class template. I don't worry about laziness yet, so the Intent is: Ensure a class has only n instances, and provide a global point of access to them. Here is my code so far: template<typename Derived, size_t n = 1> class n_ton_base // Si...

@Zoidberg Now it's your turn with the Zeroton question ;)
 
user142019
lol
 
0
Q: Industrial-strength n-ton base class template

FredOverflowI am working on an n-ton base class template. I don't worry about laziness yet, so the Intent is: Ensure a class has only n instances, and provide a global point of access to them. Here is my code so far: template<typename Derived, size_t n = 1> class n_ton_base // Si...

 
user142019
Haha Feeds.
 
I already have my first upvote.
Wait, that was you, wasn't it? :)
 
user142019
2:07 PM
That’s absolutely correct.
 
user142019
@FredOverflow see? Feeds acted within five minutes.
 
Why did it act so quickly this time?
 
user142019
I think it’s just a cronjob that runs every ten-or-so minutes.
 
user142019
RSS is pull, not push.
 
How do you like my n+(n==0) Zeroton allowance hack? :)
 
user142019
2:10 PM
lolno
 
user142019
Implicit cast. :(
 
Damnit, only 5 minutes in, and they already found the solution? :(
 
user142019
How do you define it? It’s a template.
 
I have been working my ass off for this question :(
 
user142019
Haha. :P
 
user142019
2:38 PM
1 message moved to recycle bin
 
Ha ha, he violated the rules :)
 
omg
u removed my Java rocks message
=D
I want it back
 
19 hours ago, by Zoidberg
Read the rules if you don't want to get banned.
 
I don't understand the part "You shall not use OOP when it's not the best tool for the job."
Is there any situation that OOP is not the best tool for the job?
 
Are you fucking kidding us?
 
user142019
2:44 PM
@TemporaryNickName :P
 
@TemporaryNickName Okay okay, you can have them back:
 
James Gosling the chick magnet? Wow.
 
Apparently girls of any ages tend to love him
This effectively means there are more women programmers in Java world than C# world
 
2:54 PM
Women programmers in C#?
That's a lie
 
I guess that was his point: 2 > 0
Are you the @Washu with the famous C++ UB quiz?
@Zoidberg I'm going shopping for groceries now. Don't forget that Zeroton question ;)
 
user142019
Okay.
 
3:11 PM
@FredOverflow nope... I'm Washu a peruvian noob :)
 
The fact that this room exists makes me happy.
 
@Zoidberg Meh, I'm too lazy to go outside.
 
user142019
@FredOverflow Amazon.com.
 
user142019
I'm refactoring and documenting Lambda Ore.
 
user142019
3:37 PM
github.com/daknok/lambda-ore. Comprehensive feature list. :)
 
4:02 PM
This could be an interesting read.
 
user142019
It's about Java so it's not interesting.
 
"Industrial-strength" sounds a bit BS (although I do understand what you mean, this phrase is mostly found in commercials). — fish 17 mins ago
He blew my cover!
 
user142019
IO y u no early returns.
 
0
Q: Cluster-wide singleton in Websphere Cluster

karadenizI need to run a component using Apache Camel (or Spring Integration) under WAS ND cluster. They both run some threads on startup, and stop them on shutdown normally. No problem to supply WAS managed threadpool. But that threads must run on single cluster's node at the same time. Moreover it must ...

 
user142019
4:57 PM
1 message moved to recycle bin
 
5:15 PM
BOOO Java @Washu
 
@FredOverflow hey, i was just trying to access the private variables in class A from class B using getters and setters.. but compiler keeps telling in geti(i) i is a private variable in class A
 
user142019
haha
 
user142019
Don't use getters and setters and problem solved.
 
user142019
Also use Haskell, not Java.
 
using super.i also gives me same error
 
user142019
5:25 PM
Your getter is wrong.
 
user142019
Why does it take an argument.
 
aw...... does it... hangon..... i should check...
 
user142019
class JavaIsTerrible {
    private int i;
    public int getI() { return i; }
}
 
user142019
It ain't rocket science.
 
thats a terrible mistake i made....
wait i have another problem....
 
user142019
5:30 PM
Indeed, you're using Java.
 
no wait, this was a very bad mistake.... i'm learning it
 
user142019
Java is a very bad mistake.
 
Liez
 
user142019
No. Java is bad and you should feel bad.
 
I won't Java is good, C# is bad
 
user142019
5:34 PM
Java is bad and C# is less bad.
 
user142019
Use Haskell or Erlang, which are examples of good languages.
 
pastebin.com/dS1sXmV0 the code here is working fine... but if a comment out the super(w,h,d) and uncomment from lines : 51 to 56 and from 8 to 26 then the volume becomes 0.0 why??
 
Haskell....
@Zoidberg better try lolcode.com
 
user142019
LOLCODE is also terrible.
 
D:
 
5:38 PM
@Zoidberg
 
user142019
@blackbee
 
@Zoidberg i meant the code... please look at it
 
user142019
No.
 
user142019
It's Java.
 
user142019
I hate Java.
 
5:39 PM
please........ its very basic
 
@Washu No way.
 
@blackbee if you really need help go to Java Room
 
user142019
@CCInc he's a troll.
 
this room is for people who hate Java !!
 
user142019
Yes, that's correct.
 
5:40 PM
in C#, Jan 27 at 0:37, by Roel van Uden
Drop all useful features from C# and you have Java.
 
user142019
> Java Sucks
 
i hate Java too...... bt at this point i have to
 
@blackbee wats the super function do?
 
Ok lemme check Haskell i havent used it so i cant tell...
@Zoidberg i will try Haskell. But C# sucks at least agree on that with me
 
Uhh, no.
 
5:43 PM
a subclass can call a constructor or acess a datamember of it superclass via super()
 
I guarantee he won't agree to taht.
Beceause C# is like AWESOME
 
user142019
@Washu but it sucks much less than Java.
 
C# IS BAD
 
user142019
 
user142019
Here. Definitive guide to choosing a language.
 
5:44 PM
@Washu i saw you somewhere!!
 
@Zoidberg I love that chart, still have it open in a tab, what is it three weeks since you posted it first-
 
@blackbee impossibru i'm peruvian
 
user142019
@JohanLarsson lol
 
@Washu ow.... first time i am talking to man from peru.. awsome i feel
 
user142019
What does negative awesomeness mean? :)
 
5:45 PM
in Lounge<C++>, Jan 25 at 17:10, by Zoidberg
C# is nice.
in Lounge<C++>, Jan 20 at 11:53, by Zoidberg
C# > C++.
in Lounge<C++>, Jan 20 at 11:53, by Zoidberg
C# is awesome.
yay c#
 
user142019
@CCInc I hadn't used Haskell for ages back then.
 
lol
 
@Zoidberg then why do you recommend it?
 
what/who is Haskell
 
3 mins ago, by Zoidberg
user image
 
user142019
5:47 PM
@Washu because it's an awesome language.
 
@Zoidberg One theory is that it is not only lacking awesomeness totally, it is so fkn bad that is lowers quality of life when not coding. Hypothesis
 
user142019
@CCInc yes I just posted that you scrub.
 
:D
 
user142019
@blackbee Haskell is a programming language named after Haskell Curry.
 
@Zoidberg Why not Java?
 
user142019
5:48 PM
@Washu Because Java is bad.
 
I'm the scrub, I posted it in C# without quoting properly. No idea what scrub means, not googling it either
 
user142019
I don't care. xD
 
Array elements in C# are null when created, yes?\
 
user142019
If they are reference types, yes.
 
user142019
Otherwise 0.
 
5:50 PM
I think datetime defaults to datetime.minvalue
 
0
A: MediaPlayer in WPF application

CC IncAs far as I know, this is because each MediaPlayer element in the MediaPlayer[] array is null when first initialized, so you must initialize the elements first.

is that correct?
 
user142019
@JohanLarsson datetime is a value type?
 
think so, even looks like I was right not very common.
 
java is a necessary evil
 
hahahaha
 
5:55 PM
@CCInc I dunno, no vs so cannot test it
 
Hey its a young guy
 
DateTime defaults to default(DateTime)
 
user142019
lol
 
Which is just the parameterless constructor
 
class Box{
Box() {}
}
 
5:58 PM
please be explicit with your access modifiers
public? private?
 
user142019
What is the default access modifier in C#?
 
private
 
user142019
In Java it is package, but what about C#?
 
private for classes I think
 
all public
 
user142019
5:58 PM
IMO default access modifiers are bad.
 
yep
 
user142019
It's ugly and confusing.
 
always be explicit
 
private makes thing fucking complicated
 
why?
 
user142019
5:59 PM
I always explicitly add access modifiers to C++ code, too.
 
yep, me too
 
user142019
class lexer {
public:

private:
}
 
well, not that explicit...
 
user142019
It is explicit.
 
00:00 - 18:0018:00 - 00:00

« first day (2 days earlier)      last day (891 days later) »