#voice-chat-text-0

1 messages ยท Page 102 of 1

somber heath
#

Yet.

#

!e py print(type(...))

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

<class 'ellipsis'>
somber heath
#

It's an actual object in Python.

#

You don't need to yet.

vocal basin
somber heath
#

ctrl + c

#

REPL

#

!d break

wise cargoBOT
#

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...
somber heath
#

!d continue

wise cargoBOT
#

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.
somber heath
#

!e py for i in range(10): print(i)

wise cargoBOT
#

@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
somber heath
#

!e py for i in range(10): if i == 5: continue print(i)

wise cargoBOT
#

@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
somber heath
#

!e py for i in range(10): if i == 5: break print(i)

wise cargoBOT
#

@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
somber heath
#

!e py run = True while run: print('Hello.') run = False

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello.
somber heath
#

!e py while True: break print('Hello.')

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello.
somber heath
#

!e ```py
def func():
print('Hello.')
print('Goodbye.')

func()
func()
func()```

wise cargoBOT
#

@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
#

Object oriented programming.

#

!e py print(type('abc')) print(type(123))

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | <class 'str'>
002 | <class 'int'>
somber heath
#

!e py print('text'.upper())

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

TEXT
somber heath
#

!e ```py
class Person:
def init(self, name):
self.name = name
def greet(self):
print(f'Hello! I am {self.name}.')

person_a = Person('Peter')
person_b = Person('Sally')

person_a.greet()
person_b.greet()```

wise cargoBOT
#

@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.
somber heath
#

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)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

10
somber heath
#

!e ```py
class MyClass:
def add(self, value):
print(f'You tried to add {value}')
return 9001

a = MyClass()
print(a + 10)```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | You tried to add 10
002 | 9001
somber heath
#

!e py print(dir(int))

wise cargoBOT
#

@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']
somber heath
#

!e py v = 9001 result = v.bit_count() print(result)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

6
somber heath
#

!e py 'abc'.bit_count()

wise cargoBOT
#

@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'
somber heath
#
def func():
    pass```
#

!e ```py
def func(value):
print(value)

func('Hello, world.')
func('abc')```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Hello, world.
002 | abc
somber heath
#

tomorrow

verbal zenith
#
>>> 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
]
somber heath
#

!e py for a, b in [(1, 2), (3, 4), (5, 6)]: print(a) print(b)

wise cargoBOT
#

@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
somber heath
#

!e py for a, (b, c) in [(1, (2, 3)), (4, (5, 6)), (7, (8, 9))]: print(a) print(b) print(c)

wise cargoBOT
#

@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
vocal basin
#

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

vocal basin
#

imports vs includes

#

second mostly works compile/parse-time

somber heath
#
from module heckinimport thing```
vocal basin
#

JS has imports not includes, afaik

vocal basin
verbal zenith
#
from module import fn thing
from module import var thing
import module
import module.x
from module.x ...
vocal basin
#

I can't remember any languages that do that

#

even C allow using function name as an "object"

#

(interpreted as function pointer)

vocal basin
sour willow
vocal basin
#

well, python just does dictionary lookup

#

locals()['your_variable_name']

#

only locals and globals
nonlocals (closures) are handled separately

vocal basin
#

!e

def f():
    x
    global x
wise cargoBOT
#

@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
vocal basin
#

locals/globals/closure

#

!e

def f():
    x = 1
    def g():
        print(x)
    return g
h = f()
h()
print(h.__closure__)
wise cargoBOT
#

@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>,)
vocal basin
#

normally __closure__ is None

left trail
#

heyy,,

vocal basin
#

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

left trail
#

!e
p = ctypes.pointer(ctypes.c_char.from_address(5))
p[0] = b'x'

vocal basin
#

and maybe ALGOL 68

vocal basin
#

but it definitely had lambdas

#

(in anonymous/local function sense)

vocal basin
#

@verbal zenith classes

somber heath
#

