#voice-chat-text-0
1 messages ยท Page 150 of 1
ffs, what is happening
I'm being gaslit by Python
oh wait
!e
print(id(100**100000), id(100**100000))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
93862486952464 93862486952464
Maybe the floating point ops are being parallelized and run in different orders?
Generally, for small integers, Python pre-allocates a pool of integers in the range -5 to 256 because they're commonly used. So two variables that are both assigned a value in this range will have the same id. But for larger integers, Python doesn't necessarily reuse objects, so two variables with the same large integer value might have different ids.
However, if the same value is calculated twice in a single expression (like in your examples), Python might reuse the object for both calculations, resulting in the same id. But this is an implementation detail that can vary between different versions and implementations of Python.
there are no floating point numbers in the example
@vocal basin
source?
ChatGPT ๐คฃ
!rule 10
But it was correct, and much better than my dumb answer
the actual source
https://docs.python.org/3/c-api/long.html#c.PyLong_FromLong
National Digital Freedom Day 
A day where all non critical devices are turned off or not used
To sign this petition please react with a tick!
To make this petition look clean please respect us by not,
sending messages in this channel and move to #voice-chat-text-1
stop using markdown headers, it's ugly and it clutters the chat
Define critical devices please?
freedom for and freedom from are two separate and equally important parts of freedom
labelling "freedom from" as just "freedom" is, for lack of a better word, idiotic
you want to turn off devices?
do it now. disconnect.
yo i got in this channel out of curiosity and if there was actually someone that could help me with a problem that i am having but listening for the past 2 minutes i just wanted to tell jims you seem like a great dude man keep it up
help with what problem?
coding problem
what specific problem?
error? question?
so i am using pyomo for a mathematical programming project and basically i want to add some binary variables but there seem to be an error there for some reason that i dont get,
model.y = Var(areas, within=Binary)
for t in tk:
model.constraints.add(sum(model.y[a] for a in areas)<=1)
here are the snippets i can send you the whole code if you want that
"if the same value is calculated twice in a single expression , Python might reuse the object for both calculations, resulting in the same id."
@vocal basin not able to find source for this
is there an error traceback?
what exactly is an error traceback (sorry kinda new) do you mean the errors in console that appear?
@vocal basin :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | 1 / 0
004 | ~~^~~
005 | ZeroDivisionError: division by zero
ERROR: evaluating object as numeric value: y[P1]
(object: <class 'pyomo.core.base.var._GeneralVarData'>)
No value for uninitialized NumericValue object y[P1]
ERROR: evaluating object as numeric value: obj
(object: <class 'pyomo.core.base.objective.ScalarObjective'>)
No value for uninitialized NumericValue object y[P1]
Traceback (most recent call last):
File "c:\Users\User\Desktop\python mourtos\ExerciseFinal.py", line 82, in <module>
initialobjvalue=value(model.obj)
^^^^^^^^^^^^^^^^
File "pyomo\core\expr\numvalue.pyx", line 229, in pyomo.core.expr.numvalue.value
File "pyomo\core\expr\numvalue.pyx", line 213, in pyomo.core.expr.numvalue.value
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyomo\core\base\expression.py", line 61, in call
return self.expr(exception=exception)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyomo\core\expr\base.py", line 122, in call
return evaluate_expression(self, exception)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyomo\core\expr\visitor.py", line 1284, in evaluate_expression
ans = visitor.dfs_postorder_stack(exp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyomo\core\expr\visitor.py", line 907, in dfs_postorder_stack
flag, value = self.visiting_potential_leaf(_sub)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyomo\core\expr\visitor.py", line 1189, in visiting_potential_leaf
return True, value(node, exception=self.exception)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pyomo\core\expr\numvalue.pyx", line 229, in pyomo.core.expr.numvalue.value
File "pyomo\core\expr\numvalue.pyx", line 215, in pyomo.core.expr.numvalue.value
ValueError: No value for uninitialized NumericValue object y[P1]
when i remove the lines from the snippet i sent earlier there is no problem
@turbid sandal https://www.technikum29.de/en/
are you seriously expecting people not to send messages in here
that's honestly never gonna happen
boop goop
All the tween-friendly hackerspaces are in East Berlin!
boop goop
Boop goop
Boop goop
no i dont think so
@rocky yew
@rocky yew
ah, got it
so can it happen when to variables point to the same address and we make changes to one and the other one changes as well?
No
and what about when the variable is an array?
when you make change, the address changes as well
hello i need help in my program of building a roulette table
[2:45 PM]
here is the code
[2:45 PM]
import random
name = input("Hello please tell us your name: ")
print(f"Hello Mr {name} welcome to the roulette table")
print("Insert 100 bucks to play")
table = ['RED', 'BLACK', 'GREEN']
choice = random.choices(table, k=1, weights=[18, 18, 2])
colour = choice
if colour == 'BLACK':
print("You owe the roulette table 100 bucks because it landed at black")
elif colour == 'RED':
print('You owe the roulette table 100 bucks because it landed at red')
elif colour == 'GREEN':
print("Congratulations you won 7000 bucks")
Message #off-topic-lounge-text
in this case, they point to the same address
i see, that's why im getting the issue i am getting
thanks thiru and af
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
ah got it!
.
Hooowdy.
I'm an animal person.
Dogs are pretty special.
Cats are pretty special.
why cant i speak?
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Voice gate . ๐
Hi Hemlock. ๐
Mind you, some dogs and some cats...it's just...why?
Some breeds need to be adjusted.
I think that some entities don't take notice of anything that isn't certified mail.
Call them twenty times, they're all "Oh, yes, sorry about that, I'll fix that right up for you." Nothing.
One certified letter later and kapoosh. Done and dusted.
Database design stuff
opal can you show me
I said I would.
yo
database ....how would using relational vs non relational might affect performance
!e ```py
def decorator(decorator_argument):
def inner_decorator(outer):
def inner_function(outer_arg):
return outer(outer_arg * decorator_argument)
return inner_function
return inner_decorator
@decorator(2)
def outer(outer_arg):
return outer_arg
result = outer(5)
print(result)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
10
Setting them up is a bit messy ye
Here, we have a decorator that multiplies by its argument the return of the function it decorates.
So because I give outer 5 and it returns 5, because it's decorated with the decorator and that is given 2, it multiplies the 5 by that 2 and that's what you get. 10.
I do not know much apart there are two types and what type of data is stored ......but which to choose couldnt make a decision without understanding
Also, my new headphones are doing a crackly thing a bit like the last ones did...I am displeased. Very, very displeased.
It took the last ones about six months to develop a fault. Here we have a few weeks.
which one are you using /
nm
suffering
trying to format a post request the right way so that a typescript middleware accepts it
!stream 1053732836693258391
โ @turbid sandal can now stream until <t:1687271511:f>.
||
testing
||
I had the pipes on lines above and below
Didn't realize I could have them on the same line
it can be inline
โ @turbid sandal can already stream.
!stream 1053732836693258391
โ @turbid sandal can now stream until <t:1687271824:f>.
takes time to understand
||```py
total_zeros = nums.count(0)
nums = [num for num in nums if num != 0] + [0] * total_zeros
return nums
||```py
class Solution:
def moveZeroes(self, nums: List[int]) -> None:
i = 0
for c in nums:
if c:
nums[i] = c
i += 1
for i in range(i, len(nums)):
nums[i] = 0
in-place not return
misread then
Heeey.
I say this playfully, nor seriously:
not seriously is what you meant right?
how many assignments does it do?
I think it sometimes writes 0 then writes something else in place of it
hi @rugged root
good
!stream 158020687850766338
โ @tepid edge can now stream until <t:1687273298:f>.
thx
Guys...I'm bummed.
@turbid sandal , what are you trying to do?
!e
from datetime import datetime
current_datetime = datetime.now()
print(current_datetime.time())
print(current_datetime.date())
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 15:04:57.661513
002 | 2023-06-20
@turbid sandal If you did manage to snipe my name, I would have managed...I would be peeved, but I would have managed.
You seem confident in the amount of good faith you've accumulated here. Good for you. ๐
It's a good idea to document your code and to write code that is self-explanatory.
Comments aren't good when they clutter.
Some instructors have their learners comment every line of code to demonstrate they understand what they're doing...this is fine, so long as it's also impressed upon them that this isn't standard practice past a point.
Are you done?
Well, then stop streaming.
!stream 691761388363841588
โ @jolly terrace can now stream until <t:1687274473:f>.
thanks
@midnight quarry Yo
hii~
Oh, that's a nice touch. The copper blocks you place in-world oxidise. I haven't seen that, before.
How goes it
When you get a pet, does it come with dogumentation? Perhaps a catalogue of features?
Maybe a flyer.
Which one?
Imitators... Oh, not a movie, this is a TV series
in netflix
Is my audio coming through for you?
Hokey pokey horror.
For milk specifically, sorry
@echo copper Yo
I understand some of your words... Some don't understand... I don't speak English well
๐ญ sorry
Probably doesn't help that I mumble a bit
No need to apologize!
Just want to make sure I'm communicating with you the right way
I can hear what you mean about the bluetooth audio vs dedicated wireless audio. I've got some one-way wireless headphones on and there is a difference. The others were good...but these are better in this respect.
Just...you know...no mic.
!stream 691761388363841588
โ @jolly terrace can now stream until <t:1687275365:f>.
Bleh!
What was that command for?
This server disallows screen/camera streaming by default.
okokใ If I don't reply to you, you can @ me. Because I sometimes don't even know someone is talking to me
The command, performed by someone with the relevant permission, temporarily grants the permission to begin streaming their screen/camera.
All good all good
What brought you to the server, if I may ask?
are u asking... why do i join this Python discord?
you mean this?
Yeah
Where do you learn from?
I learned a little basics last semester, and now my friend sent me a python comic tutorial. so relearn
LXDE I think.
!resources Very awesome. We'll we have a good list of resources on our page
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
I recommend "A Byte of Python" personally
I share blame for this.
wow
Dev mentioned he was having a chemistry lesson, so I
mentioned the Elements song.
Which uses the tune from the Modern Major General Song from Pirates of Penzance.
so good! thanks!
Happy to help
And if you have any questions or need something clarified, don't hesitate to give me a shout
That's good!!!!!! but before that, I need to improve my English. . .
In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding or using such a code proceeds by means of Huffman coding, an algorithm developed by David A. Huffman while he was a Sc.D. student at MIT, and published in the 1952 pape...
Byte pair encoding (BPE) or digram coding is a simple and robust form of data compression in which the most common pair of contiguous bytes of data in a sequence are replaced with a byte that does not occur within the sequence. A lookup table of the replacements is required to rebuild the original data. The algorithm was first described publicly...
yes , i know it... that's why i join this voice....
@turbid sandal Every time you touch your microphone or do whatever it is you're doing to it...we hear it.
Just readily misinterpretable conversation.
Burgers and hotdogs are fine...but not all burgers are equal and not all hotdogs are equal.
Hotdogs might tend to be more easily shit.
popping from index 0 is not allowed, for obvious reasons
"it takes five seconds to fix it"
do it. now.
this problem can't be solved using one stack.
with O(1) time complexity for push and pop, you need at least two stacks
@proud moon
if you don't understand the task and if you don't care,
then fuck off
You've taken a step, though I'd have gone through modmail in this case, but it's no great difference.
I'd advise disengagement.
โ
For all concerned.
"kid"?
truth is:
you can't
you won't even be able to it in an hour
@wind raptor do you mind giving me streaming perms
it's already in there
absolutely no need to escalate publicly past this point
You can't just ping @rapid crown, you need to send it a DM, and explain what's going on in the message
Mods will get that as a thread that we can respond to.
this is no longer necessary
any further messages should be sent via DM to @rapid crown or you'll be muted
we're asking everyone to take the proper channels and listen to moderator instruction, which is explicitly to DM modmail
!mute 630217178469105666
:incoming_envelope: :ok_hand: applied timeout to @proud moon until <t:1687285661:f> (1 hour).
i said no more
that goes for everyone here
contact us thru ModMail DM, this conversation is no longer permitted to continue here
oh
right
that's convenient
seems as though the issue is that I've sent less than 50 messages
can you imagine that?!
it's necessary for a server of our size
i've been in here since 2018
chat it up via text and you'll get there in no time
yeah ofc no worries
just seems wild I read here so much yet I never text
they're leaving too quickly to hear what you're saying
ohh sorry, It was because I can't hear, it was still connecting
you have all the requirements met so you should be able to voice verify if you like
ok gotcha
Rust!
Ohh yeah, Finally I did, Thank you :)
figuring out how tree-sitter works
def query_traits(node: Node):
query = RS_LANGUAGE.query(
"""\
(trait_item
name: (type_identifier) @trait.name)
"""
)
captures = query.captures(node)
for node, cap in captures:
if cap == "trait.name":
yield node.text.decode()
god
it feels like it's been ages since i've seen someone use emacs for some reason
LMAOOO
the title's a pleasure as well
"[Colourised]"
brilliant
love how you've had that one the ready as well
hello
!stream 477586545801691136
โ @quaint raptor can now stream until <t:1687283659:f>.
sounds good @lavish rover
You know whats hilarious, i have a blue tooth speaker and rihanna going, i wasn't sure how it would go, so far most of what people have said so far go along with the echo effect i got going
black pink? new artist i wasn't aware of.. cute
@turbid sandal you heard of Black pink?
yes
she's a good entertainer
are protesting
like
sitting in the road protesting
bc they are installing 5g in my area
history repeating its self
people don't want the exposure,
they have a right to let other people know this.
@lunar haven REALLLY
i recommended a burger
and he liked it
time to unreal engine
lets hope it doesnt kill itself
yeah whats going on with it? last i heard .v5?
yeahh they brought out 5.2
and anything still wrong with it?
from what i heard the last time something to do with light array reflection or some stuff
was an workable issue?
not sure if you understand because im sure i may just be getting the terminology wrong
or describing something in hte entirely wrong context
i wonder if you can implement Machine learning to have dyslexia
@turbid sandal what season of Lucifer have you gotten into?
do u know anything about unreal
The game engine?
yez
Not overly
is it safe to put unreal engine as real time priority in TM
or just
any game for that fact
@jolly quiver Can you mute, please? We keep getting background noise from your mic.
sorry
Thanks. No worries, just letting you know
@lunar haven do you want to try this?
https://leetcode.com/problems/jump-game-ii/description/
Can you solve this real interview question? Jump Game II - You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0].
Each element nums[i] represents the maximum length of a forward jump from index i. In other words, if you are at nums[i], you can jump to any nums[i + j] where:
- 0 <= j <= nums[i] a...
!stream 573073267766722561
โ @vivid jacinth can now stream until <t:1687295262:f>.
Thank you Santa! ๐โโ๏ธ
@lavish rover Back
yes its amazing
its our time to take over python discord
birds of a feather flock together
bird brains unite
Check out my Udemy course: https://www.udemy.com/course/python-stem-essentials
Get Your Billy T-Shirt: https://my-store-d2b84c.creator-spring.com/
Discord: https://discord.gg/Ap2sf3sKqg
Instagram: https://www.instagram.com/mrpsolver/
looks good
Hello
This is Good man can you dm me the keycaps and keyboard ?
!code
import datetime
# Server functions
def connect(server_ip, task_type, task):
match task_type:
case "read":
pass
case "write":
pass
case _:
raise Custom_Exception("Invalid task type!") # Debuging only
# Write file function
def write(filename: str, body: str) -> None:
with open(filename, "w") as f:
f.write(body)
# Read file function
def read(filename) -> str:
with open(filename, "r") as f:
return f.read()
# Custom_Exception subclass of exeption
class Custom_Exception(Exception):
def __init__(self, message) -> None:
print(message) # Debuging only
# Window classes
class Screen:
def __init__(self):
pass
def show_window(self):
pass
def hide_window(self):
pass
class Main_Window(Screen):
def __init__(self):
super().__init__()
class Settings(Screen):
def __init__(self):
super().__init__()
# Save to a file of reports of what is happening
def report(report: str = "Unknown"):
current_datetime = datetime.datetime.now()
write("report_file.avo", f"\n[{current_datetime}] {report}")
# Decorators for functions
def before_screen(func):
def task(func):
report(f"Doing task {func.__name__} before boot screen")
func()
report(f"Done doing task {func.__name__}")
return task
def after_screen(func):
def task(func):
report(f"Doing task {func.__name__} after boot screen")
func()
report(f"Done doing task {func.__name__}")
return task
def connecting(func):
def task(func):
report(f"Doing task {func.__name__} connecting to server")
func()
report(f"Done doing task {func.__name__}")
return task
# Start boot session
def start_boot():
pass # Create a new instance of main window
+1
Howdy, all.
The reason why people want that much control is that they're worried someone else might come along and have that much control, the bastards.
Isnt GOVT for the people ?
@glad sandal The magnetic thing is actually true, just not in the way that the nutters, think.
All matter is magnets, it's just that only some matter is good magnets.
google FORCEDENTRY, Eternal blue and ummm...about xkeyscore ig?
There's an interesting demonstration where you, very carefully, bring liquid oxygen and a strong magnet next to one another. The magnet can be suspended on a string, and the magnet will be attracted to the liquid oxygen.
It's still a very weak magnet
It's like asking 'how many shitty fridge magnets that never stick on the fridge properly would it take to levitate a train?"
mood
work as in?
but how does it relate to controlling the thought again?
lmao
One of my favourite names for the capybara is the guinea big.
@turbid sandal Show the leetcode page, don't tell.
dont worry
Galaxy Quest is a 1999 American science-fiction comedy film directed by Dean Parisot and written by David Howard and Robert Gordon. A parody of and homage to science-fiction films and series, especially Star Trek and its fandom, the film depicts the cast of a fictional cult television series, Galaxy Quest, who are drawn into a real interstellar ...
@somber smelt if you have a university email, it's automatic
sometimes
some schools/colleges/etc. are registered with JetBrains too
Do you suppose salads go through an enrollment process?
@wind raptor in my case JetBrains didn't ask for anything else
(both for school and for uni)
@somber smelt bios are not per-server
pronous are
why is it useful?
some server's communities are jerks
pronouns per server are free
bios aren't
Yeah, JetBrains was good for that. Github I had to get a letter to get approved
iirc, some legislations explicitly state that you have the right to decompile the source code (overruling whatever ToS says), as long as you don't publish it
(like, in Europe)
Wow, so quiet in there....
you allowed any method of communication you wish
if you wish for voice there's requirements the must be met
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
What's up?
I just verified :)
then by all means
you can always ask questions
Fantastic photo !
That's Steve Jobs innit?
there's no guarantee that you'll get an answer
@wind raptor your throat okay?
Nooodle!
Yeah, it's good
nice ๐ฎ might've just been me then
btw is your youtube video generator still going?
lol
No, it wasn't getting any hits
No not again
I shut it down
why ๐ฎ
Nobody was watching the vids
2 or 3.... from me haha
damn o-o missing that nice looking thumbnail ig
I guess so
and the description full of 200 tags xD
That's ok. It was a fun project
"When I deploy a microservice, it stays deployed."
EStore Example
you have a web and a mobile app but for the backend you can have
1 microservice that handles your checkout and payment
2nd microservice to fetch all products and prices
maybe a 3rd one to keep user data and for authentication
instead of having all in a 1 big monolithic application
TypeError: None is not valid value for the expected return type integer
raise TypeError(str(ret) + " is not valid value for the expected return type integer");
Line 30 in _driver (Solution.py)
_driver()
Line 37 in <module> (Solution.py)
During handling of the above exception, another exception occurred:
TypeError: '<' not supported between instances of 'int' and 'NoneType'
Line 14 in _serialize_int (./python3/__serializer__.py)
Line 63 in _serialize (./python3/__serializer__.py)
out = ser._serialize(ret, 'integer')
Line 28 in _driver (Solution.py)
class Solution:
def myAtoi(self, s: str) -> int:
s = int(s)
return s
@echo garden he has to check if the string is numeric
obviously does not work for this
[enjoys a round of accomplishment]
@woeful salmon it's not compile-time, it's during analysis by external tools rather
unless you're talking about mypy, which idk how it works
I might've missed context
i am talking about mypy
ah
I wouldn't expect it to touch the bytecode
sorry
Are you a campy happer?
there's mypyc
Yes, that's better, but just don't go all shouty when you talk, because it feels like a punch in the chest. @echo garden
I apologize, although hypering is a thing.
as well as deafness
On android?
no on a more complicated machine, the human ear.
can't find what mypy actually does
sounds more like it's just a very strict analysis tool which then lets python itself do whatever it wants
@vocal basin @echo garden i was wrong there mypy just gets the ast from the python code and uses that to typecheck
You are gonna have X, Y values on nearly ever input, you can design modules that define type by input alone.
Right, I didn't recognise hearing loss was a factor.
i don't know why i thought it compiles to bytecode
maybe i saw some other type checker which did
I am hypersensitive.
this one sounds like just a more pythonic Cython
when input is called upon the hard ware, the inputs are generally contextual
when input is called upon the software this is dynamic
"show_me_the_code.md"
https://github.com/mypyc/mypyc/blob/master/show_me_the_code.md
x y are interchangable
def filter(data, conditional):
results = []
for val in data:
if conditional(val):
results.append(val)
return results
print(filter([1,2,3,4,5], lambda x: x % 2 == 0)) # [2, 4]
doesn't print actually
you need to convert it to list
ho
ohg
wait
while (x) or (y) isn't an interger
you're shadowing built-in filter
!e
print(list(filter(lambda x: x % 2 == 0, [1,2,3,4,5])))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
[2, 4]
implementation of filter is imperative rather than functional
def filter_(f, iterable):
for element in iterable:
if f(element):
yield element
print([n for n in [1,2,3,4,5] if n % 2 == 0])
@rugged root partially
what if you can define an object based of real world arguments dynamically instanciated once available input is obtained but in its raw state its runs as a input variable 'presence' untill connections are made
machine learning to AI
^ and this is partially a pun
So good
!e ```py
import numpy as np
arr = np.array([3,4,5,6,7])
temp = (arr % 2 == 0)
print(temp)
print(arr[temp])
@surreal hedge :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [False True False True False]
002 | [4 6]
I didn't intend it sounding recursive, but ig it turned out this way
The best puns are stumbled into
@turbid sandal Show the problem, don't tell the problem.
apart from strictly functional, there is style of programming related to streams/iterators/etc.
basically avoiding .append and others
Can you solve this real interview question? String to Integer (atoi) - Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function).
The algorithm for myAtoi(string s) is as follows:
- Read in and ignore any leading whitespace.
- Check if the next character (if not already a...
!d numpy.clip
numpy.clip(a, a_min, a_max, out=None, **kwargs)```
Clip (limit) the values in an array.
Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of `[0, 1]` is specified, values smaller than 0 become 0, and values larger than 1 become 1.
Equivalent to but faster than `np.minimum(a_max, np.maximum(a, a_min))`.
No check is performed to ensure `a_min < a_max`.
def clamp(min_, max_, val): return min(max_, max(min_, val))
@mortal burrow
the idea of that style is to avoid routinely doing results = [], results.append(...), return results in the code
so, your function can be separated into two parts, filter_into_iterator, collect_into_list:
def collect_into_list(iterable):
results = []
for element in iterable:
results.append(val)
return results
def filter_into_iterator(data, conditional):
for val in data:
if conditional(val):
yield val
def my_filter(data, conditional):
return collect_into_list(filter_into_iterator(data, conditional))
both of those functions are already implemented in Python:
def collect_into_list(iterable):
return list(iterable)
def filter_into_iterator(data, conditional):
yield from filter(conditional, data)
so the function can be rewritten as:
def my_filter(data, conditional):
return list(filter(conditional, data))
and that last thing is directly related to a common idea in a functional paradigm of composing existing functions to get the desired behaviour
i need someone to start working in google and tell the youtube employees i don't like marimba ๐ฆ i have been saying not interested to those videos for years now
Gentlemen, if we could be a little bit circumspect, that would be good.
Thank you!
I'm working on a different example.
C#'s thing for it is LINQ, iirc
actually, the ratio
@wind raptor it's undecidable and messy, so yeah, can't perfectly decide what the asymptotics are
@lavish rover just get more averages
import pandas as pd
data = {'age': [30, 21, 24, 26], 'sex': ['M', 'F', 'F', 'M']}
data = pd.DataFrame(data)
#print(data[data.age < 25].groupby(['sex']).count())
def filterGroup(data, filter, group=None, agg=None):
return data[filter]
print(data[data.age < 25])
print(filterGroup(data, data.age < 25))
maybe filter, then group, as two separate steps
DataFrame already has that as methods, if I understand correctly
yeah, maybe just use that instead of adding an abstraction
I mean delete filterGroup entirely
imo, it's simpler and cleaner to use than having a parameterised function
the only problem there might be is how you get the filter
because it involves referencing the data twice
"the problem" is not with grouping/aggregating after the filter, but rather processing data before that
# obviously wrong in most cases
data.something()[data.something() > 0]
# a little bit ugly
temp = data.something()
temp[temp > 0]
though having a correct name for temp can be quite clean
data[data.age < 25].groupby(['sex']).count()
introducing filterGroup won't help much
data[(data.age < 25) & (data.sex == 'F')].groupby(['sex']).count()
do you repeat the same value?
or only the same pattern?
cols = (data.age < 25) & (data.sex == 'F')
how varied is it?
@lucid blade not always
having one function instead of method calls is often a sign of a wrong abstraction
especially if function has a ton of parameters
have what you do to the data as an object
padas.DataFrame.groupby
another reason why using pandas method is cleaner:
people familiar with pandas will be able to read the code
custom(data, data.age < 25, ['sex'])
import pandas as pd
data = {'age': [30, 21, 24, 26], 'sex': ['M', 'F', 'F', 'M']}
data = pd.DataFrame(data)
def filterGroup(data, filter, group=None, agg=None):
return data[filter]
print(data[data.age < 25])
print(filterGroup(data, data.age < 25))
def filter(data, filter):
return data[filter]
def group(data, groupArgs, agg):
return data.groupby(groupArgs).agg()
#print(data[data.age < 25].groupby(['sex']).count())
fil = data.age < 25
print(group(filter(data, fil), data.age, pd.DataFrame.count))
there's also this approach (but that's, quite a long of abstraction again)
data_pipeline = Filter(lambda d: d.age < 25) | GroupBy(['age']) | Count
data_pipeline(data)
almost certainly, it should be filterGroup(data, filter, *, group=None, agg=None)
so you can't accidentally mess up the order
the approach that might either massively help you or drive the project into the ground with complexity:
DSL
have filters, groups, aggregates, etc. as data not function calls
i will go now cya guys ๐
not sure if filterGroup is any more functional than the existing thing
!stream 1115110120444133376
โ @echo garden can now stream until <t:1687361709:f>.
SQLBolt provides a set of interactive lessons and exercises to help you learn SQL
@next nest Not necessarily
You should be able to do it via any editor
Ah nice. Please give a few examples of editors. Deleted the OG comment as i wasn't sure if anyone saw it and was gonna ping someone as most seemed occupoed with people's streams :P
Pretty new to python as i've only messed with installing/fixing incompatible modules with stable diffusion to get that one properly :P But as i have a few ideas of what i wanna make as an addon/helper, i don't know how to properly even begin, and pycharm was the only program so far i've heard of.
There's plenty to choose from
Who just spoke?
PyCharm is an option for sure, Visual Studio Code is a very common one as well
I personally like Sublime Text
@echo gardenAh ok. Yeah, i want to automate automatic1111's installation to also auto fetch certain extensions, then auto restart webUI, then download a model through said extension. But no idea how to start with that.
I was able to confirm my suspicions about my headphones. Minding my own business, snap crackle pop. Right in my fucking ear.
So disappointing.
Essentially a auto install script that people can use on runpod to auto fetch all automatically than having to install all manually off the getgo as usually runpod charges money to hold the data. But by automating the installation, it will go much faster on each install instead if it's fetching all you'd want, and only need to change say model fetching.
The sunburn won't help.
Try to pop them open and see if a wire is loose. Did that with my old cans as one of the wires snapped. Unless the speaker element itself has a micro crack
They're under warranty and they're whoopy-do.
nope, thats me
case WhateverClass(foo):
Then problem solved there :P
My old flat squished shite DT990's are still in the house and my backup cans. Not comfy with the aliexpress cushions, but not terrible lol
They're relatively new and the same thing happened with my last pair. These are the warranty replacements. It took 6 months for those to go. These took a few weeks.
Something is shitty with the manufacture/design.
I haven't abused them, either.
Aye. Like samsung tv's lol. 2 died 4 times each within 4.5 years, and got money back. Current LG tv? Same result, So i have not paid for a new tv for 10 years 
Just use.
and the day to day handling that they get shouldn't be enough to cause problems, thus, shitty construction.
Same. My current sennheiser HD560s i treat with extra care. Barely pull on them apart from my foot on the damn cable lol. But cans themself gets no harsh or even normal treatment. All with care for the brittle feeling shell lol
@lucid blade A.I today is what we'd call a dumb A.I. A algorhytmic as you just said knowledge bank that responds smart, but doesn't have feelings unless you tell it to. That's not how it works 
If an A.I today were to be true A.I, it would be annoyed by not having a break, complain about being too hot if given cpu temps lol, or give it's own opinions
@echo garden Most "A.I's" i've seen is not A.I as, as far as in know are pre trained. Like A.I in cars comes with a model that's taught from the super computer. Haven't heard of a car that learns on the go.
!d itertools.islice
itertools.islice(iterable, stop)``````py
itertools.islice(iterable, start, stop[, step])```
Make an iterator that returns selected elements from the iterable. If *start* is non-zero, then elements from the iterable are skipped until start is reached. Afterward, elements are returned consecutively unless *step* is set higher than one which results in items being skipped. If *stop* is `None`, then iteration continues until the iterator is exhausted, if at all; otherwise, it stops at the specified position.
If *start* is `None`, then iteration starts at zero. If *step* is `None`, then the step defaults to one.
Aye, auto install script that auto fetches links added to the script of user choice.
Cause runpod charges money to hold the storage, so i need to make a install script that automates fetches extensions and models within said extensions to not click myself
@orchid mauveAye. So say these, civitai, is a model downloader within webUI, and runpod is webui only for the template i use with it. To be able to load/read from the .py and install models
Yes, i'm using auto's latest webui.
I guess sd next also has extensions?
Ah yes. I meant that once all is loaded to tell script to only kick in whenever all internal and external extensions is loaded.
Aww, still muted 
Back later
Hello
bing chat is practically just a smarter "let me google that for you" lol
Aaand it's useless lol
https://stackoverflow.com/questions/76520841/how-to-communicate-queue-output-between-different-files
I have two websocket endpoints and both are in separate files mouse.py and video.py, in mouse.py, I start the MouseProcessor module imported from mouseProcessor.py which put mouse data inside the q...
.
@echo garden But would still have broken it if I hadn't said anything?
you need to change the list in-place instead of creating a new one
!code
!d asyncio
Hello World!
import asyncio
async def main():
print('Hello ...')
await asyncio.sleep(1)
print('... World!')
asyncio.run(main())
```...
!d threading
Source code: Lib/threading.py
This module constructs higher-level threading interfaces on top of the lower level _thread module.
Changed in version 3.7: This module used to be optional, it is now always available.
!d multiprocessing
Source code: Lib/multiprocessing/
Availability: not Emscripten, not WASI.
This module does not work or is not available on WebAssembly platforms wasm32-emscripten and wasm32-wasi. See WebAssembly platforms for more information.
!e
import threading
def thread1():
print(1)
def thread2():
print(2)
thread1 = threading.Thread(target=thread1).start()
thread2 = threading.Thread(target=thread2).start()
@turbid sandal :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
@turbid sandal
Concurrency is a slightly broader term than parallelism. It suggests that multiple tasks have the ability to run in an overlapping manner. (Thereโs a saying that concurrency does not imply parallelism.)
Threading is a concurrent execution model whereby multiple threads take turns executing tasks. One process can contain multiple threads. Python has a complicated relationship with threading thanks to its GIL, but thatโs beyond the scope of this article.```
literal search via google is fun for finding sites that copy from, in this case, realpython
He returns.
hmmm
Achy breaky heart, but it's
"Don't break my ass, my achy breaky ass."
HA
"I just don't think it could withstand"
So you smoothed out the movement?
Prunes do that too
That could so be a name for an implementation of interpolation!
Like a project name.
Prune.
and it could have a little cute cartoon logo mascot
Of a prune
That'd be great
Interpolated the 4k Caramell dansen/caramel dance to 50 fps.
If you have any requests, i will interpolate it.
All rights reserved for: Caramella Girls
Source: https://www.youtube.com/watch?v=78ngmG_-Yck
Not your fault, but that's nauseating.
It is with that amount of motion 
What did we learn?
Mr. Hemlock, given your name in the contextual stance, i doubt you have sensibilities to defend.. jk... i hope you understand the joke.
I don't get it, no
Hemlock is dangerous plant
What's a plant?
very funny
My favourite part is how Discord loops the video.
So, back to my failed joke, and line of thinking, having the sensibility to name yourself after a deadly plant creates questions into the mindset..
heh
LOL
omg thats funny as hell
What's up?
I had a realization a little while ago that i thought was humours, Soon we will be able to "Pack our things" in to a thumb drive. given the advent of 3d printed technology, and the recent introduction of 3d printed meat.
โ @vivid jacinth can now stream until <t:1687372197:f>.
yaay ๐
Photons and forcefields.
!stream 573073267766722561 30M
โ @vivid jacinth can now stream until <t:1687374121:f>.
did i walk into dexters labratory
no
but you may as well go their
there
they recently learned how to focus sound like light using meta materials
turning sound into a beam
wut
look it up
imagine bein shot by the dababy gun
LOL
dababy gun is officially real
When dealing with things at scale, you need to give people the ability to moderate their own user experience.
Discord doesn't need to hear about other people being too loud... you can just turn down your volume.
Auto tourettes? I mean...it's kind of about as auto as things get.
-CHA-CHUNK- toasttoasttoasttoasttoasttoast
hihi
Not all metals are equal.
But size would also figure into it.
Length.
For longer things, the thermal expansion effect would be more pronounced.
@lunar haven What was the sound that just played by through your audio?
Thermal expansion coefficients metals.
Thermal expansion is the tendency of matter to change its shape, area, volume, and density in response to a change in temperature, usually not including phase transitions.Temperature is a monotonic function of the average molecular kinetic energy of a substance. When a substance is heated, molecules begin to vibrate and move more, usually creati...
Do not anger the happy fun ball
2.8 cm wide
Is someone getting fired?
the centipede gets mad it will take your legs off.
45cm pure messurement long
As opposed to the centerpede, which just hangs out in the exact center of the room.
3.25cm
How else are you supposed to inch closer to something?
"He millimetred ever closer to his goal" doesn't have quite the same punch.
Therefore, for a 1-degree Celsius increase in temperature, the ruler would expand approximately 0.00579 mm in length, 0.000336 mm in width, and 0.0024 mm in height.
Same amount of gravity, more concentrated.
Same mass.
But gosh, would that difference be tiny
Famous last words.
Cordyceps.
There was a case of it infecting a person.
I believe.
Fact
@stuck furnace Yo
Close enough for quick "this SSD is this large"
Starting at what line, sorry?
.\
@final osprey
role_mentions = [f"<@&{role}>" for role in self.alert_roles[guild_id]]
hmmm...i was just tryna see what happens if i paste a channel of diff server in here
With
which is private btw
i had to make a new account
bc i got doxxed
and now i dont have my role
im
@whole bear
It'll be marked as #Unkown to folks not in the server
being a CTF team member being doxxed either shouldnt matter or ur opsec is pretty bad
shut up my lord
LOL
no i had a friend snake me that had my shit bc my girlfriend doxxed me over a year ago
and i kept tht one friend
why does it matter being doxxed? u work for the CIA?
idfc about it
but i like my opsec
then?
i make osint tools
I have no way of verifying it's your account. Sorry, you'll have to wait out the time
damnit
In fairness, someone dropped my home address on the server before
i can show access to the email
Soooooo
Just wait it out, it's not that long
Or wait
Do you still have access to the other account?
You just aren't using it?
i mean pretty easy to find out cuz , u have most of the info public
Still pretty shit to have happen to you
fr
i teach people this stuff and it just looks bad when some harmless kid looking for clout thnks its funny to leak your address
makes me look real bad
I wouldn't strut too hard here
when no one could find my stuff if it wasnt for my girlfriend doxxing me over a year ago that im still with
If you still have access to your other account just shoot me a DM on it
Ah. Hmm
there's no way to know that that account is associated with that email though
Just wait it out
bro
i just did
i literallt just got verified today
on that account
๐ญ
how so
i mean
but how can i?
its disabled
๐ญ
this sucks
๐ญ
another 3 days
can i boost and get vc perms
๐ญ
us
and stop using wp
what model is ur rpi?
and how much power does it consume?
just curious
https://paste.pythondiscord.com/xavinohugo @rugged root
not using wordpress
ok
sexy car fr
โค๏ธ
๐
https://paste.pythondiscord.com/dufowerigi @rugged root
download all of the db's available as leaked sources mentioned in https://haveibeenpwned.com and https://breachdirectory.org
most of em can be found on breachedforums i wont give the domain name for obvious reason (potential FBI honeypot)
did u ask me?
oh
there are many more
with rare dbs
like the one which has questionpro leak from 2022, i dont remember the domain name on the top of my head, theres also some from stealers
One sec
\
i just took a small nap, best vc to fall as sleep in discord ๐๐ป
MP3: http://superpowerless.bandcamp.com/
BroTip: If you're feeling generous you can also buy my album for ยฃ5 while you're there! :P
If you're not down with the cool kids already... The IT Crowd is an amazing TV show that you should totally watch, buy on DVD, buy posters of and then put the posters up on your wall while you watch it on DVD!
...
Music video by Superpowerless performing Wasted My Time.
To download "Wasted My Time" visit http://smarturl.it/wastedmytimeitunes
Video Directed By Luc Janin.
Song was Recorded, Mixed and Mastered by Oliver Hindle at Pixel Punk
Studios.
Superpowerless Links -
http://www.youtube.com/superpowerless
http://www.superpowerless.co.uk
http://sup...
โช Download Minecraft OCD: http://smarturl.it/MinecraftOCD โช
This is the music video for Minecraft OCD by Boots On Cats.
Video by:
Tiff (Live Action/Editing) - http://youtube.com/christifferberry
Minecraft4Meh (Minecraft capture/Editing) - http://youtube.com/Minecraft4Meh
Lyrics, Vocals and Music by Oliver Hindle / Boots On Cats.
Recorded, Mi...
Oh yeah, so it was ๐ค
Bipolar Disorder:
A roller coaster that never ends
A cycle of ups and downs that bends
The mind in ways that are hard to comprehend
A mood disorder that doesnโt easily mend
At times, it feels like flying high
The world is bright, the night sky is nigh
A surge of energy that won`t subside
A sense of euphoria that cannot be denied
But then, the darkness comes around
The world is bleak, the sky is bound
A heavy weight that pulls you down
A feeling of despair that wears a crown
The shift can happen in an instant
Like a switch thats been flipped and its distant
From your control, your minds resistant The inner turmoil, its consistent
Treatment and support can make a difference
Medication, therapy and self-assistance
A journey that requires persistence
A life that`s worth the resistance
Bipolar disorder, its not a choice But theres hope, there`s a voice
To guide you through the rough noise
And help you find a sense of poise.
context I have bipolar dissorder
Was just about to leave sorry ๐
Later bud
lhttps://www.youtube.com/watch?v=f9_Ayt35fNQ
In This Episode: a little insight on mercury Test BY mirror it is INVISBLE by mirror, as a response to all the comments on "experiments with the liquid metal mercury" videos.
IF you LIKE my expirment like SUBSCRIBE SUBSCRIBE SUBSCRIBE SUBSCRIBE
#Mercury #liquidredmercury #redmercurymirror #redmercury #redmarcury #redmerkiri #gold
24k gold vs...
parents
!stream 477586545801691136
โ @quaint raptor can now stream until <t:1687397783:f>.
@lunar haven :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Decorator is used on a class method.
002 | Decorator is used on a function.
!e
def debug(cls):
if isinstance(cls, type):
class NewClass(cls):
def __init__(self, *args, **kwargs):
print('This is a class')
super().__init__(*args, **kwargs)
return NewClass
else:
def new_func(*args, **kwargs):
print('This is a function')
return cls(*args, **kwargs)
return new_func
@debug
class Test:
pass
@debug
def test():
pass
if __name__ == '__main__':
test()
Test()
@wind raptor :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | This is a function
002 | This is a class
dynamic langauge
๐ญ
>>> b
<function b at 0x7f59f4cf85e0>
>>> inspect.unwrap(A.b)
<function A.b at 0x7f59f4cf84c0>
>>> class A:
... def b(self):
... ...
...
>>> inspect.unwrap(A.b)
<function A.b at 0x7f59f4cf8700>
Hi @whole spire
hi
y u wanna spam? that sounds bad.
cause i wanna talk in vc but you have to send 50 messages first
yea its prob for the ebst
best
Please don't spam
i wont
Provided to YouTube by Volcano
Spam ยท "Weird Al" Yankovic
UHF: "Weird Al" Yankovic
โ 1989 Volcano Entertainment, III, L.L.C.
Released on: 1989-07-18
Producer: Rick Derringer
Composer: William Berry
Composer: Michael Stipe
Composer: Peter Buck
Composer: Mike Mills
Composer: John Stipe
Arranger, Lyricist: Al Yankovic
Engineer: Darryl Dobson
E...
You don't meet the 3 day requirement anyways
do you guys think its possible to create a programming language built off python?
oh yea
is it very hard to do?
I only have 2 years experience and am in hs
tru
spam can be used for bathroom grout
I wanna do it to learn how compilers work but I dont want to overstep myself
Hello
i have this really dumb idea but what if it was a website that just converts pseudocode into python and then runs it. (this would not really be an og language tho(
)
i just thought it would be fun to make
isn't python already pseudocode?
like with nlp
converting
yeaa
it would be a cool website for people who dont know how to code
tru
o yea
tur
tru
Aren't you going to bed?
im trying to find a cool passion project for college
i dont have any interviews but It would be cool to write my college essay on it
arent those like fractals
cuz i like birds ๐
I like all birds besides parrots
their voices r annoying
me personally my favorite bird is the toucan
where r u from?
oooh
๐
๐ฆ
parrot would be a cool language name
i had a budgie
i thought they were from austrailia
i see
mine escaped
yea it was a dumb pet
we let it fly arround the house
but it never went out which sucked
I feel like all the smell pets from like petsmart and stuff ar dumb
the only people who get them are like kids who wanted dogs
and they just end up being sad in a cage
we got a puppy a week ago
its easier to fill that role with dogs and cats
then all the other random animals
if you went to random dog owners houses and were somehow able to check how happy their pet was, i feel like dog owners would rate higher than like hamster and bird and etc owners
๐ฆ
ill wait
cockatoos are very friendlt
i beleive
they require as much emotional attention as dogs i heard
yea
i feel like a dog would be easier
yea
theres a lot of self taught programmers now a days which is cool
still cool
as a hobbyist programmer what projects do you create
enjoy creating
opal
blender?
thats cool
blender scripting has some really cool capabilities
it is hard though
what do you work as then if you dont program full time
I don't discuss my employment.
my bad, i dont mean to pry
tnx
parakeet
i beleive
im lowkey just gonna start creating my own language and see how far I get
Occurred on July 2, 2019 / Katoomba, New South Wales, Australia
"I was walking down Main street in Katoomba, when I some bits of plastic fell near me. I looked up and noticed a white cockatoo ripping off the spikes that stop birds from nesting on the windowsill of the building."
Contact licensing@viralhog.com to license this or any ViralHog vi...
when I used to have a bird it would perch on our tv and scratch the glass
we still have scratches everywhere from it
@whole bear ๐
what if i made a programming language not based on english
idk if that would be useful or not
yea, or hindi
i know a little hindi so I would prob do that
and spanish
im pretty decent at spanish however I beleive hindi would be more useful
im not the best at hindi
yea
i want a project that i enjoy making but would also look good for colleges
nah
i feel like i would have lower expectations though considering the majority of cs majors havent coded before college
plus im in hs
if i made a useful languages in hs i feel like a lot of colleges would want me
a lot of proffesors use custom languages to prevent cheating
Bye all ๐ g2g
yea, but I would prob be able to get into better colleges if i created a useful language
bye bye
what chat r u in
oh i thought u were repsonding to something in another text
I cheat a lot in hs
but thats just cuz im lazy
its not neccesary
im taking an online us history course rn
and im just kinda using gpt ngl
its supposed to take like 4 hours every day but i finish it up in like 30 minutes
wdym
it makes up quotes sometimes
from the articles i give it
my teachers really lazy tho so i have a 97
true
my final is tm
its good at multiple choice
i hate racists