« first day (4 days earlier)      last day (889 days later) » 

7:53 AM
0
Q: Synchronizing multiple static variables of a singleton class

nitishI need to synchronize only the obj1 and obj2 of the following singleton class such that multiple threads can obtain the single instance of this class however only one thread can access obj1 or obj2 at a time. public class Sample{ private static LinkedHashMap<String, String> obj1; ...

 
 
6 hours later…
1:54 PM
0
Q: Is there a difference between holding a static instance in a class method vs a class

JamesWhen working with the singleton pattern. Is there any difference when holding the static instance in the class and holding it in the method that returns the instance? Examples: Inside the class. class cExampleA { static $mInstance; protected function __construct() { /* Protecte...

 
 
4 hours later…
5:25 PM
0
Q: Singletons - using them in simple PHP based CMS

krunoI have red lot about singletons, most agree that they are bad practice and to avoid them any way possible. Most people say because it hard to debug apps that use them. Now creating simple CMS, I tried few approaches and they seem to me the best choice. Configuration data That file is loaded ...

 
 
1 hour later…
6:32 PM
0
Q: iOS singleton class not retaining property values

ZeNewbI have a basic class that I created and then added some Singleton initialization code to in order to turn it into a Singleton object. I initialize the Singleton in my first view controller and call some methods on it which set some of the Singleton's properties, but once I get to the second view...

 
6:56 PM
@Zoidberg I'm afraid this room is destined to become a Feed graveyard :(
 
user142019
xD
 
7:08 PM
@Zoidberg In our Java exam, there were two questions that contained code like for (int = 0; i < 10; ++i) { /* ... */ }, and nobody had noticed this mistake during review :)
 
user142019
xd
 
user142019
That’s why there should be a compiler in the team.
 
Not sure whether that was ++i or i++ by the way. Remember, i++ is more object-oriented ;)
Maybe I should ask an SO why i++ is considered to be more OO :)
 
user142019
Well, you know.
 
user142019
In OOP, the object is the most important part.
 
7:11 PM
Yes, but the question is so stupid, I want to share it with the world.
 
user142019
It decides what code gets executed, eventually.
 
user142019
And the most important part coming first makes sense. :P
 
Objects most important? I strongly object to that!
 
user142019
So i++ being more OO would make some sense. I could understand the reasoning behind it.
 
But ints aren't even objects in Java :)
 
user142019
7:13 PM
Who cares about Java?
 
By the way, why can I not increment a string with ++? That would also make a great SO question :)
 
user142019
How would you do that.
 
user142019
++ is list concatenation!
 
Did you know that ++myBool used to be legal C++?
 
user142019
No. xD
 
7:14 PM
It was equivalent to myBool = true.
 
user142019
++ only makes sense on numbers.
 
user142019
C++ must stop with not being strongly typed.
 
user142019
The only implicit conversions I like all have to do with references; implicit to and from reference, and implicit D& to B& when D : B.
 
user142019
I like Haskell’s type system. :)
 
Too bad polymorphic base classes don't have their copy constructor deleted by default.
 
user142019
7:16 PM
And F#’s.
 
default = delete
Is F#'s type system less expressive than Haskell's?
 
user142019
It’s very strongly typed (i.e. no implicit conversions) but has :> and :?> for up- and downcasts.
 
:> looks very happy
:?> looks like a pipe smoker with beard
 
user142019
:> is upcase, :?> is downcast.
 
downcast can fail, hence the ? I suppose?
 
user142019
7:19 PM
Yes.
 
user142019
It can fail with an exception.
 
user142019
Like in C#.
 
By the way, it's upcast, not upcase ;)
 
user142019
@FredOverflow Autocorrect. T_T
 
WTF is upcase? :)
 
user142019
7:20 PM
Besides those, it has classes, algebraic datatypes, interfaces, type inference, polymorphism (OOP-like), structs and attributes.
 
user142019
It also has mutable types.
 
normal classes?
 
user142019
But F# isn’t lazy and you can perform side-effects whenever you want.
 
user142019
@FredOverflow Yes, like in C#.
 
user142019
It has to work with .NET, remember? :P
 
user142019
7:22 PM
         // ctor arguments
type Foo(x:int, y:double) as this = class
    inherit Bar(x)

    do // this is a ctor
        doSomething x y
        doSomethingElse x y
        this.someMethod() // call method on this object
        base.someMethod() // call method implementation of superclass
 
user142019
The syntax is very weird for classes but well. :P
 
No braces and no semicolons? This is very refreshing :)
 
user142019
Of course not. xD
 
user142019
It uses indentation and newlines.
 
What a smart move to lure the Haskell crowd to F# :)
 
user142019
7:27 PM
Erlang uses ;, , and .. :P
 
user142019
my_function(42) ->
    f(),
    io:format("Answer correct!~n"),
    h();
my_function(_) ->
    f(),
    g(),
    h().
 
user142019
Indentation is insignificant. :P
 
user142019
, is just the same as in C, ; means "next pattern", . means "end of function".
 
8:13 PM
Oh awesome, I can read our library books online, even from home.
I could have saved a lot of money if I had known that earlier :)
 
user142019
8:25 PM
xD
 
But of course not every book is available digitally.
 
user142019
That homework assignment.
 
user142019
I have to do it over because I did it poorly. xD
 
Which one?
 
user142019
The one about qualities.
 
user142019
8:28 PM
You must make a list of things you’re good at and describe them in detail.
 
user142019
Apparently my descriptions weren’t detailed enough.
 
Say you're good at C++, and then bombard them with quotes from the standard.
 
user142019
xD
 
user142019
I’d rather say I’m good at Erlang or JavaScript.
 
user142019
Yes!
 
user142019
8:32 PM
I’ll quote the conversion rules from the ECMAScript Standard! xD
 
user142019
JavaScript conversion rules are so fucking complex. :|
 
user142019
Btw here are PHP’s comparison rules. :)
 
The Big Bang Theory Season 1-5 Complete Boxset: 27 GBP
The Big Bang Theory Season 6: 17 GBP
 
user142019
 
strange price policy
 
user142019
8:33 PM
The operator represented is <.
 
user142019
So
 
user142019
array(a => "b", b => "a") < INF < array(0, 1) < array(a => "b", b => "a") XD
 
user142019
Oh no wait it’s a syntax error. xD
 
user142019
Wait wat.
 
user142019
It’s a syntax error because I chain <. T_T
 
user142019
8:39 PM
Should be a type error, no?
 
I have no idea
 
user142019
Well, you are basically doing operator<(bool, array).
 
user142019
It makes no sense to perform < on a Boolean anyway, and certainly not in conjunction with an array.
 
user142019
Hmm
 
user142019
I have Flash installed on my computer.
 
user142019
8:43 PM
I should make a website in PHP and Flash where people can sell PHP scripts.
 
user142019
2004 style. :D
 
user142019
10:07 PM
1 message moved to recycle bin
 
@Zoidberg ugly shrimp D:
 
user142019
:D
 

« first day (4 days earlier)      last day (889 days later) »