I had an idea for a demonstration, but it got convoluted.

vocal basin
#

classmethod is an example

somber heath
#

@left trail @ocean anchor๐Ÿ‘‹

vocal basin
vocal basin
#

!e

class C:
    @staticmethod
    def m(): ...

print(C.__dict__['m'])
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

<staticmethod(<function C.m at 0x7f7e46624680>)>
vocal basin
#

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

wise cargoBOT
#

classmethod int.from_bytes(bytes, byteorder='big', *, signed=False)```
Return the integer represented by the given array of bytes...
vocal basin
somber heath
#

!e ```py
class MyClass:
v = 0
@classmethod
def increment(cls):
cls.v += 1

print(MyClass.v)
instance = MyClass()
instance.increment()
print(MyClass.v)```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 0
002 | 1
somber heath
#

A stupid example, but this is how you could use it.

vocal basin
#
@classmethod
def from_something(cls, something, ...) -> Self:
    ...
somber heath
#

@timid crypt๐Ÿ‘‹

vocal basin
#

!d pathlib.Path

wise cargoBOT
#

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").
vocal basin
#

this uses __new__ at least twice

#

__new__ has very broken semantics

timid crypt
somber heath
#

!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()```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Apples.
002 | Native.
somber heath
#

Just to show how stupid decorators can get.

#

yep, I've done decorator chaining, too, for a fireworks thing

vocal basin
# vocal basin `__new__` has very broken semantics

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

vocal basin
sour willow
#

wassup AF, Osyra, Opal

somber heath
#
@decorator_a
@decorator_b
def func(...):
    ...```This is a thing.
#

@rain relic๐Ÿ‘‹

vocal basin
#
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

verbal zenith
vocal basin
vocal basin
#

own something and calling it "lambda"

#

"function" would collide with a fake builtin

#

it kind of exists but kind of not

#

!e

function
wise cargoBOT
#

@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
vocal basin
#

@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

lusty jewel
#

thanks

vocal basin
#

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

scenic quiver
#

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
vocal basin
#

this is JavaScript

scenic quiver
vocal basin
#

both are zero-ish

#

{}+1 is 1

somber heath
#

What if there are elements?

vocal basin
#

([][[]]+[])[[]-[]] is 'u'

scenic quiver
vocal basin
vocal basin
#

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

vocal basin
#

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

somber heath
#
vocal basin
#

speaking of why +x exists

#

+'a' tries to make it into a number

scenic quiver
#

Not a Number right?

#

NaN?

vocal basin
#

yes, as a result

scenic quiver
#

๐Ÿคฃ

sour willow
#

makes sene right?

verbal zenith
sour willow
#

Doesnt strings automatically turn into ascci so then its a number?

ocean anchor
#

lmao does no one have voice perms

#

ratio 1 is to 10

noble solstice
#

Hello Guys!

vocal basin
scenic quiver
#

I have it but there is background noise

ocean anchor
#

i dont have background noise but no perms

scenic quiver
#

๐Ÿ™ƒ

ocean anchor
#

im just doing studying for my exams these background noise helps

scenic quiver
#

๐Ÿ™‚

vocal basin
scenic quiver
#

๐Ÿฅฒ

somber heath
#

@analog granite๐Ÿ‘‹

vocal basin
#

with DP it's simple

vocal basin
# scenic quiver ```py class Solution(object): def minCostClimbingStairs(self, cost): ...

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

vocal basin
scenic quiver
vocal basin
#

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 ...

scenic quiver
#

Which depends on?

vocal basin
#

from which stairs can you get to stair number N? (in one step)

vocal basin
vocal basin
warped raft
#

@somber heath ๐Ÿ‘‹

#

@vocal basin are you willing to do some clash of code

#

if you're free

warped raft
#

fastest and reverse

#

give all language access

#

i'll do it with java

#

the game mode was reverse

#

or not

vocal basin
#

not reverse

#

it's choosing randomly

#

