#code-talk

2 messages · Page 14 of 1

fickle aurora
#

what it does of course is allows you to allocate blocks of memory in bytes of your choosing in the form of an array, and then you can print the address ranges and check performance in task manager to see how much memory it uses while you perform various things

fickle aurora
#

it uses about 340-370k at the start, but you can see if I allocate 100 megabytes what happens in a minute

#

interestingly, windows thinks that 100MB is 98,000KB, the reason for this is that there are 1024 bytes in 1 MB, so I am only really allocating 100000000 / 1024 = 97,656kb

#

and then of course allocating another 1GB of memory on top of the 100MB of course shows a.exe using 1,074,000 KB

fickle aurora
#

just to note, this is a 32-bit application so Windows has placed a limit of 2GB of addressable memory address space so it will crash if you try to allocate too much

coral sundial
#

sounds like you have a bug to fix

fickle aurora
#

the problem is MinGW for windows, while it says it's 64 bit it only compiles for 32 bit and I don't feel like custom compiling GCC on windows

coral sundial
#

If(user input > maxmemory) userinput = maxmemory

coral sundial
#

What happens if i put in a negative value?

jovial lake
#

gives memory away

languid harness
#

free memory

#

I could always use some

summer bobcat
fickle aurora
#

negative value input into Test4.c would basically change to a positive, except that it wouldn't be the same number since it would be considered to be a binary complement with a sign flag attached to it, and the size_t variable of malloc() would try to force it into a positive number by changing the sign flag, but that would result in a completely different number because it would be a complementary number in binary

#

yes that is complement not compliment, as in, for example the complement of 010 is 101

#

so let's say you entered -1000, that would be 1111101000 in binary.. the complement of that is 0000010111 which is 23, so you would only allocate 23 bytes of memory by asking for -1000 bytes

#

In a computer processor the negative flag or sign flag is a single bit in a system status (flag) register used to indicate whether the result of the last mathematical operation produced a value in which the most significant bit (the left most bit) was set. In a two's complemen...

#

wikipedia calls it the negative flag, but everyone else that I know and read about in every single textbook I have ever read calls it the sign flag, even programming languages call it the sign flag.. so yeah this is wikipedia's new made up word, not sure why they want to change the terminology, but at least they did acknowledge that their "negative flag" is also referred to as a "sign flag" ... why change the terminology when you don't have to...

lunar cobalt
#

Increased saturation and added edge lines to the heightmap which Matt posted a while back. (Really late reply to that conversation)

pure sierra
#

@lunar cobalt wow, @neat fossil was bluffing, release all the datas !!

pure sierra
#

in other news i found this cool map of web based HF radio tuners around teh world you can use to HAM it up 🙂

jovial lake
#

is there a foxhole api :thonk:

neat fossil
#

