#ot1-perplexing-regexing
1 messages ยท Page 433 of 1
i feel like the flux i was talking about is dif than your electric flux
@twilit hull i felt that in the beginning itself
the flux i was talking about was just integrating once for area
then if you integrate over area you get volume
per unit time
welp i wont be much help lol
if you show the pic i might figure something outlol
but most likely not

I'll show you the figure
dank
wat is the def for flux in this case?
the volume that pass through that weird thing per unit time?
it is
In principle, to find the net flux through the surface
it would be just the surface area itself right?
since unit time we just times that area by 1
when did i talk about time?
so its just the surface area itself?
It is understood
why not just call it surface area

oh wait i get it now
cuz flux is surface area with directions
omg
this should be illegal
i just saw the those vectors representing those flux
so liek maybe its not simply adding up to get area
but its adding up unit flux in each unit area with directions
yeah
this is insane how do you even
generally you dont have this complex shapes
how do you even represent this weird plane with funcs lol
As I said, this is just beginning
can we delete physics
so, that was like an example just to motivate you
the general problems are like cylinder, cube etc
can we delete physics
@twilit hull lol
ohh so you could rep them with 2d planes smart
Yeah
wait no actually if they are not orthogonal to the arrows
wait it doesnt matter cuz the angles cancel out
the first one is flux
its just projecting the flux over to the area
Yeah
the \delta phi is the flux on that unit surface i think
electric field is a vector quantity
which is the projection of the OG arrows onto that unit area
with angle \theta
idk man im just noob welp
and im assuming you just sum all the $$\delta phi$$ to get the total flux?
hum its just the name is misleading i feel like
if you call it projected surface area eletric field or soemthing lol
yeah lol
projected surface area eletric field-seriously?
lol i feel like thats just what it is tho
just electric flux
lol
liek all the kool guys use acronyms
What?
i was memeing lol
no longer a senior lol
also i think we should be PC about it and call it n-th year

