#development

1 messages ¡ Page 68 of 1

radiant kraken
#

no, the C/C++ preprocessor does that

sharp geyser
#

Well it happens during the compile time does it not?

wheat mesa
#

Yeah

#

Preprocessor -> compiling -> exe

sharp geyser
#

Thats what I meant so why you saying no

#

😔

wheat mesa
#

It’s part of the compilation process but it’s not “compiling” per se

sharp geyser
#

yea okay now I see

#

I mixed up my words

#

is there function overloading in c++?

wheat mesa
#

Yes

#

Different argument types

#

Or do you mean overriding

sharp geyser
#

so I could do

int add(int a, int b)
double add(double a, double b)

or smth

wheat mesa
#

Yes

#

You could also keep the return type the same so long as the arg types are different

sharp geyser
#

ic

wheat mesa
#

However the argument types have to differ, otherwise it won’t work

#

Since it can’t guess which version you want

rigid maple
#
ffmpeg -loglevel debug -y -acodec libopus -ac 1 -i ./src/recordings/1668904799882.pcm -b:a 128k -ar 48000 -f mp3 1668904799882.pcm
``` yes, when I decoded, the pcm file was fine too. After converting, the wav file was perfect. Thanks Tim
sharp geyser
#

Also I notice that Clion includes the header file for the cpp file I just made

wheat mesa
#

Yup

sharp geyser
#

like Math.cpp is including Math.h

#

Is there a reason?

wheat mesa
#

The power of modern IDEs

#

Because the cpp file corresponds to the declarations made in the h file

#

Most header files do not contain any actual source code, just the declarations for things (with some exceptions like templates because they’re hell to work with in both an h file and a cpp file)

rigid maple
sharp geyser
#

I see

quartz kindle
#

god bless

wheat mesa
#

Yeah

sharp geyser
#

This is kinda annoying

wheat mesa
quartz kindle
#

try splitting your code into multiple files

sharp geyser
#

This is interesting syntax

quartz kindle
#

and watch the compiler re-include all headers onto every single file

sharp geyser
#
class Math {
    int add(double a, double b);

public:
    static int add(int a, int b);
};

No idea why I had to make it static but

wheat mesa
#

Because it’s not an object

#

It’s the same thing as static in Java (in this context)

quartz kindle
#

static to use directly, non static to use after initializing an instance with New

wheat mesa
#

It’s just a function on your Math class

sharp geyser
#

no idea what static really does tbh

wheat mesa
#

Otherwise you can instantiate objects like Math math; (with a default ctor)

quartz kindle
#

so Math math makes a stack instance

#

new Math makes a heap instance

wheat mesa
#

Yeah

#

new essentially mallocs

quartz kindle
#

ye

wheat mesa
#

For every new you need one delete

sharp geyser
#

Math math = *new Math()

#

weird

wheat mesa
#

Uh

#

Sure

#

Wouldn’t recommend doing that

quartz kindle
#

yeah its a pointer because its on the heap

sharp geyser
#

Thats what the IDE recommended kek

wheat mesa
#

I would just keep Math* math = new Math() instead

#

Or use a smart pointer (don’t worry about those yet they’re outside a beginner level)

sharp geyser
#

Im not looking at your code waffle I dont understand it

quartz kindle
#

i have no idea what smart pointers do either

wheat mesa
#

Shameless plug for an example on how I instantiate objects like that

sharp geyser
#

😔

wheat mesa
#

It looks like DJS builders

#

That file at least

sharp geyser
#

"Its simple"

#

oh it is

wheat mesa
sharp geyser
#

you dont even need new?

wheat mesa
#

“Modern C++”

sharp geyser
#

you can just do Math math = Math()?

wheat mesa
#

Assuming you’re instantiating it at compile time yes

sharp geyser
#

Interesting

wheat mesa
#

If you need info to instantiate it that you don’t have at compile time, you’ll need to use pointers

sharp geyser
#

This is getting a bit too much for what I currently understand but I am glad I looked at it

rigid maple
#

What should I do to decode all files in a folder with ffmpeg? I think it is very tiring to loop and decode each file one by one.

wheat mesa
#

Compile time C++ generally doesn’t use many pointers

#

Once you start getting into things that require runtime info is where you’ll be working with (smart or not) pointers a lot

sharp geyser
#

someone told me to do malloc(999999)

quartz kindle
wheat mesa
quartz kindle
#

i mean

#

999999 is pretty small tbh

wheat mesa
#

Actually yeah

quartz kindle
#

thats just 1mb

wheat mesa
#

1m bytes is child’s play for c++

sharp geyser
#

so should I do malloc(9999999999999999999999999999999999999999999999999999999)

wheat mesa
#

Don’t think that works

quartz kindle
#

yes

sharp geyser
#

kek

wheat mesa
#

It takes a long long at most iirc

#

That’s way over the limit

quartz kindle
#

malloc(size_t)

wheat mesa
#

Ah yeah

sharp geyser
#

size_t

wheat mesa
#

size_t is just whatever the pointer size is on your OS

sharp geyser
#

nice

wheat mesa
#

Aka 64 bit

#

Or 32 bit if you own a pc from the vista era

sharp geyser
#

I own a pc from the medieval era

wheat mesa
#

0 bit

#

ches

sharp geyser
#

1 kb

wheat mesa
#

Imagine 1kb pointers

sharp geyser
#

lol

wheat mesa
#

the poor CPU registers

#

you'd need 1kb registers

quartz kindle
#

apollo 11 had like 64kb ram

wheat mesa
#

or you'd need some sort of special instructions to tell the cpu to read from multiple registers to get 1kb worth of pointer data lmao

sharp geyser
#

A space ship had ram?

wheat mesa
#

yeah

#

it had a computer

sharp geyser
#

Woah

quartz kindle
#

everything has a computer these days

wheat mesa
#

as time has gone on tho, ram has become incredibly compact and cheap

#

so we don't care as much

quartz kindle
#

also

wheat mesa
#

otherwise we'd all be using C and microoptimizing the shit out of everything

sharp geyser
quartz kindle
#

a spaceship doesnt have only 1 computer

sharp geyser
#

:o

#

Tim the space expert

quartz kindle
#

it has 4+ replicated computers

#

that correct each other in real time

wheat mesa
#

but it's gotten to a point where we let a chatting app take up 3000 times the amount of RAM that we put man on the moon with

sharp geyser
#

Tim any progress on ur astrology api?

quartz kindle
#

because of cosmic rays

wheat mesa
quartz kindle
wheat mesa
#

I guess with 4 it's so incredibly improbable that it would never happen

sharp geyser
#

rewrite it in assembly

quartz kindle
sharp geyser
#

you'll make massive progress

quartz kindle
#

lmao

#

airplanes have like 2 computers

#

to doublecheck all calculations

sharp geyser
#

calcilations

quartz kindle
#

am on phone

#

lel

wheat mesa
#

I guess those are situations where you can't afford to make computational mistakes

#

even if they're dream™️ level rare

sharp geyser
#

on the internet we love pointing out peoples misspellings but hate when it happens to us

quartz kindle
#

xD

quartz kindle
#

and in a super mario 64 speedrun

sharp geyser
#

Waffle I just found a game that sexualizes overwatch

#

Lord help me

rigid maple
wheat mesa
#

ain't no way

#

only in france

rigid maple
sharp geyser
#

Okay but why

rigid maple
#

I took a single sound recording as an experiment and decoded it and converted it to wav format and this worked

rigid maple
earnest phoenix
quartz kindle
lyric mountain
radiant kraken
lament rock
#

I ended up writing my own http client and god do I have a headache now. The difference between chunked and not is so... Breh

#

Also determining when to use chunked is annoying af

#

Discord shits its pants if I tell it that I want to send my json on the next packet

#

but I haven't tried multipart/form-data yet

#

oh and did I mention this is based off net/tls and zero dependencies

outer crater
#

Can we host kali nethunter gui with python http server or php ?

lament rock
# radiant kraken must be fun

it was so much fun trying to figure out how the client is supposed to know when the server was done sending packets in chunked encoding. I'm so glad that google had so little results for me to look through and still never really gave me an answer

sharp geyser
#

with C++

#

and share your code and results with me

#

:D

lament rock
#

what I found based off of Discord's responses is that each packet can be split by \r\n and then filtered through the array where only strings with a length > 0 can be in the Array and then take the last 2 entries in the Array. The first is the byte size and the second is the payload itself. Discard the rest of the chunk and push the remainder into the internal buffer if piping through a Transform stream

#

I guess it would suck if the payload itself had \r\n in it

#

but so long as Discord is consistent

rigid maple
dusky idol
#

I’ve a question. Is the “snipe” command against discord tos? The command which makes the bot impersonate a user & sends their last deleted message in chat.

earnest phoenix
#

Not really, just don't save every deleted message in a database krWriting

marsh bluff
#

What are some tools/file formats to create a multilanguage discord bot? Can I use Crowdin or something similar to it?

earnest phoenix
#

Crowdin is just to let others translate

#

You upload a file, for example JSON file and then translate online

#

Once it's translated in a language, you download the file for that language and then use it in your bot

neon leaf
#

Ok so I want users to create free subdomains, my API is in a docker container, whats the best way to accomplish this? I use Nginx so my Idea was to mount a subdomains folder to the API which writes configs in there for nginx to use, but then how do I load the configs without restarting nginx completely aka how do I even restart it from the container? Can I just mount /etc/init.d/nginx and then do /etc/init.d/nginx reload on the container?

boreal iron
#

You must provide the command options as array, that's not up to you

#

options:
[
{
type: 1,
name: "sub-command",
description: "..."
},
{
type: x,
...
}
];

#

Any item of the array contains the option structure which is just an object

#

In the example above the sub command option can also have an options key, passing sub command options as array of objects as value

earnest phoenix
#

Other than that there's no shorter way to achieve what you're trying to do

stuck dawn
#

I got this select i want to change the arrow icon to some like the calendar above and i want to know why is the color at the dropdown "transparent" and how can i change the dropdown style. Can someone help me?

slender wagon
#

hey guys i am back to postgress and i still have no clue what i am doing

earnest phoenix
#

https://sourceb.in/b3VIqWgSYa

This is my steal emoji command code. I wanna make the bot reply if the server has reached its emoji limit but instead of replying, my bot crashes. The try-catch and catch(err) also won't work, plz help me!

slender wagon
#

do you have an example of this but created with code, i am trying to leave the gui behind

wild thicket
earnest phoenix
#

have you tried reading the error

wild thicket
#

something to do with discord.js

earnest phoenix
#

no

#

your bots intents

wild thicket
#

intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.MessageContent
]

#

how do i do it then?

solemn latch
wild thicket
#

just have to manually turn it on..i thought admin has every access

#

thanks to you too @earnest phoenix

winter raven
#

sds

lyric mountain
#

that's how u declare table columns in sql

slender wagon
#

ah shit here we go again

quartz kindle
#

what lang lib you using? sql is its own lang, but the sql libs you use may have differences

earnest phoenix
# earnest phoenix ??

Format your code before sending it so others can read and help much easier, you can use <Promise>.catch() when creating the custom emoji and catch the error if any occurs, you can also check the boost level of the server with the <Guild>.premiumTier property and check the amount of custom emojis in the server by the <Guild>.emojis.cache.size property, and see if the maximum is reached or not

#

You need to hardcode the maximum amount of custom emojis yourself, and determine it by the boost level

earnest phoenix
#

I learn from d.js docs and YouTube

#

Made my own Handler and stuff

lyric mountain
#

in which case it'd do nothing since async happens outside of the context

#

that said, don't use exceptions for code flow, they're expensive to raise

earnest phoenix
sharp geyser
earnest phoenix
earnest phoenix
lyric mountain
#

yandev moment

earnest phoenix
#

and use switch cases

lyric mountain
#

most libs also include a guild.emoteLimit or something like that

#

and it wont return TIER_X, it'll just return 0, 1, 2 or 3

raw nest
#

Has anyone had this issue when running a docker container?

node:internal/errors:484
    ErrorCaptureStackTrace(err);
    ^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".sh" for /app/wait-for-backend.sh
    at new NodeError (node:internal/errors:393:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:79:11)
    at defaultGetFormat (node:internal/modules/esm/get_format:121:38)
    at defaultLoad (node:internal/modules/esm/load:81:20)
    at nextLoad (node:internal/modules/esm/loader:163:28)
    at ESMLoader.load (node:internal/modules/esm/loader:605:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
    at new ModuleJob (node:internal/modules/esm/module_job:63:26)
    at #createModuleJob (node:internal/modules/esm/loader:480:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
Node.js v18.12.1
radiant kraken
earnest phoenix
earnest phoenix
#

shrimple

raw nest
#

what you mean I can't import them?

earnest phoenix
lyric mountain
earnest phoenix
lyric mountain
#

unless djs for some fuckin reason decided to use strings for tiers

radiant kraken
#

ofc they will

#

in a minor update of course

earnest phoenix
#

yep

earnest phoenix
#

classic d.js™

#

@radiant kraken boo winforms

raw nest
earnest phoenix
pale vessel
earnest phoenix
#

premiumTier property no longer returns a number

lyric mountain
earnest phoenix
#

and hi flaz

lyric mountain
neon leaf
earnest phoenix
#

Oh wait it went from TIER_X to just numbers now

#

Just enums, discord.js inconsistencies™️

radiant kraken
#

minor update changes

earnest phoenix
#

😬

#

You should compare it with the Discord API types that comes with discord.js

import { GuildPremiumTier } from 'discord.js';

switch (<Guild>.premiumTier) {
  case GuildPremiumTier.Tier1: ...
  ...
}
lyric mountain
#

are u even paying attention to what we're talking abt or just waiting for a code to copy paste?

earnest phoenix
#

F
F

#

bet theyre gonna make events no longer accept a string

#

Events type already exists so lol

#

They're encouraging to use them

wheat mesa
#

I wouldn't have used strings in the first place anyways

#

Just makes it error prone

earnest phoenix
wheat mesa
#

Granted union types help a bit with that

neon leaf
#

whats the best way to make a browser start a long process (over 1 min) on a server and get notified when its done?

earnest phoenix
#

websockets

neon leaf
#

can I send an apk through websockets?

lyric mountain
#

hmm kinda

radiant kraken
#

yes

lyric mountain
#

both websockets and rest apis can only send one thing over network

#

bytes

#

apks are binaries, so u can send then, just make sure to checksum on both sides to assert integrity

#

while we're at that, everything is a binary, so anything presentable in a computer can be sent

earnest phoenix
#

@earnest phoenix you love? (revanced is making me go insane)

wheat mesa
#

everything is a rock that we tricked into thinking by pumping it with voltage

radiant kraken
#

what about objects

#

how do you serialize objects on the web

lyric mountain
#

just write a serializer

radiant kraken
#

you can't just stringify 'em

earnest phoenix
earnest phoenix
lyric mountain
#

u can, u just need to use a serializer or use json

earnest phoenix
#

you have to turn the apk file to arraybuffers and make the browser encode that and download it

radiant kraken
earnest phoenix
earnest phoenix
radiant kraken
#

i mean it's in ur github

#

so it's yours

slender wagon
lyric mountain
earnest phoenix
#

i only maintain helper which is closed sauce rn

rigid maple
earnest phoenix
#

nerdtrex
i should make one of my projects open source (ultimate compress 🗜️)

lyric mountain
#

open source is good

earnest phoenix
#

i mean i was going to but school and laziness

elder sentinel
earnest phoenix
# earnest phoenix Use the built-in `readdirSync()` method of the built-in `node:fs` module to read...
import { readdirSync } from 'node:fs';
import { join } from 'node:path';

const pathToDir = './my-dir';
const pathToDestDir = './out-dir';

let inputs = '';
let mapped = '';

const entries = readdirSync(pathToDir);
const len = entries.length;

for (let i = 0; i < len; i++) {
  const entry = entries[i];

  inputs += `-i ${join(pathToDir, entry)} `;
  mapped += `-map ${i} ${join(pathToDestDir, entry)} `;
}

const command = `ffmpeg ${inputs}${mapped}`;

...
earnest phoenix
lyric mountain
#

for (const i in entries)

sharp geyser
#

ffmpeg imagine

lyric mountain
#

or forof if u dont need the index

earnest phoenix
earnest phoenix
#

i wanna open source but school and laziness 🗿

#

also i think ill give up on the video conversion cuz it just takes too much space

earnest phoenix
#

like it gets bigger than the file that i turned into pixels

elder sentinel
earnest phoenix
#

and the frames

earnest phoenix
#

You can also override it to make your own iterators, pretty much any good language allows you to customize and create iterators like that

earnest phoenix
#

no like changing stuff then open source

#

Oh alright, have fun with that

#

When I do ```js
client.on('messageCreate', async (message) => {

if (message.mentions.has(client.user)) return message.reply({ content: Hey ${message.author.username}! Use </help:0> to view my commands})

});