Nice! icanari. But because you had to exaggerate the contrast (like I had mentioned, if you change the heightmap, you're effectively changing the terrain) it now looks like a river valley between two cliff faces. Instead of rolling hills and farmland.

This is what I was talking about.

languid harness
#

@jovial lake pinned messages

jovial lake
#

ooh ty

lunar cobalt
#

I mean, I don't think it really changes it too much. I changed it so there is a visible difference between the layers, but for a topographical map you just have to find the height difference between the different layers, and I'm guessing it's around 2m per line. The point of it isn't to act as a heightmap in another game, in which case saturating it would change the terrain, but for a topographical map it just makes the higher areas actually visible to the eye easier.

vague otter
#

Why not just have the height lines, like on every map ever?

long raft
#

maybe deadlands is just a big river valley between two cliff faces

#

reality on reality's terms 😉

languid harness
#

The issue tho is that the rocks are not included, so they give only half the image as some important 'hills' are missing on the map

pure sierra
#

@long raft i thought this is what it proved, live the earth being flat

lunar cobalt
#

@vague otter because of how I grabbed it and I was being lazy

#

Just as a thing: I saturated it after separating the layers so the lines are the same as the height thy should be in-game, just more visible.

jovial lake
#

the API gives an internal server error :thonk:

#

o wait no im just bad

#

idk

#

all i get is <html><head><title>Error</title></head><body>Not Found</body></html>

#

oh wait

#

nagh

#

im just bad

pure sierra
#

if you have trouble post link u r trying to load

kind glacier
#

I had a stronk reading that sentence but I figured it out eventually

barren quarry
#

this is the graph of data usage

#

the gray area is incoming data

#

the dip at the end is resistance

#

really makes you think

kind glacier
#

I stopped playing resistance after the first time

severe jewel
#

holy fuck

steel thistle
#

this is not to talk about foxhole code?
But what code is it to talk about?

long raft
#

the warrior code

#

the code of conduct

pure sierra
#

@steel thistle morse code

steel thistle
#

._.

#

also is foxhole open to code now?

languid harness
#

Nope, but there is an API in the pinned messages

#

This channel exists for similar reasons as #art-discussion; helping members of the community get better at their craft to (often) create something for the community

pure sierra
#

vaulting out of trench 's particularly the connectors is totally broken at the moment @neat fossil

summer bobcat
#

you... you pinged Matt of all people?

kind glacier
#

rip

lunar cobalt
#

@pure sierra I am sorry in advance for your loss.

languid harness
#

F

verbal crescent
#

F

jovial lake
#

RIP brackeys

languid harness
#

Anyhow, I made like, a discord bot in python, and it looks way sleeker than the original I made like over a year ago

#

Gonna test it if it works on my raspberry, because that would be hella swagger

#

Fuck, I forgot the log in of my raspberry oof

#

welp, time to reinstal raspbian

languid harness
#

jesus, I forgot how long it takes to configure python 3 on a rasp zero

#

it has been half an hour

barren quarry
#

doesnt python 3 take like 3.8 gb

languid harness
#

perhaps

#

its unpackiging the download and installing everything

#

which takes forever because, in case you dont know, a Zero is the closest you can come to a potato

#

he is still installing stuff

languid harness
#

hmmmm, verification takes long, but the load avg are about 1.05 with only a few exceptions

long raft
#

you can use linux uhh .. emergency mode? to reset the password

#

much easier than reinstalling

#

i wonder if you need root to do that. shouldnt, but ... maybe

languid harness
#

welp, too late hahahaha

#

it has been 1.5 year since I had set that password

#

and all things stored on it were not needed

languid harness
#

I took 1.38 hours to test all fucking install bull, and now he si doing other stuff??? what a madness

languid harness
#

ugh, it has been nearly 5 hours, and it is still not done....

#

welp, time to shut off the monitor and go to bed, I'll continue in the mornign

#

I swear it didn't take this long previous time

languid harness
#

Oh my! It just finsihed!

long raft
languid harness
#

For anyone wondering: sudo make -j 4 took a total of 5 hours and 20ish minutes to run on my Raspberry Pi Zero W

#

Oh wow, that is surprisingly easy to get into actually @long raft

#

I might need to consider locking my files additionally 🤔

#

Or perhaps encrypting my data better if I port them to the raspberry

long raft
#

uhh

#

if you have physical access to a computer you ... can do whatever you want

#

you would need some sort of secondary boot prompt that asks for a password and decrypts, or a TPM chip with encryption

#

yea, windows is the same. very easy to reset the admin password or get any files you want if you have physical access

languid harness
#

Fair point, you need physical access to do this, I read over that

#

anyhow, I just finished the instalments

#

my rasp is now running Python 3.8.5 😎

#

I'll worry about logging into my github account tomorrow

languid harness
#

Yes! Its alive! It works! Mhuhahahahaha!

#

I am unstoppable

pure sierra
#

also my host has been having big downtime today

#

@long raft @barren quarry

barren quarry
#

the black line is the pop data

#

so my server is not blacklisted it seems

#

i think

pure sierra
#

its not even just my server ip, its all the 3 vps plans i have with this host

#

im setting up a php script on a thrid party host site i manage to scrape the numbers

barren quarry
#

how often do you ping steam

pure sierra
#

every minute

barren quarry
#

my timer is on 10 minutes

#

i dont even think pop updates that often

pure sierra
#

the thing is its not just th fhs site, so likely its some kind of wide ddos block rule by either end

barren quarry
#

can you even access this link

pure sierra
#

like i said my host has had complete black outs today, so maybe ddos mitigation

#

i can from home

#

yes

#

ive set up a script on a third party host i manage that is not blocked, so fhs can curl it which curls steam

barren quarry
#

nice

pure sierra
#

then i just curl it from fhs

#

@barren quarry can you access fhs ??

long raft
#

I don't have a server for my projects

barren quarry
#

@pure sierra whats fhs

pure sierra
#

foxholestats

barren quarry
#

yeah i can

pure sierra
#

its been my host, seems to be getting better now finally

pure sierra
#

out of interest here is the websites monthly bandwidth usage, getting up towards 500GB / month ...

long raft
#

thats a hell of a lot

#

you gonna work to reduce the footprint?

pure sierra
#

nah, i believe its an unlimited plan, and im not sure i could reduce it that much any way

long raft
#

offload the media

#

heh put the static images on github or something shrug

pure sierra
#

the control map is about 40kb and it updates every few minutes

#

and is loaded by anyone with the tab open

#

currently about 300 people/connections apparently

long raft
#

still hostable by github, but ya thats pretty intense

pure sierra
#

id have to push it every map change update,

#

but i dont care, its cool to have a website that uses data

#

as its plentiful these days

#

the way to make it less with the map, would be to make it html5 canvas, so only transfer data points, but i cant be hassled with that

long raft
#

is it png? i found webp to be pretty nice as an alternative, ya know if you cut the major resource by half itd be a big dent in the overall traffic

pure sierra
#

yes png

long raft
#

maybe it was icanari who suggested it to me...

#

webp is ya know basically jpeg with transparency

#

well no thats not fair, i assume its ... vp8 or vp9 codec

#

but functionally its lossy and has transparency

#

or it can be lossy if you want that

barren quarry
#

...what exactly do you send to people on map update

pure sierra
barren quarry
#

You send people images?

#

Jesus christ

pure sierra
#

yeah, its call a png !

#

its like jpeg but it supports transparency hbwow

long raft
#

same quality as png

pure sierra
#

something to consider

languid harness
#

Lol

fickle aurora
#

why not use GIF if you are worried about data usage, it will be much lower quality but also a tiny fraction of the file size

#

JPEG is compressed but also proprietary which is what scares the Linux people away, but that is another option besides PNG

pure sierra
#

im not worried about data

fickle aurora
#

well GIF also supports transparency, I think it was one of the first formats that did

pure sierra
#

i know

long raft
#

linux people are scared of jpeg? what? its so old

#

theres open source libraries that are decades old and theres no threat of lawsuit

fickle aurora
#

you might be able to write a script or something to make use of pngcrush to reduce the file sizes, that should help reduce bandwidth usage overall

long raft
#

you will sacrifice quality and you wont achieve webp size

fickle aurora
#

might be able to overlay an image over top of a static map, where the overlaying image is mostly transparent with only the dynamically changing data and the map underneath would be static/cached on each computer

#

that could be done by taking a static clean map and using something like diff to compare that to a current map to find all the dynamic data

#

so then you are only transferring the dynamically changing data to the client

pure sierra
#

@fickle aurora thats what i already do

#

(2 layers, map and control)

fickle aurora
#

foxhole runs ungodly fast on a ramdisk

pure sierra
#

@long raft

long raft
#

yea?

pure sierra
#

i tried website viewers, and now whats above

long raft
#

it's sessions, right?

#

like if i had two chrome tabs open itd just show up like 1, right?

pure sierra
#

its a number the live update server spits out, so it theoretically the number of open sse connections that are open

long raft
#

oh

pure sierra
#

i think multi tabs would add up

long raft
#

website viewers seemed good to me

pure sierra
#

as said, i started with viewers, but that kind of implies they are looking at the site, but it might be a background tab...

long raft
#

i mean unless you uhh grouped them by ip address ...

#

a session would be shared, but other than that I cant think of a way to uniquely identify someone

pure sierra
#

so im not so concerned about uniquely identifying them

#

almost like just saying "open connections"

#

but i dont think peeps would get that

jovial lake
#

i created a discord bot with ads :evil:

pure sierra
#

where u getting ur ads from ?

long raft
#

"Tabs"

pure sierra
#

tabs open ?

long raft
#

Yea, feels clunky but it would convey the meaning

#

this is too cutting edge UI design for me, hayden

pure sierra
#

its the kind of thing a ux team would dilliberate over for weeks

jovial lake
#

currently i don't get ads from any where, but i did try to pull them from Google Ad sense

barren quarry
#

ads on a discord bot is like a sticker on your back saying "remove me please"

jovial lake
#

well its not really public more a fun project

#

don't feel like hacing to talk to ODM's ever

undone bear
#

There's plenty of websites that will provide a unique visitor count. depending on how your website is coded you would do it by IP.

#

Which essentially is connections. Depending on how much control you have over your web service, which seems like you have a few

long raft
#

doing it by IP undercounts unique viewers, doing it by connection count overcounts it; a session counter would be the closest thing, but still not perfect because a session isnt shared between browsers on the same computer or private browsing tabs - and sessions include overhead

barren quarry
#

Just count socket clients

long raft
#

so if i open 2 tabs im being counted twice

#

could use fingerprint.js to get a unique machine id, and count those

#

or ip + computer name combination

#

unlikely to have the same computer name as another machine on your local network

barren quarry
#

I'm not sure javascript has access to the machine name

#

Am I retarded?

long raft
#

perhaps something useful in the user agent then

barren quarry
#

I probably just said something retarded

#

Either way

#

This task is not worthy of overengineering

long raft
#

it might be easier to count unique viewers than come up with alternative wording for "viewers" to explain exactly what it really is

#

just look at how enlistments gets used

barren quarry
#

"People currently on the website"

long raft
#

but its not - its tabs currently on the website

pure sierra
#

its not that im concerned with discerning with the count or description that it could be multiple for one person, more that the number doesnt imply that many people sitting there watching the website or interacting with it , and that it could just be an idle computer background tab

fickle aurora
#

the thing is HTTP does not always keep connection alive, most will be in TIME_WAIT state

#

unless you are streaming data to the client

#

your best plan of action might just be to automatically create sessions for users based on IP and have them time out those sessions if they have not clicked a link in a certain length of time, and then you can just count the number of active sessions

#

the most popular way to do that is through SQL server commands but you could just parse a simple text file as well

#

for something simple like this you probably don't even need to design a login system

fickle aurora
#

might be a good resource if you want to check the return value of socket status

long raft
#

its a websocket, surely

#

not a berkley socket

fickle aurora
#

yeah I don't know if you can return the value of the client connection status

#

but you can be assured TCP has not changed much since 1984, the return values are pretty much all there as they were

#

if TCP was updated like windows was every few weeks, it would be impossible to have a functioning internet

long raft
#

it's a different socket type

#

it's not even reliant on tcp/ip

fickle aurora
#

it is 100% tcp, there are just 2 main protocols; TCP and UDP, but the vast majority of things use TCP

#

this whole "websockets" thing is not on the same layer

#

websocket is literally on application layer in networking, TCP/UDP are on a lower layer

jovial lake
#

wait

#

this channel is active

#

pog pog pog

fickle aurora
#

when you load a webpage, you basically go through that entire diagram all in just a few seconds

#

the final result is TIME_WAIT and eventually the socket will close

#

you can verify this by going to command prompt and typing netstat -a

#

if you type netstat -a in command prompt, you will see all the TCP and UDP connections from your computer, some will be to websites, one or two for discord, etc

#

the diagram I took a photo of and posted above will disseminate the information listed under the "State" column of netstat command

#

however, this is the problem with web pages is that the socket never stays alive, unless you are streaming notifications/push data to the client with node.js or something like that

#

if you are confused about those things that show [::] in netstat, it is unicast in ipv6

long raft
#

you should look up what websockets are

#

we are not talking about berkley sockets

fickle aurora
#

windows seemed to have followed using brackets around ipv6 addresses ever since windows 95 when ipv6 could be added through an update

#

yes websockets have not replaced tcp if that is what you think

long raft
#

i dont think that, and i didnt say that

fickle aurora
#

I get my information from textbooks as much as possible because the internet is still largely filled with misinformation

long raft
#

It's weird to think windows 95 would have supported ipv6 considering it wasn't invented until 98, you have a citation on this?

fickle aurora
#

I am the citation, I used ipv6 in windows 95

long raft
#

Lol

#

Sure you did

fickle aurora
#

and it was around much longer than 1998

#

yes there was a way to implement ipv6 using hurricane electric's tunnel because most ISPs did not support ipv6 natively

long raft
#

yea like in 2005

fickle aurora
#

HE was around a lot earlier than that

long raft
#

theyre an ISP, of course. but they werent offering ipv6 tunnels in 1995

#

Ah well check that out: Sometime in 1998 Microsoft Research releases its first trial version IPv6 protocol stack, which can be installed on Windows 95 or Windows 98 to provide limited IPv6 support.

fickle aurora
#

I see you are just skimming information off wikipedia to use to argue with people, when in fact you don't really do proper research

long raft
#

Please don't lecture me on research

fickle aurora
#

yes but you could use ipv6 on other systems before 1998

long raft
#

You make up stuff all the time

#

Well they did not release that code before 1998, but ok

fickle aurora
#

yes hurricane electric had the code originally

long raft
#

It did work on windows 95, you were right. I thought it might be a scenario like that so I asked for a citation

#

You think hurricane electric was using windows servers for their tunnels? I doubt that

#

Surely microsoft wasn't the first ipv6 stack. There must have been earlier ones on Unix

fickle aurora
#

no they had the code for people to get ipv6 connectivity on windows 95

#

microsoft didnt have it until later

long raft
#

god damn, ya know, maybe they were

fickle aurora
#

afaik hurricane electric was one of the biggest contributors to ipv6 development

long raft
#

that's pretty early to adopt a draft, microsoft was crazy cutting edge to put that into a consumer OS like windows 98

#

anyway, I don't care about ipv6

#

we were just talking about how to uniquely count viewers using a websocket

fickle aurora
#

yes you could do it with a tcp socket check but like I said the flaw in that is most tcp connections are always waiting

#

the best way would be probably create a temporary session for every IP that retrieves a web page and then have a timeout check run every time a page is accessed to remove sessions that are more than a defined number of minutes old

#

then simply count the number of sessions

long raft
#

I thought so too. But it's not perfect

pure sierra
#

my site uses 'server sent events' for live updates

long raft
#

what is that?

pure sierra
fickle aurora
#

well if you designed an admin portal for it, it may be useful to you to list stuff like the TCP states that are stuck on SYN for example, because robots/scripts online often use SYN/ACK attacks where they request a webpage but then they ignore the rest of the data, then send another request, ignore the rest of the data and continue like this in a loop

long raft
fickle aurora
#

sometimes it is not bots but it can be people with bad internet connections

#

if you are already using mitigation like cloudflare then it is probably not a problem

#

and this is also why satellite internet sucks so much

#

half of the websites on the internet think your computer is a bot when you connect on satellite from a remote area

long raft
#

why would bots use such an expensive network?

fickle aurora
#

bots usually use top of the line data centers but they act as if they can't fully load a webpage, because that is essentially how the attack works

pure sierra
#

@long raft i got it

fickle aurora
#

satellite has a latency problem which is why SYN/ACK in the tcp handshake has such a big lag on satellite

#

the server technically sends both an ACK for the first part of the handshake and in the same packet it also sends a SYN to check the client for a response

#

at the beginning when you request a web page your client sends a SYN

long raft
#

@pure sierra what did you get?

pure sierra
#

your point

long raft
#

i dont even know which one you mean

pure sierra
#

about bots not using sat

fickle aurora
long raft
#

oh

fickle aurora
#

there I hope it is easier to see

#

generally web pages load pretty fast, after they are done loading, there is no longer an open connection which means another client can connect

#

of course, scale this up to see the effect

#

on satellite internet (not bots, just poor blokes in northern canada) the 2 second latency of having a signal travel millions of miles from earth to space and back, and going through various routers, the latency makes your connection stay open for a long time, and some things such as cloudflare think that your computer is a bot because it detects a non-response from the server's SYNACK packet

long raft
#

its not millions of miles

#

hundreds of miles

fickle aurora
#

that is an exaggeration, but yes

#

if you happen to be someone in demand for the big bucks at mines in northern canada working on expensive systems, you will get to see just how latency is a real problem when you have to live there

#

thankfully there is going to be low to earth systems now, which the latency has gone down to about 600ms for a one way trip packet

#

I think SpaceX is advertising even better latencies, but I am skeptical on that

fickle aurora
#

so anyway if you want to work with socket programming, I would recommend something like ISBN #9780134900124 or maybe a newer edition - that is the one I use and if you go through all the examples, you can make your own server/client programs on a shell account somewhere with gcc access

pure sierra
#

i content using libraries that give me what i need, no need to reinvent the wheel when ur sot getting paid by the hour

long raft
#

can always just check your web server logs to see if its an attack

barren quarry
#

@pure sierra how often do you check map for events

pure sierra
#

i check api every minute

barren quarry
#

And what buildings do you check

pure sierra
#

just checking

barren quarry
#

I got a log saying that a bunch of buildings were destroyed at port of rime

#

But no logs of rebuilding them

#

Even though the buildings are now warden

#

Strange af

pure sierra
#

i think for events i log anything that icon/building changes

barren quarry
#

Okay I see a bunch of stray events in your shackled chasm log

#

Its probably the same issue

pure sierra
#

how often u check ?

barren quarry
#

Every 3 seconds with etags

#

I got live users so I need to send callbacks immediately with sockets

pure sierra
#

well maybe it was something quick, maybe by mods, or server restart, and i missed it

#

cron min 1 minute, thats enough

barren quarry
#

Map updates cost me 210gb bandwidth usage monthly

#

And that's just server-api

pure sierra
#

? just querying the api ?

barren quarry
#

Yes

pure sierra
#

likely thats where a bunch of my data is going too

#

500gb

#

seems like a lot for just text

barren quarry
#

One dynamic endpoint is like 4kb of json

long raft
#

every 3 seconds? wow thats high

#

do the api servers support gzip/deflate/brotli?

barren quarry
#

I should probably change to 5

#

No idea

long raft
#

because you might need to specifically request the gzipped version in your query

#

it would reduce data by like 2/3

#

i mean when theres an actual update

#

so like an http request header can include the compression formats youre willing to accept, and usually gzip is supported

pure sierra
#

i doubt it

long raft
#

the http header "Accept-Encoding: gzip,deflate"

#

i just think theres a possibility it might work because the web server supports it shrug

#

in fact i should do that for logiwaze

#

oh evidently its automatic for ajax calls

pure sierra
#

we dont use ajax, but me curl

#

can u tell if it works ?

long raft
#

sure I can try to test it

pure sierra
#

so on logi waze it says request
Accept-Encoding
gzip, deflate, br

long raft
#

yah the browser adds that

#

probably not brotli tho heh

pure sierra
#

but its not in the response header so im guessing no ?

long raft
pure sierra
#

see geegle says this

#

so im guessing u are requesting it but its not returning it

long raft
#

oh shit. i guess their web server uses brotli?

#

i would probably only use gzip, brotli is cpu intensive

#

it should be in the response if it works tho

pure sierra
long raft
#

brotli compression is amazing

#

but even gzip will get you like 2/3 reduced size for almost free

pure sierra
#

their api may not even be a web server as such, and a dedicated script

long raft
#

yah

#

but if you query it in the browser and it says the response has that, then it should be working

#

do you have an API url handy?

long raft
#

Doesn't look like it uses gzip when requested: curl -H "Accept-Encoding: gzip" -I https://war-service-live.foxhol eservices.com/api/worldconquest/maps/GreatMarchHex/dynamic/public?json=

#
date: Wed, 23 Sep 2020 02:56:01 GMT
content-type: application/json
content-length: 4673
etag: "5"
cache-control: no-transform, max-age=3```
#

sure makes me wonder what web server has http2 support but doesnt honor compression requests

pure sierra
#

gzip isnt on by default generally

long raft
#

You know, I'm not sure I'm running the curl command properly to even check

#

I can't get any site to do it...

pure sierra
#

it dosnt matter as you rajax requests request it but its not returned

long raft
#

in curl tho

#

ok finally found a site that does it, i guess the command works, and the api server doesnt support gzip

pure sierra
#

i know its just a homebrew webserver script as the 404 page is this

long raft
#

homebrew with http/2??

pure sierra
#

where u gett'ng hhtp2 from ?

long raft
#

its in the http response

#

HTTP/2 200

#

That's pretty cutting edge for something homebrew

#

ok so I guess ... nevermind to that whole idea

pure sierra
long raft
#

oh ok

fickle aurora
#

you can probably save bandwidth by not using SSL in retrieving the data

pure sierra
#

it would be quicker too

#

but likely aws just come with it by default

fickle aurora
#

but does the foxhole server API support regular HTTP?

long raft
#

im sure

fickle aurora
#

what is aws? just a framework?

long raft
#

amazon web services

summer bobcat
#

lol

pure sierra
#

look it up in one of ur text books

fickle aurora
#

last time I did high level stuff was just when phpnuke died

long raft
#

phpnuke ... what is that ... why is that familiar

summer bobcat
#

sorry for the chuckle, seeing aws being compared to a framework had me dying, especially when my intenship uses aws for almost everything

fickle aurora
#

I gave up on that whole field in 2008

long raft
#

whenever im using aws all i hear is a cash register making the chaching sound with every key i press

summer bobcat
#

also very true

#

watch those metrics 👀

fickle aurora
#

yea, I am doing electronics not computer sci that's why I work with C and not python or whatever else people use now

long raft
#

just wait until the pricing calculator has a use fee on it too

pure sierra
#

lol

long raft
#

outside of s3 and route53, i dont see much value in aws for small businesses

#

somehow my bill went to like 500+ usd/month and my servers arent even good

fickle aurora
#

I don't get it, I mean, how is it any different from just buying a dedicated server and installing freebsd on it?

summer bobcat
#

bc everything in aws is connected with each other

pure sierra
#

and scalaeb

fickle aurora
#

I wouldn't trust a system like that

pure sierra
#

scalable and distributable

fickle aurora
#

I hate cloud stuff

long raft
#

because youd build a software infrastructure that starts and stops servers based on demand, @fickle aurora, or other huge IT infrastructure automations

#

its hella reliable, but its hella pricey

#

you really have to optimize your stuff because at those scales it makes a big difference in price

summer bobcat
#

is it better than the old way of doing it though

pure sierra
#

ive been wondering if im better of using them instead of my vps accounts

long raft
#

when you lease the hardware or own it, you dont feel bad about wasting it, but with cloud shit you just cannot waste

fickle aurora
#

probably better off with vps, install freebsd or whatever, maybe gentoo and then write your own php code from scratch

#

the less bloatware the better

pure sierra
#

life is too short to write everything from scratch, thats what libs are for

long raft
#

life is too short to use a backhoe to clean your toenails. thats using aws for small projects

fickle aurora
#

proprietary requires making all your own stuff

long raft
#

i do love S3 tho. s3 is hella great, decent pricing

fickle aurora
#

I can see the benefits of open source though

pure sierra
#

i use s3 for offsite backups and email for lists

#

open source can be used in proprietry

long raft
#

oh right their email service is solid too

pure sierra
#

u just have to say u used it

long raft
#

i actually like their DNS service as well, although lacking some features and the pricing can get expensive

fickle aurora
#

well I was referring to GPL

long raft
#

depends on the license. MIT you have to say you used it and preserve the license, other licenses are far more restrictive

#

i dont even consider agpl open source. its more like shared source.

#

im working on a project now that uses LGPL3 and god damn its delicate not to cross the line and violate the license

pure sierra
#

@barren quarry there's really not much thats needs that kind of frequent checking

fickle aurora
#

even in the IRC days the dev teams were writing all their own libraries when there were so many freely available, and they still released it under GPL

long raft
#

for irc?

#

or just like 20 years ago?

fickle aurora
#

yes I guess it was close to 20 years

pure sierra
#

longer

#

waaaay longer

long raft
#

decades ago people were more willing to rewrite a library because it was easier - they did less stuff

#

its much harder to properly implement something modern

fickle aurora
#

I am thinking of the unrealircd project where the team literally rewrote IRC to port it from C to C++ and redid a lot of the libs

long raft
#

ah there were many attempts to make irc servers in C++

#

i think nefarius still kinda rules the irc world, no?

fickle aurora
#

I think christian, forgot his last name, was using the whole project for his university thesis

long raft
#

theres like 2 big ones left

#

couple more years there will be more irc daemons than irc networks

fickle aurora
#

depends on who the targeted audience will continue to be

long raft
#

theres no audience left

pure sierra
#

irc died years ago

long raft
#

gamers and programmers went to discord, businesses went to slack

fickle aurora
#

it really hasn't died in the programming world

long raft
#

compared to what it was - its dead

fickle aurora
#

yes for the most part I agree with that

long raft
#

freenode still active, but how relevant is it

#

the discord communities have replaced them like ... overnight

pure sierra
#

theres millions of ghost projects like that

#

have u heard of freenet ?

fickle aurora
#

it has been so long ago

long raft
#

i dont think ive heard of it

fickle aurora
#

when I started playing WoW I literally shut my server down and stopped programming projects entirely

#

that was probably 2005-2006

long raft
#

glad i never got sucked into that game

fickle aurora
#

but I also changed my focus from programming to electronics because I realized too many people were going into the field and of course it was being offshored even back then

#

I was the only one in my electronics class who knew how to make any program at all, and the only programming I ever had to really do was I made a custom UI in Delta V Operate software for the Delta V DCS, which hilariously used VB 6 macros

long raft
#

software was being offshored??
so you went into electronics?

#

have you seen the data since?

fickle aurora
#

my instructor said I would never hope to get into UI design until I finished my degree and got 10+ years of experience

long raft
#

hmm i dont know any ui/ux designers

fickle aurora
#

yeah I have seen the data.. everything is offshored, even electronics - but there's far less offshored because electronics is much more difficult

long raft
#

i dont know if software engineering is being offshored, but its definitely growing in about every country

#

i think a lot of electronics are done in china malaysia and japan

#

i dont think its accurate to say the labor in those countries is cheaper because theyre not as smart and cant do more difficult things

fickle aurora
#

my class was full of meatheads literally, these guys had such a hard time with digital logic and I could never understand why we were using logic gates when we could simply just use a microcontroller with a simple C program uploaded to it

long raft
#

i think electronics, of all things, dont have much cultural context (like speaking english) so its easier to sell those products internationally

#

just pointing out that china can also do difficult work

fickle aurora
#

yeah the thing is with electronics, it's mostly digital now, a lot of the digital logic that the courses have is literally outdated in a way because everything is done with C

long raft
#

what theyre not great at is iterating with an english speaking customer to design software

#

ya know i think thats why india is growing in software so fast

fickle aurora
#

the irony is that there is very little definition of digital vs analog - we were taught digital is like DC pulses, and analog is sine wave, but you know, an awful lot of digital data is sent on sine waves especially in RF modulation (wireless)

#

you can transfer a heck of a lot more data more efficiently using analog instead of digital

long raft
#

you cannot compress analog losslessly like digital

#

or selective loss

#

this is how the us saved tons of bandwidth on television broadcasts

fickle aurora
#

the thing is digital has latency, analog does not

long raft
#

im not sure thats a problem for most use cases, the latency is low

fickle aurora
#

even ADC does not cause latency, but converting it to serial data introduces latency

#

the whole idea with wireless is that you can manipulate the sine wave to create real numbers instead of just 0 or 1, so you effectively transfer bytes instead of bits

long raft
#

i would assume that requires more precise ADC and more bandwidth use (like for radio waves). theres always tradeoffs, right?

fickle aurora
#

yes

#

I had to build on my knowledge outside college though, we never did RF in college and I am not willing to fork over millions for the degree, so I basically self taught that stuff, and one of the most valuable things to me is university booklists, those are like gold for me

#

couldn't care less for a degree if I can whip up my own proprietary hardware product and get it to market

#

I spent my time driving class A and spending my off time reading and buying electronic components to build random circuits

long raft
#

ive got an idea, and ive never seen it done, and i cant imagine why not

#

its right up your alley maybe, tell me what you think...

#

say you live in an apartment, and you want to put a lamp on a different wall socket, but you cant really mess with the apartment wiring

fickle aurora
#

the most exciting thing is making oscillator tank circuits that can be used to set a frequency, then you just modulate that frequency to transmit data

long raft
#

i would like a device that i plug into the wall socket connected to the light switch, and i plug another radio connected device into a different socket, and they become linked

fickle aurora
#

yes you can get around much of the laws by keeping your projects under 30 volts and make them battery operated

long raft
#

so when i turn on the power at the switch, the connected socket recognizes activity, and transmits to the other socket to complete the circuit

#

if i could buy this, i would buy so many.

#

you can buy a wireless light switch. yes. but many people dont even know how to turn their circuit breaker switches off

fickle aurora
#

you have to get into the extra low voltage classification, but there's still other things such as RF is regulated by industry canada, but you are exempt if you are more than 10km from an airport and are doing lab work

long raft
#

but you know the lame part about making anything is im sure this is already patented, even tho whoever patented it isnt making or selling them

#

anyway, is there some reason this doesnt exist? some electronic problem im not seeing?

fickle aurora
#

yeah anything that plugs in the wall requires certification and anything that does RF modulation requires extra certification

long raft
#

i buy plenty of wall socket devices, they all manage to get certified.

#

certification cant be the reason this doesnt exist

fickle aurora
#

you can get away with USB though, but you have to use a microcontroller to request more than 5 volts

long raft
#

if you have a good idea and a working prototype i cant imagine its that hard to get certified

fickle aurora
#

200 ohms resistance across the data pins tells any device that your device is a charger, if you are making like a battery bank for a cell phone

#

but it also just registers it for 5 volts

#

for the advanced charging, lets say you want to provide 12 volts to charge a samsung phone or something, you need to send signals on the data line instead of just a 200 ohm termination

long raft
#

no no, i want it to power a wall socket

#

youre talking about usb and phones now

fickle aurora
#

otherwise if you do not use the 200 ohm resistor, even for basic 5v, the phone will ignore the USB connection to protect itself from accidents

umbral mulch
#

lol

#

that sounds like a cool idea

long raft
#

i just know if you could buy these at a cheap store every old person would stock up on them

fickle aurora
#

yeah the thing is certification is really expensive

long raft
#

it seems so possible, why doesnt it exist!

#

this is as seen on tv stuff!

umbral mulch
#

It would be kinda like a simplified home control system

#

but for 1 socket

fickle aurora
#

chinese manufacturers cheat by using CE, but CE is not legal here actually (though most CE certified stuff is not caught by customs anyway)

#

CE allows manufacturers to self-certify, it's a total joke really

long raft
#

the number of times i just wanted a light switch to control a different socket without running new electric cable

umbral mulch
#

ye

fickle aurora
#

both US and Canada don't recognize CE certification

#

I admit I have made a lot of cool 120V and even 240V stuff but I would never hope to use them outside my little workshop

long raft
#

it doesnt even seem dangerous, its just some micro controller triggering a relay

fickle aurora
#

not all of it is microcontroller based

long raft
#

the worst possible scenario is the socket is always on (which it normally would be)

fickle aurora
#

though to be honest I love the idea of making everything with fancy controls

long raft
#

theres power sources available for both devices, i just ... i cant understand why this isnt already a thing i can buy

fickle aurora
#

so what you are looking for is just a panel with toggle buttons

long raft
#

anyway thats my million dollar idea

#

no i definitely dont want a panel with toggle buttons

fickle aurora
#

I'll go back and read what you were writing

long raft
#

imagine a transmitter and a receiver, they both plug into a wall socket, like a pass-through plug

#

when the power is triggered on one socket, it tells the other socket to turn on

#

so i can move my lamp to the other side of the room, plug in both devices, and my switch controls the lamp somewhere else now

#

or i can make it work 2 lights at once on different sockets

#

every single person living in an apartment would buy at least 1

#

or offices...

fickle aurora
#

I mean that would be fairly simple to make with RF and 1 relay

long raft
#

i have never been able to find one on the market

#

theres a bunch of junk thats like half way, like you can replace your light switch with a radio transmitter, and replace your socket with the receiver

#

but thats not something most people are capable of doing

fickle aurora
#

I like the idea though but that would take multiple certifications

long raft
#

or theres remote controls, but i want to use my existing nice switch, or maybe i want 2 lights controlled by the switch

#

so i imagine, it would easily have a market, it wouldnt be too hard to collect the money to certify it from investors, but i imagine its already patented

#

people patent everything and then never make it

fickle aurora
#

I am thinking something like that would even be great for 50 amp stove outlets

#

to be able to turn the whole stove off with the light switch

long raft
#

the magic of it is that its easy enough for anyone to install

fickle aurora
#

the thing is you'd have a massive relay for that

long raft
#

i dunno, my alexa smart socket thing is ... so small

#

its like a match box

fickle aurora
#

and would need a fan to cool it off because they generate heat

long raft
#

its basically doing that with 802.11

#

why heat? again, my alexa device doesnt seem to need a fan

#

ok its more the size of a matchbox car, not a matchbox

fickle aurora
#

yeah but 50 amps at 250 would use a pretty big relay with overheaters to be compatible with induction stoves

long raft
#

oooh for the stove you mean

#

yea i would only need a 20amp one

fickle aurora
#

that would be a more special one, thinking big already

long raft
#

well you can have the idea, i wont sue lol

#

god i would surely love to buy one tho

fickle aurora
#

to make it cost effective would require a white van salesperson

#

for all the people who said LEDs can't generate heat... welcome to my lab where I turn the potentiometer down to 0 ohms and make the cob LED into a smoke generator

#

makes them shine bright though if you use higher current, but also produces a lot of heat

long raft
#

less than a regular incandescent tho, eh?

fickle aurora
#

they usually burn up before they get to that point

#

interestingly, they have never caught fire even with 120 across them

#

one project I made was 40 LEDs in series connected to 120, because each one dropped enough voltage that all of the supply voltage was used for all 40 of them

#

of course for one LED you wouldn't even see it turn on, you would hear a pop and a burn mark on the board

#

you can produce an amazing amount of light with those and they are like 3 cents each on ali

#

it saddens me when I see LED bulbs for such high prices when they are so dirt cheap to make, the problem is the cost of certification

long raft
#

@pure sierra so the bright green spots on the control map indicate its recently become colonial? It feels like the weak color and strong color are backwards

#

if its recently changed ownership i would think it should be the color closer to white

pure sierra
#

this has been brought up before

#

darker stand out more and highlight recent activity

#

and lighter has better transparency for majority of map

long raft
#

i will have to get used to it. i feel like somebody moved my silverware drawer

lunar cobalt
#

@long raft on your electric thingy, I think I remember seeing something like that at Home Depot. There was a light switch (you had to rewire the switch at minimum but that’s pretty easy), and it could then be linked to multiple smart “outlets” that you just plugged into the existing output like you would a cord but with 2 connectors

long raft
#

yep, have to rewire something

#

but thats why it wouldnt sell on TV

#

there are complicated ways to do it, i just cant believe why something easier doesnt exist

#

and the way network devices can communicate over the circuits, if a device could signal through the hardware instead of radio it would be even cooler

languid harness
#

doesnt check the chat for a day, 400 technical messages

#

lol

fickle aurora
#

well there is a very nice kitchen experiment you can do to answer part of Derp's quest for this new idea on measuring if one device is running and then turning on other plugged in things based on the state of the master plugged in device

#

it's fairly safe, all you feel is just a buzz, but if you take a strong magnet like a rare earth (neodymium) magnet and place it anywhere along the electrical cord of a kettle or microwave (or any high current device) and then run that device at full power, you can feel the current in the magnet because the high current will create a magnetic field - since it's AC current, the field will change at a rate directly proportional to the frequency (60Hz) and you get to feel it as a buzz

#

you get the same effect with any current, but they won't produce enough eddie currents/fields to feel with a magnet in your hand much like a 10-15 amp device will, but you can use this by wrapping a wire around the cord somewhere and tie one end to common ground with the other end tied to the base of a sensitive transistor

#

essentially what you would be creating in this is a mini current transformer - you can buy them already in a unit as an electronic component for pennies, but it is also great to experiment and see just how it all works

#

in addition, if you use a transistor with a good linear output, you can also use this as a way to measure the current in the main appliance because the strength of the magnetic field on the appliance's live wire (hot as opposed to neutral or ground) will be directly proportional to the current that appliance is drawing, which means your current transformer will of course increase or decrease the current sent to the base of the transistor, giving you a linear output directly proportional to the current draw of your appliance

#

and - of course - with this kitchen experiment you can understand why it's very bad to put your data wires beside high current drawing power cables... (though you can of course, wrap a bare wire over the power cables and tie that wire to ground, which is exactly what that metal foil is for inside high quality network cabling, that foil should also be connected to ground somewhere of course)

lunar cobalt
#

@long raft The reason it doesn't work over power lines is because when you flick a switch you're mechanically closing a circuit, and so the only way to detect that would be to have that circuit also run power to a different place, which is what is already in a lot of houses for outlets. You can't really communicate stuff over electrical lines since they're just running power. You'd need to "read" the output of the power line like Widallan said, and that gets relatively complicated.

fickle aurora
#

well you can actually send signals through the live wire theoretically by superimposing frequencies

#

this is kind of how DSL works really, you have one wire with hundreds of different frequencies on it - in this case, we could superimpose a different frequency on the live wire in a house and then filter out the 60Hz frequency, leaving us with the superimposed frequency we want

lunar cobalt
#

not gonna work in my house that's for sure, wires there are fucked

#

as in, "outlet on one side of the house is connected to 3 outlets on the far end of the house" for some reason

fickle aurora
#

lol

lunar cobalt
#

Need to turn off the power to rewire something? Just trip the main breaker, only way to be sure

fickle aurora
#

yeah so to detect when something is turned on, you can use a current transformer like I explained above, you'd basically detect current draw so it wouldn't really detect everything that is turned on unless it reaches a certain current threshold

#

in a way that might be an advantage because many TVs have soft power systems that draw microamps of current when they are turned off, drawing just enough power to run a microcontroller interrupt pin and to power a diode to detect input from your remote control (and of course interrupt from the physical power button on the TV)

#

well computers, TVs, kettles, stoves, coffee makers, pretty much everything now uses soft power

#

on an ATX motherboard for example, the interrupt on the motherboard detects when you short the power pin to ground, which causes current to flow and I can imagine that is detected by having the base of a transistor connected to that power on pin

summer bobcat
#

damn I love reading this channel

fickle aurora
#

I love how broadband over powerline was dumped by all the other industries because they were worried about interference, yet it's far less interfering than wireless would be, I mean, just the nature of the signal being in a wire instead of all around the air to me makes more sense in terms of preventing electrical interference

#

it also means you'd have to redesign everything that plugs into 120V sockets though, to filter out all the frequencies you don't want

#

anyway, it's good for LAN since I think the frequency is terminated at the
big transformer that provides you with service

lunar cobalt
#

yeah most things in 120V sockets dislike it when the power isn't at or near 60hz

fickle aurora
#

I wouldnt be surprised if it isnt already done at the carrier level using the high voltage lines

#

there is another cool experiment you can do using a car's ignition system and a high gain antenna to basically create sparks at a frequency picked up by the antenna and filtered with a tank circuit, but technically it is illegal lol

#

back in the early 20th century spark gap radios were banned in most countries because of course a spark is really quite interesting when it comes to electronics, RF and magnetism, it literally acts like a signal jammer

long raft
#

Uh they make network adapters you just plug into the wall sockets, Theyve been around for decades

#

hes right, it doesnt work beyond the transformer, too

fickle aurora
#

yeah there were developments on BPL in 2004 apparently according to wiki but they were discontinued because of opposition by many other industries

#

but yes they are widely available for LAN home use

long raft
#

i think they have been around longer for telephone lines

#

the moment the switch is activated there would be power to both devices...

timber onyx
#

radios in general are really interesting to me

#

you can literally make an AM receiver radio with a crystal, a piece of metal and an earpiece

#

don't even need a power source

#

and it all seems complicated until you realize a radio is just a piece of metal that transforms radio waves into electricity and the rest is just to filter the exact frequency you want.

languid harness
#

"its all just waves man"

coral sundial
#

Wait its all waves?

#

Always have been

kind glacier
#

🔫

barren quarry
#

@cursive gate @long raft

#

he probably has the files

cursive gate
#

Hey, @long raft I'm looking for the .shp files for foxhole. Trying to make a couple maps in QGIS

#

Wondering if you might be willing to share?

languid harness
#

Three stages of engineering:
pi = 3
everything is a fluid
everything fibrates (aka makes waves)

coral sundial
#

You forgot the gravity is 10 stage

long raft
#

shp files? for roads?

pure sierra
#

@timber onyx im training for my amateur license

timber onyx
#

what

#

oh for radio?

pure sierra
#

yes

timber onyx
#

oh that's cool, kinda old fashioned for me though

#

i have this professor that's super into amateur radio

#

his license plate is his call sign lol

pure sierra
#

hehe

#

yeah its pretty old school, but has some novelty, like being able to talk to people long range without any intermediate network

timber onyx
#

the gear is expensive though

pure sierra
#

i know

#

im sort more into sdr at the moment

#

but would like the ability to transmit on hf with an 'affordable' set

#

sort like how gamers spend a grand plus on a pc

#

or even just a graphics card....

coral sundial
#

I was today into my second first year of mechatronics when I found out AVR c library has a macro function for buttons

#
 
#define     bit_is_clear(sfr, bit)   (!(_SFR_BYTE(sfr) & _BV(bit)))```
languid harness
#

what kind of sorcery is this?

coral sundial
languid harness
#

Do I look like I wanna read some {}{}{} crap?

#

Also, there is a hair on your screen

kind glacier
#

Do I look like I wanna read some {}{}{} crap?
}}}}}

