#voice-chat-text-0
1 messages Β· Page 82 of 1
Using percussive maintenance on social engineering problems
they would normally say,"here check out my project cruiser"
Back in a sec
ohh wait it actually has a rhyme
if you read it in a flow!
wassup
Nadir
@amber raptor what should I use instead of Make for cross-platform making?
Here's the whole ramble I typed up --
Hello humans opinions wanted
I have a Makefile - https://github.com/shenanigansd/scratchpad/blob/main/Makefile
It is not cross platform
I want cross platform
I made one of these - https://github.com/shenanigansd/scratchpad/blob/main/justfile
Which is from this - https://github.com/casey/just
It's basically a better version of Make in Rust BTW, so I could install it on all platforms.
But now I'm trying PowerShell - https://github.com/shenanigansd/scratchpad/blob/main/make.ps1
And I think it's won me over.
It's the least friendly and I think it's ugly, but it's always there with no extra dependencies [PowerShell is part of my Arch BTW install script]
I thought about Python but I don't want to be Python-ing from inside Python
Thoughts?
Thankfully it was just that the tray guide was set to 8 1/2 by 14
Just had to move a thing
Getting paid to do bad work, what?
Hey that's my job
Preach it
π
@slim quiver π
I don't think you doing good work at work is going to get you into heaven or prevent you from doing so
Adequate
Yeah
Sufficient
Training
Practice
Prep
Stretching before helps as well
Dedication to the cause
@somber heath I can sense you giggling
Yeah true
You guys get 100s??
And the time they spend at work may be mostly spent looking for a new job
You get pennies??
HA
ur gey
Well played
If they're in Mexico, they'd be SeΓ±or Managers
Wash
Yep
Washing away total results
Tabula rasa
Wait, Rab
Unrelated
I thought .msi files weren't used anymore
In theory
wat???
Those are the new popular ones
They're 
Death to .exe(s)!!
MSI are still recommended Windows Installer format
.exe is the old format
is "free for all"
Every company makes up their own command line switches
.msi has a spec, so computers know where to go to find what they need, so everything is all standardized
Kinda like PEP 517 for Python
If I try to put something in InTune it wants a .msi file
No, any time you try and do cross platform build, you back yourself into a corner, write 3 separate install instructions for each platform and call it a day.
That's what I thought
For some reason I thought that they were hated for some reason
@mild quartz Sup brah
MSIs, they are, they are garbage but so is Windows
Why are they so bad? Maybe that's what I heard
@cerulean ridge Sup
Whatcha workin' on
Because they are extremely open. You want to install something to C:\Program FIles and C:\Windows with 5000 registry keys, GO FOR IT!
(which one?)
MSI
You're an adult
I'm not saying it's not dangerous, existence is dangerous
Same
As the youngest child, I get it
Public transportation is fine
Wait, we talking like a city bus or like Grey Hound
Oh then you're fine
They're a bit more stringent on security
Fair
I've taken Grey Hounds a few times
At worst you're going to have cramped seats
Oh in that case
Then yeah, you're golden
That's not bad
You'll probably have a few stops on the way
So you'll at least be able to stretch your legs
Flying is more expensive
"It's a me! Fileio!"
Yeah, Grey Hound isn't that bad
The stations can be a little rough around the edges
Eh like... not well maintained. Possibly dirty bathrooms, chipped floor tiles, etc.
HA
Every place has their own slums
Nah
Just the big big cities or tourist locations
The rest of it is not unlike the rest of the world
Homes, buildings, businesses
No
But that's personal preference.
I own 2 firearms, granted, but they're strictly for target shooting. I do not carry, and I do not have them for self-defense
"would you recommend me buying guns"
"as like, the first thing I do"
_
intensifies _
Haven't been to a range in years
... why is Markdown broken?
It's two underscores, isn't it?
It's a dog
Ehh
I wouldn't take Texas as a good example
Also not sure how they see "foreigners" with guns
In my experience, trains are more comfortable than busses, but I suppose it depends on each.
We don't have a very good train network in the US
You'll have to submit to a background check to purchase
Depends on the state. π
Especially Walmart
Because they're a national chain
They have a overall policy
I think
Didn't buy mine from them
If you want to deal with guns, go to a shooting range and try in a controlled setting
More fun that way, honestly
I also recommend firing .22lr ammo guns. More ammo per dollar, very little recoil, just more fun to me
There's tons around
Oh uh...
Maybe if there's a Cabela's or a Bass Pro
Outdoor goods in general
Camping gear, hunting gear, fishing gear...
Just general outdoorsy stuff
Actually
Now that I think about it
You might just see if there's a well rated local place
Which do
Bass Pro bought out Cabela's
But they might still have the Cabela's branding depending where you are
They do, but it's smaller, at least he one here is
You'd probably want to find a newer range that's more local
Like there's one here in/near Springfield, MO called "Sounds of Freedom"
Yes, you read that right
I can't make this shit up
Possibly
No
Actual bows and arrows
Or crossbows
Archery is archery
That's just local here
Just the name is like... Yep
That's America
Oh huh
Freedom, my arse.
Ah, my mistake
Just "The Sound of Freedom"
Singular
That's where I bought my pistol
Really nice place, well maintained
HA
@whole bear Yo
I hear you
Wanted to swing by and say Hi before I leave
@cerulean ridge If you're curious, the one I got was a Ruger .22/45
There are rifle ranges too
You don't, I swear you don't xD
It is yeah
Yeah you have to kind of look specifically for a rifle range. Now, I can take my rifle to the range because it's a .22lr caliber. So it's still small arms caliber at that point
Yo
Woooaaah
Bella we're getting crap tons of echo
Wooops
Yep you're golden
Hanging in there
I mean
Wife is still sickly, it's tax season....
Just tired, that's all
Yep
Eh
When it's IT I'm happy
It's what I went to school for
Yarp
As staff you can
Yeah
What're you up to
Oh yeah yeah
Glad to have you as always
Trying to figure out what the hell I want/need to do
Putting off doing delivery runs
@somber heath You just described me
going deaf with age
How old are you again?
Checks out
Tinnitus for days
True
"Why didn't anyone tell me this would happen!?!"
Catch you later
I do yeah
Or be highly confused
Or both
Hmm...
Attempting to redo the database picker (actually taking time now). Just trying to find the event triggers
... he says just now finding it
The secret to happiness
Depression disagrees with you
-silence-
Oh no no
It was in response to Opal
"If you're happy and you know it clap your hands" -silence-
πΆ If you're dead inside and know it clap your hands πΆ -round of applause-
And I do like music yeah
What type of myouzek
Large variety. 90's - 00's alternative rock is my current addiction
"If you're happy and you know it clap your hands. :click: :click:"
Of course
They were 80's though, weren't they?
Ah right right
I do yeah
I'm hit and miss with them
No that's NBA Jam, Bea
Very of course
Ever heard of Clutch?
Love them
Thinking....
I've got a top 3 I think
Double checking I'm getting the titles right, one sec
@whole bear
The Mob Goes Wild
Texan Book of the Dead
X-Ray Visions
@ripe torrent Sup
But they have a LOT of good songs
Been here like 1.5 years ago
Welcome to the party
good to see opal here
!u

