#programmers-off-topic

1 messages ยท Page 8 of 1

ivory shadow
#

It's sad that linq is slow, because it does look nice.

pliant snow
cinder karma
#

Same with collection init

#

Except for the case of an empty collection the codegen is straight nonsense

ivory shadow
#

Wait how did they give up collection init

cinder karma
#

So I only use it for empty collections or when I don't care about performance

ivory shadow
#

Fuck up. Thanks phone

cinder karma
#

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

thin estuary
#

you mean T[] newvar = [..list] or whatever the new syntax is, right?

cinder karma
#

Literally calling list.ToArray() is better

thin estuary
#

(i hate the syntax and refuse to ever use it)

cinder karma
#

I use it in events tester because events tester gets to ignore performance

ivory shadow
#

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

ivory shadow
#

I'm looking at some existing code and it has support for xnb mods and I'm like "well that's the first problem"

thin estuary
#

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

ivory shadow
#

It should at least display a giant warning message

thin estuary
#

i think they're also fine with extensions just showing messages and refusing to install stuff

ivory shadow
#

Like hey this kind of mod sucks and causes incompatibility issues are you really really sure you want it

thin estuary
#

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

ivory shadow
#

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];

cinder karma
#

Oh I see what in the collectionsmarshal they're doing there

ivory shadow
#

I see what is literally happening but it doesn't mean the compiler shouldn't know better.

cinder karma
#

Yeah

#

What does it look like as assembly?

pliant snow
#

Because it is

umbral pecan
#

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?

cinder karma
#

Ugh godbolt doesn't have net 8 yet

crystal wren
cinder karma
#

I'll explain it when I get home

#

I recognize that pattern

cinder karma
umbral pecan
#

trie ๐Ÿ”ฌSDVpuffereyes - time to learn something new

ivory shadow
cinder karma
#

I'm not at my computer but I'll look in a few hours

ivory shadow
#

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.

thin estuary
#

I hate that suggestion

ivory shadow
#

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

thin estuary
#

Iโ€™m not going anywhere near the .. syntax

cinder karma
#

Love how VSC is autocompleting float to FloatingPointError

#

I enjoy my type signatures of Optional[FloatingPointError]

#

Also python ternaries are bad

ivory shadow
#

I'm glad it's an optional error. I hate mandatory errors.

deep drum
#

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?

thin estuary
#

SMAPI loads libraries by name, and doesn't load duplicates

#

unless you're specifically asking about C#/.NET, not SMAPI

deep drum
#

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

thin estuary
#

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"

earnest cairn
lethal walrus
#

I would like to correct myself on this: I tried to install void Linux but same issue as arch, its actually kubuntu

pliant snow
#

Why didnt arch install

cinder karma
#

VS refactoring support is pretty good

#

I miss being able to select some code and go "no, try being a ternary now"

cinder karma
#

Threeeee for loops in and stilllll going

silent sky
#

anyone got experience with SQLite ...?

pliant snow
#

Ye

silent sky
#

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...

pliant snow
#

I like it a lot more than the other SQL software, as it's just a file you open, no fuss

silent sky
#

yeah

#

but i've never done SQL or databases before ๐Ÿ‘€

pliant snow
#

a new beginning

silent sky
#

hahaha

#

the coursework is like, you have to make a piece of software for a 'client'

#

im doing a... stock, sales, and customer tracker ๐Ÿ˜ด

safe dragon
#

sqlite is definitely the most convenient one and works perfectly fine most of the time

silent sky
#

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

marble jewel
#

If you're working with transactions make sure they are getting committed to the database

silent sky
#

as i say i've never done SQL before lol

marble jewel
#

I'm not sure if your column types are what I would use

#

Does DB Viewer show your table as being created?

pliant snow
#

You have the CommandText, but do you ever actually use it?

silent sky
marble jewel
#

I'd step out of the form for a second and make sure the SQL logic works

silent sky
pliant snow
#

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

marble jewel
#

From an application like DB Browser Lite you can manually write the queries and get helpful messages if your sql is incorrect

pliant snow
#

idk about C#

marble jewel
#

For example, BOOL probably should be bit

marble jewel
#

TEXT should be a VARCHAR field of sorts

pliant snow
#

TEXT is fine for SQLite

#

so is bool iirc

#

Yeah, my guess is that there are execute steps missing

silent sky
#

i believe i need to do this actually

#

makeTableCommand.Transaction = makeTableTransaction;

#

set the command to belong to that transaction lol

marble jewel
#

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.

silent sky
#

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?

pliant snow
#

nice

marble jewel
#

Awesome, that's a good sign. So whatever is wrong is particular to the application then.

pliant snow
#

that implies its in the C# code

marble jewel
#

Try logging the variables to make sure they hold the values you expect.

silent sky
#