languid harness
#

Exactly

kind glacier
#

ngl I don't really get what's going on in the screenshot

coral sundial
#

1st evaluate if button is pressed. Wait a bit. Check again and do something

#

2nd same as first without waiting

#

Idk what sfr is but you can substitute it for PINx

#

Bit is the bit value

kind glacier
#

ah so that's what the bit means

#

dunno what PINx is either

#

I haven't worked with arduino or raspberry in a very long time. Or anything else requiring button press commands for that matter.

coral sundial
#

Its the I/O port of the board. short for Pin IN id like to think

#

X is for which register

fickle aurora
#

funny thing is there would be less typing in that if you just used assembly

jovial lake
#

is that c

#

i see c

#

c

#

arduino?

fickle aurora
#

it looks more like atmel or mplab but it could be any IDE with GNU AVR C compiler in it

#

I use XC but quite similar, though the features are vastly different between compilers

#

but what his functions were doing (from what I can read there in the screenshot) is basically reads whether a pin is input high or low, which I mean, you can just read the PIN register and then branch if bit is set in assembly, which is like 2 short lines of programming instead of massive C functions :D

#

so to get started the best thing really is to grab the datasheet (I will use 328p as an example) and go to the section called "Register Summary" which is often near the end of the file - table of contents will often have a clickable link to it

