#programmers-off-topic

1 messages · Page 7 of 1

sand frost
#

For CPU temperature rise

safe dragon
#

a good one

strange copper
#

this oneYES

thin estuary
#

if (building.GetData() is { } data)

marble jewel
#

I laugh because it's funny, and then cry because it's true

safe dragon
#

I've actually got a worse one that really hurts. We are rebuilding a lot of functionality in the cash registers to be available via api to use elsewhere... We've been given the requirement for the api to always return the exact same answer as the cash register.
It's happened quite a few times now that we realized that the cash registers were doing something wrong, so we report and then get told it's been accepted to work this (broken) way and that we should build the new service to also do exactly that

marble jewel
thin estuary
#

i hate it

#

but it works

marble jewel
#

I do a lot of is { } because that's what my IDE tells me to do

safe dragon
#

we've had to essentially intentionally add bugs to our api because else it wouldn't be the same as the cash registers...

thin estuary
#

i don't think i've ever actually checked for anything in that { }

marble jewel
#

I did at one point, but found it less readable than splitting things out

safe dragon
#

I have a few times I think

#

yeah often it just looks off

thin estuary
#

i wish i could do:

void Method(int? n)
{
    if (n is not { } n)
        return;
}

basically shadowing n

marble jewel
#

Here's a real piece of code in my mod where I'm using pattern matching for more than a null check:

if (!this.isActive.Value
    || e.Button is not (SButton.MouseLeft or SButton.MouseRight or SButton.ControllerA or SButton.ControllerB)
    || this.holding.Value is not null
    || this.itemGrabMenuManager.CurrentMenu?.chestColorPicker is not
    {
        itemToDrawColored: Chest chest,
    } colorPicker
    || this.itemGrabMenuManager.Top.Container is not ChestContainer container)
{
    return;
}
#

It's more like a null check in a null check

thin estuary
#

oh god that looks ugly

marble jewel
#

Oh I found a really good one, you'll hate it. Real code:

inventoryMenu = Game1.activeClickableMenu switch
{
    ItemGrabMenu
    {
        inventory:
        { } inventory,
    } when inventory.isWithinBounds(mouseX, mouseY) => inventory,
    ItemGrabMenu
    {
        ItemsToGrabMenu:
        { } itemsToGrabMenu,
    } when itemsToGrabMenu.isWithinBounds(mouseX, mouseY) => itemsToGrabMenu,
    GameMenu gameMenu when gameMenu.GetCurrentPage() is InventoryPage
    {
        inventory:
        { } inventoryPage,
    } => inventoryPage,
    _ => null,
};
#

To find the menu that the cursor is hovering over

thin estuary
#

goodbye

ivory shadow
#

SMAPI Talk: Now that we have DataLoader to simplify loading things with the right types, it'd be neat if the AssetRequestedEvent had a similar thing for .Edit().

Like currently you can do .AsDictionary<>, .AsMap, and .AsImage but maybe toss in some extension methods for specific types?

marble jewel
#

"How to lose what respect anyone had for you in under 2 seconds"

safe dragon
#

what is this cursed code

ivory shadow
#

Like instead of .AsDictionary<string, ShopData>() an extension method for .AsShopData()

marble jewel
#

Hey, cursed code that works is still working code. This is why my mods are MIT licensed, because no one in their right mind would actually want to fork my code.

safe dragon
marble jewel
#

I don't format my code, I use analyzers and reformatting tools to do it for me

safe dragon
#

I wanna have a talk with your formatters

ivory shadow
#

Why talk to his formatters

#

Go directly for an exorcist

safe dragon
#

you're right

marble jewel
#

I don't even agree with all the formatting rules, but it lets me forgo the responsibilities

#

Like, whatever you say JetBrains + StyleCop. You're right.

#

I just want to write code and not worry about formatting, documentation, or good git commit messages

marble jewel
#

Two types of people in this world

marble jewel
indigo mistBOT
#
thin estuary
#

I don’t really hate it too much either, I’m just tired. Spent my day trying to override the font in Cobalt Core with a more compact edit I made of the one it normally uses, trying to give it all kerning data… only to realize it completely ignores kerning :|

ivory shadow
#

Ah, keming

thin estuary
#

More like, EXHAUS T

ivory shadow
#

oh no

safe dragon
#

.g cobalt core

heavy daggerBOT
#

Cobalt Core is a sci-fi roguelike deckbuilder with a unique single-axis combat system that will throw you for a loop. Many loops! Give orders to your crew by playing cards: Will you raise shields to protect your ship, dodge incoming missiles and cannon fire to avoid damage outright, or strike preemptively to disable your enemy’s weapons? Outmane...

Price

$19.99

Recommendations

2042

Metacritic

94

▶ Play video
safe dragon
#

oh it's a game

#

looks neat

supple ether
#

does cobalt core actually have furries in it or is that just creative license on the title card?

thin estuary
#

I hope it’s gonna help some modders, but nothing can save this card, it won’t fit: before and after

supple ether
#

that is.... a lot of text to cram into such a small space

thin estuary
supple ether
#

hell yeah

cinder karma
#

To be fair I'm hardware not software

#

So that is Less Cursed TM

safe dragon
#

text rendering. One of the oldest things in all of game development yet it's still a pain in the ass even now

thin estuary
#

I’d drink to that, but I gotta sleep

safe dragon
#

sleep sounds good

#

I've had to do some dynamic font scaling a few times for primarily winforms stuff and it gets pretty nasty

cinder karma
supple ether
#

one of several reasons I used monospace fonts for games for so long. and also one of the reasons I love godot

cinder karma
#

When the real reason is probably my repo is cursed and involves submodules

supple ether
#

my problem with PRs is that I'll knock out the feature in a few hours and then spend like a week worrying whether or not the code is good enough to put in someone else's repository. and then I never PR it

safe dragon
#

monospace fonts make life a lot easier it's true

cinder karma
safe dragon
#

open source woes. At work my PRs are gonna get accepted cause the deadline was 3 weeks ago even though we didn't even get the item till the week before

cinder karma
#