i'll breakpoint at each step of the way to see what's what shall i

pliant snow
#

why breakpoint when you can add a million print statements

safe dragon
#

are you trying to create the table again every single time?

silent sky
safe dragon
#

every time this button is pressed

silent sky
#

i delete and recreate the database every time i run the program to test it

safe dragon
#

ah

#

a check whether it already exists might be nice either way but probably not the issue then

silent sky
#

let's go!

safe dragon
#

nice

silent sky
#

now to work on the rest of the program ๐Ÿ˜… thanks guys !
i needed to .ExecuteNonQuery() for each command lol im a dumbass

#

ty all :)

pliant snow
#

muhaha i was right

safe dragon
#

the rest of the program and probably no plaintext passwords peepohappy

pliant snow
#

I can't tell if its vulnerable to a SQL injection or if thats recommended

safe dragon
#

it's not

pliant snow
#

not what

safe dragon
#

not vulnerable

pliant snow
#

ah

silent sky
silent sky
safe dragon
#

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

marble jewel
#

Remember, hash and salt so that you aren't vulnerable to a hash table attack

silent sky
#

like a checksum

pliant snow
#

if they're the same password, yes (which is a common exploit in the wild)

safe dragon
#

technically hash collisions are a potential thing that can happen yes

pliant snow
#

thats what that salting helps prevents, as mentioned earlier

marble jewel
#

They are so statistically unlikely that in real world you don't worry about that too much

silent sky
#

i've never heard of salting before

marble jewel
#

Salting just makes sure your hash is unique

silent sky
#

oh okay

marble jewel
#

Unique to your application that is

silent sky
#

is my teacher just shit for not teaching us any of this hahaha

pliant snow
#

salting adds extra data when you hash, so that two identical passwords will have different hashes

#

depends how far along you are

safe dragon
#

unless they also use the same salt...

pliant snow
#

going thru all the trouble of salting, only to use the same salt everytime would be something

silent sky
#

this can come later for me ๐Ÿ˜… it all sounds really complicated for now lol

safe dragon
#

all this isn't particularly important if it's just a hobby project but it might be good to just learn some best practices

silent sky
#

yeah

pliant snow
#

the real secret is to never actually handle anyones passwords as its more work than its worth

marble jewel
#

Yeah, trustless systems nowadays don't even need the concept of a passwords. Passwords are inherently insecure.

silent sky
#

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

safe dragon
#

we make Amazon cognito deal with that for us now at work... we used to do it ourselves but it was not pretty

pliant snow
#

yeah, since its just an SQL course they probs wont cover it much if at all

safe dragon
#

the important thing then is learning to use databases themselves

silent sky
#

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 :)

cinder karma
#

Okay, there are two reasons to salt

#
  1. 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

#
  1. 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

#
  1. Salting food makes it actually taste good
mint marsh
#

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!

sonic mirage
dense fulcrum
#

Hi, someone who knows JavaScript, could you help me with a small problem I have with a TreeView?

strange copper
dense fulcrum
#

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

strange copper
#

What does your code look like? What is the expected behavior of the code?

dense fulcrum
#

The parents of "Access, General and Reports" when checking them if their children mark me but the father of "All Screens" does not

#

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

strange copper
#

If they are only parents or only children, but not both, that might be your issue

dense fulcrum
#

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?

strange copper
#

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

dense fulcrum
#

oh ok, I get it

#

I will try, thank you very much

strange copper
#

I hope you're able to get it figured out :)

dense fulcrum
#

Hi, I couldn't fix it, I don't know how to do it. SDVpufferwaaah

dark veldt
vivid bridge
#

anyone know why this AHK script causes permanent clicking? forcing me to interact with stuff

uncut seal
#

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

thin estuary
#

so, the problem is that null is only really a null for reference (class) types

uncut seal
#

so it couldn't work if T is int?

thin estuary
#

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

uncut seal
#

I see, thank you

thin estuary
#

but you won't be able to name them the same, at least not in the same type

uncut seal
#

I'll just pass null as an argument when I need the default to be null

#

and see what it does

thin estuary
#

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

uncut seal
thin estuary
#

also also, you probably should be using TryGetValue for that implementation anyway, if you don't want to use GetValueOrDefault

uncut seal
thin estuary
#

ah, you have a <string, object?> dictionary... weird

uncut seal
#

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

cinder karma
#

Why are you manually parsing a json?

uncut seal
#

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

cinder karma
#

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)

uncut seal
#

I need to check individual fields depending if they're optional or not anyway, so I'll keep it this way for now

ivory shadow
#

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.

crystal wren
#

I've looked into creating a mod template project, but then immediately backed off when I saw how... strange the process was.

ivory shadow
#

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.)

uncut seal
sonic mirage
crystal wren
#

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.

