#programmers-off-topic
1 messages ยท Page 8 of 1
just like me fr
Same with collection init
Except for the case of an empty collection the codegen is straight nonsense
Wait how did they give up collection init
So I only use it for empty collections or when I don't care about performance
Fuck up. Thanks phone
When I do T[] newvar = [list]
It copies over the elements in a for loop
Instead of using the faster direct copy into array methods
you mean T[] newvar = [..list] or whatever the new syntax is, right?
Literally calling list.ToArray() is better
(i hate the syntax and refuse to ever use it)
I use it in events tester because events tester gets to ignore performance
I'll just make sure to avoid it in any hot paths. I hadn't started using it yet because I was that lazy about updating vs lol
But now I want to look into how vortex works because Shockah made me curious
I'm looking at some existing code and it has support for xnb mods and I'm like "well that's the first problem"
i think there's no way around it - the extension is supposed to be able to install every single mod out there
maybe there's a way to talk it over with Nexus guys
It should at least display a giant warning message
i think they're also fine with extensions just showing messages and refusing to install stuff
Like hey this kind of mod sucks and causes incompatibility issues are you really really sure you want it
they wanted my extension to work in some way, even if the mod loader is not installed
the "some" in my case being "just show an alert that it's not installed and do nothing"
so i can only guess they'd be fine with XNB mods working similar - just alert and be done
I just went and had a peak at the IL and lmao you were not joking
Like, doing this is exactly what you'd expect. ```csharp
List<int> test = new(){ 1, 2, 3};
But if you try this ```csharp
List<int> test = [1, 2, 3];
Oh I see what in the collectionsmarshal they're doing there
I see what is literally happening but it doesn't mean the compiler shouldn't know better.
Because it is
since the smarties are here. Are switch statements faster in C# (checking against a string value) or if ... else if ... Or do they compile to basically the same thing?
Ugh godbolt doesn't have net 8 yet
Wait, why in the actual... how is it... 
Switching over strings:
- Small n compiles to just an elif tree
- Big n compiles to a hash lookup
- Net 8 also can emit a trie
trie ๐ฌ
- time to learn something new
The assembly is a little longer for [1, 2, 3] but I am not good with assembly so I can't say how much worse it is. sharplab: https://sharplab.io/#v2:C4LghgzgtgPgAgJgIwFgBQcAMACOSAsA3OnAMy4LYDC2A3uto7uXPtgLIAUAlHQ0wIAyASwjAAPMIB2wAHzZgAUzHYAvNimKA7j1pIANNgSHSAX2JoBp/oxvNcbAHI8+lgUxFjJM+UpXqAbQMjEwBdCys7dFMgA=
C#/VB/F# compiler playground.
I'm not at my computer but I'll look in a few hours
Wish I could configure VS to notify me about "Collection initialization can be simplified" only in the express situation where the starting collection is empty.
It even wants me to replace stuff like Recipes.ToList() with [.. Recipes] which is... kinda ridiculous looking at the IL.
I hate that suggestion
I also hate it.
As soon as they moved this beyond simplifying stuff like csharp new int[]{ 1, 2, 3} it became too much
I'm gonna use it for that, but
Iโm not going anywhere near the .. syntax
Love how VSC is autocompleting float to FloatingPointError
I enjoy my type signatures of Optional[FloatingPointError]
Also python ternaries are bad
I'm glad it's an optional error. I hate mandatory errors.
How does C# handle conflicting libraries? In java I just shaded them into the classpath so that different versions were never an issue, but does C# not have something like that?
SMAPI loads libraries by name, and doesn't load duplicates
unless you're specifically asking about C#/.NET, not SMAPI
more of a C# in general thing. I've never used it in any work, just picked it up for modding
but I remember casey saying she probably wouldn't make her harmony local resolver thing into a library because there would be conflicting versions between that and spacecore.
I was just wondering why C# didn't have a mechanism like java where you could shade in the dependency
Casey said that specifically due to how SMAPI does it
(aka not very well)
you can load multiple conflicting versions into multiple AssemblyLoadContexts
and as long as you don't try to use them interchangeably, it will all work
and if you do try, you'll get weird errors like "Cannot cast type A to cast A"
I would like to correct myself on this: I tried to install void Linux but same issue as arch, its actually kubuntu
Why didnt arch install
VS refactoring support is pretty good
I miss being able to select some code and go "no, try being a ternary now"
Threeeee for loops in and stilllll going
anyone got experience with SQLite ...?
Ye
it's okay, i resolved it now haha, im a dumbass ๐คฆโโ๏ธ this shit is so hard... having to do a database for my computer science coursework software...
I like it a lot more than the other SQL software, as it's just a file you open, no fuss
a new beginning
hahaha
the coursework is like, you have to make a piece of software for a 'client'
im doing a... stock, sales, and customer tracker ๐ด
sqlite is definitely the most convenient one and works perfectly fine most of the time
could anyone have a look at this to see what i might be doing wrong? opening the database in Sqlite db viewer shows nothing after running this... be kind to me, i've never done SQL or anything like this hahaha
so it's a windows form
If you're working with transactions make sure they are getting committed to the database
yeah i am, i tried doing that to the best of my ability
as i say i've never done SQL before lol
I'm not sure if your column types are what I would use
Does DB Viewer show your table as being created?
You have the CommandText, but do you ever actually use it?
not that i can see no
I'd step out of the form for a second and make sure the SQL logic works
is there a command.Execute method or something ?
I'm not familiar with C#, but I would think there should be a line to actually apply the SQL command you've formatted
in python there is
From an application like DB Browser Lite you can manually write the queries and get helpful messages if your sql is incorrect
idk about C#
okay i'll try that then
For example, BOOL probably should be bit
i'll have a look at that
TEXT should be a VARCHAR field of sorts
TEXT is fine for SQLite
so is bool iirc
Yeah, my guess is that there are execute steps missing
i believe i need to do this actually
makeTableCommand.Transaction = makeTableTransaction;
set the command to belong to that transaction lol
Ah, okay I wasn't sure about types since I thought sqlite would work with ANSI SQL
But either way, verify the sql first before you add forms to the mix. That way you can rule out those as being the issue.
You should be able to quickly create a new db, run the code manually, and see the intended results.
well i've just executed this SQL in the db browser without a hitch
CREATE TABLE UserLogin (
UserUniqueID INT PRIMARY KEY NOT NULL UNIQUE CHECK(UserUniqueID > 0),
Username TEXT NOT NULL UNIQUE CHECK(LENGTH(Username) >= 3),
IsAdmin BOOL NOT NULL,
Password TEXT NOT NULL CHECK(LENGTH(Password) >= 3),
FullName TEXT NOT NULL CHECK(LENGTH(Username) >= 1),
Email TEXT NOT NULL CHECK(LENGTH(Username) >= 6)
);
INSERT INTO UserLogin (UserUniqueID, Username, IsAdmin, Password, FullName, Email)
VALUES (1, "nameewew", true, "pass", "name", "mail");```
sure enough, there it is...
wonder where i'm going wrong?
nice
Awesome, that's a good sign. So whatever is wrong is particular to the application then.
that implies its in the C# code
Try logging the variables to make sure they hold the values you expect.
i'll breakpoint at each step of the way to see what's what shall i
why breakpoint when you can add a million print statements
are you trying to create the table again every single time?
every single time what ?
every time this button is pressed
i delete and recreate the database every time i run the program to test it
ah
a check whether it already exists might be nice either way but probably not the issue then
let's go!
nice
now to work on the rest of the program ๐
thanks guys !
i needed to .ExecuteNonQuery() for each command lol im a dumbass
ty all :)
muhaha i was right
the rest of the program and probably no plaintext passwords 
I can't tell if its vulnerable to a SQL injection or if thats recommended
it's not
not what
not vulnerable
ah
i think the parameter functionality prevents SQL injection
how else do i store the passwords tho
hashed
doesn't matter if it's just a hobby thing for learning but generally speaking passwords should never be in a database in plaintext.
You basically hash the password someone filled in and check if the hash is the same as the one in the database
instead of checking the text directly
Remember, hash and salt so that you aren't vulnerable to a hash table attack
can't that make like duplicate hashes though or am i stupid
like a checksum
if they're the same password, yes (which is a common exploit in the wild)
technically hash collisions are a potential thing that can happen yes
thats what that salting helps prevents, as mentioned earlier
They are so statistically unlikely that in real world you don't worry about that too much
i've never heard of salting before
Salting just makes sure your hash is unique
oh okay
Unique to your application that is
is my teacher just shit for not teaching us any of this hahaha
salting adds extra data when you hash, so that two identical passwords will have different hashes
depends how far along you are
unless they also use the same salt...
going thru all the trouble of salting, only to use the same salt everytime would be something
this can come later for me ๐ it all sounds really complicated for now lol
all this isn't particularly important if it's just a hobby project but it might be good to just learn some best practices
yeah
the real secret is to never actually handle anyones passwords as its more work than its worth
Yeah, trustless systems nowadays don't even need the concept of a passwords. Passwords are inherently insecure.
it's for my coursework, i don't know particularly how important 'security' is for marking it. i know they definitely want you to prevent SQL injection hence the parameters i use
we make Amazon cognito deal with that for us now at work... we used to do it ourselves but it was not pretty
yeah, since its just an SQL course they probs wont cover it much if at all
the important thing then is learning to use databases themselves
oh rest assured my teacher has taught us nothing lol, sent us away to do it all ourselves. which, fair enough, experience is the best teacher, but i mean, teaching us nothing?
surprised the SQL worked on first run ๐
anyway, not a bad start for day 1. bedtime now (at 34 minutes past midnight ๐คฃ )
goodnight all ! thank you for the help :)
Okay, there are two reasons to salt
- Salting passwords means even identical passwords have different hashes
This way, if you get hacked and your db dumped
It is a lot harder to match up usernames and passwords
- Salting hashes for dictionaries/hashsets makes it more difficult for a malevolent user to send you inputs in such a way that creates a lot of hash collisions
(Because hash collisions cause those data structures to wildly slow down.)
If you are some desktop app you might not even care, I disabled hash salting for most of my AoC code
Cuz faster and didn't care
- Salting food makes it actually taste good
Posting this here, since it is technically not making mod related!
I put together a GitHub Page for content packs using AT / FS via their requirements tab. The pages are automatically updated on a schedule via GitHub Actions.
Alternative Textures: https://floogen.github.io/StardewValley/alternative-textures
Fashion Sense: https://floogen.github.io/StardewValley/fashion-sense
Repository: https://github.com/Floogen/StardewValley
I had been testing Blazor + GitHub Pages integration in my free time and made a small project out of it. I am unsure how useful it will be, but it was a fun learning process!
Hi, someone who knows JavaScript, could you help me with a small problem I have with a TreeView?
you're probably going to want to add a lot more details or nobody is going to be able to offer any advice since they don't know what your question is
Yes, I understand, my problem is that I have a treeview in JavaScript where I only had parents and their children
And everything was working correctly, but I had to add a new father who would be everyone's father, and I don't check it out his children, it's not working for me
What does your code look like? What is the expected behavior of the code?
The parents of "Access, General and Reports" when checking them if their children mark me but the father of "All Screens" does not
that's is my code
If a child is checked the parent should come out undetermined, if all the children are checked the parent should be checked and the parent's children should be hidden with that arrow icon, that works in those three parents but in the "All screens" "nothing is working, please help
I don't speak very much Spanish, so I might be missing something in your code. Are "Acceso", "general", and "reportes" considered parents AND children in your code?
If they are only parents or only children, but not both, that might be your issue
Yess
Oh right
But how could I do it? Because with a class I identify which is the parent 'item' and with the 'sub-item' class I identify the children, should I make one for those who are parents and children?
you could implement a tree data structure with a javascript class
a very simple one where each node has a title, a checkbox value, and an array of children
Or, when a checkbox is changed, you could traverse the DOM to find the parents elements or child elements of the checkbox
I hope you're able to get it figured out :)
Hi, I couldn't fix it, I don't know how to do it. 
This is amazing, Peace! Would you mind if we used these in the AT & FS commands?
I do not mind at all!
anyone know why this AHK script causes permanent clicking? forcing me to interact with stuff
Hello, I have some issues with C#, can someone helpe me?
I have this working function :
using Dict = Dictionary<string, object?>;
static private T extract<T>(Dict dict, string key, T default_) where T : notnull
{
if (dict.ContainsKey(key))
{
object? value = dict[key];
if (value is T t)
return t;
if (value is null)
return default_;
throw new InvalidDataException($"Field {key} in {struct_name} is not of the correct type {nameof(T)}");
}
else
{
return default_;
}
}
and I'd like to have a similar function but where default_ can be null. I tried to replace T with T? or Nullable<T> but it keeps telling me that T must be non-nullable to be used in Nullable, so I don't know what to do...
I tried this :
Huh, It seems to work when removing = null, but I don't understand why I can't have a default value null
so, the problem is that null is only really a null for reference (class) types
so it couldn't work if T is int?
for value (struct) types, when you write a null, it's actually a Nullable<YourStruct> with HasValue = false
the only way around this problem is to have two separate methods, one with where T : class and one with where T : struct
I see, thank you
but you won't be able to name them the same, at least not in the same type
I'll just pass null as an argument when I need the default to be null
and see what it does
btw. GetValueOrDefault is a thing
which will return null for reference types, or default (whatever it is for the given type) for value types
also, not sure why you're doing an object? variable there, which forces you to cast
True, I could use it here
also also, you probably should be using TryGetValue for that implementation anyway, if you don't want to use GetValueOrDefault
Well, I don't know what's in the Dictionary at first
ah, you have a <string, object?> dictionary... weird
I'm parsing a json
Also I have a similar method that does the same thing but throws errors instead of returning a default value. I made these methods because I have A LOT of data fields to extract
Why are you manually parsing a json?
It's technically not manually parsed, it's parsed into a Dict by IContentPack.ModContent.Load<Dict> but afaIk, I can't get a ShopData object from a Dict
Newtonsoft will just deserialize into whatever
And you can use a json converter if you want more fine grained control
(Part of this is my work code is type scrubbed at the moment, since it is, well, python.)
(And I keep having to fix stupid type errors, like me forgetting how iterating dictionaries worked)
I need to check individual fields depending if they're optional or not anyway, so I'll keep it this way for now
I learned about a different way of making .net project templates today, so now my idea of making a Stardew mod starter template is back on the menu.
I've looked into creating a mod template project, but then immediately backed off when I saw how... strange the process was.
Anyone have ideas for best practices? ๐ I definitely want my template to use ModManifestBuilder. Maybe with an option to turn it off depending on how good the replacements system is.
I've also been thinking about Shockah 's Project Fluent and I've concluded that I want to add support for that to Pathos' translation class builder.
As an optional dependency for making it easier for people to add translation files through content packs.
(Sorry I know this is dreadfully on topic, but I didn't want to interrupt the content people's conversation.)
turns out SMAPI is using Newtonsoft already...
Yeah have a peek in smapi-internal in your SD game folder and you'll see that along with Harmony, Pintail, etc
I like how I have my template projects set up, but the problem is that it's not entirely self-contained (it references a separate common csproj and targets file). So I don't think it would be great as the basis for a template intended to be used by random people.
You could have a one-solution version that includes a common csproj in it and then a targets file + csproj version, maybe?
The first would be for people to build multiple mods in one solution and the second would be for solution-per-mod setups
I'm not familiar with project templates and their distribution though, so maybe I'm off base
I suppose the common csproj could just be internal to a nuget package or something...
I feel like everyone develops their own common csproj if they stick around for long enough
Yeah, it's easy enough to do two templates. One for a single project and one for a monorepo with a common project.
And no options without the manifest builder, because god damn it that thing is just good practice at this point.
I've been trying to think if there's anything I would want to donate to a setup like that, probably for the monorepo + common setup.
And I guess... my attribute based subscriber pattern? ```csharp
[Subscriber]
private void OnSomeThing(object? sender, SomeSMAPIEventType e) {
}```
If only to have something in the common project to demonstrate why it exists.
And if you're putting something in, it should be something useful.
Maybe including a global mod config menu integration as a best practice? I was thinking of making a PR to GMCM to show conflicting keybinds. I actually got into Stardew modding by opening a pr to CJB cheats/item spawner to show its keybinds in GMCM, because i wanted to manage my keybinds in one place.
Hmm. I could include an integration too.
That is pretty helpful.
Might need to clean up my wrapper for it then, lol
Yeah, that would be good code to include.
tries to write an abstract class in python
God I'm out of it today haha
I just wanted a compile time enforced interface
On a programming language that isn't compiled
i'm back again ๐
anybody know what this error means in this context? the good old internet has been of no help...
Discord appears to have just added security key support! 
for 2fa, I assume?
I assume, though it would be pretty cool if it allowed them as the sole factor.
didn't it already have that ?
2FA yes, but security key like... a Yubikey or presumably passkeys!
OH
that's the.. third? thing I've seen support it
Ahhhhhh yayyyy
i wonder if i can make a raspberry pi security key
I just found a Pi Zero implementation of one, which is pretty cool.
But the point is figuring it out, so I'd say try to go for it!
Yeah, that's more or less how I felt... but it does at least hold the important stuff for me.
Well, they do... because two.
C# is strongly-typed, so it's not going to parse a string as a bool unless told to
oh apparently acts as a yubikey, hmm
i was doing bool.Parse on a string tho ๐คฃ
You can use something like Boolean.TryParse() to attempt to parse the string as a bool
https://learn.microsoft.com/en-us/dotnet/api/system.boolean.tryparse?view=net-6.0#system-boolean-tryparse(system-string-system-boolean@)
The result of the function will tell you if it succeeded, and the out param will be the resulting bool
However, if the string is "1", that isn't going to parse, since C# only cares about "True" or "False"
looks like 'string == "1"' will have to do for now
So you can just compare against "1" to save yourself some time
Got a single mod project template set up at https://github.com/KhloeLeclair/StardewTemplates, next... a solution template for monorepo work.
Not pushing it to NuGet yet, since I want the solution template ready too, and maybe opinions from other opinionated people.
I think that should be a super solid starting .csproj though.
For a single project setup, they might end up needing to put more ModBuildConfig XML entries into their csproj (if they're not going to add a targets file somewhere else), so a link to https://github.com/Pathoschild/SMAPI/blob/develop/docs/technical/mod-package.md like you have for your ModManifestBuilder is probably a good idea, probably near the two entries you already have from it
Yeah, good point. I'll add that.
Otherwise that's a great base for someone to start with, for sure.
The template.json is a bit silly, but I was able to get all the variable replacements I wanted working so I'm happy about that.
Why does python copy my dictionary backwards sometimes?????
Just to keep you on your toes and make sure you're not erroneously expecting any kind of sensible order.
aren't dictionaries unordered
Knowing Python I wouldn't be entirely shocked if they did have an order, mind you. 
IIRC they're not guarenteed to have an order, although often times they tend to stay in the same order
I think that was changed somewhat recently?
https://docs.python.org/3/library/stdtypes.html#mapping-types-dict Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6.
Yes
Dictionaries in python are ordered
I expected the order to be the same for a copied dictionary
how did you copy it
lol my mental info is only a mere 6 years out of date
I always just assume any kind of dictionary structure doesn't have a guaranteed order to it
unless it's specifically in the type name like OrderedDictionary or SortedDictionary or something
. copy
Yes but python is special
python introduced ordered dicts a while back
This monorepo template is pretty chunky. So many comments.
I've grown quite fond of atuin
Working on docs again
Introduction Hello, Iโm RyotaK ( @ryotkak ), a security engineer at Flatt Security Inc.
Recently, I reported multiple vulnerabilities to several programming languages that allowed an attacker to perform command injection on Windows when the specific conditions were satisfied.
Today, affected vendors published advisories of these vulnerabilities ...
Java Wonโt fix
Is that the rust 10/10 cve thing
k Rider isnt perfect either 
yes
Im trying to use Rider cus Im used to IntelliJ because of work
buuut so far it's.. meh :p
You'll get .NET 6 and you'll like it
You use intellij for work?
that moment when you have to use notepad because you forgor to install a IDE on second boot
I did an entire haskell course in notepad++ cause as far as I could tell the only editor at the time that had any real haskell integration was emacs
I did try emacs but I had no idea what to do once it was open and nothing seemed to do anything I expected so I gave up
tbh that's still my experience with emacs but at least now I'm slightly more used to these funky terminal code editors, just mostly neovim
ngl, I thought I would be Polite At Work and set the git text editor for one of the shared machines to nano
but it turns out I'm the sole user of that machine now
and my default git text editor is....vim
nano should always be the default editor unless it's a personal account that has been customized.
Anyone can use nano.
Conversely, most people need to Google how to quit vim.
The fact that entire distros set vim as the default, even going do far as to not install nano by default, is ludicrous.
Tbh everyone else we are training to use the VSCode git integration
And to yell for me if that doesn't work
Hence me having to fix git conflicts in labview
guyssss is there any IDE that supports C# hot reload on ARM64 macs?
I know Rider doesn't work, but... it might be worth trying the whole built-in dotnet watch method?
dotnet watch doesn't work with dlls right?
i think it needs the app to be runnable to have hot reload
Yeah, I'm not certain if it will work if the thing running is a .NET program that just happens to load the class library...
And frankly, I'm not even sure how setting that up would work with it!
lol interestingly you can't add separate watch and run targets
let him cook fr
okay
i cant get this to work
how do i assign a variable based on an input
like this
i tried like
Z = input('h')
Also, would recommend not setting a variable called input,
how do i make it so that the user input detemines the value of gender
nvm im overthinking it
my brain is thinking "ah i must assign it to a number"
so then when they say a certain list, gedner is equal to one and so if that ever comes up again i can just input
WAIT I CAN MAKE A STRING
I THINK
IM like
SUUUPER new to thi
this
im trying to figure out
like
i fthe user inputs "she, her, girl, woman," or "female", the output will always be print(user, "is a good girl")
god maybe that would be a loop? no.....
i could just type all that out but i feel like
theres a way to optimize it
if gender in ['a','b']:
and 'a' or 'b' wpuld be the inputs required to get that output right
You could also do
g = ['a','b']
if gender in g:
Yes
OOOOOOOOOH
omg
so it greates a list that all is valued to g and
omg
okay
thank you so much btw i know this is probably like teaching a 1rst grader how to add but it means a lot
im just using a library book and whatever knowledge i already have
can g be replaced with a number
np
or am i allowed to do like g1 = ['a', 'b']
Yes
SWEET
Just don't do 1g
letter before number got it
a123082104798: sure
1aoijbojeoj: nope, not doing it
not a python thing either, all languages have something against starting variable names with numbers
ive trie dcode but i think when i tried last time i went in way over my head
ill keep that in mind
The greatest pit fall there is, starting with something restrictive (for me this was c++) then not understanding and just giving up, starting with something like javascript or python is the best way to go
iwas
trying to make a mod for lethal
and figuring out how to input in the code to replace a model with another one but itw as
a lot of words and symbols i didnt understand
i think it was alo c++
(tbh, I don't really think python is a great place to start either)
because it's so flexible, the error messages end up being half useless most of the time
It's a good way to get familiar with OOP, but for general purpose, meh...
i like it bc it has IDLE so i can easily test code
ill take what i can get
thats wy i asked here im not deying the error things werent always helpful
I would recommend using jupyter over idle
+1, I also recommend: https://www.w3schools.com/python/default.asp
like if im doing my list for g1 does she and She have to be se[perate
You can run lower() on the input
yeah, casing in python is kinda annoying, the way you have it, it's case senstiive
you can run .casefold() on the input
(not .lower())
(these are the subtle things as to why I hate casing in python, btw)
so like i do like gender = input and then gender.casefold() and then if whatever whatever
the difference is that .casefold is consistent, .lower does weird things depending on language settings
yup!
one mroe thing
if i want something to print if one varieable comes up but not another, can i write this
with the colon after else lol
yup!
it didnt work
just forgoing the else did tho
hold on
elif
IT WORKED
my first ever code
i feel so accomplished
And hey, if you want additional motivation (while I don't love Python either)... you're learning what Bouncer was written in! 
@crystal wren i got hot reload working on mac with dotnet watch
don't worry I'll put the instructions on github ASAP
Those... might actually be super useful for me on Linux, so that'll be great!
yeah I'll do it tomorrow and tag you and other mac devs i know of
thanks for the lead
i have never seen casefold in my life
apparently it's different from lower on 297 characters in unicode
i was told its more reliable than lower due to language stuff
it got me the results i wanted so im not complaining
i mean you're only working with standard querty keyboard characters rn anyway
so it doesn't particularly matter
what kind of characters behave differently for the two anyway
i'm not saying ur wrong ๐ญ i've just never seen it
like learning to optimize stuff now rather than doing it later when its an issue and having to rework a whole buncha code
no i dea crumble but someone here said to use it and they def know more than i do bc i know next to nothing
yeah I mean there's probably little downside to using it
they're almost exaclty the same performance wise too
that's a strange character to "lower"...
except your colleagues having to look up what casefold does ๐ญ
thankfully this is jsut me sitting at my desk trying to learn basics so i dont have that issue
ยฏ_(ใ)_/ยฏ
germans wouldn't be very happy if ร was lowered to ss I think
thats for furure me to deal with
i wonder what happens if you casefold characters like kanji
you can't really lowercase a kanji can you?
none of the japanese writing systems have a concept of lowercase/uppercase
i doubt it'd romanize it like with the german character bc of all the multiple readings
maybe it'd just keep the original character
kanji don't have a consistent romanization to begin with
yeah ok it doesn't do anything
they could be read many different ways depending on the word it's in
lowering would go from a simple quick process to very complicated language analysis lmao
python whipping out its kanji reading dictionary like ๐ญ
it do be fun
it's very rewardibg
I wrote out a thing and hit go and sometimes it doesn't work but I FIGURE IT OUT with my BRAIN and then try again and then it DOES!!!
Sometimes things even work on the first try.
That's when you worry something else has gone wrong.
Depends on how many lines it took ๐
me when my edge detection assignment finally works
I was today years old when I learned that C# will emit IL to call a constructor that doesn't use the newobj opcode. I am vexed.
love the little lizard
It makes sense that value types would be initialized and then have their constructors called, but I definitely did not expect it.
What is IL? Iโve seen you mention it a few times.
Stands for Intermediate Language.
When you compile a .NET application, it doesn't output machine code (well, usually). Instead it outputs something called Common Intermediate Language. It's like a bridge between proper machine code and something a programmer would write.
Designed to be portable and be JIT compiled wherever it runs.
ILs are found outside of .NET as well. Java has Java Bytecode, Elixir/Erlang use BEAM bytecode etc
you'll find they're often called [something] bytecode
even a lot of languages that ultimate compile to native code have an intermediate step, you just don't see it. Tons upon tons of languages compile to LLVM IR(intermediate representation) first and then compile that into what is ultimately run
hell, even python technically "compiles" your code into an intermediate thing before it runs
Mira for rust too
As much as I like pintail, I want to bash it with a hammer right now.
I designed an API too complex for it. ... or more likely there's one tiny bit in use by literally everything in the API and I can't find out what it is without systematically disabling everything one thing at a time.
Because it just errors the name of the first thing in the chain every time.
I think Pintail's drunk because I can remove everything from this and it still says that it can't be mapped.
Usually at that point I close Visual Studio because occasionally it's actually VS just being dumb
Though these more recent versions have been less bad about needing to do that
When can we get a bot that yells at people teaches people who post multi-line JSON blocks without using ``` blocks that they exist
i only learned about that last month or so
it was... very eye opening
For mac devs - how to get hot reload on mac:
https://github.com/arannya/macos-sdv-hotreload
@marble jewel @crystal wren
somtimes c# syntax is pretty
but you bet your ass it took five tries to remember this syntax haha
tfw your professor has hardcoded your grade to be a D 
rough
A 6 is a D, 5.5 is a passing grade here, a 6 is sometimes considered high
is this how I figure out you're dutch
grading systems are interesting. Being from the netherlands where consistently scoring above like 75% is only reserved for some of the most dedicated smart students to places where people seemingly score 100% scores constantly
No need to dig deep for that, it's on my nexus page ๐ณ๐ฑ
I checked that after 
From the US and curious: are grading curves a thing in the netherlands or is the grade you score on the test the grade that you get at the end of it all?
I have lots of classes where at the end of the quarter the professor sets some interpolation curve and curves people up so the average sits at like a 2.7 or a 3.0 out of 4
@cinder karma When Pintail creates a proxy for a new thing with properties, does it call the getters immediately to create proxies for those types, or is it lazy?
I'm trying to create a minimal repro right now, but even copying my entire API interface into a new mod doesn't break so it's obviously something about the implementation classes. Just not sure how deep I need to go hunting here.
I recall it being eager
Not that I'm aware, all scores are weighted, at the end they add everything together and divide, that's your final score (might differ for some schools but that's my experience)
omg I think I may have discovered the problem

I MADE A CODE WITH A RANDOMIZER AND USING INPUT AND MADE IT REPEAT
ITS AN OPTIONAL TRY AGAIN FUNCTION!!!
Okay atra riddle me this, riddle me that
Why is pintail breaking when the target mod doesn't depend on BmFont (which is included with the game) and the relevant parts of the API file are commented out
don't they mean on single test, like their grade becomes higher if the test ended up being more difficult than expected?
im sure theres an easier way than copy pasting the whole code into a def repeat() function BUT I DID IT
I added BmFont to my client project's references, and uncommented the relevant lines out, and now it works.
which is a thing the netherlands does at least for central exams
whats bmfont
Grading on a curve is not something I encountered at all in the netherlands other than I guess the CITO you do before you enter secondary school
BmFont is the library used for SpriteText rendering.
wh
whats sprite text
sorry
im VERY new
and i wanna learn all i can even if its not currently applicable to me
yeah mostly that and central exams i can recall
though it wasn't applicable for me as i had to do mine in 2020 (the covid ruling basically removed that and made everyone's grading a lot higher)
oh yeah that saved my senior year grades i got a full passing grade on every single supject for second semester
SpriteText is one of two methods Stardew uses for rendering text. The bigger, more stylized one.
but for most tests i did, percentage wasn't equivalent to grade, what i mean is that a 55% does not equal a 5.5. A lot of the time the teacher would say you'd need 65% or 75% for a 5.5, though these percentages are usually set beforehand so not used to adjust the grades afterwards
the nightmare that is font rendering
Maybe, but like Crumble said, never seen it before (on my tests anyways),
yea, except for central exams i haven't seen it myself either
in all of high school 50% was a 5.5 (because the lowest grade was a 1, not a 0)
and then in uni 50% was a 5.0
cause the lowest grade was a 0
that was pretty much it
interesting, for my school it would vary per subject usually
though in the last 2 years most ended up being equivalent to percentages
My current situation 
so it renders text as a sprite like on a spritesheet yeah?
do you think jumping from a relativley simple team randomizer to a stardew mod would be too bug of a leap
@cinder karma I have successfully made a minimal reproduction.
The ingredients: ```csharp
public interface IThingTwo {
// This type is loaded at runtime by the game.
// But the client does not reference the assembly that provides it.
// And this is uncommented in the provider API, but
// commented out in the consumer.
FontFile? File { get; }
// Just something so this isn't totally empty
// when File is commented out.
bool IsThing { get; }
}
// The secret sauce: IReadOnlyDictionary<string, IThingTwo>
public interface IThing : IReadOnlyDictionary<string, IThingTwo> {
IThingTwo MyThing { get; }
}
public interface IBreakPintailApi {
IThing Thingy { get; }
}
I think it's refusing to partially proxy an interface used in an enumerable
And swapping out FontFile for object in the client also didn't work. But swapping to object on the provider side as well did work.
I assume it's seeing a collection and being like "no this type must be EXACT in case you add to it" even though I'm using read only collections.
But this is easy enough to fix on the Theme Manager side of things. I'll just use object instead of the proper font types so people won't need to depend on it.
Ahhh! I don't think it has the concept of read only collections at all
Or covariance at the generics
Thank you so much for looking into it!
Hell yeah my API is working now in all its hugeness
why does the other binary not see bmfont
Just doesn't have a reference to BmFont. You need to reference it.
ModBuildConfig doesn't include a reference to it.
makes sense!
@thin estuary
oh i missed it
read only collections should be fine?
i've been using them for a while
but like, directly using a type like IReadOnlyList<Whatever>
didn't try making another interface that extends it
and yeah, i don't think i do covariance/contravariance at all
ugh
yeah, read only interfaces work they just don't have the concept of covariance/contravariance
i'm too dumb to make that work
no you're NOT
of course i am
Pintail is really a lot of spaghetti added on top of whatever was already there, handling every single new edge case that we happened upon
Hi, I'm zunder and I spend ridiculous amounts of effort to reimplement convenience features from ASP.NET for a mod that I will probably be the only person to write code for. ๐
But hey, at least I don't have to manually parse query string parameters for new API endpoint methods
Related: reflection still feels like dark magic
Even after... what, 11 years? Of using it
wait until you get to doing IL
Absolutely not lol
it's fun! Most of the time!
IL is close enough to basically being assembly that I should not be trusted with it
I have "fixed" my API by just switching out a type for object so that consumers don't need to have a reference to the type. It is a pretty non issue for Pintail, likely.
i've gotten to the point where about 80% of my transpilers using my Shrike library work on first try
I doubt anyone else is even coming close to my level of bullshittery.
the difference is that if you screw up assembly, you hard crash everything. if you screw up IL, often you only get a small complaint and your IL is just ignored
(unless you do something very bad, like mistyping)
but hard crashing everything is fun!
Thank f$&# for the CLR
It's great when all the feedback you get is SEGFAULT
worse when you don't even get those!
i do a lot.
partial has been a godsend here
Yeah but your a lot is less bullshit than my a lot. ๐
slaps roof of Theme Manager
This API can fit so many generics
at some point you may just... require a proper hard reference
I'm wrapping the content loader API. That's the main reason I've got so much generic going on in Theme Manager.
not gonna lie, not being able to just construct new instances of various types is painful
I love understanding what I did by not understanding it
like okay, made mod, happy, do again? Brain hurt
0.0 i wish i understood any of the stuff being talked about in the general chat lol
Activator.CreateInstance doesnโt work?
Not if you only have an interface, which is kind of the point of Pintail.
how would one construct an instance of an interface even in a theoretical sense
I missed the interface, though you could at least scan your loaded assemblies for things that implement it
yeah which works fine even if it's not pretty
In the context of pintail nothing implements the interface
Pintail is emitting a class that does
I gotta google pintail cause this sounds incredibly strange
Ahh
okay I'm seeing the idea here
not something I'd ever even think of using for the type of projects I actually work on
but for modding it makes sense
visual studio casually asking if i'd like to add a whole ML model
What's a little AI between friends, though
shipping my mod with a whole neural network and not warning people who download it ๐
any bug reports just say get some more ram
i mean you can just download more ram
just throw a bitcoin miner in there while you're at it
a couple protein folders, too
i know ur joking but surely that's against nexus tos lol
I would hope so 
just heard about one of the 1.6 easter eggs, & I was compelled to make a quick reskin 
(and also fix custom sprite support for these monsters in FTM)
what the hell
||terraria|| easter egg, it shows up in TAS form if you ||throw an ancient doll into mine level 100's lava||
concernedape with the oddly specific mechanics again, another masterpiece
I had to trim the horns a bit, the real version is like 42x32 
(and make the ||ball joint||)
I'm getting really tempted to just go read the full 1.6 changelog because avoiding spoilers is tiring
I keep seeing things in the decompile and have to more on quickly so I don't learn what that thing I don't recognize is
...oh, heck, I just noticed this is the off-topic channel 
I find it very funny that i was trying to add a item to the game and the bugs that happened...LMAO im still laughing over it
The item worked very well, it is a item that makes my NPC be eligible as a roommate:
But i didnt tested him fully, i was only going to test roommate stuff later
So i tried to divorce him: but that didnt work... So i FORCED it by using debug
Also didnt work! I went to sleep a couple days and he kept in the kitchen, hating on me instead of hugging LMAO
So i forced another debug, makeex....
Yes it didnt work either so as a another attempt i used the ||witch hut to erase his memories||
It worked, and the relationship got resetted but he kept in my house for some damn reason ๐ญ
As my last resource i tried the killnpc, which made him instantly vanish so i really thought it worked!
But guess what. Went to sleep and there he has...in the kitchen, as if nothing happened
Giving me breakfast again
This is strangely fitting for the character but i never saw a spouse/roommate that simply refused to leave and came back after death LMAOOO
In the end i just created another save
"Its not a bug, its a feature!" -The NPC
I have a really stupid question. how do I edit/create dll's? All I found was "they can be made with several different languages" Which didn't help too much. New to modding and I want to revive some dead sound mods for the community who wants that but I need a bit of help starting lol
DLL files are compiled C# code
(at least for Stardew. DLLs can be other stuff too)
you either need to find the source code for the mod, or decompile the DLL file to get something to work with
keep in mind you can't just take a mod and update it - not without permission
Thats fair, and I went to the mod makers disc but it was "Defunct" so I thought Id study up and make something derivative theoretically
Which as a lil baby noob I wanted to examine the dll for direction
Thank you btw @thin estuary :D
-waddles right on in- :D hello hello everyone. I come seeking advice. I want to get a better understanding of coding and require some base knowledge to understand what it is iโm doing instead of just copying tutorials and praying theyโll work.
Would anybody have any advice for a beginner who wants to learn the basics and grow?
My recommendation is to find a project you're interested in, that is also reasonable to finish with your skill level. You're right, just doing tutorials never really kept my attention for too long, and even when you're done it doesn't really feel like you did something yourself. That being said, it's actually kinda hard to find a good project until you have a good sense of what is and isn't easy. Saying "I'm going to make an entire video game" is a noble project, but that's a lot of work even for an experienced programmer.
So I would say to find something you think is cool, something ideally you'd use yourself, and something you can make good, solid progress on.
(Told you we'd have good advice for you here!
)
XD ideally I would enjoy making a small 2D game, but I also understand that that is an absolute beast of a goal to tackle with zero experience or knowledge. I canโt even comprehend what I would create in order to get started. Perhaps a database of some kind that would filter? But even then iโm worried it wouldnโt be applicable to what i eventually want to do.
:โ3 you were so right. everyone here is so knowledgable and kind.
That's always the challenge, deciding what you want to work on lol. I'm not sure what I can really recommend, as it depends on what you're interested in. I would say to try and come up with a project that has a clear, well-defined end goal. Even better if it has logical steps you can work towards so that you can see yourself making concrete progress.
Yes yes, itโs something that Iโm sure only I could figure out. Can I ask what you first attempted when you were just learning?
I can tell you what I did.
Work at the time had me copying data very carefully from one spreadsheet to another
It would take literal hours and was so easy to mess up
So I cracked open a textbook on VBA (excels scripting language) and automated it out of spite
lol I'm doing something kinda similar at work right now
I had done a few programming tutorial things, and there was a subreddit that posted daily programming challenges that I did for fun for a while, but when I was in grad school I decided to switch majors and thus was a bit behind the other students. So over that summer I did a few projects to try and get better at programming. The first was the make a website from scratch and learn how that worked, the second was to make a Discord bot (which is long since dead) and then the third was to do hacking of an NES game, which was definitely a "I bit off more than I could chew" project.
It's surprising how many tech people have this exact same backstory
XD i love the spite learning. I wanted to try and dip my toes in by doing a simple NPC mod, but it isnโt really that educational. I might search the subreddits for small daily challenges like that. At least until i have somewhat of a grasp on things before looking into game development.
Mods for stuff aren't a bad way to learn either, since you don't have to create things from scratch, you're working within a pre-defined system
I was having fun seeing little results as I worked through a youtube tutorial on how to create custom locations. Maybe I should focus on creating something like that to begin with. Maybe tackling individual sections of an npc would help me get some kind of grasp on it. Like locations, animations, heart events. That would feel more related to what my eventual goal would be as well.
Careful with any tutorials you're following that they're up-to-date. Since v1.6 just came out last month and changed a LOT of how mods are written, most older tutorials for v1.5 and before will no longer be accurate
NPCs are one of the more complex mods to make for Stardew, btw
Eh, it's fine, I think a sufficiently bullheaded person can do anything
!npc
Keep in mind that making NPCs is a complex process that requires learning many different aspects of Stardew modding. Here are a few links that can help get you started on all that you need to know:
- Familiarize yourself with the NPC wiki page (https://stardewvalleywiki.com/Modding:NPC_data) which covers the many components which comprise an NPC.
- Use Content Patcher (https://github.com/Pathoschild/StardewMods/blob/stable/ContentPatcher/docs/author-guide.md) to add your NPC to the game.
- See Lemurkat's blogpost on NPC-making (https://lemurkat.wordpress.com/2020/10/09/npc-creation-part-1/) for additional tips and tricks related to creating your new character.
- For changes made to NPCs in 1.6, see the migration guide (https://stardewvalleywiki.com/Modding:Migrate_to_Stardew_Valley_1.6). Custom NPCs received many QoL improvements with the new version.
This is a little on-topic for this channel, though
What is the joke? "We did it but because we thought it was hard, but because we thought it was easy. And by the time we realized we were wrong it was too late to turn back?%
Google suggested this one:
The Programmersโ Credo: we do these things not because they are easy, but because we thought they were going to be easy
Looking at existing files for mods seems to help my brain understand. Is it seen as acceptable to look to other peopleโs work and dissect it to get a better understanding? Obviously not snipping their actual work and taking it but for learning purposes?
I would say thats perfectly fine
Until the 30th of April, use code BIRTHDAY40 for 40% off any course, BIRTHDAY20 for 20% off any bundle and BIRTHDAY15 for 15% off your first year of Dometrain Pro: https://bit.ly/4aUVR8l
Become a Patreon and get special perks: https://www.patreon.com/nickchapsas
Hello, everybody, I'm Nick, and in this video I will show you how Exceptions got m...
Looking at existing mods is one of the best ways to understand how to interact with the game. Do keep in mind, though, that just because a mod does something one way, does not mean that it's the best or even recommended way to do that thing for you (or anyone). So always compare to current recommendations from the wiki and such.
for open source projects, yes, absolutely. for reverse engineering in general, knowledge of closed source or GPL-licensed stuff can actually compromise things a bit and is a gray area.
for examples - things like third party reimplementations of proprietary software (like a from-scratch minecraft server or something) require team members who have never decompiled the real thing because otherwise they can't distribute their own work because its then debatably derivative.
or in GPL's case (a license that used to be popular, and still is in the Linux community), their license is (unenforceably, but that's besides the point) aggressive and will try to infect everything you touch as GPL too. not particularly legal, but GPL is gross and you don't want to get it on your hands anyway.
[just Haphy's opinion, not legal advice or anything :p] </disclaimer>
I have taken advice and now the commands page isn't the full width https://stardew.chat/commands.php
there is also an expand all button now
Nice. That was on my list of SD-related things to PR
I think that page is in a pretty good place now
I should consolidate my CSS files tho, they're kind of a mess
Oh interesting
Most of my things are gpl
The revert and tilesheetclimbing commands have some funky HTML in them, might need to do some more escaping or something
The only other CSS thing I was going to add was something like
details[open] summary + * { margin-top: 0; }
details[open] :last-child { margin-bottom: 0; }
so that the padding stays consistent / applies properly, rather than the p tag adding extra spacing with its default margins
revert I think looks okay? tilesheetclimbing is.. concerning. I'm not sure I'm escaping HTML correctly. No one inject anything
revert has a <password`> element (yes including the `) being created
Which is causing some content to be eaten
hmm
In any case, I think thats the same issue as the other one, let me handle it correctly
It looks like < isn't being converted to <
Take a look at it now and see if it's still weird
notably, GPL licensing on a mod creates a paradox. according to the license everything that consumes it (like, say, the modloader or game itself) must also be GPL. which the modder can't control. so it could be posited that GPL is literally impossible to apply to mods or plugins of non-GPL software.
and seeing license follows things like snippets, hence my problem with the GPL ecosystem. spend too much time there and your ability to work in non-GPL spaces becomes compromised.
and that was done intentionally to create a forced open ecosystem with no closed parts. which is possibly a noble goal? but as someone who does work for other companies in ARR software... kinda icky for me personally.
Doesn't that only apply to software that is making modifications to the source code? I thought it's only things that build upon that software that have to adhere to the terms of the GPL
Otherwise you just have to make it available or whatever
GPL applies itself to the entire "software" which they define as the entirety of what the user would perceive as the entire application.
which is a vague and way too broad definition
its so broad that its enforcibility can be called to question for legal sanity. ...which to me just means pick a different license. but ymmv somehow? lol
By that definition, if I release a Firefox plugin under GPL, Firefox itself would have to become GPL
correct
LGPL was created to remedy that
which has an exception for host softwares that consume it
still way more baggage than i want in a license, personally. MIT is simple "i own this, but use it as you like". which for my purposes is a lot less of a minefield
so all my stuff is MIT
idk I think that's a bit of an extreme interpretation. Given that Firefox seems to have gotten away unscathed, idk if that argument would really hold up. But then again I'm not a lawyer, and I don't really use GPL either. I've grown to favor the BSD licenses of late
oh wait not BSD
it wouldnt hold up. you're correct. but why say a license is fine just because the gross parts dont hold up, when there are non gross licenses?
what are those called
and BSD is much nicer
CC is better for content like images and music
Actually what is my stuff licensed under
cc-by is the most common and says basically "do whatever you want with it as long as I get visible credit"
Mostly MIT or I couldnt be bothered
The two examples I mentioned earlier look good now
cc and mit are roughly equivalent, with cc being more easily applied to any medium, and MIT being specifically designed for code
nice
I was considering switching my mod from MIT to MPL so that changes have to be kept open source if I were to stop maintaining it for whatever reason and someone else takes it over
My understanding is that it's much less "aggresive" than the GPL ones
That's really what I want out of my licenses, to keep credit somewhere, and that it should remain open source
I think the attribution is always implied, but it seems like a lot of places that describe licenses don't mention that so much
attribution is very much not always implied. you can ask for it as a kindness, or you can use a license like cc-by to require it. cc-by-sa requires credit and that modifications be kept open source.
the -by is attribution requirement, the -sa is sharealike
Funnily, I very recently made the switch from LGPL to MPL for my mods.
Iโve always disliked GPL and related licenses for personal reasons, but I havenโt taken the time to read the MPL
The MIT license is at least easy to read
i think my biggest issue with GPL is that half the people using it don't actually understand what it is. and new people show up also not knowing and follow suit. and its such a long, verbose license that is incredibly hard to digest that the problem perpetuates, because its terms are, in my opinion, rather unreasonable.
to anyone using it, please read it and try to understand what you're using. it does have a valid use case, but i really don't think modding is appropriate under it. it exists to protect linux as FOSS.
anyway. </rant> sorry i am passionate about this stuff lol
Ah luckily for me I hold personal grudges a very long time so Iโve never been tempted ๐
but as someone who is passionate about licenses, if anyone wants some input on what license to choose, feel free to DM me. i can probably point towards one that fits your needs.
as opinion, of course, not advice. i am not a lawyer.
The fact we don't have any community license recommendations is odd to me...
For me for modding in general, I like MIT-like for general mods, but a license that forces the source of derivatives to remain open for framework mods.
I've just been using MIT on the basis that my code is ridiculous and no one would want to have to maintain it themselves.
MPL wouldn't be bad. ๐ค
It's the closest to LGPL I could find without being Gnu, so I count it as a huge win!
(I thought the community license rec was Pathos telling everyone to use MIT
)
Fair!
I think that the community recommendation has been โhave a licenseโ
It is a very good choice for mods.
and this page, which more or less does that, but links the "choosealicense.com" page: https://www.stardewvalleywiki.com/Modding:Open_source
Because just having a license is a great improvement to not having one
Oh, so we do have one!
I guess I just never went there.
I'm not sure where it's actually linked on the wiki, I just vaguely recalled it existing & searched for it
Iโve been there but not often
ah, down here 
แตโฟหกแตหขหข แถฆแตหข แดณแดพแดธ
That's actually a good point
๐คทโโ๏ธ it has flaws but within the context of modding it does at least allow people to fix the mods later *insofar as its issues already applied
I feel like MPL could be the gold standard for Stardew modding. It ensures the source of derivatives remains open, but isn't super infectious like GPL.
id agree it sounds like a nice default recommendation
(ill continue to use MIT but thats because i want people to steal use my stuff)
It's probably worth making an article on the wiki describing a few (including MIT and maybe one other) and justing saying "here's one we recommend for X Y Z reasons if you want a suggestion"
I like MIT for non-framework mods, and MPL for framework mods I think.
If other mods are going to depend on it, I absolutely want any derivatives to need the source to remain available.
cant "recommend" one on the wiki- the US has weird laws where any actual legal advice comes with liability. can explain someone's understanding/opinions freely, as long as its disclaimed such.
but then im the lady that reads all 2000 pages of every EULA. most people wont be so pedantic. lol
We could say โmany people in the community use X for Y reason, and Z for W reason, but this isnโt legal advice.โ
The wiki already technically recommends MIT as a default (briefly)
"Pathoschild prefers this one"
Whatโs that line from mean girls? I saw pathoschild use mit, so I did it too?
hmm
MPL does look nice
9 out of 10 Pathoschilds recommend MIT
there are 2100 species of barnacles. ten of them could certainly be pathos
Like the calteen bars thing?
Apparently the real quote is โI saw Cady Heron wearing Army pants and flip-flops, so I bought Army pants and flip-flops.โ
What a coincidence, I also saw Pathos wearing army pants and flip-flops
What about the third type of coder:
(Needless to say don't use either of the two I posted in actual production haha)
Like there is no reason to hand unroll a division by 10 that is literally one of the easiest compiler tricks
The fourth kind
char CheckGrade(int s) {
return 'C';
}```
Didn't prof hard-code the grade to be a D?
No if they pass they show up to complain in your office less
Has anyone been able to run sdv on github codespaces? Through vnc of course
Hi loves! A quick question, if I may: When one slaps a method down, like
ModEntry.EatPickles()
and it has the parentheses, that's called calling the method. But, when something is just slapped down, with no parentheses, what's that called?
Thanks!!!!
(The EatPickles is irrellevant, I am just desperately craving dill spears, maybe some of those little sweet Gherkins pickles....)
A field?
Might be looking for the phrase "method reference" ?
Are you talking about delegate methods?
I'm thinking like when you pass a named function to, say, a sort function. So you pass a method reference as a parameter to the sort function
Idk what c# calls them tho
Thanks everyone! You all are the best!!!
Welcome
This one is me I'm just like "uhhh idk how to thing lemme google it"
Ans thats the site i usually end up on
i'm the third type, but i have copilot do it for me
๐ค
Someone needs to design a carpal tunnel warm sleeve
This is programming related I swear
I have a little gel warmer but it jeeps falling off my arm
Programming socks (but for arms)
am i supposed to be wearing socks
I have hand-knit socks
Also I am ready to go back to armwarmers and stripy extensions in my hair tbh
Assetinvalidation works wonders for swapping out a thrown item for my mod but it crashes the game too
says it caused an error in the game's draw loop
How do i avoid this?
My mod creates a projectile. While the projectile is not null the weapon's texture becomes a plain transparent sprite after calling asset invalidate. After the projectile dissipates or comes back to me, i asset invalidate again after restoring the sprite
This works but it's causing the game to crash
Says something about disrupting the draw loop
yes, knee high ones at that
Do wellies count?
Just laughing at the image of trying to put shoes on over a pair of rain boots
That's only if you're on linux right?
Things I Googled today: "python switch fallthrough"
does python have switch statements at all?
div 10?
yup! it's a hand-unrolled divison by 10 (which you would never do these days)
I don't know, but with me, if/else still more perfer. Yes, performance is important but you need to let's others and yourself be able to understand what you are trying to do in one glance (first look, I mean, is "glance" right word?)
Over all, programming is "talking" with computer, right? It is programming "language", right?
(it's a joke, you would do neither in a real codebase.)
you would never actually unroll division by hand anymore, unless you were writing actual assembly or maybe some godawful language, because that's one of the easiest compiler tricks and most compilers do it for you
here's C#, for example:
not a single division instruction in sight, it's done with multiplication and shifts
I definitely wouldn't unroll a division by 10, unless I noticed the compiler isn't emitting it properly
But I might do it in the shader world, where you can't necessarily trust that it would be as fast as possible for a target platform
Shader devs are scary
When I want to feel inferior I'll go look at demos or shadertoy.
I was planned to build my mod like this picture
If it's unclear i will explain more detail
After 2 days read the code and find the correct way to spawn crow and manually move pet
I still don't know how should I expand the original Crow class, make crow be able to chased down by pet or like in the diagram, how should I design the crow "call others" mechanism
The hardest issue is the crow because the crow somehow feel like hard code
So if there is anyone have experience with this, or have any idea, please help
You forgot to put words on the paper :^)
Jk looks dope. Maybe u can use some overrides on the movement or patch the crow's behavior
it's the subtle things, like python using elif and capital letters for its booleans
elif gets me every time
but it goes both waysโI've typed elif in C# and had a Moment
:3
(i did not make this, just got it from AI cause its smarter to make cursed stuff)
there are some people at my company who would view this as perfectly logical code
The AI thought it really tied the room together when it put it there
Don't know how I've only just noticed this channel
Currently reading through the Postgres documentation for a personal project. This makes my head hurt
You can set a column's datatype to have a negative precision which means it will round to the left of the decimal point ๐
NUMERIC(2, -3) means the representable values for the column are [-xx000, xx000]
I guess itโs just a display preference that point right? Still weird though.
Found at work today: a random file named "tatus" that contains the output of a long forgotten git diff
What kind of half asleep git command did I do to generate that?
git patch files are just diffs saved into a file
so idk, probably like git diff > tatus
sounds like a typo of 'status'
It probably is! I just haven't q clue of what I typed to do that and not notice for days tbh
Or a strange way of writing taters ๐ฅ
Sometimes commit messages are truly fun.
I really do enjoy editing xml project configuration files by hand because it lost one of my files, grumpy today
One of my favorite series of commits in the past couple of weeks. Made some changes, ran the tests. A bunch of tests started failing and โw-100โ was appearing places it hadnโt before, so I updated the tests and committed, then updated the app dependencies and discovered that all the โw-100โs had disappeared again, and now all the tests were actually failing because I had โfixedโ them. Promptly undid all my test changes and recommitted 
Also a fan of adding mildly self-deprecating memes to my PRs at work 
was reading through this; I picked GPLv3 two weeks ago due to the definition of "copyleft". Although reading through the thread seems like it might have some issues. I like the idea of copyleft, so is there a license I should move to; or should I just switch my repo to MIT? It seems like the specifics of gpl can actually make it hard for others to use, where MIT might be what I want and make it the easiest for others to learn from/use.
MIT is more permissive. it lets people use your work in whatever way they like, and does not restrict or burden them. GPL can make it hard for others to use it, because they are only permitted to do so if they promise to keep things completely and totally open. Which sounds nice, but that literally means they can't use it up against anything they don't control the licensing for.
MIT doesn't have such a burden, they can use it in whatever context they like as long as they don't claim to be the original author.
MIT is simple, it's literally one block paragraph and a header line, mostly focused on disclaiming liability. Others like BSD and MPL are verbose licenses that use a whole lot of language to be more specific about things- too much language for me to simplify here, but they aren't burdened in the way that GPL is.
I'm increasingly a fan of creative commons licenses. CC0 for "do anything at all" (basically public domain); CC-BY for "by attribution - do anything as long as I get due credit", and CC-SA (or CC-BY-SA) for "sharealike - do anything but share your source changes" (bear in mind that sharing changes can be a burden).
Notably, creative commons licenses also work for content - MIT wasn't written with content in mind, it was specifically designed for code. So CC licenses are more adaptable in that regard. (While it shouldn't be a deciding factor, Creative Commons licenses also have a lovely website that includes linkable breakdowns of each license variant in simple terms, e.g. https://creativecommons.org/licenses/by/4.0/)
In short, my personal position is: Generally I'll go MIT or CC-BY if I want credit. BSD, MPL, Apache, and even MsPL are other reasonable (but considerably more verbose) licenses. I value simplicity and transparency, and I'm satisfied with the disclaimer of both MIT and CC, so I prefer not to use a license with all that extra language.
Also worth mentioning is that when I first started out, I was largely focused on sharealike and credit and stuff, for fear that people would go sell my work and profit off it in ways that I can't. Over time, I realized I am the soul of my projects. They can take the output so far, but even if they're outright trying to shortchange me, I have the source. The font of creativity. Because it's me. And a license doesn't give that away. So I relaxed on the legals a bit.
All of this is subjective opinion and not legal advice by any stretch of the imagination. Use your own judgement.
Many in here are moving towards using MPL as a nice middle ground between MIT and GPL
Keeps the codebase open source but less infectious than GPL
On mobile or I'd give more details, but choosealicense.org has some nice breakdowns
Another important thing for people to understand is that you issue licenses to others. If you properly own your own work, then you are not bound by those licenses you use for others. You can bind them to a share-alike license while doing closed-source stuff with it yourself. Secondly, you can issue different licenses to different people - but do realize that many licenses are irrevocable (can't change it later without the other party's agreement).
You can also dual license if you wish (some of my mods are)
That however is an OR not an AND
If I see a project that is licensed in a way that compromises what I'd like to do, occasionally I'll reach out to the author and see if they would license me separately so that my project can work.
Licenses are scary at first, but to be honest it's worth getting to understand at least the general ideas of them. A general understanding isn't too complicated, and is worth it because its literally all about making sure people are agreeing on how to share work with each other.
It's a cooperative concept (usually, lol).
All my stuff is MIT. I refuse to use any code (professionally) without a license and credit
If it's unlicensed reach out to authors. And if a project is closed source, reach out to the author for info on if you can decompile it
Super helpful and insightful, thank you 
me, tries to code something useful: no thought, head empy
also me when messing around: %0|%0
please do not do that line btw
Wow
pannenkoek videos are an instant watch from me. I have watched the entire thing
Look I like nerdy af videos but four hours????
What's a third monitor for if not Discord and a four hour video about the physics of a video game from 1996?
I have three monitors, but I can only concentrate on one at a time
Might just be my ADHD, but if I have Twitch up while I try to do anything I just end up watching it for 10 min, then doing something else for 30 seconds, then watching another 10 min
How does that have 1.1M views though? Like why would this many people care about the technical limitations of a 25+ year old game
pannenkoek got famous-ish because of the parallel universes thing that became a bit of a meme.
Yeah. This one is too.
Still, I'd rather fill my brain with useful stuff
yall think thats crazy
may i present to you
This is the complete first season of Fallout Series Fun Facts in one video. Eight hours of Fallout facts!
8 Hours of Useless Fallout Series Facts
FOLLOW MANTIS:
โบOfficial Site - https://www.tksmantis.com/
โบTikTok - https://www.tiktok.com/@tksmantisofficial
โบTwitch - https://www.twitch.tv/tksmantis
โบDiscord - https://discord.com/servers/tks-man...
:3
lol beautiful
Wish I could sort my watch history by length...
@paper adder i dont mind talking about Chatgpt and coding if you want
cool : )
hell ya
i've had the experience so far, doing something very simple (adding a custom NPC) and ChatGPT was pretty useful in troubleshooting basic problems with syntax
wasn't aware that there was a stigma against using it here, but i can see why because the structure for content patcher isn't as well documented as widely used languages
To answer your question, chatgpt isn't all too aware of conventions we use to mod Stardew Valley if at all. As such, while it can be helpful to get basic information about json or csharp, it is going to be wildly unhelpful in terms of specifics for modding.
simple you say... preceeds to make an NPC.... me struggling to add a single item
well i have experience with coding in a few different languages so reading .json files in the format content patcher uses can seem a lot easier in comparison
it's very personal
And specifically for this, its not a stigma. Its a fact that chatgpt will be hallucinating a lot of its code because as you also agree there is a lack of resources compared to more popular languages.
that's totally fair. i have a lot less experience using it for stardew modding, i'll take your word for it
there are so many questions asked in making mods general that get passed up, so i figured i'd suggest something that worked for me a couple times
i see why it can be a problem though, so i'll stick with what i can answer from personal experience 
Yup, I appreciate that lol. Btw if you know what you're doing, there's no issue with chatgpt. Its only when you're also not sure of the answer that its a little awkward
definitely can see that lol..
i love it for getting quick snippets of code when you give it proper context and direct instructions
ive used it to make entire basic code stuff, but i also do have the knowledge of how to change it to work, ive HAD to learn this because i can not code from scratch
can be such a huge time saver
i need a premade code to go off
im in a strange state of knowing how to code but not being able to at the same time
it can be a good exercise to try your best to write something and instead have a manual with you, or use w3schools on the side
coding anything is a constant state of asking questions, trying things, and researching
you're never going to know how to do everything
im on linux so i do kinda have to do coding on my own now, which has been rough but i have learned
Ah
fellow linux modder
its why i can code now! its just starting from 0 is still not possible yet. i have done from like Almost scratch though
yep
on NixOS so everything need to be coded into its system packages
and the rebuilt
๐ fellow nixos too lol
:3
yeah
i tried Linux mint, lubuntu, and Arch
none of which i liked
NixOS is just really nice to me
buuuut i broke it like 7 times and had to full reinstall before

Ah I run on a chromebook, got arch for gaming, debian for most things, and nixos for development
a whole month by this point and its only died like 3 times and ive been able to fix now that i know how to use the terminal
ive tried asking for people to give me random little things to try and ive failed a good amount of em
i have coder friends so they know easy stuff and im like... best i can do is printout
loll. well maybe set an objective to learn 1 new thing, and create a project around it!
my mind does not work like that sadly, ive decided itd be a good idea to learn, python, C#, NixOS, Javascript, Typescript all at once :3
(it was not... like at all)
Its okay take your time!
well you're in the SDV discord server, a stardew mod! And there's a github of ideas for mods somewhere
anything is worth something!!
