Johnnynator1 147 Posted April 5, 2017 Report post Posted April 5, 2017 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. Page: YaSCPSV Code: https://gitlab.com/JohnZi/StarConflictStatsViewer Licensed under the 1 Share this post Link to post Share on other sites
Swifter43021 317 Posted April 5, 2017 Report post Posted April 5, 2017 dat awesome css Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 5, 2017 Report post Posted April 5, 2017 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. Share this post Link to post Share on other sites
ORCA1911 848 Posted April 5, 2017 Report post Posted April 5, 2017 Why are pilot stats important again xd Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 5, 2017 Report post Posted April 5, 2017 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 ) Share this post Link to post Share on other sites
Gizmomac 353 Posted April 5, 2017 Report post Posted April 5, 2017 Its not working for me. Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 5, 2017 Report post Posted April 5, 2017 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. Share this post Link to post Share on other sites
xKostyan 1,075 Posted April 5, 2017 Report post Posted April 5, 2017 we shall call this one Yeti 1 Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 5, 2017 Report post Posted April 5, 2017 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/ Share this post Link to post Share on other sites
Milfeulle 211 Posted April 5, 2017 Report post Posted April 5, 2017 What's up with the Fleet Rating, my OCD is killing me with all those 9's :/ Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 5, 2017 Report post Posted April 5, 2017 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. Share this post Link to post Share on other sites
Swifter43021 317 Posted April 5, 2017 Report post Posted April 5, 2017 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. Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 5, 2017 Report post Posted April 5, 2017 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 ... Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 5, 2017 Report post Posted April 5, 2017 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) Share this post Link to post Share on other sites
Swifter43021 317 Posted April 5, 2017 Report post Posted April 5, 2017 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. Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 5, 2017 Report post Posted April 5, 2017 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)... Share this post Link to post Share on other sites
Swifter43021 317 Posted April 5, 2017 Report post Posted April 5, 2017 Because that takes half a second to get an answer on the net... But as you wish. http://floating-point-gui.de/basic/ Share this post Link to post Share on other sites
Gizmomac 353 Posted April 6, 2017 Report post Posted April 6, 2017 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 Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 6, 2017 Report post Posted April 6, 2017 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) Share this post Link to post Share on other sites
g4borg 1,866 Posted April 6, 2017 Report post Posted April 6, 2017 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 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 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.2784blahE-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! 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 5 Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 6, 2017 Report post Posted April 6, 2017 2 hours ago, g4borg said: Reveal hidden contents 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.2784blahE-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! 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. 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 Thanks and nearly everything I have coded that has to do with SC and got finished, is avaible somewhere in the forum\the link to the source code in the forum (the crappy directx overlay ID counter and the php stats to picture thingy I used to have in my Sigbature(which actually broke the ruled since it was 20px or so to side)) Does anyone know what the minimum ram requirement for php is? I have 36Mb left. Share this post Link to post Share on other sites
Swifter43021 317 Posted April 6, 2017 Report post Posted April 6, 2017 These peoples using PhP and JS. Why PhP when you can asp.net ? Why JS when you can Bridge.net ? Share this post Link to post Share on other sites
Johnnynator1 147 Posted April 6, 2017 Report post Posted April 6, 2017 52 minutes ago, Swifter43021 said: These peoples using PhP and JS. Why PhP when you can asp.net ? Why JS when you can Bridge.net ? Coz especially Bridge.net an unneeded additional layer between the code you write and the target platform is, the only advantage it may have is that C# devs can write familiar code and with plain js I can easily update smth without the need to compile it to js first (and don't need aditional tools, just a texteditor) For asp.net is the secod part still true bur I can't say more about it. I myself started with php coz I wad involved in a project that was using already php. I never bothered to learn c# and still wouldn't think about it, while it may be usable everywhere (like Java), it isn't perfect for anything. Share this post Link to post Share on other sites
Swifter43021 317 Posted April 6, 2017 Report post Posted April 6, 2017 Let's be honest. JS sucks. If there are so many "layers" that compile into JS, instead of using plain JS, it's because of this. Bridge was just a random name poping into my head. But for example, let's say you want to share some code between your client and your server. You have tree options : - Convert the code manually, and spend hours doing so + requires to be updated simultaneously after every changes. - Don't implement it on the client, and do a request everytimes it's required (but will most likely lag) - Compile your code to JS. And it works right out of the box, and both client/server are always synchronized without any extra manipulation. The best answer for both efficiency, and maintainability is quite obvious right ? Anyway it's quite out topic. Share this post Link to post Share on other sites
g4borg 1,866 Posted April 6, 2017 Report post Posted April 6, 2017 Wow, so many evil words. Funny, that the most evil of them all, and the sole reason why php got so popular back then, was asp I remember that time. I would also still prefer php over asp.net - of course, I would do neither, and simply use a python wsgi script or even a perl cgi script. faster, less memory, for this task, and works on more and cheaper hosts. And I know some js purists would simply go node.js. yeah, i know, it hurts. To be honest, writing separate client and server code sometimes indeed seems annoying, but in the end, almost every time, you will have two separate layers anyway, if it grows to the point, where you would have had upsides with metalanguages. Which is why all these uber-duper-libraries which began with google gwt, never really managed to fight off things like jquery or angular. Personally, while i dislike php and js as languages which are prone to bad style and taste in programming, i can only laugh if someone talks about internet, M$ products and efficiency in one sentence. 5 Share this post Link to post Share on other sites
Recommended Posts