Created: <t:1513930688:R>
Profile: @ionic inlet
ID: 393678585413500939
Joined: <t:1625868594:R>
Roles: <@&267629731250176001>, <@&831776746206265384>, <@&409416496733880320>, <@&267630620367257601>, <@&295488872404484098>, <@&764802720779337729>, <@&518565788744024082>, <@&1074780483776417964>
Messages: 13,246
Activity blocks: 1,982
Total: 9
Active: 0
I like that they added it to the profiles
Yeah, it's handy
Been here a long ass time
do we have like a bot for amount of time spent in vc?
We don't, it's really quite hard to track
idk....there are bots though
It's tedious
for tracking time spent
Yeah. I'd have to see how they implemented it, but if they're basing it purely on voice events, then it's going to potentially be unreliable
can he/she add them in here? after taking permissions?
If they're basing it on current channel occupants, it'll have to repeatedly check
yes amount of time spent in voice channels
We could probably implement it, but I don't think we've ever really had any reason to track this information.
No I know that
is the basis of those bots
true but the same reason applies for msgs sent as well
:}
It'd potentially be a lot of overhead
need for msgs track?
thts only till 50
isnt it
and thts managed either ways
It's also helpful for us when picking helper candidates, quickly checking to see if someone with poor behavior is brand new to the server or not, or if they've sent a lot of messages if they've been here a long time but just lurking
I think we do track how many people are in VC at any time, right? π€
Propose it in #community-meta
I don't think so
ohkk
Discord just has a cap you can set
Ah I thought that was something @tidal rapids tracks.
wb me
You ever figure out the model issues you were having?
Ah true true
Depends how loud you are I suppose
Back in a sec as well, getting water/coffee
yeah all is well
firt
Which is just a different sounding fart
Those little ones
The whole approach yeah
All their clothes were wrinkled. No sense of irony
I don't know if I'm proud of that one or not
HA
Hey hey, keep it clean alright?
@mild quartz #sorrynotsorry
What you wanna go? You gonna starch some shit?
I know I have more
But my brain is stuck on "practice what you bleach"
And I just don't have any lead in to that
It's a bit of a delicate situation
I might cycle back to it
But currently it's a bit of a wash
Oh right yeah
Oh woooooow
That took me a moment
That's amazing
Man that guy can really dish it out
My jokes are running dry
I must be getting softener in my old age
Okay that was bad even for me
Which is funny since we were talking about washing and cleaning
GET OUT OF MY HEAD
@timber mist How's it going
good!
Yeah yeah yeah
OH NO
No no no no no
I know what you're thinking
And that's sounding like a bad idea
I don't think we can top that
What is?
Ah yes, the programmer's paradox
"It's broken and I don't know why"
"It's working and I don't know why"
π
Your code base
Lots of lines, few lines
So what's breaking in it?
@timber mist So what's the program, if you don't mind me asking
I'm also a video editor and sometimes I want to just open a folder and start a new project, but it's better not to make a terrible mess. I make a code that creates all the folders I need and also creates a file for my editing software
Oh neat
@cunning lake Yo
Oh just reading up on events in Tk
Ah HA
Found the event I want
https://tcl.tk/man/tcl8.6/TkCmd/bind.htm#M7 Handy little list
People give tkinter crap but it's not bad
It's good enough for the small tools I make for work
How do you mean?
Oh I getcha
True true
Overkill for this little bastard, though
@midnight agate Suuuuuuppppppppppppppppppp
It's probably cursed
Something isn't working on a computer? Demons
Or daemons
Or demon daemons
Or daemon demons
You get the picture
Welcome back, cruiser
@midnight agate Your audio not working again?
:{}
Yeah if you're trying to say things, your mic isn't coming through
.... especially now that you're disconnected
I heard a click
There we go
Huh, haven't heard of Helix (unless you've told me before and I've forgotten)
Errr, they're a little bit different.
It's based on another editor, Kakoune.
The main difference is, you always have a selection. When you move around, the selection changes.
When you apply a command, it applies to the current selection.
So, it's the other way round to Vim.
In Vim, you do <command> <movement>, whereas in Kakoune/Helix, you do <movement> <command>.
E.g. in Vim you would do dw to delete a word.
But in Helix/Kakoune, you do wd (select the word, then delete it).
Noun Verb?
That feels weird
It's from Bazinga
@whole bear Sup dude, didn't see you join
@midnight agate Yeah now it's background from you
Depends on your purposes. And what job you've gotten into
Not all websites need speed
If it's a low to medium traffic website, meh
LP is the Go person
HA
Correction, Go lover
Well played
LP the user
No no
He was joking
LP is a user on the server
True
sup
But I wonder if it's more as a sounding board
To each their own
(Never used it, don't have a use case for it personally)
It was to what you said
Yeah
Can be both
Love you, bud
Fair
I can't really say anything, I rock the self-deprecation
Itty bitty
He's Italian Farzin π
Sliders
@whole bear You've got like... fan noise or something in your background
You might want to check your settings, see if Krisp is on
I can hear him
I could hear him the whole time
That's on you @whole bear
I can hear Maro
I can hear him 
Oh my god
Read chat
I will end you
Vim World
That does not sound like a fun amusement park
You can never leave π
Until you learn how
You also have to learn how to ride the rides
And you may or may not have fun with it
But the rides are free
So nothing really lost
Very nice
Nifty
I haven't really delved much into customising Helix.
I think it's still fairly new software, so it's missing many of the features of Vim.
Kakoune is arguably more mature.
Errrm, easy configuration π
Have to try new things to see if you like them
As in, you don't have to do much to get language servers working.
Helix has LSP integration built in. Kakoune uses an extension.
I mean... vim was created how long ago?
at least 2 or 3 weeks ago
I think a bit more
@rugged root Hey
How's it going?
For me, I just want a text editor with as little friction as possible, which I haven't really found.
Sublime Text has fit that bill for me
i guess a noise supression would do it
You'd think so
some ppl just dont have it turned on
What's going on here. I;m new
@midnight agate Go ahead
Eh, just kind of hanging out, shooting the shit and all that
This sounds right 
Okay. I will just have to play along
Eh
I mean if you have questions or want to talk about stuff go for it. Just kind of a slow day today
Who are you asking?
Fair
No I'm good with that
Web front end would be TypeScript or JavaScript for obvious reasons
@lucid blade Sup
PyCharm?
HA
Classic
How goes it
all good much chatgpt fun
Nifty
As I step up to the kettle,
Ready to make a brew that'll settle,
I gotta make sure I do it right,
Boiling water, tea bag, and milk in sight.
With a flick of the wrist and a twist of the hand,
I stir it all up like a one-man band,
A quick taste test, and it's just fine,
My cup of tea, oh so divine!
So if you wanna sip on something hot,
Just follow my lead, give it your best shot,
Make a brew that's fit for a king,
And sit back and enjoy that thing!
hehe π
That's the most British thing you could have ever asked it
1st thing i asked it was ...
write me if by rudyard kipling in the style of stevie hyper d
Only you
haha ...
`If you can keep your head when all around
Are losing theirs and letting off sound
If you can trust yourself when others doubt
And keep the vibe alive, never drop out
If you can flex and still keep your humility
And get the crowd hyped with your ability
If you can grind hard but keep your soul
And still be true to your original goal
If you can keep your focus in the darkest night
And keep the flow tight, never losing sight
If you can ride the beat and ride it well
And let the bassline do the story tell
If you can handle fame and not lose your way
And still remember what you want to say
If you can live your life with no regrets
And keep the crowd jumping with no resets
Yours is the stage and everything that's in it,
And - which is more - you'll be a legend, Stevie, my friend!`
i was blown away tbh π
That sounds like a more helpful question
The way that's structured
And it does make sense to ask
so duckin slick man
Considering you just got a job, yeah
ive been using it to write short stories about my friends and sending them the stories
Back in a jiffy
Fair enough
We'll never know
@midnight agate 8080 is wondering if you have tmux at the bottom
You apparently couldn't hear him
He was speaking
If you say so
Or you could just send him the message
In here
So that he can know
Potential 5% gain
Not guaranteed
Tbh, that's probably the sensible thing to do.
i thought i recognised it
And the productive thing to do.
I highly doubt vim has been a net productivity gain for me over the however many years I've used it.
I mostly set mine up as procrastination during work
so it was sort of net neutral for me
and also vim and vi you can use tools like grep awk and sed
ive never got that far though
Oh now I remember why I switched to Kakoune actually lol
It has a client-server model, so you can open multiple clients connected to the same session.
What's the primary advantage of that?
So you can use your own window manager, instead of having like three window managers layered on top of each other.
I just thought it was nifty.
In vim, you would have to either use the built-in window system, or open multiple sessions, which means you can't easily copy/paste between them (and other things).
You could copy to the system clipboard, but it's not very convenient in Vim.
Why wouldn't it use it or let you just change the default alias to use it
Feels antiquated
Well pretty much whenever you change/delete anything in vim, whatever you deleted gets saved so you can easily paste it back into the file somewhere else.
So like, if you do dd to delete a line, you can then move to a different line and do p to paste it.
If it used the system clipboard, it would be constantly overwriting it lol
Like using _ to get the last returned value in the Python REPL
I mean...
Isn't that what it's doing anyway?
I'm assuming if you dd one line then dd another, it's only going to remember the most recently deleted thing right?
In that case it's no different
Yeah that's true
Just sounds like cut and paste instead of copy
And since p doesn't specify whether you're pasting a previously deleted line or previously copied line....
Unless it does
In which case that'd be cool
Not meaning to grill you, sorry
You can save to different registers, although I didn't use that very often.
Windows lets you access past things added to the clipboard
It would be pretty hard to keep track of everything I think.
Yep
IMO you need to set vim up to use the system clipboard by default
As in you would prefer to do so?
yeah
Just makes more sense to me
Like what if you're trying to copy from the editor to a message
Like to Discord
Actually that is a good question
How do you do that
From vim? You have to select a special register first (I can't remember which).
That's silly
if you just have set clipboard=unnamedplus in your vimrc or whatever, it uses the system clipboard by default
Hmm, yeah not sure why I never did this 
Just feels weird that it ISN'T the default
But I guess it's to keep with the old ways
-waves hands mysteriously-
I wouldn't ever be willing to use vim without that
selecting the system clipboard register is really fucking annoying
@midnight agate Thoughts on this?
Why have those extra steps
How often do you have them sorted in a useful way
That just feels... tedious
I get the appeal
But like...
Eh
I'm probably just jaded and like using my mouse
My ADHD doesn't let me think in that continuous manner
I get the principal, I just can't think of a common application
Sure sure
I mean in the case of the registers in vim
Not that it's not worth it, but I just don't see a practical application for accumulating all those things that way
Personally at least
Like when I hear "delete" I think it's deleted, not "cut"
What you're describing sounds like "cut"
Preciesly

Bear vim
rarr
No
I just wanted to say bear vim
My brain is always looking for puns or jokes, good or bad
Charlie
He would beat your ass
Don't even
100%
I guess it's just a terminology thing for me
Guess what they call "copy" in vim? π
replicate?
"yank"
Β―_(γ)_/Β―
Pulling it to a different position rather than making a new one
That is - noooo
it was amazing
Where is that even from
"Modmail" server. Idek what server that is lol 
zubba zubba
are you planning armageddon in here
Called it
Yeap
@civic zephyr Sup
Not against the rules no
@quasi condor chill
Communities
The communities page on our website contains a number of communities we have partnered with as well as a curated list of other communities relating to programming and technology.
@civic zephyr You might find a server here: https://github.com/mhxion/awesome-discord-communities
That sounds reasonable
That's my fave
Thank you
I'll smack Charlie upside the head
Wait is this Maro lecturing his boss?
And you wonder why you have a hard time getting employed
You seriously don't see this
I'll be right back
AmigaDev - is gonna be old i think , in awesome discord
Well, she certainly knows you well
That I doubt
They'll probably just be sick of your shit
I really don't think you're going to break the system and make change
I think it's more you don't continue to defy or lecture your boss
-sighs-
You do you, brother
You do you

What's going on in here?
I like bees.
Yellowjackets I'm not fond of.
But it's part of the game
Hey Rab
Sup Rabbit
Or sting your neck while you're just trying to enjoy a birthday party
Fuck wasps
Wasps are assholes
And they're also incredibly creepy
There are so many just terrifying kinds of wasps
Maro, I think the big thing is, do you want to stay employed/get employed or do you want stick to your moral guns and potentially continue to get rejected. Able to eat.... riding the high horse
Pick one
Then knuckle under and deal with it
No, work isn't always going to be perfect
You're likely going to be doing some things that you deem pointless
That's life
That shit happens
And I'm guessing your gf is tired of this cycle as well
If nothing else, do it for her
There's a reason pride is listed as a deadly sin
@molten pewter Sup
7 days
That is no longer in nap territory
@midnight agate I'm sorry if I was too much of a dick
I know
I just have to apologize, it's in my nature
Only evidence to my points are the stories and situations you've told
If you fib while giving a testimony, would you be a lie witness?
Moronic?
HA
@mild quartz Well played
Does git have a built in make a .gitignore file?
Or is that something GitHub does specifically
Or you just have unstable relationships
You literally just said a statement about the anger thing related to a relationship
Apologies if it was a poor assumption you were speaking from personal experience
Nor did I specifically call out your current relationship
.gitignore is part of git
Right but I mean generating the file with the handy defaults
no, that's not it's job
I will appreciate if someone can come up with a coding challenge and lets put our heads to solving it...just saying
Nigeria
I'm working on finding one
..... demanding today aren't you
haha
There wasn't confusion
Getting an extra pair of eyes on something
See previous pendulum analogy
Charlie
glad to hear ML/AI
Civvy CV CV.
Hop down if you're going to do your code thingy, please
I was trying this,, but couldnt do it
Or that works too
yeah.. I just wanted us to put our heads together on this
I havn't come across medium /easy one of this
Okay.
Well, you can come up with an easy one
have done this excercise in my tutorials
okay. lets so that
I can't talk because I'm in a very noisy environment
I'm following
I really like your approach
@midnight agate Thanks. I gotta go. I have a meeting my boss. Will join the chat in approx. 1 hour time
Please share your code. Thanks
@dense ibex
from sklearn.tree import DecisionTreeClassifier
music_data = pd.read_csv('music.csv.zip')
x = music_data.drop(columns=['genre'])
y = music_data['genre']
model = DecisionTreeClassifier()
model.fit(x,y)
predictions = model.predict([[21,1],[22,0]])
predictions```
UserWarning: X does not have valid feature names, but DecisionTreeClassifier was fitted with feature names
warnings.warn(
array(['HipHop', 'Dance'], dtype=object)
!d list.sort
sort(*, key=None, reverse=False)```
This method sorts the list in place, using only `<` comparisons between items. Exceptions are not suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state).
[`sort()`](https://docs.python.org/3/library/stdtypes.html#list.sort "list.sort") accepts two arguments that can only be passed by keyword ([keyword-only arguments](https://docs.python.org/3/glossary.html#keyword-only-parameter)):
*key* specifies a function of one argument that is used to extract a comparison key from each list element (for example, `key=str.lower`). The key corresponding to each item in the list is calculated once and then used for the entire sorting process. The default value of `None` means that list items are sorted directly without calculating a separate key value.
!d sorted
sorted(iterable, /, *, key=None, reverse=False)```
Return a new sorted list from the items in *iterable*.
Has two optional arguments which must be specified as keyword arguments.
*key* specifies a function of one argument that is used to extract a comparison key from each element in *iterable* (for example, `key=str.lower`). The default value is `None` (compare the elements directly).
*reverse* is a boolean value. If set to `True`, then the list elements are sorted as if each comparison were reversed.
Use [`functools.cmp_to_key()`](https://docs.python.org/3/library/functools.html#functools.cmp_to_key "functools.cmp_to_key") to convert an old-style *cmp* function to a *key* function.
these two
it may be a linked list, for example
in that case you can't "just sort" it
Output: [1,1,2,3,4,4]
Example 2:
Input: list1 = [], list2 = []
Output: []```
class Solution:
def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]:
result = []
for i in range(len(list1)):
for j in range(len(list2)):
if list1[i] <= list2[j]:
result.append(i)
else:
result.append(j)
return result ```
ListNode is not a list
Maro and I were solving this earlier
(I was mostly suggesting refactoring options, not actually solving it)
@whole bear π
@tiny pebbleπ
two lists are given as sorted, that's what's stated in the problem statement, iirc
hello
from the placeholder code:
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
list1 has no __len__
this is all you have in ListNode:
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
ListNode().next is of type ListNode | None
!e ```py
class MyClass:
def len(self):
return 9001
my_instance = MyClass()
result = len(my_instance)
print(result)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
9001
in this specific case, without digging into the class, there's no way to add that
(defining a function would probably be more task-appropriate)
this is the definition
ListNode(0, ListNode(1, ListNode(2, None)))
roughly equivalent to [0, 1, 2]
adding methods is used a lot in old JS libraries/frameworks
kind of an extension method but worse
Rust does it well
why this?
whats the use of it?
to make a list look bigger?
why cant we write [1,2,3]
because that's the task
you're given a ListNode and need to return a ListNode
linked lists have their special uses in other cases which aren't demonstrated here
ohk ty
if list1.val <= list2.val:
result = list1
result.next = self.mergeTwoLists(list1.next, list2)
else:
result = list2
result.next = self.mergeTwoLists(list1, list2.next)
return result```
worked !!! @vocal basin
!e py import time t = time.monotonic() time.sleep(3) print(time.monotonic() - t, 'has passed.')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
3.000087827909738 has passed.
use asyncio+threading not to block
import time
import random
common = [
"wolf",
"tiger",
"bear",
"shark",
"seal"
]
print("Hello! Welcome to Python Zookeeper! Every 3 hours, you get an animal at random. You can sell them for tokens and get some even rarer animals! Make your zoo the best you can possibly make it! Enter in Zoo to get started!")
while True:
zookeep = input()
if zookeep == "zoo":
print('Nice! You got a', (random.choice(common)), " Take good care of it!")
time = time.sleep(10800)
if time < 108000:
print("You cant do that, there is a three hour cooldown between```
separate the loop and the handler
so, first, abstract the input handling function
while True:
handle(input())
that will make things a little easier
the next thing you might want to do is to store the state your program is in somewhere
either track what time is left before next input can be processed
or do the threaded solution (with sleep and all that)
ok
the simple way (with no concurrency) is to store the time until when the input is blocked
and always reject the input (regardless of what the input is)
input() can be called from anywhere
should it? probably no
in more complex applications, there should be a simple separated entity responsible for taking the input
having input in the context of some code that's expected to get some data from the outside, it may be fine
for example, functions called during some sort of setup
I think I remember what's the largest method in my code
time to count lines
67
(a lot)
the current structure is
if ...:
...
elif ...:
...
elif ...:
...
else:
...
whereas to separate it, it'd have to be
if ...:
...
task = ...
elif ...:
...
task = ...
elif ...:
...
task = ...
else:
...
task = ...
return await task
the reason is that inside of each block it manipulates the state in a synchronous way and then proceeds to do the async stuff
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
result = []
for i in range(len(nums)):
if nums[i] != nums[i-1]:
result.append(nums[i])
return result ```
is this code wrong for removing duplicates?
if input = [1,1,1,2]
output = [1,2]
only checks for duplicates that are near each other
[1,1] -> []
!e
class Solution:
def removeDuplicates(self, nums: list[int]) -> list[int]:
result = []
for i in range(len(nums)):
if nums[i] != nums[i-1]:
result.append(nums[i])
return result
print(Solution().removeDuplicates([1,1]))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
[]
this shouldn't happen
ik them a lil bit for C
!d match
8.6. The match statement
New in version 3.10.
The match statement is used for pattern matching. Syntax:
match_stmt ::= 'match' subject_expr ":" NEWLINE INDENT case_block+ DEDENT
subject_expr ::= star_named_expression "," star_named_expressions?
| named_expression
case_block ::= 'case' patterns [guard] ":" block
```...
in terms of things literally called "switch", C# probably has one of the most capable ones
both C# and python have _ as a keyword just because of that, pattern matching
!e ```py
class Solution:
def removeDuplicates(self, nums: list[int]) -> int:
result = []
for i in range(len(nums)):
if i == 0 or nums[i] != nums[i-1]:
result.append(nums[i])
return result
print(Solution().removeDuplicates([1,1])) ```
(soft keyword, rather)
!e ```py
class Solution:
def removeDuplicates(self, nums: list[int]) -> int:
result = []
for i in range(len(nums)):
if i == 0 or nums[i] != nums[i-1]:
result.append(nums[i])
return result
print(Solution().removeDuplicates([1,1]))```
@sharp urchin :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1]
!e ```py
class Solution:
def removeDuplicates(self, nums: list[int]) -> int:
result = []
for i in range(len(nums)):
if i == 0 or nums[i] != nums[i-1]:
result.append(nums[i])
return result
print(Solution().removeDuplicates([1,1,2,2,3,4]))```
@sharp urchin :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 3, 4]
seems ok
you have an if statement
oh, wait
where do you need to put them?
those are actual lists, so you can use len() on them
!e ```py
class Solution:
def removeDuplicates(self, nums: list[int]) -> int:
result = []
for i in range(len(nums)):
if i == 0 or nums[i] != nums[i-1]:
result.append(nums[i])
if len(result) != len(nums):
result.append("_")
return result
print(Solution().removeDuplicates([1,1,2,2,3,4])) ```
@sharp urchin :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, '_', '_', 2, '_', '_', 3, '_', 4, '_']
!e
target = [1,1,2,2,3,4]
print([a for a, b in zip(target, [object(), *target]) if a != b])
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 3, 4]
I know it
to some extent
it has PEP written on it
three
Python Enhancement Proposals (PEPs)
Python Enhancement Proposals (PEPs)
scopes inherit only partially
for some mutability you need to explicitly declare that you're using a variable from the outer scope
I have a module with a lot of match-casing in it
because I'm trying to build the API that's easy for me to understand and maintain before I move on to using some more widespread and appropriate solution
case {'type': 'guilds'}:
guilds = []
for guild in self.client.guilds:
if self._guild_visible(guild):
guilds.append(
{
'id': str(guild.id),
'member_count': guild.member_count,
'name': guild.name,
}
)
return guilds
case {'type': 'sleep', 'duration': (float() | int()) as duration, 'echo': _ as echo}:
await asyncio.sleep(duration)
return echo
!e ```py
class Solution:
def removeDuplicates(self, nums: list[int]) -> int:
result = []
for i in range(len(nums)):
if i == 0 or nums[i] != nums[i-1]:
result.append(nums[i])
while len(result) != len(nums):
result.append("_")
return result
print(Solution().removeDuplicates([1,1,2,2,3,4])) ```
@sharp urchin :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 3, 4, '_', '_']
!e py data = [1, 2, 3, 4, '_', '_'] print(*data)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
1 2 3 4 _ _
.
seems to be working
raise TypeError(str(ret) + " is not valid value for the expected return type integer[]");
Line 37 in _driver (Solution.py)
_driver()
Line 44 in <module> (Solution.py)
During handling of the above exception, another exception occurred:
TypeError: slice indices must be integers or None or have an __index__ method
out = ser._serialize(param_1[:ret], 'integer[]')
Line 34 in _driver (Solution.py)```
class Solution:
def removeDuplicates(self, nums: list[int]) -> int:
result = []
for i in range(len(nums)):
if i == 0 or nums[i] != nums[i-1]:
result.append(nums[i])
while len(result) != len(nums):
result.append("_")
return result
def removeDuplicates(self, nums: list[int]) -> list[int]:
list[int] in return not int
oh, also
wait
looks weird
what does the task say, again?
on the usage of _
your task is to change the list in-place and return the length
you don't need _; it's just how it shows missing values in the leetcode
you need to change nums
!e py data = [1, 2, 3, 4, '_', '_'] print(*data, sep=', ')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
1, 2, 3, 4, _, _
also:
Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.
!e py data = [1, 2, 3, 4, '_', '_'] result = ', '.join(str(v) for v in data) print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
1, 2, 3, 4, _, _
thanks for it:}
the task is to do it without creating any new lists
i.e. you need to overwrite the existing values
during the iteration over the list
why isnt this working then?
i wonder
it is expected to return the length not a list
i just dont get it
Input
nums =
[1,1,2]
Output
[1,2]```
where is the length in this
?
[1,2] is the length?
this is the sample input and output from leetcode
the thing that's printed is nums
the list is truncated down to the length that's returned
example
input: [1,1,2]
after calling the function: [1,2,2]
what the function returns: 2
output (first 2 elements): [1,2]
dude these problems are ass.....they dont make sense:[
File "c:\Users\My pc\Desktop\test\Flappuccino\main.py", line 4, in <module>
from .player import Player
ImportError: attempted relative import with no known parent package
PS C:\Users\My pc\Desktop\test\Flappuccino>
how do you start your program?
(what command)
I'd suggest not using relative imports
I did it again.
i just used run in VSCode
does from player import Player work?
def get_neighbors(self, y, x, data=True):
if ([y, x] == [3, 7]):
pass
def get_data(points):
for point in points:
# print(point)
if (point == 0):
yield '0'
else:
yield self.get_point(point[0], point[1]).str_data
def get_points(y, x):
for _y in [-1, 0, 1]:
for _x in [-1, 0, 1]:
if ((y + _y) < 0) or ((x + _x) < 0) or (
(y + _y) > (self.size[0] - 1)) or ((x + _x) >
(self.size[1] - 1)):
continue
elif ([_y, _x] == [0, 0]):
continue
else:
yield [y + _y, x + _x]
points = list(get_points(y, x))
if data:
return list(get_data(points))
else:
return points
!e py deltas = [(y, x) for y in (-1, 0, 1) for x in (-1, 0, 1) if (y, x) != (0,0)] print(deltas) position = 5, 5 for delta in deltas: print(position[0] + delta[0], position[1] + delta[1])This is what I started off doing.
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)]
002 | 4 4
003 | 4 5
004 | 4 6
005 | 5 4
006 | 5 6
007 | 6 4
008 | 6 5
009 | 6 6
I found out how to maybe reduce noise without using median:
allow diagonal movement
!e py import numpy as np deltas = np.array([(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)]) position = 5, 5 print(position + deltas)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [[4 4]
002 | [4 5]
003 | [4 6]
004 | [5 4]
005 | [5 6]
006 | [6 4]
007 | [6 5]
008 | [6 6]]
But you can also get some nice things like this.
But this is also sort of not quite the way to do things.
Because numpy index arrays like to be written like py np.array([(0, 1, 2), (3, 4, 5)])for py np.array([(0, 3), (1, 4), (2, 5)])
But then there's also some actually properly vectorised stuff that you get out in the style of numpy.ogrid
!e py import numpy as np deltas = np.ogrid[-1:2, -1:2] print(deltas)
narrowed the angle randomness now I see almost no noise
magic
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [array([[-1],
002 | [ 0],
003 | [ 1]]), array([[-1, 0, 1]])]
Which looks like this.
It gets more efficient as it gets less readable.
and this is just if you're doing it per single point
Unless you're wriggling around your whole array of stuff
for _x in range(-1, 2):
for _y in range(-1, 2):
!e py deltas = [(y, x) for x in range(-1, 2) for y in range(-1, 2)] print(deltas)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
[(-1, -1), (0, -1), (1, -1), (-1, 0), (0, 0), (1, 0), (-1, 1), (0, 1), (1, 1)]
!e py import itertools deltas = [*itertools.product(range(-1, 2), repeat=2)] print(deltas)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
[(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 0), (0, 1), (1, -1), (1, 0), (1, 1)]
@stuck furnace I tried submitting your rpartition solution because I was curious as to how it performed, and it's apparently slower that the strip().split() solution
maybe I should write this as a dm
@somber heath
merging with different offsets
Reminds me of animated scenes in movies where they have a "what has gone before" moment.
Very cool.
Yu are you some kind of artist ,because you animations are so good
class asyncio.Lock```
Implements a mutex lock for asyncio tasks. Not thread-safe.
An asyncio lock can be used to guarantee exclusive access to a shared resource.
The preferred way to use a Lock is an [`async with`](https://docs.python.org/3/reference/compound_stmts.html#async-with) statement:
```py
lock = asyncio.Lock()
# ... later
async with lock:
# access shared state
```...
@hot vortex π
hi
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
https://2.bp.blogspot.com/-xwDIZMWzoKQ/VwuHjXhmGrI/AAAAAAAAPS0/UWU1G6mJc4QqrSruUENBtyXsKV6Y7ZT_A/s1600/covers.png @sudden barn "Googling the error message"
I don't have premission to talk sry
Hello
yeah it says, that i haven't sent the 50 messages yet.
Btw i am working on a Spring boot project rn and want to integrate an Python AI in the future.
yes, it's a java framework
im building an AI in java rn π
in java? i haven't thought about AIs in Java lmao
i consider python ai libraries as cheating
I thought that Python is the leading language in that.
lmao
hjahahhahaha
nah i will stick to python and cheat
only because people just do something like
import train
train(data)```
nice, thats exactly what i am looking for ^^
nah man, can't do that. I don't want to become an AI Guru
@whole bear π
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@coarse ridge do you need help with anytihng?
Write 50 message and write !voice in voice verification related channel.
im going to rewrite my entire Matrix class into 3 dimensional
kill me
i changed 1 line
HEE HEE HAW
Sarati are you coding OOP for some longer time?
I'm a bit irritated that i can't see any Interfaces and packaging.
@lofty crater Could you please spell it?