I get this error- `client.on is not a function.`

Plz help
#

😦

elder sentinel
earnest phoenix
elder sentinel
earnest phoenix
#
  // Set the Bot status
  client.user.setPresence({ activities: [{ name: `/help | ${client.guilds.cache.size} Guilds` }], status: "idle" });```
earnest phoenix
earnest phoenix
earnest phoenix
# earnest phoenix v14.6.0

Your code is correct, however statuses take a while to change, and resolve your promise as <ClientUser>.setPresence() returns a promise

earnest phoenix
#

Okay, and that's how it's possible; resolve your promise and wait for a while for it to change

#

If the status doesn't change your code probably doesn't even run

earnest phoenix
#

Then try what I said

boreal iron
#

The API expects a number not a status string

#

djs doesn't convert strings anymore

#

@earnest phoenix jfyi

earnest phoenix
boreal iron
#

Errr yeah

#

Activities is the right word

#

He didnt provide a valid activity (not status) value

#

Man... im calling this status

earnest phoenix
boreal iron
#

It's not

#

The type is missing

earnest phoenix
#

If the activity type isn't provided it falls back to PLAYING

boreal iron
#

Which is required

#

Ah

earnest phoenix
#

They said that the activity changes in their case, just not the status

solemn latch
#

did you follow the troubleshooting guide?

#

Its listed on the npm page

#

yeah

boreal iron
#

But anyways since it's the status it doesn't matter anyways

earnest phoenix
#

Not in the discord.js code, the API falls back to it

boreal iron
#

Ah okay

#

Wasn't aware

earnest phoenix
#

Can you put the entire error in a bin and send it here?

lyric mountain
#

code

#

cuz I hope u didn't install the actual VS

earnest phoenix
#

It requires Visual Studio, which comes with the build tools needed

solemn latch
#

Its just vs build tools you need iirc

lyric mountain
#

oh

boreal iron
earnest phoenix
#

You shouldn't use the non-LTS releases of Node.js (19.1.0 in this case) in production, use the latest LTS release (18.12.1)

And it seems like it's looking for Visual Studio 2019 or something?

#
npm ERR! gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe ENOENT

This means that C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe doesn't exist, try going to that path to confirm if it exists or not

#

You're welcome

potent tiger
#

Ping me if eny one have some ideas. Thanks 🙂

#

I can't install even discord.js... i cant install anything 😅

sharp geyser
#

Looks like a node-gyp error but I could be wrong

#

Oh wait that tis replit

sharp geyser
lyric mountain
#

yep

potent tiger
#

Ehmm idk... But A magic happend 😄 I just deleted all npm modules and run the bot and noww everything is working 😂

neon leaf
#

funny question, is it possible to run bash scripts (and java apps from it) on windows? Im too lazy to port my script to windows

neon leaf
#

yeah but I want the average user to be able to run it, I think wsl is too complicated

lyric mountain
#

well, then port it

neon leaf
#

mh

lyric mountain
#

u can also write ur script in a cross platform lang like js or python

sharp geyser
#

or c++ /s

neon leaf
lyric mountain
neon leaf
#

tool to replace for example all occurences of "cool" with "uncool" in a file

lyric mountain
#

that's literally <string>.replace()

earnest phoenix
#

you can use git bash

sharp geyser
#

It does more than just replacing but yea

lyric mountain
#

just read the file -> replace -> overwrite file

neon leaf
#

lol

sharp geyser
#

You'd have to loop through the contents though to find the word you wanna replace unless I am just not thinking of a more efficient way

neon leaf
#

can I run tools like apktools, apksigner, etc using js on both platforms?

lyric mountain
#

probably, ig

#

js can call external apps, just like any other lang

sharp geyser
#

He'd have to bundle those apps with his though right?

#

Unless he wants people to install em themselves

earnest phoenix
#

use child_process for that

neon leaf
#

apktools and apksigner are java apps so no problem but zipalign may be

sharp geyser
#

I mean you could always have em install them themselves so

neon leaf
#

well I think the only thing I need is to know if the Javascript file was run on Windows or Linux / Mac, how do I know that?

earnest phoenix
#

os module

#

iirc os.platform func

sharp geyser
#

yea

neon leaf
#

win32 is windows then, id guess?

sharp geyser
#

well obviously

lament rock
#

channels.cache.get() no?

sharp geyser
#

I prefer using .fetch as it checks cache first before doing api calls

lament rock
#

djs caches just about everything regardless of if your pc is struggling with memory alloc

#

cache broadly means to store data somewhere you can easily access without having to request the data from the holder like in this case Discord

lyric mountain
#

cache is like a temporary storage for recently/commonly used data

#

to get stuff like channels or guilds, the library has to request from discord api, but doing that constantly would quickly reach ratelimits

#

so to prevent that, it "saves" recently fetched data instead of disposing of it instantly

lament rock
#

get your token reset speedrun any%

lyric mountain
#

cache is good, yes, but too much cache is equally bad since it'll use all your free space and reduce your app to a crawl

#

so it's important to fine tune the cache according to your usage

sharp geyser
#

Which is why djs doesn't cache all members at ready unless you tell it too

lyric mountain
#

which you absolutely shouldn't do

sharp geyser
#

that or they were too lazy shrug

lament rock
#

the real memory leak are presences, not GuildMembers

sharp geyser
#

I don't cache anything I just fetch the api all the time sunglas

lament rock
#

slash commands give me just about everything

#

I only cache users and their voice states

sharp geyser
#

You stalking their voices?

lament rock
#

music bot

sharp geyser
#

Do you record their voices like alexa and google?

lament rock
#

100

#

no

sharp geyser
potent tiger
sharp geyser
#

Idk, I just know it exists

lyric mountain
#

replit has an interface for installing packages

sharp geyser
#

I dont use replit but it has a built in package installer

lyric mountain
#

use it instead of cmd line

lament rock
#

inb4 sftp

potent tiger
lament rock
#

try debug logging like gateway messages

potent tiger
#

And there he stops 😅

potent tiger
lament rock
#

that's great and all, but says nothing Discord related

#

if you import modules in your files and catch errors when loading them, then might not be modules

#

might be the node you're hosting on is blocked

#

but debug log gateway messages before assuming

neon leaf
#

how do I make a select menu like in create-vite (cli)?

potent tiger
lyric mountain
#

that's not a log

#

tbh, I have no idea wtf that even is

potent tiger
#

Well it is something called logs 😂

#

Maybe can u come in to my replit and see the logs by ur self?

#

I have debugger active

#

but no errors it shows 🤷‍♂️

wheat mesa
potent tiger
wheat mesa
#

No

earnest phoenix
#

Help me

sharp geyser
#

Show code maybe

boreal iron
#

Well... respond accordingly to your interaction event

earnest phoenix
#
            label: "🤝 Support",
            description: "Click for Support",
            value: "six",
          },```
