#⌨coders-cave
1 messages · Page 28 of 1
That’s not interesting. I don’t like simplicity
Then you dont get a life
You dont want it to be difficult but not simple either
Linux too🤭
Thank you 🤝
baba boi
superior ahh syntax
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 
hi if i code in scratch am i good
best coder on EARTH
thanks
You're more garbage than me. I'm the golden garbage
and im unreal garbage
^Hey, that’s a bypass
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
what
never use Python
I think it is not hard
Oh yes, WorldBox invented C# for sure
but I think you could also start wirh anything else
Unity is C# and since Worldbox is made with Unity, Worldbox is in C#
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
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.
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
the hell is the point of learning it as a first language if you arent even gonna learn the data types
thats like the most basic knowledge in programming you practically have to have
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 🫠
python is dope for some projects
on the fly quick stuff is a blast
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
Python is good for that
It just has limited use cases because it's really not good for bigger projects
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 
no one uses it to be the fastest
in execution of the code
(not every solution needs it)
the execution time might be slow, but the program writing time is faster
Yeah but I keep seeing stuff about how it’s good for making hacking tools and such
I love that "хуй"
you write the program once
most of the time execute it a few times
plus it really depends on your skill level
not really. A lot of websites, like Uber for example, use python as their backend
congrats
Deadchatd
It's the coders cave cycle give us a bit to come up with controversial stuff to say
btw, Kotlin is literraly Java but better
I don't like Java 🤷♂️
nobody does 
"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
yeah uber and instagram use django for some of their backend
and they pay a lot for it
Hi
Software developers:
Shut up nerd🤓
Oh.. I have image for your mom
Seems like skill issue ngl
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
It is
Yap yap
Punishment for using xml
Not like it was my choice
JsonBody parsing for HTML requests is also wonky in .NET 6+ tho
Hi Jupe
I’m back
UncaughtSyntaxError:Unexpectedtoken<console.log("why would you make fun of coders in their cave? xo";
You come into our house, say 'skill issue' for no reason, and then call us yappers?
Chat, show me this guy's front yard
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
Yall better answer.
@barren shale
Come here
It's your boy kiril
Aren't you gonna greet me?
So what exactly do you need help with?
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
Headache
Plis explain every detail so i can reuse the information whenever me need it
Too busy
Use brain
Leveling system for player like every exp = +1 level
But.. what if the xp the player get from is in the other file
So like..
Wait
No nvm
Dum dum me
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
Ask away, I have some basic knowledge so I might be able to help but someone else might also be able to help. In the future don't ask to ask just ask, that way you have the best chance of getting answered
Thank you, I am going to send you a DM to give you more information about my project
Doesn't work
what part of it doesn't work
What am I suppose to do with GetRequiredXp();
Hold on
oh you need to make a function called GetRequiredXp that returns the amount of xp needed for next level up
I suppose
It makes errors because on non thing
So like..
Int GetRequiredXp()
{
Uh.. ?
}
Hm.
Dang 3 years and still this is like the 10th time learning C#
What function though
🤔
Objects and classes, the backbone of OOP
I thought that's the flag of Germany in your pfp at first glance
Reject gay return to the first Reich
It‘s the ace flag 😔
Did I stutter
After 1 day i finally got it. I'm so dumb
cool
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?
I'm confused as to what you're asking for.
Oh don't worry, I don't need it anymore
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
debugging so fun
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
It becomes a problem again when you start working on big software
Like 500k+ lines big
i would quit after a day ngl 
I've Counted in the hours
requiredXp = GetRequiredXp();
Ajax code is funnier
when you only use a single thread
https://vxtwitter.com/pymaunier/status/1757710674174550191
How CPU cycles are used inside a routing engine during big RIB updates
💖 47 🔁 7
Hey guys, i want to learn python and i dont't have any idea about how to start please explain me how to start
Run vs code and watch tutorials
hey
can you help me to download vs code
@opaque ingot
Just open YouTube or Chrome bro
Find it there
I mean.. we all start at YouTube or Chrome
oh kk
Why do you wanna learn python anyways
I tried to learn it but failed miserably and went back to C# again
Im not expert at websites but you could try learn python for website's backend
For python there are a lot of great options.
For example:
- Codeacademy has great courses and for example this is completely free https://www.codecademy.com/learn/learn-python-3
- Also w3schools is great Imo https://www.w3schools.com/python/
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
Thanks!
My star role when
I have proofs that I am kirill
or yesberrynice
Or Kirillsharky
send the proofs and let's go from there
Check dm
lol
I switched to godot
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
I am using it too
Can you use C# in godoy?
Godot*
For me it is better than unity, because you can modify it if you want and if you can do things on c++
Thank god. C# is like my favorite
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

Now tell me, is there a tutorial for godot?
They have very good docs
Where where
Thank you
Should I use Weapon as interface? Because you know.. I'll add alot of weapons
Or abstract
Ye what hamza said
if base realization contains some behaviour, better to have it as class, even not abstract
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
I'm trying to only add Damage, the weapon price, material contained to craft it and durability
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
What is.. realization?
weapon class
So just class I should use for weapons?
It does not contains info of weapon, just behaviour
What you exactly doing if it is not a secret?
I don't know, once I make the Weapon and then when the player get it they can use get the damage of the weapon, info about the materials needed how to craft it, durability if it hits 0 then it'll magically dissapear
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
Okay I'm confused (except for the classes) I'm not really that good at english, like can you make an example with code? Short one is fine
Yes, give me a minute
since yall are coders, what prevents the mobile version of worldbox from getting mods?
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
What does dictionary do there?
Keeps weapon data
Ohh, thank you very much
What about the void below?
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
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?
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);
}
}
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
Well this is pretty difficult but worth a try to understand because pretty much it'll be useful for future
You never worked with getters and setters?
No..
If so, this is good case to start
Isn't getter where it returns or get something and setter is the one who sets the value
Yes
What is your language?
I mean it's so obvious judging from it's name😭
C#
I mean speaking
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
En version
Thank you
Damn 💀
I spent too much time on Discord for like a year and forgot some of my native language's words 😎
Lmao, I spent too much time isolating myself from everyone
I don't get it, why do you have to private some data? Like what is the cost if it's not private?
So you never access it when you shouldn't
How do i call the id?
I keep trying to learn zig but theres so few things, the documentation is kindof bad..
Wdym?
Like in your main or other file you call for that Weapon's Id or name
Still can't understand wdym by call?
Like Console.WriteLine(how do I put the id here or the name of the weapons in other files);?
Console.WriteLine(weapon.Asset.id)
Thank you
But what about if you wanna put specific ID? Like bow or sword since there's alot
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
Input to where?
Other file(like just in case when I make the inventory system i don't need to ask about this)
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
I tried making a kernel in zig
Some time ago
If the language was more popular it would literally be a better C
for real bruh
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
yeah
And every version completely changes the language and compiler making older code versions unusable
scary too learn
The docs are sometimes outdated too
So you read the docs
You try them
But they error
Only to find out they are a version behind
So now you are on your own
and thats the only resource thats even real
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
oof
Best version from what I remember too
you know its bad when theres a "best version"
@orchid frigate remember me?
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?
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
Shows an error
Forgot I can't send ss
An object reference is required for the non-static field, method, or property 'WeaponLibrary.Weapons'
You sure you do it from weaponLibrary object, not from class?
var wl = new WeaponLibrary();
wl.Weapons
And is it okay if I just let the fields as it be inside WeaponAssest like what if I put get and set?
Wait
Yeah, I think
Wdym?
Check please
Like public string id = { get; set;}
Yeah it's from object
I mean i don't understand what are you asking
Show me the code
Where you trying to get object
And your WeaponLibrary class
Oh shit, wait
It's working, it was WeaponLibrary.Weapons instead of weaponLibrary.Weapons
My bad
Like you have public string id inside WeaponAsset should I not touch it?
Why you want to touch it?
I don't know, should I put get and set or just leave it alone
And also, how do i make a crit damage to Weapon? All i know is that you use Random and multiply
Yes
Leave it
Yes, random, you can google about random in godot (if you using it)
I'm pretty sure you use other variable for random numbers(not int since it makes it easier to get crit damage)
Like the chances of crit damage
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
Like you need return with Damage * 2
Yes
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;
}
if(rand.Randf() <= 0.5)//50% chance. 0.75 for 75% chance for example
{
return damage * 2;
}
Ohh, thank you
Is that python
Me when set and dict 😔
😔
ballers
The random class is not true random 
Is it a bad idea to put inventory methods inside WeaponLibrary?
Knew it, can you teach me how to make inventory
I know you have to make class for inventory inside Weapon file and then some Dictionary thing
And some methods
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
I need inventory system where user can add,remove and list the inventory inside
So just list enough


