#⌨coders-cave

1 messages · Page 28 of 1

orchid frigate
#

I have changed like 6 friend groups in a year this way when zi get bored

queen zodiac
#

That’s not interesting. I don’t like simplicity

orchid frigate
#

Then you dont get a life

#

You dont want it to be difficult but not simple either

#

Linux too🤭

queen zodiac
tropic dagger
#

Noted

#

I still can't get over rust having a function keyword 😭 that syntax man wbsuffer

bold owl
#

baba boi

barren shale
#

The only reasons these languages use a keyword for function is that it makes compilation faster

#

By reducing the look ahead of the compiler

#

Because if you write “int f” for example

#

There’s ambiguity until you reach the token after “f”

#

It’s a very small optimization that doesn’t really do a lot xzibit

knotty root
#

hi if i code in scratch am i good

muted mountain
knotty root
#

thanks

queen zodiac
knotty root
#

and im unreal garbage

queen zodiac
cunning sparrow
#

I’m going to learn as much Java as I can, make atrocious projects with it then move on to Python and repeat cause I can get to some shenanigans with it in hacking and cyber

knotty root
wicked spindle
#

Is C# a good language to start

#

Isnt that worldbox coding language?

dusty kernel
dusty kernel
#

I started with C#

distant wraith
dusty kernel
dusty kernel
wet girder
#

C# Imo is a pretty good starting language

#

Some people would recommend python over it because it hides stuff like data types and doesn't require OOP knowledge

torpid isle
#

I like C#'s clean syntax, I'd recommend it as a starting language. It all depends on what you want to get into though.

#

Others might argue Python over it.

wet girder
#

I used to recommend python before but nowadays I recommend C#. If you're motivated to learn the little bit of extra challenge you experience at the start will help you avoid a lot of problems later on

#

learning python first you basically only learn problem solving and no actual programming concepts

#

as the programming concepts are hidden away

orchid frigate
#

thats like the most basic knowledge in programming you practically have to have

distant wraith
#

I don't understand what's up with Python being worse than literally every language in this channel; I've never had a real bad experience with it

#

The only frustrating thing for me was the early part of learning it; I didn't understand what I did wrong most of the time. But to be fair, that's when I still don't know English as well

#

I didn't even know what list index out of range means 🫠

hollow bronze
#

on the fly quick stuff is a blast

distant wraith
#

I mostly use it for command-line programs and quick scripts that make my life easier, like bulk image downloads

#

Which, I guess, is the most common use case of Python anyway

wet girder
#

Python is good for that

#

It just has limited use cases because it's really not good for bigger projects

barren shale
#

python is good when someone has already built a library in C/C++ that you can use to do what you want

#

pure python can be meh

#

code is slow and for loops take like years to execute xzibit

hollow bronze
#

no one uses it to be the fastest

#

in execution of the code

#

(not every solution needs it)

blissful sable
#

the execution time might be slow, but the program writing time is faster

tame socket
#

Finnaly i can understand blender

cunning sparrow
digital mica
barren shale
orchid frigate
#

most of the time execute it a few times

#

plus it really depends on your skill level

blissful sable
queen zodiac
karmic cave
#

Deadchatd

tropic dagger
slim raven
#

btw, Kotlin is literraly Java but better

tropic dagger
#

I don't like Java 🤷‍♂️

barren shale
#

nobody does xzibit

wet girder
#

"At the lower levels, Uber’s engineers primarily write in Python, Node.js, Go, and Java. We started with two main languages: Node.js for the Marketplace team, and Python for everyone else. These first languages still power most services running at Uber today." Huh interesting

#

I don't really get why tf they'd do that and I'd never want to work at uber but cool

#

"We adopted Go and Java for high performance reasons. We provide first-class support for these languages. Java takes advantage of the open source ecosystem and integrates with external technologies, like Hadoop and other analytics tools. Go gives us efficiency, simplicity, and runtime speed."

#

They've changed from python to go and Java for stuff that needs to be not slow

barren shale
#

yeah uber and instagram use django for some of their backend

#

and they pay a lot for it

queen zodiac
restive dune
#

Hi 👋

#

👋

#

🧐🫡🫥

karmic cave
lapis flint
#

Hi

static solar
#

Hi

late torrent
#

Software developers:

late torrent
#

Oh.. I have image for your mom

static solar
wet girder
#

Today I learned that if you make an enum attributr and obsolete attribute it also makes it xml ignored which makes it very unpractical to do backwards compatible enums for xml serialization and it's not even documented anywhere in .NET documentation

#

It's so stupid

frozen edge
wet girder
#

Not like it was my choice

#

JsonBody parsing for HTML requests is also wonky in .NET 6+ tho

copper fjord
#

I’m back

honest rivet
#

