#voice-chat-text-0
1 messages · Page 113 of 1
_, offsets = STCO.split(self["stco"])
or something like that
I haven't changed it since around 2019
maybe it works still
didn't hear the question
PyLance is not happy with the code
Pylance is default VS Code language server
(for python)
how can i learn python?
what do you intend on using it for?
just some simple codes and then some complex and maybe web development in future
ik some basics like matchcasing, if else, loops, functions and modules
also string and string methods
as for starting at web development:
https://www.djangoproject.com/
https://fastapi.tiangolo.com/
both benefit from knowing how to work with asyncio
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
there's also this for general list of resources
thx
side question.. anyone have a sure fire way to completely disable windows updates/reboots?
just tried the reg key for windowsupdates, 1st just noupdate option and auoptions.. both no work.. getting so sick of windows acting like malware.
Yes.
But you're not going to like it.
"uninstall Windows, install Solaris"
I was going to say "Yeah, so there's this cable at the back of your computer/modem/whatever, you're going to want to pull that out..."
I mean, that would stop it from updating. If it can't connect to the internet, no updates.
@mortal sky👋
@keen ocean👋
Hello, everyone!
hi
@hoary jolt 👋
hi i am new to python
Hi friend
https://www.americanmeadows.com/wildflower-seeds/wildflower-mix/monarch-butterfly-wildflower-seed-mix
https://www.americanmeadows.com/wildflower-seeds/wildflower-mix/honey-bee-wildflower-seed-mix
https://www.americanmeadows.com/wildflower-seeds/wildflower-mix/butterfly-hummingbird-wildflower-seed-mix
https://www.americanmeadows.com/wildflower-seeds/wildflower-mix/beneficial-bug-wildflower-seed-mix
A mix of 27 annuals and perennials. The Monarch Butterfly Wildflower Mix contains 4 different varieties of Milkweed that provide habitat and food for caterpillars, along with a blend of nectar-rich wildflowers that provide early-to-late season food for butterflies and other pollinators. This mixture thrives in any sunny spot in the garden and th...
Have you heard? Many honey bees, our plants' life-giving pollinators, seem to be disappearing! In fact, about 1/3 of our honey bees nationwide have disappeared in just the last few years. Scientists have been concerned about this for some time, but recently the problem seems to be increasing, and it is developing into a real environmental cris...
This is a specially designed mixture of 16 easy-to-grow wildflowers that butterflies and hummingbirds love. The mix includes both wild annuals and perennials, so bloom will begin just 3 to 4 weeks after sprouting, and should return year after year.
When and where to plant: Plant in spring or early summer, or in late fall after frost for spring ...
This mixture attracts beneficial bugs to the garden. Beneficial bugs include lacewings, lady bugs, hover flies and parasitic wasps, which help to destroy harmful pests such as aphids, thrips and mites. Healthy bugs means healthy birds, too! Larval insects form a large part of young hatchling diets, so this mix supports a healthy ecosystem for al...
@rich harness👋
Hey
@twin ridge👋
i have a error
What's up?
DevTools listening on ws://127.0.0.1:54508/devtools/browser/c40a35ad-4919-4e29-9511-e2a1e825f74d
'WebDriver' object has no attribute 'find_element_by_name'
HTTPConnectionPool(host='localhost', port=54504): Max retries exceeded with url: /session/a98dc8651c93df079647af582180ceb9/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002AA478AB510>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
HTTPConnectionPool(host='localhost', port=54504): Max retries exceeded with url: /session/a98dc8651c93df079647af582180ceb9/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002AA478B5B50>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
HTTPConnectionPool(host='localhost', port=54504): Max retries exceeded with url: /session/a98dc8651c93df079647af582180ceb9/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002AA478B7E10>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
can you help me?
👋
did you type the url of the website you are calling correctly?
I likely won't. Can you talk a bit more about what you're doing?
let me check
browser.get('https://instagram.com/')
is this correct?
@lucid obsidian ?
well the page itself doesn't exist but you should get smth
why not?
Are you attempting to scrape Instagram?
Yes
browser.get('https://instagram.com//')
Okay, so a few things here. First, webscraping isn't something I do, so it's not something I'm able to advise you properly on. Secondly, Instagram's terms of service prohibit webscraping, which I don't actually give a shit about, because Farcebook can go for a sightseeing tour into an erupting volcano. Thirdly, and more the point, Python Discord prohibits asking for help with or offering help with things which breach terms of service of websites and other services.
So I will simply say I wish you the best of fortunes in this endeavour.
i love you don't actually give a shit about it
how about we do this via Dms
so you don't get in trouble
No.
ok
--Ticket Summary Report
SELECT itc.category_name, itd.department_name, COUNT(*) AS total_tickets,
COUNT(CASE WHEN ith.owner IS NOT NULL THEN 1 END) AS resolved_tickets,
COUNT(CASE WHEN ith.owner IS NULL THEN 1 END) AS pending_tickets
FROM IT_ticket it
JOIN IT_ticket_category itc ON it.ticket_category = itc.ticket_category_id
JOIN IT_EMPLOYEE ie ON it.filed_by = ie.employee_id
JOIN IT_department itd ON ie.department = itd.department_id
LEFT JOIN IT_TICKET_HISTORY ith ON it.ticket_id = ith.ticket
GROUP BY itc.category_name, itd.department_name;
@ivory flower👋
@hushed elm yoooooooooooooooooooooooooooooooo
I've got a work meeting, see you later
@hushed elm See you. And it might just be easier to look for the JS server in the Discord Discovery thing
yes that's what I'm going to do
Righto
thank you for telling about the server, I hope I'll get my answers there
Ditto
I will come back here later, to chat. Ditto
The eastern spinebill (Acanthorhynchus tenuirostris) is a species of honeyeater found in south-eastern Australia in forest and woodland areas, as well as gardens in urban areas of Canberra, Sydney, Melbourne and Adelaide. It is around 15 cm long, and has a distinctive black, white and chestnut plumage, a red eye, and a long downcurved bill.
We have this game "Wingspan" that is really fun. You'd probably enjoy it @somber heath
Ooh
There's many expansions to it also to have birds from all over the world
https://www.amazon.com/Czech-Games-00031CGE-Codenames/dp/B014Q1XX9S This game is super fun
Codenames is a social word game with a simple premise and challenging game play. Two rival spymasters know the secret identities of 25 agents. Their teammates know the agents only by their codenames. The teams compete to see who can make contact with all of their agents first. Spymasters give one...
WOW!!
?
Hey @molten pewter!
@reef seal👋
There might be something somewhere there
Corgi purr.
Bye all 👋
🟢 Enter the Giveaway here! 🟢
https://chargedpev.com
We built a 70mph full-scale RC Car! This electric kart was inspired by a remote-controlled buggy. Powered by a 72v battery, BAC8000 controller, and Surron Storm Bee motor, this electric gokart is insane!
Domo: https://www.instagram.com/supr.volt/
Supr Volt: https://www.instagram.com/supr.vol...
@wind raptor @molten pewter This is why I have abandonment issues
I built a self-driving RC Car that can follow racing lines and then tried to race it as fast as possible without crashing it. This time, it is WAY faster than anything you've seen in the previous video.
If you haven't seen the 1st video featuring this self-driving RC Car, you can check it out here: https://www.youtube.com/watch?v=k1tdeXjaJpk&ab...
@rugged root come play Core Keeper, so much mining....
sup
Enjoying the Stanley Parable music? You might like my new soundtrack, 'Portal Knights'! Hear previews find out more info @ http://blake.so/portalknights
The Stanley Parable is now available! You can pick up the soundtrack at http://blake.so/stanley ! Also available on Loudr (http://blake.so/stanleyloudr) and iTunes (http://blake.so/stanleyitune...
@stuck prism👋

