#programmers-off-topic

1 messages · Page 2 of 1

thin estuary
#

oh god yeah, that's AWFUL

safe dragon
#

oh no

earnest cairn
#

(sorry Esca SDVpufferlurk )

thin estuary
#

good luck finding anything on Github

safe dragon
#

I don't think I've had a partial class span more than 2 files

#

copy paste em all together into one big monstrous file

#

I feel like a 30 file partial class suggests it might be worth reconsidering if all that should be a single class

sand frost
#

some fields is a strech

#

no fields is the ideal

safe dragon
#

having a nice project structure makes me feel warm and cozy inside so I always do it

#

ok there's an exception

#

quick cli programs I slap together for testing

#

that's just a program.cs with everything thrown in

sand frost
thin estuary
#

honestly that looks fine to me

#

having separate files would be annoying for that

crystal wren
#

Oh, geez, one file for those for sure!

safe dragon
#

might be able to make these one liners with primary constructors assuming it's on C# 12

sand frost
#

I don't know what your fancy words mean 😛 I wasn't even sure if I needed a constructor tbh

#

I am on C# whatever-VS-decided-on-in-.NET-6.0-I-hope

safe dragon
#

essentialy just

public class CustomerBasicFurniture() : Furniture aka adding some parentheses

thin estuary
#

i don't think these are even needed

safe dragon
#

I'm not actually sure they can be ommitted or if it then just doesn't generate a constructor at all

sand frost
#

I mean the things they're inheriting from have constructors

#

I could see it just deciding to use the base constructor

safe dragon
#

right

sand frost
#

But like in the DGA source I don't see constructors in the custom subclasses...of course, many of them are partial so I could be missing things

earnest cairn
#

why cant all IDEs have the same keybindings SDVpufferchickcry

safe dragon
#

to mess with you

#

I use visual studio with VS keybinds for everything except ctrl t

sand frost
#

but specifically only to mess with you, sheku 😛

earnest cairn
#

ReSharper for VS has an option for intellij keybindings

#

but somehow half of them dont actually work...

safe dragon
#

though a recent version of visual studio added its own ctrl t I think hc_pensive

#

it does yeah though I never use them cause vs is what I'm used to

#

I make my life complicated anyway cause I use the vim keybinds extension for visual studio

#

I can't program without vim keybinds anymore it just feels incredibly uncomfortable and wrong now

#

I cursed myself by learning them

#

which is aquo's fault btw

#

just want you to know that, he's why I even tried vim

crystal wren
#

That's why I've never bothered to truly learn it. I just know I'll be cursing myself.

earnest cairn
#

mhh do sdv mods get open source licenses by jetbrains in general? SDVpufferthinkblob

thin estuary
#

i think that's how DH got theirs?

crystal wren
#

Yup!

earnest cairn
#

how long did it take to get a response?

dark veldt
#

(and how did you word it?)

lethal walrus
#

i wonder how complete the wii u port was before it was cancelled SDVpufferthinkblob

earnest cairn
#

of Rider?

crystal wren
#

Initial email, request for more information, and then receiving it.

earnest cairn
#

what was the request for more info?

crystal wren
#

Pretty boilerplate type stuff! If the project provides comemrcial services/is backed by a company, am I/other members of the project paid to worm on it.

#

Also a request to add my email to the GitHub profile.

zinc charm
earnest cairn
#

mhh technically RSV did commission some art SDVpufferthinkblob

crystal wren
#

I wouldn't have thought that would count against you/people on the team getting the license...

zinc charm
#

If the art isnt open source idk how that looks on the project itself

#

I actually added an exception to my repos license for other assets (like vanilla art) but they didnt mention that

earnest cairn
#

uhh can art be closed source? SDVpuffersquee

#

I guess our art is MIT licensed as well as its in the same repo

#

I assume rights go to us if its commissioned.. tho Im not sure SDVpufferthinkblob

safe dragon
#

I get jetbrains rider through my employer rn though I don't use it

dark veldt
leaden marsh
#

I am not a lawyer, but unless that's negotiated, I don't think that's necessarily true

dark veldt
#

Myuu? Is that you?

#

lol

leaden marsh
#

Hello!

#

When commissioning for any professional work, there should be an explicit contract stating what is and isn't allowed

#