#
      .setTitle("🤝 Support")
      .setDescription(`
      Testing
      `)
      .setColor("GREEN");```
boreal iron
#

Non of that is a response

earnest phoenix
#

but on this part is not working

north nymph
#

You've created the embed, use it to respond with it

earnest phoenix
north nymph
#

Or whatever function you want of course, you can edit the message, reply to it, delete it, etc..

boreal iron
#

I have doubts... but do your thing

earnest phoenix
boreal iron
sharp geyser
#

it usually involves pesky php

boreal iron
#

Shhh little purple name

#

If php wouldn't be a thing you wouldn't be able to browser 50% of the web, or actually even more

sharp geyser
#

jokes on you

#

I dont enjoy surfing the web

boreal iron
#

Imagine a dark web without php but js instead freerealestate

#

I didn't say you enjoy it but we all need it unfortunately

#

sometimes

earnest phoenix
#

Fortunately PHP is not used much anymore, victory to the web! troll

boreal iron
#

At least more than 50% of the webservers still sending integrated php in their header

#

If we wanna trust statistics

earnest phoenix
#

I would say it's way less than that, I barely come across any websites or web servers that actually use/send PHP files as responses anymore

boreal iron
#

Oh wow

#

77%

#

More than 77% of the existing websites

#

I guess fuck you thrn

#

Errr 70,7% not 77 my bad

earnest phoenix
#

That's not right, probably old statistics; you can barely find any websites or web servers that does use it nowadays

north nymph
#

What is php topggAngry

sharp geyser
#

some ancient language

#

don't worry too much about it

#

only dinosaurs use it now

boreal iron
#

Im still speaking about webservers sending php headers

north nymph
#

oh

boreal iron
#

Not sure about websites itself tho

#

Guess that's not that easy to detect without like browsing any website

#

But only by clicking a few links regarding its market share I'm still surprised...
Seems to be far over 35% for websites

#

Probably caused by million of WordPress shops etc

sharp geyser
#

Wordpress best

earnest phoenix
#

WordPress still uses PHP?

boreal iron
#

Voltrex seems to think that any service out there is always up to date using the latest technology

earnest phoenix
#

I do not think like that, I heard that they migrated or something but it may not be true

boreal iron
#

Voltrex, I wanna bet that most of the visible infrastructure is built on fucking old technologies probably lots of them being outdated

earnest phoenix
#

Nope, it isn't

#

Only a couple of banks and governments use ancient software for obscure reasons, most of them these days don't even look back at that old software anymore

#

It also applies to countries that are not so technologically advanced and falling behind, and have no interest to upgrade whatsoever such as where I live, Iran

sharp geyser
#

Half our government facilities in the US still runs on vista I think

boreal iron
#

Xp over here yeah

#

Or vista, yes

earnest phoenix
#

Almost every single ATM I've seen here runs on like Windows Vista, 7, XP, or something way older

#

Or other stuff

sharp geyser
#

Windows 95 moment

boreal iron
#

Theres a lot of infrastructure which needs to be changed but it isn't touched to prevent large blackouts due to simple update issues

#

At least all the stuff that hasn't intentionally be replaced the last 10-20y

boreal iron
#

Nowadays newer developed systems and infrastructures might not have that issue anymore

sharp geyser
#

Welcome thunder, here in development we are talking about how lazy our government is

earnest phoenix
#

They do change stuff and maintain things behind the scenes but of course not so frequently, they usually do every month or 3 months or so

royal portal
#

ads

earnest phoenix
#

Just like large servers big companies maintain, it's usually a similar pattern

sharp geyser
#

I should buy a server rack and offer hosting plans

#

throwback tto when a guy tried to say you can have your account stolen with oauth

earnest phoenix
sharp geyser
#

voltrex caught in 4k

earnest phoenix
#

No wonder hundreds of ATMs were hacked like a few years ago

boreal iron
#

Fbi being informed right now

sharp geyser
#

Voltrex if you hack an atm make sure to route some money my way /s

earnest phoenix
#

Sure mmLol

sharp geyser
#

Okay so thunder brief explanation on what you need to do

boreal iron
#

Doesn't discord OAUTH has a relatively short session timeout?

sharp geyser
#

You will need 4 things, Client ID, Client Secret, Scope, and Callback url

boreal iron
#

I mean instead of storing the logged in user data and handling the OAUTH flow, a simply login/register and account management system is probably less work to do

sharp geyser
#

Indeed

#

idk why they wanna do discord stuff

#

No

#

By god no

boreal iron
#

Especially if those things aren't necessarily connected to each other

#

If you don't need the user account info in any way, why using discord login flow then?

sharp geyser
#

Are you going to bind anything o their account with this id for future use?

royal portal
#

token

boreal iron
#

What if somebody using your service doesn't have discord ?

sharp geyser
#

^

#

Use my service go make a discord account and come back sunglas

#

Anyone can visit your site

royal portal
#

nitro exclusive to create an account

sharp geyser
#

Then have a whitelist only system and just use their ips ez

royal portal
#

what if dynamic ip

sharp geyser
#

Oh well

#

Well I gtg

#

work calls

boreal iron
#

"Work"

#

What's even locked behind the registration requirement?

#

Registration -> email/password

#

And you will have an email, too

#

Like anybody can abuse it?!

#

Either with a discord account or fake registered account

#

Create a verification system

#

Only accepted registered users can use your service

#

A normal login isn't trustworthy

#

Wut

#

Well I'm using cookies and a remember mr checkbox to save user sessions to prevent multiple logins

#

In your words the need to enter passwords

#

brb

solemn latch
#

With discord releasing more features for bots, imo start with the bot first. It sounds like you know how to do that too.
Once you have that done you can move onto oauth and site stuff.

lyric mountain
#

postgres

royal portal
#

do you have a vps?!?!1

lyric mountain
#

it's pretty much sudo apt install postgres

#

that's it

#

u just need to setup users so u dont use root user for everything, but it'll come ready from the get go

#

just read some postgres quick start

#

there are a ton on the net

potent tiger
#

Here is a complete log... I cant install a important package called @discordjs/opus - Can some one help :0

lyric mountain
#

wtf is that

#

basic?

potent tiger
#

basic what...

lyric mountain
#

just a joke, for how every line has a number before it

#

but really, what the hell is that log

potent tiger
#

i did cat cmd to pull the complete log

#

like that 😄

#

but that is a error what keeps away from installing that dam package 😄

#

And iDk WhYYY

#

😭

#

helP

lyric mountain
#

I cant really help

potent tiger
#

o i did one ytb tutorial... SO basicly it needed to do this... I guess it didnt like some version or smthing of node ir smthing - idk... But now everything works 😄

lyric mountain
#

16 💀

radiant kraken
hasty mulch
#

How do I pass a bot instance as a parameter when initializing the class?

class PinRequestModal(discord.ui.Modal, title="Pin Request"):
    def __init__(self, bot: commands.Bot):
        super().__init__()
        self.bot = bot
surreal sage
#

Is there a way to do this in javascript?

const constant = "
    Text
"```?
pale vessel
#