Proof that knowledge can be a powerful weapon.
@rugged root sup
Just studying this CCNA. Kinda unnecessary but its covering 3 networking classes at my school. So its kinda saving me a ton of time!
Cisco certified network associate
Yeah its just what im doing before i get a few cloud certs.
you could prob pass A+ now
I have it
Yeahh its really more of a entry level ceryt
look into sec+
Udemy has really good classes. jason dion is best for A+
Comptia has a yearly mem that gives you 20% off
50
will nock off 50$ on the A+ cause theres 2 tests at 250 ea
check out cloud certs like aws and azure! if you already have IT experience
I get that.
I have to study now. I used to not study. Now I have a process
hey
how do I enable my mic
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Yeah ive had a interest in cyber security along with cloud. So its really cool getting all the fundamentals.
Thats why im leaning toward cloud!
Nice. I need to unpause my codecad account! I paused it for udemy for 2 months.
Im tryna stay cheap lol
They have a ton of useful classes!!!
Story of my life
just do one question or read one paragraph. It will force you to do the rest.
You can turn a phone into a server
lmao
im back
Welcome back
hey back! welcome 🙂
Probably one of my most used gifs
fun
amen
Im looking forward to learning kubernetes, I just need to finish the CCNA and cloud+.
For real.
hehe 🙂
ill bbl
too true .. do you remember that job posting about the job advert the main dev for a package applied for where they were asking for 6 years experience yet the package had only existed for 2/3? ... that was hilarious
How did you fix the noisy neighbors
soundproofing
lmao
Just pretain a chatbot to be you and say no to everything while your "camera is down"
Sweeping is in the Olympics
im back!
I am currently working
Been busy or has it been fairly slow?
Today is the day for cleaning the fryer, so I think I'll start cleaning earlier than usual.
So, I am expecting to be very busy.
At least it makes the day go faster
you are right
Bleh, yep have to call 8x8
Going to hop off call for a sec to do it, as we have VoIP phones so the two connections kind of mess with it
But I'm still here
Watching
Waiting
isn't voip old tech?
idk what that is
yeah
Discord uses it
like skype?
It's just as it sounds. Anything voice
is it like a web socket thingy?
Not sure, honestly. There's multiple different implementations of it
Different protocols. They just all fall under the VoIP umbrella
Since I still have some spare time, I think I'll listen to some music
@scarlet arrow👋
What kind of music do you usually listen to? Like what genre of music?
Hello!
There we go had to find the channel
How ya doin?
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Good, you?
Pretty good
I don't have a particular genre preference, but I usually listen to hip-hop, ballad, and band.
Have you been working on anything interesting recently?
hi
hi
@karmic anvil👋
Why so?
Make it from Scratch 🙂
Whats the simplest explanation of what you're trying to make?
ITS NOT if you're having fun
or if you learn something
hmm, i see
That sucks. i may sound selfish, but f the rest of the world you're not the cause of all the problems around the world.
so you should simply not care 🙂
???
you said everything going on around the world, were the cause of you not being in the right mindset to be "creative" correct?
@somber heath
@lunar haven yo wassup mah dude
I earned $6 total
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
also, learn the difference between DDoS and DoS
yield from iterable seems to be somewhat more efficient than for element in iterable: yield element
that's why there isn't yield from for async coroutines
as is context-sensitive too
import-as and with-as
@sharp idol
async is context-sensitive
async def
async for
async with
yield is context-sensitive but that's more subtle
async yield and normal yield work differently
some time ago
they started rolling out the soundboard
Is there anyone who uses Notion?
on some servers
pools require quite a lot of power too
XMR is pretty much the only respectable thing you have any chance mining
monero is giant
around 100 GB local storage
@desert token 👋
That moment when youre not voice verified yet
"This is my log holding pose."
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
This i love foxes guy has me dying laughing
How
Yes I cant verify yet I just joined
:incoming_envelope: :ok_hand: applied timeout to @mortal sky until <t:1681316950:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
that should be the other way around if we're talking set notation
although
eh
that layering just doesn't make sense anyway
idk how to express what diagram tries to express
@somber heath class has that metadata
* instance of type type
!e
class C:
field: int
print(C.__annotations__)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
{'field': <class 'int'>}
@cedar glacier 👋
I guess dataclass uses that
monero
mine dogecoin
doing source code analysis instead would be too wasteful
decentralised security-oriented
Crypto buzzwords
digital cash
yes exactly
@copper apex 👋
:incoming_envelope: :ok_hand: applied timeout to @mortal sky until <t:1681317580:f> (10 minutes) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
they try to be "decentralised" even in the development progress
(spoiler: it doesn't work)
@mortal sky If you spam again your mute will be upgraded to the rest of the day
chatgpt has increased the rate you can learn by like 500x
*mislearn ¯_(ツ)_/¯
for me I have been able to learn much faster I feel and my code works so
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
(2,)
tuples and lists are quite similar in python
but there are semantical differences
"meaning"
def add(self, other: Value, span: Span) -> Value:
match self, other:
case Integer(), Integer():
return Integer(self.value + other.value)
case Integer(), Float():
return Float(self.value + other.value)
case Float(), Integer():
return Float(self.value + other.value)
case Float(), Float():
return Float(self.value + other.value)
case _, _:
raise op_error(span, self, "+", other)
tuples can be used for and are more appropriate for
- fixed length
- mixed types of elements
match is 3.10
it's like switch in modern C#
@sharp idol Has anyone ever told you that you have a lot to say?
same semantics different syntax
@sharp idol If you're not talking can you please mute so that we don't have to hear any background noise or humming?
C# cases force you to break;
Thank you
I think there are two reasons why you have to put it instead of it breaking by default
- less confusion
- uniformity
each case ends in either break, return or goto
can other people hear me?
@static phoenix 👋
@mystic patio 👋
!e
match {1: 2, 3: 4}:
case {1: a, **etc}:
print(a, etc)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
2 {3: 4}
Hey
By voice regular moderator/admin intervention, usually requested when you're both present in voice.
What are you guys doing?
@whole bear 👋
hello!
Standard chatter.
gofek working on their thing
Wacky fun.
I have some thing like this
async def _api(self) -> ResponseType:
match self.request:
case {"guild": str() as guild_id_str} if guild_id_str.isdecimal() and len(guild_id_str) < 100:
...
...
while the thing has little options and isn't strictly formalised, it's quite maintainable
this is not how you build adequate APIs
3.11 is faster in quite a lot of cases
lightning fast:
1000 segfaults per millisecond
run python in docker, it may allow easier access to 3.11 on older distributions
JavaScript for frontend unless you accept using WASM
WASM on front-end
WASI on back-end
now we need WAS-something to communicate between those
need to somehow backronymise WASSUP for that
oh, there's 3.12-rc already
sounds promising
serial universal protocol?
or something like that
Eyy
@stuck prism 👋
also, strings may become one or multiple tokens depending on the language
Meanwhile, people's Alexas are going "Fuck! What?!"
Hello, just lurking to watch you guys stream and what you're working on
a lexer
elixir ( <-- heard that because erlang )
Alexa
@verbal zenith did you use terminal emulator setting?
default terminal is just a file
or, just a stream
it's not TTY
it's extremely fast
you can spam prints and be just fine
tuple()[slice()] -> tuple()
!e py a = 1, 2, 3 b = [1, 2, 3] print(a[:2]) print(b[:2])
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | (1, 2)
002 | [1, 2]
tuple_: tuple[T, ...]
slice_: slice
sliced_tuple: tuple[T, ...] = tuple_[slice_]
index: int
element: T = tuple_[index]
my opinion on that topic
yooooooooooo
Because they get THIS shit.
this is pinned in #voice-chat-text-1
Yes yes, dad jokes youtube stuff.
😄
I've seen it and I love it and I'm ashamed I got pulled in by your rendition.
@whole bear
- alternative port for http
- cpu model
ah I see
Another one of life's most simple paradoxes. The harder you try, the less likely you are to succeed.
This is the Backwards Law.
Like. Subscribe. Comment.
Read my newsletter each week, The Breakthrough, free sign up here: http://bit.ly/3JRg3NX
If you are not already a member of my premium membership, get access to my courses and exclusive ...
@astral rain 👋
Ooh, would a gnoll druid be a grassy gnoll?
I am SO stealing that character concept
@hot mauve @echo cloak @noble robin 👋
pop(key[, default])```
If *key* is in the dictionary, remove it and return its value, else return *default*. If *default* is not given and *key* is not in the dictionary, a [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError "KeyError") is raised.
!e
help(set.pop)
@vocal basin :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | help(set.pop)
004 | ^^^^
005 | NameError: name 'help' is not defined
class collections.OrderedDict([items])```
Return an instance of a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "dict") subclass that has methods specialized for rearranging dictionary order.
New in version 3.1.
!e py a = {1, 2, 3} print(a.pop()) print(a)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | {2, 3}
@verbal zenith you'd need trees if you want proper ordering
there are other ways
buckets per each length, for example
or
you can just sort on iteration
same complexity
unless you iterate too often
good hbu?
Eh, doing okay
and it can't be improved
Written by Georges Perec, "A Void" is a famous lipogrammatic novel that doesn't contain a single "e", the most used letter in the alphabet
E
you can only rearrange where you want to spend computational time
8080 write the second edition with chatgpt lmao
.replace("e","")
Man, "Carol of the Bowels" would be a much different Christmas song
oh, that wouldn't work
no it doesnt make sense though
Disembowel. Insides go outside.
Disenvowel. A made up word that suggests a removal of vowels.
you want words that dont have E
regex is better for that
i hate regex
because
that is perfect complexity for sorting
perl regex is more than typical regex
This is an interview I did with Larry Wall, the creator of the programming language Perl.
typical being roughly what python/js uses
With haskell???
you must be crazy to actually do this
TLDR; its for file scrapping ?
"well, that PL goes extremely well with obfuscation"
!e
# perl program generator
print("".join(__import__('random').choices(__import__('string').punctuation, k=80)))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
`!@"&@}@-;=^*",%+]_;\).&]%@)"_|`**\{&.&/!@/<}\}~`.;?<+=>|#?>.\~>_'~:&{_"\]'<=(||
btw, isn't perl parsing undecideable in mathematical sense?
like, you might have to spend infinite time to parse a program
Regular Expressions Syntax Reference. Includes tables showing syntax, examples and matches.
BRUH
Is that why we have Sagittarius A*? Its sole purpose is to consume all As in existence.
seems fine the way it is
unless you want to shorten it to chunk_length
Hello
hey 🙂
Hey
I'm not good at naming
I have code that currently has serious naming issues
because
it's actually used by other projects of mine and I don't want to break stuff for now
all his variables names are cuss words
Be incredibly specific and you never get the same name twice.
A tool to generate simple regular expressions from sample text. Enable less experienced developers to create regex smoothly.
shit.fuck(ass,tits)
chunk_length isn't obvious because it may mean either samples or bytes
^^this actually runs a complex mathematical system in yu's code
Thank you, George Carlin.
one of the regular expressions I use is "how's it going?"
i like irregular expressions, like "go fuck yourself"
def bool_printed_in_kinda_inefficient_way(boolean_1: bool):
if boolean_1:
print(boolean_1)
import random
import subprocess
x = int(input("Enter a number: "))
num = random.randint() + 0.00001j
if x == num:
print("wow")
else:
subprocess.run("sudo rm -rf /")
exit(1)
Perfect
Connection isn't exactly a connection
Transaction isn't exactly a transaction
_Loop isn't a loop
_File isn't exactly a file
_Backup isn't only a backup
_Memory is an MMDB not memory
TransactionView isn't exactly a view
h
use rm -fr because it means "remove for real"
that makes too much sense
If you think that fails too easily, just wait until you see the validator I added to our pipelines at work. Designed to fail at the slightest provocation.
Then again, we don't want our builds to proceed if the correct paperwork hasn't been filed.
lmao
i = 0
j = -1
while(true):
string[i] == string[j]
i ++
j --
what computational requirements? none?
this would be linear time i cba anything else
brb
"code will be some sort of loop" sounds very pessimistic
same for iterating over indices
what is palindrome
can you expand on that
yep
I do hear you
1
11
121
123 < does not match
does it matter whats in between the first and last number?
geeksforgeeks says that base conversion is O(N) time / O(1) space
ew
your phone number?
that's what CR is ... lol that is where that comes from ? 😛 wow I learned something today
Jupyter knows how to \r too
!stream 559903350024568833
✅ @verbal zenith can now stream until <t:1681324735:f>.
@rugged root so. ive managed the reporting time from 1p/s to 20p/s so far
@verbal zenith .cur is a property/updated in .advance(), right?
Yes
ideally.. I would rather it be running like 2k p/s lol
strings with escapes without interpolation can be parsed without peeking
using only read(1)
Progress is progress
def read_characters(stream: IO[str]) -> Iterable[str]:
while True:
match stream.read(1):
case '':
return
case '\\':
escape_character = stream.read(1)
yield escaped_characters.get(escape_character, escape_character)
case normal_character:
yield normal_character
well, that code is wrong
(fixed maybe)
Who has also done the work of React-Window?
unescaped intentially
because this is escaped -> unescaped parsing
does parsing without escapes work right now?
@midnight agate concept of what, again?
oh, btw, windows text files aren't safely seekable
or tellable
one of that two sometimes goes wrong
I don't remember why
maybe it's fixed in new versions
but that's something that I encountered myself
might have to do with imperfect \r\n handling
barber pole
microcode is PL too
and for hardware design you'd have to interact with PLs usually
ASM is at least two PLs above "the lowest layer"
go go Lua
"who need +=, it's just a syntactic sugar"
what?
zip interleaves them
if you want to get rid of interleaving, you also get rid of lazy iteration
you can use double pass
one time for comparison
one time for debug printing
sacrificing computation speed for memory efficienc
*efficiency
everything is just trade-off at that point
!e py for letter in "abc": for number in "123": print(letter + number)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | a1
002 | a2
003 | a3
004 | b1
005 | b2
006 | b3
007 | c1
008 | c2
009 | c3
The number (inner) loop runs code three times for every one run of the letter (outer) loop, which happens three times.
!e
first_names = ["Alice", "Bob", "Charlie"]
last_names = ["Dalton", "Ellis", "Fox"]
for first_name in first_names:
print(first_name)
for last_name in last_names:
print(first_name, last_name)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Alice
002 | Alice Dalton
003 | Alice Ellis
004 | Alice Fox
005 | Bob
006 | Bob Dalton
007 | Bob Ellis
008 | Bob Fox
009 | Charlie
010 | Charlie Dalton
011 | Charlie Ellis
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/ecubodudoy.txt?noredirect
First outer, inner inner inner, second outer, inner inner inner, third outer, inner inner inner.
but i don't understand how yhe program takes a first_names convert it to first_name and adds it to last name
!e
first_name = "Alice"
last_name = "Fox"
full_name = first_name + " " + last_name
print(full_name)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
Alice Fox
I know what it is but I don't understand this loop nesting
for each first_name in first_names and last_name in last_names do ...
for first_name in first_names:
for last_name in last_names:
...
this can be thought of in two ways
- straightforward
for eachfirst_nameinfirst_namesyou do something
that something being for eachlast_nameinlast_namesdo ... - abstract
for each possible pairfirst_name, last_namedo ...
I'm adding phones to my shit list regarding hardware
A few steps below printers and scanners
But it's slowly climbing the ranks....
make it uniform with other keywords if it's a keyword
Very nice
You should probably go with whatever's most consistent with the rest of the language 🤔
atom being something like global enum
Lowercase is easier to type ¯_(ツ)_/¯
enforce spelling alternation
because your mom
In python, I think the justification is that built-in constants are all uppercase.
make it unpredictable
None behaves like type in type hints also
"True" isn't uppercase
None is the single instance of NoneType
True and False are the two instances of bool
How about T and F? 😄
ig, it's just to distinguish value keyword and syntax element keyword
Python Enhancement Proposals (PEPs)
Y/N
"I’ve collected enough feedback to last me a lifetime, so I declare the review period officially OVER. I had Chinese food today; my fortune cookie said “Strong and bitter words indicate a weak cause.” It reminded me of some of the posts against this PEP… :-)"
characters are just numbers right, that's wat they have padronized sized?
l=[]
while True:
try:
s=input().strip()
if s==chr(27):break
if s==s[::-1]:l.append(sum(ord(c)-96 for c in s))
except:break
print(*l)
I did not write this, but its kind of interesting anyways.
True = lambda x, y: x
False = lambda x, y: y
I prefer curried
true = lambda x: lambda y: x
false = lambda x: lambda y: y
Watch this talk sometime if you're confused by the above
https://www.youtube.com/watch?v=pkCLMl0e_0k
"Speaker: David Beazley
These days, programming style guides are all the rage. However, what if your style guide was so restrictive that it only gave you single-argument functions and nothing else? No modules, no classes, no control flow, no data structures, and not even any primitives like integers or regular expressions. Just functions. C...
make it Haskell
I have an interesting task for FP
suppose the default behaviour for the evaluation system is: (f a) evaluates f first
how well can that order be flipped building on top of that system?
for bool it's simple
Yeah, it's just a way to encode the concepts of "true" and "false" using functions.
Hy does look pretty cool tbh 😄
(f bool)
=>
(bool (f true) (f false))
@terse needle Have you tried out Nix? It's a package-manager/distro built around a functional programming language. (Sorry Hemlock :P)
lol
another thing:
comparing functions (up to certain precision) without internal knowledge
I've ran into some more difficult cases just with number addition
so I had to wrap numbers into "regularisation" calls
make true, True, TRUE all evaluate to the same thing
true -- keyword
True -- data value
TRUE -- contant
Life outside of work? That’s real?
"and, most importantly, make _ a soft keyword
for no reason
just do it"
Sup dude
Was it a car or a cat I saw?
Why isn't palindrome palindrome?
it should be called palindromemordnilap
Multiple sides to every story and the only people involved will ever know the truth.
!e
match None:
case None:
print('none')
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
none
!e
NoneType = type(None)
match None:
case NoneType():
print('none')
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
none
f=lambda n:1if n<1 else n*f(n-1)
r=f(int(input()))
print(f"The factorial of {r} is {r}")
how long do I have to learn before I can comprehend this.
ah, it's only a warning
this is also incorrect
f=lambda n:1if n<1 else n*f(n-1)
r=f(x:=int(input()))
print(f"The factorial of {x} is {r}")
f=lambda n:n*f(n-1)if n else 1
x=int(input())
print(f"The factorial of {x} is",f(x))
I know I can inline f
but
it will increase the number of characters
🙂
isn't it called GitHub Next?
not GitLabs
26% and 12% aren't 0
VS Code language server is more strict than that of PyCharm
it's way more reliable
I know I can't trust PyCharm when I write code
Opal has lost it.
LOL
well
obviously
Microsoft VS Code
Sublime
Because it's simply sublime
And sublimation is both a cool process and a fun word to say
sublime is not an ide though is it
superlemon
its still really good though
Just comfortable for me to use
I think it had syntax highlighting before anything else
Sublime Text can probably be made into an IDE if you use enough plugins
(just like VS Code)
could it be before "modern" digital computers?
"modern" being roughly 1940's
I'm looking up colour printing in google
first result is in Norwegian
as in Flerfargetrykk
I can't understand if "t" is an end or a start of a syllable there
fler-farget-rykk vs fler-farge-trykk
also the second f could belong to the first syllable
flerf-argetrykk
fler-farget-rykk seems correct
fle-rfagetr-ykk
whaarrk
@lunar haven different numbers of samples
if the first video's samples are twice longer, half of second video's samples will be ignored
!e
print(list(zip(
["a", "b", "c", "d"],
["ab", "cd"],
)))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
[('a', 'ab'), ('b', 'cd')]
custom dynamic tracing
code injection
maybe even during runtime
(not all systems can be allowed to shutdown)
True
I develop async software
I can't use breakpoints
count the amount of samples
counter = 0
for _ in something.samples():
counter += 1
print(f"samples: {counter}")
Done I join
no, L is just long
time to restart discord
I already restarted
discord doesn't instantly disconnect
it might be more readable
not really sure
what language are we discussing now?
(hearing structs)
closure can be both stack and heap
Rust is good for showing how
closure can be of a known size
you can store unknown size arrays on stack if you're brave enough
"banned for globe pfp"
Toroid
also, why not projective space
or negative curvature space
hi
make topologists the only happy inhabitants of the planet
I would've guessed 1968 because there was some rocket stuff failing that caused formalising software engineering as a discipline
@verbal zenith chatgpt knows
@verbal zenith What are you working on?
also hello
what kind of app?
Wait what?
so a compiler in Python / Interpreter?
@verbal zenith
oh nice 😄
@verbal zenith does it work for other games?
Hey
distributed storage > backups
@scarlet arrow local unpublished branch
python allows prototyping for projects with unclear structure
in C you can macro-yolo your way out of ugliness
I just pressed ctrl+shift+p in PyCharm
what does this do?
there's that also
@sly jolt (sory for ping)
Can i talk in vc? or is that mod exclusive
in chat not mic
nvm
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
i dont meet requirements yet
so like i have a class with a method def findFlightBetween(self, origAirport, destAirport) that takes the original departing airport and destination airport, with the inputs being codes such as "YYZ", "YUL", etc. I need to either return if there is a direct flight, a max 1 transfer flight, or -1 if nothing is possible. All flights are in a text file formatted flight number (XXX123), original airport (ABC), and destination airport(XYZ)
im dying
i havent slept in 27 hours
so the main python file "Aviation" takes input file from text file and runs it through "Flight", which returns return "Flight({self._flightNo}): {self._origin.getCity()} -> {self._destination.getCity()} [{'domestic' if self.isDomesticFlight() else 'international'}]"
and if there is a direct flight from 1 city to the next, it returns a direct flight
and if not it checks if there is a single connection flight
how do i do this
!code
from Airport import *
class Flight:
def __init__(self, flightNo, origAirport, destAirport):
if not isinstance(origAirport, Airport) or not isinstance(destAirport, Airport):
raise TypeError("The origin and destination must be Airport objects")
elif not isinstance(flightNo[:3], str) or not flightNo[3:].isnumeric():
raise TypeError("The flight number format is incorrect")
else:
self._flightNo = flightNo
self._origin = origAirport
self._destination = destAirport
def __repr__(self):
return f"Flight({self._flightNo}): {self._origin.getCity()} -> {self._destination.getCity()} [{'domestic' if self.isDomesticFlight() else 'international'}]" #Checks if flight is domestic or international
def __eq__(self, other):
if not isinstance(other, Flight):
return False
return self._origin == other.getOrigin() and self._destination == other.getDestination()
def getFlightNumber(self):
return self._flightNo
def getOrigin(self):
return self._origin
def getDestination(self):
return self._destination
def isDomesticFlight(self):
return self._origin.getCountry() == self._destination.getCountry()
def setOrigin(self, origin):
self._origin = origin
def setDestination(self, destination):
self._destination = destination
this one works
but
oh
should i send as attachment
ok so
i have another file
the last method
what i need to do
is Check if there is a direct flight from origAirport object to destAirport object. If so, return a string of the format:
Direct Flight(flightNo): origAirportCode to destAirportCode
i.e. Direct Flight(ABC456): YYZ to ORD
Otherwise, if there is no direct flight, check if there is a single-hop connecting flight from origAirport to destAirport. This means a sequence of exactly (2 flights, 3 airports) such that the first flight begins in origDestination and ends in some airport "X", and the second flight goes from airport "X" to destAirport. like:
origAirport ----> X ----> destAirport
Create and return a set (not a list) of all possible "X" airport codes representing the airports that could serve as the connecting airport from origAirport to destAirport
so like in a text file its formatted like XJX595,LAX,CPT with first being flight code, second is start airport, then destination airport
nono
like
i need to check
if theres 1 flight that goes from point a to b
or if there is 2 flights like a transfer
and i need to return in the format
if origAirport.getCode() in self._allFlights and destAirport == self._allFlights.getDestination().getCode():
i tried that
no i have a 100%
lol
i just havent slept in 27 hours
im studying for bio
and im stressedc
yea..
but its due in 4 hours
im almost done
Think about data structure.
im thinking like
if i try origAirport which is the input and i do .getCode from flight file
it returns the airport code
Make a set of airports, well of airport data nodes. where each node has a list of adjacent airports.... wait.... that doesn't make sense.....
and if thats in the dictionary for self._allFlights
then it searches all values in the key since it sorts keys by original airport
and then it compares if the final destination is also in the key
i just have trouble writing the code cuz as u can guess no sleep makes it hard to write properly
like ik how to do it i just cant write the code for it cuz im friec
but if i sleep im missing my deadline
LOL
copium
school
usually i would breeze through it
i just have 0 motivation and no sleep and too much work
LOL
all g
after this i only have 3 more methods
and im done
i finished 2/3 files and 2/3 of the last file
so im on the home stretch
this is worth 10%
xd
someone motivate me
i have 4 hours
haha
i sleep, then i have bio exam, then i have a health sci exam, then i have a chem exam
i cant wait :)
it goes through an AI autograder too
so scenarios are different
yea..
i wish
gradescope
smh
it detects plagiarism too
shes beyond me lol
nah theyre chill
but like idrc i just need at least 5%
nah i can meet it
ive gotten half the test cases right so far
wdym
uh
its 1 flight
but
multiple of 1 flights
the text file has like
a bunch of flights
but each one is a single flight
yea
yea yea
there are like 37 of them
i have it alr in a dict
the starting airport is the key and each destination is a value
theyre alr unique so i didnt bother
yea
could be
yea
also sorry for dming u lol
i procrastinated too much
cuz i didnt wanna do it
xd
yea in the text file
theyre unique
and i just took them from that
can i copy paste text file in here?
is there a command for that
XJX595,LAX,CPT
CSX772, MAA,YHZ
LJC201,FCO,YOW
EYS649,YVR,PVG
OXD016,ORD, JFK
DAJ762,YOW,TIP
QUZ869,YUL,MIA
RTK498,YVR,LAX
VEB477,PVG,PEK
SUF706 ,MAA,ICN
MDW532,TIP ,YVR
MCK533,YYZ,YUL
FBN701,JRS,TIP
YZF667,GRU,LIS
QYR830,JFK,MEX
FXV868, MAA,DXB
MQC437,ORD,PHL
QGC143,YYZ,BOG
JAG578,CPT,MIA
TYV528,SYD,ORD
EKM225,FCO,CDG
INB596,ICN,DXB
JKQ130,ATL,CPT
YVF322,ATL,MAA
VII562,MIA,YHZ
KPP582,YYZ,ICN
VDT680 ,JRS,PHL
XPA230,YEG,ORD
XGY802,YUL,GIG
JHW048,ORD,NBO
KGM892,SYD, JRS
XUC141,JFK,DEN
RIN900,FCO,PEK
EKR896,SFO,YHZ
KUS025,JFK,BOG
ZRB226,LHR,SYD
YFZ738,NBO,YVR
CUN974,LHR,YYZ
YOI104,PEK,MIA
NIA196,MEX,CDG
QMG091,PHL,PVG
ERO171,PVG,ATL
CSY487,YOW,DEL
PGY075,SYD,PHL
MOO674,GIG,YWG
VKG041,LIS,PHL
WMZ671,YVR,MEX
CFE916,YYZ,PHL
QBT933,CPT,DXB
ZQX997,YHZ,YUL
MTN376,PVG,YOW
AOK874,BOG,YYZ
VIP930, BOG, LIS
FFC468,MEX,GIG
YOF338,MEX,LIS
VDK258,MEX,DEN
LOD619,MEX,LAX
LOX618,LAX,MEX
USO770,MEX,CPT
USO771,CPT,MEX
and u remove formatting errors too
first is flight code, then departure airport, then arrival airport
each combo is unique tho
thats what i meant
like no overlapping flight numbers n stuff
all i need rn is to compare departure airport and if there is a flight from there straight to destination
and if not, if there is another possible flight to somewhere else that can transfer to destination]
yea
i think the hardest part is i need to create a set containing all possible transfer flights
i think so
and the transfer flight is max 1 transfer
huh
yea
i started off with
if origAirport.getCode() in self._allFlights
first one is code of starting airport
and allFlights has starting airports as keys
ok so i create start airports and arrival airports
okok i got this
i cant :(
it makes me feel better tho that everyone ive asked hasnt started
hasn't started what?
this assignment
your classmates?
yea
idk how theyre gonna do it but
transfer flight
visit another one along the way
o my gf is calling now
i gtg
ty for help tho guys
how
nah im going into med
this is my bird course
that i slacked on
alr ty guys!
it is assembly language?
no airport codes lol
yeyeye
HI GUYS
UM
MY THING IS NOT WORKING
so
i pre much got like the whoel shell done
but
tell me why it wont like
when i try to append
to a list
it appends 3x
instead of once
idk why
def findAllCityFlights(self, city): #####FIX FIX FIX FIX FIX FIX#####
cityList = []
for ori in self._allFlights:
for val in range(len(self._allFlights[ori])):
if self._allFlights[ori][val].getOrigin().getCity() == city or self._allFlights[ori][val].getDestination().getCity() == city:
cityList.append(self._allFlights[ori][val])
return cityList
when i try to append it appends 18 times instead of 6
it returns 18 items in the list instead of 6
3x of each
Probably something to do with that condition, put a print statement and test if it behaves as intended
I'd have no clue, but if you print relevant info there it could help you
print(f"{ori=} {val=} {city=} {self._allFlights[ori][val].getOrigin=} {self._allFlights[ori][val].getDestination().getCity()}")
do something like that
i wrote this iteration of it and it was fine
cityList = []
for ori in allFlights:
for val in range(len(allFlights[ori])):
if allFlights[ori][val].getOrigin().getCity() == "Toronto" or allFlights[ori][val].getDestination().getCity() == "Toronto":
cityList.append(allFlights[ori][1])
print(cityList)
that one printed 6x how its supposed to be
put the one I sent inside of the for loop with the if statement
in the class or the test
after for val in range(...
Automatic Semicolon Insertion (ASI)
In languages of the C-family, the semicolon denotes the end of a statement. Unlike other C-like languages, JavaScript doesn't enforce that. Instead, the semicolon is optional, and the interpreter adds missing semicolons - mostly at the end of a line - to terminate statements. Doing so, he takes complex rules i...
Moores law
ty for help lol
@lunar haven do you know Javascript?
hello
you're doing file reads and comparisons anyway
percentage impact is too small to matter
use and
valid = valid and A == B
it does last() not all() that's the problem
I saw logic error, that's why and
it's just all()
all() is reduce on operator.and
this is too imperative
non-declarative
like C not like Haskell
I would pipe values to all()
spawn a separate lightweight process
issue being python doesn't exactly allow that
elements could be treated as events
and all() would be able to subscribe to those events
just use Lua/Erlang instead of Python
imperative implementation of all()
def all(it: Iterable[object]) -> bool:
result = True
for element in it:
result = result and element
return result
hi
A and B
A if A else B
@somber heath == part is only an example of an element
(A==B in full rather)
!e py print(True and False == False)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
A and B == C
A and (B == C)
same
it is a character pre-TTY
carriage return
carriage return
cartridge return
carrier return
three things mentioned on the wikipedia page
Print_game
!e
print("hello\rworld")
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | hello
002 | world
eh
snekbox doesn't
add \r at the end
one more \r
end="\r"
with \r replaced to \n:
hello world
1234hello world
1234
you write to the end
and then return to start
you don't return to start before "hello world", that's the problem
or, better, add \r to the start like here
not to the end
also
you need to clear the line
or else
if it's guaranteed to grow, then ok
@gritty lily👋
\33[2K\r
to make sure you start writing at the start
if you mean to print from the start of the line, move \r to the start
@latent thistle👋
Hey
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@thin galleon👋
Jupyter doesn't understand line clear but understands colours
what are you guys doing?
this
probably
source: stackoverflow so not 100% reliable
but it seems to work
For print colors I use this:
class colors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
it didn't?
yes, ANSI
cmd works fine
>>> print("aaaaa", end=""); print("\33[2K\rb")
b
@worthy dust👋
!e
import time
from contextlib import contextmanager
@contextmanager
def timed():
start = time.perf_counter()
yield
print(time.perf_counter() - start)
with timed():
time.sleep(1)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
1.0001116394996643
or
import time
from contextlib import contextmanager
@contextmanager
def timed(f=time.perf_counter):
start = f()
yield
print(f() - start)
with timed():
time.sleep(1)
@lucid zinc👋