#development

1 messages · Page 2048 of 1

cinder patio
#
struct A {
  b: B
}

#[derive(Default)]
struct B {
   a: usize
}

// in code
A {
  // You still have to supply the `b` field with a value, even if the type `B` has a default value
  b: B::default()
}
dusk vault
#

B::default()

#

lol

cinder patio
#

why do you find that funny?

#

lmao

dusk vault
#

it lets you not specify it

split hazel
#

c++ developers answering just to say namespace std is a bad practice

dusk vault
#

so ..Default::default() fills in the rest

#

so you can modify ones you need and default the others

cinder patio
#

but that doesn't matter because you STILL HAVE TO SPECIFY SOMETHING

#

you can't exclude the whole field altogether

wheat mesa
#

The idea here is that most languages have default values for most types in structs/objects

#

For example, objects in java default to null, integral types default to 0, and floating point types default to 0.0

dusk vault
#

eh, the idea is that data types and values are clearly separated I think

wheat mesa
#

Without needing to specify anything

#

(and booleans false ofc)

dusk vault
wheat mesa
#

I disagree

dusk vault
#

almost half of java errors seem to be an NPE

wheat mesa
#

If your error in java is a NPE then consider yourself lucky

lyric mountain
#

how tf

wheat mesa
#

those are usually incredibly easy to fix

dusk vault
#

Java exceptions be like

lyric mountain
#

npe is the least common error as long as you pay half attention to ur code

wheat mesa
#

It's your fault if you forget to instantiate something in the constructor

lyric mountain
cinder patio
#

Rust handles empty values way better with Option

#

fuck null

wheat mesa
#

I do like Option a lot

split hazel
#

c++ users realizing you cant do ++ and -- in rust

dusk vault
#

I just think it's cleaner to explicitly specify Option or | null

wheat mesa
#

compared to null

#

But at the same time I love java I'll be honest

dusk vault
wheat mesa
#

It's simple but elegant and powerful

split hazel
wheat mesa
#

java users realizing you can't do ```java
class A {
static int i = 1111;

static {
    i = i-- - --i;
}

{
    i = i++ + ++i;
}

}

class B extends A {
static {
i = --i - i--;
}

{
    i = ++i + i++;
}

}

public class Main {
public static void main(String[] args) {
B b = new B();
System.out.println(b.i);
}
}

dusk vault
#

LOL

#

jesus christ

split hazel
#

c++ users realizing you cant make a runtime string in c

lyric mountain
#

you cant chain increments in rust?

wheat mesa
#

there's no ++ or -- in rust

dusk vault
#

no, they're statements iirc

lyric mountain
#

what do they use?

dusk vault
#

+= -=

wheat mesa
#

+= and -=

lyric mountain
#

tf

dusk vault
#

that's pretty standard

wheat mesa
#

there's some reason for it I can't remember

split hazel
#

rust copied python change my mind

#

especially with the naked if conditions

wheat mesa
#

but to be fair I rarely find myself writing += 1 or -= 1 in rust anyways because I'm usually writing for loops like for i in 0..=100

dusk vault
#

not having () everywhere is nice imo

cinder patio
#

you can still have ()

dusk vault
#

and requiring a body

cinder patio
#

they're optional

dusk vault
cinder patio
#

yeah

#

you can ignore it

dusk vault
#

lol

wheat mesa
#

they're optional but it doesn't follow standard conventions to use them

dusk vault
#

it's just making an unecessary expression, not actually part of the if syntax

wheat mesa
#

idk, that's the only part about rust that I don't really like

#

coming from languages that have that every time just feels weird

dusk vault
#

pretty minor difference

wheat mesa
#

it's something I can deal with in exchange for nice memory management

split hazel
#

rust used to have for i in range(..) instead of for i in 1..5 rust copying python exposed

dusk vault
#

yeah

cinder patio
dusk vault
#

no, it's only a tuple if you suffix with a comma I think

#

(5) + 3 works still

#

it's just grouping

#

yeah (value,) is a 1 item tuple

#

or (type,)

#

otherwise grouping in math wouldn't work

#

and for ranges 0..(num + 1)

wheat mesa
#

ranges are nice

dusk vault
#

ye

wheat mesa
#

that's a feature I could get used to in other languages

dusk vault
#

C developers when no for (int i = 0; i < 10; i++)

lyric mountain
dusk vault
#

nah, Kotlin

#

lmao

lyric mountain
#

groovy is actually even more versatile than kotlin

wheat mesa
#

I don't really have an interest in trying kotlin tbh

#

I've seen it, I don't really like the way it looks

dusk vault
wheat mesa
#

I'm a syntax-ist

lyric mountain
#

versatility is syntax-wise

dusk vault
#

Kotlin actually supports Node.js and compiling as well

#

You haven't used Kotlin

wheat mesa
#

just make your own jvm lang :troll:

dusk vault
#

lol

lyric mountain
dusk vault
#

I have

wheat mesa
#

and jvm lang != easy to do the same exact things

lyric mountain
#

now you also coded in groovy for 10 years?

wheat mesa
#

just means they can technically do all of the same things

dusk vault
#

you got a problem?

lyric mountain
#

nah, I see lang haters here all the time

#

I don't really care for "X is better than Y" as long as it fills my needs

dusk vault
#

I just speak facts :P

wheat mesa
#

I hate python smile

lyric mountain
wheat mesa
#

though inevitably I'll have to learn it one day most likely

dusk vault
#

You feeling insecure?

lyric mountain
#

bruh, you're the one who came shit talking about java out of nowhere

wheat mesa
#

pretty much impossible to work a dev job without knowing how to make little python scripts

lyric mountain
#

I'm just replying

dusk vault
wheat mesa
#

I dislike it for many reasons

dusk vault
wheat mesa
#

syntax and speed being the main two