between reverse and fastest

vocal basin
warped raft
#

then do it

#

we are just two we will know who is the fastest

vocal basin
#

reverse seems to work the same way as "fastest" by default

#

there is no reverse code golf

warped raft
#

yup

#

the ranking is done the same way

lavish rover
#

I wanna join y'all but I'm in bed

vocal basin
#

btw, is there an APL keyboard for phones?

#

brb
(will send the next link when back)

lavish rover
#

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

somber heath
#

@spark prairie๐Ÿ‘‹

spark prairie
#

Hi

#

Sorry I canโ€™t speak

warped raft
#

just pin me

somber heath
#

@ionic reef ๐Ÿ‘‹

somber heath
wise cargoBOT
#
Voice verification

Canโ€™t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

warped raft
#

if you can talk jump in live coding

somber heath
#

@cosmic lodge๐Ÿ‘‹

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

frosty star
#

Yoyo

somber heath
#

@fallen sinew๐Ÿ‘‹

fallen sinew
#

Hey

#

I'm guessing you can't talk here hmm?

frosty star
#

Can somebody do a bit of image detective? If I post a photo here can you find the exact source?

somber heath
wise cargoBOT
#
Voice verification

Canโ€™t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

cosmic lodge
#

see bro this file

frosty star
#

@somber heath what was that?

#

Orait thanks!

frosty star
#

Thanks opal :3

#

I will try

cosmic lodge
#

bro i cant understand

#

ok

#

ok bro thanks for helping me

somber heath
cosmic lodge
#

thanks๐Ÿ˜„

somber heath
#

@upbeat whale๐Ÿ‘‹

upbeat whale
#

Hello

frosty star
#

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

ancient lily
#

yo

frosty star
#

Heh

#

Haaaahahha

#

Iโ€™m like playing detective right now tryna prove that this breeder is a scam

somber heath
#

@shadow prawn๐Ÿ‘‹

shadow prawn
#

hi

somber heath
#

!voice

wise cargoBOT
#
Voice verification

Canโ€™t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

frosty star
#

Sometimes I donโ€™t even rinse

warped raft
#

@vocal basin you can come back if you want

rugged root
#

@old juniper Yo

somber heath
#

By nary search.

#

A search that requires less sorting.

rugged root
#

Yo yo yo Huffle Puff Daddy

#

!stream 95175136319115264

wise cargoBOT
#

โœ… @whole bear can now stream until <t:1679320973:f>.

warped raft
#

no problem

rugged root
#

Wait, how long does it take you to do your hair

somber heath
#

Product.

wise cargoBOT
#

Hey @whole bear!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

uncut meteor
#
#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;
}
somber heath
#

@rugged root %

vocal basin
#

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

vocal basin
#

char, char, char
I think this should be 4 bytes

gentle flint
#

have you considered cutting it

#

might save time

rugged root
#

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

vocal basin
vital quartz
#

How to bring back the button to start the code?

somber heath
#

!e py my_list = ['apples', 'pear', 'orange', 'banana', 'orange'] my_list.remove('orange') print(my_list)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

['apples', 'pear', 'banana', 'orange']
somber heath
#

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)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | orange
002 | ['apples', 'pear', 'orange', 'banana']
somber heath
#

By default, list.pop removes from the right of the list.

vocal basin
somber heath
#

But you can specify an index position to pop.

rugged root
#

@stuck furnace Yo

somber heath
#

!e py my_list = my_list = ['apples', 'pear', 'orange', 'banana', 'orange'] popped = my_list.pop(1) print(my_list) print(popped)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | ['apples', 'orange', 'banana', 'orange']
002 | pear
vital quartz
uncut meteor
#

๐Ÿ˜ญ

somber heath
#

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.

willow light
somber heath
#

Antimony, Antimony, tim tim, ta-roo.

rugged root
#

Dude

#

We have someone from our MSP, he's so small

#

I think he's under 5 foot

rugged root
#