Can u use #
Try
Oops wrong chat
Sorry
What
the header #
Any of you know what the fuck wix is
My tech teacher making me make a website with it
Oh no
an absolutely horrid experience
Oh fuck
Console.WriteLine("Hello World");
~bt
is it dead?
~bt ur mum
oh wait you cant use amp here
Hello coders-cave
Hello orange train

Is there a way where I can make if statement about the
weaponName like if the user input the Weapon name that only exists inside the WeaponLibrary then it'll add that inside the list
And yes I'm using the same file, not different file
What do you exactly want to make? Where user will write weapon name?
Dictionary has method ContainsKey, so you can check
But it is case sensitive
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
Add to inventory?
Yes
As i said, you can use ContainsKey to check if key exists, and then use get method from weapon library to get weapon
What is containsKey
Weapons?
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
Like any tutorials?
Google them
Like this?
if(weaponLibrary.Weapons.ContainsKey(userInput))
{
Console.WriteLine("Yes");
}
else
{
Console.WriteLine("No");
}
Yes
But user input may be incorrect
it may be in other case
Why
So you need to work around it
Bro what is this windows slander. Windows is a perfectly usable operating system
from my experience its probably as stable as macos
remembering the time when i had to use linux for around 2 years gives me war flashbacks
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
well the tinkering part applies for all OSes 
one time i accidently deleted the wrong registery
had to reinstall windows 
lol
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. 
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
Well, it was more of a case of "how much of this logic can I write without needing to create a new line", the result just happened to align with that. xD
Do you want to see the one line TicTacToe I once wrote in JS? 
JavaScript on its own is already outrageous
one line javascript is better than normal javascript imo
you get the intellisense that having all of your code in one file gives you
Hmmm, I got an idea 
Python is too. IwI
(Btw, Jupe, if you see this, no need to block me from pushing to AMP, most of the lists used here only contain like 1-4 elements at any given time.)
Yall should move AMP to JavaScript xD
Do we look like idiots or something? IwI
Maybe
@main crescent
seems like some sort of ad
also seems like a hacked account
posted in most channels
🔨 Banned mako0934 indefinitely
In what ways?
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
@prisma grail have you ever used lua?
To configure nvim.
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.
I've used it just a little bit for gmod but aside from that it's unknown to me.
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.
Not that Windows is bad, but they do make some bad decisions. Like removing the "minimize all windows" button from the taskbar
Bro came here and said int**
Its still there
Not for me, completely gone
Bottom right corner
Replaced with annoying ai tool that I didn't ask for
Why copilot there?
idk, just appeared a few days ago
Just try doubleclick in bot right corner
does nothing
Also, right click on taskbar -> options
And enable show desktop by clicking right corner
I see, that fixed it
Still kinda dumb that they automatically disabled what was probably the most useful tasbar button
idk, it never was disabled for me
It's going to function like two linked lists
Probably going to have to be intrusive linked lists
bro its a 2d array
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]
I want the ability to easily grab and place an entire column into one variable as you can with a row
💀
No because the [y] argument will just grab from a row 💀😭
well its a row because you wanna call it a row
but it can be a column if you call it a column
...
its a dimension it can be whatever you want
🤦♂️
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
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
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
but if you dont make your own array struct youre gonna have to make a new array within the function
That's the point of using intrusive linked lists
Simply hand the caller the vertical list head
I can't really think of a better way without copying which is still going to be slow
^
anyway got some work to do
bye
you can make it without copying
use math
you can figure it out
That's the goal
I'll probably just have two different implementations one to give an array, one to give a list head
Fuck the automod
I'm not sure if I'm even surprised that they might have banned the word that perfectly describes the mods
it contains hashtags i think
it thinks the hashtags are header values
but its within code so its not even headers