self.bot watdafak

surreal sage
#

Sick

#

Just so idiots don't remove the quotes on accident yk

hasty mulch
surreal sage
#

Let's say you have 2 objects, see them as headers

One object are your standard http headers
user agent, host all of that

The other one are also headers but pre-defined

{"authorization":"123"}```

What would be the fastest and smallest way to make sure the keys and values in the second object are included and equal in the first object?
pale vessel
surreal sage
hasty mulch
pale vessel
# surreal sage Let's say you have 2 objects, see them as headers One object are your standard ...

use Object.entries() and Array.prototype.every(). make sure that the keys and values in the second object exist and equal to the ones in the first object

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every

Object.entries(preDefinedHeaders).every(([key, value]) => httpHeaders[key] === value)

boreal iron
#

every()?!

#

The new for each?

fallen holly
#
 
const user = await interaction.options.getString('name')
        const id = await interaction.options.getInteger('uid')



        const db = new QuickDB();
        await db.set("MemberInfo", { name: user, uid: id });
    


        const info = await db.get("MemberInfo");
        interaction.reply(({ content: `${info}` }));

it is replying object object
haven't coded in js in a while

#

soo this is for my friend team

He wants to add all the members info and display all the members and its info
and remove it if needed

boreal iron
#

First of all you don't need to await getString() or getInteger()
They aren't async functions, they just access the options

craggy pine
#

also correct me if I'm wrong but the ${} for your content is unnecessary if it's already going to be a string you should just be able to do content: info

boreal iron
#

info is shown as object since it actually is an object
The result of your database request returning the structure you have set

#

So if you wanna see the keys/properties it holds/you can access, just log the var info

craggy pine
#

Ik with my database by default it would be like this: thing[0].whateverImGrabbing

#

but that's mysql (maria DB)

boreal iron
#

Those generally return an array of your results, yes

#

But his request seems to return the result structure directly

craggy pine
#

yeah quickDB

#

whatever that exactly does

boreal iron
#

He must have created the structure before, so if he can't remember anymore, it makes sense to just log the result (info) to know which properties he wanna get

craggy pine
#

facts

boreal iron
#

Also i can see one () too much inside reply()

#

Not needed to nest another parentheses in there

craggy pine
#

Oh I have a mysql question if your familar with it

boreal iron
#

Flazepe would cry

#

Sure go for it

craggy pine
#
      let checkBal = await client.extends.database(`SELECT currency FROM user WHERE userid = ${message.author.id}`, false, true)
      let checkDuelBal = await client.extends.database(`SELECT currency FROM user WHERE userid = ${user.id}`, false, true)
#

Is there a way to make this a 1 line thing

#

same DB, just two different userIds

#

ignore false, true. It just means I am saving it to an variable.

boreal iron
#

Yes

#

WHERE userid = A OR userid = B

#

If I understood you right

craggy pine
#

well no

#

it's a like 1v1 thing so I need to save BOTH users currency

#

so I do need both at all times

boreal iron
#

The OR operator should work

#

It will return both rows

craggy pine
#

oh I assumed it would chose 1 or the other

#

I'll give it a try.

boreal iron
#

No you haven't set a limit

craggy pine
#

not at all

boreal iron
#

So it searches any result that matches either that or that or another one etc

#

When dealing with doubles you can also use this

#

WHERE userid IN(id, id, id)

craggy pine
#

AH ok ok

boreal iron
#

In this case the result would be the same

#

You will just have to use the OR operator when it comes to strings

craggy pine
#

Good 2 no.

#

Appreciate it

boreal iron
#

👍

craggy pine
boreal iron
#

Make sure your lib also handles bigints

#

accordingly

craggy pine
#

ye

boreal iron
#

Also make sure if an user id wasn't found you don't compare something with null or undefined etc

craggy pine
#

already had checks b4 this so were good 🙂

boreal iron
#

Always expect the unexpected

craggy pine
#

Do you think Math.random() > 0.5 is a good 50/50 odds chance thing.

boreal iron
#

Technically not exactly 50% as random() doesn't include 1 as result iirc

#

But 49,99999999...

craggy pine
#

lol

#

i think that's fair nuf

boreal iron
#

challenging yourself to get rich

#

Chance to win: >100%

craggy pine
#

heidiSQL

boreal iron
#

Just edit the value and add a few 0 behind

#

Issue solved

craggy pine
#

lol

#

MariaDB

#

or mysql really

boreal iron
craggy pine
craggy pine
boreal iron
#

Instead of copy and pasting any of its disadvantages you might wanna search em up yourself

#

Literally there's no reason to use that unmaintained beast of a big unfriendly buggy engine anymore

craggy pine
#

I never had any issues with it to be fair. Atleast for the reasons I use it.

boreal iron
#

When you can at least mariadb or postgres

craggy pine
#

ok well

#

I do use maria

#

so i guess im in the clear

#

I just assumed they were essentially the same thing since queries are literally the same.

boreal iron
#

They are mostly the same because they are all written in sql

#

Differences are just specifically to which database engine supports which features and which not

craggy pine
#

I c I c

boreal iron
#

The main difference between mariadb and MySQL is that the creator (of both) spends his time and love developing and improving mariadb instead of milking the cow like Oracle does, completely ignoring the user base and wishes and can't actually fix issues in their engine for the past 10y

#

You literally just don't wanna touch anything Oracle has its hands on

craggy pine
#

That's fair.

#

Yeah maria has been a good DB since I started using it.

boreal iron
#

It is and there aren't any fundamental differences to postgres

#

Just a bunch of features both engines support or not you need or not

earnest phoenix
#

Hey I am trying to make my bot reply if someone mention it.

Can anyone tell me that will this work?

const { MessageEmbed } = require ('discord.js');

module.exports = client => {

client.on('messageCreate', (message) => {

const mentionEmbed = new MessageEmbed()
.setTitle(`Hello ${message.author.username}!`)
.setDescription("To view my commands, use </help:0>")
.setColor('#4169E1');

if (message.mentions.has(client.user)) return message.reply({ embeds: [mentionEmbed]})

}); 

   }

Rn, I can't use my pc so if anyone don't mind plz try and tell me.

#

My discord.js version- 13.12.0

#

you shouldnt recreate mentionEmbed when messageCreate event is fired

earnest phoenix
charred roost
#

keeps smapping like this

#

every ~8 seconds

#

fixed

sharp geyser
#
#include <iostream>
#include <vector>

int n = 0;

std::vector<int> fibb()
{
    std::vector<int> sequence {};
    int t1 = 0, t2 = 1, nextTerm = 0;
    for (int i = 1; i < n; i++) {
        if(i == 1) {
            sequence.push_back(t1);
            continue;
        }
        if (i == 2) {
            sequence.push_back(t2);
            continue;
        }

        nextTerm = t1 + t2;
        t1 = i;
        t2 = nextTerm;

        sequence.push_back(nextTerm);
    }

    return sequence;
}

int main() {

    std::cout << "Enter number of terms: ";
    std::cin >> n;

    std::cout << "Fibonacci Series: " << std::endl;

    for (int nums : fibb())
        std::cout << nums << std::endl;
}
wheat mesa
#

So this could be simplified quite a bit

#

Keep in mind that the sequence starts like so: 1 1 2 3 5

#

So if you just start with a vector of [1, 1], then you can just sum the two previous terms to get the next term

sharp geyser
#

I thought it started with a 0

wheat mesa
#

ok yeah

#

whatever

#

same concept

sharp geyser
#

:^)

wheat mesa
#
std::vec<int> vec = [0, 1];
for(int i = 2; i < howeverManyTermsYouWant; i++) {
  int firstTerm = vec[i - 2];
  int secondTerm = vec[i - 1];
  vec.emplace_back(firstTerm + secondTerm);
}
``` some pseudocode for the basic idea
sharp geyser
#

