#voice-chat-text-0
1 messages ยท Page 546 of 1
So you're learning the fundamentals of Python
yup
assignment (as-sign-ment)
ment
sign
signment
as
assignment
So you break the word into its syllables and then start saying out loud one syllable at a time from the end of the word to the beginning taking one step at a time to combine the syllables until you get to the beginning of the word and then pronounce the whole word.
text-to-voice
text-to-voice hi kyle
You can find a website or app to do text-to-voice and learn how to pronounce words
Syllable Counter is a free online tool that helps you count the total number of syllables for any word or sentences, per line for haiku poems.
parentheses
syntax error
syn-tax error
hello Ghazi
/tts Hello
class Class1:
def __init__(self, var)
self.var = var
class Class2(Class1):
def __init__(self)
def function1
# how do I get self.var here from Class1
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Omit __init__ in the second class, write __init__ along the same lines as in Class1 , provide for a var parameter in Class2.__init__ and use super to pass it along to Class1.__init__ from Class2.__init__, or some other approach.
!e ```py
class Class1:
def init(self, var):
self.var = var
class Class2(Class1):
def function1(self):
print(self.var)
instance = Class2("Hello, world.")
instance.function1()```Omission of Class2.__init__ allowing Class1.__init__ to be used as the constructor for Class2.
:white_check_mark: Your 3.14 eval job has completed with return code 0.
Hello, world.
!e Giving Class2.__init__ whole.```py
class Class1:
def init(self, var):
self.var = var
class Class2(Class1):
def init(self, var):
self.var = var
def function1(self):
print(self.var)
instance = Class2("Hello, world.")
instance.function1()```
:white_check_mark: Your 3.14 eval job has completed with return code 0.
Hello, world.
@somber heath coming in for the win!
What about something else:
def run_shutdown(self, info, hypervisor, host):
for entry in info:
if hypervisor == "ESXi":
if entry[0] != exempt_vm:
print(f"Shutting down VM {entry[0]} ({entry[1]}) on {host}...")
output, err = run_command(self.ssh_client, f"{self.shutdown_command} {entry[0]}")
if output:
print(f" Result: {output}")
if err:
print(f" Error: {err}")
elif hypervisor == "Proxmox":
if entry[0] == "106":
print(f"Shutting down VM {entry[0]} ({entry[1]}) on {host}...")
output, err = run_command(self.ssh_client, f"{self.shutdown_command} {entry[0]}")
if output:
print(f" Result: {output}")
if err:
print(f" Error: {err}")
class ESXi(Hypervisor):
def __init__(self):
self.pattern = r"^(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*?(\S*)\s*?$"
self.list_command = "vim-cmd vmsvc/getallvms"
self.shutdown_command = "vim-cmd vmsvc/power.shutdown"
class Proxmox(Hypervisor):
def __init__(self):
self.pattern = r"^\s+(\d\d\d)\s+(\S+)\s+(\S+)\s+\d+\s+\d+\.\d\d\s(\d+)\s*$"
self.list_command = "qm list"
self.shutdown_command = "qm shutdown"
!e Giving Class2.__init__ but using super.```py
class Class1:
def init(self, var):
self.var = var
class Class2(Class1):
def init(self, var):
super().init(var) # Class1.init
def function1(self):
print(self.var)
instance = Class2("Hello, world.")
instance.function1()```
:white_check_mark: Your 3.14 eval job has completed with return code 0.
Hello, world.
How do I get self.shutdown_command up into the parrent class?
I guess I just need to structure the code differently
Yeah, I'm not really sure what's going on.
Keeping in mind that we write classes when we want an object or objects that represents (persistent) state that we want to interact with during the program.
Like a goblin in a game, separate from other goblins.
Yes, that's the goal
Or an object that represents a connection and you're calling its methods as you need to, reading and writing data, shutting down, etc.
So should I not have subclasses in my code for this example or just move the run_shutdown function into the sub classes?
I don't know.
I think the problem is I'm defining variables in the sub class and expecting to be able to call them in the functions of the parent class
I just need to write it differently
Oh, my, no
lol
I could hear your voice when I read that
OK, I'll try doing it differently. I gotta go afk but I'll be back in a bit
ty again
Technically, you could, but it wouldn't be code smell so much as code turd to the face. Something something __init_subclass__.
Or explicit name referencing...
!e ```py
class A:
def b(self):
C.b(self)
class C(A):
def b(self):
print("Hello, world.")
A().b()```
:white_check_mark: Your 3.14 eval job has completed with return code 0.
Hello, world.
๐คฎ
How is everyone doing today?
oh goodness that does look awful
Good, how's it going?
Another lovely evening
It's Amazon prime night well for me at least it's something that I want to start and I picked a good one that I haven't seen in a bit
@somber heath https://paste.pythondiscord.com/UVPA
It's working, I feel like there is so much more to do
print(*objects, sep=' ', end='\n', file=None, flush=False)```
Print *objects* to the text stream *file*, separated by *sep* and followed by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as keyword arguments.
All non-keyword arguments are converted to strings like [`str()`](https://docs.python.org/3/library/stdtypes.html#str) does and written to the stream, separated by *sep* and followed by *end*. Both *sep* and *end* must be strings; they can also be `None`, which means to use the default values. If no *objects* are given, [`print()`](https://docs.python.org/3/library/functions.html#print) will just write *end*.
The *file* argument must be an object with a `write(string)` method; if it is not present or `None`, [`sys.stdout`](https://docs.python.org/3/library/sys.html#sys.stdout) will be used. Since printed arguments are converted to text strings, [`print()`](https://docs.python.org/3/library/functions.html#print) cannot be used with binary mode file objects. For these, use `file.write(...)` instead.
!pep8
PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.
More information:
- PEP 8 document
- Our PEP 8 song! :notes:
@quiet needle ๐

@fleet drum ๐
w pfp
@abstract bear ๐
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
i can't VC
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
TEHRE ARE CLASSES IN PYTHON?!?!?!?!?!
yes be patient be patient
Python is object-oriented, but can be written bimodally. "Everything" in Python is an object, every object is of a type/class.
@inner scroll ๐
hello
hi
MOOSEBUTTER IS THE MAN!
(A Star Wars-themed four-part a cappella song)
Moosebutter sings 'Star Wars' live in the studio.
Check out more amazing a cappella songs (read the lyrics, and buy the MP3) from Moosebutter at:
http://www.moosebutter.com
WRITTEN AND PERFORMED ENTIRELY BY MOOSEBUTTER
MEMBERS:
Top Left: Weston
Top Right: Chris
Bottom Left...
@dusk spruce ๐
@fallow whale ๐
Hello ^-^
@hearty flame ๐
restapi coding resources anyone has?
@neon dock ๐
hello
@compact fjord ๐
looks yummy
that is well done...
(Al also happens to be what Dante's other half of the name shortens to)
actually that is congratulation
creatine??
cat: what are you looking human?
curl arxiv | grep
how you guys can take that nice pictures?? like when i did it on my phone it sucks, i tried doing it with my classmate's cus his phone has better camera but it still suck
the image has all the noise you can have
@somber heath i have all the shit light, i infact use the sun
@hidden fjord ๐
that classmate has a nikon p14 ig... it perform super good even with bad exposure and shutter speed
thats 50?
oh
80 per side isnt something i can lift lol
- your phones' cameras might be using fake upscaling
- it might be too dark
@peak depot meanwhile here it's cheaper for all the wrong reasons
temu?
i.e. in person purchase pricing of groceries is artificially inflated
I think Amazon with some of their policies does the same to stores
about 80 total but i dont have those equipment... i just lift cement bags
each was about 80KG
also dont delete message....
(this is not an unusual practice to have this illogical inverted pricing)
@peak depot buying in person for me is also, ironically, the more convenient and less stressful option
ill teach you how to make it...
it's just faster to go to the store for most things
exotic matter, < 0
interacting with 0~1 people rather than 2~3 involved in delivery handling
also
it suposed to have some sort of delay on each numbers?
stores are open at night
of whom
guh fine
@vast knoll ๐
we have three 24/7 grocery shops nearby, but all the groceries delivery stuff is offline
off by 299792458 metres
@peak depot the reasoning isn't based on anything moderation iirc
does that parse?
why not?
.flush
instead of ,flush
I'm trying to remember the nuances of parsing there
end="".flush=True is valid syntax outside the argument list
but
I think that is kind of special case for assignment statements
also, iirc, multi-= assignments have very weird precedence
counts up not down
@midnight agate kindly dont delete your messages
dissable it...
your account will be banned if discord moderation detected it
it is totally against discord TOS
yes i got banned easilly
thats how ni lost my account form 2022
anyways ill fix the code
what?
import argparse, time
parser = argparse.ArgumentParser(description="Countdown timer.")
parser.add_argument("seconds", type=int, help="Duration in seconds")
args=parser.parse_args()
print("Countdown: ", end="")
for i in range(args.seconds, 0, -1):
print(f"{i}...", end=" ")
time.sleep(1)
print("0...")```My stab at it. You'd still need the right invocation and setup, and that's a little beyond the scope of Python.
it does exactly what my code do...
Well, I l didn't copy the original spec.
It is a very simple project. It's not surprising there would be considerable overlap.
"bikeshedding time: final should be 0. not 0..."
Shedding the bike.
you might wanna use some escape codes to do what you need
but it shoulndt be that hard
"today on national geographic we have: Europeans"
argument parser?? never knew that existed on python...
you dont need argument parser when you only have one call options
I often use clap in Rust even with 0 arguments
ensures extra arguments are rejected not silently ignored
#!/usr/bin/env python3
import argparse, time
parser = argparse.ArgumentParser(description="Countdown timer.")
parser.add_argument("seconds", type=int, help="Duration in seconds")
args=parser.parse_args()
print("Countdown: ", end="")
for i in range(args.seconds, 0, -1):
print(f"{i}...", end=" ", flush=True)
time.sleep(1)
print("0.", flush=True)
Now, as to the #!
That's what works for me.
Other things that say that they should work are maybe targeted at other configurations.
docker's output capturing has interesting opinions on flushing
specifically, ignoring it altogether
Yes, but that's a matter of what you call the file, also chmod +x filename
what are you using this for anyways?
probably he's on window....
ill suspect...
if you are on linux, you first need to remove the french language pack, its buggy and will give aloot of error on the standard output
remove the u part..
you gotta remove the -fr /* pack
offlineimap??
ohhhh
i see
what OS you using?
a what...
is that another weird distro?
๐ค
ever tried nix :3?
@midnight agateI would argue bash is probably the better language for it.
you can do the same thing on bash to
use Rust, you can just rely on the compile times as the delay
I'm probably missing VC context and this is probably like the dumbest question, but what does a parser do in this context and why is it hooked up to a countdown?
never heard the word before and looking it up isn't super helping heh
parses ["program", "123"] as args.seconds=123
wouldn't that be xibang?
I wanted to be conventional. My understanding is that doing it this way is how it's supposed to be done.
vs sys.argv
appreciate the answers, I think I'm probably missing the goal too, is it just supposed to be a simple countdown script?
Yes.

there should be a decorator to turn functions into argparsed programs
(if not existent, should be created)
same for clap in Rust
I wrote a thing like that for work, but there it's pulling stuff from somewhere other than arguments
I hear a bat. ๐
there is no vc mods...
thank you for helping explain Marco! I'm very beginner which is why I was asking, I definitely would not do something better, and would probably use time.sleep(1) in some horrible loop for [i] seconds or something because I'm not familiar with how to use "parsing" or "arguments" in this context haha
just a simple int(sys.argv[1]) would suffice
sure that sounds fun, I'll give it a shot one sec
oh fuck
one sec sorry forgot discord formatting
@midnight agate ok this is probably terrible but this is my immediate go-to solution, is there anything wrong with this?
import time
print("Countdown: ")
for i in range(0, 5):
print(f"{5 - i}...")
time.sleep(1)
print("0.")```
5?
I was just trying to figure out how to format the python code in discord haha
ah! I wasn't aware there's a target, what's the target then?
hello guys
will give it a shot!
@midnight agate how's this?
import time
print("Countdown: ", end = "")
for i in range(0, 5):
print(f"{5 - i}...", end = "")
time.sleep(1)
print("0.", end = "")```
hahaha
that is very supportive and nice marco, thanks for the help/explanation again!
oh i should've taken your range(5) and put it in too
add flush=True
just for the practice
so it will flush it on each print
does that actually affect the end result?
yes
have a look
will do
just test it
ahhhhhhhhh now i see what you're saying with the text "buffering"
flush stuff is very system/context dependent
now it displays as it comes out
if you didnt flush, it will flush it when the program ends or if onother print flush it
very good to know thanks!
(usually)
unlive non-coding
"take care of ..."
given rimworld, ohno what are you planning
I think the last game I played which has any sort of "having to manage people's mental state" was Alters
the premise is that the main character creates alternative versions of himself
naturally, I picked the most cruel choice I could as soon the game let me
one voice actor, many very different characters
I've just learned what that voice actor contributed to BG3
Sup
Can't talk rn
I might in a moment
I migrated to NL
Don't think I told you
Currently living here as a refugee
My roommate is an odd fucker
And housemates tend to be odd too
So yeah
not even
Dude stalked my mom on FB and harassed her
Then expected nothing to happen
Now he's trying to stalk me
๐
I'm not sure if he's like master level manipulator or genuinely just a small person who never faced consequences in his life
Because surely someone beat his ass back home for this shit
Ukrainians aren't known to tolerate bullshit like this.
Anyways how are you Krzy
Glad to hear
I wish for a boring life
But currently it's still a bit too much
Haven't truly settled in yet
Gonna get a job soon ish
So i can afford good food
would that be pronounced [kสษจ]?
ะัะธ
โ I'll assume that is Ukrainian ะธ not Russian ะธ so it aligns what I suggested
yes
ะัั
intersperse letters in the name with some guns, American will pay closer attention
either
there is a feminine name of that sort
relatively common I'd expect
Christopher is the English version of a Europe-wide name derived from the Greek name ฮงฯฮนฯฯฯฯฮฟฯฮฟฯ (Christophoros or Christoforos). The constituent parts are ฮงฯฮนฯฯฯฯ (Christรณs), "Christ" or "Anointed", and ฯฮญฯฮตฮนฮฝ (phรฉrein), "to bear"; hence the "Christ-bearer".
As a given name, 'Christopher' has been in use since the 10th...
I think zeki was in the VC relatively recently
reminds me that I should continue playing the game where the "Cassidy" is from
half-completed
INFO:__main__:Running TCP check on 10.136.200.10
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_9.2p1)
INFO:paramiko.transport:Authentication (password) successful!
INFO:__main__:Running TCP check on 10.136.200.51
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_9.2p1)
INFO:paramiko.transport:Authentication (password) successful!
INFO:__main__:Running TCP check on 10.136.200.10
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_9.2p1)
INFO:paramiko.transport:Authentication (password) successful!
INFO:__main__:Running TCP check on 10.136.200.51
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_9.2p1)
INFO:paramiko.transport:Authentication (password) successful!
INFO:__main__:Running TCP check on 10.136.200.52
INFO:__main__:Could not reach the host on port 22 (connection refused or timed out).
(if you do this for monitoring, consider looking into SNMP and adjacents)
giving me more to do
This is a script that probably runs maybe once every couple of months, so it might be easier to write a check in an RMM to look for changes to the file and then look at it manually in the event it happens
so i found a stackoverflow on a way to avoid the blocking issue somewhat
it's put the handler insider a queue
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
@jaunty socket
This environment does have an SNMP server though
Ok
๐
INFO:__main__:Running TCP check on 10.136.200.10
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_9.2p1)
INFO:paramiko.transport:Authentication (password) successful!
INFO:__main__:Connected to Hypervisor: 10.136.200.10
INFO:root:Checking host hypervisor type
INFO:root:Host is Proxmox
INFO:root:Getting VM list
INFO:root:Connection closed to 10.136.200.10
INFO:__main__:Running TCP check on 10.136.200.51
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_9.2p1)
INFO:paramiko.transport:Authentication (password) successful!
INFO:__main__:Connected to Hypervisor: 10.136.200.51
INFO:root:Checking host hypervisor type
INFO:root:Host is Proxmox
INFO:root:Getting VM list
INFO:root:Shutting down VM 106 (kali) on 10.136.200.51...
ERROR:root:Error: VM 106 not running
INFO:root:Connection closed to 10.136.200.51
INFO:__main__:Running TCP check on 10.136.200.52
ERROR:__main__:Could not reach the host on port 22 (connection refused or timed out)
ERROR:__main__:Verify SSH is enabled and not blocked by a firewall
hi all, just got to know about this discord serverfrom my book Python Crash Course by Eric Matthes
Excellent community
!e py print(format(0x1F642, "b"))
:white_check_mark: Your 3.14 eval job has completed with return code 0.
11111011001000010
Hi
if (($Battery.EstimatedChargeRemaining -le 50) -and ($Battery.BatteryStatus -eq 1))
four 50/50s in a row
so how can i verify this
by participating in conversations using the text channels
@wind raptor did you buy Alters?
(it's bundled on steam with Expedition 33)
(they said they were playing fortnite)
hollow knight
yeah
idk
ah, okay
confusing syllables
anyway back to writing splay trees
I've mostly heard that Silksong was better not harder
Vim escape simulator
yeah online co-op
@peak depot โ absolutely nothing
this seems interesting
minesweeper is souls-like:
- high difficulty
- enemies respawn after restart
yes
@dry jasper Rematch
allegedly
it's existent
Soma too
existential horror
I want an option to find games from my library that are currently on sale
yeah, trying that
hmm
@heavy zenith yeah, steamdb has filter by discount, thought of search there too
w
Frostpunk is 90% off, good game
!stream 223839302914801664
โ @calm heron can now stream until <t:1762111000:f>.
oh, it also shows "all-time low" note
you can use OBS as a cam and apply filters to unRed the theme
or just change it
looks like I have exactly 100 games that are on sale
I approve of Red
compared to light mode
@wind raptor insides of a military submarine vibe
!
@lavish rover in notifications settings
ic right i knew that
if on phone, then rip
i had just tuned out the default sound i didn't even realize this was that
lmao
recommended stuff: Frostpunk 1, SOMA, Nihilumbra, Haven, OPUS series, Alters, Noctuary, SIGNALIS, Expedition 33
Nihilumbra is quite good
@calm heron great coder
Noctuary is definitely the current favourite for me
How are you ?
@wind raptor this one only* takes something like 2~4 hours
* you'll find out why not really, but later
KSP 1 is good
KSP 2 is idk
In Kerbal Space Program, take charge of the space program for the alien race known as the Kerbals. You have access to an array of parts to assemble fully-functional spacecraft that flies (or doesnโt) based on realistic aerodynamic and orbital physics. Launch your Kerbal crew into orbit and beyond (while keeping them alive) to explore moonsโฆ
$39.99
106215
88
@spice mango (we're in this chat)
(not #off-topic-lounge-text)
@uneven jasper only in that both have orbit mechanics
SpaceEngine and Universe Sandbox are just sandboxes/simulators without any sort of goals
Echoes of Londor
is second part still considered not worth trying?
I didn't buy it
and can't buy it anymore
Homeworld 3 was the biggest sequel disappointment for me
@uneven jasper likely not a server-appropriate game I'd expect
Homeworld is 3D RTS
full 3D
Homeworld 3 is a catastrophe
allegedly
M
it's M
not even R
R is the stuff kids can watch with parents around
I usually rename with accordance to pfp change
which part
@wind raptor for some games it depends on which part of that story/part of gameplay that is, I'd assume
too bad I can't give an example because don't want to spoil
!stream 1287949767611252747
โ @uneven jasper can now stream until <t:1762112685:f>.
Frostpunk 1 and 2 eventually go non-PG13
SOMA is please don't show this to kids
Nihilumbra is family friendly
Have is ABSOLUTELY DON'T SHOW THIS TO KIDS
Alters is okay as far as I know
Noctuary is [you'll see]
SIGNALIS is too much horror/violence/dismemberment
Expedition 33 has a bit too much violence/death from what I know
@lavish rover can you grep for explain in the C code (compiled)? might be coming from some errno stuff
or did you solve it already
I don't like VMs
low performance, low security
want security => Zones
proper containers
typical VM setup for illumos always involves putting a Zone around the VM because Zones are more secure
Docker is the right way for most cases
if you deploy on your own hardware, there are nearly no reasons to use VMs
if you're a paranoid cloud provider, then Zones+VMs
illumos Zones
this got created a bit earlier than Docker
Meetup: http://bit.ly/24BICms
Papers: http://bit.ly/1OQu5YB & http://bit.ly/21HNDYf
Slides: http://bit.ly/1QmCSWr
Audio: http://bit.ly/1T8uYUb
Sponsored by Two Sigma (@twosigma) and Enigma (@enigma_io)
-----------------------------------...
FreeBSD is security-centric
it is Unix, in a way
direct descendant
Solaris is another Unix
brb
VHS
@uneven jasper well, not really, many disks already back then had mechanisms through which they could revoke your right to view something
especially blu-ray
there is so much copyright enforcement there
you need to keep your disks away from new hardware, and keep your old hardware away from new disks/software/internet
if you want to keep the ownership actually forever
(push for blu-ray was largely about that)
pirating after the company retroactively revokes your right to use something you bought is morally (and, iirc, in some places legally) justified
e.g. in cases of ToS changing from lifetime license to something more limited
(or lifetime license getting voided by product getting discontinued)
currently playing Tetris Effect, trying to get better score on the first stage
with surface area proportional to the information it consumes
1 bit per square Planck length
very dumb sounding unit but seemingly true
* upper limit
Bekenstein bound
I already gave up on GCC and adjacents
all the C/C++ dependencies I need for my Rust stuff I compile with Zig during release builds
cargo zigbuild is the only reliable way to cross-compile
I do write unsafe code sometimes
https://github.com/parrrate/ruchei/blob/main/ruchei-wakelist/src/lib.rs
C is getting more complicated
it's getting provenance in the standard
same with C++
(but C++ is already a mess)
operator overloading is mostly fine
just don't misuse it
large part of C++'s good parts is about allowing you to use anything like an int as far as logic allows that
that covers all the copy semantics stuff
noo cause why can the (, - etc.) do heap allocations
but now that there is also move, this gets complicated
C++/Python/Rust reasoning: addition should be expressed as +
for all types where addition is defined
if you want fallible addition, that is a separate story
C++ OOP and Java OOP are very different
C++ has too many design defects
e.g. std::vector<bool>
if you want better C, then use Zig
custom allocators, and therefore memory leak tracking, is simpler with Zig
it's possible to cross compile Zig to mingw from other hosts
for some of my software I distribute two separate Windows builds, one is MSVC, other is mingw/GNU
(even with all the unsafe {}s, this is still more ergonomic than C)
ergonomic ?
easier to write and maintain
Rust provides a lot of stuff to get even unsafe parts right
@vital prairie you can just use WASM if you want an isolated environment to run something
... or Lua
I did ~21K lines of manually written code in 12 days at some point, so 4KLoC in 4 days isn't unrealistically much
it's just very simple code
Rust+SQL
the whole point there is that there wasn't much thought required
luna-canidae@[dir]$ python3 randos.py
Please enter a username: LunaCanidae
Enter your password:
Welcome, LunaCanidae
LunaCanidae@HP-LUNA-5421 [/home/LunaCanidae] $ pwd
/home/LunaCanidae
LunaCanidae@HP-LUNA-5421 [/home/LunaCanidae] $ ls
The command ls was not found in /bin
LunaCanidae@HP-LUNA-5421 [/home/LunaCanidae] $ cd
'NoneType' object has no attribute 'startswith'
LunaCanidae@HP-LUNA-5421 [/home/LunaCanidae] $ cd abc
'NoneType' object has no attribute 'startswith'
LunaCanidae@HP-LUNA-5421 [/home/LunaCanidae] $ pwd
/home/LunaCanidae
LunaCanidae@HP-LUNA-5421 [/home/LunaCanidae] $
all the thinking was spent on debugging
debugging performance
which in SQL is quite non-trivial
goal (roughly):
million items, need to find a single item in <1ms
with many complications
indexed
but
need to join multiple tables
complications mostly were SQLite being way too straightforward
can't do in-memory; embedded
enough disk space, very limited RAM
in practice there's at most something like 10K entries
but during development I test with more, to ensure it performs correctly
you just need not to hit the cases where the DB decides to scan the whole table
just avoid linear search
which isn't always trivial
you need to structure queries in a way that doesn't prevent the database from using indexes
general solution with SQLite:
do joins/conditional logic outside SQLite
i.e. break queries down into multiple steps
with PostgreSQL, do the opposite
(I need to support both)
it's been at 30~40KLoC for the past half year
now adding functionality without adding much code size
(the original code is gradually refactored/rearranged/reduced)
I don't have work schedule
(so I can very much just do 75h one week and 5h the next week)
the exception is only for me, because I need this sort of time inconsistency, otherwise I work way worse
can't you get some sort of flexible schedule out of the company if you have some sort of health condition that prevents you from following normal schedule?
(e.g. untreatable insomnia)
idk how that'd be formally
???
so confused
"well, at least anime acknowledges Australia..."
200 lines after starting, running the splay tree code for the first time
seems to work
I need to somehow visualise the structure
splay tree is one of the binary search tree implementations
one of its differences from the rest is that you need mutable access for search, not just insertion
amortised
however they're 1) fast 2) can be implemented non-recursively 3) function as a naturally emerging cache
recently accessed items tend to remain close to the top
tail recursion is as fast as iteration when implemented right
general rule: don't make performance claims without concrete benchmarks
sometimes recursion is faster, sometimes is slower
definitively saying one of the two is definitively slower is generally incorrect
@viral knot often alternatives to recursion mean you'll have to involve heap instead of stack
by your own words, stack is more efficient
some problems require you to model stack in one way or another
if you choose between heap-based solution and call stack solution (recursion),
do benchmarks and measure, heap might be slower
@viral knot only matrix power
or floating point, but that is kind of questionable
!e
fib = lambda n: round((((1+5**.5)/2)**n-((1-5**.5)/2)**n)/5**.5)
print([fib(i) for i in range(10)])
:white_check_mark: Your 3.14 eval job has completed with return code 0.
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
@viral knot literally this
golden ratio and the other golden ratio
I wouldn't actually bet on this being the fastest
because floating point
it is O(1)
if you want this to be fast, ensure you're on a CPU which implements floating point
this is the main case for why you might want recursion for performance
needing to keep state
the cost comes down to whether it's faster to poke the heap or move the stack pointer
(roughly, terms and conditions may apply)
C/C++/Rust/Zig for performance
ASM for those cases where intrinsics get so ugly that Assembly is more readable
8MB
compilers are good at optimisations
also that list should include Fortran, yes
C and C++ are introducing more and more UB to allow for optimisations
with provenance and others
Rust is better at disambiguating than those two, so can do more optimisations
idk what state of Zig and optimisations is
https://www.cppnow.org
A Deep Dive Into C++ Object Lifetimes - Jonathan Mรผller - C++Now 2024
A C++ program manipulate objects, but it is undefined behavior if you attempt to manipulate them while they are not alive.
So let's do a deep dive into object lifetime.
When are objects created and when are they destroyed?
How does temporary ...
I thought function are also objects
for asymptotically fast Fibonacci numbers you need power function with matrix multiplication
What is the precision of this???
there is a matrix that turns [[fib(n)], [fib(n + 1)]] into [[fib(n + 1)], [fib(n + 2)]],
specifically [[0, 1], [1, 1]];
you need to raise that matrix to power n and then apply it to [[0], [1]], and the first element of the result will be the answer;
that is implemented by breaking it down into calculating power n//2, squaring that, and then multiplying it once more if n%2 is not 0
which is how you calculate fib(1_000_000) in a second
(with big integers)
tail recursion just turns into a goto
you can
just needs to end in return same_function(...)
can only go outside of the function with setjmp/longjmp
which save/restore registers
in strict functional programming, tail recursion
- is a correctness requirement, not an optimisation
- is necessary to implement any otherwise iterative algorithms
so kind of just a different representation of loops
!e
print((lambda: lambda f: lambda: (lambda: lambda x: lambda: f()(x()(x))())()(lambda: lambda x: lambda: f()(x()(x))())())()(lambda: lambda g: lambda: lambda x: lambda: 1 if x() == 0 else x() * g()(lambda: x() - 1)())()(lambda: 100)())
:white_check_mark: Your 3.14 eval job has completed with return code 0.
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
stuff like this
factorial of 100
no loops, no named recursion
manually implementing recursion
no functions referring to themselves by names
it's, like, doing 100 steps * small constant
!e
x = 1
for i in range(1, 101):
x *= i
print(x)
:white_check_mark: Your 3.14 eval job has completed with return code 0.
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
it's, like, a very small example
!e
print((lambda: lambda f: lambda: (lambda: lambda x: lambda: f()(x()(x))())()(lambda: lambda x: lambda: f()(x()(x))())())()(lambda: lambda g: lambda: lambda x: lambda: 1 if x() == 0 else x() * g()(lambda: x() - 1)())()(lambda: 1_000_000)())
:x: Your 3.14 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | print([31m(lambda: lambda f: lambda: (lambda: lambda x: lambda: f()(x()(x))())()(lambda: lambda x: lambda: f()(x()(x))())())()(lambda: lambda g: lambda: lambda x: lambda: 1 if x() == 0 else x() * g()(lambda: x() - 1)())()(lambda: 1_000_000)[0m[1;31m()[0m)
004 | [31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m[1;31m^^[0m
005 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<lambda>[0m
006 | print((lambda: lambda f: lambda: (lambda: lambda x: lambda: f()(x()(x))())()(lambda: lambda x: lambda: f()(x()(x))())())()(lambda: lambda g: lambda: lambda x: lambda: 1 if x() == 0 else x() * [31mg()(lambda: x() - 1)[0m[1;31m()[0m)()(lambda: 1_000_000)
... (truncated - too long, too many lines)
Full output: https://paste.pythondiscord.com/KXPTVDOKRDDAHF3SMVZXILIIAA
as you can see, it does not tail recurse
I don't think you can force tail recursion onto that code in Python without loops
or at least some sort of map + repeat weirdness
!d itertools.repeat
itertools.repeat(object[, times])```
Make an iterator that returns *object* over and over again. Runs indefinitely unless the *times* argument is specified.
Roughly equivalent to...
!e
print(*map(max, map(str.__add__, ["", "", "Fizz"] * 100, ["", "", "", "", "Buzz"] * 100), map(str, range(1, 101))), sep="\n")
:white_check_mark: Your 3.14 eval job has completed with return code 0.
001 | 1
002 | 2
003 | Fizz
004 | 4
005 | Buzz
006 | Fizz
007 | 7
008 | 8
009 | Fizz
010 | Buzz
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/W6ZTER44G3WYCVLVW354UIE72E
yes
drinking game[citation needed]
(quote from wikipedia)
The 3rd one I disagree with. Usually you'd focus on features that you think are useful in your domain. If you're perfecting sth usually I'd bet it's sth others don't have hence the motivation to put in that extra elbow grease.
The 4th one man...the 4th one.
Every hackathon competitor's nightmare.
I remember every time it happened, and every time my heart absolutely sank.
!pypi quick-core
quick/primitives/operator.py and quick/primitives/contraction.py.
Operator represents a quantum gate, Statevector represents your quantum state, contraction.py contains the logic for applying the gates to the state.
That's basically a bare bone, minimal quantum circuit simulator.
You can take that, and just build a circuit IR (basically a list of tuples, where each tuple is a pair of Operator and list[int] where the list[int] is what qubits you want to apply the gate to), and you simulate it.
After that, it's really just how you want your IR to look like, what levels of abstraction you want (for instance, transpilation so you can convert from arbitrary gates to a set of specific gates) and add features.
Circuit IR itself is not hard to make. What usually makes one circuit library better than the other even when both use the same IR is those features and just pure classical performance in how long the code takes to run.
@dry jasper u getting electrecuted?
Beginning the linear algebra series with the basics.
Help fund future projects: https://www.patreon.com/3blue1brown
Music: https://vincerubinetti.bandcamp.com/track/grants-etude
Thanks to Elo Marie Viennot and Ambros Gleixner from HTW Berlin (www.htw-berlin.de) for contributing German translations and dubbing.
Thanks also to these viewers for...
@paper wolf @upper basin
yeah thats the vid i watched the first
sup @amber basin
Good what about you?
just chilling
@latent gorge ๐
Greetings
i was figuring out with a project i have @somber heath
its wasn't big project though
Choppy audio ๐ญ
sounds okay to me
Well MY internet is the issue
Our internet and electric provider are total shit
It's expensive and you getting at average 200ms delay at good day with 5k Ms when the provider decided to mess with people
And we got at average 3 power outage per month
@somber heath i have big problem with myself in coding
that i do hurry for see results
You ask questions here so we can help :D
Problem solving is a skill a programmer need the most
True i always trying to type fast
i have to remember the keys in my mind first
i know a guy expert in programming he's old , and his fingers are messed up i mean he's maybe about 40s
Just remember if you wanna learn something, don't wait for help just start doing it
Not everyone need to follow the way other do
but if u stuck , what about this
If you are stuck and can't progress, ask some help or find something that could help
Like nowadays it's easu to unstuck when you learning something
Almost everything was digitalized and can be find with just one click
im learning from a course , now
Just make sure you are not going into some rabbit hole
Searching is another skill a programmer needs
im trying , and i do search too
Not even a greatest programmer can memorize everything on back of their head
I mean I still search how to print on java.....
Lol
lol ik
Also we got AI now, it's basically a talking google than can respond on your follow-up or more complicated questions
!reminders
expiration
Go to class?
Current project
A.D.R.S
- Automated
- Defense
- Reconsens
- System
explain
It's a fire wall
It's a firewall that if hacked tests the other side firewall and deploys actions against malware that's possible Lee coming through the open link and sends maybe automatic shutdown to the computer
The Transcrypt Python to JavaScript compiler makes it possible to program lean and fast browser applications in Python. Transcrypt applications can use any JavaScript library and can also run on top of Node.js or be used in combination with Django.
@brave sluice my website(sorry for long URL): https://thumbnails-racial-parent-argued.trycloudflare.com/home/
please, for your own accounts' standings' benefit, don't send trycloudflare links
hmmmm i dont think those links is good
@paper wolf you left?
rtc connecting ๐ญ
I'm running gta4 complete edition on ps4 pro linux using
Wine + FusionFix + Various Fixes
@flat herald ๐
Have you ever seen those chod SSDS that are real short
all mine are the long ones
2280
do i gut unmute from chat
@lavish rover https://www.phoronix.com/news/Linux-Kernel-WebAssembly
From my gmail..
Learn how to vibe code like the best
Shpongolese spoken here
@torpid flame ๐
Run KolibriOS, Linux or Windows 98 in your browser
@wise loom But i am not finished. I have many work. I must to create a stable diffusion pictures for my website.
https://copy.sh/v86/ - more sandboxes, no login, obscure os-es, directly emulated in browser, somewhat slow
https://instantworkstation.com/ - different arches and distros, no login
https://distrosea.com/ - sandbox for VMs, no login
https://neverinstall.com/ - cool, allows selecting apps to pre-provision the VM with, multiple distros, haven't tried yet, requires login
https://www.bellard.org/jslinux/ - alpine, win2k, freedos, fedora 33, buildroot
https://win32.run/ - windows xp kindof
https://lrusso.github.io/VirtualXP/VirtualXP.htm - windows xp, for real
Chris
I guess it was the essential phone
I don't remember that name but this is definitely it
looks sci-fi
Hey
360 camera attachment was really cool
nice, 1st time i see a 360 cam
did you check the drama list I sent you ๐
Yeah, I started watching Revenant.
๐
frrrrrr????
AI gives only benefits..
gaming is more expensive because AI uses GPUs
server ram is more expensive because AI uses tons of memory..
hmmmm
I'm adding colours to the splay tree visualisation I'm making
(to see how the recently fetched keys behave)
how are you doing today mindeful dev
don't tempt me to protest-buy it on Steam instead
okay now that this is somewhat done, back to gaming
minimal effort visualisation
Pleasing to look at
Honestly, its already pretty good
it actually does this, just hides all the non-first items in each column
lol i gotta fix my microphone, well what are you guys doin
Downloading Bendy and the Ink machine :)
(there is a book named that)
I don't remember doing anything class-heavy in pygame, it's way too imperative for that to be the central part
and, like, it's not really a game engine, so not centred about life cycles of entities
It's a graph
Cisco?
ยฎ๏ธ GANGSTER CLUB - The music channel mostly includes gangster music, hip-hop, rap, trap, and dope remixes. Hot fresh premieres from the best rappers. ๐ Subscribe and turn on notifications to stay updated with the best music daily.
๐ข Follow our Spotify Playlists: https://spoti.fi/3jTJdl6
๐ต Travis Scott - MY EYES
๐ซ The premiere of...
this image single-handedly discredited entire nixcademy for me
this should have โจ emoji next to it
Who has been Pythoning lately?
single-handedly dogpiling nixcademy there I see
- (contributor list)
reaching myself from nixcademy's website
useless speedrun
it's like those speedruns they do on wikipedia
(picking two pages, getting from one to another in minimal amount of clicks)
@haughty pier if you use any AI, you won't
paying for/using ChatGPT => give up preemptively
if you use AI, you aren't and won't be an expert at Rust
it is, 100%
sending shit like this already qualifies you as one
spoiler: you won't find any
for grammar, it can just copy-paste the reference
reference now even has diagrams for syntax
@wind raptor can i stream?
has anyone ran make all on that?
link me?
working on my os
!stream 1379884144070365367
โ @whole bear can now stream until <t:1762279718:f>.
how's that AI CPU going?
if I understand correctly, -j with anything above 1 will mess up the order there
hmm so after doing some calculation I made it only in math not irl
like I calculate how much core and treats and how much watt it consume how much fast it can run in Ghz
btw I'm not working on how much nm chip and silicon stuffs
doing calculation on cpu planing
@whole bear why snap?
no
btw it's x86 based cpu not arm
wouldn't that get you into legal issues eventually
iirc only amd and intel are allowed to make x86 cpu's
i could be wrong ofc
hmmm idk that really about legal stuffs
damn didn't know that haha
for now I try to build a simple source prototype of my CPU
Cores: 64 (4 ร 16 CCD) | Threads: 128 (SMT2)
Base / Boost: 3.2 GHz / 4.5 GHz
Vector: 512-bit BF16/FP16/FP32 SIMD
AI Tile: 4,096 MACs @ 2.0 GHz (โ16 TOPS peak FP16) (example)
L1/I+D: 64 KB / 64 KB per core | L2: 512 KB per core | L3: 64 MB per CCD (256 MB total)
Memory: 8ร DDR5-6400 (โ409 GB/s)
PCIe: 128 ร Gen5 lanes
TDP: 280โ350 W
Socket: Large LGA (Threadripper style)
OS: x86-64 Linux
a starting source
some random website is ripping people off by selling RISC-V licenses
they might get in trouble for that since they're violating the trademark license (which is a separate thing that can't be bought this way either) by selling something that claims to be directly related to RISC-V
(RISC-V is trademarked, in part to prevent this stuff, but crime is legal now anyway, so who cares)
elastic ML
AI training on demand does sound quite cursed
"we have no idea how much money we're planning to waste on this, because our bosses change their opinion every hour"
shards are the secret sauce in the AI business, you just turn them on and it scaled right up
AI SCALE
write Wolfram instead and pretend it's MatLab
I started using Wolfram only 12 years ago, fun times
Mathematics is an addiction
โ math
โ
meth
yep that's all math ppl and physics ppl
ill be back i need to reboot to Windows
Are you guys working on any projects?
[...]
Hold on I'm getting a call
[..]
Ok I gotta go!
I sometimes just like to hear people talk since I'm Alone most of the time
meshtastic
meanwhile USA: yeah, this sounds like an okay place to deport people to
like i said i'm not as educated to tell about it
for all beginners whom I supervise more directly, I ensure they start using uv from day 1
the frequency bands are different, but the range is the biggest difference. LoRa(meshtastic) is 10-15km range with clear line-of-sight. bluetooth is ~10-20m typically.
regardless of whether a beginner or an expert, for most of the things: same tooling, same workflow
yeahh
Didn't even realize you had an accent
xD
Yu
H
Yuh
Can you guys send me screenshot of some confusing codes I Just wanna see if my friend understand it keke
He's been bragging that he knows how to code
And I should join him
Ty
doy you not code stuff?
I'm curious tho
How much do you guys kake
Make
Per month
start. just watch a python tutorial for basic
I'm thinking if it's worth it to change job
WHAT@mossy cedar
I make like 5kโฌ per month
For cleaning ship's
And maintaining
I pay mortgage tho
What currency is that?
Euro
Not included tax btw
So basically uh if I get rid of tax and mortgage
I still make 1200
Mortgage
Trying to break into this industry right now is pretty hard
What If I just hire you guys
Maybe get deck rating?
For like 1kโฌ per month
rule 9
lmao
Just hypothetical
In any case, technology hiring is in toilet so switching would be difficult
my mom is shundori
there however is a nuance with AI:
it does less work with more people having to be involved
it's not a productivity tool
(unlike with automation in manufacturing industry)
@primal shadow even when America does ban it, corporations don't care
see Uber
what did uber do
Tesla and Uber believe they're above the law
greyball
and that mean..................
@haughty pier 0
exactly 0
to be fair, by definition from Haskell docs, many does include 0
@primal shadow (that is funnier because it, for reasons, can't be used as fertiliser, but some company would still pretend it can)
venture capital: it doesn't have to make sense
love it- hahahaa
and everything else
Tesla don't want to use anything other than cameras
they refuse to use lidar
even the damn cleaning robots use lidar
Tesla only refuse to use lidar just because Musk is an infantile idiot who thinks "humans can drive with just eyes, therefore cars can drive with just cameras, therefore we must not use anything other than cameras"
@primal shadow Uber did the same, but that was years ago
how about this revolutionary idea:
REDUCE CAR COUNT
"bUt ThiS iS uNamEricaN"
trains
Unamerican is all the rage these days
perfect time to jump on it\
the "patriots" are tearing down eveyrthing tha was good about AMerica
Going full 'merica to spite the libs
Didn't need my nose anyways
there was a crazy idea, that, I think, even got implemented:
to avoid taking up parking space, let the empty car loiter around on the roads instead
Craig Fuller, Freight Waves founder and CEO, joins 'The Exchange' to discuss the looming freight recession, why sectors relying on freight have been weaker and much more.
!e
print("Hello Aaron!")
:white_check_mark: Your 3.14 eval job has completed with return code 0.
Hello Aaron!
print("hi")
How ya doing?
trynna figure out how do you put codes in discord
!e
print("hi")
you got it
yes sirr
!e
import sys
print(sys.version)
!e
printf("hi in c too");
:white_check_mark: Your 3.14 JIT-compilation enabled eval job has completed with return code 0.
3.14.0 (main, Oct 14 2025, 03:25:51) [GCC 12.2.0]
does printf even work anymore?
its c
I thought that was a python 2 thing