lyric mountain
dusk vault
#

my main gripe with Python is the module system

wheat mesa
#

It's just that it's a very useful language for making things like installation scripts and such

dusk vault
#

it's ambiguous

wheat mesa
#

you look in any git repo of an open source software and there's bound to be some python in there

lyric mountain
#

python is a scripting lang, it's people who insist to use it for fully fledged systems

wheat mesa
#

(and shell most likely)

lyric mountain
#

I most of the time use python for file management or automated stuff

#

heard doing robotics is nice with it too

dusk vault
#

true, the company I work for uses C++ for performance heavy things and writes the rest in Python

#

though I'd personally have chosen TS and or Rust

#

but it's good as it is as well

lyric mountain
#

ts is mono-thread

dusk vault
#

again, the performance heavy code isn't written in a scripting language

#

but Node.js specifically (not TS) has worker threads & is JIT compiled

#

so it's fairly performant

#

you can always just run multiple processes as well

wheat mesa
#

I think python is probably more convenient for writing small scripts than ts

lyric mountain
#

it's more a multi-process environment than a multi-thread env

#

nearly the same, but not quite

dusk vault
wheat mesa
#

As much as I hate to admit it, python is definitely useful

dusk vault
#

it's a blockchain

wheat mesa
#

ew crypto

#

you will never convince me that crypto is a good investment

#

I just call it a gamble

dusk vault
#

not trying to

#

lol

wheat mesa
#

ik just saying

dusk vault
#

I like learning the underlying cryptography

#

it's interesting stuff

wheat mesa
#

I'm gonna stick with parsing

split hazel
wheat mesa
#

no

dusk vault
#

lmfao

dusk vault
lyric mountain
#

nft is just e-money laundering

wheat mesa
#

I hope nft values just tank one day

dusk vault
#

spent a long time writing recursive descent parsers, but never much else

wheat mesa
#

completely tank

dusk vault
lyric mountain
#

politics now?

#

tf

dusk vault
#

kek

wheat mesa
#

he's not wrong (kuuhaku)

dusk vault
#

it's not a fault of the technology, but rather the people using it

wheat mesa
#

I feel like that's the underlying reason as to why they have any sort of value

dusk vault
#

lots of scams out there atm

wheat mesa
#

rich people wanting to avoid taxes in some way or another

lyric mountain
#

ultra-expensive art is money laundering too, it just got digital now

slender thistle
#

US feds were looking into ways to monitor crypto recently iirc

dusk vault
#

they have it on the tax forms now

wheat mesa
#

I think cryptocurrency was pushing the lines of real currency but NFTs are just blatantly worthless

dusk vault
#

and every exchange has KYC

lyric mountain
wheat mesa
#

it's gonna be pretty difficult to monitor

lyric mountain
#

like, isn't that the entire reason for crypto? total anon

slender thistle
#

Found the tweet

dusk vault
#

yeah I don't own any NFTs since
A. Ethereum is terrible for a variety of reasons
B. The art is shit
C. It's not worth the investment

slender thistle
wheat mesa
#

I don't own any NFTs since
A. They're fucking stupid
B. They're fucking stupid
C. It's not an investment
D. You will inevitably lose your money
E. NFTs are the dumbest shit to exist as a representation of real world value

dusk vault
#

lol

#

Just because I work for a blockchain doesn't mean I agree with all of the Bitcoin and Ethereum maxis

wheat mesa
#

I wonder if people realized that they could do the exact same thing but have real value by just paying real artists what their work is worth

lyric mountain
#

nfts are supposed to be reserved for physical objects, like mona lisa

dusk vault
#

to be fair NFTs have other uses

lyric mountain
#

like, stuff that can't be traded for equally-valued stuff

dusk vault
#

they haven't been explored yet though

lyric mountain
#

digital is anything but unique, anything can be copied or reproduced

wheat mesa
dusk vault
#

no, to prove you own your house

wheat mesa
#

Or, you could just buy a house and not have to prove it to anyone

dusk vault
#

NFTs aren't even necessarily graphical

dusk vault
wheat mesa
#

buy a house

dusk vault
#

who proves you bought it

quartz kindle
#

you can use them for tickets, passes, club membership, status, etc

dusk vault
#

yeah, like BAYC is doing

wheat mesa
#

The title of the house that has real value because you paid for it

dusk vault
#

or trying to (they keep getting hacked lmfao)

wheat mesa
#

The house is where the value is stored, the title just says you own it

lyric mountain
dusk vault
wheat mesa
#

And the idea is still stupid

dusk vault
#

not really

#

the world is moving digital

wheat mesa
#

It's just throwing money around in hopes that rich people will throw more cash into it so you'll make money

#

It's not a real investment in my eyes

dusk vault
#

that's the image side of NFTs

wheat mesa
#

The images are worthless

dusk vault
#

the thing I'm describing doesn't exist yet

wheat mesa
#

It's just the receipt that has value

#

When in reality it shouldn't

#

Not to mention it's fucking terrible for the environment

dusk vault
#

Ethereum*

lyric mountain
#

just the digital pixels in the form of text

wheat mesa
#

mining crypto

#

NFTs are all associated with ETH or some form of crypto

dusk vault
#

currently yes

wheat mesa
#

Which about 95% or more of crypto is terrible for the environment

dusk vault
#

check out Chia, it's entire focus is the environment

wheat mesa
#

That's just an estimation

dusk vault
#

they're even partnering with the Climate Warehouse lol

lyric mountain
wheat mesa
#

Yeah

lyric mountain
#

fuckin gpu prices got to the moon

wheat mesa
#

I got lucky, got my rtx 2070 before prices skyrocketed

#

now 3 years later it's worth more than I bought it for

lyric mountain
#

I planned to upgrade my note this year, but the prices more than doubled

#

covid didn't help either

wheat mesa
#