Oh yeah, that's possible
Discord also detects the #️⃣ emoji as a # in regex, so you can't use that emoji at the beginning of messages either if I recall correctly.
Though the whole being unable to use # in code blocks is a problem with the regex this server uses, not with Discord.
Remember: code should be readable instead of having to memorize everything
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. 
nahhhh im gonna just write everything in one line in an untyped language with one letter variable names
For the unreadability!
they used ai to take a screenshot of the character and determine whether it is a hashtag or not
or something like that
Peak job safety. 
There’s a discord automod?
More like peak censorship
Nah, it's actually because the #️⃣ emoji is formed of several unicode characters, one of them being #, and Discords regex parser fails to realise that the characters go together into one emoji, instead treating them as individual characters.
Or something like that.
lmao
I can't remember in a lot of detail anymore tbh because it's already been a while. xD
Literally every other regex parser treats the emoji as one character. 
their regex parser is string.StartsWith("#");
Hello coders, I come here... Ummm... For... To ask you... Um... Idfk
What is it about
¯_(ツ)_/¯
It's been like 2 years since you been sending that shit
almost 3 ☝️
Fuck you in a nicest possible way
true dat
in the* ☝️
OwO
why the? Why not a?
because that's how english works
nuh uh
wtf
skill issue
So stupid
so discord 
Wait, so discord or server
its discord
Why discord blocking using # if it is discord feature
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
But it doesn't contains #
discord check sucks


