#off-topic-lounge-text

1 messages · Page 6 of 1

potent wharf
#

nope

#

i am thinking to restart the word

#

yes

#

ok

#

just i want to ask that header is permently fix there

#

?

potent wharf
#

@dull anvil done I fix it

potent wharf
#

Thanks for help

warm mango
#

Maro, were you asking me something? .. im sort of listening while working and trying to get ready for a meeting in .5hrs

languid cave
#

Hey

buoyant kestrel
#

What've I missed?

visual crow
#

I have absolutely no idea

cold lintel
#

Sorry if you were talking to me earlier and I wasn't responding. I wasn't able to connect.

#

Unicode escapes work on my machine pithink ```bash
echo $'\u61'

#

Should print a

#

What is the shell in the bottom-left?

#
echo $SHELL
latent moss
#

!e

num1 = int(input())
print("enter the num2 number: ")
num2 = int(input())

total = num1 + num2
print(f"{num1} + {num2} = {total}")```
timid fjordBOT
#

@latent moss :x: Your 3.10 eval job has completed with return code 1.

001 | Enter the num1 number: 
002 | Traceback (most recent call last):
003 |   File "<string>", line 2, in <module>
004 | EOFError: EOF when reading a line
latent moss
#

print("Enter the num1 number: ")
num1 = int(input())
print("enter the num2 number: ")
num2 = int(input())

total = num1 + num2
print(f"{num1} + {num2} = {total}")

#

!eval print("Enter the num1 number: ")
num1 = int(input())
print("enter the num2 number: ")
num2 = int(input())

total = num1 + num2
print(f"{num1} + {num2} = {total}")

timid fjordBOT
#

@latent moss :x: Your 3.11 eval job has completed with return code 1.

001 | Enter the num1 number: 
002 | Traceback (most recent call last):
003 |   File "<string>", line 2, in <module>
004 | EOFError: EOF when reading a line
latent moss
#

!eval data = "Your uncle and yours"
print(data)

timid fjordBOT
#

@latent moss :white_check_mark: Your 3.11 eval job has completed with return code 0.

Your uncle and yours
modern halo
#

!eval a = 1+1

timid fjordBOT
#

@modern halo :warning: Your 3.11 eval job has completed with return code 0.

[No output]
modern halo
#

!eval a = 1+1
print(a)

timid fjordBOT
#

@modern halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

2
modern halo
#

!eval
for i in range(10):

timid fjordBOT
#

@modern halo :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     for i in range(10):
003 |                        ^
004 | IndentationError: expected an indented block after 'for' statement on line 1
modern halo
#

!eval
for i in range(10):
print('Hello World')

timid fjordBOT
#

@modern halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Hello World
002 | Hello World
003 | Hello World
004 | Hello World
005 | Hello World
006 | Hello World
007 | Hello World
008 | Hello World
009 | Hello World
010 | Hello World
modern halo
#

!eval
while True:

#

!eval
a = 1
while True:
print(a)
a += 1

timid fjordBOT
#

@modern halo :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     print(a)
003 |     ^
004 | IndentationError: expected an indented block after 'while' statement on line 2
modern halo
#

!eval
a = 1
while True:
print(a)
a += 1

timid fjordBOT
#

@modern halo :x: Your 3.11 eval job has completed with return code 143 (SIGTERM).

001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
006 | 6
007 | 7
008 | 8
009 | 9
010 | 10
011 | 11
... (truncated - too many lines)

Full output: too long to upload

modern halo
#

!eval
import os

timid fjordBOT
#

@modern halo :warning: Your 3.11 eval job has completed with return code 0.

[No output]
peak lion
#

!eval
return 1

timid fjordBOT
#

@peak lion :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 | SyntaxError: 'return' outside function
rugged wigeon
#

import turtle

raw rock
#

ohh hello maro and Yu

oak grove
#

@atomic phoenix common bro you make this easily readable

#

!e ```py
import math
import sys

def sd_calc(data):
n = len(data)

if n <= 1:
    return 0.0

mean, sd = avg_calc(data), 0.0

# calculate stan. dev.
for el in data:
    sd += (float(el) - mean)**2
sd = math.sqrt(sd / float(n-1))

return sd

def avg_calc(ls):
n, mean = len(ls), 0.0

if n <= 1:
    return ls[0]

# calculate average
for el in ls:
    mean = mean + float(el)
mean = mean / float(n)

return mean

data = [4, 2, 5, 8, 6]
print("Sample Data: ",data)
print("Standard Deviation : ",sd_calc(data))```

timid fjordBOT
#

@oak grove :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Sample Data:  [4, 2, 5, 8, 6]
002 | Standard Deviation :  2.23606797749979
oak grove
#

Pretend that I have streaming perms...

grave folio
#

Hey can someone help me the last line isnt prrinting when I put the input

#

#Python Treasure Hunt Game
import time, random



def display_game_intro():
    
    print('''
              
            ----> Welcome to the 'Python Treasure Hunt Game'
            ... the msot amazing game ever made!

          After a long journey, you find yourself in front of two caves
          One cave leads to a treasure, the other, a spike filled pit
          Being Brave, and a little greedy for treasure, you've decided to go for it!
       
       
        ''')






def choose_cave():
    cave = ''
    while cave != 1 and cave != 2:
     print("Which cave do you want to enter (1 or 2)")
     cave = input()
    return cave
   




    
  

       
 


def enter_cave():
    
    pass


def main_loop():
    
    display_game_intro()
    choose_cave()



main_loop()
whatdidenter = choose_cave


print("What cave did I choose: " + whatdidenter)```
uncut tiger
#

yo

#

I don't have a working mic, haha

#

@umbral trout were you the one talking?

uncut tiger
#

no reason, just wanted to let whoever it was know I didn't have a working mic

primal bison
#

any solutions?

oak plume
#

hey guys im currently studying computer science engineering and I have problems with 2D structures so if someone could tell me if this code is fine to know if a matrix has equal rows and columns

#

def is_square(matrix):
num_rows = len(matrix)
num_colums = len(matrix[0])
if num_rows == num_colums:
return True
else:
return False

#

but lets say the last list of the list has less numbers than the first one

#

how could i verify if it is a square matrix or no

timid fjordBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

night token
#

!e
print("I am a bot")

timid fjordBOT
#

@night token :white_check_mark: Your 3.11 eval job has completed with return code 0.

I am a bot
night token
#

!e
import torch, random

num = random.randint(0,1000)
dimensional_list = []

for i in range(num):
dimensional_list.append(random.randint(0,1000))

x = torch.rand(*dimensional_list)

print(f"This is a {len(x.size())} dimensional tensor.")

timid fjordBOT
#

@night token :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'torch'
night token
#

Dangit

#

guess i have to create the function myself ;-;

#

!e

timid fjordBOT
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!

night token
#

!e
pip install torch

timid fjordBOT
#

@night token :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     pip install torch
003 |         ^^^^^^^
004 | SyntaxError: invalid syntax
night token
#

!e
raise Exception

timid fjordBOT
#

@night token :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | Exception
night token
#

!e
raise KeyboardInterrupt

timid fjordBOT
#

@night token :x: Your 3.11 eval job has completed with return code 130 (SIGINT).

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | KeyboardInterrupt
oak grove
#

!e ```py
from typing import List
from dataclasses import dataclass

@dataclass
class Point:
x: int
y: int

def match_points(points: List[Point]) -> str:
return (
"No points" if not points else
"The origin" if len(points) == 1 and points[0].x == 0 and points[0].y == 0 else
f"Single point {points[0].x}, {points[0].y}" if len(points) == 1 else
f"Two on the Y axis at {points[0].y}, {points[1].y}" if len(points) == 2 and points[0].x == 0 and points[1].x == 0 else
f"{len(points)} points"
)

Example usage:

print(match_points([])) # No points
print(match_points([Point(0, 0)])) # The origin
print(match_points([Point(1, 2)])) # Single point 1, 2
print(match_points([Point(0, 1), Point(0, 2)])) # Two on the Y axis at 1, 2
print(match_points([Point(1, 2), Point(3, 4), Point(5, 6)])) # 3 points

timid fjordBOT
#

@oak grove :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | No points
002 | The origin
003 | Single point 1, 2
004 | Two on the Y axis at 1, 2
005 | 3 points
oak grove
#

!e ```py
from dataclasses import dataclass

@dataclass
class Point:
x: int
y: int

def match_points(points: list[Point]) -> str:
return (
"No points" if not points else
"The origin" if len(points) == 1 and points[0].x == 0 and points[0].y == 0 else
f"Single point {points[0].x}, {points[0].y}" if len(points) == 1 else
f"Two on the Y axis at {points[0].y}, {points[1].y}" if len(points) == 2 and points[0].x == 0 and points[1].x == 0 else
f"{len(points)} points"
)

Example usage:

print(match_points([])) # No points
print(match_points([Point(0, 0)])) # The origin
print(match_points([Point(1, 2)])) # Single point 1, 2
print(match_points([Point(0, 1), Point(0, 2)])) # Two on the Y axis at 1, 2
print(match_points([Point(1, 2), Point(3, 4), Point(5, 6)])) # 3 points

timid fjordBOT
#

@oak grove :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | No points
002 | The origin
003 | Single point 1, 2
004 | Two on the Y axis at 1, 2
005 | 3 points
oak grove
#
from dataclasses import dataclass

@dataclass
class Point:
    x: float
    y: float

def match_points(points: list[Point]) -> str:
    if not isinstance(points, list):
        raise TypeError("Points must be a list of Point objects")
    for p in points:
        if not isinstance(p, Point):
            raise TypeError("Points must be a list of Point objects")
        if not isinstance(p.x, (int, float)) or not isinstance(p.y, (int, float)):
            raise TypeError("Point coordinates must be integers or floats")
    return (
        "No points" if not points else
        "The origin" if len(points) == 1 and points[0].x == 0 and points[0].y == 0 else
        f"Single point {points[0].x}, {points[0].y}" if len(points) == 1 else
        f"Two on the Y axis at {points[0].y}, {points[1].y}" if len(points) == 2 and points[0].x == 0 and points[1].x == 0 else
        f"{len(points)} points"
    )

# Example usage:
try:
    print(match_points("invalid input"))
except TypeError as e:
    print(e) # Points must be a list of Point objects

try:
    print(match_points([1, 2]))
except TypeError as e:
    print(e) # Points must be a list of Point objects

try:
    print(match_points([Point(1, 2), "invalid point"]))
except TypeError as e:
    print(e) # Points must be a list of Point objects

try:
    print(match_points([Point(1, 2), Point("invalid", 4)]))
except TypeError as e:
    print(e) # Point coordinates must be integers or floats

print(match_points([])) # No points
print(match_points([Point(0, 0)])) # The origin
print(match_points([Point(1, 2)])) # Single point 1.0, 2.0
print(match_points([Point(0, 1), Point(0, 2)])) # Two on the Y axis at 1.0, 2.0
print(match_points([Point(1, 2), Point(3, 4), Point(5, 6)])) # 3 points
#

!e ```py
from dataclasses import dataclass