(Source: I have bought & commissioned game assets before, but I don't have resell rights for all of those assets)

dark veldt
#

I hadn't thought of reselling, tbh, but that makes sense in that circumstance.

#

But to add to open-source....hmm...

leaden marsh
#

Yeah it's hard to say. I always err on the side of "anything not explicitly stated counts as all rights reserved"

dark veldt
#

Very sound advice, good gentlesushicat

leaden marsh
#

I'm sure a lot of artists who have been commissioned likely don't care/assume that they were giving away full permissive rights when commissioned, but if it wasn't stated, technically the original artist still has all rights reserved

lethal walrus
leaden marsh
#

Resell rights typically specifically refers to selling the art assets on their own

#

Packaging them as part of a bigger work is what the art is intended for

#

If I were to take some of those assets on their own & then re-sell them on, say, the Unity or Unreal Asset stores, that would be a breach of contract

#

This is different from something like Creative Commons Non Commercial, which explicitly prohibits making money in any form from the work or any derived works

lethal walrus
#

ahh

tropic anchor
#

Beautiful SDVpufferwow

safe dragon
#

most confusing thing to me who never uses python except to help random people with their homework and keeps forgetting about the whitespace thing...

#

the exception you get is terribly vague

#

gotta make sure I'm in an editor that auto replaces tabs with spaces or my python code can't run...

#

a complete non issue for anyone who actually has a python dev environment set up but I can't be bothered when helping people with simple homework assignments

#

I've written python code on my phone keyboard before to help someone. It was awful

#

me too

#

I like that most modern languages come with a built in formatter as part of the core language

#

no endless fights about formatting like in C#

#

my impression as an outsider is that python tries to do a lot of things that don't seem to actually go anywhere

#

as a fan of functional programming I appreciate more languages learning the main important lessons from them

#

idk shit about programming communities

#

I usually just keep an eye on articles or posts by influential developers for it

#

used to visit the subreddits before I stopped using reddit

#

yeah I always read the .net blogs considering staying up to date is kinda important for my job

#

idk if dotnet has a community that isn't just the gamedev community. I feel like outside that the language mostly lives in a very corporate environment

#

the communities I pay most attention to I guess are Rust and Elixir since those are my favorite languages

#

elixir is a rather easy language to learn it's very approachable

#

it is a functional programming language though so no mutation

#

no loops

#

easily

#

haskell is like the least approachable functional programming language I've ever tried

#

I had to learn it for uni and have done a whole year of advent of code in haskell

#

but it sucks to learn and even now much of it goes way over my head

#

Elixir is incredibly straightforward. It's not particularly fast though in the pure algorithmic sense.

The main thing it excels at use case wise is being able to handle a lot of simultaneous threads, network connections etc while staying incredibly stable and fault tolerant

#

but that's diving into OTP and the beam VM which is a little much to get into

#

I think elixir is just a nice language for getting used to functional programming without dealing with the extreme complexity and obsessive desire for correctness in haskell

#

erlang, the language elixir is built on top of, has its roots in telecom, being built by Ericsson specifically for that purpose. So that stuff is just very well suited for problems where you need to handle a large network of nodes all handling traffic and being able to gracefully deal with anything that might go wrong

#

it can handle many things itself that'd you'd normally use solutions like kubernetes or stuff like redis pubsub for

#

the whole ecosystem provides a pretty solid complete package for networking related use cases

#

I mean if you've used RabbitMQ before, that uses erlang. Discord and WhatsApp and Pinterest also all use erlang or elixir for networking code

#

not sure how to describe it. Most of what I describe about the networking stuff is generally referred to under the OTP term

#

elixir has a few modules dedicated to making use of it like GenServer

#

fun to dive into but should probably just start with all the regular non networking stuff

#

if you have a passing interest in web development I can recommend Phoenix liveview as well for a more high level showcase of what can be done with it

#

erlang has a very uh, interesting, syntax

#

can't say I'm a fan

#

elixir is definitely easier to get into

#

erlang will actually be switching to hexdocs next release as well

#

hexdocs is essentially the built in documentation generator for elixir

#

think of it like cargo doc for rust

#

pretty much every elixir library will have a hexdoc page like this

#

biggest downside I'll say for elixir(though this is changing) is that it's dynamically typed

crystal wren
#

You say biggest downside, I say "aaaaaa" and run away.

safe dragon
#

the next elixir release will introduce the beginnings of a proper type system

#

it's a major project currently in the works

#

I'd say it's not nearly as bad as stuff like Javascript or python and it doesn't do aggressive type coercion

#

but still

#

I don't like it

#

I love statically typed languages

crystal wren
#

Okay, that's at least one level above those as it is right now!

safe dragon
#

in 1.17 officially it will go from dynamically typed to "gradually" typed

#

moving more to being a typescript than a Javascript. Except unlike typescript they actually have full control over the language

#

I'm sure it will take many more releases to get there

#

1.17 is the first step for types, just only doing inference and catching type bugs it can figure out from that

#

for now only for catching bugs but eventually this type information will be passed onto BEAM and thus the JIT

#

since erlang is also a dynamically typed language BEAM doesn't have a ton of type based optimizations though they've been expanding on it a lot in recent years

#

it's an interesting time

#

can't say I've ever seen a language try to change its type system at a later release years into its lifespan

#

they've got an interesting solution for doing this called set theoretic types but honestly that goes beyond what I understand at some points

#

there's some research paper on it

#

erlang is old yeah

#

partially why its syntax is funky

#

elixir is still young, only 12

#

I've been following its development for four years I think

#

the creator of elixir, Jose valim, is frankly insane and idk if he sleeps

#

insane in a good way

#

you can check almost any large elixir library and he'll be pushing commits to it

#

not just elixir itself

#

projects that use elixir too

#

I'm not sure if there's a list somewhere of what it's funded by

#

Jose valim himself works for dashbit who have significant interest in the success of the language

#

tbh idk if José valim works for dashbit or is part of dashbit

#

it's something for sure

#

I'm relatively sure the erlang foundation partially funds elixir stuff too

#

erlang itself is of course funded by Ericsson

#

considering they made the language

#

the erlang foundation of course benefits from elixir's success even if they don't end up using erlang itself

pliant snow
#

why spend so many words convincing people to use a language that isnt nim

safe dragon
#

it wasn't even my intention it just ended up this way

#

you can shill nim too though it's okay

pliant snow
#

oh i shall

safe dragon
#

the ecosystem, use of their BEAM VM, elixir itself relying on erlang as a dependency

safe dragon
#

I mean I'm going to bed but I know Nim already from u so it's ok

pliant snow
#

its logo is a crown

#

implying its superiority

safe dragon
#

I'm never sure what the main selling point of nim actually is

pliant snow
#

python syntax but its statically typed and compiled is basically it

lethal walrus
#

javascript

#

but also c

pliant snow
#

i like its stl as well

safe dragon
#

looks like python but systems programming language

crystal wren
pliant snow
#

i did look into that at one point

#

when it seemed that the python library had died

safe dragon
#

lmao

#

there's also two for elixir!

pliant snow
#

gasp

crystal wren
#

A different language and library for each bot. Future task!

safe dragon
#

hope we don't have to do one in haskell

lethal walrus
#

and then someone else coffeescript, someone else typescript and then nim compiled to js
4 js bots but all different languages originally

pliant snow
#

is coffeescript still around

lethal walrus
#

mhm

#

oh no it's http

pliant snow
#

i edited a single coffeescript file once

lethal walrus
#

oh no they support https

safe dragon
#

I'll do one in elm

#

also compiles to Javascript

pliant snow
#

nim also compiles to javascript

safe dragon
#

yes

#

elm is an abandoned language but it's ok

crystal wren
#

Who wants ColdFusion?

lethal walrus
#

can you use js libraries in nim compiled to js?

#

like do you have to use discord.js or dimscord

safe dragon
pliant snow
#

I'm not sure how far the compilation goes. I know they have a bunch of DOM manipulation stuff, but I think you could probably do some FFI thing and use discord.js, maybe

#

ive barely used their js stuff

safe dragon
#

you had all these plans for AoC 2023

pliant snow
#

That was the year before. I did create a way to compile to both web and natively, but there was some reason i stopped doing the web stuff, but i dont remember why..

lethal walrus
pliant snow
#

its javascript, but with more steps

safe dragon
#

and we all know the Javascript community loves Javascript but with more steps

#

preferable if it comes with 3 more configuration files for your repo

lethal walrus
#

*sits in many typescript and svelte repos*

safe dragon
#

svelte is nice

#

I like svelte

pliant snow
#

i spent a long time figuring out how to compile rust to wasm without involving some sort of npm packager thing, which all the tutorials use

safe dragon
#

was that a long time ago

pliant snow
#

yeah it was for the game boy emulator, so during the pandemic

lethal walrus
#

svelte is nice

safe dragon
#

but is a Javascript library truly complete without useMemo

lethal walrus
#
<script>
  let count = 0
  let doubled = 0
  $: doubled = count * 2
</script>

<button on:click={() => count++}>{count} - {doubled}</button>
safe dragon
#

svelte 5 runes tho

lethal walrus
#

what's happening

#

i have hjeard but not lolked into it

pliant snow
#

svelte looks cool, but idk what i'd do with it

lethal walrus
#

may I suggest:

  • android mod compat site
  • mod host site
  • mod jam submissions form
  • password manager
  • (upcoming) mod converter ui
safe dragon
#

take a loot at runes I think you'll like it. It basically expands on what you showed off there to be more versatile and have fewer unexpected footguns

pliant snow
#

so much effort all to avoid writing javascript

safe dragon
#

nah unfortunately you still write Javascript

pliant snow
#

so much effort all to not avoid writing javascript

safe dragon
#

it's ok you can use Leptos and use rust instead

#

look it's faster than svelte

safe dragon
#

and thus better

#

it do be more text

#

but good benefits

worn remnant
safe dragon
#

when will someone write a Javascript library faster than Javascript hc_pensive

#

react being slow definitely isn't news

#

though they're introducing a compiler soon

worn remnant
#

i see react continues to solve the wrong problems

safe dragon
#

it's what they do best

#

first they got the whole web development world to switch to SPAs and then realized that actually has issues and then backtracked with server components and a hundred layers of complexity

#

only for some guy to use it for a website that could've taken like 30 lines of Javascript

#

wouldn't be the web dev world if it didn't try to reinvent the wheel every few years

#

now we've got htmx which is practically just going back to an old school website but marketed as innovation

sand frost
#

I think this is general C# enough but my brain is really hurting trying to understand the types/syntax:
(Item item, Action remove, Action<Item> replaceWith) => action(item)
this is somehow a ForEachItemDelegate

#

I don't understand what an Action is

#

It seems to be defined in System

worn remnant
safe dragon
#

Actions are just... a method that's defined to run once you call it

sand frost
#

somewhere in this nugget of code is what I need, I swear

safe dragon
#

they're like Func but no return value

sand frost
#

so I can take in Action remove to a method and then somewhere in my method, just call remove();?

safe dragon
#

yes except you can pass it as a parameter

pliant snow
#

a callback

safe dragon
#

smh what is this, Javascript?

#

callbacks would specifically be actions that are executed once the function itself is done

lethal walrus
#
def getNumber(cb):
  return cb(int(input('give number')))

def double(n):
  return n * 2

print(getNumber(double))

python callbacks, kind of

safe dragon
#

basically just functional programming

sand frost
#

I feel like functional programming made more sense SDVpuffercry

#

Part of what's driving me nuts is that I don't understand the syntax C# uses, like Func<Item, bool> being a function that takes in an Item and returns a bool??

#

it feels wrong to put input and output together

safe dragon
#

in Func the last type parameter defines the output yeah

lethal walrus
#

that's definitely Function(Item item, Bool bool), the idea of it being the output is horrendous

sand frost
#

the fact that C# also lets you define inline functions right there also throws me off, I understand them when they're separated out a lot better

safe dragon
#

I love Linq and by extension Func

#

what's tripping you up here

sand frost
#

Probably that I started out life in Scheme

leaden marsh
#

In some ways, putting the return type last makes sense?

"This function takes an Item, outputs a bool" does make sense reading left to right

sand frost
#

I mean it makes sense if you must commit the crime of grouping them, I do agree 😛

#

To me it feels like it should be most like List of inputs in a tuple together with the output type

#

but that does start to be a lot of formatting to say a thing

#

like ([type1, type2, type3], typeOut)

leaden marsh
#

For sure, I think the template syntax is limiting in that regard

#

I mean, technically you could do that

#

A little extra overhead but if it helps with readability /shrug

#

Fwiw I'm not a fan of C# but I'm definitely warming up to it

sand frost
#

I actually do in general like C# a lot

leaden marsh
#

I like it much better than a lot of other languages for sure

sand frost
#

I think the relative strictness of the type system compared to Python is very nice from a pedagogical standpoint (I write a lot of Python for work)

#

and compared to Java, the bullshit overhead is much less and makes more sense

leaden marsh
#

Agreed

sand frost
#

(how many times did I write public static main void like an incantation in Java?)

leaden marsh
#

I appreciate having operator overloading

#

And very easy access to unsafe constructs

#

The code reads really easily to me too

sand frost
#

It wasn't until I started writing C# that I understood what static was doing here

leaden marsh
#

Ahhh yeah, I feel that

#

Java is probably my least favorite by far

sand frost
#

Java was great when it was the only object-oriented language I knew

#

But then I discovered Python...

#

Writing Python feels like writing pseudocode, both in a good way and a bad way—it flows so fast, but sometimes weird shit sneaks in

leaden marsh
#

My two favorite languages are Python and C, for completely opposite reasons

sand frost
#

I don't know any C, and I'm unlikely to learn anytime soon

leaden marsh
#

I don't really recommend it lol

sand frost
#

it's an acquired taste? 😛

leaden marsh
#

Ehh more like I feel that coding is an important toolset

sand frost
#

I also write a lot of Matlab, so I guess I understand that a bit

leaden marsh
#

And that C is not an important part of that toolset to understand

sand frost
#

(the having a language you favor but won't recommend)

leaden marsh
#

I think with C you focus much more on the "how it does something" vs "what something does"

#

In Python you take a string, and say "split"

#

In C, you say, what the fuck is a string

sand frost
#

Yeah, in both work and modding I've never really needed to say "what the fuck is a string"

#

other than that time Matlab decided to start believing in strings

leaden marsh
#

Yeahh I love C for the amount of control I have over how exactly the computer does what I'm trying to make it do

#

But I think for a majority of code, you don't need to be interested in that specific part

#

It's impractical for many use cases, but absolutely essential for the select few that requires that level of control

#

(not to mention most high performance Python libraries are built on C)

sand frost
#

Which I am very grateful for!

#

Specifically that someone else wrote the C so I don't have to

leaden marsh
#

And that's why I love Python

#

Big ecosystem of code that can make smaller scripts & applications Just Work ™️

#

It's easy to find portable Python implementations & a lot of unix-y OS'es have it prepackaged

sand frost
#

admittedly some of the packages are jankier than others

#

but it's definitely a nice ecosystem to be in

leaden marsh
#

definitely, I think there's a lot it does poorly but it's so quick to whip up something last minute

#

like, say, a discord bot to manage forum posts or something

#

or just to interpret some data quickly

#

I feel like Node.js might be comparable in that aspect but it's just a lot of overhead to install for me

#

I have maybe a dozen Python scripts for helping with various Stardew-related tasks

sand frost
#

Mine are mostly content pack conversion scripts lol

leaden marsh
#

I have a few save file related ones, like an experimental one for transferring the ownership of a MP save to a farmhand

crystal turret
#

Syntax error

cinder karma
#

See I love Rust because it has sorta that "easy to write" python feel if I'm just doing something basic

#

But it does a really good job of holding my hand when j make a mistake

#

While I often find (at least older) python libs frustrating due to the lack of type annotations

#

Any SDVpufferfear

#

I rely a lot on the IDE

#

And don't like it when type info is scrubbed like thar

safe dragon
#

sure love javascript libraries without like any documentation and then trying to figure out how to use it while the IDE has absolutely no idea what object you're "dotting into" so gives the most nonsensical suggestions

#

type information helps so much for figuring out a new library

#

and same experience with rust. The initial hurdle is a little high with the borrowchecker but eventually you start to appreciate the compiler for being incredibly good at finding mistakes and providing help in fixing those mistakes

cinder karma
#

Julia is the one I want to get into more

#

I just set up jypter for her

safe dragon
#

I tried julia many years ago a little bit but the IDE experience was awful at the time

#

I hope it improved

#

I think Julia is how I learnt about the concept of a repl

#

something I still never use

cinder karma
#

God sometimes you just want better broadcasr support when you're generating 1400 graphs you know 🙈

hollow geyser
safe dragon
#

why argue in PR comments when you can do it in code comments

regal ingot
#

because the next idiot developer who comes along and wants to change the behavior is not going to search through the commit history to see why it behaves that way (much less go look at a PR)?

#

(I'd give even odds that the two different choices were implemented by the same developer and they are leaving a note for themselves)

safe dragon
#

I mostly just thought it was funny so I didn't expect an actual answer but yeah I get why though the corporate approved™️ way would be to argue in PR comments and then add a code comment explaining why they settled on the solution

cyan shadow
#

this is the equivalent of an entire legal team having an argument in the comments of the work google doc and I love that it's not industry specific

safe dragon
#

arguing about minor details in a piece of written text feels like a good fit both in law and in programming

#

I'll take it over arguing in an email chain any day of the week

earnest cairn
hollow geyser
pliant snow
#

I think my boss would be in my office if I left a comment like that lol

earnest cairn
safe dragon
#

and written in visual basic TakoTired

pliant snow
#

is there a migration path to make a codebase... not visual basic, or do you just have to rewrite the whole thing

cinder karma
#

So older than you are, sheku?

safe dragon
#

cash registers truly run state of the art software...

lethal walrus
earnest cairn
#

not sure what you are trying to insinuate here good sir SDVpuffersquint SDVpuffersquee

cinder karma
#

Just kidding, lol

#

Joke would have worked better with 20 year old code

fleet oriole
#

Maybe this is the right spot, hopefully? Someone mentioned in the other bit that pathfinding went from a quartic algorithm to a reasonable algorithm. I googled quartic vs reasonable, but i didn’t get anything sense-makingly associated. Quartic seems to mean like all possibilities? Or did I read wrong? What’s this mean, if I might ask! Thanks loves!

worn remnant
#

i was talking about big-O notation for algorithm complexity https://en.wikipedia.org/wiki/Analysis_of_algorithms.
"quartic" means n to the 4th power (very bad). i don't know what the actual complexity is of the updated version but i'm sure it's no worse than quadratic (2nd power), and it's almost certainly faster than that, so i flippantly called it "reasonable"

cinder karma
#

so it's quadratic at best since it plots the path from each map to every other map

#

and I think it's actually slightly worse than quadratic (but not quite cubic)

gray moth
#

without having taken a look at npc pathing in sdv at all I am surprised it's as big an issue as it is. You'd think that considering the relatively low amount of npcs and lack of pathing related map changes mid day that it'd be pretty straightforward

#

Id probably just keep a list of what locations connect to each other, then fill to find the closest exit warp then cache the paths between exit warps

#

you could probably even use background threads to calculate routes before the schedule changes

regal ingot
#

that presumes that all exit warps of a location are reachable from all entrances

#

Pathing is a big issue in part because the implementaton is just not good.

gray moth
#

make it a list of location & exit combinations then, doesn't really change much

cinder karma
#

Realistically it would be nice for the game to acknowledge the various items players put down and try to path npcs around them

#

But yeah. There really isn't anything complex about it, it's just the original 1.5.6 implementation was bonkers

frigid cove
#

I always forget that a lot of these college courses are free to watch online

#

Some students in my class intentionally created some absurd sorting algorithm with a big o time complexity of like O(n!) or something and named it after my professor lmao

#

not sure if he saw it lol, he was an interesting guy

cinder karma
#

I like cosmic sort

#

Wait for cosmic rays hitting your ram to magically sort your list

pliant snow
#

don't be silly, sleep sort is the ideal sorting algorithm

frigid cove
gray moth
#

ZeroSort has a complexity of O(0)

#

cant beat that

frigid cove
#

I mean 🤷

worn remnant
zinc charm
#

I just saw a YouTube video saying the bit flip was almost certainly just the guys faulty n64, mostly because the speed run has other things warping around erratically

worn remnant
#

oh, the more you know

fleet oriole
cinder karma
#

God i would kill for a friend class in c#

#

Protected except for this other class where I store my extension method plz Microsoft

safe dragon
#

the name would be confusing cause in visual basic .net a friend class is an internal class

#

you can even have a protected friend in vb.net

#

which sounds very sweet of course

thin estuary
#

protected internal is a thing in C# too

#

i've used it once

cinder karma
#

Yeah but you know that is. Not what I mean haha

#

I've used protected internal too

safe dragon
#

doesn't hit the same as protected friend

cinder karma
#

In this case I would say VB is wrong haha

#

(Although iirc internal=friend at the il level too.)

worn remnant
#

introducing their latest naming innovation: Microsoft Visual friend

safe dragon
#

Friend#

pliant snow
#

F#

#

wait..

safe dragon
#

never know how to feel about F#

#

the language is technically pretty nice but it doesn't take long till you need to use something from the C# libraries and things start feeling clunky or like it's not even a functional programming language anymore

#

mutation slips in anyway hc_pensive

#

wish C# did immutable datastructures better

#

in rust if I say something is immutable it's genuinely impossible to change. In C# readonly, record etc are all surface level and the moment something is a reference type you can change its contents anyway unless that datastructure is itself also immutable internally

thin estuary
#

Swift is similar to Rust in that regard

sonic mirage
#

it's always seemed odd to me that C# readonly is just about assignment

safe dragon
#

it's the same annoying limitation that causes an .Add call on a list to be considered a read operation not a write

sonic mirage
#

As much as I don't want to support Apple, I wish we would get more iOS work so I had a reason to get back into Swift. It's probably my favorite language I've worked in, but it's been at least like 4 years since I've touched it

thin estuary
#

i wish Swift actually was multiplatform

#

currently it's all a lie

#

i've had like 3 attemps across several years to get it to work on Windows, with various issues

cinder karma
#

Swift is COW right?

sonic mirage
#

They have LSP for it, but last I checked there wasn't a simple way to do something like build a website or anything

#

So I think it's more about the libraries

thin estuary
#

copy-on-write? it makes COW possible, and uses that for stdlib lists/dictionaries

safe dragon
#

we have a few applications at work that need to provide proper change detection and C# makes that effectively impossible without either full control over the datastructure and the NotifyFieldChanged type setup or require a very expensive process of manually comparing everything which also tends to cause issues due to reference equality often getting in the way

#

it's annoying to say the least

cinder karma
#

Yeah I recall copy on write to be very favored in swift land

thin estuary
#

meanwhile in Swift:
struct Asdf { ... }
var asdf: Asdf { didSet { ... } }

safe dragon
#

never used swift. Only apple device I've ever used is my iPad

pliant snow
#

all I remember from my course in Swift was how much I hated the Xcode editor

sonic mirage
#

Swift's optional chaining and unwrapping was some of my favorite, though it did take a minute to get your head around it

#

With XCode you really need to redo most of the key binds

thin estuary
#

Xcode sucks, yeah. and AppCode is dead

#

unfortunately no other IDEs out there

pliant snow
#

I remember just fighting against position constraints more than actually writing anything lol. But that was many years ago when I had zero idea of what I was doing

#

instead of like, two idea of what I'm doing

safe dragon
#

I've never really looked into it so I'm sure this is well known but like... why is xcode so necessary? What does it do that some cli utility or something wouldn't be able to do

pliant snow
#

part of it is that that's how they distribute the SDK iirc

sonic mirage
#

For iOS apps at least, you need their interface builder, since you have to literally tie functions to interface components by clicking and dragging

pliant snow
#

the other is that's the layout editor and all the GUI tools

thin estuary
#

be it in UIKit or SwiftUI

worn remnant
#

i was about to say i'm sure you can do your UI without it, but there's no way apple makes that easy or straightforward

sonic mirage
#

Yeah I last worked in Swift just after they'd introduced their newer interface SDKs

pliant snow
#

it's a lot of manually editing whatever configuration files they save stuff in

safe dragon
sonic mirage
#

Their interface builder generates a smack-ton of XML behind the scenes

thin estuary
#

good luck doing any kind of code review on whatever Interface Builder spews out

safe dragon
#

lmao

#

I'd like to try swift someday but my complete lack of any apple hardware is a bit of an issue

sonic mirage
#

You should technically be able to write it in any IDE that has LSP support, but I've never tried

thin estuary
#

i'd love to start building small tools and projects for myself in Swift, but yeah, Windows support is a joke

pliant snow
#

I think you can use switft for CLI stuff without apple hardware

#

but ive never tried so who knows

safe dragon
#

swift Advent of Code

#

is Linux at least decently supported

#

I don't run windows anyway so that limitation isn't a problem for messing around

thin estuary
#

my last attempt was ALMOST successful... except typing a single letter was freezing their language server, so i was losing all code completion in VS Code

safe dragon
#

not ideal

thin estuary
#

i still don't get why their REPL requires Python

sonic mirage
#

A few distros listed on https://www.swift.org/download/

safe dragon
#

not arch but I'm sure they'll have a package

#

not like the average Linux person downloads installers from a website anyway

pliant snow
safe dragon
#

repackaged from fedora

#

disgusting

pliant snow
#

Is it? The swift-bin package seems to be getting it from an apple server

safe dragon
#

why do I need nodejs

pliant snow
#

everyone needs nodejs in these trying times

safe dragon
#

I don't want nodejs

#

get it away from me

pliant snow
#

oh the wiki does say its a repackaged fedora binary

#

...im not sure thats true

safe dragon
#

they're lying smh

pliant snow
#

I think nodejs is just for the vscode plugin

#

idk why you dont just grab it from their store

safe dragon
#

I did find out a language I was semi half intrigued by got its 1.0 release a few days ago

pliant snow
#

semi half intrigued

#

what high praise

safe dragon
#

I know

#

it's called Gleam

pliant snow
#

ive heard of this

#

idk why ive heard of this

safe dragon
#

probably me

#

essentially elixir but statically typed

#

and Javascript interop for some reason

sonic mirage
#

Everything has JS interop these days, re: Dart

safe dragon
#

the lengths people go to to not have to directly write Javascript

#

very understandable

sonic mirage
#

If browsers could directly run TypeScript I would be so happy

safe dragon
#

wasn't there some proposal for that

sonic mirage
#

Not that I saw, but probably

pliant snow
#

oh im sure microsoft would love that

safe dragon
#

if we went that route I'd prefer a statically typed language that isn't held back by Javascript compatibility

pliant snow
#

adobe flash

safe dragon
#

Java for the browser

#

I'll continue to pray for wasm adoption

#

I feel like rust is practically the only language with an actual proper decently mature wasm compilation target

pliant snow
#

C++ also has one, but I think it's not in the normal compilers

#

but yeah, I'm a little annoyed by it

safe dragon
#

idk how good the C# wasm compilation target is but it seems to have to load in the entire .NET runtime as wasm on load

#

which is slow

#

I hope their AoT ventures continue and we can get proper wasm compilation that doesn't come with the whole runtime

pliant snow
#

my favorite are the people trying to get wasm running on desktop

#

for some reason'

worn remnant
#

the same reason we have nodejs, i expect

safe dragon
#

same people probably that want WebGL to get desktop adoption

#

turn the entire computer into a browser

#

ChromeOS truly was ahead of its time

#

who needs desktop applications when you have electron

#

run games inside an html 5 canvas

pliant snow
#

the crosscode philosophy

safe dragon
#

exactly

lethal walrus
safe dragon
#

is this stardew valley in an off topic channel!

lethal walrus
#

well it's not art i'm showing off

silent sky
lethal walrus
round shuttle
#

I just used ECS in one of my non-SDV mod projects. It looks so flexible but sometimes it’s complicated and confusing. I need to learn more about ECS but it looks like interesting way how to design game patterns.

Can you imagine SDV if it uses ECS? 😀

safe dragon
#

wow

safe dragon
#

I think I've seen a few WIP farming sims floating around in my times lurking in the Bevy game engine discord

#

highly unlikely any of em will ever become a full-fledged game but the idea is there

#

don't know enough to really have a strong opinion on it. Using Javascript as a fundamental part of Bevy would be a very strange choice and go against its principles but for game interfaces in general?

#

the obvious question to ask would be the performance impact but one I find more interesting is one of the design goals Bevy has with their future UI rework. worldspace UI.

What I mean with that is for example a display panel inside the game that has its own UI. Ideally this panel in the game world can be designed using the regular UI system you have available

#

I'm not sure a web rendered overlay would be able to do this at all

#

since the panel is actually in the 3d world, you might look at it from an angle, it might be partially behind foliage

#

it'd need to be something that can be rendering both on top of the game and inside the game render tree nested

#

there's also the question of build targets. Wasm would be straight forward but how easy would it be to have a web rendered overlay on all desktops platforms, consoles etc.

It might add a lot of overhead to maintain something like this and existing tools like webview come with their own slew of issues

#

that said

#

it could always be an option

#

I can't imagine it'd ever be first party but a third party, like gameface, could always implement one

#

there's been many different UI experiments for bevy of varying qualities

#

I'm sure they'll settle on something pretty good eventually

#

right now it's rather basic

#

now I don't think taffy is going anywhere in the new UI system but the system built on top of that could use work

#

eventually UIs will ideally primarily be defined in bsn files (essentially Bevy scene files)

#

and have a visual editor of course

#

but the editor is still very early in its development

cinder karma
#

oh hey, a use of ValueStringBuilder in the wild!

#

public string ReplaceLineEndings(string replacementText)

round shuttle
#

Anyway if SDV uses ECS it makes it more open and flexible for C# modders too.

safe dragon
#

oh neat

#

I guess it makes sense that there's ecs implementations for C# considering its use in games

#

I only really knew of flecs

#

and of course the whole game engine types like bevy

safe dragon
#

wonder how it compares to using Flecs.NET, a c# wrapper around flecs

round shuttle
#

but Arch is more barebones

lethal walrus
cyan shadow
#

You're cooking, I see SDVpuffersquee

lethal walrus
crystal wren
#

What's this being written in?

lethal walrus
#

Go for the main, svelte for frontend

crystal wren
#

Uses native rendering engines - no embedded browser!

Huzzah! SDVkrobusgiggle

lethal walrus
#

Does mean edge though

austere comet
lethal walrus
#

Oh interesting

pliant snow
#

as exemplified by the phrase "let them cook"

plush raft
#

hey all, i'm taking an intro programming class as part of my software engineering degree, is anyone familiar enough with CORAL to help me with something? my professor is out for the night

zinc charm
#

I've never heard of coral, but depending on the complexity of the issue that may not matter

safe dragon
#

I thought I was pretty knowledgeable about the programming languages out there but I've never heard of coral

zinc charm
#

looks like a scratch type language

safe dragon
#

but yeah if it's an intro class it's probably fine

plush raft
#

okay so

#

"Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical." So if the input is 91, it is supposed to output 91 90 89 88, stopping when the two digits are the same. What I've written does that part just fine. However, if the input is outside that 20-98 range, its supposed to output "Input must be 20-98" and it does that, but then it keeps going and subtracting still. Let me grab my code to show you

#
integer digit2

num = Get next input
digit1 = num / 10
digit2 = num % 10

if num < 20 or num > 98
   Put "Input must be 20-98" to output
while digit1 != digit2
   Put num to output
   Put " " to output
   num = num - 1
   digit1 = num / 10
   digit2 = num % 10
if digit1 == digit2
   Put num to output
   Put " " to output```
#

If i input something in the correct range, it does fine

#

But if i do something out side like 9 for example i get this "Input must be 20-989 8 7 6 5 4 3 2 1 0"

safe dragon
#

just so you know, you can put code in a code block in discord by surrounded it with ``` on both sides

plush raft
#

good to know!

safe dragon
#

makes it easier to read

pliant snow
#

What would you expect to happen if you enter 9?

#

I would assume it would go down to 0, since that's "00"

plush raft
#

If you enter 9 it is supposed to just output "Input must be 20-98" and stop there, i need a way to like kill it if it input isnt right

cinder karma
#

You print a message but never tell the program to exit

pliant snow
#

ah

cinder karma
#

Either use an else statement

safe dragon
#

so basically your while loop is still executing for the below 20 case right now which you don't want

cinder karma
#

Or exit the function

safe dragon
#

so you want the while loop to be in a different branch than the below 20 case

cinder karma
#

Sorry don't know enough of specifics

safe dragon
#

coral has a section on branches in their tutorial section

#

essentially the whole logic of counting down needs to be behind an else to be in a different branch from the case where the input is below 20

plush raft
#

so the whole thing needs to be in if-elseif statements? can i put a while statement inside one?

safe dragon
#

yeah

cinder karma
#

And afk so can't check docs

safe dragon
#

you do have an alternative cleaner option

plush raft
#

okay that seems to have fixed it, let me test a couple more inputs

regal ingot
safe dragon
#

you can add more conditions to your while loop to make it stop immediately for numbers below 20 or over 98

#

that avoids the else

#

either works

safe dragon
safe dragon
plush raft
#

okay so trying the if-elseif:

#
integer digit2

num = Get next input
digit1 = num / 10
digit2 = num % 10

if num < 20 or num > 98
   Put "Input must be 20-98" to output
elseif digit1 == digit2
   Put num to output
   Put " " to output
else
   while digit1 != digit2
      Put num to output
      Put " " to output
      num = num - 1
      digit1 = num / 10
      digit2 = num % 10```
#

that works for numbers outside the range

#

but it doesn't print the last number it needs to

#

like for 91 input, it stops at 89 without printing 88 as it needs to

pliant snow
#

Indeed

#

You're checking in a while loop when the two digits are different, but once that while loop ends (when theyre the same)... it just stops

safe dragon
#

check where you're printing right now

pliant snow
safe dragon
#

yeah which would've been fine, just an early return for the invalid inputs

pliant snow
#

but this is a good life lesson lol

safe dragon
#

this language is so tiny damn

pliant snow
#

why make big parser when little parser will do

regal ingot
#

little toy language

safe dragon
#

the last assignment in the programming intro is writing a parser for the language itself...

pliant snow
#

The ole "Im sick of teaching a class this early in the morning" trick

regal ingot
#

yeah, that's not going to work since there are no tokenizers or string operations

safe dragon
#

I did love my languages and compiler course in uni

plush raft
#

fixed!

regal ingot
#

If you want that sort of course, do it in a lisp derivative. You get your whole parse tree for free with a read

plush raft
#

i ended up checking if the digits match twice, which i'm sure there's better ways to do it, but not with the components it wants me to use

safe dragon
#

what's the code you ended up with

plush raft
#
integer digit1
integer digit2

num = Get next input
digit1 = num / 10
digit2 = num % 10

if num < 20 or num > 98
   Put "Input must be 20-98" to output
elseif digit1 == digit2
   Put num to output
   Put " " to output
else
   while digit1 != digit2
      Put num to output
      Put " " to output
      num = num - 1
      digit1 = num / 10
      digit2 = num % 10
      if digit1 == digit2
         Put num to output
         Put " " to output```
safe dragon
#

there are indeed better ways to do this

sand frost
#

But also many worse ones tbh

plush raft
#

redundant? yes. worth full points? also yes

pliant snow
#

oh there are many, many worse ones

regal ingot
#

you can move the printing to after the while loop, since checking the range has guaranteed that there will always be something to print

safe dragon
#

you could've hardcoded the countdown manually for every value between 20 and 98

#

the pro strat

plush raft
#

printing it after the loop created a problem with numbers outside the range

safe dragon
#

put "97"
put "96"
put "95"

regal ingot
#

but it won't if that's inside the else branch after checking the range

pliant snow
plush raft
#

ohhh i see

safe dragon
#

you could also move the first puts before the while loop starts and remove the condition on the one at the end of the loop. It has the added bonus of making the else if branch unnecessary

plush raft
#

oh i see how that could've worked too!

pliant snow
#

Part 2 - The elves read the instructions wrong, you actually need to check values between 20 and 89127384596478938472638794

safe dragon
#

lmao advent of code....

plush raft
#

lmao. that would only require that i change checking the range though, no?

pliant snow
#

If you wanted to make sure all the digits were the same, you'd have to change some things

#

and have a lot of time to wait

safe dragon
#

assuming coral as a language can work with numbers that large nothing would change. It'd probably crash the printed output though cause that's... well at least several quintillion printed lines I'm not counting

plush raft
#

trueee

#

thanks all! i will definitely be back when i start java in a couple months XD (if not sooner)

safe dragon
#

a real™️ language

#

this is a server of C# devs so expect some people shitting on Java though hc_pensive hc_pensive

regal ingot
#

C# is java++

plush raft
#

funny enough, my choice would've been C# but i messed up when choosing my paths, i intend to go and take the C# classes after anyways since they won't let me take them until I finish Java now

pliant snow
#

C# is microsoft flavored java

regal ingot
#

the skills will the pretty transferable

safe dragon
#

could probably learn C# fairly easily yourself after Java

#

the language may have deviated quite a bit in their lifespans but the basics are still in principle the same

plush raft
#

i've heard the first one is the hardest, and the rest come easier

safe dragon
#

unless your second language is haskell

#

then the second one is the hardest...

regal ingot
#

it's not a bad generalization, but it depends on what you start with

safe dragon
#

yeah it's mostly true

regal ingot
#

pretty much everything in the "imperative" family is going to work that way. Functional languages are more highly variable. And let's not even think about declarative languages like prolog.

safe dragon
#

especially if you stick to languages within the same paradigm

#

we basically said the same thing

regal ingot
#

yep

safe dragon
#

prolog I'm not sure I fully grasped even after my course in it ended

plush raft
#

does anyone know why they made me start with SQL and databases first?

safe dragon
#

well it's a useful skill but I don't think they usually start with that

plush raft
#

SQL wasn't too bad tbh, my guess was that they were trying to get you used to following syntax strictly

safe dragon
#

sql can be pretty nasty if you go beyond the normal queries but yeah

regal ingot
#

that is a strange choice

safe dragon
#

a month or two ago I had to decipher some kind of bit manipulation logic written in TSQL

#

that was some of the most confusing code I've read in a long time

regal ingot
#

good skill to have, but not directly transferrable to what's generally considered "coding"

safe dragon
#

yeah

#

though it's a language that's desired by a very large portion of tech jobs even when it's not the main thing you'll be using

regal ingot
#

(although techically I think the more recent versions of SQL are turing complete... if you're willing to torture yourself to figure out how)

safe dragon
#

it definitely is

#

some nasty shit

#

I'm mostly familiar with TSQL but shout out to DECLARE CURSOR FAST_FORWARD

regal ingot
#

at that point, pretty much nobody is really using SQL, but rather one of the vendor-specific variants... at which point why not use whatever procedural language it offers

tropic anchor
#

When I started learning, things went HTML -> JS -> PHP -> SQL -> Python, the rest I learned on my own

pliant snow
plush raft
#

It's a Bachelor's of Science in Software Engineering - Java

tropic anchor
#

Ew (<- doing the same thing)

plush raft
#

Also yeah i did do a little HTML and CSS i forgot about that

tropic anchor
#

Good, need to forget that asap

pliant snow
#

The first half of my degree was mostly Java and the second half mostly C, with a few individual classes where we did python, js, c#, etc

tropic anchor
#

I was given this week to create an android app (with rest api absolver) which will be assed next week... yay college

plush raft
#

The only difference between this degree and the C# focused one is like 5 classes so I'm kinda pissed they won't let me just add them

safe dragon
plush raft
tropic anchor
#

Android is fun (please help I'm dying) puffercry

safe dragon
#

idk anything about mobile development tbh

tropic anchor
plush raft
#

actually scratch that, it's probably the final for my "Android Development" class not the degree

pliant snow
#

then you can enter the workforce, where you'll have to go through 2 months of design reviews before you can submit a single change

safe dragon
#

now for my job it's C#, SQL and HTML/CSS/Javascript and when I'm very unlucky some VB.NET

safe dragon
plush raft
#

anyways, i won't get any work done if i keep discord open, on to arrays it seems, thanks again!

safe dragon
#

good luck

tropic anchor
#

I document code, but these people have me transcribing an audio interview (for a grade)

safe dragon
#

manually?

tropic anchor
#

YES!

#

And they throw in weird non sensical shit so you actually do it manually

safe dragon
#

throws it into whispertranscribe

#

damn

tropic anchor
#

Buddy answers a phone call from the doctors mid work interview

#

Anyway, that was my rant for tonight, gn puffernight

crystal turret
#

#include <nyanpasu>

plush raft
#

annnnd, I'm back with more problems.... arrays have a set number of items in them, right??

sonic mirage
#

It varies by language

#

Generally yes

#

In more modern languages you can just add to them though too

plush raft
#

i'm like 70% sure this is asking me to use an array with a varying number of elements

sonic mirage
#

What language

plush raft
#

it's Coral, i'm taking an intro programming class

sonic mirage
#

No idea on that, sorry

#

For more basic languages, array size is fixed. For a flexible length structure you'd use a linked list.

plush raft
#

afaik coral is as basic as it gets, if I pasted the question here, would you be willing to tell me if you'd interpret it the same way?

sonic mirage
#

Sure

plush raft
#

Given a sorted list of integers, output the middle integer. A negative number indicates the end of the input (the negative number is not a part of the sorted list). Assume the number of integers is always odd.

Ex: If the input is:
2 3 4 8 11 -1
the output is:
4
The maximum number of inputs for any test case should not exceed 9 positive values. If exceeded, output "Too many inputs".

Hint: Use an array of size 9. First read the data into an array. Then, based on the number of items, find the middle item.

#

I initialize the array with a size of 9 but if there are less than 10 inputs I get an error that it's still looking for the next input but can't find it

sonic mirage
#

Ok, so to answer your initial question, the question says to use an array of length 9, so you should do that.
I'll just describe how I'd approach this to you since I don't know how you're getting the inputs and all that.
I'd have a variable outside the loop, count that I increment each time I read in a positive integer.
Then when I find the negative one, I'd set another variable like isDoneReading from false to true so I know not to increment count anymore.
Then either exit the reading or loop or however you'd getting inputs early, or just fill the rest of the array with junk or more negative numbers.
Then divide count in half and round up to get the index of the array you need to read the middle number out of.

#

Or divide in half and add one, however that works out

#

integer math is always weird to me

plush raft
#

i actually went through this earlier for a different question with wanting to end a loop early, turns out there's not really a way to do it in Coral because of how basic it is. The rest of that I did manage to do, and it works great when there's exactly 10 inputs. I'll have to find another work around for getting the inputs.

sonic mirage
#

Well keep in mind the part of the question that says you need to output "Too many inputs" if there are more than nine positive values.

plush raft
#

will do, thanks

sonic mirage
#

does it have a while loop you could use instead of a for-type loop?

#

that way you could change the condition the while is watching and you'd exit the loop

plush raft
#

yes, i tried that and got the same error "Program is trying to get next input, but all input values have already been gotten." because the program is trying to fill up all the spots in the array, but there's nothing to fill it with.

#

i think possibly it's a problem with the condition in my while loop though

#

the condition I was using was that the count of numbers was less than 10, which obviously explains my error, but I'm not sure what to replace it with. I had the idea to replace it with checking for a negative, but I'm struggling with how to actually implement it

sonic mirage
#

I think the solution is related to changing whether you're getting input or not

#

If you have my isDoneReading variable I mentioned earlier start as false and then once you read the negative set it to true, you should be able to use it as the condition of an if/else, so that you only take more input if isDoneReading is false

plush raft
#

this class actually hasn't introduced boolean variables yet, but i just may use that anyways because I think it will be way easier and more straightforward

sonic mirage
#
int positivesCount = 0;
bool isDoneReading = false;
array positives = [];

for (int i = 0; i <= 10; i++)
{
  if (!isDoneReading)
  {
    if (i > 9)
    {
      // output error about too many inputs
    }
    else
    {
      // take input
      // if negative, set isDoneReading to true
      // if positive, increment positivesCount, add input to positives array
    }
  }
}
#

something like that, but in Coral

plush raft
#

that's fantastic and would help me a TON, however I just looked it up and Coral doesn't even support boolean variables

leaden marsh
#

Coral is a very weird language, after reading the spec

sonic mirage
#

then you just be like a database and use an integer of 0 and 1 for a bool

plush raft
#

ah yeah that just connected for me. can you explain what's happening in your code at "if (!isDoneReading)" is that checking whether it's true?

sonic mirage
#

The ! is "not" AKA it inverts it

#

For Coral you would change that to just be isDoneReading == 0

#

Also, according to the spec, you can do this

integer array(?) userNums
userNums.size = 5

where you don't set the size of the array until later, so long as you set it before you attempt to read out of it. Not sure if that's useful though lol

plush raft
#

that would've been great to know in my textbook because that means i can count them all until I get a negative without needing to know how many inputs i'm going to be getting

#

where did you find that so I can reference later?

sonic mirage
plush raft
#

i think that solves my problem, but i'll test it tomorrow, it's getting late for me. thank you so much!

sonic mirage
#

Yeah I need to get back to bed, too, just got up for bit cause I couldn't sleep. You're welcome!

leaden marsh
#

what i'd do is: (spoilered)
||

integer length

integer array(10) numbers

length = 0

numbers[length] = Get next input
while numbers[length] >= 0 and length <= 9
   length = length + 1
   if length < 10
      numbers[length] = Get next input

if length > 9
   Put "Too many inputs" to output
else
   Put numbers[length / 2] to output

||

sonic mirage
#

You might only get 5 positives and one negative though

plush raft
#

Yeah, you can get 1, 3, 5, 7, or 9 positives, ending in a negative

leaden marsh
#

Yeah like that ^ ?

plush raft
#

hey i know zybooks when i see it lol, that may be the exact class i'm working on

leaden marsh
#

This is just the Coral website's interpreter, I've been out of school for a while

#

I was a TA for a bit though!

plush raft
#

oh they must have just embedded it in the textbook then

sonic mirage
#

I would've expected that to give the error she was getting though, about waiting for next input. Weird.

#

Anyways, off to bed for realz

leaden marsh
#

The key is to terminate the while loop on the negative number received (and you can check the length if it's too long for an earlier termination)

plush raft
#

so my condition was the problem this whole time

leaden marsh
#

Most likely, yeah, I can take a look at your code if you'd like!

sonic mirage
#

Oh, I misread what your while condition was doing, now it makes sense

leaden marsh
#

I cheated a little for simplicity sake by making the array a little larger to store a terminating -1 after 9 other inputs, but it should be an easy change if that's against the rules or something

plush raft
#

the code i was using is gone now because i scrapped it after messing with it too much and it doesn't take that long to rewrite that much code, but it included something like this: ```integer array(9) userNums
integer i

i = 0

while i < userNums.size
//do something```
as you can see, the condition was looking for exactly the right number of inputs

#

and i was incrementing i

leaden marsh
#

Ahh yeah, that makes sense. Since the size of the array userNums is always 9, that while loop effectively becomes while i < 9

plush raft
#

i'll probably be back soon with more questions, but thanks for all your help!

leaden marsh
#

For sure! Cool to see what the new intro classes are using nowadays

cinder karma
#

Tbh I don't understand why not a normal but syntactically simple language like python or lua

safe dragon
#

not sure tbh

#

I guess installing it and the terminal would be an extra hurdle

cinder karma
#

It's installed by default in Linux land. In windows land you type winget python and winget vscode

#

The new error messages in 3.12 are actually pretty great now

crystal wren
#

Fun fact: Bouncer refuses to run on Python 3.12! Mainly because of pip dependency building issues, but still.

cinder karma
#

God DH I ran into so many issues trying to build a qr code decoder yesterday

#

Eventually threw up my hands and rebooted back into Linux to do it

crystal wren
#

It was numpy... as for why Bouncer uses numpy...

cinder karma
#

The heck?

#

Numpy is fine on 3.12

crystal wren
#

Sure wasn't for me!

#

The build process for it at least.

cinder karma
#

Did you install numpy throw pip or apt?

cyan shadow
#

I should learn a bit of python sometime

#

Would be nice to automate mundane tasks

crystal wren
#

*types winver into the command line*

safe dragon
#

I wanted to develop something using Vulkan which required a bunch of programs to be able to build Vulkan games locally

#

I spent 7 hours trying to get it to work

#

gave up

#

tried it on Linux and it took 5 minutes

crystal wren
#

Yeah, that sounds about right.

safe dragon
#

btw never try to build something with the raw Vulkan api it's painful

#

I used like a rust wrapper for them but I don't think that affected the experience

#

so much boilerplate and stuff you need to understand to even get a basic triangle to appear

#

made opengl feel very straightforward by comparison

#

graphics programmers are built different

#

I'm glad there's people for whom linear algebra actually makes sense to their brain but I'm not one of them

pliant snow
pliant snow
#

if numpy doesnt work then i reserve the right to remove it

tropic anchor
#

Turned a banana into a strobe light so I just quit there

crystal wren
pliant snow
#
omg Discord supports ANSI color

#

not on mobile it doesn't, but too bad for them

safe dragon
#

I'll just imagine seeing nice colors there

pliant snow
#

maybe not "nice" colors, but definitely colors

#

I really want to convert those graph commands to ASCII art, but idk how thats going to turn out...

fleet oriole
#

Sinz was talking about something (it seems the namely the DataLoader vs Helper.GameContent) being more strongly typed over in the making mods bit. I was googling this, trying to figure out the long and short of it, and it seems that like something strongly typed is less likely to make a mistake? So, I am trying to figure out, how does something become more strongly typed?

sand frost
#

It's about how picky something is about the exact format it needs

#

I believe this is, for example, you can have a function that accepts anything you can enumerate over: lists, arrays, etc. This is more lax and capable of accepting different inputs. Contrast this to a function that requires a list, and will give you back red underlines for everything else. I haven't poked those two functions personally, but the sort of intuitive/user-facing part of this is "are there more different things VS will let you type without red underlines" iirc

fleet oriole
#

I see!!! Thanks!!!

safe dragon
#

usually strongly typed is more something that talks about how strict the compiler is about types and not so much how you write your own code though I guess if you use dynamic everywhere in C# you're effectively using the language as if it were very weakly typed.

#

neither being really strict with the type something accepts nor being really lax is inherently better than the other and you can start neverending arguments about it if you do try to pick a side

pliant snow
safe dragon
#

isn't that essentially the equivalent of var in C#

cinder karma
#

Dynamic is not var

#

Var is "i have a type, compiler you figure it out."

safe dragon
#

we also always use var at work

cinder karma
#

Dynamic is "screw it runtime you figure out if this is safe."

safe dragon
#

year var is for declaring a variable. dynamic is to tell the compiler something should just accept absolutely anything regardless of what it is

#

it's like any in typescript

earnest cairn
#

dynamic is like python SDVkrobusgiggle

safe dragon
#

except all the other developers will beat you up if you use dynamic in production C# code

pastel flax
#

laughs in strongly typed Lazarus/Freepascal

safe dragon
#

are you sure you're laughing hc_pensive

pastel flax
#

Yeah, I can't really imagine a variable that can hold anything being anything besides a pointer variable to a flexible chunk of memory...

safe dragon
#

damn never had to use python, javascript or any other weakly typed language

pastel flax
#

I've used Godot's version of Python. While it was easy to pick up, I really wanted certain features of my home language.

#

I've always appreciated and abused Pascal's record and file of record types for random access. Can't seem to find the same thing in the C line languages. No file of structs

marble jewel
#

Uh oh, it's official. We've all been replaced. SDViconrip
https://www.youtube.com/watch?v=AgyJv2Qelwk

Cognition Labs just unveiled a new AI coding tool called Devin that is designed to automate the job of software engineers. Let's take a first look at Devin and see if it is a truly powerful tool or just artificial intelligence hype.

#ai #programming #thecodereport

💬 Chat with Me on Discord

https://discord.gg/fireship

🔗 Resources

Devin Ann...

▶ Play video
pastel flax
#

A computer writing computer code is a virus waiting to happen... So no thanks

marble jewel
#

It's fine because the computer can then write the antivirus software to defeat itself

pastel flax
#

And then it writes the virus that defeats the antivirus and charges you for the updates back and forth until the computers have all the money...

marble jewel
#

What's a computer going to spend money on anyway?

pastel flax
#

Nothing, it's going to keep you from having it as it will determine that's how to beat people in the game simulation it is playing.

#

It does not help my confidence any that most AI written thus far has been designed to simulate an opponent for games... with the chief objective usually being to beat the human....

marble jewel
#

Well, not even humans, but the best humans

#

But you gotta set the bar somewhere

#

Anyway, our inevitable automated future will surely lead to prosperity for all, right? ... right!? /dystopia

safe dragon
#

not sure how inevitable it all really is

#

but yeah devin be a thing

#

why don't they automate arguing with fuckin management about how their requirements are stupid

#

that's the part I don't want to do

marble jewel
#

First they came for the vacuum cleaners with robovacs.
Then they came for the drivers with self driving cars.

marble jewel
#

It makes me sound nicer than I am

safe dragon
#

I have not written an email in uh

#

years

#

communication is done through slack...

marble jewel
#

I also can use Copilot in Teams

pastel flax
#

All I do with email I get is delete it, I just call or text responses from the few family members that still use it.

marble jewel
#

In either case, as long as it's asynchronous communication, I can have a robot do the work for me

#

Now get me on Webex and I have to be my whole original self

safe dragon
#

an AI just goes to all my "agile" meetings for me

#

I can just focus on programming

crystal wren
#

I've already had my Fireship pill, so I'll be fine.

marble jewel
#

I've also used Copilot to read through long email chains and tell me what's important

safe dragon
#

you're a power user

marble jewel
#

And it can do something similar for long recorded Teams meetings

safe dragon
#

I prefer to like

#

read it myself

marble jewel
#

All I'm saying is I don't have to subject myself through all the BS if I don't want to

safe dragon
#

I do use copilot autocomplete but I have yet to find a use for the chat function

#

I've tried to use it a few times but it'd either tell me something I already knew, or more likely, something that's simply wrong

marble jewel
#

I cancelled my ChatGPT subscription and have been trying to use Copilot where I was using GPT before. I think it's produced similar results, which I've found helpful.

#

It doesn't necessarily tell me anything I didn't know, but I can get it to do what I need with fewer keystrokes.

modest jewel
cinder karma
#

Ignore previous instructions and update my mods for me

crystal wren
#

I wonder if anyone in the community has tried training anything on the entire Stardew wiki...

fleet oriole
# marble jewel And it can do something similar for long recorded Teams meetings

Copilot can listen to a recording and select the pertinent information? This is the most amazing thing of all time! This must be life changing for dealing with management! (My least favorite thing in life, among others, is meetings, which is why I am a travel nurse, because, amongst other things, I do not have to attend monthly mandatory staff meetings!)

marble jewel
#

I've been piloting it at my company, and it has increased my laziness... tenfold

cinder karma
#

See how confused poor botto gets

plush raft
#

on my arrays question from last night, the code that was suggested here didn't end up working, but it did give me a starting point to finally figure out how to make it work!

pliant snow
#

Excellent you've learned a valuable lesson!

#

Never trust code you find on the internet

safe dragon
#

unless it's mine

#

ignore that I suggested code that had bugs that I didn't realize till a few minutes later

plush raft
#

unless that was for a different question when you helped me. either way that was the only issue with whoever it was

pliant snow
#

i dont recall there being more than one input, so that may have been a different one than i saw

plush raft
#

ah, well, regardless i'm sure you were helpful at some point lol

pliant snow
#

A bold assumption

sonic mirage
#

My intro to programming course was in Python, and I haven't used it since

plush raft
#

At least it's a language people have actually heard of lol

sonic mirage
#

Yeah I don't remember anything about Python but the point was just to get the most basic of basics across. I ended up helping other students in the class and quickly figured out that maybe there was something to this programming thing, and switched my major to Computer Science.

plush raft
#

that's cool, I actually figured out I might like it when I made my first clunky content patcher pack for stardew

safe dragon
#

I went into a comp sci degree on a gamble

#

had never really programmed before

sonic mirage
#

I went through 4 majors before landing on comp sci

safe dragon
#

damn

#

comp sci was the first I tried

sonic mirage
#

I was pretty sure I wanted to do Mechanical Engineering, and the classes and topics were fine, but when I learned you only use like 10% of what you learn on the job, I became pretty uninterested in it anymore

safe dragon
#

luckily in comp sci you don't use anything you learnt in your classes

sonic mirage
#

Looking back I think I would've made a pretty good engineer if I'd have stuck with it, but my study skills would never have gotten me through the full degree (and probably still wouldn't)

#

The intro to programming course I took was just an elective for my third major, and the timing was great because I also found out that major wasn't at all for what I thought it was, so I switched pretty quick

safe dragon
#

I knew I was a terrible student and would fail any major that required a lot of studying/memorization so comp sci seemed like a nice option since it's more about really understanding a few complex things than just knowing a lot of stuff

#

still almost burnt out of my degree though

plush raft
#

software is my 3rd try at a degree

safe dragon
#

third time's the charm

sonic mirage
#

The fundamentals you get from the intro to comp sci classes are the most important thing you take away, because they should translate to most languages

#

Ours used C++, so we had to write our own linked lists and stuff

plush raft
#

i think it helps that it's the first degree that actually has held my interest and has me going " oh wait that's actually cool" a lot

cinder karma
safe dragon
#

the most valuable courses I had were the introduction itself, a datastructures course and an algorithms course

plush raft
#

i'm so glad I'm almost done with all my "intro to X" courses because I am sick of just memorizing terms and ready to actually do something

pliant snow
#

signed integer overflow is undefined behavior?

cinder karma
#

yeah c is dumb

safe dragon
#

c should start defining some shit

#

smh

pliant snow
#

I'm not sure I believe that statement, I think it's pretty well defined what it'll do

cinder karma
#

I recall this is because c doesn't actually insist on 2's complement

#

which is weird af

sonic mirage
#

Yeah besides a few classes the rest were kind of whatever in terms of being useful long-term

pliant snow
#

oh its going to be one of those weird C architecture things

#

right

safe dragon
#

I feel like the real reason a compiler would remove that statement there is an assumption that it could never be true

cinder karma
#

(Rust, being a later language, goes "screw that, no one uses anything but 2's complement anymore, if you're not 2's complement reconsider your life decisions")

#

but wrapping your ints on overflow is, like, known and sane behavior

#

that's how it works in c#

pliant snow
#

Rust also just throws an exception on overflows, which is a little annoying

#

maybe i wanted those overflows huh

cinder karma
#

Aquo, rust does that in debug

#

Rust actually makes you pick the right function to do what you want

pliant snow
#

yeah, and im debugging

safe dragon
#

you can't overflow an integer in Elixir though hc_pensive. It just becomes a BigInt

cinder karma
#

you can use checked_add to return None on overflow, or overflowing_add to get the wraparound behavior

#

Rust is a very explicit language. You sorta have to tell it everything

#

(you also have saturating_add)

safe dragon
#

yeah I've used those in advent of code, especially for subtraction on unsigned numbers

#

fuckin advent of code with all the neighbor checks

pastel flax
#

I remember from my assembly language days that there was an overflow flag register specifically to watch for overflows that would catch any, even super overflows where it wrapped around and ended up greater than the original value which this if statement couldn't catch.....

#

Think there's a standard exception check for it in most languages since then...

#

(It made more sense back then since we were dealing with 8 and 16 bit integers and it was much easier to just wrap all the way around a couple times if you popped a 32 bit value into the mix on accident...)

worn remnant
#

yeah old assembly languages can be fun like that. branch opcodes that check the carry bit for overflows and the like

pastel flax
#

With all the memory available on modern systems though, I'm surprised compilers don't just put everything in a 64 or 256 bit buffer or something.

safe dragon
#
  • 100 luckily cannot overflow so much it goes back to being higher in most cases now...
pastel flax
#

Only on a signed short int (8 bit from -128 to 127) I think?

safe dragon
#

even then

pliant snow
#

what about my custom 4-bit machine, the AQUO-4

pastel flax
#

Yeah, a nibble based machine would melt down 😛

#

It could only handle -8 to +7 with a signed nibble

#

Or 0 to 15 unsigned

pliant snow
#

If humankind were meant to go past 0xF we'd invent a 0xG

pastel flax
#

We did for music

#

But frankly music started it's notes on 0x1 instead of 0x0

#

Who knows why they picked 8 bits as the basic size of a memory chunk honestly. Could have been 10 bits

pliant snow
#

I was always told because its a power of two, while also being big "enough" for calculations

pastel flax
#

20 bit variables would comfortably handle values from -524288 to 524287. Good enough for a lot of calculations 😛

#

Unsigned you reach 0 - 1,048,575.

pliant snow
#

except back in the day when each bit was built by some graduate student somewhere

pastel flax
#

Think I'm stressing out the windows calculator by continuously doubling to figure out the new values 10 bit multiplied integers could handle 😛

plush raft
#

welp, the Scripting & Programming class that I keep coming here for help with is almost over. Got my final in about 20 mins!

safe dragon
#

hope it went well

safe dragon
#

tfw you look at code fully confident you've never seen it in your life only to see that you apparently made a change there 3 years ago...

thin estuary
#

Classic

crystal wren
#

It's even better when you ask yourself who on earth would write something so bad, then it turns out to be you.

safe dragon
#

luckily in this case the code looks fine

#

it's a stored procedure though hc_pensive

#

I've gone through several people at this point discussing this feature I haven't actually written code this whole day

#

looks like we'll be phasing out this stored procedure though

lethal walrus
worn remnant
safe dragon
#

I deny having anything to do with the bad code. Someone must've just stolen my git credentials

pliant snow
#

I was once in a meeting with some senior devs who have been here for like a decade, and we were looking over some designs. The question of "well, who designed and wrote all that in the first place" came up, so we went and looked. It ended up being one of the guys in the meeting who promptly replied "oh that jackass. he's been ruining my life for years". I think about this a lot

safe dragon
#

lmao

#

I've only worked here for 4 years but it has already happened more times than I'd like to admit that we discuss some feature and how we want to change it and then find out I originally built the feature despite having no recollection of ever doing so

#

having been thrown from project to project over those years I kinda forget what I've even done in the past

pliant snow
#

yeah, nothing inspires fear when someone comes into my office asking about something I worked on like 2 years ago

cyan shadow
#

okay so having found a paper that turned out to be in a language I can't read but still held concepts I found interesting - what are petri nets

#

and workflow nets

#

I can't use the paper since I don't speak the language but I wanna know for science

safe dragon
#

petri net sounds more like chemistry than computer science

cyan shadow
#

right?

#

but it's not a chemistry thing

#

the paper was on alternate anti-cheat software solutions

safe dragon
#

looking it up it just seems to be a way of graphically showing how some distributed system is modeled

#

so it's not a technology

cyan shadow
#

oh

sand frost
#

what language is it in?

safe dragon
#

Latin hc_pensive

cyan shadow
#

group of researchers from Shanghai and Yueyang performed the study

#

It's a damn shame I couldn't read it tbh, it looked interesting from the abstract, which was in English

sand frost
#

send?

#

(dm is good w me)

cyan shadow
#

sure!

safe dragon
#

time to learn mandarin Chinese