UncaughtSyntaxError:Unexpectedtoken<console.log("why would you make fun of coders in their cave? xo";

tropic dagger
#

Chat, show me this guy's front yard

opaque ingot
#

Hello

#

Any idea how do I make Xp-leveling system in C#?

#

I know it involves math but I'm too poor at thinking

#

I tried

if(MaxXp <= PlayerXp)
{
   PlayerLvL ++;
   SubXP = PlayerXp; //When player tries read its info it'll see its total xp gained
   PlayerXp = ResetXP; //the xp will reset to 0 when     specified xp amount comes
}
#

Seems icky

opaque ingot
#

Yall better answer.

#

@barren shale

#

Come here

#

It's your boy kiril

#

Aren't you gonna greet me?

wet girder
#

So what exactly do you need help with?

barren shale
#
    public int Level { get; private set; } = 1;

    public int Xp
    {
        get { return _xp; }

        set
        {
            _xp = value;

            var requiredXp = GetRequiredXp();
            if (!(_xp > requiredXp) || Level >= 150)
            {
                return;
            }

            while (_xp > requiredXp && Level < 150)
            {
                _xp -= requiredXp;
                Level++;

                requiredXp = GetRequiredXp();
            }
        }
    }

    private int _xp;
#

this is how i do it

#

max level is 150 that's why it checks

#

GetRequiredXp just gets the amount of xp needed to level up

opaque ingot
#

Plis explain every detail so i can reuse the information whenever me need it

opaque ingot
#

Nuh uh, I already forgot C#

#

Ayo me potato

opaque ingot
opaque ingot
#

So like..

#

Wait

#

No nvm

#

Dum dum me

long phoenix
#

Hello everyone!
Is anybody here familiar with programming on android studio (java)? I have to program an App for a school project but I need some help. I would be very happy if somebody could help me out

wet girder
long phoenix
#

Thank you, I am going to send you a DM to give you more information about my project

wet girder
#

what part of it doesn't work

opaque ingot
#

What am I suppose to do with GetRequiredXp();

opaque ingot
wet girder
#

oh you need to make a function called GetRequiredXp that returns the amount of xp needed for next level up

#

I suppose

opaque ingot
#

So like..

#
Int GetRequiredXp()
{
    Uh.. ?
}
#

Hm.

#

Dang 3 years and still this is like the 10th time learning C#wbsuffer

wet girder
opaque ingot
#

So

#

Lemme test

fading sail
#

🤔

distant wraith
#

I thought that's the flag of Germany in your pfp at first glance

quartz pumice
#

Reject gay return to the first Reich

static solar
quartz pumice
#

Did I stutter

opaque ingot
barren shale
#

cool

opaque ingot
#

I removed "_" for some reason

#

Like

#
    public int Level { get; private set; } = 1;

    public int Xp
    {
        get { return Xp; }

        set
        {
            Xp = value;

            var requiredXp = GetRequiredXp();
            if (!(Xp > requiredXp) || Level >= 150)
            {
                return;
            }

            while (Xp > requiredXp && Level < 150)
            {
                Xp -= requiredXp;
                Level++;

                requiredXp = GetRequiredXp();
            }
        }
    }
#

💀

#

No wonder why the code wasn't working

#

Brain ain't braining till I came here to read your code again

#

@barren shale also is there an if condition where if Level gets +1 I execute some code when it condition is Met?

#

Also remember me papi?

#

Does if(x += y) work?

torpid isle
opaque ingot
static solar
#

Oh my God.

#

My code, it...

#

Works, as..

#

Intended...

#

Four days of debugging just to implement this little shit feature that just didn't wanna work

lofty phoenix
#

debugging so fun

barren shale
#

debugging is not that hard after you do it a lot

#

you get a sense for where the problems could be

#

makes it a ton easier

#

hadn't had a problem with debugging for ages

wet girder
#

It becomes a problem again when you start working on big software

#

Like 500k+ lines big

barren shale
#

true

#

never debugged code i didnt write

lapis flint
#

I did

#

Quit after week

barren shale
#

i would quit after a day ngl xzibit

quartz pumice
#

I've Counted in the hours

chilly nymph
#

requiredXp = GetRequiredXp();

tropic dagger
#

Ajax code is funnier

astral basin
wary steppe
#

Hey guys, i want to learn python and i dont't have any idea about how to start please explain me how to start

opaque ingot
wary steppe
#

can you help me to download vs code

#

@opaque ingot

opaque ingot
#

Find it there

#

I mean.. we all start at YouTube or Chrome

wary steppe
#

oh kk

opaque ingot
#

I tried to learn it but failed miserably and went back to C# again

wary steppe
#

for career

#

and just skill

opaque ingot
#

What career

#

As in like making Ai and stuff?

wary steppe
#

nah

#

making websites and apps

opaque ingot
#

Oh...

#

Wait

#

What kind of apps?

#

And for website, I recommend html, css and js

wary steppe
#

html?

#

oh yes!

opaque ingot
#

Im not expert at websites but you could try learn python for website's backend

wet girder
# wary steppe Hey guys, i want to learn python and i dont't have any idea about how to start p...

For python there are a lot of great options.
For example:

Python is very limited language tho. You can technically use it for anything but it's not the recommended language for most. It's a great first language still tho.

If you're interested in web dev I'd recommend to learn HTML, CSS and JavaScript first. Then you can learn some frameworks and backend stuff but don't worry about that yet. Just learn HTML, CSS and JavaScript and make some basic sites using that. w3schools has great material for this as well https://www.w3schools.com/

Also I'd recommend you download Visual Studio Code and use that, here's a tutorial on basic usage for it https://www.youtube.com/watch?v=phzQMwFXMEo

If you're interested in application development or game development you should learn C#, I'll send info if you want

wet girder
opaque ingot
#

I have proofs that I am kirill

#

or yesberrynice

#

Or Kirillsharky

wet girder
#

send the proofs and let's go from there

opaque ingot
opaque ingot
#

Should I use godot over unity

#

I got a bad feeling about unity

lapis flint
lapis flint
#

I am on version 4.*, its not done yet and contains bugs, but good enough

#

Not sure about 3.*, it has less bugs, but less features as well

opaque ingot
#

Can you use C# in godoy?

#

Godot*

lapis flint
#

For me it is better than unity, because you can modify it if you want and if you can do things on c++

lapis flint
#

GD lang is their own, also c# and c++

opaque ingot
lapis flint
#

And many others as unofficial plugins

#

Generics don't work correctly for nodes(godot's gameobjects) for now, i hope they will fix that in near future