yeah

#

tbh I'm glad I overbuilt my pc in 2019

#

It's still running strong today

#

And I would be very upset if I had to buy a new GPU or part atm due to prices

#

Only things that have ever broke in my PC was a freakout with my SSD where it got fried somehow, and my cheap network card that I bought for 10 bucks and lasted 2 years

lyric mountain
#

it'll probably last a long time, it'll be hard to make another big jump as rtx did

wheat mesa
#

Thankfully I had nothing of value on that SSD that couldn't be replaced

#

One day I just booted up my pc and it refused to boot into windows

lyric mountain
#

are u using nvme or box ssd?

wheat mesa
#

Looked at it in the BIOS and it said that it had 0.0gb/0.0gb capacity lol

#

box ssd

#

didn't want to shell out the extra cash for an nvme

#

they were still pretty expensive at the time I bought it

lyric mountain
#

get a low-capacity one just for the os and stuff that you really crave for performance

#

mine is 256gb (2019, when it wasn't so expensive), most stuff barely take time loading

wheat mesa
#

yeah maybe in the future

#

I have a 500gb box ssd

#

pretty fast

#

then I have a 1tb hdd for storage of mass stuff

#

which tbh I haven't used for much other than a few steam games that I don't play too often

#

yeah my steam folder on that disk is 167gb

#

I probably should've put llvm on that disk...

lyric mountain
#

hdd is a must if u have huge stuff

wheat mesa
#

I usually manage my space pretty well

#

I like to keep 100gb+-ish free on my ssd

#

if you get too low on storage things start to slow down

#

I used to have a weird problem with my pc randomly shutting off, uninstalled valorant and never had that problem since lmao

lyric mountain
#

ye, ssd needs some padding to maintain speed

dusk vault
#

i just have a 1TB M.2 SSD

wheat mesa
#

No blue screen or anything, just literally shut off too

lyric mountain
wheat mesa
#

Nope

lyric mountain
#

at the beginning, vanguard had some weird issues where it disabled cpu fan

wheat mesa
#

I don't like vanguard at all

split hazel
wheat mesa
#

Too invasive

lyric mountain
#

indeed is

split hazel
#

if there aint too much space left it probably has to move around some stuff and place data in awkward places

#

ntfs has absolutely no fragmentation prevention

dusk vault
#

I hate windows but I have to use it for games

lyric mountain
#

there's another reason for ssd, don't remember it tho

split hazel
#

ssds dont magically prevent fragmenation

#

it still happens the effects are just different

lyric mountain
#

ssd is immune to fragmentation slowdown, since it has no moving parts

#

it can still be fragmented

dusk vault
#

ssds are immune to ur mom

lyric mountain
#

shut hobbyist

dusk vault
#

literally have a job that makes more than ur family but ok

lyric mountain
#

yes yes, whatever

wheat mesa
#

I don't have a job :C

dusk vault
#

rip

wheat mesa
#

Rightfully so though, I'm by no means ready to be a dev lmao

dusk vault
#

lol

wheat mesa
#

Still got a long ways to go

lyric mountain
wheat mesa
#

lol

wheat mesa
#

I'm 16 and I started with a djs bot when I was 15 KEKW

split hazel
#

ssd owners after they realize they have a limited write cycle after reinstalling windows 10x

wheat mesa
#

That was my first "development" experience

#

my god if I could look back on that codebase

dusk vault
#

I mean it's good experience

lyric mountain
#

url doesn't allow ()

dusk vault
#

auto generated url moment

wheat mesa
#

I have a mc mod I'm supposed to throw an update at by the end of the week but at the same time I'm kinda lazy and I don't want to

lyric mountain
#

do it at friday

#

near 18:00h

wheat mesa
#

lmao might not be possible to do it that fast

dusk vault
#

forge or fabric

wheat mesa
#

forge

#

all of it is related to chat messages pretty much, the problem being that I don't necessarily have the needed info to update the mod since most of it is rng

#

So I don't know what I'm really supposed to add quite yet

split hazel
#

ssd users realizing if they dont power on the drive for a couple of years data loss will occur

dusk vault
wheat mesa
#

Plus forge is a whole clusterfuck

#

and I need to update the UI but I kinda don't want to lay a finger on ogl

dusk vault
#

fabric is much nicer but sadly not much (comparatively) supports it yet

lyric mountain
#

I wanted to use ogl, but it feels so weird to use

wheat mesa
#

currently to move around stat displays (which are just rectangles of text pretty much), you have to use like 30 sliders

#

which is becoming impossibly unmaintainable as I add more stat displays

#

I also need to figure out a better json setting storage system

#

my trackers are probably like 1000 lines of code in a project that only has 2.5k lines

lyric mountain
#

json storage

wheat mesa
#

it's for settings

#

and trackers

#

it auto saves every time they close the settings gui and every 5 mins, and when they close the game

lyric mountain
#

use an sqlite file, everything uses it

wheat mesa
#

nah

#

json is fine for this case

#

Haven't had any issues, it's just a little annoying to create more trackers

#

Currently the way I do it is... really bad

split hazel
#

sqlite users realizing there is a performance penalty when you manipulate and update too many strings

dusk vault
#

sqlite users realizing better databases exist

wheat mesa
#

I basically have a hashmap for storing all the loot, and then I just make getters and setters in the class to manipulate the map, then the map is serialized into json

wheat mesa
#

problem is...

#

I didn't think this through very well

dusk vault
#

oh god

wheat mesa
#

it's just easy to serialize and deserialize

lyric mountain
dusk vault
lyric mountain
wheat mesa
#

and it's a safe external api, but when I need to mess with settings and add more stuff it's really annoying

#

gets kinda old writing this over and over KEKW

#

I'll have to refactor it sometime

dusk vault
#

oh jesus christ

wheat mesa
#

I need to think of a better solution

#

Imagine that code, but for 4 different classes

lyric mountain
#

you could use moshi + class mapping for that

wheat mesa
#

agh

lyric mountain
#

that way u can deal with the json file as if it was a normal class

wheat mesa
#

I only do it like this because it's easy to serialize and deserialize with simple-json

dusk vault
#

simple json is nice

wheat mesa
#

it's better than the way I used to do it in a previous project

#

used to have an entire class just full of static global variables KEKW

dusk vault
#

lol

split hazel
#

java and c# users realizing they have to use classes and objects in order to create and deserialize json

dusk vault
#

ikr

wheat mesa
#

classes represent json really well

#

imo

split hazel
#

its so annoying

#

statically typed json 🤮

lyric mountain
#

json is supposed to be represented by a class tbh

split hazel
#

one name change and its over

dusk vault
lyric mountain
#

o stands for object

wheat mesa
#

like in c#

dusk vault
#

it's supposed to be represented by JavaScript Objects

#

which are not classes

wheat mesa
#

[JsonProperty("name_here")]

lyric mountain
dusk vault
#

no

#

they aren't

wheat mesa
#

object is in the name

cinder patio
#

object doesn't necessarily mean class instance

dusk vault
#

they're objects

wheat mesa
#

classes can represent key value really easily

dusk vault
#

not as easy as objects can KEKo7

wheat mesa
#

and they're easy to serialize models because they're just a collection of properties with values

split hazel
#

c++ libs dont use classes/structs for json instead they use maps

cinder patio
#

Can't you use interfaces n C# instead of classes

wheat mesa
#

uhhhh

lyric mountain
wheat mesa
#

I don't think you can deserialize to an interface in C#

dusk vault
wheat mesa
#

or maybe it's the other way around

#

you might not be able to serialize an interface

dusk vault
#

not every object has a prototype

wheat mesa
#

can't remember, but I had problems with interfaces at some point

dusk vault
#

in JS

wheat mesa
dusk vault
#

interfaces in Java aren't really true interfaces iirc

#

same with generics

wheat mesa
#

Why not

split hazel
lyric mountain
#

generics in java all must have Object as a common ancestor, I don't see why it's less generic than using Something<int>

dusk vault
#

typeof is very old and poorly written

#

typeof null === 'object'

dusk vault
#

it's not true generics

#

it's only compile-time

wheat mesa
#

because null is technically the value of an object, it's just the absence of one

dusk vault
#

nope, it was confirmed as a bug

wheat mesa
#

makes sense in my mind at least, coming from java

dusk vault
#

null should not work the way it does in Java

#

that's the reason modern languages are commonly "null safe"

lyric mountain
#

how should nulls work then?

dusk vault
#

be a separate type

#

lol

wheat mesa
#

I think null is a perfectly fine concept if you understand the caveats, but I do prefer rust's Option

lyric mountain
quartz kindle
#

In the first implementation of JavaScript, JavaScript values were represented as a type tag and a value. The type tag for objects was 0. null was represented as the NULL pointer (0x00 in most platforms). Consequently, null had 0 as type tag, hence the "object" typeof return value. (reference)

A fix was proposed for ECMAScript (via an opt-in), but was rejected. It would have resulted in typeof null === 'null'.

dusk vault
#

solely because of backwards compatibility

dusk vault
#

not everything is Java

lyric mountain
#

we were talking abt java

dusk vault
#

no we weren't

#

lol

lyric mountain
wheat mesa
#

lol

dusk vault
lyric mountain
#

ah, u pinged

quartz kindle
#

java and javascript are the same thing, just like car and carpet :^)