emplace_back?

#

whats the difference from push_back interesting

#

ima google it

wheat mesa
#

same function

#

emplace_back is faster iirc

sharp geyser
#

seems to be the same thing yea

sharp geyser
#

😔

#

My code was indeed bloated

#

Works perfect

wheat mesa
#

now if you want to make it REALLY bad you can use recursion 😉

sharp geyser
#

Do you have time to explain how it works

#

if not thats fine

wheat mesa
#

The fibonacci sequence is just the previous two numbers added together

#

First numbers: 0 1 1 2 3 5
0 + 1 = 1
1 + 1 = 2
2 + 1 = 3
2 + 3 = 5

sharp geyser
#

Oh wait

#

nvm I get how it works

#

first term is vec[i - 2] since i starts out as 2 it'd be 0, and second is vec[i - 1] would would be one so yea nvm it makes sense

wheat mesa
#

Yup

sharp geyser
#

I couldn't visualize it for a second

#

Also waffle no school tomorrow for me again

#

fucking buss route cancelled once more

wheat mesa
#

damn

#

I'm off the whole week for break

sharp geyser
#

mf school fucking with my education man

#

I dont like it

wheat mesa
#

more time to learn c++

sharp geyser
#

Im doing what I can from home with my homework

wheat mesa
#

now learn templates ferrisWink

