#voice-chat-text-0
1 messages Β· Page 354 of 1
Hello guys.
Can anyone tell me what is wrong with my code?
I cannot make this case and is True function work together.
When I sit to write nothing comes out
case pattern if condition
It's not made for that. For that you'd want an if statement. match case is more for when you know what values you want to check for
Or what AF said
Also, your _ case needs to be the last case mentioned
Ah thank you very kindly.
: )
ig this
@rugged root "no, hemlock, it's still morning somewhere"
I am working on an inventory managment system for my vinyl collection (it needs an inventory system xD), I have built a proto type in python but am wondering if I would be better using python with sqlite or just an SQL database.
SQLite is a SQL database too
did you mean something like postgres as opposed to SQLite?
SQLite is fine
Like this?
yeah I get that, but i meant more so would it be more efficient/worth while to build it in SQLite with python or just a straight up SQL server like MySQL (which I do have experiance with)
yes
yeah, if you have MariaDB experience, it might be faster to use that
damn i had my first cs class today
they have both sync and async support in Python
apparently i didnt know what a programming error is
I do not, is that something worth learning?
but you will need to install extra dependencies
Ill give it a look!
SQLite is simpler to use than MariaDB/Postgres, but somewhat limited
whats a "semantic error"
like sure i spell the words correctly but it's not syntax error or logic error?
fuck
worded incorectly, or commands used inproperly
i was never taught this
SQLite expects you write complex logic on your own instead of providing much on its own
the task was to write 3 types of errors, what they are, examples of it and how to detect errors
so no really advanced stuff like built-in functions to work with timeseries, pubsub mechanisms, all that you don't need for your project anyway
meaning error
turns out the teacher said stuff along the lines of "syntax error", "logic error", "semantic error"
π
i wrote all this code and got a fuckton of errors for nothing π
design and naming error not an explicit error
It is not working. Showing error.
email not defined?
what is that?
you need r string not f string
what is that?
how would having an error in the meaning of code be different from having a logical error
i have no fucking clue
@rugged root @frozen owl
example of a semantic error:
def add(x, y):
return x * y
but this is also logically wrong right?
you meant not what you wrote
fuck i have never taken any courses on logic
i asked my teacher for errors and i was so π
it's a design/naming error
similar to how, in Arc/Zen, wide window borders are a design error
also for tmr theyre doing 2s complement
i have no clue whats that
the other kids know since they all did prior cs
@rugged root https://youtu.be/di18hTFTwIw?si=sNvcBazjxsRukhd5
Click here to stream and download more music from Army Of Lovers: https://lnk.to/ArmyOfLovers
#ArmyOfLovers #Crucified #vevo
i barely survived today's cs class when they did binary typa shit
binary addition, conversion et al
i was learning bitshifts today at school
is << faster than *?
in C, yes
if you use no optimisation
with optimisation, it will replace * with << when it can
Wouldn't most compilers make the optimization?
yes
.
write * when you mean to *
ok
0010 = 2 0100 = 4 bit shift left is *2
don't this:
x << 0
x << 1
x * 3
x << 2
x * 5
(x << 1) * 3
x * 7
x << 3
Cursed
you can bitshift a float if you're brave enough
hmm
seems like the sounds I heard today/yesterday were indeed explosions
allegedly
do Preact instead: hate your work more space-efficiently
we use it at work as just a smaller React
Oh holy crap, forgot it was only 3kB
project itself + some library on top of react (via compat layer) -> 30kB
That's still itty bitty
the react part is around 1MB
Is it interoperable with React plugins and stuff?
yes
you make react point to a compat package
which re-exports and wraps parts of preact
This is something that's always kind of worried me
both bundled with vite
Like the whole CDN stuff
would writing docstrings and documentation help solve semantic error
checksum prevents supply chain attacks
you always get the exact same thing
if you don't, it errors
checksum is applied to the final JS file that you fetch
does not matter
if the compromised supply build chain ends up producing the exact same JS output
so, like
does not change anything
the issue is when CDN thing cannot have a checksum
e.g. polyfill
this is important either way
just rename the function
or rewrite the body
depending on how you use it
and if you don't use the function, delete it
"reduce the chance of this error"
like this is remedial, but the question is like preventative
flowcharts?
or avoiding close/ambigious words???
ik this is some pretentious cs crap
code review, tests
that prevents simple ones
sometimes, meaning of what you're doing, is non-trivial
issue not with names, but with interactions of the system as a whole
@brazen gazelle just don't return lifetimes, most of the time
in functions/methods
ty af :D
then you can start adding things that are &self to &T
getter methods
@brazen gazelle return owned values
also for Q2 i said that the having more cores would benefit to some extent, when parallel computation is supported in the programme but having more cores will not benefit single threaded applications
this sounds so obvious but im not sure if this is correct
sometimes you will have to .clone();
it's fine until you figure out the lifetimes
this is The Approach to starting introducing lifetimes into a project
"I'm too busy to document interfaces I write"
all those C "experts"
aka devs incapable of writing reliable software
people like that have been mistakenly though of as capable of writing safe C
and people who actually understand safe C just move on to better languages because it makes their life easier by taking on the responsibility away from the programmer
!stream 451730408636416000
β @late spoke can now stream until <t:1725992052:f>.
@late spoke and cross-compiling to older libc is quite non-trivial
Zig solves that
for older Python, Docker it
@fleet canyon π
I hit the wrong channel on my phone!
HA, all good
@vocal basin
Hey thank you. It worked. But my program is having a hard time calling the custom function.
what are all these oddly specific ads on youtube
"I'm not a Kubernetes Error, this book is not for me"
@willow light docker on the server, VSC (or proper open-source derivative) on the client;
dev containers, happy life
(until it explodes and burns from memory usage)
in regex, you need r" not f"
so you can put the \ back in
I did use that. But it makes email a part of the main string.
Like this?
@whole bear π
Heyyy :D
@lavish rover add start to indices in arr accesses?
oh wait
no
hm m
hmm
start + (end - start) // 2 fails too?
it should be
r = end - 1?
oh, then halving is not equivalent
@lavish rover Don't go anywhere, I'm going to be hopping into the van shortly
Take that as you will
with candy
I cannot do arithmetic today;
had enough of thinking for the day from debugging webrtc
fails with +1 removed too?
@rugged root gotta head out, see ya
oh
hi
i have a questionb
So i have learned basically all the basics of python like for loops, strings, while loops and some basic programs like quizes
but im wondering what to do next
True but where can i learn more
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!kindling
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
thanks
I always recommend tic tac toe
Well, I hope you can help me
Lol
Hey before purchasing this course, I was wondering if any of you could look over this information anfd let me know is this something worthy to teaching me the basics?
@long minnow
@sour imp ^
I'm creating my own distributed application framework in Python. The goal is to be able to easily create processes that can find and talk to each other via tcp/udp. Eventually, these could be packed up in docker and then pushed out to a bunch of machines on a network.
!stream 962128994814263316
β @sweet sorrel can now stream until <t:1726015974:f>.
I have more CSS horrors to show
minified? why don't they get those borders minified
is spidermonkey the current or previous one
seems like still the actual one for Firefox
okay what was I thinking of then
@sweet sorrel @sour imp
fr fr though!
why is there a \
import csv
map = {}
def read_chunk(map, path, cords = None):
"""Reads a chunk of a tile map from a CSV file.
Args:
map (dict): The map dictionary to store the chunk.
path (str or tuple): The path to the CSV file or a tuple containing the base path and file extension.
cords (tuple, optional): The coordinates of the chunk. Defaults to None.
Returns:
dict: The updated map dictionary.
"""
if isinstance(path, str):
file_path = path
else:
file_path = f"{path[0]}{cords[0]},{cords[1]}{path[1]}"
with open(file_path, 'r') as csvfile:
reader = csv.reader(csvfile)
chunk = [row for row in reader]
map[f"{cords[0]},{cords[1]}"] = chunk
return map
def write_chunk(map, chunk, path, cords = None):
"""Writes a chunk of a tile map to a CSV file.
Args:
map (dict): The map dictionary.
chunk (list): The chunk of tiles to write.
path (str or tuple): The path to the CSV file or a tuple containing the base path and file extension.
cords (tuple, optional): The coordinates of the chunk. Defaults to None.
Returns:
dict: The updated map dictionary.
"""
if isinstance(path, str):
file_path = path
else:
file_path = f"{path[0]}{cords[0]},{cords[1]}{path[1]}"
with open(file_path, 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerows(chunk)
map[f"{cords[0]},{cords[1]}"] = file_path
return map
"`"
````~~~``python
import csv
map = {}
def read_chunk(map, path, coords=None):
"""
Reads a chunk of a tile map from a CSV file.
Args:
map (dict): The map dictionary to store the chunk.
path (str or tuple): The path to the CSV file or a tuple containing the base path and file extension.
coords (tuple, optional): The coordinates of the chunk. Defaults to None.
Returns:
dict: The updated map dictionary.
"""
if isinstance(path, str):
file_path = path
else:
file_path = f"{path[0]}{coords[0]},{coords[1]}{path[1]}"
with open(file_path, 'r') as csvfile:
reader = csv.reader(csvfile)
chunk = [row for row in reader]
if coords:
map[f"{coords[0]},{coords[1]}"] = chunk
else:
map["default"] = chunk
return map
def write_chunk(map, chunk, path, coords=None):
"""
Writes a chunk of a tile map to a CSV file.
Args:
map (dict): The map dictionary.
chunk (list): The chunk of tiles to write.
path (str or tuple): The path to the CSV file or a tuple containing the base path and file extension.
coords (tuple, optional): The coordinates of the chunk. Defaults to None.
Returns:
dict: The updated map dictionary.
"""
if isinstance(path, str):
file_path = path
else:
file_path = f"{path[0]}{coords[0]},{coords[1]}{path[1]}"
with open(file_path, 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerows(chunk)
if coords:
map[f"{coords[0]},{coords[1]}"] = file_path
else:
map["default"] = file_path
return map
Here are a few key changes:
1. **Formatting:** Improved the readability by properly formatting the code (spacing, indentation).
2. **Variable Naming:** Changed `cords` to `coords` for clarity.
3. **Key Assignment:** Checked if `coords` are provided. If not, a default key is used to store the chunk or file path.
4. **Docstrings:** Updated the docstrings to reflect the variable name changes and added clarity.
Feel free to further customize it based on your specific needs or constraints.```~~~```
!rule 10 @sweet sorrel Please don't post GPT responses to user questions.
Hey, when installing this onto my computer I got some Chrome Error message about this being unsafe
I checked reddit and didn't see any bad reviews. Just wanting some additional opinions
@sour imp / @long minnow
I totally made that myself, you can tell due to how bad the code is π
!stream 732291998274420828 2h
β @sour imp can now stream until <t:1726025646:f>.
!stream 962128994814263316 30M
β @sweet sorrel can now stream until <t:1726020799:f>.
@ivory wadi π
@frank pumiceπ
Heyy
.
edge is my second favorite browser ngl
last time I used it
I was very pleasantly surprised
easily better than chrome feature-wise
in terms of tracking I thankfully don't care
MHRD - Welcome to Microhard- Become a hardware engineer- Join the hardware startup Microhard- Immerse yourself in the technology of the 80's- Disrupt the tech industryBuild your own CPU- Design hardware circuits with the integrated hardware development environment- Write your designs in the MHRD hardware design language- Create hardware designs ...
Build circuits using a variety of components from different manufacturers, like microcontrollers, memory, logic gates, and LCD screens. Write code in a compact and powerful assembly language where every instruction can be conditionally executed. Read the included manual, which includes over 30 pages of original datasheets, reference guides, and...
$14.99
3280
hi
What you were in before 4 years @wind raptor
Marketing
B2B or Analysts?
Analyst
But was that good with incentives..
As a Dad,
Why at this age , you choose to be Programmer?
Because it was so boring. I chose it because I didn't know what I wanted to do when I was younger. I've loved programming for 4 years now and am much happier doing it.
So, with that connections you got, you are working for them as freelance now?
Chrome has gotten better with how it handles excess tabs
Usually it relegates unused tabs to an idle state that takes up less ram or gets moved to page memory
Also, can't talk out loud, have a co-worker back here
@still herald Yo

trust me I know
Edge started doing that quite aggressively earlier than Chrome
Parsi girls' highs school
Shit
Can Farsi
I screwed up the punchline
Assume my joke was actually funny
HA
I'll take it
Pity laughs are still laughs
deez nuts?
UwU
Just saw it. Carry on.
"You teach me how to be a good girl" can have.... connotations
yeah but chrome with 9 tabs freezes my system.
He's so cool for being a person?
How much ram do you have?
Yeah
im grateful.
My keyboard keeps ghosting "k"
We have tons of people from South East Asia
What are you talking about
They... do
I used to be
I was before high school
It wasn't until I did theater that I got more confidence
Yep yep
7 shows in high school, 2 shows after that
"D-do you want me to do my...hemshake?"
Let's see if I can even remember them all....
Starts thrashing
Yearbook Reflections
10x10
Brady Bunch
Godspell
Wizard of Oz
New Town
Sarah Plain and Tall
Those were the high school ones (possibly in that order, it's been over a decade since then)
Then it was:
Dracula: The Comedy
Fuddy Meers
Favorite show was Dracula: The Comedy
there is something even i downgraded the kernel to the 2nd last LTS version
Had an awesome director, awesome cast mates
On Windows?
There's dicks in all communities
Wouldn't label all of them as such
See previous dicks
Yep. The loudest people are the most recognized
@still herald Patience is a virtue
Yo
Primarily Windows
When I'm not, usually Manjaro
But I'm considering distro hopping again
Just like to try various ones until I find one that feels comfortable
HA
Right
So you're using Chromium rather than Chrome, right?
Gotcha
Could be actual ram issues, too
What distro are you using?
Oh well...
Hmm
That's legit what I was going to suggest
I think Manjaro has access to the Discord desktop client
Might have better streaming using that
Hmm, could also be your DE
Sometimes some DE's just don't play well with other things
I usually rock XFCE
But that's mainly because I'm boring
@still herald hello
yes and that was one of the reason ive got manjaro over arch
Manjaro's driver compatability is awesome out of the box, too
It's the only distro I've used where the wireless card just straight up worked
Hmm?
What'd he call you
Performance review?
It's AUR compatible
That's more a thing about AUR
Not necessarily the distro
@still herald Dude that's awesome!
Proud of you girly
wsg ppl
Not much, 'bout you
Oh dock your pay?
I didn't know that was still allowed anywhere
@upper basin π π»
@somber heath hello
lol yep
Rather not have one
Nothing special to celebrate about me
Just another person
I have no idea what I'm supposed to be doing
I just sat back down
@still herald I don't know anyone who hates you
Had to help one of the partners figure out an issue with their voicemail box
@jovial iris Possibly. It's been quite a while since I've used Manjaro and I've heard it's gotten less awesome over time
Haven't actually futzed with regular Arch but I've heard that's gotten easier to mess with over the years
@still herald I've got a co-worker back here
Just trying to be polite
No no
I'm in the office
If I'm on here, I'm at the office
Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
I'm not bringing accountants onto this server
Damn shame
Whelp, time to start distro hunting again
Would assume so
Worth a shot
If you don't have a lot invested or on that rig, can't hurt
VM is always going to give you mixed results
See if they have a live USB or something
@still herald It's common enough. We have lots of folks who are more here for the community than anything else
And we can still help you learn
Practice practice practice
Well if you get stuck or need guidance you know where to find us
Go for it
There's an off topic name
So the Off-topic channel names are added by staff and most of them are jokes or what have you. Opal's Fanclub is one of them
They don't hate
I swear to god
The Endevour one has a live USB because of the Manjaro folks?
@still herald I mean I don't know what you're expecting me to say
"Tea"
Yeah as in gossip
I know what you mean
I don't think it's just women
Sure
It happens
I mean usually it's more like "That dude is an absolute douchebag"
Yarp
You have an interesting view of what men and women are supposed to be
I honestly don't like beer
@still herald I mean... people have things to do, too
Oh my god
.... but you do care
That's fair. But you also have to let other people talk about things they want to talk about as well
Breathe
Breeeeeeathe
Or you know it's something you would say to their face
Like the people who I think are douchebags, 10,000% I'd say it to them
And have
Also, quick question. If you have someone call you a magnificent bastard, would you consider that a compliment or an insult
I think it's the tone of how you say it, too
If you say it while smiling or about to laugh, compliment
No
I'm still talking about the magnificent bastard thing
You're fine, Winter
Just breathe
I love this site: https://distrowatch.com/
News and feature lists of Linux and BSD distributions.
HA
Love it
"Uh Greg? Stop it"
News and feature lists of Linux and BSD distributions.
@still herald Sometimes the repeition can be a bit much
That... has nothing to do with coding
@vocal basin What's your recommended distro?
@still herald False
> I'm not a coder, I'm a human
did you just call coders non-humans lmao
They're people, they're individuals, and sometimes they're wordy as fuck
It depends on the person, just like anything else
random.choice(whatever_runs)
Well played
@still herald Well.... there's a phrase called "beating a dead horse"
When the point is stated over and over it starts to get- there you go generalizing again
Dude, we talk about random shit all the time
I couldn't install some distros so went with Ubuntu Server again
Wait, Ubuntu Server as your daily driver?
for two servers
the computer had some limitations in terms of GPU
I might've misconnected it
or some power issue
Exactly
like
the other installers crashed for some reason
I should've just pre-installed the system on another computer
Hold on, something weird is happening on my discord, one sec
There we go
Still had the window up like someone was streaming
No idea why
well "had" "some"
now it has a very specific one
a very specific limitation of not having a GPU
You guys are sharp man
@vocal basin What's your DE of choice
I use KDE Plasma;
the one that Mint uses is fine too
I find it hard to get away from XFCE
I feel like I want to, but at the same time...
@still herald Okies. Catch you later
Take care
You're fine
Xfce annoys me visually somewhat
What
Just how it looks so dated?
partially
it's in that part of old UIs that I don't like
It's a weird comfort zone for me
@somber heath hi hi
@peak depot hai
I didn't have to ask
VirtualBox-type datedness in the UIs I'm more fine with
because it looks more as "we didn't have tools to do better" than "we didn't yet realise this might make some people dislike it"
@somber heath "In Come the Spiders" is a horror book in waiting
questionable design decisions are being revived over and over
@upper basin Your flesh actually starts to rot away
now those suboptimal trends have hit the browser the development
Reminds me of that zombies episode of Primal.
Not to be confused with "Income in Spiders"
@somber heath I will end you
It's making me itch
infestment
like
investment + infestation
Oh that's gooooooooooooooooooooooooooooooold
HΓ€mΓ€hΓ€kki
I had that word prepared for a long time
I'm proud of you
Genuinely
Wyrm
Yeah
Stuff like that
Serpent
Back in a sec, have to IT something
π
π¨οΈ
@upper basin what does the auto-formatter do
stubgen?
black or ruff
Puts everything in a single line.
Oh, I haven't run black on my stubs.
run it on the code
the non-stub part
I have before, mine is slightly more readable and consistent.
what are you generating .pyis for?
For faster type checking, basically whatever stubs are used for.
is it observably faster or only theoretically faster?
Hello everyone.
I haven't played around with it.
: )
Can anyone help me with regex?
I want to write a code for matching a number pattern.
The first two has to be 0 and 1 and then the third one has to be 9,5,7,8,6.
!e
import re
pattern = re.compile(r"[01][01][5-9]")
assert pattern.match("005")
assert pattern.match("015")
assert pattern.match("105")
assert pattern.match("115")
assert pattern.match("006")
assert pattern.match("007")
assert pattern.match("008")
assert pattern.match("009")
assert not pattern.match("004")
assert not pattern.match("025")
assert not pattern.match("205")
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
Do I need to write all of these?
does something different, probably
Sorry, I am just a beginner.
everything starting with assert is a test there
!e
assert True
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e
assert False
:x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | assert False
004 | ^^^^^
005 | AssertionError
what are the examples that you need the regex to match?
1st - 0
2nd - 1
3rd - 5 to 9
the rest of 8 can be any number.
: )
I mean the whole string
01912365934
!e
import re
pattern = re.compile(r"") # this we need to fill in
assert pattern.match("01912365934")
assert not pattern.match("00412365934")
assert not pattern.match("01412365934")
assert not pattern.match("10912365934")
assert not pattern.match("11912365934")
:x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 5, in <module>
003 | assert not pattern.match("00412365934")
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | AssertionError
since 0 and 1 we need to match exactly, we just add them there
!e
import re
pattern = re.compile(r"01") # this we need to fill in
assert pattern.match("01912365934")
assert not pattern.match("00412365934")
assert not pattern.match("01412365934")
assert not pattern.match("10912365934")
assert not pattern.match("11912365934")
:x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 6, in <module>
003 | assert not pattern.match("01412365934")
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | AssertionError
then we need to match 5~9
a single time
!e
import re
pattern = re.compile(r"01[5-9]") # this we need to fill in
assert pattern.match("01912365934")
assert not pattern.match("00412365934")
assert not pattern.match("01412365934")
assert not pattern.match("10912365934")
assert not pattern.match("11912365934")
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
and then an arbitrary digit 8 times
!e
import re
pattern = re.compile(r"01[5-9][0-9]{8}") # this we need to fill in
assert pattern.match("01912365934")
assert not pattern.match("00412365934")
assert not pattern.match("01412365934")
assert not pattern.match("10912365934")
assert not pattern.match("11912365934")
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
[0-9] we can simplify as \d
!e
import re
pattern = re.compile(r"01[5-9]\d{8}")
assert pattern.match("01912365934")
assert not pattern.match("00412365934")
assert not pattern.match("01412365934")
assert not pattern.match("10912365934")
assert not pattern.match("11912365934")
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
@errant laurel We're down here. π
@sturdy terrace you understand how this one is made, right?
I think I did. Let me try first.
: )
@peak depot CERN-style
about the font
Former ATLAS spokesperson Fabiola Gianotti announces the change to Comic Sans (Video: CERN) Update 2 April 2014: Enjoy the April fool's gag? CERN's communications switched back from Comic Sans this morning. From today, all of CERN's official communication channels are switching to exclusive use of the font Comic Sans. The move comes after weeks ...
(1st of april but still)
this was based on what happened in 2012
Higgs boson announcement
in Comic Sans
the more popular occassion, not 1st of april
https://www.theverge.com/2012/7/4/3136652/cern-scientists-comic-sans-higgs-boson
!count
( it will tell you to use it in #bot-commands )
!used
user
!usering
you already have >50 anyway
!user
You are not allowed to use that command here. Please use the #bot-commands channel instead.
and, quite surely, you already have more than 3 activity blocks
I'm blocked
Now leave the voice chat and join.
@gentle flint Drink it
Or add vinegar
Or both
Can you flush it?
Real time picture
Moving pictures
A talkie, if you will
How can I leave voice chat
You're not showing up in the list
So I think you already left it?
@gentle flint Does your renter's insurance cover acts of stupid?
I'm new in the channel
Welcome!
@gentle flint Don't lick it
The wires
The sediment is fine
It's not the volts that kill you
Why would you want a remote opened door
I feel like we're watching a found footage movie
He turns around and suddenly Slender Man
@somber heath Would you expect any less?
Well played
Is this how you need to do it?
re.match
these do the same
re.compile(pattern).match(s)
re.match(pattern, s)
however the first one can be used to pre-compile the pattern
Thank you very kindly.
you can use this website to see how regexes match on strings
I'd compile it ahead of time rather than each time the function is called
Not the regex one, no
do you at least know that it's quite different from what Perl/Python use?
I could swear there was another one...
I do, yeah
Wait the syntax is?
I thought regex syntax was more or less standardized
Rust's regex is more limited
iirc POSIX regex is very limited compared to Python/Perl too
Perl has the most advanced one out of popular languages I think
but then again
it's Perl
the whole language is a regex
Rust regex is guaranteed to finish in linear time
O(MN) where M is pattern size and N is string size
I'mma go eat din din.
All work and no food makes A.C.E a silly goose.
you can configure it to be more permissive though
thus losing the performance
Not sure if that's helpful
@tepid mantle Yo
@gentle flint And likely a lot of mold and mildew
A singular big toe
They're kind of cute
They don't really hurt anyone
@sage basalt Yo
f
what
oh hey!
tell him to make a steak with those creatures
β @peak depot can now stream until <t:1726073370:f>.
Uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Nice
Same
@peak depot You don't know my hole
yes they would taste amazing
Of course you do
solves world hunger
@gentle flint They only sell white bread
Napkins?
@sage basalt ... what?
Put kids in the basement?
I'm both confused and concerned
@somber heath Orange cats are especially derpy
Cats love rectangular things
gotta call 911
That came out of nowhere. What promped you to say that again?
the mysterious side of his house
the creatures are just some kids
@gentle flint That just sounds like getting super powers
Today we're going to pick a nose
@vestal zenith π
well thats a fun effect
I think you need to move the phone = line above the match just above it
This?
That's an etsy one, though
If you look in the middle it's just flipping a usual switch
@tepid mantle Yeah it's just a panel cover over a regular one
π¦
not cool enough
insurance would never let you use an unprotected original one
@sturdy terrace Swap these two lines
!code
import re
def main_menu():
print('Main Menu')
print('1. String Operation')
print('2. Number Operation')
print('3. Exit')
def emailValid(email):
if re.match(r'[^@]+@[^@]+.[^@]+', email):
return True
return False
def phoneValid(phone):
if re.match(r'01[5-9]\d{8}', phone):
return True
return False
def main():
while (True):
main_menu()
choice = input('\nEnter choice(1, 2 or 3): ')
match choice:
case '1':
print('\nThank you for choosing String operation.')
while True:
rchoice = input('Choice (1-> EmailValidation, 2->PhoneValidation, 3->Exit): ')
match rchoice:
case '3':
break
match rchoice:
phone = input('\nEnter a valid phone number: ')
case '1' if phoneValid(phone):
print(f'\nProvided phone number [{phone}] is valid!')
break
case _:
print(f'\nProvided phone number [{phone}] is not valid')
match rchoice:
case '1' if emailValid(email):
print(f'\nProvided email address [{email}] is valid')
case '2':
print('\nInvalid Input !!!')
break
case _:
print(f'\nProvided email address [{email}] not valid')
case '2':
print('\nThank you for choosing number operation.')
case '3':
print('\nThanks for using switch statements')
break
case _:
print('\nInvalid Input!!!')
main()
Hello can i please get unmuted from 14 days voice mute duration?
It's too harsh and strict i need to learn python fast
Oh I thought you were going to ask about the Python help you needed
I'm not going to make an exception on the mute. Otherwise what's the point of it. It does say in #voice-verification not to spam to get verified
I know it sucks, but if you don't read the rules....
It's easier to help via text anyway
Just ask one thing at a time, we can go from there
IF you decide to do that, both accounts will be banned
Infraction invasion is something we take seriously
On top of that, you'd still have to wait 3 days and do the 50 messages
So....
I mean i wouldn't decide it the idea popped up in my head. But how will you find out the account
Just... ask your Python questions
3 days is still better than 14 isn't it? π you guys take this voice verfication too seriosly
The more time you try to get a way out of this, the more time you're not asking for help
Yeah ill do as you say i wouldn't wanna cause problems
So as a python beginner, who just knows fundamentals, but i haven't done any serious projects. Should i move on to learn intermediate/advance python or should i just stick to beginner to master it.
day 2 of cs
Like i just tried to do something and i found out that i have forgotten 30% of what i learned
But i remembered from internet
So you're trying to get over that beginner/intermediate hump?
found out about negating binary
mind is blown
ok why does sign magnitude exist
it sounds so stupid
Are you familiar with stuff like classes and what not?
shit it's raining in the uk too
I am familiar with classes i started learning them yesterday, not that much tho. And i have no idea about what no
I've heatd Not tho
@gentle flint What with the hand crank?
But i dont know how it works
As in how to use not?
Yeah
We'll start there
So you're familiar with == and != right?
I am with == as for if statements. != i learned that one but i forgot lol
?
I started 1 week ago to take it seriously
The gatling
"never shake thy gory locks at me"
!e
!= means not equals. So it checks the two values and sees if they equal the same thing. If they aren't, then it's true:
print(3 == 4)
print(3 != 4)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | False
002 | True
!e
Exactly
ham = 3
pork = 4
print(ham != pork)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
True
So the not keyword will take a boolean and flip it
Interesting
Whenever you do a value comparison (like we just did with == or !=), it evaluates it and will convert it to a boolean. Using not, we can flip it
So if i said
Running = True
Running not
@quartz beacon It's a subject you don't like talking about it, and yet you are
But what about "what"
As far as I know there isn't a what keyword
Oh also, in Discord you can do little code blocks
Didn't you mention not and what?
If I did I didn't mean to
Thanks i needed that ππ
Yea not i get it i thought there was a what keyword i never heard about
Yeah yeah
I understand..
!e py import keyword print(keyword.kwlist)
Are you familiar with is?
:white_check_mark: Your 3.12 eval job has completed with return code 0.
['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
I genuinely keep forgetting about this
Oh yeah that's going to complicate it
It's a backtick character
Usually shares a key with the ~ character
@gentle flint That's insane
Actually
@quartz beacon Genuinely what would be the honorific on that
Like as opposed to Mr, Mrs...
I'm trying to learn
On the road, having lunch at the halfway point
@gentle flint Twas a joke
''' print(123)'''
Shoot
This one
Are you familiar with other programming languages?
I know you said you started a week ago
This isn't a slam. Usually if you know other languages, each language you learn after that gets easier and easier
Can confirm. I know matlab, python, fortran, and now go.
But I personally think a week is a bit short. Things like the != and not are pretty important, so I'd focus on getting a stronger grasp on the fundamentals. Those will be your foundation from here on, so making sure you're confident in them can make a world of difference
I'm happy to make little assignments for you to do if you feel like you want to get a better grasp on a particular topic
My fathers friend is very big data engineer or something and he gave me pirple course on python. I learned it output and input, from that point it gkt boring, the guy would explain one function 90 times. So i abondened it and started learning from youtube, this part really confused me because on one bit i would re-learn fundamentals and the other bit i'd try to learn OOP and machine learning. I am just confused man
Understandable
It's because i abandoned that course in the first place and when i got back i knew some things and some not, it was hard to separate which one i had to skip bc i new and which one to focus on
So I personally recommend "A Byte of Python": https://python.swaroopch.com/
I've never done well with courses and videos don't go at the right pace for me (either too fast, too slow, or not enough information)
So I find reading things better for me personally
I can go at my own pace
I'd start thumbing through that one and asking questions here if you get stuck or need something explained
We're as much of a resource as that book is
!resources We also have a bunch of other resources listed on our site
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Yeah honestly i have tried reading and i noticed it is significantly better than watching this courses
They just bore me out
Im a man of science and philosophy. I get bored from this guys saying same thing 66 times
But you just have to push through. Find little ways to make it interesting. As you're reading, have a terminal open. Try the things there, play with them, try and break them or find other things to do with them
I understand that and i've realized it since beginning.
That's the best advice I can really give. Engage with it not just through reading, but through hands on
I'd love to hear your story.
It's boring as hell, trust me
How did you got into programming with Python?
I hate you guys
Curiosity. I went to college for a CIS (Computer Information Systems) degree. Due to moving around with family, I've gone to 6 different colleges across 3 different states over the course of about 3 or so years. I got my associate's, which was a transfer degree more or less, and then I just broke.
But in that time, I learned programming through school (Java being the first language I learned, as well as Visual Basic and some C#). I didn't really do anything with it for... I guess 5ish years? Then I hung out on the Incremental Games server, got the itch to start coding again, found Python, never looked back
Now, one thing I will say is that I'm not in the industry. I do IT for an accounting firm. Coding is a hobby for me, just for fun
Like I said, boring as hell
whyβ
Hell yeeaaah!
Join back Pydad, miss your company.
I'm going to have to head out shortly. Need to take Joi to some doc appointments
Probably won't be back until tomorrow
Wow i found a lot of simillarites with you. I also go to IT collage. I am 16, and yet so desperate to learn coding fast. I have this one project in mind that i want to pull of.
I'll keep the torches lit sire.
But i feel like i have already failed because i dont know how to code. Feels like 16 Is too late for it
Not at all
I guess it's teenage issues xD
There's people in their 30's and 40's out there beginning to learn coding
Yeah
There's always time to learn
For context I'm 34
it's just maths
What, coding?
Idk
yes
I'd say it's more just logic than math
Cause and effect
This leads to this leads to this
Logic and math are not mutually exclusive
Sure, but I'd say the main emphasis is the logic
Thanks for tutoring me Mr Hemlock. I greatly appriciate it. Sorry for making you hang here, i know you got stuff to do. Thanks
I do this for fun, it's not a problem. I'm around here every weekday, so if you have questions and you see me on VC, I'm happy to answer (as I can)
Alright, I'm hopping off. I'll see you folks later
c ya
Of all the days for the NOLA radar to be offline...at least the Lake Charles one works
you good?
bye
I'm about as far away from that as possible while still on the sane coast.
Taking a brief break from I-95 for lunch. And of course the only good soda left in the US.
it's been a year since i've had soda
i wonder if they changed it
bring back the coke in coca cola
BNF Parser Generator
<letter> ::= "A" | "B" ...
<word> ::= <word> | <word><letter>
i think?
moxie still uses the original recipe. gentian root is still the key ingredient.
almost showtime
Want to be a Member? Click here : https://www.youtube.com/channel/UCV6hWxB0-u_IX7e-h4fEBAw/join
Support the Chase here : https://shopnsc.com/
TeamDomHQ Discord - https://discord.gg/teamdomhq
Team Dominator is back in action with a live hurricane chase as Francine has rapidly intensified into a category 2 hurricane expected at landfall. Tornadoe...
@verbal zenith
Can you please help me with a simple problem?
: )
todo!()
I'm installing neovim on the phone
haven't installed the lsp support yet
but at least it has syntax highlighting
a more colourful one than vim had
.any
it takes a predicate
first?
What's that software may i ask?
as in .first
Is it pydroid?
ah
you need Some or true?
when the predicate is true
.first
oh wait no I thought it was a thing
what am I confusing it with
A trait for dealing with iterators.
that one
.find
I got first two letters right
Alisa?
termux
Okay thank you Mis
@verbal zenith did you know that implementing Eq for T changes the be behaviour of Arc:<T>::eq?
it short-cuts on equal pointer
PartialEq isn't enough
Eq means self == self
^ which is not true for f64
!e
x = float('nan')
print(x == x)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
False
!e
x = float('nan')
print(x < 0)
print(x > 0)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | False
002 | False
that's why f*s are neither Eq nor Ord
pub struct StringIterator {
_string: Rc<str>,
chars: IntoIter<MaybeUninit<char>>,
}
impl StringIterator {
pub fn new(string: Rc<str>) -> Self {
let chars = string
.chars()
.map(MaybeUninit::new)
.collect::<Vec<_>>()
.into_iter();
Self {
_string: string,
chars,
}
}
}
impl Iterator for StringIterator {
type Item = Value;
fn next(&mut self) -> Option<Self::Item> {
self.chars
.next()
.map(|c| Value::String(Rc::from(unsafe { c.assume_init() }.to_string())))
}
}
why MaybeUninit?
no it won't require
there is almost no reason to ever use MaybeUninit<char> instead of char
MaybeUninit<char> is just a potentially invalid char
this one was the one that had MaybeUninit
just to force unsafe when accessing it
I think this one was by me too
they're both kind of ugly
you can go with an extreme solution of just having chars: Chars<'static> in there
with one unsafe block
and annotate safety everywhere
definitely have a minimal mod to have that thing in
so the scope for unsafe is limited
you need both the impl Iterator and struct itself hidden away in a mod
uh
there are ways
A crate for creating safe self-referencing structs.
@verbal zenith I think it does nothing
but that safeguards against changes to std if those ever happen
Provides mappable Rc and Arc implementations.
@verbal zenith you can also just store Arc<str> and usize and increment (by 1~4 bytes) it on next
nobody talking?
good, thougt my headset broken lol
next:
s = s.get(index..)
c = s.chars.next()
index += c.len_utf8()
preferrably with correct syntax and not pseudocode
let slice = &self.source[index..=index+4]
let c = slice.chars().next();
self.index += c.len...
let s = self.rc.get(self.index..)?;
let c = s.chars().next()?;
self.index += c.len_utf8();
Some(c)
why
it's O(1)
no
it has an iterator over &[u8] inside
green-ish underline means unused?
reminds of how VS proper has a lot of colours for highlighting code
maybe runtime error
or yield bits as booleans
Lisp levels of hackiness
true => [true]
false => []
@sweet sorrel there is quite a popular story about how they spent ~18 months on a new website, and on a first real test it took 10 minutes to load
well, actually, on first try it timed out; 10 minutes was after raising the time limits
talk to Oxide, they'll tell you just how correct your frustration with Dell is
yeah, if you need just a lot of space, Oxide's stuff isn't the way either