So good

somber heath
#

Talkative graph.

#

@willow light When?

#

"When" it recovers?

#

@whole bear๐Ÿ‘‹

willow light
#

I am contractually obligated to believe in the market

willow light
#

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

somber heath
#

@proud depot๐Ÿ‘‹

#

bbiab

proud depot
#

hello

#

really new to python

#

trying to figure out how to import a image

rugged root
#

How do you mean? What's the context?

willow light
vocal basin
willow light
#

RealPython is better written though

rugged root
#

Sometimes

vocal basin
#

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

rugged root
vocal basin
#

APIs allow decoupling implementation from the interface
so, yes, (if people putting in the requirement understood that) there shouldn't be such restrictions

willow light
#

They also required our front end to be compatible with internet explorer

rugged root
#

@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

vocal basin
#

but not go nvm it's too

golden sonnet
#

hi

vocal basin
#

I found one container (out of 31 running) which definitely is alpine

rugged root
#

@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

vocal basin
#

"A.F." is initials of the name

rugged root
#

Wait how long is your hair, AF?

willow light
#

Itโ€™s long AF

vocal basin
#

60cm
didn't measure more exactly

rugged root
#

That is very long

vocal basin
#

interactivity:
if you DDoS the site, it changes the response

willow light
#

.topic

viscid lagoonBOT
#
**What's your favourite type of weather?**

Suggest more topics here!

willow light
#

Sprites

ancient lily
#

hello

rugged root
#

What're you up to

ancient lily
#

learning bout subclass

willow light
#

@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?

rugged root
#

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

willow light
#

Yeah, if it is a DM and only the first time, it probably won't do the job.

rugged root
rugged root
ancient lily
rugged root
#

Anything tripping you up so far?

gentle flint
rugged root
#

Your ear's must have been burning, oof

gentle flint
#

maybe best to only ping them in the chat

rugged root
#

Fury was wondering if you still had access to the ISO 9000 stuff

gentle flint
ancient lily
gentle flint
#

yes I do

rugged root
#

Yeah I don't know why I hit the ' there

rugged root
#

Love that guy

gentle flint
#

why was furyo wondering?

rugged root
#

@molten pewter

#

I think he was wondering whether SWIFT was getting any security things added to the standard

ancient lily
#

opal was the one who told me about him

gentle flint
#

ISO 9000 is about quality management

#

what does that have to do with SWIFT?

ancient lily
#

your just getting older @rugged root

gentle flint
#

you're

willow light
vocal basin
#

seems like SWIFT is ISO 9362 which isn't a part of ISO 9000 Family

#

screwdriver set is at risk of becoming screwdriver singleton

lucid blade
#

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โ€™...

โ–ถ Play video
gentle flint
lucid blade
molten pewter
vocal basin
#

oh, docs use monokai

#

steam excludes sudden waves of reviews

#

sometimes

hoary plaza
vocal basin
#

there is urllib or something

#

(in standard library)

#

!d urllib.parse.quote

wise cargoBOT
#

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.
vocal basin
#

"just use raw TCP packets over Tor instead of email"

rugged root
#

@warped prawn Yo

warped prawn
vocal basin
#

mail.ru (please, don't use it, it's government controlled) allows arbitrary aliases

rugged root
#

Not much, you?

woven verge
#

hey

#

what're we all in vc for?

#

fun

sharp urchin
#

hello sir hemlock

woven verge
#

checking out how sir lancebot works

sharp urchin
#

how are yall doin?

woven verge
#

im doing

sharp urchin
#

hmmm...possibly best

#

how much's the membership for you guys?

woven verge
#

question about async io

#

if yall are up for it

sharp urchin
#

what!!!

#

nahh

#

20 in here

#

:]

#

yeh same

#

we have got a pool and a gym in here

#

so pretty comfy

woven verge
#

planet fitness would be wild if their lunk alarm had cv

sharp urchin
#

true

somber heath
#

