#voice-chat-text-0
1 messages ยท Page 89 of 1
C++ for embedded sometimes ends up just being C with a little bit different syntax
if Arduino supports it, then fine
Java doesn't allow raw pointers
for something made in Java, I'd probably expect an array-like structure to be implemented there instead of an array
implementing MutableMapping is fun
(list is MutableSequence)
@hoary olive
what's the purpose of that custom array?
numpy does same as C for bool arrays
depending on the usecase, storing bool as a byte can be more or less efficient
elements, not field, I guess
linked lists are faster for some situations too
fancy indexing does suffer though
other operations can be optimised by using np.uint8 explicitly
depends
it has a weird design, not the worst
"steampunk of the programming languages" as bcantrill said
I do like steampunk.
Java has even worse naming scheme
@novel hound ๐
James Gosling created the original JVM with support of goto statements, but then he removed this feature as needless
JVM probably still has gotos inside
just like CLR
Goto (goto, GOTO, GO TO, GoTo, or other case combinations, depending on the programming language) is a statement found in many computer programming languages. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control. The jumped-to locations are usually identified using labels, thou...
it's unstructural
continue is limited
same for break and return
continue, break, and others are bad too but less bad
C# has goto
testing:
for (Integer numbers: arrayNumbers)
if (numbers != 0)
count++;
continue testing;
some languages have continue 2, break 2, iirc
to do that for outer loops
it's better to design your code in such a way that you don't need this
public void add(int number) {
if (count == arrayNumbers.length) {
int[] numbers = java.util.Arrays.copyOf(arrayNumbers, arrayNumbers.length + 1);
numbers[arrayNumbers.length] = number;
arrayNumbers = numbers;
} else {
arrayNumbers[count] = number;
count++;
}
}
addition is O(N^2)
@whole bear ๐
for choice, there are: AbstractList, AbstractSequentialList, ArrayList, AttributeList, CopyOnWriteArrayList, LinkedList, RoleList, RoleUnresolvedList, Stack, Vector
maybe more in newer java
take a look at this class in the standard library:
https://docs.oracle.com/javase/8/docs/api/java/util/Vector.html
roughly what Python's list[T] and C++'s std::vector<T> are
so adding is constant?
on average
or possibly an ArrayList now that i think about it
whee
98 games lost of the last 100
I was thinking on how to write a program to help understand the early game strategy in minesweeper
failed to come up with anything meaningful
to a certain extent, it's possible to calculate mine probability for each cell
first N moves can be just brute forced and the "main lines" can be picked from the result
the early game goal, if simplified, is to open a "0" cell (which often leads to something like a middlegame)
reading something someone else wrote isn't as interesting as coming up with it on my own
I've never read any serious guides on minesweeper
minesweeper.online is aware of more capable algorithms
91.65% 78.22% 40.1%
thanks to selection bias, I was able to achieve 95% 66% 31%
what algo are you using? (math behind it)
idk
I'm not using any algorithm
minesweeper.online's backend does
they improved the algorithm they use at some point
it lead to some difficulty cuts
doesnt Visual studio have it built in?
ALM has UML for typescript
but its a typescript code editor; so only for typescript
questionable, but exists
https://github.com/demike/TsUML2
It's unclear if that's UML 1.0 or UML 2.0
I was only taught UML 2.0.
Now it's called TsUML2 and looks like UML 2.0 to me.
I've heard about UML designers being able to generate code from UML like starUML.
questionable implementation/applicability, I guess
probably fine, but I have neither tested it nor looked at it
as in "I wouldn't recommend because I have no idea what this is"
i presume it doesnt work on visual studio
"good rating, deserved"
(only now noticed this one)
I've seen a place advise against running executables.
how much of discord is peer to peer?
probably not much
I'm not sure the "bad packet => take over the machine" is much of a thing with it
(I may be wrong)
i have worked with discords api, and it sucks
generally they read malformed http headers
application api, bot api, or else?
so like discord servers go boom
I've setup APIs for various things like Discord and Twitch but that's as far as I get.
I was in this server and this dude was sending a bunch of requests to discords api, and messages came with ~20s delay
application as in what Discord call "application"
(Discord generally don't want someone using "or else" option)
what option?
as in API wrapper?
API for setting up bots
the API that Discord executable/Discord website uses
as opposed to publicly documented API
no one wants that, but i mean discord devs suck for letting that happen
hey
I decided I wanted to learn calculus so I watched a lecture series but they haven't even got to the calculus part yet.
3Blue1Brown, by Grant Sanderson, is some combination of math and entertainment, depending on your disposition. The goal is for explanations to be driven by animations and for difficult problems to be made simple with changes in perspective.
For more information, other projects, FAQs, and inquiries see the website: https://www.3blue1brown.com
I'm watching this one: https://www.youtube.com/watch?v=fYyARMqiaag&list=PLF797E961509B4EB5
https://www.patreon.com/ProfessorLeonard
Calculus 1 Lecture 0.1: Lines, Angle of Inclination, and the Distance Formula
@zinc wharf๐
hey BEAN
@analog quarry๐
Hi! Are we all not allowed to speak or am I missing something?
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
It said I was granted access but the channel still says I don't. weird
reconnect
I sometimes get emails in something that's definitely not a human language
(I may find, but unlikely)
"it'd be a little bit surprising to find Australia as a member of North Atlantic Treaty Organization", I guess
the anniversary is on the 24th.
also, Kerbal Space Program 2 release date
That too
I'm waiting for KSP2.
Well, early access.
I saw someone play this game called Red Heart yesterday. Looks a bit bioshocky.
I'm a former professional box opener.
I played a bit of it on PC
Rain World is great
I found the way to get sound was to plug something into the 3.5mm audio jack.
So I could get it working on the USB headphones.
would play it more if the only game I intend on playing wasn't minesweeper
I wasn't using the 3.5mm audio jack for phones
It needed something plugged into that for anything else to work.
My motherboard had Via audio drivers.
This was in 2012/13
"at which point does it stop being a game and just becomes straight up gambling?"
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
my current difficulty record has a win probability of 2.33%
it took 714 games (roughly 14 hours) to get
so my win rate is ~0.14% (which is somewhat lower than 2.33%)
On shortly, running behind today
I played Gameboy Tetris yesterday but got bored pretty quick.
Out of all the old ones, I love the way the Gameboy Tetris' music sounds
Yeah that's the main reason to play it.
Gameboy had great music despite its limitations
I played it on a 49" TV lol
I think I have a photo
wassup hem
We are, most of us, butts with legs.
tetris breaks my brain too much, so I play this instead
Struggling to get a password reset for someone
I'm looking forward to the Tetris movie.
I saw the shorts to that.
what website?
The game you couldnโt put down, the story you couldnโt make up. Tetris streaming March 31 on Apple TV+ https://apple.co/_Tetris_
Taron Egerton stars in a new Apple Original Film inspired by the true story of how one man risked his life to outsmart the KGB and turn Tetris into a worldwide sensation.
Tetris is directed by Jon S. Baird and writte...
Bloomberg. Its one of the accounting programs
they dont have password resets?
It's in a weird place, it's specific to one of the programs, SuperForms
Should be an easy call to their help desk
i was tryina get this external speaker to work didnt work
Honestly, out of all the helpdesks I've dealt with, they are by far the easiest to work with
i have a pioneer with 6 channels
but sound comes from my tv , so gotta go fix that later
also, keyboard that accidentally double-presses the space doesn't exactly mix well with tetris
A pioneer amp?
There might be an optical output on the TV and you'll have to set your TV to optical output only in its audio settings.
ye i dont find any "Audio output" though
Then your TV doesn't have an optical output.
@tight kraken๐
brb gotta turn off my dishwasher
ok, it didnt work
What is the model of your amp?
let me get the manual
XV-DV252
ok let me go ahead and follow the manual, if you got anything let me know
Yo
How dangles it
Sore. I hate the bed at my boss' place
But I'll be home again tonight, so (hopefully) no more sore neck
It hurts to turn my head to the left
It's the mattress
I'm glad you said neck
"ooOOP"
Yeah would make more tension
@polar linden๐
Hello
If you're wondering why you can't talk, check out the #voice-verification channel. That'll tell you what you need to know about the voice gate
Oh that's right it doesn't hyperlink for you does it, Opal
Oh huh
Didn't realize they changed it
Makes sense, in a way
someone too worried about security got their hands on formatting
"No channel for you!"
Check out the Hem(lock no access) channel
That'll tell you what you need to know about not accessing Hem
It's worth watching
I think it holds up
Although David Spade....
@north imp๐
@terse needle How did you learn lambda calculus? Was it in school?
Hi
Hey nowar
Man I really can't stop myself from shortening names...
Yeah I'm looking over the wiki
Ohhhhhhh
Lamb
That's strong
Oh ewe
Right right
Am I the GOAT of puns?
I'm always intimidated impressed with how smart you guys are
History shall tell.
Oh, I thought it was when you belittled a weak male
I never took higher level maths, so it's a lot to wrap my head around
Highest I did was college algebra
Never even did trig
Nope
(where does "higher level maths" start?)
I mean we did that
But not the more advanced stuff
College algebra was just what it was called
@somber heath I appreciated it
It's like.... Uni level algebra
I once again forgot how our maths school program was ordered
I mean we covered those in geometry
I can gather it
It'll just take me a bit longer
You cool with me asking for clarification if I get stuck on this?
Although I guess we do have quite a few functional junkies on staff
Hey LX
"if you try to teach Riemann integral to high school students, their brains will fail" and the example of that
@buoyant basin๐
@buoyant basin Yo
Hello 
hi bro
I hope you are always well, my friend
Excellent
@rugged root if you are interested
Cheers, been meaning to ask about it
@amber raptor Sup
You sound as cheery as ever
I don't sleep at all, my friend
Probably not the most healthy thing
How's your morning been so far, Rab?
Any co-worker frustrations yet?
True, but I am doing a big project
if it's programming and if it takes more than a day to make, sleep will, quite likely, accelerate the process
Dude... it never fails that one of my co-workers - Nanoic is back - will lock themselves out of one of their accounts
One of the sites of the security organization
Ooo, nifty
I'm really tired
I have a suggestion that might help
sleep
Yeah that one
I can't remember if that's approaching or is past the starting to hallucinate point
I think "go now and sleep for 12 hours at least" is a reasonable advice in this case
They'll be more complicated the longer you go without sleep
@civic zephyr Sup
I usually have hallucinations at around ~24h of no sleep
less afterwards
I have to do this, if I don't, I will definitely be hallucinating
@civic zephyr Also, don't take what Charlie yelled at you for to be the word of law
If I could speak I would have chewed him out, but unfortunately I had to do it via text
yeh
how many hours more, do you estimate, it's going to take to finish? (the lower bound)
Perceptual changes rarely make an appearance before 24 h have elapsed. Only after a whole night without sleep do these experiences start making an appearance (Figure โ 3A). After 48 h of sleep deprivation, perceptual distortions and hallucinations are reliably elicited (87.5% cumulative percentage of studies)
Neat
Although they seem to be more consistent around day 3 or 4
2 more days
Yeah sleep
Oh okay just making sure
You're going to end up writing poor quality code otherwise
The only aspect that he was right about was just listening to make sure there's no convo going on when you join. Beyond that, he was just being a prick
Exactly right
I think you found the same paper as me
I'm too lazy to clip
https://youtu.be/30jNsCVLpAE?t=862
overriding not overwriting, I'd say
Oh I see what you're saying
specifically, not shadowing
It should also be noted that you do need to use super() in order to set the attributes of the parent classes
class A:
def method(self):
...
class B(A):
def method(self):
A.method(self) #Calling A.method as a function
#or
super().method()```
super().__init__(*args, **kwargs)
Or the like
I really do like what they've done with the code highlighting colors
@sharp urchin Yo
It's more muted
hello:]
with that wording, I was about to say "is Hemlock joining the hallucination trend too"?
stands out a bit too much
better than normal at least:{}
For something like Discord yeah
Monokai for code highlighting?
Yeah, I use Monokai Pro
same
I like how much they stand out from each other
If we donโt do super and just tried to reference an attribute of the parent class then why wouldnโt that work?
i thought you were implying monokai is a word
sublime text uses it, iirc
I have a good feeling here with you
Monokai is OK
It uses standard Monokai, yeah.
alternative?
Nord, One Dark. Github Theme
Or just use the default theme
@somber heath I'll be honest I missed what you were saying. So I'll just reply with "your mom"
nahh pro is fine for me
It wouldn't set them properly, no
๐
Iโve seen a demonstration where a subclass didnโt have a innit so the parent constructor was intialized
I feel like I'm hallucinating
For that subclass
Either way, it's proper practice to use super() in most cases for Python inheritance. And yeah, that can happen
thats only when constructor isnt there
So Iโm the case letโs say a method isnโt present in the subclass
Then no need to use super()
Example of the Monokai theme I currently have on. Spoilered because it's a large image
So what opal said pretty much in the case of overriding
super() is generally used to inherit the parent class and initalize automatically if needed
on its own
super().__init__ is like "super, isn't it?", but Bri_ish?
If you still need the attributes that the parent class grants, then you'll still - HA that's great - need to do the super().__init__()
its not the standard one though
class Phone:
def __init__(self, price, brand, camera):
print ("Inside phone constructor")
self.__price = price
self.brand = brand
self.camera = camera
def buy(self):
print ("Buying a phone")
class SmartPhone(Phone):
def buy(self):
print ("Buying a smartphone")
# syntax to call parent method
super().buy()
s=SmartPhone(20000, "Apple", 13)
s.buy()```
Although it's not that much different
hope this clears
this code is surprisingly hard to judge
How do you mean?
no variety i presume
formatting and naming doesn't annoy me
I try to write clean code when I can
!e
print(fr'G:\DMS\{1+2}')
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
G:\DMS\3
this is "for real" string
order doesn't matter
so, rFench string
radio frequency string
This is Sublime
Sublime has two ways you can make themes from my experience prior
- You just specify the colors and sublime does the job
- You manually edit it (never done that)
I'm really liking this colour scheme at the moment, particularly the 'mirage' variant: https://github.com/ayu-theme/ayu-colors
@willow lynx Yo
sup lx how was your coffee
Hmm
@rugged root hi
"just embed neovim into VS Code"
I like the contrasting yellow and blue tbh.
The light version is not that great though.
Was gonna say
Odd that light is the only example they have
Yeeeahhhh IDLE's themes are god awful
there's also Wing
which by default only changes the code part instead of the whole IDE
iirc
I may be confusing it with something else
There's a section for IDLE plugins but I don't think I've ever seen them. UNTIL NOW
I wonder how many of these are still relevant
Oh wait what?
There's one that supports Cython syntax
It does look like a handful of these have already been added in
A bit what?
hello..
How's it going
When you absolutely need the whole neighbourhood to know you're playing Tetris.
PFFF god damn it
The Monokai Pro's sublime-color-scheme file (which is a JSON) is all on one line
How did Marty not end up with permanent deafness through the whole series?
Like, complete and total?
McFly?
Yeah.
I legit didn't know that was a gif
Right?
Did he pass?
That's unfortunate
It's been a looooong time since I've seen it
I might have the box set, actually....
I'm not sorry
I would be impressed if they were alive by then
He just knew, Opal
He just knew
@whole bear Hello/goodbye
Oh
Oh no
Nooooooo
God damn it
I hate YAML
hi
what? whats wrong with yaml? other then the huge loading time
Like, so many things lol
The adjuster came and went yesterday, so that's all done. The folks in the office next to us (part of the building we own and one of the folks who also suffered water damage) is getting a new desk so I'll be snagging that in the mean time while waiting for cubicle walls and what not
So in theory, end of the week?
It had the potential to be good, but there are so many quirks, complications, and gotchas.
But still not to the point I'll be happy with
I hate it
Give me regular JSON or TOML any day of the week
StrictYAML might be ok: https://hitchdev.com/strictyaml/
Although I don't think it's widely known.
What's up
eh.. my limited exp with seems ok so far, used as config and data.. but then the scripts i use it for give a structure to follow.. so not much exp beyound that..
Indifferent
Just sad ๐
Erm, it depends really yeah.
I'm sorry
@past oar It's an indifferent thing. A lot of languages have type inference anymore
So you may not have to declare type anyway
They still need to know how to handle types in Python
Dynamic typing is great for development speed early on, but as the software gets more complex, and more developers get involved, the benefits of static typing become apparent.
Yarp
@past oar are you aware that python has optional static typing?
That's not a hallucination thing
You can code Python the same way you would code a static language
Mostly for communicating between developers, and statically verifying type correctness.
Wait LX, do you mean the built in typeguard?
Python is
๐ multi-paradigm ๐ 
Word
Not sure what you're referring to sorry 
Hold on... second guessing myself, one sec
(that was purely because of grammar/wording, almost just as in the first case)
You just add this to the curriculum
time to check pylanced.py
still broken
Oh right sorry, I just mean checking types with Mypy or Pyright.
contravariance + tuple covariance => broken Pylance
Yeah you can create a function which is type guard, meaning that function can be understood by static type checkers.
Python Enhancement Proposals (PEPs)
One variable, one type, one purpose
Yes
Python does not require any kind of internet connection
So long as you have a version of Python on there
Then yes, it'll work
There is no hard requirement for an internet connection
@past oar
Thonny?
Mu-Editor
IDEs may be unhappy
"who cares about IDEs just write code in ed"
I'm confused what you mean
Thumb drive
I too shall dongle
Or just have access to the docs. Actually does Python come with the docs?
I think it might...
The windows machines are easy
IDEs should be used. text editors aren't enough for effective learning.
debuggers are important. auto-completion is (sometimes) a benefit too.
Just get an installer for something like Thonny or Mu-Editor which comes with their own Python version
Or that
Opal lives in the computer stone ages
If it works it works
2008
The year I graduated high school
Dude, there are computers from the 80's that still work
Don't be surprised
!e
import os
print(os.system("man python"))
Maybe I'm thinking rust
@hoary olive :white_check_mark: Your 3.11 eval job has completed with return code 0.
32512
@past oar How old are you again?
Not necessarily
Some just work
Again
This is 2008
Different system demands
4 is ok
SOMA
what an amazing game
(might have misheard what got mentioned)
windows 11 runs on xmb of ram
SOMA is great
says 4GB RAM required
phones dont require that much ram
Do you use a flash drive to use... what was it... ReadyBoost?
Opal whats your CPU?
with nothing open, phones seem to use 50% RAM, I guess
You mean using your Flash for mem?
its a windows feature
It was an option on Windows 7 and higher
pushing the usage by running stuff in termux is fun
You just plug it in, and turn it on
Read here how you use a USB flash drive or a SD card in Windows 7 for Windows ReadyBoost.
On Windows it's ReadyBoost, yeah
minimal Windows version: Vista
Ah forgot it was vista
Wasn't a terrible option
i barely use any swap myself i highly doubt it being that useful
"everything can have a file handle not everything is a file" or something
i knew this guy that had 20GB of swap
I have the swap file on Windows limited to 16GB, iirc
Or PageMemory I think?
Vram
Dram is standard
Vram does way more operations slower
meanwhile linux, only 31M of swap used:
Right
They use VRAM for crypto
And a gpu
-rolls eyes- here we go
so that many more cores, and more processes , but slower
I didn't configure docker to use it, so, eh, predictable
Uggghhhhh I don't want to listen to another OS war/Windows bashing system
It's exhausting
LVM, BTRFS, Ext3, ZFS etc...
didnt dell make a linux laptop?
Do computing stores like that still exit? 
Mint for sure
Ubuntu, probably.
Linux is a very very very very very tiny part of the market for home computers
I literally haven't been to one in like 10 years.
It's not as well known, not as intuitive, not as regular user friendly
Joyent had laptops with Solaris installed (rare) stolen twice
now there's a legend about a thief who targets Solaris laptops specifically
There isn't as much support out there for it
Not as many programs support it
I could go on
It's not good for normal users
Meh
If you want a laptop with touch buttons and Linux, this is it
yep NTFS by default
NTFS is faster than FAT32
so its a good file system
Good but not as globally compatible
@past oar You just answered your question as to why you don't see linux machines in stores
low hanging bar?
what :?
The folks who know and want linux are power users
"Globally compatible?"
FAT32 is readable on damn near everything
NTFS not as much
Updating firmware on a printer? FAT32
Moving files from Windows to Linux and back again?
Ye thats why ppl flash drivers as FAT32
Flash != HDD
Although exFAT is getting more - I know
However, Linux struggles to deal with NTFS out of the box
I doubt you can do NTFS on a flash
You can
Provided you have a large one
@somber heath I've seen it support reading but not writing
Who uses linux with ntfs .....
My use case was extracting files from a dying hard drive that Windows would open but I could with Linux
It was NTFS
Depends on the load
*would not
When you boot it up it does that?
ive heard recuva or hbcd is good for recovering windows drives
It wasn't even recognizing that there was a drive
Thankfully I have Manjaro installed (properly installed, not a live USB) on a flash drive for situations like that
And Manjaro specifically because of hardware compatibility
It just works
Could you say when it does that , and what brand you GPU is? Mjzo
i recently bought a handful of usbs for students to test drive different distros
yes but with some basic hardware and programming knowledge
You're going to have a much harder time selling that
All the programs that normal folks would use already have Windows installs
Unlikely they'll have Linux ones
I think with the sheer amount of support and knowledge base that's out there, and how commonly exposed they are to Windows or Mac, unless they're really interested, it feels pointless to try and get them on Linux
Now, I do have an exception
aight gonna head out guys, enjoy your day
If someone really only browses the web and needs a simple cheap machine, absolutely
Later Phantom
cyber sec?
@lavish rover Hey buddy
Hanging in there. You?
wish I was
At least I figured out how not to rebuild 11k files
goofy ass build system
Need to start a docker shell and use this script they have to build
Just would have never guessed
The usual way to build anything at Amazon is using our central build system called brazil
Except this one project apparently
It builds only what's necessary so not more than a minute
Nifty
Lots of red balloons
Is that all?
HA
Wrong Rust
It was a joke
I'm not admin anymore
@blazing sinew Is the card still under warranty?
it's not like I was actually serious
i keep wanting to go outside.. but i cant even get the pets togo.. below 10f atm..
Sup
was taking a nap, nothing else besides work todo.. and well.. they dont respect my hours so.. anyways why cats such pricks when they find you taking a nap.. wake you up curely.. you get up and they just go take a nap..
imagines - an array of sleeping cat based heating elements to power ? it could be done....
As soon as they realized they were being useful they would leave
Don't respect your hours in what way?
i generally work 3am to 1pm, breaks, lunch, 1hr workout included... and they constantly call me during business hours and even after.. often when im not even oncall upto 9pm
Bruh linux isn't for the programs that normal folks use
windows registry is a fucking nightmare
linux kernel is just superior
Cool, I don't care
I'm not getting dragged into another one of these convos
It's exhausting
Yes, but we got a really good deal on the enterprise windows plan, so we arenโt going to give it up because the sunken cost fallacy
from sklearn.tree import DecisionTreeRegressor
unlike the English Wiktionary, simple English Wiktionary has the pronunciation of "cellular"
syntax isn't that much important to understanding the code after some level of general knowledge
except for very weird languages
@valid night๐
@whole bear
deep learning is a subset of machine learning, so it's kind of semantically impossible to learn deep learning before machine learning
makes sense
is Australian variant of Emo called Emu?
"ethics are important for programming, Uber"
I don't understand what "sentience" means
I understand the obvious difference with most of the current popular text AIs:
it doesn't think if you don't talk to it
(no background process)
like, if ChatGPT answers your question, it can't on its own decide "oh, I answered wrongly, here's a correction" without user prompting for it
the model that GPT aims to replicate isn't fit for that
this seems to be for people who already work with most of it
@wintry mulch๐
h
I still have a (relatively useless) pdf on trying to understand formal requirements for hash functions
in short, if you can invert a composition of two hash functions, you can invert one of that hash functions too
because composing the other hash function with the algorithm to reverse the composition gives the necessary algorithm
the paper itself talks more about frequencies in other situations
@grave idol๐
there's like, the thing about hash functions needing to produce the same (frequency-wise) outputs on different input subsets
elliptic curves aren't used much on practice
Edwards curves are easier to compute
those two types are isomorphic
"isomorphic" meaning "equivalent" with regards to some structure
group structure in this case
topology has isomorphisms too
- invalid SQL
- this is not f-string
- don't do this, you're risking an SQL injection
?
????
fmt.format()

red error is because this is invalid SQL
it doesn't know you use format later
so pycharm is dumb?
or am I
?
all types of topology, I'd say
isomorphisms are quite fundamental
neither
that sounds too complicated
SQLAlchemy?
well it doesn't shout at me for this
Postgres
where does __tablename__ come from?
hi can someone please help me understand wha ti am doing wrong
self.table
i've searched all over google and even chatgpt and nothing has helped
im trying to run a tkinter program
this is my specific issue
This doesn't appear to be a Python traceback message. This looks like something is throwing a bit of a wobbly.
Like Python itself, rather than the code and Python going, "okay, here's what happened"
Pasting large amounts of code
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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
however, when i try to instantiate a class before calling that function
yes for sure
one second
apologies for the wonky formatting, i copy pasted multiple modules into a single file
but my concern is mainly with the HorizontalDistancePrompt method under the Display() class (bottom part of the code)
!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:
This isn't what's causing the problem.
But have a look at it and bookmark it, anyway.
my capitalisation
See: Naming conventions.
yes
Yes.
yes i am aware of that issue too haha thanks tho
Is this in a form I can run, directly?
also this method runs fine on its own
yes
should be
wait no u dont have the
video files tho
Ah.
cuz it uses opencv
i can send the video file if that's allowed?
it's a 1 second video lol
You'll have difficulty.
I don't know what might cause the problem. My guess is OpenCV.
hmm
try to reduce code to the minimal size where it causes the problem
something that doesnt sit right w me is the fact that the method runs perfectly fine when it is isolated in a file of its own
Or use a different version of the framework. Maybe update it.
how do i do that haha sorry im rly bad at this
hmm yeah i could do that
mac
pip3
Python.
Okay, then python3 -m pip install --upgrade pip
Check what version of Python that's pointing to, too.
Check that it's compatible with opencv
from there python3 -m pip install <packagename> --upgrade
venv aliases python to python3
(if it's used and activated)
Where <packagename> is opencv or whatever
ah
You might like to try to upgrade scipy while you're at it
there's opencv-python
first time finding this:
https://github.com/pypa/manylinux
(was referenced in opencv-python)
its docker image comes with gfortran installed
hello is anybody there?
@arctic dome check u dms pls
Hey could u help me?
im currently writing something called wwm i uses a mix of autohotkey/python.
im not a programmer i just have basics.
with what?
i installed python and if i enter in cmd the python --version i become a failed message
@stray swan
hmm can you purge python ? by that i mean uninstalling it completely.
then you can just use scoop package manager to install it
i did but still not working
scoop will autoadd your installed apps to your path
I writed u dm
can you check that no traces of python left on your pc?
ye
ok
ah i think opencv is the issue
the error occurs when i try to instantiate this class
but idk how to fix it ugh
@somber heath hi sorry for the ping but i think i have found the problem
from Display import *
import cv2
import numpy as np
# Define the range of green color in HSV format
green_lower = np.array([40, 50, 50])
green_upper = np.array([80, 255, 255])
# Read the video file
cap = cv2.VideoCapture('videos/trim1.MOV')
# Loop through each frame of the video
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
# Convert the frame from RGB to HSV color space
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
# Apply the green color threshold to the HSV image
mask = cv2.inRange(hsv, green_lower, green_upper)
# Perform morphological operations to remove noise and fill gaps
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5, 5))
mask = cv2.erode(mask, kernel, iterations=2)
mask = cv2.dilate(mask, kernel, iterations=2)
# Find contours in the binary image
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
# Loop through each contour and filter based on size and shape
for cnt in contours:
area = cv2.contourArea(cnt)
if area > 500: # adjust the area threshold based on your specific case
perimeter = cv2.arcLength(cnt, True)
approx = cv2.approxPolyDP(cnt, 0.03 * perimeter, True)
if len(approx) >= 8:
# Draw a bounding box around the detected ball
x, y, w, h = cv2.boundingRect(cnt)
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
# Display the video with the bounding box overlayed on each frame
cv2.imshow('green ball detection', frame)
if cv2.waitKey(1) == ord('q'):
break
# Release the video capture and destroy all windows
cap.release()
cv2.destroyAllWindows()
display = Display()
display.HorizontalDistancePrompt(6, 5, 10)
this code here
it uses opencv to play a video
then it runs the tkinter gui code
and it gives the same error
which confirms my suspicions that the opencv video display is causing it
i am not sure on how to fix this issue. does it have anything to do with opencv's compatibility with tkinter?
this code isnt from the previous huge chunk of program. i just created a random one which displays a random video using opencv and then trying to display a tkinter gui
yeah same issue
ah yes. tysm for the help tho
tkinter is a pain in zeee bum ... havent used for years but when i did i remember it being longwinded and not well documented (but im going back a long time)
my device just canโt run to tkinter after running opencv
lemme show u another example code ( a very short runnable one) that wonโt run on my mac
after running or after importing?
but it executed perfectly on my friendโs windows
import cv2
import numpy as np
# Define the range of green color in HSV format
green_lower = np.array([40, 50, 50])
green_upper = np.array([80, 255, 255])
# Read the video file
cap = cv2.VideoCapture('videos/trim1.MOV')
# Loop through each frame of the video
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
# Convert the frame from RGB to HSV color space
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
# Apply the green color threshold to the HSV image
mask = cv2.inRange(hsv, green_lower, green_upper)
# Perform morphological operations to remove noise and fill gaps
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5, 5))
mask = cv2.erode(mask, kernel, iterations=2)
mask = cv2.dilate(mask, kernel, iterations=2)
# Find contours in the binary image
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
# Loop through each contour and filter based on size and shape
for cnt in contours:
area = cv2.contourArea(cnt)
if area > 500: # adjust the area threshold based on your specific case
perimeter = cv2.arcLength(cnt, True)
approx = cv2.approxPolyDP(cnt, 0.03 * perimeter, True)
if len(approx) >= 8:
# Draw a bounding box around the detected ball
x, y, w, h = cv2.boundingRect(cnt)
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
# Display the video with the bounding box overlayed on each frame
cv2.imshow('green ball detection', frame)
if cv2.waitKey(1) == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
import tkinter as tk
window = tk.Tk()
window.title("My Program")
label = tk.Label(window, text="Welcome to my program!")
label.pack()
button = tk.Button(window, text="Click me!")
button.pack()
window.mainloop()
midway running
this code wonโt run for me but it runs on windows???
i donโt even know anymore ๐
echidna
what
(response to Kirti)
oh
so, it crashes during window.mainloop()?
The platypus (Ornithorhynchus anatinus), sometimes referred to as the duck-billed platypus, is a semiaquatic, egg-laying mammal endemic to eastern Australia, including Tasmania. The platypus is the sole living representative or monotypic taxon of its family (Ornithorhynchidae) and genus (Ornithorhynchus), though a number of related species appe...
and the error is thrown
Echidnas (), sometimes known as spiny anteaters, are quill-covered monotremes (egg-laying mammals) belonging to the family Tachyglossidae . The four extant species of echidnas and the platypus are the only living mammals that lay eggs and the only surviving members of the order Monotremata. The diet of some species consists of ants and termites,...
can you run it in a debugger or add prints to determine when the error happens?
the error may be happening in the import tkinter as tk
or even earlier (what would mean that tkinter isn't an issue)
yea good idea iโll try that
yup it works perfectly fine
same goes for opencv as well
stand-alone opencv works
but together is no go
hmm
tk also uses its own language (tcl) to some extent
hey AF did you code in C++ for the competitive programming which you mentioned earlier?
or used python?
only
yes, because C++ is de facto the main language for most of competitive programming where I participated
as either ways i am learning algos so i was thinking to go in cp....what do you say??
ohh ok
@lusty fjord ๐
good morning guys
ye ?
bye bye
for most cases, only C++ and Rust provide the necessary combination of program speed and programming speed
Igorrr?
ahh
so me knowing only C and python should focus on more learning
I watched it recently
Igor is a 2008 computer-animated horror comedy film directed by Tony Leondis from a screenplay by Chris McKenna. Igor, developed and produced by Max Howard with the California-based Exodus Film Group, was the first feature-length animated film to be financed with private equity. The animation was completed at France's Sparx Animation Studios and...
perhaps rust
@somber heath why u ping me
if you can learn and use Rust for it, use Rust instead of C++
just greeting
Rust has a difficult thing with lifetimes
but for most simple architectures (ones more likely to be present in algorithmic problems) it won't cause much issues
they claim tht knowing python with the adequate knowledge should do it
Python for speed relies on libraries written in C, C++, Fortran, etc.
Rust for dynamic programming problems isn't in any way more difficult than C++
for working with vectors (lists in python) it's way easier
same for dictionaries
c++ is easier than java?
depends on what you write
agree
generally, no
it's messier and more syntax heavy
why does industries use python much then?
if it isnt the fastest lang out there
in fact slow many times
implement?
heavy tasks aren't written in python
is that what they require in industries?
numpy uses C or something
good to know
i just started to learn java
i agree
but i always thought they needed speed in there
which made me question the usage of python
but i get it
hmmm
makes sense
out of that kind of languages, I'd probably go with Rust or .NET (Core) C#
C++++
sadly, most of my C# code is for Framework not Core
for backend?
in what sense "backend"?
>++++++++[<+++++++++>-]<.>++++[<+++++++>-]<+.+++++++..+++.>>++++++[<+++++++>-]<+ +.------------.>++++++[<+++++++++>-]<+.<.+++.------.--------.>>>++++[<++++++++>- ]<+.
:{
C# has quite good UI libraries too