(The AssetName one, aka "it's totally obvious a hardware engineer wrote this since there is a truth table in here " and interpolated strinf handler, where the code worked but I apparently got sidetracked while documenting and didn't notice)

supple ether
#

I was going to do a PR for... range highlight? data layers? whichever of those is a pathos mod. to add support for the modified range option on better beehouses, but I ran into this weird problem where it got exponentially slower as range increased, and beyond a few tiles over the vanilla range, the game would just slow to a crawl

cinder karma
#

Data layers

supple ether
#

I suspect it was somehow due to the way it does rendering but I could never figure out where the lag was actually coming from, so I just abandoned it

leaden marsh
supple ether
#

which reminds me, at some point I need to make a test mod for that spacecore custom tools PR I was gonna do

crystal wren
cinder karma
#

Oh free enchiladas!

ivory shadow
marble jewel
#

What you describe as bugs, I call unintentional/unwanted features

#

Happy little accidents

cinder karma
#

I'm glad I will probably never have to think about word wrapping or internationalization again

safe dragon
#

never say never

marble jewel
cinder karma
#

Yeah we're all dying sorry

#

YouTube keeps advertising this ui/ux game dev course to me

#

Which

#

You know

#

Is about as far from what I like to do and what I'm good at as possible without evolving into modern art

safe dragon
#

love ads for things I would definitely never do anything with

marble jewel
#

Or how about ads that you did one search and suddenly Google thinks it's your entire personality

#

Actually the ones that really get me are me physically visiting a store, never do a search, but suddenly seeing ads for things in the store

safe dragon
#

when you let a single family guy video autoplay by accident

#

"you must love family guy here's 300 clips and also south park"

ivory shadow
safe dragon
#

tbh I go down YouTube rabbit holes frequently for enthusiasts for product types I would never do anything with so I give off mixed signals

ivory shadow
cinder karma
#

You're the legendary UI expert around here!

marble jewel
#

I literally bought boots from a store, and started seeing Boots ads on social media

cinder karma
#

I'm just a dumb EE

marble jewel
#

Tracking is extra creepy

safe dragon
#

I get recommendations for note-taking eink tablets despite never taking notes (I used like 6 pages of a single notebook in 4 years of university)

sand frost
#

I used to get lots of worm gear ads

#

That was actually fun

fleet oriole
#

Reading the fancy words about Hash Sets. “The HashSet<T> is an unordered collection of unique items. No order is maintained.” This somehow fits me perfectly!!!

ivory shadow
#

I am a hash set of useless video game trivia and programming.

fleet oriole
#

My bedroom is sadly a hashset too

safe dragon
#

an unordered collection where no order is maintained

cinder karma
#

techincally hashsets have an order to them, it's just not an order that you would expect for anything

#

iterating a hashset twice will produce the same order

strange copper
#

Omw to implement a hashset that iterates by randomly generating which element to return

ivory shadow
#

HashSets only have an order as a detail of the implementation.

digital canyon
#

Anyone use GLFW?

leaden marsh
digital canyon
#

I assume you use c++? and do you use Vulkan or OpenGL?

leaden marsh
#

I've written GLFW based applets in C & C++, with OpenGL

digital canyon
#

nice!

leaden marsh
#

Vulkan is interesting but unsupported on some of my test machines

digital canyon
#

What do you think about C vs C++?

digital canyon
#

back to GTX 960s

leaden marsh
#

Mhmm, it's less the hardware support and more the fact that OpenGL, though deprecated, still works seamlessly on MacOS

#

As for C vs C++

#

My thing is that I don't need most of the C++ feature set, & C works better for my tooling, so I prefer C

digital canyon
#

Ah

#

What projects do you do?

leaden marsh
#

It's blazing fast to compile, so I use it where possible

#

Game engine development, primarily

digital canyon
digital canyon
#

to build a framework for desktop apps

leaden marsh
#

Ah sure, yeah I have some in-house tools to track down memory leaks and other resource allocation leaks, and C just fits those tools better

#

It's severely limiting syntactically, and very verbose

digital canyon
#

ah yea

leaden marsh
#

I think in general, modern C++ is safer & easier to develop than C, with a better standard library

digital canyon
#

True

#

Is C or CPP faster I wonder

#

cause C is prob simpler

leaden marsh
#

However, if you make a mistake in C++, it can be much harder to track down

digital canyon
#

but CPP has advanced features already built in

#

true

leaden marsh
#

C is faster to compile, but between C & C++, execution time differences are negligible

digital canyon
#

I need to go back and debug one of my older projects

stiff gazelle
#

c# is life :[

leaden marsh
#

That boils down to compiler implementation

stiff gazelle
#

:p

digital canyon
#

C# is quite popular

digital canyon
#

but anyhow I settled on MSVC for now

leaden marsh
#

I write a lot of C# now thanks to Stardew, but at heart I'm still a C developer

#

MSVC is good, though written mostly as a C++ compiler from my experience with it

digital canyon
#

definitely

#

What compiler do you use for C?

leaden marsh
#

It's also been slower in compile times and worse at auto vectorizing than GCC or clang

#

I use MSVC on Windows, and GCC or clang on Linux & MacOS

#

There's some differences between GCC & clang but nothing that I've really had to deal with so far

digital canyon
#

tbh I have a negative association with GCC

#

I don't really like the GNU type licensing

#

I feel like the freedom requirements get too restrictive

leaden marsh
#

My project is meant to be easily compiled on Debian/Ubuntu, MacOS 1.15+, and Windows 10+, so I try to avoid using compiler specific extensions in my own code

digital canyon
#

that's smart

#

GLFW is designed for cross platform from the get go right?

leaden marsh
#

Yeah, I usually use the pre built binaries on Windows, and build from source on MacOS & Ubuntu

digital canyon
#

noice

#

I don't like the Python indent syntax also

#

semi colons seem sketchy at first but actually work really well

leaden marsh
#

I'm generally fine with most language's syntax choices

#

I really appreciate Python's simplicity

#

If you aren't dealing with it's package management/dependency hell, it's a great for quick little scripts for bootstrapping a dev environment

digital canyon
#

What do you make of the new "next gen" languages?

#

The ones that are suppost to be super fast and simple

digital canyon
#

downloading 20 tools to do one task lol

#

development

leaden marsh
digital canyon
#

yea

leaden marsh
#

Reading anyone's C code can be a nightmare, especially with how much C developers tend to use code generators or preprocessor tricks

digital canyon
#

ahhhh

#

There are so many different ways to do simple tasks

leaden marsh
#

True

#

I like C because it forces me to reinvent the wheel a lot, which is good for generally understanding how things are implemented. That said, I don't think that's valuable for most kinds of development tasks

digital canyon
#

agreed

#

except I take it one step easier with object oriented C++

leaden marsh
#

For most, I'd say understanding when to use a hash table is more important than knowing how it works

#

So I think C++ is a good middle ground

#

But I'd almost recommend using Rust at that point, because it would encourage better habits imo

digital canyon
#

As a rookie programmer I need to find out how to get around if loops

#

Huh

#

Yea habits are a big thing

leaden marsh
#

It's more that C++ & its compilers let you make many mistakes without complaining

#

People describe C & C++ code as "eager to compile"

#

Even if you use static checkers, sanitizers, and constrain the subset of the language you use, it's just not as safe as something like Rust

#

It teaches better habits because that's the whole design philosophy of the language

stiff gazelle
#

how does rust translate to game development?

digital canyon
#

Eh

stiff gazelle
#

or reverse engineering

digital canyon
#

The community isn’t really there

#

But it’s growing

digital canyon
leaden marsh
#

I don't think C++ is better in any capacity imo

#

That's not me saying Rust is better either

#

It's just that no developer is perfect, even experienced C++ developers make common mistakes, and there's no safeguards for it

digital canyon
#

True that is a big flaw

leaden marsh
#

C++'s greatest strength is also it's greatest weakness

#

Code written decades ago will just work

#

But as a result, new code has to deliberately forgo language features that exist solely to support legacy code

digital canyon
leaden marsh
#

Windows is known to be spaghetti code, yeah

digital canyon
#

Explains why explorer crashed so often

leaden marsh
#

I don't remember where I heard this, but it has something like 5 million lines of code in the codebase that no one understands

digital canyon
#

Anyhow, I really gotta go to bed, peace

digital canyon
#

Those notes that the one guy 30 years ago wrote:

#

Imagine they just delete it to see what happens

leaden marsh
#

In any case, my overall point is, never consider one language better than another

#

They all have their use cases

digital canyon
leaden marsh
#

I know MacOS is "trying" with having stuff like GPT (Game Porting Toolkit, stupid to reuse that acronym, I know)

#

But until they start trying to actively support Vulkan instead of locking developers into Metal, it's a hard ask to expect devs to actually work on a MacOS port

#

Also actively deprecating the later, more useful versions of OpenGL is such a tragedy

digital canyon
#

Microsoft seems to be trying to smush out OpenGL just a bit

leaden marsh
#

The AZDO (approaching zero driver overhead) techniques for OpenGL are mostly 4.0+ features that are deprecated in MacOS

uncut seal
#

Playing on Linux is pretty easy nowadays with Steam's Proton

leaden marsh
#

And those features actually make it potentially viable versus other graphics APIs

digital canyon
leaden marsh
#

Yeah, I think a lot of players will even use Proton version instead of the native Linux version because sometimes it just works better

uncut seal
#

I rarely have issues with games, and when I have, it's mostly new releases for which the community is actively finding solutions

digital canyon
#

How good is performance?

uncut seal
leaden marsh
#

Not quite native, but pretty good tbh

uncut seal
# digital canyon How good is performance?

I'd say better than Windows but my laptop is pretty old, I could barely run The Thalos Principle 2 last year (mainly because my computer doesn't support advanced graphics anyway)

