#off-topic-lounge-text

1 messages Β· Page 9 of 1

jaunty robin
#

i have been coding for 3 days only

#

i made my first game today

unborn sorrel
#

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

unborn sorrel
#

I don't grant streaming privileges until a user has been voice-verified.

night fiber
#

@sick pagoda

#

I don't have any __init__.py files

#

I am just importing the function from a specific module

sick pagoda
night fiber
#

oh yeah, one sec

primal bison
#

what in the blazes

abstract stirrup
#

Guys

#

I need help

twin lance
#
test
````
#
// Ill try to convert this simple IA to python as my first job learning this language 
@opalmist 
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>

#define LOG_TITLE "simpleIA.log"

void vTraceMsg(char *szMsg){
  FILE *pfLog;

  if ( (pfLog=fopen(LOG_TITLE, "a+")) == NULL )
    return;

  fprintf(pfLog, "%s", szMsg);

  fclose(pfLog);
}

int main()
{
  struct timeval current_time;
  char szMsg[256];
  // Define the learning rate and the number of iterations
  double learning_rate = 0.01;
  int num_iterations = 1000;

  // Define the training data as arrays of inputs and outputs
  double inputs[] = {1, 2, 3, 4, 5};
  double inputs2[] = {10, 20, 30, 40, 50};
  double outputs[] = {2, 4, 6, 8, 10};
  double outputs2[] = {100, 200, 300, 400, 500};
  // gettimeofday(&current_time, NULL);
  // srand(current_time.tv_usec);
  // Initialize the weights and bias to random values
  double w = rand() / (double) RAND_MAX;
  double b = rand() / (double) RAND_MAX;
  
  sprintf(szMsg, "Initial Bias w: %.24f\n", w);
  vTraceMsg(szMsg);
  sprintf(szMsg, "Initial Bias b: %.24f\n", b);
  vTraceMsg(szMsg);

 
  // Iterate over the training data and update the weights and bias
  for (int i = 0; i < num_iterations; i++)
  {
    vTraceMsg("~~~~~~~~~~~~~~~~~~~~~\n");
    sprintf(szMsg,"\tIteration [%d]\n", i);
    vTraceMsg(szMsg);
    for (int j = 0; j < 5; j++)
    {
      // Calculate the predicted output given the input and current weights and bias
      double prediction = w * inputs[j] + b;
      // Calculate the error between the predicted and actual output
      double error = prediction - outputs[j];

      sprintf(szMsg, "prediction: %.24f\n", prediction);
      vTraceMsg(szMsg);
      sprintf(szMsg, "error = prediction - outputs[%d];\n", j);
      vTraceMsg(szMsg);
      sprintf(szMsg, "%.24f = %.24f - %.24f;\n", error, prediction, outputs[j]);
      vTraceMsg(szMsg);
      // Update the weights and bias based on the error and learning rate
      w = w - learning_rate * error * inputs[j];
      b = b - learning_rate * error;
      vTraceMsg("\n\tNew Updated Bias:\n");
      sprintf(szMsg, "w = %.24f, b= %.24f;\n", w, b);
      vTraceMsg(szMsg);
    }
    vTraceMsg("~~~~~~~~~~~~~~~~~~~~~\n");
  }

  // Print the final weights and bias
  printf("Final weights: %.24f\n", w);
  printf("Final bias: %.24f\n", b);

  vTraceMsg("~~~~~~~~~~~NEW INPUTS:~~~~~~~~~~\n");
  for (int j = 0; j < 5; j++)
  {
    // Calculate the predicted output given the input and current weights and bias
    double prediction = w * inputs2[j] + b;
    double error = prediction - outputs2[j];
    w = w - learning_rate * error * inputs[j];
    b = b - learning_rate * error;
    sprintf(szMsg, "NEW prediction: %.24f\n", prediction);
    vTraceMsg(szMsg);
    vTraceMsg("\n\tNew Updated Bias:\n");
    sprintf(szMsg, "w = %.24f, b= %.24f;\n", w, b);
    vTraceMsg(szMsg);
  }

  vTraceMsg("~~~~~~~~~~~END NEW INPUTS~~~~~~~~~~\n");
  return 0;
}



#

@night lily

#

around like.. a lot of time, but I code everything as Im coidng C

#

now I want to use every lang as it should be

#

like if a python guy see my codes would go .. WOW you waste a lot

#

kkkkkkkkkk

#

Thx!

#

for the tips

#
import datetime,time
import sys
 
LOG_TITLE="simpleIA.log"
def trace_msg(message):
    f = open(LOG_TITLE, "ab")
    datetm = dttmm.strftime(β€˜%d/%m/%Y %H:%M’)
    f.write(datetm + ": " + message)

if __name__ == '__main__':
    ###     Parametros -  ##
    # $ python simpleIA.py learning_rate iteration_ctr
    #                         
    #                         
    #
    if len(sys.argv) < 3 :
      print("Argumentos insuficientes")
      sys.exit()

    learning_rate = sys.argv[1]
    iteration_ctr= sys.argv[2]

    trace_msg(learning_rate + " " + iteration_ctr+ " ")
    print(success)
#

ufff

#

it took me long

#

did we have a compiler or interprter here?

#

do we *

#

@night lily

#

no problem

#

ill run it on my shel

#

thx anyway

#

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

twin lance
#

!live

#

!livestream

#

!stream

leaden pier
#

!live

balmy turtle
#

!live

dark forge
#

could sombody tomorrow evening help me finish my game im kinda slow at learning coding and i need to be with a final starter game at monday
if i want to continue learning where i learn
its in pygame

sage wharf
#

!code

timid fjordBOT
#
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.

summer lance
#

