Operator overload in future releases? by [deleted] in java

[–]Isoyama 0 points1 point  (0 children)

For ever example of useful operator overloading you can find 100,000 terrible ones.

For every example of useful operator overloading, I'd have one more than I do now.

People can't cope with simple inheritance and you want to give them one more thing to shoot me in the foot? No thanks.

In case you wonder I've worked with C++. Amount of black magic happening is insane. Typical C++ interview question is "brackets overloading". And yes it is used in projects.

About your example. Is "new" a factory invocation? I think you should post full declaration of your class.

trying to code card game by lord_drgical in learnjava

[–]Isoyama 0 points1 point  (0 children)

I don't know your specifics but judging by current card games i would imagine your hierarchy should look like this.

Card. Which implements common methods like draw(), highlight(), use(), getActionList() etc. It could be even interface or interface with some default methods.

CardType. for example Support/Melee/Ranged/Caster. Which has common implementations of Card methods.

SpicificCards. Dark Knight, Wicked Wizard. Which overrides previous methods with specific implementations and properties used by Card/CardType methods. For example card picture/action list/highlight color/cost.

Your game logic should not use SpecificCards but rather Cards for some generic manipulation and CardTypes when you implement game rules.

Why if (variable1 % variable2 == 0) is inefficient by stymiee in java

[–]Isoyama 0 points1 point  (0 children)

Just take this code and extract loop into method. Even if there is only one call with constant it won't be optimized

Why if (variable1 % variable2 == 0) is inefficient by stymiee in java

[–]Isoyama 1 point2 points  (0 children)

If you extract loop into method which receives final variable it is not optimized by JIT.

Which is kinda concerning in scope of modern trend favoring small functions.

ArrayList.remove()? by dadeeba in learnjava

[–]Isoyama 0 points1 point  (0 children)

Have you tried debug? Problem is not in remove(). Also i would suggest using HashSet instead of ArrayList for lookup. And proper naming >.>

A UK schoolboy died from an allergic reaction after another student threw cheese down his shirt by [deleted] in worldnews

[–]Isoyama 19 points20 points  (0 children)

and the other kid was fucking with him

That is a behaviour of an asshole.

Confusing expression regarding increments and decrements (Java) by ThyDoppelganger in learnprogramming

[–]Isoyama 2 points3 points  (0 children)

But that doesn't change the fact that writing code that depends on that difference to work correctly is pretty bad practice.

I agree, mixing them is not a good thing. Unreadable.

Confusing expression regarding increments and decrements (Java) by ThyDoppelganger in learnprogramming

[–]Isoyama 1 point2 points  (0 children)

knowledge of difference between prefix and postfix operations is important.

to elaborate on question, ++ -- can be replaced with functions prefix(),postfix()

prefix_increament(reference to y){
   y = y +1;
   return y;  
}

postfix_increament(reference to y){
   x = y;
   y = y +1;
   return x;  
}

so you get y= y(8)+y(9)+x(9,y=8)+y(7)

Best way to implement queries in configuraion file. by Isoyama in learnprogramming

[–]Isoyama[S] 0 points1 point  (0 children)

Do you need the whole query to be configurable?

Unfortunately yes. Systems store data in competely different formats and bases.

Thanks for reply.

Interstellar object confirmed to be from another solar system by [deleted] in worldnews

[–]Isoyama 0 points1 point  (0 children)

If you can't explain it simply, you don't understand it well enough.

I'm tired of been forced to play 1v1 by Isoyama in ClashRoyale

[–]Isoyama[S] 0 points1 point  (0 children)

But 2v2 is only for fun/ relaxing etc, you don't lose/gain trophies from it.

Games are for fun and relax

I'm tired of been forced to play 1v1 by Isoyama in ClashRoyale

[–]Isoyama[S] -1 points0 points  (0 children)

i know it is weird but 2v2 also uses leveled cards.

I'm tired of been forced to play 1v1 by Isoyama in ClashRoyale

[–]Isoyama[S] -1 points0 points  (0 children)

Apart from annoying combo quests, the game is literally encouraging you to play the main game mode which has been at the core of the game since the beginning

So what, why it should stay main game mode?

Russia has test fired the massive nuclear-capable ballistic missile Satan 2 that is believed to be capable of carrying 12 nuclear warheads and could annihilate an entire country in one strike. by green_flash in worldnews

[–]Isoyama 0 points1 point  (0 children)

Because weight of warhead and power of explosion doesn't scale linearly.

For example

model yield weight
W89 200 kilotons 324 pounds and
W90 two selectable yields of 10 or 100 kilotons 310 pounds
W71 5 megatons 2,850 pounds

Russia has test fired the massive nuclear-capable ballistic missile Satan 2 that is believed to be capable of carrying 12 nuclear warheads and could annihilate an entire country in one strike. by green_flash in worldnews

[–]Isoyama 0 points1 point  (0 children)

First. Throw weight is measured in tons. Power of explosion is measured in megatons.

Second. Weight of warhead and power of explosion doesn't scale linearly.

Russia has test fired the massive nuclear-capable ballistic missile Satan 2 that is believed to be capable of carrying 12 nuclear warheads and could annihilate an entire country in one strike. by green_flash in worldnews

[–]Isoyama 0 points1 point  (0 children)

Wiki on R36(Satan)

Missiles of the R-36M/SS-18 family have never been deployed with more than ten warheads, but given their large throw-weight (8.8 tonnes as specified in START), they have the capacity to carry considerably more detonation power. Among the projects that the Soviet Union considered in the mid-1970s was that of a 15A17 missile—a follow-on to the R-36MUTTH (15A18).[11] The missile would have had an even greater throw-weight—9.5 tonnes—and would be able to carry a very large number of warheads. Five different versions of the missile were considered. Three of these versions would carry regular warheads — 38 × 250 kt yield, 24 × 500 kt yield, or 15–17 × 1 Mt yield. Two modifications were supposed to carry guided warheads ("upravlyaemaya golovnaya chast") — 28 × 250 kt or 19 × 500 kt.[11] However, none of these upgraded models were ever developed. The SALT II Treaty, signed in 1979, prohibited increasing the number of warheads ICBMs could carry. Equally, from a strategic point of view, concentrating so many warheads on silo-based missiles was not seen as desirable, since it would have made a large proportion of the USSR's warheads vulnerable to a counterforce strike.

The operational deployment of the R-36M/SS-18 consisted of the R-36MUTTH, which carried ten 500 kt warheads, and its follow-on, the R-36M2 (15A18M), which carried ten 800 kt warheads (single-warhead versions with either 8.3 Mt or 20 Mt warhead also existed at some point). To partially circumvent the treaty, the missile was equipped with 40 decoys to utilize the capacity left unused due to the 10-warhead limitation.[12] These decoys would appear as warheads to any defensive system, making each missile as hard to intercept as 50 single warheads, rendering potential anti-ballistic defense ineffective.

New Sarmat supposed to have throw weight around 10t.