#

the address numbers in brackets are the ones you want to focus on, some of the registers have another number in there, but to get started, just focus on the ones in brackets, so in this case if you were using PINB you can simply call up 0x23 to see which pins on port B are high or low, like this: IN R0, 0x23 which would store the value of the pins on PINB into general purpose register 0 (aka working register)

#

so one thing people are often confused by is how to make if statements in assembly, but in assembly you have more flexibility - we can ignore all the rules about programming and simply tell the program counter exactly what to do line by line, and where we want to loop from or branch out to

#

so we don't really have an if statement, we kind of make our own from scratch, and I like to use the SBRC instruction for this in almost every situation - not all CPUs have the same instructions but this one seems common among all the AVRs, it tells the CPU that if the bit in the register given is cleared (0), then skip the next instruction... essentially your next instruction will be your branch for if it is set (1, or like I say, 1 is usually true)

#
  SBRC R0, 0 // 0=PINB0, 1=PINB1, 2=PINB2, 3=PINB3, 4=PINB4, etc...
  RJMP PINBx_INPUT_IS_HIGH``` so this is a good example, you can replace all those big C functions with something quick and easy like this
#

of course, if you instead wanted to check if a pin was held low (or grounded), you could instead change the instruction from SBRC to SBRS which skips if bit is set: IN R0, 0x23 SBRS R0, 0 // 0=PINB0, 1=PINB1, 2=PINB2, 3=PINB3, 4=PINB4, etc... RJMP PINBx_INPUT_IS_LOW

#

RJMP is just an instruction that tells the CPU to modify the program counter to point to the line where the specified label is at and ignore everything up to and including the colon plus any whitespaces (so you can have the instruction placed anywhere after the colon)

jovial lake
#

nice

long raft
#

if (x) { return 0; } else { return 1; }
use conditional operator

return x ? 0 : 1;```
coral sundial
#

