YaSCPSV (Yet another SC Pilots Statistics Viewer)

Since I think we don’t have enough tools out in the wild for parsing Star Conflict’s Web Api, I made Yet another Star Conflict Player Stats Viewer. You may ask were is the difference to all the other Viewers.

Well, for one you can use this one on your phone without having to scroll to the side and everything is done on the end user device without having the need of an additional server. And all of this the code is licensed under the Do Why the F*ck you Want to Public License.

8NS94mt.png

Page: YaSCPSV

 

Code: https://gitlab.com/JohnZi/StarConflictStatsViewer

Licensed under the wtfpl-badge-1.png

dat awesome css

8 minutes ago, Swifter43021 said:

dat awesome css

Of course, I just removed some stuff I don’t need here so it is even more lightweight.

And for everyone who doesn’t like the awesome solarized colors, there are plugins line stylish to modify CSS In your browser.

Why are pilot stats important again xd

2 minutes ago, ORCA1911 said:

Why are pilot stats important again xd

Don*t ask me, I found the code of this some days ago (started years ago with jquery as a base) and started to clean it up, so my count of abandoned projects isn’t that high;

and I also released it because we have already so much of these type of programs (Frogswarm / Italy / the Russian one / the other one / probably another one )

Its not working for me.

30 minutes ago, Gizmomac said:

Its not working for me.

Didn’t I say that one has to allow mixed content / disable the protection in firefox since the Star Conflict web api is to buggy when accessed over https

Edit: it looks like you can only disable it temporarily in firefox-esr(45) but not in firefox 52

In chrome (and most other chromium based browsers) one has just allow to load unsafe scripts.

we shall call this one Yeti

I changed the webhost from github.io to my Router (an aweasome Fritz!Box) so I don’t have to deal with https.

New adress ist http://jzh.nerdpol.ovh/

pzpc0ik.png

What’s up with the Fleet Rating, my OCD is killing me with all those 9’s :/

4 minutes ago, Milfeulle said:

 

What’s up with the Fleet Rating, my OCD is killing me with all those 9’s :/

Funfact: The italy tools has the same problem…

I kind of fixed it now but it shouldn’t behave like that.

 

11 minutes ago, Milfeulle said:

What’s up with the Fleet Rating, my OCD is killing me with all those 9’s :/

That’s because in the database fleet strength isn’t 226. But 2.26

And the OP multiply this value by 100, to make it 226

 

But floating numbers aren’t extremely precise. Which leads to such things.

1 minute ago, Swifter43021 said:

That’s because in the database fleet strength isn’t 226. But 2.26

And the OP multiply this value by 100, to make it 226

 

But floating numbers aren’t extremely precise. Which leads to such things.

but 2.26 * 100 should not result in 225.9999999999999997 … 

22 minutes ago, MightyHoot said:

just make put that in some int(thingie) so it’s nice 226 

I don’t have any plan how to force data types in JS, I just went and rounded it after the calculation to 0 digits after the dot. (maybe it is now saved as a int maybe not who knows)

1 hour ago, MightyHoot said:

just make put that in some int(thingie) so it’s nice 226 

That would be 225

 

Just use number.ceil()

 

1 hour ago, John161 said:

but 2.26 * 100 should not result in 225.9999999999999997 … 

Like I said, it’s due to an imprecision computers do with floating numbers. 

1 hour ago, Swifter43021 said:

Like I said, it’s due to an imprecision computers do with floating numbers. 

Thanks for that precise explanation.

you could have just wrote that that there is no natural number solution for the equation where i isn’t infinite.

2*10^-1 + 6*10^-2 = x*2^-i+y*2^(i-1)…

Because that takes half a second to get an answer on the net…

 

But as you wish.

http://floating-point-gui.de/basic/

18 hours ago, John161 said:

Didn’t I say that one has to allow mixed content / disable the protection in firefox since the Star Conflict web api is to buggy when accessed over https

