#code-talk
2 messages ยท Page 15 of 1
well if it's a website, you almost have no choice but to connect via hostname, but if it is server based with no virtual hostnames then you are better off using ip directly
if you are resolving hostname that is where the issue lies, because you can resolve a hostname to both ipv4 and/or ipv6
back later
what I mean by virtual hostname is like this - you can have one IP address and one port hosting many domain names
the way the server determines which site you connect to is based on quite literally the hostname text you resolved
traditionally, most of the internet services are 1 IP and port to one service, whereas HTTP servers are mostly 1 IP and port to multiple services (domain names)
that is also why you can have so many security issues with websites, you never, ever want to have secure customer data on a website that shares the same IP/port with another website, essentially you want that IP/port dedicated to one domain (or only -your- domains if you do decide to use virtual hostnames)
one great example of a security hole from virtual hostnames in this situation is certificate spoofing, since certificates use IP to hostname verification as one of the main verifications
@fickle aurora sorry but im pretty sure u cant have more than one service/server on a ip\port
its not that they cant figure out ipv6, its that nobody cares about ipv6 anymore
isnt it atleast for a shortage of ip
we were supposed to run out years ago
ipv6 became unnecessary as everyone relied on NAT and nat-punching
it doesnt really offer 95% of people anything they want
if it were a drop-in replacement for ipv4 it would expose you to the internet, and if you set it up properly the configurations are more complicated than ipv4
also its poorly implemented, like the specification said IPSEC encryption was mandatory but nobody does it
error 11004
WSANO_DATA (11004) Valid name, no data record of requested type
Berkeley description: The requested name is valid, but does not have an Internet IP address at the name server. This is not a temporary error. This means another type of request to the name server will result in an answer.
WinSock description: Same as Berkeley for host resolution. For protocol and services resolution, the name or number was not found in the respective database.
identical to WSANO_ADDRESS (11004)* No address, look for MX record
ESocketException: connect: WSocketResolveProto: Cannot convert protocol
'tcp', Error # 11004
You can change Proto with '6' insteand of 'tcp'. However it is the tcp stack that is not properly
installed or they have messes around with it. In C:\WinNT\System32\drivers\etc there is a file
'protocol' (without extention) that holds all the proto's. Eventually you can just copy it from
another machine.
@lunar cobalt @fickle aurora @zealous sonnet @long raft @lean forum I just fixed a second players network problems ( @proud mirage ) he used to be able to play but not for some months. He could get into home region but not travel, and had error in top right small text saying 'War Service connection failed. Error: Connection Failed could not initialize connection' .
After trying different things, I reviewed hes War.log and found several lib web socket errors, the first being 'getprotobyname() failed with error 11004' after some googling as to the origin and function of getprotobyname() it seems it is not a lws function but a native c one, and found it relates to C:\Windows\System32\drivers\etc\protocol file, infact it seems getprotobyname uses and relies on the protocol 'index' file. And it turned out this players file was missing for what ever reason, so i gave him a copy from a win10 machine i have and just like magic it started working again, and he`s very happy to be able to try out all the new content and changes. ๐
nuts
icanari maybe you could post the file and description in tech chat
i must admit ive never seen or looked at this index file
pretty weird, no idea why missing
thats it
its like dns but between common alpha name and the index numbers
so you can do getprotobyname(TCP) or getprotobyname(6)
I hate it
or getprotobyname(MYPROTOCOL) if there is an entry for it
i laughed at the copyright line too, hasnt changed in a while
yeah
That's XP
And Server 2003
Vista was '07
So you wonder why windows just doesn't install it sometimes

not sure, i googled, and cant find any results of others with the missing file so, maybe some 3rd party thing did it
maybe something tried to add a protocol to it and corrupted it so windows just deleted it?
or just scandisk coz it happened to get corrupt from power reset
@pure sierra Thanks, we'll investigate.
so its not so much a problem your end,
nor sure if/how many others have had the problem
just something to keep in mind if it comes up again
or you could just use getprotobyname(6) to maybe avoid relying on the file
wouldn't that just grab it from the same file though
from what i can tell the protocol file is a link between the alpha names and numeric index
The file also has the numbers in it though
So I'm guessing if you said getprotobynum(6) it would check what 6 is on this file, and then keep going
6 is not anything in the file, its kinda one way
ip 0 IP # Internet protocol
icmp 1 ICMP # Internet control message protocol
ggp 3 GGP # Gateway-gateway protocol
tcp 6 TCP # Transmission control protocol```
tcp 6 TCP #Transmission Control Protocol
A text file that provides resolution of protocol names into their respective RFC-defined protocol numbers on a TCP/IP network.
Definition of protocol file in The Network Encyclopedia.
it goes from name or alias/s to number
linux even has one too https://linux.die.net/man/5/protocols
This file is a plain ASCII file, describing the various DARPA internet protocols that are available from the TCP/IP subsystem.
my thinking is they would have these problems everywhere not just foxhole, wouldnt they?
ud think so, but maybe the file is not relied on as much
I'm guessing a lot of stuff either bypasses it or brings its own definition
shouldnt it be used for every single socket that gets opened?
it would seem not, as afaik had no other problems
and was using browser/discord and even got into the home region
test, delete own file and find out ;p
hayden what I was saying is that with apache you can do virtual hosts which allows you to host multiple domain names or websites on one IP and port - this is how it's done on many large scale cheap operations, but at the same time it introduces a lot of security issues
ah ok, got it
that is why businesses need to be weary about how their website is hosted
why is there security vulnerability to using vhosts and same ip
because if you use SSL then someone else with another website on the same IP as virtual host can spoof easily
then again, the hosting provider themselves could be spoofing all the clients website certificates and basically steal all encrypted data
also on the topic of nat, nat only really is deployed with home routers or in businesses... most people still largely all have an assigned public IP on their modem... IPv6 is already widely deployed for mobile internet and asia/europe for internet service, but again, if you are not actually using ipv6 yourself it is best disabled to avoid problems
sure, but within a vps where you are the only ip user for different websites than is ther still a risk ? assuming you are only one in dev control of the websites
no need to disable ipv6 at least on my ISP, it only sends ipv6 info if asked specifically for it
yeah it depends though, if your ISP supports ipv6 but does not actually route ipv6, that is really where the issue lies
All major american ISPs route ipv6
if it is only half implemented that is when you have connectivity issues, if it is disabled completely, then the OS will ignore it and just use ipv4
you'd be surprised how badly implemented american ISPs have done it
No i wouldn't be surprised
well in canada anyway, it is a nightmare on Bell, if you are on Bell in certain areas, it is really mucked up - I don't know who they hire at their centers, but it is plain junk - I found Rogers implemented it just fine however
You're talking about american ISPs
I expect the worst possibly version of anything from them
on Rogers you have to force the apn on mobile to use IPv6 though, it defaults to ipv4
the only beef I had with them was their throttling of certain things
when I traveled I used verizon and family mobile, and of course verizon ended up being superior
funny when you talk of throttling of services, as when i was googling the protocol file, some where modifying it among other changes to change the way bittorrent traffic was routed to avoid service shaping/tiering by isp
I never used bittorrent, it was mostly things like steam that they throttled
it was fiber to the home
all the fiber offerings near me are bullshit
you'll get good readings from all the major speed test sites, but then you go back to steam and all of a sudden you're back to stone age speeds
oh yeah all the major speed test sites are complete BS
Rogers also admitted publicly in a case that they had throttled World of Warcraft, but not all of us go that far to get them to change their ways lol
throttled world of warcraft? i wonder why, im sure it barely used any bandwidth
downloads maybe?
Honestly thanks to all you guys @pure sierra @lunar cobalt @long raft for all the help guys, was a weird and convoluted issue but you guys were patient with me thanks again.
^
It's true hayden was especially helpful but I appericiate y'all taking a shot
i really didnt think it would be so easy such that we could fix it, so got lucky
(There's 2 hard problems in computer science: Naming things, Cache Invalidation, and off-by-one errors).
invented a trick for myself, idk if its commonplace
when you need to compare a variable with multiple constants, say, (x === 1 || x ===2)
you can instead write ([1,2].includes(x))
this was like a revelation to me
ah ha! - Yea I've done that too, technically it's creating an Array Object to do the check but it reads soo mich nicer than a multi-OR-IF
php has in_array
yea new int[]{1,2}.Contains(y) something you see in c# too
managed languages arent afraid to allocate an array for a test
Not only allocate, but also iterate all of it's 2 elements ๐ฑ
J
101000010111010101010101010001010100100100010
welcome to unicode
@tough goblet if I could reach through discord and slap you I would
stale memes
its a funny idea but youd delete it and retype ; like very first thing, right?
it would take seconds to fix
you wouldnt just keep hitting build and going ๐ค
unless you're using one of those IDEs which don't tell you what the error is on the line
Doesn't sound life much of an IDE
God bless eslint
automatically placing all semicolons for you
automatically indenting
do you use semi colons in javascript? you know its optional?
assembly does not use semicolon
@long raft i know, i like to add them
the end is nigh !
๐ฆ
rip newgrounds, long live newgrounds
hence the long live newgrounds
long live perl and cgi-bin scripting
Updated the foxhole war map to the new version that is now heavily optimized, using the reactJS web framework (the previous war map was basically just a heap of code stacked on top of each other that made little sense)
take a look https://foxholeglobal.com/map/
The Foxhole War Map is a community project developed by Sethfire and Kastow that displays a live map of the game Foxhole.
it's completely feature-empty though containing only the bare minimum to work, i'll add more features over coming months
seems to run pretty smooth
all the code is available on github so feel free to have a peek https://github.com/Sethfire/foxhole-war-map
loads pretty quick!
consider webp instead of png for the map, its like half the size
i have found leaflet is just awful on mobile browsers. open to tips to speed it up
Awful as in?
very slow and sometimes freezes the phone for seconds or minutes
you havent noticed that?
Leaflet doesn't pre-load different zoom levels well I think
So it has to re-grab a bunch of images from the server when you change zoom
leaflet usually completely chokes my phone
Huh, only issue I have with it on mobile most of the time is it loads zoom levels really slowly
leaflet is mobile-friendly and lightweight in general. the bigger issue is with the colossal number of map icons that the browser has to load for the war map
i like leaflet
any of you into DSP? trying to figure out why my high pass filter doesnt work
have you tried turning it off and on again?
figured you of anybody might be into dsp, disk
well yes but actually no
i had to flunk the class where i learned about it due to covid 
ask me again next semester
i could try to give you some theoretical shit i have about it
@long raft ok i have the stuff in front of me, what exactly is your problem
so I built a working low-pass filter for audio, tested it, sweet. great.
I do spectral inversion on it, but it doesn't work as a high pass
lets everything through
after normalizing the low pass filter, i just reverse the sign, add 1 to the middle sample, and voila, right? but no worky
And since I've never implemented a working high pass filter before I'm not certain I'm doing it right
oh I'm using a windowed sinc filter with a blackman window
@timber onyx
Idk why but doesnt sound right
Can you show the original spectrogram, the inverted and the two filtered? @long raft
Perhaps the clue can already be found visually
Oh I haven't drawn it, that's a good idea, might take me some time to do
would have loved to be in game when this happened... again
2:14am UTC
aha, spectral inversion is changing every other value's sign, not every value. think I found my problem
it was helpful to draw them tho
@barren quarry stats tab still broken ?
i made a decision to not touch foxhole global hq anymore, its shit code that is impossible to maintain
a lot of work for sure
i dont even know which features are half made and which are complete
just looking to compare summary section working on
lol i too made a decision to not touch the old foxhole war map, instead i just completely redid it from scratch. fortunately the project is not large in scale
btw what's icon 54, something to do with the dead harvest?
99 little errors in the code, 99 little errors, track one down, patch it and now...105 errors in the code
@young pilot maybe the font of balor portal. i couldnt find it in one endpoint i checked , but maybe it is there, or was added...
all code sucks
people invented extra languages for no reason other than to say they are special because they made a new language, but the vast majority of the web still uses perl
remember, new language == reinventing the wheel ... if the new wheel sucks compared to the old one, don't bother
but you think computer science peaked in 1970
github list javascript as the #1 language on their site, and perl as #21
it peaked around 2004, nothing great ever came after that
you may as well use visual basic over C# anyway since anything you can do in C# you can perform more smoothly with less performance drain in visual basic
also most windows software that supports macros will only accept VB 6.0 programming for those macros
im looking for anything correct in what you said but i cant find it
perhaps Delta V Operate software? it's quarter million dollar software so I don't think a lot of people own it, but it's used in a lot of manufacturing facilities
javascript sucks but jquery rulez
not a huge fan of jquery, ive found so many things people use jquery for can be done with vanilla.js so easily, without the additional 100k-1000k library
http://vanilla-js.com/ its really the best javascript framework
never heard of it so it must suck, jk
is it newer than 1975, then it must suck. also wa jk
well its an interpreted language, so it must have 0 value to humanity
assembly is everything
too high level. electrical impulses is the only way to really maximize your CPU
also, why the hell is your name green again ? you bad boi
because ive complained about team imbalance for ... 3 straight years
kastow is fancy electron man
jquery does what i need so i dont need any better
and its used by most cms i use
@long raft so you figured you would do something about it
hmm not really. ive only played 1 night. but at least i dont have feelings of guilt or wait times in queue when i do
also its good to see colonials i know
and ya know foxhole global is a colonial exclusive now...
i would feel so dirty if i tried green man
oh i think ... itd be good for you
people would be like "are you the hayden who made foxholestats?"
youd have some inter-faction celebrity status there
bathe in tomato juice and it will remove any 82dk scent you may still have on you
i never played one op with them, but did slave away building thier defences
not best clan for au
nah. but hey anzac is going colonial next war i think
i would maybe join anzac, but not sure i could join a non-warden-only clan
but u say they may play green
yah like first time ever
what pop issue ๐
thats how bad the imbalance is lately
moorep saw me last week and said "oh derp's here, that must mean its really bad"
turned 25 on the 18th
you are a young bun
how old are you?
late 30's
jesus christ you guys are hella old
i must say i dont think ive met anyone over 50 in foxhole
id bet minibar is pretty close
heheh, is minibar maybars baybe ?
minibar is the leader of 3SP
you mean we're hella smart and mature and wise
do they start programming in elemetry school in russia ?
the first time i programmed was like in middle school but very basic stuff
like fucking delphi
im having flashbacks of having to sing patriotic songs in grade school
delphi is ... basic?
from what i remember delphi is like glorified pascal
Delphi in legend previously called Pytho in ancient times was a sacred precinct that served as the seat of Pythia
Boreland is a village in Dumfries and Galloway, Scotland, which is located in Eskdale about 7 miles (11 kilometres) north of Lockerbie on the B723 road to Eskdalemuir. The village has a small primary school.
boreland
isnt the company borland?
yes
Defunct April 5, 2015
imagine paying for your compiler or IDE these days... nuts
man who was it here who was selling me on vs code a few months ago? I've really gotten into it, god damn its pretty amazing from the last time i used it
Have you guys seen code-server? It's vs code in a browser...
what is vs code
can even run it from your android phone...
i use vs code on a daily basis so could have been me
oh microsoft visual studio code is a rewrite of a development environment for many languages - open source
its fairly good, not every feature of visual studio, but its cross platform, and it has many features visual studio doesnt have
it competes with jetbrains
i use pycharm for python but i think the interface is a bit wack
my mind was rather blown by code-server, i know that kind of stuff is possible i just never see it executed well
very cool to have an entire IDE on your phone
coding on a phone is stage 4 colon cancer
meh not for me
i can just broadcast it to my TV or computer screen, and i can just pull out a bluetooth folding keyboard
if i traveled much i would try that maybe
i want to start doing my development inside containers, so i think im gonna head down this remote coding route
shipping containers ?? why...
peace and quiet
easy to focus
yah when you get locked in, youre really in the zone
watch in awe as docker eats your entire ssd
dont connect the net, just have a set of encyclopedia britanica
docker? please. like im gonna give root access to my containers
k8s or podman, brother.
@pure sierra yea a shipping container with a mobile phone IDE and programming books that dont go past 2004
wildman heaven
makes me want to go purge my book shelves of anything pre-2004
Hey, i try to implement E-Tags for the API. but it seems I kill the server by using them... any help?
it is just the representation. the data is properly handled, this is Guzzle a HTTPClient package
yes, if i dont pass it, i get the right response. if i do, i 500 the foxhole server
ok so its just a small error
so an etag is unique to the API call, I think
you cant use the same etag for different kind of API requests, as far as i know
the foxhole api docs state that i should send the key, i get from the header in the 200 response.
https://github.com/clapfoot/warapi#rate-limiting-and-caching
that is what i do. first i dont have one. so i send none.
it works, i get one.
then i start sing it, and i get 500...
its a cache mechanism
so youre doing the exact same query twice? but the second time uses the etag?
yes
yes
perhaps the casing is wrong
I use what they state. it is also what Mozilla defines:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
it sure looks right to me...
do the Devs look at this?
I think uhh ... adam does, sometimes
im not sure ...lots of people here know the api tho
so maybe someone in #code-talk can help me? ๐
@pure sierra has used the api using php im pretty sure
perhaps not laravel specifically
i dont use a user-agent, i wonder if that could make any difference
otherwise i see no difference, not sure if theres any way you can take a look at the raw request headers that get sent to curl or whatever is making that http call
perhaps theres some mangling between guzzle and the remote web server
Could use wireshark to grab the packets
@void marlin i notice in your example the first request gives back "317", but then you respond with 300. Also note the additional set of quotation marks - this may be important, I know I just copy it as-is, meaning with the quotations
3 commends says its the additional quotation marks that are needed
the 300 would be a client that didnt ask the api for maybe 1hour or so. should work. 300 was an old valid etag.
i just tried with 324 ( i got it and send it directly after. got 500 as well. tried with quotation mars and without.
xmlhttprequest onreadystatechange 2 if etags match abort
thank you for attention
That is if you're using js
hes using php
if i send the header with the wrong name it works, as i get the response. so the server is reading my etag header and then it is dying.
@barren quarry please dont be a dick. if you think you know the answer, and it is easy explain it nice.
@barren quarry the documentation states that i should get a 304 Not Modified response.
i'm a javascript programmer so i answered in javascript
i have never seen php so i cant help very much with that
the mechanics of xhr is that you get response tags first and then decide if you want to continue
and if etags match the previous response, you abort the request
he has all the mechanics right, its just some fine detail thats having issue
have you tried without a user agent, yet?
i do not believe that header is required and it might be causing the issue, i know i dont use it
and again, the quotations should be copied
can confirm its working fine for me.
"341"
i get the 304 response as expected
lets see if it works without quotes...
mine blows up if i strip the quotations out
pretty sure thats your issue, or that and a combination of the user-agent
it is in quotes
"\"342\""
there is an extra set of quotes
literal quotes in the string
look at the etag you get back on the first request, it has extra quotes - you have to copy those
i think you are saving it somewhere as an integer but it needs to be kept as a string
lol
i did. but the package did ignore them. i hat to use ' "300" ' as "300" would become 300... thank you.
yep
it was the quotes
yes
@long raft @pure sierra @barren quarry @void marlin
Oh, Minibar, such a nice guy. And 3SP... The best Crew ๐
I thought php is dead
@barren quarry looking at the way you write DB stuff in Node... trust me there is a reason for PHP Laravel ๐คฃ
@void marlin that code was written 1.5 years ago
when i knew almost nothing about javascript
i myself consider that code a pile of garbage
but there is really no competition
so for some reason some people like it
I like it as well. I will use the UI as part of my wardenHQ ๐
with a new backend.
dont be. people live it.
but maybe, how do i init the sqlite and what does the .env need? i think that is missing.
im proud of the UI ๐ฅ
for all the preppers out there with mechanical clocks the time has rolled back one hour if your area uses daylight savings time
Lol
My digital clock doesn't roll back an hour
time to get new clocks huh
daylight savings is a scam, fun fact
people actually die from daylight savings
the only reason we have it is because some rich guys a long time ago wanted to have more time to stroll outside during the day
i wish we didnt have it
it gives us something to do in the spring when the boss calls and says we're 1 hour late for work
i have oft considered moving to arizona or hawaii
PNW
Get lost in the rainforests
Off grid forest hut
Elon's satellite internet comes through and you've got 100mbps at decent ping
Plenty enough to live your life in the middle of nowhere and play foxhole, only seeing people when you journey out for the monthly resupply
no i just dont like changing clocks
satellite and decent ping don't fall into the same sentence
this is coming from someone who has used satellite internet since late 90s
low earth orbit is around 600ms latency, the companies will lie and tell you it's down to 300ms, and they can legally get away with lying, because, well, yeah, 300ms is for the signal going one direction
so yes you can ping the gateway at 300ms but if you want to actually ping anything other than the gateway in the sky, it will be 600ms
regular satellites out in high orbit are about 1000-1500ms latency
@fickle aurora in presentations to the FCC, which companies are under oath for, starlink has been tested at under 50ms latency to the internet.
As well, people who have been testing the service recently during the beta have been getting around that latency.
hmm... yeah let's see what I get on low earth orbit satellite...
I would be very surprised if starlink can actually beat that, likely the 50ms they are advertising is from cellular tower based mobile internet, not from satellite
if you really think you can get 50ms on satellite.. I have a moon to sell ya
it's just not possible
Starlink doesn't run their satellites in the normal geostationary orbits
They're way closer to earth
I know they use low earth orbit
340km above the surface
my satellite internet service aka xplornet recently switched us from regular orbit satellites to low earth orbit
the difference in ping was huge but not 50ms I can say that
Xplornet satellites sit in a band 35785km above the surface
Delivering faster Internet speeds and more data to rural Canadians WOODSTOCK, NB โ Rural Canadians are once again about to get a big boost in Internet speed and capacity, thanks to game-changing new investments in satellite Internet service by Xplornet Communications Inc. Xplo...
they resell the satellite service from other companies man they literally don't own the whole satellite
it used to be provided by hughesnet long ago I am not sure now
Starlink satellites sit 105 times closer to earth than the satellites you're using
It very much is yes
I said fight me
lol
No
So yeah, the reason Starlink has that low latency is because they're really really close to earth compared to other satellite providers.
yes that is called low earth orbit satellites aka what xplornet sells service from now
No.
someone needs to snap mr musk out of his delusions and tell him he needs to invest in a fiberglass internet company
the one you are quoting really far from earth is the old outdated system
in the past 15 years we had changed satellites 3 different times
the original one was 1500ms
From what you said, you're currently using Via Sat 2
Or maybe ViaSat 3, but they're both Geosync'd at 35K km
I would have to check on my account and see what it is hooked to now
the old modems were viasat modems but every time they switch satellites they have to change out the modem
the same internet provider has 4G LTE which probably has 50ms latency, but I can already get better unlimited internet plans from other cell providers
Xplornet currently operates Satellite Internet from 2 satellites, ViaSat 2 and EchoStar XIX
The Starlink Public Beta is HERE! Invitation emails are going out, packages are being shipped, specifications are OPEN. I cover all the details so far, including a few surprises!
References:
Ridgeline Mount Guide: https://github.com/mikeonspace/research/blob/master/Starlink/o...
prices/speeds etc in this
Both of those satellites sit in a Geosynchronous orbit at 35,786km above Earth's equator.
The reason most internet satellites aren't in LEO is that they don't have a large view of the planetary surface, so you need a lot of them.
what kind of transfer caps do they have?
Starlink?
none yet
yea
Haven't heard anything about any
$99/m
There probably will be some, because satellite gets fucky without transfer caps, but that's being partially mitigated with the fact that there's just a fuckton of satellites to send data at, so they can handle more incoming and outgoing data
ok I think you are right, they haven't actually moved over to low earth orbit yet
They won't
The only feasible way to run satellite internet in low earth orbit is through a constellation of microsats
well we already signed up for it but we were told it won't be active until next year
So unless they go to microsats, you'll never get consistent coverage from the LEO satellites
It'll be switching back and forth from the Geostat ones to the LEO ones
but at 600ms, gaming is nearly implausible, most websites that use jsnode end up failing to load due to timeout, lots of problems
Yep, that's the problem with satellite that Starlink is aiming to solve
I had to change MTU packet size long ago to make the old system work on websites
most people leave it at 1.5kb per packet
remember the old days where cable internet was download only and it was dial-up for the upload?
I remember that for one way satellite
then two-way satellite came out and there were 2 cables connected from modem to the dish
now it's one cable, I am guessing serial transfer
the mining company uses synchronous transfer, so upload and download are same speed on their satellite connection
the latency was absolutely terrible on that and in the evening everyone using the net to check email or whatever after work made it slow like a crawl
Starlink you just stick an ethernet cable into the ground terminal and it goes
interesting because every other satellite system uses coax connected to a modem
unless they are referring to plugging the ethernet cable into the modem
there will probably be lots of angry customers over starlink when they find out how bad satellite is
Doubt it
I can bet they will lock people into 10 year contracts like xplornet did long ago
now they can only do maximum 2 or 3 year contracts
As much as I hate saying "oh this is revolutionary", starlink is literally revolutionizing the entire system of satellite internet.
once people are locked into paying for it, musk isn't going to care, the money will cover the cost of the business end and as for quality of service, they will just give you a telephone number to some call center offshore
like every other internet provider does
then they will spend millions hiring people to comb through the internet for negative feedback and launch massive lawsuits to stop people from reviewing their bad service
Oops I forgot that this conversation was in code-talk rather than in general
ยฏ_(ใ)_/ยฏ
Yes the ping is decent, it's very close to earth, and closer to earth than say, the ISS. The lower the altitude, the smaller the distance between sat to sat, and receiver-to-receiver. 75ms falls far short of what hypothetical values say it could be, but when pricing in everything else, it's pretty damn good
It's also worth noting that consumer customers won't be the only ones using the network, but high value contracts are forming between financial trade hubs and stock markets to make use of those potential low pings if they can be put into practice
It's significant.
As for contracts and consumer support, eh
I think if I was trading stock every day I would just move to toronto and use fiber, I wouldn't rely on a connection that stops working every time a cloud passes over
Can't be worse than what already exists for rural customers
That's the thing, it's not day traders
It's AI
It's AIs that make trades based on millisecond differences between the different trading hubs
It's whole institutions, who can't move, already have operations, and already have those operations automated via the net
Line 10ish years ago a company literally laid a line of fiber optic between chicago and New York at the cost of 300 million plus for a 3 millisecond faster route
such absurdity
And they're making billions out of renting the use of that line, and even more off the trading margins.
I think what will enhance this the most will be 5G, because of more bandwith capability, but I am very skeptical on the actual latency
Starlink doesn't have to really worry about making a ton of money from residential consumers, because they can charge truly massive amounts of money from large corporations and traders to reduce their latency to the NYSE & CSE
According to FCC stats for initial testing, apparent max sat throughput per satellite is 20Gbps, with an initial total constellation size of 12'000 and plans for 30'000 on top of that
For residential consumers, it's going to be significant even if it's not as fast as the average in a city with fibre
Most US cities don't have good fiber
They won't care about it being great as long as it's better than rural cable
Yup.
i still find it funny how old people treat fiber optics as this new technology
the classes i took on the basics of fiber optics are themselves more than 10 years old
and yet even my professors talked about it like it's this revolutionary new technology
It's the gap between introduction and widespread implementation
yeah, that and recent technological improvements
the fiber optic itself is old shit but what you can do with it is getting a lot of attention
my first intern job was at a tiny company that only sold a device they bought the patent to, by making a fiber optic turn in a specific way you can increase the quality of the signal by a pretty significant margin
maybe i still have the video
Egh. Memories of optics classes still put me in a bad mood, and I just graduated this year
But yeah, some US towns have services that cap at 25Mbps for $145/month
Or worse for similar prices, with no alternatives
french?
yup
so i'll take a guess that it isn't the government that pays for fiber optic installations?
Depends on the government, depends on the area. Here in the UK, there are national projects, and county projects, from what I recall it's similar in the US but with more granularity for states/counties/etc
so i'll take a guess that it isn't the government that pays for fiber optic installations?
Dunno, might be the municipality
Nah, looks like it's commercial companies that do it
then that explains why they would deem some places not "worthy" of getting installations
Talking of which, I'm still mad that my apartment building still hasn't been connected to the city's fibre net
still get just shy of 10MB/s usually
in canada bell fiber is what most people try to get
i get like 50MB/s and i live in a suburb, shit sucks
At least it's not 450KB/s anymore. I remember downloading BF3 for a full day
bell can suck a dick
lol
price fixing assholes
shit man, 50MB/s is blazingly fast compared to 10MB/s
robbers is not much better
they're all bad
canadians pay the most out of literally any country in that stuff
for a while we paid about 150/mo for satellite
when you look at it all the companies in canada offer pretty much the same prices too, it's legal price fixing
price has gone down a lot
City's fibre network is 500Mbps
My building is only connected to old copper broadband
and it used to be 1mbps for that 150/mo
if there was an alternative it would have been used
there is an alternative, it's called the government stepping in
I was going to get shaw leased line for 450/mo but they were going to bill for the cost of putting lines in which was prohibitively expensive
but for that I could provide service to a few people
i don't know what's with canada and its monopolies but fuck is it annoying
US throws money at the telecom providers / ISPs to install fiber, they take the money then don't install fiber
at least you dont have to pay the highest rates in the world
I know disk but you are lucky if you are in a city
northern remote mines in canada don't have these luxuries unless you are willing to pay for it
For cable, the US pays more on average than Canada
who pays for cable though
but when you make the wage of a miner you can buy lots of things that city folks would cry over
Cable internet*
bruh miners make so much money
but you have to suffer the inconveniences of bad internet service
suffering bad internet for a few months then coming back rich? i'll take that
Just have some books and you'll be fine
got that california dystopia internet
that's slower than i thought california internet would be
odd numbers mean bad internet, right?
i grew up on dial up with ...350-400ms latency
why didnt you just buy a better internet like seriously smh
i got the 1gbps package at the office
christ that's fast
cant believe that tech actually exists now
could download a modern game in less than a minute
and just thinking about the fact that 5G is even usable with internet. maybe one day updates wont take fucking hours
doubt it
they'll make sure updates take a long time so they can force you to buy preferred connections
fuck it then i'll just go to china
in singapore 2gbps synchronous is like ... 75 sgd/mo lol
something ridiculous
when the internet cant keep up with you
10 gbps lan is now affordable option
Fumoffu! โค๏ธ
@neat fossil ๐บ 
@pure sierra ๐
Now that I have time on my hands, I should get back to trying to get the war api to work in unity
Does mapName change or is it pretty consistent from war to war?
where is this ?
To refrence the different hexes in api
map names dont change
one day i asked phil
why doesnt it have "hex" in the end? change pls
and he said that changing it would be really painful
also DeadLands ....
Thanks!
goddamn bro making states in HOI4 without the nudge editor is tedious
i been making states for nearly 2 hours and only have like four
i need to find a fix on github or something
its tough i know
Other languages:
*write to console*
Python:
p r i n t
no
echo
you don't realize how important it is to name your functions logically until you have to use somebody else's code that has random words used
@kind glacier what ya mean? Just use the anaconda compiler, then you don't even have to use print
You mean LCD_print_GPGGA_data(int message)
Not to be confused with the LCD_puts(char)
lol
But that feels like a specific command used for a display on a microcontroller or something
@coral sundial ya lego mindstorm freak
oh
no
well it is for an LCD display
but GPGGA is a nmea GPS data code
and the function just blurts that out on an LCD
well afcourse after I go over it and add some context xD
hmmmmm
did someone say lego mindstorms
ah those nice visual studio colors are so great
Ahahaha
I just went straight to an already existinf library
Couldnt be arsed and wanted to play with the usart
"back in the 70's you wrote your own libraries, you cant share them coz no net..." @fickle aurora ( @long raft
)
"real coders dont use libraries" - also @fickle aurora (tongue in cheek)
i imagine in his world real coders write 1000 lines a year
so hayden, people are complaining there is no faction neutral way of calculating storm cannons anymore
dunno if you are interested in adding a feature to foxholestats 
oh
its not really a stats thing, but its also not a logi thing so i didnt do it
its ... pretty easy
a simple placement overlay would do the trick i think
dunno if you have any thoughts.
or maybe sethfire would add it...
well it would seem it would fit in easier at sethfire, but ive from time to time considered integrating his map into my site as well
yeah that would be fine
i must admit my code is a little messy - ive got technical debt and it makes me not want to make new changes
nothing about node.js is ... enjoyable
So uhh, how do you tell from the API which map item is the Abandoned Ward townhall?
icontype 5 6 7
sort static data by pythagoras theorem
pick [0]
actually no the other way around
you get the point
you get the point
no I don't actually
you have static data
static data is the array of labels
you pick whatever label you want
get its coordinates
then you have dynamic data
you filter icontypes 5 6 7
which are town halls of three levels
So I need to match static with dynamic
you calculate the distance to each town hall using the pythagoras theorem with coordinate differences
and sort by ascending
distance from where?
from the text label to the town hall
now you've lost me completely
that's what I'm trying to figure out
here is your label
here is your dynamic data
you take every town hall
(and relic bases?)
town halls have icon type 5, 6, or 7
you find delta x and delta y
for every town hall
apply pythagoras theorem to find the distance
you know what pythagoras theorem is right?
Yeah, but so far this is making no sense
and when you find the distance to every town hall, you simply pick the town hall with the least distance
thats how everyone calculates what town hall is named what
They couldn't have just named them :/
@kind glacier do you understand the process?
tbh no
right now though, I'm trying to get the API working in the first place. I had it somehow figured out before but I lost the files.
From what I understand, I take the Abandoned Ward label, slap it onto a Hex picture of deadlands using the x and y coordinates and then throw on all the townhall icons and do the math to figure out which is closest to the label
but I gotta get the API data first to even attempt the rest
@kind glacier that depends on what you're trying to do, find what is abandoned ward or what is town hall
I'm trying find which is the abandoned ward townhall
right
right now I just want an icon to turn green or blue depending on who holds the townhall
trying to place all of the hexes into a big map and drawing all the icons onto them comes after
save yourself a square root, sort by distance squared, the results are the same
the coordinates dont match up - so you have to search the list for the closest one
wouldnt it be easy if the dynamic api matched the static api, or if they used some sort of unique ID
hah actually derp is right
I can't for the life of me figure out how I managed to do it before
Going to try more in the morning
I gotta find me an example cuz this is not working
hang on
They couldn't have just named them :/
@kind glacier![]()
![]()
![]()
@kind glacier
@barren quarry @long raft i just screenshot it so u cant just copy pasta and have to read it
๐
again, you dont need the sqrt, the results are the same. save the computation time
ok, but its not a time sensitive application
x < y => x^2 < y^2
you wouldnt just put +0 on all your if statements, right?
sorry, graphics programmer here, cant tolerate extra sqrts
looks like you have a bit of OCD
dude, its not a casio calculator
i grew up when they were expensive.
but if you took it out, it would work exactly the same
its a fair point, but maybe in the future you will want the actual distance
then you would calculate it once, at the end, instead of every iteration of the loop
you cant expect the compiler (lol php) to optimize a sqrt out. it might be smart enough to optimize a division out but not sqrt
like i said, i dont need the speed so its fine, but its a novel suggestion
its free real estate, hayden
in a free world
im being lenient. i can barely even tolerate an O(n^2) algorithm
so whats this +0 thing ?
a notation for an algorithm's complexity, big O notation
generally algorithms fall into a growth scheme thats known, like O(n) (linear time), or O(1) (constant time), O(n^2) (like an exponential time based on data size), O(n log n) or O(log n) are common optimized algorithms, and the worst case O(n!)
so if you were searching a list of size n, this algorithm would take O(n) time where O is the function that determines how long it takes
if you had m lookups, it would be O(n * m) which is generalized to O(n*n) -> O(n^2)
hahaha
its still an extra conditional statement, but at least it will be faster for me
alan seems more like a computer science 200 guy, algorithm complexity is more computer science 300
if you were to make a dictionary with cities - and you generated a key that was the latitude and longitude, but maybe you rounded it to 1 digit
that would be a primitive geohashing algorith, and you could find the nearest point in O(1) time
its not accurate tho, but it can be used to speed up that O(n) algorithm
theres like 50 towns tho so who cares
but i shit you not, C/c++ famously has slow memory allocations and they are often touted as being as slow as a square root
aaactually
there are like 10 major text labels per region
since we... well, dont include town halls from other regions when calculating which belongs to the label
the most i can find is 12 items
you cant have trouble with a 1x12 comparison
maybe in like 1919
or if it was actually in the game code when calculation optimisation matters
im being lenient. i can barely even tolerate an O(n^2) algorithm
Here, i just ran a
O( 45^(N)*9^(Nยฒ) )
Algorithm
wtf
With 6 it only took 1 minute. It is random so it could have been luck, tough
but then like 7 is gonna take 400x longer
Help me change faction in Foxhole a friend plays for the Wardens and I for the Colony help me play with him
Welp, managed to get the static info again
now I just need to get it into a format that I can actually read
no idea how I'm supposed to do that
it literally just comes back as
{"regionId":3,"scorchedVictoryTowns":0,"mapItems":[],"mapTextItems":[{"text":"Abandoned Ward","x":0.4065897,"y":0.4973474,"mapMarkerType":"Major"},{"text":"Biting Tarn","x":0.82187194,"y":0.70537686,"mapMarkerType":"Minor"} ...
Parse the whole thing as a string and split it by commas?
no need to split
the whole thing is a json response
just use JSON.parse() if you are a javascript peasant like me
not a javascript peasant
And from what I can tell it comes in as an array of objects
and that's after doing the .parse
Even just taking the first entry returns
{"text":"Abandoned Ward","x":0.4065897,"y":0.4973474,"mapMarkerType":"Major"}
as an object
Then youโve got an array of objects that all follow the same format? Though it appears to be a dictionary
Well I've got no clue on how to get a list or array out of it
A for each loop that cycles [โtextโ,โxโ,โyโ,โMapMarkerTypeโ] whichโll return abandoned ward, .406,.49, Major?
If you can get it into dictionary format, you can just call the index โtextโ and it should return the text
Is it a list or dictionary? The curly brackets I thought signified dictionary
Check your languageโs definition of dictionaries
It's all too much of a mystery to me
It may be the answer, the idea is that the key on the right of the colon is what you call, and the return is whateverโs on the right. Dictionaries then also cannot be changed, cannot be called by the right side, arenโt actually lists, and the key must always be a string. I am assuming itโs Java though, @kind glacier?
Then it should be similar.
if I knew how to make a dictionary
@kind glacier
var dict = new Dictionary<T1, T2>();?
It seems like we're talking about json serialization
That's how you make a new dictionary, but how do you make a dictionary out of the api info?
So
The API info is a JSON string (Javascript Standard Object Notation or something like that)
There is a couple ways to deserialize JSON objects
You can use Newtonsoft.Json (available as a nuget package)
Or use the built-in System.Text.Json package form .NET
last time I tried nuget I fucked my entire project
Then maybe try the built-in version
๐
now to figure out how that even works
If you'd want to do a call I could walk you through it lol
Though their documentation is pretty detailed
probably faster if I can read it somewhere
The ppl who make it are called newtonsoft json, and the product is called json.net i think
But I use those two names interchangeably xd
And if you're using System.Text.Json from Microsoft it's the link I sent earlier
Product product = new Product();
wth is "Product"
It's an example class
So replace that with whatever class you want to deserialize into
So if you have a JSON like this
"prop1": "hello",
"prop2": "bye"
}```
you want your class to look like this
public class NameOfTheClass
{
public String Prop1 { get; set; }
public String Prop2 { get; set; }
}```
and that will be the class you use instead of the example
like this then
You call the function to get text?
Now I'm confused
@kind glacier https://dotnetfiddle.net/dZyGz7
Foxhole WarApi example | Test your C# code online with .NET Fiddle code editor.
Smh
Not even using high level APIs to do the resource management for you
It's gonna take me a while to decipher that example
Take your time :)
C for this ? like Why.... Did you see the code iposted for you @kind glacier
@pure sierra I did, and it looks like the code for trying to figure out which townhall belongs where
From what I can tell it's supposed to be working
but isn't
its for assigning the static labels to dynamic items
I'm not even near that step yet
well u were talking about it with kastow b4
true, but I had to take a step back to even get the requested json into a format I can work with
php easy: $regions = json_decode($regions, true);
so again, why c?
ah thats a good example
have you started using nullable reference types yet, @vague otter?
Yes
Gave it a try
It's nice having nullable safety, though the implementation is too high-level to actually be a big thing
But gives you more compile-time goodies
.net 5 is properly using nullable reference types throughout the api now
the number of warnings in my code dropped by like half
so again, why c?
Because I'm not trying to make a website
What are you using to make your API calls?
how do you mean?
Well
You have to get the foxhole war data from somewhere, right?
What are you using to send requests to Clapfoot's API?
UnityWebRequest
I see
You're using Unity
What would you have me do, use UE4?
I like Unity. It's simple enough for what I want to do
Well
I didn't know what you were doing
Still don't
So I was just curious xD
that's okay
some just like to shit on unity and I don't really understand why
Even looking at the tutorials I was using, my webrequest checks out but still returns null
I've never used it so cant help you there >.<
this should return the json but it doesn't
Whats the url it calls?
weird
Only thing I can imagine is paralellism fuckery
But I don't know unity enough to give any insight
even the link directly doesn't work
so why unity ? what u makin
Foxhole HQ except 3d and clientside (until I can figure out how multiplayer works, anyway).
trying to
Had a whole talk and brainstorm about it in this channel a good 2 months ago
mostly wishful thinking
was i talking to you about the radio generals games
let's scroll up
it was back a few months
Yeah, it was in September
But now that I've actually finished my internship I have the time
i did buy the first one a played a fair bit of it
my first plan was to just have a gameobject turn green or blue depending on who holds the Abandoned Ward townhall
but now I can't even get the info from the API anymore
Can't really tell the two apart, but it seems like the result of the SendRequest
you're using this example?
IEnumerator GetText(string url, Action<string> result)
{
UnityWebRequest www = UnityWebRequest.Get(url);
yield return www.SendWebRequest();
if (www.isNetworkError || www.isHttpError)
{
Debug.Log(www.error);
if (result != null)
result(www.error);
}
else
{
Debug.Log(www.downloadHandler.data); // this log is returning the requested data.
if (result != null)
result(www.downloadHandler.text);
}
}
couldnt understand why its being yield returned instead of returned
like, its 1 url input, so there can only be one response output, right? why would it return an iterator of them
yield just means its an iterator no?
yea
i mean it means youre inside an iterator method
you can still use return in those if you return another iterator
err IEnumerable, not iterator
ok so my guess is that maybe you dont need to set the downloadHandler
Seems similar to me
string staticURL = BaseURL + "/worldconquest/maps/" + Mapname + "/static";
UnityWebRequest RequestStatic = UnityWebRequest.Get(staticURL);
RequestStatic.downloadHandler = new DownloadHandlerBuffer();
yield return RequestStatic.SendWebRequest();
if (RequestStatic.isNetworkError || RequestStatic.isHttpError)
{
Debug.Log(RequestStatic.error);
yield break;
}
JSONNode StaticInfo = JSON.Parse(RequestStatic.downloadHandler.text);
Debug.Log("2 " + StaticInfo);```
the debug only returns the 2
do you get anything in RequestStatic.downloadHandler.text?
do you get anything in RequestStatic.downloadHandler.text?
I used to
then I broke it
This yield stuff is too big brain for me
string staticURL = BaseURL + "/worldconquest/maps/" + Mapname + "/static";
UnityWebRequest RequestStatic = UnityWebRequest.Get(staticURL);
RequestStatic.SendWebRequest().Wait();
if (RequestStatic.isNetworkError || RequestStatic.isHttpError)
{
Debug.Log(RequestStatic.error);
yield break;
}
JSONNode StaticInfo = JSON.Parse(RequestStatic.downloadHandler.text);
Debug.Log("2 " + StaticInfo);
SendWebRequest returns an async operation - so you have to wait for it before you check downloadHandler.text
oh and I haven't seen any other example of someone setting the downloadHandler, I assume it's set already
ah it has to be async?
yes
it worked like this before
removing the downloadhandlerbuffer doesn't do anything either
oof there are nice ways to do this in c# 7.1 but not 6
.ContinueWith( ) is a really easy way of doing it
I mean
Do you get any error logs? Seems obvious but Im asking anyway
anyway it's ienumerable because it's returning tasks... it was hard to tell without the function header
lemme try dynamic
well you could try doing wait to see if thats causing your problem
null too
yah its kind of what i would expect
if the task hasnt run then its going to be empty
c# async and unity all at once huh? ooof thats a lot to figure out at once
When I followed this video tutorial it worked until it didn't
๐ Download the project files from this video: http://bit.ly/UnityAPIGet ๐
๐ฎ Let me know what other topics you want to learn about ๐ฎ
๐ See below for time stamps ๐
PokeAPI: https://pokeapi.co/
Download SimpleJSON.cs: http://wiki.unity3d.com/index.php/SimpleJSON
0:00 - Introduc...
I think this is how I'd write the async, but I'm not sure if it'd work because I don't have unity
protected static async Task<JSONNode> Query(string URL)
{
return new Task( async () => {
UnityWebRequest RequestStatic = UnityWebRequest.Get(URL);
await RequestStatic.SendWebRequest();
if (RequestStatic.isNetworkError || RequestStatic.isHttpError)
{
lock(Debug)
Debug.Log(RequestStatic.error);
return null;
}
lock(Debug)
Debug.Log("Response: " + RequestStatic.downloadHandler.text);
return JSON.Parse(RequestStatic.downloadHandler.text);
});
}
and on the outside:
var api_result = await Query(...);
is unity like async all over the place? I haven't used unity since before async was popular
oh uhh
i guess i need async before (), i changed the code. also made Debug thread safe
my async knowledge is purely academic
even when I copy a working example 1:1 it doesn't seem to want to work
yah those are the hardest things to debug
heh back to 0



