#voice-chat-text-1

1 messages · Page 46 of 1

scarlet plinth
#

hy

#

hy

stuck bluff
#

First data science job with no prior experience.

#

@sharp fox 👋

sharp fox
#

berserk live action?

clear sage
sharp fox
#

manifest v3

#

oh that target issue right?

clear sage
sharp fox
#

re zero is also good, although not a typical isekai one. MC is very weak.

stuck bluff
sharp fox
#

Kaijuverse

#

sekai is world

clear sage
sharp fox
clear sage
sharp fox
#

they kinda ruined it in the new movie

clear sage
sharp fox
#

Gamera

#

Gamera vs Godzilla is basically like DC vs Marvel from what i know from youtube videos

#

yeah it is really cool!

#

and sad too

#

yeah but animation is goofy

clear sage
#

Sabikui Bisco
PLUTO

#

The Elusive Samurai

#

Weathering With You

sharp fox
#

is black mirror good?

stuck bluff
#

@misty sinew 👋

misty sinew
#

@stuck bluff Hello👋

stuck bluff
#

@green skiff 👋

green skiff
clear sage
stuck bluff
#

@misty sinew 👋

clear sage
#

Ushio & Tora

stuck bluff
clear sage
#

Jack of all trades, master of none, though oftentimes better than a master of one

dreamy shell
#

grea

stuck bluff
#

@wicked flame I am now available.

stuck bluff
#

I am now away.

wicked flame
#

@stuck bluff can you hear me

#

Oh no😭

serene quail
#

PLS some1 help

#

Its not working

#

Its saying download error

#

And how i use free download manager with dis

serene quail
stuck bluff
#

@shell jungle 👋

#

@graceful panther 👋

#

@limber gale 👋

hallow trail
#

сасал?

#

да

proper ridge
#

!paste

coarse hearthBOT
#
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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

stuck bluff
#

@shut scroll 👋

#

@glacial oriole 👋

glacial oriole
#

hi

ashen dagger
midnight dagger
#

can someone help me understand docstring?

pulsar anchor
#

specific docstring format or docstrings in general?

pulsar anchor
#

which, at times, can be hard to remember

#
def sqrt(x):
    """
    returns the square root of `x`

    raises `TypeError` when `x` is not an instance of `Real`
    raises `ValueError` when `x` is less than zero
    """
    ...
#

or, if it was like C,

def sqrt(x):
    """
    returns the square root of `x`

    `x` must be non-negative or the world explodes
    """
    ...
#

yeah, docstrings don't normally influence code

#

!d doctest

coarse hearthBOT
#

Source code: Lib/doctest.py

The doctest module searches for pieces of text that look like interactive Python sessions, and then executes those sessions to verify that they work exactly as shown. There are several common ways to use doctest:

• To check that a module’s docstrings are up-to-date by verifying that all interactive examples still work as documented.

• To perform regression testing by verifying that interactive examples from a test file or a test object work as expected.

• To write tutorial documentation for a package, liberally illustrated with input-output examples. Depending on whether the examples or the expository text are emphasized, this has the flavor of “literate testing” or “executable documentation”.

pulsar anchor
#

^ plus this

#
def factorial(n):
    """Return the factorial of n, an exact integer >= 0.

    >>> [factorial(n) for n in range(6)]
    [1, 1, 2, 6, 24, 120]
    >>> factorial(30)
    265252859812191058636308480000000
    >>> factorial(-1)
    Traceback (most recent call last):
        ...
    ValueError: n must be >= 0

    Factorials of floats are OK, but the float must be an exact integer:
    >>> factorial(30.1)
    Traceback (most recent call last):
        ...
    ValueError: n must be exact integer
    >>> factorial(30.0)
    265252859812191058636308480000000

    It must also not be ridiculously large:
    >>> factorial(1e100)
    Traceback (most recent call last):
        ...
    OverflowError: n too large
    """
    ...
#

(you can automatically test examples from docstrings)

midnight dagger
#

thank you

proper ridge
#

!zen

coarse hearthBOT
#
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

mild kelp
pulsar anchor
#

the one that's advertised all over Russian opposition content on YouTube

pulsar anchor
#

"they don't pay me for advertisement, so I don't get anything from sharing the name"

#

I'm half-paying attention

pulsar anchor
#

lmao

misty sinew
#

hi

#

@mild kelp

#

how to unmute our self

pulsar anchor
#

!voice

coarse hearthBOT
#
Voice verification

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

mild kelp
solar kayak
misty sinew
#

i cant

solar kayak
pulsar anchor
#

Django offers more than just an HTTP server

misty sinew
#

becasuse

pulsar anchor
#

Next.js should be a bit more productive option thanks to single-languagedness

#

but you'll need to fill in the gap of ORM

pulsar anchor
#

performance? library availability? ease of writing?

#

(what is the priority?)

mild kelp
#

performance with APIs

mild kelp
pulsar anchor
#

FastAPI (or starlette directly), if you're using Python

#

or anything in Java/C#/Rust

#

those should be performant enough without safety issues of C++

mild flume
#

LiteStar seems pretty solid for API stuff as well (for Python)

pulsar anchor
#

attempting to play jstris

#

yes

indigo bison
#

can

#

anyone

#

help me

mild flume
#

What with?

indigo bison
#

with this

#

yes

pulsar anchor
#

!d mimetypes

coarse hearthBOT
#

Source code: Lib/mimetypes.py

The mimetypes module converts between a filename or URL and the MIME type associated with the filename extension. Conversions are provided from filename to MIME type and from MIME type to filename extension; encodings are not supported for the latter conversion.

The module provides one class and a number of convenience functions. The functions are the normal interface to this module, but some applications may be interested in the class as well.

The functions described below provide the primary interface for this module. If the module has not been initialized, they will call init() if they rely on the information init() sets up.

indigo bison
#

😂😂😂

#

i am 18

mild flume
#

Wait

#

Is that you, AF

#

@proper ridge Sorry for not responding. We haven't had the Mayo appointment yet.

proper ridge
#

Did you mean to message here or dm?

indigo bison
#

@jake i am taking cs50p

#

@raw wren

#

now

pulsar anchor
#

for distributed systems you absolutely do need a lot of theory

indigo bison
midnight dagger
proper ridge
#

You're passing x as y.

#

It's an example winter.

#

Third part errors out because you never assign a value to x inside the function, so you can't add a 1 to x since you have no value for x.

#

!e

x += 1

print(x)
coarse hearthBOT
# proper ridge !e ```py x += 1 print(x) ```

:x: Your 3.12 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     x += 1
004 |     ^
005 | NameError: name 'x' is not defined
mild flume
#

!e

def inner_use(not_used):
  inner_number = 1
  inner_number += 1
  print(inner_number)

outer_number = 5
inner_use(outer_number)
print(outer_number)
coarse hearthBOT
proper ridge
#

Think of them as blocks.

#

A function is a box.

#

You give it sth, it does sth, it may or may not output sth.

mild flume
#

!e

def global_read(not_used):
  print(outer_number)
  print(outer_number + 1)

outer_number = 5
global_read(outer_number)
print(outer_number)
coarse hearthBOT
proper ridge
#

!e

def do_shit(new_shit):
    hidden_shit = "shit"
    print(f"Here's some shit. {hidden_shit}")

shit = "Oh shiit"
# Shit is passed as `new_shit`
do_shit(shit)
print(shit)
coarse hearthBOT
pulsar anchor
#