Wow

#

My dude its just a button press for a school project

pure sierra
#

@fickle aurora try writing here a little more condensed...

languid harness
#

I love this chat, because at random someone drops like 5 paragraphs of text with only terminology

coral sundial
#

C is low level enough

#

Thank you

pure sierra
#

theres only one 'someone' that does that

fickle aurora
#

I tried to simplify it

pure sierra
#

im not so much saying u need to simplify, but maybe not write so much 'off the bat', just my opinion

#

some may like it

long raft
#

i think the topic just hit all his dopamine spots

fickle aurora
#

well I am surprised all these university students are having trouble reading a few paragraphs wardenlol

#

I think derp made a syntax error, because the way the syntax goes is value = <condition>?<value if true>:<value if false>; in C at least

#

if you simply just put x variable in there instead of writing the condition x==1, then what can happen with some compilers is that it can return the property of whether x is assigned a value or not, as in, some compilers don't consider 0 to be null, some like for example, XC that uses C99 standard, or at least anything that is ANSI C standard will require that you actually put a conditional statement in there

#

so if you declare x = 0;, sometimes if you use a condition such as if (x) { } then some compilers will return true because that compiler may be checking whether x has been initialized (assigned a value), so you should get into the habit of always using if (x==1) {} or even if (x>0) {}