opaque ingot
#

Now tell me, is there a tutorial for godot?

lapis flint
#

They have very good docs

opaque ingot
#

Where where

lapis flint
#

Much better than unity's

opaque ingot
#

Thank you

opaque ingot
#

Should I use Weapon as interface? Because you know.. I'll add alot of weapons

barren shale
#

default interface

#

you need abstract functions then abstract

wet girder
#

Ye what hamza said

lapis flint
#

And description of weapon can be separated from realization

#

So realization just do what described in somewhere else

#

Like maxim did in worldbox and his asset libraries

#

Library contains entities, and then, realization jsut do what wrote in entity which is attached to realizxation's instance

opaque ingot
lapis flint
#

So better to keep that info in some other library, and use it in realization

#

but items in library should be immutable, or pretend to be

lapis flint
#

weapon class

opaque ingot
#

So just class I should use for weapons?

lapis flint
#

It does not contains info of weapon, just behaviour

#

What you exactly doing if it is not a secret?

opaque ingot
lapis flint
#

So you need what i said, you need to make a weapon class, lets name it WeaponClass, then you need to make other class, which contains weapon properties, lets name it WeaponAsset
You store instances of weapon properties in some list or dictionary with WeaponAssets inside, and when you creating new weapon be instantiating WeaponClass, you use weapon properties from WeaponAsset

#

So you have class with dynamic behaviour for weapon WeaponClass and immutable thing to keep everything as is, WeaponAsset

opaque ingot
upper granite
#

since yall are coders, what prevents the mobile version of worldbox from getting mods?

lapis flint
# opaque ingot Okay I'm confused (except for the classes) I'm not really that good at english, ...
public class BaseWeapon //Realization
{
  public WeaponAsset Asset { get; private set; }
  public int Damage { get; private set; }

  public BaseWeapon(WeaponAsset asset)
  {
    Asset = asset;
    Damage = asset.damage;
  }
}

public class WeaponAsset // asset for data
{
  public string id;
  public int damage;
  public int cost;
  public string somethingElse;
}

public class WeaponLibrary // library to keep assets
{
  public Dictionary<string, WeaponAsset> Weapons { get; private set; }

  public WeaponLibrary()
  {
    Weapons  = new();
    
    Add(new(){
      id = "sword",
      damage = 5
    });

    Add(new(){
      id = "bow",
      damage = 2
    });
  }

  public void Add(WeaponAsset asset)
  {
    Weapons.Add(asset.id, asset);
  }
}
#

This is very simplified of what i meant

#

This is how it is in worldbox (schematic)

#

For my projects i used other version but in base it is looks like that

opaque ingot
lapis flint
#

Keeps weapon data

opaque ingot
#

Ohh, thank you very much

lapis flint
#

Here you add weapons to library using Add method

#

In this method, to avoid duplicates of using id, you put asset, and it puts asset to library, using id as dictionary key

#

You also can create Get method by yourself to correctly receive item by id

#

In my realization of that system i do it like this, to avoid using strings i use property name as id

opaque ingot
#

I see but I can put like for example I added durability there then If I try to put conditions about durability should i put it inside the library?

#

And how can i call those weapons like sword or bow or other weapon?

opaque ingot
# opaque ingot I see but I can put like for example I added durability there then If I try to p...

Like

public class BaseWeapon //Realization
{
  public WeaponAsset Asset { get; private set; }
  public int Damage { get; private set; }

  public BaseWeapon(WeaponAsset asset)
  {
    Asset = asset;
    Damage = asset.damage;
  }
}

public class WeaponAsset // asset for data
{
  public string id;
  public int damage;
  public int durability;
  public int cost;
  public string somethingElse;
}

public class WeaponLibrary // library to keep assets
{
  public Dictionary<string, WeaponAsset> Weapons { get; private set; }

  public WeaponLibrary()
  {
    Weapons  = new();
    
    Add(new(){
      id = "sword",
      damage = 5,
      durability = 100 //(where should I put the if condition when it gets to 0 it'll unequip or get removed from their inventor?(durability gets reduced everytime the player dies))
    });

    Add(new(){
      id = "bow",
      damage = 2
    });
  }

  public void Add(WeaponAsset asset)
  {
    Weapons.Add(asset.id, asset);
  }
}
lapis flint
# opaque ingot Like ```csharp public class BaseWeapon //Realization { public WeaponAsset Asse...
public class BaseWeapon //Realization
{
  
  public WeaponAsset Asset { get; private set; }

  public Player Owner { get; private set; }

  public int Damage { get; private set; }
  public int Durability { get { return durability; } set { setDurability (value); } }
  private int durability;

  public BaseWeapon(WeaponAsset asset, Player owner)
  {
    Owner = owner;
    Asset = asset;
    Damage = asset.damage;
  }

  private void setDurability(int value)
  {
    durability = value;

    if(durability < 0)
    {
        Owner.Unequip(this);// or whatever
    }
  }
}
#

So you change durability of realization, not of asset

//...
var weapon = new BaseWeapon(WeaponLibrary.Weapons["sword"]);
weapon.Durability = 0;
#

Like that

#

Again, it is simplified version of how it can be done

opaque ingot
lapis flint
#

You never worked with getters and setters?

opaque ingot
#

No..

lapis flint
#

If so, this is good case to start

opaque ingot
#

Isn't getter where it returns or get something and setter is the one who sets the value

opaque ingot
opaque ingot
lapis flint
#

I mean speaking

opaque ingot
#

Tagalog or Japanese

#