wheat mesa
#

you must've disabled the @

#

yeah

lyric mountain
#

didn't notice discord showed whether u pinged or not

wheat mesa
#

ham and hamster

#

they probably taste similar

dusk vault
#

JavaScript being named the way it is is a severe marketing failure

wheat mesa
#

wasn't originally named javascript

lyric mountain
#

ecmascript

wheat mesa
#

the company wanted to make it familiar because of java's popularity at the time

lyric mountain
#

what does ecma stands for btw?

dusk vault
#

hence marketing failure

wheat mesa
#

it was originally called mocha I think

quartz kindle
#

external computerized marketing asshats

dusk vault
#

European Computer Manufacturers Association Script

#

apparently

lyric mountain
#

had to be the british /s

dusk vault
#

AppleScript be like

quartz kindle
#

microsoft jscript

dusk vault
#

oh god

#

C#ava KEKW

wheat mesa
#

fun fact that I learned about: discord has syntax highlighting for x86

slender thistle
#

CScript

dusk vault
quartz kindle
#

nasmasm

wheat mesa
#
.section text
  mov eax, 1

; I don't remember enough asm
lyric mountain
#

C# is literally java after sun didn't allow microsoft to name it Java++

dusk vault
#

lmfao

#

Java#

lyric mountain
#

no, really, it wasn't originally supposed to be called C#

dusk vault
#

Microsoft really do be copying everything out here

lyric mountain
#

they didn't try electric cars yet

#

or at least I think

quartz kindle
#

yet

dusk vault
#

Microdick Winshit

quartz kindle
#

imagine an electric car running on some windows platform

dusk vault
#

BSOD moment

split hazel
#

asm users realizing there are no if statements

quartz kindle
#

"accident caused by bsod in electric car"

dusk vault
split hazel
#

no you have to compare a value then do a conditional jump

dusk vault
#

ah yes apple is microsoft

quartz kindle
dusk vault
#

lmfao

split hazel
#

car crashed because of segmentation fault

dusk vault
#

windows car be like "turning it off doesn't actually turn it off"

lyric mountain
quartz kindle
#

apple car be like "oh the browser isnt working? you'll have to replace the entire car"

split hazel
dusk vault
#

lmfao