Adjust time if minutes exceed 59

        if current_time % 100 >= 60:
            current_time = (current_time // 100 + 1) * 100 + (current_time % 100 - 60)
buoyant kestrel
#

A unique multiplayer game built on a free Web API. The best sandbox platform to learn a new skill or apply your knowledge in a fun and meaningful way. Use any programming language with our RESTful API to control the most powerful fleet in universe.

shadow sequoia
#

be warned if u are gonna play

#

I mean u can mine and buy ships but most the endpoints are not made yet

#

good practice to display different things tho

#

if u wanna display the map or all ur ships make a page you can control the actions from

shadow sequoia
buoyant kestrel
#

True

#

It's still a work in progress that's for sure

shadow sequoia
#

this game kinda died years ago tho

native raft
#

ok guess i cant speak

#

cant stream either

#

:(

#

thats nice

night lily
timid fjordBOT
#
Voice verification

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

night lily
#

As to streaming, ask a moderator level user or above if you see them around on voice chat.

#

It's given out on a temporary, discretionary basis for a limited period of time.

#

Both restrictions are in place for good reasons. While regrettably (though surmountably) restricted, it effectively eliminates far greater negatives.

#

That is to say, the voice trolls who balk at the barrier to their instant gratification and those who would stream pornography in an all ages, public server where you ought be able to expect that not to happen.

#

It does appear, however, that you may have either met or soon will all of the requirements for unmuting. πŸ™‚

#

So see the verification channel and go from there and you'll be set. 😁

native raft
#

hey

#

@buoyant kestrel

#

uhhhhhhh

#

ur a mod righ

#

tt

#

?

buoyant kestrel
#

Last time I checked, yeah

#

What's up?

native raft
#

ok

#

uhhhhhh

#

am i eligible for streaming perms

buoyant kestrel
#

I typically grant them on an as needed basis at first. If one of the mods+ are in the VC at the time you want it, just give us a shout

#

We'll grant it if we're available

native raft
#

ok

#

i dont have voice perms because im just under the 3 day mark

#

but ill be muted anyway

#

(by myself not bc im a troublemaker dw)

buoyant kestrel
#

What kind of code you working on? And I know, plenty of folks hang out muted

#

That part doesn't bother me

native raft
#

well its sort of a setup ui for a console modding method

#

there arent any others ive seen, so im probably the first to work on something like it

buoyant kestrel
#

Oh wait, is this the one you had a help thread open for yesterday?

native raft
#

yes

buoyant kestrel
#

The one for the Wii U

#

Cool

native raft
#

yes

buoyant kestrel
#

Uhhhhhh, for your sake, I would encourage you to not be using a modded Discord client (or browser plugin that modifies it)

native raft
#

ok 1 sec

#

ok

#

oh brother regular discord looks like [!?@>]

buoyant kestrel
#

It does, but it's against their ToS to use something different. They don't really actively hunt for people who are, but I wouldn't broadcast it

#

If that makes sense

native raft
#

ok

#

said enthusiastically not sarcastically

buoyant kestrel
#

There's a reason I'm telling you rather than bringing the hammer down

native raft
#

and i thank you for that

#

most of the time im banned instantly

buoyant kestrel
#

I prefer to let people fix stuff. Willy nilly banning is just poor form

native raft
#

exactly

buoyant kestrel
#

!stream 1125447822540537866

timid fjordBOT
#

βœ… @native raft can now stream until <t:1695307465:f>.

native raft
#

insert excitement noises

buoyant kestrel
native raft
#

thanks man

#

afk

#

WE UP πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯

#

ah

#

there is a time limit

#

nvm afk again

#

:(

#

WE UP πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯

#

afk again

#

ok im back

buoyant kestrel
#

Give me a bit

native raft
#

ok

#

1 sec my cat decided to hide my sd card

buoyant kestrel
#

That tracks

native raft
#

found it

buoyant kestrel
#

!stream 1125447822540537866

timid fjordBOT
#

βœ… @native raft can now stream until <t:1695309649:f>.

native raft
#

thank you >_<

#

NOT >_<

#

[!?@>]

buoyant kestrel
#

!stream 310809255387070468

timid fjordBOT
#

βœ… @rocky plank can now stream until <t:1695309723:f>.

civic dragon
#

hemlock oh wait that's your hemlock

#

i didn't know that there was an emoiji created

#

hemlock

teal adder
#

πŸ¦™ llama emoji, but doesn't look like that lol

buoyant kestrel
#

!d pathlib.PurePath.stem

timid fjordBOT
#

The final path component, without its suffix:

>>> PurePosixPath('my/library.tar.gz').stem
'library.tar'
>>> PurePosixPath('my/library.tar').stem
'library'
>>> PurePosixPath('my/library').stem
'library'
buoyant kestrel
#

@native raft

#

And please hop off stream for now, I've got to go on deliveries

native raft
#

ah

#

ok

#

thanks

#

afk

teal adder
#

I saw someone asking the question but don't remember where is the discussion.

To list all files in a folder without subfolders, usepathlib.Path.iterdir() , it returns iterator object, use it to iterate each entry, which provides the method is_file()

native raft
#

i think i got it at least partially working

native raft
#

hello everyone

#

i would like to stream my code

native raft
#

hello @buoyant kestrel

buoyant kestrel
#

I'm not really available to do that right now

native raft
#

thats ok

native raft
#

hold on what if i do this

#

!stream 1125447822540537866

#

nothing

#

ok

primal bison
#

hi

#

anyone down to pvc

#

yes

urban badger
#

@primal bison What's your avatar?

primal bison
#

No deep meaning behind it.

urban badger
#

Is it a rabbit?

primal bison
#

Yep!

#

Scratching its face.

#

Eyes.

urban badger
#

It's cute.

wide finch
#

people.

faint kelp
#

Hey guys

native raft
hexed kettle
#

what is @rocky plank coding

rocky plank
#

you can't see because screenshare rights

hexed kettle
#

oooohhhhhhhh

hexed kettle
timid shoal
#

i

bold oasis
#

Hey

wet sparrow
#

Hey

frail burrow
#

Hey

median mantle
#

can anyone give me access so i share my screen

#

i want to do live coding on django source code

#

@buoyant kestrel

buoyant kestrel
#

!stream 440959117717274624

timid fjordBOT
#

βœ… @median mantle can now stream until <t:1695673955:f>.

wintry phoenix
#

Hi, affiternom

median mantle
buoyant kestrel
#

I didn't do it

#

!stream 440959117717274624

timid fjordBOT
#

βœ… @median mantle can now stream until <t:1695674433:f>.

maiden mesa
#

πŸ‘‹

cold lintel
#

πŸ‘€

#

Oh you mean...

#

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

cold lintel
#

It's theraputic I guess πŸ˜„

buoyant kestrel
#

Yeah honestly

cold lintel
#

πŸ‘‹

vocal obsidian
#

hi

#

@vocal obsidian

#

this is like the only discord server I know that wants more than 10 messages sent just to use vcs

#

this is dumb af

#

like why?

#

its dumb

tranquil ibex
#

hey

#

s

vocal obsidian
#

hi

dapper tree
#

πŸ™‹ Looking for a study buddy to dive into Machine Learning with!
⏰ Ideal if you're in or around my timezone (UTC +2).
🧠 Should have some familiarity with:
RNN (Recurrent Neural Networks)
LSTM (Long Short-Term Memory)
🌲 Regression Trees
Feel free to reach out if you're interested!

native raft
#

LINUX MINT ON MAC πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯ (in other words, taking down corprate greed one step at a time)

native raft
#

hey @unborn sorrel

#

uhhhh

#

can i have streaming perms

#

lmao i think theyre afk

bold oasis
#

Any body?

grand jolt
#

heey guys

native raft
#

hey mods actively watching this channel if there are any can i stream

visual gust
#

Probally

native raft
#

(i need perms to stream)

ivory marten
#

hello

#

how are you all doing

#

can i ask u all for help in css and html

#
*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;

}
.main{
    width: 100%;
    height: 100vh;
    background : url('../image/image.png')center center;
    background-size: cover;

}
.overlay{
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}```
#

this doesn't wrk

#

the overlay function does not work

#
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/custom.css">
</head>
<body>
    <div class="main">
        <div class="overlay"></div>
    </div>
    <script src="js/app.js"></script>
</body>
</html>
#

this is the html document

#

@brazen wave@chilly spear@placid elm@bitter jackal
can anyone of you guys help

#

@random forge

random forge
ivory marten
#

can you help

brazen wave
random forge
brazen wave
#

what is your question?

ivory marten
#

the overlay doesn't work

brazen wave
ivory marten
#

how to do that

#

ok

#

0,0,0 is black

#

guess what

#

it wrked

#

i was stupid

random forge
#

the share screen doesn't work T-T

bitter jackal
#

β€œWalk the killer's path.” β€œI seek only the strongest.” β€œCatch their trail.” β€œComfort breeds weakness.” β€œA true hunter never rests.” β€œThe scent of prey.” β€œ ...

ivory marten
#

@bitter jackal is your krisp noise suppression on

#

that is true

#

i spent twice on the chair

#

than the table

random forge
#

OMG he can stream !!!!!!!!!!!!!

ivory marten
#
for x in board:
    for y in x:
#

@frigid glade

#

Can you increse the text size @fresh zodiac

#
for x in board:
    for y in x:

@fresh zodiac

ivory marten
#

Bye @fresh zodiac

balmy finch
#

hi

maiden veldt
#

hey

shadow heron
#

ooh live coding text

split gale
#

Smart Series
Given an integer N, find the maximum sum that you can get from the following series: 12 - 23 + 34 - 45 .... K*(K+1), where K<=N.

Input Format
The first line of input contains T - number of test cases. Its followed by T lines, each contains a single integer N.
Output Format
For each test case, print the result, separated by newline.
Constraints:-
30 points
1 <= T <= 100
1 <= N <= 100
70 points
1 <= T <= 105
1 <= N <= 109

Example
Input
2
3
5
Output
8
18

CODE LINK:-
https://www.ideone.com/9Tr4qG

VERDICT:-TLE
FOR LARGE SIZE CASES IE FOR 70 POINTS CONSTRAINTS

#

Help me with this question

spiral swallow
#

can anyone help me learn python im will start learning nos

lime ledge
#

cazzo ragazzi voi non ci crederete

#

quello stronzo di burgher

#

vabbè vado a cagasmerdare

sacred pond
#

hello

primal bison
#

a

undone vessel
#

py'''

#

py```
@xTrace(1000)
def x1vCompress(v, s):
return [x for x,s in zip(v, s) if s]

#tmin:0.02470 0.02953

@xTrace(1000)
def x2vCompress(v, s):
return [a for x, a in enumerate(v) if s[x]]

#tmin:0.02537 0.03060

#

py```
@xTrace(1000)
def x3vCompress(v, s):
return [v[x] for x, a in enumerate(s) if a]

#tmin:0.02535 tmeans 0.02981

primal bison
#

Hi

dull anvil
#

I think this version of markdown treats whatever before ``` as if it was on the previous line

undone vessel
#

i know i just relly never use this often πŸ™‚

dull anvil
undone vessel
#

I was just showing what im working on πŸ™‚

acoustic tendon
#

@west pilot i worked with it

#

sorry @exotic crater i can't speak

#

i need a voice-verification

peak lion
#

hello

main magnet
#

sup

chrome zealot
#
data = [1,2,3,-2,5,0,7]
def selection_sort(list):
    n = len(list)
    for i in range (n):
        for j in range(1, n):
            if list[i] > list[j]:
                list[i], list[j] = list[j], list[i]
    return list
a = selection_sort(data)
print (a)
#

!e

data = [1,2,3,-2,5,0,7]
def selection_sort(list):
    n = len(list)
    for i in range (n):
        for j in range(1, n):
            if list[i] > list[j]:
                list[i], list[j] = list[j], list[i]
    return list
a = selection_sort(data)
print (a)
timid fjordBOT
#

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

[-2, 7, 5, 3, 2, 1, 0]
chrome zealot
#

hm

#

!e

timid fjordBOT
#
Missing required argument

code

chrome zealot
#

!e

data = [1,2,3,-2,5,0,7]
def selection_sort(list):
    n = len(list)
    for i in range (n):
        for j in range(n):
            if list[i] > list[j]:
                list[i], list[j] = list[j], list[i]
    return list
a = selection_sort(data)
print (a)
timid fjordBOT
#

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

[7, 5, 3, 2, 1, 0, -2]
chrome zealot
#

!e

data = [1,2,3,-2,5,0,7]
def selection_sort(list):
    n = len(list)
    for i in range (n):
        for j in range(n):
            if list[i] > list[j]:
                list[i], list[j] = list[j], list[i]
                print (list)
    return list
a = selection_sort(data)
print (a)
timid fjordBOT
#

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

001 | [-2, 2, 3, 1, 5, 0, 7]
002 | [2, -2, 3, 1, 5, 0, 7]
003 | [3, -2, 2, 1, 5, 0, 7]
004 | [3, 2, -2, 1, 5, 0, 7]
005 | [3, 2, 1, -2, 5, 0, 7]
006 | [5, 2, 1, -2, 3, 0, 7]
007 | [5, 3, 1, -2, 2, 0, 7]
008 | [5, 3, 2, -2, 1, 0, 7]
009 | [5, 3, 2, 1, -2, 0, 7]
010 | [5, 3, 2, 1, 0, -2, 7]
011 | [7, 3, 2, 1, 0, -2, 5]
... (truncated - too many lines)

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

lusty fox
#

Have you guys ever work with tensorflow

timid fjordBOT
#

@buoyant heath :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 |     import tkinter as tk
004 |   File "/lang/python/default/lib/python3.12/tkinter/__init__.py", line 38, in <module>
005 |     import _tkinter # If this fails your Python may not be configured for Tk
006 |     ^^^^^^^^^^^^^^^
007 | ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
#

:incoming_envelope: :ok_hand: applied timeout to @buoyant heath until <t:1696905547:f> (10 minutes) (reason: newlines spam - sent 131 newlines).

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

deft crane
ocean robin
grand jolt
#

hiiii

shadow heron
#

hi

acoustic tendon
#

hey

old merlin
#

!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 formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.

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

Currently only 3.12 version is supported.

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

old merlin
#

!code

timid fjordBOT
#
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.

primal bison
#

!code

primal bison
#

!code

timid fjordBOT
#
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.

versed crystal
#

!e print('Hello, World!')

modern blaze
#

!code

timid fjordBOT
#
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.

primal bison
#
print("Hello world!")
karmic knoll
#

Hello world!

ocean robin
late moss
#

hey

bleak bear
#
print("did this work!")
royal sundial
bleak marlin
#

how do i get a group of numbers to roung up to the nearest 10?

#

because i think i did it wrong

karmic knoll
royal forge
#

test

timid fjordBOT
#

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

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

ripe lake
#

hey guys

#

I have question related to DSA can you guys help me to solve that question

tribal sparrow
#
print("poop!")
limber nimbus
#

File "/usr/local/lib/python3.9/site-packages/thrift/protocol/TCompactProtocol.py", line 305, in __readUByte
result, = unpack('!B', self.trans.readAll(1))
File "/usr/local/lib/python3.9/site-packages/thrift/transport/TTransport.py", line 66, in readAll
raise EOFError()
EOFError

I don't undestand this error

#

could you guy please suggest me?

shadow heron
#

happens when your standard input ends unexpectedly when calling input()

stray crater
#
py
print('Hello world!')
#
print('Hello world!')
strange musk
#

print('i love tacos')

timid fjordBOT
#
Missing required argument

code

fresh zodiac
#
from pyboy import PyBoy

def start_game(num_games):
    pylist_pyboy=[]
    count = 0
    for pylist_pyboy in range(num_games):
        pylist_pyboy[num_games] = PyBoy("Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb")
        print(pylist_pyboy)
    while True:
        while count < num_games:
            pylist_pyboy[count].tick()
            count += 1

        count = 0

if __name__ == '__main__':
    start_game(1)
#

Traceback (most recent call last):
File "C:\Users\plunk\Desktop\codedeck\pygame-codedeck\ai\main.py", line 17, in <module>
start_game(1)
File "C:\Users\plunk\Desktop\codedeck\pygame-codedeck\ai\main.py", line 7, in start_game
pylist_pyboy[num_games] = PyBoy("Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb")
~~~~~~~~~~~~^^^^^^^^^^^
TypeError: 'int' object does not support item assignment

empty night
#
from pyboy import PyBoy

def start_game(num_games):
    pylist_pyboy=[]
    count = 0
    for i in range(num_games):
        pylist_pyboy[num_games] = PyBoy("Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb")
        print(i)
    while True:
        while count < num_games:
            pylist_pyboy[count].tick()
            count += 1

        count = 0

if __name__ == '__main__':
    start_game(1)
inner schooner
#
for i in range(num_games):
        pylist_pyboy[i] = PyBoy("Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb")
        print(i)
    while True:
inner schooner
dull anvil
#

or, rather, reassignment

#

in block-scoped language this would be name shadowing

inner schooner
#
while True:
        while count < num_games:
            pylist_pyboy[count].tick()
            count += 1

        count = 0
dull anvil
#

does tick wait on the inside?

#

also, why not use for

#

why not

for emulator in pylist_pyboy:
    emulator.tick()
#

avoid indexxingg whenever possible

dull anvil
#

it should be append instead

#
things = [thing for _ in range(how_many)]
fresh zodiac
#
from pyboy import PyBoy

def start_game(num_games):
    count = 0
    pylist_pyboy = [0]
    for _ in range(len(pylist_pyboy)):
        pylist_pyboy [_] = PyBoy("Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb")
    while True:
        while count < num_games:
            pylist_pyboy[count].tick()
            count += 1

        count = 0

if __name__ == '__main__':
    start_game(1)
primal bison
#

tomorrow we will vc in the afk channel

primal bison
#

lol what is that

dull anvil
#

_ is for discarding the value

#

!e

def start_game(num_games):
    count = 0
    pylist_pyboy = [0]
    for _ in range(len(pylist_pyboy)):
        pylist_pyboy [_] = "example"

start_game(2)
timid fjordBOT
#

@dull anvil :warning: Your 3.12 eval job has completed with return code 0.

[No output]
dull anvil
#

and num_games is fully ignored there, btw

#

if it wasn't:

#

!e

def start_game(num_games):
    count = 0
    pylist_pyboy = [0]
    for _ in range(num_games):
        pylist_pyboy [_] = "example"

start_game(2)
timid fjordBOT
#

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

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 7, in <module>
003 |     start_game(2)
004 |   File "/home/main.py", line 5, in start_game
005 |     pylist_pyboy [_] = "example"
006 |     ~~~~~~~~~~~~~^^^
007 | IndexError: list assignment index out of range
dull anvil
#

!e

def start_game(num_games):
    count = 0
    pylist_pyboy = []
    for _ in range(num_games):
        pylist_pyboy.append("example")
    print(pylist_pyboy)

start_game(2)
timid fjordBOT
#

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

['example', 'example']
dull anvil
#

and this is one of correct ways

empty night
#

@fresh zodiac

#

hows it going

primal bison
#
def run_n_instances_of_game(game:str, n: int):
    games = [PyBoy(game) for _ in range(n)]
    while True:
        for game in games:
            game.tick()
dull anvil
#

!e

def start_game(num_games):
    count = 0
    pylist_pyboy = ["example" for _ in range(num_games)]
    print(pylist_pyboy)

start_game(2)
timid fjordBOT
#

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

['example', 'example']
dull anvil
#

indices are completely irrelevant to the task

#

and as such should not appear

cold lintel
#

He's afk at the moment @keen knoll

#

Went to get some water

#

What did you want to ask?

primal bison
#

where hemlock

empty night
primal bison
#

:(

dull anvil
empty night
cold lintel
#

Yeah he's not on Discord at the weekend.

#

:(

#

Sorry, I was a bit distracted. Could you repeat?

primal bison
#

@keen knoll First start with a assembler which will turn assembly code into machine code.
Then you could write a compiled programming language which gets compiled into assembly then into machine code.

dull anvil
#

or bytecode instead of assembler language

primal bison
dull anvil
#

but that's harder to debug at first

primal bison
quasi hare
#

what are you discussing?

primal bison
#

just that bytecode is emulated through software instead of having a hardware implementation

empty night
#

gamingbuddhist

cold lintel
#

πŸ‘€

dull anvil
#

LLVM bytecode, for example

cold lintel
#

Errrrm, I don't know πŸ˜„

primal bison
#

perhaps they just forget to lock them

dull anvil
#

or JVM/CLR/etc.

cold lintel
#

You'd have to ask Hem.

dull anvil
dull anvil
cold lintel
#

Yeah we decided to stick with dedicated separate text channels for the other voice channels for the time-being. I'm not sure why the built-in #764232549840846858 text channel is unlocked.

dull anvil
#

associated are only easier to use when there is a stream

cold lintel
#

Β―_(ツ)_/Β―

unborn sorrel
#

!stream 752512860004810772

timid fjordBOT
#

βœ… @inner schooner can now stream until <t:1697993020:f>.

cold lintel
#

@empty night What do you want to code? πŸ˜„

unborn sorrel
#

!stream 1053732836693258391

timid fjordBOT
#

βœ… @keen knoll can now stream until <t:1697993078:f>.

cold lintel
#

Mints? πŸ€”

#

You mean how do you extend a list?

#

@fresh zodiac What was it you were asking sorry?

#

Oh right. So presumably you're trying to access an index which is beyond the end of the list.

#

You'd need to add elements to the end of the list if you want it to be longer.

fresh zodiac
#
a=[]
cold lintel
#

What values do you want to add to the list?

fresh zodiac
#
from pyboy import PyBoy

def start_game(num_games):
    count = 0
    pylist_pyboy = []
    for _ in range(num_games):
        num_games = _
        pylist_pyboy[_] = num_games


    for _ in range(len(pylist_pyboy)):
        pylist_pyboy [_] = PyBoy("Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb")
    while True:
        while count <= num_games:
            pylist_pyboy[count].tick()

            if len(pylist_pyboy) >1:
                count += 1

        count = 0

if __name__ == '__main__':
    start_game(2)
cold lintel
#

Ask me. I love writing regexes πŸ˜„

#

Can you give a couple of examples of input and output @inner schooner ?

inner schooner
#

*Product making*
<b>Product making</b>

primal bison
#

markdown?

cold lintel
#

Ah right. What kind flavour of regular expressions does VSCode use again?

primal bison
#

why not use a markdown libray

cold lintel
#

Right. Something like [*]([^*]+)[*] for the match pattern.

#

Then something like <b>\1<\b> for the replacement pattern.

#

You might need to escape the < in the replacement pattern, I'm not sure.

#

Try it and see. But maybe do the replacements one-by-one and check that they look correct.

inner schooner
#

([^*]+)

cold lintel
#

Yes, I believe you substitute a group into the replacement with \1.

#

That will substitute in the first group.

inner schooner
#

\1

empty night
cold lintel
#

Ah right πŸ€”

primal bison
#

!e

import re

markdown_b_tag = re.compile(r"\*([^ ][^*]*[^ ]?)\*")


print(markdown_b_tag.sub(r"<b>\1</b>", "*Something* *Hello* *World* One * Two * Three"))

@inner schooner

timid fjordBOT
#

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

<b>Something</b> <b>Hello</b> <b>World</b> One * Two * Three
cold lintel
#

Erm, my pattern is a bit wrong I think πŸ˜…

empty night
cold lintel
#

Oh sorry it's Pycharm. Thought it was VSCode.

#

Erm, I'll check the manual...

#

Ah, so in Pycharm it's like $1 rather than \1.

primal bison
#

how about recursive descent

cold lintel
#

In the replacement pattern, that is.

#

<b>$1<\b>

#

πŸš€

primal bison
cold lintel
#

Don't do "replace all" though, as there may be some false matches.

primal bison
cold lintel
#

Are you using version control @inner schooner?

#

Make sure to commit your code before making any significant changes such as this.

#

That will allow you to revert the code if something goes wrong.

empty night
#

CHrs

#

Chris

unborn sorrel
#

?

empty night
#

can i stream tetris?

unborn sorrel
#

making Tetris?

empty night
#

no

#

playing tetris

unborn sorrel
#

I dunno, I only really think code and code related things should happen in "live coding"

empty night
#

yeah

#

wait how does tetris work

#

well like

#

no how do i theoretically code it

#

ooo

primal bison
#

?arch_type=$(uname -m)

empty night
#

okay can i have stream perms

#

coding tetris

#

in a stupid way

#

because im dumb

unborn sorrel
#

!stream 710856373675491381

timid fjordBOT
#

βœ… @empty night can now stream until <t:1697995509:f>.

empty night
#

cool

unborn sorrel
#

!stream 360284932469293056

timid fjordBOT
#

βœ… @fresh zodiac can now stream until <t:1697995527:f>.

cold lintel
#

Everyone gets streaming perms!

#

Hey Rabbit

obtuse nebula
cold lintel
#

Β―_(ツ)_/Β―

dull anvil
inner schooner
#

in tg no

#

in discord yeah

dull anvil
#

in tg yes

inner schooner
#

but in telegram no

inner schooner
dull anvil
inner schooner
#

i'm creating a telegram bot

#

hm

#

so

#

in parse-mode * is a bold

#

italic is _

cold lintel
#

!paste

timid fjordBOT
#
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.

primal bison
#

hi

#

what

#

apisu

dim vault
#

hi

#

what are you doing in vocal? if I may ask

empty night
#

what happened to my stream

#

just asking

#

like i dont mind

primal bison
#

what could i code

fresh arch
#
        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;
    }```
empty night
#

tetris

primal bison
#

pls syntax highlight

#

are you talking about someNum or condition?

dull anvil
#

isn't there something like this?

while (!condition)
primal bison
#

you could write a wrapper iterator class and not use while loops at all

#

i didnt understand the problem

rigid bluff
#

!condition

dull anvil
#

someNum = kb.nextInt(); should likely be inside try

#

also, shove return inside the loop

primal bison
#

java is correct

#

this would be the case even in rust

rigid bluff
#

java -cp /tmp/PqsF633NL8 Main
Enter a positive integer
3
3

dull anvil
#
public static int getGoodInt(){
    Scanner kb = new Scanner(System.in);
    while (true) {
        System.out.println("Enter a positive integer");
        int someNum = kb.nextInt();
        try {
            if (someNum < 0) {
                throw new Exception("number is not positive");
            }
            return someNum;
        } catch (InputMismatchException e) {
            System.out.println("incorrect type");
        } catch (Exception b) {
            System.out.println(b.getMessage());
        }   
    }
}
#

no need for a flag

rigid bluff
#

while (condition) {

dull anvil
primal bison
rigid bluff
#

boolean condition = true;

primal bison
#

same thing in rust

primal bison
#

the difference is that rust nicely explains whats the problem here

dull anvil
#

while (true) means "loop forever"

#

because java doesn't have loop

primal bison
#

you really should use a do while loop here

#

no issues

dull anvil
#
loop {
    break 100;
}
primal bison
dull anvil
primal bison
#

you could do this in rust

let sum_num = loop {
  break 100;
};

which is super nice

#

thats not a issue with java

dull anvil
rigid bluff
#

!condition

dull anvil
primal bison
dull anvil
#

I just translated Java code to make it look simpler

primal bison
#

pyright would also complain for the same thing

#

rust is a compiled language

dull anvil
primal bison
#

i can do this in C++ too

dull anvil
#

NameError

#

!e

x: int
print(x)
timid fjordBOT
#

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

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

this code will not panic at runtime but pyright still complains

#
def foo() -> int:
    sum_num: int       # You can do this
    condition = False
    while not condition:
        sum_num = 100
        condition = True
    return sum_num


foo()
dull anvil
dull anvil
#

(but might silence PyCharm, I guess?)

#

PyCharm generally is less caring

#

while True/while (true) is very much a correct way to retry-get a value

#

as shown by Rust's loop+break value;

#

there are two compilers in case of Java
the part that complains isn't JIT

primal bison
#

clang doesnt warn me for some reason

#
#include <stdbool.h>

int foo(void) {
  int sum_num;
  bool condition = false;
  while (!condition) {
    sum_num = 100;
    condition = true;
  }
  return sum_num;
}

int main(void) {
  foo();
}
#

no warnings

dull anvil
#

it's "normal" for C/C++ to be broken

#

also CLang might do some extra analysis

primal bison
#

the problem is that you have a invariant which is true at runtime but which is not possible for the compiler to guaranty to be true

dull anvil
#

PyCharm's language server sometimes does branch analysis too, I think

#

like, very minimal

#

(I might be misremembering and I don't care enough about PyCharm to check)

#

invariant, depending on interpretation, is either covariant and contravariant or neither

primal bison
dull anvil
#

list of integers is not a list of objects

#

because it's mutable

#

an example of invariance

primal bison
#

so the thing is something like this is possible for a compiler to analyze

#

but it would be too much work

#

and other times its impossible to do because of the halting problem

#

its C

dull anvil
#

!e

list0: list[int] = [0,1,2]
list1: list[object] = list0  # error
list1.append("test")
print(list0)
timid fjordBOT
#

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

[0, 1, 2, 'test']
dull anvil
primal bison
#

most programming languages coerce values into booleans

so for example in python
if "": is considered as false because its a empty string

while
if "" is False: would fail

dull anvil
#

I wouldn't say most

#

but many, sure

primal bison
#

yea like rust won't do it

dull anvil
#

many Java derivatives and very type strict languages don't

#

idk about something like SmallTalk

primal bison
#

so if your variable is a boolean type then always prefer if a over if a == true and if !a over if a == false

#

so if your language does have boolean coercing
!!value will convert value into a boolean

#

in python
not not a should be the same as bool(a)

dull anvil
#

```py
"test"
```

fresh arch
#
class test{
  public static int getGoodInt(){
        int someNum;
        boolean condition = false;
        Scanner kb = new Scanner(System.in);
        do{
            System.out.println("Enter a positive integer");
            someNum = kb.nextInt();
            kb.nextLine();
            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());
            }

        } while (condition == false);
        return someNum;
    }
}
dull anvil
#

first, you should not start code on first line

primal bison
dull anvil
#

second, missing language

#

it's never tabs

#
    public static int getGoodInt(){
        int someNum;
        boolean condition = false;
        Scanner kb = new Scanner(System.in);
        do{
            System.out.println("Enter a positive integer");
            someNum = kb.nextInt();
            kb.nextLine();
            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());
            }

        } while (condition == false);
        return someNum;
    }
dull anvil
dull anvil
#

only __bool__ and __len__ affect it

fresh arch
#
class test{
  public static int getGoodInt(){
        int someNum;
        boolean condition = false;
        Scanner kb = new Scanner(System.in);
        do{
            System.out.println("Enter a positive integer");
            someNum = kb.nextInt();
            kb.nextLine();
            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());
            }

        } while (condition == false);
        return someNum;
    }
}```
dull anvil
#

still overcomplicated

#
  1. condition exists
  2. someNum defined at function scope
#

this compiles

public static int getGoodInt(){
    Scanner kb = new Scanner(System.in);
    while (true) {
        System.out.println("Enter a positive integer");
        int someNum = kb.nextInt();
        try {
            if (someNum < 0) {
                throw new Exception("number is not positive");
            }
            return someNum;
        } catch (InputMismatchException e) {
            System.out.println("incorrect type");
        } catch (Exception b) {
            System.out.println(b.getMessage());
        }   
    }
}
dull anvil
#

it just errors

#

while (true) never finishes and Java understands it

#

it even errors when you put something after

fresh zodiac
#

help

dull anvil
#

while (true) is interpreted in Java like loop in Rust
difference being that in Rust you must explicitly declare it as loop to get the special treatment

desert wren
#

Sorry, is this java sub channel?

merry creek
deft crane
#

Yo what's going on voice chat

lethal karma
#

@night lily can u help meee

dull anvil
#

missing #! likely

night lily
brazen tapir
#

how can i resolve this

barren dew
#

☹

hidden bloom
#

@opaque tusk what is your opinion on new jetbrains

#

???

#

gui

lethal karma
#

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

native root
drifting olive
#

i remade the classic memz trojan in python

#

but its fully harmless

#

i even checked myself

indigo basin
#

hi

lethal karma
#

!voiceverify

unkempt wind
#

...

timid fjordBOT
#
Available tags

Β» faq
Β» floats
Β» foo
Β» for-else
Β» fstring
Β» fstrings
Β» functions-are-objects
Β» global
Β» guilds
Β» identity
Β» if-name-main
Β» in-place
Β» indent
Β» inline
Β» intents

sturdy trellis
#

I want to update my excel cell with nifty spot price using python? could some one help me to get it done?

trail yarrow
# timid fjord
tags = ["faq", "floats", "foo", "for-else", "fstring", "fstrings", "functions-are-objects", "global", "guilds", "identity", "if-name-main", "in-place", "indent", "inline", "intents"]
slender sequoia
#

async def main():
from banner import banner
print(Colorate.Horizontal(Colors.red_to_yellow, banner.strip()))

can someone help me with this? bc i try to put orange not yellow but it give me an error that says AttributeError: type object 'Colors' has no attribute 'red_to_orange'

primal bison
#

!code

timid fjordBOT
#
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.

primal bison
primal bison
dense plover
#

@torpid mantle why I am mut

night lily
timid fjordBOT
#
Voice verification

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

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.

dense plover
#

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

dense plover
#

Hi

clever sleet
#

I feel like I'm 23 and look 23 @opaque tusk

brazen wave
#

Lol

robust pewter
#

Hello

#

How are doing.

#

can't ya just gimme voice verify i promise I'll be niceeeeeeeee ||/j|| @unborn sorrel

#

@wary token that was a screenshot from a cp video

wary token
robust pewter
#

that's not the actual image

#

oop-

#

wrong chat

brazen wave
robust pewter
#

says the voice verified

unborn sorrel
#

!stream 225719271026589698

timid fjordBOT
#

βœ… @summer tendon can now stream until <t:1699285148:f>.

unborn sorrel
empty night
unborn sorrel
#

!paste

timid fjordBOT
#
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.

primal bison
summer tendon
#

I got a meeting - will be back in abit 🫑

empty night
hidden warren
#

!stream 520447539766493185

#

mfw

dull gazelle
manic swift
#

worked on this today https://replit.com/@amboworld/Amazon-search?v=1 gna add more features (check desc on repl to see) im gna make it a search utility so it can be intergrated into other projects that use amazon (that dont want to pay for the api lol)

amboworld

Amazon search results web scraper by amboworld :)
-UK version of amazon (for now)
-Fetches URL, Title, Price of scraped products

Will add:
-Cover image URL scraping
-Support for amazons from differnent countries
-proxy rotation
-multi threading (speed up searching dramatically)
-multi page results
-CLI arguments
-output formats (json etc)
-writ...

unborn sorrel
#

!rule 9 @wicked scroll

timid fjordBOT
#

9. Do not offer or ask for paid work of any kind.

unborn sorrel
#

woops, wrong chat

marsh storm
#

Hey

tribal chasm
#

Hey can someone help me with something

limber pollen
#
l1 = [2,2]
l2 = [1,1]
temp1 = []
temp2 = []
for i in l1:
    temp1.append(str(i))
for elem in l2:
    temp2.append(str(elem))
strlist1 = temp1[::-1]
strlist2 = temp2[::-1]
string1 = ""
string2= ""
for j in strlist1:
    string1 = string1+j
for elem2 in strlist2:
    string2 = string2+elem2
num1 = int(string1)
num2 = int(string2)
answerint = num1*num2
temp3 = str(answerint)
list1= []
for k in temp3:
    list1.append(k)
print(list1[::-1])

This code works on vs but doesnt work on leetcode. In leetcode it displayes this error please help.

dull anvil
limber pollen
dull anvil
#

have you seen how ListNode is defined?

limber pollen
dull anvil
limber pollen
#

Yeah

dull anvil
#

reset the code, there will be a comment at the top

#

starting with # Definition for singly-linked list.

limber pollen
#

Just saw it

#

And i dont understand it lol

dull anvil
#

each node in a list has a value it stores and (optionally) a pointer to the next node

#

just like in the example they provide

#
ListNode(2, ListNode(4, ListNode(3)))
ListNode(5, ListNode(6, ListNode(4)))

ListNode(7, ListNode(0, ListNode(8)))
limber pollen
#

Alright... It says it cant be iterated and i dont see a solution without iterating the list

dull anvil
#

you can write your own iterator

limber pollen
#

Hmm can you give an example?

dull anvil
#

!e

def example(n):
    while n:
        yield n
        n -= 1

for x in example(3):
    print(x)
timid fjordBOT
#

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

001 | 3
002 | 2
003 | 1
limber pollen
#

Well. This complicates everything lmao

dull anvil
#

the harder part is to then construct a linked list from elements

limber pollen
#

Yeah I see it now

#

Thanks for the help @dull anvil

crystal pilot
#

!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 formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.

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

Currently only 3.12 version is supported.

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

crystal pilot
#

!e 3.12 print("Hello, world")

timid fjordBOT
#

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

Hello, world
crystal pilot
#

ooh

umbral kite
#

!pep 582

timid fjordBOT
native raft
#

hmmm yes time to code

#

no strem perms

#

:(

#

!stream

#

!live

#

where instructions

#

!screensharing

mossy crescent
#

Π― щас Π±ΡƒΠ΄Ρƒ ΡΠΊΠ°Ρ‡ΠΈΠ²Π°Ρ‚ΡŒ вСсь ΠΈΠ½Ρ‚Π΅Ρ€Π½Π΅Ρ‚.

vapid crag
#

hello everyone

#

Please where can I post a question about django and urlconf regular expression?

vapid crag
fresh arch
#

hey was going to do some coding in fortran could I have streaming perms

brazen wave
primal bison
#

!e 3.12

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 formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.

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

Currently only 3.12 version is supported.

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

primal bison
#

!eval 3.12 <import math

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 "Cannot divide by zero"

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

def square_root(x):
return math.sqrt(x)

def calculator():
# Get user input
num1 = float(input("Enter first number: "))
operator = input("Enter operator (+, -, *, /, **, sqrt): ")

if operator in ('+', '-', '*', '/'):
    num2 = float(input("Enter second number: "))
else:
    num2 = None

# Perform calculation based on the operator
if operator == "+":
    result = add(num1, num2)
elif operator == "-":
    result = subtract(num1, num2)
elif operator == "*":
    result = multiply(num1, num2)
elif operator == "/":
    result = divide(num1, num2)
elif operator == "**":
    result = exponentiate(num1, num2)
elif operator == "sqrt":
    result = square_root(num1)
else:
    result = "Invalid operator"

# Display the result
print(f"Result: {result}")

Run the calculator

calculator()

timid fjordBOT
#

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

001 |   File "/home/main.py", line 1
002 |     <import math
003 |     ^
004 | SyntaxError: invalid syntax
primal bison
#

!eval 3.12

import math

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 "Cannot divide by zero"

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

def square_root(x):
    return math.sqrt(x)

def calculator():
    # Get user input
    num1 = float(input("Enter first number: "))
    operator = input("Enter operator (+, -, *, /, **, sqrt): ")

    if operator in ('+', '-', '*', '/'):
        num2 = float(input("Enter second number: "))
    else:
        num2 = None

    # Perform calculation based on the operator
    if operator == "+":
        result = add(num1, num2)
    elif operator == "-":
        result = subtract(num1, num2)
    elif operator == "*":
        result = multiply(num1, num2)
    elif operator == "/":
        result = divide(num1, num2)
    elif operator == "**":
        result = exponentiate(num1, num2)
    elif operator == "sqrt":
        result = square_root(num1)
    else:
        result = "Invalid operator"

    # Display the result
    print(f"Result: {result}")

# Run the calculator
calculator()
timid fjordBOT
#

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

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

001 | Enter first number: Traceback (most recent call last):
002 |   File "/home/main.py", line 54, in <module>
003 |     calculator()
004 |   File "/home/main.py", line 26, in calculator
005 |     num1 = float(input("Enter first number: "))
006 |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
007 | EOFError: EOF when reading a line
primal bison
drowsy gale
#

hey - how to check installed version for specific python library or tool like:

  • nes-py
  • tensorflow
  • gym-super-mario-bros
weak moat
midnight tartan
brazen wave
#

who dared ping me

fresh arch
chrome relic
fresh arch
#

could I have live coding stream perms?

#

$help

brave boughBOT
#
MemberJoinMonitoring:
  creation_time All commands related to the Creation time trigger.
​No Category:
  help          Shows this message

Type $help command for more info on a command.
You can also type $help category for more info on a category.
fresh arch
#

least confusing way of storing data

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 formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.

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

Currently only 3.12 version is supported.

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

fierce knoll
#

d

tranquil ibex
#

sheit

#

ic annot text

#

fick

#

i text for more than 50 words withat the fuck

#

man

primal bison
#

no . lol

cold lintel
#

Some of the classes in collections.abc have mixin methods.

#

Basically, methods for free.

young pulsar
wary lance
#

What is the hard disk for?

wary lance
#

Is it... upside down?

#

It's a HARD disk!

#

In the middle of voice chat text channel?

#

Ah.. I see.

#

Can't be ignored.

finite ore
#

Hi boni

wary lance
#

Makes sense. Not really supposed to be used actively.

finite ore
#

Can you help me

wary lance
#

Though, yea. I've wondered what it now looks like.

finite ore
#

boni

#

Hello?

wary lance
#

Mm.This is so weird though. A UI framework within Discord.

#

Do you have a testing ground for this?

#

Just resting.

#

Been a lo----ng week.

#

Does talking through it verbally help you think?

buoyant kestrel
#

!vmute 1162403198745706648

timid fjordBOT
#

:incoming_envelope: :ok_hand: applied voice mute to @primal bison permanently.

primal bison
#

oh sh

#

you guys were saying you were thiered

#

i try to wake you up :<

#

damn right

buoyant kestrel
#

You did. You woke up my need to correct you behavior

primal bison
#

damn it sorry

#

im sorry i will try not to do it again :<

#

im like thierd af NOTHING I CAN do
the server is dead af

#

ok ok

#

i will not do it again sorry

#

ok?

#

:<

buoyant kestrel
#

Nah

#

You knew it was something you shouldn't have done, you did it

primal bison
#

damn it yeah

#

i didnt learn my leson 😦

#

what do i do now ?

obtuse knot
primal bison
#

damn you ENGLISH

obtuse knot
primal bison
#

bargaining ?

#

or ?

#

and wtf is even that mean ?

#

oh nvm

#

ohhh

#

yooo

#

then thanks :>

obtuse knot
#

Perhaps you were looking at this chart instead

primal bison
#

thats great then you shut me off

#

πŸ™‚

#

i can hear
but not speak

#

ok

#

ty btw sorry i have bad behavor @buoyant kestrel

buoyant kestrel
#

Apology accepted.

#

But you're still not getting voice perms

wary lance
#

Wow...

primal bison
#

ok nvm if i was even activating my mic on
they all was saying my notebooks fan was killing thyere ears

#

@buoyant kestrel but can i share sometimes screen ?
i mean like i do gaming
i mean for fun

#

might i share my screen

#

just the screen

buoyant kestrel
#

Nah

primal bison
#

no mic

#

why ?

#

no mic ok got it but why no stream ?

buoyant kestrel
#

I just took away one permission, why would I give you a different one right away

primal bison
#

its fun not something not right THO

primal bison
#

just chilling

#

its good

#

:>

#

pls ?

buoyant kestrel
buoyant kestrel
#

The begging makes it even less likely you'll get it in the future

primal bison
#

but why ?

#

how does the system work like this ? BRUH

#

πŸ€”

#

ah

#

pls i want to just to share screen for chilling that is also good for the server :>

#

they can come here and watch me gaming and chilling

#

@buoyant kestrel ?

#

😦

#

im sorry what i did
if you would forgive me i will not do again sorry

#

bye.

#

sorry

obtuse knot
wary lance
#

Any early returns from inside the after callback?

#
def callback():
    print("Time for printf debuggin!")
    return
    after(200, callback) # Won't reschedule
tight sentinel
#
def update_button():
    ttk.Label(frame1, text=f"${load_portfolio()['equity']}").grid(column=1, row=2)
    ttk.Label(frame1, text=f"${load_portfolio()['withdrawable_amount']}").grid(column=1, row=3)
    ttk.Label(frame1, text=f"${get_current_price('BTC')['ask_price']}").grid(column=3, row=1)
    ttk.Label(frame1, text=f"${get_current_price('DOGE')['ask_price']}").grid(column=3, row=4)
    root.mainloop()
    recursive_update()

def recursive_update():
    root.after(200, update_button())
obtuse knot
wary lance
#

update_button() returns None
So root.after(200, update_button()) becomes root.after(200, None).

obtuse knot
#
from functools import partial

def update_labels(l1,l2,l3):
    ...

root.after(200,partial(update_labels,a,b,c))
``` Is what hem was getting at previously btw
wary lance
#

We don't get extra for OTs 😒

#

Surprised you didn't get blocked with the constant polling.

rancid widget
#

hello

tight sentinel
#
selection = ""
while not selection:
    print("do something")
    selection = input("enter to continue or anything else when finished.")
bitter bane
#

Hey! Why don't we have permission to speak in the Python meetings you set up? We can only listen. Or maybe that's just happening to me? πŸ€” Let me know what's up!

primal bison
#

$help

brave boughBOT
#
MemberJoinMonitoring:
  creation_time All commands related to the Creation time trigger.
​No Category:
  help          Shows this message

Type $help command for more info on a command.
You can also type $help category for more info on a category.
primal bison
#

$creation_time

brave boughBOT
#
$[creation_time|crt]

All commands related to the Creation time trigger.

primal bison
#

creation_time

young pulsar
#

@buoyant kestrel join vc1?

buoyant kestrel
#

Can't at the moment

unborn wave
#

wow

unborn wave
#

aa

amber sluice
brazen wave
#

@mellow solar here ^^

amber sluice
#

@mellow solar

mellow solar
#

lenght 640, leght 480

#

naytto.blit(robo, (50+50*i, 100))

amber sluice
amber sluice
mellow solar
#
for rivi in range(10):
    for sarake in range(10):
        naytto.blit(robo, (50 + 50 * sarake, 100 + 50 * rivi))
brazen wave
#

the only change i made was adding the (rivi*10) to the X coordinate in order to induce an increasing displacement for every row

mellow solar
brazen wave
#

@young pulsar you worked so much you broke your leg twice?

mellow solar
#

rivi = row, sarake = column

#
import pygame

pygame.init()
naytto = pygame.display.set_mode((640, 480))

robo = pygame.image.load("robo.png")

naytto.fill((0, 0, 0))

for rivi in range(10):
    for sarake in range(10):
        naytto.blit(robo, (30 + (rivi * 20) + 30 * sarake, 60 + 30 * rivi))

pygame.display.flip()

while True:
    for tapahtuma in pygame.event.get():
        if tapahtuma.type == pygame.QUIT:
            exit()
amber sluice
#

120 + (rivi * 30) + 30

weak moat
#

who needs help making a script

#

i can do almost anything

night lily
weak moat
#

delete bootstrap

#

really anything that can harm ur pc

night lily
#

What about in terms of proficiency?

weak moat
#

ill make any script as long as it isnt used for harmful purposes

night lily
#

What are you bad at?

weak moat
#

ive mastered python

#

probably making games

#

thats my only problem

#

im still learning that

night lily
#

Sounds like a project. I wish you good fortune in the endeavour.

weak moat
#

btw its not that i cant delete bootstrap or harm pcs i dont want to cuz if i run it on my pc im dead

night lily
#

Destruction is simple.

weak moat
#

boutta send u one in ur dms

night lily
#

No, you aren't.

weak moat
#

it will make ur memory to 100% if u check task manager

#

yes

#

i am

#

use it for any malicious content

#

and uhhhhhh

#

act like i didnt give it to you

night lily
#

It needn't be an act at this point.

weak moat
#

boutta send

#

bro

#

ur dms are off

#

turn em on

#

you know what

night lily
#

Chicken butt?

#

I would counsel you against sending grief code in the server.

weak moat
#

proof?

night lily
#

Does the code make you happy?

#

Does it excite your soul?

weak moat
#

nope

#

i gotta sleep so stop dmming

night lily
#

Can't stop that which hasn't begun.

weak moat
#

well just stop talking to me

night lily
#

Very well. I wish you a restful sleep.

native raft
#

hello chat

#

i would like to stream my development

night lily
# native raft i would like to stream my development

Streaming permissions are given to "Voice Verified" roled users upon request to an already-present voice-regular moderator-level user or above at their discretion. You are asking them to monitor your stream.

If you see Mr. Hemlock, Mindful Dev, Alex, Griff or Luna in voice chat, just ask them. πŸ™‚

native raft
#

nice

night lily
#

Permissions (to begin your stream) are usually temporary.

native raft
#

there goes streaming

#

welp

sterile solstice
#

hi

#

hello world

still goblet
#

hello there

white thorn
#

hi

floral summit
#

so i cant talk till i have 50 messages

#

Bruhhh

white thorn
#

guys any no about gsoc

brazen wave
solar copper
#

hi

#

I use thonny for python

primal bison
#

Tf

formal marsh
#

how can i share my screen in the live coding channel ?

night lily
night lily
#

The people to look out for currently are Mr. Hemlock, Mindful Dev, Alex and Luna.

cursive bough
#

test

#

test

void kelp
#

can anyone help me with my project ?

smoky tulip
#

euribor

primal bison
#

hello i have a problem

#

file_path = "C:\Users\koltu\Desktop\SIKERTEN\Project"
extend = "\"
file_merge = file_path + extend

#

its the code

#

i want to share it with my friend

#

it works on me fine but when he tries to install he cant run it cuz of path

#

how can i make it work?

heavy crag
#

Heres the problem I'm trying to solve with code. Let's say we run the code 10 times, we want A, B, and C to be different every time but within their constraints and we want the numbers to ALWAYS add up to 15. What is this type of problem called? And from a math perspective how would you go about solving it?

I understand there's a limited number of combinations here and you could iterate through the numbers to find all the possible combinations then choose from those combinations at random, is that the best way to do this? How would you write that out on paper?

maiden notch
#

so i guess we cant store data between runs of the code but i'd try to use time some how to find one bc time is always unike and if a b and c can be floats there are infinite versions so id do something like:

import time
s=time.time()
while True:
  s-=1
  if s<7 and not locals('a'):
    a=s
  elif s>3:
    b=s
  else:
    c=15-(a+b)
    break
print(a,b,c)
heavy crag
#

Codes taking a longgg time to run for me, if i were to scale this up where there are thousands of solutions idk if this would be the best method? What do you think

maiden notch
#

i didnt think of how to do that but time.time gives a huge numbers so this would take long u need to somehow remove most of s with something first like %10 just i dont know if that works on floats

#

so u could try to replace s=time.time() with s=time.time()%10

#

u could also multiply s by some number if u run the code rarly like by 10 if u run it multyiple times in 10s but not so many times in 1s

rose marsh
#

hey guys

#

can someone help me

maiden notch
fading wagon
#

hey good people can someone help me

pliant pagoda
#

hello there

#

how do u do guys

steep jay
#

catto

azure phoenix
#

I am on it bro

mystic ocean
#

Hey which coc extension would you prefer for python code interpreter in nvim

tranquil ibex
#

hey i still canot talk

#

we

#

stupi

#

d

chilly jacinth
#

hi

wispy perch
#

hey