But I prefer English more(but either way I suck at those 3 languages since I don't social much with anyone)

#

And stuff.. but yeah

lapis flint
#

En version

opaque ingot
#

Thank you

distant wraith
#

I spent too much time on Discord for like a year and forgot some of my native language's words 😎

opaque ingot
opaque ingot
lapis flint
quartz pumice
#

I keep trying to learn zig but theres so few things, the documentation is kindof bad..

lapis flint
opaque ingot
lapis flint
#

Still can't understand wdym by call?

opaque ingot
lapis flint
opaque ingot
opaque ingot
opaque ingot
# lapis flint Wdym?

Like when the player unequip sword or stuff like recycle or sell it, how do I input Sword since there's other weapons inside the dictionary

lapis flint
#

Input to where?

opaque ingot
lapis flint
#

Put BaseWeapon to it
Use list, if there can be many same weapons

#

Or dictionary if there can be only one same weapon

#

Use asset as dictionary key

orchid frigate
#

Some time ago

#

If the language was more popular it would literally be a better C

quartz pumice
#

for real bruh

orchid frigate
#

But right now finding information about it is too damn hard

#

But tbh it had its problems from what I remember

#

Sometimes the compiler would bug and error without errors

quartz pumice
#

yeah

orchid frigate
#

And every version completely changes the language and compiler making older code versions unusable

quartz pumice
#

scary too learn

orchid frigate
#

So you read the docs

#

You try them

quartz pumice
#

well I tried

#

yeah

orchid frigate
#

But they error

#

Only to find out they are a version behind

#

So now you are on your own

quartz pumice
#

and thats the only resource thats even real

orchid frigate
#

Nah you could use other zig projects from people insane enough to learn the language themselves as a learning resource but

#

The majority of them are old

#

From like 0.9

#

Or whatever the version was

quartz pumice
#

oof

orchid frigate
#

Best version from what I remember too

quartz pumice
#

you know its bad when theres a "best version"

opaque ingot
#

@orchid frigate remember me?

opaque ingot
# lapis flint Put BaseWeapon to it Use list, if there can be many same weapons

Okay so I don't get this one(I have social anxiety or whatever and I'm hard sweating rn when I ask questions) so what im saying is for example you have like for example you have main file and Weapon file. In Weapon file you have the id with like 2 Weapon which is sword and bow in WeaponAsset or WeaponLibraty then you create object(WeaponLibrary weaponLibrary = new WeaponLibrary(); I'm not sure what this is called) in your main file so after you create that I wanna access id but SPECIFIC like you wanna access the Sword name, what I do?

lapis flint
#

weaponLibrary.Weapons["sword"] to get weapon asset
weaponLibrary.Weapons.Keys to get list of ids

#

There is Weapons dictionary with which you can interact

#

But i suggest to you to make your own Get method inside WeaponLibrary

opaque ingot
#

Forgot I can't send ss

#

An object reference is required for the non-static field, method, or property 'WeaponLibrary.Weapons'

lapis flint
#

You sure you do it from weaponLibrary object, not from class?

#

var wl = new WeaponLibrary();
wl.Weapons

opaque ingot
opaque ingot
opaque ingot
lapis flint
opaque ingot
opaque ingot
lapis flint
lapis flint
#

Where you trying to get object

#

And your WeaponLibrary class

opaque ingot
#

Oh shit, wait

opaque ingot
#

My bad

opaque ingot
lapis flint
#

Why you want to touch it?

opaque ingot
#

And also, how do i make a crit damage to Weapon? All i know is that you use Random and multiply

lapis flint
opaque ingot
opaque ingot
lapis flint
#

Chance is default random

#

Like, you have chance for crit

#

But crit dame is not a random

#

Usually it is fixed

#

So if chance worked, you multiplying damage by some multiplier

#

And it is a crit

opaque ingot
lapis flint
#

Yes

opaque ingot
#

What about the chances? Like what if I do this

Random rand = new Random();
float c = rand.Next(1.5, 25.4);
//not sure how do I get the rand to run without making the numbers show up in the console
if(c <= 5.9)
{
   return damage * 2;
}
else if(>= 6.0)
{
   return;
}
lapis flint
crystal ferry
#

Is that python

lapis flint
#

c#

#

python dont use { and }

distant wraith
#

Me when set and dict 😔

jolly field
#

😔

errant trail
#

ballers

static solar
#

The random class is not true random TPA_Emoji_OwO

opaque ingot
lapis flint
#

Yes

#

Library only for keeping weapon's data

opaque ingot
#

I know you have to make class for inventory inside Weapon file and then some Dictionary thing

#

And some methods

lapis flint
#

Why inside weapon file?

#

It's not logical

#

Oh, you mean class inside file

#

No need

#

Depends on what you need, it can be done without new class

#

You can jsut make a list of Weapons inside your player class

opaque ingot
lapis flint
#

So just list enough

amber bobcat
lapis flint
knotty root
#

Try

#

Oops wrong chat

#

Sorry

lapis flint
#

What

feral bramble
#

the header #

barren shale
narrow light
#

Any of you know what the fuck wix is

#

My tech teacher making me make a website with it

distant wraith
#

Oh no

quartz pumice
narrow light
barren shale
#
Console.WriteLine("Hello World");
barren shale
#

is it dead?

#

~bt ur mum

#

oh wait you cant use amp here

gray tundra
#

Hello coders-cave

wet girder
#

Hello orange train

lapis flint
#

Also we:

barren shale
opaque ingot
opaque ingot
lapis flint
#

Dictionary has method ContainsKey, so you can check

#

But it is case sensitive

opaque ingot
# lapis flint What do you exactly want to make? Where user will write weapon name?

I'm trying to make an method where like for example you make an if statement where user in the console have to Input the Weapon name like Wooden Sword
Or let's say if(userInput == "Wooden Sword") but there will be like tons of Weapon which will make my time wasted or wasting lines of codes making if statement to every Weapon name that exists

#

Like im making Add inventory method rn

lapis flint
opaque ingot
lapis flint
lapis flint
#

Method

#

Of dictionary

#

Which is inside weapon library

opaque ingot
#

Weapons?

lapis flint
#

If(Weapons.ContainsKey("something")

#

I suggest you to check some c# tutorials first before make a game, it will be easier to you after that

opaque ingot
#

Like any tutorials?

lapis flint
opaque ingot
lapis flint
#

But user input may be incorrect

#

it may be in other case

opaque ingot
lapis flint
#

So you need to work around it

wet girder
#

Bro what is this windows slander. Windows is a perfectly usable operating system

barren shale
#

remembering the time when i had to use linux for around 2 years gives me war flashbacks

wet girder
#

Windows is really stable in my experience. Well until you go tinkering without knowing wtf you're doing and break everything

#

but up until that point it works great

barren shale
#

well the tinkering part applies for all OSes xzibit

#

one time i accidently deleted the wrong registery

#

had to reinstall windows xzibit

wet girder
#

lol

prisma grail
#
votes = [([[o for o in d.options if o.emoji == r.emoji] for d in self.current_decision_node.decisions if len([o for o in d.options if o.emoji == r.emoji]) > 0][0][0], len([u async for u in r.users()])) for r in [r for r in current_vote.reactions if r.emoji in [[o.emoji for o in d.options] for d in self.current_decision_node.decisions]]]

Two days into coding a new AMP feature, and I'm already writing stuff like this in a system that's meant to be robust. GremlinRoseWheeze

distant wraith
#

Inefficiency, useless list comprehension, single letter variable 😡🤬😡🤬😡🤬😡🤬

#

It's almost like you're making it to be as slow as possible

#

I've never been triggered by a code block in my life until now

prisma grail
prisma grail
distant wraith
#

JavaScript on its own is already outrageous

barren shale
#

one line javascript is better than normal javascript imo

#

you get the intellisense that having all of your code in one file gives you

distant wraith
#

Hmmm, I got an idea maximdark

prisma grail
prisma grail
spare mirage
prisma grail
#

Do we look like idiots or something? IwI

queen zodiac
barren shale
#

@main crescent

#

seems like some sort of ad

#

also seems like a hacked account

#

posted in most channels

half warrenBOT
#

🔨 Banned mako0934 indefinitely

queen zodiac
#

LET'S GOO

spare mirage
tropic dagger
#

fuck it I'm writing a map in C

#

and maybe a grid structure because my comp sci teacher went over 2D arrays and expressed discomfort with the fact that you can't easily iterate through a column

spare mirage
#

@prisma grail have you ever used lua?

prisma grail
spare mirage
prisma grail
# spare mirage any thoughts on it?

I don't think that my usage extent with it was enough for me to form reasonable opinions on it. All I can say that that the basic syntax looked ugly to me but that it was able to do its job of letting me configure nvim however I want.

spare mirage
prisma grail
#

I don't really have any reason to familiarize myself with it, never needed to do anything complicated in it and probably won't ever need to.

hardy field
hardy field
lapis flint
#

Bottom right corner

hardy field
#

Replaced with annoying ai tool that I didn't ask for

lapis flint
#

Why copilot there?

hardy field
#

idk, just appeared a few days ago

lapis flint
#

For me it is with other icons

lapis flint
hardy field
#

does nothing

lapis flint
#

Also, right click on taskbar -> options

#

And enable show desktop by clicking right corner

hardy field
#

I see, that fixed it

#

Still kinda dumb that they automatically disabled what was probably the most useful tasbar button

lapis flint
#

idk, it never was disabled for me

tropic dagger
#

Probably going to have to be intrusive linked lists

barren shale
#

why linked lists

#

just an array of arrays

#

4x4 would look like this

int** map = malloc(4 * sizeof(int*));
for(int i = 0; i < 4; i++) {
  map[i] = malloc(4 * sizeof(int));
}
#

and then you can map[x][y]

tropic dagger
#

I want the ability to easily grab and place an entire column into one variable as you can with a row

barren shale
#

well just switch up rows and columns

#

map[y][x]

tropic dagger
#

💀

barren shale
#

that's what people in AI do xzibit

#

because they like columns more for some reason

tropic dagger
#

No because the [y] argument will just grab from a row 💀😭

barren shale
#

well its a row because you wanna call it a row

#

but it can be a column if you call it a column

tropic dagger
#

...

barren shale
#

its a dimension it can be whatever you want

tropic dagger
#

🤦‍♂️

barren shale
#

when you nest loop over it instead of using map[i][j] you can do map[j][i]

#

and now the first dimension is the column

tropic dagger
#

You can iterate through a column with a constant in the column slot in the access operator. What I want is the ability to write something like auto ptr = getCol(&gridhead, 3);

#

Just as how you can write auto ptr = arr_arr[3] to get a row

barren shale
#

you cant override operators in C

#

so you need to make your own Array struct

tropic dagger
#

That's why I used a function?

#

Also that's not how the operator overload would work anyways you'd be forfeiting the ability to grab a row

barren shale
tropic dagger
barren shale
#

not very optimizied

#

hmm

tropic dagger
#

Simply hand the caller the vertical list head

barren shale
#

but linkedlists suck at normal reads

#

they are O(n) instead of O(1)

tropic dagger
#

I can't really think of a better way without copying which is still going to be slow

barren shale
#

anyway got some work to do

#

bye

tropic dagger
#

That's what I meant by copying

#

Cya

barren shale
#

use math

#

you can figure it out

tropic dagger
#

That's the goal

barren shale
#

i have worse problems to deal with

tropic dagger
#

I'll probably just have two different implementations one to give an array, one to give a list head

distant wraith
#

Fuck the automod

#

I'm not sure if I'm even surprised that they might have banned the word that perfectly describes the mods

barren shale
#

it contains hashtags i think

#

it thinks the hashtags are header values

#

but its within code so its not even headers

distant wraith
#

Oh yeah, that's possible

prisma grail
#

Though the whole being unable to use # in code blocks is a problem with the regex this server uses, not with Discord.

barren shale
#

funnieh

#

discord after they layoff 17% of the company:

wicked spindle
#

Remember: code should be readable instead of having to memorize everything

prisma grail
# barren shale funnieh

Pretty sure that Jupe opened a bug report about it but that they just ignored it. I then even bothered to write a workaround for the problem using some negative lookahead, but that didn't work either because whatever ungodly regex flavor Discord came up with doesn't even support lookaheads. GremlinRoseWheeze

barren shale
distant wraith
#

For the unreadability!

barren shale
#

or something like that

wicked spindle
#

There’s a discord automod?

distant wraith
#

More like peak censorship

prisma grail
#

Or something like that.

barren shale
#

lmao

prisma grail
#

I can't remember in a lot of detail anymore tbh because it's already been a while. xD

prisma grail
barren shale
#

their regex parser is string.StartsWith("#");

queen zodiac
#

Hello coders, I come here... Ummm... For... To ask you... Um... Idfk

queen zodiac
opaque ingot
barren shale
opaque ingot
#

Fuck you in a nicest possible way

barren shale
queen zodiac
queen zodiac
barren shale
queen zodiac
opaque ingot
#

Help, I'm still having a hard time understanding encapsulation

lapis flint
lapis flint
#

So stupid

barren shale
#

so discord xzibit

lapis flint
#

Wait, so discord or server

barren shale
#

its discord

lapis flint
#

Why discord blocking using # if it is discord feature

barren shale
#

but its a setting in the server that doesnt allow headers

#

headers start with a #

#

so discord thinks #️⃣ is a header if you type it first

#

it thinks its the same as this

#

this has the same issue

lapis flint
#

But it doesn't contains #

barren shale
lapis flint
barren shale
knotty root
#

Discord automod has been weird lately

barren shale
#

could be allowed in that channel

knotty root
#

They sent the message twice and I think the second time it got through

barren shale
#

hmm

#

or jupe fixed it

#

because it wasnt working in sb blog

#

and then jupe fixed it for me

#

or discord sucks

prisma grail
#

Is there a way to do this without any busy waiting where I don't need to make the method this is being done in async? wbsuffer

#

Btw, this isn't blocking the rest of programm execution because I'm already running this logic in separate processes.

#

(Don't ask me why processes and not threads please. TwT)

barren shale
#

the worst solution is what you are doing right now

#

these are the only two solutions

prisma grail
barren shale
#

then make all the methods async

prisma grail
barren shale
#

threads and async are very different

#

pls do not mix or ill be mad >:(

prisma grail
barren shale
#

async runs in the main thread

#

threading is different threads

#

the reason async doesnt block is that it creates a state machine so when you have to wait for something it saves the state of what you are currently doing and loads the state of something else and does it

#

so you dont wait

prisma grail
barren shale
#

threading causes issues

#

asnyc doesnt

#

threading requires your code to be thread safe

#

async doesnt

#

asnyc kinda hot ngl wblove

prisma grail
#

And I'm enough of not an idiot to write my code thread safe because I know this.

barren shale
#

well you dont have to deal with race conditions in async

#

as i said async very khot

#

use async

prisma grail
barren shale
#

async does not have thread issues

prisma grail
barren shale
#

oooooh

#

the benefit is not useless

#

the benefit is way better developer experience

prisma grail
barren shale
#

hmmmmm

#

you sure?

#

is it like a reported issue?

#

or is it just an issue you are having

prisma grail
# barren shale you sure?

You know the HotPotato command in general? It does 0 multithreading or multiprocessing, but it still runs into race conditions if two users invoke the comamnd at the same time.

prisma grail
barren shale
#

can you show me the code for it?

prisma grail
barren shale
#

you needed a lock

distant wraith
#

asyncio has its equivalent of a thread lock

#

Don't remember what though

barren shale
#

the problem is probably that there's a small amount of time where two players will have the hot potato at the same time while its switching

prisma grail
barren shale
#

I WANNA SEE THE CODE mastefgun

distant wraith
#

I remember that there's something that can prevent multiple users from calling the command at the same time

#

I'll search a bit

barren shale
distant wraith
barren shale
#

that's probably a semaphore

#

which is a lock

#

but async

distant wraith
#

Yeah, they might be using it internally

#

Never checked the source

barren shale
#

never check the source

distant wraith
barren shale
#

never read the documentation

#

just write code

#

and hope for the best

#

that's what i do

#

im learning the hard way xzibit

knotty root
#

When

barren shale
prisma grail
# barren shale the problem is probably that there's a small amount of time where two players wi...

Umm, ok, so in my defence to prefix what I'm about to say; the code was written by cloud, not me, I only put in the locks and stuff; and I just remembered that the issue wasn't two people using the commands at the same time.

Basically, HotPotato does its potato timeout by, at the end of the command, creating a task that waits for 60 seconds, awaiting that task, and then randomly passing the potato. And if the potato is manually passed before that waiting task is over, it cancels the task which then also cancels the auto pass. Now, when a user would manually task at the same time where the timeout expires, there wouldn't be a task to cancel, so the potato would both auto pass and manually pass, and due to that literally duplicate.

#

Anyways, my point is that whatever discord.py is doing made it possible for the code of the command to be running twice at the same time.

#

And that was causing issue until I added a lock.

barren shale
#

that seems less of an discord issue now

distant wraith
#

Skill issue

barren shale
#

@prisma grail where's the logic for the manual pass

#

oh i see it

#

actually i dont

prisma grail
barren shale
#

:(

prisma grail
# barren shale >:(

Oh, so fun fact, HotPotato is a whole lot of code, and I'm too lazy to dig through it rn and also don't want to just send all of the code when it's not mine. xD

barren shale
#

yeah i forgot i have a meeting in a bit too

#

bye

prisma grail
#

Bye!

quartz pumice
#

pycord is supposed to be a better (and dropin) version of discord.py but it's literaly the same amount of jank

prisma grail
quartz pumice
#

Your fucked

#

Yesterday I had to make a function that called my remote DB 3 times, when I couldve easily made it work in one by writing some sql but supabase wouldn't let me

prisma grail
quartz pumice
#

Faster

#

If you for some reason can't do async though, your probably doing something wrong
Top 100 reasons why I hate most of modern python

knotty root
#

Guys how to use vim?

prisma grail
prisma grail
quartz pumice
prisma grail
barren shale
#

i dont think people use async because its easier

prisma grail
barren shale
#

async is used when there's lots of waiting

#

if there's lots of waiting it doesnt make sense to use threads

#

especially since there's a limit to how many threads you can have active at once

#

a common use of threads is calculations if you have 1000 calculations you can do half the amount of time it takes to calculate them by using 2 threads

#

very cool use of thread but if you use async nothing will change the time will stay the same

#

meanwhile if there's lots of waiting threads are a big waste since you are not using them to their full limit and they cost more than state machines

prisma grail
# barren shale meanwhile if there's lots of waiting threads are a big waste since you are not u...

I don't have "a lot of waiting threads". All I'm saying is that I'm not on the main thread anyways when needing this data, the only code I'm blocking from execution by waiting for it is code that depends on the data anyways, so why make me use some special syntax for waiting instead of just having a way for me to put the thread to sleep while waiting on whatever networking needs to be done. Like, ok, I get the state machine aspect of async. But how does it do literally anything for me if all other code the thread could be running depends on me getting the result?

barren shale
#

its a discord bot library so it probably built with async because there's a lot of waiting for people to do commands

prisma grail
prisma grail
barren shale
#

they are as useful as the benefits of threads

quartz pumice
prisma grail
barren shale
#

but async is better suited in this situation

barren shale
#

in C# there's a default limit that you can surpass

#

but its usually more costly to start up a new thread

prisma grail
quartz pumice
#

If the threads are waiting they aren't being run

prisma grail
barren shale
#

programs use green threads

#

not actual threads

#

a program cant control which physical threads they are running on

#

if you have two threads they could both be running on the same physical thread xzibit

#

funnieh

prisma grail
barren shale
#

it doesnt

#

its just a side fun fact

#

i dont really know what exactly you are doing that cant be done using async

prisma grail
# barren shale its just a side fun fact

_Time to write my own OS and scheduler Ig so that I can provide some endpoint C# in particular can then use to control physical threads even though that's really stupid. wbtroll _

barren shale
prisma grail
barren shale
#

yeah last time i wrote async in python i didnt

#

because it seemed like too much work for just writing some async code

#

dont use python 👍

prisma grail
barren shale
#

i did suggest it once to jupe

#

i dont think he want to

#

imagine AMP in typescript

#

that would've been so cool ngl

prisma grail
prisma grail
# barren shale imagine AMP in typescript

Omg keep me far away from that piece of garbage if it's being rewritten anyways why would you ever be deranged enough to choose TS over an actually good language like C#? wbgreg

#

C#. C#. Not C. C was a typo. I meant C#.

barren shale
#

TS is super poggers when it comes to small projects

quartz pumice
#

Making your own os is actually a fun project lol

prisma grail
barren shale
#

but if you handle it correctly

prisma grail
barren shale
#

and with the help of some libraries

#

or they call them packages

#

typescript is very typesafe

#

and you can write it way faster than C#

#

with some amazing functionality that comes with types

#

only if types in C# were the same wbsuffer

quartz pumice
barren shale
#

would make it the perfect language

quartz pumice
#

Me who never wants to ever touch C# because there's too much bloat in it

barren shale
#

C# not really that bloated

#

it might be more verbose but that's about it

quartz pumice
#

Bruh c++ I can just install g++ but don't you need like .net for C#?

barren shale
#

in C++ you can do everything in 20 different ways or something

quartz pumice
#

I like it that way >:)

prisma grail
rocky kernelBOT
#

You need to create a character first. Use _start

barren shale
quartz pumice
#

I don't think I even have 200 megabytes of space

barren shale
#

you cant use that command

prisma grail
quartz pumice
#

I

barren shale
#

AMP looks like its in the middle ground so iguess C# is viable

prisma grail
barren shale
#

i thought mastef already did that

quartz pumice
#

What's SpeciesBox

#

Oh the shitty bot

barren shale
prisma grail
rocky kernelBOT
#

You need to create a character first. Use _start

quartz pumice
#

LMAO

barren shale
#

_i

rocky kernelBOT
#

Command: Inventory

Aliases: [inventory, inv, i]

Description:
Check your items, equipments and resources
Use _inventory equipments or _i e to check your equipments
Use _inventory resources or _i r to check your resources
Use _inventory gems or _i g to check your gems

barren shale
#

_s

rocky kernelBOT
barren shale
#

im god

quartz pumice
barren shale
#

no

quartz pumice
barren shale
#

also typescript is very good right now with things like bun coming out

#

it makes it super fast and you can run it without compiling it first to javascript

feral bramble
#

_s

rocky kernelBOT
feral bramble
#

oh

#

I thought the commands could only be used in playground

#

Well don't think people will be spamming it here

prisma grail
prisma grail
rocky kernelBOT
#

You need to create a character first. Use _start

feral bramble
barren shale
#

IL is funny to look at

feral bramble
hardy field
#

Quick, cover up the sb commands before a norank comes along and thinks this is the channel to use them in!

feral bramble
#

simple

#

why do you even start em with a _ sometimes anyways?

prisma grail
#

Quite the fun experience tbh.

feral bramble
prisma grail
feral bramble
#

ah k

hardy field
prisma grail
hardy field
#

It has happened before, and it will happen again

hardy field
feral bramble
#

lol only one in 2022

#

2 last year

prisma grail
feral bramble
#

lol

#

yup 2023 was u lol

prisma grail
feral bramble
#

ye

barren shale
#

intermediate language

#

languages like C# and java have an IL

quartz pumice
#

Oh

#

How does IL relate to assembly 💀

#

Is it like assembly

#

I know lua's bytecode is like assembly

prisma grail
quartz pumice
#

Ok

prisma grail
quartz pumice
#

pov: your ripping off assembly

prisma grail
#

(Please ignore the actual C# code being written, I just used whatever garbage my IDE happened to have opened.)

quartz pumice
#

I will now be reading the actual C# code

barren shale
#

this is just used to reduce the size of the code

#

because C# is JIT

#

that's how it supports multiple platforms

quartz pumice
#

O

#

I thought it was just bytecode

barren shale
#

well if you look at it

#

its not just bytecode

#

it got some extra stuff to it

quartz pumice
#

I didn't look at it I saw "Microsoft" and ran away

barren shale
#

but yeah its very similar to bytecode

#

but yeah C# compiler will just compile to this IL

#

which will be compiled and ran by the runtime

quartz pumice
#

Learn IL instead

#

fr fr

barren shale
#

IL is meant to be generated

#

variable names are literally V_{insert number here}

quartz pumice
#

Seems easy to learn then

barren shale
#

sure i guess xzibit

#

need a good memory though

#

to remember what each variable is

quartz pumice
#

Seems like it has notes so

barren shale
#

actually C# compiles in 3 stages

#

C# => Optimized C# => IL

#

optimized C# doesnt even have for loops

#

it uses while loops

quartz pumice
#

Oo

barren shale
#

yeah C# is really cool 😎

prisma grail
# barren shale

But it's theoretically possible to write C# code is a way where the compiler opts to not optimize anything?

prisma grail
rocky kernelBOT
#

You need to create a character first. Use _start

prisma grail
#

Omg the admins gotta stop ghosting me on getting this bot blocked. wbsuffer

hardy field
#

Using asterisks instead of underscores would solve this issue

prisma grail
quartz pumice
#

I made a new file system for my os

#
; load kernel (assuming it is the first file that appears)
bootloader:
  ; pray to god that this is correct
  mov rax, 49
  mov rbx, 69
  ; ^ praying to god

  mov rax, 12 ; get sector of file descriptor from kfs
  mov cl, 1
  mov rdi, tempsector
  call ata_lba_read

  mov rdi, tempsector
  mov rax, qword [tempsector+74]   ; mov start to rax
  mov rcx, qword [tempsector+74+8] ; mov end   to rcx

  sub rcx, rax ; get sector count to read by subtracting the end-start
  mov rdi, 0x00010000
  call ata_lba_read

; jump to kernel
  jmp 0x00010000``` only 12 instructions to read the kernel and start it (ignoring ata_lba_read which is like 500 lines)
opaque ingot
barren shale
#

that's for interfaces

lapis flint
#

Or if you will have only one inventory instance, its ok

barren shale
#

i mean i can also see a lot of badly designed code

#

but im not gonna say anything

lapis flint
barren shale
#

but having them is better for expanding the code and changing it

#

i dont think beginners should focus on these kind of things

lapis flint
#

They are newbie, its ok for the beginning

barren shale
#

yeah it works

#

no need to have the perfectly designed code

barren shale
lapis flint
#

I remember when at the beginning i used structures instead of classes because i liked word struct more, i didn't know differences

prisma grail
opaque ingot
opaque ingot
#

So what's the purpose of parameter and why should i use it and when

barren shale
#

me when someone uses python

prisma grail
barren shale
#

blame jupe

#

his choice xzibit

#

oh shit he is here

wet girder
#

No one is forcing you to code, you just do it

barren shale
#

bro caught us in 4k

#

admin powers

wet girder
barren shale
#

everyone does

#

python is never the best

#

unless its ai or something

prisma grail
barren shale
distant wraith
prisma grail
barren shale
barren shale
#

python is the worst

#

unless its ai

barren shale
#

ok let me rephrase again

#

python is top 10 bad language

#

unless its ai

distant wraith
prisma grail
barren shale
barren shale
#

i always use for(;;) for infinite loops

#

to confuse the noobs

#

hehe

prisma grail
prisma grail
# barren shale i always use `for(;;)` for infinite loops

Back when I had to code JS on a regular basis because of school, I'd often just straight up have bodyless for loops that run their code in the increment segment, because I was too bored to bother with having a body and found it funny just how much JS lets you do with that sort of sketchy/ridiculous syntax.

barren shale
#

JS 🤮

#

TS 😎

prisma grail
barren shale
#

in most js jobs you wont be working on big projects