#off-topic-lounge-text
1 messages ยท Page 4 of 1
@merry ocean Home movie?
Yeah
Hey Rab
Well done
Well dooooone
I'm going to drag people up to VC1 so that this channel is free for its intended use
no mic
can i have access to stream in voice chat ?
@pliant prairie what are u coding rn?
@atomic phoenix interesting
is he teaching dictionarys
heylo @buoyant kestrel can I stream please?
Neat
This is using numpy?
Why would you not make the data frame as a variable and work from it that way
Just to make it less cluttered
@atomic phoenix
YeahYep
I'm more saying because you're calling so many methods
Ah, okay
Looooooove their syntactic sugar for getting slices and indexes
@honest pasture Are you having a stroke
rtc con
Oh fun. Close and reopen the client
Yep. The cost of using Pandas vs numpy. A lot of the optimizations and quality of life things that you have from the latter are kind of not applicable on the former
Yo @primal bison
YAW !
Fun fact: Makarouna = pasta in tunisian
Huh, learn something new everyday
helo @buoyant kestrel so I wanna stream my current project that I am working on
!stream 406382478102626314
โ @restive flower can now stream until <t:1673282178:f>.
Aahahahhahaha
Awwww ๐ฅบ thank you sir @buoyant kestrel
They have a flavor called Loca Mocha
I'm bored, you can't blame me
heheh boiss got the perm , come visit my stall :3
And now to wait for an uncertain amount of time hoping that tech support gets back to me on a different issue
Sadly it's not our MSP but a vendor
That would do it
Seriously with this damn program
You do you
@primal bison Yo
A lot of people did
Culmination of years of work by staff and server members alike
!stream 406382478102626314
โ @restive flower can now stream until <t:1673282620:f>.
!source
!contribute
Contribute to Python Discord's Open Source Projects
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!
Projects to Contribute to
โข Sir Lancebot - our fun, beginner-friendly bot
โข Python - our utility & moderation bot
โข Site - resources, guides, and more
Where to start
- Read our contribution guide
- Chat with us in #dev-contrib if you're ready to jump in or have any questions
- Open an issue or ask to be assigned to an issue to work on
Forgot we had that tag
@primal bison have a read at that
I got you !
Correct
Yes, it is in python
how much time and trust do I need to serve to become a trusted streamer sir? ๐ฅบ
You can see that in the github repository
@buoyant kestrel
It shows you the different languages used
I don't have a hard quota or something
@primal bison Type in here so we're not interrupting the streamers
welp ! I am gonna wait till I become a verified streamer
What do you mean ?
@primal bison And that's part of the learning experience. Seeing how other groups do their code and learning to adapt to a different structure.
Hum
There's a couple of things happening there
- It's not that it it's "different", it's just that the bot isn't big enough
We use cogs, which is a way to categorize commands and group them together
Same context -> more understandable
I suggest reading the docs that discord py has
And the different examples
They will help you get started
I need to catch my carpooling friend, ciao !
@primal bison Just imagining you chasing after them
swirling like pasta, middle of the street
mslkdsmlkzsdmlkjsdmlkjsdf is my movement pattern
They went right pasta you
10/10
!e
pasta = "pasta"
print(f"There was {pasta[-1]} {pasta[2:]}{pasta[0}} sign")
@primal bison :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 2
002 | print(f"There was {pasta[-1]} {pasta[2:]}{pasta[0}} sign")
003 | ^
004 | SyntaxError: f-string: closing parenthesis '}' does not match opening parenthesis '['
Yarp
Yeah my mic is picking the bg song, I muted
@atomic phoenix Have patience
I am listening and watching
Just doing multiple things
i am sir
It's not cheating to use the built in functionality that the library gives you
If anything it's encouraging good practice
Especially because pandas is built off of numpy
Back later, currently on hold with a vendor
aight imma head out now ! it was nice exploring
g
Build with Visual Studio Code, anywhere, anytime, entirely in your browser.
hello anyone there i need help!!!
what help
@night lily cant speak, seems my role is messed up
hello, can someone help me with a piece of code?
def vow(s):
vowels = ['a', 'e', 'i', 'o', 'u']
for char in s:
if char in vowels:
return char
else:
return 'No vowels'
user = input('Enter a string: ')
print(vow(user))
trying to make a function to get all the vowels from a string
Hello
can somebody help me with this code
# PCA & CLustering
pca = PCA(2).fit_transform(df)
pca_data = pd.DataFrame(pca)
pca_data['cluster'] = cluster.KMeans().fit_predict(pca_data)
# Score
silhouette_score(pca_data, pca_data['cluster']) # 0.3979574879047732
How can i increase the score
my data is some 16*16 digits at tilted angles
You're returning in a for statement which ends, there are two ways to change this.
One, you can use a tmp variable:
def vow(s):
vowels = ['a', 'e', 'i', 'o', 'u']
_tmp = []
for char in s:
if char in vowels:
_tmp.append(char)
return ",".join(_tmp)
Or you can use a generator, but I'm sure this is more advanced than what you need so I'd recommend just doing the above...
If you want to learn about generators though:
https://wiki.python.org/moin/Generators
wassup 4YT
Example of less code (and not necessarily unreadable if you know how generators work):
def vow(s):
"""return a comma-separated string of all the vowels (in order, with duplicates if present) in the given function input"""
return ",".join(
char
for char in s
if char in ('a', 'e', 'i', 'o', 'u')
)
sup x10
how did that code go
@vivid tinsel what happend to the whole work for a bar thing
the code you were working on yesterday?
lmao
man not having a mic is hard
ps: i lost my prev account so i dont have voice perms yet on this alt
hola maro
What are you making?
yup deb 11
Booting up my pc will disappear for a second
sup AF
hows starlink?
if anyone has tried it?
is it stable?
is it like better than the local providers
on xfinity but i want to switch to starlink
is it?
the first one
which says its bad
nvmm prolly my interpretation skills are bad
that made soo much sense
"All the ram in the universe"
Java is the best language tbf
prove me wrong
i would say a whole essay if i had my mic , but sadly i have to talk here
generally
unsigned is useless
static is important
Generators make use of yield not return if I'm not wrong, right?
I thought the ",".join() "yields" the generator
my view should be standardized :)
I mean a generator wpuld negate the need for a tmp list but it would change the code slightly
A generator being an iterable still makes the point/intent of my statement true then, no? =)
ยฏ_(ใ)_/ยฏ
A generator makes use of the term yield which is similar to return but its nonbreaking
Your doesn't break either?
I based mine off yours @fallen topaz
Yeah I could write up a quick generator but I'm on my phone atm
Calls what
Wym the other end
brb grabbing some breakfast
what does yeild do in python?
it should be for cuncurrency right?
well its for that in java
Trigger the next iteration of a generator
ok same thing then
@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello,
002 | World!
Why do you have the "Hey I'm new" icon @dull anvil ?
aight imma head out ...ty for the streams:) ....byee
import pandas as pd
Erstellen Sie zwei Series
s1 = pd.Series([1, 2, 3])
s2 = pd.Series([4, 5, 6])
Erstellen Sie einen DataFrame aus den Series
df = pd.DataFrame({'s1': s1, 's2': s2})
Geben Sie den DataFrame aus
print(df)
@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.
1024
mandelbrot set
take advantage of it being lawless!!
the ethics behind the creation of AI reminds me of this episode:
"uses their DNA to clone their conscious minds into his modded version of the video game their company makes and runs. This means that although they are living their normal daily lives outside of the game, unaware they've been cloned, inside the game they are fully aware of their existence and are trapped in Daly's sick power fantasy. All they know is that they woke up in Daly's game and haven't been able to escape. "
https://gamerant.com/black-mirror-star-trek-episode-ending/
@pliant prairie if you add from __future__ import annotations you dont have to make your typehints strings
yeah
it makes it so all annotations are evaluated after everything else
Welcome to IDEA, the internet's best source for primary-source recordings of English-language dialects and accents as heard around the world.
Provided to YouTube by Universal Music Group
Flagpole Sitta ยท Harvey Danger
Where Have All The Merrymakers Gone?
โ 1997 The Island Def Jam Music Group
Released on: 1997-01-01
Producer, Associated Performer, Recording Arranger: Harvey Danger
Producer, Studio Personnel, Mixer: John Goodmanson
Composer Lyricist: Harvey Danger
Auto-generat...
Watch the official music video for Basket Case by Green Day from the album Dookie.
๐ Subscribe to the channel: https://www.youtube.com/c/GreenDay/?sub_confirmation=1
Directed by Mark Kohr.
Stream/download Father Of Allโฆ here: https://greenday.lnk.to/fatherofall
Watch more Green Day music videos here: https://youtube.com/watch?v=eXv00PJ9IQM&lis...
A bottle dynamo or sidewall dynamo is a small electrical generator for bicycles employed to power a bicycle's lights. The traditional bottle dynamo (pictured) is not actually a dynamo at all (which creates DC power), but a low-power magneto that generates AC. Newer models can include a rectifier to create DC output to charge batteries for electr...
Powered by AMD Ryzen AM4 processors, the MSI MAG B550 TOMAHAWK MAX WiFi inspired by the military armor design, tuned for better performance by Core boost, DDR4 Boost, WiFi 6E, Lightning Gen 4 M.2 with M.2 Shied, 2oz copper PCB
Series([4, 6], index=["a", "b"])
guys
btw
does anyone know the blank coding page
with green code
that people use to pretend they're coding but it actually doesn't do anything
i wish you could be my tutor
so that i may talk no more bullshit
and work only on facts maro:{
Sup
How's it going, what're we working on
@atomic phoenix Full of information, always open to share such knowledge
Wouldn't say blathering
Little bit from column A....
I am a master of bullshitting
Mobile is still unwieldy, and even on desktop, code blocks don't fit well in it
But I kept the built in text channel open in this channel and code/help so that if people are streaming they can use the built in
I personally just hate having the video windows open all the time, especially when I'm at work
Harder to justify for me
Fine, I'll hop to the other, jesus christ
I'll swap during stream
Just when it's not going on I prefer it here
Dude, if this DMS export crashes again I'm going to scream
I hate this program
SO much
Sup null
Grab food already
A river dirt cheese
'murican
I love how bouncy and flowing Italian is
Mother. Fucker.
Failed
AGAIN
Scorched earth
Doing it in 5 client chunks
Arrivederci
Exception:
-----------------------------------------------------------------------------------------
2.1 Date : Mon, 16 Jan 2023 11:39:40 -0600
2.2 Address: 00E47CA9
2.3 Module : DMSCore.bpl
2.4 Type : EDBISAMEngineError
2.5 Message: DBISAM Engine Error # 11010 Table or backup file 'DATA03A' does not exist.
These are the bullshit errors I get to deal with
Best part? It's not consistent which backup file it says does or doesn't exist
Quite often it's different
HATE this program
I'm not making a bespoke solution
lol
That's the dumbest way to do things, especially for an accounting firm
It's not practical
POV: no one has streaming perms
lol..m sorry but this is funny
Try
The GPU
In a different
Slot
@tender tangle Don't be shitty
@royal heart You're peaking your mic. Can you pull it back from your mouth just a bit
k
And amperage
It needs to match or exceed
I know, but if it's under it'll misbehave
I know
Still better to know than to not
๐
@tender tangle Stop interrupting him
Why are you being this way right now?
@atomic phoenix When do you plan on starting
Who're we still waiting on?
@proper cobalt Sup
@royal heart We're going to be talking about the pandas library
hello hello
Data analysis
Pandas builds off of numpy
I will punch you
Squarely in the arm
better than the nuts
brb
@royal heart Can you move your mic away from your mic? Or adjust your auto gain. Currently you're peaking your mic so a lot of what you're saying is being cut off
move mic away from mic
:{
Dude
I'm tired
I meant mouth
I wouldn't
You're using a Python wrapper around existing functions
To the user, it'd be no different if it was implemented in Python
So you're still programming and using the library in Python
In the same way you wouldn't say "Oh I'm not writing or doing Python, I'm just making things for the bytecode interpreter"
yeh ik i was bored so thought to pull random things
fair point
:{
I'm just writing electrical pulses
the only person i like is @tender tangle
ive got 12 cathode ray tubes here
i mean i understand this channel is for studying
Why?
are they for attacking burglars
which verboof does
I stab you with a cathode ray tube
i dont got the money for these newfangled transistwhatchamadongers
It's not an LCD screen, it's a series of tubes!
@atomic phoenix Ready if you are
@upper umbra ๐
are we learning polars?
Bears
hi, just wondering how the live coding and this chat works?
What do you mean?
wassup griff
if i had a coding question can i ask here?
sure
thanks!
Yeah, you can ask here in chat
Might have to migrate to a different chat or direct you to the help system, but no problem asking quick stuff
Just got here, what's this ?
emacs i presume
Someone had a quick question, and now we're back to poking around the pandas library
thank you
so i want to count how many rows and columns a csv file contains. this is the code I have but i'm not sure how to proceed/why it's not working py refugee_data = pd.read_csv("refugees.csv", header=0) mydata = pd.read_csv( refugees_csv, optional args ) mydata.info() mydata.describe() mydata.value_counts()
Not defined enough for me personally
yeah i know
i am thinking of implementing dark theme
but boy oh boy did i do a ton of copy pasting
context im a java developer
would anyone be able to help me with this?
From what I'm seeing it'd be....
rows = len(mydata.axes[0])
columns = len(mydata.axes[1])
I think
Not overly familiar with Pandas, personally
If that's all you're needing to get without any extra frills
lombok
thanks! I think I figured it out! refugee_data = pd.read_csv("refugees.csv", header=0) refugee_data.info() refugee_data.describe() refugee_data.value_counts() this is what i used
https://www.geeksforgeeks.org/count-the-number-of-rows-and-columns-of-a-pandas-dataframe/ Yeah seems there's many ways to approach it
C# would wish it had anything near JPA
Java persistence API
Been too long since I've done Java, can you enlighten me?
https://www.npersistence.org/ is apparently a thing
studentsRepository.save(
new Student(
"ryan",
"speedro",
"contact"
)
)
C# can never do this as simple^^
Oh sure sure
I wonder if Entity Framework Core is the alternative
i saw this good video on the difference
Ehhhhh
That's an Amazon implementation
I'm not saying that Java doesn't do it better
that was the first picture that came on google idk
Just wondering what C#'s native alternative is
Yeah, Entity seems to be the closest
not bad
not bad
exec sp_executesql N'SET NOCOUNT ON;
INSERT INTO [Students] ( [FirstName], [LastName])
VALUES (@p0, @p1);
SELECT [StudentId]
FROM [Students]
WHERE @@ROWCOUNT = 1 AND [StudentId] = scope_identity();',N
'@p0 nvarchar(4000), @p1 nvarchar(4000) ',@p0=N'Bill',@p1=N'Gates'
go
using (var context = new SchoolContext())
{
var std = new Student()
{
FirstName = "Bill",
LastName = "Gates"
};
context.Students.Add(std);
// or
// context.Add<Student>(std);
context.SaveChanges();
}
That feels pretty clean to me
not as clean as
Oh sure sure, I like Java's decorators that you showed
Yeah, I'm pleased with Microsoft's dedication to their docs
Not quite Python level
But still
public interface CrudRepository<T, ID> extends Repository<T, ID> {
<S extends T> S save(S entity);
Optional<T> findById(ID primaryKey);
Iterable<T> findAll();
long count();
void delete(T entity);
boolean existsById(ID primaryKey);
// โฆ more functionality omitted.
}
this is generated by JPA
you can just type StudentsRepository.findAllByUsernameAndEmailOrPassword();
magic
and the only think you need to do is implmenet
You know how people complain about how Java is verbose?
String findAllByUsernameAndEmailOrPassword(String username, String email, String password);
i have no clue how they managed to implement such a powerful thing
That's such a cluster fuck to read
noooo
I think I'm just spoiled by snake_case
camelCase works for smaller things but huge chunks like that...
Sure, you're saving space on the underscores but that just feels gross
And this is just a general casing gripe, not specific to Java or any other
List<User> findByFirstnameEndsWith(String firstname);
how hard is it to read this
WITH A GOOD FONT
also sorting and pagination
But like more than 5 words or so in camel case just kills me
User findFirstByOrderByLastnameAsc();
User findTopByOrderByAgeDesc();
Page<User> queryFirst10ByLastname(String lastname, Pageable pageable);
Slice<User> findTop3ByLastname(String lastname, Pageable pageable);
List<User> findFirst10ByLastname(String lastname, Sort sort);
List<User> findTop10ByLastname(String lastname, Pageable pageable);
weeeeeeeeeeeeeeee
And it does all of that based on the name?
no clue
If it does then that feels spooky
Variable names feel like they shouldn't dictate functionality, just readability
i honestly cant find any thing explaning how it works
but i have never seen something work like this
its pure magic
Always a good sign
I hate magical
I want to at least have a vague idea what's going on
Especially if you start getting errors being vomited at you
You cannot tell me that you find Java errors easily readable compared to others
There's no way
I mean other than experience with them, obviously
@buoyant kestrel :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
na
Exception in thread "main" java.lang.ArithmeticException: / by zero
at Main.main(Main.java:3)
better by miles
I think this is one we'll always disagree on
ok let me say something we both will agree on
Because I've used Intuit programs where it crashes and you have a traceback that is close to a hundred lines long
And it's not the top part that properly shows the issue
java is arguably one of the most contributing factor to the rise of computers
especially the web
No argument there
python will never come close
Never made the claim that it was or would
Different languages, different purposes
Right too, right job
COBOL, I'd argue, spearheaded the use of coding in business, especially financial sector, miles more than Java
banks aswell^
Does that mean COBOL is better?
You're saying it would have been COBOL
Was gonna say
It came out like... 30 years after
It would've been the better COBOL
never used it
I've attempted to
wont make any argument
This is more observation. While yes, we could say that COBOL is still there because "why change it", but if it didn't work, they wouldn't have kept it
that literally went against what i was saying 10 seconds ago
ofc COBOL has contributed alot aswell
but i dont think as much as java
Sure sure, more explaining my thoughts
I would also argue C is higher up in the food chain
ofc - no argument there - put C++ there aswell
Looking at COBOL again, I don't hate the syntax
It's just getting a test environment up to play with it is a bitch
Have to emulate a mainframe setup
Hi, I wanted to find the value of a specific column in a dataframe. I know this function .value_counts() but idk how to find the value of a specific column
i just used dataframe.value_counts()
What do you mean specific column. Like all the values contained in all the rows for it?
from my knowledge Sim cards runs on Java aswell
Possible/probable
it seems they have their own operating system developed with java
yeah! all the values in all the rows of one column, not the whole dataframe
Java Card
Odd that this pissing match even started since I never made the claim that Python is superior or more important to the history or pedigree of programming in general
programming gets a very vague
that would be C
PHP is coded in C
but generally i would talk about Web
and no language comes as close to java
And?
Java applets
Javascript never implemented anything like Java applets for you to say Java copied it from Javascript
Java applets really allowed interactivity
https://www.geeksforgeeks.org/get-a-list-of-a-particular-column-values-of-a-pandas-dataframe/ This seems to cover what you need. Honestly I was able to find it by essentially searching what you asked
Javascript was built on top of that
and was the successor for sure
yk whats the most important thing in the web?
interactivity
Other languages and implementations also had much more dominance in the web market
who really took it into the main stream? java
PHP, RubyOnRails, everything comes and goes
argument made
Java applets were implemented in Netscape 2 and really changed interactivity (After HotJar)
At the time, sure
i dont get it. why do i have to create a dictionary?
And that time has come and gone
Yes but Java is the foundation
Javascript is the successor
Java must have existed for Javascript to build futher on it
No
You're saying that programmers would have just sat on their hands and thought "Oh golly gee, we don't have any inspiration to make this better, guess it'll stay this way forever."?
That's absurd
i meant built on top of the interactivity java provided
What specific interactivity
JS was made for the sole purpose to have that kind of intractability
And it turned out to be a much more robust alternative
but Java did it first, and Javascript did it way better.
but Java brought it into mainstream
Why is this claim even being made?
JavaScript was first introduced and deployed in the Netscape browser version 2.0B3 in December of 1995.
Hotjar had Java applets
and then Netscape
was like f you i will do it better
boom the web
But the claim you're making is that JavaScript never would have evolved without Java
Which is silly
yes - wouldnt have existed
You're saying that at no point, someone wouldn't have implemented an interactive language
I feel like you're fucking with us at this point
Created by Brendan Eich in 1995 in just 10 days for the Netscape Communications Corporation, JavaScript is a programming language that was inspired by several other languages, including Java. Since 1997, JavaScript has become a trademark of Oracle.
wtf
JavaScript had a different name prior
ActionScript is an object-oriented programming language originally developed by Macromedia Inc. It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript, though it originally arose as a sibling, both being influenced by HyperTalk.
think its a different thing
- Introduced in 2011, the second iteration of LiveScript can compile to JavaScript. It provides improved object-oriented programming options and allows users to develop expressive scripting without the need for boilerplate code.
i mean doesnt it transpile
Neat
And technically we shouldn't be calling it JavaScript anymore
It's ECMAScript, right?
Something like that
my brain currently
@primal bison #data-science-and-ml might be a good place to start
Unrelated note, god damn it I hate Lacerte DMS
man physics for 3 hours really makes my brain go brrrr
@proper cobalt What part?
one day you love it ; the other you hate
well ima go guys
brain had too much for today
I've never said I loved it
Oh right yea
thanks buddy
Sure, but I still hate it
That didn't change
Weird mic drop
Legit thought he said parting goats
hey I need a little help but I can't post it in the apropriate channel
def a():
x=100
pass
def b():
c =100
d =x+c
return d
x = 100
def func()
x = 200
print(x)
func()
print(x)
what about it? ๐
So selecting from a list
fam[x:y] select from a list number from x to y, without y. ???
!e
x = 100
def func():
x = x + 1
print(f"Inside of the function {x=}")
print(f"Before the function call {x=}")
func()
print(f"After the function call {x=}")
Oh for
@buoyant kestrel :x: Your 3.11 eval job has completed with return code 1.
001 | Before the function call x=100
002 | Traceback (most recent call last):
003 | File "<string>", line 8, in <module>
004 | File "<string>", line 4, in func
005 | UnboundLocalError: cannot access local variable 'x' where it is not associated with a value
Ah, fair point
We can't add anything to x within the function scope because it does not yet exist
Yep
So we have the one in the global scope. Sort of
If you're reading the value then it would work
But since you're wanting to overwrite that value, it doesn't
You'd have to either explicitly declare x in order to us it locally OR make it global
!e
x = 100
def func():
x = 5
print(f"Inside of the function {x=}")
print(f"Before the function call {x=}")
func()
print(f"After the function call {x=}")
@buoyant kestrel :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Before the function call x=100
002 | Inside of the function x=5
003 | After the function call x=100
x = 100
def func()
global x
x = 200
print(x)
func()
print(x)
That'll behave the way you originally thought
Yep
It's more prone to errors if you aren't careful
A better solution would be....
your not using c
Mr. hemlock can u help me with a error ?
!e
x = 100
def ham(x):
x += 1
print(f"Inside of the function {x=}")
return x
print(f"Before the function call {x=}")
x = ham(x)
print(f"After the function call {x=}")
@buoyant kestrel :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Before the function call x=100
002 | Inside of the function x=101
003 | After the function call x=101
Passing arguments and returning values is how you would normally handle things like this
So the b() function can only see within itself or outside of itself. It cannot see inside of other functions
If you want it to know, you have to pass it to it or declare it there
!e
So let's take your code and try the following:
def ham():
pork = 100
return pork
def beef(spam):
eggs = 200
bacon = spam + eggs
return bacon
number = ham()
print(number)
new_number = beef(number)
print(new_number)
@buoyant kestrel :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 100
002 | 300
Oh derp
!e
def ham():
pork = 100
return pork
def beef(spam):
eggs = 200
bacon = spam + eggs
return bacon
print(beef(ham()))
@buoyant kestrel :white_check_mark: Your 3.11 eval job has completed with return code 0.
300
Happy to help
There's other little shorthand things you can do such as
def beef(spam):
return 200 + spam
But it really just depends on your needs
Okay, now I'm back
Gonna migrate back up to VC0 since no one is really streaming at the moment
just a sec brb
async def handler1(client, message):
await message.forward("me")
def handler2(client, message):
message.forward("me")
yeah right i can write code here
import asyncio
async def count():
print("One")
await asyncio.sleep(1)
print("Two")
async def main():
await asyncio.gather(count(), count(), count())
One
One
One
Two
Two
Two
just a moment
oh you are from europe?
poland is pretty cheap
malta?
for people from poland is even worse
rip
tik tok is just addictive
it is designed to do that
yeah but you don't earn much from tik tok
sooo some parties from poland say that Poland should leave UE
*EU
nice
nice proof for innocence
is anyone from vc even reading this? XD
wow I am surprised
i would love to talk with you but i don't have 50 message here
sooo it will take some time
๐
math is not that bad
I'm studying computer science
oh I have done matura exam
what is your first language Leonardo?
I learned english the same way
no it's not
i have something similar too
you can talk about it without promoting it
yeah
War had big impact on Poland
soo in Poland a lot of politic parties use war to gain some political approve
yeah
so in Poland there are some proEU parties and some proRussia parties
comunism is just stupid
Poland is great example
we have many
so many
under schools and other buildings
those shelters are from around 1930 something
but there are some new
In Poland there is huge problem with our privacy
Sure, because in 1930, you had to worry about something, we didn't.
yeah
i cant talk
i would like
its kinda crazy
some people think they know better that everyone else
great
Dunning-Kruger effect?
possibly
yes
that was quick
gn
@sturdy geyser https://github.com/projectcalico/calico
Terraform is an Infrastructure as Code tool. I use it at work using AWS. It's pretty cool ๐
Itโs widely believed that the most successful entrepreneurs are young. Bill Gates, Steve Jobs, and Mark Zuckerberg were in their early twenties when they launched what would become world-changing companies. Do these famous cases reflect a generalizable pattern? In fact, the average age of entrepreneurs at the time they founded their companies is...
hey everyone
i need a little bit of help
i need to clear the output terminal in vscode
using the os package
so like import os
and def cls():
need to create a function called cls()
to clear terminal outsput
output*
wtf
Use ansii escape code for clear
can someone please explain super().init()
how do i do this?
Is that hw my g?
idk what all that stuff is when it says compile your code with xyz
but to get an average of three numbers I would use the input method
input ("prompt the user with anything you want")
yeah
and I would just do that three times and set each of the responses equal to a variable
and then add the three variables and divide by 3, set that equal to an output variable and then print output variable
could you please explain what they mean when they say "compile your code with g++ etc"
i'm honestly kinda new to python as well
Yea idk how it would work in c++ I have a feeling its similar but idk
did you get it tho?
@slate galleon
int main() {
double num1, num2, num3;
double average;
std::cout << "Type the first number: ";
std::cin >> num1;
std::cout << "Type the second number: ";
std::cin >> num2;
std::cout << "Type the third number: ";
std::cin >> num3;
average = (num1 + num2 + num3) / 3;
std::cout << "The average is: " << average << std::endl;
return 0;
}```
my code
from urllib.request import urlopen
from urllib.parse import quote_plus
from bs4 import BeautifulSoup
from selenium import webdriver
import time
baseUrl = 'https://www.instagram.com/explore/tags/'
plusUrl = input('๊ฒ์ํ ํ๊ทธ๋ฅผ ์
๋ ฅํ์ธ์ : ')
url = baseUrl + quote_plus(plusUrl)
driver = webdriver.Chrome()
driver.get(url)
time.sleep(3)
html = driver.page_source
soup = features=("html.parser")
insta = ('.v1Nh3.kIKUG._bz0w')
n = 1
for i in insta:
print('https://www.instagram.com' + i.a['href'])
imgUrl = i.select_one('.KL4Bh').img['src']
with urlopen(imgUrl) as f:
with open('./img/' + plusUrl + str(n) + '.png', '.jpg', 'wb') as h:
img = f.read()
h.write(img)
n += 1
print(imgUrl)
print()
driver.close()
error
print('https://www.instagram.com/' + i.a['href'])
^^^
AttributeError: 'str' object has no attribute 'a'
why error?
please give me new code PLEASE DM
0 Posts - See Instagram photos and videos from ''' hashtag
!e py insta = '.v1Nh3.kIKUG._bz0w' for i in insta: i.a
@night lily :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 3, in <module>
003 | AttributeError: 'str' object has no attribute 'a'
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
Farcebook doesn't want you scraping stuff.
Yeah we can hear you ๐
I'm guessing None?
That's usually the way they represent an empty linkedlist/tree on leetcode.
@atomic phoenix 
Btw, are you ok with back-seat coding? ๐
A dummy-node can be helpful. It kind of removes the empty list edge-case.
Oh huh, didn't node that
Very true!
@fallen topaz https://leetcode.com/problems/merge-two-sorted-lists
What's going on with your connection dropping? Is it a connectivity issue?
If you're interested, this is how I would do it: ||```py
class Solution:
def mergeTwoLists(self, list1, list2):
current = dummy = ListNode()
node1, node2 = list1, list2
while node1 and node2:
if node1.val <= node2.val:
current.next = node1
node1 = node1.next
else:
current.next = node2
node2 = node2.next
current = current.next
if node1:
current.next = node1
if node2:
current.next = node2
return dummy.next
brb


What are you guys looking at? ๐
Erm, assuming the two lists are already sorted.
Yeah it would, but this section then appends the remaining elements of whichever list was longer: ```py
if node1:
current.next = node1
if node2:
current.next = node2
Sorry, not necessarily the longer one.
But the one with items remaining.
Thanks ๐
It helps to draw a few pictures, like the one in the example.
It's just re-arranging the arrows essentially.
I think the lists can have different lengths.
But they are guaranteed to individually be sorted.
It's kind of weird, because we're modifying the lists in-place.
Yeah, in the real world ๐
Erm, maybe walk through an example with pen and paper.
Actually draw the list nodes out and the arrows between them.
The only way I can solve these kinds of problems is visualising them.
class Solution(object):
def mergeTwoLists(self, list1, list2=None):
"""
:type list1: Optional[ListNode]
:type list2: Optional[ListNode]
:rtype: Optional[ListNode]
"""
if list1 and list2:
_list = list1
[_list.append(x) for x in list2]
_list.sort()
return _list
# Return either list if other is empty:
elif list1:
return list1
elif list2:
return list2
``` Before I realized it was listnode objects lol
Ah right ok.
You could write a method that iterates over the linked list:
def nodes(ll):
while ll:
yield ll
ll = ll.next
Then do something like sorted(itertools.chain(nodes(list1), nodes(list2)))
But then you have to convert it back to a linked list. ยฏ_(ใ)_/ยฏ
return ListNode(_list)
Erm, try writing it: ```py
def iterable_to_ll(iterable):
...
You need to build up the structure of the linked list yeah.
Yep ๐
A nice trick is to use a dummy-node.
Ah right yeah. I think this: py a = b = c is like doing: ```py
b = c
a = b
Not sure about the exact semantics.
public void add(Object data, int index)
// post: inserts the specified element at the specified position in this list.
{
Node temp = new Node(data);
Node current = head;
// crawl to the requested index or the last element in the list,
// whichever comes first
for(int i = 1; i < index && current.getNext() != null; i++)
{
current = current.getNext();
}
// set the new node's next-node reference to this node's next-node reference
temp.setNext(current.getNext());
// now set this node's next-node reference to the new node
current.setNext(temp);
listCount++;// increment the number of elements variable
}
Actually, I know a website that might help you understand...
one sec.
Huge link sorry ๐
I think they encode all the code into the URL, to make the link permanent.
It's a bit hard to see what's going on sorry ๐ค
Yeah
Yeah exactly
Yep. Variables and attributes are all just references/pointers.
Erm, linked lists are kind of a special case of graphs I think.
One advantage is you can efficiently add/remove elements from either end of this list.
@opal gate ๐
list.pop(0)
list.pop(-1)
Yep, although lists in python are implemented as dynamic arrays. When you .pop(0), every element to the right has to be shifted over one place.
Yeap
collections.deque is a linked list.
Or "double-ended queue", because it's actually a doubly-linked list (links go in both directions).
Yep ๐
If you know about big-oh notation, pop(0) from a dynamic array is O(n), whereas removing the first element of a linked list is O(1)
Yep, it is, although it obviously requires slightly more memory to have links going both ways.
If you're coding in python though, that's probably not a huge issue.
Yeah
No worries
I've got to go cook dinner ๐
Cya
Mine actually doesn't work as it's a linked list of nodes which I didn't understand at the time of writing it. @cold lintel Helped me understand it, and his genuinely works.
Hey ๐ Working on another coding exercise?
What is actually going on with your Discord?
Hey Mustafa ๐
@atomic phoenix Can we get to the bottom of what's causing your Discord client to crash? ๐
It must be annoying for you.
Erm, there isn't a priority queue in the standard library, but there's a heap implementation, which you can use to make a priority queue.
brb
Hey @calm bay 
oops
No worries. I'm not sure myself whether to talk in this channel or the integrated text channel.
hm?
heapq
priority queue is an abstract data structure, a heap is an implementation of a priority queue
also there is a PriorityQueue class in standard library (wrapper over heapq)
Oh there is 
!d queue.PriorityQueue
class queue.PriorityQueue(maxsize=0)```
Constructor for a priority queue. *maxsize* is an integer that sets the upperbound limit on the number of items that can be placed in the queue. Insertion will block once this size has been reached, until queue items are consumed. If *maxsize* is less than or equal to zero, the queue size is infinite.
The lowest valued entries are retrieved first (the lowest valued entry is the one returned by `sorted(list(entries))[0]`). A typical pattern for entries is a tuple in the form: `(priority_number, data)`.
If the *data* elements are not comparable, the data can be wrapped in a class that ignores the data item and only compares the priority number:
I mean, some consider the complexity to be part of the ADT, and heapq provides an easy way to implement that the priority queue ADT (O(log n) pop of the item with highest priority).
Ahh, I did not know this
Is this a recent addition?
I'm not sure what you mean
there isn't a priority queue in the standard library, but there's a heap implementation, which you can use to make a priority queue
is kind of like saying
there isn't a list in the standard library, but there's a dynamic array implementation, which you can use to make a list
ADT defines the interface, not the implementation
heapq is a priorityqueue, it just doesn't have an object oriented API
I think that would be a reasonable thing to say, if it were true.
Ah right I see.
What were you discussing earlier by the way? Sounded like logic (I heard the word "tautology" ๐ )
@atomic phoenix I wasn't paying full attention sorry.
i don't remember but I feel like marlo just likes finding a reason to use such words
Ah no, with Mr. Focus.
oh right, he was talking about first order logic stuff in his discrete math course
am I wrong though, would you not use the word tautology if you had a chance to
look me in the eyes and say it
Oh right. Tell him to check out this website: http://intrologic.stanford.edu/logica/homepage/index.php
@opal gate
@fallen topaz I'm going to be here for a while, so you can stream if you like.
!stream 559903350024568833
โ @fallen topaz can now stream until <t:1674244053:f>.
nobody wants to make me a mod ๐ฆ
been asking hemlock for ages
can you even imagine me abusing my powers? it's unthinkable
I think the problem is right now we have about a billion moderators already.
what's one more
ยฏ_(ใ)_/ยฏ
it's fine I don't have time for it anymore with work and stuff
would have been cool in the 11 month hiatus from work i had
So @atomic phoenix, did you understand the idea behind the code I posted?
You have the right idea to draw pictures of nodes with arrows between them.
That's how I visualise this kind of problem.
Btw, what's going on with your client crashing all the time?
Is it like an out-of-memory issue or something?
Hey @flat mural ๐
hello
Segfault 
Is it a standard client?
Oh, that's weird.
Are you on Ubuntu?
Maybe try installing by downloading from discord.com?
Just drop it in /opt and add an .application file.
Or .desktop or whatever ๐
Fair enough
I guess snap packages are nicely isolated.
Ah right. I haven't had any issues with Discord on Linux though
Maybe you could try installing a different version?
Hey @primal bison ๐ Just chatting, and doing some coding exercises.
Erm, I'm not sure Maro, let me check...
Oh like context-free grammars?
Erm, probably. I've not developed something like that myself, but I'm sure there are libraries for it.
Nah you're not
This might be what you're looking for @primal bison https://github.com/davidmaamoaix/Overlay
It's based on tkinter. I know a pretty good tkinter tutorial.
Oh it is? :C
Yeah I think the best projects to work on are ones that people will actually use!
Hey Rabbit ๐
Yep
Adversarial crossword 
nice emoji
Band name
:C
Ohh, writing a recursive-descent parser can be fun.
Ah nice
Bye Maro ๐
Yeah that's pretty accurate. You start at the top an recursively break the sentence down to figure out the structure.
Backaus Naur Form
Sounds interesting
Sure
!stream 559903350024568833 20M
โ @fallen topaz can now stream until <t:1674246931:f>.
Ah, parsing natural languages is fairly difficult.
At least, doing it in a way which is robust.
Bit small 
There is such thing as a parser parser yeah ๐
Aka parser generator.
Ah interesting
๐ Hello
Btw, there's a small example of a tokeniser in the re documentation: https://docs.python.org/3/library/re.html#writing-a-tokenizer
Ah very nice ๐
Ohh the dragon book!
O Wow
Erm, live-coding, but whatever.
You could measure it in terms of the number of machine code instructions it compiles to ๐ค
Yeah, a major factor is cache performance.
mhm
Oh yeah, you should check out code golfing ๐
You have to solve problems with the smallest amount of code.
Yep ๐
People have written languages specifically for golfing.
Does python compile to machine code?๐ค
There's a code golf Stack Exchange: https://codegolf.stackexchange.com/questions/256556/find-the-first-run-of-numbers-summing-to-n
Some solutions are extremely inventive.
Python is typically interpreted rather than compiled.
Yeah but it's all in good fun ๐
Ah well it compiles to an intermediate byte-code representation.
Although the byte-code is specific to CPython.
Yeah there are a few others.
PyPy and Jython for example.
Jython is JVM python.
Erm, they behave pretty similarly, if your code is written in pure python.
Most code written for CPython will work fine when run with PyPy for example.
PyPy is much faster in some cases.
Note PyPy is different from PyPI (Python Package Index).
It's a just-in-time compiler.
There sites that allow you to convert java code to python
Yep ๐
it might use weird nested else and if statements instead of elif statements so it isn't going to be very efficient I assume
Yeah, list expressions are not a regular language unfortunately. You'd have to parse them.
Not sure what you mean sorry.
Ah right. Can words contain only latin letters and digits? 
[a-zA-Z][a-zA-Z0-9]*
Something like this?
Dude, I had to study this at university ๐
Writing out regular expressions by hand and converting them to equivalent finite state machines.
Ah right yep. You need to surround with word boundaries.
\b[a-zA-Z][a-zA-Z0-9]*\b
@fallen topaz 

I'm not sure on what the exact definition of \b is.
Ah nice.
You don't have any quotes in your test string 
Oh right
How are you going to handle nested quotes?