I saw a video of the alarm getting set off by a dropped pen.

woven verge
#

oh yeah that did happen

hoary plaza
sharp urchin
#

i would squeeze out every penny i spent lmao

#

yes

woven verge
#

hell yes

sharp urchin
#

slave

woven verge
#

i'd go if i got paid

#

i don't have a habit of going to the gym but that cash entices me

sharp urchin
#

in fact work wont keep you fit

woven verge
#

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

sharp urchin
#

:{seems tasty

limpid umbra
#

@rugged root exercise bike to generator - to charge phones and ...

woven verge
rugged root
woven verge
#

check thid out

sharp urchin
#

well its just the same case with the libraries

#

we do have books now though..but ppl still prefer to go

limpid umbra
#

two birds one stone

vocal basin
rugged root
#

Jesus

#

That's like... mid back?

limpid umbra
#

roll around in a pile of money - theres your pheromones

opaque lark
#

hi!

rugged root
#

Yo

limpid umbra
#

life is contagious

sharp urchin
#

nahh i disagree

#

its more like you havent seen it all

amber raptor
sharp urchin
#

alright well people in asia did die in mass

limpid umbra
#

@rugged root multipurpose generator that you can move - so bike , wind , water ....... there may be a toilet joke in there somewhere

vocal basin
sharp urchin
#

and some countries just couldnt do anything

#

trust me

vocal basin
#

so much difference between two official sources

sharp urchin
#

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

molten pewter
vocal basin
rugged root
#

Steve Baller

vocal basin
#

privacy violation as a service

#

I still haven't accepted WhatsApp's "new" ToS

#

still not locked out of the app, two years later

rugged root
#

They aren't in the same market

vocal basin
vocal basin
#

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

gentle flint
vocal basin
#

"I have a static IPv4 address at home, I'm living a happy life"

#

"looking for a VPS? host at Yandex. illegally."

rugged root
#

Sounds right

gentle flint
vocal basin
#

there was a copyright trouble with nginx

rugged root
#

Eh?

vocal basin
#

!d traceback.print_exc

wise cargoBOT
#

traceback.print_exc(limit=None, file=None, chain=True)```
This is a shorthand for `print_exception(sys.exception(), limit, file, chain)`.
rugged root
#

!e

class Student:
  def __init__(self, name, age):
    self.name = name
    self.age = age

sally = Student("Sally", 10)
print(sally)
print(str(sally))
wise cargoBOT
#

@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>
inland gorge
#

hey i need a lil bit of help with linux distro

vocal basin
#

which distro?

inland gorge
#

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

sour willow
#

try ubuntu or mint

inland gorge
#

in upcoming days

#

ive tried it

vocal basin
#

there was some Linux with quite good driver support

#

I forgot the name

vocal basin
sour willow
#

new update

vocal basin
#

Ubuntu is an ok choice in general

inland gorge
inland gorge
#

is the package manager the same apt for it/

#

?

vocal basin
#

most debian-based support apt (including ubuntu and mint)

sour willow
#

yes if u want something with more support check apx for vanilla os

inland gorge
#

im ok with all the difficult in the world coz have used debian and ubuntu before

#

and some arch

sour willow
#

apx has like fedora,deb,arch suppoet

vocal basin
inland gorge
#

i have been a manjaro user for a while

#

but its fkn heavy and buggy

#

afaik

inland gorge
#

thanks btw

sour willow
#

np

vocal basin
sour willow
#

L

whole bear
#

L

vocal basin
#

source deactivate

#

probably

limpid umbra
#

try ubuntu on a data stick

sour willow
#

hi verboof, hem, gofek, fedrick, magical girl, prop head

rugged root
#

@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

limpid umbra
#

be prepared to do a singing audition...

rugged root
#

No worries!

gentle flint
limpid umbra
#

can pickle work ? py code to other py code kinda like a pipe ???

rugged root
#

!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))
wise cargoBOT
#

@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]
limpid umbra
#

@rugged root your using JSON as a bridge between 2 seperate py files ?

stone crown
#
questionares = {
  mother = {
        "questions": None,
        "answers": {
            
        },
        "title": None,
        "description": None,
    }
  father = {
        "questions": None,
        "answers": {
            
        },
        "title": None,
        "description": None,
    }
}
rugged root
#

How would you pronounce this: Bois D'Arc

gentle flint
#

Prideaux

dense ibex
#

essex

gentle flint
#

sussex

whole bear
#

hsl or hsla works

#

works

#

both the same

gentle flint
gentle flint
#

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

sour willow
#

joe_salute imagine a karen was like "us? how dare you!"

viscid pond
#

hi

#

can anyone help and show me how to run manim code from 3blue1brown bcs im doing smth wrong

finite mango
#

how do i get unsuprresed

verbal zenith
#

!voice

wise cargoBOT
#
Voice verification

Canโ€™t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

verbal zenith
#
>>> 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>'] })
    ...
]
brisk current
verbal zenith
brisk current
lavish rover
# verbal zenith https://github.com/HavenSelph/cobralang/tree/development

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.")
    }
}
verbal zenith
#

yeah I made it before I had a lot of features lmao

hardy jewel
#

ops

#

im testing things out with chatgpt

verbal zenith
#

!code

wise cargoBOT
#
Formatting code on discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

hardy jewel
pine shell
#

what is the use of LEGB rule ??

somber heath
#

!e py def outer(): set = 0 def inner(): set = 1 print(set) #local to inner inner() set = 2 outer()

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

1
somber heath
#

!e py def outer(): set = 0 def inner(): print(set) #enclosing of inner inner() set = 2 outer()

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

0
somber heath
#

!e py def outer(): def inner(): print(set) #global inner() set = 2 outer()

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

2
somber heath
#

!e py def outer(): def inner(): print(set) #builtin inner() outer()

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

<class 'set'>
somber heath
#

@pine shell

pine shell
#

what is the use of it

#

can you help me ?
or is it onlly the concept

somber heath
pine shell
#

to do what ??

somber heath
#

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.

warped raft
#

hello @verbal zenith

verbal zenith
#

oops i didn't see you say hi

warped raft
#

no problem

somber heath
#

@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.')```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Hello, world.
002 | Goodbye.
somber heath
#

!e ```py
def function(a, b):
print(a)
print(b)

function('apples', 'pears')```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | apples
002 | pears
somber heath
#

!e ```py
def function():
pass

print(function())```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

None
somber heath
#

!e ```py
def function():
return 'Hello, world.'

print(function())```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello, world.
somber heath
#

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)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Hello, world.
002 | None
somber heath
#