quartz kindle
#

lmao

dusk vault
#

looks like apple mouse

#

apple car: "beachball covers entire front screen causing wreck"

quartz kindle
#

does it also have the charging port under the car?

dusk vault
#

oh god

#

u have to flip it upside down to charge it

#

imagine

quartz kindle
#

yes

lyric mountain
wheat mesa
#

stupid question, how do I implement display for an enum in rust to display like LeftParen if the enum's value is TokenType::LeftParen

dusk vault
quartz kindle
#

xDDDD

split hazel
#

bruh

wheat mesa
#

lmfaooo

dusk vault
#

assuming this is for dbg!()

wheat mesa
#

No I meant impl Display for TokenType, the fmt function

dusk vault
#

oh

#

idk

#

my speedometer when driving:

quartz kindle
#

ever seen a fine caused by a broken speed camera?

dusk vault
#

no

wheat mesa
#

they have speed cameras that automatically hand out fines?

dusk vault
#

yeah

wheat mesa
#

ouch

dusk vault
#

they usually have a sign telling you tho

#

i think its a legal requirement

quartz kindle
#

there were sevaral ive heard of around here, dude in a bike was fined for driving at 800km/h according to the speed cam

wheat mesa
#

in texas they even declared that red light cameras are unlawful lmao

dusk vault
#

lol speeding on a bike

#

based

quartz kindle
#

he went to appeal the fine and was rejected

dusk vault
#

what

#

lmao

quartz kindle
#

because if the speed cam says so, then thats what it is, we cant to anything

dusk vault
#

bro

#

sounds about right, our court system is trash

quartz kindle
#

driving a bike at airplane speeds exdee

dusk vault
sonic lodge
#

then you can

fn main() {
    println!("{}", TokenType::LeftParen);
}
#

though if you derived debug it would print the same thing

wheat mesa
#

in theory could I just derive debug and then do something stupid like ```rs
impl Display for TokenType {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "{:?}", &self);
}
}

#

Or does that not work

sonic lodge
#

that works too

#

im not experienced enough to say if thats "rusty" though lol

split hazel
#

the windows c api sucks so much

wheat mesa
#

The windows api sucks

lyric mountain
#

corporate wants you to find the difference between lParam and wParam

split hazel
#

does rust make it better

#

i kinda wanna make a trojan

#

(for educational purposes)

#

but the windows api is impossible to work with

timid geyser
#

my old linxu machine

#

before I wiped it

lyric mountain
split hazel
#

doesnt make it better 💀

#

yeah but you can like

#

abstract it maybe

#

to cut out some of the stupid steps

#

like receiving windows events is a mess

#

pretty sure you cant do it with a single file

#

you have to have one exe and one dll file

lyric mountain
#

the one who makes a clean abstracted winapi wrapper will be the next node-ips dude

split hazel
#

i dont understand the joke

lyric mountain
#

not a joke, but if someone makes a good enough clean wrapper for winapi pretty much EVERYONE would use it

#

save for a few enterprises that have their own wrapper

lyric mountain
#

it is, but nobody achieved that yet afaik

#

because it'd the an ultimate task to wrap everything

wheat mesa
#

copy your package.json then run npm i

timid geyser
#

ah alright

#

Thank you

split hazel
#

you called linux linxu opinion disregarded

timid geyser
#

speedtyping issue

#

I am sorry, tux

#

please do not revoke my linux access

simple stump
#

How can I embed HTML directly? Not a page, but rather just straight markdown? For example, if I were to have something like this:

<!DOCTYPE HTML>
<html>
  <head>
  </head>
  <body>
    <h1>Hello</h1>
  </body>
</html>

And have a page like this:

<!DOCTYPE HTML>
<html>
  <head>
  </head>
  <body>
    <h1>Content</h1>
    <iframe src="something" />
  </body>
</html>

How could I embed the first HTML on the page? I don't have a file, link, etc. Just the HTML itself. Another issue I have is that I'm using React, but I'm just wondering if this is possible with straight markdown.

split hazel
#

wot

#

do you mean

#

embed html in a page

quartz kindle
#

i believe this is possible

#

<iframe srcdoc="<html><body>Hello, <b>world</b>.</body></html>"></iframe>

split hazel
#

srcdoc yeah

#

i use it for rendering the emails in my page so its sandboxed and doesnt get affected by my pages styles

#

do note if you want to run a script which resizes the iframe to the size of the content inside instead of being a tiny box you need to set sandbox="allow-same-origin"

#

if its from the same origin

#

for some reason the browser by default doesnt trust content from srcdoc/same origin

boreal iron
#

wouldn't trust your content, too

simple stump
split hazel
#

you coukld at least say

#

"wow that is a good implementation"

boreal iron
split hazel
#

or "great!"

boreal iron
#

you're "praise hungry" hmm

#

you better accept the sad world we're living in

timber fractal
#

Looking for (affordable) webhosting for an express website, cant really find any, suggestions? Preferably domain registration and emaim included

lyric mountain
#

replit

#

if it's going to be an on-demand site you don't really need to keep it 24/7

wheat mesa
#

Ah okay I've got a better understanding about rust lifetimes now ```rs
fn main() {
let test: Test;
{
let a_str: &str = "test";
test = Test { thing: a_str }
} // a_str data normally dropped here
println!("{:?}", test) // still valid because the reference inside test stays alive as long as test is alive
}

#[derive(Debug)]
struct Test<'a> {
thing: &'a str,
}

#

that makes a lot more sense

#

I think I'm starting to love rust

lyric mountain
#

basically you bind a variable to another variable

#

or the infamous case of "how to kill parent with child"

wheat mesa
#

it's just ensuring you don't have any unsafe memory accesses

#

telling the compiler to not free a_str since test is still using it

#

that's really neat actually

split hazel
#

