#ot1-perplexing-regexing
1 messages ยท Page 592 of 1
cya
nice
blue cheeto
so back to this, to test if a point is within a circle, if i < 0 is true, it means i is outside the image
if i > width is true, it also means i is outside the image, so this if clause basically sees if i and j lie within the imaghe right?
And the 2nd if caluse sees if i,j are a point lying WITHIN the circle?
yep
yes
ah i seeeee
i sort of get how the algorithim works now!
Thank you both so much!!!!!!!!!!
welcome :D
depends
being able to done within under a few miliseconds or so, assuming c++, if not, it would be slow, im assumignhere
Occam's Razor
the most simple solutions are often the best ones
well, in Python you should be using numpy for this instead if you need performance, otherwise you'll have to deal with the slowness of Python no matter what
i remember seeing anoither method but it used these golden angles or something and blew my mind into pieces
it's simple
there might be a better one tho
you never know
what
my exact same reaction, it made no sense
gn!
afternoon here 
but thank you anyways
something like, uhh
from_x = max(x-radius,0)
from_y = max(y-radius,0)
to_x = min(x+radius+1,width)
to_y = min(y+radius+1,height)
image_part = img_arr[from_y:to_y, from_x:to_x, :]
Xs = np.arange(from_y-y,to_y-y)
Ys = np.arange(from_x-x,to_x-x)
Xs, Ys = np.meshgrid(Xs,Ys)
R = Xs**2 + Ys**2
mask = R <= radius**2
mean_color = image_part.astype(np.float64).mean(axis=(0,1), where = mask)
return mean_color.astype(np.uint8)
is how I'd do that with numpy
๐ค
doesn;t that get the bounding square
not the circle
how would i miss a few pixels tho? If the numebr im finding sqrt of is not a perfect square, ill HAVE to round down the sqrt anytway right?
there, fixed I think
because we cant have decimal values of y and x
idk
Thank you!
Tho ill admit im a bit unfamiliar with numpy ๐
it should probably work the same
well, really you shouldn't be using sqrt anyway just because it's slow ๐
yeah ig you could compare with r^2
instead of checking sqrt(x**2+y**2) <= r, check x**2+y**2<=r**2, that avoids a sqrt
ye
no wait
im not comparing anything there though
im finding the start and end y coordinate
ah, fair enough
why does this work though?
why not? these inequalities are equivalent
simply square both sides
im confused because, in
root three < root 10
you said we could write it as
3<10
But here is my q. 3 < 10 is the same as root three * root three < root 10 * root 10
Now in x < y, if i multiply the same constant 5 on both sides as in x * 5 < y * 5, I can understand how the inequality is 'maintained', since the exact SAME number is multiplied on both sides
But in root three * root three < root 10 * root 10, I multiply different numbers on each side (root three on the left, root 10 on the right), so how can we assure the inequality is constant?
Instead of checking if x+1 == y you can do x == y-1
It's same as for sqrt(x) == y vs. x == y**2
y - 1*
Oh yeah sorry
Sorry I dont understand, in this case of sqrt(x) ==y wont it instead be x == y*x if it has to maintain equality?
If a==b, it follows that a**2 == b**2, always
In other languages I think you do ^?
If the square root of x is y. Then x is the same as yยฒ (y^2 but in Python typed as y**2)
inequalities are a bit more complex - if a < b and also a and b are both positive, then we can say a**2 < b**2.
That's the case in going from sqrt(x**2 + y**2) <= r to x**2 + y**2 <= r**2
.spookyavatar
weeeeeeeeeeee
Is this because a is smaller than b, so if we do a*a, it will always be smaller than b*b ?
Yes I understand
And all of this (except for >0 part, because negative * negative = positive, which I'm not sure if its axiomatic ) is to be considered axiomatic?
small * small < big * big
Nah. Suppose x<y and they are both positive. Then y*y > x*y (because y>x and y is positive) and x*y > x*x (because y>x and x is positive), hence y*y > x*x
(if it's not clear why y*y > x*y - it is equivalent to y*(y-x) > 0, which is true because y>0 and y>x ==> (y-x)>0)
.spookyavatar
.savatar
.savatar
wow so creepy
hey this just switched up the parity!
.spookyavatar
Oh yeahh
I see! Thank you, that's a nice way to proof it!
Thank you too, for an intuitive approach as well!
.savatar
.spookyavatar
.spookyavatar
.spookyavatar
#bot-commands !
TheDevilBacon
Lol, sorry that I contributed to the spooky train
evil boy
.savatar
.spookyavatar
lol
Neat
when are quantum computers coming?
alr ig
Not any time soon
just not public avaliable because the computer youre using is alr gud enough
no it's not lol, i have poop cpu and 1gb of ram
Quantum computers dont do better at traditional tasks than your pc back home
Dont get sucked in from all the hype
they are better at breaking encryption
No theyre not
They are cool due to the technology they employ and the possibilities they bring, not their current capability. (in my opinion)
enough for you, dont compare. it works fine youre able to type here
could
lol
alr then
Why would encryption stay the same as today but quantum computers could advance
Encryption would also advance
Anyway you dont need a quantum computer now or ever
yes
this is just like saying that self-driving cars unnecessary because they don't do better than the average driver
They do though
yeah
Bro are you kidding, the average driver is shit
a computer cannot drink and drive
.savatar 263560579770220554
or fall asleep at the wheel
ops
Do you know how many people die each year from car accidents
more than 3
a computer can run out of battery at the wheel lol
bruh
fr
as of today, elliptic curve cryptography is practically uncrackable at key sizes a microcontroller could compute in real time
so I can't imagine quantum computers will change that, they aren't a more powerful method of computation, though they may end up much faster for some workloads
I like how these are perfectly valid terms but still sound like star trek technobabble
quantum can beat rsa tho
current computers can beat rsa
that's why we are depracating it
multiplication gets harder for large keys, and finding prime factors get "easier"
general number field sieves are kinda insane.
It's like cookie clicker
when you first upgrade your cookie factories they don't outpace the old ones
but you know they have the potential too
Their potential is not as general as people think, its not like they'll replace the traditional computer in households
Most people donโt need the computing power capable of cracking modern encryption, so itโs likely itโll just be a researcherโs machine
But arenโt quantum parts really expensive
Except classical computers were an improvement at all their functions, quantum computers arent
What's your favorite thing to do in programming guys? Web dev? Game dev? AI? GUI Dev? etc.
burning the language 
esoteric stuff
Dockerizing literally everything
ic lmao
but like
what aspect of programming
like from the main ones
Web dev
Game dev
idk Generative art
And like, Data Structures/Algos
Or something like networking/security
Full stack web i'd say
Ah, that's nice!
I asked that question cuz I have kinda lost passion gradually in this quarantine and it's reached a point where I hardly code nowadays yk
Vue is just as good as react. it's just less popular
You probably didn't like it because React already satisfied your needs yk
Im not that good with react, i just made a couple SPAs
"made" is an overstatement i guess
SPAs are the whole purpose of frameworks like React and Vue ig
Yea but its not like i finished the project and deployed is what i mean
Its functioning but they dont look good either
I suck at design
Ah
Well
idk why but 99% of the fullstack programmers (Including me) suck at designing lmao
idk anything about networking
maybe i should start after i finish this crypto thing
Like , I know CSS, but I can't think of a proper design
Networking is very good to know, even if you don't use it
Well, you use your wifi anyway lol
lmao
dis gonna take some time though
probably a couple months
Networking is mostly theory and not actual work though. I found it boring but still suffocated and learned (somewhat) lol
also
if you have nothing else to learn, try functional programming if you haven't already
just saying
is functional programming something you learn?
hmmm what does it consist of
Functional programming languages
im kinda addicted to oop
Like Haskell, OCaml, and other stuff
Try FP it's fun imo
Oh and scala mixes FP and OOP
Maybe try it
Scala is nice
Pick a lisp and try it
what is FP
gimme an example
FP is functional programming. In functional programming, everything is a function (plus datatypes, yes). And what is a function? A function is an operation which returns one thing for each value. if f(x) = 2x , f(1) is 2, and nothing else. Basically, a FP language is a language avoiding side effects as much as possible
Those side effects also consist of printing something to the console which is one of the only side effects that FPs don't avoid
Like in Haskell, side effects are ONLY possible in the main function
But there are some languages which have side effects too, yk
ah ok
You can also search for the wikipedia page, it has more details
Hahaha and Python is OOP compared to that
yes lmaooo
Like... classes are types. And you can control how those are created.
You can define a metaclass, which will decide how a class is constructed. The class of course you define to decide how an object is constructed.
i am addicted to classes
idk why
i make classes for e v e r y t h i n g
Not everything needs to be a class
can't hear you over my jvm
In Haskell, let's say , the datatype PrintThis, which holds a string, has a type constructor and a data constructor. Data constructor is a function which gets the values and returns the type. Like we can get PrintThis "Hi" just like what I wrote. PrintThis is the data constructor. It gets a string as an argument, and returns PrintThis + The string it got. The type constructor is used when defining function types . Let's say, we wan't a function that always returns PrintThis "Hi" , it would be like this :
myFunction ::
PrintThis -- This is the type constructor
myFunction = PrintThis "Hi"
idk if that's 100% correct but that's what I know lol
but yeah that's the type system
(a part of it)
the shadow realm
In appdata/roaming/pypoetry
how is it going andre?
.
Favorite paradox: "This statement is False"
if python were javascript, we would speak with a different language. We would use the pathlib API and the requests API and the SQLAlchemy API and the list comprehension API. What end would there be to things that are now APIs?
f-string api
shebang line aat the top of the file api
thats how js really is
the relative import api
why are they so attached to that term?
Im going to update my .bashrc later with some new aliases. Gotta love that bashrc alias api
pathlib is an api tho and so is requests and sqlalchemy
Right.. But we dont say that constantly with every thing in python
Introducing the x API
that is how anyone talks about javscript
its not about there being a package. IF JS came out with some like... type hints, which were growing in popularity....
It would "the new type hints API"
its not a objectively bad or good
its just how they talk
we have a better range of descriptors
because everything isnt just api.
I've never heard anyone call arrow functions an api
Or interfaces an api in ts
So where does this even come from
fetch api, useContext api, function components hooks api
Those are apis
im not debating that lol
useContext is a hook
Bruh
i can find you twenty aarticles right now that call functional components an api.
You mean react hooks?
python:
the method call protocol
the descriptor protocol
the iterable protocol
the iterator protocol
the boolean protocol
the attribute access protocol
the item access protocol
the mapping protocol
the sequence protocol
the set protocol
the mutableset protocol
the mutablemapping protocol
we aren't much better tbh
React hooks are APIs why would they call them anything else
This is just pointless complaining about js
Im not complaining about JS. im remarking about it. Objectively, there isnt bad or good preference for a general term.
But as you read about JS in the JS community, you find the use of the word in excess.
API is a very general term, and yes, JS uses it in places where python would say module
Module, package, etc are not more descriptive as just saying API anyway
Whereas in python, we say something is an API when like.... Qt5 gives the same bindings in C++ to use it with a language we know.
SQLAlch would be a good exaample of something pythonists would call an api yeah
They're not.
But JS has a culture of trends that we dont thave
in the same way
and when you read the articles you see it
disclaimer, right now i do way more js than python btw
Is it even possible to shove this into a lambda function?
yes, but I would not do that
Why would you do that
I don't know but now my brain hurts
I just want to make an inline lambda with the algo I made above
and then map it to this mess
I already made a reasonable solution
the input has to be a string, and the cases must remain in the same place/index as they were found in the regular string
only for the string to be reversed and maintain the case locations (or whatever you call it)
ignore the gibberish at the top of the terminal
there might be a simpler solution; I tend to over complicate things
this is truly marvelous
@tardy rain
Right now i am currently using the two monitors on my desk while sitting in my chair api
I feel like API is a better term in reference to the actual reference material.
and the specification inside of it.
in the sitting at your desk api, you can pass a height to the chair object and set the state of its vertical positioning
you could say the lever is a hook into this state
but of course, in js, you could also just say that its an api
the chair api
๐
"Learn to use the chair API in twenty minutes in all of your react projects!"
my full course is available
ill leave you with just one question this brings to mind
is the chair api relevant in 2021?
ah
you collapsed it
mary had a little lam its soul was black as coal one night it walked in to her room and it ate her soul
Story of my life
danm
i take her home i spent all night


so... poetic!
you know
they should teach this to children
much better
If you're bored, I'd appreciate help on upvoting the Python Developer in Residence article on Hacker News (by the end of the New page).
alr
oh that's what ycombinator is
i was like "wtf is that site man"
or is it that site hmm
Yes, news.ycombinator.com
i dont know why its named hacker news tho
link? I don't see which article you are talking about
why is PHP hated btw? modern PHP has most issues resolved, right?
which popular language isn't hated
um
I mean, at least JavaScript or Python are loved my many. most PHP developers have quitted/hated it yk
by*
lol autocorrect
PHP, originally called "Personal Home Page" by its author, was an alternative to CGI and at the time of creation didn't have ambitions much bigger than "provide a few server-site niceties straight inside HTML". It wasn't designed as a fully fledged programming language, and its builtin functions weren't particularly thought through as a "standard library" that will grow.
It became super successful because through Apache it turned out that it's trivial to provide SHARED server-side hosting for people with as little as an FTP account. No long-running processes, no server-side configuration (besides .htaccess I guess). It became very popular very quick, and with that, people wanted to do more with it.
At around PHP4 the old design started really show its age. PHP5 shed some of that cruft, and PHP7 copied some performance-improving ideas from Facebook's HHVM. It's now a modern language by all means. But people remembering PHP3 will never forget its clunkiness and disregard for security. So they complain to this day ๐
You're saying that JavaScript is loved by many. Yes, but many old timers remember times of Internet Explorer 6 and before and that JavaScript sucked baaadly. I bring up Internet Explorer because while it's rightfully hated for a lot of things, it was Microsoft who came up with AJAX which changed the entire thinking about what is possible in a browser. Before it was all "fat plugins", with Java, Silverlight, and of course Flash, being the biggest players.
Now everybody takes it for granted JavaScript allows nice async networking and has full front-end multimedia capability with audio, video, and an hardware-accelerated 2D canvas and 3D engine built right into the browser.
Not so long ago none of this was true.
I ran a successful Java WebStart CMS-style application for a while that was used at Polish universities ๐
damn
and that was 2006-2009 so really, not so long ago.
It was very popular because all those university office computers in 2006-2009 were still some locked down Windows XP machines with IE6. Nothing else worked if you wanted multimedia.
At the peak we were in >40 universities.
The US financial crisis killed it eventually as advertising dried up.
is there a current alternative to php/cgi/wsgi for shared hosts?
Ah. So it's because they had really bad experiences in the past
0j0php
i made an elephant
damn
IDK, Netlify is "free" and there's plenty of tiny VMs for $3 - $7/month.
ah no, I mean for like universities that want to give their students websites with a bit more logic than just a static site
my uni gives me cgi and php
and while cgi works, it is quite slow
I do miss AJAX occasionally, that was really a game changer
has anyone read the book: Journey to the center of the earth
Jules Verne right? yeah its quite a famous one.
so if i have a method like this,
@staticmethod
def meet(rule_1, rule_2):
new_rule = []
for i in rule_1:
rule_added = False
for j in new_rule:
print('=>', i, j)
if i.intersection(j):
j = j.union(i)
print(j)
rule_added = True
break
if rule_added:
continue
r = deepcopy(i)
for j in rule_2:
print(i, j)
intersection = r.intersection(j)
if intersection:
print('found intersection')
r = r.union(j)
new_rule.append(r)
print('uhm', new_rule)
r = Partition.to_rule(new_rule)
del new_rule
gc.collect()
return r
here i was kinda trying to manipulate the j inside new_rule, what would be the way for it then?
oh you could use j.update(i) too
enumerate and index
wait what
In [1]: a = {1, 2, 3}
In [2]: b = {2, 3, 4}
In [3]: a.update(b)
In [4]: a
Out[4]: {1, 2, 3, 4}
๐ค
can u put a frozenset inside a frozenset
if b is a frozenset it works
yes
nice
yep you can.
okay.
ah i see, frozensets should be immutable. what the fuck is wrong with me.
so to let it update, I'll just keep it as a set, and to have sets inside I'll keep new_rule as list right now.
but no if i do that, i wouldn't be able to update the inner element in next iteration right?
yeah wait
so in this code, what I'm doing is, in first inner loop it is possible to manipulate the element of new_rule.
So if add a frozenset, I won't be able to manipulate it by update or anything.
So i need it as a set.
And as it is a set, i cannot have parent as a set. So I'll need to keep it as a list.
!e
def to_rule(rule):
return frozenset([frozenset(i) for i in rule])
def meet(rule_1, rule_2):
new_rule = []
for i in rule_1:
rule_added = False
for j in new_rule:
# print('=>', i, j)
if i.intersection(j):
j = j.update(i)
# print(j)
rule_added = True
break
if rule_added:
continue
r = set(i)
for j in rule_2:
# print(i, j)
intersection = r.intersection(j)
if intersection:
# print('found intersection')
r = r.union(j)
new_rule.append(r)
r = to_rule(new_rule)
return r
print(meet(to_rule([[1,2], [3,4,5]]), to_rule([[1], [2,3],[4,5]])))
eh
@rough sapphire :white_check_mark: Your eval job has completed with return code 0.
frozenset({frozenset({1, 2, 3, 4, 5})})
ah alright, this is working now, I'll need to check again, I somehow missed edge cases last time.
why do you have those dels and gc.collects btw
yeah about that
i actually had partitions of like 400 elements.
so when i was doing meet and join operations, it was eating up ram on colab.
Because i had to do it on a lot partitions.
But issue was it was not releasing from somewhere.
So i did bit of commenting and found out these were causing issues.
So i tried to clear them out, and now things are working fine.
I never experienced this before tho.
It may be colab or may be my code, but after removing them forcefully, ram is getting managed.
hmm
but tho colab is fucking handy
it works perfect with drive, so we get file system and cloud so PC all easy going.
yeah colab is nice
i don't feel that comfortable with notebooks but ive still used it a few times
wow, I kinda started py with notebooks, i feel so strange with actual py files.
heh
notebooks are just so so handy
the closest i get to notebooks is my ipython shell
cya
@acoustic moss
So it should be
j.update(j.union(i))
right?
no just j.update(i)
uhm no wait
In [1]: a = {1, 2, 3}
In [2]: b = {2, 3, 4}
In [3]: a.update(b)
In [4]: a
Out[4]: {1, 2, 3, 4}
weird, I'm doing something wrong.
oh okay alright thanks, I got some bug in my code then.
hey guys could someone google "why do i have no friends" i can't really rn cuz i really don't need google giving me craigslist ads
๐ thanks
y'all, I have a question.
For a location for modmail addons/extensions/plugins/etc (basically user installed third-party stuff, mostly from github, might add some gitlab support too)
how does this seem?
modmail/plugins/{USER}/{plugin_name}/{files}
modmail/plugins/local/{plugin_name}/{files}
@solid pollen asking you because I know you use plugins lol
What's the context? What is that structure, the git repo ? @vapid nymph
yeah
well
no
where the files will be installed to
the git repo will be like a monorepo
extension repos structure:
/{plugin_name}/{files}
So you are asking what modmail should support or how you should structure it with the current support?
I'm asking for how you think it would be best to install them on the bot
what folder structure on the bot should the plugins take
Are you asking for like your own modmail version?
yeah
@bleak lintel u 2 ๐ฅบ
not sure if i should also have a source like /gh/ and /gl/ since I want to support both.โฆ
then again, this is easy enough to change before release
lol I don't care
ultimately I run things in docker
so it could go in /etc/golang for all I care
well yeah
its more the import order
like
if you want to import from a different plugin
which I'm not saying will be supported, but I'm not saying it won't either.
but addons will be heavily supported
tl;dr I wrote a system to not load cogs unless the bot is in specific modes
so it will have an extension manager for built in cogs, eval command, etc, but they won't load under normal usage unless the env var is explicitly set
Lmao
Could you guys tell me which one looks better?
I'd also appreciate any feedback on either.
Number 1
i like the first one, but make "Bill Gates" have a consistent style
ahh thank you. So for the name part, i shouldn't have the last name bold?
also, i am not sure if the job description is too tiny, is it readable? (for number 1)
As long as text isn't smaller than 12 pts you should be fine. I also prefer the first. It's cleaner and looks nicer.
Awesome, thank you
this channel name is perfect right now #ot1-perplexing-regexing
@rough sapphire What are you on about?
What's coming though?
uh
I use arch btw
:<
made a quick design of a trans birb lad. he is a fashion designer
interesting
im excited to make some more clothes for him. and digitally color and stuff
hmm making clothes with holes for wings AND arms
it can be constructed with a more open back/sides
the clothes will be more colorful, prolly not the wings
but... i am gonna have lots of fun with fabrics. i wanna make an outfit with batik, a fabric dyed and patterned with beeswax
im just like that
yes
im trying to authorize github for android studio, and after i login, its redirecting me to http://127.0.0.1:63342/api/github/oauth/authorization_code?code=not_showing, and its giving me a sign-in pop up. What does this mean, and how am I supposed to sign in?
ive never seen this before, and idk what im supposed to use to sign in
github login doesn't work
hmm i tried using a token again, and now it worked. token didnt work the first time fore some reason. still have no idea what that redirect was
that guy is talking with a coffee bruh
if you didn't get the joke: ||(java is coffee)||
lmao
what about the guy learning julia or ruby
julia is a girl ig. sure you can talk to her
you'll need to learn to speak with nonexistent objects (a gf) and inanimate objects
ruby is expensive i'ma not learn it
so if you want to learn zig you talk to Zig?
Joe-E is a subset of the Java programming language intended to support programming according to object-capability discipline.The language is notable for being an early object-capability subset language. It has influenced later subset languages, such as ADsafe and Caja/Cajita, subsets of Javascript.
It is also notable for allowing methods to be ...
you know what to do

The Lemon Programming Language
Breaking News: Joe-E becomes the primary language of arch
no sebastiaan programming language rip
joe lang when
.
hsp whats abnended
banned
but. but no. thats just, how you spell like that
this is a c copy man (except for objects)
nothing is similar to c except the braces
looks a lot like JS, really
except def
it is like you combined JS, C/C++, and python together
var, ;, dynamic typing..
they played both sides
nooo, the "both" memes have spilled over into ot1
yeah it literally looks like python and js mashed together lol
# - def - print -> python
// - {} - ; -> C/C++ - JS
var -> JS
they're even using objective-C in their code
lol
why not both channels
who said brackets are only for c cpp and js
!pypi brackets
natively it isn't for py
I keep getting an error, am i doing something wrong?
const API = require('kasu.nhentaiapi.js');
const api = new API();
async function sauce(){
let id = api.pRandID;
const val = await api.getID(id).json()
console.log(val)
}
sauce()
(node:15708) UnhandledPromiseRejectionWarning: TypeError: ID.replace is not a function
at main.getID (C:\Users\snowy\Documents\GitHub\Discord.js\node_modules\kasu.nhentaiapi.js\lib\main.js:28:30)
at json (C:\Users\snowy\Documents\GitHub\Discord.js\test_nhentai_api.js:6:27)
at Object.<anonymous> (C:\Users\snowy\Documents\GitHub\Discord.js\test_nhentai_api.js:10:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
(Use node --trace-warnings ... to show where the warning was created)
(node:15708) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15708) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Well, I can't say I'm familiar enough with JS to know this
However
(await api.getID(id)).json() I'd imagine you meant to do that
Nah, that didnt do anything, thanks tho
Nice api You're trying to use 
wtf why are both so similar
I*
see this masterpiece
you'll understand
what in the goddamn fuck is this
c preprocessor macros
see that #include "__py__"? thats where all the macros are
you defined cpp functions.. this guy just pushed it to another level
luckily you can use the gcc preprocessor on any file
but no cursed
if you have gcc, try this ```py
gcc -E - < yourfile.py
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)
```Just abuse Python syntax and make monsters
what does include __py__ do
it includes my macros
without it this won't work
ohh... macros is?
in c you can define macros which substitute the thing
for example
#define NOT_HELLO_WORLD "hello world"
printf(NOT_HELLO_WORLD)
the not_hello_world gets subsituted by "hello world"
the thing is, the substitution happens literally
#define infiniloop while (true) {
#define end }
infiniloop
stuff
end
``` becomes ```c
while (true) {
stuff
}
ah alright coool
which is what im abusing in python
so u defined macros like.. print to printf.. print("some string") to printf("%s","some string")?
wait lemme show you the macros
// Normal py stuff
from typing import *
from functools import reduce
#define do :
#define end
#define puts print(
#define close )
#define let
#define foreach(var, iter) for var in iter
#define try try:
#define catch(exception) except exception:
// Aliases
#define fn lambda
#define require import
#define ret return
ah coool
so py #include "__py__" f = fn x,y: x*y becomes ```py
f = lambda x,y: x*y
geee this is cooooool!
you can do this if you have gcc
i sound like a 7 year old.. and i dont mind.. this seems so cool
what the fuck is this
python abuse
it's cpp running on python code
exactly
i just slapped a bunch of macros inside __py__ and included it
so why do you have py syntax highlighting
but it's a comment
yeah, but its preprocessed by a c preprocessor, so for it its not a comment
it's important to keep in mind that the cpp is completely independent from C or C++ and even has it's own tokenization rules
c++ is cpp isn't it
cpp is the c preprocessor
for some reason cpp hangs for me, im using gcc -E as the preprocessor
still works
ye
it takes stdin by default
wha
the syntax highlighting is enough reason to keep elvish, even if it is not as nice as powershell
i made my first python package! https://test.pypi.org/project/example-pkg-InvisibleOS/0.0.1/
there isnt anything in it so
no use of downloading it lol
but im just happy that i managed to upload it
nice
ill make a new one for another project
btw im unable to change the description
the project description ;-;
so you can do gcc -E file.py && python3 file.py to "enjoy" the "benefits" of macros
uh so i have some code like this... (not some program code.. just a random scenario i ran across while making a program)
if n<10:
return "hello world"
while True:
yield n
n+=1
so if i put n=2 or sumn ... it basically returns None
so i am wondering what caused it ๐...
like does type of a_func become generator and the return function will not return some value but just mark end of function? ---> if yes why does it happen so ๐
it should return "hello world" tho
hmm
!e ```py
def a_func(n:int):
if n<10:
return "hello world"
while True:
yield n
n+=1
print(next(a_func(2)))
@opaque bronze :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 7, in <module>
003 | StopIteration: hello world
thats strange ๐ค
yeah
why is this strange
why did throw an exception tho
not an exception
it just returns none
!e ```py
def a_func(n:int):
if n<10:
return "hello world"
while True:
yield n
n+=1
print(list(a_func(2)))
@spare lance :white_check_mark: Your eval job has completed with return code 0.
[]
why list
just to show it returns None? ๐คท
because you are not yeilding hellow world
the worst of both worlds
!e
def a_func(n:int):
if n<10:
yield "hello world"
while True:
yield n
n+=1
print(a_func(2))
@rough sapphire :white_check_mark: Your eval job has completed with return code 0.
<generator object a_func at 0x7fbc9019e6d0>
use list to catch the output
or starred
but this will yield "hello world" yeah
and the numbers ahead too
!e
def a_func(n:int):
if n<10:
yield "hello world"
while True:
yield n
n+=1
print(list(a_func(2)))
@rough sapphire :warning: Your eval job timed out or ran out of memory.
[No output]
yeah outta memory, expected.
So what is your issue @spare lance
while true will keep running
yeah obviously
not issue lol.. i am wondering what return exactly does and why it doesnt do
yield "hello world" ; StopIteration
uhm, probably someone better may help.
okay the answer to second is prolly that it isnt defined that way.. but what is it defined as then ๐
usually when you next a iterable, you expect a value or StopIteration, but not both ๐ฅด
ah hmm that could be one thing
Does anyone here how knows dynamic programming?
the peeps in #algos-and-data-structs sure do
hm
can i vent programming woes here?
What kind of venting are you planning to do
Blue sus saw him vent
Because the programming subject dropped me from the course because my code LOOKS like what someone posted online
after 3 months of work
Uh oh
someone from the same course had a smart idea to post the problem on stackexchange
I'm like collateral damage cuz i've never seen the forum post
how do you properly detect plagiarism of code?
is that even a thing?
if it's word for word sure
File creation date vs stackoverflow date?
shit is that a metric used?
if you had a git history, it could be pretty convincing proof, that is a bit hard to fake
is that something to do with github? mine was always done locally so im not sure i can use that
like i never used github or uploaded my code in any way
Yet another case for the use of git
noted but my god
Is this about school work
ye
If you could somehow have a discussion with who is running the course it would be worth a shot
Best you can do is plead with your dept head i guess
it sucks so much because I have to retake if I don't fight the accusation
the issue in question was a machine problem where it was about graphs and flows and capacities and all of that
and the MP was split up into like subtasks and u couldn't move on from 1 subtask to the next without completing the previous one
the reason it was flagged because it looks like I used similar variables, liked the named variables were similar in function albeit with different names
yeah, if you didn't use a version manager, that's not useful
ye thats the part that's ass im not sure if i have good enough ammo to shoot
the only ammo I have is that the subtask where I supposedly 'plagiarized' is that it was a copy paste from the previous subtask I did, because it was basically almost the same code with a different function at the end
my argument is that if I plagiarized the subtask in question, then why is the code in the previous subtask similar? Won't that mean the variable names in question was something I came up for myself and not copied online?
idfk i almost got a heart attack when i received the email about the whole goddamn thing
can i go off topic in off topic
that's why it is made for ig
what
Everything is on topic
yes
so help me with potatoes
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>JavaDiscordBot</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>dv8tion</id>
<name>m2-dv8tion</name>
<url>https://m2.dv8tion.net/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.sedmelluq</groupId>
<artifactId>lavaplayer</artifactId>
<version>1.3.77</version>
</dependency>
</dependencies>
</project>```
error in groupid and artifactid and version
copied from docs
placed in right place
but why are the potatoes not frying
not to mention, the only messages i get in the help channels that i open are "help channel has been marked dormant" messages
looks like u also like going absolute off topic
Have you considered asking better questions
I'm making a windows assistant, anyone have ideas for some features I could add?
elaborate the mango
i mean ur windows assistant
off topic in off topic channel 
yes
it's all objects
i know this isn't a meme dump, but there are no ongoing convos so i'm starting one with this meme
bruh
dont
block
my
problem ffs
bruh no one answered you in 15 minutes, of course i can start a new conversation
lol jk
Looking at games
Wait,it's all quaternions?
wait, it's all hypercomplex algebra?
I used to get so confused with unity trying to multiply vectors and quaternions
I used to multiply the quaternion by the vector (smort)
im making my own "isnt" function in python
nah, don't make a function - that isn't fun.
instead, modify the cpython grammar file and create a isnt keyword yourself with custom behaviour
just fork this repo https://github.com/python/cpython and you'll be on your way
Hey @proper harness!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Made a sorting algorithm from scratch cuz why not
wanted to see what type it is
DomgSort
that's a less optmised variant of the selection sort as far as I can tell
Hmmm so its different
so I can name it
Perfect, and just like that MeSort was made. Because "it was made by me" according to its author.
And normal b is boring so German s it is
hell. yes.
gonna learn cython first tho
Does anybody know where I can read about the current lifetimes of all Python versions?
@rancid aspen
hello
You can't get viruses on an ipad
so my cmd keeps opening and my computer crashes after maybe 10 seconds
ooh
my iphone is jailbroken can that get viruses?
probably not
thats good
You should've downloaded a paid antivirus cracked version and gotten a virus from there 
true
malwarebytes
It's paid but can be used after the trial
does it delete a virus
Just do a quick run, that should solve everything
(theyre trolling)
they were before too
the thing is i cant download because my computer crashes before i can do anything
welcome to the life of windows users
the os with builtin keyloggers
i have an counter point to end everything
why care if it isn't yours?
"hey why are you using a json instead of a db in your project(dummy)"
"why care if it isnt your project"
why do you stir 3 sugar cubes instead of 2?
why care if it isnt yours!!!!!
@shell raptor @wise schooner I completely botched the paste in pygen. This is the "fun" javascript gift a friend showed me. the 0/0+ makes all the difference
0/0+([]+1/0)[!+[]+!+[]+(+!+[])]
that expression is overpowered
I wonder... how does Python's speed compare to C# in a scenario like "loading a ton of rows from a database and making each row into an instance of a certain class"?..
in both of them it should involve expensive stuff like multiple memory allocations per object, etc, so I wonder how much faster C# is there.
c# will be faster
bruh
what does this actually do?
0/0 becomes NaN
1/0 becomes Infinity, doing [] + 1/0 makes it "Infinity"
!+[] is true, or 1, so !+[]+!+[]+!+[] becomes 3
so ([] + 1/0)[!+[]+!+[]+!+[]] becomes "Infinity"[3], i.e. "i"
then 0/0 + "i" becomes NaN + "i", "NaNi"
too advanced
too stoopit
"Infinity"[3]*
Folding is nice
I fold when I have like a massive class or something
and I there's code that I don't want to edit that only makes everything look messier than it is
I often use it for codingame bots
because it allows only one file
so all of my 1000+ lines of Rust are in one file 
๐
hi
VS Codeโข sure is nice
What no ๐ the keywords are caps but the names shouldn't be lmao
wait keywords need to be caps? i thought it wasnt case sensitive
nah i don't think so
but i think most sql developer do caps on keywords like insert into
yeah prolly
I think my days of bad posturing have finally caught up with me
I woke up cause my shoulder feels so much like it just needs to pop, but she refuses
It may or may not be 4:27
may not be 4:27?
hmm
Anyways, my other shoulder is also really sore now cause I got my second dose of the vaccine
Arm more than shoulder, I guess
Either way, pain on either side 
I'm thinking about wiping my PC tomorrow and then dual booting windows and probably a new linux distro to try it out
I've heard trying to dual boot with windows after having already installed Linux is a pain, and I don't actually have a heap of stuff stored on my PC, so wiping it will probably be the fastest way
I'll just backup what I want
which distro
Not too sure yet, but I think I'll go with something more stable this time
Haven't been a huge fan of rolling release
Yeah its case insensitive, but having them capitalised looks nicer
same
i am liking a ubuntu flavour much more
Yeah I'm probably going to go with something like that

i wanna try https://pearos.xyz/ once
it's ubuntu based ๐
why pearintosh when KDE plasma skin
quite confused with license stuffs rn
https://github.com/microsoft/vscode-python
^
i think this extension for vscode uses pylint (gpl license) but the extension is marked with mit license
nvm the pylint might not be included in the source
it's 99% running the cli of pylint
I think that would make sense in terms of licensing
oh great so i don't have to include pylint in my source
but actually requesting the user to install it and use it in my program?
Are you use PyLint isn't LGPL?
Hmm, alright. Because I remember there being issues with if you use a library you also need to release under GPL? Like if a module is used as GPL
Could be different when you use a CLI, vs like using a module's functions.
Either way, if your project relies of PyLint for linting and you just have people download it seperately. I am pretty sure that should be okay.
hm thanks
It doesn't need to be but it's common practice I think
YEA I THINK MOST PEOPLE USES CAPS FOR KEYWORDS IN SQL
yeah but.... i have got some problems with common practices
Lmao
AGREED
always has been
Input/Data:
13/07/2021, 9:52 pm - 0124873: Lorem
13/07/2021, 9:52 pm - 1894738: Ipsum
14/07/2021, 9:20 pm - Ahadb: Multiline!
Lorem!
Ipsum!
Dolor!
How I want this data:
['13/07/2021, 9:52 pm - 0124873: Lorem', '13/07/2021, 9:52 pm - 1894738: Ipsum', '14/07/2021, 9:20 pm - Ahadb: Multiline!\n\nLorem!\nIpsum!\n\nDolor!']
Could anyone point me in the direction of any regex specific tokens that might help me do this?
lol
do everything from date format to next date format
any clue how i would do that? Can't find any tokens to help me
positive lookahead works for "look for next date" but doesn't work on last entry because it doesn't have a next date...
https://regex101.com/r/9H51TW/1 this is what works for anything (including multiline) but the last one
hmm thanks! ill try and see if i can modify something in order to make it work!
:O
openSUSE KDE is pretty great, I might suggest also trying out Leap
wait does 0% exists
i think itll cause zero division error
because % is equal to divided by 100 am i correct?
but what if its y*(0/100)
so how is 0 in the bottom?
ye
That is 0 divided by 100, not 100 divided by 0
oops i made an oopsie
guy wanted to reach infinity
why do i find it funny that microsoft community has less members than r/apple discord
surprisingly lot of mods are offline atm.. sunday = rest :yes:
unbased scoping in python
In [1]: x = []; i = 0
In [2]: while i <= 2:
...: x.append(lambda: i)
...: i += 1
...:
In [3]: x[0](), x[1](), x[2]()
Out[3]: (3, 3, 3)
based scoping in julia
julia> x = Vector{Any}(undef, 3); i = 1;
julia> while i <= 3
let i = i
x[i] = () -> i
end
i += 1
end
julia> (x[1](), x[2](), x[3]())
(1, 2, 3)
In [4]: x = []; i = 0
In [5]: while i <= 2:
...: x.append(lambda i=i: i)
...: i += 1
...:
In [6]: x[0](), x[1](), x[2]()
Out[6]: (0, 1, 2)
wack
lies
we are in shadows
watching ๐๏ธ
you are resting in the shadows
๐
they talked about human mods
๐
https://marketplace.visualstudio.com/items?itemName=huacat.office-theme What a funky theme here
!e
x = []
for i in range(3):
x.append(lambda i=i: print(i))
for c in x:
c() # 0, 1, 2
x = []
for i in range(3):
x.append(lambda: print(i))
for c in x:
c() # 2, 2, 2
@solemn leaf :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 2
005 | 2
006 | 2
bypass late binding ๐ with i=i
.
based scoping in julia
proceeds to send python
sends julia too
ok
interesting
I love this community
@tacit shore Well JS and Python more or less cover all of those, except for mobile app development
Which you'd probably want kotlin or java for on android, and swift or objective-c on ios
I think it's only for IOS, or at least was built for that
Last time I checked Swift has downloads for other platforms
https://swift.org/download/#releases Even on Windows it's available
I guess it's just much more ideal on Apple's platform though
the name #ot1-perplexing-regexing sounds painful...
@topaz aurorawait, weren't you a mod before? ping me when replying
On vacation
Happens with nearly everybody ig
If you study well you can just have a lower flat line
Instead of dying come exam time
I have adopted to your suggestion recently
I use pomodoro technique
I hate coffee but this is the best coffee
Looks great ๐
๐
Depends if I want to pass or wanna score ๐๐
Tastes great as well because it's Irish coffee. With whisky, lol
true lol
Coffee with whiskey... Well that's weird... Should try
Coffee + sugar (our own honey in my case) + some whisky + soft whipped cream layer
Did you type the recipe already
Soft whipped == whipped so it's light but still liquidy
I was writing it already when you said, so I just hit reply, yes
Your own recipie?
Adapted from Internet ^^
Ahh
Might have to skip the whiskey part till 18 tho ๐
Uh no wait it was 21