sharp geyser
#

but they don't exactly notify me on canvas with homework as majority of the classes I take do it in person

wheat mesa
#

😔

sharp geyser
#

tbh we don't even have homework thats assigned

#

is just whatever we didn't complete in class KEKW

sharp geyser
wheat mesa
#

C++'s version of generics

#

The fabled error messages

sharp geyser
#

Simple ?

#

Why do you make it sound so bad waffle

#

its simple

wheat mesa
#

Yeah it's simple

sharp geyser
#

is it actually?

wheat mesa
#

definitely

#

it's not that hard but the errors are horrendous and they can be finicky

sharp geyser
#

oh linker errors

#

anything from the linker is horrendous i've learned

wheat mesa
#

not necessarily just the linker errors

#

the compiler errors are pretty bad with it

sharp geyser
#

so far the compiler has been pretty nice

#

Also waffle did I tell you my ambition to make my own game editor in c++ if I feel like it after learning enough c++

earnest phoenix
#

imagine not modifying winpe

wheat mesa
#

this is not a joke with template errors

wheat mesa
#

it'll be a lot of work

#

but definitely a good project

sharp geyser
wheat mesa
#

there's some horror stories with templating errors

sharp geyser
#

I am regretting c++ now

wheat mesa
#

let's just leave it at "they're not pretty" for right now

