#voice-chat-text-0

1 messages Β· Page 208 of 1

astral coral
somber heath
#

@vapid pier πŸ‘‹

gentle flint
somber heath
#

@whole bear πŸ‘‹

astral coral
#
        """rotate self counterclockwise by angle
        """
        perp = Vec2D(-self[1], self[0])
        angle = math.radians(angle)
        c, s = math.cos(angle), math.sin(angle)
        return Vec2D(self[0]*c+perp[0]*s, self[1]*c+perp[1]*s)```
#

result = round(math.degrees(math.atan2(y, x)), 10) % 360.0

somber heath
#

@molten jettyπŸ‘‹

molten jetty
#

how to get voice verified?

astral coral
#

OPAL

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.

astral coral
#

Imma need help again 🍼

molten jetty
somber heath
#

@naive tendon πŸ‘‹

naive tendon
#

hello

gentle flint
wind raptor
#

Hey @somber heath πŸ‘‹

somber heath
#

@empty breach πŸ‘‹

empty breach
#

Hey guys

somber heath
#

@sharp egret πŸ‘‹

sharp egret
#

hi

somber heath
#

winged vs weaned

whole bear
#

ruined

somber heath
#

@whole bear

hot bay
#

Hi

somber heath
#

@gleaming geyser πŸ‘‹

whole bear
#

Veluwemeer

keen ingot
gentle flint
#

arrived at the train station

whole bear
knotty moss
#

a problem with french community @keen ingot ?

#

and .net community ?

keen ingot
#

nah mate

knotty moss
#

you want to fight brainmon ?

keen ingot
#

look at my status i am using .net rn hahhaha

knotty moss
#

where is write ?

#

I validate this shipit

keen ingot
knotty moss
#

.Net community > all community logo_ironpython

#

why i can't speech ?!

keen ingot
#

we are in the wrong territory

#

unmute urself

knotty moss
#

i can't do thaht : /

nocturne sail
#

hhi

knotty moss
#

i just want to die -_-

knotty moss
#

because i can't talk : /

#

let me speak shipit !!!!

#

salam πŸ‘‹

short owl
#

alien potato ?

amber raptor
amber raptor
wind raptor
#

I'll be back. Gonna head to the staff meeting. Cheers

frozen owl
lunar venture
#

what aae you reading @mild quartz

mild quartz
verbal wind
#

uwu wat dis

#

AI paper?

mild quartz
#

ye

#

see above

wise loom
#

I'm boiling some tortellini spinach. Is it okay to eat these before bed?
I can add a bit of curd cheese

mild quartz
wise loom
#

@shadow pivot asking how he can get voice verified

mild quartz
#

python script.py > result.txt

shadow pivot
#

oh i got to do some text

cloud stratus
#

Thank you for the book and reality check :) @mild quartz

vocal basin
#

I prefer context managers

#

!e

def test():
    try:
        return
    finally:
        print("test")
test()
wise cargoBOT
#

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

test
vocal basin
#

!e

def test():
    try:
        1 / 0
    except Exception as e:
        raise RuntimeError("fail") from e
    finally:
        print("test")
test()
wise cargoBOT
#

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

001 | test
002 | Traceback (most recent call last):
003 |   File "/home/main.py", line 3, in test
004 |     1 / 0
005 |     ~~^~~
006 | ZeroDivisionError: division by zero
007 | 
008 | The above exception was the direct cause of the following exception:
009 | 
010 | Traceback (most recent call last):
011 |   File "/home/main.py", line 8, in <module>
... (truncated - too many lines)

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

vocal basin
wise cargoBOT
#

@contextlib.contextmanager```
This function is a [decorator](https://docs.python.org/3/glossary.html#term-decorator) that can be used to define a factory function for [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statement context managers, without needing to create a class or separate [`__enter__()`](https://docs.python.org/3/reference/datamodel.html#object.__enter__) and [`__exit__()`](https://docs.python.org/3/reference/datamodel.html#object.__exit__) methods.

While many objects natively support use in with statements, sometimes a resource needs to be managed that isn’t a context manager in its own right, and doesn’t implement a `close()` method for use with `contextlib.closing`

An abstract example would be the following to ensure correct resource management:
vocal basin
#

especially this thing

#

I probably don't use this specific one often enough

#

it's way easier compared to usual enter/exit

#

what it doesn't handle well, I guess, is multiple-enter/exit thing

#

a lot of what I do involves them

#

mostly async ones

wise cargoBOT
#
Missing required argument

code

vocal basin
#

!e

from contextlib import contextmanager

@contextmanager
def f():
    while True:
        yield

with f():
    pass
wise cargoBOT
#

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

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 8, in <module>
003 |     with f():
004 |   File "/lang/python/default/lib/python3.12/contextlib.py", line 148, in __exit__
005 |     raise RuntimeError("generator didn't stop")
006 | RuntimeError: generator didn't stop
vocal basin
#

this

#

full-file read/write is easier with pathlib.Path methods

#

I'd expect multiprocessing to have some convenience functions too

#

Python 4

#

following Mark Rendle's "prediction"

#

I've only played tetris effect recently

somber heath
#

@torn lotus πŸ‘‹

vocal basin
#

this took way too long

torn lotus
#

what's going on

vocal basin
#

there was a tournament recently but I was too lazy to participate

torn lotus
#

For what?

vocal basin
#

I also still don't like pvp tetris

#

I don't understand it

vocal basin
torn lotus
#

i've seen very competitive matches

vocal basin
#

there are two common "types"

torn lotus
#

the way the change direction into place is amazin

vocal basin
#

the only place where pvp aspect comes in with score attack is the timer

#

you can lose on purpose if your opponent is slow but would outrun your score eventually

#

this way you start the timer for them

vocal basin
somber heath
#

@whole bear πŸ‘‹

golden sonnet
#

hi opal

whole bear
golden sonnet
#

languages are a fun discossion

somber heath
#

@forest gorge πŸ‘‹

forest gorge
#

i have been in the server for more than 3 days i just left since a day ago

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.

forest gorge
#

I fill all the requirements, its just I accidentally left

#

is there any way to get around that?

#

Can i ask a mod?

#

I am not waiting for 12 hours

golden sonnet
#

anyone got a fun idea for adding to a website?

#

pretty much anything

#

just soemthing πŸ™‚

#

i do django

#

yeah it gets boring when you just keep doing the same stuff

#

bees?

vocal basin
#

are you collecting/processing data of European users?
if yes, add GDPR compliance page (including the export/deletion of data all their data you store)

golden sonnet
#

oh
like animation

#

hmm
i wish i had the ability to do anything graphical

#

i feel like it's more fun to do
backend is a bit dark

#

πŸ˜‚ that is accurate

vocal basin
#

with the only website I made, that other people frequently used, backend was the easier part

#

or, at least, smaller (3~5 times so)

golden sonnet
#

blogs are easy
form is a bit harder

#

am currently strugling on a form cause it has many to many fields

vocal basin
#

a single-page chat

golden sonnet
#

django has good support for forms tho
this is an edge case

vocal basin
#

at the time I used Flask because I didn't know any better

#

today I would definitely use FastAPI instead

golden sonnet
#

i hear good stuff about fast api

#

monitoring what? sorry

vocal basin
#

FastAPI and aiohttp(server) also both allow some cursed stuff because they're async

#

bee log

#

b log

#

trie

golden sonnet
#

mindful dev was working on a website to track bugs yesterday

vocal basin
#

@unborn storm linked list is a tree

#

ownership hierarchy is what matters

#

semilattice is not a tree

#

(some)

vocal basin
#

(ownership is not tree-like)

golden sonnet
#

πŸ‘‹

somber heath
#

@outer zinc πŸ‘‹

outer zinc
somber heath
vocal basin
#

check that whatever, that's to the left of [], is not None

#

!e

None[0]
wise cargoBOT
#

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

001 | /home/main.py:1: SyntaxWarning: 'NoneType' object is not subscriptable; perhaps you missed a comma?
002 |   None[0]
003 | Traceback (most recent call last):
004 |   File "/home/main.py", line 1, in <module>
005 |     None[0]
006 |     ~~~~^^^
007 | TypeError: 'NoneType' object is not subscriptable
vocal basin
#

if that data comes from an external API/dataset, it's quite normal to have fields missing/null

#

print(e)

#

(likely)

#

maybe even logging.error

somber heath
#

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

somber heath
#

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

dire storm
somber heath
#

@umbral spoke πŸ‘‹

warped raft
#

@oppa

#

@somber heath hello

somber heath
#

@limpid nova πŸ‘‹

warped raft
#

how are you doing

limpid nova
warped raft
#

aight

#

@somber heath what are you doing

lean pumice
#

@warped raft , do you know web development?

warped raft
#

not much
but i got a taste of javascript

lean pumice
#

i am trying to scrape a site

#

the table here. it has some hidden rows. i want to scrape those too.

#

you see the plus here

#

they only show up if i click plus

#

there are these onclick something here that shows it. idk what these are. are they js?

somber heath
#

The terms of service could conceivably be interpreted as prohibiting webscraping. "Copying of materials".

#

@remote cradle πŸ‘‹

lean pumice
#

yeah idc about that. doing it for personal project and not commercial. they cant catch it anyways

remote cradle
#

hii

lean pumice
#

uhh i am not asking anyone to do it for me lol. just want to know how its working. Maybe for my own knowledge :)