!print-return

wise cargoBOT
#
Print and return

Here's a handy animation demonstrating how print and return differ in behavior.

See also: /tag return

somber heath
#

!e ```py
def function():
return 5

result = function() #result = 5
print(result)```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

5
somber heath
#

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())```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Printed
002 | Returned
somber heath
#

!e py def func(): return 5 print(func()) #print(5)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

5
somber heath
#

!e ```py
def add(a, b):
return a + b

result = add(5, 2)
print(result)```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

7
somber heath
#
5 + 2 + 3 == 10
7 + 3 == 10
10 == 10
True```
winter plover
#

downloaded linux bout to see how fun it is lol

#

zion

#

yep

somber heath
#

!e py for letter in 'abc': print(letter)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | a
002 | b
003 | c
somber heath
#

!e py for fruit in ['apple', 'pear', 'orange']: print(fruit)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | apple
002 | pear
003 | orange
somber heath
#

!e py for i in range(5): print(i)

wise cargoBOT
#

@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
somber heath
#

!e py for i in 5: print(i)

wise cargoBOT
#

@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
#

@whole bear๐Ÿ‘‹

#

!e py data = [6, 1, 8, 3, 2, 9, 4, 5, 7] data.sort() print(data)

wise cargoBOT
#

@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]
somber heath
#