@dataclass
class Point:
x: float
y: float

def match_points(points: list[Point]) -> str:
if not isinstance(points, list):
raise TypeError("Points must be a list of Point objects")
for p in points:
if not isinstance(p, Point):
raise TypeError("Points must be a list of Point objects")
if not isinstance(p.x, (int, float)) or not isinstance(p.y, (int, float)):
raise TypeError("Point coordinates must be integers or floats")
return (
"No points" if not points else
"The origin" if len(points) == 1 and points[0].x == 0 and points[0].y == 0 else
f"Single point {points[0].x}, {points[0].y}" if len(points) == 1 else
f"Two on the Y axis at {points[0].y}, {points[1].y}" if len(points) == 2 and points[0].x == 0 and points[1].x == 0 else
f"{len(points)} points"
)

Example usage:

try:
print(match_points("invalid input"))
except TypeError as e:
print(e) # Points must be a list of Point objects

try:
print(match_points([1, 2]))
except TypeError as e:
print(e) # Points must be a list of Point objects

try:
print(match_points([Point(1, 2), "invalid point"]))
except TypeError as e:
print(e) # Points must be a list of Point objects

try:
print(match_points([Point(1, 2), Point("invalid", 4)]))
except TypeError as e:
print(e) # Point coordinates must be integers or floats

print(match_points([])) # No points
print(match_points([Point(0, 0)])) # The origin
print(match_points([Point(1, 2)])) # Single point 1.0, 2.0
print(match_points([Point(0, 1), Point(0, 2)])) # Two on the Y axis at 1.0, 2.0
print(match_points([Point(1, 2), Point(3, 4), Point(5, 6)])) # 3 points

timid fjordBOT
#

@oak grove :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Points must be a list of Point objects
002 | Points must be a list of Point objects
003 | Points must be a list of Point objects
004 | Point coordinates must be integers or floats
005 | No points
006 | The origin
007 | Single point 1, 2
008 | Two on the Y axis at 1, 2
009 | 3 points
oak grove
#

ezpz

honest osprey
#

how do i copy an entire directory into another directory?

hollow trench
#

@split pendant 👋

thorn garden
#

what is slicing in python

brazen helm
brazen helm
vague cliff
#

@night lily Hii
can i get help in c

night lily
vague cliff
potent wharf
#

@dull anvil what's up

wintry acorn
#

this is really Good One

#

try this

pale beacon
#

anyone can help me?

#

please

spare sleet
#

Whoooah

#

There is a "mei misaki" in vc

spare sleet
orchid lagoon
#

hi ,i just want to complete my 50 message challenge so i will be sending some message please don't mind

timid fjordBOT
#

:incoming_envelope: :ok_hand: applied mute to @orchid lagoon until <t:1678298767:f> (10 minutes) (reason: duplicates rule: sent 4 duplicated messages in 10s).

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

lofty vortex
#

we do mind actually

obtuse knot
#

You know how there's a clause that says that spamming to reach the threshold will result in a voice mute? pithink

lofty vortex
#

!tvmute 463649853730324491 "2 weeks" Spamming messages to up your message count is not the way to get voice verified. You can still join voice channels without being verified; you just have to get some legitimate server activity in order to get verified.

timid fjordBOT
#

:incoming_envelope: :ok_hand: applied voice mute to @orchid lagoon until <t:1679507874:f> (14 days).

obtuse knot
#

Didn't see that coming

potent wharf
#

@dull anvil You guys making any project

#

?

#

ok its c++?

#

okay

#

i search about it looks powerfull language

warm rose
#

@atomic phoenix A byte?

#

@atomic phoenix
A byte consists of 8 bits. 8 bits together make a byte.

#

@atomic phoenix
What is a numbre?

#

I am sorry I could not understand your question.

#

Ohh, Array!

#

An array is a collection of data that has an index.

#

inheritance? Is it not about object oriented programming?

#

One question? Have I just joined in a programming class willy nilly without even knowing about it in the first place?

warm rose
#

@atomic phoenix @modern hazel
Bad blood still persists between these two sophisticated programmers.

ornate rampart
#

lol

#

@atomic phoenix Test 1 ,2 ,3

#

yes

white forge
#

!eval while true: print("fr")

timid fjordBOT
#

@white forge :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'true' is not defined. Did you mean: 'True'?
white forge
#

!eval while True: print("fr")

timid fjordBOT
#

@white forge :x: Your 3.10 eval job has completed with return code 143 (SIGTERM).

001 | fr
002 | fr
003 | fr
004 | fr
005 | fr
006 | fr
007 | fr
008 | fr
009 | fr
010 | fr
011 | fr
... (truncated - too many lines)

Full output: too long to upload

calm bay
#

!eval print("fr"*100000)

timid fjordBOT
#

@calm bay :white_check_mark: Your 3.11 eval job has completed with return code 0.

frfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfr
... (truncated - too long)

Full output: too long to upload

rain geyser
#

!eval print("I like python lol"*10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)

timid fjordBOT
#

@rain geyser :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | OverflowError: cannot fit 'int' into an index-sized integer
rain geyser
#

!eval print("I like python lol"*10000000000000000000)

timid fjordBOT
#

@rain geyser :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | OverflowError: cannot fit 'int' into an index-sized integer
rain geyser
#

!eval print("I like python lol"*10000000000000)

timid fjordBOT
#

@rain geyser :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | MemoryError
crystal torrent
#

Hello everyone, I am a 3rd year student of Applied Electronics and I would like to learn programming on microcontrollers, that is, the embedded part. Can you suggest some starter project ideas and some apps I can test? So Proteus and AVR studio would be good? I want you to work on this part with bits. Thank you and I look forward to any reply in private or here.

tender tangle
#
class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next
#
list_instance = ListNode()
def list_generator():
    while list_instance.next != None:
        return_value = list_instance.val
        list_instance = list_instance.next
        yield return_value

reversed_nodes_list = list(list_generator()).reverse()
royal heart
#

is the sound working?

royal heart
#

alls quiet on the western front...........

#

python broken compared to rust ??

royal heart
#

im listening ----- keep going

lunar kayak
#

hey whatsup

#

can anyone help me with some math related code

potent wharf
#

@dull anvil hi

#

if you have time can you please help me to fix one error

#

1 min

#

Actually I want to install mongodb

#

Yes

#

Like we have to install that home brew

#

Should I type that in terminal?

#

Sudo chown ...

#

Wait I send you

#

1 min

#

Yes

#

wait i try from starting

#

ok

#

wait run

#

ok

#

i run this

#

sudo chown -R

#

ok sure

#

i am also thinking same

#

i run now

#

nothing happen

#

ok

#

i think its work

#

done buddy

#

i think that path was lock

#

@dull anvil thanks for help

#

now i install mongodb

#

ok

#

done with installation

strong summit
#

yes

#

i can see it

tranquil lichen
#

Oh

vague cliff
#

Hello Guys!

#

i want to add drf in tutorial how can i add

#

I am thinking to create a project djangorestframeworkforbois

#

yeah!

#

Byy

jagged granite
#

Should probably make the MD detectable

spring gazelle
#

whatcha coding

jagged granite
#

You have to tell it to

lime cove
#

hi

#

im still gaining experience to be able to chat

#

This is probably my 20th line so far

#

It takes time and dilligence

#

I tried to skip ahead and write a bunch of lines all at once, but i got caught by a mod

#

told me i had to start over so here i am at the bottom rising the ranks of chat texts

calm bay
#

@stoic wing let me guess, from Toronto?

stoic wing
calm bay
#

I'm very perceptive

stoic wing
#

perceptions score must be 18+

calm bay
#

Indeed

#

Whereabouts in Toronto?

stoic wing
#

are you a rogue

#

i can't go into specifics about where

#

just not in the center

calm bay
#

fair enough

stoic wing
#

i moved to a small town recently might be going back soon

runic sage
#

why stream 5 fps

#

I understand

#

thx

round bronze
#

yeah

#

xD

lament otter
#

hello

silver spindle
#
# Remove the first duplicate element of a list

my_list = [2, 3, 4, 5, 3, 6, 4, 1]
appended_list = set()

print("My List (Original):", my_list)

for list_value, each_list_element in enumerate(my_list):
    if each_list_element in appended_list:
        my_list.pop(list_value)

        break

    appended_list.add(each_list_element)

print("My List (Revised): ", my_list)
#

@atomic phoenix

#

I think pop removes the an element from the list, but I am not sure how it does it.

#

What do you mean?

wintry zodiac
#

