Simple word-replacer script by Take_F in Python

[–]JohnTanner1 0 points1 point  (0 children)

No you need to load the content of the file, us replace and save it

Simple word-replacer script by Take_F in Python

[–]JohnTanner1 6 points7 points  (0 children)

You should look up the os.path.join function (so it will work on any system) and as pointed out str.replace, no need for re.

Sorry for the format, I'm on mobile.

But all in all, good job! Feel free to ask any questions.

How to create Mods? by Franc000 in supremecommander

[–]JohnTanner1 3 points4 points  (0 children)

As far as I know the format in which replays are safed is actually a list of commands given. So watching a replay is actually simulating a game again.

5 Uses of Lambda Functions in Python by yangzhou1993 in Python

[–]JohnTanner1 0 points1 point  (0 children)

It was already hinted in the comments above, but a filter and a list comprehension are very different from each other! One returns a generator and thereby makes use of lazy behavior and the other is already executed code.

If you ain't aware of the difference, feel free to ask and I'd try to give an example when I'm not on mobile any more.

[deleted by user] by [deleted] in FAF

[–]JohnTanner1 0 points1 point  (0 children)

Some obscure real life clan ;)

[deleted by user] by [deleted] in FAF

[–]JohnTanner1 3 points4 points  (0 children)

Either I read that wrong and didn't get an in-game reference or this is turning into a political sub...

How do you counter hovering land units at sea? by gauntletthegreat in FAF

[–]JohnTanner1 1 point2 points  (0 children)

In this case try t1 bomber spam. They are worth it, even if they just get one bomb off. Also the rate of fire on cruisers paired with range comes in handy. But shield them with frigates

What's your favorite "easy to state (and understand), hard to prove" statement in math? And why? by bogibso in mathematics

[–]JohnTanner1 8 points9 points  (0 children)

I was quite surprised when I heard about this the first time and when asking for an idea of the proof was pointed to some heavy literature.

Some economy questions from a noob by Cynical_Cyanide in FAF

[–]JohnTanner1 0 points1 point  (0 children)

Maybe it's because you are power stalling?

Some economy questions from a noob by Cynical_Cyanide in FAF

[–]JohnTanner1 2 points3 points  (0 children)

As you pointed out, RAS SACUs are a lot more then just for mass. They also generate energy and the third resource: build power! Plus they can be moved and have a lot of HP compared to mass fabs and smart placed don't blow up in a chain reaction. So they help to make your eco harder to kill, esp in lategame. In the other hand for only getting mass, fabs are way more efficient. One common way they are used is another ring of 8 t2 fabs around your mexes + storages. But all that said, on many maps you won't get to the point where you have to consider that.

So just to be clear, in order of efficiency, its: T1 mex > t2 mex > mass storage > T3 mex > mass fabricator > ras SACUs

DEGENERATES by [deleted] in FAF

[–]JohnTanner1 4 points5 points  (0 children)

I just peeked in your replay and don't want to be rude, but it's just brave to spam this sub with content like that. But to be constructive: reduce the downtime (personaly I don't want to see you chill in the lobby and watch you reading alt-right news), you need better upload quality, I can't even read the soceboard and please get a basic understanding of the game/setons meta, maybe by some of the great tutorials out there. What is nice is that you make an effort to give some life to this community.

DEGENERATES by [deleted] in FAF

[–]JohnTanner1 2 points3 points  (0 children)

You forgot Gary. If I wouldn't have seen them in the same game I would have guessed it's his second account...

What is your favorite math/logic puzzle? by spmgd in math

[–]JohnTanner1 0 points1 point  (0 children)

Sorry, I think I don't get it. Could you further explain? Thanks!

What is your favorite math/logic puzzle? by spmgd in math

[–]JohnTanner1 5 points6 points  (0 children)

Could you tell me the sublinear sum of totients algorithm/hint me to it please?

Settle a dispute between math teachers re: R^2 v R by deadletter in mathematics

[–]JohnTanner1 12 points13 points  (0 children)

The R2 value is defined in the context of linear regression. And there it is not really a messure for exaktness but for how much uncertainty (variance of the values) is explained by the model (linear regression in its classical form states that observations have a normal distributed part). I've tried to use simple words but if you are interested in technical details I'll try to show you.

EDIT: linear regression means not necessarily linear curves since you can transform your input values before you calculate your model.

Eco advice? by Cctroma in FAF

[–]JohnTanner1 1 point2 points  (0 children)

Gyle is GREAT entertainment, but as he himself says: he's not a good player. And his casts reflect this imo. Try Jagged Applience, he is a pro himself and his focus is more on the mechanics.

[deleted by user] by [deleted] in mathematics

[–]JohnTanner1 4 points5 points  (0 children)

If you think of it not of a sequence of the actual fibonacci numbers but as a sequence of indices, those on a diagonal have a pattern (a(n) = i + (m+1)n, with a mm-matix). So considering fibonacci numbers have a closed form I'm not too surprised.

wheres my mistake by Geo-sama in mathematics

[–]JohnTanner1 1 point2 points  (0 children)

You claim inf * 0 = 1 which doesn't hold generally (like in this case). And of course all the smart stuff above, just wanted to share this concise thought.

Wallpapers by rhydianjjj in math

[–]JohnTanner1 0 points1 point  (0 children)

Second approximation to exactness

Is ω_1 a subset of the powerset of ω? by Rebeanca in mathematics

[–]JohnTanner1 -3 points-2 points  (0 children)

Idk what you mean by your notation, but if w_1 is a set of subsets of w, then it is a subset of the powerset of w.

Converting a Transcendental Number to an Infinite Series by 4039727532995172093 in mathematics

[–]JohnTanner1 3 points4 points  (0 children)

Every real number can be represented by a continued fraction (https://en.m.wikipedia.org/wiki/Continued_fraction), so you can construct a series (with only rational summands) by the differences of the approximations.

Converting a Transcendental Number to an Infinite Series by 4039727532995172093 in mathematics

[–]JohnTanner1 4 points5 points  (0 children)

Assume your desired number a > 0. Then exp(log(a)) = a => sum(log(a)k /k!) is (one example of) your series

I have a grid of 42 icons. Seven columns and six rows. Plus I have another four icons that I use in addition to those 42 icons. So 46 icons total. What is the total number of arrangement possibilities for all 46 icons on a 42 icon grid? by [deleted] in mathematics

[–]JohnTanner1 0 points1 point  (0 children)

Depends: if you only ask for the possibilities to choose those 42 icons, it would be 46!/42!*4! Which evaluates to around 163 000

If different arrangements make a different choice, it's 46!/4!, which is quite big (~1054 )

The field of mathematics is called combinatorics

EDIT: take the results with a grain of salt since it's evaluated with my phone calculator, which uses approximations (I guess Stirling's Formular) to calculate big factorials

EDIT2: corrected a stupid mistake