!e ```py
def normal_function():
return 'func'

lambda_function = lambda: 'lambda'

print(normal_function())
print(lambda_function())```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | func
002 | lambda
somber heath
#

!e py print('abc'[0]) print('abc'[1]) print('abc'[2]) print('abc'[-1]) print('abc'[-2]) print('abc'[-3])

wise cargoBOT
#

@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
somber heath
#

@lapis burrow๐Ÿ‘‹

#

!e py my_dictionary = {'apples': 'delicious', 5: 32} print(my_dictionary['apples']) print(my_dictionary[5])

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | delicious
002 | 32
somber heath
#

!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())

wise cargoBOT
#

@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')])
somber heath
#

!e py my_dictionary = {'key_a': 'value_a', 'key_b': 'value_b', 'key_c': 'value_c'} print(my_dictionary['key_b'])

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

value_b
somber heath
#
{'key': ['value_1', 'value_2', 'value_3']}```
#
{(0, 0): 'value'}```
somber heath
#

@lone yarrow๐Ÿ‘‹

lone yarrow
#

hi bro

#

I have a doubt regarding python

#

I want to ask but dont have permission to speak

somber heath
#

!voice

wise cargoBOT
#
Voice verification

Canโ€™t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

lone yarrow
#

!voice

#

okay

#

I wanted to ask that i am learning python,

#

I have problem in stepsize of python

#

stepsize of string

somber heath
#

range:
stop
start stop
start stop step

lone yarrow
#

like what is the meaning of [2:7:9]

#

start and stop

somber heath
#

From index position 2 inclusive, to position 7 exclusive, by steps of 9.

lone yarrow
#

I know that it will start the indexing from 2th position but will it end the iteration on 7th ?

somber heath
#

!e py text = 'abcdefghijklmnop' print(text[2:7])

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

cdefg
somber heath
#

!e py text = 'abcdefghijklmnop' result = text[2:7:1] print(result)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

cdefg
somber heath
#

!e py text = 'abcdefghijklmnop' result = text[2:7:2] print(result)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

ceg
lone yarrow
#

so it wont include the 7th position right ?

somber heath
#

!e py text = 'abcdefghijklmnop' result = text[2:7:3] print(result)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

cf
lone yarrow
#

Okay brother

#

understood

#

Thank you

somber heath
#

!e py text = 'abcdefghijklmnopqrstuvwxyz' result = text[::2] print(result)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

acegikmoqsuwy
somber heath
#

!e py text = 'abcdefghijklmnopqrstuvwxyz' result = text[::-1] print(result)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.

zyxwvutsrqponmlkjihgfedcba
lone yarrow
#

yeah rest of the functions i have understood

#

it will skip the literals

#

thank you so much man, see you later

somber heath
#

@hollow jewel๐Ÿ‘‹

#

@errant bolt๐Ÿ‘‹

errant bolt
#

hi

#

sorry im still a newbie

#

i cant talk

somber heath
#

!voice

wise cargoBOT
#
Voice verification

Canโ€™t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

errant bolt
#

and i just started learning python

vocal basin
#

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.

vocal basin
#

basically, explain that the URL cannot be guessed in real setting

#

you shouldn't be accessing S3 from Flask

vocal basin
#

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

vocal basin
#

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

somber heath
#

@verbal fox๐Ÿ‘‹

verbal fox
#

Hello

vocal basin
#

it's still IO

#

1ms is already a lot of time

#

even SQLite

vocal basin
vocal basin
#

!e

import sys
print(sys.getswitchinterval())
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

0.005
vocal basin
#

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)

cosmic lark
#

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'
vocal basin
golden sonnet
#

hi

cosmic lark
vocal basin
cosmic lark
vocal basin
#

I'm not asking if it will work

vocal basin
#

to make sure overwriting isn't the problem

cosmic lark
#