Edit: it looks like you can only disable it temporarily in firefox-esr(45) but not in firefox 52

In chrome (and most other chromium based browsers) one has just allow to load unsafe scripts.

ahh sorry I didn’t see it.

but the new link works well ![:)](<fileStore.core_Emoticons>/emoticons/001j.png “:)”)

3 minutes ago, Gizmomac said:

ahh sorry I didn’t see it.

No problem, I just host it now an my awesome badass router two so that I have also an non https host (I maybe should add scp or ftp so I don’t have to use plain SSH and nano for updating the site)

 

11 hours ago, MightyHoot said:

now tell me how to convert .py to single .exe file with py3.6 XD

downgrade to 3.5 and use on of pyinstaller, cx_Freeze or py2exe; I would either go for pyinstaller (looks mature) or py2exe (the oldest, used it for many projects)

there is no real reason a 3.6 code wont run under 3.5 imho

there is also no reason to use the latest python except you lack libraries or very specific functions otherwise. u know, in production, most still use py2.7 ![:p](<fileStore.core_Emoticons>/emoticons/004.png “:p”)

btw. you wanna watch this - also, the dev version of pyinstaller seems to already support 3.6

15 hours ago, MightyHoot said:

just make put that in some int(thingie) so it’s nice 226 

in python your math library rules, because round(x, 2) will round to two decimal places…

in javascript, things are, as always, a bit more complicated, because the language was written between the kitchen and the toilet.

(I like this:)

Quote

function round(x, digits){
return parseFloat(x.toFixed(digits))
}

anyway, as john uses toFixed already, and its only for outputting strings into html, i think toFixed() call to whatever is sufficient for him ![:)](<fileStore.core_Emoticons>/emoticons/001j.png “:)”) just felt like this is a nice discussion.


@float

 

Otherwise, with floats, it helps to remember, resolution. float has a finite set of bits, depending on where the decimal is, this limits the total amount of significant digits / information stored, before and after the decimal. Btw. it’s called float because of this, the “decimal floats” between the digits dynamically. this means, that some numbers cannot be sufficiently displayed. numbers in front of the decimal take away more and more resolution, while infinitely small numbers may be cut off if combined with larger ones, if their significant parts are behind a lot of zeroes (1.2784blah E-9 ). it is not the only reason, but it plays into results, which are calculated over multiple steps, with different scales of numbers, you basicly cut off information. This gets more interesting in simulation, where this effect creates camera shakes in 3d sims if your coordinates you work with are at a certain distance from (0,0,0), reducing the resolution behind the decimal, and the main reason, most games using floats for x, y, z have a maximum mapsize of 99-999 units (whatever a unit may be, e.g. SC seems to be around 1f = 10m). There are other reasons, but this is one of the main issues for float, as the same problem almost never appears for doubles (64 bit), except you go into crazy number calcs.
I only tell you this, since you will have to study floats if you reach 3d coding. With your current learning speed, that might happen soon! ![:p](<fileStore.core_Emoticons>/emoticons/004.png “:p”)

life hack: if you ever see this happening at input (so if you input 127, and suddenly it says 127.0000001 in any kind of application) you know automatically, whatever you input, gets calculated in the background, or transformed into another number and retransformed for display, because this effect _always_ happens after calculations. this means, it is sufficient to round the value you display at output, rounding inbetween will achieve nothing, and a float will not suddenly change into something else, if you explicitly define it. Only saying, because before i understood floats, and to be honest it took me quite a few attempts, i was never sure wtf. Especially at applications, which let you input degrees (0°-360°) but stored the value in radians, so your inputted number suddenly gets fuzzy.

 

22 hours ago, John161 said:

I made Yet another Star Conflict Player Stats Viewer.

i looked at it, quite cool and short, kudos for releasing with source.

well okay, with js, thats hardly a question, but you know what i mean, with link to repo ![:)](<fileStore.core_Emoticons>/emoticons/001j.png “:)”)