somber heath
#

I'm not going to engage in an argument about this.

#

Just mentioning it for your consideration.

limpid nova
somber heath
#

!e py import datetime now = datetime.datetime.now() dob = datetime.datetime(year = 1983, month = 1, day = 1) age = (now - dob).days // 365 print(age)

wise cargoBOT
#

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

40
somber heath
#

@limpid nova If you were after something a bit more dynamic.

#

(Don't rely on datetime to be precise.)

#

@crimson lark πŸ‘‹

crimson lark
#

whatup

limpid nova
#

is justs a custom variable so i didn't search it

#

*just

oblique ridge
#

mac and cheese so good they had to bring out the maths

oblique ridge
somber heath
#

@cobalt seal πŸ‘‹

cobalt seal
#

hey

#

do I have to accept something in order to talk in the channel?

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.

cobalt seal
#

πŸ˜€

#

hahahah

#

bummer

gentle flint
#

well there you are

#

address those requirements, then try again

cobalt seal
#

no problem -- until then can someone help with the question I've posted at python-help?

gentle flint
#

I'm sure people are already looking

#

I can't rn cuz I'm at work

cobalt seal
#

I'm new to python world -- I have some background in other languages but would like some feedback

#

thanks πŸ™‚

oblique ridge
cobalt seal
#

Oh-- that's nice

oblique ridge
#

ima take a look but no promises i know how to help

cobalt seal
#

sure -- I'm open to different approaches, the one I've posted may not be the best way to handle that

#

I've been trying to use my experience with other frameworks, languages, etc to achive the goal

oblique ridge
#

ah i don't quite understand how this is meant to work hold up

lucid shoal
#

@gritty garden also it's not a problem

lucid shoal
#

What lmao

#

I'm kinda doing something else

gritty garden
lucid shoal
#

@somber heath i think i fixed it

limpid nova
#

why this emoji looks like the sound ||/pipi/|| pypi

oblique ridge
#

idgi

limpid nova
#

yes

#

sounds like

oblique ridge
#
limpid nova
#
lucid shoal
#

This C++ program is actually 3x slower then a python one which does the exact same thing

#include <iostream>
#include <fstream>
#include <string>
#include <unordered_set>

int main(int argc, char* argv[]) {
    if (argc != 2) {
        std::cerr << "Usage: " << argv[0] << " <input_file>" << std::endl;
        return 1;
    }

    const std::string input_file_path = argv[1];

    std::unordered_set<std::string> unique_lines;
    std::ifstream input_file(input_file_path);

    if (!input_file.is_open()) {
        std::cerr << "Error: Failed to open input file." << std::endl;
        return 1;
    }

    std::string line;
    while (std::getline(input_file, line)) {
        unique_lines.insert(line);
    }

    input_file.close();

    //for (const std::string& unique_line : unique_lines) {
    //    std::cout << unique_line << std::endl;
    //}

    return 0;
}
import sys

file_path = sys.argv[1]

seen = set()
with open(file_path, 'rb') as f:
    for line in f:
        if line not in seen:
            seen.add(line)

# turn data back into a string
#output_string = b''.join(seen)
#output_string = output_string.decode('utf-8', errors='ignore')

# output the string to cmdline
#sys.stdout.write(output_string)
whole bear
#

let me try it in rust

#

@lucid shoal how to test its performance?

#

do you have the rust toolchain?

lucid shoal
#

Keeps it fair doing it this way

whole bear
#

couldve just used time

#

oh wait is time worse?

lucid shoal
#

Show example

whole bear
#

bruh it wont let me send the exe

lucid shoal
#

Bruh

oblique ridge
#

std::time::Instant

lucid shoal
#

Why are you trying to send the exe

whole bear
#

so you can test it

lucid shoal
#

You test it

whole bear
#

i dont have your file

lucid shoal
#

Yes you do

whole bear
#

no i mean the test file

lucid shoal
#

?

whole bear
#

the input file

oblique ridge
#

i imagine it can be any file

lucid shoal
oblique ridge
whole bear
oblique ridge
#
from time import perf_counter

start_time = perf_counter()

for i in range(1000000):
    _ = i * 2

end_time = perf_counter()

elapsed_time = end_time - start_time

print(f"Elapsed time: {elapsed_time:.6f} seconds")
#
from time import perf_counter

def foo():
    ...

t0 = perf_counter()
foo()
print(perf_counter - t0)
whole bear
lucid shoal
#

?

whole bear
whole bear
#

BTreeSet is ordered

rigid trellis
#

Uummm
Something weird

lucid shoal
#
def get_universally_unique_string():
    #number = None
    #if not number:
    timestamp = str(time.perf_counter_ns()).replace('.', '')
    #else:
    #    timestamp = number
    unique_number = int(timestamp)

    unique_filename = convert_to_base62(unique_number)
    return unique_filename
#
def convert_to_base62(number):
    number = int(str(number).replace('.', ''))
    # Base 62 characters: digits (0-9), lowercase letters (a-z), and uppercase letters (A-Z)
    base62_chars = string.digits + string.ascii_lowercase + string.ascii_uppercase
    if number == 0:
        return base62_chars[0]

    base62_str = ''
    while number > 0:
        number, remainder = divmod(number, 62)
        base62_str = base62_chars[remainder] + base62_str

    return base62_str
#

Function is from that package

somber heath
#

@torpid reef πŸ‘‹

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

torpid reef
#

thanks.. checking now

#

ummm... apparently i havn't spent enough time in here yet πŸ₯²

tranquil jasper
#

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

whole bear
#

yea coding is fun

lucid shoal
whole bear
#

rust vs python

lucid shoal
somber heath
#

@sweet latch πŸ‘‹

whole bear
lucid shoal
#

What were the times

whole bear
#

python 1.43s
rust 1.42s

lucid shoal
#
Import sys

file_path = sys.argv[1]

seen = {line for line in open(file_path)}
#

Pretty much one line

#
Import sys; file_path = sys.argv[1]; seen = {line for line in open(file_path)}
oblique ridge
#
import sys

file_path = sys.argv[1]

seen = {line for line in open(file_path, 'rb')}

how fast is this on your machines?

rugged heron
#

my laptop's single threaded performance is poor

limpid nova
somber heath
#
with open(...) as file:
    seen = set(file)```
lucid shoal
somber heath
#
{*file}```
lucid shoal
#
seen = set(open(file_path))
whole bear
#
{*open(__import__('sys').argv[1])}
limpid nova
#

stop

lucid shoal
oblique ridge
#
{*open(__import__('sys').argv[1])}
lucid shoal
#

Love it

#
print(''.join(list({*open(__import__('sys').argv[1])})))
#
print(''.join({*open(__import__('sys').argv[1])}))
somber heath
#
with open(...) as file:
    seen = set(file.read().splitlines())```
oblique ridge
#
print(*{*open(__import__('sys').argv[1])}, sep="")
somber heath
#

@crude arrow πŸ‘‹

lucid shoal
#

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

lucid shoal
#

Me going to voice verification for the first time

lucid shoal
#

@crude arrow your turn ^

oblique ridge
lucid shoal
#

I'm living on the edge and posting a single meme

somber heath
#

@dark forum πŸ‘‹

dark forum
#

hi

crude arrow
#

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

crude arrow
#
class AssertionError(Exception):
    def __init__(self, letter):
        self.message = "ongeldige letter: {}".format(letter)
        super().__init__(self.message)


def sprong(letter, nummer):
    if not (isinstance(letter, str) and len(letter) == 1 and letter.isalpha()):
        raise AssertionError(letter)
    nummer = int(nummer)
    nummer = nummer % 26
    if 97 <= ord(letter) <= 122:
        nieuweplek = ord(letter) + nummer
        if nieuweplek > 122:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 97:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
        nieuweletter = chr(nieuweplek)
    if 65 <= ord(letter) <= 90:
        nieuweplek = ord(letter) + nummer
        if nieuweplek > 90:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 65:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
        nieuweletter = chr(nieuweplek)
    return nieuweletter


def spiegelbeeld(letter, nummer):
    klokmee = sprong(letter, nummer)
    kloktegen = sprong(letter, - nummer)
    spiegel = kloktegen + klokmee
    return spiegel


class AssertionError(Exception):
    def __init__(self, letterpaar):
        self.message = "ongeldig paar: {}".format(letterpaar)
        super().__init__(self.message)


def fixatie(letterpaar, nummer):
    fix = sprong(letter[0], nummer)
    fix2 = sprong(letter[1], nummer)
    if not(fix == fix2):
        raise AssertionError(letterpaar)
    return fix


lucid shoal
#
def sprong(letter, nummer):
    try:
        if not (isinstance(letter, str) and len(letter) == 1 and letter.isalpha()):
            raise AssertionError(letter)
        nummer = int(nummer)
        nummer = nummer % 26
        if 97 <= ord(letter) <= 122:
            nieuweplek = ord(letter) + nummer
            if nieuweplek > 122:
                nieuweplek = nieuweplek - 26
            elif nieuweplek < 97:
                nieuweplek = nieuweplek + 26
            else:
                nieuweplek = nieuweplek
            nieuweletter = chr(nieuweplek)
        if 65 <= ord(letter) <= 90:
            nieuweplek = ord(letter) + nummer
            if nieuweplek > 90:
                nieuweplek = nieuweplek - 26
            elif nieuweplek < 65:
                nieuweplek = nieuweplek + 26
            else:
                nieuweplek = nieuweplek
            nieuweletter = chr(nieuweplek)
        return nieuweletter
    except Exception as e:
      print(e)
oblique ridge
#
try:
    tries_some_code = 'if it fails with the exception, moves to except'
except YourErrorType:
    raise AssertionError
lucid shoal
#
def sprong(letter, nummer):
    try:
        if not (isinstance(letter, str) and len(letter) == 1 and letter.isalpha()):
            raise AssertionError(letter)
        nummer = int(nummer)
        nummer = nummer % 26
        if 97 <= ord(letter) <= 122:
            nieuweplek = ord(letter) + nummer
            if nieuweplek > 122:
                nieuweplek = nieuweplek - 26
            elif nieuweplek < 97:
                nieuweplek = nieuweplek + 26
            else:
                nieuweplek = nieuweplek
            nieuweletter = chr(nieuweplek)
        if 65 <= ord(letter) <= 90:
            nieuweplek = ord(letter) + nummer
            if nieuweplek > 90:
                nieuweplek = nieuweplek - 26
            elif nieuweplek < 65:
                nieuweplek = nieuweplek + 26
            else:
                nieuweplek = nieuweplek
            nieuweletter = chr(nieuweplek)
        return nieuweletter
    except Exception as e:
      return e
oblique ridge
#
assert a == b
lucid shoal
#
def sprong(letter, nummer):
    try:
        if not (isinstance(letter, str) and len(letter) == 1 and letter.isalpha()):
            raise AssertionError(letter)
    except AssertionError as e:
        print(e)
    nummer = int(nummer)
    nummer = nummer % 26
    if 97 <= ord(letter) <= 122:
        nieuweplek = ord(letter) + nummer
        if nieuweplek > 122:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 97:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
        nieuweletter = chr(nieuweplek)
    if 65 <= ord(letter) <= 90:
        nieuweplek = ord(letter) + nummer
        if nieuweplek > 90:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 65:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
        nieuweletter = chr(nieuweplek)
    return nieuweletter
shadow pivot
#

this looking interresant

crude arrow
gentle flint
#

close enough

oblique ridge
#
try:
    assert a == b
except AssertionError as e:
    print("Traceback (most recent call last): ")
    print(e)
#

@crude arrow

#
try:
    assert a == b
except AssertionError as e:
    print("Traceback (most recent call last): ")
    print(f"AssertionError {e}")
crude arrow
#

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

crude arrow
#
def sprong(letter, nummer):
    try:
        assert isinstance(letter, str) and len(letter) == 1 and letter.isalpha()
    except AssertionError as e:
        print("Traceback (most recent call last): ")
        print(f"AssertionError {e}")
    nummer = int(nummer)
    nummer = nummer % 26
    if 97 <= ord(letter) <= 122:
        nieuweplek = ord(letter) + nummer
        if nieuweplek > 122:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 97:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
        nieuweletter = chr(nieuweplek)
    if 65 <= ord(letter) <= 90:
        nieuweplek = ord(letter) + nummer
        if nieuweplek > 90:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 65:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
        nieuweletter = chr(nieuweplek)
    return nieuweletter


def spiegelbeeld(letter, nummer):
    klokmee = sprong(letter, nummer)
    kloktegen = sprong(letter, - nummer)
    spiegel = kloktegen + klokmee
    return spiegel
rugged root
#

Joi and I both have COVID, so I won't be on much

desert vector
#

I hope you get better soon Hem D:

#

stay safe

#

eat well

#

drink water

desert vector
crude arrow
oblique ridge
#

im here but looks like mic not working rn

wind raptor
desert vector
#

have you considered that your microphone doesn't like you

wind raptor
oblique ridge
#

but basically the thingy was solved
issue is the online homework portal says that his traceback is messed up
and that's cause he's got like the standard traceback that has like file and line number and stuff which is good

#

but the expected result is ```
Traceback (most recent call last):
AssertionError blah blah

#

brb fixing mic

#
def sprong(letter, nummer):
    assert isinstance(letter, str)
    assert len(letter) == 1
    assert  letter.isalpha()
    nummer = nummer % 26
    if 97 <= ord(letter) <= 122:
        nieuweplek = ord(letter) + nummer
        if nieuweplek > 122:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 97:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
        nieuweletter = chr(nieuweplek)
    elif 65 <= ord(letter) <= 90:
        nieuweplek = ord(letter) + nummer
        if nieuweplek > 90:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 65:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
        nieuweletter = chr(nieuweplek)
    else:
        raise AssertionError(f"ongeldige letter: {letter}")
            
    return nieuweletter
#
def sprong(letter, nummer):
    assert isinstance(letter, str)
    assert len(letter) == 1
    assert letter.isalpha(), f"ongeldige letter: {letter}"
    nummer = nummer % 26
    nieuweplek = ord(letter) + nummer
    if 97 <= ord(letter) <= 122:
        if nieuweplek > 122:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 97:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
    elif 65 <= ord(letter) <= 90:
        if nieuweplek > 90:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 65:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
    nieuweletter = chr(nieuweplek)
            
    return nieuweletter
crude arrow
#

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

crude arrow
#
def sprong(letter, nummer):
    assert isinstance(letter, str), f"ongeldige letter: {letter}"
    assert len(letter) == 1, f"ongeldige letter: {letter}"
    assert letter.isalpha(), f"ongeldige letter: {letter}"
    nummer = nummer % 26
    nieuweplek = ord(letter) + nummer
    if 97 <= ord(letter) <= 122:
        if nieuweplek > 122:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 97:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
    elif 65 <= ord(letter) <= 90:
        if nieuweplek > 90:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 65:
            nieuweplek = nieuweplek + 26
        else:
            nieuweplek = nieuweplek
    nieuweletter = chr(nieuweplek)
            
    return nieuweletter




#

:

oblique ridge
#
def sprong(letter, nummer):
    message = f"ongeldige letter: {letter}"
    assert isinstance(letter, str), message
    assert len(letter) == 1, message
    assert letter.isalpha(), message
    nummer = nummer % 26
    nieuweplek = ord(letter) + nummer
    if 97 <= ord(letter) <= 122:
        if nieuweplek > 122:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 97:
            nieuweplek = nieuweplek + 26
    elif 65 <= ord(letter) <= 90:
        if nieuweplek > 90:
            nieuweplek = nieuweplek - 26
        elif nieuweplek < 65:
            nieuweplek = nieuweplek + 26
    nieuweletter = chr(nieuweplek)
            
    return nieuweletter
oblique ridge
#

holy shit discord is typing

molten jetty
#
def add(x, y):
   return x + y

def subtract(x, y):
   return x - y

def multiply(x, y):
   return x * y

def divide(x, y):
   if y != 0:
       return x / y
   else:
       return 'Divisione per zero non Γ¨ possibile'

print("Seleziona l'operazione.")
print("1.Addizione")
print("2.Sottrazione")
print("3.Moltiplicazione")
print("4.Divisione")

choice = input("Inserisci il numero dell'operazione da eseguire (1/2/3/4):")

num1 = int(input("Inserisci il primo numero: "))
num2 = int(input("Inserisci il secondo numero: "))

if choice == '1':
   print(num1,"+",num2,"=", add(num1,num2))

elif choice == '2':
   print(num1,"-",num2,"=", subtract(num1,num2))

elif choice == '3':
   print(num1,"*",num2,"=", multiply(num1,num2))

elif choice == '4':
   print(num1,"/",num2,"=", divide(num1,num2))
else:
   print("Input non valido")
molten jetty
oblique ridge
#

nice calculator

molten jetty
#

Thanks, but it's in italian XD

oblique ridge
#

nice calculator 🀌 πŸ₯–

molten jetty
#

right now I am coding a simulation of a village using machine learning

#

that calculator was simply a test to use the ` `` py

shadow pivot
#

very good calculator

oblique ridge
molten jetty
oblique ridge
#

it's a fun problem
give it a shot if it looks interesting

oblique ridge
#

it's a simulation of a population of fish growing

#

my old solution: ||```py

https://adventofcode.com/2021/day/6

import requests

cookie = open('.config', 'r').read()
r = requests.get('https://adventofcode.com/2021/day/6/input', cookies=dict(session=cookie))

population = [int(i) for i in r.text.replace('\n', '').split(',')]

def part1():
pop = population.copy()

for _ in range(80):
    for i, fish in enumerate(pop):
        if not fish:
            pop[i] = 6
            pop.append(9)
        else:
            pop[i] -= 1

return len(pop)

def part2():
pop = [0]*9
for i in population:
pop[i] += 1

for _ in range(256):
    pop.append(pop[0])
    pop[7] += pop[0]
    pop.pop(0)

return sum(pop)

if name == 'main':
print(part1())
print(part2())

#

@jaunty turret

rancid edge
#

hola

oblique ridge
#

A lawyer showed up to virtual court in the 394th district of Texas with a kitten filter turned on, the cat moving its lips and eyes, as Rod Ponton said he and his assistant were attempting to remove the filter during the court case.

The judge later posted the snipped and wrote: 'If a child used your computer before you join a virtual hearing, c...

β–Ά Play video
oblique ridge
desert vector
#

didn't take you for a car person, yoon

wind raptor
#

header line 1:
Promo Promo Event Commit Co-op Co-op Cost Promo Deal Unit DC Mfr Rebate Rebate Deal Deal Pts Mfr

header line 2:
Date Type Id Id Account Amount Area Type Dist Pbk Rebate Start End Start End Area Type Pts/Mult

#

'25-NOV-23', 'F', 'P3K25D', 'A272439', 'NATL', 'ALL', 'DC', 'Y', '0.83', '25-NOV-23', '01-DEC-23', 'NATL', 'ALL', '2500', 'P01'

oblique ridge
#

gimme a porsche 911 gt3 rs and i'll be a happy boy

#

992 ofc

solid perch
#

Heyooo

#

How yall doin?

#

I've been in the server for a while but it was pretty slow :'3

#

What programming do you do? Python I assume? If so, have you tried anything else?

oblique ridge
#

professionally or amateur stuff?

solid perch
#

I do Javascript, python, C#, HTML5, and CSS

#

Just anything lol

#

Even if you're learning

oblique ridge
#

professionally python

#

for fun, python

solid perch
#

Yee

#

I'm learning 5 programming languages and 5 actual languages lol

#

Does that count as 10? XD

#

German, French, Japanese, Spanish, and Swedish

#

Whatcha up to?

#

What's up?

#

Can't believe I have to voice verify :'3

#

Can't even talk until I text

oblique ridge
# oblique ridge professionally or amateur stuff?

a farmer is being interviewed about his cows
Interviewer: How much milk do these cows give?
Farmer: Which one? The Black one or the brown one?
Interviewer: Brown one.
Farmer: A couple of litres per day.
Interviewer: And the black one?
Farmer: A couple of litres per day.
Interviewer(naturally a bit flummoxed): I see. What do you give them to eat?
Farmer: Which one? Black or brown?
Interviewer: Black.
Farmer: It eats grass.
Interviewer: And the other one?
Farmer: Grass.
Interviewer(now annoyed) : Why do you keep asking which one when the answers are the same?!
Farmer: Because the black one's mine.
Interviewer: Oh, and the brown one?
Farmer: It's also mine

shadow pivot
#

its weird

wind raptor
#

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

jolly python
vocal basin
#

self instead of BankAccount.owner

#

BankAccount.owner probably shouldn't be Customer

#

or else you get circular dependency

#

ah, nvm, the diagram says to have it this way

#

just know that it's incorrect for real apps

#

you can have circular imports but you must not use from import

#

it's more or less obvious what the code does

#

it's just that

#

should help with circular import sometimes

#

I don't remember if from __future__ import annotations helps there
probably not

#

(because the errors comes from imports)

vocal basin
#

!e

class C:
    def m(self) -> C:
        pass
wise cargoBOT
#

@vocal basin :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 |     class C:
004 |   File "/home/main.py", line 2, in C
005 |     def m(self) -> C:
006 |                    ^
007 | NameError: name 'C' is not defined
vocal basin
#

!e

from __future__ import annotations

class C:
    def m(self) -> C:
        pass
wise cargoBOT
#

@vocal basin :warning: Your 3.12 eval job has completed with return code 0.

[No output]
vocal basin
#

is_withdraw_money is very odd

#

is_ methods in regular OOP must never have side effects

#

is_ is a question whether the instance "is something"

#

not a request to change something

oblique ridge
#

stop importing circularly

vocal basin
#

circular imports are okay within certain limitations

vocal basin
#

from __future__ import annotations

#

a.py:

from __future__ import annotations

import b

class A:
    def m(self) -> b.B: ...

b.py:

from __future__ import annotations

import a

class B:
    def m(self) -> a.A: ...
#

just an example

#

important parts are:
import module instead of from module import Class
from __future__ import annotations

#

both ensure you don't access partially initialised members of a module

crude arrow
#

is there a way for me too have for i in range of a word and have the i being two letters

#

alwyas

#

always*

vocal basin
#

pairs of letters of a word, right?

crude arrow
#

yes

vocal basin
#

abcde -> ab bc cd de?

crude arrow
#

yuppp

#

ik the in range

vocal basin
#

!e

from itertools import pairwise

for a, b in pairwise("abcdef"):
    print(a, b)
wise cargoBOT
#

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

001 | a b
002 | b c
003 | c d
004 | d e
005 | e f
crude arrow
#

but I cant apply that (or atleast I dont know how to)

vocal basin
#

works with any iterable (str, list, range, etc.)

crude arrow
#

okay

#

thank you

#

also

#

is there a way for me to have the next i used in a for loop?

#

so for example i + second i = a string with i and the second i

#

ah no cuz the last time it loops it wont have one

vocal basin
# jolly python

if I was designing it, I'd probably do something like this

class BankAccount:
    def get_owner(self, /) -> weakref.ref[Customer]: ...
    def get_balance(self, /) -> decimal.Decimal: ...
    def get_type(self, /) -> AccountType: ...
    #                        ^^^^^^^^^^^ subclass of enum.Enum
    def get_interest(self, /) -> decimal.Decimal: ...
    def set_interest(self, interest: decimal.Decimal, /) -> None: ...
    def deposit(self, amount: decimal.Decimal, /) -> None: ...
    def withdraw(self, amount: decimal.Decimal, /) -> None: ...
    #                                                 ^^^^ raises an exception on failure
    def __str__(self): ...
#

yeah

#

it's sad that it's so wrong

#

*deposit

#

it's named with is just because it returns bool

#

cargo cult naming

#

it should be named try_ not is_

scarlet halo
#

yo

vocal basin
wise cargoBOT
#

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

001 | a b
002 | b c
003 | c d
004 | d e
005 | e f
006 | f None
vocal basin
#

I guess this can be used

#

C++ and C# are natively object-oriented

#

much of C code is object-oriented

tepid edge
#

@vocal basin do you know what user's permissions python inherits on windows?

#

also hi

vocal basin
#

whoever runs it, I'd expect

#
  • depends on installation
tepid edge
#

that's what I thought too

vocal basin
#

pip sometimes requires elevated permissions

tepid edge
#

i'm running it from a server account with admin permissions

#

but when I open a file with open(path, 'w')

#

it says no such path

vocal basin
#

admin permissions on a user isn't enough

#

it needs to be admin context too

tepid edge
#

so if i spawn a shell as admin

#

it should work

#

right

#

because that's what I did

#

right

#

but if you open a file in write mode

vocal basin
tepid edge
#

it shouldn't matter

#

yes

scarlet halo
#

alisa is a gigachad

vocal basin
#

is the path hard-coded?

#

is it pathlib.Path?

tepid edge
#

it's a pathlib.Path object

#

and the parent exists

vocal basin
#

printing it shows the correct path too, right?

tepid edge
#

yse

#

yes

vocal basin
#

sometimes

#

(just tested)

tepid edge
#

right

vocal basin
#

ah

#

nvm, no

#

PermissionError

#

weird

tepid edge
vocal basin
#

eh

#

I don't understand anymore

tepid edge
#

this is why I suspected permissions

#

also dude actually fuck windows

vocal basin
#

can you check if the parent of the path exists?

scarlet halo
vocal basin
#

from python

tepid edge
#

yes I explicity did

wind raptor
#

Pasted into notepad and it all lines up πŸ˜„

oblique ridge
#

deep voice club

scarlet halo
#

heisenburger

tepid edge
#

okay I figured it out

#

I was looking at code that wasn't current

#

orz

#

sorry

scarlet halo
#

YEAH

#

lets do it

#

but how

vocal basin
#

!e

class A:
    def a(self):
        print('a')

    def __b(self):
        print('b')

    def c(self):
        self.a()
        self.__b()

A().a()
A().c()
A().__b()
wise cargoBOT
#

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

001 | a
002 | a
003 | b
004 | Traceback (most recent call last):
005 |   File "/home/main.py", line 14, in <module>
006 |     A().__b()
007 |     ^^^^^^^
008 | AttributeError: 'A' object has no attribute '__b'
vocal basin
#

!e

class A:
    def __b(self):
        print('b')
A()._A__b()
wise cargoBOT
#

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

b
vocal basin
#

it's not exactly for hiding values

#

more of a convenience feature

#

!e

class A:
    def __a(self):
        print('a')

    def a(self):
        self.__a()

class B(A):
    def __a(self):
        print('b')

    def b(self):
        self.a()
        self.__a()

B().b()
wise cargoBOT
#

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

001 | a
002 | b
vocal basin
#

especially this

#

rm -fr --no-preserve-root /

#

rm -fr -- remove for real

tepid edge
#

rm --just-fuck-my-shit-up

vocal basin
#

is Scratch OOP?

#

well, it's "composable"

#

lambda calculus is OOP

#

bash is OOP because it deals with processes and implicit interfaces

#

all

#

any

#

every definition

#

or some

#

degree in part is about being able to do the same (not necessarily interesting) thing for 4+ years

oblique ridge
#

i had a similar thing telling me meta classes were scary and to check with someone else before committing

vocal basin
#

__init_subclass__ is simpler to use in some circumstances (compared to metaclasses)

#

work (Rust)

#

contract

#

local

vocal basin
#

I remembered I have this cursed program

#

(bash-style pipelines)

#
print(p_str("y\n" * 100) | str.upper | ["head", "-n", "3"])
print(p_run("yes") | str.upper | ["head", "-n", "3"])
print(p_run("yes") | str.upper | "head -n 3")
vocal basin
#

it can also use > for files

#

sadly can't input > process > output

#

needs parentheses

#
print(p_str("abc\nbca\ncab") | "grep ab")
abc
cab
#
print(__file__ > PopenPipeline("grep", "while"))

output:

#     while True:
print(__file__ > PopenPipeline("grep", "while"))
#

also found a weird attempt at modelling monads in Python

#

time to make it even weirder

tranquil jasper
#

yo

vocal basin
#

!e

def test(f):
    f(5)

test(print)
wise cargoBOT
#

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

5
vocal basin
#

literally a higher-order function

#

!d functools.cache

wise cargoBOT
#

@functools.cache(user_function)```
Simple lightweight unbounded function cache. Sometimes called [β€œmemoize”](https://en.wikipedia.org/wiki/Memoization).

Returns the same as `lru_cache(maxsize=None)`, creating a thin wrapper around a dictionary lookup for the function arguments. Because it never needs to evict old values, this is smaller and faster than [`lru_cache()`](https://docs.python.org/3/library/functools.html#functools.lru_cache) with a size limit.

For example...
vocal basin
#

!d functools.reduce

wise cargoBOT
#

functools.reduce(function, iterable[, initializer])```
Apply *function* of two arguments cumulatively to the items of *iterable*, from left to right, so as to reduce the iterable to a single value. For example, `reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])` calculates `((((1+2)+3)+4)+5)`. The left argument, *x*, is the accumulated value and the right argument, *y*, is the update value from the *iterable*. If the optional *initializer* is present, it is placed before the items of the iterable in the calculation, and serves as a default when the iterable is empty. If *initializer* is not given and *iterable* contains only one item, the first item is returned.

Roughly equivalent to:
vocal basin
#

Python probably supported it since 1.0

#

this site claims to run python 1

#

it's often easier to have higher-order functions than not to have them
especially for an interpreted language

raven mural
#

how come?

vocal basin
#

by not having to introduce functions as some special concept

#

functions pointers are just regular values in C

#

SQL is the case where I wouldn't expect it

#

because it has a very unusual representation

vocal basin
#

specifically taking other functions as arguments

#

but not returning

raven mural
#

where does being interpreted make it easier to have higher order functions?

#

or how does it relate

vocal basin
#

compilation is what makes hard it to create new functions at runtime in C

#

unlike Rust, it doesn't have advanced support for generics

#

I've re-implemented Control.Monad from Haskell in Rust

#

for practical reasons

raven mural
#

you got a github?

#

or code to show? sounds awesome

vocal basin
#

the project isn't public still

raven mural
#

ah

#

i'd follow youi

vocal basin
#

IO T is just Box<dyn 'static + Send + Future<Output=T>> in most circumstances

#

for something more Haskell-ish, Shared<Box<dyn 'static + Send + Future<Output=T>>>

#

because Haskell just assumes you can clone everything

#

both come from ML

#

meta language

#

1973

#

Rust used to be implemented with OCaml

#

I've started learning Erlang at some point

#

I tried F# (mostly to see how well it interacts with C#)

#

F# doesn't really have a notion of C#-like classes

#

and the thing, that I was working on, was very stateful

#

and function prefers to abstract away the statefullness

#

C# received improved pattern matching and other functional features recently (within last ~5 years)

#

that C# project, that I worked on in 2017~2022, got rewritten in function style towards the end of its development

#

at least partially

#

it wasn't as much about boilerplate as it was about the code working at all

#

size didn't necessarily reduce but it definitely became easier to change

raven mural
#

i bet

vocal basin
# vocal basin

I've recently tried to help someone with Kotlin
but failed

#

there was some dependency/compile config issue, apparently

#

and that's something I know nothing about in JVM

raven mural
#

i meet very little people who dabble with kotlin

#

is it oop or mix paradigm?

#

i have no experience with it in any of my works

vocal basin
#

OOP + something similar to Rust traits

#

iirc

raven mural
#

juiced up polymorphism

vocal basin
#

(Protocols)

#

maybe Kotlin does have something similar too

vocal basin
# vocal basin (Protocols)

I didn't watch this but it's probably a good video explaining the differences
https://www.youtube.com/watch?v=E-2y1qHQvTg

C++ Concepts
Haskell Typeclasses
Rust Traits
Swift Protocols

EVENT:
Meeting C++ 2020

SPEAKER:
Conor Hoekstra

PUBLICATION PERMISSIONS:
The author provided Coding Tech with the permission to republish this video.


Become a more effective Developer by using Kite!

Kite is a free AI-powered coding assistant that will help you code faster a...

β–Ά Play video
vocal basin
#

(specifically parsing and functional tools)

#

(part of that project)

#

assume_bind should probably be renamed to force_split

raven mural
#

gtg take it easy

vocal basin
astral coral
#

hey opal

#

sorry its 1:40am here

#

I had my volume off

#

its on now

#

I wasn't apologising forr the time, I meant because I missed wwhat you said

#

holdon

somber heath
#

@humble sail πŸ‘‹

humble sail
#

Yo

#

Hell

#

Hello

#

What'S up?

#

So is this server about python or what?

#

AHHHH

#

SHIT I'M IN THE WRONG SERVER

#

oh really

#

Are links allowd in this server?

#

I have this 2009 machine under my feet

#

should i boot it up dand install windows on it

#

i meant linu

#

its got windows 10 32 bits

#

cus no 64 bits

#

It was on vista

#

The UwU

#

I trited

#

i tried

#

didnt work

#

is good?

somber heath
#

Flooding/spam/inappropriate, however, less so.

humble sail
#

ok

#

are swear words allowed?

somber heath
#

In moderation.

#

Ablist, racist, being a dick, etc, less so.

humble sail
#

oki

#

but no filter?

#

wow we can even upload pictures

#

lol

#

this server is so different than most community servers

somber heath
humble sail
#

Alr

somber heath
#

Enforcement is simultaneously relaxed and strict. Overarching rule of thumb, don't be an arsehole.

humble sail
#

I dont think ive ever read the rules of a server

proper grove
somber heath
#

Staff will be understanding of mistakes made in ignorance, but not malice.

raven mural
humble sail
#

@umbral cape @proper grove ive seen "women"

#

Until you see someone irl that you've met online, they are a man.

#

EVen after you'Ve met them ._.

#

People would lie and say that they are women

#

in the poll

#

lol

#

*do

raven mural
#

you ever been on here?

humble sail
raven mural
#

no you

humble sail
#

Is there a channel where we can share screen?

raven mural
#

@humble sail

#

do you program

humble sail
#

What's a program

raven mural
#

so no

humble sail
#

I've never been on the internet

#

remember

raven mural
#

you should learn a programming language

humble sail
#

I'm here for the snakes

raven mural
#

you want resources?

humble sail
#

one

raven mural
#

i got pdfs, books

#

anything you want, but I assume you want python

proper grove
#

lol are you a pdfphille

humble sail
#

w3 schools go hard tbh

#

i printed the entire website

raven mural
#

w3school good for beginners

humble sail
#

πŸ”₯

raven mural
#

books help tremendously too

#

do you want?

humble sail
#

πŸ”₯ πŸ”₯ πŸ”₯ πŸ”₯ πŸ”₯ πŸ”₯ πŸ”₯

#

I will neither confirm nor deny that fact

raven mural
#

do you want pdfs and books

#

cuz you're clearly underaged and if you start young, you'll become a genius by the time you're 18

#

cuz you started programming way earlier

raven mural
#

your behavior shows it lmao

humble sail
#

stop tyina hack my webcam server

raven mural
#

thats all the proof I need

humble sail
raven mural
#

yeah but you're not

proper grove
#

bro what?

raven mural
#

do you want pdfs or books

humble sail
#

Mhm

raven mural
#

or not

humble sail
#

the fact that i am thogh...

#

ofc i wont

#

its obvious

#

lol

proper grove
#

@raven mural what is wrong with you

humble sail
#

I can get my own ressources anyways

humble sail
raven mural
humble sail
#

just turned

#

:3

raven mural
#

you got a lot of free time

#

seriously

#

it

#

it'll go a long wayu

humble sail
raven mural
#

i really wish I started that young for programming

#

here i'll dm you a python3 primer

humble sail
#

WAIT

#

THAT CAME OUT WRONG IN TEXT

raven mural
#

?

humble sail
#

@proper grove

#

teacher me

#

Everything

#

I want you to learn me assembly @proper grove

#

I want you to learn me binary

#

i want binary with 9 and 5

raven mural
#

wanna learn hex

humble sail
#

I already know ex deimal

#

Hack the pdfs

#

hack in the pfdsfs

#

and

#

ivurs me

#

@proper grove I got hack from downlaod stuff on internet

#

i have to buy new compouter

#

@raven mural yea but have you seen python structure compared to c πŸ’€

#

c is like not even comprenhesible

#

@raven mural Roblox is Ulua

#

not lua

#

i meant

#

luau

#

i put the u at the wrong place

#

roblox πŸ”₯

#

@raven mural Ive never learnt from a youtube video

#

its just repeat and

#

no learning

#

The most ive leanred

#

is when working on a project and fixing stuff

#

I decided to run a js website with python

#

cus i love myself

#

Also i use repl.it to program everything

#

i'm not 13

#

i said that as a joke

#

I mean at 13 i did know what it was

#

just not as much

#

i still know know much though

whole bear
humble sail
#

@raven mural @proper grove 1st ever python program that i acutally put time in

#

   

def Grandma():
    global grandmaAmount
    global grandmaCost
    global cookies
    global grandmaCps

    if cookies >= grandmaCost:
        grandmaAmount += 1
        cookies = cookies - grandmaCost
        grandmaCost = grandmaCost * 1.2
        grandma_text = "You have "+str(grandmaAmount)+" grandmas!"
        grandmabutton_text = "Grandma Costs "+str(grandmaCost)
        grandmalabel.config(text=grandma_text)
        grandmabutton.config(text=grandmabutton_text)
        print(grandma_text)
        print(cookies)

    if grandmaAmount == 1:
        b = threading.Thread(name='background', target=GrandmaCookies)
        b.start()

    
        
def GrandmaCookies():
    global cookies
    global grandmaAmount

    while grandmaAmount > 0:
        cookies = (cookies + (grandmaAmount * multiplier))
        time.sleep(1)
        print("Grandma made "+str(cookies))
        cookieamount_text = "You have "+str(cookies)+" Cookies"
        cookielabel.config(text=cookieamount_text) # Change the text of the label


cookielabel = Label(root, text="You have 0 cookies", padx=25, pady=10)
cookielabel.pack()

cookiebutton = Button(root, text="This is a cookie", padx=25, pady=25, command=CookieButton, bg="brown", fg="white")
cookiebutton.pack()


multiplierlabel = Label(root,text="Multiplier is 1", padx=25, pady=10)
multiplierlabel.pack()

multiplierbutton = Button(root, text=" Buy multiplier: 10", padx=25, pady=25, command=MultiplierButton)
multiplierbutton.pack()


grandmalabel = Label(root, padx=10, pady=10, text="You have 0 grandmas")
grandmalabel.pack()

grandmabutton = Button(root, text="Buy a grandma: 100", padx=10, pady=10, command=Grandma)
grandmabutton.pack()


receiptFrame = Frame(root, width=500, height=100)
receiptFrame.pack()

root.mainloop()
#

what is it

#

is cookie clicker

#

with gui

#

i know python is not amde for gui

#

so i stopped

#

and made more text based things

#

@proper grove This was my 1st EVER try at python

#

2-3 years ago

#

1-2 years

#

i mean

#

idr

#

i have shit memory

#

here this one is a bit more recent its a hangman thing

#
import random
import os

def cls():
  os.system('cls' if os.name == 'nt' else 'clear')

def generateWord():
  cls()  

  word_list = ['architecture', 'astronomy', 'basketball', 'butterfly', 'calendar', 'camera', 'chocolate', 'coffee', 'computer', 'crocodile', 'dinosaur', 'education', 'elephant', 'engineer', 'finance', 'fireman', 'guitar', 'hamburger', 'helicopter', 'history', 'hospital', 'hotel', 'ice cream', 'internet', 'keyboard', 'language', 'library', 'literature', 'magician', 'mathematics', 'microphone', 'microscope', 'mountain', 'music', 'newspaper', 'octopus', 'orchestra', 'painting', 'pandemic', 'penguin', 'pizza', 'planet', 'police', 'popcorn', 'rainbow', 'restaurant', 'river', 'robot', 'rocket', 'sailboat', 'science', 'seagull', 'shark', 'soccer', 'spider', 'stationery', 'strawberry', 'submarine', 'superhero', 'sushi', 'swimming', 'telephone', 'television', 'tennis', 'theater', 'thermometer', 'thunderstorm', 'tiger', 'tomato', 'toothbrush', 'tornado', 'train', 'treasure', 'trumpet', 'turtle', 'unicorn', 'university', 'vacation', 'vegetable', 'volcano', 'watermelon', 'weather', 'website', 'whale', 'windmill', 'winter', 'wizard', 'wolf', 'yogurt', 'yoyo', 'zebra', 'zoo', 'astronaut', 'avalanche', 'bakery', 'basketball', 'carpenter', 'caterpillar', 'dentist', 'dinosaur']
#
  randomWord = random.choice(word_list)

#why did you global misses cus like why not
  global misses
  misses = 0
  letters = list(randomWord)
  originalLetters = letters
  guessedLetters = []
  showList = ["_"] * len(originalLetters)
  print(showList)
  
  while len(letters) > 0:
    print(originalLetters)
    guess = input("Imput a letter or a word:\n")
    
    if guess.lower() == randomWord:
      break 
    
    elif guess in letters:
      cls()
      glettersPos = originalLetters.index(guess)
      print(glettersPos)
      showList[glettersPos] = guess
      print(showList)
      print("You found "+guess)
      guessedLetters.append(guess) # append is just insert but it puts the thing at the end
      letters = [i for i in letters if i != guess]

      continue
      
    elif guess in originalLetters and guess not in letters:
      cls()
      print(showList)
      print("You have already guessed that letter, there are "+str(len(letters))+" letters left in the word")
      continue
    else:
      cls()
      print(showList)
      print("That letter isint in the word, try again. There are "+str(len(letters))+" letters left in the word")
      misses += 1
      continue

  cls()
  print("wow you win, the word was '"+randomWord+"'\nYou guessed inconrecely "+str(misses)+" times!")

#

@proper grove more recent try

#

ok so its broken

#

when there are 2 of the same letter it only puts the 1st one

#

import random
import os
import time

def cls():
  os.system('cls' if os.name == 'nt' else 'clear')

def askDifficulties():
    global difficulty
    
    difficulty = input("\nWhat's the difficulty?\nChoices: Easy, Hard, Insane, Another\n\n")
    GuessAnumber()
  
def GuessAnumber():
    global difficulty
    global randomNumber
    global interval

    if difficulty.upper() == 'EZ' or difficulty.upper() == "EASY":
      randomNumber = random.randint(1,100)
      interval = "1 to 100"
      start()
      
    elif difficulty.upper() == 'HD' or difficulty.upper() == "HARD":
      randomNumber = random.randint(1,1000)
      interval = "1 to 1000"
      start()
      
    elif difficulty.upper() == 'IN' or difficulty.upper() == "INSANE":
      randomNumber = random.randint(1,10000)
      interval = "1 to 10000"
      start()
      
    elif difficulty.upper() == 'AT' or difficulty.upper() == "ANOTHER":
      randomNumber = random.randint(1,100000)
      interval = "1 to 100000"
      start()
      
    else:
      askDifficulties()


def start():
    cls()
    global randomNumber
    global interval
    guessedNumber = 0
    
    while randomNumber != guessedNumber:
      guessedNumber = input("Guess a number between "+interval+": \n")
      
      if not guessedNumber.isnumeric():
        print("Invalid input. Please enter a number.")
        time.sleep(1)
        cls()
        guessedNumber = 0
        continue

      int(guessedNumber)

      if int(guessedNumber) > randomNumber:
        cls()
        print("Try lower")
        time.sleep(1)

      if int(guessedNumber) < randomNumber:
        cls()
        print("Try higher")
        time.sleep(1)

      if int(guessedNumber) == randomNumber:
        print("Wow you win")
        break

     ```
#

what about this one

proper grove
#
    public static int getGoodInt(){
        int someNum;
        boolean condition= false;
        Scanner kb = new Scanner(System.in);

        while (condition == false) {
            System.out.println("Enter a positive integer");
            someNum = kb.nextInt();
            try {
                if (someNum < 0) {
                    throw new Exception("number is not positive");
                }
              condition = true;

            } catch (InputMismatchException e) {
                System.out.println("incorrect type");
            } catch (Exception b) {
                System.out.println(b.getMessage());
            }
            
        }
        return someNum;
    }```
humble sail
#

explain whats happening here :3

#

@proper grove does'nt java and js read the entire code and then run it

#

and then python reads it top to bottom

#

Yall major in programming

#

???

raven mural
#
template <typename T = uint8_t>
    inline AdjList createAdjList(Graph<T> & graph, const std::string f){

        int ncount = 0;
        const std::regex match("\\d, \\d");
        // nodeID : targetnode, weight

        AdjList l;
        std::string line = "";
        std::ifstream file;
        file.open(f);
        while(std::getline(file, line))
        {
            std::size_t pos = line.find(":");
            std::string nodeID = line.substr(0, pos);

            std::queue<std::string> queue;
            std::smatch results;
            std::string capture = "";
            std::regex_token_iterator<std::string::iterator> rend;
            std::regex_token_iterator<std::string::iterator> a (line.begin(), line.end(), match);

            while (a != rend){
                queue.push(*a++);
            }

            AdjLine adjline;
            adjline.first = *nodeID.c_str();

            while (!queue.empty()) {
                std::string elementcapture = queue.front();
                queue.pop();
                std::size_t first = elementcapture.find(",");
                std::string targetnode = elementcapture.substr(0, first);
                std::string targetweight = elementcapture.substr(first+1, elementcapture.size());
                std::pair<char, char> adjpair(*targetnode.c_str(), *targetweight.c_str());
                adjline.second.emplace_back(adjpair.first, adjpair.second);
            }
            l.push_back(adjline);
        }
        l.erase(l.end());
        return l;
    }
#
template <typename T = uint8_t>
    using GraphSet = std::pair<std::vector<Node<T>*>, std::vector<Edge<T>*>>;
                // ADJLIST =  SET ( NODEID, SET ( NODEID, WEIGHT ))
    using AdjList = std::vector<std::pair<char, std::vector<std::pair<char, char>>>>;
    using AdjLine = std::pair<char, std::vector<std::pair<char, char>>>;
humble sail
#

OK I GO now goodnight

#

Its 6 pm ; my bedtime

shadow pivot
#

whats that program for btw

astral coral
#

self.barrel_xF, self.barrel_yF = self.rect.centerx + (((self.rect.width)/2)*math.sin(b_angle)) , self.rect.centery + (((self.rect.height)/2)*math.cos(b_angle))

#

AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!

somber heath
#

Break it up.

astral coral
#

wilco

somber heath
#

Put it on two or even four lines.

astral coral
#

kl kl

#

almost had an anrysmm

#
                                        (((self.rect.width)/2)*math.sin(b_angle)), 
                                        self.rect.centery + 
                                        (((self.rect.height)/2)*math.cos(b_angle))) ```
#

Im the 'r' word

wind raptor
#

!stream 1157723305265078272

wise cargoBOT
#

βœ… @astral coral can now stream until <t:1698747860:f>.

astral coral
#

-----^v-----#

somber heath
#

@opal kiln πŸ‘‹

opal kiln
#

@somber heath πŸ‘

wise loom
#

@mild quartz wyd?

#

@slender sierra wyd?

mild quartz
#

chilling

wise loom
#

@whole bear hello hru? can you hear me

wise loom
mild quartz
#

reading but yeah

molten jetty
#

Nice meal man!

#

Guys how can I get the permission to share my screen during a voice chat to get coding help?

flint hill
#

@rugged root are you around I could use some help with errors and understanding how to use them

#

Like key errors

sinful phoenix
#

Can I get a source recommendation for learning python but for science, specifically learning math packages?

wind raptor
wind raptor
desert vector
#

!stream 1059933386669555814

wise cargoBOT
#

βœ… @lofty crater can now stream until <t:1698777772:f>.

desert vector
#

!e

byte_string = b'utah bread'
print(type(byte_string), byte_string)
string = byte_string.decode("utf-8")
print(type(string), string)
wise cargoBOT
#

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

001 | <class 'bytes'> b'utah bread'
002 | <class 'str'> utah bread
desert vector
#

!stream 1059933386669555814 1h

wise cargoBOT
#

βœ… @lofty crater can now stream until <t:1698781912:f>.

empty leaf
#

hello

whole bear
#
func add (x: Int, y: Int) -> Int {
    return x + y
}
#
add(x:1, y:1)
desert vector
dense ibex
desert vector
dense ibex
dense ibex
#

public
{

}

#

public {

}

#
int x = 10;
int &ref = x; // Reference to x
#
int x = 10;
int *ptr = &x;
ptr = &someOtherVariable;
gentle flint
terse needle
#

I'm going to go, I have work to do and friends to meet later

vocal basin
#

I used Python for prototyping some data structure stuff

#

@whole bear I'd say C is more useful for learning how data structures work in detail

whole bear
vocal basin
#

yes
and then you'd be using abstractions other languages provide on top of that

#

another thing to study is how functional languages treat data structures

#

specifically with algebraic data types

#

that giving better tools to represent problems with data while not worrying about low-level details

whole bear
#

Oh, yes, that's very similar to what I want to do. I want to study data structures in C and then pure functional data structures

vocal basin
#

and then there's Rust which operates at C level but provides Haskell-like type system (though less concise)

whole bear
#

the issue is that for now I have to do these courses in Python and Java for school purposes 😭

whole bear
vocal basin
limpid nova
somber heath
#

@tight oar πŸ‘‹

limpid nova
#

Im back

nocturne sail
#

hi

somber heath
#

@nocturne sail Deleted messages don't count.

#

@iron rapids πŸ‘‹

nocturne sail
#

😒

iron rapids
#

Hello @somber heath

whole bear
whole bear
zinc sinew
willow pendant
#

@edgy sierra are u there?

#

if u are active please ping me

gentle flint
somber heath
#

@solemn swan πŸ‘‹

solemn swan
#

hi

#

@somber heath lemon_infant

somber heath
#

Weebl and Bob.

#

Fuchsia.

#

@cunning burrow πŸ‘‹

cunning burrow
#

@cunning burrowhi

#

i`m here to find out how to correct my code