sonic mirage
#

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

crystal wren
#

I suppose the common csproj could just be internal to a nuget package or something...

cinder karma
#

I feel like everyone develops their own common csproj if they stick around for long enough

ivory shadow
#

Yeah, it's easy enough to do two templates. One for a single project and one for a monorepo with a common project.

crystal wren
#

And no options without the manifest builder, because god damn it that thing is just good practice at this point.

ivory shadow
#

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.

umbral pecan
#

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.

ivory shadow
#

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.

cinder karma
#

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

silent sky
#

i'm back again ๐Ÿ˜…

#

anybody know what this error means in this context? the good old internet has been of no help...

crystal wren
#

Discord appears to have just added security key support! SDVkrobusnaughty

lethal walrus
#

for 2fa, I assume?

crystal wren
#

I assume, though it would be pretty cool if it allowed them as the sole factor.

silent sky
#

didn't it already have that ?

crystal wren
#

2FA yes, but security key like... a Yubikey or presumably passkeys!

silent sky
#

OH

lethal walrus
#

that's the.. third? thing I've seen support it

cinder karma
#

Ahhhhhh yayyyy

lethal walrus
#

i wonder if i can make a raspberry pi security key

crystal wren
#

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!

lethal walrus
silent sky
#

why would 1 not parse to true...? wtf C#

pliant snow
#

i bought a yubikey

#

its neat, but honestly not as amazing as one would hope

crystal wren
#

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.

sonic mirage
# silent sky what

C# is strongly-typed, so it's not going to parse a string as a bool unless told to

lethal walrus
silent sky
sonic mirage
#

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"

silent sky
#

looks like 'string == "1"' will have to do for now

sonic mirage
#

So you can just compare against "1" to save yourself some time

ivory shadow
#

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.

sonic mirage
ivory shadow
#

Yeah, good point. I'll add that.

sonic mirage
#

Otherwise that's a great base for someone to start with, for sure.

ivory shadow
#

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.

cinder karma
#

Why does python copy my dictionary backwards sometimes?????

crystal wren
#

Just to keep you on your toes and make sure you're not erroneously expecting any kind of sensible order.

strange copper
#

aren't dictionaries unordered

crystal wren
#

Knowing Python I wouldn't be entirely shocked if they did have an order, mind you. SDVkrobusgiggle

pliant snow
#

IIRC they're not guarenteed to have an order, although often times they tend to stay in the same order

frosty echo
#

I think that was changed somewhat recently?

cinder karma
#

Yes

#

Dictionaries in python are ordered

#

I expected the order to be the same for a copied dictionary

pliant snow
#

how did you copy it

pliant snow
safe dragon
#

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

cinder karma
earnest cairn
#

python introduced ordered dicts a while back

ivory shadow
#

This monorepo template is pretty chunky. So many comments.

pliant snow
#

I've grown quite fond of atuin

tropic anchor
#

Working on docs again

cinder karma
#

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 ...

sand frost
#

Java Wonโ€™t fix

lethal walrus
#

Is that the rust 10/10 cve thing

earnest cairn
#

k Rider isnt perfect either SDVpuffersquee

earnest cairn
#

can we use .NET8 for SDV pathos SDVpufferheart

thin estuary
#

SMAPI would need to come with its own .NET

#

Is that a Rider limitation?

earnest cairn
#

Im trying to use Rider cus Im used to IntelliJ because of work

#

buuut so far it's.. meh :p

pliant snow
#

You'll get .NET 6 and you'll like it

cinder karma
#

You use intellij for work?

dapper sinew
#

that moment when you have to use notepad because you forgor to install a IDE on second boot

safe dragon
#

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

cinder karma
#

lol

#

vim supremacy

safe dragon
#

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

cinder karma
#

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

ivory shadow
#

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.

cinder karma
#

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

fierce meteor
#

guyssss is there any IDE that supports C# hot reload on ARM64 macs?

crystal wren
#

I know Rider doesn't work, but... it might be worth trying the whole built-in dotnet watch method?

fierce meteor
#

dotnet watch doesn't work with dlls right?

#

i think it needs the app to be runnable to have hot reload

crystal wren
#

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!

fierce meteor
#

lol interestingly you can't add separate watch and run targets

willow knot
#

IM DOING IT

#

IM CODING

strange copper
#

let him cook fr

willow knot
#

okay

#

i cant get this to work

#

how do i assign a variable based on an input

#

like this

#

i tried like

lethal walrus
#

Z = input('h')

willow knot
#

if input is she gender will =1

#

OH

lethal walrus
#

You don't need () around ifs in python btw

#

if x == y: will work

willow knot
#

i tried tha tlemme try again

#

i get no error but its not printing what i need

lethal walrus
#

Also, would recommend not setting a variable called input,

