#voice-chat-text-0
1 messages ยท Page 102 of 1
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'ellipsis'>
used for placeholders and typing
I remember it also being used in some external libraries (as a meaningful value)
7.9. The break statement
break_stmt ::= "break"
``` [`break`](https://docs.python.org/3/reference/simple_stmts.html#break) may only occur syntactically nested in a [`for`](https://docs.python.org/3/reference/compound_stmts.html#for) or [`while`](https://docs.python.org/3/reference/compound_stmts.html#while) loop, but not nested in a function or class definition within that loop.
It terminates the nearest enclosing loop, skipping the optional `else` clause if the loop has one.
If a [`for`](https://docs.python.org/3/reference/compound_stmts.html#for) loop is terminated by [`break`](https://docs.python.org/3/reference/simple_stmts.html#break), the loop control target keeps its current value...
!d continue
7.10. The continue statement
continue_stmt ::= "continue"
``` [`continue`](https://docs.python.org/3/reference/simple_stmts.html#continue) may only occur syntactically nested in a [`for`](https://docs.python.org/3/reference/compound_stmts.html#for) or [`while`](https://docs.python.org/3/reference/compound_stmts.html#while) loop, but not nested in a function or class definition within that loop. It continues with the next cycle of the nearest enclosing loop.
When [`continue`](https://docs.python.org/3/reference/simple_stmts.html#continue) passes control out of a [`try`](https://docs.python.org/3/reference/compound_stmts.html#try) statement with a [`finally`](https://docs.python.org/3/reference/compound_stmts.html#finally) clause, that `finally` clause is executed before really starting the next loop cycle.
!e py for i in range(10): print(i)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
!e py for i in range(10): if i == 5: continue print(i)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 6
007 | 7
008 | 8
009 | 9
!e py for i in range(10): if i == 5: break print(i)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
!e py run = True while run: print('Hello.') run = False
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello.
!e py while True: break print('Hello.')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello.
!e ```py
def func():
print('Hello.')
print('Goodbye.')
func()
func()
func()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello.
002 | Goodbye.
003 | Hello.
004 | Goodbye.
005 | Hello.
006 | Goodbye.
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | <class 'str'>
002 | <class 'int'>
!e py print('text'.upper())
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
TEXT
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello! I am Peter.
002 | Hello! I am Sally.
Including but not limited to int, str, float, complex, range, enumerate, bytes, bytearray.
list, set, tuple
5.6 float
3.0 float
3 int
'abc' str
5+7j complex
range(50) range
['abc', None, 5] list
!e py print(5 + 5)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
10
!e ```py
class MyClass:
def add(self, value):
print(f'You tried to add {value}')
return 9001
a = MyClass()
print(a + 10)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | You tried to add 10
002 | 9001
!e py print(dir(int))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__getstate__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'as_integer_ratio', 'bit_count', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'numerator', 'real', 'to_bytes']
!e py v = 9001 result = v.bit_count() print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
6
!e py 'abc'.bit_count()
@somber heath :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 | 'abc'.bit_count()
004 | ^^^^^^^^^^^^^^^
005 | AttributeError: 'str' object has no attribute 'bit_count'
def func():
pass```
!e ```py
def func(value):
print(value)
func('Hello, world.')
func('abc')```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello, world.
002 | abc
tomorrow
>>> for (x,y) in (1, 2, 3, 4, 5+10, 6) { dump(show_funcs=False, only_current=True) }
Variables: [
x=1
y=2
]
Variables: [
x=3
y=4
]
Variables: [
x=15
y=6
]
!e py for a, b in [(1, 2), (3, 4), (5, 6)]: print(a) print(b)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
006 | 6
!e py for a, (b, c) in [(1, (2, 3)), (4, (5, 6)), (7, (8, 9))]: print(a) print(b) print(c)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
006 | 6
007 | 7
008 | 8
009 | 9
be like Rust, use Result instead of exceptions
"or just panic lmao"
Rust doesn't have exceptions
just like C
Rust's Result is similar to how Java tries to do exception handling
with exception types being restricted to specific types
Either error ok
(throws syntax)
imports vs includes
second mostly works compile/parse-time
from module heckinimport thing```
JS has imports not includes, afaik
(ES modules)
from module import fn thing
from module import var thing
import module
import module.x
from module.x ...
and whether it happens on runtime or on compilation is unclear
I can't remember any languages that do that
even C allow using function name as an "object"
(interpreted as function pointer)
*allows
it has includes
but not what you mean by includes
well, python just does dictionary lookup
locals()['your_variable_name']
only locals and globals
nonlocals (closures) are handled separately
(it's more complex than "just" because it actually needs to know where to look)
!e
def f():
x
global x
@vocal basin :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 3
002 | global x
003 | ^^^^^^^^
004 | SyntaxError: name 'x' is used prior to global declaration
locals/globals/closure
!e
def f():
x = 1
def g():
print(x)
return g
h = f()
h()
print(h.__closure__)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | (<cell at 0x7fc85c5e90f0: int object at 0x7fc85cec8288>,)
normally __closure__ is None
heyy,,
common way to write decorators
it outlives the scope, and that's what the closure is
or, in other interpretation, function scope outlives the function call
this is actually where some OOP ideas came from
!e
p = ctypes.pointer(ctypes.c_char.from_address(5))
p[0] = b'x'
Simula programming language
and maybe ALGOL 68
I don't remember if it had closures
but it definitely had lambdas
(in anonymous/local function sense)
46 years before Java had them
@verbal zenith classes
I had an idea for a demonstration, but it got convoluted.
classmethod is an example
@left trail @ocean anchor๐
or staticmethod
!e
class C:
@staticmethod
def m(): ...
print(C.__dict__['m'])
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
<staticmethod(<function C.m at 0x7f7e46624680>)>
it has __get__ overloaded
it always returns the original function
code organisation
staticmethods are "useless" for classes because they provide no proper "interface" surface
they are validly defined on exactly one object
factory methods
!d int.from_bytes
classmethod int.from_bytes(bytes, byteorder='big', *, signed=False)```
Return the integer represented by the given array of bytes...
for example, this factory method
!e ```py
class MyClass:
v = 0
@classmethod
def increment(cls):
cls.v += 1
print(MyClass.v)
instance = MyClass()
instance.increment()
print(MyClass.v)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
A stupid example, but this is how you could use it.
@classmethod
def from_something(cls, something, ...) -> Self:
...
@timid crypt๐
!d pathlib.Path
class pathlib.Path(*pathsegments)```
A subclass of [`PurePath`](https://docs.python.org/3/library/pathlib.html#pathlib.PurePath "pathlib.PurePath"), this class represents concrete paths of the systemโs path flavour (instantiating it creates either a [`PosixPath`](https://docs.python.org/3/library/pathlib.html#pathlib.PosixPath "pathlib.PosixPath") or a [`WindowsPath`](https://docs.python.org/3/library/pathlib.html#pathlib.WindowsPath "pathlib.WindowsPath")):
```py
>>> Path('setup.py')
PosixPath('setup.py')
``` *pathsegments* is specified similarly to [`PurePath`](https://docs.python.org/3/library/pathlib.html#pathlib.PurePath "pathlib.PurePath").
Hello
!e ```py
def class_decorator_with_parameters(a):
def d(cls):
class C(cls):
def init(self):
print(a)
super().init()
return C
return d
@class_decorator_with_parameters("Apples.")
class MyClass:
def init(self):
print("Native.")
instance = MyClass()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Apples.
002 | Native.
Just to show how stupid decorators can get.
yep, I've done decorator chaining, too, for a fireworks thing
class overriding __new__ must either:
return an initialised value that's not an instance of Self,
return an uninitialised x that's an instance of Self,
not have __init__ defined and return initialised x that's an instance of Self
pathlib.Path does third
normal classes do second
wassup AF, Osyra, Opal
def compose(other_decorator):
def metadecorator(decorator):
def composed(func):
return other_decorator(decorator(func))
return composed
return metadecorator
@compose(decorator_a)
def decorator_b(func):
...
@decorator_b
def func_a(...):
...
collision avoidance moment
iirc, pep8 says to use a single trailing underscore (lambda_/class_) for such names
python lambda count there is 109
own something and calling it "lambda"
"function" would collide with a fake builtin
it kind of exists but kind of not
!e
function
@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 | function
004 | NameError: name 'function' is not defined
@lusty jewel export to what form?
VCS? archive?
packaging?
I never noticed the first one had "/Global/" in URL
and I've copied this, like, tens of times
thanks
1+"2" works in JS
as well as 1-"2"
@verbal zenith this is what happens when you try to do it
implicit type coercion leads to issues
class Solution(object):
def minCostClimbingStairs(self, cost):
n=len(cost)
step=0
su=0
while step<=n-2:
if step==n-3:
if (cost[step]+cost[step+2])>cost[step+1]:
su=su+cost[step+1]
else:
su=su+cost[step]+cost[step+2]
step=step+3
else:
if cost[step]>=cost[step+1]:
su=su+cost[step+1]
print(cost[step+1])
step=step+1
else:
su=su+cost[step]
print(cost[step])
step=step+1
return su
this is JavaScript
What if there are elements?
([][[]]+[])[[]-[]] is 'u'
It's passing most of the test cases, need help in this code. What's the issue? Which edge case is this logic missing? Anyone?
[][[]]+[] is 'undefined'
[]-[] is 0
I tried
it thinks it's a scope
but it's fine without +1
left side is undefined
because you can't return from a scope there
yes, JS needs a valid function scope for returns
in rust it's just
{
value
}
not in the loop, probably
there are loop labels, yes
idk if there's a way to reduce the character set
false, true, undefined
and indexing
also, '[object Object]'
where space comes from
"computational creativity"
some bundlers do that
![] is shorted than false
This week, Victor Ribero tweeted this JavaScript craziness.
// Returns "banana" ('b' + 'a' + + 'a' + 'a').toLowerCase(); Soโฆ what the hell is going on here?
Not a number The trick is in the + + 'a', specifically, the + 'a'.
Thereโs no number between the two plus signs. The browser attempts to add nothing to 'a', which returns NaN (short for Not...
peak JS humour
speaking of why +x exists
+'a' tries to make it into a number
๐คฃ
makes sene right?
๐คฆโโ๏ธ
Doesnt strings automatically turn into ascci so then its a number?
Hello Guys!
+'a'->Nan
+'1'->1
I have it but there is background noise
i dont have background noise but no perms
๐
im just doing studying for my exams these background noise helps
๐
this is dynamic programming
๐ฅฒ
@analog granite๐
ok, so I may have solved it
with DP it's simple
I reformatted the code to make it more readable
class Solution(object):
def minCostClimbingStairs(self, cost):
n = len(cost)
step = 0
su = 0
while step <= n - 2:
if step == n - 3:
if cost[step] + cost[step+2] > cost[step+1]:
su += cost[step+1]
else:
su += cost[step] + cost[step+2]
step += 3
else:
if cost[step] >= cost[step+1]:
su += cost[step+1]
step += 1
else:
su += cost[step]
step += 1
return su
so, yes, you can solve it recursively
but you will run into time limits
and recursive solution will lead you directly to DP solution
yeah, I'm just trying to read your code
256 / 283 testcases passed
try [6, 3, 9, 11, 14, 2]
your solution seems to go
3 9 11 2
instead of
3 11 2
or no
strange
idk
I wrote a thing to track steps
@scenic quiver the fundamental problem with your solution is that you store only one counter, su
you're calculating a fastest way to get to a stair number N
which depends on ...
Which depends on?
from which stairs can you get to stair number N? (in one step)
simpler tests:
[1, 2, 11, 1]
[6, 7, 7, 1]
if you know the answers for those indices, you know the answer for index N
@somber heath ๐
@vocal basin are you willing to do some clash of code
if you're free
which modes?
fastest and reverse
give all language access
i'll do it with java
the game mode was reverse
or not
to get true reverse I need to uncheck "Fastest"
reverse seems to work the same way as "fastest" by default
there is no reverse code golf
I wanna join y'all but I'm in bed
use APL, involves less key presses
btw, is there an APL keyboard for phones?
brb
(will send the next link when back)
I can't program on my phone tbh
Not as fast as I'd like
I'm very competitive at clash of code lmao
Was like #2 in Canada at some point
@spark prairie๐
@ionic reef ๐
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
if you can talk jump in live coding
@cosmic lodge๐
hello
i need one help
bro are you there
i have a problem while cration my own bot
ai chatbot i am creating in colab
yes
wel1 minute
can i upload a photo
Yoyo
@fallen sinew๐
Can somebody do a bit of image detective? If I post a photo here can you find the exact source?
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
see bro this file
thanks๐
@upbeat whale๐
Hello
Canโt find the source ๐
This is the image that Iโm trying to investigate
Nope ๐ฆ
Not the breed
Iโm trying to get a cat and I suspect the breeder is scamming me
Trying to*
Yeah itโs a BLH but I think the โbreederโ stole someoneโs picture
And pass it as their own
Right??
Might as well
I knoww right :((
Im kinda sad now
The video they provide has a song over it -,-
Itโs strange
Iโm not sure how to check that in my locality ..
Or if they are strict abt it
Hi hemlock
yo
Heh
Haaaahahha
Iโm like playing detective right now tryna prove that this breeder is a scam
@shadow prawn๐
hi
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Sometimes I donโt even rinse
@vocal basin you can come back if you want
@old juniper Yo
โ @whole bear can now stream until <t:1679320973:f>.
no problem
Wait, how long does it take you to do your hair
Product.
Hey @whole bear!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
#include <stdio.h>
#include <stdlib.h>
typedef struct MyStruct1 {
int a, b;
} MyStruct1;
typedef struct MyStruct2 {
int a, b, c, d;
} MyStruct2;
int main() {
MyStruct1 *data = malloc(sizeof(MyStruct1));
MyStruct2 *data2 = (MyStruct2 *) data;
data2->a = 10;
data2->b = 20;
data2->c = 30;
data2->d = 40;
printf("data1 size=%lu a=%d b=%d\n", sizeof(*data), data->a, data->b);
printf("data2 size=%lu a=%d b=%d c=%d d=%d\n", sizeof(*data2), data2->a, data2->b, data2->c, data2->d);
return 0;
}
@rugged root %
accidentally correct
it probably allocates in larger chunks so less issues
offsetof
also
if you had 3 and 4 fields
the thing could be that both structures have the same size
because of rounding up
depends on the target platform, compiler, etc.
char, char, char
I think this should be 4 bytes
Should shave your head like I do
The fuck it adjustment
Is it in your way? Fuck it
I buzzed my head yesterday
It's the only reason I say it
I forgot how to replicate that
How to bring back the button to start the code?
!e py my_list = ['apples', 'pear', 'orange', 'banana', 'orange'] my_list.remove('orange') print(my_list)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
['apples', 'pear', 'banana', 'orange']
Note how only the first 'orange' is removed.
!e py my_list = my_list = ['apples', 'pear', 'orange', 'banana', 'orange'] popped = my_list.pop() print(popped) print(my_list)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | orange
002 | ['apples', 'pear', 'orange', 'banana']
By default, list.pop removes from the right of the list.
does it show "Run or Debug..." when you right click on split button?
But you can specify an index position to pop.
@stuck furnace Yo
!e py my_list = my_list = ['apples', 'pear', 'orange', 'banana', 'orange'] popped = my_list.pop(1) print(my_list) print(popped)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | ['apples', 'orange', 'banana', 'orange']
002 | pear
Now it deos thanks!
โ@CarloandSarah
For more from Carlo and Sarah follow their instagram
https://www.instagram.com/carloandsarahtiktok/
For More Italian Videos Follow
https://www.instagram.com/growingupitalian/
๐ญ
Tortelli [torหtษlli] is a type of filled pasta traditionally made in the Lombardy, Emilia-Romagna, and Tuscany regions of Italy. It can be found in several shapes, including square (similar to ravioli), semi-circular (similar to agnolini), or twisted into a rounded, hat-like form (similar to cappelletti (pasta)). It can be served with melted but...
Butter and sage.
My nonna would have hit me with a rolling pin if I did that
Antimony, Antimony, tim tim, ta-roo.
I am contractually obligated to believe in the market
Well wolfram alpha does say that the migrational velocity of an unladen swallow is 40 km/h, but it does specify that that is for the European swallow as there are too many species of African swallow to measure
There is something unsettling about the thumbnail for this.
@proud depot๐
bbiab
How do you mean? What's the context?
RealPython is better written though
Sometimes
PyCharm has typing problems too
python default docker image seems to be debian-based
just saying that they choose debian-based
so ubuntu in your case
@whole bear #voice-verification
APIs allow decoupling implementation from the interface
so, yes, (if people putting in the requirement understood that) there shouldn't be such restrictions
They also required our front end to be compatible with internet explorer
@main crest If you're wondering why you can't talk, check out the #voice-verification channel. That'll tell you what you need to know about the voice gate
node too
but not nvm it's toogo
hi
I forgot with what image I ran into having to use apk instead of apt
I found one container (out of 31 running) which definitely is alpine
@whole bear If you're wondering why you can't talk, check out the #voice-verification channel. That'll tell you what you need to know about the voice gate
"A.F." is initials of the name
I'm too lazy to expand the list
#voice-chat-text-0 message
Wait how long is your hair, AF?
Itโs long AF
60cm
didn't measure more exactly
That is very long
interactivity:
if you DDoS the site, it changes the response
.topic
Sprites
Science of how red sprites and blue jets form over thunderstorms. Some of the greatest red sprites ever caught on camera with easy to understand explanations including a new discovery are highlighted in this video. Explore the colorful world of Transient Luminous Events including gigantic jets, elves, halos and more as they are initiated by ma...
hello
What're you up to
learning bout subclass
@rugged root Is it possible to make a bot to automatically detect when non-vc-verified users join vc and tell them in the respective text channel where to go for verification?
We have that
It should be DMing them if they hadn't been here before. I think I might have them tweak it back to just be a ping in the voice verification channel
Yeah, if it is a DM and only the first time, it probably won't do the job.
Oooo, fun
Right. If they have DM's disabled it will ping from the channel
i have been on classes for three days
Anything tripping you up so far?
people frequently ignore dms
Your ear's must have been burning, oof
maybe best to only ping them in the chat
Fury was wondering if you still had access to the ISO 9000 stuff
ears
Corey Schafer does a good job explaining
yes I do
Yeah I don't know why I hit the ' there
why was furyo wondering?
@molten pewter
I think he was wondering whether SWIFT was getting any security things added to the standard
opal was the one who told me about him
your just getting older @rugged root
you're
you don't ignore my dms though
seems like SWIFT is ISO 9362 which isn't a part of ISO 9000 Family
screwdriver set is at risk of becoming screwdriver singleton
Subscribe to CLASSIC TRAILERS: http://bit.ly/1u43jDe
Subscribe to TRAILERS: http://bit.ly/sxaw6h
Subscribe to COMING SOON: http://bit.ly/H2vZUn
Like us on FACEBOOK: http://goo.gl/dHs73
Follow us on TWITTER: http://bit.ly/1ghOWmt
City of God (2002) Official Trailer - Crime Drama HD
The streets of the worldโs most notorious slum, Rio de Janeiroโ...
maybe I'm not a person
Vamp is a system for plugins that extract feature information from audio data.
email@email.com -> email%40email.com
urllib.parse.quote(string, safe='/', encoding=None, errors=None)```
Replace special characters in *string* using the `%xx` escape. Letters, digits, and the characters `'_.-~'` are never quoted. By default, this function is intended for quoting the path section of a URL. The optional *safe* parameter specifies additional ASCII characters that should not be quoted โ its default value is `'/'`.
*string* may be either a [`str`](https://docs.python.org/3/library/stdtypes.html#str "str") or a [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "bytes") object.
Changed in version 3.7: Moved from [**RFC 2396**](https://datatracker.ietf.org/doc/html/rfc2396.html) to [**RFC 3986**](https://datatracker.ietf.org/doc/html/rfc3986.html) for quoting URL strings. โ~โ is now included in the set of unreserved characters.
@warped prawn Yo
What's up?
Not much, you?
hello sir hemlock
checking out how sir lancebot works
how are yall doin?
im doing
thought because you told,'gyms are not that big?'
what!!!
nahh
20 in here
:]
yeh same
we have got a pool and a gym in here
so pretty comfy
planet fitness would be wild if their lunk alarm had cv
true
I saw a video of the alarm getting set off by a dropped pen.
oh yeah that did happen
hell yes
slave
i'd go if i got paid
i don't have a habit of going to the gym but that cash entices me
in fact work wont keep you fit
plus i can get cardio in
work is just work
unless it's like a labor of love
i mean fitness ain't meant to be comfortable at all times
so temperature would b the least of problems
:{seems tasty
@rugged root exercise bike to generator - to charge phones and ...
Yeah that I'd be down with
check thid out
well its just the same case with the libraries
we do have books now though..but ppl still prefer to go
two birds one stone
I measured, it's 70~80cm
roll around in a pile of money - theres your pheromones
hi!
Yo
life is contagious
I got COVID and ended up in ER, it's real
alright well people in asia did die in mass
@rugged root multipurpose generator that you can move - so bike , wind , water ....... there may be a toilet joke in there somewhere
so much difference between two official sources
dont believe the stats
the stats can never be relied on ...at least in many countries
!
i believe the death tolls are not at all covered
so you cant presume that it wasnt 'seeable' prolly
tried and, excluding Russian sites, these four sites are top 4 returned by google on "iso 20022"
(in the order: iso20022.org, en.wikipedia.org, swift.com, jpmorgan.com)
Steve Baller
privacy violation as a service
I still haven't accepted WhatsApp's "new" ToS
still not locked out of the app, two years later
They aren't in the same market
I remembered this exists
https://mattermost.com/
continuing the "maybe opensource maybe talk" theme
https://github.com/nextcloud/spreed
I know someone who hosts a discord bot on digitalocean
didn't hear any complaints from them so far
bot without anything useful runs on around 30MB
my bots almost never surpass .5GB
"I have a static IPv4 address at home, I'm living a happy life"
"looking for a VPS? host at Yandex. illegally."
Sounds right
there was a copyright trouble with nginx
Eh?
Rambler (who tf are they? idk) claimed copyright because the author worked for them
!d traceback.print_exc
traceback.print_exc(limit=None, file=None, chain=True)```
This is a shorthand for `print_exception(sys.exception(), limit, file, chain)`.
!e
class Student:
def __init__(self, name, age):
self.name = name
self.age = age
sally = Student("Sally", 10)
print(sally)
print(str(sally))
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | <__main__.Student object at 0x7fd459fc0510>
002 | <__main__.Student object at 0x7fd459fc0510>
hey i need a lil bit of help with linux distro
which distro?
thats my question
i was pop os user for quite a while then something fucked up due to some update or smth
now im on windows
and i aint liking this coz my laptop sucks
and ill need it for some python stuff and entertaainment
try ubuntu or mint
(or at least mentioned in such contexts)
new update
Ubuntu is an ok choice in general
that wont be an factor not like i have graphics card etc
most debian-based support apt (including ubuntu and mint)
yes if u want something with more support check apx for vanilla os
ok ill note these
im ok with all the difficult in the world coz have used debian and ubuntu before
and some arch
apx has like fedora,deb,arch suppoet
it might have been Manjaro
oh yeh manjaro has epic nividia support thats tru
i have been a manjaro user for a while
but its fkn heavy and buggy
afaik
np
for relatively lightweight distros, there's Lubuntu
L
L
try ubuntu on a data stick
hi verboof, hem, gofek, fedrick, magical girl, prop head
@stone crown If you're wondering why you can't talk, check out the #voice-verification channel. That'll tell you what you need to know about the voice gate
be prepared to do a singing audition...
didnt run the command
mb
No worries!
can pickle work ? py code to other py code kinda like a pipe ???
!e
from json import dumps, loads
ham = [1, 2, 3, 4, 5]
print(repr(ham))
json_string = dumps(ham)
print(repr(json_string))
loaded_json = loads(json_string)
print(repr(loaded_json))
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [1, 2, 3, 4, 5]
002 | '[1, 2, 3, 4, 5]'
003 | [1, 2, 3, 4, 5]
@rugged root your using JSON as a bridge between 2 seperate py files ?
questionares = {
mother = {
"questions": None,
"answers": {
},
"title": None,
"description": None,
}
father = {
"questions": None,
"answers": {
},
"title": None,
"description": None,
}
}
How would you pronounce this: Bois D'Arc
Prideaux
essex
sussex
Example of a Fortranย 90 Program
Hello,
Thank you for registering for a DigitalOcean account. Our automated security tooling identified patterns that suggest your account is not eligible for activation, which resulted in an account lock. After review by our support staff, we have determined that restoring access to your account will not be possible.
If you feel your account was locked in error you can take action! Please provide us with additional information about how you plan to use our platform including potential resource requirements. Additionally, if you recently opened multiple new accounts with us, could you please clarify why you have created an additional account rather than use our Teams feature?
To learn about Team Accounts, please see here: https://www.digitalocean.com/docs/accounts/teams/
A note on potential account charges:
When you add a credit card to a new DigitalOcean account, we may send a preauthorization request to the issuing bank. This is to verify that the card being added has been issued by the bank and that they will authorize the charges. This temporary preauthorization hold ranges from USD $1 to $15. The hold may appear on your statement for up to 7 days, but no funds are being transferred from your card or account to DigitalOcean. You will see those amounts reflect in the coming week, probably sooner. Inquiries about the hold should be made directly with your bank.Any PayPal payments initiated on sign up have been refunded and will post as soon as it clears via PayPalโs automated network. You can contact PayPal directly about the status of the refund.
DigitalOcean Support Team
dumb fucks
imagine a karen was like "us? how dare you!"
hi
can anyone help and show me how to run manim code from 3blue1brown bcs im doing smth wrong
how do i get unsuprresed
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
>>> dump()
Variables: [
]
Functions: [
print=Function(print, [], args, {'sep': ' ', 'end': '\n', 'flush': True}, None, { ['<built-in function>'] })
exit=Function(exit, [], None, {'code': 0}, None, { ['<built-in function>'] })
dump=Function(dump, [], None, {'show_self': False, 'show_var': True, 'show_func': True}, None, { ['<built-in function>'] })
clear=Function(clear, [], None, {}, None, { ['<built-in function>'] })
time=Function(time, [], None, {'as_int': False}, None, { ['<built-in function>'] })
getvars=Function(getvars, [], None, {}, None, { ['<built-in function>'] })
getvar=Function(getvar, ['name'], None, {}, None, { ['<built-in function>'] })
getfuncs=Function(getfuncs, [], None, {}, None, { ['<built-in function>'] })
setvar=Function(setvar, ['name', 'value'], None, {}, None, { ['<built-in function>'] })
global=Function(global, ['name', 'value'], None, {}, None, { ['<built-in function>'] })
input=Function(input, ['prompt'], None, {}, None, { ['<built-in function>'] })
...
]
Does this help?
https://stackoverflow.com/questions/41253228/preflight-or-cors-error-on-every-request
shortened it, lmao
import random
import utils
print("Welcome to Rock, Paper, Scissors!")
print("Type 'rock', 'paper', or 'scissors' to play.")
print("Type 'quit' to quit.")
let choices = ["rock", "paper", "scissors"]
let results = ["You lose!", "You win!", "It's a tie!"]
while True {
print("What is your choice?")
let choice = input(">> ")
if choice == "quit" {
break
} elif choice in choices {
print(choice(results))
} else {
print("That is not a valid choice.")
}
}
yeah I made it before I had a lot of features lmao
!code
what is the use of LEGB rule ??
!e py def outer(): set = 0 def inner(): set = 1 print(set) #local to inner inner() set = 2 outer()
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
1
!e py def outer(): set = 0 def inner(): print(set) #enclosing of inner inner() set = 2 outer()
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
0
!e py def outer(): def inner(): print(set) #global inner() set = 2 outer()
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
2
!e py def outer(): def inner(): print(set) #builtin inner() outer()
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'set'>
@pine shell
It's the order of resolution you need to account for.
to do what ??
You can refer to variables outside of the current scope, and if you do, this is the way the onion peels.
Bar exceptional cases, it's generally a good idea to avoid reaching outside of scope where things should be given as argument, instead.
For example, constants you could reach outside to.
Things that could be different per call, you'd have that given to a parameter as an argument of a call.
hello @verbal zenith
oops i didn't see you say hi
no problem
@sick condor ๐
def function(parameter):
pass
function(argument) #The call to the fuction```
!e ```py
def function(value):
print(value)
function('Hello, world.')
function('Goodbye.')```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello, world.
002 | Goodbye.
!e ```py
def function(a, b):
print(a)
print(b)
function('apples', 'pears')```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | apples
002 | pears
!e ```py
def function():
pass
print(function())```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
None
!e ```py
def function():
return 'Hello, world.'
print(function())```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world.
The call to a function or method is replaced by the return of that function or method.
!e py result = print('Hello, world.') print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello, world.
002 | None
!print-return
!e ```py
def function():
return 5
result = function() #result = 5
print(result)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
5
The call, function() on the result line, is replaced by the object given to return within the function.
Here, 5.
!e ```py
def function():
print('Printed')
return 'Returned'
print(function())```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Printed
002 | Returned
!e py def func(): return 5 print(func()) #print(5)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
5
!e ```py
def add(a, b):
return a + b
result = add(5, 2)
print(result)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
7
5 + 2 + 3 == 10
7 + 3 == 10
10 == 10
True```
!e py for letter in 'abc': print(letter)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | a
002 | b
003 | c
!e py for fruit in ['apple', 'pear', 'orange']: print(fruit)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | apple
002 | pear
003 | orange
!e py for i in range(5): print(i)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
!e py for i in 5: print(i)
@somber heath :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 | for i in 5:
004 | TypeError: 'int' object is not iterable
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 3, 4, 5, 6, 7, 8, 9]
!e ```py
def normal_function():
return 'func'
lambda_function = lambda: 'lambda'
print(normal_function())
print(lambda_function())```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | func
002 | lambda
!e py print('abc'[0]) print('abc'[1]) print('abc'[2]) print('abc'[-1]) print('abc'[-2]) print('abc'[-3])
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | a
002 | b
003 | c
004 | c
005 | b
006 | a
@lapis burrow๐
!e py my_dictionary = {'apples': 'delicious', 5: 32} print(my_dictionary['apples']) print(my_dictionary[5])
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | delicious
002 | 32
!e py my_dictionary = {'key_a': 'value_a', 'key_b': 'value_b', 'key_c': 'value_c'} print(my_dictionary.keys()) print(my_dictionary.values()) print(my_dictionary.items())
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | dict_keys(['key_a', 'key_b', 'key_c'])
002 | dict_values(['value_a', 'value_b', 'value_c'])
003 | dict_items([('key_a', 'value_a'), ('key_b', 'value_b'), ('key_c', 'value_c')])
!e py my_dictionary = {'key_a': 'value_a', 'key_b': 'value_b', 'key_c': 'value_c'} print(my_dictionary['key_b'])
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
value_b
@lone yarrow๐
hi bro
I have a doubt regarding python
I want to ask but dont have permission to speak
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
okay
I wanted to ask that i am learning python,
I have problem in stepsize of python
stepsize of string
range:
stop
start stop
start stop step
From index position 2 inclusive, to position 7 exclusive, by steps of 9.
I know that it will start the indexing from 2th position but will it end the iteration on 7th ?
!e py text = 'abcdefghijklmnop' print(text[2:7])
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
cdefg
!e py text = 'abcdefghijklmnop' result = text[2:7:1] print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
cdefg
!e py text = 'abcdefghijklmnop' result = text[2:7:2] print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
ceg
so it wont include the 7th position right ?
!e py text = 'abcdefghijklmnop' result = text[2:7:3] print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
cf
!e py text = 'abcdefghijklmnopqrstuvwxyz' result = text[::2] print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
acegikmoqsuwy
!e py text = 'abcdefghijklmnopqrstuvwxyz' result = text[::-1] print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
zyxwvutsrqponmlkjihgfedcba
yeah rest of the functions i have understood
it will skip the literals
thank you so much man, see you later
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
and i just started learning python
I used it once (when going through tutorials)
but I have no idea about the API
@buoyant cobalt use randomized names
randomisation is the simplest version
S3 isn't optimised for optimisation, from what I think its principles are
with randomisation it can't be accesses without the URL being shared
but
if someone can share a link
they might just share the file itself
store at
/group_id/message_id/88e24a1c0f7d17b2242689accbe67540/filename.jpg
@buoyant cobalt
by the way S3 works,
/group_id/message_id/ shouldn't show the list of files
@somber heath the issue is being able to guess the URL, seems like
not the need for auth.
@buoyant cobalt you need to explain that to people who might take issue with guessing the URL
basically, explain that the URL cannot be guessed in real setting
you shouldn't be accessing S3 from Flask
main reason being Flask isn't async
if you need something familiar, use Quart
as a more proper framework within the same family of software, Django
S3 requests take time
by not using async, you're limiting the amount of requests you can serve by your HTTP server
most Flask production servers are limiting the amount of requests to amount of CPUs you have
so like
each file upload is going to slow down all other requests significantly
with default settings, if you have 8 cores and and 8 uploads happening at the same time,
your server will be unable to respond to anything at all
(by default the amount of workers is limited by the amount of cores)
you can have a separate service for uploads, yes
probably the correct choice
nginx allows that very well
Quart is just async Flask, that's all it is
I think FastAPI is more easy to use in most cases
if you do no IO requests from Flask, it's fine to use it
@verbal fox๐
Hello
any database, filesystem, etc. operations are in most cases better handled with async
it's still IO
1ms is already a lot of time
even SQLite
file operations aren't instant
threading by default takes 5ms to switch contexts, iirc
(granularity-wise not how computation-heavy it is)
!e
import sys
print(sys.getswitchinterval())
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
0.005
This floating-point value determines the ideal duration of the โtimeslicesโ allocated to concurrently running Python threads.
there's also print which has a very weird behaviour
it's not quite async friendly in some circumstances
no, not interlacing
I'm talking about performance
(aprint was just adding some amount of buffering and using async)
default PyCharm output behaves like a simple write-only file
(but without the filesystem overhead)
anyhow why this horrible code no work:
from PIL import Image, ImageSequence
frames = []
def add_and_split(gif):
for frame in ImageSequence.Iterator(gif):
print(frames)
frames.append(frame)
frames.insert( len(frames) + 1, gif)
if len(frames) > 1:
frames[0].save("temp_result.gif", save_all=True, append_images=frames[1:-1])
else:
pass
i = 0
while True:
gif = Image.open("temp_result.gif")
add_and_split(gif)
i += 1
print(i)
if i >= 20:
break
for some reason gives :
Traceback (most recent call last):
File "D:\gif.py", line 21, in <module>
add_and_split(gif)
File "D:\gif.py", line 14, in add_and_split
frames[0].save("temp_result.gif.png", save_all=True, append_images=frames[1:-1])
File "D:\venv\lib\site-packages\PIL\Image.py", line 2431, in save
save_handler(self, fp, filename)
File "D:\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1239, in _save_all
_save(im, fp, filename, save_all=True)
File "D:\lib\site-packages\PIL\PngImagePlugin.py", line 1262, in _save
mode = modes.pop()
KeyError: 'pop from an empty set'
aren't you overwriting the opened file?
hi
yeah, but its again opening in umm..the while loop
does it give the same error if you save to a separate file?
separate file wont work, cuz i wanna append the gif every second frame in a same file
I'm not asking if it will work
test this first to make sure
to make sure overwriting isn't the problem
!e
print("Hello python people")
@scenic quiver :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello python people
!d pathlib.Path.rename
Path.rename(target)```
Rename this file or directory to the given *target*, and return a new Path instance pointing to *target*. On Unix, if *target* exists and is a file, it will be replaced silently if the user has permission. On Windows, if *target* exists, [`FileExistsError`](https://docs.python.org/3/library/exceptions.html#FileExistsError "FileExistsError") will be raised. *target* can be either a string or another path object:
```py
>>> p = Path('foo')
>>> p.open('w').write('some text')
9
>>> target = Path('bar')
>>> p.rename(target)
PosixPath('bar')
>>> target.open().read()
'some text'
```...
although I don't remember if mv overwrites by default
may require unlinking the old file first
@native reef๐
hy
@open osprey๐
hello @vocal basin wanna come in some clash of code
create a new one
this string sucks
I don't know much about the char stuff
Just instantiate each char classโฆoh wait wrong languageโฆ
@merry forge๐
@vocal basin next one
as you're doing it in Java, I restricted the languages to Java/C#
https://www.codingame.com/clashofcode/clash/2984069eab7471672b5a074b366ef07f815d06f
@cyan sentinel๐
sup
how can i verfy
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
output format threw me off a bit because it looked more like median than like average
because of how the python's standard implementation of the first handled types
yup
i was stuck on the decimal
part the output on the int side only
got it now
just checked if it is a double
and then
printed is accordingly
C#'s Console.WriteLine seems to remove the decimal by default
or tests just allow it
What's up?
@vocal basin i didn't get it what we had to do
product of digits
@dapper shard๐
separate as in owned?
as in my login service and my email verificstion is seperate
so, a separate service for making SMTP requests, right?
correct
yeah, that's a microservice approach, applicable in a lot of cases
(if you already have a service dedicated to login, might as well have a separate service for email)
gets a bit complex when i gotta send pictures any suggetions?
since b64 encoding wont work
why not host images separately and just link them?
https://en.wikipedia.org/wiki/Reverse_proxy Hm. The risks heading is...something.
In computer networks, a reverse proxy is an application that sits in front of back-end applications and forwards client (e.g. browser) requests to those applications. Reverse proxies help increase scalability, performance, resilience and security. The resources returned to the client appear as if they originated from the web server itself.Large ...
(I never wrote one myself neither do I intend on doing that; but I have experience configuring httpd to do reverse proxying)
is it about CORS?
never dealt with it on low-level
if I was doing that I'd look into how nginx/httpd do it
because they don't have any such problems by default
Okay Here is the thing I have a Nextjs frontend and a FlaskBackend
and basically using jwt
So I get preflight requests
quite a lot of risks arise if the proxy and the server are owned by separate parties (or at least run on separate machines)
Any request which is not a simple request is considered a non-simple or a preflighted request. The browser treats these kinds of requests a little differently. Before sending the actual request, the browser will send what we call a preflight request, to check with the server if it allows this type of request. A preflight request is an OPTIONS request which includes the following headers:
why do you need a custom reverse proxy?
oh
and why do you need to avoid those requests?
(just making sure)
do you know about preserve-host parameters for httpd/nginx?
they make sure the back-end knows which domain it gets accessed on
if the back-end returns CORS headers for the wrong domains, you will have issues
(I'll reframe the questions)
what issues do you have right now that you need a reverse proxy for?
CORS errors?
did you try using nginx or httpd and properly setting them up with preserve-host and stuff?
ProxyPreserveHost On
ProxyPass / http://some-server/
ProxyPassReverse / http://some-server/
(httpd)
!stream 750025574558335017
โ @brisk current can now stream until <t:1679406481:f>.
@patent depot๐
hello!
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.
@somber heath I think, you can unretract your statement about convincing to write reverse proxies
I wasn't watching.
fetch("http://127.0.0.1:5000/register" happens on the server, right?
yes, both ends
ok, so the problem is:
you're trying to access 127.0.0.1 from the outside world
fetch("/register")
if you need to access from the outside world
for httpd:
ProxyPreserveHost On
ProxyPass /register http://127.0.0.1:5000/register
ProxyPassReverse /register http://127.0.0.1:5000/register
"proxy":127.0.0.1:5000
@whole bear Yo
hello ๐๐
How's it going
Not too shabby. Trying to figure out why one of our programs is being especially stupid
thought you are a bot ๐ฅธ
happen to the best of us. you can do it
Password Safe allows you to safely and easily create a secured and encrypted user name/password list. With Password Safe all you have to do is create and remember a single Master Password of your choice in order to unlock and access your entire user name/password list.
Wait they have a Github
Wonder which one is the mirror
When I type sourceforge, I have to be careful I don't write sourceforget.
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.
@lucid bladeI had a friend whose Internet Explorer was fully half just toolbars.
The latter looks like a structural improvement.
รท will be a difficult character for people to type using their keyboard
When wanting to exit your program, use sys.exit.
import sys
sys.exit()```
imports at the top of your module, calls where you need them.
Depends on how you're calling/running the file
Exiting the current codeblock you're in can depend on what sort of block it is.
If you're in a function, at any point, you can return. This will terminate the execution of the function at that point. If you're in a for or while loop, you can break. If you're in most other kinds of blocks, you have to wait for them to process.
for the vc: .topic
You can type exit into the input to set a condition that is then read by, say, a while loop.
Or an if
user_input = input(...)
while user_input != 'exit':
...
user_input = input(...)```Is one pattern you could use. This has a little bit of smell to it because of the doubling up, but let's not worry too much about that for the moment.
There's a nice compact one using walrus, but yeah...maybe not.
while (user_input := input(...)) != 'exit':
...```
while True:
user_input = input(...)
if user_input == 'exit':
break```
Another approach.