sharp geyser
earnest phoenix
sharp geyser
#

nah

wheat mesa
#

you'll cross that bridge when you get to it

sharp geyser
#

I am pursing c++ heavily rn

earnest phoenix
#

@radiant kraken you know what to do

wheat mesa
#

null loves C though too

sharp geyser
#

I plan on making a triple A game by the end of 2025

wheat mesa
#

that might be a little too ambitious lol

sharp geyser
#

it was a joke

earnest phoenix
wheat mesa
#

AAA games are not solo developer teams

#

good

#

lol

sharp geyser
#

You think I got that?

earnest phoenix
#

good luck

wheat mesa
#

C++ and rust are good to know

sharp geyser
#

At best it will be a single A game KEKW

wheat mesa
#

rust because it's clean but low level and C++ because it's common and low level

sharp geyser
#

can you go lower than C++?

earnest phoenix
#

C

sharp geyser
#

without breaking your neck

earnest phoenix
#

assembly

sharp geyser
#

without breaking your neck

earnest phoenix
#

yea no

wheat mesa
#

Machine code

#

I’d say yes

sharp geyser
#

waffle I dont think you understand me

#

I said without breaking your neck

wheat mesa
#

Fortran

sharp geyser
#

Also wasn't there this super popular game that was made purely in assembly

earnest phoenix
#

@sharp geyser make an os in c++ NOW

sharp geyser
#

thats speedy's thing not mine

earnest phoenix
sharp geyser
#

It was a modern game

wheat mesa
#

Not on the scale of roller coaster tycoon though

sharp geyser
#

or a more modern game

radiant kraken
#

Rust > C > C++

sharp geyser
#

Objective-C best

wheat mesa
#

C++ has a lot of stdlib bloat

radiant kraken
#

so true

earnest phoenix
#

time to die

radiant kraken
#

C is just plain simple and straight to the point

wheat mesa
#

I think rust has the correct approach for libraries

earnest phoenix
#

JS > *

sharp geyser
#

So should I be learning C over c++ then 🤔 /s

earnest phoenix
#

yes

radiant kraken
#

yes

earnest phoenix
#

and suffer

wheat mesa
#

The stdlib in rust is very small but gets the basics done, then you use crates for smaller things

sharp geyser
#

no

wheat mesa
#

No

radiant kraken
#

but you have to do everything from the ground up

earnest phoenix
wheat mesa
#

I don’t think it’s worth learning C over C++ at this point

radiant kraken
#

like dynamic arrays and strings

earnest phoenix
#

thats suprising

sharp geyser
wheat mesa
#

Learn C after C++

radiant kraken
#

but what i love about C is it's simplicity

wheat mesa
#

It’s very simple which is a gift and a curse

sharp geyser
#

strings in C are a myth

wheat mesa
#

Because you have to start thinking about things you wouldn’t normally think of

radiant kraken
#

no

wheat mesa
#

Strings in every language are a myth

radiant kraken
#

char * iara_sunglasses_cool

sharp geyser
#

isn't that how you had to do it in c++ ffor a long time?

wheat mesa
#

A string doesn’t even exist

radiant kraken
#

just an array of numbers, since everything in C is a number/byte

wheat mesa
#

Everything is just electrons flowing through the wires in your computer

#

😉

sharp geyser
#

Fun fact waffle is not real

#

He's an AI I made

radiant kraken
#

Fun fact waffle is edible

earnest phoenix
#

am bored

wheat mesa
#

So true

sharp geyser
#

I mean

#

technically everything is edible if you got the willpower

wheat mesa
#

Honestly though keep learning C++

#

You won’t regret it

radiant kraken
#

won't sure2

sharp geyser
#

Ima become one of those basement dwelling c++ nerds

#

aka waffle

wheat mesa
#

If you learn C++ then you’ve basically already learned C

#

Just have to think about the smaller structures that aren’t available to you if you’re using C

radiant kraken
#

i just love the fact that everything is a number/bytes in C

sharp geyser
#

I've learned with C++ I am more interested in how the data is stored and works more than anything else

#

with C++ I am actually focusing on optimizations

radiant kraken
#

i love structure-based and pointer-based things

wheat mesa
#

Don’t worry about optimizations too much

#

Learn how pointers and references and the features of the language work first

#

Then you can worry about making things super fast

sharp geyser
#

Super sped

radiant kraken
#

not as blazingly fast™️ as Rust though

#

🚀

wheat mesa
#

True!!

sharp geyser
#

C++ is faster than the speed of light wym

radiant kraken
#

but Rust is miles beyond that!!!!!!!!!!!!!!!!!

sharp geyser
#

look at me not even a full day of work using c++ and I am already defending it