#

there are lots of tips people can give you, such as for example, always increment instead of decrement wherever you can - why? internally, adding is just shifting bits... subtracting requires more CPU time because a CPU can't really subtract a number ... it has to get the complementary value and then add 1 to the result, then get the complementary value of the result which is how it performs subtraction on the hardware level - unless of course the math operation is performed by the math co-processor, which does not use binary to perform math

#

some compilers accept while (;;) and others will not compile unless you use while (1), another example of a situation where it depends on what specific compiler you are using

long raft
#

its because you didnt see the line before it

#define x 1
pure sierra
#

funny shit, open web developer toolbar on a facebook tab just to use the js console for a test and find this:

lunar cobalt
#

@pure sierra the fact they have to say that is kind of sad, but also expected

jovial lake
#

look at discord's console lmao

pure sierra
#

@jovial lake can u screenshot it

jovial lake
#

@pure sierra

pure sierra
#

lol, im sure lots of people have been scammed

jovial lake
#

s c a m

barren quarry
#

Sometimes I use the dev console as a calculator

kind glacier
#

lol

coral sundial
#

I mean

#

I once used opengl to plot graphs for me

timber onyx
#

they actually link to their job offers

#

wow

pure sierra
#

@dusky gorge can you explain ? better to contact me in here

dusky gorge
#