list = [1,2,3,4]
list.pop()
print(list) => [1,2,3]

silver spindle
#

Ok

#

I got it now

#

Now what does this one do: appended_list.add(each_list_element)

@atomic phoenix and @wintry zodiac

I mean, I think what it is doing is adding the rest of the values back to the list...

wintry zodiac
#

i feel like you should look at the documentation

#

also will help you learn how to find the answers yourself which is a big part of programming

#

you don't want to just memorize things there is to much to memorize

#

so append_list variable is it a list or set

#

?

silver spindle
wintry zodiac
#

Do why are you using a set?

#

oops i meant why are you using a set

#

im not saying dont use it but why

#

yes

#

yes because property of a set is that it cant have duplicates

#

adding to the set called appended list from the value my_list

#

also are you trying to remove all duplicates are the first recurring one

#

?

#

so would a set help you

#

a set removes all duplicates though

#

So I would not use it then

#

because we just want to remove the first duplicate not all

#

does this make sense

#

try [1,1,2,2,3,3]

#

will it be [1,2,2,3,3]?

#

wait now i'm confuse do you want both first dublicate remove and all dublicates removed

#

printed out

#

yes

#

so it doesn't work

#

yes

#

loop through list check if its a duplicate if so remove else keep looping

fallen topaz
#

[1,2,2,1,1]

silver spindle
#

[1, 2, 2]

#

My Solution:

wintry zodiac
#

yes

#

If i give you an ideal it will be the solution

errant lark
#

what's the question?

wintry zodiac
#

that wont work try [1,2,2,1]

#

@fallen topaz try [1,2,2,1] will it give you [1,2,2,1]

#

should give you [1,2,2]

#

[1,1,1,1,1,1,1]

#

you want me to show you what i think the solution is

#

oh wait is it bad to just give solution will you get banned?

#

im not going to

#

find the first duplicate element using the compare operator "in"

#

also make sure you need to check index

#

too when looking for first duplicate

errant lark
#

you are constantly creating a copy of the original?

#

that's a copy for sure

#

!e

lst = []
print(lst[:] is lst)
timid fjordBOT
#

@errant lark :white_check_mark: Your 3.11 eval job has completed with return code 0.

False
fallen topaz
#

!e

x = [
  1, 2, 1, 1, 3, 2
]

def remove_first_duplicate_elements_duplicates(items):
    dup = None
    i = 0
    while i < len(items):
        if not dup and items[i] in items[0:i]:
            dup = items[i]
        if dup and items[i] == dup:
            items.pop(i)
            continue
        i += 1
    return items

z = remove_first_duplicate_elements_duplicates(x)
print(z)
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 3, 2]
wintry zodiac
#

i would loop through the list check if the element is the first duplicate by seeing if it is in the list splice from current index

errant lark
#

wouldn't it be easier to just use a set and add to it as you go over the list and check if the current item is not in the set or sth

#

you're making a bunch of copies of the list now tho

#

items[0:i]

weary wing
#

hi guys 😍

errant lark
#

👍

#

lol

#

I mean, you could always time both methods

#

oh, pff, alright

fallen topaz
#

!e

x = [
    1, 1, 3, 1, 4, 1, 1, 2, 2
]


def remove_first_duplicate_elements_duplicates(items):
    dup = None
    out = []
    for elem in items:
        if not dup and elem in out:
            dup = elem
        if dup and elem == dup:
            continue
        out.append(elem)
    return out

print(remove_first_duplicate_elements_duplicates(x))
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 3, 4, 2, 2]
errant lark
#

uhh, this has an issue

#

[1, 2, 2, 1]?

fallen topaz
#

!e

x = [
  1, 2, 2, 1
]


dup = None
out = []
for elem in items:
  if not dup and elem in out:
    dup = elem
  if dup and elem == dup:
    continue
  out.append(elem)
print(out)
timid fjordBOT
#

@fallen topaz :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 8, in <module>
003 |     for elem in items:
004 |                 ^^^^^
005 | NameError: name 'items' is not defined. Did you mean: 'iter'?
fallen topaz
#

!e

x = [
  1, 2, 2, 1
]


dup = None
out = []
for elem in x:
  if not dup and elem in out:
    dup = elem
  if dup and elem == dup:
    continue
  out.append(elem)
print(out)
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 1]
errant lark
#

yep, it was mentioned by someone else be4

silver spindle
#

[1, 1, 1, 1, 1, 1]

errant lark
#

setsssss

quartz stag
#

Im trying to get python to return any pixle on the screen that is black. I tried this and mine had to scan each pixle 1 by 1 until it found a black pixel but this took like 10 seconds to find 1. How do I do this so that It can find a pixel in under 1 second

fallen topaz
#

!e

x = [
  1, 1, 1, 1, 1
]


dup = None
out = []
for elem in x:
  if not dup and elem in out:
    dup = elem
  if dup and elem == dup:
    continue
  out.append(elem)
print(out)
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1]
errant lark
#

cuz you need to keep track of everythign

#

setssss

quartz stag
#

!e

print(”hi”)
errant lark
#

unless

#

you use sets

#

wait a sec, this is way more complicated than I thought

#

uhh to avoid [1, 2, 2, 1] in that interpretation of the problem, you gotta like look ahead, that goes to like O(N^2)

wintry zodiac
#

okay im back

#

wait is the runtime essential

#

okay

errant lark
#

I'll speak on Wednesday I think

#

so, what interpretation are we going off of?

wintry zodiac
#

did you get the solution

silver spindle
wintry zodiac
#

@silver spindle did you find a solution to the problem

#

@silver spindle is there a case where it does not work

silver spindle
#

So the output for @dull anvil will look like this:

1 2 2 1 2 1
  ~~^ first duplicate
Out: 1 2 2 1

1 2 2 1 2 1
~~~~~~^ earliest duplicate ordered by first occurence
Out: 2 2 2

1 2 2 1 2 1
  ~~^~~~^ duplicates of the first duplicate
Out: 1 2

1 2 2 1 2 1
~~~~~~^~~~^ duplicates of the earliest duplicate group ordered by first occurence
Out: 1 2

Is this corect?

fallen topaz
#

!e

x = [1, 2, 2, 1, 1, 3, 2]

def remove_duplicates_of_oldest(items):
    tmp = {}
    for i, elem in enumerate(items):
        if elem in items[:i]:
            tmp[elem] = True
        tmp[elem] = False
    tmp, *_ = tmp.keys()
    dup = False
    out = []
    for elem in items:
        if dup and elem == tmp:
            continue
        elif not dup and elem == tmp:
            dup = True
        out.append(elem)
    return out


print(remove_duplicates_of_oldest(x))
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 2, 3, 2]
fallen topaz
#

!e

x = [1, 2, 2, 1, 1, 3, 2]

def remove_duplicates_of_oldest(items):
    tmp = {}
    for i, elem in enumerate(items):
        if elem in items[:i]:
            tmp[elem] = True
        tmp[elem] = False
    tmp, *_ = tmp.keys()
    dup = False
    out = []
    for elem in items:
        if dup and elem == tmp:
            continue
        elif not dup and elem == tmp:
            dup = True
        out.append(elem)
    return out


print(remove_duplicates_of_oldest(x))
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 2, 3, 2]
errant lark
#

Corey Schafer

#

on yt

timid fjordBOT
#

A series of statements which returns some value to a caller. It can also be passed zero or more arguments which may be used in the execution of the body. See also parameter, method, and the Function definitions section.

errant lark
#

uhhh

#

skill issue

#

cuz one's like regular normal font, the other's monospaced?

hollow trench
#

i think

fallen topaz
#

!e

items = [1, 2, 2, 1, 1, 3, 2]

tmp = {}
for i, elem in enumerate(items):
    if elem in items[:i]:
        tmp[elem] = True
    tmp[elem] = False
tmp, *_ = tmp.keys()
dup = False
out = []
for elem in items:
    if dup and elem == tmp:
        continue
    elif not dup and elem == tmp:
        dup = True
    out.append(elem)

print(out)
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 2, 3, 2]
wintry zodiac
#

list = [1, 2, 2, 1, 2, 1]

first_duplicate = None
first_duplicate_index = None
#finds duplicate and index of duplicate
for index, element in enumerate(list):
if element in list[index:]:
first_duplicate = element
first_duplicate_index = index
break

#remove all duplicate except first one
for index, element in enumerate(list):
if first_duplicate_index != index and element == first_duplicate:
list.pop(index)

print(list)

#

oh i thought thats what we are looking for

fallen topaz
#

!e

list = [1, 2, 2, 1, 2, 1]

first_duplicate = None
first_duplicate_index = None
#finds duplicate and index of duplicate 
for index, element in enumerate(list):
    if element in list[index:]:
        first_duplicate = element
        first_duplicate_index = index
        break

#remove all duplicate except first one
for index, element in enumerate(list):
    if first_duplicate_index != index and element == first_duplicate:
        list.pop(index)

print(list)
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 2, 2]
errant lark
#

noooo, not a built-in function name as a variable

wintry zodiac
#

wait so is mine tight?

#

im so confuse

#

@fallen topaz

#

okay thank you for the verification

#

wait

#

@silver spindle wait

#

let me give you a hint on how to solve it another way

#

@silver spindle

#

@silver spindle So try splice the list into two list remove all the duplicates from one of the splice list then merging them together. havn't tried it yet but i think it will work.

fallen topaz
#
>>> 
silver spindle
#
>>> 
hollow trench
#
>>> 
weary wing
#

bye!! @silver spindle

timid fjordBOT
#

@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.

[3, 1, 2, 2]
weary wing
#

i enjoyed hearing you talk

#

i learned a lot

wintry zodiac
#

@fallen topaz @dull anvil
here another solution visually:
[1,2,2,3,1] =(splice into two list)=> [1] , [2,2,3,1] =(remove duplicate in one list)=> [1],[2,2,3] =(merge)=> [1,2,2,3]