willow knot
#

how do i make it so that the user input detemines the value of gender

lethal walrus
#

gender = input("what's your gender")

#

Like you did for user

willow knot
#

hmm

#

myt old code hasd that and then

#

hmm maybe a secondary

lethal walrus
#

Then you do gender == "she"

#

Wdym?

willow knot
#

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

lethal walrus
#

if gender in ['a','b']:

willow knot
#

and 'a' or 'b' wpuld be the inputs required to get that output right

lethal walrus
#

You could also do

g = ['a','b']
if gender in g:
willow knot
#

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

willow knot
#

or am i allowed to do like g1 = ['a', 'b']

lethal walrus
#

Yes

willow knot
#

SWEET

lethal walrus
#

Just don't do 1g

willow knot
#

letter before number got it

tropic anchor
#

a123082104798: sure
1aoijbojeoj: nope, not doing it

willow knot
#

i feel like

#

i really like this

tropic anchor
#

not a python thing either, all languages have something against starting variable names with numbers

willow knot
#

ive trie dcode but i think when i tried last time i went in way over my head

#

ill keep that in mind

tropic anchor
willow knot
#

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++

cinder karma
#

(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

tropic anchor
#

It's a good way to get familiar with OOP, but for general purpose, meh...

willow knot
#

i like it bc it has IDLE so i can easily test code

cinder karma
#

IDLE is also, uh

#

not great.

willow knot
#

ill take what i can get

#

thats wy i asked here im not deying the error things werent always helpful

cinder karma
#

I would recommend using jupyter over idle

willow knot
#

ill look into it

#

is the list case sensitive

tropic anchor
willow knot
#

like if im doing my list for g1 does she and She have to be se[perate

lethal walrus
#

You can run lower() on the input

cinder karma
#

yeah, casing in python is kinda annoying, the way you have it, it's case senstiive

willow knot
#

oh right

#

thank you

cinder karma
#

you can run .casefold() on the input

#

(not .lower())

#

(these are the subtle things as to why I hate casing in python, btw)

willow knot
#

so like i do like gender = input and then gender.casefold() and then if whatever whatever

cinder karma
#

the difference is that .casefold is consistent, .lower does weird things depending on language settings

#

yup!

willow knot
#

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

cinder karma
#

yup!

willow knot
#

it didnt work

#

just forgoing the else did tho

#

hold on

#

elif

#

IT WORKED

#

my first ever code

#

i feel so accomplished

crystal wren
#

And hey, if you want additional motivation (while I don't love Python either)... you're learning what Bouncer was written in! SDVkrobusgiggle

cinder karma
#

I used to love python

#

Then i learned Rust

#

Pls insert jealous girlfriend meme

fierce meteor
#

@crystal wren i got hot reload working on mac with dotnet watch

#

don't worry I'll put the instructions on github ASAP

crystal wren
#

Those... might actually be super useful for me on Linux, so that'll be great!

fierce meteor
#

yeah I'll do it tomorrow and tag you and other mac devs i know of

#

thanks for the lead

willow knot
#

I FIGURED OUT HOW TO USE PIP

#

@cinder karma do you recc jupyter lab or notebook

strange copper
#

apparently it's different from lower on 297 characters in unicode

willow knot
#

i was told its more reliable than lower due to language stuff

#

it got me the results i wanted so im not complaining

strange copper
#

i mean you're only working with standard querty keyboard characters rn anyway

#

so it doesn't particularly matter

willow knot
#

yeha but

#

id rahter get used to it now than have it be an issue later

safe dragon
#

what kind of characters behave differently for the two anyway

strange copper
#

i'm not saying ur wrong ๐Ÿ˜ญ i've just never seen it

willow knot
#

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

safe dragon
#

yeah I mean there's probably little downside to using it

strange copper
willow knot
#

yeah

#

oh well now i know two ways to do that

safe dragon
#

that's a strange character to "lower"...

strange copper
willow knot
#

thankfully this is jsut me sitting at my desk trying to learn basics so i dont have that issue

strange copper
#

i wonder if it's similar to toLocaleLowercase?

#

in other langs

willow knot
#

ยฏ_(ใƒ„)_/ยฏ

safe dragon
#

germans wouldn't be very happy if รŸ was lowered to ss I think

willow knot
#

probably not but

#

makes the same sound

safe dragon
#

welcome to the world of localization TakoTired

#

we do have german clients so it'd be important

willow knot
#

thats for furure me to deal with

strange copper
#

i wonder what happens if you casefold characters like kanji

#

you can't really lowercase a kanji can you?

safe dragon
#

none of the japanese writing systems have a concept of lowercase/uppercase

strange copper
#

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

safe dragon
#

kanji don't have a consistent romanization to begin with

strange copper
#

yeah ok it doesn't do anything

safe dragon
#

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

strange copper
#

python whipping out its kanji reading dictionary like ๐Ÿ˜ญ

willow knot
#

LOL

#

I'm glad I'm learning to code i know it's gonna be difficult but I'm having fun

safe dragon
#

it do be fun

willow knot
#

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!!!

crystal wren
#

Sometimes things even work on the first try.

That's when you worry something else has gone wrong.

sand frost
#

Depends on how many lines it took ๐Ÿ˜›

strange copper
#

me when my edge detection assignment finally works

ivory shadow
#

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.

strange copper
#

love the little lizard

ivory shadow
#

It makes sense that value types would be initialized and then have their constructors called, but I definitely did not expect it.

umbral pecan
#

What is IL? Iโ€™ve seen you mention it a few times.

ivory shadow
#

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.

safe dragon
#

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

cinder karma
#

Mira for rust too

ivory shadow
#

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.

sonic mirage
#

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

ivory shadow
#

When can we get a bot that yells at people teaches people who post multi-line JSON blocks without using ``` blocks that they exist

dapper sinew
#

it was... very eye opening

fierce meteor
cinder karma
#

somtimes c# syntax is pretty

#

but you bet your ass it took five tries to remember this syntax haha

pliant snow
#

tfw your professor has hardcoded your grade to be a D SDVpufferpensive

safe dragon
#

rough

tropic anchor
#

A 6 is a D, 5.5 is a passing grade here, a 6 is sometimes considered high

safe dragon
#

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

tropic anchor
#

No need to dig deep for that, it's on my nexus page ๐Ÿ‡ณ๐Ÿ‡ฑ

safe dragon
#

I checked that after hc_pensive

strange copper
#

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

ivory shadow
#

@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.

cinder karma
#

I recall it being eager

tropic anchor
ivory shadow
#

omg I think I may have discovered the problem

willow knot
#

I MADE A CODE WITH A RANDOMIZER AND USING INPUT AND MADE IT REPEAT

#

ITS AN OPTIONAL TRY AGAIN FUNCTION!!!

ivory shadow
#

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

fringe grove
willow knot
#

im sure theres an easier way than copy pasting the whole code into a def repeat() function BUT I DID IT

ivory shadow
#

I added BmFont to my client project's references, and uncommented the relevant lines out, and now it works.

fringe grove
#

which is a thing the netherlands does at least for central exams

willow knot
#

whats bmfont

safe dragon
#

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

ivory shadow
#

BmFont is the library used for SpriteText rendering.

willow knot
#

wh

#

whats sprite text

#

sorry

#

im VERY new

#

and i wanna learn all i can even if its not currently applicable to me

fringe grove
#

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)

willow knot
#

oh yeah that saved my senior year grades i got a full passing grade on every single supject for second semester

ivory shadow
#

SpriteText is one of two methods Stardew uses for rendering text. The bigger, more stylized one.

fringe grove
#

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

safe dragon
#

the nightmare that is font rendering

tropic anchor
fringe grove
#

yea, except for central exams i haven't seen it myself either

safe dragon
#

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

fringe grove
#

interesting, for my school it would vary per subject usually

#

though in the last 2 years most ended up being equivalent to percentages

tropic anchor
willow knot
#

do you think jumping from a relativley simple team randomizer to a stardew mod would be too bug of a leap

ivory shadow
#

@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.

cinder karma
#

Or covariance at the generics

#

Thank you so much for looking into it!

ivory shadow
#

Hell yeah my API is working now in all its hugeness

cinder karma
#

why does the other binary not see bmfont

ivory shadow
#

Just doesn't have a reference to BmFont. You need to reference it.

#

ModBuildConfig doesn't include a reference to it.

cinder karma
#

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

cinder karma
#

yeah, read only interfaces work they just don't have the concept of covariance/contravariance

thin estuary
#

i'm too dumb to make that work

cinder karma
#

no you're NOT

thin estuary
#

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

kind marlin
#

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

thin estuary
#

wait until you get to doing IL

kind marlin
#

Absolutely not lol

cinder karma
#

it's fun! Most of the time!

kind marlin
#

IL is close enough to basically being assembly that I should not be trusted with it

ivory shadow
#

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.

thin estuary
#

i've gotten to the point where about 80% of my transpilers using my Shrike library work on first try

ivory shadow
#

I doubt anyone else is even coming close to my level of bullshittery.

thin estuary
#

(unless you do something very bad, like mistyping)

cinder karma
#

but hard crashing everything is fun!

kind marlin
#

Thank f$&# for the CLR

cinder karma
#

It's great when all the feedback you get is SEGFAULT

#

worse when you don't even get those!

ivory shadow
#

Yeah but your a lot is less bullshit than my a lot. ๐Ÿ˜›

#

slaps roof of Theme Manager
This API can fit so many generics

thin estuary
#

at some point you may just... require a proper hard reference

ivory shadow
#

I'm wrapping the content loader API. That's the main reason I've got so much generic going on in Theme Manager.

thin estuary
#

not gonna lie, not being able to just construct new instances of various types is painful

ebon canopy
#

I love understanding what I did by not understanding it

#

like okay, made mod, happy, do again? Brain hurt

rain lotus
#

0.0 i wish i understood any of the stuff being talked about in the general chat lol

ebon cypress
ivory shadow
#

Not if you only have an interface, which is kind of the point of Pintail.

safe dragon
#

how would one construct an instance of an interface even in a theoretical sense

ebon cypress
#

I missed the interface, though you could at least scan your loaded assemblies for things that implement it

safe dragon
#

yeah which works fine even if it's not pretty

cinder karma
#

In the context of pintail nothing implements the interface

#

Pintail is emitting a class that does

safe dragon
#

I gotta google pintail cause this sounds incredibly strange

ebon cypress
#

Ahh

safe dragon
#

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

strange copper
#

visual studio casually asking if i'd like to add a whole ML model

sonic mirage
#

What's a little AI between friends, though

strange copper
#

shipping my mod with a whole neural network and not warning people who download it ๐Ÿ˜Œ

#

any bug reports just say get some more ram

sonic mirage
#

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

strange copper
sonic mirage
#

I would hope so SDVkrobusgiggle

tranquil grove
#

just heard about one of the 1.6 easter eggs, & I was compelled to make a quick reskin SDVpufferwoke
(and also fix custom sprite support for these monsters in FTM)

cinder karma
#

what the hell

tranquil grove
#

||terraria|| easter egg, it shows up in TAS form if you ||throw an ancient doll into mine level 100's lava||

strange copper
#

concernedape with the oddly specific mechanics again, another masterpiece

tranquil grove
#

I had to trim the horns a bit, the real version is like 42x32 SDVkrobusgiggle
(and make the ||ball joint||)

sonic mirage
#

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

tranquil grove
#

...oh, heck, I just noticed this is the off-topic channel SDVpufferdizzy

hard arch
#

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

jade hazel
#

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

thin estuary
#

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

jade hazel
#

Which as a lil baby noob I wanted to examine the dll for direction

#

Thank you btw @thin estuary :D

slim dirge
#

-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?

pliant snow
#

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.

crystal wren
#

(Told you we'd have good advice for you here! SDVkrobusgiggle)

slim dirge
#

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.

pliant snow
#

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.

slim dirge
#

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?

cinder karma
#

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

pliant snow
#

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.

frosty robin
slim dirge
#

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.

pliant snow
#

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

slim dirge
#

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.

sonic mirage
#

NPCs are one of the more complex mods to make for Stardew, btw

cinder karma
#

Eh, it's fine, I think a sufficiently bullheaded person can do anything

sonic mirage
#

!npc

indigo mistBOT
#

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:

  1. Familiarize yourself with the NPC wiki page (https://stardewvalleywiki.com/Modding:NPC_data) which covers the many components which comprise an NPC.
  2. Use Content Patcher (https://github.com/Pathoschild/StardewMods/blob/stable/ContentPatcher/docs/author-guide.md) to add your NPC to the game.
  3. 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.
  4. 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.
sonic mirage
#

This is a little on-topic for this channel, though

cinder karma
#

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?%

sonic mirage
#

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

slim dirge
#

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?

pliant snow
#

I would say thats perfectly fine

cinder karma
sonic mirage
prime prism
#

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>

pliant snow
#

there is also an expand all button now

sonic mirage
#

Nice. That was on my list of SD-related things to PR

pliant snow
#

I think that page is in a pretty good place now

#

I should consolidate my CSS files tho, they're kind of a mess

lethal walrus
#

Most of my things are gpl

sonic mirage
sonic mirage
pliant snow
#

revert I think looks okay? tilesheetclimbing is.. concerning. I'm not sure I'm escaping HTML correctly. No one inject anything

sonic mirage
#

revert has a <password`> element (yes including the `) being created

#

Which is causing some content to be eaten

pliant snow
#

In any case, I think thats the same issue as the other one, let me handle it correctly

sonic mirage
#

It looks like < isn't being converted to <

pliant snow
#

Take a look at it now and see if it's still weird

prime prism
# lethal walrus Most of my things are gpl

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.

pliant snow
#

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

prime prism
#

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

pliant snow
#

By that definition, if I release a Firefox plugin under GPL, Firefox itself would have to become GPL

prime prism
#

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

pliant snow
#

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

prime prism
#

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?

pliant snow
#

what are those called

prime prism
#

and BSD is much nicer

pliant snow
#

The CC ones, that's it

#

they all confuse me lol

prime prism
#

CC is better for content like images and music

pliant snow
#

Actually what is my stuff licensed under

prime prism
#

cc-by is the most common and says basically "do whatever you want with it as long as I get visible credit"

pliant snow
#

Mostly MIT or I couldnt be bothered

sonic mirage
prime prism
#

cc and mit are roughly equivalent, with cc being more easily applied to any medium, and MIT being specifically designed for code

sonic mirage
#

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

pliant snow
#

That's really what I want out of my licenses, to keep credit somewhere, and that it should remain open source

sonic mirage
#

I think the attribution is always implied, but it seems like a lot of places that describe licenses don't mention that so much

prime prism
#

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

crystal wren
#

Funnily, I very recently made the switch from LGPL to MPL for my mods.

sand frost
#

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

prime prism
#

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

sand frost
#

Ah luckily for me I hold personal grudges a very long time so Iโ€™ve never been tempted ๐Ÿ˜›

prime prism
#

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.

crystal wren
#

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.

ivory shadow
#

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. ๐Ÿค”

crystal wren
#

It's the closest to LGPL I could find without being Gnu, so I count it as a huge win!

tranquil grove
#

(I thought the community license rec was Pathos telling everyone to use MIT SDVkrobusgiggle )

crystal wren
#

Fair!

sand frost
#

I think that the community recommendation has been โ€œhave a licenseโ€

crystal wren
#

It is a very good choice for mods.

tranquil grove
sand frost
#

Because just having a license is a great improvement to not having one

crystal wren
#

I guess I just never went there.

tranquil grove
#

I'm not sure where it's actually linked on the wiki, I just vaguely recalled it existing & searched for it

sand frost
#

Iโ€™ve been there but not often

tranquil grove
#

ah, down here SDVkrobusgiggle

prime prism
pliant snow
sand frost
#

๐Ÿคทโ€โ™€๏ธ 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

crystal wren
#

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.

prime prism
#

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)

pliant snow
#

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"

crystal wren
#

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.

prime prism
#

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

sand frost
#

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)

pliant snow
#

"Pathoschild prefers this one"

sand frost
#

Whatโ€™s that line from mean girls? I saw pathoschild use mit, so I did it too?

lethal walrus
#

hmm
MPL does look nice

prime prism
#

9 out of 10 Pathoschilds recommend MIT

lethal walrus
#

I really don't know why my converters are GPL

#

but my mods are mit

cinder karma
#

Huh is that why he is so productive

#

There are ten barnacles of him?

prime prism
#

there are 2100 species of barnacles. ten of them could certainly be pathos

strange copper
sand frost
#

Apparently the real quote is โ€œI saw Cady Heron wearing Army pants and flip-flops, so I bought Army pants and flip-flops.โ€

strange copper
#

that sounds right

#

like after she becomes a plastic

gaunt wadi
#

What a coincidence, I also saw Pathos wearing army pants and flip-flops

cinder karma
#

the two types of coders:

ivory shadow
#

What about the third type of coder:

cinder karma
#

(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

pliant snow
#

The fourth kind

char CheckGrade(int s) {
    return 'C';
}```
cinder karma
#

Didn't prof hard-code the grade to be a D?

pliant snow
#

No if they pass they show up to complain in your office less

fierce meteor
#

Has anyone been able to run sdv on github codespaces? Through vnc of course

fleet oriole
#

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....)

fierce meteor
#

A field?

strange copper
#

Might be looking for the phrase "method reference" ?

fierce meteor
#

Are you talking about delegate methods?

strange copper
#

Idk what c# calls them tho

fierce meteor
#

Delegate methods

#

C calls them function pointers

strange copper
#

Yeah that's the vibe

#

Apryll might just be thinking of fields tho like u said lol

fleet oriole
#

Thanks everyone! You all are the best!!!

fierce meteor
#

Welcome

willow knot
#

Ans thats the site i usually end up on

umbral pecan
#

i'm the third type, but i have copilot do it for me aSDVmarutinker ๐Ÿค–

cinder karma
#

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

ivory shadow
#

Programming socks (but for arms)

pliant snow
#

am i supposed to be wearing socks

cinder karma
#

I have hand-knit socks

#

Also I am ready to go back to armwarmers and stripy extensions in my hair tbh

fierce meteor
#

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

leaden marsh
umbral pecan
#

Do wellies count?

#

Just laughing at the image of trying to put shoes on over a pair of rain boots

tropic anchor
cinder karma
#

Things I Googled today: "python switch fallthrough"

pliant snow
#

does python have switch statements at all?

cinder karma
#

Er. It has match statements

#

Close enough in my book

pliant snow
#

does it?

#

oh they do

#

3.10 added them huh

#

I should use them more...

cinder karma
#

They were broken on first release

#

Not broken

#

Just really inexplicably slow

modest jewel
cinder karma
#

yup! it's a hand-unrolled divison by 10 (which you would never do these days)

modest jewel
#

Over all, programming is "talking" with computer, right? It is programming "language", right?

cinder karma
#

(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

leaden marsh
#

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

cinder karma
#

Shader devs are scary

ivory shadow
#

When I want to feel inferior I'll go look at demos or shadertoy.

modest jewel
#

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

dry spear
#

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

cinder karma
#

it's the subtle things, like python using elif and capital letters for its booleans

sand frost
#

elif gets me every time

#

but it goes both waysโ€”I've typed elif in C# and had a Moment

dapper sinew
#

:3

#

(i did not make this, just got it from AI cause its smarter to make cursed stuff)

pliant snow
#

there are some people at my company who would view this as perfectly logical code

cinder karma
#

the more I read it the more cursed it gets

#

why is the memoize decorator on THAT?

sonic mirage
#

The AI thought it really tied the room together when it put it there

scarlet hollow
#

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]

umbral pecan
#

I guess itโ€™s just a display preference that point right? Still weird though.

cinder karma
#

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?

pliant snow
#

git patch files are just diffs saved into a file

#

so idk, probably like git diff > tatus

sonic mirage
#

sounds like a typo of 'status'

cinder karma
#

It probably is! I just haven't q clue of what I typed to do that and not notice for days tbh

umbral pecan
#

Or a strange way of writing taters ๐Ÿฅ”

crystal wren
#

Sometimes commit messages are truly fun.

cinder karma
#

I really do enjoy editing xml project configuration files by hand because it lost one of my files, grumpy today

scarlet hollow
#

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 omegaLUL

#

Also a fan of adding mildly self-deprecating memes to my PRs at work aPES_Giggle

umbral pecan
# prime prism but as someone who is passionate about licenses, if anyone wants some input on w...

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.

prime prism
#

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.

sonic mirage
#

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

prime prism
#

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).

cinder karma
#

You can also dual license if you wish (some of my mods are)

#

That however is an OR not an AND

prime prism
#

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).

fast granite
#

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

umbral pecan
#

Super helpful and insightful, thank you SDVpufferheart

dapper sinew
#

me, tries to code something useful: no thought, head empy
also me when messing around: %0|%0

#

please do not do that line btw

cinder karma
ivory shadow
#

pannenkoek videos are an instant watch from me. I have watched the entire thing

cinder karma
#

Look I like nerdy af videos but four hours????

ivory shadow
#

What's a third monitor for if not Discord and a four hour video about the physics of a video game from 1996?

sonic mirage
#

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

gray moth
# cinder karma Wow

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

ivory shadow
#

pannenkoek got famous-ish because of the parallel universes thing that became a bit of a meme.

gray moth
#

oh that video

#

It was really well made tbh

ivory shadow
#

Yeah. This one is too.

gray moth
#

Still, I'd rather fill my brain with useful stuff

dapper sinew
#

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...

โ–ถ Play video
#

:3

ivory shadow
dapper sinew
#

lol beautiful

ivory shadow
#

Wish I could sort my watch history by length...

dapper sinew
#

@paper adder i dont mind talking about Chatgpt and coding if you want

paper adder
#

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

gilded hound
#

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.

dapper sinew
paper adder
#

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

gilded hound
paper adder
#

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 thumbs_up

gilded hound
#

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

paper adder
#

definitely can see that lol..

#

i love it for getting quick snippets of code when you give it proper context and direct instructions

dapper sinew
#

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

paper adder
#

can be such a huge time saver

dapper sinew
#

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

paper adder
#

coding anything is a constant state of asking questions, trying things, and researching

#

you're never going to know how to do everything

dapper sinew
#

im on linux so i do kinda have to do coding on my own now, which has been rough but i have learned

gilded hound
#

Ah SDVpuffercry fellow linux modder

dapper sinew
#

its why i can code now! its just starting from 0 is still not possible yet. i have done from like Almost scratch though

dapper sinew
#

on NixOS so everything need to be coded into its system packages

#

and the rebuilt

gilded hound
#

๐Ÿ‘€ fellow nixos too lol

dapper sinew
#

: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

gilded hound
#

Ah I run on a chromebook, got arch for gaming, debian for most things, and nixos for development

dapper sinew
#

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

dapper sinew
#

i have coder friends so they know easy stuff and im like... best i can do is printout

paper adder
dapper sinew
#

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)

gilded hound
#

Its okay take your time!

dapper sinew
#

my trouble is on what to make

#

to test and all, i mean

gilded hound
#

well you're in the SDV discord server, a stardew mod! And there's a github of ideas for mods somewhere

paper adder
#

anything is worth something!!