#

waffle what have you done to me

wheat mesa
#

To move one value into a register on your CPU, it takes the same amount of time it takes light to cross a standard 17” laptop screen

sharp geyser
#

😔

wheat mesa
#

It’s fascinating how fast it is

sharp geyser
#

c++ that fast?

wheat mesa
#

That’s really fast 😭

radiant kraken
#

saw that misty

sharp geyser
#

I didn't even delete it

#

💀

radiant kraken
#

oh some mod lurking probably deleted it

sharp geyser
#

that was quick

#

probably nom

#

she has no life

radiant kraken
#

so rude

sharp geyser
#

she called me an idiot earlier

#

it is deserved

wheat mesa
radiant kraken
#

sorry i don't speak inches

wheat mesa
#

Like 40cm

sharp geyser
#

Okay you metric boy

radiant kraken
#

metric >>>

sharp geyser
#

At this point ima just make a bot that calculates conversions

#

Just so I can talk to null

#

foreigner

radiant kraken
#

ew american

sharp geyser
#

Time to move to nulls house

wheat mesa
sharp geyser
#

Lmao using fucking decimals

radiant kraken
sharp geyser
#

Should I spend my time making a bot that calculates conversions or continue working on c++

wheat mesa
#

C++

sharp geyser
#

bot it is /s

radiant kraken
#

bots are boring

wheat mesa
#

The other one would just be argument parsing busy work while looking up conversion formulas

radiant kraken
sharp geyser
#

I will eventually

#

rn I am trying to make it so the exe window doesn't close immediately after smh

wheat mesa
#

There’s a solution online for that

radiant kraken
#

what are you making

sharp geyser
#

fibb thingy

#

First c++ project might as well make it smth special

#

even tho waffle pretty much gave me the asnwer

#

hmph

radiant kraken
#

just make the program wait for a character input in stdin

#

that's what almost every programming tutorial in a compiled language does

sharp geyser
#

std::cin.get() is what I am doing

radiant kraken
#

yes

sharp geyser
#

but it no work

radiant kraken
#

why

#

send code

sharp geyser
#
int main() {

    std::cout << "Enter number of terms: ";
    std::cin >> n;

    std::cout << "Fibonacci Series: " << std::endl;

    for (int nums : fibb())
        std::cout << nums << std::endl;

    std::cin.get();
}
radiant kraken
#

what's fibb

sharp geyser
#

I assumed adding it at the end would be that it would wait

#
std::vector<int> fibb()
{
    std::vector<int> vec {0,1};
    for (int i = 2; i < n; i++) {
        int firstTerm = vec[i - 2];
        int secondTerm = vec[i - 1];
        vec.emplace_back(firstTerm + secondTerm);
    }

    return vec;
}
radiant kraken
#

isn't it push_back

sharp geyser
#

emplace_back does same thing as push_back

radiant kraken
#

oh

sharp geyser
#

waffle said emplace_back is faster tho so

radiant kraken
#

what's n tho

sharp geyser
#

whatever they pass

#

n could be anything thats a number

radiant kraken
#

yes but where is it stored

#

i don't see any declaration of n

sharp geyser
#

outside both functions as a "global"

#

idk if thats what its considered

radiant kraken
#

why global

#

just pass it as an argument

sharp geyser
#

cause I wanted it to be null

#

😔

#

and I also didn't think about passing it as a arg

radiant kraken
#

that's bad practice

#

try passing it as an arg and see what happens

sharp geyser
#

will running cmake build again rebuild the project or?

radiant kraken
#

try running cmake build again

sharp geyser
#

I did and it just says they have been written to build

#

but nothing changed so I was curious

#

still exits immediately

radiant kraken
#

remove the build directory and re-run everything again

#

or just use g++, you don't have to use cmake for a small c++ project

sharp geyser
#

Still no

#

g++ is not a cmd since i haven't added it to path

#

too lazy to do it as well

radiant kraken
#

oh

#

the problem is in std::cin.get()

sharp geyser
#

huh

radiant kraken
#

@sharp geyser use getch(); from conio.h

sharp geyser
#
Enter number of terms: 100
Fibonacci Series:
0
1
1
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765
10946
17711
28657
46368
75025
121393
196418
317811
514229
832040
1346269
2178309
3524578
5702887
9227465
14930352
24157817
39088169
63245986
102334155
165580141
267914296
433494437
701408733
1134903170
1836311903
-1323752223
512559680
-811192543
-298632863
-1109825406
-1408458269
1776683621
368225352
2144908973
-1781832971
363076002
-1418756969
-1055680967
1820529360
764848393
-1709589543
-944741150
1640636603
695895453
-1958435240
-1262539787
1073992269
-188547518
885444751
696897233
1582341984
-2015728079
-433386095
1845853122
1412467027
-1036647147
375819880
-660827267
-285007387
-945834654
-1230842041
2118290601
887448560
-1289228135
-401779575
-1691007710
-2092787285
511172301
-1581614984
-1070442683
1642909629
572466946
-2079590721
-1507123775
708252800
-798870975
-90618175
-889489150

Oh?

#

fibonacci goes into negative?

earnest phoenix
#

nop

#
0
1
1
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765
10946
17711
28657
46368
75025
121393
196418
317811
514229
832040
1346269
2178309
3524578
5702887
9227465
14930352
24157817
39088169
63245986
102334155
165580141
267914296
433494437
701408733
1134903170
1836311903
2971215073
4807526976
7778742049
12586269025
20365011074
32951280099
53316291173
86267571272
139583862445
225851433717
365435296162
591286729879
956722026041
1548008755920
2504730781961
4052739537881
6557470319842
10610209857723
17167680177565
27777890035288
44945570212853
72723460248141
117669030460994
190392490709135
308061521170129
498454011879264
806515533049393
1304969544928657
2111485077978050
3416454622906707
5527939700884757
8944394323791464
14472334024676221
23416728348467685
37889062373143906
61305790721611591
99194853094755497
160500643816367088
259695496911122585
420196140727489673
679891637638612258
1100087778366101931
1779979416004714189
2880067194370816120
4660046610375530309
7540113804746346429
12200160415121876738
19740274219868223167
31940434634990099905
51680708854858323072
83621143489848422977
135301852344706746049
218922995834555169026
sharp geyser
#

Why the hell is mine in negative then

#

the math looks correct

#

whatever I can't be bothered anymore

#

Ima go look into pointers and reference

earnest phoenix
#

int has a max value, which is 2147483647

#

So you have an overflow when adding 1134903170 to 1836311903, that is when you first get a negative value

sharp geyser
#

Ah right