leaden marsh
#

Running via Proton beats a poorly coded native version anyday though

uncut seal
#

The hardest part for me was to install Nvidia drivers, but I've heard that I was on the hardest distribution of Linux to do so : Fedora

leaden marsh
#

Ah yeah that makes sense

digital canyon
#

Unpopular opinion but Nvidis is just a horrible company

uncut seal
#

yup, but I kinda learnt about that 2 years after getting my laptop

leaden marsh
#

If it's good hardware, it's good hardware

digital canyon
#

But they still have the industry standard

#

So once again we are stuck

digital canyon
#

Anyhow this time I really gotta go to bed

uncut seal
leaden marsh
#

Night!

safe dragon
#

people like Nvidia gpus but I don't think there's many people who know about Nvidia as a company and like them still

safe dragon
#

proton has been a double-edged sword. It's making it possible to play significantly more games on Linux than before, but it also makes it far less interesting to a developer to make a native Linux build

#

a lot of indie devs want their game to work well on the steam deck specifically though so they still tend to put some effort into making sure it runs smoothly even if that's through proton

leaden marsh
#

Hi Atra!

#

Did you see I've become a Rust shill

safe dragon
#

everyone becomes a rust shill eventually

leaden marsh
#

I have touched Rust only once, so maybe it really is just a grass is greener on the other side type thing

safe dragon
#

it's some pretty green grass tbh but it definitely does have issues too

#

a big flaw it currently has compared to C/C++ is a lack of a stable ABI

leaden marsh
#

A stable ABI is both the strength & weakness of C/C++

#

There's no better tool for the job as it is now imo

safe dragon
#

performance wise I think your choice of programming language is honestly not as important as people make it out to be. Most of the times when I've seen significant performance issues in an application it was a flaw with how the code was written and not the language

cinder karma
safe dragon
#

it's rare for an application to run into the limits of the language itself performance wise

leaden marsh
#

I'd say the biggest exception to that is Python

cinder karma
#

How are you doing?

safe dragon
#

ok yeah the performance approach python has gone with is "do it in C instead"

leaden marsh
#

I remember translating a Python script almost line-by-line into C++, where it was several orders of magnitudes faster

#