Discord automod has been weird lately
it depends
could be allowed in that channel
its allowed in #1144581107220762634
No because automod also caught it in that channel
They sent the message twice and I think the second time it got through
hmm
or jupe fixed it
because it wasnt working in sb blog
and then jupe fixed it for me
or discord sucks
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? 
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)
the best solution is to make the method async
the worst solution is what you are doing right now
these are the only two solutions

Well, then I have the same problem again with the method that's calling the current method. 
then make all the methods async
That'd involve me figuring out what Python was on when they made asyncio instead of just being able to use Threads. IwI
Correct me if I'm wrong, but the reason why you'd have something async is so that it doesn't block main execution, and I can also accomplish that by yeeting the code execution into a different thread?
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
Well, fair, but I don't see how that difference matters for what I'm trying to do, especially when I'm already splitting up program execution all over the place anyways.
threading causes issues
asnyc doesnt
threading requires your code to be thread safe
async doesnt
asnyc kinda hot ngl 
Literally the entirety of discord.py already causes issues like race conditions because of how it works if you don't write your code thread safe.
And I'm enough of not an idiot to write my code thread safe because I know this.
well you dont have to deal with race conditions in async
as i said async very khot
use async
But if I already have to deal with them anyways, why suddenly make one part of the code different?
you shouldnt have to deal with them if you use async
async does not have thread issues
Like, ok, sure, async is idiot proof and whatnot. But how does that justify forcing me into using it if its benefit is pointless to me?
Well, something about the way how discord.py work inherently causes race conditions anyways, so I'm not saving myself from anything with async in this case.
hmmmmm
you sure?
is it like a reported issue?
or is it just an issue you are having
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.
I never checked.
this is not a discord issue
can you show me the code for it?
How can you say that, and then how was the issue magically gone when I started putting a lock into the code?
see the issue is your code
you needed a lock
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
But my code had absolutely nothing that would make thread safety necessary, the issue came from how discord.py handles two users invoking the command at the same time.
can i see the code >:(
I WANNA SEE THE CODE 
I remember that there's something that can prevent multiple users from calling the command at the same time
I'll search a bit
never check the source

never read the documentation
just write code
and hope for the best
that's what i do
im learning the hard way 
When
never
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.
that seems less of an discord issue now
Skill issue
Oh yeah, because I only sent the auto pass. xD
:(
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
Bye!
Every python discord library is a piece of shit
pycord is supposed to be a better (and dropin) version of discord.py but it's literaly the same amount of jank
Hey, person that's less opposed to literally anything I'm saying, do you know of a less stupid way to do the thing I'm doing that originally made me ask for help here?
.
No
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
Ah, how great. Didn't think that Python could manage to make my code even worse than it usually is. 
Can maybe try time.sleep(0)
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
Guys how to use vim?
Fair, but I don't really need the result too quickly, so I might as well give the Thread I'm executing the code on some down time before checking again.
It's mainly because then making all following method calls nested would be very messy to deal with.
Yeah I hate when shit forces you to do that stuff
Sure, I get that async is more idiot proof and whatnot, but if I'm already doing multithreading anyways, let me await the result my way instead of needing to budge to some entirely different system.
i dont think people use async because its easier
What do you think is the reason?
threads are used when performance is needed
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
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?
if you need the result then you just add await
its a discord bot library so it probably built with async because there's a lot of waiting for people to do commands
There's literally nothing else for the code that's running on the thread to do at the same time. This whole problem isn't happening on e.g. the main thread of the application, it's happening on some side thread that the main thread only needs to care about when user input instructs the main application to intervene in the activities of the side thread.
But that'd require me to refactor all of the code to be async in the first place when the benefits of async are pointless for me.
they are as useful as the benefits of threads
I looked it up, theres no thread limit?
Well, yeah, but the part of logic I'm in rn is in a way disconnected from normal async command execution.
but async is better suited in this situation
depends on the language
in C# there's a default limit that you can surpass
but its usually more costly to start up a new thread
There's a limit on how many threads the CPU can run at once though, I'd assume that that's what they meant.
If the threads are waiting they aren't being run
Oh nvm what I said Ig.
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 
funnieh
Well, fair, that's literally the job of the scheduler, but how does that affect my general point rn?
it doesnt
its just a side fun fact

i dont really know what exactly you are doing that cant be done using async
_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.
_
nah the scheduler is already good enough to spread you green threads across all the physical threads
Well, I could do all of the required refactors for using it, but the fact that Python forces me into doing so is completely stupid.
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 👍
Ah yes, lemme avoid major refactors of a whole lot of code by casually rewriting the entirety of AMP into a less awful language from scratch. 
i did suggest it once to jupe
i dont think he want to
imagine AMP in typescript
that would've been so cool ngl
Yeah, I acknowledged the stupidity of my own idea already. xD
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#? 
C#. C#. Not C. C was a typo. I meant C#.
TS > C# for small projects
TS is super poggers when it comes to small projects
Making your own os is actually a fun project lol
It's literally just JS with an illusion of types that's slightly more convincing than whatever Python is doing though...
yes it is technically not a typed language
but if you handle it correctly
I saw that y'all were obsessed with something like that a while back when I was only modding WorldBox and lurking in this channel a lot. Looked like quite the experience and I had no idea what was going on most of the time. IwI
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 
It is, you learn a lot.
Though for some reason the community around it gives really bad advice 💀
would make it the perfect language
Me who never wants to ever touch C# because there's too much bloat in it
nah that's C++
C# not really that bloated
it might be more verbose but that's about it
Bruh c++ I can just install g++ but don't you need like .net for C#?
in C++ you can do everything in 20 different ways or something
I like it that way >:)
I somehow feel like that's a matter of personal experience with both languages and also inevitably backfires when the project starts scaling up too much.
You need to create a character first. Use _start
yeah you need a 200 megabytes runtime
you just typed _i_
I don't think I even have 200 megabytes of space
Omg can this stupid bot for once leave me alone. 
I
well yeah if we talking hundreds of files i would use C#
AMP looks like its in the middle ground so iguess C# is viable
Watch me go to #✨staff-suggestions and blackmail the admin team into blocking SpeciesBox from literally every channel on this server except for the ones where it's meant to be used.
i thought mastef already did that
I think I proved that wrong like 10 messages earlier.
You need to create a character first. Use _start
LMAO
_i
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
_s
im god
Ayo are you using a bot in #⌨coders-cave
no
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
_s
oh
I thought the commands could only be used in playground
Well don't think people will be spamming it here
Funnily enough, I do have basic experiences with IL due to WorldBox modding. It's not nearly as low of a level as actual Assembly, of course, but was still quite the experience.
I will now have to personally lobby to get them blocked because the stupid bot keeps interpreting my normal messages as commands.
You need to create a character first. Use _start
real
IL is funny to look at
just don't start your messages with an _
Quick, cover up the sb commands before a norank comes along and thinks this is the channel to use them in!
I've used it before to rewrite the behaviour of some C# methods on runtime.
Quite the fun experience tbh.
as if no ranks even look at this channel
Because of the emphasis added by italics.
ah k
But they do, seemingly just to see someone use sb in this channel and then use it themselves
80% literally think this channel is WorldBox related. 
wait so it happened before?
It has happened before, and it will happen again
yeah a couple times
I wouldn't be surprised if both of those are me tbh. IwI
And the 2022 one was the same type of accidental usage as me.
ye
wtf is IL
Oh
How does IL relate to assembly 💀
Is it like assembly
I know lua's bytecode is like assembly
It's the thing that the runtime enviroments of Java/C# run. So it's effectively Assembly for those specific runtime enviroments.
Ok
(Slight glimpse onto it if you're curious what it looks like fsr.)
pov: your ripping off assembly
(Please ignore the actual C# code being written, I just used whatever garbage my IDE happened to have opened.)
I will now be reading the actual C# code
this is just used to reduce the size of the code
because C# is JIT
that's how it supports multiple platforms
I didn't look at it I saw "Microsoft" and ran away
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
Seems like it has notes so
actually C# compiles in 3 stages
C# => Optimized C# => IL
optimized C# doesnt even have for loops
it uses while loops
Oo
yeah C# is really cool 😎
But it's theoretically possible to write C# code is a way where the compiler opts to not optimize anything?
You’re free to try
I have a life though. 
You need to create a character first. Use _start
Omg the admins gotta stop ghosting me on getting this bot blocked. 
Using asterisks instead of underscores would solve this issue
Yes, but then I'd be using the same character for both bold and italics. Also, to move on to more justifiable arguments, there isn't any reason why SB is needed in these channels in the first place.
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)
Is this bad guys? Review please
dont start the class name with an I
that's for interfaces
Do not keep weapon library in each inventory instance
Or if you will have only one inventory instance, its ok
why
because the code works without them
but having them is better for expanding the code and changing it
i dont think beginners should focus on these kind of things
They are newbie, its ok for the beginning
that's why this is my only complain 
I remember when at the beginning i used structures instead of classes because i liked word struct more, i didn't know differences
Idk stuff about assembly, but I like how literally the first thing I notice is a comment praying that two, to me seemingly random, magic numbers are correct. 
https://pastebin.com/tY6xvpt6 what about this
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
So what's the purpose of parameter and why should i use it and when
me when someone uses python
As someone forced to code Python right now, I 100% agree with this. TwT
No one is forcing you to code, you just do it
I agree tho ngl
Well, yeah, fair, but it's a great statement for dramatic effect. xD
(Watch me make some horrible argument that while I'm not forced to code at all, I am forced to do it with Python if I do choose to code now.)
You can say that to literally every language 🤷
It'd be pure poetry if AI completely replaces the incompetent coders that genuinely consider Python the best language for everything.
@soft flame thank you for this great gif 
ok let me rephrase
python is the worst
unless its ai
lmao
Still
You caught in a while (true); or something? xD
nah i fixed it
for(;;)
i always use for(;;) for infinite loops
to confuse the noobs
hehe
xD
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.
Dear god, I can't help but notice, school ruined my JS coding habits so badly, I'd genuinely be fired from any JS coding job within a week if I were stupid enough to code JS for a living, simply because of how genuinely awful and unmaintainable JS code by me tends to become once I get bored enough to start abusing its syntax.
in most js jobs you wont be working on big projects



