#ot1-perplexing-regexing
1 messages · Page 591 of 1
fortnite
gta 5
among us
subnautica
abzu
alien: isolation
amnesia: a machine for pigs
axiom verge
cave story+
celeste
cities: skylines
city of brass
costume quest 2
darkest dungeon
defense grid: the awakening
enter the gungeon
fez
for the king
frostpunk
galactic civilizations III
genshin impact
hell is other demons
hitman
inside
into the breach
jurassic world evolution
just cause 4
kingdom new lands
metro 2033 redux
metro last light redux
mothergunship
my time at portia
night in the woods
obduction
overcooked
overcooked 2
oxenfree
pikuniku
pine
railway empire
rayman legends
RiME
rocket leage
roller coaster tycoon 3
scavangers
slime rancher
solitairica
star wars battlefron II
stories untold
stranded deep
stranger things 3
super meat boy
the escapists
the first tree
the lion's song
the long dark
the spectrum retreat
the stanley parable
the textorcist
the witness
thimbleweed park
torchlight II
train sim world 2
transistor
tropico 5
verdun
watch dogs 2
world of goo
``` what game should i play?
world of goo is nice if you need/want a puzzle game with a bit funny story
slime rancher if you just need/want to chill with cute creatures from other planet and manage your own ranch
both have cute graphics, both have slimy/gooey balls, both have nice music, both I like
where did u get this list from
it's my epic games collection
oh
encoding it's important
hm, did you type it out manually or is there some form of export?
What does fortnite do in this? :3
What's wrong with it ?
It too was in my library
Manually
bruh
Whats dvorak?
it's another one of those keyboard layouts
which suks
dvorak is annoying af.
colemak is very nice and keeps azxcv in place, so text writing shortcuts are in place. s is only one key away from its original place, so ctrl+s is easy to do as well
I actually feel comfortable typing that. However, I quit after the week typing that and gone back to qwerty
agreed
u can even keep colemak while playing lol
ye Dvorak f*** up movements in game
some games even support colemak
and they rebind keys so it's like qwerty when playing
damn
apparently 4.5% of all messages I have sent contain lmao
!e print(142/9490)
@dire siren :white_check_mark: Your eval job has completed with return code 0.
0.014963119072708114
apparently 1% of all messages i have contains lol lol
0.028 of all messages i have contains apparently apparently
the s yea
positioning yea
yes the S, I couldnt move it from cutting off on the side and also the Daze icon to the right.
this is what am trying to build
Can you show the CSS?
.icon{
position: relative;
bottom: 60px;
flex-direction: column;
}
thats the only thing I got in my css
Then you probably want to add a parent <div> to the two and do something like:
.class-on-div {
display: flex;
flex-wrap: wrap;
fiex-direction: row;
}
The Flexible Box Module, usually referred to as flexbox, was designed as a one-dimensional layout model, and as a method that could offer space distribution between items in an interface and powerful alignment capabilities. This article gives an outline of the main features of flexbox, which we will be exploring in more detail in the rest of the...
like add another div that wraps the <Row>?
wait what do you mean by that
oops
I imported it
Can you show the source code of the file that has that?
Oh, I've never worked with react-bootstrap, so I have no idea, sorry
@quartz dagger you would have much better luck in a js server
this is the best layout
Yep
tying "download" would be hell in this layout
typing the alphabet would be heaven tho
@lilac badge \🤔 you have a mustache
damn ikr 🥴
beautiful
btw, there was such "weird layout ideas" thread on colemak forums a few years back. people inventing the worst layouts when it comes to moving fingers or with words in top row (just like "qwerty" is read from top row) 😄
I'd need to find it. it was yeaaaars ago
like 10 years ago or something like that when I used colemak and was a regular on colemak forums...
correction: 6 years ago
https://forum.colemak.com/topic/420-the-best-keyboard-layout-ever/ weird bad layout placing most common characters in bad places and rare letters in best places, layout using pangrams (sentences consisting of all 26 letters used only once), layout with "fuck" and "stoned" in it... I thought there were more in that thread 
lol
what the heck DIscord, I'm literally on the app
Let me teach you about electron my friend
Lmaoo
Discord go brr I guess
electron is bloat
Must be a bug in the update I just downloaded
always has been
I wouldn’t say that
https://tauri.studio is great
Tauri is a framework for building tiny, blazing fast binaries for all major desktop platforms. Developers can integrate any front-end framework that compiles to HTML, JS and CSS for building their user interface.
But Electron isn't that bad
Oh god, Discord is now doing bugs that I've only seen happen on web
Never have I seen these specific bugs on the desktop app
Lol I stand by my statement
is star wars battlefront 2 good?
it was a bug earlier, patch has already been pushed
solution is to force kill discord via taskmanager or taskkill and then relaunch it and it will update
Discord also hangs and dies in KDE plasma
didn't work for me 🤷♂️
oh nvm, did it again and it worked
not correlated, runs fine on my plasma.
Is correlated, a kde dev said that it's a problem with electron 8
anyone noticing that u have to spam enter to send messages that start with any of !?>-
bruh fucking stickers
huh
did it do anything weird
yeah
hmm
stickers are annoying too
huh i thought it was the stickers doing this
anyways, fuck stickers
llo
damn
same
discord web or app
app
same
its not some broken input
i tried doing the same thing in other apps
works fine
brug
How was your result

It's slash command shit
They want you to use slash commands
Try typing one of those characters, pressing the down arrow once, and hitting enter :)
soon™️
It's Danny so... (probably not)soon™️
ye, that's why i switched to a dart wrapper
Hi.
I always get this error
wdym
I always get runtime error
you plugged it wrong and now it only transfers at x rate
not because script or the eletro components
So you use JS
Java
can you help with java
I can but note I am not expert in it.
slap the code here
I haven't worked with Arduino
it just a eletric thing with a cable
yea ik
i will try mint
Wait if I am correct isn't a Hemlock like a plant
yesnt, mr.hemlock is an admin on this server
ubuntu
ubuntu
Manjaro
manjaro
an ubuntu flavor
lol
It depends what you want and what you're experience is.
Are you beginner, intermediate, or advanced with Linux?
Do you want stability or newer versions of software?
What is your intended use of the distro?
The second question means so you want stuff to be stable or do your want meter versions of everything so the potential cost of stability...
It's kinda hard to elaborately farther on that. ^ @rough sapphire
I'd recommend OpenSUSE Tumbleweed then
If you're intermediate and know what you're doing, and know your way around using a terminal when you need to
It's a stable rolling release
Avoid arch or anything based on arch unless you want to spend every single day fixing things that break instead of getting things you want to do done
Yes
Yes
You can customize it however you want
Most distros offer many choices for desktop environment
And most environments been be customized wildly
This is what mine looks like work KDE plasma desktop
It is not even close to what a default install of plasma looks like
Default install kinda mimics windows 7
If you do like to customize stuff I recommend KDE plasma
One question though, do you have an Nvidia graphics card?
Well more specifically, is it a LAPTOP with Nvidia and Intel.. Oh it's a shitbook
An old as fuck one at that, oof
I'll dm you an invite to the opensuse discord
Just in case you have issues with drivers
same except endeavour
we have similar tastes huh
Really nothing if you want rolling release
There's Solus but package availability and compatibility are issues
Otherwise... Sky's the limit any distro really will work, so long as it's not arch based
It breaks. Constantly
It will break without you updating even
And every time you do update, it will break
Arch and anything based on arch is more of an experimental os that will teach you how to fix problems and become an advanced user
Arch is mostly used by kids who don't know what they're doing and were told to use arch,
Tinfoil hat FOSSers who think they anything not free and open source is the end of the world,
And crazy people
The community is also awful
It's you have a problem that the wiki didn't fix or answer, you're on your own
I'd much rather learn to be an advanced user by actually doing things
Rather than trying to fix my OS constantly when I'm trying to get work done
I've tried arch, Manjaro, and endeavor over the past few years
All 3 had the exact same issue of being so unstable I spent more than half of my time fixing problems instead of working on my projects
Soi this is not just me hating on it with no substance
It's genuinely caused me a lot of grief and I gave arch based 3 chances of my main workstation
Just erase the disk during install :p
Looks good, sadly I can't use Firefox
It hates me for whatever reason
No Discord under Socialize?
fair
I forgot about that
hmmm
I wonder if there's a way you can open an app through a website hyperlink
seen a fair amount of websites do it
Knowing how crappy discord docs are, probably not
@topaz aurora sorry for the ping, i just have to show you this lol
seems as if it really is just undefined behaviour, different forms of execution can give different results, and IDLE just so happens to not call the finalizer at program termination clean-up
henlo off topic people
uhhh. is 10 lines of C++ supposed to create 800 lines of assembly?
depends on the lines
yeah, that's probably it
you could easily get much more than 800 with enough templates
but without templates, yeah, it's probably just debug symbols
how did I get the templates?
Django templates?
yay coffee
I don't have to ssh into coffee because there is coffee in my body at all times
@eternal wing you know it
I have been summoned
well one cup was all strictly form Ethiopia and then the other was a blend of south america and indonesia
that's like, so many places
omg
ok
looking for the code now
oh well actually it's used very basically, and specific to a single project that i worked on, but i guess it may help
where can i find fellow members of the anti-anime crusade?
i know they're out there
You should try Oaxacan (Mexican) coffee
I've had coffee from chiapas. why
The blend I tried was really good
i read that as a hex code
I forgot what it's called but it's very premium so I would hope it's good.
hey your name means haha stinky poop. does coffee make you poop?
no
drink more
Hsp probably doesn't drink coffee
coffee makes me happy
He seems too
does pooping not make you happy?
Hspish
depends
Not entirely
not as much as coffee
#badjoke ||oops i thought it is haha stelercus poops||
whomst has summoned me
im looking for a the anti-anime crusade community to shill my bot
advertise
!rule 6
you can't ask @polar knoll and get a verified advertise
do u have ur coffee keys
I was given a "light-weight" repo to use at work. A node setup for an lambda auth service in AWS. Darn thing had a clean 100 package imports if it had 12.
use https://isevenapi.xyz instead, its way more reliable 😤
Can you imagine the havoc these would cause with a breaking api change?
lmao if the owner of is-number decided to, he could destroy the internet for a few days
@tranquil orchid I have a feeling it could be used for diagnostics in terms of API testing
Everything would break
That seems semi-reasonable, like pinging 8.8.8.8

I don't imagine a lot of people care if numbers are even or odd
Well, the 400k downloads per week say otherwise 👀
Would you download a script over the internet to verify that
and folks think too much rides on cloud-flare ....
i would be willing to pay $99.99 to verify that 😤
They couldn't see the real danger
I'm assuming SHA-256 is done for verifying what you download is what you download too, so there's a lot of other things being done typically
It's not a raw GET and call it a day
Maybe bots are downloading it for some reason
It's likely deployment packages.
Just baked right into the libraries that are running the backends.
Yep
imagine doing all that hard work yourself
when you have an API that does it for you
why not just use some 15 lines of code
when you have to do the difficult work of 1 line
Whoever made this is a genius, making a fortune off of idiots
its satire lol
I wish it was real
guys
if i have a table in a pdf
can i read it with python
without losing my sanity
huh
time to install ipython
tomorrow I gotta use it for work
so it's probbly practical to find out how it works
God
At least semver is higher
But that's probably because npm uses it (I think)
it would probably be restored like that one package
what was it again
leftpad
kik, I thought
oh, nvm
That's one of the maintainers of babel (I think)
kik was the package whose name led to the conflict
and then over that argument, koçulu deleted leftpad
which basically broke the entirety of js
Ohhhhhh
Stratton offered to pay for the name, and Koçulu suggested $30,000 “for the hassle of giving up with my pet project for bunch of corporate dicks.” It was clear the two men weren’t going to reach an agreement.
ah
They were in a public argument with the original maintainer of babel who gave up on it
Beautiful haha
as a result, someone made http://left-pad.io/
which you should absolutely check out
left-pad?
it immediately got republished by npm for obvious reasons, without the original maintainer's permission, which made him (and quite a few others) rather annoyed
chad
var i = -1;
++i;
``` vs virgin
```js
let i = 0;
i++;
as he said
I want all my modules to be deleted including my account, along with this package. I don’t wanna be a part of NPM anymore. If you don’t do it, let me know how do it quickly. I think I have the right of deleting all my stuff from NPM.
how about
i = 0
i += 1
nah, too easy
but that's the thing, you do not want i to be 1 
from __future__ import annotations
@lambda c:c()
class __annotations__:
def __setitem__(self, name, value):
globals()[value] = globals()[name]
class Number:
def __init__(self, value):
self.value = value
def __pos__(self):
self.value += 0.5
return self
def __str__(self):
return str(self.value)
let: i = Number(5)
++i
print(i)
```Or perhaps
What's annotatinos
It'll store annotations of global-scope variables
!e
a: int = 5
print(__annotations__)
@tranquil orchid :white_check_mark: Your eval job has completed with return code 0.
{'a': <class 'int'>}
Why are you using future, aren't these already implemented in python 3? Or 3.8 I think for the specific version
Not stringified annotations (I don't know the actual name here)
let: i = Number(5) i here would be undefined without it
And would just throw an error
Ah
let: i = Number(5) this is related to the future?
The i is
It turns it into "i" basically
Rather than searching for the variable
Which wouldn't be defined
I can't wait for them
I often want them
I believe it got pushed back
To 3.11
Cause it just breaks absolutely everything
what does virgin mean?
No
Let's not do this here please
if i++ and ++i add 1, shouldn't ++i++ add 2?
how are they different?
in C, that one is UB, in java, it is defined
I wonder how I wonder why
Pineapple Coffee is a thing over here under the blue blue sky
But seriously
Like wtf
Why Pineapple Mint Coffee
pineapple pizza
in java yeah, but not in C or C++
how do I change the url on an html website?
hello
how do I change the url on an html website?
wdym @open pewter
hi
@frozen crane how do I ssh into coffee
$ ssh addict@coffee
idk tbh
lol
I can't remove the file name on my website
who is this et al guy and why is he in so many scientific papers
ah, my bad
who is feat and why is he in every song
feat = featured
if it was a joke, should of put /s
not reddit
discord uses it all the time man
there's a lot of stuff you can do with these increment/decrement operators :D
i +++++ i, the fence operator (not sure if it'll work lmao)
i --> j, the arrow operator
hello obj
Hi aru
lol
can monkeys grow beards
————————————
they already have fur on their chin why need a beard
@prime aspen i hate slowmode, do you mind if we move here
Sure
huh
what does make -j <number> do?
I'm planning to ditch Pytest and move to https://github.com/darrenburns/ward
How many compile jobs in parallel
Not sure, need to check
if you got 2c4t make -j 4
okay
Your PC shall suffer but you get speeb
@vapid nymph oof https://github.com/darrenburns/ward/issues/263
ow my eyes
I see what you mean
to note: I intend to make unittest compatible tests, just they're ran with pytest due to pytest-cov
also

why does ward have jinja2 as a dep

and pygments and rich
why does compiling take so much resources
Need color in life
huh
ik but
coloredlogs is already a dep 😔
so colorama is a dep
oh no 43 packages to go
like
and i f-ing forgot to include tkinter
would be nice to use some stuff that i already use
Maths gotta be done to optimize the binary
ah okay
wrong venv
this project is for 3.8 and 3.9 so i have two venvs
hmmmmmmm maybe i should use venvs instead of fumbling around with anaconda even tho i have no use for it
also why is vmmem taking 1.5 GIGS of memory
that's a lot...
ah i c
@odd sluice Might as well have some very fast music to speed up compilation
It's not superstition if 50% of the time it works all the time
ow my ears
it gets better/worse
OW
oh yea, turn your volume down
which is a big enough reason for me not to use it
since
unittest tests are compatiable with pytest
which means i have a fallback
btw
arisu, do you wanna work on a project I'm making
whatchugot
discord modmail bot 
GH repo?
Gonna wait til stable v2.0 and migrate my cogs there as exercise first
huh people what's the syntax for update-alternatives?
Used it a few times, can't remember
ah yea
there's like
no source for it
so we're just starting with v2
that's a pending pr if you want to review it
root I think
it's not documentation of the project; rather instructions for contributing to it
true
license and readme also aren't in /docs/
it looks like a knitted scarf
lol
oh boy
smh what
Anyone know of a community I could ask general programming questions on? or where they could direct me to such a ressource?
!guilds
Communities
The communities page on our website contains a number of communities we have partnered with as well as a curated list of other communities relating to programming and technology.
hi can someone help me with js code ?
i am trying to fetch an api and save it as a var but i dont know how to do this
btw i am using wix.com
Api call is just making a request to url. Most APIs use mainly/only gets, posts, and puts
how i do this ?
I don't do js coding, but I'd say: just like you do any other js get and post calls
Y'know, am I the only one who thinks it'd be kinda cool if Discord had "stories"
I don't know how I would feel about that
I like how discord doesn't put too much of an emphasis on your "profile"
aren't stories at their core short videos?
hmm
Yeah
soon there will be discord reels following that 😬
They've not got to be videos, but I was just thinking about how I wish to like communicate with all my friends without the pressure of response
yeah, IG just getting twitter inside of discord would not be terrible
hello guys i am a deleted user
ah
What algorithm is used to write the text for the channel name?
wdym?
Off topic names are managed in this file: https://github.com/python-discord/bot/blob/main/bot/exts/fun/off_topic_names.py
its a few inches long so it wouldn't be a very useful one
Sounds like a useless adapter then
I guess it has a power switch but couldn't I just unplug the pi?
Hm
The string has mostly repeated content
1 char difference for the first 7
Same char for the second 7
So like, it's there a way I can reduce the repeated content
Im not too sure, I'm not an expert in rust, so if you have a question about it you could have a go in the rust server, they're far more accomplished then me
Okie
mmm i wonder what's a pepperess 
@clear plume
:)
could maybe assign those unicode to a variable? would be more readable for the user too
using a package
Good idea
Yeah I probably will use termcolor
lol
in format can't you have like 2 brackets and then 2 values to be placed in them? just asking cause idk rust
I don't fully understand what you're saying, but I believe so
something like rust equivalent of :
"hello {}, today is {}".format(user, date)
u can
in rust that'd be format!("hello {}, today is {}", user, date)
ahh alright pretty cool
if you assign it to a variable format! won't work tho
it can only use literals
No....
That whole function returns a String
That I pass into another format! later on
format!("{}{}", ansi_col, text)
format! would be pointless if you couldn't add logic
ol
format!{"\u{001b}{}{}\u{001b}[0m", ansi_col, text}
``` wont work?
That should work
dam, monkeytype's "code python" is now updated
yay, it's chili's otname
finally
Fr
?
fuck you discord previews
ugh
because of a project I did when I was still learning python and was in over my head
u usually say something like that everytime a bot or a thing doesn't work as you would expect...
I'm sure everything I build doesn't work as I would expect XD
lmao
Anyone who uses linux on a daily basis, what's better about it than windows? I installed linux on an old laptop recently but I haven't really figured out the point of it over Windows.
C development is nicer and you get access to the gnu ecosystem
From what I've heard and seen it's mostly about how you can configure it
Plus most of the time it doesn't come with 50 gigs of bloatwear
ye, it also tends to work better under resource pressure, and some people really love their eccentric window managers and desktop environments on linux, where windows just gives you 1-2 depending on how you count
Ok, but I can't get over how annoying installing apps is
yeah, that can be an issue sometimes
some would say its easier on linux
it really isn't
beuae u dont have to search the apps website for the right installer, u just make ur package manager do it
I'm coming from windows, I just prefer getting the installer off the site's page
on windows you have: download installer and run it
on linux: is the version in system repositories up to date? Use that
do you want flatpack/snap/appimage? Use that
does it have prebuilt binaries in gh releases? Use that
does it just have source distributions for linux and you have to built it from scratch? GLHF (this is python for example)
also, do you really want the application as a system dependency
That's why I installed pop_os, which is nice since it comes with an app store
Ubuntu brought new life to my old laptop. With Windows it was lagging and struggling to get along. With Ubuntu it is packaged with apt, which is great to use from the terminal
that's the same issue as everything else, just one more way which will not support everything
linux app installs are practically unfixable due to the way linux systems work.
Same
The laptop cost me 400 dollars 6 years ago lol
And it's perfectly usable now
joe is arch btw
a potato flew around my room before you came
I always thought you could call functions in type annotations.. Like ```py
def some_func_that_returns_type() -> None: # Typed as None
return
class Test:
# Should be typed as None because that is the return type of the function
val: some_func_that_returns_type()
Wait why?
No that's been reverted? from __future__ import annotations won't be the default?
ye, it was postponed until 3.11
it was going to be in 3.10
but then all the people using annotations for not type hints got mad
Ah, this is still a draft yeah https://www.python.org/dev/peps/pep-0649/
like fastapi and pydantic
it makes sense ngl
i’m sad my original wii is giving me an error message when trying to read discs
It just started being wierd
i think i might have to take it apart
and clean the reader
from-future -import-braces does it mean python will be a clone of LISP ?
Uh, wdym
Have you read the error?
!e
from __future__ import braces
@wraith hound :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | SyntaxError: not a chance
No braces
!e
__import__ random
print(__import__)
print(random.choice([1,2]))```
alright so I have connect raspberry pi dht11 to a flask website
the data required is humidity and temperature
then I need to be able to graph the value collected for the day
!e
__import__ random
print(__import__)
print(random.choice([1,2]))```
okay
what is __import__
so you need to graph temp and humidity?
yes
im not too sure
actually how do you graph using python
Is there a way ?
And then to print the screen
yeah
how do i do that
can i find it on github
you just have to use it to display temperature
thank you
will do
its actually a fairly simple package
it is definitely
is there a way I can request data from the raspberry pi and display it on my website
probably but i don’t do websites haha
websites are kinda a grey zone for me
😅
@shadow ridge here
okay
u first have to push ur changes to the fork
and then go to ur fork on github
and youll see the pr button
yes
duh, I mean what does it do
😩 I need eivl so I can talk about PC stuff and have him answer literally 1 question about wattages and a power bill
go on...
Ok so, I have a 850W PSU, and I need it for well, everything, and I was gonna ask Eivl, because I know that he probably didn't guy 11 hard drives at once, so I wanted to know how much higher his power bill went, when he needed a better PSU per hard drive
basically, I want to know if getting a higher psu will affect my power bill by alot
yo
fair enough thanks for help anyways @opaque jolt
😂
ok
u seem to use vscode even after finding vim 

vim is evil

i don't understand why people use it
lol
What, you can't figure it out?
no i cannot
Lmao
i still forget how to exit
i still have to search it up 
:q!
I didn't say it was bad
I said it was evil
Oh yeah it's evil for sure
hm
HMMMM
vim is for nerds who never have sex, true chads use joe
lmao
What's vim?
Shit
the only reason I even started using vim was to not have to press combining keys, and well, vim isnt good at avoiding that anyway
You think you're too smart, but you're not. https://joe-editor.sourceforge.io/
Joe's Own Editor Joe's Own Editor
My god
What's termbin.com
enter that into a browser
Huh cool
also i should probably change that port
Does it handle binary data?
it's evil-mode
no need that for ls
alias open="xdg-open"
alias lf="ls -AF --color=tty"
alias gf="git fetch"
alias gp="git push"
alias gcm="git commit -m"
alias gl="git log --oneline --graph --all"
alias ga="git add ."
alias gsa="git status"
alias f="clear"
alias fl="clear;ls -F --color=tty"
alias fa="clear;ls -F --color=tty"
alias rm="trash"
alias p="pacman"
alias sp="sudo pacman"
alias ls="ls -F --color=tty"
alias ys="yay -S "
alias cr="cargo run"
alias cdoc="cargo doc --open"``` man, I have some weird alias lol
ye
I can probably type Syu faster than anything else
Also I'm constantly riddled by pamcan -Syu
vim
Maybe I should set an alias
q
on colemak it's just rolling your fingers
/*
* Averages the pixels in a given image (img) within a circular
* region centered at (x, y) with a radius of 'radius' pixels.
* This function uses the "simple" approach to average RGB
* colors which simply returns the mean of the red, green, and
* blue components.
*/
color getAverageRGBCircle(PImage img, int x, int y, int radius) {
float r = 0;
float g = 0;
float b = 0;
int num = 0;
/* Iterate through a bounding box in which the circle lies */
for (int i = x - radius; i < x + radius; i++) {
for (int j = y - radius; j < y + radius; j++) {
/* If the pixel is outside the canvas, skip it */
if (i < 0 || i >= width || j < 0 || j >= height)
continue;
/* If the pixel is outside the circle, skip it */
if (dist(x, y, i, j) > r)
continue;
/* Get the color from the image, add to a running sum */
color c = img.get(i, j);
r += red(c);
g += green(c);
b += blue(c);
num++;
}
}
/* Return the mean of the R, G, and B components */
return color(r/num, g/num, b/num);```
Was directed to this channel t o ask for help in understanding this c++ code. I have intentions of converting it to Python but 1) Im not sure what some of the syntax here means 2) How the logic of the program works exactly
Anyone know specifically how this specific bit of it works?
```c++
/* Iterate through a bounding box in which the circle lies */
for (int i = x - radius; i < x + radius; i++) {
for (int j = y - radius; j < y + radius; j++) {
/* If the pixel is outside the canvas, skip it */
if (i < 0 || i >= width || j < 0 || j >= height)
continue;
/* If the pixel is outside the circle, skip it */
if (dist(x, y, i, j) > r)
continue;
/* Get the color from the image, add to a running sum */
color c = img.get(i, j);```
How does this give me a circle exactly?
And what does the syntax in the for loops and stuff (like int i = x - radius for instance) mean?
idk c++
but this is similar to javascript so lemme try
is this js or c++?
Tbh im not sure what lang it is,m i assumed c++ because of the brackets
is PImage some kind of image editing module like PIL?
so the first loop checks that the x coordinates are between x - radius and x + radius (the diameter)
next for loop does the same for y
the next if checks if x-radius and y-radius is outside the canvas (it skips it so that it does not render)
the next if checks if any of the above ones are outside the circle's perimeter (it skips them too)
i don't know what PImage is, but I can infer the following from the code
it has a method get which returns the colour values at that given point
then they just add the values to r g and b
this function finally returns the mean of the colour values of everything in the circle
so first for loop in python would be something like this?
do for loop:```?
and wont x ALWAYS be between x-radius and x+ radius?
yes
they are iterating between x-radius and x+radius
so it would be
for i in range(x-radius, x+radius+1):
...
it would work a 'lil something like this
bonjour hash
for i in range(x-radius, x+radius+1):
for j in range(y - radius, r+radius+1):
if (i < 0 or i >= width or j < 0 or j >= height):
continue
this is part of the code ^
the (i < 0 || i >= width || j < 0 || j >= height) is for checking that (i, j) is a coordinate within the image
yup
ah i see
give me a while to read, im a bit slow at understanding and reading code
ah ok
this prevents considering points such as this, which lies inside the circle but not inside the image
You have unlocked a new technique: Images!
lol
so its for literal edge cases, where im calculating circles at the corners or borders of an image?
ye
yes
i will pardon the pun
It's not in C++, I believe.
whatever it is in
it's readable
so 
in Rust you'd to if !((0..=width).contains(&i) && (0..=heigth).contains(&j))
Why.
if not (0 < i < width and 0 < j < height):
though they are also the worst Rust type, lol
https://ridiculousfish.com/blog/posts/least-favorite-rust-type.html
What is width here?
width of the image
width of the image
i see
I tried to understand the code and here is the understanding of it I cam up with , tho i still dont fully get it yet
send yo code and I'll try to help
for (int i = x - radius; i < x + radius; i++) {
for (int j = y - radius; j < y + radius; j++) {
```
In the first for loop, x-radius would be a point on the perimeter on the lft hand side of the circle, x+radius is a point on perimeter on right hand side of the circle
So basically here, the first for loop sort ofgets all the x values lying on a line going thru the radius of the circle
For every time the for loop is run, or for every value of x, we do a similar test with y.
for every value of x, we test every value of y
it's like a sequential search
like this what i meant
for n x's and m y's
we check:
x1y1, x1y2, x1y3....x1ym
x2y1, x2y2, x2y3.... x2ym
....
xny1, xny2, xny3.... xnym
yeah
yes
but why do we test values of y for every value of x?
because we want to scrape every pixel possible
we could check every value of x for values of y
it's just a choice
the final result is the same
But here is the prob, for some point i in the range(x-r,x+r) as marked by the green dot, if i traced a line containg points in teh range (y-r,y+r) (which i assume what the second for loop does) wont some of these y points go out of circle?
the two loops furnish every coordinate in thsi square
you then do the if (dist(i, j, x, y)) > r check to yeet the coodinates which are inside the square but not in the circle
doesn't matter
if you see the next if condition, that deals with exactly that
could the for loop be refactored so that we dont have to do the if?
Like if x was at center, y's range shoiuld be (y-r,y+r), if x was somewhere else on the line, y's range would be smaller, like (y-(r-w), y +(r+w)), where w is the distance in y units to the perimeter at that specific point?
smth like this
is what i mean by w
This way y wont go outside circle right?
hmmmmm
I can't think of anything off the top of my head
you'll need to find w somehow
yeah
yes thats the issue i dont know how to find w
would it make it faster?
this is fine i think
i actually think the extra calculation will make it less efficient
how? in the triangle here, we only know the base
not the hypo or opposite/tall side
like this?
🤷
so to calc max range of y within circle , it wouldbe smth like max y = sqrt(r^2-xAtThatPoint^2)?
I understand, just wanted to know if it was possible, is all
sqrt(r^2 - (x-i)^2)

I see
yeah xAtThatPoint is x - i
I would think so too