i like rust but i feel like im being held back by it so i wont really be using it

lyric mountain
#

how do I calculate a square triangle's size when I resize the other to maintain hipothenuse angles the same?

#

like, lemme draw

#

I want to resize A, how do I find out how long B needs to be so C (angle) stays the same?

#

context: I have a HP bar where one of the sides is sloped

#

nvm I'll just set a clip area

woeful pike
#

find the ratio between the old and new A and multiply B by that

lyric mountain
#

ah ty, but I'll use a clip area since it's also simpler to interp the bar length

split hazel
#

go ask your maths teacher

wheat mesa
#

math is fun

#

very satisfying when you find an application for something math related in your code

wheat mesa
#

anyone know how to get rid of this underline garbage when using rust-analyzer

#

nvm got it

dusk vault
wheat mesa
#

for anyone else wondering, slap this in vsc settings.json```json

{
"editor.semanticTokenColorCustomizations": {
"enabled": true,
"rules": {
"*.mutable": {
"underline": false,
}
}
}
}

dusk vault
#

Replit, Glitch, etc are really limiting and I don't recommend them if you can afford $3/mo

dusk vault
#

I'm still learning myself but ye

wheat mesa
#

I’m making a math parser (much like I did in C#) in rust, it’s been really easy so far

#

Very intuitive

split hazel
#

the focus on safety is good but i think its a little too much

#

it pre-emptively decides whether something is safe or not

#

of course you can get around all these things but its not as easy as you would with c/c++

#

and im also not a fan of some of the syntax and keyword designs

dusk vault
#

not trying to help

#

lmao

spark flint
#

theyre right tho

#

you only know its broken when it doesn't work

#

USE A DATABASE

#

ok then why do you need to know if it works

#

if its not broken

wheat mesa
#

DO NOT USE JSON AS A DATABASE PLEASE

spark flint
#

^^^^^^^^^^^^^^

wheat mesa
#

that is my recommendation

spark flint
#

good ty

#

NO

#

FUCK OFF

split hazel
#

mongodb for something that small 💀

#

y'all are overexaggerating

wheat mesa
#

Yes and no

dusk vault
#

mongodb or mysql are good options

spark flint
#
const birthdays = await <collection>.find({ }).toArray()
for (const birthday of birthdays) {
  //loop and send for each birthday
}```
dusk vault
#

when you have arbitrary amounts of rows

wheat mesa
#

Json can be fine, but I have a feeling it’ll expand into something that it shouldn’t because he won’t want to port over to a db if he gets more traffic

split hazel
#

thats what i also thought and the only reasonable argument

#

unless its a private server

spark flint
#

its for his public bot tho

spark flint
wheat mesa
#

Then definitely go for a db

dusk vault
#

lmfao

wheat mesa
spark flint
#

lol i still have it

#

db then

dusk vault
#

i remember deleting my entire mongo collection on accident

wheat mesa
#

If it’s private now, then go ahead and use json if you don’t feel like implementing a db. But if you plan on making it public, use a db

#

That way you can have it as a one-and-done feature

spark flint
#

mongodb atlas

dusk vault
#

mongoose is actually easier to use than JSON

#

lmfao

spark flint
#

or Railway for mongo, its free

wheat mesa
#

Mongo has a free 512mb cloud cluster

spark flint
dusk vault
#

omfg does nobody here use proper hosting

#

i swear to god

wheat mesa
#

There’s no need for something so small

spark flint
#

i use several servers lmao

dusk vault
#

it's disgusting how people use repl and shit

wheat mesa
#

I find mostly nothing wrong with it until people start complaining about it

spark flint
#

that gets all saved birthdays from the birthday collection, then loops through said birthdays and you can go from there

wheat mesa
#

Replit is a decent option if you don’t intend on ever paying for hosting

sharp geyser
#

sounds reasonable

wheat mesa
wheat mesa
dusk vault
sharp geyser
sharp geyser
wheat mesa
#

Json is fine as a format for saving data, just not CONSTANT data or anything

dusk vault
#

bro

wheat mesa
#

And as it grows in size it will take more and more memory to keep in your program, and will take longer and longer to read

dusk vault
#

yall have no money at all

#

lmfao

sharp geyser
#

Again I am just curious if it is viable to use it as a database

wheat mesa
#

Oracle has a free tier VPS

sharp geyser
#

There has to be ways to get around the concurrent write issue

dusk vault
wheat mesa
#

Yes there is but that’s not the only issue with it

spark flint
#

Oracle is good

dusk vault
#

yes a VPS is good

sharp geyser
#

Well of course not but if you can solve one you can solve em all mmLol

dusk vault
#

then you can host any DB you want easily

wheat mesa
#

Don’t expect amazing performance, but it’s what I use

sharp geyser
#

Anyway I am done being a clown

#

what is going on in the dev channel

wheat mesa
dusk vault
wheat mesa
#

Yes

sharp geyser
#

as my db

split hazel
#
dusk vault
#

kek

sharp geyser
dusk vault
#

^

wheat mesa
#

You have to have a debit card/credit card to register, but that’s just to make sure you don’t make a massive botnet with free tier accounts

sharp geyser
#

don't ever suggest that trash

spark flint
split hazel
#