ok that worked

#

lmao

#

nice

scenic quiver
#

!e

print("Hello python people")
wise cargoBOT
#

@scenic quiver :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello python people
vocal basin
#

!d pathlib.Path.rename

wise cargoBOT
#

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'
```...
vocal basin
#

although I don't remember if mv overwrites by default

#

may require unlinking the old file first

somber heath
#

@native reef๐Ÿ‘‹

native reef
#

hy

somber heath
#

@open osprey๐Ÿ‘‹

warped raft
#

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

willow light
#

Just instantiate each char classโ€ฆoh wait wrong languageโ€ฆ

somber heath
#

@merry forge๐Ÿ‘‹

warped raft
#

@vocal basin next one

vocal basin
warped raft
#

ok

#

that fair deal

somber heath
#

@cyan sentinel๐Ÿ‘‹

cyan sentinel
#

sup

cyan sentinel
vocal basin
#

!voice

wise cargoBOT
#
Voice verification

Canโ€™t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

vocal basin
warped raft
#

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

vocal basin
#

C#'s Console.WriteLine seems to remove the decimal by default
or tests just allow it

somber heath
#

What's up?

warped raft
#

@vocal basin i didn't get it what we had to do

vocal basin
warped raft
#

ok i Tried

#

sum of digits

#

but i didn't get it

#

anyways next one

somber heath
#

@dapper shard๐Ÿ‘‹

vocal basin
#

C#'s String.Join is too JS-like

#

it auto-converts to String

sour willow
#

its good to have a seperate emial server rightM

#

?

vocal basin
#

separate as in owned?

sour willow
#

as in my login service and my email verificstion is seperate

vocal basin
#

so, a separate service for making SMTP requests, right?

sour willow
#

correct

vocal basin
#

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)

sour willow
#

gets a bit complex when i gotta send pictures any suggetions?

#

since b64 encoding wont work

vocal basin
#

why wouldn't it work?

#

@brisk current httpd, nginx or custom?

vocal basin
somber heath
#

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 ...

vocal basin
#

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

brisk current
#

Okay Here is the thing I have a Nextjs frontend and a FlaskBackend

and basically using jwt

#

So I get preflight requests

vocal basin
brisk current
#

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:

vocal basin
#

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

vocal basin
#

CORS errors?

brisk current
#

yes

#

cors errors

#

Ive tried everything

#

but it doesnt work

vocal basin
#

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)

rugged root
#

!stream 750025574558335017

wise cargoBOT
#

โœ… @brisk current can now stream until <t:1679406481:f>.

somber heath
#

@patent depot๐Ÿ‘‹

patent depot
#

hello!

rugged root
#

How goes it

#

!paste

wise cargoBOT
#
Pasting large amounts of code

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.

vocal basin
#

@somber heath I think, you can unretract your statement about convincing to write reverse proxies

somber heath
#

I wasn't watching.

vocal basin
#

httpd/nginx cover most of the functionality

#

apache

vocal basin
#

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
brisk current
#

"proxy":127.0.0.1:5000

uncut meteor
#

Matherik

rugged root
#

@whole bear Yo

whole bear
#

hello ๐Ÿ‘‹๐Ÿ‘‹

uncut meteor
rugged root
#

How's it going

whole bear
#

it's going good. thanks for asking

#

how's it going for you

rugged root
#

Not too shabby. Trying to figure out why one of our programs is being especially stupid

willow light
uncut meteor
whole bear
uncut meteor
whole bear
willow light
rugged root
#
#

Wait they have a Github

#

Wonder which one is the mirror

somber heath
#

When I type sourceforge, I have to be careful I don't write sourceforget.

willow light
#

There we go, the only geocities-like site I trust the downloads from

wise cargoBOT
#
Pasting large amounts of code

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
#

@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.

rugged root
#

Depends on how you're calling/running the file

somber heath
#

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.

willow light
#

for the vc: .topic

somber heath
#

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.