like salt caps and westmarch / jade are all blue now

#

but the colored parts arent updated on the map

#

they are still green

#

I tried refreshing / deleting all cookies and reloading

#

wont update

pure sierra
#

which map ?

dusky gorge
pure sierra
#

sorry which zone is those towns ?

dusky gorge
#

theres an example

#

the overview shows all of drowned green when thats not the case

pure sierra
#

yes, that is a problem

dusky gorge
#

yep

#

Just didn't know if you were aware of it

pure sierra
#

i wasnt, thanks

dusky gorge
#

np

pure sierra
#

let me look into it now

#

@dusky gorge ok i think i fixed it

dusky gorge
#

yep looks good now

pure sierra
#

thanks again, it was a coding problem. golden start helper award goes to you 👍

timber onyx
#

when will foxhole global get its roadmap fixed i need to see the win/loss ratio REEEEEEEE

pure sierra
#

roadmap ? @timber onyx

timber onyx
#

sorry i mean statstab

#

the one showing every win and loss over the wars

#

if i try opening it it just goes to a blank page

#

it's my only source of win/loss so its precious to me

pure sierra
#

yeah i want to make one of them. kastow mentioned it was broken

#

you can always look in game

#

or on my website

timber onyx
#

where?

pure sierra
#

at the memorial garden in the home region

timber onyx
#

memorial garden doesnt show all of them

#

and its not a good way to screencap and shove it in the face of wardens

pure sierra
#

that sucks,

timber onyx
modern glade
#

Wow.

coral sundial
#

Anyone here ever used the ibt_2 motorshield with succes?

#

I just cant get it to work

#

I am better of just plugging the motor straight into an outlet at this point

#

(Yeah i want to die)

coral sundial
#

I am also extremely annoyed by all these breadboard Cables and i am about to just buy a set of microcontroller chips

timber onyx
#

dont you dare boy

#

live with the cables, be the cables

#

@coral sundial honestly tho could you post a screen of your schematic so i can tell what ur doing

coral sundial
#

its too late

#

I am one with the microcontroller now

#

I am the microcontroller

pure sierra
#

how could you be using a shield withot mc ?

coral sundial
#

I dont understand your question

timber onyx
#

a shield is something you add to your microcontroller. i also would like to know why you're using code that's made for a shield

coral sundial
#

well, thats because its not an official shield. its just a bit of extra circuitry

#

that jus happens to look like a shield

#

potato patota

timber onyx
#

but is it made for mc

pure sierra
#

technically u could say its made for mc also in a shield/breakout board

timber onyx
#

yes and i'm saying that it would be weird to try to make a shield work alone

#

@coral sundial post the goddamn circuit, i wanna see it

coral sundial
#

well truth be told. I got it replaced because I probably fried it in my frantic testing

#

and it worked perfectly fine first try on the new one

#

however

#

i still bought an atmega328. it comes with a bootloader I think

#

whatever that is

#

I am working on a homemade ISP

timber onyx
#

oh you're just working with a straight motor bridge?

coral sundial
#

no. google IBT_2

timber onyx
#

no what i meant was are you adding any controllers

coral sundial
#

well in the college project we are using a atmega2501 arduino board with the IBT_2 as motor controller.

#

Personally I want to learn how to program directly to the microchip so I wont have to use expensive boards

timber onyx
#

you mean an atmega2561?

coral sundial
#

yes thank you

timber onyx
#

ok so you have that and you're trying to make it control a motor through a driver. anything more?

coral sundial
#

sensors to stop and start the motor at specific points

#

I mean I got it to work now. I tested my code with another and it worked fine. I probably fried my old one or it was faulty.

timber onyx
#

what kind of motor is it

coral sundial
#

I dont know some kind of small transmission DC motor

timber onyx
#

so it's not a stepper motor

#

if you want control you gotta use a stepper motor

coral sundial
#

nah

#

thats for super precise control

#

I just need to know wheter its opened or closed something

timber onyx
#

alright well if you fixed your issue it should be ok. just remember to be careful what inputs you're using, some drivers literally insta die just for activating the controlling side before the motor side

#

and as a useful tip, dont use the dangling jumper cables if your circuit is all on a breadboard, cut pieces of wire and put them on the breadboard instead. becomes way less annoying to figure out what's connected to what

fickle aurora
#

@coral sundial you can just basically buy the chips in bulk and solder them directly to prototype boards but make sure you stock up on 15pf and 22pf, and maybe 0.1uf ceramic capacitors, 100nf/1uf/10uf electrolytics and 16 and 20mhz crystals as well esp if you are using stuff like the 328p - also should maybe consider investing in the atmel ICE basic kit if you are gonna do a lot with AVR ... for resistors you can go for the resistor sample books so you have a wide variety and then also perhaps stock up on a lot of 10k and 1k resistors and maybe 470 ones for LEDs ... buying a big bag of cheap BC547 NPN wouldn't hurt either

#

there are some guides around explaining how to set up your own ICSP header and how to set up a reset button with a short ground pulse for when you need to upload a program to the chip

#

basically you need to put positive rail through some resistance to the reset pin for programming it, but you need a pushbutton that shorts it to ground with a ceramic capacitor across it, so that as soon as you click to upload a program, you can then give the button one press and it will then accept the data transfer ... shorting the reset pin to ground is what makes the chip accept your upload - but the timing has to be fairly precise which is why you need to pick the right capacitor, but it is explained in the datasheet which cap to use ... if it doesnt work, it will make you think that the chip is dead when it is in fact okay, just that you need to get the timing of the reset proper

#

another common one that gets me sometimes is don't forget to power the rest of the Vdd pins and ground the rest of the Vss pins, as there are often multiples and if you miss one it will also not work for that reason

timber onyx
#

who needs to buy anything when you have infinite free resistors and capacitors you can steal from your school

timber onyx
#

and some inputs arent activated by ground, you gotta make sure you read the datasheet. always. i've fried some ships for not reading correctly

#

some manufacturers are nice and even give you example circuit diagrams for their stuff

#

i know i had to read the texas instrument examples many times to remember how to use an LM117

#

but god it feels good to figure out how a component works, feels like being an archeologist digging up ancient runes

#

though that might just be me

coral sundial
#

I have a book that teaches c for the atmega328

#

Goes into detail about uploading to the chip

#

At least

#

It tells you how to flash the bootloadet

#

After that...

timber onyx
#

you could figure out by yourself how the chip works. i had to do it for my first job in the domain.

#

it just requires reading the datasheet a lot and looking up every word you dont understand

#

understanding every port..

#

it's pretty time consuming but you get to really understand how the chip works

coral sundial
#

Ive been following this diagram

timber onyx
#

finally thank you

coral sundial
#

Ive been making a header board to plug into the atmega like this

timber onyx
#

i hope you arent using dangly jumpers for those connections

coral sundial
#

nuuu

#

I am soldering some real wires

timber onyx
#

oooh i like the dedication

coral sundial
#

but I fucked up. shouldve used the other side of the soldering board

#

I got some weird connections xD

timber onyx
#

hope you got a pump

coral sundial
#

nope

timber onyx
#

they're cheap

coral sundial
#

I got more soldering boards though

timber onyx
#