:(

#
sharp geyser
#

slightly better

dusk vault
#

just use mongodb with mongoose

#

lmao

sharp geyser
#

ew mongo

dusk vault
#

or mysql with mysql2

sharp geyser
#

pg where it's at

lyric mountain
#

nono mysql no

dusk vault
#

ok java user

lyric mountain
#

if you value your data

split hazel
sharp geyser
#

csv > *

wheat mesa
dusk vault
#

im gaining aids reading this chat

sharp geyser
#

What you don't like csv?

wheat mesa
#

I found that oracle’s vps is nice for hosting my bot that is only used on a few servers

dusk vault
#

small discord.js bots aren't very resource intensive

sharp geyser
#

Doesn't oracle give you 24gb of ram to split up between multiple vps?

wheat mesa
#

Free tier has only about 1gb of ram

dusk vault
#

lol 24gb

split hazel
dusk vault
#

that costs like $100

#

GL

wheat mesa
#

Where did you find that lol

sharp geyser
#

I was asking cause someone said so which sounded outrageous I just never confirmed it

wheat mesa
#

You get like $300 of free credits to spend in like the first 3 months but thats it

sharp geyser
#

so i decied to ask again

split hazel
#

if mfs are giving 24gb ram for free sign me up i have some things i want to put up there

wheat mesa
#

Same 💀

sharp geyser
#

lmao

#

Waffle what would you put out there

#

you haven't done anything big

wheat mesa
#

I did your mom

#

She’s big

dusk vault
#

that's low

#

lmao

sharp geyser
#

Jokes on u idk where my mom is

#

so

dusk vault
wheat mesa
sharp geyser
#

All I am hearing is a pig oinking

wheat mesa
#

Go tell your mom to stop talking then

sharp geyser
#

Waffle I will admit I walked into that one

#

but still

#

😔

spark flint
#

4 servers all with 6gb ram

#

3 servers with 6gb ram, 6gb ram and 12gb ram

#

2 with 12gb ram

#

or of course, the big 24gb ram

dusk vault
#

ah yes

split hazel
#

where

spark flint
split hazel
#

galaxygate is milking me dry rn

split hazel
#

and i havent gotten my paycheck yet

spark flint
#

if its for bost hosting

#

bot hosting

#

select Ashburn (US-East)

#

its 24ms ping

split hazel
#

i'll probably use for a bit of remote coding with visual studio code bc my laptop cannot handle shit

spark flint
split hazel
#

so united arab emirates

spark flint
#

what

#

no

#

US East (Ashburn) is an Oracle location name

split hazel
#

choose a country in the middle so you get good ping both in england and in the us

spark flint
#

Ashburn is a census-designated place (CDP) in Loudoun County, Virginia, United States. As of the 2010 United States Census, its population was 43,511, up from 3,393 twenty years earlier. It is 30 miles (48 km) northwest of Washington, D.C., and part of the Washington metropolitan area.
Ashburn is a major hub for Internet traffic, due to its many...

#

idk

#

look

split hazel
#

canada discord user opinion rejected

dusk vault
#

lol

split hazel
#

cant find united arab emirates on the list

#

im swimming in debt rn

wheat mesa
#

why... does it matter...

#

canada is going to be a worse option, discord's servers are in california iirc

#

they have multiple regions, I don't think any are in canada though

#

you probably wanna go with either US-east or US-west

#

one of the two

dusk vault
#

california deez nuts

split hazel
quartz kindle
#

therefore it was canceled by twitter mobs

sharp geyser
dusk vault
#

lmfao

wheat mesa
#

no I do not believe so

split hazel
#

do they require credit cards?

sharp geyser
#

Do you have 1$

split hazel
#

it says credit card

#

yeah

sharp geyser
#

It should be credit or debit from what I read

wheat mesa
#

it charges you $1 verification fee and gives it back

split hazel
#

they dont even ask for the card name

wheat mesa
#

it can be either

sharp geyser
#

👀

wheat mesa
#

make sure your bank isn't declining the verification thing

split hazel
#

"We're seeing criminals target people like you" just saw that when logging into bank

#

who are people like me

wheat mesa
#

people buying oracle VPSs apparently

split hazel
#

yeah i defo have balance just confirmed

dusk vault
#

/s

split hazel
#

i'll try contacting them

wheat mesa
#

your bank might be marking the purchase as fraudulent

sharp geyser
#

probably your bank declining it

wheat mesa
#

idk why they would for 1 dollar though

sharp geyser
#

even 1$ can be considered a scam ig

split hazel
#

mfs usually lock my account if something gets marked as a scam transaction

#

oh fuck

#

the billing info has the wrong name and address

wheat mesa
#

lol

split hazel
#

i've tried it like 2x

#

at this rate i have no hope of my bank account remaining open for very long

#

they lock your account as soon as you do something out of the ordinary

#

and you have to call them

quartz kindle
#

get another bank account

#

i have ike 6

split hazel
#

cant open a new one rn but i will as soon as i can

#

my identity docs are expired

dusk vault
#

yall

#

silent judging

split hazel
#

💀 i dont know if i still use this number

#

if its not im defo done for

#

good stuff enjoy my 80p oracle

wheat mesa
#

they give back the money, it's just to verify that you're not making a botnet

split hazel
#

nah oracles playing a joke

wheat mesa
#

why are you even bothering with oracle anyways

#

do u need a 1gb ram vps

split hazel
#

24GB RAM

wheat mesa
#

it's not lol

#

idk who told you that but it's definitely not

#

you get $300 worth of credits for free for your first 30 days

#

but after 30 days that's it

#

1gb ram

split hazel
#

and its apparently free forever

wheat mesa
#

not true

#

I use their free forever tier

#

I get 1gb of ram

split hazel
#

nevermind i aint giving my details to oracle to probably put me up on those public lookup websites

spark flint
#

what no

wheat mesa
spark flint
#

you select the Ampere option

#

not AMD

spark flint
split hazel
#

oracle actually blacklisted me

#

💀

#

i wanna be on the whitelist pls

spark flint
#

lmao

wheat mesa
#

interesting

split hazel
#

oracle prob charging me twice

split hazel
wheat mesa
#

I looked many hours through oracle's website when I was looking for my VPS and couldn't find jack shit on that

split hazel
#

its not supposed to be easy

wheat mesa
#

I'll have to keep this in mind, but I have a feeling there's a downside to this

split hazel
#

NOOOO I ACCIDENTALLY CLOSED THE TAB

#

IT TAKES LIKE 20 MINUTES TO GET TO THE PAYMENT PAGE

sharp geyser
#

lmao

#

poor speedy

split hazel
#

i am going to HURT SOMEONE

#

same shit

#

except one is an architecture and ones a company

sharp geyser
#

It is just a matter of the architecture amd has a different instruction set than ARM does, it is just arm doesn't allow x86 from what I recall while AMD does

split hazel
#

fuck you stop showing me something i dont have

sharp geyser
#

then go get it speedy

sharp geyser
spark flint
#

you can't make more

#

i have 2 servers already

#

always free

#

no card info linked

sharp geyser
#

I see

#

So you essentially get 24gb free every month?

spark flint
#

yeah

sharp geyser
split hazel
#

THEY FUCKING BLOCKED MY EMAILS

sharp geyser
#

THEN EMAIL THEM

split hazel
#

who tf made this goofy system

wheat mesa
#

jesus bro

wheat mesa
split hazel
#

nah the jig is up

#

either my bank thinks somethings sussy or oracles goofy system blacklisted me

#

that probably means my card is blocked

#

fucking monopolies

#

cant even access my hard earnt money

sharp geyser
#

It is 1$

split hazel
#

fuckers let fraudsters through but dont let you through

#

its night and theres still people in the support chat

#

they better be paid night premium

#

mfs blacklisted me

quartz kindle
#

rip

lyric mountain
#

oracle tsundere

#

"I-i-it's not like I want you to pay us b-baka"

split hazel
#

mfs just take my 80p for lifetime access to free servers pls

#

sounds like a scam now that i think about it

royal portal
ancient nova
#
<MessageEmbed>.addField(
`Roles (Total of ${member.roles.cache.filter(r => r.id !== message.guild.id).map(roles => `\`${roles.name}\``).length || "0"} Roles)`,
`${slicedRoles || "No Roles"}`
)

MessageEmbed field values must be non-empty strings.

#

any idea why?

sharp geyser
#

They are empty

ancient nova
#

yeah why?

#

I've included the || "No Roles" and || "0"

#

just incase that happens

#

is that not the right use case for ||?

dusk vault
#

first of all length || 0 is redundant, if the length is 0, it'll be 0 already

#

what is slicedRoles?

#

it sounds like an array

#

which is not a string

#

you probably intend to join it and tostring the values?

ancient nova
#

I know the code is extremely bad for what I just showed you

    let slicedRoles = member.roles.cache.filter(r => r.id !== message.guild.id).map(roles => `<@&${roles.id }>`);
    if (slicedRoles.length > 16) {
        slicedRoles = slicedRoles.slice(0, 16);
        slicedRoles = slicedRoles + " and more..."
    }
``` just don't have the time to make it better
ancient nova
dusk vault
#