(It was a pre-processing script for my codebase, where in Python it would take maybe 5 seconds, while in C++ it's milliseconds)

safe dragon
#

pretty much any performance conscious library in python is written in C/C++

cinder karma
#

Eh, you can say the language is less of a problem but the c# compiler does not have the time to do a good job and it's obvious ReadOnlySpan and friends are latecomers to the language and don't fit nicely

leaden marsh
#

To me choosing between the languages is mostly about choosing between the tooling available

safe dragon
#

it can definitely cause performance to get worse still yeah, still gotta pick the right language for the job

crystal wren
cinder karma
#

Then again I've been in Cursed land lately

#

Will continue being in cursed land

#

And won't cease to be in cursed land for a while

leaden marsh
#

C# (and similiarly, Java) run fast enough at this point that I'd have trouble coming up with a good reason to pick C/C++ if the comparison point is performance on a modern PC

cinder karma
#

Even verilog would be preferable to labview

crystal wren
#

What repeatedly impresses me about Python is the startup time for things written in it. Which makes sense, and yet somehow feels a little counter-intuitive?

safe dragon
#

C# is a language with a high performance ceiling but also full of performance footguns that you don't even know are happening

leaden marsh
#

Very fair

cinder karma
#

C# is a language with a high performance ceiling that also just fjckinf feels like writing c++ when you're trying to hit it tbh

safe dragon
#

it's not ergonomic to write in any case

cinder karma
#

Nope!

#

I implemented my own string splitter

leaden marsh
#

The main thing I appreciate about C# is reflection

#

Newer C++ standards are proposing a form of static reflection

cinder karma
#

That is very nice yes

safe dragon
#

rust I think is nice partially just because normal comfortable code written in rust is still actually very performant and often enough trying to outsmart the compiler is just not happening unless you really know what you're doing

leaden marsh
#

Right, Rust is a language where I almost absolutely trust that the compiler is smarter than I am

#

And more correct than I am

#

Between Java and C# I think I'll always choose C# though

safe dragon
#

I've never used Java so that's entirely true for me too!

cinder karma
#

Hahaha yeah

leaden marsh
#

My biggest qualm with it is the lack of operator overloading

cinder karma
#

Although I've been meaning to (a) learn zig and (b) do more Haskell

#

Haskell as a replacement for verilog mind

leaden marsh
#

Say what you will about operator overloading, but saying
v1 = v1.Multiply(v2)
just isn't as nice as
v1 *= v2

safe dragon
#

haskell is neat but then also a language I would never choose for any project ever

#

it's interesting to see what kind of madness they're up to trying to turn their type system into a programming language of its own

cinder karma
#

(I'm looking at it in the small world of as a verilog replacement)

leaden marsh
#

Interesting

safe dragon
#

considering I don't even know what verilog is I will trust you on that

cinder karma
#

See: Haskell Clash

leaden marsh
safe dragon
#

nice

#

zig might be interesting to give a shot but I feel like I should actually try C++/C cause I've never used them

thin estuary
leaden marsh
#

Very different languages, C & C++, in this day and age

safe dragon
leaden marsh
#

I'd almost never recommend C unless it's really needed, since it's (practically) a subset of C++

#

Not entirely true, but there is a substantial overlap between code written in C, and code that will compile correctly with a C++ compiler

cinder karma
#

Also don't get me wrong I like c# perfectly fine! It's better than java!

leaden marsh
#

Better than Java is a low bar

#

Not as low of a bar as better than JavaScript though

cinder karma
#

But I've noticed it is like....really not ergonomic when you are going for performance

leaden marsh
#

Not that I dislike JavaScript, but it really isn't the right tool for... so many of the things it's actually used for

safe dragon
#

I doubt I'd choose to use the languages for any real project but there's probably still value in trying C++ to at least see what it's about and what all these newer languages are attempting to replace

cinder karma
#

Hey, Myuu, I'm in python land with badly typed libraries interacting with LabVIEW at the moment

#

Pretty sure a hammer to the foot is less painful

safe dragon
#

I do dislike Javascript i don't have many good words to say about it

leaden marsh
#

As Elizabeth pointed out, the foot has way too many nerve endings for me to wish a hammer to the foot on my worst enemy

#

I have to disagree with that one

cinder karma
#

You say that but I have no ide support for something as simple as "who mutates this global?"

#

(In LabVIEW)

safe dragon
#

don't ask for so much smh

leaden marsh
#

Fair enough, one thing I really appreciated with VS was being able to see all references to a method/variable

safe dragon
#

mutating global variables is bad enough as it is for code maintainability, if you can't even check where it's mutated easily I think I'd cry

leaden marsh
#

It makes the whole "what the heck is this code doing" a lot more convenient

cinder karma
#

Yeah, and I get that in my python too. It's weaker than VS and sometimes misfires but it mostly works well

#

In LabView I can't even throw my hands up and grep for shit

leaden marsh
#

On the real I still edit any code with Sublime Text & no extensions

cinder karma
#

Vis are binaries

#

I like VSC. Despite the Microsoft

crystal wren
#

VSCodium exists!

safe dragon
#

our visual basic winforms thing has like over 100 global booleans that are like "handlingPayment" or any other possible state one might express.

A lot of methods have if statements that check like 5+ of them to know what to do

#

global variables SDVpufferwaaah

cinder karma
#

That feels about right for normal code

#

Tbh

safe dragon
#

it's a disaster that's what it is

#

making any change to any of these booleans feels like you're jumping into a moat unsure if there's alligators

leaden marsh
#

I get that

cinder karma
#

Yeahhhhh

leaden marsh
#

During 1.6 development, there was this odd bug where, upon reconnecting to the host after disconnecting while in the mines, ||Calico Statue|| effects would trigger

safe dragon
#

it's often incredibly unclear what many of these booleans actually do. They always start simple but then over the decade they got more specific or get weird niche cases where they're ignored or enabled to fix some random other bug...

cinder karma
#

Myuu of course knows that, Furniture.drawingForWorld, FarmerRender.DrawingForUI, all the stardew tool state booleans....

leaden marsh
#

The root cause of the issue is that, for a brief period of time upon connecting, the client thinks Game1.IsMasterGame is true

#

We just put a bandaid over the symptom, because I have no idea how much code actually relies on Game1.IsMasterGame being true while the client is still connecting

safe dragon
#

yup and then keep making careful patches like that over 17 years

crystal wren
#

My instinct: probably a lot more than you would like.

cinder karma
#

Yeah. Normal software!

leaden marsh
#

But still, you never know

cinder karma
#

And eventually someone goes "dear lord can we do a rewrite"

crystal wren
#

Management says no.

safe dragon
#

"no we can't the risk is too high and we don't have a test suite"

cinder karma
#

Your engineers cry into their Friday beers

safe dragon
#

our management has this (unfounded) belief that the person who originally wrote our code to determine which discounts to use when scanning products was a genius and doesn't believe that we are capable of achieving the same result in a cleaner way

#

the discount code is such a massive disaster at this point

#

but nope do not change it

crystal wren
#

That does definitely sound like a problem that has a singular good solution, of course.

leaden marsh
#

don't you love 10x Engineers who write 10x the code necessary, 10x as fast, causing 10x the problems

safe dragon
#

the guy who originally wrote it is also a gigantic fan of XML so we have some nasty process where the entire transaction is serialized into some handwritten XML monstrosity and then manually read out again by the discount handler to then figure out which discounts to use

cinder karma
#

Oh god

safe dragon
#

to be clear, this discount system is built right into the cash register, he could've literally just passed the transactionitem list directly

#

but nope it's a fucked up XML creation

crystal wren
#

Huh.

leaden marsh
#

I love XML

safe dragon
#

it's full of bugs too which are then corrected by a post processor to the XML reader that tries to reverse engineer a bunch of information

crystal wren
#

It's slightly reassuring to hear that I could have probably done a better job than someone who was hired as a programmer to write code.

leaden marsh
#

tbf I feel like people these days do the same thing but with JSON

#

serializing data when it absolutely does not need to be

safe dragon
crystal wren
#

I also dislike JSON!

leaden marsh
#

THANK YOU

crystal wren
cinder karma
#

Toml is pretty good

crystal wren
#

Absolutely abusing my markdown privileges there, yes.

safe dragon
#

json is alright as long as you just use it for what it actually is good at(much like XML for that matter)

leaden marsh
#

(Okay actually I don't mind RSON, but I'd appreciate it if Rust game devs did not use it as their config file format)

safe dragon
#

nah they'll use ron

leaden marsh
#

ah YEAH that's the one

crystal wren
#

How badly I want to pull an Ameise and not use JSON for my mods' config files...

leaden marsh
#

I also do not appreciate RON as a config file format

#

And in a similar vein, Lua being used for config, also not a fan

cinder karma
#

I've been doing configuration files in toml lately

#

It's nice

leaden marsh
#

I really like TOML

safe dragon
#

I have no strong opinion on configuration file formats

cinder karma
#

"Configuration files" actually they're test protcols

leaden marsh
#

It's similar to what most .cfg or .ini file formats looked like when I was a kid so

#

I like those the best

cinder karma
#

So I can easily do [[Test]] # pile of test conditions

safe dragon
#

I'll configure everything in vimscript

leaden marsh
#

Honestly I think my biggest qualm with config file formats is that it shouldn't be visually nested

cinder karma
#

Reason why I'm liking toml now tbh

#

It isn't as indented as json would be

leaden marsh
#

Formats which encourage flat structures will be my favorite for configs

cinder karma
#
  • my test files have a lot on them (temperatures, sweep times, voltage limits, current clamps, settling time, etc)
leaden marsh
#

I don't think end users understand (nor need to understand) the nesting of the object

cinder karma
#

It's flexible and I can version control them

leaden marsh
#

TBH I don't even really care if it uses a markup language or known object format at all, it could look like:

forward                 KEY_W                   NULL
backward                KEY_S                   NULL
left                    KEY_A                   NULL
right                   KEY_D                   NULL
jump                    KEY_SPACE               SCROLL_UP
fall                    KEY_LEFT_CONTROL        NULL
run                     KEY_LEFT_SHIFT          NULL
interact                KEY_F                   NULL
ping                    KEY_Z                   NULL
ability_1               KEY_Q                   NULL
ability_2               KEY_E                   MOUSE_BUTTON_5
ability_3               KEY_C                   NULL

and i'd be down for it

#

if it's flat, and human readable, it's A okay w/ me

safe dragon
#

gonna make a configuration format where anything requires 2 levels of indentation

#

or more

crystal wren
#

Speaking of indentation, I just discovered Dhall...

safe dragon
leaden marsh
#

so my disclaimer is that I've started following the Linux kernel style guide and using 8-width indents (set in editor, bc Tabs not Spaces), so looking at heavily nested structures already irks me

cinder karma
#

Hahaha I do four space indents

safe dragon
#

I do 4 as well

cinder karma
#

But also my code recently is conceptually simple tbh

leaden marsh
#

I do four space indents normally yeah

#

Stardew also uses 4 space character indents for new code

#

I don't really care about the whole tabs vs spaces debate since any reasonably large project should be using an auto-formatter

cinder karma
#

That reminds me I was gonna set up ruff

safe dragon
#

any reasonable editor automatically does indentation for you when you go to the next line

cinder karma
#

I found that regions work in python

#

Nice when the file starts off with 8 data classes and four enums tbh

#

And a NamedTuple

leaden marsh
#

my biggest qualm with Sublime is that it does not recognize the blocks of

#ifdef MACRO_NAME
/* something */
#else
/* something else */
#endif
#

So I can't just collapse the macro for easy reading

cinder karma
#

Ahhhh that sucks

leaden marsh
#

VS does though, which is nice

cinder karma
#

I do enjoy a nice dataclass

crystal wren
#

Sublime not recognising that is bizarre.

leaden marsh
#

Yeah, I don't know if I have it misconfigured?

#

I'm going to look into that right now, come to think of it

cinder karma
#

I'm also a massive stickler for making and using enums tbh

#

I don't want to be passed an int state, let me know my possibilities with good names

safe dragon
#

rust enums my beloved

leaden marsh
#

My only issue with enums (in C) are that the width isn't defined by the standard

safe dragon
#

I introduced an enum recently just to pass it from 1 method to a single other method

cinder karma
#

I was pretty sad to have to int my enums in some recent c#

#

Because the Volatile library couldn't take enums

leaden marsh
#

Ahhhhh

safe dragon
#

I feel like I'd like it if enums had an implicit conversion to int but maybe that's a bad idea

leaden marsh
#

I'm happy with the ability to cast to int & back easily

cinder karma
#

They actually kinda do haha

#

At the IL level

#

Enums are their backing types

safe dragon
#

yeah I just don't like adding (int) in code hc_pensive

thin estuary
#

yeah fuck that

#

and by "that" i mean "enums being their backing types"

cinder karma
#

I enjoy that

leaden marsh
#

Yeah I enjoy that as well

cinder karma
#

Not really a fan of reference type enums tbh

leaden marsh
#

Ah I was about to ask what the alternative is

thin estuary
#

in general this is sane behavior

#

caused me too many issues in CC modding though

cinder karma
#

Not that performance even matters in the code I'm writing (I have to insert sleeps to allow my measurements to settle)

leaden marsh
#

damn sorry that reminded me of another reason why i can't believe windows is the standard in gaming

#

did you know that the sleep timer on Windows by default has a precision of like 15 ms

#

you can't just sleep for 1 ms

crystal wren
#

Ooh, a thing I actually did know!

leaden marsh
#

Oh my, that was so incredibly frustrating to debug with my engine

safe dragon
#

sleep timers are very inaccurate yeah

leaden marsh
#

I was swapping out Steam's networking library with a hand-rolled networking framework I wrote, but suddenly my game's framerate dropped from 200 FPS+ to like 30 FPS

safe dragon
#

30 fps is good enough time to ship

leaden marsh
#

Because Steam's networking lib added the call to tell windows "hey I want the more accurate timer"

#

30 FPS (consistently) is good enough to ship, but in 3D it's dizzying when the framepacing is off too

safe dragon
#

definitely, I wasn't really suggesting it lmao

leaden marsh
#

it was so frustrating trying to figure out "what's the difference between the code on Windows vs my Linux machine??"

leaden marsh
#

Windows has been a frustrating experience overall for dev'ing C

crystal wren
#

If you just sleep for 800ms every frame, any other timing variances become basically rounding errors.

leaden marsh
#

Banger idea

crystal wren
#

Truly smooth frame times achieved.

leaden marsh
#

Powerpoint truly is the best game engine

cinder karma
#

You say that as a joke but that is literally my current code

#

15-70ms sleeps everywhere making any performance changes entirely irrelevant

#

Oh, allocated two strings when I could have done one? Irrelevant. Hit up the dictionary nine times when six would have worked? Irrelevant

leaden marsh
#

surely by sleep you mean

while time_now - time_start < 15:
    pass
cinder karma
#

Nah, straight up calling time.sleep

#

I just need long enough the measurements settle

leaden marsh
#

i can't believe you don't busy wait

crystal wren
#

No no, surely you would want to add an element to a list every iteration and just count time using those. I call it ListTime.

cinder karma
#

A bit longer doesn't hurt

#

Would busy waiting be more correct? Yes. Does it matter? No

safe dragon
#

gotta initialize the list with a capacity large enough for the maximum ListTime

cinder karma
#

(Technically what I should be doing is polling the measurement repeatedly and waiting for the deviance to fall)

crystal wren
#

While I've been describing monstrosities, I've been doing this monstrosity of an experiment. It's about as broken as I would have hoped.

leaden marsh
#

i loved being taught about linked lists in school only to find out that when people say "list" they generally mean "array list" because cache coherency actually matters

cinder karma
#

Yup

#

You've seen the rust linked list ranr

safe dragon
#

functional programming loves linked lists

#

I however do not

cinder karma
leaden marsh
#

someone could tell me this was written by Atra and I would believe it

#

did you write this

#

Mumble mumble kernel embedded something something intrusive

cinder karma
#

No I'm not that smart

leaden marsh
#

i also like that i was taught to implement queues & stacks as linked lists, but in reality it's still basically an array list

#

i had one class (operating systems) where they actually had us write a queue as a circular buffer

#

but didn't actually teach us how to do it

#

which I mean, fair, but I feel like I learned most of my knowledge about data structures from practical, high performance applications

safe dragon
#

I was never taught what a linked list even was in uni

#

I don't think it was part of the datastructures course at all

cinder karma
#

I can do one but they really aren't preferred anymore unless you're doing some crazy lock free nonsense

leaden marsh
#

i'm grateful for my data structures courses, bc they did in fact teach me a lot

cinder karma
#

And frankly I'm not insane enough for crazy lock free nonsense

leaden marsh
#

and tbf I learned to make an AVL tree with a backing array in those courses

safe dragon
#

linked lists are a necessary evil in functional programming and that's about it

leaden marsh
#

but no one taught me WHY using an array as the backing structure was a good idea

#

maybe if my degree were computer engineering? idk

crystal wren
safe dragon
#

I remember learning about all sorts of trees in my data structures class that I have not seen even once since then

cinder karma
#

It's soooo good

leaden marsh
#

But to this day I have skirted by without knowing how to implement a B-tree

safe dragon
#

when would you ever even implement them yourself beyond incredibly niche scenarios

crystal wren
#

For me, the benefit of knowing these things would be the following ability to be able to figure out "oh hey, I should actually use this rare thing here".

#

Instead of just bumbling along with a terrible solution because I have no idea about them!

#

Because currently, I bumble, and I bumble hard.

safe dragon
#

goes through every type of binary tree one by one

thin estuary
#

fwiw, your standard List/Dictionary data structures are good enough for 95% cases

safe dragon
#

it really is

#

I've seen a lot of code at work though where people use lists still when dictionaries should be used

#

list lookup is fine if it's only a few elements in size but...

thin estuary
#

oh and (Hash)Set

cinder karma
#

I use 6-32 as the rule of thumb tbh

leaden marsh
safe dragon
#

easy it's -26

leaden marsh
#

i-

cinder karma
#

If I have a collection of less than six elements it will almost certainly be faster to throw them into a list and straight search

#

Between 6 and 32 elements it is a tossup

thin estuary
#

why these specific numbers

leaden marsh
#

that bodes well for most palletized data structures i suppose

safe dragon
#

they're nice numbers

leaden marsh
safe dragon
#

lmao

#

I've seen list lookup used for lists with hundreds of elements

cinder karma
#

Empirical really

leaden marsh
#

and i assume above 32, always use a dictionary?

cinder karma
#

Yeah, favor dictionary

leaden marsh
#

i guess it also depends on the frequency in which this is called, and from where

cinder karma
#

Yeah.

#

Binary search is also an option

leaden marsh
#

for a Minecraft converter thing I worked on, I used gperf to get a perfect hash table for all the string block IDs to a numerical ID

#

(I could disregard the other information, like waterlogging or block orientation or whatever, so it worked for my purposes)

safe dragon
#

perfectly optimized hash functions

leaden marsh
#

Yeah guaranteed O(1) lookup

cinder karma
#

What's mine craft

safe dragon
leaden marsh
#

mince raft is a type of raft used to escape deserted islands, made by packing together the meat of animals

#

desperate times call for desperate measures

cinder karma
#

Anyways, the c# dictionary does a cool trick where they use a more collision prone but faster hash function on strings unless there are too many collisions

#

In which case it switches the hash function

leaden marsh
#

just use a trie obviously

#

what is space complexity

safe dragon
#

idk I'm pretty sure memory is infinite anyway

cinder karma
#

I love tries!

#

I love it when the c# compiler writes them for me!

#

(Switching over strings in dotnet8 emits a trie)

leaden marsh
#

that's pretty smart, and really cool tbh

dapper sinew
tough arch
#

Lots of mods still needing updated

#

haha

#

Glad I use vortex cos I can just click a check for updates button

supple ether
#

oh no not vortex

tough arch
#

I paid for it a long time ago so I'm not worried

cinder karma
#

shoo, on topic!

#

This is the place we can hide from modding responsibilities

#

Here, have my meeting sock

tough arch
safe dragon
#

the all important meeting sock

cinder karma
#

Aren't the colors pretty???

umbral pecan
#

That’s a great idea. I should totally crochet during meetings.

leaden marsh
#

That's pretty!

cinder karma
#

I only get away with it for online meetings tbh

digital canyon
#

Anyone happen to know how to compile the Machine Interface driver for LLDB on Windows?

cinder karma
umbral pecan
#

Honestly, I might apply. I'm pretty happy with my company rn, but they are paying under the average in my area. Culture is super important to me, but it doesn't hurt to look around.

woven harness
#

does anybody here use microsoft visual studio

pliant snow
#

i think some people here do ye

digital canyon
#

I assume you do, what language?

woven harness
#

well im trying to learn

#

c++ right now, i know a bit of html and css

digital canyon
#

Same

#

Except for the css and html

woven harness
#

i just am wondering why when i try running my code it brings me to microsoft edge instead of runing the code in the terminal

digital canyon
#

What is the extension of the file?

#

You are running

woven harness
#

let me check

#

im not seeing one

pliant snow
#

You're writing C++ code?

woven harness
#

it just says file, and yes ive hit the show extensions button

woven harness
digital canyon
#

Show me your project settings like linker and stuff

digital canyon
woven harness
#

in file manager or in vs

digital canyon
#

Vs will update it into FS

#

Either works

woven harness
#

ok ill try

#

one sec

digital canyon
woven harness
#

not exactly

#

im trying to screenshot to show

digital canyon
#

Sorry, no rush

woven harness
#

first this comes up

#

when i try run and debug

digital canyon
#

Type #include <iostream> at the top

woven harness
#

i have that

#

its hidden by the drop down

digital canyon
#

Oh VS code?

#

Sorry I just realized

woven harness
#

do you not use it

digital canyon
#

Can you show me verbatim what it says?

#

I’ve dabbled in it

pliant snow
#

Im looking at your errors at the bottom

digital canyon
#

But I used Visual Studio more

woven harness
digital canyon
#

Check ur environmental variables

woven harness
pliant snow
#

Open that launch.json file they suggest

woven harness
digital canyon
#

VS Code is like a flushed out text editor

woven harness
#

oh

pliant snow
#

They're completely different programs, despite the similar names

digital canyon
#

Kinda like notepad++

pliant snow
#

But they do the same in the end, its more about their features

woven harness
#

and i have the bottom or top

pliant snow
#

Bottom

digital canyon
#

gimme a sec

pliant snow
#

Open your launch.json, i think that might be incorrectly set up

woven harness
#

also i am trying to learn but cant really find stuff, how did you guys learn

pliant snow
#

Lots of googling lol

woven harness
#

seems rather tedious

pliant snow
#

What did you do to build the code also?

woven harness
#

like to figure out what to do?

pliant snow
#

It can be. The secret is the more you write the more you can look back at your old stuff

leaden marsh
#

The launch.json seems to have the exact string enter program name, for example C:\Users\my pc\Documents\New folder\a.exe

cinder karma
#

I've never done c++ on windows

leaden marsh
#

You gotta drop the enter program name, for example part, that's not supposed to be part of the text

cinder karma
#

But back in the old days I recall just running gcc from termknal

woven harness
#

oh

#

where would i change that

pliant snow
#

Theres two steps to running c++ code. First you have to turn the code into a windows exe, then you have to run it

leaden marsh
pliant snow
#

Your launch.json file will do the second atep

#

Idk how you did the first step, but it would be helpful to know

leaden marsh
woven harness
digital canyon
digital canyon
leaden marsh
pliant snow
woven harness
#

nothing

#

i followed what he did and he didn t type anything i dont think

#

but imma double check now that you mention it

pliant snow
#

He may have set up a task or something instead

digital canyon
#

For your question abt Visual Studio vs Visual Studio Code, left vs right

woven harness
#

i have the one on the right

pliant snow
#

Visual studio code is more beginner friendly imo

digital canyon
#

Hard disagree

woven harness
#

so vs code is preschool to vs or what

digital canyon
#

for cpp at least

digital canyon
woven harness
#

oh mb

digital canyon
#

VSC is more basic

woven harness
#

what would you recomend

digital canyon
#

it's like a fancy text editor

#

do you plan on doiong a lot of programming?

woven harness
#

yeah, thats why i want to learn it

digital canyon
#

(and with others or not, and commerically or not, etc)

pliant snow
woven harness
#

i just want to find an understandable way to learn

digital canyon
#

It sets up a lot of the stuff for you if you choose the right workload

woven harness
#

so should i just stick with vsc until i have a semi decent grasp on c++

leaden marsh
#

Whatever works for you

#

I don't even use VS or VSC for C++ on Windows

digital canyon
#

Codeblocks?

woven harness
#

what do you use

leaden marsh
#

No

digital canyon
#

lol

pliant snow
#

Anyway, first step is to turn your code into an exe. The exact steps to do that depends on what build program ("compiler") you have installed

leaden marsh
#

I just use Sublime pretty much

digital canyon
#

nice

cinder karma
#

Sublime is pretty good

#

I was a vim and command line kid

leaden marsh
#

I do use the Visual Studio compiler though, MSVC

leaden marsh
digital canyon
#

no

leaden marsh
#

gdb is a debugger

digital canyon
#

those are debuggers

woven harness
#

oh

digital canyon
#

it's like gcc.exe, cl.exe

pliant snow
digital canyon
#

clang.exe(if anyone can help me with the LLVM stuff)

woven harness
#

oh

digital canyon
#

Check this, I remember it worked

woven harness
#

ok

#

thanks

digital canyon
#

What compiler are you using out of curiousity?

woven harness
#

to be honest i didnt know i needed one

#

i started cpp last night

digital canyon
#

ah

#

fair

woven harness
#

but i rocked html in school

#

yeah

digital canyon
#

actually that's a bad way of putting it(or not idk HTML)

#

C++ compiles into bytecode

woven harness
digital canyon
#

there are many compilers to choose from but some main ones I know are GCC(MINGW on Windows), Clang(LLVM toolset), CL(MSVC)

#

Do you have one installed rn?

woven harness
#

not that im aware of

#

i just got to that part on the site

digital canyon
#

ah ok

woven harness
#

it says gcc is linux

#

is for*

digital canyon
#

kinda

#

MINGW is the version for Windows

leaden marsh
#

There's a gcc version for Windows, as part of the mingw toolset

woven harness
#

oh i see

#

im getting mingw rn

#

its saying "the install directory is completely deleted" or will be deleted. what does that mean

digital canyon
#

Sorry for the lacking advice I'm trying to remember VSC lol

woven harness
digital canyon
#

Select a new folder

woven harness
digital canyon
#

Make a new one

woven harness
#

ok

digital canyon
#

Do not do that

woven harness
#

ok

#

wait

#

huh

digital canyon
#

BRB in like a minute or two

woven harness
#

ok

digital canyon
#

Wait what are you installing?

#

MSYS?

woven harness
#

yeah

#

thats what the website brought me to for mingw

digital canyon
#

Do you understand what MSYS2 is?

woven harness
#

if it isnt a compiler no

digital canyon
#

MSYS2 is "MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software."

woven harness
#

oh

digital canyon
#

The tutorial

#

works

woven harness
#

oooooohh

digital canyon
#

Just make sure you know what you are installing before it happens

woven harness
#

the tutorial says to install msys2 and then install mingw through it

digital canyon
#

That absolutely works

woven harness
#

and if i install msys2 into a brand new file nothing can go wrong?

digital canyon
#

(just please make sure you know what you are installing, very imporatant)

digital canyon
#

but make sure it's empt or it will erase everything

#

now BRB in 5

woven harness
#

thats what its been telling me

woven harness
digital canyon
woven harness
#

ok

#

im currently insalling MSYS2 onto a completely new folder

#

and im gunna run the code to instal mingw

digital canyon
#

K

#

Ping me when ur done

woven harness
digital canyon
#

Restart visual studio

#

Then show me the files structure again please

woven harness
#

what do you mean by files structure

#

like in file manager?

digital canyon
#

Click the top tab on the left

woven harness
#

this is after i restarted and tried running again

digital canyon
#

Delete .vscofe for now

woven harness
#

ok

#

also got rid of the one file that wasnt a cpp beacuse it was empty and i made it while trying to figure this out

digital canyon
#

Something like this should be the only file rn

#

Click this

woven harness
#

2 of the g++ ones come up for me

digital canyon
#

show me

woven harness
digital canyon
#

Top one

woven harness
#

i hit one and then it made a .json

digital canyon
#

Nope

#

My

woven harness
#

or idk if it made it but one appeared

digital canyon
#

bottom one mb

woven harness
#

ok i did and it brought back the vscode folder

digital canyon
#

This is my tasks

#

They are all same I think

woven harness
#

yea

#

mines same as that

digital canyon
#

Honestly I would try to verify compiler files and check stuff like that

woven harness
#

vs code seems like its gatekeeping coding from me

digital canyon
#

From this point I don’t think I can do much

#

It’s so much easier with python on vscode

woven harness
#

yeah

#

maybe ill switch code editors that im using

digital canyon
#

Maybe

woven harness
#

well

digital canyon
#

If you need any more help, feel free to dm? Dunno

#

Best wishes

woven harness
#

yeah, ill look into other ones because i havent even been able to try acual code yet

#

i really appreciate your help though

digital canyon
#

np

woven harness
#

thanks a bunch SDVpetfrog

digital canyon
#

peace

woven harness
#

(idk why frog)

#

peace

digital canyon
#

hehe

hard arch
#

Why do SVE Wizard needs to be Magnus (as in a separated char)
It breaks some portraits mods so much aaaAAAAAAA dispear

#

I know how to fix it, but not everyone does
Especially if they don't know much about computers, they will get scared to edit/ will accidentally break the mod even more when "fixing" the code

woven harness
#

@digital canyon so last night I downloaded VS to see it, and I tried my piece of code and ran it. It ran immediately and I only needed to spend a minute total figuring it out and it worked

digital canyon
#

Noice

pliant snow
#

I wonder if that's because MSVC installed with it

safe dragon
#

could very well be

#

visual studio loads your pc up with all sorts of stuff immediately

pliant snow
#

I have it on my work machine just to manage msvc lol

safe dragon
#

I have it on my work machine... cause I use visual studio

pliant snow
#

i also have at least two different editions of visual studio to go along with it

safe dragon
#

me too

#

wait no, 3

#

2019, 2022 and 2022 preview

pliant snow
#

i have 2017 and 2019 lol

safe dragon
#

still using the 32 bit versions hc_pensive

pliant snow
#

I just let the toolchain people tell me what they want me to use

cinder karma
#

I'm enjoying toml over json tbh

umbral pecan
#

It’s the age old question of better design/ease of use vs what has actually been adopted and has large community support

pliant snow
#

For configuration stuff, I vastly prefer yaml or toml than json these days

safe dragon
#

I'm learning people have strong opinions about the format used in config files

#

I don't think I've ever cared

#

just property name and then the value and that's essentially the config file done

#

idk what kind of complicated configuration files people are dealing with

umbral pecan
#

Have you ever used something like docker compose or AWS CloudFormation? You can basically manage entire backend setups just through the config files.

safe dragon
#

yeah my home server uses a docker compose file

pliant snow
safe dragon
#

fair

#

I feel like the appsettings.json in asp.net projects does support comments though...

#

hmm maybe it doesn't

pliant snow
#

i mean, it really supports whatever its library does. There is a version of json that does support comments, but many of the standard json libraries don't seem to support it

safe dragon
#

in my mind almost all configuration file standards are essentially the same thing with slight variations. Sometimes there's nesting and sometimes that nesting uses whitespace and other times braces... Some other formats have like [[thing]] header section things

#

it just doesn't really matter in my eyes they all essentially do the same thing and you look at it maybe a few times in your entire project's lifespan

#

I don't think I do anything with the config files at work beyond changing what environment I need

#

and then there's the ones like docker-compose.yml of azure-pipelines.yml which you just essentially set up once and then don't look at again for 3 years

#

I guess the only config files I really work with that I open more often are the init.lua for neovim and the hyprland config

#

but honestly I'd hardly call neovim's config file a config file anymore

#

it's a whole ass programming language pretending to be a config file

marble jewel
#

content.json would like to speak with you

safe dragon
#

what's a content.json referring to

marble jewel
#

Oh wait, you're not a modder

#

Content Patcher's content format is json, but it encodes a lot of programming-like constructs

safe dragon
#

that sounds like something I would not be a fan of

marble jewel
#

Like, I'm pretty sure Content Patcher is turing complete

safe dragon
#

I'm looking at it now and it gives me the shivers

#

this is using json like it's a programming language but worse

#

I'm sure there's a good reason this came to be

#

and not all modders are programmers

marble jewel
#

It's a gateway for content creators to learn programming

#

Except, programming makes sense to me, but Content Patcher still confuses me sometimes

safe dragon
#

I assume this is primarily intended just for stuff like portrait mods or extra dialogue

marble jewel
#

It can edit anything in SDV's content pipeline

#

Artwork, data models, music, maps

pliant snow
#

edit out CA

#

we're in charge here now

cinder karma
#

Oh God what did I start

safe dragon
#

hc_pensive how big are some of these content patcher jsons

cinder karma
#

Crumble, uh

#

20k lines?

sand frost
#

A few thousand lines

#

Depends

safe dragon
#

ah it's not as bad as our MainForm of the cash register so it's all ok

sand frost
#

I have one I generate with a Matlab script that’s about 3000 lines iirc

#

Does that make you feel better? 😂

cinder karma
#

Anyways, crumble, I need to know if opengl has issues with modern Intel processors

safe dragon
sand frost
#

I’m not convinced CP is Turing complete but I’d also have to remember the definition of Turing complete

safe dragon
#

it's not all that difficult to technically be turing complete

sand frost
#

There’s various specific things about self-referencing that im not sure are possible

#

Though I guess you can define variables and do arithmetic

marble jewel
#

Microsoft Excel formulas are turing complete

safe dragon
#

doesn't need to be ergonomic or in any case remotely reasonable to be turing complete

sand frost
#

If you’re willing to ignore the useless nature of focusing solely on complex configs and not on the actual functionality I guess

cinder karma
marble jewel
#

Some examples thanks to wikipedia

sand frost
#

Hmm this is why I never made it as a mathematician

#

Too grumpy about practical applications

safe dragon
#

habbo hotel lmao

cinder karma
#

Work cad software crashed three times due to opengl issues yesterday

sand frost
#

That’s a scary sentence

safe dragon
#

is it an old version of opengl or new

#

"new"

sand frost
#

Admittedly I used to work on cad that would crash about once an hour due to sharing an IP address between 6 computers

cinder karma
#

Uh, new probably????

#

I'm pulling driver updates for it

#

IT says try X not Wayland if problems continue

safe dragon
#

ah

pliant snow
#

im going to say that probably wont help

#

but then again they are black boxes of mystery

safe dragon
#

I find it highly unlikely for intel processors to have issues with opengl of all things but I'm no graphics programmer

#

idk what software it is but it's probably running in an XWayland instance anyway

cinder karma
#

Thank you!

#

I'm hoping it's just driver jank

#

It wasn't doing this last week smh

dapper sinew
#

just putting this out there... ts is hard negative

#

making a discord bot and i STILL cant fully code on my own and this is rough

lethal walrus
#

dw i learnt js through writing a discord bot

#

they're not a bad starting point

dapper sinew
#

i can understand a bit thankfully

#

but so much RED

#

and chatgpt(cause i need help) is busted right now :(

pliant snow
#

I find chatgpt to lead me down bad avenues than it is a help lol

dapper sinew
#

it does go insane a bit, but its better than nothing since i have no teacher right now

#

if i had someone to guide me i wouldnt need it

#

sadly youtube videos expect you to already know most of the stuff they talk about as well

lethal walrus
#

assuming discord.js, they have great examples

dapper sinew
#

yeah its that plus my own api stuff, i had someone coding all this stuff for me but they wanted to take a break from coding so now im starting from scratch

pliant snow
#

Discord bots are nice tho as youre really just reacting to some event thats happened, and you can sign up to handle more or less of them as you go

dapper sinew
#

i actually have no clue if this is api stuff, i have no clue what any of this stuff actually is, but im slowly making the reds go down

#

but like.... how does one fix this negative
Property 'payload' does not exist on type 'never'.ts(2339)
(i have so many of these)

pliant snow
#

Im not super familiar with typescript, but I think that means that the type of that object could potentially be never, which understandably wont have a payload property. You could do something like checking that the variable isnt never (and handle it as needed if it is)

dapper sinew
#

hmm, i shall try that, provided i figure out how to do that. also yay! down to 50

lethal walrus
#

is the easy fix

#

if you want to, you can actually write types for your API

safe dragon
#

I'd have thought they provided a base project that essentially had a simple hello world type situation ready and done as is

#

in an examples folder or something

lethal walrus
#

i think this is from the API integration stuff

#

not the library

dapper sinew
#

i know i had to make imports from scratch cause the code wasnt happy with importing stuff from discord.js

#

it took,,, forever

lethal walrus
#

djs has amazing docs, sapphire from my quick look has great ones too

lethal walrus
dapper sinew
#

yeah, what i can at least, im doing a massive refactor and breakdown

safe dragon
#

god javascript project config files have gotten out of hand

dapper sinew
#

but trying to keep already made code so long as it works

lethal walrus
#

that seems like not a great idea when you don't understand the language

dapper sinew
#

i understand it enough to read, but not write

#

and yeah its a really bad idea, yet im determined to make it work

#

trail by fire sort of thing

#

(deletes system32 by accident)

pliant snow
#

What do you want it to do?

dapper sinew
#

uh, let me check it

#

looks like its the command checker part of the code, i could send a snippet but eh. wont unless someone asks

lethal walrus
#

if it's not too long sure

dapper sinew
#

its checking if the prefix is met or if a slash command is used, then it does things

pliant snow
#

I meant the bot in general i guess

dapper sinew
#

ohhh

#

its a general chat bot, using my AI, it can also be used for moderation eventually and just to have fun with

dapper sinew
#

oop gtg be back in a bit to complain more laugh

lethal walrus
#

Change event: never to event: any in the args

safe dragon
#

is never an actual valid type

#

it sounds more like it'd be an extreme version of void. Not only doesn't it return anything it will just never return...

lethal walrus
#

It is

#

idk what it's used for but it is

#

Notably, you cannot cast it to any, you must go to unknown first

safe dragon
#

my only guess is functions that only ever throw exceptions since that's the only scenario I know of where a function would fail to return

#

strange to treat it as a type

#

but it's something

pliant snow
safe dragon
#

I can't imagine they actually want you to do that

lethal walrus
#

Probably not

safe dragon
#

looking at some docs the examples they give are functions that throw exceptions or functions that loop forever

#

bit of a weird one

#

there's cases for functions that never end for the entire runtime of the program I suppose

#

not a blocking function though I hope...

dapper sinew
#

thats just what my ide put there spooky

#

so i trusted it

cinder karma
safe dragon
#

is this a programmer

#

they look tired

#

long day at work huh

dapper sinew
cinder karma
#

All meetings and no code make Bella an....actually she'd be happy

#

She loves people

#

Me on the other hand am looking forward to a solid evening of getting shit done

dapper sinew
#

aaaaaaaaaaaaa

#

i put in the work(and so did AI)

#

sadly thats my limit even with AI

cinder karma
#

Pylance thinks my string literals are undefined variables?

pliant snow
#

Tell pylance to mind its own business

strange copper
dapper sinew
cyan shadow
cinder karma
#

She's doing somewhat better!

cyan shadow
#

I'm glad to hear that! SBVHugFrog

umbral pecan
#

github copilot is fun, I'm pretty new to c# and I was able to get it to rewrite my loops and if statements to all use chained c# functions. I know it doesn't mean necessarily "better" code but it's great for learning

// ORIGINAL
foreach (GiantCrop giantCrop in location.resourceClumps.OfType<GiantCrop>()) {
    Monitor.Log($"Found big version of {giantCrop.GetData()?.FromItemId}", LogLevel.Trace);
    string? item_key = giantCrop.GetData()?.FromItemId;
    if (item_key != null) {
        // Note the key is the source items id (e.g. Melon is '(O)254')
        if (cropTypeCounts.ContainsKey(item_key)) {
            cropTypeCounts[item_key]++;
        } else {
            cropTypeCounts[item_key] = 1;
        }
    }
}
// REPLACEMENT
cropTypeCounts = location.resourceClumps
    .OfType<GiantCrop>()
    .Select(giantCrop => giantCrop.GetData()?.FromItemId)
    .Where(itemKey => itemKey != null)
    .GroupBy(itemKey => itemKey)
    .ToDictionary(group => group.Key!, group => group.Count());
cinder karma
#

Yeah it tells you to do that but doesn't mention it is pretty bad performance wise

#

I had to rip all that pretty out

thin estuary
#

it's rarely noticeable

sand frost