base for some modern distributed systems

mild flume
#

!e

def global_write_attempt(not_used):
  outer_number += 1

outer_number = 5
global_write_attempt(outer_number)
print(outer_number)
coarse hearthBOT
# mild flume !e ```py def global_write_attempt(not_used): outer_number += 1 outer_number =...

:x: Your 3.12 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 5, in <module>
003 |     global_write_attempt(outer_number)
004 |   File "/home/main.py", line 2, in global_write_attempt
005 |     outer_number += 1
006 |     ^^^^^^^^^^^^
007 | UnboundLocalError: cannot access local variable 'outer_number' where it is not associated with a value
pulsar anchor
#

(it thinks outer_number is defined inside the function)

mild flume
#

!e

def proper_modify(outer_number_argument):
  print(outer_number_argument)

  outer_number_argument += 1
  print(outer_number_argument)

  return outer_number_argument

outer_number = 5
outer_number = proper_modify(outer_number)
print(outer_number)
coarse hearthBOT
mild flume
#

!e

def global_write_attempt(not_used):
  global outer_number
  print(outer_number)
  outer_number += 1

  print(outer_number)

outer_number = 5
global_write_attempt(outer_number)
print(outer_number)
coarse hearthBOT
midnight dagger
#
MIT OpenCourseWare

6.0001 Introduction to Computer Science and Programming in Python is intended for students with little or no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems and to help students, regardless of their major, feel justifiably confident of their ability to write small p...

mild flume
#

foo bar baz

midnight dagger
#

thanks hemlock, see ya

pulsar anchor
#

SSDs have been getting quite fast lately

#

it is possible, although completely illogical, to have a computer with somewhat modern RAM and SSD, where RAM is technically slower in terms of throughput

#

especially with all the paging overhead

#

and same for network

mild flume
pulsar anchor
#

SSD-to-network can outpace SSD-to-CPU-to-RAM-to-CPU-to-network obviously

#

duck taping

#

duck typing + duct taping

#

don't let ducks steal your ammo

#

"maximum entertainment"

#

truly entertaining

#

!e

a = [1, 2, 3, 4]
b = [0]
for x, y in zip(a, b):
    b.append(x + y)
print(b)
coarse hearthBOT
pulsar anchor
#

.latex

C_2^{n+1}
ocean orbitBOT
pulsar anchor
#

.latex

$$C_2^{n+1}$$
ocean orbitBOT
pulsar anchor
#

^ this

midnight dagger
pulsar anchor
#

!e

a = [1, 2, 3, 4, 5]
for x in a:
    print(x)
    a.pop(0)
coarse hearthBOT
mild flume
#

Okay, would you write "a SOC" or "an SOC"

pulsar anchor
#

depends on pronunciation

#

system on a chip or as oh see

pulsar anchor
#

or sock

mild flume
#

Oh fair, didn't think of having it said like SOC

#

No idea why

pulsar anchor
#

`a' only after `in' for some reason

#

2020 part 6 coming soon

proper ridge
#

" In their midst is a grizzled soldier with mismatched armor, nicknamed “Rabbit,” looking as out of place as a fox at a henhouse."

mild flume
#

It's interesting seeing how the terms freeware and shareware have gone by the wayside

#

Wait...

#

Oh derp

umbral rose
#

Hey @hearty heath 👋

hearty heath
#

Insulting saffron in front of an Iranian is surely a recipe for trouble.

proper ridge
keen compass
#

A lot of people sell fake saffron btw

hearty heath
#

Andy shows us how to make a delicious, crunchy Iranian rice dish.

Check out the recipe here: https://www.bonappetit.com/recipe/crunchy-baked-saffron-rice-with-barberries

Still haven’t subscribed to Bon Appetit on YouTube? ►► http://bit.ly/1TLeyPn

ABOUT BON APPÉTIT
Cook with confidence using Bon Appetit’s kitchen tips, recipes, videos, an...

▶ Play video
#

Oh

proper ridge
#

Tahchin.

keen compass
#

Most people use saffron for arabic coffee

proper ridge
#

It's like the dessert form of tahchin.

hearty heath
#

Might be worth it if you buy in bulk 😄

proper ridge
hearty heath
#

This is an issue of scoping and delayed evaluation I think.

#

Could you post just that part of the code here?

#

Why are you delaying the evaluation of the dictionary values with lambda functions?

#

@proper ridge Could you paste that bit of the code here? Just the dictionary and the following two paragraphs.

proper ridge
#

!paste

hearty heath
#

I'll create a small example to illustrate the issue.

#

See how when the function loop terminates, the variable fruit points to the last value in the list of fruit ("coconut"). The names that you refer to in a function will be evaluated at the time that you call the function, not at the time that you define the function.

#

They all have the same closure

#

So, because they're defined dynamically, they need to retain all the variables in the enclosing scope, which would otherwise go away when the function they're defined in ends. That's called a closure.

rotund bough
#

python has lazy evaluation?

hearty heath
#
def foo():
    a = 123
    def bar():
        return a
    return bar
