#voice-chat-text-0
1 messages Β· Page 72 of 1
no
ohk
im not
Anyways I just wanted to say thanks for helping me out with my python.
Peace out guys
Guys. Am I inaudible?
yeh
no. u r zahid.
π
hey
lol
@whole bear π
hi opal
@wanton spruce where you getting these questions from?
if you dont mind telling:]
ty
< 3
i like codewars more than leetcode
thanks for the website:}
dont know much abt deez
:{
im trying to do at least one of the puzzles a day to practice and apply
leetcode works with classses more
code wars works with functions more
i just wanna practice questions in order to improve my logic skills
you can solve the cs50 problem sets
yup
umm m not able to find question from them:{ unfortunately
1 sec
this is the first one
they have 10
sumone even told me abt topcoder
there are many sites
welcome to the league of legends
i am not
have to see sum yt
:}
sorry didnt get you
come again please
@final agate
you can text here
@somber heath can you give the link to your works you showed the other day?
import requests
import time
import telegram
Your Telegram bot's API key
API_KEY = '*****************'
The chat ID of the Telegram user or group you want to send the price to
CHAT_ID = '*******'
The URL for the CoinMarketCap API endpoint for Bitcoin
BTC_PRICE_API_URL = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC&convert=USD'
The header for the CoinMarketCap API request
HEADERS = {
'Accepts': 'application/json',
'X-CMC_Pro_API_Key': '1ccd4cff-17ca-459d-b2ea-1328bacc21a7',
}
Initialize the Telegram bot
bot = telegram.Bot(token=API_KEY)
Function to get the latest price of Bitcoin
def get_btc_price():
response = requests.get(BTC_PRICE_API_URL, headers=HEADERS)
data = response.json()
btc_price = data['data']['BTC']['quote']['USD']['price']
return btc_price
Function to send the latest price of Bitcoin to Telegram
def send_btc_price_to_telegram():
btc_price = get_btc_price()
message = f'The current price of Bitcoin (BTC) is ${btc_price:.2f}.'
bot.send_message(chat_id=CHAT_ID, text=message)
Send the price of Bitcoin to Telegram every hour
while True:
send_btc_price_to_telegram()
time.sleep(5)
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.
wazzup
import requests
import time
import telegram
# Your Telegram bot's API key
API_KEY = '**'
# The chat ID of the Telegram user or group you want to send the price to
CHAT_ID = '**'
# The URL for the CoinMarketCap API endpoint for Bitcoin
BTC_PRICE_API_URL = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC&convert=USD'
# The header for the CoinMarketCap API request
HEADERS = {
'Accepts': 'application/json',
'X-CMC_Pro_API_Key': '1ccd4cff-17ca-459d-b2ea-1328bacc21a7',
}
# Initialize the Telegram bot
bot = telegram.Bot(token=API_KEY)
# Function to get the latest price of Bitcoin
def get_btc_price():
response = requests.get(BTC_PRICE_API_URL, headers=HEADERS)
data = response.json()
btc_price = data['data']['BTC']['quote']['USD']['price']
return btc_price
# Function to send the latest price of Bitcoin to Telegram
def send_btc_price_to_telegram():
btc_price = get_btc_price()
message = f'The current price of Bitcoin (BTC) is ${btc_price:.2f}.'
bot.send_message(chat_id=CHAT_ID, text=message)
# Send the price of Bitcoin to Telegram every hour
while True:
send_btc_price_to_telegram()
time.sleep(5)
'X-CMC_Pro_API_Key': '1ccd4cff-17ca-459d-b2ea-1328bacc21a7',
you sure this isnt your own api key?
how do you get it colored?:{}
this is it
!code
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.
add py
cruiser
hello
i think you leaked your api token
not mine
ah
its @final agate
all it's correct
i just formatted it
`import requests
import time
import telegram
Your Telegram bot's API key
API_KEY = '5889611966:AAFPDSx1jGPO_rdJNtB_9iOQ_vwKSSfsEG0'
The chat ID of the Telegram user or group you want to send the price to
CHAT_ID = '1372325447'
The URL for the CoinMarketCap API endpoint for Bitcoin
BTC_PRICE_API_URL = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC&convert=USD'
The header for the CoinMarketCap API request
HEADERS = {
'Accepts': 'application/json',
'X-CMC_Pro_API_Key': '1ccd4cff-17ca-459d-b2ea-1328bacc21a7',
}
Initialize the Telegram bot
bot = telegram.Bot(token=API_KEY)
Function to get the latest price of Bitcoin
def get_btc_price():
response = requests.get(BTC_PRICE_API_URL, headers=HEADERS)
data = response.json()
btc_price = data['data']['BTC']['quote']['USD']['price']
return btc_price
Function to send the latest price of Bitcoin to Telegram
def send_btc_price_to_telegram():
btc_price = get_btc_price()
message = f'The current price of Bitcoin (BTC) is ${btc_price:.2f}.'
bot.send_message(chat_id=CHAT_ID, text=message)
Send the price of Bitcoin to Telegram every hour
while True:
send_btc_price_to_telegram()
time.sleep(5)
`
are you gonna missuse his token?
then what's the issue?
..
am just kidding
@final agate can you copy paste the error?
c:\Users\Win10\Desktop\BOT.py:38: RuntimeWarning: coroutine 'Bot.send_message' was never awaited
bot.send_message(chat_id=CHAT_ID, text=message)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
await it?
def send_btc_price_to_telegram():
btc_price = get_btc_price()
message = f'The current price of Bitcoin (BTC) is ${btc_price:.2f}.'
bot.send_message(chat_id=CHAT_ID, text=message)
i think you need to work around here
but i've never done bots
yeah but i need a func to sync
API_KEY = '5889611966:AAFPDSx1jGPO_rdJNtB_9iOQ_vwKSSfsEG0'
you even leaked your telegram API key
....
@somber forge π
#discord-bots try this
@somber heath hello
no prb it's a test hhh
its a telegram bot
bot is bot
telegram python sucks
how can i fixe this prb guys now ?
@final agate
Async And Routines are soo useful
@somber heath can you give the link to your graphic work u showed the other day?
forgot the name .....
still rendering != anything to do with async
thats HTTP 2
it gets very specific , since HTTP 1 didnt used to support any ASync
HTTP 1.1 had support for pipelining
but HTTP 2 had multiplexing
HTTP 1.0 was just serial
so pipelining means
its async, but still ordered
they all get downloaded at the same time, but in order
multiplex means theres no order to it
@celest pond π
imma get tea
anyone want a cup?
we have that as well
i love them
but this ones earl grey
hmm
a decent choice
aight imma head out,catch yall later:}
may python be with you
iranian?
yeah
same lol
what are we talking about today
i am not iranian
thought you got it
thought you know the alphabet
fair
so you are in iran or just have the originality?
i am in iran
hiπ
# Write a Python program that accepts
# a list of integers and calculates
# the length and the fifth element.
# Return true if the length of the list
# is 8 and the fifth element occurs thrice in the said list.
what have you done so far
it not working yet but i post what i have
def list_len_fifth(list_nums):
count = 0
if len(list_nums) == 8:
for i in list_nums:
if i == list_nums[4]:
count += 1
if count == 3:
print('True')
list_len_fifth([1,4,6,8,4,6,7,4])
ah ok
it's not returning any value
This is sentence is not correct... What do you mean "calculate the length and the fifth element"
The fifth element what?
5th element of any list
!e py letters = list('abbccc') print(letters) print(letters.count('b'))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | ['a', 'b', 'b', 'c', 'c', 'c']
002 | 2
if count == 3:
what is this doing?
!e py print(False and False) print(False and True) print(True and False) print(True and True)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | False
002 | False
003 | False
004 | True
Checks if the count of elements equal to 5th element equals 3.
fulfill condition that there are at least 3 occurances of 5th element of the list
but you are checking if the value is equal to 3
if it's at least, then you want to check if count >= 3
Nah. It's just =3.
you should check the len of it
well i stopped it at ==3 because anymore is not necessary to fulfill the condition
def list_len_fifth(list_nums : list[int]):
count = 0
if len(list_nums) == 8:
for i in list_nums:
if i == list_nums[4]:
count += 1
if count == 3:
return True
return False
print(list_len_fifth([1, 4, 6, 8, 4, 6, 7, 4]))
print(list_len_fifth([1, 6, 8, 4, 6, 7, 4]))
I dunno this works for me.
But I would not use that solution....
you can just do this:
def list_len_fifth(list):
if (len(list) == 8 and list.count(list[4]) == 3):
return True
return False
print(list_len_fifth([1, 2, 3]))
print(list_len_fifth([1,4,6,8,4,6,7,4]))
I forgot to equal the count to 3 lol
edited
def func(arg):
return len(arg) == 8 and arg.count(arg[4]) == 3```
hahah indeed, even better!
i believe you can use a list comprehension as well
it'll be longer but workable
def list_len_fifth(arg):
return len(arg) == 8 and arg.count(arg[4]) == 3
list_len_fifth([1,4,6,8,4,6,7,4])
so I plugged this into PyCharm and it returning no value at all
@zenith garnet π
@hazy saffron π
you mean like black?
camelCase
snake case is more readable really
prefrence
snake_case
i prefer camelcase
!pep 8
Naming Conventions.
@vestal mason there are simple programs you can write to convert camel case to snake case and vice versa
brb
so this is rust?
@ruby isle π
I can't speak even after completing the eligibility requirements?
!voice
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!verify
module Main where
import Data.Char
import Data.List
import System.IO
import Debug.Trace
data Instr = NoOp
| AddX Int
deriving Show
-- (XRegister, Cycle, SignalStrength)
type Env = (Int, Int, Int)
evalInstrs :: Env -> [Instr] -> Env
evalInstrs env instrs = foldl evalInstr env instrs
evalInstr :: Env -> Instr -> Env
evalInstr (reg, cyc, sig) (NoOp)
| mod (cyc - 20) 40 == 0 = (reg, cyc + 1, sig + (reg * cyc))
| otherwise = (reg, cyc + 1, sig)
evalInstr (reg, cyc, sig) (AddX number)
| mod (cyc - 20) 40 == 0 = (reg + number, cyc + 2, sig + (reg * cyc))
| mod ((cyc+1) - 20) 40 == 0 = (reg + number, cyc + 2, sig + (reg * (cyc+1)))
| otherwise = (reg + number, cyc + 2, sig)
parseLines :: String -> [Instr]
parseLines s = map parseLine (lines s)
parseLine :: String -> Instr
parseLine s | s == "noop" = NoOp
| (take 4 s) == "addx" = AddX (read (drop 4 s) :: Int)
| otherwise = NoOp
main :: IO ()
main = do
contents <- getContents
print (evalInstrs (1, 1, 0) (parseLines contents))
haskell?
nice
i used to use haskell for xmonad
!vban 921958681761947689
:x: This command is not yet implemented. Maybe you meant to use voicemute?
!voicemute 921958681761947689
:incoming_envelope: :ok_hand: applied voice mute to @simple anvil permanently.
!ban 921958681761947689 Trolling, spam leave joining
:incoming_envelope: :ok_hand: applied ban to @simple anvil permanently.
bad troll
!stream @whole bear
β @whole bear can now stream until <t:1675529821:f>.
depends
of what?
- how it handles data ( data that can be manipulated by the user )
- complexity
filter on how you expect the value to be
I know a little bit about of headers but not enough to be confident in any situation about it
what did you think of learning how a injection attack works for preventing?
what i mean when i say filter is
when you know your user is going to give you their email
about complexity it's what makes my mind goes brrrr
regex it , example: ^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$
because it can't be one person
theres no way an email address will have a semi colon in it
so just filter it out like that
elaborate?
like a http sql injection
SQL injection is a very complicated injection method. Its not hard to do it, Buts its hard to properly do it
but use PDO's
boom sql injection fixed
it's very cheap here
or any alternitive
what language are you using?
Best to use the local entity package your language provides
so?
so
query parameterization is the best way to protect against SQL injection
I don't use it anymore
yk most of the time
your hecker.exe wont go ahead and try SQL injection
they will just search around to find more useful info
I I have a file like that running right now
in my school they did that too
i had this guy get my email info from a screenshot of a chrome tab i sent him.... (i didnt intend to have it there, somehow he noticed it though)
I want to know where the attack came from
me
can't be
subjective
it's a trick
were*
in linux distros
no
yes, and it happens through discord
it's not fictional
it's like fake wifi
I think they call evil twins
looks like it's from my own town
evil twins π€£
!e
import dis
print(dis.dis("[1 for i in range(1, 1000)]"))
print(dis.dis("x = []\nfor i in range(1, 1000):\nx.append(1)"))
@terse needle :x: Your 3.11 eval job has completed with return code 1.
001 | 0 0 RESUME 0
002 |
003 | 1 2 LOAD_CONST 0 (<code object <listcomp> at 0x7f3932bc0c60, file "<dis>", line 1>)
004 | 4 MAKE_FUNCTION 0
005 | 6 PUSH_NULL
006 | 8 LOAD_NAME 0 (range)
007 | 10 LOAD_CONST 1 (1)
008 | 12 LOAD_CONST 2 (1000)
009 | 14 PRECALL 2
010 | 18 CALL 2
011 | 28 GET_ITER
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/xekeyagubi.txt?noredirect
got it
Frederik, what are you currently working on rn?
truly one of the games of our time
@whole bear you can select the top half, right click. Somewhere there will be a "float" option
"Layer-> Float"
ew, co-pilot
That one pixel ;-;
.
well my day went to poop, tried to setup a vmhost1(vmftp) to vmhost2(vmftpclient) and borked my vmhost1(vm) connection.. i set everything back to default but no internet.. if I loose it im gonna be so pissed.
hello
Ayo, does anyone understand args and kwargs well ?
Cause
I am trying to learn about them
what's your question
"A variable is a named signpost/reference to a thing in memory. A variable is not the thing, itself. In this way, you can have more than one variable referring to the one same thing in memory." @trail meteor
Ahhh I see thank you!
@glad crow π
Hello!
Well, I can't speak in this vc quite yet.
Although I've been in the server before
haha
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voiceverify
oof
wrong channel
so you program in python I assume π€£
well its nice to meet an individual who shares similar interests
ha
ah i see
Do you maintain any projects?
ah so kind of like http://weavesilk.com/
well you actually draw it on the site
its super cool
Very similar
ah nice
I mainly work on applications and security
Whipper snippering?
sounds like a weed wacker
may just be your country lol
figured as much
I'm currently working on my anti-virus program now
I would have to agree, but I don't see Intel moving away from x86 any time soon
Ah me too
what distro
Nice
I use Fedora
Everything install w/ deepin desktop environment
right
dnf > apt in my opinion
just personal preference though
hang on I will return in a minute
a
alas
vsc is connected to discord
indeed
on my profile
Roblox code haha
I was just touching that up for one of my friends
i feel that downloading 40 gigs of virus signatures every time you want to run a virus scan is a bit excessive
indeed the antivirus just crashed vsc
due to the excessive amount of virus signatures being loaded into memory
do you prefer working on a desktop or laptop?
i can agree
Yeah. He's a youtuber that durability tests devices
then i can make an educated guess that it was not created by Apple
3310?
I would say that I wasnt alive to experience those days
a smart brick
patent pending
what kind of music do you all listen to in australia?
ah
PC Building Simulator Soundtrack
Ultimate Programmer Music
Have you played around with GhatGPT yet?
Its pretty incredible
lol
PC Troubleshooting 101
Ubuntu Problems π€£
what game is it?
never heard of it
That was absurdly loud
pascal is the best programming language
I was thinking about working on a .NET decompiler in python
not sure if itll turn out too well
welp
ima head out
its pretty early in the morning here
so it was nice talking to you!
@warped igloo π
hello
hows your day going?
@remote stream π
hi why idont have permission to speack
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
ok
@somber heath what are you doing?
Image Ai is insane nowadays
Yea The voice Ai worrys me the most
I couldnt even tell it was fake with some of them
hi opal
hi sploof
Hello libra
@somber heath what would you say is the most dangerous form of Ai we have at the moment?
I have a task for python. Can you guys look at it?
I sadly cant help as I'm very bad at python
opal I cant hear you
Oh.
yea i can hear you
i just check my audio on another applications; chrome and it works just fine.
So more regulation and control is what you think should be happening in the Ai space atm
very true
I pray for the courts and systems having to deal with all that in the future
@cyan swallow π
Why can't I speak?
I completely forgot Ai can teach other Ai
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
How?
just forgot
ok opal i can hear you now
@fresh patio π
i had to adjust my settings
hii
Couldnt signatures be forged via Ai as well?
true
Ai movies at some point would be kinda cool
hey opal, you feel like making some code examples?
Might be better than half the netflix originals
The volume of a sphere is 4/3Οr3, where Ο has the value of "pi".
Write a function calledΒ print_volume (r)Β that takes an argument for the sphere's radius and prints the sphere's volume.
Call theΒ print_volumeΒ function three times with different values for radius.
Include all of the following:
The code for yourΒ print_volumeΒ function.
The inputs and outputs to three calls of yourΒ print_volume function
lol
!d math.pi
math.pi```
The mathematical constant *Ο* = 3.141592β¦, to available precision.
my voice is supressed! why?
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
im back
!e py v = 5 v = v ** 2 print(v)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
25
I need an Ai that teaches me coding or does it for me lol
ok
ah i need to wait for 3 days to be able to speak! that's a bummer!
@odd junco π
xD
People like that have too much spare time on their hands
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
1.3333333333333333
intro = input("Welcome to the mini calculator Made by Gaurav")
print(intro)
first = input("enter first number : ")
operator = input("enter operator (+,-,*,/,%): ")
second = input("enter second number : ")
first = int(first)
second = int(second)
if operator == "+":
print(first + second)
elif operator == "-":
print(first - second)
elif operator == "*":
print(first * second)
elif operator == "/":
print(first / second)
elif operator == "%":
print(first % second)
else:
print("Invalid Operation")
yeahh
!d operator
Source code: Lib/operator.py
The operator module exports a set of efficient functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y. Many function names are those used for special methods, without the double underscores. For backward compatibility, many of these have a variant with the double underscores kept. The variants without the double underscores are preferred for clarity.
The functions fall into categories that perform object comparisons, logical operations, mathematical operations and sequence operations.
The object comparison functions are useful for all objects, and are named after the rich comparison operators they support:
does sending messages in here count towards my verification opal?
ok
great
thanks
hello duke
alright
dang looking nice
@stone viperDictionaries are also handy.
hey opal, can i see your code if you will be ok with it?
@stone viper gonna refactor ze code π
bruh
lol
def, parameters of functions, assignment =, power operator **, multiplication operator *, division operator /, return.
intro = input("Welcome to the mini calculator Made by Gaurav")
print(intro)
first = input("enter first number : ")
operator = input("enter operator (+,-,*,/,%): ")
second = input("enter second number : ")
first = int(first)
second = int(second)
if operator == "+":
print(first + second)
elif operator == "-":
print(first - second)
elif operator == "*":
print(first * second)
elif operator == "/":
print(first / second)
elif operator == "%":
print(first % second)
else:
print("Invalid Operation")
@whole bear W
@stone viper give me one second
done
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
2.5
Halo
!e py v = 5 v /= 2 print(v)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
2.5
Two ways of writing more or less the same thing.
v = 5
v = v / 2
print(v)
yes sir duke
....
pp
!e py v = 5 v = v * v * v * v print(v)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
625
!e py v = 5 v = v ** 4 print(v)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
625
!e py v = 5 v **= 4 print(v)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
625
i have a few people on my team right now
!e
v = 69
v = v + v + v
print(v)
@stone viper :white_check_mark: Your 3.11 eval job has completed with return code 0.
207
!e ```py
def func(v):
print(v) #beware
func(5)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
5
!e ```py
def func():
v = 5
return v
result = func()
print(result)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
5
!e
#so first we make an empty variable so we can put our result inside it
output = 0
# now we need to ask the user what numbers they want to work with, but since user might misclick and put in something other than a number
#we put a "while True" function, which will repeat the question forever
while True:
#"try" is a fuction we use when we expect something goes wrong, this will try what you want, and if it doesn't work, raises an exception
try:
#now we get numbers from user, and use the "float" methode to turn their input to actual numbers, because an input is always a str unless we make it otherwise
num1 = float(input("Hello, What is your First Number? "))
num2 = float(input("Your Second Number? "))
#now we need to add a break, this will break the loop if user inputs numbers, so the loop doesn't go on forever
break
#if user puts the wrong kind of input, an exceptaion will be raised that will tell the user what they have done wrong
except ValueError:
print("number needs to be a number")
# now we make a function to get ask user what kind of operation they want to operate on those numbers
#the reason we don't do "try" and "except" here is because we cen't raise a value error, becuase we are not converting the input to numbers
def op():
operation = input("Operation (+, -, *, /)?")
if operation == "+":
output=num1+num2
elif operation == "-":
output=num1-num2
elif operation == "*":
output=num1*num2
elif operation == "/":
output=num1/num2
#if operation input is wrong:
else:
#tell the use what they have done wrong:
print("wrong operation")
#repeat the question of operation
op()
#print the result
print (output)
@stone viper :x: Your 3.11 eval job has completed with return code 1.
001 | Hello, What is your First Number? Traceback (most recent call last):
002 | File "<string>", line 13, in <module>
003 | EOFError: EOF when reading a line
Why i can't turn on my voice?
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
hey opal, I should be at 50 messages soon
Wkwk
@stone viper
def get_number(prompt):
while True:
number = input(prompt)
try:
number = int(number)
break
except ValueError:
print("Invalid input, please enter a valid number.")
return number
def get_operator(prompt):
while True:
operator = input(prompt)
if operator in ["+", "-", "", "/", "%"]:
break
else:
print("Invalid operator, please enter a valid operator.")
return operator
def calculator(firstNumber, operator, secondNumber):
try:
first = int(first)
second = int(second)
except ValueError:
return "Invalid input, please enter a valid number."
if operator == "+":
return first + second
elif operator == "-":
return first - second
elif operator == "":
return first * second
elif operator == "/":
return first / second
elif operator == "%":
return first % second
else:
return "Invalid Operation"
print("Welcome to the mini calculator Made by Gaurav")
firstNumber = get_number("Enter first number: ")
operator = get_operator("Enter operator (+,-,,/,%): ")
secondNumber = get_number("Enter second number: ")
result = calculator(firstNumber, operator, secondNumber)
print(result)
@somber heath how long have you been coding for?
lol
Web development seems pretty cool
I'm in software engineering study program right now so we learn js and we should know that, but i don't know why, i don't really like javascript
Wkwkw
what is java use for? compared to javascript?
Dang learn something everyday
but chatGPT said java doesn't last long lol
Lol
Wonder if schools will ever use chat gpt
My teacher used to copy and paste from Ai for our work all the time
Get/understand?
@somber heath some i understand some i don't
hey sploof, how many days have you been trying to get voice going?
None just started
I remember seeing you here the first day i met opal
I think i said hi but that was it
I think in another year the Ai will finally get fingers and toes
brb guys. I think i can use voice now
Too well
We will war with AI
hey sploof just every now and then go to voice verification channel and type !voiceverify
thankfully we have will smith he was in I robot so we should be fine
!e
code
!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!
!code
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.
!e ```py
print('Hello, world.')
print('Goodbye'.)```
!e py print('Hello, world.') print('Goodbye.')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello, world.
002 | Goodbye.
!e
code
!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!
!e
print("Hello, World")
I still have that suppression over my head.
@robust lichen :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, World
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
__ __ _ ___ __ _ _ __
F \/ ] ____ _ _ /.\ F _ ", FJ FJ L] / J
J |\__/| L F __ J J | | L ______ //_\\ J `-' |J L J | | LLFJ
| |`--'| | | |--| |J J F L|______| / ___ \ | __/F| | J J F LJ L
F L J J F L__J JJ\ \/ /FL______J/ L___J \ F |__/ F J J\ \/ /FJ L
J__L J__LJ\______/F\\__// J__L J__LJ__| J____L \\__// J__L
|__L J__| J______F \__/ |__L J__||__L |____| \__/ |__|
!epy print("Hello guys and girls!")
@buoyant cradle :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello guys and girls!
ββββ ββββ βββββββ βββ βββ ββββββ βββββββ βββ βββ βββ βββ
βββββ βββββββββββββββββ βββ βββββββββββββββββββ βββ βββββββ
ββββββββββββββ ββββββ ββββββββββββββββββββββββββββ βββ βββββββ
ββββββββββββββ βββββββ βββββββββββββββββββββββββ βββ ββββ ββββ βββ
βββ βββ ββββββββββββ βββββββ βββ ββββββ βββ βββββββ βββ
βββ βββ βββββββ βββββ βββ ββββββ βββ βββββ βββ
!e
print("Hello Guys!")
@sturdy terrace :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello Guys!
ββββ
!e ```py
print('Hello World')
print('Good Morning!')
@buoyant cradle :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello World
002 | Good Morning!
Getting good responses π
{
title: 'Tango One',
href: '/movie/watch-tango-one-7898',
image: 'https://img.flixhq.to/xxrz/250x400/379/c6/5f/c65f7d5d25c4f52a4e8424edc9b9fc57/c65f7d5d25c4f52a4e8424edc9b9fc57.jpg',
type: 'Movie',
description: '\n' +
' Three officers are assigned to go undercover and join a mission to capture Den Donovan.\n' +
' ',
releaseDate: '2018-03-02',
genres: [ 'Crime', 'Drama', 'Thriller' ],
casts: [
'Vincent Regan',
'Sophie Colquhoun',
'Richie Campbell',
'Enrique Arce',
'Christopher Ellison'
],
duration: '112 min'
},
{
title: 'One Chance',
href: '/movie/watch-one-chance-9510',
image: 'https://img.flixhq.to/xxrz/250x400/379/6a/dd/6add6a322f6fda5e856c11dbdc1d51e8/6add6a322f6fda5e856c11dbdc1d51e8.jpg',
type: 'Movie',
description: '\n' +
' This film follows the remarkable and inspirational true story of Paul Potts, a shy, bullied shop assistant by day and an amateur opera singer by night.\n' +
' ',
releaseDate: '2013-09-09',
genres: [ 'Drama', 'Comedy', 'Music' ],
casts: [
'James Corden',
'Alexandra Roach',
'Julie Walters',
'Colm Meaney',
'Jemima Rooper'
],
duration: '103 min'
},
!e py import math print(math.pi)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
3.141592653589793
!e
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
print(tf.version)
@sturdy terrace :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 'tensorflow'
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
You can not do tensorflow here!
Have a great time guys. I need to go. Catch you later.
@robust lichen why you learn python? do you wanna learn python for web development or ml or something?
// Hello World! program
namespace HelloWorld
{
class Hello {
static void Main(string[] args)
{
System.Console.WriteLine("Hello World!");
}
}
}
print("hello world")
assembly shd be known then:{}
hello sir
binary is ez asf
01010100101110001010101
lmfao
'yeh yeh'
he is not
very
yes
it does matters
jump off:{}
these "gen z" problems nowadays
"i dont know"
i mean i do
but not gen z "stuff"
how does it bother you?
it doesnt but irritates me to a limit tbh:{}
when smoll kids just "idk"
Part 1
The volume of a sphere is 4/3Οr3, where Ο has the value of "pi".
Write a function calledΒ print_volume (r)Β that takes an argument for the sphere's radius and prints the sphere's volume.
Call theΒ print_volumeΒ function three times with different values for radius.
Include all of the following:
The code for yourΒ print_volumeΒ function.
The inputs and outputs to three calls of yourΒ print_volume function
pp = poopoo
ohh those memes you mean?
talk big man
i cant:{}
m an introvert
agree with the smoll kid @hoary olive
i dont know
"other"
kekw
Sweeney Todd.
npm?
@sly yarrow π
@grim fable
that part
git clone https://github.com/zeyanthecoder/Teron-AI.git
cd Teron-AI
npm install
npm start
i want install it on vs code
@willow lynx
you've already aggregated the data, right?
to install npm, use nvm
vs code?
node version manager
node, that you get from nvm, will be available globally, including VSC
to get git:
https://git-scm.com/download/win
No I amm still stuck in joining. The df
(don't forget to check "add to path")
can you somehow limit the amount of rows?
I'd expect whatever you use for aggregation to allow that
I actually don't know which one I have installed
so this one is for windows
they have installers on release/tags page
@flat locust π
Hi
OpalMist
can you guide me on why am I suppressed with audio in the voice chat
I joined the chat but was unable to speak in it
@somber heath
hey
hi
please sombody help me
for what bro
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
i cant install moudles in python who knows where is the problem
what
The instructions for install are given within the linked site.
i don't know him bro XD
how many languages do you guys know ?
enough to get by
oh that's cool
For me I know C, C++ , Python, CSS, Java
c++ html css java python
oh that's good
- not in path
pythonnotPython
(either or both)
C is so haaardπ€―
do you use Django ? @sour imp
yeah
I don't think so I guess Java is more of a mess in compared to C or C++
i agree
I am having myself to learn Java and somewhat trying to be good in CSS to make good looking websites from scratch which for sure is difficult if you do it from scratch
what about ceh
You are radiating motivation for me to learn more frameworks in it ... I hope one day I could also say that
pedophilia
why -m?
@somber heath
error again
what
oh okay
aahhahhahhhhhhhhh
opal
um i dont know
ohhhh you right
okay
just a minute
um
opal
from here?
I guess.
okay
@somber heath thank you opalποΈ
code harry?
hello
Octodad: Dadliest Catch is about destruction, deception, and fatherhood. The player controls Octodad, a dapper octopus masquerading as a human, as he goes about daily life.
Octodad: Dadliest Catch is set to release on PS4 in 2014 and is being made by an independent studio in Chicago , Young Horses.
Find out more about Octodad on our site: ht...
so what you sayπ
25kb/s
If observing things heats them up, how many people would it take staring at a pot of water to make it boil?
Chicken slappers be like, "We've got this."
Emo matter.
lol
Locks itself in its room. Says we don't understand it.
i joined and the first thing i get to hear is this
nice m not always late
:}
nahh
g2g for a bit. I'll be back later
hello opal
no
there are two primary atoms or what ever in our eyes
one for colors
one for light
i presume if theres a ton of light you see black aswell
Hm?
The best way to learn how fish swim in microgravity is to take them into space and watch what happens
obv it doesπ
Nasa logic
The best way to learn how the human reacts to no oxygen is to take them into space and watch what happens ! brilliant
I dont know why nasa decided sending a cat to space would be a good idea, as it cannot do anything
poor dude
lmao
Im gonna switch back to linux and I'll brb
How do I screenshare?
define main() {
board = [[false; 10]; 10]; // create a 10x10 array of bools
new_board = board;
board[2][1] = true;
board[3][1] = true;
board[4][1] = true;
println("Generation: 0");
draw_board(&board);
iters = 5;
for i in 0..iters {
for x in 0..10 {
for y in 0..10 {
neighbors = check_neighbors(&board, x, y);
new_board[x][y] = board[x][y];
if board[x][y] {
if neighbors != 2 and neighbors != 3 {
new_board[x][y] = false;
}
} else if neighbors==3{
new_board[x][y] = true;
}
}
}
print("Generation: ");
println(i+1);
board = new_board;
draw_board(&board);
}
}
define check_row_neighbors(board: &bool[10], y: i32) -> i32 {
neighbors: i32 = board[y];
if y>0 {
neighbors+=board[y-1];
}
if y<9 {
neighbors+=board[y+1];
}
return neighbors;
}
define check_neighbors(board: &bool[10][10], x: i32, y:i32) -> i32 {
neighbors = 0;
if x>0 {
neighbors += check_row_neighbors(&board[x-1], y);
}
neighbors += check_row_neighbors(&board[x], y) - board[x][y];
if x<9 {
neighbors += check_row_neighbors(&board[x+1], y);
}
return neighbors;
}
define draw_row(row: &bool[10]) {
for i in 0..10 {
if row[i] {
print("ββ");
}else {
print("ββ");
}
}
println("");
}
define draw_board(board: &bool[10][10]) {
for i in 0..10 {
draw_row(&board[i]);
}
println("\n\n\n");
}
hello
wsp
@lucid blade why do you sound like Captain Price?
most people in the vc dont have permission to speak
i want talk
!voiceverify in #voice-verification
@glad crow i must have 50 posts to speak
@terse needle what distro is that?
void
nice
looks like arch linux
just another minimal distro
hes asking what is the purpose of a lambda calculus interpreter
i miss crunchbang π¦
it was my favourite
but i hear someone has made a similar os / continued the project
guys i need help
i need a javascript script which is not beutified
to test my software
Either
"ps1", "py", "js", "html", "css", "vbs"
are supported
extensions
Hello again mr @somber heath
i am making the best programmer snack
dino nuggies
cup of tea*
You can get some sample code by pressing CTRL + SHIFT + I on your browser there you can find the js code of the website
1337 H4CK3R
Griff, could i be able to screenshare?
β @cosmic bison can now stream until <t:1675624615:f>.
str(arg)
fair enough
haha
''.join([chr(x) for x in arg])
yes π
You can drop the []
That ultimately what i did
You could also use map instead, but it's not as pythonic.
Does anyone in the vc mind reading over my code to check for any optimizations?
import os
import re
import bs4
import jsbeautifier
import autopep8
import cssutils
import argparse
def beautify_powershell(code):
code = code.strip()
code = code.replace("\r\n", "\n")
code = code.replace("\n", "\r\n")
code = "\r\n".join([line.strip() for line in code.split("\r\n")])
return code
def beautify_python(code):
return autopep8.fix_code(code)
def beautify_javascript(code):
return jsbeautifier.beautify(code)
def beautify_html(code):
soup = bs4.BeautifulSoup(code, "html.parser")
return soup.prettify()
def beautify_css(code):
return cssutils.parseString(code).cssText.decode('utf-8')
def beautify_vbscript(code):
code = re.sub(r'(\s)\s+', '\\1', code)
code = re.sub(r'(\n){2,}', '\\1\\1', code)
return code
def beautify_code(code, language):
if language == "ps1":
return beautify_powershell(code)
elif language == "py":
return beautify_python(code)
elif language == "js":
return beautify_javascript(code)
elif language == "html":
return beautify_html(code)
elif language == "css":
return beautify_css(code)
elif language == "vbs":
return beautify_vbscript(code)
else:
return code
def main():
parser = argparse.ArgumentParser(description='Beautify code in a file.')
parser.add_argument('file_name', type=str, help='Name of the file to beautify')
args = parser.parse_args()
file_name = args.file_name
ext = file_name.rsplit(".", 1)[-1]
if ext not in ["ps1", "py", "js", "html", "css", "vbs"]:
print("Unsupported file type.")
return
with open(file_name, "r") as f:
code = f.read()
beautified_code = beautify_code(code, ext)
modified_file_name = file_name.replace(".", "_modified.")
with open(modified_file_name, "w") as f:
f.write(beautified_code)
print(f"Code beautified successfully. New file: {modified_file_name}")
if __name__ == "__main__":
main()```
thats more code than i thought
if elif chains can often be refactored into a dictionary.
Another thing is a lot of your functions are just calling one function, anyway.
I get why you've done this, but it does make for what amounts to an unnecessary intermediary complexity.
do
i do *
@somber heath so instead of this:
if language == "ps1":
return beautify_powershell(code)
elif language == "py":
return beautify_python(code)
elif language == "js":
return beautify_javascript(code)
elif language == "html":
return beautify_html(code)
elif language == "css":
return beautify_css(code)
elif language == "vbs":
return beautify_vbscript(code)
else:
return code
we could do this?
functions = {
"ps1": beautify_powershell,
"py": beautify_python,
"js": beautify_javascript,
"html": beautify_html,
"css": beautify_css,
"vbs": beautify_css
}
if language in functions.keys():
return functions[language](code)
else:
return code
Meh, it's DevOps scripts, rock on!
Also look into dict.get.
ah
so like this?
functions = {
"ps1": beautify_powershell,
"py": beautify_python,
"js": beautify_javascript,
"html": beautify_html,
"css": beautify_css,
"vbs": beautify_css
}
if language in functions.keys():
return functions.get(language)(code)
else:
return code
or would that not work
Chew on dict.get.
!e py data = {'a': 'A'} a = data.get('a', 'Hello, world.') b = data.get('b', 'Hello, world.') print(a) print(b)
hiπ
ah ok
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | A
002 | Hello, world.
indeed it is either one or the other
I should have slept hours ago.
staying up late are we?
\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u200e' in position 11: character maps to <undefined>"
I am trying to save data in .csv file and getting this error
any soln for this
https://stackoverflow.com/questions/27092833/unicodeencodeerror-charmap-codec-cant-encode-characters
I'm trying to scrape a website, but it gives me an error.
I'm using the following code:
import urllib.request
from bs4 import BeautifulSoup
get = urllib.request.urlopen("https://www.website.com/")
@river thistle
Thankyou I figured it
@scenic stratus π
1
3
5
7
9
88 128 152 172 190 208
@somber heath im going to work on what you told me to.thanks
Input Text -> Generator -> Encoder -> Output Embeddings
@whole cairn π
In a bit.
We build a Generatively Pretrained Transformer (GPT), following the paper "Attention is All You Need" and OpenAI's GPT-2 / GPT-3. We talk about connections to ChatGPT, which has taken the world by storm. We watch GitHub Copilot, itself a GPT, help us write a GPT (meta :D!) . I recommend people watch the earlier makemore videos to get comfortable...
I would say you don't need try/except and unless you're writing unit tests or giving a demonstration, assert is to be avoided.
!e py a = 5 b = 4, 5, 6 c = a in b print(c)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
!e py print(not True) print(not False)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | False
002 | True
now im getting this
Hey @whole bear!
It looks like you tried to attach file type(s) that we do not allow (.pdf). 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.
I'm noticing a space where it may not expect one.
where is that, ive been staring at this thin so long im numb and cant ntoice
In a string.
...
Two error messages...okay...
What does the terminal show?
Put the space back in.
Hm.
lol this stupid bot grader
Yeah.
I'm not sure what the deal is, there.
Have you covered sys.stdin?
I'm not suggesting you use it, but I'm wondering if there's something where it's getting crabby with the user input reflecting out as stdout which would be weird and I'm grasping at straws here.
Some courses insist on sys.stdin vs input.
Hello everyone, I need helping regarding the Pylint extension in Vscode and enabling the same. It seems thar Jedi is also presentable with Pylint however I would like to disable Jedi ( if possible ) and to get βpossible fixes β from Pylint

.