#voice-chat-text-0
1 messages ยท Page 198 of 1
hi
with open('text.txt', 'w') as file:
file.write('Hello, world.')
# File has now been created, opened in write mode, written to and closed
with open('text.txt', 'r') as file:
text = file.read()
# File subsequently has been opened in read mode, read from, and closed.
print(text) # File contents displayed.```
ohhhhhh
i was gonna find a way to save it into the lists
and put the lists into a dif file
!d csv
Source code: Lib/csv.py
The so-called CSV (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. CSV format was used for many years prior to attempts to describe the format in a standardized way in RFC 4180. The lack of a well-defined standard means that subtle differences often exist in the data produced and consumed by different applications. These differences can make it annoying to process CSV files from multiple sources. Still, while the delimiters and quoting characters vary, the overall format is similar enough that it is possible to write a single module which can efficiently manipulate such data, hiding the details of reading and writing the data from the programmer.
sounds more fit for tracking something
import json
my_dictionary = {'apples': 5, 'pears': 6, 'oranges': 0}
with open('data.json', 'w') as file:
json.dump(my_dictionary, file)
# File created, written to
with open('data.json', 'r') as file:
my_dictionary = json.load(file)
# my_dictionary reassigned, now points at information read from file
print(my_dictionary)```
(Data need not be a dict)
as it doesn't require rewriting the file for adding new rows
only appending
i see
JSON can be streamed too, but it's way harder than both regular JSON or CSV
why would i wanna be careful?
takes @somber heath
Format/data corruption. It's easy to mess things up the more manual you get.
i see
surprising that ```csv isn't a thing
day;value1;value2
2023-10-10;1500;300
2023-10-10;1620;250
...
(using ```txt instead)
I don't remember exactly why I'm used to ; instead of .
likely correlates to that avoiding conflict with , in numbers
wait i found a way
The Australien Government just released this ad about the Marriage Equality Plebiscite and it's surprisingly honest and informative. ๐ Enrol for Equality: http://aec.gov.au/enrol
__Ways you can keep us going:
โ Become a Patron: https://www.patreon.com/TheJuiceMedia
โ Tip us on PayPal: https://www.paypal.me/thejuicemedia
โ Bitcoin: 1HMPK1zFCLopA...
The Australian Marriage Law Postal Survey was a national survey designed to gauge support for legalising same-sex marriage in Australia. The survey was held via the postal service between 12 September and 7 November 2017. Unlike voting in elections and referendums, which is compulsory in Australia, responding to the survey was voluntary.
A surve...
"whereas here, we just don't vote for anything and don't recognise any rights"
I actually don't remember a single voted-on change since 2020 here
"voted"
it's still funny to me that that change was in large part pushed by the first woman to be in space
truly shows how selection procedures worked back then
i lob tasmania
problem with stuff like climate change is that it's portrayed as only an existential threat
instead of "it already harms, not somewhere in the future"
@keen tendon ๐
any headphone suggestions? from indian market, budget 3k to 6k rupees
do you know what does it means when a person say "a bilingual dict is good for 1 thing- put coffee on your cup so it doesnt leave rings on the table"
hello @rugged root
how are you doing
what are you up to
just trying to trying to torrent some udemy courses
can you help me
oh yeah we are in python server
nice ethics
i appreciate it
so how do you recommend to learn courses
so how do you recommend learning a new language
i paticularily need js
The various injuries BlueRaven has incurred and walked away from
#mommy #kak #spedupsongs
ROAD TO 1000 subs pls help :D
!resources We've got tons of different resources. I typically recommend "A Byte of Python", which is free on its respecitve site.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
"Automate the Boring Stuff" is also great
well i think i know what i want but i dont know how to put it together so python understands
What's tripping you up?
i dont think ive got enough braincells to put the problem into understandable sentence
so i just started with python and ive got to do a simple task a week
the task is
to make program that after inputing code of a part and ammount needed it says if there is enough of those parts or not
something like checking if there is enough material right?
yes
i think ive got the thing right but i just dont know how the specific lines should look like so python gets thro it
you will need "if statement" for that.
yes ive done that
for example
a = int(input("enter value")
if a >= 10
print("you have enough material")
what
else
print("you dont have enought material")
I think you can use this website to practice coding with a specific language and solutions to those problems exist on GitHub or for some problems exist on itself
like that right?
ive maybe found the mistake
do you need a different line if it was a code with letters rather then numbers?? a = int(input("enter value")
i dont understand?
a = int(input("enter value")
you mean like that??
you know i started out with pascal and that silly thing needs to know litteraly everything about the value like if its a number or letter code so i wonder if it takes both a number combination and letter combinations with the same line of code
so what about if the code looked something like N21KL4
the print you mean?
oh ye i forgot you need to enter a code of the material before you ask for the ammount
rest_framework/viewsets.py line 238
class ModelViewSet(mixins.CreateModelMixin,```
@whole bear๐
what is his problem?
https://github.com/encode/django-rest-framework/blob/18b02ce00e4c911719297149406cb3c0f054cf22/rest_framework/serializers.py#L1064 It's more a specific how things work under the hood question
rest_framework/serializers.py line 1064
def get_fields(self):```
I found a video about printing "Hello world!" is so boring
and he uses random letter and joins them together one by one
I think that was ....
FUN
rest_framework/serializers.py line 242
def data(self):```
The one I linked was specifically for models, which is what I thought you were asking about
have nice day guys
@plain salmon Yo
@fathom laurel Yo
How's it going
good wau?
Fighting Excel. Excel is currently winning
FN
!e py import numpy as np arr = np.arange(81).reshape(9, 9) print(arr) result = [] for y in range(0, 9, 3): for x in range(0, 9, 3): result.append(arr[y:y+3, x:x+3]) print(*result, sep='\n')
@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | [[ 0 1 2 3 4 5 6 7 8]
002 | [ 9 10 11 12 13 14 15 16 17]
003 | [18 19 20 21 22 23 24 25 26]
004 | [27 28 29 30 31 32 33 34 35]
005 | [36 37 38 39 40 41 42 43 44]
006 | [45 46 47 48 49 50 51 52 53]
007 | [54 55 56 57 58 59 60 61 62]
008 | [63 64 65 66 67 68 69 70 71]
009 | [72 73 74 75 76 77 78 79 80]]
010 | [[ 0 1 2]
011 | [ 9 10 11]
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/MAD6T5QPHFNC3YQKXOP7Z6UVOI
evening
I'll be honest Opal, I'm looking at Chat-GPT responses
Because I was already dealing with Excel stuff
hi
Critical infrastructure: When you cross a bridge and it starts criticising your life choices.
Evaluate how fucked your database is with this handy website.
We just released our first audio plugin at work
So very busy past couple of months
We used to do game dev in the first year but we pivoted to AI (which was the original market of the company) when it didn't work out
I was not aware I had this power, sleep well.
I'm just surprised it decided to pick anything up.
It was just slight each time, it was more that I am now yawning in the middle of the day.
!pypi pre-commit
!e
class Student:
def __init__(self, name: str, age: int, favorite_subject: str):
self.name = name
self.age = age
self.favorite_subject = favorite_subject
def introduce(self):
print(f"Hello, my name is {self.name}")
def how_old_in(self, years):
print(f"In {years} years, I will be {self.age + years} years old!")
sally = Student("Sally", 10, "Science")
billy = Student("Billy", 9, "Math")
sally.introduce()
billy.introduce()
sally.how_old_in(3)
billy.how_old_in(3)
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Hello, my name is Sally
002 | Hello, my name is Billy
003 | In 3 years, I will be 13 years old!
004 | In 3 years, I will be 12 years old!
What data type is picked_piece? a list?
I'm going to assume that trainer/global_step means how many steps a Pokemon trainer takes while wander Kanto
Mimicking a compressor https://en.wikipedia.org/wiki/Dynamic_range_compression
Dynamic range compression (DRC) or simply compression is an audio signal processing operation that reduces the volume of loud sounds or amplifies quiet sounds, thus reducing or compressing an audio signal's dynamic range. Compression is commonly used in sound recording and reproduction, broadcasting, live sound reinforcement and in some instrum...
๐ +๐ฅ๏ธ
and 80% of it is spent on that one spot where you can bike continuously to hatch eggs ๐
I should try out the newer Pokemon games
But I'm too busy with my backlog of games
https://www.youtube.com/watch?v=Sl0O6dDgh8E a good example of dynamic range compression
Sunflower -- Love Is Magic
Label: F1 Team -- DM 917
Format: Vinyl, 12", 45 RPM, Stereo
Country: Italy
Released: 1981
Genre: Electronic
Style: Italo-Disco
Also Love is Magic
Huh, yeah I hadn't noticed that
2022 apparently is when JetBrain overhauled their UI
@ebon mist The list you're passing to print_in_piece(?) is empty
Around line 140-ish
@ebon mist Line 152
no simulation the python module
is there anychance someone who knows simpy can review my code im slamming my head against the wall since its not outputing any values
@rugged root I was about to say that lol
iirc it's a clean room effort
actually, not that specifically
When adding functions or classes to a program, it can be tempting to reference inaccessible variables by declaring them as global. Doing this can result in code that is harder to read, debug and test. Instead of using globals, pass variables or objects as parameters and receive return values.
Instead of writing
def update_score():
global score, roll
score = score + roll
update_score()
do this instead
def update_score(score, roll):
return score + roll
score = update_score(score, roll)
For in-depth explanations on why global variables are bad news in a variety of situations, see this Stack Overflow answer.
your previous issue deals with this 
function drawTree(x, y, len, angle) {
if (len > 2) {
let x1 = x + len * cos(angle);
let y1 = y - len * sin(angle);
line(x, y, x1, y1);
drawTree(x1, y1, len * 0.75, angle + PI / 6);
drawTree(x1, y1, len * 0.75, angle - PI / 6);
}
}
function setup() {
createCanvas(500, 500);
background(220);
translate(width / 2, height);
drawTree(0, 0, 100, PI / 2);
}
sup
Not a lot, you?
i'm crazy or I heard Java Script?
There's something in particular you guys would recommend to study in python?
Hi, if someone could help me with a twitter bot i would really appreciate that
has anyone tried , mojo-python yet ?
not yet
claim is its faster , made for AI research , using advanced python stuff which i dont know .. cant form opinion on it
last i heard its BETA , but you can ask to be on list to test it , i want advanced programmers to offer ideas to be incorporated into it - i cant offer to many ideas for it
its like asking me to tune up a ferrari , i have no idea how , but maybe the advanced programmers do
curl ... | sh -
ffs
this is so, like, bad
well, at least there is less cringe option
The SDK is currently provided free of charge. Licensee acknowledges that Modular may at any time discontinue its provision of the SDK for free or generally. In the event Modular does the foregoing, it will make commercially reasonable efforts to provide Licensee of advanced notice of its plans to either discontinue its provision of the SDK or offer the SDK for a fee to the contact information provided by Licensee to Modular.
These Terms may be terminated by Modular immediately for any reason or no reason. Modular will attempt to provide written notice of termination to Licensee either through a posting on its website, or via the contact method for Licensee it has available. Upon termination, Licensee shall immediately cease all use of the SDK.
so.... temporarily open with option to make it private , hmmm locked doors in future ??
someone from Wolfram being wrong lmao
https://blog.wolfram.com/2019/04/02/why-wolfram-tech-isnt-open-source-a-dozen-reasons/#nine-open-source-doesnt-bring-major-tech-innovation-to-market
do you think the reasons in article are true , open source is NOT good ? @vocal basin
@rugged root
one thing is defending closed-source; it's completely different to try to justify it by saying "open source bad, dumb and useless"
Which I'm for sure not saying
there are some valid reasons listed there
listened to the Lex Fridman interviews , with python inventor and scipi inventor , they feel open source allows experts to contribute amazing ideas and makes python grow and become better tools
reworded and shortened:
"we want to move the project in a specific direction, we don't want any interference in that"
"we need money"
"we don't need to take responsibility for someone else's contributions"
latter being rather against open-contribution
but, like, many projects are already open-source closed-contribution
i have a dreaded feeling , mojo may die on the vine ,
it might even become open-source at some point, who knows
its the dream of multicore ( no GIL lock ) , massive speed ups , C underneath ... bla bla ... santa clause dreams
well, Zig works already
these are all different languages?
https://ziglang.org/ <---- this @vocal basin
1 -- not related to open-source
2 -- not related to open-source
3 -- not related to open-source
4 -- not related to open-source
5 -- yes, correct
6 -- not related to open-source
7 -- not related to open-source
8 -- not related to open-source
9 -- lie
10 -- header tells nothing; what's written inside the section is partially true, but exaggerated
11 -- yes, correct
12 -- not related to open-source
and some Rust systems rely on zigbuild for cross-compilation
But will it ever hit a major version
it might be weird versioning
like, 0.X -> 1.0 would imply breaking backwards compatibility
lmao
Right
Rust's base library for everything async has been at 0.3 for 4 years
Weird
Rust uses slightly altered semver
@whole bear yes, implemented it once
@whole bear what block mode are you using?
never do this
use existing implementations
always
100%
if you're ever using ECB for files that aren't already encrypted, you've failed
ftp not sftp ?
it's not that hard to make a secure encryption using C/Rust/etc.
salt needs not be protected
use argon or something
@whole bear find libsodium bindings for the language you're using
then it's trivial
for Python:
https://pynacl.readthedocs.io/en/latest/
password hashes it uses:
argon2i
argon2id
scrypt
they're implemented in libsodium
javascript on top
PyNaCl package provides bindings
javascript on top
if anybody knows python can you reply back to this message to help me witht his error
if anybody knows python can you reply back to this message to help me witht his error
which error
15 years
NaCl (pronounced "salt") is an abbreviation for Networking and Cryptography Library, a public domain, high-speed software library for network communication, encryption, decryption, signatures, etc.NaCl was created by the mathematician and programmer Daniel J. Bernstein, who is best known for the creation of qmail and Curve25519. The core team al...
their signature algorithm, iirc, is very easy to implement
(and it's easier to verify for correctness)
space space
tab
tab space space
tab tab
tab tab space space
opening a multiline comment
space
tab space
closing a multiline comment
space space space
tab space space space
if I correctly remember the BS spec
The bullshit specs?
There's something good you can say about every programming language. But that's no fun. Instead, let's take the worst features of all the languages we know, and put them together to create an abomination with the worst syntax, the worst semantics, the worst foot-guns and the worst runtime behaviour in recorded history. Let's make a language so b...
what is the point?
"So we need a name for our language, and nice short names, that are easily googleable, are key thing when you're creating a programming language.
So I'm going to call it BS"
pain
bash: curl: command not found
I'm still halfway through trying to install mojo
(or rather, forgetting I'm doing that)
Can someone explain me how to calculate:
w * = + + z โ ( โ โ y ) + 2 * โ z โ โ ;
It's c, I'm new to it but needs to learn cause University
23:54 at that point my mind is in madness
libcurl likely isn't installed either
Can't find sources cause I don't know how to call it
what are values of w,z,y?
ints
values not types
is this an exam? or homework?
test question ?
you know what *= does, right?
This is from presentation
// x = 5
x *= 3;
// x = 15
// x = 5
y = x++;
// x = 6
// y = 5
// x = 5
y = ++x;
// x = 6
// y = 6
same applies for --
this, I think, is implementation-defined
does C actually specify order of evaluation?
parentheses seem to just be placed based on operator precedence
(i.e. just clarifying how it's evaluated)
(-(y--))%(++z) is simpler to understand than first part because it doesn't rely on ordering
How to search it on internet so I can see someone solve similar example? I don't know how to call it
y-- -> y -> 2
++z -> z + 1 -> 3
I don't know if there's a name for this type of exercise
seems like it's just about stepping through the structure, evaluating one expression at a time
this can be represented as a tree
Read about precedence
And specifically the grammar of the language where the precedence of operators is defined
it's irrelevant for the last row
because that is already solved
@pine dune
ah
yeah, with two x it's difficult
(++x)*(x--) is either x*x or (x+1)*(x+1)
I'd pick latter because it comes from left-to-right evaluation of *
w*=((-(++x))*(x--))+((-(y--))%(++z)) x=1 y=2 z=3 w=4
w*=((-2) *(x--))+((-(y--))%(++z)) x=2 y=2 z=3 w=4
w*=((-2) * 2)+((-(y--))%(++z)) x=1 y=2 z=3 w=4
w*=(-4) +((-2) %(++z)) x=1 y=1 z=3 w=4
w*=(-4) +((-2) % 4) x=1 y=1 z=4 w=4
w*=(-4) + (-2) x=1 y=1 z=4 w=4
w*=-6 x=1 y=1 z=4 w=4
-24 x=1 y=1 z=4 w=-24
does it make sense to fry pasta a bit after boiling in order to dry them up a bit. i have tortellini
thanks, will do example myself, now it makes sense
it assumes that, in p*q, p is evaluated before q
this is guaranteed in Python and many other languages
but, iirc, not in C
https://en.cppreference.com/w/c/language/eval_order
i = ++i + i++; // undefined behavior
i.e. (-(++x))*(x--) is actually not defined, but I doubt it matters much here
though this applies to i =
idk
it might be defined in some compilers
w += (-(++x))+(x--)+(-(y--))%(++z) x=1 y=2 z=3 w=4
w += -(2) +(1) -(1)%(4) x=1, y=1, z=4, w=4
w += 1-1%4 x=1, y=1, z=4, w=4
w += 0
x=1, y=1, z=4, w=4
Right?
so --y is permament and y-- is temporary?
same thing for thing between xs (there is * not +)
y-- returns previous value
--y returns current value
after decrementing y
// y = 5
y-- // = 5
// y = 4
// y = 5
--y // = 4
// y = 4
Ok, will try again
w += (-(++x))+(x--)+(-(y--))%(++z) x=1 y=2 z=3 w=4
w += -(2) +(2) -(2)%(4) x=1, y=1, z=4, w=4
w += -2%4 x=1, y=1, z=4, w=4
w += -2
x=1, y=1, z=4, w=2
Small corection
w+= 2
w=6
for + instead of *, seems correct
(-2)%4==-2 in C because it's remainded not modulo
for original task, it would be this (just switched + to * accordingly)
w *= -(2)*(2) (-2)%(4)
which would give the expect result (w=-24)
anyone willing to review 420 lines of code i wrote for school
will learn more about how % works, thanks a lot for help : D
!paste
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.
true but what about pastebin or github
@vocal basin
how does this work
do i paste the link
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.
PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.
More information:
โข PEP 8 document
โข Our PEP 8 song! :notes:
this has some general advice on styling code
small typo
a more idiomatic way is to use self.effects is not None
https://paste.pythondiscord.com/IG4Q#1L81-L81
PascalCase for classes
snake_case for arguments, variables, functions, methods
https://peps.python.org/pep-0008/#naming-conventions
wym
is None is preferred over == None
ok
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | /home/main.py:2: SyntaxWarning: "is not" with 'int' literal. Did you mean "!="?
002 | print(5 is not None)
003 | True
004 | True
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | True
002 | True
i see
reason for this warning is this:
print(x is 5) # this is **not** equivalent to x == 5
^this can output False even if x==5
how is that
reason for using is with None is that
- there's only one
Nonein existence ==Nonecan be overloaded by a custom type, in which case comparison may be inaccurate
two equal integers can be different objects
!e
print((100**100) is (100**100))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
False
yes
and then != is for evaluating values
use is not on strings
only
and operators on ints
unless your concatinating strings
string1 = 'hi'
string2 = 'how are you'
string3 = string1 + string2
print(string3)
how did you run the code
in here
with the bot
!e
```py
print(5)
```
ok
!e
string1 = 'hi'
string2 = 'how are you'
string3 = string1 + string2
print(string3)
@steep juniper :white_check_mark: Your 3.12 eval job has completed with return code 0.
hihow are you
another common usecase for is would be to check if a value is a specific custom value
_UNSET = object()
def first(iterable, default=_UNSET):
if default is _UNSET:
return next(iter(iterable))
else:
return next(iter(iterable), default)
i see
naming conventions make it easier to read and maintain code,
so following them is quite important
i think i have done something simaler when i was iterating through object lists
ok
overall its just a basic game
but i think i did good on the logical parts
this dictionary should probably be extracted from the loop
https://paste.pythondiscord.com/IG4Q#1L406-L406
just so it doesn't get created/deleted each iteration
it should just live outside of the while loop then
moving it to before while starts should be good enough
ok
shouldn't it be KeyError instead of Exception?
https://paste.pythondiscord.com/IG4Q#1L412-L412
ok im still unsure about about exceptions work
this loop always stops after one iteration
https://paste.pythondiscord.com/IG4Q#1L257-L266
and how try except actually works
!e
{}[2]
@vocal basin :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | {}[2]
004 | ~~^^^
005 | KeyError: 2
oh no because im calling a function, the function is just stored in the dict relative to the key
if the key is invalid it errors out and prints invalid choice
then reloops
choices[choice[0][0]](choice[1][0])
the () on the right of the dictionary call are the function areguments
try:
action = actions[choice]
except KeyError:
clear()
print('Invalid choice.')
time.sleep(1)
continue
try:
action()
except Exception:
traceback.print_exc()
input("an internal error occured. continue?")
that is longer tho
its faster to just call it from the dict than to store it in another place first
i do like that decision branching though where you can choose to continue.
one thing I'm unsure about is if its ok to put all of the functions with he player object
the
is there a professional channel somewhere?
there's #career-advice; might be related
amongus
the choice often is between controlled and uncontrolled modification
law can only ban the former
hello
uhm
i have a question
is it okay
uhm this is not the question
but
can i have permission to open my mic?
okay okay
uhm
i have this problem
function isn't being called
how do i fix that
print(bmi)
# ^^^ this should be different
its my first time working with the else if thing
i see
i seee
wait a sec
ill check
im trying to learn python
yes
thats what i need hahaha
no unfortunately
print is a function too
i see
i missed () at the end
haha i put (categorize_bmi)
and didnt put
(categorize_bmi(bmi))
yes yes
yes
thanks mannn
it worked as i wanted
this month
iirc, Ctrl+Alt+L in PyCharm reformats the code to make it easier to read
(will be very useful later on for larger projects)
I think PyCharm embedded this style lint into my brain
also new skill
missing newline
at the end
I don't remember what extension that was (maybe misconfigured prettier),
it automatically removed the trailing newline
horrible
(in VS Code)
rustfmt is slightly weird with newlines in one specific case
it changes an empty file to be a single newline
I still haven't found a way to show Python/Rust style issues in VSC
but that's kind of not as important to me now as it used to be
(because now I myself see if something is off + everything gets auto-reformatted anyway)
unlike Markdown, for which there is
https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
the pun programming language is coming together
yea
spider!
hi
oh sick
close enough
any features you want?
call of duty modern warfare on pi 4
ah yes
you can checkout other repositories in actions
even private, but that's difficult
GitHub use either VM or Container
there likely exist prepared actions to install stuff
@kindred blade @dreamy shore ๐
yaml moment
telepathic debugging
I still have only, like, cargo-cult-ish understanding of how yaml is structured
what features exist?
it just outputs "you already know what the problem is"
genius
the error location just says "you know where"
"my react project isn't working"
the "react project":
at least 7
create a programming language for snakes to use
you heard me
sssss
ss
ssssss
I tried googling and I failed
does anyone know how to incorperate a captcha solver into a selenium script?
Well, it's hard to say, but they're experts in hiss-tory!
happy?
for any snake to have an iq of below 10, there needs to be at least a billion snakes
so, likely, correct
o
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
"there is no such thing as captcha solver"
mostly because getting funding to develop that is problematic,
unless you either are running a captcha company yourself or are funded by government
another reason why saying "AI is dumber than humans because it can't solve captchas" is quite incorrect
do fish ever get thirsty?
not sure why you would want netflix and the GIL
first time googling this correctly
why's it called a "pair of pants" when there's only one?
um
why
where the "at" at?
?
'ssss',
'ssss',
'ssssss',
'ssssss',
'ss',
'sssss',
'sssss',
'sssss',
'ss',
'ssss',
];
sssss sssss = sssss[Ssss.sssss(ssss.ssssss() * sssss.ssssss)];
ssssssss.sss(`ssssssss sssss sssssss: ${ssss}`);
snake
all non-s characters (other than symbols) are ignored as comments
indeed
yes
dang
this makes wayyyy more sense now
so...
so...
quick
72/8 + 32
5
41
??
thank u
you accidentally replied to me. You should have replied to aim
I can't count
genius
i already know
forgot how to do that since I became mathematician
lol
why is no one talking in the vc
tf
im making it rn
functions are just different lengths of s's
very productive
you can just use s and S to represent this
https://en.wikipedia.org/wiki/Iota_and_Jot
In formal language theory and computer science, Iota and Jot (from Greek iota ฮน, Hebrew yodh ื, the smallest letters in those two alphabets) are languages, extremely minimalist formal systems, designed to be even simpler than other more popular alternatives, such as the lambda calculus and SKI combinator calculus. Thus, they can also be consider...
i see
(Sss)(a)=a
(SsSsSss)(a)(b)=b
(SsSsSsSss)(a)(b)(c)=(a(b))(a(c))
in that notation
how will the snakes pronounce parantheses
okie
these are just examples of what such programs represent
innovation
sSSSSSSSSSSSs
I have meaningful code that can be relatively easily transpiled into this
beautiful
mac and cheese
thx
how the challenge is to compile it back into something that I can run
fine, what will it do
Anyways
almost always if I need something powershell-related, I just look up specific questions
Thanks alisa
something terrible happened to this SVG
What is that
gears
omg
That startling, are they?
Anyways how to get a virtual machine working?
download an iso
snakelanguage.iso
What is Ubuntu?
I usually install virtualbox and its gui and go from there.
Linux flavour.
Popular operating system. A lot of other distributions are based on it.
How long do I left to talk in VC?
debian
already enough to verify
i wish
You've been eligible for some time.
you wish what
okay, so the code compiled and synced, that's already quite impressive
now I need 3 numbers between 1 and 1000
!e
from random import randrange
x = randrange(1000)
y = randrange(1000)
z = randrange(1000)
print(x, y, z)
print(pow(x, y, z))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 927 611 957
002 | 927
erm
wha
uhh
wait, why is it same
!e
from random import randrange
x = randrange(1000)
y = randrange(1000)
z = randrange(1000)
print(x, y, z)
print(pow(x, y, z))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 154 218 158
002 | 128
!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 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!
okay, so I just got scammed for one time
!e
print('bob')
@haughty fog :white_check_mark: Your 3.12 eval job has completed with return code 0.
bob
it takes so long to compile
unsurprising given the compiled artifact is 5MB
I don't think I have hyper-V enabled
VirtualBox itself is relatively easy to use, afaik
haven't changed much since it was Sunโข๏ธ VirtualBox
this code works, confirmed
Chrome/Firefox/Edge depending on situation
opera is a virus itself
WOAH
edge has more precise search results while google has more
edge isn't a search engine
Brave is chromium-based too
everything is Chrome nowadays
except for Firefox and Safari
edge uses whatever you configure it to use
im using duckduck ngl
Tor defaults to duckduckgo
@prime bobcat ๐
duckduckgo turned out not as independent and no-tracking as they claimed
hello guys
2
This article compares browser engines, especially actively-developed ones.Some of these engines have shared origins. For example, the WebKit engine was created by forking the KHTML engine in 2001. Then, in 2013, a modified version of WebKit was officially forked as the Blink engine.
chatgpt is awesome lol
fr
is teaching me how to code python so i like gepeto
hacking browser?
Please don't rely by on chatgpt to teach you Python.
basically, only Chrome, Safari, Firefox and whatever SerenityOS uses -- is all there is
i mean i read the documentation but i ask gepeto to solve stuff or make my code better
@whole bear participate in CTFs
Capture The Flag, CTF teams, CTF ratings, CTF archive, CTF writeups
metaphorical flag being a secret key
@ashen hollow @spice wave ๐
Hello
print("{player['Hp']}/{player['MaxHp']}")
you good?
i was having issues with that
print(f"{player['Hp']/player['MaxHp']}")
but using gpt for info instead of just asking him to code
this?
is pretty damn good
why?
pr1nt("{play3r['Hp']}/{pl@y3r['M@xH?']")
omg using markdown please xD
yeah alisa, i didnt know i should use f before
format
@unreal otter ๐
shes an unicorn
This is an example markdown
pr1nt("{play3r['Hp']}/{pl@y3r['M@xH?']")
very much works as intended
how do i paste my code as that Cloud?
?
pr1nt("{play3r['Hp']}/{pl@y3r['M@xH?']")
there are also Attack-Defense CTFs too but they're less common
because more difficult to organise
what``is``happening``oh no
lol xD
p#in\t("{pl&y^r['H,p'],b*(^y}['M}xH?']")
aim has a low voice!
how to get it to work:
- parse it as a syntax tree this way:
sis jot combinator,S<p><q>is "call<q>with argument<p>" - evaluate it (the result is a function)
- call it with arguments:
0,1,a => b => a + b,n => x => y => x if n == 0 else y,n => x => y => x if n & 1 else y,n => n >> 1,a,b,m - result is
pow(b, a, m)
this image is scared me!
Best HEIC to JPG converter. Convert HEIC to JPEG in the highest quality in seconds. Supports live mode (multi-image) HEIC files. Online & free.
My broken laptop
Emotional Damage
no
install Ubuntu 22.04
zorin
what is zorin xD?
the art of suggesting solutions to non-existent problems
is he really installing more ram?
||how do we tell him...||
just do
๐
its fine, it's godaddy
sometimes
download nvidia4090free100percent.exe
I need a photo from your keyboard right now who has the best keyboard for programming ?
corsair k100
hey aim
'hi'
hi
`import randomshit
xd = randomshit.data
print(f"{xd['1']}{xd['2']}{xd['3']}{xd['4']}{xd['5']}{xd['6']}{xd['7']}{xd['8']}{xd['9']}{xd['10']}{xd['11']}{xd['12']}{xd['13']}{xd['14']}{xd['15']}{xd['16']}{xd['17']}{xd['18']}{xd['19']}{xd['20']}{xd['21']}{xd['22']}{xd['23']}{xd['24']}{xd['25']}{xd['26']}{xd['27']}{xd['28']}{xd['29']}{xd['30']}{xd['31']}{xd['32']}{xd['33']}{xd['34']}{xd['35']}{xd['36']}{xd['37']}{xd['38']}{xd['39']}{xd['40']}{xd['41']}")`
data = { "1" : "p", "2" : "r", "3" : "i", "4" : "n", "5" : "t", "6" : "(", "7" : '"', "8" : "{", "9" : "p", "10" : "l", "11" : "a", "12" : "y", "13" : "e", "14" : "r", "15" : "[", "16" : "'", "17" : "H", "18" : "p", "19" : "'", "20" : "]", "21" : "}", "22" : "/", "23" : "{", "24" : "p", "25" : "l", "26" : "a", "27" : "y", "28" : "e", "29" : "r", "30" : "[", "31" : "'", "32" : "M", "33" : "a", "34" : "x", "35" : "H", "36" : "p", "37" : "'", "38" : "]", "39" : "}", "40" : '"', "41" : ")", }
i win
dont mind my dirty desk
clean
@tranquil jasper ๐
didnt realize it wouldnt let me talk lmao
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
22-23?
i have 22?
yes
sweet almost halfway
it's the best browser out there
nothing better
aim what you like to do in python
!voiceverify
straightedge
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
can i not react?
they like to aim
monke what do you like to do in python
i use snake not python
you deleted that message fast
Create map generators, algorithims for completing tasks, and experimenting
monke, what do you use for map generators?
bro what even is this
S-language
S-lang for short
i like that
I implemented fast exponentiation in lambda calculus
then transpiled it into jot ( https://en.wikipedia.org/wiki/Iota_and_Jot )
S and s are used as 0 and 1 in jot
perlin noise + biome diffusion
but how do you display as graphic output?
pygame
oh, i was looking at that recently
im using terminal only
whats the difference between pygame and pygame zero?
idk what pygame zero is
like what?
i havent used any, someone told me to stick with raw python
but i saw the documentation a bit
default Pygame is better for understanding what's actually happening
documentation for S-lang will be out shortly
wow
I should rewrite the interpreter in Rust
so, basically if you want to learn properly is better to start with pygame instead?
(it's in Python currently)
yes, especially for projects beyond ~100 lines of size
there might be things similar to Pygame Zero but less framework-ish
they were right, you know a lot Alisa
IDK if Pygame Zero is even properly integrated with IDEs
this is valid pgz script but every IDE will say it has issues
WIDTH = 300
HEIGHT = 300
def draw():
screen.fill((128, 0, 0))
specifically lack of imports
mate
what do you think about this libraries?
pyqt
django
mysql
It is intended for use in education, so that teachers can teach basic programming without needing to explain the Pygame API or write an event loop.
someone told me to start with those
my maps are ๐ฅ
I would choose pyside over pyqt
mysql isn't a library, it's a database
(but there is a package with the same name, which provides connection to that DB)
worst part about MySQL is its current owner, otherwise it's a good choice
wdym
Oracle
oh didnt realize they were the owner
i tried getting their like cloud free tier and literally just kept getting stuck when i tried to validate payment and i looked up like if other people where having this problem and every one was bad mouthing them pretty much
MariaDB, as a MySQL fork, was started due to Oracle takeover
#this is so cool i didnt realize you could put the language in the top
def send(msg):
message = msg.encode(FORMAT)
msg_length = len(message)
send_length = str(msg_length).encode(FORMAT)
send_length += b' ' * (HEADER - len(send_length))
client.send(send_length)
client.send(message)
print(client.recv(2048).decode(FORMAT))
send(DISCONNECT_MESSAGE)
print('ikr')
cout << "omg this is so litty" << endl;
class Me:
def __init__(self, smort):
self.smort = smort
def let_people_know_how_smort(self):
print('smortness level:', self.smort)
me = Me(10000000000)
me.let_people_know_how_smort()
anyone a tkinter fanatic?
I've helped with tkinter more than I've done anything myself, I think
i have a database and i need to make an app for me and my buddies to use and i was gonna make it via tkinter but ive just been kinda delaying for a week
the app only interacts with the DB, right?
ive made like small tkinter stuff but this would probably be like 2k lines of code
yeah
well wdym like what else would it do?
web UI might be another option instead of a tkinter app
with web server running on the same host as the DB
how much would i have to learn to host website?
depends
is the DB centralised?
if yes, how is it accessed normally? over the network?
accessed over network
its on a linux server through linode
and i use just mysql.connector to connect to it
im very greedy imo
I would use this+FastAPI for a similar task
https://github.com/aio-libs/aiomysql
(async is better for multiple concurrent requests)
guess what
in cases where API endpoint would be waiting on the database most of the time it processes the request
it has documentation now?
FastAPI's sql tutorials are based on SQLAlchemy (ORM for Python)
so most of the documentation will be there
gotchu
(in SQLAlchemy and encode/databases)
https://docs.sqlalchemy.org/en/20/
https://www.encode.io/databases/
aim you keeping me in suspense
i think the goals really fit it well
also i think the only way to speed up my current project is divy it up across multiple machines but i have to use requests.get for like 52 thousand links every day and it takes like 4 hours to run with threading, any thoughts to speed it up?
is it CPU-bound or just waiting?
kinda new to this not sure exactly what that means i dont think its cpu bound i think its just whenever it makes the requests and its waiting it fires off the next request in the list
very easy language
s s+8 s+5 s+12 s+12 s+15 s+0 s+23 s+15 s+18 s+12 s+4
and asyncio.create_task 100~10000 times
can i combine threading and asyncio or just one or other
asyncio is faster without threading
combining them requires extra synchronisation overhead
with each task pulling from a shared queue what it needs to do next
if it does get stuck because of CPU, then multiprocessing
any idea what syntax would look like
with futures.ThreadPoolExecutor(max_workers=40) as p:
p.map(get_html_of_card, sub_links)
im pretty sure map doesn't work like that
i mean its worked so far
not that map
its from threadpoolexecutor
so something like
for link in sub_links:
asyncio.create_task(get_html_of_Card(link))
that would a little bit too much tasks, if there's 50K total
well i split it up into groups of 1k
for x in range(54):
a = x*1000
b = x*1000+1000
sub_links = card_links[a:b]
with futures.ThreadPoolExecutor(max_workers=40) as p:
p.map(get_html_of_card, sub_links)
then it's fine, though not perfectly efficient
the threads would crash if i didnt them all at once
singular slow requests will slow down everything when batch-processing
ill try asyncio and see how fast it goes
oh my god im so stupid
is there anyway to revert back to a previous instance of mysql
i just deleted like my entire history table
from mysql connector and committed because i forgot i put it main
there is rollback, but not all circumstances allow it
normally only before it's committed
CPU I'm using is able to process 100 requests
(if the server takes 1 second to respond)
it throws all the tasks in the loop but its freezing after that
Alisa, are u the thing that we as humans consider as god?
or just very close to it?
the setup I used
total = 0
def increment():
global total
total += 1
async def worker(client: httpx.AsyncClient):
while True:
_ = await client.get("http://localhost:7780")
increment()
async def tracker():
while True:
print(total)
await asyncio.sleep(1)
async def main():
async with httpx.AsyncClient(limits=httpx.Limits(max_connections=10000, max_keepalive_connections=10000)) as client:
async with asyncio.TaskGroup() as tg:
tg.create_task(tracker())
for _ in range(100):
tg.create_task(worker(client))
"http://localhost:7780" would be replaced by await queue.get()
and main would also store all tasks that were created, cancelling them once await queue.join() is done
and worker would also queue.task_done on each element it pulls
!d asyncio.Queue
class asyncio.Queue(maxsize=0)```
A first in, first out (FIFO) queue.
If *maxsize* is less than or equal to zero, the queue size is infinite. If it is an integer greater than `0`, then `await put()` blocks when the queue reaches *maxsize* until an item is removed by [`get()`](https://docs.python.org/3/library/asyncio-queue.html#asyncio.Queue.get).
Unlike the standard library threading [`queue`](https://docs.python.org/3/library/queue.html#module-queue), the size of the queue is always known and can be returned by calling the [`qsize()`](https://docs.python.org/3/library/asyncio-queue.html#asyncio.Queue.qsize) method.
Changed in version 3.10: Removed the *loop* parameter.
This class is [not thread safe](https://docs.python.org/3/library/asyncio-dev.html#asyncio-multithreading).
this is current code
def get_tasks(session):
tasks = []
for card_link in card_links:
tasks.append([card_link, session.get(card_link, ssl=False)])
print(len(tasks))
print('returning tasks')
return tasks
async def get_htmls():
async with aiohttp.ClientSession() as session:
tasks = get_tasks(session)
responses = await asyncio.gather(*tasks)
for response in responses:
p_dict[response[0]] = await response[1].text()
print("HTML:", len(p_dict.keys()))
asyncio.run(get_htmls())
getting an error currently though
elements of tasks aren't awaitable
aight lemme try that
also, isn't get a context manager?
aiohttp works very differently from requests
unlike httpx
idk i was follwing youtube tutorial
okay, I checked, it can be awaited too
Traceback (most recent call last):
File "C:\Users\Aidan\p_chart_server.py", line 533, in <module>
main()
File "C:\Users\Aidan\p_chart_server.py", line 464, in main
asyncio.run(get_htmls())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Aidan\p_chart_server.py", line 457, in get_htmls
responses = await asyncio.gather(*tasks)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\tasks.py", line 827, in gather
fut = _ensure_future(arg, loop=loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\tasks.py", line 674, in _ensure_future
raise TypeError('An asyncio.Future, a coroutine or an awaitable '
TypeError: An asyncio.Future, a coroutine or an awaitable is required
sys:1: RuntimeWarning: coroutine 'ClientSession._request' was never awaited
currently getting this
but i need the card link
do i need to like make another dictionary and just input the response to get the link
you can return that separately, then zip together
or create a coroutine that both does session.get and returns card_link
and may even do await response.text() inside that coroutine
so that it's all concurrent
i realized i could just do it by index since its already sending them in order
and we back to freezing again
oh its probably not freezing its just actually making the requests
i wish there was a way to tell
yup thats what its doing!
literally this
yeah its just struggling with larger amounts at a time
yeah men, shes a god helping everyone here
someone taught me how to use dictionary variable values into print
but i cant get it
i mean i understand the For loop
`import randomshit
xd = randomshit.data
output = ''
for x in xd:
output += xd[x]
print(output)`
he explain something like this right?
do you want output to be a list?
because he saw my code, sorry for the lenght
data = { "1" : "p", "2" : "r", "3" : "i", "4" : "n", "5" : "t", "6" : "(", "7" : '"', "8" : "{", "9" : "p", "10" : "l", "11" : "a", "12" : "y", "13" : "e", "14" : "r", "15" : "[", "16" : "'", "17" : "H", "18" : "p", "19" : "'", "20" : "]", "21" : "}", "22" : "/", "23" : "{", "24" : "p", "25" : "l", "26" : "a", "27" : "y", "28" : "e", "29" : "r", "30" : "[", "31" : "'", "32" : "M", "33" : "a", "34" : "x", "35" : "H", "36" : "p", "37" : "'", "38" : "]", "39" : "}", "40" : '"', "41" : ")", }
import randomshit
xd = randomshit.data
output = ''
for x in xd.keys():
output += xd[x]
print(output)
try that
and i printed like this because aim was trolling me with some code i send
im not sure if that will output in order or not
`import randomshit
xd = randomshit.data
print(f"{xd['1']}{xd['2']}{xd['3']}{xd['4']}{xd['5']}{xd['6']}{xd['7']}{xd['8']}{xd['9']}{xd['10']}{xd['11']}{xd['12']}{xd['13']}{xd['14']}{xd['15']}{xd['16']}{xd['17']}{xd['18']}{xd['19']}{xd['20']}{xd['21']}{xd['22']}{xd['23']}{xd['24']}{xd['25']}{xd['26']}{xd['27']}{xd['28']}{xd['29']}{xd['30']}{xd['31']}{xd['32']}{xd['33']}{xd['34']}{xd['35']}{xd['36']}{xd['37']}{xd['38']}{xd['39']}{xd['40']}{xd['41']}")
`
manually
so he told me to use for loop to make it, it works with any of the 2 methods for output the text right?
!e
data = {
"1" : "p",
"2" : "r",
"3" : "i",
"4" : "n",
"5" : "t",
"6" : "(",
"7" : '"',
"8" : "{",
"9" : "p",
"10" : "l",
"11" : "a",
"12" : "y",
"13" : "e",
"14" : "r",
"15" : "[",
"16" : "'",
"17" : "H",
"18" : "p",
"19" : "'",
"20" : "]",
"21" : "}",
"22" : "/",
"23" : "{",
"24" : "p",
"25" : "l",
"26" : "a",
"27" : "y",
"28" : "e",
"29" : "r",
"30" : "[",
"31" : "'",
"32" : "M",
"33" : "a",
"34" : "x",
"35" : "H",
"36" : "p",
"37" : "'",
"38" : "]",
"39" : "}",
"40" : '"',
"41" : ")",
}
output = ''
for x in data.keys():
output += data[x]
print(output)
@tranquil jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.
print("{player['Hp']}/{player['MaxHp']}")
yeah so you for loop through the keys of the dictionary which i think it does in the order that you add them in
`import randomshit
xd = randomshit.data
for x in xd:
print(x)`
and here it prints the name of the variable right?
wtf this does output = ''
" "
this
it would have to be xd.keys() so like
for x in xd.keys()
''