weary wing
#

that guy was really nice

fallen topaz
hollow trench
#
import requests
from bs4 import BeautifulSoup

r = requests.get("https://vipstream.tv/tv/watch-breaking-bad-full-39506")
soup = BeautifulSoup(r.text, "html.parser")

def get_description():
    element_div = soup.find("div", {"class": "description"})
    description = element_div.text.strip()
    return description

def get_genre():
    elements_div = soup.find_all('div', {"class": "row-line"})
    elements = [element.text.strip() for element in elements_div]
    duration_str = [e for e in elements if "Duration" in e][0].replace("Duration:", "").strip()
    duration = int(duration_str.split(" ")[0])
    elements = [e for e in elements if "Duration" not in e]
    elements = [e.strip() for e in elements]
    casts = [c.strip() for c in elements[2].replace('Casts:', '').split(',')]
    return elements[:2] + [casts] + elements[3:], duration

def get_image():
    image = soup.find('img', {'class': 'film-poster-img'})
    return image['src']

def main():
    description = get_description()
    genre_list, duration = get_genre()
    image_link = get_image()

    show_data = {
        "image": image_link,
        "description": description,
        "release-date": genre_list[0].replace("Released:  ", ""),
        "casts": genre_list[2],
        "duration": duration,
        "country": genre_list[3].replace("\n", "").replace("Country: ","").strip()
    }
    print(show_data)

if __name__ == "__main__":
    main()
weary wing
#

that's scary

errant lark
#

why so many list comps?

weary wing
#
if keyauthapp.checkblacklist():
    print(Fore.RED + " You are blacklisted from our system." + Fore.RESET)
    for i in range(10, 0, -1):
        print(f"{Fore.GREEN} T-Minus: {Fore.RED} {i} {Fore.WHITE} seconds until self-destruction")
        time.sleep(1)
    print('''
         _____ _______ _____ _    _ 
        |  _ \_   _|__   __/ ____| |  | |
        | |_) || |    | | | |    | |__| |
        |  _ < | |    | | | |    |  __  |
        | |_) || |_   | | | |____| |  | |
        |____/_____|  |_|  \_____|_|  |_|
    ''')
    time.sleep(3)
    quit()

😩

#

LMAO

#

i love being immature in my code

#

LMAO

errant lark
#

bruh, so many for e in elements repeated unnecessarily

timid fjordBOT
#

@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 3, 2, 3, 3]
weary wing
#

!e

for i in range(10, 0, -1):
        print(f"T-Minus: {i} seconds until self-destruction")
        time.sleep(1)
    print('''
         _____ _______ _____ _    _ 
        |  _ \_   _|__   __/ ____| |  | |
        | |_) || |    | | | |    | |__| |
        |  _ < | |    | | | |    |  __  |
        | |_) || |_   | | | |____| |  | |
        |____/_____|  |_|  \_____|_|  |_|
    ''')
    time.sleep(3)
#

🙄

fallen topaz
#

!e

x = [1, 2, 2, 1, 1, 3, 2]

def remove_duplicates_of_oldest(items):
    tmp = {}
    for i, elem in enumerate(items):
        if elem in items[:i]:
            tmp[elem] = True
        tmp[elem] = False
    tmp, *_ = tmp.keys()
    dup = False
    out = []
    for elem in items:
        if dup and elem == tmp:
            continue
        elif not dup and elem == tmp:
            dup = True
        out.append(elem)
    return out


print(remove_duplicates_of_oldest(x))
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 2, 3, 2]
hollow trench
#

some slight changes

for i in range(10, 0, -1):
        print(f"T-Minus: {i} seconds until self-destruction");
        time.sleep(1);
    print('''
         _____ _______ _____ _    _ 
        |  _ \_   _|__   __/ ____| |  | |
        | |_) || |    | | | |    | |__| |
        |  _ < | |    | | | |    |  __  |
        | |_) || |_   | | | |____| |  | |
        |____/_____|  |_|  \_____|_|  |_|
    ''');
    time.sleep(3);
fallen topaz
#

!e

x = [1, 2, 2, 3, 2, 3, 3]

def remove_duplicates_of_oldest(items):
    tmp = {}
    for i, elem in enumerate(items):
        if elem in items[:i]:
            tmp[elem] = True
        tmp[elem] = False
    tmp, *_ = [x if x for x in tmp.keys()]
    dup = False
    out = []
    for elem in items:
        if dup and elem == tmp:
            continue
        elif not dup and elem == tmp:
            dup = True
        out.append(elem)
    return out


print(remove_duplicates_of_oldest(x))
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 2, 3, 2, 3, 3]
wintry zodiac
#

@dull anvil oops i had a index off when splicing

wintry zodiac
#

@dull anvil
here it is with the correction:
list = [1,2,3,2,3,3]

first_duplicate = None
first_duplicate_index = None
#finds duplicate and index of duplicate
for index, element in enumerate(list):
if element in list[index-1:]:
first_duplicate = element
first_duplicate_index = index
break

#remove all duplicate except first one
for index, element in enumerate(list):
if first_duplicate_index != index and element == first_duplicate:
list.pop(index)

print(list)

hollow trench
fallen topaz
#

!e

x = [1, 2, 2, 3, 2, 3, 3]

def remove_duplicates_of_oldest(items):
    tmp = {}
    for i, elem in enumerate(items):
        if elem in items[:i]:
            tmp[elem] = True
        tmp[elem] = False
    tmp, *_ = [x if x for x in tmp.keys()]
    dup = False
    out = []
    for elem in items:
        if dup and elem == tmp:
            continue
        elif not dup and elem == tmp:
            dup = True
        out.append(elem)
    return out


print(remove_duplicates_of_oldest(x))
timid fjordBOT
#

@fallen topaz :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 9
002 |     tmp, *_ = [x if x for x in tmp.keys()]
003 |                ^^^^^^
004 | SyntaxError: expected 'else' after 'if' expression
weary wing
#

ahh semicolons

fallen topaz
#

!e

x = [1, 2, 2, 3, 2, 3, 3]

def remove_duplicates_of_oldest(items):
    tmp = {}
    for i, elem in enumerate(items):
        if elem in items[:i]:
            tmp[elem] = True
        tmp[elem] = False
    tmp, *_ = [x for x in tmp.keys() if x]
    dup = False
    out = []
    for elem in items:
        if dup and elem == tmp:
            continue
        elif not dup and elem == tmp:
            dup = True
        out.append(elem)
    return out


print(remove_duplicates_of_oldest(x))
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

[1, 2, 2, 3, 2, 3, 3]
weary wing
#

python doesn't need semilcolons tho?

#

!e

for i in range(10, 0, -1):
        print(f"T-Minus: {i} seconds until self-destruction");
        time.sleep(1);
    print('''
         _____ _______ _____ _    _ 
        |  _ \_   _|__   __/ ____| |  | |
        | |_) || |    | | | |    | |__| |
        |  _ < | |    | | | |    |  __  |
        | |_) || |_   | | | |____| |  | |
        |____/_____|  |_|  \_____|_|  |_|
    ''');
    time.sleep(3);
timid fjordBOT
#