PC?
lol not really just some peeps do that lol
Nice talk
exactly. but,shh
lol
I know there's a few modders here
I am starting to get reeeeeeeeally tired of how toxic the minecraft forge project is
In what way?
I think this gist that a prominent modder made outlines it well, but https://gist.github.com/jellysquid3/8b68b81a5e48462f8690284a0a3c89a1
there's very much an air of "I have to be correct, I don't have to be nice"
like classic torvalds
of course they're often not correct either
I got yelled at for refusing to shut up about coremodding once because I asked how to do something without coremodding haha
Yeah that's a massive tl;dr
it's years and years of bs tbh
I'm glad fabric is a thing (as an alternative to forge) and their community isn't toxic
hopefully I get to move to it someday
they've managed to make Sky go even more of a bad app
Has anyone done any PDF generation with Python? I need to generate a summary type thing, and I can see a few different ways of doing it - not sure on exactly the best way
Pretty much just a bunch of tables and colours
easiest way to me seems to be Jinja+HTML+Something to turn HTML into a PDF
That would be my suggestion, honestly. Working directly with PDF is an absolute bear in most cases
Where as things that print to PDF files are great
report lab is pretty good
I'm just heavily bitter towards pdfs
is an Excel plugin
in React
I'm not sure if your experience should push me towards it or pull me away from it
This is for work?
yeah
If everyone is using Office 365 or the latest Office then it's not a terrible choice.
If you're using only Windows machines and copies of office then I'd steer you towards VSTO
But using Excel as an interface isn't necessarily a bad idea
The only reason I had so much trouble with the Office.js stuff was because I was woefully unprepared
Also, if you are in Office365, there is Excel REST API
Even non-365 uses that, but you can't easily guarantee your on-prem versions will have what you need, not easily at least.
REST API?
But I can certainly help clarify a bunch of the BS I went through if that's the path you decide to take, Charlie
Yeah
TIL
you could also build summary webpage as well
nah - my manager doesn't want a dashboard
well - this is just presenting information
Email is worse
Options are generating PDF (i don't mind), generating static Excel (i'm not a fan), or actually interfacing with Excel (almost certainly a terrible choice, but it appeals to me on a stupid level)
and I think the Excel thing is just a bad idea
I have 2 weeks
My gut says you're going to have a less terrible time - yeah, go for the first
and too many problems lie in that direction
Although you'd probably have an easier time of it than I did
There were lots of limitations that bound my hands
The biggest one being that I had to have a solution that worked even when not connected to the office network or the internet in general
Now having said that, I think option 1 is going to be the least painful
I think I'd face different but time consuming restraints
i.e infosec being terrible here
Fo sho
Are people going to want data from this PDF?
because that's the part I see being problematic
Good point
Well - the people using it are business people
but some might want Excel
then to aggregate it themselves
Are you in Office365?
Something in the back of my head tells me that you can convert HTML tables to Excel
Yeah, I think so
There is also PowerBI
there's openpyxl for working with Excel for Python
where you just dump raw data on it's head and be like, unfuck it cloud
and it looks pretty neat
It is, honestly
No
I dunno - I'm just collating like 3 APIs into one thing
If you're going to integrate with Excel, you'll want to do it the way they dictate
Unless all that matters is getting the data from point a to point b
The Microsoft Graph explorer is a tool that lets you make requests and see responses against the Microsoft Graph
what the fuck is that
Something to note, I only really touched creating a Taskpane for the add-in
Graph
Oh dude
how do I get a graph? I want a graph
That's dope as fuck
I don't want to do bloody LDAP
Microsoft REST API for interacting with all the Office365 cloud stuff
LDAP can get in the bin
Little Ducks and Ponies
i'm using LDAP right now to go from name --> email
but apparently not everyone is on O365 for some bizarre reason
so it doesn't matter and this isn't a solution - needs to support Office 2016
so
screw that
OpenPyxl
๐คฆ
Doesn't seem like a problem if it's just aggregating and dumping the data to Excel
Hell, could use Pandas to organize as need be
I think
Maybe
That's not really my area
god I hate pandas
but yeah
making a dataframe isn't too hard
but god is pandas terrible software
How so?
The options it gives you for manipulating data are just atrocious compared to equivalents in R or in normal Spark. The API is not near as intuitive as it could be
some things just make 0 sense
like kwargs that can't be passed down through functions
despite the fact they should be able to be passed down through functions
Fair enough. Closest I ever got to it was numpy
And that was only for Advent of Code
don't get me wrong - Pandas is by far the best way of working with CSV/excel/numpyish data in Python (that I know of)
but it's bad compared to what you'd expect coming from better parts of the python ecosystem (or a better language for this stuff)
Fair
Would the folks getting the Excel output expect anything special? Like any formulas calculating certain columns or what have you?
Or would they just want the data well organized
Saves you some effort at least
nevermind the in fact
There is also getting them data
I just give people csvs, haha
I think my favorite thing about pandas is the ability to pull data from a sql and almost immediately save it to a csv to give to someone who isn't as database-capable. It's been SO useful this test series
so it needs some degree of formatting
Yeah, my workflow is generally numpy -> pandas -> sql database
But I make csvs for people for quick checking of stuff
Like "Hey what's the output for that step of your program?" I'd rather just quickly write the code to gen a csv
csv's really are useful
For the longest time I didn't understand quite how they worked
Like I thought they were only one line and didn't contain any newline characters
No idea why I thought that
They're useful to give to programmers since you can parse a csv in pretty much any language
i made a typing game hack cuz i was bored :\
good job
this is no cooldown mode
speed
Bleh
Company I just interviewed with probably won't be a good fit because it's on the eastern coast
east coast*
and they want people to have meetings on their time zone
and they like daily 9 am meetings >.>
9 AM sounds soooo east coast
meetings are dumb
it's probably standup meetings
literally most of the time spent in meetings are spent pretending to do work
West Coast Companies I've dealt with generally are fine if nothing starts before 10AM
my company is awesome enough not to start before 1030
like my G Suite working hours are 1030 -> 1730
7 hours
and meetings are pretending to do wokr
but I'm paid for 8 hours, I don't care how I spend it
My daily meetings range from 15 seconds to 15 minutes
Gotta love the "Should have been an email" meetings
I really wish instead of doing 9-5, you just had to log roughly 40hours a week
or X hours
because - I'd much rather work 7-10 and 17-22 than 9-5
damn 17-22
f u c k a f t e r n o o n s
FFFFFFFF
Lol, at my org everyone pretty well assumes the day starts at 7am. We frequently have 8am meetings
Fuck that noise
(human-operated color bot)
#FFFFFFFF
#FF00FF
I only complain if we have meetings before 7:30am... but mostly because I struggle waking up before 6:30 am
(human-operated color bot)
#FF00FF
8 am meetings wow
But having a 7-3 workday is pretty nice in the summer
Honestly I'm comfortable working 10 am to 10 pm
i like 9 am to any time personally
I mean like, not all those hours, but maybe have random breaks thrown around in there
Telling my developers you have 8Am meeting.
๐๏ธ
Some people get in at 6am. I've have requests for 7:00am meetings and I literally just laugh at that
Telling me that.
๐๏ธ
I mean sure if you need to have a meeting at that time because everything is on fire
i could probably do that because i generally wake up early but i would be angry if it were earlier
Or you're okay with me not retaining any information disclosed at that meeting
That's one thing, but daily/regular meetings? Screw that
Thatโs not a meeting, thatโs a party at 
oh no, these are just regular meetings. Like project updates, reviewing procedures before testing for the day
๐ฅ๐ฅ๐ฅ๐ฅ๐ฅ๐ฅ
๐ฅmeeting time๐ฅ
๐ฅ๐ฅ๐ฅ๐ฅ๐ฅ๐ฅ
in completely unrelated news
the Twins have loaded the bases again
We fixed socket upgrades ๐
๐
I do not miss dealing with that shit
pirates walked max kepler three times today
(human-operated color bot)
Shutting down, @ @rancid forge with a color value to start the service
apparently discord gives tips now in the EAP build
i killed the chat
@rugged geyser I saw that you had asked earlier about making command line tools and that someone helped you with this in a help session, though I have a different approach
let me know if you'd like to go over it
@frozen crane yeah sure I was thinking of just using click + setup tools to create the python cli
please open a help session and ping me and we can talk about it.
sure
test
test
btw this is why nobody except the most dedicated learns haskell https://wiki.haskell.org/State_Monad
@autumn night I've learnt the hard way that sometimes it's just easier to accept types as is rather than dwell on trivial examples and/or analogies
No regerts tho 
heh, it was more just the fact that the doc is incredibly dense
or howto or wiki page or w/e
Yeah there's no real structure to it really
every semi-official haskell document seems to assume you're fully familiar with the rest of the language
there's no good starting point in the official docs
you have to look elsewhere
i guess that's true for python, but less so
the big problem for python is that not enough stuff is cross-linked in the docs, like the definition of an "iterable"
which makes them hard to read
You're hard to read
(Because we're communicating online and I can't see your facial expressions)
i'm also a salt rock
it's hard to communicate with humans irl
pretty different cultures
I'm bad at communicating online and offline
i never understand
see
then its silence
๐
Online communication takes more time than offline
but the tradeoff is you have more time to think out what you're going to say
yes i'm working on it 
Isn't that just a lemon juice stand?
What why?
Multiple games interpreted lemons as weapons
When life gives you lemons...
Squeeze them on your keyboard
I'LL HAVE MY ENGINEERS INVENT A COMBUSTIBLE LEMON! SO I CAN BURN YOUR HOUSE DOWN! WITH LEMONS!
trust me i am a engineer
ah yes, my boutique
now give me pgp gui in .deb type
I'LL HAVE MY ENGINEERS INVENT A COMBUSTIBLE LEMON! SO I CAN BURN YOUR HOUSE DOWN! WITH LEMONS!
@floral viper don't forget the manager
dont trust me the lemon write a tool tthat broke pgp so i kill the lemon
The pgp is a lie anyway
Woo I fixed it
So you know when your computer is being all slow and shit
And you decide to close some stuff down
But then it won't close down, so you open up the terminal to kill it
But you accidentally copy the wrong PID and end up killing Xorg
htop to the rescue!
I had to turn it off because it was all broken n stuff
But then when I turned it on it froze whenever I tried to login
So then I spend my whole morning trying to get it working
And it's working!
(although I'm pretty sure it will break again if I turn it off, so I'm sort of scared to turn it off now)
It'll be fiiiiiine
sounds like time to not fix it
because then you'll spend time not fixing it than fixing it
Sounds like time to invest in a proper backup strategy then lol
Although to be fair I feel I learnt quite a lot by trying to fix it
I still don't really know what the problem was. Well, the problem was that it wasn't working, but I don't know the details
"Probably all the fire I put on it, honestly."
Bleh, well this is a good sign.
Only just now taking my morning meds
Stupid printers taking up time
Right but then I can't have the cool deigns on them that I want
Huh. Well, the fire probably isn't helping that.
Or the carcinogens
ahhhh
love that generic error
lp0 on fire
a genuine unix error message for printers
But seriously, the first thing I got greeted with this morning was a printer that was printing out solid black pages
you sure it wasn't just doing that instagram blackout thing
This is why people shouldn't change toner other than me
and you're just crushing a political movement?
But seriously, the first thing I got greeted with this morning was a printer that was printing out solid black pages
@plucky ridge excuse me it's doing what now
Political movements don't usually go hand in hand with daily payroll reports
solid black pages usually means an idiot put the toner in
I did 2 cleaning pages, still getting horizontal bars
So something is still fucked
And I swapped the cart
Eh, I mean paper and toner is so cheap (relatively) that it's not as big of a deal
You can waste a couple hundred and it really wouldn't make that much of a dent
but think of the trees 
And since our shred goes to a recycling company, I don't feel super terrible about it
More annoyed, honestly
It's more the ink mafia than anything else
consumer cartridges are a massive fraud
yeah, i believe in the U.S. there was a lawsuit over it
can't remember how it turned out
when a cartridge can just be reloaded with ink and you're intentionally flipping bits in the firmware to say "don't use this" then fuuuuck you.
Oh yeah, consumer carts are dumb
Business ones are slightly better
Well, for toner at least
But they're such complex machines that if one thing goes the whole thing is shot
Although that has been moderately rectified by having a lot of those complex parts in the toner cartridge, but then that ups the cost and yaddah yaddah
I'm mainly salty that HP doesn't have any metal fuser rollers anymore
It's all the film
And considering we've had fusers literally shred themselves in multiple machines, it gets old reeeaaalllly quick
But then the trade off is that the film ones heat up faster so there's less time from clicking print to picking up your page but like...
Sorry, I'm rambling about the most boring thing in the world
I'm just imagining you as a Borrower just wandering through one
or reading a 2000 page service manual to see if i could bypass the ink detection mechanism
If we didn't have contracts with a printer maintenance firm and someone who comes in and replaces our toner carts, I might have looked into it
But the maintenance is far more useful in my eyes
hint: you can but you have 4 arrow keys and an okay button and it's like +20 menus deep in the secret service mode boot method
Which is usually locked
Oh, cool thing
We actually have a printer/scanner big ass thing that has a keyboard
Just pulls out from under the screen
yeah, you just have to get inside and find the "reset to real factory defaults" jumper
oh that is cool
Yeah pretty sure that'd void our contract like
Instantly
Not going to be held responsible for that one.
i was working for a school when i did that. they outright owned the machine but obviously didn't have any printer experts and weren't going to pay for none
"look, i can see it. there is clearly toner in there!"
"yes, but it wont print if it's below X level because it might not produce good results."
"don't care. make it work."
Also potentially for mechanical safety
Although that's less often the case
And with our prints, we need to have good quality
But yeah, schools are always on a tighter budget
So that makes 100% sense to me
When I worked for SKDP the printer had like an entire reservoir
this bigass separate thing for waste toner
it'd fill up and then we'd have to wait two days for the guy to come empty it before we could print again
I stained my hands a couple times
"Toner smoke. Don't breathe this. No seriously, it'll actually give you cancer."
the printer at my current job doesn't have a separate thing for waste toner
I suspect there is still waste toner, and that it's just in the actual toner cartridges
i've managed to come out of printer work with a 100% clean white shirt rate
fucking jamie hyneman up in here
always wash toner off with cold water as well btw
Yep
if you don't it'll set
And become more likely to absorb into the skin
Same rule after going to a gun range
Honestly I just wash my hands with cold water most of the time anymore
oh - is that true for lead?
Yep
you should 100% wash your hands after handling lead pellets
huh - used to shoot air rifles all the time and washed my hands with hot water
Air rifle pellets aren't typically lead are they?
yeah
they are
The ones I had were soft enough that you'd fairly regularly crush them with your bare hands
Oh you know what
lead is the only metal even close to letting you do that
not the steel bearing ones.
yeah, these have to be lead else they wont rifle in the barrel
There is one that's almost liquid at room temperature
i think you can get some other metal types for non-toxic pest control
but not quite
Lead bans are starting to roll out now though
gallium?
THAT
but it stains the shit out of your hands
That's the one
yeah - that's it
fucks up aluminium real good too
The old "melting spoon" trick
Gallium isn't harmful - but it does stain apparently
literally decays/destroys aluminium, so cool to watch
I know gun advocates will pitch a HUGE fit
@gentle moss yeah, I generally leave my gold bars alone
don't bother hammering them
also: we have lead bans in europe
you can still get lead shot for guns
you just can't use it in like say, soldering
for lead shot there's steel shot
you still get lead solder right?
and if you're hunting to eat you should use that already
@gentle moss no in some countries it is completely banned. Denmark for example. Uk is banning it atm
nope, it's not lead based anymore charlie
Oh finally, it's safe to lick the soldering work
you might be able to get it as a specialist product, but it's not common place anymore
huh - so it seems. I'm sure 5-10 years ago it was still fairly common
because i think it's around then when it came in
i still have some lead based solder laying around
I'm sure I do as well
the new stuff feels like it needs a higher temperature to work with, but it's fine
yeah, lead is the only metal of it's kind when it comes to meltiness
most others are quite a bit higher
Gallium
True
ideally you'd want one that melted at like 120c or something
I'm just obsessed with it
i think lead is like
Unless in an alloy
~250c?
tin is 230, lead is 300ish
Neat
the most common lead solder replacement i see is like
I should get some bismuth crystals...
yeah, normally you're allyoing tin, lead, and other shit to get exactly what you want
tin-silver-copper mix
They're so pretty
AAA High Quality Bismuth Crystals
bismuth is pretty nice looking yeah
https://www.thebismuthsmith.com/listing/766328494/giant-bismuth-aztec-calendar Oh dude that one's friggin' awesome
Too expensive to own but still
thinking about lead
why is it always a lead pipe
that you hit someone with
literally any other metal seems better
I guess it's the weight/denseness of lead
Also because that's what was most common around the time that was popularized
More likely to bend yes, but still probably stronger than a skull
And helpful when you have an upset tumtum
Niiiiiiiiice
That was a worthwhile edit
I only noticed the potential genius after the fact - I couldn't let the opportunity go to waste
Good man
i think it's the weight of a lead pipe
blackjacks were often made with lead shot in them for the same reason
it'll install it just fine but refuses to lock
"saps"
good times
You have to pop it before you can lock it
Pop'n lock, man
I just watched the episode of Community the other day where they have the pop'n'lock'a'thon and no one goes accept Chang who pops and locks for like 5 hours or something.
@rough sapphire And there's nothing wrong with being not good at a particular language. But every language has its strengths and weaknesses, and hating it wholesale does no one any good
he is still going on about it in general lol
Yeah I see that
My rule of thumb is that if you think whatever language you use is flawless, you're basically a zealot trying to prove something or you're just lying to yourself
@rough sapphire Again, more than willing to have the conversation, but lets do it in here
Trying to implement one language in another is also going to lead to all kinds of headaches, especially if you're not experienced in the base language
I use python every day, it's my work tool, but god damn does I hate it sometimes, I secretly wish the field I'm in would move to other languages but every time I try something else I just miss either the ecosystem, the documentations, syntactical shortcuts etc
I mostly use C# and C++ so writing classes in python is a bit weird lol
ok
fine
i will do it here
Thank you
@rough sapphire For the record, Lua is not comparable to Python in terms of functionality. Lua is a lot more lightweight than CPython
It's also not used for the same purpose at all
I saw a guy on twitter that got Lua running in kernel mode lol
There's a reason why it's the preferred scripting language for C/C++
if lua is more lightweight than python then why do i have to import tons of stuff in python, a high-level language?
bruh
Because namespaces help with cohesion
imports don't have anything to do with how high/low level a language is
^
Consider the following
you're saying because a language has a good ecosystem (that is, a big community) it's bad ?
no
Python's strengths lie in its diverse ecosystem, how quickly you can create something, ease of testing, interoperability with C code and a few others.
Its weaknesses are its execution speed, its dynamic typing, difficulty with recursion, and requiring the interpreter to run
Haskell is extremely high level and requires imports for everything but prelude, and purescript requires imports for even the prelude
if lua is more lightweight than python then why do i have to import tons of stuff in python, a high-level language?
@rough sapphire python has a lot of the code already written for you. In other languages you would need to write it on your own
Haskell is extremely high level and requires imports for everything but prelude, and purescript requires imports for even the prelude
@graceful basin Said it before me haha
the low/high level discussion is silly at best
i never said i like haskell or purescript, i dont even know what the latter is, and for haskell, i never wrote even a hello world in it
imports are just because having everything builtin is inconvenient
high level - good for complex interaction with servers, scripting, etc. low level - good for performance dependant tasks and generally when you need to get down and dirty with the memory
lua prevents having a massive builtin namespace by placing functions into tables
which is a fine approach
in python you have to convert tuples and builtins to lists to perform most of the list-related functions
What do you mean by "builtins"?
Yes, because they're different things
a type when you run builtins()
I don't see how that is a problem, they're different types entirely
yeah, lazy sequence manipulation is pretty mediocre in python
but builtins and tuples are basically the same
what
they are both readonly lists
which builtins
Javascript's strengths are that it's really the only horse in the game when it comes to Web stuff, its vast and battle tested ecosystem, its powerful engines (V8 for example).
Its downsides are that it's restricted to being either web based or server based, and while you can wrap it into a desktop application using something like Electron, performance suffers heavily. Its dynamic typing, use of both null and undefined, as well as a handful of other things make it very problematic
I'd honestly rather move map and filter to functools if only it didn't break legacy code
builtins()
that's not a type
That's a dictionary
I think you don't really understand which types exist in Python and why they are different.
hemlock, python is also dynamic typing
I also mentioned that as a con in my Python list
I'm taking the values of the language per language
brb
complaining about dynamic typing but also complaining about having to convert types is ???
Just like any good tool, it has to be used for the right job
You wouldn't use a hammer to screw in a bolt, you wouldn't use a wrench to saw a plank of wood
You can (and should) find what you like and dislike about a language, but it needs to be within the context of its purpose
Blanket hatred towards a language limits your options and learning opportunities, and breeds unnecessary biases towards things that could benefit you at a later date.
fair enough
Again, I get that there's a LOT to bitch about in Python. There is in any language
But you have to take the noise of the crowd with a grain of salt, find out for yourself
Again, I get that there's a LOT to bitch about in Python. There is in any language
unless it's lisp. it's perfect /s
(((Sorry)(((Say (again?))))))
@topaz aurora I think you misspelled Idris!
Nah QBasic for the win
I think you meant forth
I think I said Form DSL
pascal is the perfect language, no one can beat it /s
I keep seeing "Pascal" but in my head hear "pastels" and it just makes me think about art classes back in middle school
Well, Pascal ABC .NET adopted many modern features
I'll stick to my favorite LISP flavor for now haha
@topaz aurora I think it'd make me happier if LISP was written as if you had a lisp. Like thtring for string
Don't give me ideas now
I'm actually building a lisp interpreter in python, it's pretty fun
if python adds readonly lists (tuples), why not add readonly for every type and not make it in a separate type, just use a keyword or something, that would perhaps make it better than js
(most) lisp implementations actually make a very nice use of dynamic typing that we don't see very often
cause there is no need
It does have immutable other types
Immutability by convention works well
@rough sapphire Making an arbitrary type immutable is impossible and might make some types useless. But, for example, there are frozensets.
but i can read and write to a string, int and float
nope
It creates a new object
(not without ctypes, which is cursed)
It's not modifying the same one
By convention, it should be noted not to touch anything like this
DO_NOT_TOUCH = UnsafePerformIO()
lemme try that
Python works on the idea of "consenting adults"
Ye
In that the conventions should be as good as gold when it comes to treating things as constants
Python isn't going to tell you that you can't do it, but you know that you shouldn't
And, well, there are read-only properties
Forgot about those
it works fine
I really hate the idea of footguns and letting the developers on their own
you are not changing a string
you didn't modify the string
That's overwriting the string
a = (1, 2)
a = (3, 4)
``` is also valid
you're binding a new string to the variable somestr
if you mean that there is no const keyword, then yes
oh
__slots__ also enforces stuff to not arbitrarily be assigned with new attributes
!e
my_string = "bacon"
my_string[1] = "c"
print(my_string)
@plucky ridge :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | TypeError: 'str' object does not support item assignment
What I just tried right there is an attempt to modify the string itself
enforcing immutability is difficult (I would even say unviable in a inheritance-based object environment)
again, still created a new string
Rather than just create a new one
ok then, can they make non-immutable strings, ints, floats etc.?
+= also creates a new string (there is a special case where it does for optimalization purposes, but that will never actually be detectable)
Also, something like "bacon and " += "ham" also creates a - damn it lak, you're too fast
Those things that you've mentioned are semantically immutable
immutable is different from read-only
you can rewrite immutable things
but not read-only things
You can't change some property of a number, but you can with a list
that's because you're used to "false" const-correctness
if you mean that there is no const keyword, then yes
but as I said in #python-discussion, it might be deceptive (as it doesn't prevent mutation)
const fooBar = {hello: "world"};
fooBar.hello = "baz";
im not saying anything about js specifically
i dont really like it that much anymore
Sure, it's just the easiest comparison to make
@sonic river :D
in C/C++ the type of constness depends on where you put the const in the type
const int*
int* const
const int* const
im talking about "final" in java
or does it not have proper final correctness as well
yes, so we can have fine graiin control over which part we need as const/mut
!e
xs = ([], [])
xs[0].append("Hello")
xs[1].append("World")
print(xs)
making class immutable cannot work because of something like this
class Immutable:
def fun(self):
return 5
class SecretlyMutable(Immutable):
def __init__(self):
self.x = 0
def fun():
self.x += 1
return self.x
```when object implementation details can arbitrarily mutate, it fails
@rough sapphire you can still mutate something which is final, I think. Because otherwise you wouldn't be able to call any methods on a final value, since the compiler can't prove that some method doesn't have side effects.
lemme try that
Python doesn't have something like that. The best you can do is make the variable all caps and know that you shouldn't modify it. If you accidentally modify it yourself, that lends itself more to a logic error than a language issue
@topaz aurora :white_check_mark: Your eval job has completed with return code 0.
(['Hello'], ['World'])
final List<Integer> x = new ArrayList<>();
x.add(10);
```is valid
same issue
when I can inherit from a class and make it mutate things, marking something immutable is meaningless
const only reflects on the variable doesn't it?
I believe so
swift actually enforces it for structs, but not for classes
Much like Rust's
i mean, why wouldnt it be? its just a method
@topaz aurora depends on the language (see message above about C/C++^)
methods mutate
๐ final ๐ doesnt ๐ mean ๐ preventing ๐ using ๐ methods
then it does not mean immutability
No but you were saying it should prevent changing the value?
Or did you just mean that it should prevent reusing the variable
Just trying to make sure I'm understanding
So it prevents changing the identity, like const in JS, but doesn't prevent changing the value.
but how would it prevent it if it is using methods and not += or something
Gotcha, okay
let xs = "hello".to_string();
// xs.push_str("world") nightmare, bad
let mut ys = xs;
ys.push("world");
That's rust, right?
Yes
+= is just several method calls in python
Does xs still have ownership or is that given up when you make ys
and in a bunch of other langs
It is transferred to ys
using languages i never claimed to be better than python against me is just not correct
i never said anything about rust
It's also totally different from Haskell's everything is immutable model which caught me off-guard
all I have to say is "hi" when it comes to these conversations 
This is more us being nerdy and enjoying seeing how things tick in the various languages
@topaz aurora And then you get caught off-guard when you realize that it is actually not ๐
Is it?
@topaz aurora Well, with unsafe stuff
final doesnt mean preventing people from using methods
That's correct
makes sense
yup
@rough sapphire wouldn't that final just prevent reassinging the value x points to?
final only reflects on the variable much like const I believe
that's right
ye, all final does is prevent the value from being reassigned (except when it does not)
you can actually bypass that modifier on JRE < 12
Well, in java there's reflection and stuff...
reflection doesn't let you do that IIRC
That reminds me of interior mutability in Rust. Neato
JRE >= 12 prevents it though
do you know why that did not work? it's because it's not a method
it does, on 11 and lower
crazy, right?
Yes, you're assigning something new to a final
it applies some extra optimisations tofinal variables when they're plain primitives as well
no, that did not work because you are reassigning a variable, rather than mutating an object
Well, in Python there's typing_extensions.Final
in kotlin, you can actually only use final with static primitives
There are actually many more weird type stuff in the world ๐ค https://en.wikipedia.org/wiki/Substructural_type_system
I expect it does some memory optimisation that has to be enforced there
It's still reassigning a variable, you're not mutating the 5 object
like python's += on strings
well that also doesn't mutate ya fixed it
fine you proved me wrong about 1 of my 17 cons
neither java nor javascript has immutable const/final
I bet that one is a nasty hack
nobody is saying python has no cons
jshell> import java.lang.reflect.Constructor;
jshell> import java.lang.reflect.Field;
jshell>
jshell> enum Test {
...> A, B;
...> public static void main(String[] args) throws Exception{
...> Field f = Unsafe.class.getDeclaredField("theUnsafe");
...> f.setAccessible(true);
...> Unsafe unsafe = (Unsafe) f.get(null);
...> Test C = (Test) unsafe.allocateInstance(Test.class);
...> long addr = unsafe.objectFieldOffset(Enum.class.getDeclaredField("ordinal"));
...> unsafe.putInt(C, addr, 5);
...> System.out.println(C.ordinal());
...> }
...> }
| created enum Test
jshell> Test.main(new String[0])
5
``` I mean, does java 12+ really prevent mutating final fields?
const disallows you to reassign a value
nope
The enhancement request ticket in the Java Community Process for implementing const correctness in Java was closed in 2005 on the basis that it was impossible to implement in a backwards-compatible fashion, implying that const correctness will probably never find its way into the official Java specification.
maybe it's int const
isn't that final in java?
it's a reserved keyword but it doesn't do anything
nope
as in, it's not used in the parser
like goto?
yes it is final but we are discussing const, a different keyword
ok
which appears does nothing
so they just kind of reserved the keyword and decided not to implement it
I wonder why
they do that a lot
Python doesn't force things, it just offers best practices and syntax clarification
btw i use java 8 because i am too poor for higher javas
I build against 14 where possible
Python doesn't force things, it just offers best practices and syntax clarification
@scenic blaze also python: requires tabs instead of brackets
but I also write minecraft mods so gotta target 8 there
You should be tabbing anyway
yes i am
It offers clarity for someone else reading your code
Fair
pretty much the only disadvantage there is moving code blocks around, which a good editor fixes
but when i say copy code from say, discord, in primitive IDEs i cant shift+tab
really if such a small syntactical difference bothers you, id say the problem lies elsewhere
I mean, even vi lets you deal with it fine
C-style syntax is more flexible but indentation-based syntax is more humanly readable
so I tend to call it not a problem
yeah, what pure said
the only difference is that aggressive indentation is not possible for python, that's about it
which is why things with C-style syntax tend to be indented
i dont know, people say python is like english, but have those people ever seen lua?
lua is far less readable, what're you talking about
The benefit to C is that if you really wanted to fuck with people you can obfuscate your code and make it unreadable pretty easily
if you want to achieve english in a programming language, use lua
and again, i dont say lua is good
use COBOL /s
tell me zalt
^
@shell raptor I will end you
how do you join two strings in lua?
COBOL is the english programming language that's terrible but it exists
SQL is not great either
SQL works well enough, tbh
lua may be less readable, but it is almost exactly like english
oracle sql is dope tho
in what way
it's really not
What's crazy to me is that both SQL and COBOL are a chore to write in but they're so friggin' powerful
it even starts with 1 for all you english-programming language lovers
it's 1-indexed, yes
FLATTEN MONAD IN users WHERE LEFT ASSOCIATIVE JOIN EXISTS ON NULL
Then why did you say it
@shell raptor I mean in fairness I've gotten emails like that
I can't believe we have to have a separate concat operator in a modern language
string + string? Nay, string .. string
can you develop on how lua may be closer to "english" than python
lua is not really modern i think
I mean, + for strings is bad if you have weak typing
@shell raptor English-based parser combinators ๐
@sand goblet Tell me how to concatenate strings in Julia ๐
if you have implicit casting, yeah
lua has tons of cons but it was easy enough for me to make a simple game using LOVE2D
Julia is a programming language?
@sand goblet I think there are others that do something like ++ instead of +
yes chess
But I can't remember off the top of my head
haskell
Ahhh okay
Julia is string(x, y)
Okay, I've mentioned this a billion times, but I wish Python had ++ and --
^
Ehhhhh
Tired of typing out += 1 -=1
I'm not really hurt about it
like yall said, different languages have different purposes
I'd rather not have ++ or --
In Julia, "abc" * "def" == "abcdef" and "abc" ^ 2 == "abcabc" because of some bullshit explanation about how it forms a monoid.
<> is also a synonym for String concat
It's like... 3 extra key strokes?
<> in haskell (there is no common typeclass for String and Num), ~ in raku (otherwise you get weak typing mess), . in PHP, ditto
I actively avoid it in languages that have it
Sql is lovely to write
But yeah, different flavors per language.
(I say as I fuck off on discord)
now we moved on from python to different programming languages, great
it's because haskell bois thought it would be a good idea to make strings linked lists
and I think kotlin doesn't use it either, although I could be wrong
This is how our brains work, Zalt
strings as linked lists O_O
or ByteString
Or don't work, I guess
@sonic river There are actually many different types for strings, and I'm lost :)
ye, <> should still work cause Semigroup
How do y'all feel about chars as ints?
In traditional object-oriented programming languages const would require proving that a method is not mutating anything.
The only way to do that is to mark mutation in the type system (like in Haskell/Idris)
at the end of the day, you guys will always prefer python over java and js, and i will prefer js and java over python
i dont prefer python over anything I apply the best tool for the situation
^
i started with js and so i like c-like syntax
That's a generalized assumption mate
I linked it before but
In psychology and ethology, imprinting is any kind of phase-sensitive learning (learning occurring at a particular age or a particular life stage) that is rapid and apparently independent of the consequences of behaviour. It was first used to describe situations in which an an...
If you like java so much why not code in C?
We're all prone to it
kotlin and python are my top two but I do a lot of java
Or ASM
c is low level
@rough sapphire I wouldn't say always. I have been dabbling in some JS based languages or at least ones that compile down to it (Elm and ReasonML are the ones I'm referring to)
different tools for different things
I started with pascal, C and java and I still like python
like really low level
Again, it's right tool for the right job
although I wouldn't use java if I could slot kotlin into the stack
I mean, you are saying that you hate high level stuff
C is pretty high level
@scenic blaze Soldering transistors into place?
C is pretty high level
@graceful basin not sure if i agree but ok
C is pretty high level
Relative to ASM
the low/high level discussion is soooooo silly
yes
It is