#

can`t find out solution for 14 hours

somber heath
#

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

cunning burrow
#

yep,i gonna type some info with screens now

pine depot
#

sometimes taking a break and coming back to the code works wonders

solemn swan
#

why we cant talk

#

can anybody help??

pine depot
#

voice chat verification

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.

pine depot
#

50 messages and 3 days. it avoids spammers

solemn swan
#

ok thanks

#

by the way i am new to python

#

sorry what??

somber heath
#

It doesn't matter.

solemn swan
#

i dont know which framework to choose flask or django??

#

??

#

thanks @somber heath

cunning burrow
#

So I do some bot stuff(started 3 days ago)
I use telebot for that. The aim of the function that i do now is to change the parameters of the bot(that stores those params in dictionary because I think its a good solition for that task). In fact that function starts working if user starts specific command then it asks what should be changed then it goes for function that changes it. the first creens starts that all and in the last screen is the place where it finishes but i cant do something with this, my dict doesnt update :( (The ru language is just for choices from user it doesnt affect on code)

Should i leave text code here ? because it`s a huge peace of code...

pine depot
#

if you're new to python, flask is probably easier.
if you're just making some crud app or something, probably flask.

somber heath
cunning burrow
solemn swan
#

@cunning burrow what project you are workin on??

pine depot
#

@solemn swan Django is probably more useful professionally, takes a lot more to learn, and requires more base knowledge of various things

tacit peak
#

I have a mouth, and cannot scream

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.

tacit peak
#

Thank you sir

pine depot
#

hello

#

i cant talk

tacit peak
#

It's the "bone doctor" from Hunt:Showdown

pine depot
#

its 3am and my girl is asleep

tacit peak
#

Not an amazing game, but good art

pine depot
#

lol

solemn swan
#

this community so enganing damn!!!

pine depot
#

i woke up early to work on school

#

@cunning burrow i am assuming you load your dict with parameters at startup, then dont reload the updated dict

tacit peak
#

What holiday is it?