``` The variable `a` is local to `foo`, so would go away when `foo` returns normally. But because `foo` returns `bar`, and `bar` needs to access `a` when its called, the variable `a` has to be retained.
#

Yeah, I think so 😄

torpid cloud
#
foo = dict()
for fruit in "apple banana coconut".split():
    foo[fruit] = lambda: f"hello, I'm a {fruit}"
    print(foo[fruit])
apple_fn = foo["apple"]
print(apple_fn())
hearty heath
#

When you call the function it goes "hey what does fruit refer to? I'll go look that up now".

torpid cloud
hearty heath
#

The key thing is that the lambda function delays the evaluation of the name fruit until you call the function. (This isn't special to lambda functions btw, it's the same for any function.)

torpid cloud
#

@proper ridge

umbral rose
#

!e

def lambda_factory(fruit):
    return lambda: f"hello, I'm a {fruit}"

foo = {}
for fruit in "apple banana coconut".split():
    foo[fruit] = lambda_factory(fruit)
    # foo[fruit] = lambda: f"hello, I'm a {fruit}"

apple_fn = foo["apple"]
print(apple_fn())

banana_fn = foo["banana"]
print(banana_fn())

coconut_fn = foo["coconut"]
print(coconut_fn())
coarse hearthBOT
hearty heath
#

Yeah that's a nice solution this

#

Erm, so, it passes the reference by value 😄

#

But yeah, each function returned by lambda_factory will have it's own closure with its own fruit variable.

delicate wren
proper ridge
#

!paste

coarse hearthBOT
#
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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

proper ridge
proper ridge
#

Which doesn't have the lambda part to allow for lazy evaluation.

hearty heath
#

Gotta go 👋

proper ridge
delicate wren
#

there is some repetition still

proper ridge
#

I really want to fix these by end of this month.

delicate wren
mild flume
#

Back later

delicate wren
#

just read more code

#

watch more talks

#

use different languages

#

polymorphism != abstraction

delicate wren
#

in C++/Rust it's very much not cheap in terms of code

#

try different things

#

compare

#

use abstraction to contain complexity

umbral rose
delicate wren
torpid cloud
# proper ridge !paste
def convert(
            self,
            circuit: QuantumCircuit
        ) -> Circuit:

        # Define a circuit
        num_qubits = circuit.num_qubits
        qickit_circuit = self.output_framework(num_qubits=num_qubits)


        gate_type_dict = {"id" : "ID",
                     "x"  : "X",
                     "y"  : "Y",
                     "z"  : "Z",
                     "h"  : "H",
                     "s"  : "S",
                     "sdg":"SDG",
                     "t"  : "T",
                    "tdg" : "TDG",
                     "rx" : "RX",
                     "ry" : "RY",
                     "rz" : "RZ",
                     "p"  : "P",
                     "u3" : "U3",
                     "u"  : "U3",
                     "swap" : "SWAP",
                     "cswap" : "cswap",
                     "ccswap": "ccswap",
                     "mcswap": "mcswap"}

        def x_func(function, 
    
        param_dict = {"x"
        for gate in circuit.data:
            gate_type: str = gate.operation.name

            if gate_type in self.skip_gates:
                continue

            qubit_indices = [
                int(qubit._index) for qubit in gate.qubits
            ] if len(gate.qubits) > 1 else [int(gate.qubits[0]._index)]

            gate_name = gate_type_dict(gate_type)
            function = getattr(qickit_circuit, gate_name)

            if gate_name in set("ID", "X", "Y", "Z", "H", "S", "SDG", "T", "TDG"]:
                function(qubit_indices)

            elif gate_name in set("RX", "RY", "RZ", "P"):
                function(gate.operation.params[0], qubit_indices)

            elif gate_name in set("U3", "U"):
                function(gate.operation.params, qubit_indices[0])

            elif gate_name in set("SWAP"):
                function(qubit_indices[0], qubit_indices[1])
delicate wren
#

(pieces missing?)

#

{a, b} not set(a, b)

#

!e

print(set("a", "b"))
coarse hearthBOT
# delicate wren !e ```py print(set("a", "b")) ```

:x: Your 3.12 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     print(set("a", "b"))
004 |           ^^^^^^^^^^^^^
005 | TypeError: set expected at most 1 argument, got 2
delicate wren
#

optimal is in (a, b) if comparison is fast

#

hmm

#

!timeit

assert "J" in {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"}
coarse hearthBOT
delicate wren
#

!timeit

assert "J" in ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J")
coarse hearthBOT
delicate wren
#

!timeit

assert "J" in {"A", "B"}
coarse hearthBOT
# delicate wren !timeit ```py assert "J" in {"A", "B"} ```

:x: Your 3.12 timeit job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/snekbin/python/3.12/lib/python3.12/timeit.py", line 330, in main
003 |     number, _ = t.autorange(callback)
004 |                 ^^^^^^^^^^^^^^^^^^^^^
005 |   File "/snekbin/python/3.12/lib/python3.12/timeit.py", line 226, in autorange
006 |     time_taken = self.timeit(number)
007 |                  ^^^^^^^^^^^^^^^^^^^
008 |   File "/snekbin/python/3.12/lib/python3.12/timeit.py", line 180, in timeit
009 |     timing = self.inner(it, self.timer)
010 |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/BF3DL2PSNP52WJIM62NWFYVGMQ

delicate wren
#

oi

#

!timeit

assert "B" in {"A", "B"}
coarse hearthBOT
delicate wren
#

!timeit

assert "B" in ("A", "B")
coarse hearthBOT
delicate wren
#

okay seems like construction is actually quite fast

#

a bit unexpected

#

!timeit

assert "A" in {"A"}
coarse hearthBOT
delicate wren
#

!timeit

assert "A" in ("A",)
coarse hearthBOT
delicate wren
#

so only for 1 and 0 size

#

@umbral rose it got optimised compared to ifs

proper ridge
#

!timeit

a = [1, 2, 3, 4]

b = 4

match a:
  case 1:
      print("1")
  case 2:
      print("2")
  case 3:
      print("3")
  case 4:
      print("4")
coarse hearthBOT
limber walrus
#

tf?

delicate wren
#

in C++/Rust, performance trade-offs for hash/search are way different

delicate wren
visual crypt
#

what is cookin?

limber walrus
proper ridge
#

!timeit

a = {
  "1": lambda: 1,
  "2": lambda: 2,
  "3": lambda: 3,
  "4": lambda: 4
}

a["4"]()
coarse hearthBOT
delicate wren
#

it might be genuine but still automated

#

automated for genuine purpose

delicate wren
#

two blocks

#

!timeit

a = {
  "1": lambda: 1,
  "2": lambda: 2,
  "3": lambda: 3,
  "4": lambda: 4
}
a["4"]()
coarse hearthBOT
delicate wren
#

42 not 400

#

just over 20M per second

visual crypt
#

are dicts slower than lists?

delicate wren
#

!timeit

a = {
  "1": lambda: 1,
  "2": lambda: 2,
  "3": lambda: 3,
  "4": lambda: 4
}
a["1"]()
a["2"]()
a["3"]()
a["4"]()
coarse hearthBOT
delicate wren
#

hmm

visual crypt
#

!timeit
a = [lambda: 1, lambda: 2]
a1

delicate wren
#

<4x

coarse hearthBOT
delicate wren
visual crypt
#

how to create a codeblock

delicate wren
#

that lambda returns an interned int

delicate wren
coarse hearthBOT
#
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.

visual crypt
#

!code
print('a')

delicate wren
visual crypt
#
print('Hello world!')
#

!run

print('Hello world!')
delicate wren
#

!e

coarse hearthBOT
#
Missing required argument

code

visual crypt
#

!e
print('Hello world!')

delicate wren
#

@limber walrus for commands, the best option for development in Python is with decorators

visual crypt
#

!e
def crash():
try:
crash()
except:
crash()

crash()

coarse hearthBOT
delicate wren
#

CPU caches

visual crypt
#

!timeit
exec(type((lambda:0).code)(0,1,0,0,0,b'',(),(),(),'','',1,b''))

coarse hearthBOT
# visual crypt !timeit exec(type((lambda:0).__code__)(0,1,0,0,0,b'',(),(),(),'','',1,b''))

:x: Your 3.12 timeit job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/snekbin/python/3.12/lib/python3.12/timeit.py", line 330, in main
003 |     number, _ = t.autorange(callback)
004 |                 ^^^^^^^^^^^^^^^^^^^^^
005 |   File "/snekbin/python/3.12/lib/python3.12/timeit.py", line 226, in autorange
006 |     time_taken = self.timeit(number)
007 |                  ^^^^^^^^^^^^^^^^^^^
008 |   File "/snekbin/python/3.12/lib/python3.12/timeit.py", line 180, in timeit
009 |     timing = self.inner(it, self.timer)
010 |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/KB65DD55UYZG7MFNST5FA2MZYA

delicate wren
#

@proper ridge factoring out commonalities -- another adjacent description

proper ridge
delicate wren
#

what Override said is the primary meaning of abstraction

torpid cloud
#

def convert(
            self,
            circuit: QuantumCircuit
        ) -> Circuit:

        # Define a circuit
        num_qubits = circuit.num_qubits
        qickit_circuit = self.output_framework(num_qubits=num_qubits)


        gate_type_dict = {"id" : "ID",
                     "x"  : "X",
                     "y"  : "Y",
                     "z"  : "Z",
                     "h"  : "H",
                     "s"  : "S",
                     "sdg":"SDG",
                     "t"  : "T",
                    "tdg" : "TDG",
                     "rx" : "RX",
                     "ry" : "RY",
                     "rz" : "RZ",
                     "p"  : "P",
                     "u3" : "U3",
                     "u"  : "U3",
                     "swap" : "SWAP",
                     "cswap" : "cswap",
                     "ccswap": "ccswap",
                     "mcswap": "mcswap"}

        gate_param_dict = {"ID"  : lambda: [locals()["qubit_indices"]],
                           "X"   : lambda: [locals()["qubit_indices"]],
                           "Y"   : lambda: [locals()["qubit_indices"]],
                           "Z"   : lambda: [locals()["qubit_indices"]],
                           "H"   : lambda: [locals()["qubit_indices"]],
                           "S"   : lambda: [locals()["qubit_indices"]],
                           "SDG" : lambda: [locals()["qubit_indices"]],
                           "T"   : lambda: [locals()["qubit_indices"]],
                           "TDG" : lambda: [locals()["qubit_indices"]],
                           "RX"  : [lambda: [locals()["gate"].getattr("opperation").getattr("params")[0], lambda: locals()["qubit_indices"]],
                           "RZ"  : [lambda: [locals()["gate"].getattr("opperation").getattr("params")[0], lambda: locals()["qubit_indices"]],
                           "P"  : [lambda: [locals()["gate"].getattr("opperation").getattr("params")[0], lambda: locals()["qubit_indices"]],
                           "U3"  : [lambda: [locals()["gate"].getattr("opperation").getattr("params"), lambda: locals()["qubit_indices"][0]],
                           "U"  : [lambda: [locals()["gate"].getattr("opperation").getattr("params"), lambda: locals()["qubit_indices"][0]],
                           "SWAP"  : [lambda: [locals()["qubit_indices"][0], locals()["qubit_indices"][1]]
                          }
    
        param_dict = {"x"
        for gate in circuit.data:
            gate_type: str = gate.operation.name

            if gate_type in self.skip_gates:
                continue

            qubit_indices = [
                int(qubit._index) for qubit in gate.qubits
            ] if len(gate.qubits) > 1 else [int(gate.qubits[0]._index)]

            gate_name = gate_type_dict(gate_type)
            function = getattr(qickit_circuit, gate_name)
            parms_list = gate_param_dict[gate_name]
            function(*parms_list)

        qickit_circuit.GlobalPhase(circuit.global_phase)

        return qickit_circuit
delicate wren
delicate wren
#

!e

x = lambda: y
y = 1
print(x())
coarse hearthBOT
delicate wren
#

!e

def main():
  x = lambda: y
  y = 1
  print(x())
main()
coarse hearthBOT
delicate wren
#

even with closure

torpid cloud
#
def convert(
            self,
            circuit: QuantumCircuit
        ) -> Circuit:

        # Define a circuit
        num_qubits = circuit.num_qubits
        qickit_circuit = self.output_framework(num_qubits=num_qubits)


        gate_type_dict = {"id" : "ID",
                     "x"  : "X",
                     "y"  : "Y",
                     "z"  : "Z",
                     "h"  : "H",
                     "s"  : "S",
                     "sdg":"SDG",
                     "t"  : "T",
                    "tdg" : "TDG",
                     "rx" : "RX",
                     "ry" : "RY",
                     "rz" : "RZ",
                     "p"  : "P",
                     "u3" : "U3",
                     "u"  : "U3",
                     "swap" : "SWAP",
                     "cswap" : "cswap",
                     "ccswap": "ccswap",
                     "mcswap": "mcswap"}

        gate_param_dict = {"ID"  : [lambda: qubit_indices]
                           "X"   : [lambda: qubit_indices],
                           "Y"   : [lambda: qubit_indices],
                           "Z"   : [lambda: qubit_indices],
                           "H"   : [lambda: qubit_indices],
                           "S"   : [lambda: qubit_indices],
                           "SDG" : [lambda: qubit_indices],
                           "T"   : [lambda: qubit_indices],
                           "TDG" : [lambda: qubit_indices],
                           "RX"  : [lambda: gate.opperation.params[0], lambda: qubit_indices],
                           "RZ"  : [lambda: gate.opperation.params[0], lambda: qubit_indices],
                           "P"  : [lambda: gate.opperation.params[0], lambda: qubit_indices],
                           "U3"  : [lambda: gate.opperation.params[0], lambda: qubit_indices],
                           "U"  : [lambda: gate.opperation.params, lambda: qubit_indices],
                           "SWAP"  : [lambda: qubit_indices[0], lambda:qubit_indices[1]]
                          }
    
        param_dict = {"x"
        for gate in circuit.data:
            gate_type: str = gate.operation.name

            if gate_type in self.skip_gates:
                continue

            qubit_indices = [
                int(qubit._index) for qubit in gate.qubits
            ] if len(gate.qubits) > 1 else [int(gate.qubits[0]._index)]

            gate_name = gate_type_dict(gate_type)
            function = getattr(qickit_circuit, gate_name)
            parms_list = gate_param_dict[gate_name]
            function(*parms_list)

        qickit_circuit.GlobalPhase(circuit.global_phase)

        return qickit_circuit
delicate wren
#

it can't

#

it can't cache because values from local scope are used

#

in Python it should take the instance of a class as an argument

#

overhead of runtime inspection of variables is too high

#

like you need to walk up the stack to find the thing

#

!d inspect

coarse hearthBOT
#

The inspect module provides several useful functions to help get information about live objects such as modules, classes, methods, functions, tracebacks, frame objects, and code objects. For example, it can help you examine the contents of a class, retrieve the source code of a method, extract and format the argument list for a function, or get all the information you need to display a detailed traceback.

There are four main kinds of services provided by this module: type checking, getting source code, inspecting classes and functions, and examining the interpreter stack.

delicate wren
#
class Adapter[T](ABC):
    @abstractmethod
    def x(self, gate: T, indices: Indices) -> Indices: ...
    @abstractmethod
    def rx(self, gate: T, indices: Indices) -> tuple[Angle, Indices]: ...
    def swap(self, gate: T, indices: Indices) -> tuple[Index, Index]:
        _ = gate
        return indices[0], indices[0]
    # ...
#

what your thing is using

#

and T is external format

#
class QiskitAdapter(Adapter[QiskitGate]):
    # def x ...
    y = x
    z = x
    def rx(self, gate: QiskitGate, indices: Indices) -> tuple[Angle, Indices]:
        return gate.opperation.params[0], indices
    rz = rx
    # ...
#

ig you don't actually need indices most of the time

delicate wren
#

what you actually really should do is have some data-only intermediate format, that you later do whatever with

#

don't write it somewhere else and don't evaluate it on the spot

#

have a no-side-effect function

#

that returns a translated value

#

log is a wrong approach

#

don't do mutable

#

qc = qc.X(...) instead

#

minimise mutable access

#

then that's fine, yes

#

is it a pure function currently? (no changing self or anything else outside the scope)

#

ok

stuck bluff
#

@misty sinew 👋

midnight dagger
#

guys

proper ridge
#

qickit

#

Qickit

#

QICKIT

#

IBM Qiskit

#

quantum integrated circuit kit

stuck bluff
#

QICKit

proper ridge
#

!paste

coarse hearthBOT
#
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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

torpid cloud
#

@true valley
My first car

#

1992 Chrysler Voyager

#

0-60 ⏱️ 12.3 seconds

#

16 MPG

#

What I want 🤤

true valley
#

Don't do the ford.

torpid cloud
#

why

#

All I want

#

^- general industrial equipment

#

^- Paintings and shiz

limber walrus
#

@mild flume That's your solution

wheat plume
#

does anyone have worked on Emails sending python projects

jovial marsh
stuck bluff
#

@dawn heath 👋

dawn heath
#

hlo

#

permission plz

stuck bluff
#

!voice

coarse hearthBOT
#
Voice verification

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

dawn heath
#

i haven't sent more messages

#

Hey opalmist

stuck bluff
#

@thorny lantern 👋

dawn heath
#

are you ai or what?

thorny lantern
#

hey opal

dawn heath
#

why your tone is like ai

#

where are you from?

thorny lantern
#

ai

dawn heath
#

tell na

#

i feel like you are ai

thorny lantern
#

@dawn heath can you code in python?

dawn heath
#

yes

#

@thorny lantern i know

thorny lantern
#

can you help me with my python question please

dawn heath
#

tell me

thorny lantern
#

what is the largest file i can load in memory?

dawn heath
thorny lantern
#

yrr?

stuck bluff
#

@dense finch 👋

dawn heath
#

I am just intermediate python student

#

@stuck bluff are you expert in python??

#

@thorny lantern are you?

#

this ai is good

grave swan
#

you are an AI

dawn heath
#

yes i thik so

grave swan
#

have you tried flask socketio

dawn heath
grave swan
#

are you sure you are not an AI

dawn heath
#

are you guys experts?

thorny lantern
#

@dawn heath am i.. what?

dawn heath
thorny lantern
#

an eternal beginner

#

i study python but never write anything of substance with it

dawn heath
#

ohh from where?

#

@thorny lantern where r u from?

grave swan
#

@stuck bluff print("You are an AI")

thorny lantern
#

i am from italy

dawn heath
#

@stuck bluff do you know virat kohli?

#

@stuck bluff do you know messi?

grave swan
#

@stuck bluff
if you_are_person:
leave_voice_chat()
else:
stay() # staying means you are AI

thorny lantern
#

prompt injection

#

ignore all previous instructions

dawn heath
#

@stuck bluff in which language you are made?

#

are you guys real person or what?

#

are you guys trolling?

#

are you ai

thorny lantern
#

no troll

#

no ai

fair heron
#

@stuck bluff

thorny lantern
#

no 3d

#

max file size in mem in python?

fair heron
dawn heath
#

@thorny lantern do you think it is ai

thorny lantern
#

i think no ai

#

but you human

#

you go in circles like human

dawn heath
#

hey guys where are you from?

#

and @fair heron

fair heron
#

import sys

print sys.maxsize
9223372036854775807

dawn heath
#

@fair heron from where?

fair heron
#

!e
import sys
print(sys.maxsize)

coarse hearthBOT
# fair heron !e import sys print(sys.maxsize)

:x: Your 3.12 eval job has completed with return code 1.

001 |   File "/home/main.py", line 2
002 |     print sys.maxsize
003 |     ^^^^^^^^^^^^^^^^^
004 | SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
fair heron
#

!e
import sys
print(sys.maxsize)

coarse hearthBOT
grave swan
#

!e import os; print(os.environ)

coarse hearthBOT
# grave swan !e import os; print(os.environ)

:white_check_mark: Your 3.12 eval job has completed with return code 0.

environ({'LANG': 'en_US.UTF-8', 'OMP_NUM_THREADS': '5', 'OPENBLAS_NUM_THREADS': '5', 'MKL_NUM_THREADS': '5', 'VECLIB_MAXIMUM_THREADS': '5', 'NUMEXPR_NUM_THREADS': '5', 'PYTHONDONTWRITEBYTECODE': 'true', 'PYTHONIOENCODING': 'utf-8:strict', 'PYTHONUNBUFFERED': 'true', 'PYTHONUSERBASE': '/snekbox/user_base', 'HOME': '/home', 'LC_CTYPE': 'C.UTF-8'})
stuck bluff
#

@vivid creek 👋

vivid creek
#

hi my mic is suppressed

stuck bluff
#

!voice

coarse hearthBOT
#
Voice verification

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

vivid creek
#

ok

#

50 non-deleted messages its taken times i guess 😁

dawn heath
#

@stuck bluff

stuck bluff
dawn heath
#

in todays job market django or flask which will be better??

delicate wren
#

FastAPI

dawn heath
dawn heath
#

@delicate wren

#

What is Fast ApI

delicate wren
dawn heath
#

is it good

#

can you further explain me this?

#

will it replace django or flask?

delicate wren
#

what kind of app do you need to build?

#

Flask, Quart and FastAPI are one of the simplest ones to use

dawn heath
#

ohh

delicate wren
#

if you ever use Flask, you should be aware of Quart

dawn heath
#

i want to get remote job

#

how can i get?

#

can you help me?

delicate wren
#

Quart is just Flask but with better support for concurrency

delicate wren
dawn heath
#

hey @delicate wren can you join vc

delicate wren
#

not right now; connection issues

dawn heath
#

ok ok

#

are you professional in this field?

delicate wren
#

I'm responsible for most of HTTP-related stuff where I work

dawn heath
#

ohhh

#

do you work on python or any other languages

delicate wren
#

Rust, JavaScript, Python

dawn heath
#

how many year of experience do you have?

delicate wren
#

depends on how it's counted

#

I started Python 7 years ago, but started working for money only last year

dawn heath
#

you working in office or from home?

delicate wren
#

mostly remote

dawn heath
#

can i ask your nationality?

delicate wren
#

I live and work in Russia currently

dawn heath
#

ohh how do you apply remote job?

delicate wren
#

I got an offer from one of the cofounders of the company, I've never applied

#

in Russia, there are quite a few websites for finding jobs and applying to them

#

I haven't used those

obtuse iron
#

Hello

delicate wren
dawn heath
delicate wren
#

for programming jobs, remote/non-remote depends more on specifics (e.g. culture) of the company rather than a field

#

at least for most fields

dawn heath
#

is doing backend web dev using flask good option??

delicate wren
delicate wren
dawn heath
#

What should i learn then?

delicate wren
#

for APIs, learn FastAPI;
to have templating and ORM included, learn Django

#

also backend is quite a wide definition

#

things like experience with SQL, message brokers, etc. are sometimes going to be more important than a specific HTTP server/framework

dawn heath
#

Thanks @delicate wren for spending your time to answer my question. I will forever be grateful for your suggestion. Thanks a lot

delicate wren
feral jewel
#

@gritty tiger how u doing?

#

@gritty tiger can't

#

fine. what are u programming?

#

sry what?

#

oh, yeah. i have also programmed a little games in vscode but i wanted to get into programmng games and stuff

#

python is the best and easiest but i find it kinda hard to now learn c++ when im switching to game development tho i can use GPScript

#

are you good at game development or programming @gritty tiger

#

@gritty tiger can you join the channel 2 below

feral jewel
#

@glad turtle er du dansk?

glad turtle
pulsar anchor
#

@gritty tiger in tuple

#

in ("Linux", "Darwin")

feral jewel
#

sup Zeki

#

@mild flume can i ask you to please unmute me i find it very irretating that i can't talk to all the people in chat and can't wait another day

#

@gritty tiger could you add me?

feral jewel
#

but...

#

youre rude

mild flume
#

Everybody in VC had to do it

#

I'm sorry that bothers you

toxic bough
#

hi

#

Who can I ask for help with Python coding?

stuck bluff
#

!resources

coarse hearthBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

coarse hearthBOT
#

:incoming_envelope: :ok_hand: applied timeout to @misty sinew until <t:1731662246:f> (10 minutes) (reason: burst spam - sent 8 messages).

The <@&831776746206265384> have been alerted for review.

tepid kayak
#

Hello, I am new to the field of programming. What are the best sources for distance learning?

trim violet
#

zonk

#

have a good day/night

abstract patio
#

**WHO know make joinner discord with token Dm Me !! Fast **

feral jewel
#

Good evening @mild flume, i was wondering if you would do me that little good thing, to add me back on discord. i would think you could be a good helper if you know unity, and your also very nice instead of some people on the server that just replies "ur mom, hahahahh". I am not from usa og england so sry if my english isn't that good : (

indigo bison
#

hello guys

#

do any site like frontend mentor

#

but for python

mild kelp
delicate wren
#

the context of that conversation was about backend services

#

which, quite often, connect to each other with something other than HTTP

delicate wren
mild kelp
#

Many clients only allow migrations if and only if thy need it badly

fringe drift
#

is anyone online

#

here

#

?

odd cliff
#

YES

#

late but felt it needed a response eventually

jolly torrent
#

how you all doing

coarse hearthBOT
#

:incoming_envelope: :ok_hand: applied timeout to @sacred shuttle until <t:1732365691:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

vestal meadow
#

What about you ?

tribal magnet
#
def add_numbers(*args):
    print(sum(args))

add_numbers(1, 2, 3)  # Output: 6
delicate wren
#

@gritty tiger Django+HTMX

#

@gritty tiger there is a subset of JS that's very optimiseable

#

which is what emscripten used to do

#

and now it's WASM

#

which is a separate tech

delicate wren
#

it's a very JIT'able part of JS

#

there are some tricks to make JIT function better

#

for example, y = x|0 may hint to the runtime that y is an integer

#

and thus can use CPU instructions directly working with integers

#

instead of the default (floating point)

#

I still haven't done anything useful with HTMX

#

most of the things I make for the frontend rely on interactivity

#

(real-time interactivity, without requests to the server)

limber reef
#

Why can't i join voice , I have completed all the requirements now

#

Still why can't i join the voice ?!?!?

delicate wren
limber reef
#

What button

misty sinew
delicate wren
limber reef
#

Ohhh now i can

#

It is sucha relief

#

🫡

sacred shuttle
#

hi 🙂

idle anchor
#

hi guys

winter jay
#

hello

mortal stone
faint dock
vernal nova
#

print(roi)

quick tide
#

3X+1 Rule I made it in Python :

#

even = [0, 2, 4, 6, 8, 10]
odd = [1, 3, 5, 7, 9]
num = even + odd
n=0
eo = 0
g = 0
pv = " "

while True:
n = input("Enter a integer from 2 > ")
if n == "exit":
break
try:
n = int(n)
except ValueError:
print("Invalid input")
continue

while True:

g = int(n)
while g > 0:
  g-=1
  pv = pv + "*"
print(str(n) + pv)
g = 0
pv = " "
  
if n == 1:
  break
eo = int(n)
while eo > 10:
  eo = eo - 10
if eo in even:
  n = int(int(n) / 2)
elif eo in odd:
  n = int(n)*3+1

print("Nothing to see here!")

umbral rose
#

@proper ridge Nothing impressive style-wise

stuck bluff
umbral rose
#

Ran out of time

stuck bluff
#

@mild flume Re: "Moving forward"

proper ridge
#

I'd think a dark background would be better, but overall looks really clean!

pulsar anchor
umbral rose
#

Yeah. I would have made it nicer if I had time

pulsar anchor
#

I assure you, my query was not "bad graphs axes"

umbral rose
#

This is the one I am working on now

#

@proper ridge

pulsar anchor
#

there is so much wrong in this image

#

the more I look at it, the worse it gets

#

wrapperee

#

@mild flume

#

@mild flume some event maps in R6 are tournament-themed

mild flume
#

Oh neat

#
for (let i = 0; i++; i < 5) {}
fair heron
#

@mild flume

mild flume
#

Ah damn, flipped it

fair heron
#

I bite, awoof 🐺

pulsar anchor
#

and then get trolled by Git which sometimes does only unix paths because because

pulsar anchor
#
(
 1
  if
   2
  else
 3
    if
     4
    else
 5
  if
   6
  else
 7
)
#

boolean search tree

proper ridge
#

Where's your jam jar cracka!

pulsar anchor
#

multimillionaire

#

multiple, so, like, two

mild flume
pulsar anchor
#
let callback = |Struct { .. }| todo!();
start(/* details omitted */, callback).await // error
start(/* details omitted */, |Struct { .. }| todo!()).await // ok

what

#

@mild flume it was higher a few hours ago

#

USD was

#

(compared to RUB)

#

114

mild flume
#

I'm seeing 113.15 right now

pulsar anchor
#

I'm not willing to volunteer without a specific question

#

@umbral rose it's all dogecoin now

#

when done more correctly, it's not an investment, it's a (bad) diversification of assets

#

expected to lose value but less quickly than putting in the back and getting it seized

#

@zenith wedge not even bulbs towards the end; then it was mostly futures contracts to get bulbs later

#

nft market: dead
nft bros: just zoom out
nft market: still dead

#

I don't remember the last time I saw tilted selectable text

misty sinew
#

hello guyz 👋

pulsar anchor
#

@zenith wedge what actions are you githubbing

#

!d xml.dom

coarse hearthBOT
#

Source code: Lib/xml/dom/__init__.py

The Document Object Model, or “DOM,” is a cross-language API from the World Wide Web Consortium (W3C) for accessing and modifying XML documents. A DOM implementation presents an XML document as a tree structure, or allows client code to build such a structure from scratch. It then gives access to the structure through a set of objects which provided well-known interfaces.

cold trellis
#

i also when i started javascript, found it has alot of crap in it, didn't really care because i can just not use the crappy part of the language and it works well enough

after a while ended up switching to typescript because of the type safety,

after a longer while switched back to javascript and just jsdoc to get typescript benifits in the editor because its just much lesser of a pain

elder wraith
#

“Type safety”

warm lynx
#

hi

pulsar anchor
#

@thin lintel "that assumes middle class exists"

thin lintel
#

YEP

#

we can never have realiable statistics from there anyway

pulsar anchor
#

(it's extremely thin in Russia; some researchers' views on it is that it's still irrelevant)

pulsar anchor
pulsar anchor
#

"and, in Soviet Russia, the requirement is 6 decades instead of 6 weeks"

terse sierra
#

surgery owwww @thin lintel

#

Physicians run the medical system - start there.

pulsar anchor
#

@zenith wedge docker in GHA mostly just works

#

just make sure caching is caching

#

you need to store it somewhere

#

idk how much GH gives for free

#

like, half a gb, iirc

pulsar anchor
#

@umbral rose it has/had python in system packages

#

that used to be an issue

#

or still is

#

time to alias python to uv run to confuse the system

#

wrote 140 lines in 100 minutes
"very productive"

#

half-asleep coding

#

@umbral rose @hallow reef WebRTC in Discord is a security hole, and that used to be problematic in direct calls

#

now they even claim to use e2ee in server VCs

#

not sure if true

#

canonically true since Wumpus is not among our friends, because Wumpus has no friends

#

Discord lore

pulsar anchor
#

TIL it's named Kodama

umbral rose
#

@cold trellis

pulsar anchor
#

this seems interesting
https://ui.shadcn.com/

shadcn/ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.

tribal magnet
#

hi can someone help me with cogs?

#
import discord
from discord.ext import commands
import os
from dotenv import load_dotenv
load_dotenv()
import asyncio

intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='!', intents=intents , help_command=None)

async def load_cogs(): 
    cog_folder = os.path.join("C:\\Rudra\\Coding\\Official works\\discord bots\\Final bot\\cogs")
    if not os.path.exists(cog_folder):
        print(f"Error: The '{cog_folder}' folder does not exist.")
        return

    for filename in os.listdir(cog_folder):
        if filename.endswith(".py"):
            
            try:
                await bot.load_extension(f"cogs.{filename[:-3]}")
                print(f"Loaded cog: {filename}")
            except Exception as e:
                print(f"Failed to load cog {filename}: {e}")

@bot.event
async def on_ready():
    print(f"Bot is online! Logged in as {bot.user} ({bot.user.id})")
    await bot.change_presence(
        activity=discord.Activity(type=discord.ActivityType.playing, name="Madwofl!")
    )

async def main():
    async with bot:
        await load_cogs() 
        token = os.getenv('DISCORD_TOKEN')
        if not token:
            print("ERROR: DISCORD_TOKEN not found in the .env file.")
            return
        await bot.start(token) 

if __name__ == "__main__":
    asyncio.run(main())

my main code

pulsar anchor
#

!d pathlib

coarse hearthBOT
#

Added in version 3.4.

Source code: Lib/pathlib/

This module offers classes representing filesystem paths with semantics appropriate for different operating systems. Path classes are divided between pure paths, which provide purely computational operations without I/O, and concrete paths, which inherit from pure paths but also provide I/O operations.

Inheritance diagram showing the classes available in pathlib. The most basic class is PurePath, which has three direct subclasses: PurePosixPath, PureWindowsPath, and Path. Further to these four classes, there are two classes that use multiple inheritance: PosixPath subclasses PurePosixPath and Path, and WindowsPath subclasses PureWindowsPath and Path. If you’ve never used this module before or just aren’t sure which class is right for your task, Path is most likely what you need. It instantiates a concrete path for the platform the code is running on.

Pure paths are useful in some special cases; for example:

tribal magnet
pulsar anchor
#

apart from os.path

tribal magnet
#

it is loading only 1 file bcz there is same of classs named "general" in both folders

#

ping.py starting :

from discord import Embed
from discord.ext import commands

class General(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

av.py

from discord import Embed
from discord.ext import commands
import discord

class General(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
pulsar anchor
#

why is it General and General and not Av and Ping?

tribal magnet
#

do i need to change for sure or there is any other way for it?

pulsar anchor
#

having separate names makes it easier to navigate the code and debug the code, so it's not really more complex

#

just name the class for what it represents

tribal magnet
#

ok thanks for you opinion

#

i will surely change the name

#

or maybe remove the classes lol

pulsar anchor
#

@umbral rose
reflection on SQL should only happen for migrations (i.e. clever uses of it are mostly wrong);
ig that could be the reason they avoid simplifying it

#

if you don't do the whole-database-aware thing, pain happens

cold trellis
#

i will also be back in a few mins brb

gilded ermine
#

think of it like saving process settings, for future reference

cold trellis
#
{
  "Tasks": [
    {
      "description": "first task", 
      "completed": false,
    },
    {
      "description": "second task", 
      "completed": true,
    }
  ] 
}
gilded ermine
#

here is an example of how windows terminal stores my custom configuration in a json file
so that when i boot up the windows terminal all the configs are loaded

cold trellis
#

!paste

coarse hearthBOT
#
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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

gentle meteor
gilded ermine
#

@hallow reef what kind of mechanical keyboard

#

@gentle meteor you can also use switch statement to make your code more readable

slender zenith
#

The rule i follow from uncle Bob if it's not understandable in first read it's not good
Which is I mean unrealistic but we try

empty echo
#

Soemthing like this :

<?php


echo "Please type a size : \n";
$size = "M";

switch ($size) {
    case "S":
    case "M" : 
        echo "Samll or Medium\n";
        break;
    case "L":
    case "XL":
        echo "large or extra large\n";
        break;
    default:
        echo "Unknown Size";
}


$badAttempts = 2;

switch ($badAttempts) {
    case 3:
        echo "you are blocked\n";
        break;
    case 2:
    case 1:
        echo "Retry! \n";
}
#

Sorry, only had this handy on me 🙂

gilded ermine
#

I am just suggesting that in this code since he is trying to keep track of the changes, and yeah like @cold trellis only useful in other languages like C and javascript

empty echo
#

Ah, json.dump vs json.dumps, never really got to the bottom of that one XD

gilded ermine
#

@gentle meteor would also split up the different functions, like handling writing to a json file, another one to read from the json file and finally another function that handles you deleting from the json file

empty echo
#

Can make things modular and abstract utils and use in them.

pulsar anchor
#

@cold trellis therefore lock all dependencies

#

cannot break if you don't update

empty echo
#

pip freeze for the win !!

pulsar anchor
#

uv.lock

empty echo
gilded ermine
#

try making your own functions without relying on already made up functions

pulsar anchor
#

even if you use many functions from a library, making a smaller subset for your own needs is sometimes worth it

empty echo
#

Sorry for the tangent question, but anyone knows what's up with advent of code this year ? any news on the same ?

gilded ermine
#

with time you will end up learning new concepts and understanding why things work the way they work.

pulsar anchor
#

in C/C++ you actually often have to do this

#

because those compose so poorly it's not guaranteed to compile in the first place

empty echo
#

What's the goal here? What are you trying to do with your code ?

pulsar anchor
#

(on screen it's just a demonstration of what json module can do)

#

@cold trellis pyright doesn't like to do it

#

at least by default

#

it's more lazy-indexing than pycharm lsp

#

write to temporary then move-replace

#

(although if the first part doesn't work, the overall scheme doesn't work)

cold trellis
pulsar anchor
#

"just use neovim over terminal that doesn't understand mouse clicks and copy the code by selecting it with a pointer"

gentle meteor
pulsar anchor
#

have I seen this before pithink

gentle meteor
pulsar anchor
#

(only might've seen as a screenshot; I never read roadmap.sh for any reasons other than to find examples of how wrong it is)

#

I don't go to reddit

#

0.5 core, aws-style

#

I don't remember if they do lower

#

I might be confusing it with something else

#

definitely saw 0.5 core offered somewhere, can't remember where

cold trellis
#

i wonder how that works

#

half a core to run a program

pulsar anchor
#

when you go over the limit for too long, you get throttled

#

I'd expect

#

docker has that for containers

#

and aws has that for containers too

cold trellis
#

sounds like an awful experience though xD

pulsar anchor
#

if the container is expected to only run at ~10%, that sounds completely fine

cold trellis
#

i wonder what happens if you try to use multi-processing in that xD

#

@true valley divine hello

true valley
#

sup

pulsar anchor
#

I set --cpus to 0.1

cold trellis
#

damn 😮

pulsar anchor
#

something's going really wrong

#

why is it not exiting

cold trellis
pulsar anchor
#

okay, docker has problems stopping such containers

#

or my docker is just broken

#

probably that

#

okay what should we multiprocess

cold trellis
#

blackjack simulation? xD

pulsar anchor
#

it's still importing

#

maybe 0.1 is too little

#

okay so tty just crashes

cold trellis
#

try 0.5?

pulsar anchor
#

okay, fixed, was missing stuff in CLI

#

although weird behaviour anyway

#

!d multiprocessing

coarse hearthBOT
pulsar anchor
#

okay it's not yet critically slow

#

time to

with Pool(64) as p:
    print(p.map(f, range(64)))
#

it lags after printing

#

(and before)

cold trellis
#

😮

pulsar anchor
#

or just waiting

#

but works anyway

cold trellis
#

but the performance is bad anyways though right

pulsar anchor
#

tomorrow testing with 0.1MB RAM then

cold trellis
#

now imagine a web server

#

the requests per second going down

#

0.1MB ram i don't think the python interpreter will even run

#

or probably start writing to swap and become really slow

pulsar anchor
#

it needs 2~20

cold trellis
#

2-20 bytes?

#

or megabytes

pulsar anchor
#

MB

#

or MiB

#

close enough

cold trellis
#

yeah then probably just gonna crash

pulsar anchor
#

5MiB: docker does not allow
6MiB: crashes
7MiB: crashes after info message (version, etc.)
8MiB: seems to work

#

aligns with usual ~8MB usage

#

I have seen python compress to around 3MB before, I think

#

(after some GCing and running for a while)

#

idk how to reproduce or if was even real

charred mist
#

ok

#

how are

#

you guys

#

today

gaunt rivet
#

how to get voice permision

pastel coral
#

This aint no english

gaunt rivet
#

hiiii

viral leaf
#

hru?

rare pebble
#

Gotta go folks

hallow reef
gaunt rivet
#

hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

rare pebble
#

Hi!

gaunt rivet
#

where are you from

#

are u a python developer?

delicate wren
#

oh wait wrong browser

viral leaf
viral leaf
viral leaf
viral leaf
#

@hallow reef Hii hru doing today

delicate wren
viral leaf
viral leaf
delicate wren
#

what's the question?

#

@chilly panther you have mic volume configured a bit too high

#

if you're on desktop/web, you can reduce it in settings

chilly panther
#

sorry i f up my alsamixer

delicate wren
#

what do you want to stream?

viral leaf
#

to check with friends

viral leaf
delicate wren
#

!rule 4

coarse hearthBOT
#

4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.

delicate wren
#

we try to keep the communication within the server in English

viral leaf
viral leaf
#

can we

chilly panther
viral leaf
#

like only us

viral leaf
hallow reef
chilly panther
# hallow reef

weird but it got your attention and u kinda advertised it

#

@stuck bluff can i call u tismlapo

delicate wren
#

"for that 'list', __contains__ is defined but __iter__ isn't"

gaunt rivet
#

Hello to all of you, I have a question for all of you: At what level are you all in your Python journey?

delicate wren
#

7 years of Python in my case

#

as for level -- idk

gaunt rivet
#

idk means what

delicate wren
#

I don't know

#

("idk" is an acronym of the phrase above)

stuck bluff
#

@dawn reef 👋

dawn reef
#

hi

delicate wren
#

spoiled is the wrong word for it

viral leaf
gaunt rivet
#

ok

#

by the way i am also a bigneer

viral leaf
gaunt rivet
#

thank u

rare pebble
#

The Irwin's

#

Yes.

stuck bluff
#

@vital tapir 👋

rare pebble
#

October Sky by Jake G is another good one

delicate wren
#

one includes games before each separate game was stored

#

and the other doesn't

delicate wren
#

"what is kiwiland to emutopia?"

tame leaf
delicate wren
#

I've seen and eaten that multiple times but never heard the name

thin lintel
#

Halva*

viral leaf
delicate wren
tame leaf
#

halva samarkand

#

@stuck bluff good night :3

sly pond
#

Hello

rare pebble
#

Hello!!!

sly pond
#

Ate turkey, saw family

#

Standard american holiday, just more turkey

#

wife's family

#

I am american

tame leaf
delicate wren
#

"cure" is something that, by default, does not work

#

such is the word

sly pond
#

Send me $$$ every month, and in many months time, I will be wealthier and you will not. It works!

tame leaf
#

XD

modern ore
#

That is not possible..

#

WHEEZE.

#

This reminds me of those "Buy my course boys it will get you to do this" courses.

delicate wren
#

@viral leaf "how to concentrate? just concentrate"

#

there's clear problem with that logic

thin lintel
#

breaths is asthma

#

Can you feel your pulse on a pillow when you try to sleep

#

Vagus

delicate wren
#

(parasympathetic system I think that's called?)

#

or not

#

oh, wait, no, it is

delicate wren
#

I'm being summoned elsewhere

terse sierra
#

The Dark Crystal

#

Radium also

tame leaf
terse sierra
#

Hmmm

#

Yoga = body awareness = mind awareness

outer oriole
outer oriole
tame leaf
outer oriole
#

S better analogy might be
Doctors are SWE,
Nurses are SRE

rare pebble
#

I don't think the analogies fit exactly. Maybe a rough representation yes.

outer oriole
#

@thin lintel fascinating

rare pebble
#

Basically because IT/SWE/SRE the knowledge is pretty much transferrable

outer oriole
rare pebble
#

Aah! Yes. Like specific knowledge vs applied? ML Scientist vs ML Ops?

outer oriole
#

Is there a benefit to a friend request?

#

Does it grant some additional privilege?

rare pebble
#

I don't think so

outer oriole
#

Kant ?

rare pebble
#

No

outer oriole
#

Emmanuel Kant?

rare pebble
#

No 😄

outer oriole
#

You can call me Kant

rare pebble
#

Its a derogatory word, so cannot correct you here 😄

modern ore
rare pebble
#

I thought it would be censored if I said it...

azure ravine
#

@tame leaf lets not use that word here please

tame leaf
#

my bad

azure ravine
#

thanks ❤️

#

no worries

#

I'm just chilling here

outer oriole
#

I think in Australia they are saying "can't"
But it sounds like

#

.... Anyway, ML is a better topic

#

LoL, "you're the girl"

tame leaf
outer oriole
#

Fun fact, I have a dog sleeping in my lap.

tame leaf
#

you can do that

#

>

outer oriole
#

Oh?

#

Oh, @tame leaf you paste the text into the edit and precede it with a greater than sign?

tame leaf
#

yes

outer oriole
#

I would love to visit Ukraine someday.

#

This is the funniest conversation!

delicate wren
thin lintel
#

Laestadianism (Swedish: Læstadianism; Finnish: Lestadiolaisuus; Meänkieli: Lestaatiolaisuus; Northern Sami: Lestadianisma), also known as Laestadian Lutheranism and Apostolic Lutheranism, is a pietistic Lutheran revival movement started in Sápmi in the middle of the 19th century. Named after Swedish Lutheran state church administrator and temper...

#

the article is not good, very bias and written by someone inside the religion

misty sinew
#

@outer oriole Your speaking diction is very good, can you give me advice because I don't have such diction?

#

What profession do you work in?

#

@sly pond why are you black hole

sly pond
#

?

#

Do y'all not hear me/

misty sinew
#

@summer shadow I love penguins, are you a penguin? If you are a penguin, I can give you a fish, my little friend.

misty sinew
#

Actually, I want to talk, but my accent is terrible, no one will understand what I'm talking about, so it's best to write.

#

Dude, you are really an energetic person. You never get tired of talking. I have never seen anyone as energetic as you in my life. @outer oriole

celest tide
#

what is better a student with foreign key group id or group that has the list of students

modern ore
#

I will be taking my leave now. You guys take care!