@weary wing :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 4
002 |     print('''
003 |              ^
004 | IndentationError: unindent does not match any outer indentation level
hollow trench
weary wing
#

!e

for i in range(10, 0, -1):
        print(f"T-Minus: {i} seconds until self-destruction");
        time.sleep(1);
    print("bitch");
    time.sleep(3);
timid fjordBOT
#

@weary wing :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 4
002 |     print("bitch");
003 |                    ^
004 | IndentationError: unindent does not match any outer indentation level
fallen topaz
#

!e

x = [1, 2, 2, 3, 2, 3, 3]

def remove_duplicates_of_oldest(items):
    tmp = {}
    for i, elem in enumerate(items):
        if elem in items[:i]:
            tmp[elem] = True
        tmp[elem] = False
    tmp, *_ = [k for k, v in tmp.items() if v]
    dup = False
    out = []
    for elem in items:
        if dup and elem == tmp:
            continue
        elif not dup and elem == tmp:
            dup = True
        out.append(elem)
    return out


print(remove_duplicates_of_oldest(x))
timid fjordBOT
#

@fallen topaz :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 21, in <module>
003 |     print(remove_duplicates_of_oldest(x))
004 |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 |   File "/home/main.py", line 9, in remove_duplicates_of_oldest
006 |     tmp, *_ = [k for k, v in tmp.items() if v]
007 |     ^^^^^^^
008 | ValueError: not enough values to unpack (expected at least 1, got 0)
weary wing
#

excellent feedback, duke

fallen topaz
#

!e

x = [1, 2, 2, 3, 2, 3, 3]

def remove_duplicates_of_oldest(items):
    tmp = {}
    for i, elem in enumerate(items):
        if elem in items[:i]:
            tmp[elem] = True
        tmp[elem] = False
    tmp = [k for k, v in tmp if v][0] or None
    dup = False
    out = []
    for elem in items:
        if dup and elem == tmp:
            continue
        elif not dup and elem == tmp:
            dup = True
        out.append(elem)
    return out


print(remove_duplicates_of_oldest(x))
errant lark
#
def solve(items):
    unique = None
    result = []
    for idx, item in enumerate(items):
        if unique is None:
            if item in items[idx + 1:]:
                unique = item
        elif unique == item:
            continue
        result.append(item)

    return result
timid fjordBOT
#

@fallen topaz :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 21, in <module>
003 |     print(remove_duplicates_of_oldest(x))
004 |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 |   File "/home/main.py", line 9, in remove_duplicates_of_oldest
006 |     tmp = [k for k, v in tmp if v][0]
007 |           ^^^^^^^^^^^^^^^^^^^^^^^^
008 |   File "/home/main.py", line 9, in <listcomp>
009 |     tmp = [k for k, v in tmp if v][0]
010 |                  ^^^^
011 | TypeError: cannot unpack non-iterable int object
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/osugixegav.txt?noredirect

errant lark
#

how do you want to unpack it?

timid fjordBOT
#

items()```
Return a new view of the dictionary’s items (`(key, value)` pairs). See the [documentation of view objects](https://docs.python.org/3/library/stdtypes.html#dict-views).
errant lark
#

!e

def solve(items):
    unique = None
    result = []
    for idx, item in enumerate(items):
        if unique is None:
            if item in items[idx + 1:]:
                unique = item
        elif unique == item:
            continue
        result.append(item)

    return result


print(solve([1, 2, 2, 1]))
print(solve([1, 2, 2, 3, 2, 3, 3]))
timid fjordBOT
#

@errant lark :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | [1, 2, 2]
002 | [1, 2, 3, 3, 3]
errant lark
#

is this the right interpret?

timid fjordBOT
#

@fallen topaz :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 21, in <module>
003 |     print(remove_duplicates_of_oldest(x))
004 |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 |   File "/home/main.py", line 9, in remove_duplicates_of_oldest
006 |     tmp = [k for k, v in tmp if v][0] or None
007 |           ^^^^^^^^^^^^^^^^^^^^^^^^
008 |   File "/home/main.py", line 9, in <listcomp>
009 |     tmp = [k for k, v in tmp if v][0] or None
010 |                  ^^^^
011 | TypeError: cannot unpack non-iterable int object
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/ubuyazukid.txt?noredirect

errant lark
#

why do I gotta wait so loooong for voice verif

#

scam

#

I have been here before, for way longer, why don't they just keep a huge database of all that jazz

fallen topaz
#

!voice

timid fjordBOT
#
Voice verification

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

hollow trench
#

I saw that

errant lark
#

I wanna speaaaaak

weary wing
#

boom

#

live coding

errant lark
#

Shrek being compressed into a single gif...

weary wing
#

^

weary wing
#

yk what

#

im gonna do it

#

right now

#

were you guys using code to remove duplicates out of a string?

errant lark
#

N * logN

#

or + ?

#

meh

#

time to learn them

#

just graph them graphs

hollow trench
errant lark
#

sin, cos, tan: they're coefficients between lengths of certain sides (basically)

#

^^^

#

@fallen topaz

#

log is the inverse of exponent

timid fjordBOT
#

@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.

11.0
errant lark
#

wut, why does log default to base e?

#

and not like 10

timid fjordBOT
#

@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 2.7169239322355936
002 | 2.718281828459045
errant lark
#

that's the only definition of ln

#

I was asking about log

#

and why math.log has base e?

#

who does that

#

well, that's silly

#

natural logarithm

#

base e

#

meh, calculators on mobile say otherwise...

#

13???

#

you sound like 30

#

or sth

#

tbf idk what 30 sounds like

#

do I?

#

I need sleep, talk to ya on Wednesday (when the dang 3 day requirement is met...)

timid fjordBOT
timid fjordBOT
#

Hey @weary wing!

It looks like you tried to attach file type(s) that we do not allow (.m4v). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

hybrid dagger
#

anyone use react here

#

?

errant lark
#

sir, this is a python's

hybrid dagger
#

ok

calm bay
#

no idea I don't use jetbrains or rust that often

#

don't even know what rust-project.json is

primal bison
#

^ she seems like a nice person, right? WRONG!

pastel gazelle
errant lark
#

!e
java-like entry point go brrrt

class EntryPoint(type):
    def __init__(self, *args):
        self.main()


class Main(metaclass=EntryPoint):
    @staticmethod
    def main():
        print("entry point")
timid fjordBOT
#

@errant lark :white_check_mark: Your 3.11 eval job has completed with return code 0.

entry point
pastel gazelle
pastel gazelle
pastel gazelle
full heart
#

hi

timid fjordBOT
#

class io.StringIO(initial_value='', newline='\n')```
A text stream using an in-memory text buffer. It inherits [`TextIOBase`](https://docs.python.org/3/library/io.html#io.TextIOBase "io.TextIOBase").

The text buffer is discarded when the [`close()`](https://docs.python.org/3/library/io.html#io.IOBase.close "io.IOBase.close") method is called.

The initial value of the buffer can be set by providing *initial\_value*. If newline translation is enabled, newlines will be encoded as if by [`write()`](https://docs.python.org/3/library/io.html#io.TextIOBase.write "io.TextIOBase.write"). The stream is positioned at the start of the buffer which emulates opening an existing file in a `w+` mode, making it ready for an immediate write from the beginning or for a write that would overwrite the initial value. To emulate opening a file in an `a+` mode ready for appending, use `f.seek(0, io.SEEK_END)` to reposition the stream at the end of the buffer.
#

class io.BytesIO(initial_bytes=b'')```
A binary stream using an in-memory bytes buffer. It inherits [`BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase "io.BufferedIOBase"). The buffer is discarded when the [`close()`](https://docs.python.org/3/library/io.html#io.IOBase.close "io.IOBase.close") method is called.

The optional argument *initial\_bytes* is a [bytes-like object](https://docs.python.org/3/glossary.html#term-bytes-like-object) that contains initial data.

[`BytesIO`](https://docs.python.org/3/library/io.html#io.BytesIO "io.BytesIO") provides or overrides these methods in addition to those from [`BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase "io.BufferedIOBase") and [`IOBase`](https://docs.python.org/3/library/io.html#io.IOBase "io.IOBase"):
timid fjordBOT
#

@dull anvil :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 2, in <module>
003 |     BytesIO().fileno()
004 | io.UnsupportedOperation: fileno
pallid bison
#

hello

timid fjordBOT
#

shlex.split(s, comments=False, posix=True)```
Split the string *s* using shell-like syntax. If *comments* is [`False`](https://docs.python.org/3/library/constants.html#False "False") (the default), the parsing of comments in the given string will be disabled (setting the [`commenters`](https://docs.python.org/3/library/shlex.html#shlex.shlex.commenters "shlex.shlex.commenters") attribute of the [`shlex`](https://docs.python.org/3/library/shlex.html#shlex.shlex "shlex.shlex") instance to the empty string). This function operates in POSIX mode by default, but uses non-POSIX mode if the *posix* argument is false.

Note

Since the [`split()`](https://docs.python.org/3/library/shlex.html#shlex.split "shlex.split") function instantiates a [`shlex`](https://docs.python.org/3/library/shlex.html#shlex.shlex "shlex.shlex") instance, passing `None` for *s* will read the string to split from standard input.

Deprecated since version 3.9: Passing `None` for *s* will raise an exception in future Python versions.
pallid bison
#

why cant?

#

teach me please

errant lark
#

haven't installed it

pallid bison
#

Python?

errant lark
#

you have not installed that module in your environment

pallid bison
#

what do you mean…..

errant lark
#

did you pip install discord or whatever its pypi name is

short depot
#

@keen radish bash is still very powerful for some applications. Python is not always the answer.

pallid bison
stone atlas
#

How do you become voice verified?

short depot
#

@calm bay Don't have mic verify yet, but I was curious.. I saw some of your code, but perhaps you could explain the use case for Threading? I am wanting to learn more about that and how it works with your code.

stone atlas
#

How do you become worthy?

timid fjordBOT
#
Voice verification

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

stone atlas
#

Oh okay

#

Thanks!

#

Just 45 messages to go then xD

errant lark
#

mostly I/O ops

#

waiting for user input and such too

errant lark
# pallid bison to the terminal?

I'd suggest you start with some basic Python tutorial and a tutorial for that library, it should cover how to install the module too

raven spade
#

who is learning python still?

keen radish
#

os.sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(file))))

#

@fallen topaz

timid fjordBOT
#

New in version 3.4.

Source code: Lib/pathlib.py

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.

../_images/pathlib-inheritance.png 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:

calm bay
#

Yu, what's the whole PerLined thing about?

#

like I get that it's to do with processing data per-line but why is it a separate thing?

#

is it possible to implement say, sort in python?

#

how would I do it in your framework

calm bay
#

fair enough

#

I'm still a little confused by your "bind" and "wrap" terminology

#

I like my use of generators

@PythonCommand
def cat(inp):
    for line in inp:
        yield line

@PythonCommand
def sort(inp):
    return sorted(inp)
#

better ways to do this ofc

#

yield from inp i guess for cat()

#

overthinking 101,

@PythonCommand
def cat(inp): return inp
keen radish
calm bay
#

yeah definitely better to cat but proof of concept

calm bay
#

I'd write this off as user error

#

fair enough

#
pipeline = Pipeline() | 'nl' | sorted | head(n=10) < 'test.py' > 'out.txt'
pipeline.run()
#

pretty happy with this tbh

#

actually kinda considering not using |

#
pipeline = Pipeline() > 'nl' > sorted > head(n=10) >= func_that_works_on_one_line
pipeline.run()
#

instead of the consumes_entire_stream thing, nice syntax sugar

#

wait does that even work

#

or is the precedence fucky

#

would have worked in aecor

#

how sad

#

maybe / and //

#

ew

#

I much prefer / and // over that

ivory marten
#

@atomic phoenix which language are you coding in

#

yup

#

sry

#

one of them happened just now

#

@atomic phoenix which language are you coding in?

final grail
young frost
#

strings = ["Hello", "world"]
numbers = [1, 2, 3, 4, 5]
data = ["hello", 1]

print(strings)
print(numbers)
print(data)

summa = numbers + data
print(summa)

numbers.append(6)
print(numbers)

first = strings[0]
second = strings[1]
print(first)
print(second)

strings_length = len(strings)
print(strings_length)

s = sum(numbers)
print(s)

midnight jay
#

!voice

timid fjordBOT
#
Voice verification

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

summer mica
#

import os
import discord
from dotenv import load_dotenv

load_dotenv()
TOKEN = os.getenv('')

client = discord.Client()

@client.event
async def on_ready():
print(f'{client.user} has connected to Discord!')

@client.event
async def on_message(message):
if message.author == client.user:
return

if message.content.startswith('!hello'):
    await message.channel.send('Hello!')

if message.content.startswith('!giveaway'):
    await message.channel.send('React with 🎉 to participate in the giveaway!')
    await message.add_reaction('🎉')

if message.content.startswith('!kick'):
    if message.author.guild_permissions.administrator:
        try:
            user = message.mentions[0]
            await user.kick()
            await message.channel.send(f'{user.mention} has been kicked from the server.')
        except:
            await message.channel.send('Please mention the user you want to kick.')
    else:
        await message.channel.send('You do not have permission to use this command.')

client.run()

#

pls help

primal bison
ivory marten
#

hello @viral shuttle

viral shuttle
#

hi

#

wats up

#

@ivory marten

ivory marten
#

doing great

#

how about you

viral shuttle
#

i am bored and need something to contribute

ivory marten
#

hello @dull anvil

copper cloud
#

@timid isle Do you need help?

primal bison
warm mango
#

just messing around with some, ProcessPool, ThreadingPool, and Async combinations

warm mango
#

kk, done testing.. processpool with threading knocked the doors off async, by 1000x or something.. was nice ...

stoic yew
#

So ProcessPool is faster than Async in general?

warm mango
#

combos.. I was using ProcessPool to run ThreadPools.. was the fastest.. my testing was only 7 processpools each with 20-100threads..
which beat standalone async, Processpools with async, Threadpools with async, and process pools with threadpools each running async.

stoic yew
#

hmm, I gotta learn what all of these pools mean because I don't know the difference.

warm mango
#

process pools for cpu stuff, thread pools for I/O stuff... that's what they say in the docs and stuff.. but if I really want to open something up, I'll throw threadpools into many processpools ...
but really all comes down to how and what you can do with the data you got.

stoic yew
#

Oh, so you put things into pools to get the program to run faster?

warm mango
#

in a way, you have to have more then 1 thing to run.. I'd say a lot of things otherwise the buildup and teardown isnt worth the cost in time&resources.

frigid geyser
frigid geyser
#

if you want to use !

ornate rampart
#
def resolve_sphere_collision(
    pos, vel, collision_indices, collision_count
    ):

    for i in range(collision_count):

        x_a = pos[2 * collision_indices[2 * i]]
        y_a = pos[2 * collision_indices[2 * i] + 1]
        x_b = pos[2 * collision_indices[2 * i + 1]]
        y_b = pos[2 * collision_indices[2 * i + 1] + 1]

        vx_a = vel[2 * collision_indices[2 * i]]
        vy_a = vel[2 * collision_indices[2 * i] + 1]
        vx_b = vel[2 * collision_indices[2 * i + 1]]
        vy_b = vel[2 * collision_indices[2 * i + 1] + 1]

        disp_a_to_b = np.array([x_b - x_a, y_b - y_a, 0.0], dtype=np.float32)
        vel_a = np.array([vx_a, vy_a, 0.0], dtype=np.float32)
        vel_b = np.array([vx_b, vy_b, 0.0], dtype=np.float32)
        temp_result = np.zeros(3, np.float32)

        new_vx_a = vx_a
        new_vy_a = vy_a
        project_u_on_v(u=vel_b, v=disp_a_to_b, w=temp_result)
        new_vx_a += temp_result[0]
        new_vy_a += temp_result[1]
        project_u_on_v(u=vel_a, v=-disp_a_to_b, w=temp_result)
        new_vx_a -= temp_result[0]
        new_vy_a -= temp_result[1]

        new_vx_b = vx_b
        new_vy_b = vy_b
        project_u_on_v(u=vel_a, v=disp_a_to_b, w=temp_result)
        new_vx_b += temp_result[0]
        new_vy_b += temp_result[1]
        project_u_on_v(u=vel_b, v=-disp_a_to_b, w=temp_result)
        new_vx_b -= temp_result[0]
        new_vy_b -= temp_result[1]
#

a > B

#

the answer is 9

timid fjordBOT
#

typing.Self```
Special type to represent the current enclosed class. For example:

```py
from typing import Self

class Foo:
   def return_self(self) -> Self:
      ...
      return self
```  This annotation is semantically equivalent to the following, albeit in a more succinct fashion...
ornate rampart
#
class TokenType(Enum):

    end_of_file = auto()

    open_paren = auto()
    closed_paren = auto()
    open_bracket = auto()
    closed_bracket = auto()
    open_brace = auto()
    closed_brace = auto()

    binary_op = auto()
fallen topaz
#
class TokenKind(Enum):
    # Literals
    StringLiteral = auto()
    IntegerLiteral = auto()
    FloatLiteral = auto()
    BooleanLiteral = auto()
    NullLiteral = auto()

    # Identifiers
    Identifier = auto()

    # Operators
    Plus = auto()
    PlusPlus = auto()
    Minus = auto()
    MinusMinus = auto()
    Multiply = auto()
    Power = auto()
    Divide = auto()
    FloorDivide = auto()
    Mod = auto()
    Equal = auto()
    PlusEqual = auto()
    MinusEqual = auto()
    MultiplyEqual = auto()
    DivideEqual = auto()
    ModEqual = auto()

    # Comparison
    EqualEqual = auto()
    Not = auto()
    NotEqual = auto()
    Greater = auto()
    GreaterEqual = auto()
    Less = auto()
    LessEqual = auto()
    And = auto()
    Or = auto()
    In = auto()

    # Delimiters
    LeftParen = auto()
    RightParen = auto()
    LeftBrace = auto()
    RightBrace = auto()
    LeftBracket = auto()
    RightBracket = auto()
    Semicolon = auto()
    Colon = auto()
    Comma = auto()

    # Statements
    Import = auto()
    Return = auto()
    Break = auto()
    Let = auto()
    Fn = auto()
    For = auto()

    # Blocks
    If = auto()
    Elif = auto()
    Else = auto()
    While = auto()

    # EOF
    EOF = auto()
ornate rampart
#

!e```py

def name(name: str):
print(name)

name(1)

timid fjordBOT
#

@ornate rampart :white_check_mark: Your 3.11 eval job has completed with return code 0.

1
fallen topaz
#

!e

print("hello world"[0])
timid fjordBOT
#

@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.

h
fallen topaz
#

Hello and welcome to the first episode on how to create your VERY OWN programming language in Python.

We will be using Python3 in this series, but feel free to follow along with any other language. The language that we will be creating will be our own implementation of BASIC.

In the first three videos we will be focusing on adding numbers and ...

▶ Play video
ornate rampart
#
def advance(self):
        self.pos += 1
        self.current_char = self.text[pos] if self.pos < len(self.text) else None

"pos" is not defined
#
class Lexer:
    def __init__(self, text) -> None:
        self.text = text
        self.pos = -1
        self.current_char = None
        self.advance()

    def advance(self):
        self.pos += 1
        self.current_char = self.text[pos] if self.pos < len(self.text) else None
fallen topaz
#

RIP Yu 😭

ornate rampart
#

    def make_tokens(self):
        tokens = []

        while self.current_char != None:
            if self.current_char in '\t':
                self.advance()
            elif self.current_char == '+':
                tokens.append(Token(TokenKind.op_plus.name, TokenKind.op_plus.value))
fallen topaz
#
match self.current_char:
  case char if char.isalpha():
    pass
  case "+":
    pass
  case "-":
    pass
soft cove
#

hey guys do you happen to know why my drawing isn't being filled in completely?

#

I've been stuck on this for hours

#

what does that mean? I'm sorry I'm new at this

#

and how can i fix it

#

could it be because i didn't go all the way around but instead used setpos() and mirrored the other side

ornate rampart
#

match command:
  case Command(command = 'quit' | 'exit' | 'bye'):
    print('quitting')
    quit()
  case Command(command = 'quit' | 'exit' | 'bye', arguments=['--force', '-f', *rest]):
    print('quitting with force')
    quit()


#passing command 'quit' and command 'quit --force' go to the first case automaticly since the second command also matches the first case


soft cove
#

I'm so stuck guys 😦

#

without setpos() to mirror the other side of the wing idk how to reverse the code to go all the way around from top to bottom and then back to top

jovial arrow
#

Anyone knows which line numbers contain errors?

#

I know is 3, 10 but that's not enough?

#

but they only asked to choose which line numbers contain errors

#

so we not suppose to change anything here

#

practice

#

quiz

#

the line numbers at the left side...

jovial arrow
#

I got the answer is 3, 5, 10

#

Solved it myself in the end

#

thanks

ivory marten
#

hello @formal hearth and @spiral plover

ivory marten
#

hello @fervent mica

fervent mica
#

how do i end a while loop?

#

thanks

ivory marten
#

hello @dull anvil

#

how are you doing

#

@fallen topaz

#

yup

#

i have used it

#

window container

#

for elementor

#

yup

#

where were you

#

virtual machine

ivory marten
#

just wanted you to tell a thing @buoyant kestrel

#

you have a great sense of humour
I like it very much

ivory marten
#

hello @dull anvil ready for some clash of code

#

no problem

#

busy or what

high zephyr
#

hello af , opal , hem, magicalgirl

high zephyr
#

not sure what "their is paid too" means but docker over ssh is free

#

huh why didnt it delete the message. i figured afterr by "their" you mean jetbrains

#

forgive me

trim phoenix
#

Hello everyone!
Can you recommend some use case of Chat-GPT and Python?

idle urchin
lofty sedge
#

@sturdy geyser what is the purpose of this program?

sturdy geyser
#

it's for my cs class

hardy charm
#

I have GPT 4

#

It's pretty fucking good lol

buoyant dust
#

Hi Folks, Can anyone help with few projects for someone beginning with python

paper escarp
#

What are you working on @little sierra I'm also working on some stuff maybe we work tg if its similar

primal bison
#

hi

bronze night
#

Hey how do you get stream verified

#

@wide aurora

#

Are you talking about TeamBlind the jobs platform

#

a user with a what?

deep tangle
#

Hello

stray flare
#

guys wt are u taliking

#

about]

buoyant kestrel
#

Data sciency things

#

I'm trying to understand enough to help

stray flare
#

i need help in back end can i join u

#

if u can help me

buoyant kestrel
#

I'll have to be right back

stray flare
#

k

buoyant kestrel
#

What's your question about?

viral shuttle
#

@placid cypress can you please give me Video role?

placid cypress
viral shuttle
#

@hollow swan can you please give me video role?

obsidian pendant
#

how can i customize the style in mpl finance

#

the thing is that the mpl finance has a set of default styles

timid fjordBOT
raven mulch
#

q12q3

primal bison
#

@buoyant kestrel Do you know how can i see how many users using my telegram bot?

sweet charm
#

progress so far

twilit quarry
#

hey guys i need help with using the github, I want to clone the repository but it has to end up in my favorite IDE please help 😦

primal bison
twilit quarry
#

yes

torpid quest
#

Hello

primal bison
#

Hello @torpid quest

torpid quest
#

Hi @primal bison . It's a pleasure be here ^^

#

I am a python noob, so I have a lot of troubles hehe

static escarp
#

Hi can I ask a q here please

#

Anyone know why there's an error here

bold gate
#

sup

#

i cant speak

#

no access

gusty shoal
#

does anyone here ever created a P2P network using python ?

turbid charm
#

Who can help me install the discourse forum on digital ocean?

static escarp
#

what is that

outer burrow
#

!voice

timid fjordBOT
#
Voice verification

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

manic tiger
royal heart
#

coursera has a ton of stuff - cool

rough schooner
#

mic permission @pliant prairie

timid fjordBOT
#
Voice verification

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

jaunty scarab
#

this is scary but so mezmerising

manic gate
#

!voice

timid fjordBOT
#
Voice verification

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

humble hinge
#

Hello

cyan flint
#

yo

humble hinge
#

How y a Doing Darth ?

potent wharf
hard mauve
#

hello

ebon wasp
#

Hi

#

Join the python chat

#

we

#

were in here

#

me and the gofek

cyan flint
#

!resources

timid fjordBOT
#
Resources

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

primal bison
#

!voice

timid fjordBOT
#
Voice verification

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

dreamy basin
peak lion
#
path = "D:/"
for file in os.list_dir(path):
  image = cv2.imread(os.path.join(path, file))
#

import os

#

os.listdir()

dreamy basin
#

path = "D:/SEGMENTATION/healthy"
for file in os.list_dir(path):
image = cv2.imread(os.path.join(path, file))
image_array = np.array(image)
healthy = file.replace('.jpg', '.npy')
np.save(healthy1, image_array)

peak lion
#
path = "D:/SEGMENTATION/healthy"
for file in os.listdir(path):
    image = cv2.imread(os.path.join(path, file))
    image_array = np.array(image)
    healthy = file.replace('.jpg', '.npy')
    np.save(healthy1, image_array)
dreamy basin
#

thanks yibtag, i got it from there

bitter rune
#

Hi, I’ve been researching SIEMS (Security Information & Event Management Systems) and have to design and implement code cable of performing basic log management, like displaying network system or user logs in real time, etc., possibly analyze the results as well, all by 11:59 pm tonight, April 17th.

Other than the short timeframe, my problem is that while I’ve done enough research to gain a basic understanding of SIEMS, I have no background in coding except for a few basic Python, Pycharm, or Googlecolab exercises and tutorials in the past. I am exploring GitHub and Stackoverflow, trying to find source code, or anything to help with the design and implementation of my code.

Anyone have any suggestions or recommendations on how I can quickly navigate and move forward with the above, spending as little time as possible with fixing errors?

crystal nymph
#

@fallen topaz Hey im not sure if you've gave an update since i've joined my mic audio was deafened. can u explain whats happening here im sorta new to coding

#

very cool ty

sleek dune
#

@buoyant kestrel Hi can I stream on the server for learning purpose

keen venture
#

Yes

ivory marten
#

Hello @tight zinc , @tiny carbon , @wary vortex

#

hello @primal bison

primal bison
#

Yes

wary vortex
#

hi

#

@ivory marten do you think you could me with my code

ivory marten
#

maybe maybe

#

what is the problem

wary vortex
#

if you look at the chatbot post in python help that one is mine

#

i have to make a function called game() which i have i just need help with making the code inside the function

#

do you see it

ivory marten
#

hello @half hare

#

how are you doing

#

doing good

#

working on somethin

half hare
#

yes

ivory marten
#

what

#

you can talk I can hear you

#

keep working

tiny carbon
#

@crude iris hello there!

#

@vague cliff hello tere!

vague cliff
#

What r u doing bro!

tiny carbon
#

me is coding rn

#

i have just pinged u bcaz

vague cliff
tiny carbon
#

i need some help with my code

#

will be able to?

vague cliff
tiny carbon
#

i am working on a mutiple object detedction in real time projcet

#

can help me?

tiny carbon
#

cv2 , tf, keras

vague cliff
tiny carbon
#

oh np

vague cliff
crude iris
sly gulch
#

**Quick Survey ** Most of us have completed "basics level" classes from various online platforms. Some of us still feel the need to practice to become more proficient. What do you use as the best source for practicing python projects?

zenith shadow
#
while True:
  print('omk 97ba')
ocean osprey
ivory marten
#

@sharp summit hello

#

how are you doing

sharp summit
#

hi

#

not so well, am struggling on a piece of code i've been looking at too long

ivory marten
#

hello @earnest finch

#

sorry did not get that

#

can you please repeat

dusty glen
#

print(boobies)

#
print("boobies are the best")

twilit quarry
#

in your code you're a legend ;D @dusty glen

pulsar sun
#

Why i cant speak?

#

@shadow ivy

twilit quarry
#

you gotta keep texting for 50 message within 30 mins

pulsar sun
#

reallyy 😄

#

LMAO why

twilit quarry
#

im not joking when i am saying this

gritty sandal
pulsar sun
#

its will be a spam message

pulsar sun
twilit quarry
#

no like keep talking like this

pulsar sun
#

ahh i see mate

gritty sandal
#

It's voice verification channel or sth. Just look

twilit quarry
#

dont do this: "hey hi bye fly sky"

pulsar sun
#

hahahah okey

#

are you IT guy?

twilit quarry
#

not really just a python noobie

pulsar sun
#

Ah i see

#

I am IT guy 🙂

candid grotto
#

Cool

eternal sandal
timid fjordBOT
#

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

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

tiny carbon
#

A quiz for you guys....

#
        <input id="password">
        <p><button id="go">Log in</button></p>
      </div>
    </div>
    <div class="bottom"><div>Use the panel to log in.</div></div>
  </div>
</body>
<script>
const checkPassword = () => {
  const v = document.getElementById("password").value;
  const p = Array.from(v).map(a => 0xCafe + a.charCodeAt(0));

  if(p[0] === 52037 &&
     p[6] === 52081 &&
     p[5] === 52063 &&
     p[1] === 52077 &&
     p[9] === 52077 &&
     p[10] === 52080 &&
     p[4] === 52046 &&
     p[3] === 52066 &&
     p[8] === 52085 &&
     p[7] === 52081 &&
     p[2] === 52077 &&
     p[11] === 52066) {
    window.location.replace(v + ".html");
  } else {
    alert("Wrong password!");
  }
}

window.addEventListener("DOMContentLoaded", () => {
  document.getElementById("go").addEventListener("click", checkPassword);
  document.getElementById("password").addEventListener("keydown", e => {
    if (e.keyCode === 13) {
      checkPassword();
    }
  });
}, false);
</script>
</html>```
#

this a code snnipet from a html web page

#

find the password

rich blaze
#

can anyone give me the rights to join the sound channel of live-coding-text? Being a starter in this field, I would love to learn how you guys code.

#

@drifting niche

#

@hallow jasper

candid grotto
#

Hi, can you join my server?

ivory marten
#

hello @dense wing

#

how are you doing

dense wing
#

I'm fine,.
and you?

ivory marten
#

doing good

cinder sage
#

Hi

rustic apex
#

That's to check for Enter key 😭

rustic apex
rustic apex
past harness
#

How can I livestream?

primal bison
#

damn

#

that mod look fire

#

does that work

#

with

#

bedrock

#

@@wise lake

#

i actually js started learning python myself like 3 weeks ago its pretty hard 😢

#

java sound boring ngl

#

i have codenation at my school they tryna teach us JS

#

DAMN

#

O oops wrong channel

autumn plinth
ripe ermine
#

I wanna talk too, but I need to send more msgs

autumn plinth
#

Demute me

gloomy lily
wraith eagle
unborn sorrel
#

!stream 313415567354757121

timid fjordBOT
#

✅ @wraith eagle can now stream until <t:1682559693:f>.

unborn sorrel
trail flume
#

I am

#

I mean my guess was the even numbers were the pattern

#

I just came here to learn how to make a auto-clicking bot

wraith eagle
#

In this kata, your task is to create a regular expression capable of evaluating binary strings (strings with only 1s and 0s) and determining whether the given string represents a number divisible by 3.

Take into account that:

An empty string might be evaluated to true (it's not going to be tested, so you don't need to worry about it - unless you want)
The input should consist only of binary digits - no spaces, other digits, alphanumeric characters, etc.
There might be leading 0s.

Examples (Javascript)

multipleof3Regex.test('000') should be true
multipleof3Regex.test('001') should be false
multipleof3Regex.test('011') should be true
multipleof3Regex.test('110') should be true
multipleof3Regex.test(' abc ') should be false

You can check more in the example test cases
Note

There's a way to develop an automata (FSM) that evaluates if strings representing numbers in a given base are divisible by a given number. You might want to check an example of an automata for doing this same particular task here.

If you want to understand better the inner principles behind it, you might want to study how to get the modulo of an arbitrarily large number taking one digit at a time.

trail flume
#

I see one pattern

unborn sorrel
#

1111111111 is divisible by 3

warped saffron
#

Hey, could I have screen share perms? I'd like to show everyone something 🙂 @unborn sorrel

unborn sorrel
warped saffron
#

Np if you don't want to

unborn sorrel
#

Just curious what it is

warped saffron
#

A project to try and simulate electoral voting methods

#

I've just started by working on the classes

unborn sorrel
#

We're just in the middle of solving a coding challenge, maybe if you show it quietly for those interested or wait for the topic to change.

warped saffron
#

No problem, I'll wait

#

But no chance of me solving the coding challenge haha

unborn sorrel
#

^(1(01*0)*1|0)*$

warped saffron
primal bison
#

over time he got better at coding

#

damn @twilit quarry did u take notes on pc or on notebook irl

primal bison
#

which one did u take notes on?

twilit quarry
#

i have some coding examples in my notes on my iphone as of rn

primal bison
#

i js started learning python

twilit quarry
#

really

primal bison
#

yeaa

#

was super hard to look at at first but now i kinda get the gist

#

ive been studying on w2schools .com

twilit quarry
#

oh hell yeah it was extremely hard

primal bison
#
#

this taught me alot mannn

twilit quarry
#

once i got the grasp of input, string, integer, loops

#

everything started to make sense

primal bison
#

okay

#

one question

twilit quarry
#

yes

primal bison
#

how would you know you're ready to make a project

#

like how did u know

twilit quarry
#

i can show you

primal bison
#

how to think of creating something without using youtube tuts

primal bison
#

cant rlly tlk rn kz im nonverified but ill js type here

twilit quarry
#

if someone ask me to create a code that tells you "how old are you" by entering the year of your birth year from this year. and have the code print the result in the terminal

primal bison
#

hmm

#

what about stuff like

#

applications that do that

twilit quarry
primal bison
#

making applications*

#

like a app

twilit quarry
#

hmm

primal bison
#

exe i would say

twilit quarry
#

ohhh thats web development

#

i'm pretty sure

primal bison
#

can python do that?

#

i mean like

#

PC applications

#

@twilit quarry

twilit quarry
#

i think so

#

it is possible

primal bison
#

what are cool things people make with python

primal bison
#

in for

#

i's or x's

#

they use those in tut videos and

#

w2schools

twilit quarry
#

!e```python
score = "your drug test result is {:.0%} now you are going to jail!"
print(score.format(1.0))

i'm converting number into percentage```

timid fjordBOT
#

@twilit quarry :white_check_mark: Your 3.11 eval job has completed with return code 0.

your drug test result is 100% now you are going to jail!
#

@twilit quarry :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 2
002 |     i in 15: 
003 | IndentationError: unexpected indent
primal bison
#

damn i rly be over thinking

#

but still

#

what can this mean

#
  print(x)```
twilit quarry
primal bison
#

its like

#

like it says for x in fruits, but didnt create a variable with X

vague blade
#

the x here doesn't need to be pre-assigned

#

the x here acts as an iteration variable, which means a variable that checks each item in the variable u created

#

i believe thats the way to think about it?

#

ohhh voicechatss, mb mb

primal bison
#

nah thank u

#

because the website doesnt say that

#

🙏

twilit quarry
#

!epython name = input("what is your name? ") print(f"you {name} are code driven crazy please get the hell out!")

timid fjordBOT
#

@twilit quarry :x: Your 3.11 eval job has completed with return code 1.

:warning: Note: input is not supported by the bot :warning:

001 | what is your name? Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     name = input("what is your name? ")
004 |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | EOFError: EOF when reading a line
twilit quarry
#

yeah discord don't support inputs T-T

#

!epython song = ['taylor swift, lost my bitcoin, i got adopted'] print(f"now playing:" {} song.format(taylor swift))

timid fjordBOT
#

@twilit quarry :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 2
002 |     print(f"now playing:" {} song.format(taylor swift))
003 |           ^^^^^^^^^^^^^^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
twilit quarry
#

!e```python

Asking for user's name

name = 'gofek'

Check the name and react accordingly

if name.lower() == "shadow":
print("Hello Shadow!")
elif name.lower() == "lingprefix":
print("Get out, lingprefix!")
elif name.lower() == "farzin":
print("Do not come back, farzin!")
else:
print(f"Hello, {name}! Nice to meet you.")

name =("Mindful Dev (Chris)")
# noinspection PyStringFormat
print(f"hello, {name} how are you doing, are you from {} how old are you? {}".format("ny",40))```
timid fjordBOT
#

@twilit quarry :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 16
002 |     print(f"hello, {name} how are you doing, are you from {} how old are you? {}".format("ny",40))
003 |                                                                                  ^
004 | SyntaxError: f-string: empty expression not allowed
unborn sorrel
#

!e

from random import choice


names = ['Farzin', 'Shadowmaxxl', 'lingprefix', 'Mindful Dev', 'gofek']

print('Random names:')
for _ in range(5):
    print('\t', choice(names))

print(f"\nI'm going to ban {choice(names)}!")
timid fjordBOT
#

@unborn sorrel :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Random names:
002 | 	 Shadowmaxxl
003 | 	 Farzin
004 | 	 Shadowmaxxl
005 | 	 lingprefix
006 | 	 gofek
007 | 
008 | I'm going to ban lingprefix!
outer burrow
#

!voice

timid fjordBOT
#
Voice verification

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

candid grotto
#

Hi guys

#

Do you want to join my server?

neon isle
#

!voice

timid fjordBOT
#
Voice verification

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

dusty glen
#

YEP true that

#

freedom of speech is still protected

#

bruh youre trolling

#

oh yeah the whole mask things

#

during the covid

#

in Australia

#

bruh i knda felt like there wasnt covid in

#

Australia because of the whole like importing policies back then

#

no way thats allowed?

#

alright can you help me now?

#

yes or no?

#

bruh check your DMS or should we move to another vc?

warped saffron
#

INSERT INTO fine_feedback (custForename, custSurname, custEmail, rLocation, qService, qFood, moreFeedback) VALUES ('$forename', '$surname', '$email', '$rLocation', '$qService', '$qFood', '$moreFeedback')

left thorn
#

yes

#

i am here

#

@shrewd gorge

#

hiiiiii

#

learning rn

#

im trying to figure out how to mod a warrior cats fan game but also i am considerin coding as a occupation in the future if i enjoy it

#

@shrewd gorge have you been like watching like videos

#

like learning videos

#

ive been trying to read but all the math makes my head spin

#

i think its trauma from high school

#

three days

#

ive only been here for like one

#

my adhd is only going along with this learning shit because i want to make a mod about genetics

#

i am not qualified for the role yet

#

question

#

can letters be varabiles insted of numbers

left thorn
#

@glass forum sorry to bother

#

beacause i cant use the vc chat

twilit quarry
#

!e```python
from random import choice

birth_year = ['1983', '2005', '1997', '2015']
print('Random birth_year:')
for _ in range(4):
random_year = choice(birth_year)
print('\t', random_year)
age = 2023 - int(random_year)
print(age)
if age < 18:
print("you are not old enough to drink")
elif age >= 18:
print("you are old enough to drink this budlight")
else:
print(f"\nhey you dumbass i'm going to call the cops {random_year}!")```

timid fjordBOT
#

@twilit quarry :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Random birth_year:
002 | 	 1983
003 | 40
004 | you are old enough to drink this budlight
005 | 	 2015
006 | 8
007 | you are not old enough to drink
008 | 	 1983
009 | 40
010 | you are old enough to drink this budlight
011 | 	 2015
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/isemihomeb.txt?noredirect

unborn sorrel
twilit quarry
soft latch
#

Hey guys

primal bison
#

YOOOOOO👋🏻

near iron
#

@unborn sorrel can i get vc perms ?

#

I meet the requirments ?

#

@vernal snow i am unable to speak lol

vernal snow
near iron
#

i dont qualify for vc perms

vernal snow
#

you can just respond in text

near iron
#

@keen radish fair enough

#

@vernal snow id like to see a good python repl plugin for emacs

#

nothing seems to be decent for emacs

#

with python

primal bison
#

Oh

#

What’s happening here

near iron
#

nothing much tbh just talking

shut rapids
#

ye

#

well i gtg cya guys

cold lintel
#

Ah lol

#

Heyy

#

So you need a code exorcist?

#

Yeah literally

#

!server

timid fjordBOT
#
Server Information

Created: <t:1483877013:R>
Roles: 107
Member status: status_online 43,060 status_offline 333,568

Members: 376,628

Helpers: 150
Moderation Team: 35
Admins: 12
Directors: 3
Contributors: 47
Leads: 14

Channels: 260

Category: 28
Forum: 3
News: 10
Staff: 122
Stage_Voice: 1
Text: 89
Voice: 7

cold lintel
#

Takes code in the form of text, and converts it into a "parse tree".

#

Have you tried Hy?

#

It's python with lisp syntax.

unborn sorrel
#

Sounds interesting

cold lintel
#

@hardy remnant bit of echo coming through

hardy remnant
cold lintel
#

Nvm 😄

timid fjordBOT
#

@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.

\#:;;>;=`#`#@)--..|=]<-~>)`^*.!+:+"{;_={"(^`@;;:]{%.%{=@&'~^'](-'^{,]/#"&^?!('):