like really cheap. 10 bucks cheap

#

you got an electronics store near you they'll have one for sure

coral sundial
#

besides that, I soldered it yesterday. right now its one soldered terminal, a green led + resistor and some headers

timber onyx
#

you solder often?

coral sundial
#

nope

#

xD

timber onyx
#

if you're having difficulty i recommend using flux

#

you know how annoying the solder sticks to your iron?

#

flux fixes that

coral sundial
#

oh wait I just got an idea

timber onyx
coral sundial
#

I can remove the black things from the headers and solder wires to them. that ought to solve my weird soldering problem

#

yeah they dont stick to the board xD

timber onyx
#

i cannot recommend flux more

#

like really, buy a fucking pen

#

you just have to put a dab on the board, put the wire in place and heat the solder

#

instantly sticks to the board and no trouble AT ALL

#

the first time i used flux i thought it was a joke or something

#

it's fucking magical

coral sundial
#

xD

#

I will check it out later. I got to walk the dawg

#

also my chips just arrived

#

🥳

timber onyx
#

aight aight

coral sundial
coral sundial
#

ew I just realized its tainted with a uno bootloader

coral sundial
coral sundial
#

fits nice and snugly 🙂

coral sundial
#

okay this is interesting. I wanted to try the connections with the multimeter using that beeping mode. U somehow managed to light the led from the orange cable to ground...

timber onyx
#

the beeping mode?

#

you mean continuity mode?

#

yeah what that does is create a small current in the probes so that when the circuit between positive and negative lead closes the multimeter beeps

#

if you put it on an LED it'll light up faintly because of the small current

#

some multimeters have a special diode check mode just for this reason

lunar cobalt
#

don't do that on a powered circuit though

timber onyx
#

ye, it's the same function as a resistor meter except the multi meter just checks for a minimum level of current. overloading it will blow out the fuse like would happen for a resistor meter

coral sundial
#

I mean it lighted up through the microcontroller 😅

coral sundial
#

Anyway avrdude gives me the OK signal which means it all works :D

coral sundial
#

Yes i have fried my h bridge again

#

What about it :◇

warm lintel
minor swallow
#

hey, anybody here play Hearts of Iron 4? Me and some friends are making a Foxhole mod for the game, and i need another person to help code.

pure sierra
#

nah, steel division is my game a bit like that

kind glacier
#

I've played a little bit of hearts of iron 4

#

but no idea how to mod that stuff

#

tbh a reskin mod isn't the only thing that game needs Mattthink

#

that said, I don't exactly have the time rn either

#

that stuff would be a dayjob tbh

#

just figuring out how to use the war api took me several hours a day before I gave up

#

(technically I had pc problems and needed to reinstall windows, but I've been too lazy to try again)

mellow bramble
#
 
#define     bit_is_clear(sfr, bit)   (!(_SFR_BYTE(sfr) & _BV(bit)))```

@coral sundial LUL most manufacturer will release an API library for simple checks and modifications to registers/ports

pure sierra
#

"Mortar Half-Tracks can be fired from the back of a Barge when the Ramp is up" wardenlol

halcyon zinc
#

Gun Boatette

kind glacier
#

inb4 someone draws the gunboat with the bowsette crown

kind glacier
long raft
#

🤔 anything in there actually worth a dollar? maybe generative deep learning

#

i just want to point out what a ridiculous cop-out oreilly's covers are, as somebody who has designed book covers

#

they just pick a random animal ... as if animals are somehow related to code or whatever

long raft
#

looking forward to that GAN book tho, thanks

timber onyx
#

you designed book covers?

long raft
#

ive done a few

#

i cant say they were amazing, but they were relevant to the topic inside

#

not just like ... a frog

fickle aurora
#

the beep mode on a multimeter is often for testing diodes on most multimeters, depends on which one you have, it will have a diode symbol on the beeping mode selection - it is basically great for testing LEDs without the need for current limiting also since they are of course diodes - you can also test transistors and such, but there are better testers for transistors

#

the beep won't work if the wire has high resistance like over 5k or so, so you need to use resistance mode and select the proper range if you are checking resistances above 2k or so ... diode mode can give resistance readings up to around 2k for most meters

#

if your solder joints break, using proper resin flux will make those joints very solid - a good solder joint won't break, but there are some cases where you don't want to use flux, like with sensitive components or some BGA stuff, but that's also why you can easily pry off components from most mass produced PCBs because robotic machines that make most circuitboards often don't flux the board and the connections can easily break

pure sierra
#

help, my account has been vac banned ....

barren quarry
#

@pure sierra Really?

lunar cobalt
#

The game was being dumb @barren quarry

#

he's not actually banned

pure sierra
#

yeah im fine

summer bobcat
#

phew

pure sierra
#

@lunar cobalt im banned again

#

@summer bobcat

summer bobcat
#

Mods can't really do anything about VAC "bans". @pure sierra Could you please start a ticket by DMing @lean forum ?

pure sierra
#

i got back in eventually

#

just had to wait again

#

thanks @summer bobcat

summer bobcat
#

I still think you should make a ticket, if you didn't already the last time it happened @pure sierra

pure sierra
#

i did

summer bobcat
#

seems like something's up with the VAC integration in game

languid harness
#

((click on more photo's))

timber onyx
#

python is overrated

languid harness
#

everything is overrated

#

its depression time

coral sundial
#

C master gang

neat fossil
#

assembly purity

coral sundial
#

an assembly purist

#

how despicable

long raft
#

bnf 4 life

winged pagoda
#

just code in C# like a normal person

long raft
#

agreed...

jovial lake
#

y e s

#

b ru h

mossy pelican
#

LUA gang :( no one?

neat fossil
#

warthunder

#

but in assembly

#

o god

kind glacier
#

o god

#

warthunder is a fuckin mess already

neat fossil
#

run warthunder on casio musical calculators

pure sierra
#

@lunar cobalt @barren quarry just got word that a player with the 'failed to download profile error' got it working by changing his steam display name. i suspect this corrected a problem with his profile.

long raft
#

unicode!!

lunar cobalt
#

Ah so Unicode. Nice.

kind glacier
#

But does it run Doom?

pure sierra
#

@lunar cobalt looking over another users problems, the one that can get into home but not travel, with error about wark services, did you know about C:\Users\USER\AppData\Local\Foxhole\Saved\Logs\War.log ??

#

this is the errors im sure that are from his problem

#

his websockets are failing

#

@proud mirage

proud mirage
#

Gonna try reseting my game clock

proud mirage
#

Same error still even after clock reset

lunar cobalt
#

My guess is it’s what you told me about how you don’t have ipv6

pure sierra
#

u dont need ipv6, it runs off v4

#

infact ipv6 is likely to get in the way

fickle aurora
#

you should almost always disable ipv6 in network connection adapter settings unless you are sure you need it, because windows will try to use it to resolve addresses before it tries to resolve with ipv4

pure sierra
#

@fickle aurora yes

fickle aurora
#

it makes a big problem down the road but I think on most linux/mac systems you are fine with ipv6 enabled

#

just windows has this problem and anything that uses windows sockets, such as .net applications (C# apps ported to linux for example)

#

sadly microsoft couldn't properly implement ipv6 back in 1998 and even today still has not figured it out despite their billions of dollars

pure sierra
#

ive had problems with it on my linux vps, where services will try and bind to it by default, and then become unreacheabale

fickle aurora
#

works fine in freebsd 4.8

pure sierra
#

im not saying it doesnt work, just that it can get selected as the wrong iface

fickle aurora
#

well, I admit, most people don't use 4.8 now, but people who still remember the words "uptime" and "stability" still use it

#

funny thing is, windows 10 has great stability, but due to forced updates, it's worse than windows 98 loaded with viruses and malware in uptime

pure sierra
#

win10 sucks, im still using 7

fickle aurora
#

I would, but I have more than 190GB of memory

pure sierra
#

u can see in the logs they dont use ipv6: [2020.10.13-19.20.45:129][576]LogLwsWebSockets: Lws(Notice): Creating Vhost 'default' (serving disabled), 3 protocols, IPv6 off

fickle aurora
#

if the site resolves to an IPv6 address, and you have ipv6 enabled in your adapter settings, windows will try to connect via ipv6 (because why not, it's newer than ipv4) even if it does not actually have an ipv6 address - this is because there is often compatibility via ipv4 mapped ipv6 addressing

#

the idea back in the 90's was that all ISPs would switch to IPv6 permanently - it never happened

pure sierra
#

@fickle aurora what do u make of the first error he gets , as likely that is the one that starts all the rest