#voice-chat-text-1
1 messages ยท Page 5 of 1
@ripe bear
hey is it worth it to become a py dev for a semi big corps it dep.
@crystal aurora
for element, set_idx in enumerated(set_):
assert set_idx <= list_.index(element), f"Element {element} was found in list before set"
from collections import Counter
num = int(input())
sep = []
for _ in range(num):
text = input()
sep.append(text)
x = Counter(sep)
print(len(list(x.keys())))
res = []
for key, value in x.items():
res.append(value)
print(*res)
I like this way of writing it better:
assert all(
set_idx <= my_list.index(element)
for element, index
in enumerated(set(my_list))
), "Set of list is not stably ordered"
@crystal aurora if you want chaining: https://pypi.org/project/fluentpy/
as i said, a bit of a ugly hack
nice pl
Just the artist playlist. Their songs are great
yeah
Are you the OpalOpossite
Yeah I'm the opposite one
Nice to meet you Opal-site
Simple, elegant, Pythonic functional programming.
oh that's neat
does it have a LSP server?
No clue^^
you can send a message here and we can respon in voice
sorry
im trying to talk hahaha
and sorry my English in bad
So
im try to use google drive api
and its not working
songs and things
https://patreon.com/briandavidgilbert
https://briandavidgilbert.com
business inquiries: briandavidgilbert.com/contact
@pale pivot Byee
Byee
flashing lights warning https://www.youtube.com/watch?v=qrMwxe2ya5E
"The Greatest Show on Earth" from VEHICLE OF SPIRIT - Wembley 2015 featuring Richard Dawkins, English ethologist, evolutionary biologist, and author.
Directed by Ville Lipiรคinen.
LYRICS:
https://genius.com/Nightwish-the-greatest-show-on-earth-lyrics
NIGHTWISH is:
Tuomas Holopainen - Keyboards
@Floor Jansen - Vocals
@Marko Hietala - Bass
Emppu...
Might be back on later in a couple.hours if you're around
Hmm
oooh
What context was this term used in in our discussion?
Hey @olive echo
you looking whether you can discover my name from my online name
"sorry i nerdsniped you into doing that"
oh yes.
I was nerd snipped
ah yes
How's it going
!e ```py
import ast
print(ast.dump(ast.parse("""for a in range(100):
if a in (1, 2): a
"""), indent="\t"))
@dry perch What sign language do you use? ASL?
@golden marsh :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Module(
002 | body=[
003 | For(
004 | target=Name(id='a', ctx=Store()),
005 | iter=Call(
006 | func=Name(id='range', ctx=Load()),
007 | args=[
008 | Constant(value=100)],
009 | keywords=[]),
010 | body=[
011 | If(
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/ojofefikip.txt?noredirect
@misty sinew
Night y'all.
Everyone who should be sleeping, plis go sleep.
- The Hypocrite in me
Looking at you @golden marsh
allright allright
ye
im so so at it though
so i only use it when i dont feel like talking
still learning
Ah okay. I know the alphabets in ASL.
I'm learning ISL (Indian Sign Language)
.
get pip is for linux, isn't it?
.
pip isn't installed
it will error with get-pip.py not found
that one should work
@south schooner
maybe your pip got removed by antivirus
check antivirus list of quarantined files or something like that
there should be an option to whitelist
ok
speaking of hacking, I should be doing CTF right now
with what
heat=float(input("Please enter the pool temperature in F: "))
pur=input("The purpose for swimming (adult, children, or racing):")
def isSafe(pur,heat):
if pur=="adult" and heat>=83 and heat<87:
return True
elif pur=="children" and heat==90:
print=("The saftey is: True")
elif pur=="racing":
distance=float(input("Please enter the length in M: "))
if distance>5 and heat>=77 and heat <=87.9:
print("The saftey is: True")
elif distance <5 and heat>=77 and heat<=86:
print("The saftey is: True")
else:
print("The saftey is: False")
else:
print("The saftey is: False")
isSafe(pur,heat)
can enybody help me w this?
which root terminal command to apply to upgrade Python from old to latest?
You ok @faint warren ? ๐
Ah yeah. I use direnv to activate python venvs.
@digital cradle byee
# Export all .gitignored (potentially) secret environment variables
#echo "files: $(find . -maxdepth 1 -type f -name '.env*' -and -not -name '.envrc')"
find . -maxdepth 1 -type f -name '.env*' -and -not -name '.envrc' -print0 |
while IFS= read -r -d '' file; do
# loop-iteration per file
echo -e "Gonna read:\t$file"
if ! [ -r "$file" ]; then return; fi;
for line in $(cat "$file"); do
# loop iteration per line in file
echo -e "trying to export:\t$line\tIn file: $file"
eval "export $line"
done
done
What's the issue?
๐
Maybe you could write a function and use xargs ยฏ_(ใ)_/ยฏ
Erm, one sec sorry.
load_envs() {
for file in "$@"
do
echo "Loading $file"
cat "$file" | while read line
do
...
done
done
}
This is probably full of errors 
Erm, yep ๐
Although now that I think about it, I'm not sure you can use a function as the argument to xargs.
I was thinking bash find ... -print0 | xargs -0 load_envs but I realise now that xargs doesn't accept a function.
Errr
Yall wanna see an ai creating a to do list manager?
load_envs() {
local line
...
}
tasks = []
def add_task(task):
tasks.append(task)
print("Task added: ", task)
def view_tasks():
print("Tasks:")
for task in tasks:
print(task)
def mark_complete(task):
tasks.remove(task)
print("Task completed: ", task)
while True:
action = input("What would you like to do? (add/view/complete) ")
if action == "add":
task = input("Enter task to add: ")
add_task(task)
elif action == "view":
view_tasks()
elif action == "complete":
task = input("Enter task to mark complete: ")
mark_complete(task)
else:
print("Invalid action")
list.remove(x): x not in list
ValueError
Im making an AI code snake in python
@mild flume whatcha doin'
@mild flume what you programmin
Just relearning PowerShell
shudder
Don't have a lot of time to do anything in depth for programming (have holiday deliveries here shortly)
I like it
Asia check in ๐โโ๏ธ
@mild flume How do you get voice verified?
@primal igloo Check out the #voice-verification channel. That'll tell you what you need to know
Thank you!
@raven orbit Hey
@latent knot #microcontrollers
Hes beautiful! Many pets
@deft roost bye?
tis a gun
@misty sinew @rocky granite
:incoming_envelope: :ok_hand: applied mute to @astral spoke until <t:1671643387:f> (10 minutes) (reason: attachments rule: sent 8 attachments in 10s).
The <@&831776746206265384> have been alerted for review.
!unmute 156198616065769472
:incoming_envelope: :ok_hand: pardoned infraction mute for @astral spoke.
Maybe send less photos at once
Thanks, will try to remember this limitation^^
Unhealthy
@misty sinew challenge accepted
@rocky granite you didn't ask, but here's a heartily recommended solution to your mic problem =) https://www.pcmag.com/reviews/sennheiser-gsp-370
Can you gift it to me while you are at it
Can't afford, and maybe it'd be a better fit for the "final" owner to purchase it themselves? ;)
I would if I could
You win with this one

๐ณ๏ธ ๐ณ๏ธ ๐ฎโ๐จ

Mole
the one without sugar
As i didn't verify for voice chat I can't tell what Gymkhana is๐.Gymkhana is nothing but a event designed to test driving skills
@mild flume may I screenshare?
hi guys
Yeah one sec
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!stream 156198616065769472 3w
โ @astral spoke can now stream until <t:1673460382:f>.
someone here?
Hey @candid garnet!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
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.
res = struct.unpack(">4s",b"\x74\x72\x61\x6B")
str(res[0],'utf-8')
str(res[0],'utf-8')
@candid garnet
ow okay sorry
thats better
umm what are you doing i didn't he
hear it weell
well
broo i'm making way too much orthograph faults its dramatic
ok
cool
yes yes
and chat ai
yes math is incredible
i'm actually making some olympic maths
i'm part of the frensh team of IMO
IMO stands for International Maths Olympiad
quite cool
so yeah maths is clearly better than programming
but actually right now we still need coders
what?
lmao
yes
yes
for real
i fucking agree
nope
can you send a link
yeah cool
and it's about what?
oww
it
is
sooo
coool
incredible
yes python has been made for math
yes
lmao you're better than you're teacher
lmao
actually you're better at optimising
Bro i think you have some connection problem
or it's your mic that isn't
in front of your mounth
mouth
how many lines have your projetc
projetc
projeeect
wooow
i'm have some problem don't I
lmaoo i correct my self with the same error
Um how can I get access to a mike
?
hey'
:incoming_envelope: :ok_hand: applied mute to @trail crag until <t:1671716557:f> (10 minutes) (reason: duplicates rule: sent 4 duplicated messages in 10s).
The <@&831776746206265384> have been alerted for review.
hello
Ran 54 tests in 1.219s
OK
== Tests result: FAILURE ==
368 tests OK.
2 tests failed:
test_codecs test_locale
25 tests skipped:
test_aepack test_al test_applesingle test_bsddb test_bsddb185
test_bsddb3 test_cd test_cl test_dl test_gl test_imageop
test_imgfile test_kqueue test_linuxaudiodev test_macos
test_macostools test_msilib test_ossaudiodev test_py3kwarn
test_scriptpackages test_startfile test_sunaudiodev test_winreg
test_winsound test_zipfile64
2 skips unexpected on linux2:
test_bsddb test_bsddb3
Total duration: 12 min 56 sec
Tests result: FAILURE
Trying:
test = doctest.DocTestFinder().find(f)[0]
Expecting nothing
ok
Trying:
[e.lineno for e in test.examples]
Expecting:
[1, 9, 12]
ok
doctest (test_zipped_doctest) ... 46 tests with zero failures
ok
test_doctest_main_issue4197 (test.test_zipimport_support.ZipSupportTests) ... Expected line File "/tmp/tmp0DVICP/script.py", line 2, in __main__.Test
Got stdout:
liveOverFlow
Grant Collins
Capture The Flag, CTF teams, CTF ratings, CTF archive, CTF writeups
The Hacker101 CTF is a game designed to let you learn to hack in a safe, rewarding environment. Hacker101 is a free educational site for hackers, run by HackerOne.
Capture The Flag Competition Wiki
@stuck bluff whatโs the best project you ever made?
!voiceverify
makes me think of
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!
Am looking for a one teammate or two by max so we can learn together and solve ex. From leetcode everyday by choose a specific hour. I just start to attend udacity course for algorithms and data. Anyone interested DM me
voice chat
!user
You are not allowed to use that command here. Please use the #bot-commands channel instead.
@outer umbra i'll talk here
def is_acceptable_password(password):
if len(password) < 6:
return False
for digit in "0123456789":
if digit in password:
return True
if digit not in password:
return False
so this fails on something like 11111111 right
kinda yea
mhm
so the idea is that you don't want to return false in the loop
because it could be that other digits are present, just not this one
mhm
but now try xxxxxxxxx
def is_acceptable_password(password):
if len(password) < 6:
return False
for digit in "0123456789":
if digit in password:
return True
x = is_acceptable_password("111111111")
print(x)```
yep
so if it ran through all the digits and didnt return true, then we know it doesnt have any of them
so you can place a final return False after the loop
not inside, after
ye
def is_acceptable_password(password):
if len(password) < 6:
return False
for digit in "0123456789":
if digit in password:
return True
else:
return False
x = is_acceptable_password("111111111")
print(x)```
๐ (the for-else is actually something different, but still valid)
def is_acceptable_password(password):
if len(password) < 6:
return False
for digit in "0123456789":
if digit in password:
return True
return False
this would be good
you don't need it
yea
it can return anything ye
yea no need to add brackets
print needs it because print is a function
what's the test case it's failing
here's fine, we only disable images in general
you have an extra indent on the return
nice
๐
mm let's see, not too sure how strict the question is here
mm yea
but if its not convertable to an integer then it would cause an error
also -11111111 is an integer but not all digits
you could use an try except yea
yep
you could do
try:
int(password)
except:
...
dont really need an if/else, the try/except kinda becomes the branch
still in the function yea
once you finish the except it should disappear
def is_acceptable_password(password):
if len(password) < 6:
return False
for digit in "0123456789":
if digit in password:
return True
return False
try:
int(password)
except:
return True
else:
return False
x = is_acceptable_password("123123213123")
print(x)```
same as before, you dont need the else after the except
def is_acceptable_password(password):
if len(password) < 6:
return False
for digit in "0123456789":
if digit in password:
return True
return False
try:
int(password)
except:
return True
x = is_acceptable_password("123123213123")
print(x)```
ah right
you still have the return false above it
just remove it
also we need to modify the for digit loop
def is_acceptable_password(password):
if len(password) < 6:
return False
for digit in "0123456789":
if digit in password:
return True
try:
int(password)
except:
return True
x = is_acceptable_password("123123213123")
print(x)```
if it is not all digits then int(password) fails, which goes into the except
mhm
we need to shift things around though
at the moment the for loop will return immediately
we need to shift it after the try
but now the question is, inside the except or outside
ye with the return true
should the for loop go in the same place as the return true, or should it go after it
think about what you want to check and when
.
ye kinda
but the for loop actually needs to be inside the except
the except runs when its not all digits, but we still need to check that there's at least one digit
def is_acceptable_password(password):
if len(password) < 6:
return False
try:
int(password)
except:
return True
for digit in "0123456789":
if digit in password:
return True
x = is_acceptable_password("Banana2")
print(x)```
def is_acceptable_password(password):
if len(password) < 6:
return False
try:
int(password)
except:
for digit in "0123456789":
if digit in password:
return True
return False
x = is_acceptable_password("234832480248234")
print(x)```
yep
ah that
kinda
typically you'd want to be more specific about what exception you're catching
yea pycharm is more for heavy work
so
except:
is called a bare except, it catches absolutely all exceptions
which can be bad
ye
except ValueError:
in real code we'd do this
so it only catches valueerror (which comes from int)
!e
int("abc")
@still meteor :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 | ValueError: invalid literal for int() with base 10: 'abc'
see
ye
any other error would pass through, which is actually good
because we only expected valueerror, we want to know what other errors come
!e
0/0
@still meteor :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 | ZeroDivisionError: division by zero
there are many yea
and you can make your own exceptions
nah its over time
mm
you could put it in the if/else body
or the reverse, you could return early if its long enough so the try/except doesnt run
def is_acceptable_password(password):
if len(password) < 6:
return False
if len(password) > 9:
return True
else:
try:
int(password)
except ValueError:
for digit in "0123456789":
if digit in password:
return True
return False
x = is_acceptable_password("123xxx123")
print(x)```
cya ๐
speak more

You already have the role, so you've already verified
You do have to leave the chat for the permissions to take effect
If you join back now does it still say you're suppressed?
its good now
hi
i dont have headphones now ;-;
do you have liveshare installed?
if you want to share the screen of VS Code
no, like, not using the stream
but using read-only liveshare
there is an option to share it as read only
send in DMs
(for safety reasons)
there is Live Share button at the bottom panel
it copies the link by default
I prefer not to be in DM calls
you have the link in the clipboard
probably
should be something like that
it should load after some time
it's strange that it doesn't
you can cancel it and retry
though I doubt it'll help
joining
there's a way to somehow share the currently edited document
it's more easy to configure VS Code properly
do you have the project in the workspace or somewhere else?
open the directory with the file as a workspace
there is this thing on the left
if there are no files, then you didn't open a workspace
yes, this thing
live share allows to edit/view only what's inside the workspace
you should probably just select the correct workspace (folder) not create the file
are there files now in the VS Code's explorer?
like, the bot's script file
just locate where the file already is
you were editing a file
open the folder it's in
do you know where your file is?
open that folder using file->open folder
(then do live share again)
I see the file
I formatted the file so it's easier to read
alt+shift+f in my settings
generally, should prevent self-response
though there are other problems potentially
re-run it to test
oh
weird
what version of discord.py?
run pip list
now run
pip install --upgrade discord.py
run in admin terminal (outside of VS Code)
if you have permission issues
key word being "admin"
def mutate(a_list):
b_list = []
for item in a_list:
new_item = item * 2
b_list.append(new_item)
print(b_list)
mutate([1,2,3,5,8,13])
can u help me debug this?
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
like i want it to print the values in the list multiplied by 2
you are missing indentation
but it gives 26
def mutate(a_list):
b_list = []
for item in a_list:
new_item = item * 2
b_list.append(new_item)
print(b_list)
mutate([1,2,3,5,8,13])
how do u convert the text to code format?
!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.
b_list = []
for item in a_list:
new_item = item * 2
b_list.append(new_item)
print(b_list)
mutate([1,2,3,5,8,13])
oh
cool
running pip install --upgrade pip might have broken the pip
this is why there is python -m pip install --upgrade pip
lol the code aint colored but ok
```py
the code
```
if you have ModuleNotFoundError: No module named 'pip' then you've broken your python somewhat
def mutate(a_list):
b_list = []
for item in a_list:
new_item = item * 2
b_list.append(new_item)
print(b_list)
mutate([1,2,3,5,8,13])```
cool
don't upgrade pip using pip.exe
reinstall python so you unbreak the pip
like it said to use E:\Downloads\python.exe -m pip install --upgrade pip not just pip.exe install --upgrade pip:
You should consider upgrading via the 'E:\Downloads\python.exe -m pip install --upgrade pip' command.
just make sure the pip and path options are both selected
("install pip" and "add to path")
now, run pip list in VS Code again (don't forget to restart the terminal)
- to open new terminal
does it do the same error?
python -m ensurepip
this may fix the pip
now pip list again
this gives the same error, right?
pip install --upgrade discord.py
now run the bot again
for commands, it's easier to use discord.ext.commands.Bot instead of discord.Client
it automatically does the message.author == client.user check and other stuff
there is an event related to that
same as on_message
you can store the token in a file
the venv?
or a file?
env
rpi has ARM architecture
i.e. not x86-64
some programs may fail to install
try running the bot now
does the command work with the code that's now there?
!hello command that is
restart the bot and test the command
you did restart the bot, right?
I didn't see the terminal changing
CTRL+C
in the terminal
now test commands again
the code has changed since 14 minutes ago
there is a way to do the slash commands
@bot.hybrid_command actually already describes it as slash command
but
you need to sync it
restart the bot
and the !hello works now, right?
restart the bot again
I used the decorator incorrectly
should work now
maybe even slash will show up
does the slash command work?
so
what hybrid_command is:
it adds a command as prefix command (!something)
and as a slash command (/something)
music bots are mostly against ToS
are you familiar with ffmpeg?
I won't say how to play music from youtube because rule 5
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
to play music from a file, you can use discord.FFmpegPCMAudio
or discord.FFmpegOpusAudio
any streaming services not only youtube
unless you have an explicit permit or own the music
I help distributing some
(and help with some technical aspects of the production)
it's basically:
if you can legally acquire files and you have a license to play them, you can use these files in the music bot
there is a very blurry line
you definitely can't do it for monetary gain unless you're contracted as a distributor with the contract explicitly allowing music bots
the most problem YouTube has is that bot authors make money
instead of them
copyright infringement
most bots now stopped supporting music from YouTube
because of legal troubles
Spotify has direct official integration with discord
Spotify has some official APIs/SDKs
Application Programming Interface
set of protocols to interact with some software
I have no idea how Spotify integration works
I am really not sure if it can be done without violating ToS
of either Discord or Spotify
doing this commercially will definitely be against ToS
"commercially" being roughly approximate to "for money"
if you make money from it, you violate ToS
I deliberately don't say some things as to not violate this
doing media bot on your own in any case is not very feasible
I'd recommend not touching this topic until you understand the legality and the technical details deep enough
in short, just don't do it
you can try doing text-to-speech idea instead
link deleted as not sure about appropriateness
though I'm not sure about this one being fine
it says it uses "undocumented Google Translate speech functionality"
the more appropriate is https://cloud.google.com/text-to-speech/
this one is offline
https://github.com/nateshmbhat/pyttsx3
so no troubles with google
will involve ffmpeg anyways
this seems to be free, as it's offline
it's a package/module
https://pyttsx3.readthedocs.io/en/latest/
follow the readme
here
it will show how to use it
save_to_file option is probably preferred
the example isn't long because it's all the necessary things
it just shows many fine configuration options available
as for installation, it's this
https://github.com/nateshmbhat/pyttsx3#installation-
it may fail on windows though
(may require some additional libraries)
in some cases
did you run it from VS Code?
just open the terminal in the same VS Code workspace
and run pip install pyttsx3 there
no don't save as workspace
the session ended
and the file was already in the workspace
live share again
it's better to create and then open
instead of the other way around
file plus button in the VS Code explorer
run it
run again
it's weird that it errors
hi
try to look up the docs for all the code later
I'm looking for the attachments parameter
can't find
im sorry
easy fix
im gonna go
so this should reply with a file of tts recording
!tts something
restart the bot
sent mp3?
valid mp3?
yes, it's random hex
the sent file is just for test
it should also play the file if you are in the vc which it can see
I can join if you want to test it there
(if you DM the invite)
D
so the way to share timezone currently is:
"midnight for me is <t:1672520400:t> for you"
requires updating from time to time though
to get the midnight timestamp:
datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0).timestamp()
like NodaTime for .NET?
the thing that Jon Skeet makes
top 1 person by rating on StackOverflow
Jon Skeet can recite ฯ. Backwards.
that reminded me of GitHub Copilot's answer to the last digit of pi
!e
import math
print(str(math.pi)[-1])
@delicate wren :white_check_mark: Your 3.11 eval job has completed with return code 0.
3
MCQ? MSQ?
MySQL?
(didn't hear)
any column can be FK if you need to in most cases
What does FK mean
foreign key
they sometimes abbreviate it as such in constraint name
fk_ or _fk
yeah, and then someone needs to call Mark Rendle to create the database "unfucker"
"unfuck.exe" as it was shipped to the customer
I got so tired of using any SQL in any form that now I live purely on in-memory key value stores
if a project needs a RDBMS, I just don't develop that project
I don't even know what a foreign key is tbh
django has good DB support
reference to another table
In the same database?
usually, yes
foreign key A->B requires every non-null value in column A to have an equal value in column B
A and B being in different tables
C# has official discord server, afaik
it had anime channel for some reason if I remember correctly
it was weird
I may mix it up with D#+
@stuck bluff
-- what do you do then?
-- gardening
@upbeat wyvern database project or a project using a database?
oh
the second one
for some application SQL-using RDBMSs is both easier and more stable
did I just hear CAP theorem mentioned by a wrong name?
oh, my brain failed to parse the phonemes
"Brewer's" and "Turing's" are very similar in pronunciation
there is a problem with Twitter architecture
people that built it are not there anymore
same and even worse with Oracle
or just raise the threshold
I've just made something quite amazing in terms of its functionality
I can query my site over the http(s) to get the number of requests it currently works on
so now I should make it extensible; but intentionally limited as to not break everything
I'm actually steering more into database project but honestly, I'm just tryna make a project that stores my data. Don't know probably both. Originally I just wanted to store data and so learning database was just a byproduct
like, the current request is that:
{
type: "monitoring",
operator: null,
target: ["modulename", "ClassName", "method_name"],
instrumentation: "Concurrency",
catches: { "not an operator": null, "*": null },
}
and the list of available target-instrumentation tuples is right now hard-coded
PKs can be multi-column if I remember correctly
sometimes in some RDBMSs
thats fk
PK is one thing
because using UNIQUE makes a primary key
example from SQLite:
Optionally, a PRIMARY KEY for the table. Both single column and composite (multiple column) primary keys are supported.
ah interesting
got a mixup
this is just me reminding myself about helping someone else previously where I came up with a solution that involved a composite PK
I see str.format on SQL
sql injection
hi
:))))
@upbeat wyvern you shouldn't be dynamically substitute table names in the first place
why do you have multiple same tables?
@upbeat wyvern why does .insert need table argument?
looks like you are trying to use multiple tables instead of adding a column
this is not recommended for all the reasons
not always
depends
especially if the database already exists
for new projects and for beginners, ORMs are better
but you would still need (to write) SQL for migrations
well, at least, not for operations/runtime itself
im pretty sure enterprise applications also use ORMS
also who said you cant migrate by using ORMS
I don't remember what magic RoR had but they somehow didn't require this
SQLAlchemy migrations requires manual review of the generated script
ORMS let you see the compiled output
ORM does migrate but you need to help it and review its results
insert has more or less static insides
the question should probably be: why do you need multiple tables with this three columns?
this is GUI for SQLite
this uses Qt; you (with some effort) can import this database browser it in python
but you need to give up tkinter for Qt
I may be misremembering, but wasn't there an alternative to PyQt?
PySide
you can try but you shouldn't rely on that idea too much
other people have already made stable flexible tools and you should probably use them
unless you work at top-secret closed-source agency
It's not for work. It's a personal project
"SQL" and "flexible" mix only as far as providing a direct interface to SQL
trying to implement that is fine
It's also an experiment ๐
it will help to understand what parts of SQL are flexible and which aren't
Don't know where I'm going with it
Right. I wanna test the limits
the thing I did with PySide2
(where I remember that from)
not very interactive but anyway
Then maybe after I'll try to make a more realistic one using a better sql and gui module ๐ค
@stuck bluff there are some trials related to tax-handling stuff going on right now
in the same spirit
"this should always be hard" because people that make it easier earn money by doing so
those apps that do what governments do in other legislations
this one is not the only one
there are 17 fractals total
all done with complex numbers because that's easier
the hard part was to make this fit
because it does not touch the border
this was one of the hardest because of borders and easiest because of the recursion
class Levy(Fractal):
RATIO = 8 / 5
n_max = 15
name = 'Levy'
@classmethod
def _fit(cls, tl, tr, bl, br) -> descendtype:
return (12 * bl + 4 * br + tl * 3 + tr) / 20, \
(12 * br + 4 * bl + tr * 3 + tl) / 20, \
(tl * 3 + tr * 3 + bl * 2 + br * 2) / 10
@classmethod
def descend(cls, a: complex, b: complex, c: complex):
yield a, c, c + (a - b) / 2
yield c, b, c + (b - a) / 2
thats cool
that part gets filled a more iterations
"gets filled a more iterations"
I don't remember fucking up grammar that much in a long time
not sleep deprived yet
"Oh, you're doing fractals?"
"Line."
"Well, yes, I can see that, but -"
"Line."
Koch Binary at 0 iterations
different fractals have that line at quite different locations
https://youtube.com/shorts/Oly8f4h5C78?feature=share @rocky granite
good web design, awesome cropping
Oooh. I see.
@barren steppe ๐๐
"Line."
Hey guys
Guys whats ur new years resolution?
Actually I need help. Can someone tell me from where I can start learning about WEB 3
do want an honest advice or a pleasant advice?
As far as this server is concerned, you could poke around in #web-development.
@rocky granite lol grout
Okay
Raclette
if you want to earn anything from it, then don't, the time to profit from it is over for a couple of months or years or decades;
to learn the existing technology, start by experimenting with a local copy of Ethereum chain;
to succeed at the real projects or to integrate them with existing ones, you have to learn the background stuff like maths and cryptography;
Practical data skills you can apply immediately: that's what you'll learn in these no-cost courses. They're the fastest (and most fun) way to become a data scientist or improve your current skills.
product+activation function
without activation function, layer composition would be useless
@olive echo
it's not only matrix multiplication; I think you shouldn't leave out that part from the description;
(sorry if I didn't hear you mention that earlier)
@barren steppe it does have function apart from multiplication
there are other functions
In artificial neural networks, the activation function of a node defines the output of that node given an input or set of inputs.
A standard integrated circuit can be seen as a digital network of activation functions that can be "ON" (1) or "OFF" (0), depending on input. This is similar to the linear perceptron in neural networks. However, only...
even though some have a linear derivative, the functions themselves are not linear; they are not just multiplication
"non-linear" so you don't have linear composition problems
ReLU is C^0
at least it is continuous though
left is 0, right is 1
so, like, the set of derivatives is {0,1} but there's no single one
tanh and sigmoid have easily calculable derivatives
there's also GELU that's almost like RELU but is differentiable
so many names for it
Sigmoid linear unit (SiLU, Sigmoid shrinkage, SiL, or Swish-โ1)
there should be a way to somehow demonstrate how output distributions change with layers/activation functions
like, assume a normal distribution of all the parameters and see what happens
idk how to model that
normalisation is the often used term
scaling, I'd assume, is to answer the question "what's the error"
if your model outputs, for examples, seconds and litres, you'd probably not want to treat those similarly
that is also applicable when units are the same
so to measure the error you apply some scale to each dimension
I was about to mention PCA
(you shouldn't just put the data straight into the PCA without being sure about the scale)
PCA - Principle Component Analysis - finally explained in an accessible way, thanks to Dr Mike Pound. This is part 6 of the Data Analysis Learning Playlist: https://www.youtube.com/playlist?list=PLzH6n4zXuckpfMu_4Ff8E7Z1behQks5ba
This Learning Playlist was designed by Dr Mercedes Torres-Torres & Dr Michael Pound of the University of Nottingha...
(unrelated: there is also covariance/contravariance in type theory; that's somewhat confusing)
An Introduction to Statistical Learning with Applications in R
acronym moment
openly rating employees is cancer
what are you guys workin on rn?
I cannot speak
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
I need help
Can u add me in dm
Bc it's getting late here
ok
I want to know a device coordinates
exact
coordinates
anything
In which I am running the code
I want code
Can u create
I have tried lot of thing
please give me voice permission
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
My problem is that I can't make the code
ohh
So can u tell me how can I make
listen brother
haha
I just want a plain python file
@stuck bluff please listen him
BRB
#!pip install -q pyscbwrapper
from matplotlib import pyplot as plt
from pyscbwrapper import SCB
#Du skall skapa funktionens parameterlista:
def generateGraphFile(new_graph):
plt.plot(xData, yData)
plt.title("new graph")
plt.savefig("new_graph.png")
plt.close()
#denna funktion skall du skriva koden till.
def generateGraphData(scb, valueIndex, keyIndex):
scbData = []
scbData = scb.get_data()
#Filter out metadata:
scbFetchData = scbData['data']
xData = []
yData = []
for i in range(len(scbFetchData)):
yData.append(float(scbFetchData[i]['values'][valueIndex]))
xData.append(scbFetchData[i]['key'][keyIndex])
return xData, yData
#Alternativ 1: Antal invรฅnare i Sverige mellan 2010 och 2021
scb = SCB('en', 'BE', 'BE0101', 'BE0101C', 'BefArealTathetKon')
scb.set_query(observations=["Population"],
year=[
"2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017",
"2018", "2019", "2020", "2021"
])
xData, yData = generateGraphData(scb, 0, 0)
generateGraphFile(xData)
#option 2
scb = SCB('en', 'TK', 'TK1001', 'TK1001A', 'PersBilarA')
scb.set_query(region=["Sweden"],
observations="Passenger cars in use",
year=[
"2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017",
"2018", "2019", "2020", "2021"
])
xData, yData = generateGraphData(scb, 0, 1)
#generateGraphFile(yData)```
I know a bit
basically it works. one small issue it saves the graphs to the same image
yes, it literally is expected to overwrite
yeah i see why. i just dont know how to fix it
pass filename as an argument
def generateGraphFile(new_graph, filename):
huh
also that; but shouldn't
those two are different in more than just order/time
im intrested, go on. its pulling data from an api and saving it in a png format as a graph so please elaborate
def generateGraphFile(new_graph, filename):
plt.plot(xData, yData)
plt.title("new graph")
plt.savefig(filename)
plt.close()
generateGraphFile(xData, "new_graph.png")
@misty sinew what AF means is just pass the name in the argument, ie. you choose the name of the graph everytime.
I'd expect the filename to be:
generateGraphFile(xData, f"{formatted_time}-{valueIndex}-{keyIndex}.png")
or something
lets try! gimme a sec. question. filename should be an input right?
listen
can u write a code for getting device's coordinates
I was just asking
too sus.
FK_YOU
@halcyon notch pythonnn
@elder wraith im trying to get a laptop with a decent battery life (2hrs+) and at least 12 gb ram
Dont care much about other specs (within reason)
it aint working chief
@misty sinew did you change the argument?
so first run the function using
generateGraphFile(xData, "new_graph.png")
then maybe
generateGraphFile(xData, "another_new_graph.png")
and so on
yeah so where are you calling the function?
if you want we can get on a call
#Alternativ 1: Antal invรฅnare i Sverige mellan 2010 och 2021
scb = SCB('en', 'BE', 'BE0101', 'BE0101C', 'BefArealTathetKon')
scb.set_query(observations=["Population"],
year=[
"2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017",
"2018", "2019", "2020", "2021"
])
xData, yData = generateGraphData(scb, 0, 0)
generateGraphFile(xData,filename)
#option 2
scb = SCB('en', 'TK', 'TK1001', 'TK1001A', 'PersBilarA')
scb.set_query(region=["Sweden"],
observations="Passenger cars in use",
year=[
"2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017",
"2018", "2019", "2020", "2021"
])
xData, yData = generateGraphData(scb, 0, 1)
generateGraphFile(yData,filename)```
cant speak in the server yet
sure if you want
1 sec
hi guys
i had a small question
what language should i use to make a file uploading service
if you would like me to ellaborate i can talk
!kindling
Kindling Projects
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
uh guys any thoughts?
if it works it works
choose ir poison
ir pioson?
This section will walk you through cloning your first repo, making commits, and submitting them as GitHub pull requests.
Kindling Projects
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
ur
tasty
import random
answers = ["Yes","No","Maybe","Maybe Not","Definetly","Definetly Not","Not Yet","Never"]
print(random.choice(answers))
old ones
import random
from Eight_Ball_Answers import EightBallAnswers
int = random.randint(1, 8)
EightBallAnswers()
class EightBallAnswers:
if int == 1:
print("Yes")
elif int == 2:
print("No")
elif int == 3:
print("Maybe")
elif int == 4:
print("Posiibly")
elif int == 5:
print("Possibly Not")
elif int == 6:
print("Absolutly")
elif int == 7:
print("Aboslutly Not")
else:
print("Why would you ask that, you know the answer")
!e
import random
answers = ["Yes","No","Maybe","Maybe Not","Definetly","Definetly Not","Not Yet","Never"]
print(random.choice(answers))
answers = [
"Yes",
"No"
]
import random
answers = [
"Yes",
"No",
"Maybe",
"Maybe Not",
"Definetly",
"Definetly Not",
"Not Yet",
"Never"
]
print(random.choice(answers))
def my_function()
cookies = 0
def my_function(number):
cookies + number
cookies_cooked = my_function(8)
print(cookies_cooked)
def func(num_of_cookies):
print(num_of_cookies)
func(5)
!e
cookies = 0
def my_function(number):
cookies + number
cookies_cooked = my_function(8)
print(cookies_cooked)
!e
cookies = 0
def my_function(number):
return cookies + number
cookies_cooked = my_function(8)
print(cookies_cooked)
@wind terrace :white_check_mark: Your 3.11 eval job has completed with return code 0.
8
Cookie = 8
def divide_cookies(cookies):
Mycookies = cookies/2
Return Mycookies
!e
cookies = 8
def my_function(number):
return cookies / number
number_of_people = my_function(8)
print(number_of_people)
!e
def divide_cookies(cookies, number):
my_cookies = cookies / number
return my_cookies
print(divide_cookies(10, 2))
@upbeat wyvern :white_check_mark: Your 3.11 eval job has completed with return code 0.
5.0
!e
print([x for x in list(range(10))])
@upbeat wyvern :white_check_mark: Your 3.11 eval job has completed with return code 0.
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
!e
print([x for x in list(range(10))] if x%2)
@upbeat wyvern :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | print([x for x in list(range(10))] if x%2)
003 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
004 | SyntaxError: expected 'else' after 'if' expression
!e
print([x for x in list(range(10)) if x%2])
@upbeat wyvern :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 3, 5, 7, 9]
@solid gyro holy shit I literally just realized your name is more like "soy milk latte", not "i am latte" in spanish
class MyTree(ttk.Treeview):
def __init__(self, master=None, data=[], **kwargs):
super(MyTree, self).__init__(master=master, **kwargs)
**
**h
*args
**kwargs
!e
def say(*args):
print(args)
say("Hi", "Hello", "Random string")
@upbeat wyvern :white_check_mark: Your 3.11 eval job has completed with return code 0.
('Hi', 'Hello', 'Random string')
!e
def foo(x):
match x:
case ["hello", y]: print("saying hello to", y)
case ["bye", z]: print("saying goodbye to", z)
case [a, b]: print("not sure, but got", a, b)
case c: print("last case...", c)
foo(["hello", "sam"])
foo(["bye", "tom"])
foo([1, 2])
foo({1,2,3})
@pale pivot :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | saying hello to sam
002 | saying goodbye to tom
003 | not sure, but got 1 2
004 | last case... {1, 2, 3}
!e```def foo(x):
match x:
case ["hello", y]: print("saying hello to", y)
case ["sam", z]: print("saying goodbye to", z)
case [a, b]: print("not sure, but got", a, b)
case c: print("last case...", c)
foo(["hello", "sam"])
foo(["bye", "tom"])
foo([1, 2])
foo({1,2,3})```
!resources
@wild panther :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | saying hello to sam
002 | not sure, but got bye tom
003 | not sure, but got 1 2
004 | last case... {1, 2, 3}
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!e
def say(*args):
for arg in args:
print(arg)
say("Hi", "Hello", "Random string")
@upbeat wyvern :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hi
002 | Hello
003 | Random string
from pathlib import Path
path = Path()
for file in path.glob(*.py):
print(file)
Traceback (most recent call last):
File "C:\Users\4YTfu\AppData\Local\Programs\Python\Python311\Lib\runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\4YTfu\AppData\Local\Programs\Python\Python311\Lib\runpy.py", line 88, in _run_code
exec(code, run_globals)
File "c:\Users\4YTfu\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\__main__.py", line 39, in <module>
cli.main()
File "c:\Users\4YTfu\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main
run()
File "c:\Users\4YTfu\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file
runpy.run_path(target, run_name="__main__")
File "c:\Users\4YTfu\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 320, in run_path
code, fname = _get_code_from_file(run_name, path_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\4YTfu\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 294, in _get_code_from_file
code = compile(f.read(), fname, 'exec')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\4YTfu\OneDrive\Desktop\VS Projects\Test\test.py", line 5
for file in path.glob(*.py):
^
SyntaxError: invalid syntax
import os
for file in os.listdir():
if file.endswith(".py"):
print(file)
for file in listdir(path.join(getcwd(), "Default", "assets", "models", "block"))
import os
for file in os.listdir():
print(file)
if file.endswith(".py"):
print(file)
import os
for file in os.listdir(os.path.join(os.getcwd(), "Notes")):
if file.endswith(".py"):
print(file)
\