it's not..

sharp geyser
#

It'd never be an issue

ancient nova
#

well I still wanted to make sure

sharp geyser
dusk vault
#

average JS user

ancient nova
#

so

#

what's the issue then?

dusk vault
#

lmfao

ancient nova
wheat mesa
#

be glad you haven't seen any regex yet @dusk vault

earnest phoenix
#

I suppose they're trying to remove the @everyone role from the list of roles, which is assigned to all members, but that can be improved

ancient nova
#

the code for that is old, I've taken it out of my older bot and just updated what I needed to make it work with v13

dusk vault
#

how is that related

wheat mesa
#

That's not my point

#

You'll see

earnest phoenix
#

As the @everyone role has the guild ID

dusk vault
wheat mesa
#

ItsOkayBae has a little bit of a reputation for overusing regex in my opinion

ancient nova
#

😐

wheat mesa
#

Just saying!

sharp geyser
dusk vault
#

lol

ancient nova
earnest phoenix
sharp geyser
#

Yes when you use it properly

ancient nova
sharp geyser
#

no

#

not at all

dusk vault
ancient nova
#

well either way

#

what's the issue?

dusk vault
#

idk, log ur params

#

debug it urself

ancient nova
#

😐

#

fine

dusk vault
#

this is a super simple thing to debug lmao

sharp geyser
#

this guy acts as if it is a big inconvenience to do his own work

earnest phoenix
#

You're passing the array as the first operand to the logical OR operator (||), which'll always return true for arrays, doesn't matter if empty or not

ancient nova
#

fixed it

dusk vault
#

oh wait

ancient nova
dusk vault
#

only in the if

ancient nova
#

cause I can if you want

#

and I'll send it here

#

for you guys to rate

#

🙂

dusk vault
#

it just screams script-kiddie to me

sharp geyser
ancient nova
#

I've written it in 2019

dusk vault
#

u haven't learned how JS or DJS works or how to debug in 3 years?

#

impressive

ancient nova
earnest phoenix
#

Well this is nothing compared to the people in the discord.js' support server's support channels...

#

They write the most cursed code I have ever seen in my entire life

ancient nova
#

it's not like javascript is the only language you use, not at all

dusk vault
#

lmfao

earnest phoenix
sharp geyser
#

👀

#

That is a challenge

dusk vault
#
public static void main() {
  bot.client('ready' {
function client.login(token).then {
      client.on('message', function(message) = console
}
})
}
#

discord.js users be like

sharp geyser
#

or at least it should be

dusk vault
#

"why no work help"

earnest phoenix
dusk vault
#

lol

earnest phoenix
#

I would rather rewrite you

dusk vault
#

uwu

sharp geyser
dusk vault
#

lol

sharp geyser
#

My knowledge in the art of programming is so poor I make shit code 24/7

#

rewrite me with knowledge

earnest phoenix
#

I mean, you're still decent anyway; but I'll do so gladly

sharp geyser
#

pfffffttt

#

I'd say I am no where near decent

dusk vault