#development

1 messages · Page 197 of 1

lament rock
#

refresh your client since it might be a client bug

sterile lantern
#

also tried it on mobile, doesnt work its data, not body facepalm

earnest phoenix
#

and how would I use ts-node? Can I use it without the runtime extension?

sharp geyser
#

huh

#

you just use it like normal?

#

You don't put the file extension because that will also compile down to js and it will try and import the ts file rather than the js one

frosty gale
#

typescript doesnt do anything during runtime?

#

tbf typescript could be much better if it also enhanced regular javascript

#

theyve made it clear ts is only for type checking and safety but if they also optimized the js that would be cool

#

for example enums in ts simply compile down to an object, thats terrible in my opinion, it should just replace all references of said enum with the actual value like it is in basically every language

#

otherwise youre costing an unnecessary object lookup each time

acoustic bough
#

I like typescript but I’ve been moving more and more to Go-lang

#

it’s weird writing typescript which just gets compiled to javascript and then JIT compiled

frosty gale
#

yeah i get that feeling

#

it also doesnt help that javascripts whole purpose is to be a completely dynamic language with no strict structures or types in place

#

by using typescript youre in a way taking that away and slowing down development with basically no performance benefit

#

the only benefit is reduced runtime bugs and more clearer intellisense and syntax

#

i do use it occasionally and i like it but for any sort of fast development or sudden ideas id stick to javascript

harsh aspen
#

JS FTW!!!

quartz kindle
#

js with ts annotations via jsdoc

#

best of both worlds

#

thats what i've been using for the past couple years and i absolutely love it

#

you get full type safety and intellisense and still write pure js

frosty gale
golden coral
#

Hello, im using the topgg webhook to get when someone votes for my bot

#

But for some reason I get multiple requests when I vote once for my bot

#

Any ideas on that?

slim heart
#

it’ll retry

#

are you using a library or just doing it yourself

quartz kindle
#

vsc does that natively if you have typescript installed

#

pure jsdoc has its own type annotation system, which is slightly different from ts

golden coral
#

So I just return 200

#

With empty body?

slim heart
#

whatever you’d like

golden coral
#

k

frosty gale
#

dont like it personally

#

id want something typescript has or any other typed language

#

makes it less obvious that im annotating every line of code

quartz kindle
#

i dont need to annotate every single line

#

mostly just functions/methods and a few things here and there for type enforcing/converting

eternal osprey
#

hey guys

#

how do i create my own programming language

#

i got some spare time, a very good understanding of assembly and i assume that i will need assembly to handle all the actions, and i basically bind the raw assembly actions to the higher level language i will create.

#

i might be wrong

lyric mountain
#

waffle is the only weirdo I know here that tried to make one

sharp geyser
#

or you can use an already made language to make one

frosty gale
#

id stick with interpreted

#

although LLVM toolchain helps a lot with this stuff

#

but then id argue youre not getting the full lang dev experience if youre using LLVM which does 90% of the heavy lifting for you

eternal osprey
#

Nah I really want to go all out

#

Start from scratch

#

I already got a start by creating a tokenizer and language interpreter. I am using Java for now

#

Assembly had not that much support from what I found

frosty gale
#

if you play your cards right you can get something working

#

you just need to keep track of your variables so you can emit assembly that allocates space on the stack at the beginning, keeps track of the location of them on the stack for code that uses those variables, etc

frosty gale
#

so you refer to the variables with the correct offsets since pushing new variables and doing stuff changes that offset constantly

sharp geyser
#

Just use llvm fuck it mmLol

#

Why not use up 60gb of space on your drive

wheat mesa
#

Creating your own compilation toolchain to assembly is hell. Don’t do it unless you want to go down that rabbit hole. LLVM and Cranelift exist for a reason, as they’re platform independent for the most part

#

If you want to do something low level like that, make a stack based or register based VM

#

That way you can compile down to your own bytecode format and it’s still platform independent

lyric mountain
#

unless you want to go down that rabbit hole
inb4, chitty goes down the rabbit hole

sharp geyser
#

He will

#

He’ll learn a lot on not to do it

frosty gale
#

rarely anything innovative happens from avoiding difficult things

#

i would strongly recommend giving a compiler&lang from scratch a shot but its your choice really

#

depends on what you envision your end goal as and what you wanna focus on

#

although I'd recommend getting a language foundation in place in terms of syntax and tracking things before you even touch compilation or running it

elder dock
#

how to add photo in description

lament rock
#

I'll assume you mean in an embed on Discord. It isn't in the description field, it's in the image field

surreal sage
#

actively denying discord's tos changes

frosty gale
#

on a side note terms of services nowadays are awful

#

companies put whatever they want in it because they know only 1 out of 100 odd people will read it

#

and things like forced arbitration that prevents them from being sued directly is completely legal and enforceable, rossman should focus on the fact its even legally enforceable rather than companies taking advantage of it

#

because why wouldnt you if its a ticket out of being sued easily

#

absolutely ridiculous that this clause doesn't go both ways so the company can sue you but you cant

lament rock
#

Some malicious actors abuse the ability to sue a company even if the case is frivolous inducing totally avoidable court fees and wasted time. Meanwhile yeah some companies abuse their own terms instead of using it for what was likely intended for good will

frosty gale
#

you would still get arbitration fees though? arbitrator has to be paid somehow

#

probably less than court fees but still

#

i think most companies pay for the arbitrator themselves in full which puts bias in question

#

but then again a whole point of an arbitrator is to be an unbiased judge so i would doubt theyre this corrupt

#

arbitration only limits the worst outcome really

harsh aspen
#

I agree

surreal sage
#

even on mobile

#

(love gestures)

frosty gale
frosty gale
#

theyll force you eventually to agree or sign out

#

actually another stupid thing

#

i dont think you can cancel your nitro subscription without agreeing to the terms

#

youd have to email them to cancel it for you without agreeing to their terms

#

by the time they reply youll prob be charged for another month

lament rock
#

Been working on a game. I have a few days of dev time in it. Just a few.

radiant kraken
lament rock
#

Well. I won't exactly specify what type of game it is as someone hasn't really done anything similar but I can give some story expo

#

Why it matters is I don't want people stealing my idea

radiant kraken
#

sure

lament rock
#

The game will have you traverse through either one of two main settings; A futuristic-ish city and the other being in a clearly lost to time outskirts beyond city walls. Beyond the city walls, an oppressed group is outcasted, fending for their lives in the wilderness against hostile creatures. Meanwhile, the mostly rich populous live safe and lavish lives within the walls. A mother has a child with one who was outcasted and the secret police learn of this and forcibly seize the child and cast them to the wilderness to essentially die. What becomes of the mother is unknown. The main character is the child and they survive by integrating with a group beyond the walls. They were old enough to know of the whole thing and plan to reunite with their mother somehow but perhaps can achieve some payback in the meantime

#

The goal is to also meet other people and be able to play as them with each having their own quirks and abilities.

harsh aspen
lament rock
#

Good for you, kid

#

A bit of paraphrasing was done to be ambiguous enough

surreal sage
#

totally

#

hippity hoppity modal get the fuck off my property

lyric mountain
#

dont remember which one was it tho

craggy pine
queen needle
#

I have this chart, and instead of trying to constantly decipher through it, I want to make an app to show each question and give yes or no and correctly follow the path depending on my answer. The only part I'm a bit confused about per se is the best way to handle the logic of making sure you're on the right question and making the right question is shown depending on your answer from the previous. My first thought was either some giant object thing or a bunch of if statements but I felt that wasn't the best efficiency wise and also really easy and I feel like there are a few more challenging and more efficient ways to handle this. One that came to mind was a sort of "permission bit field" system, where you need the permission to view each question, to ensure you're given each after each correctly. I was wondering how would you handle something like this? Most efficient way? Stuff like that.

quartz kindle
queen needle
#

As in like js { question: "", yes: {...}, no: {...} }

quartz kindle
#

pretty much yes

#

but you dont need to build the entire object at once

#

you can build the object step by step, that way you can reuse things if needed, as references

queen needle
#

so my state would be the current question, which holds the yes and no states, and then depending on my answer update state including those values accordingly so I only have store the question and answers?

quartz kindle
#

yup

#

it also supports circular questions, if you ever wanna add that xd

queen needle
#

I had a similar idea to that but my issue with it was that I then have to store the yes and no response, I was trying to just have a definition of all questions and say to any given one if they answered true or false and then depending I want to display the next question

quartz kindle
#

since all questions have 2 possible results, you can indeed store every single answer as 1 or 0

#

and from there have all the results in a single place

#

the only con is that is less flexible, you cant easily change/reorder stuff without redefining the bitfield structure

queen needle
#

ill see how the bitfield ideas faires and ask any questions, thank you!

limpid rain
#

Hi

deft wolf
#

Yo

eternal osprey
#

unity is so fucked

#

i wish you luck

sterile lantern
#

has anyone had an issue where autocomplete value is returning as the name instead of the actual value? some of my users are experiencing it, and i cant seem to reproduce it either

(it was reported a few times and apparently was fixed but it is still happening so idk; https://github.com/discord/discord-api-docs/issues/4536)

lament rock
fickle flare
#

wtf

real rose
#

wtf

fickle flare
real rose
#

reach out to the BR if you have questions

fickle flare
fickle flare
#

@real rose

#

You Resours github

#

is my bot

sharp geyser
#

People have to use npm packages for giveaway features now

solemn latch
sharp geyser
#

bro its dumb tho

#

😭

frosty gale
#

only problem is these packages tend to be shit

#

but issue in this is it likely hooks to the discord js client and has it's own command and event handlers with little customization which makes it a bad clone

deft wolf
#

The problem with such packages, in my opinion, is that they either do not contain a database at all and operate on cache memory or they use JSON files as a database like this discord-giveaways package

#

Many people will not want to implement their database into this package

frosty gale
#

but its moreso aimed at people that are very new and dont know what theyre doing so not surprised

lament rock
#

I always write low level wrappers to avoid idiots like that

frosty gale
#

i installed the same kinds of packages when i started out so can i blame them

#

(they barely worked most of the time)

quartz kindle
#

:^)

frosty gale
#

i am aware

#

i looked through the code of one and it was abysmal

#

at least 10 vulnerable entry points for prototype pollution

surreal sage
#

is 110 mb/s good for a hdd? 😭

lyric mountain
#

you dont put "good" and "hdd" in the same sentence

radiant kraken
civic scroll
#

else you will have to wait for quite a while

surreal sage
civic scroll
queen needle
# quartz kindle well, your idea of a bitfield is not bad
export enum QuestionPermission {
    InitialQuestion = 1 << 0,
    PluralQuestion = 1 << 1,
    NegativeQuestion = 1 << 2,
}

enum Question {
    Initial = "Are referring to a specific thing or saying you like/dislike something in general?",
    Plural = "Is it plural?",
    Negative = "Is it negative?",
    End = "End of questioning",
}

export class Word {
    private permissions: number;
    private endPermission: number;
    private questionMap: Map<QuestionPermission, string>;

    constructor() {
        this.permissions = 0;
        this.endPermission = 1 << Object.keys(QuestionPermission).length;
        this.questionMap = new Map([
            [QuestionPermission.InitialQuestion, Question.Initial],
            [QuestionPermission.PluralQuestion, Question.Plural],
            [QuestionPermission.NegativeQuestion, Question.Negative],
            [this.endPermission, Question.End],
        ]);
    }

    get bits(){
        return this.permissions
    }

    answer(question: QuestionPermission) {
        this.permissions |= question;
    }

    access(question: QuestionPermission): boolean {
        return (this.permissions & (question - 1)) === (question - 1);
    }

    get(): string {
        for (let [permission, question] of this.questionMap as any) {
            if (this.access(permission)) {
                return question;
            }
        }
        return "Invalid question";
    }
}
``` i'm trying to get a basic implementation, but for some reason the question doesn't update ```tsx
export default function Home() {
  const word = new Word();
  const [question, setQuestion] = useState(word.get())
  useEffect(() => {
    setQuestion(word.get())
    console.log("changed")
  }, [word.bits])
  return (
    <div className="flex flex-col gap-3">
      <button onClick={() => {
        word.answer(QuestionPermission.InitialQuestion)
      }}>Click</button>
      {question}
    </div>
  );
}``` I printed the values from answering and the permissions
#

and it is valid

lyric mountain
#

can you even listen to object properties?

#

like, with useEffect, idk if it'll receive the update notification if not the variable but a property was updated

#

also you can for (const instead of let if you never change those values

queen needle
# lyric mountain like, with useEffect, idk if it'll receive the update notification if not the va...
"use client"
import { QuestionPermission, Word } from "./utils/bitfield";
import { useEffect, useState } from "react";

export default function Home() {
  const word = new Word();
  const [question, setQuestion] = useState({
    number: 0
  })
  useEffect(() => {
    // setQuestion(word.get())
    console.log("changed")
  }, [question.number])
  return (
    <div className="flex flex-col gap-3">
      <button onClick={() => {
        // word.answer(QuestionPermission.InitialQuestion)
        setQuestion({number: question.number + 1})
      }}>Click</button>
      {question.number}
    </div>
  );
}
#

this seems to work

#

Like it logs changed everytime

lyric mountain
#

did you try putting the console.log before the setQuestion?

#

maybe it's looping

#

or try using the raw variable instead of a getter

#

like, expose permissions

queen needle
#

What do you mean?

lyric mountain
#
useEffect(() => {
    console.log("changed")
    setQuestion(word.get())
}, [word.permissions])
queen needle
lyric mountain
#

yes

#

I answered to that one

#

atm you're using ```js
get bits(){
return this.permissions
}

#

cut the middleman and try to use it directly

queen needle
#

ohhh so change permissions to public and try it, that yields the same result

lyric mountain
#

did you try it?

#

also put the console.log before the setter, so we can know whether it's looping infinitely

queen needle
#

Yes, i did both of those, the changed isn't logged after i've clicked the button

#

I tried storing the permissions in a state on the page but still not getting it to work

lyric mountain
#

perhaps the issue is with ```js
// word.answer(QuestionPermission.InitialQuestion)
setQuestion({number: question.number + 1})

queen needle
#

I think my bitfield logic is wrong

#
export class Word {
    private endPermission: number;
    private questionMap: Map<QuestionPermission, string>;

    constructor() {
        this.endPermission = 1 << Object.keys(QuestionPermission).length;
        this.questionMap = new Map([
            [QuestionPermission.InitialQuestion, Question.Initial],
            [QuestionPermission.PluralQuestion, Question.Plural],
            [QuestionPermission.NegativeQuestion, Question.Negative],
            [this.endPermission, Question.End],
        ]);
    }

    get(state_permissions: number): string {
        for (const [permission, question] of this.questionMap as any) {
            console.log(state_permissions, permission)
            if ((state_permissions & permission) === state_permissions) {
                return question;
            }
        }
        return "Invalid question";
    }
}
#

when i click it logs 1 1 so their the correct bits, but it still returns the wrong question

lyric mountain
#

oh wait, yes it's wrong

#

(bitfield & flag) == flag, ur comparing with bitfield

#

so like, instead of (0b110 & 0b10) == 0b10 // masked out the rest ur doing (0b110 & 0b10) == 0b110

#

which will never be true

#

I mean, it will, but not when you want it to be

#

in that example it'll say true for the 6th question, while ur checking for the 2nd

queen needle
#

so it should be state_permissions(the permisisons presently had) & permission(the permission i'm checking if it has)) == permission

lyric mountain
#

yes

#

always compare with the mask itself

#

u could also just !!(state_permissions & permission) since ur in js/ts

queen needle
#

Now it always returns invalid question

lyric mountain
#

as 1 is truey

queen needle
#

oh wait

#

i'm still doing something wrong it seems, ```ts
export enum QuestionPermission {
InitialQuestion = 0,
PluralQuestion = 1 << 1,
NegativeQuestion = 1 << 2,
}

enum Question {
Initial = "Are referring to a specific thing or saying you like/dislike something in general?",
Plural = "Is it plural?",
Negative = "Is it negative?",
End = "End of questioning",
}

export class Word {
private endPermission: number;
private questionMap: Map<QuestionPermission, string>;

constructor() {
    this.endPermission = 1 << Object.keys(QuestionPermission).length;
    this.questionMap = new Map([
        [QuestionPermission.InitialQuestion, Question.Initial],
        [QuestionPermission.PluralQuestion, Question.Plural],
        [QuestionPermission.NegativeQuestion, Question.Negative],
        [this.endPermission, Question.End],
    ]);
}

get(state_permissions: number): string {
    for (const [permission, question] of this.questionMap as any) {
        if ((state_permissions & permission) === permission) {
            return question;
        }
    }
    return "Invalid question";
}

}
i made the inital 0 so it shows first,ts
"use client"
import { QuestionPermission, Word } from "./utils/bitfield";
import { useEffect, useState } from "react";

export default function Home() {
const word = new Word();
const [permissions, setPermissions] = useState(0);
const [question, setQuestion] = useState(word.get(permissions))
useEffect(() => {
setQuestion(word.get(permissions))
}, [permissions])

return (
<div className="flex flex-col gap-3">
<button onClick={() => setPermissions(QuestionPermission.PluralQuestion)}>
Click
</button>
<p>{question}</p>
</div>
);
}

lyric mountain
#

not 0

#

which is 1

#

1 << 1 is 2

queen needle
#

thank you

#
"use client"
import { QuestionPermission, Word } from "./utils/bitfield";
import { useEffect, useState } from "react";

export default function Home() {
  const word = new Word();
  const [permissions, setPermissions] = useState(QuestionPermission.InitialQuestion);
  const [question, setQuestion] = useState(word.get(permissions))
  useEffect(() => {
    setQuestion(word.get(permissions))
  }, [permissions])

  return (
    <div className="flex flex-col gap-3">
      <button onClick={() => setPermissions(QuestionPermission.PluralQuestion)}>
        Click
      </button>
      <p>{question}</p>
    </div>
  );
}
``` works nicely
#

How could I add bits, instead of setting them?

#

since i have a few questions that appear more than once, and I don't want to make each one a different bit, like "Is it masculine or feminine" appears 3 times, and i want to try to make it so I can reuse it

lyric mountain
#

bitfield |= 1 << index

#

or the long version, bitfield = bitfield | (1 << index)

#

to understand what's happening:

  0000 0001 // bitfield
| 0010 1100 // bits to add
-----------
  0010 1101
#

if any of the bits is 1, it becomes 1

#

bit = bitA == 1 || bitB == 1 basically, for every bit in the number

#

for & it's bit = bitA == 1 && bitB == 1

#

so if any is 0, it becomes 0

#

so when you use it to check if a bit is ON, you're just masking out every other bit, so it'll either be 0 or the value of mask

sharp geyser
#

"INSERT INTO student (full_name, password, email, campus_id) VALUES ($1,$2,$3,$4) RETURNING *" is there anything wrong with this SQL ?

#

It seems to not be inserting anything, but it does return the record's values so idk

lament rock
sharp geyser
#

yea

#

I found out the issue though

#

I am using transactions and forgor to commit them

#

💀

lament rock
#

yup thats it

sharp geyser
#

Now it works properly

lament rock
#

also, transactions dont really benefit the database unless its like in the millions of rows

sharp geyser
#

wym?

#

transactions are useful if something happens it will rollback, which if this reaches the scale I hope it will that will be very beneficial

lament rock
#

Ah you're using it for the rollback feature

sharp geyser
#

Yea

lament rock
#

Transactions advertise some performance benefit

sharp geyser
#

Ah, yea that doesn't matter much to me right now

#

All I care about is that it will rolleback changes if commit is never called which I now know works KEKW

surreal sage
#

peak design

#

i cant close the modal

#

💀

sharp geyser
#

Join the newsletter and then you can escape

hidden gorge
#

Quick question is it recommened to use sharding when you have 53+ servers or no?

deft wolf
#

Sharding is probably "recommended" for a thousand or two thousand servers. With 2.5 thousand servers it is required

#

You'll have to use it sooner or later anyway, so there's no harm in getting interested in sharding now

harsh nova
#

if you use d.js sharding will make you use unnecessary memory and spend time on something you dont need

#

even if you reach the 2.5k mark discord.js offers automatic sharding which means you dont need to rewrite any code at all

hidden gorge
#

Ok thanks guy.

past field
#

what does sharding mean

quartz kindle
#

in discord's context, it means splitting your bot into multiple connections, each connection handling a certain amount of guilds

#

its the system discord uses to balance the load for big bots

#

sharding is recommended once your bot reaches 1500 guilds, and it becomes required once it reaches 2500 guilds

#

most libraries already include support for sharding, and usually what they do is they run multiple copies of your bot for you, and each copy manages a different set of guilds

past field
#

maybe one day i’ll get to the point of learning to do that

wheat mesa
#

Kinda unrelated, but what font is discord using for codeblocks now? I kind of like it, might have to use it as an editor font ```java
public class Main {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}

sharp geyser
#

maybe monaco

#

actually nah

quartz kindle
#

if you're talking about the customid field, yes you can do that

#

as long is it fits the limits

pale vessel
smoky nexus
#

How do you guys stage your bots? Just create a new Discord Bot for each stage?

deft wolf
#

"Stage"?

pale vessel
smoky nexus
civic scroll
#

it's dev, a-b (test), and then prod for me

civic scroll
#

or if you feeling ballsy - one for all

#

dev should already be test

#

after all you are not making an enterprise-grade application

smoky nexus
civic scroll
#

i use full name

civic scroll
#

only shortened for well-known

smoky nexus
#

Lol, is your mod a permissions mod or was that some super funky bug?

lyric mountain
#

jb mono is in fact the apex of monotype

radiant kraken
#

roboto mono ftw

#

even consolas is great

pale vessel
#

fira code with ligatures

radiant kraken
#

will look into it

smoky nexus
#

Does discord support markdown badges? I can´t get mine to work like in GitHub.

pale vessel
#

discord doesn't support markdown images

lyric mountain
#

Discord doesn't support 50% of markdown

pale vessel
#

even if they do, you probably need to convert them to png instead of svg (some of the badges support that afaik)

lyric mountain
#

doesnt work with embed images too btw, since discord really doesn't like dynamic image urls

#

the caching doesn't allow it

neon leaf
whole glen
#

client.application.owner give null

lyric mountain
#

🫱🔮🫲 hmmm lemme see

#

nop, nothing, not even the crystal ball knows the issue without the code

sharp geyser
#

💀

#

thats the most creative way of telling someone that you can't do shit without code i've seen

lyric mountain
frosty gale
sharp geyser
#

you have to fetch the application

frosty gale
#

sounds about right

sharp geyser
#

client.application.fetch().owner

#

iirc

#

though it returns a promise so you have to await it

frosty gale
#

didnt know it was a "partial" as well

sharp geyser
#
let app = await client.application.fetch();

app.owner```
#

its a partial?

frosty gale
#

its a field so i would assume it could be

#

in djs terms i think partial just means it might or might not be present depending on context

#

in cache at least or by default*

sharp geyser
#

Oh right

#

idk why you have to fetch it tbh

#

it should be available at ready

hidden gorge
#

Any reason its returning: An error has occurred: TypeError: Cannot read properties of undefined (reading 'avatarURL')

Its in the same file as the client

app.get('/contributors', async (req, res) => {
  const HyperID = 1042818144890278060;
  const NickID = 518507870812110880;
  const BestonID = 474286442982539321;

  try {
    const HyperUser = await client.users.cache.get(HyperID)
    const NickUser = await client.users.cache.get(NickID)
    const BestonUser = await client.users.cache.get(BestonID)

    console.log(HyperUser, NickUser, BestonUser)

    const HyperIcon = HyperUser.avatarURL()
    const NickIcon = NickUser.avatarURL()
    const BestonIcon = BestonUser.avatarURL()

    res.render('pages/public_pages/contributors', { Hyper: HyperIcon, Nick: NickIcon, Beston: BestonIcon });
  } catch (e) {
    console.error("An error has occurred:", e);
    res.status(500).send("An error has occurred. Please try again later.");
  }
});
frosty gale
#

IDs on discord as defined as strings so you need to wrap the IDs with quotes

#

so "" or ''

hidden gorge
#

Ok i'll test that

#

Same error.

frosty gale
#

and second since you are fetching the users from cache its not guaranteed they are present because the cache only keeps users that were used before

hidden gorge
#

what could i do other than cache?

frosty gale
#

you should ideally do something like await client.users.fetch(ID) instead

hidden gorge
#

ok

frosty gale
#

this will try get the user from the cache and if its not there it will fetch it from the API

#

and when getting things from the cache (so .cache) you dont need await since the operation is guaranteed to be instant

hidden gorge
#

this happened...

frosty gale
#

unlike .fetch which may ask the discord API for the user which takes a random amount of time

hidden gorge
#

ok i fixe dit thanks Chloe

blissful coral
hidden gorge
#

oh thats fun

blissful coral
#

Anybody have any idea why my GH is looking like this I cant fix

#

Cant click anything either its weird

hidden gorge
#

Broken CSS and JS?

blissful coral
#

Not sure its on safari but ive cleared everything and getting the same issue

sharp geyser
#

what kind of protocol does postgres use when making connections?

frosty gale
# blissful coral

willing to bet its some dark mode theme/extension thats conflicting with the page

sharp geyser
#

how is sql sent to postgres

frosty gale
#

but not sure about the structure or kind of data that gets sent

sharp geyser
#

🤔

#

so its essentially just http rest calls back and forth?

frosty gale
#

Within normal operation, SQL commands can be executed through either of two sub-protocols. In the "simple query" protocol, the frontend just sends a textual query string, which is parsed and immediately executed by the backend. In the "extended query" protocol, processing of queries is separated into multiple steps: parsing, binding of parameter values, and execution. This offers flexibility and performance benefits, at the cost of extra complexity.

#

so it looks like clients on the low level can literally just send text that is an SQL query and the server will respond to it in some format with the data or an error

#

assuming youre not using things like templates for sql injection, etc

sharp geyser
#

🤔

frosty gale
#

which in the other case will use some more complex structure which will still contain your SQL query as text but with additional information

sharp geyser
#

hm

frosty gale
#

why do youw anna know anyways

sharp geyser
#

Just was curious, cause I was working on a project that takes roblox lua dictionaries and turn them into sql tables that get sent to a pg database

#

Was wondering if there was anyway I can make this easier, but roblox doesn't allow making tcp connections

#

I'd have to do what I was originally doing which is just make a rest api as a go between

frosty gale
#

yeah looks like you can only use http

#

what you can do which is also safer and easier is to make a http server off of roblox which has an api that interacts with your postgres database

#

then the roblox server can make requests to it

sharp geyser
#

that's what I am currently doing

frosty gale
#

definitely much better and reliable than trying to write your own postgres client on roblox at least

sharp geyser
#

Oh for sure

#

I don't think it is even possible

#

At least not with my skill level

frosty gale
#

tcp is annoying to work with anyways because its binary and tcp data can either be grouped together or split into 2 packets which requires you to write some kind of frame algorithm that defines the length for each data sent by TCP so the recipient knows how large the transmission is supposed to be

sharp geyser
#

Yea no thanks

#

I'd let the smarter people do this for me :)

quartz kindle
#

prepend each packet with a couple of bytes containing the packet size
on the receiving end read those bytes, start a reading loop until there is enough data to read the packet, then restart the loop with whatever leftovers you have

frosty gale
#

especially one thats vulnerable to attacks

rugged delta
#

Hallo

#

Can someone pls help me make a bot??

#

Me need SOS need...

frosty gale
#

and in js its even more annoying because you have to go through uint8arrays and their own tcp interface

#

but once you get it implemented tcp is relatively straight forward

rugged delta
frosty gale
#

thats ok i was talking to tim

frosty gale
rugged delta
#

@frosty gale you left??

#

Ok - nvm

frosty gale
#

you have to understand people spend their free time to help out here

#

so id rather try help you here that way if im gone or dont know someone can chime in and help instead

sharp geyser
#

Previously what I did was something like

local user_table = {
  table_name = "user",
  columns = {
    {
      column_name = "id",
      column_type = "text"
      -- then there could be optional fields like default, nullable, primary, etc
    }
  }
}

On the api I would basically form the request by just grabbing the values and looping over the columns to put them into the query string mind you this is not safe since I am not sanatizing them since idk the proper way to do this since I can't use paramertized statements

#

What would you recommend to properly sanatize the incoming table structure

#

This isn't a specific question to just Chloe, so if anyone has any feedback lmk

frosty gale
sharp geyser
#

Essentially yea

#

I am dynamically forming the sql query based on the table they are sending

solemn latch
sharp geyser
#

That example right there is what they would send if they are creating a table

frosty gale
#

why cant you use templates, does the library not support it or something? its basically a must have for any sql library that wants to be production ready

sharp geyser
#

wdym by templates

frosty gale
#

params

sharp geyser
#

oh

#

Well, depending on how I am forming the sql query no

#

sqlx only allows params for values, I have to form the first part of the sql and then param any values

#

so if they were inserting something i'd have to do INSERT INTO ${table_name_from_request} (${values_they_inserting}) VALUES ($1,$2,etc)

#

and then I can param the values

frosty gale
#

ah okay so you sort of want users to insert custom columns and values

#

or you

#

i would try move away from this type of thing because you cant sanitize it easily

sharp geyser
#

🤔

#

Actually now that I think about it

frosty gale
#

the first part which is table name is not a problem you can just check if the string is an actual table name and insert it

#

but the problem is the columns

sharp geyser
#

why not just create a pg user for each person who signs up

#

if they sql inject their own db

lament rock
sharp geyser
#

I use postgres

lament rock
#

Welp then there you go!

sharp geyser
#

tbh I dont think i actually have to worry about sql injection

lament rock
#

You do

sharp geyser
#

I mean, I will be having it run on their own user

frosty gale
sharp geyser
#

damnit

#

back to the drawing board

lament rock
#

Yeah I'd say just take a look at my system. You can also see how it generates the statements before you try to run them

sharp geyser
#

ima be real

#

idk how to read js/ts code anymore 😭

lament rock
#

There are guards against UPDATE all and DELETE all

frosty gale
#

then you can safely insert those columns into the query

sharp geyser
#

that's fine for an insert query

#

but other stuff not so much

lament rock
#

I need to extend my orm because it only supports simple statements. It isn't class or context based

frosty gale
lament rock
#

nothing like select(columns).from(table)

frosty gale
#

letting users set up their own database and query it?

sharp geyser
#

Yea

#

Its supposed to be a replacement for Datastores

#

with a more relational db

frosty gale
#

how would it look like to a user using it

sharp geyser
#

Well, tbh I might just do away with using dictionaries and just let them write their own sql

#

Since the target audience is more advanced users

lament rock
#

That could be dangerous

sharp geyser
#

It could be, but it is more saner for me.

frosty gale
sharp geyser
lament rock
#

until someone bombs your server

sharp geyser
#

Look Ophidian, idk shit about db management 😭

lament rock
#

Then are you sure doing this is a good idea

quartz kindle
sharp geyser
#

probably not, but im not going to let a hiccup stop me from experiementing

lament rock
#

Alright then I won't persuade you otherwise

sharp geyser
#

It's really just a hobby project

#

and if I can make it secure enough and stable enough to use why not let others try it out

frosty gale
#

no fair

#

whats the requirement

quartz kindle
#

dafuq

solemn latch
#

;p

quartz kindle
sharp geyser
#

I mean

#

lets be real

deft wolf
sharp geyser
#

tim is quite literally the most experienced here

#

but how does NyNu have it

#

🤔

frosty gale
#

i mean he is like 30

sharp geyser
#

how does age have anything to do with it

quartz kindle
#

last time a special role like this was made, it was later removed because people got jealous

sharp geyser
#

thats an insult

frosty gale
sharp geyser
#

Okay?

#

Age has nothing to do with it

frosty gale
#

why are you getting offended for him

#

he knows i wouldnt purposefully insult him (i hope)

sharp geyser
#

Im not getting offended for him, im offended at the idea that experience comes with age

deft wolf
sharp geyser
#

rather than hard work

solemn latch
deft wolf
#

Nah, it was a joke

quartz kindle
lament rock
#

Shit I been doing this for 7-8 years. Still not tim level tho. I think Tim earned it 👍

quartz kindle
#

:^)

solemn latch
#

We don't want it to feel forced on anyone, so if you do want it removed let someone know

deft wolf
#

I mean... jealous of the role? Really?

#

This sounds ridiculous

quartz kindle
lament rock
#

You flatter me

frosty gale
sharp geyser
#

I disagree

#

If you work hard enough you can become just as experienced as those with a larger age gap than you

frosty gale
#

sure, i agree with that

real rose
solemn latch
#

It's just a role name, I wouldn't go this far into it.

frosty gale
#

my intention was mainly to say that since hes older he would have the opportunity to start learning longer than someone who is younger for example

#

and since you said "experienced"

quartz kindle
#

inb4 the role is removed because it caused a discussion

deft wolf
#

XD

frosty gale
#

experience usually refers to the amount of time youve been doing something so thats what ive been talking about

solemn latch
#

Nah, it's a good discussion. Hopefully an announcement will be posted to clear things up.

It's likely to only be removed for drama, but we're hoping for some maturity.

frosty gale
#

ofc you could do something for a year and be better than someone thats done it for 10 years

quartz kindle
#

btw what does the role actually mean? for all we know it could mean experienced in nsfw things :^)

sharp geyser
#

I agree that tim and NyNu should have the role

#

a lot of others as well

#

haku, chloe, papi

#

to name a few

quartz kindle
#

bring back voltrex

#

and speedy

sharp geyser
#

voltrex deserves a role beyond experienced

lament rock
#

@voltrex

#

What

sharp geyser
#

bro basically wrote the v8 engine tbh

#

He knows the v8 engine like the back of his hand

frosty gale
#

oh wait forgot hes banned like the many good people that were here for some arbitrary reason

sharp geyser
#

He has to appeal

#

if he hasn't already

real rose
# quartz kindle last time a special role like this was made, it was later removed because people...

Going for a re-trial, it's proven to be super successful in other places. Just to be that bit more helpful towards new users we want people with proven experience and who have helped in the past to stand out that bit more. This is also to go against some of the jokers who interrupt genuine "helpful conversations".

I'm hoping that when we make an announcement the criteria will be made clear and it shouldn't be considered a competition, race, or "superiority" over others.

It takes time for mods to see activity and helpful-ness from certain users, which is what actually drives this role. And spoiler, you don't just have to be a dev giving advice in #development

If anyone has any questions then feel free to bring them up, but if the first reaction you give is to stomp your feet that you don't have it, then I don't know what else to say other than it's ruining your chances. pepe_sadge

(not directed at Tim, just the context of your message I wanted to bring up kek ref: #site-status message)

Also want to mention that we used to have a Contributors role which was application-based, but had a similar purpose.

#

wanted to mention that in advance of any other questions or convos^ kek

real rose
sharp geyser
#

ong

quartz kindle
# real rose

i was literally about to say that, but decided not to

real rose
sharp geyser
#

get the experienced role

#

😏

real rose
#

if it means helping people, then I'm all for it

sharp geyser
#

I just need people to ask questions about rust 🦗

lament rock
#

Time to learn ts and js

solemn latch
quartz kindle
#

time to play maplestory instead of working

lament rock
#

real

sharp geyser
#

time to make something so I can also be in staff picks /j

sharp geyser
#

how's life been haven't seen you in a bit

lament rock
#

My bot will probably never be picked if Discord is breathing down Top.gg's neck

sharp geyser
#

yikes

#

what is ur bot

lament rock
#

Music boat

sharp geyser
#

Oh yea gl

solemn latch
#

Busy busy busy. For someone who is online all the time I've not been at my desk much in the past month

sharp geyser
#

oof

#

I feel that

solemn latch
#

I miss it here notlikenoot

lament rock
#

irl job got me fucked up

sharp geyser
#

uprooting my life and moving across the US has been very busy for me as well

harsh nova
sharp geyser
#

oh no fish is here

#

gotta leave

harsh nova
#

sup

solemn latch
#

Run away

sharp geyser
#

<3

#

We are talking about the development of our lives fish

#

you wouldn't understand

#

😔

harsh nova
#

👍

sharp geyser
#

What even is the staff pick role

solemn latch
#

Kinda development related. Can a pihole be setup on my server but restricted to a specific IP(mine) or have a password? 👀

#

Surely someone has setup a pihole

#

I want to setup a vps to be a pihole, but I don't want others using it ^-^

lament rock
#

firewall can restrict ips likely

sharp geyser
#

does piehol have a setup var file?

#

I can't remember if it does

lament rock
#

Or if you can only access it via LAN then just dont port forward

solemn latch
sharp geyser
#
lament rock
#

This is likely just binding the listen server to an ip

sharp geyser
#

hm, yea

#

idk the only other thing I see is editing setupVars.conf but that doesn't look like it will produce the required result

lament rock
#

I think firewall is the move

sharp geyser
#

yea

whole glen
wooden ember
#

Is there a way to revert this back to normal? is is this just another needless change that discord devs are upto?

harsh nova
sharp geyser
#

I see no issue with it why do people complain

wooden ember
#

its not version spesific, its like this on an alt.

sharp geyser
#

Then it definitely is

#

Your client could be different then what your alt is logged in as

wooden ember
sharp geyser
#

But it is an application

lament rock
#

Oh it is an app

sharp geyser
#

🤔

#

You just happen to turn that application into a bot account

wooden ember
harsh nova
#

anyhow that is outside of the scope of this channel. Better discussed in #general

wooden ember
#

fair

haughty tundra
#

hello. is it possible to like display only the icon (arrow) of an OptionMenu/ComboBox for tkinter?

past field
#

is it possible to have the bot kick out all users with a specific role ID?

sharp geyser
#

Yes

#

You will have to loop through the people that have that role and then kick them.

#

Careful though as if there are a lot of users it can be api spammy.

#

Best thing to do is do it in batches if there is a lot of people.

past field
#

is 91 considered a lot of people?

#

i have an “unverified” role that double center assigns upon entering and and swaps it for a verified role once they verify.

#

rn i have 91 ppl who never verified but i don’t want to kick them 1 by 1 lmao

sharp geyser
#

more than 10 is already a lot tbh

past field
#

ah

sharp geyser
#

There are rate limits on the api

#

and some of those endpoints have specific rate limits which defeats the purpose of global rate limits tbh but who cares right :^)

#

Either way, depsite what those rate limits are, you will end up hitting it with 91 for sure

#

If you truly want to automate it you can do it in batches of 10-20 roughly though someone smarter than me might have a better solution

pale vessel
sharp geyser
#

or yes do what flaze said.

past field
#

i mean i kinda did this with my prune command

pale vessel
#

just have a significant delay between the kicks, maybe 10s. eventually you'll kick them all

past field
#

i know the limit is 100 messages but i’ve got it looped for anything more than 100

sharp geyser
#

15m to kick all 91 members trollface

past field
sharp geyser
#

Honestly you should be fine to do it in small batches

#

iirc thats what dyno does

#

or did

#

can't remember which

past field
#

iirc? googles

sharp geyser
#

if i remember correctly

rose warren
#

Dyno kicks one every 1 - 3 seconds I believe

deft wolf
#

Dyno doesn't have an increased rate limit by any chance? I once heard something that these larger bots have this option

lament rock
deft wolf
#

I see

lament rock
#

Rip to Bot and Verified bot tags

#

Hello App and Verified app

rose warren
deft wolf
pale vessel
#

アプリ

deft wolf
#

The "app" badge is often longer than the name of the bot itself KEKW

lament rock
#

Amazing

hard dust
#

In German it would be "Applikation" but they let it on APP

#

maby bc APP would also be the abbreviation in german? idk

humble gyro
#

probably will be fixed tbh, my guess it's just localization not aware of constraints

quartz kindle
#

in slovenian its probably "APLIKACIJA", with an extra I in it, but idk i use english

radiant kraken
#

best way to store your gpg keys topggSunglasses

quartz kindle
#

someone didnt read the readme

neon leaf
#

Nice U got experienced role

radiant kraken
#

i forgot my gpg passkey a few hours after setting it up topggSob

#

wtf is wrong with my brain

harsh aspen
neon leaf
timber hatch
#

is topgg hosted serverless or serverful?

spark flint
#

i dont think thats public info

timber hatch
#

ah understandable, was just having a debate with @low orbit and this would've resolved it :(

spark flint
#

ah

spark flint
#

somehow

frosty gale
#

serverless is such a scam

#

there's still a server somewhere

spark flint
#

yes

timber hatch
#

not so much with lambda, but services like cercek and netlify make it easy as hell

quartz kindle
#

serverless is fine for some things

#

but the whole concept of distributed/microservice architecture is overhyped and often misused

#

most times you're just adding unnecessary traffic and load to the wrong places and convoluting your entire network

neon leaf
#

this took way longer than it shouldve

frosty gale
#

I really like supabase and would use it but if you're going to host it on your own server I feel like it defeats the point of being serverless and might as well make a standard server app

#

it's useful for people moving away from a serverless structure to their own self hosted but the complications and annoyances might be meh

#

I see serverless as being able to cut down on costs by only having the things you strictly need as a backend

#

so you can spin up a tiny macro to run some task and call it a day

lyric mountain
neon leaf
lyric mountain
#

oh, so it considers repeated statements

neon leaf
#

yeah, 1w -1d 2d is same as 1w 1d

exotic hull
#

Between java and javascript which should i learn first, I've learnt html and css and asked some friend he said learn java and javascript will be very easy after that

lyric mountain
#

they're wildly different

#

personally I recommend java, as it'll make you actually care about types and classes

#

which makes easier to learn other strict languages

exotic hull
#

So first java and then javascript

lyric mountain
#

they're not connected at all

exotic hull
#

Ik but someone told it'll be easier to learn javascript after you learn java

lyric mountain
#

like 1 2 2022

neon leaf
#

no

lyric mountain
neon leaf
lyric mountain
#

you'll have an easier time either way because the syntax is vaguely similar

lyric mountain
exotic hull
neon leaf
#

yeah, Date should do that right?

lyric mountain
#

if it's US, then mon day year, else day mon year

neon leaf
#

I basically just try parsing with Date

#

and if it fails I do my own

lyric mountain
#

ah

lyric mountain
#

like, do you have an end goal?

exotic hull
#

I'm studying btech so i gotta learn some langauges to bag a internship and i too have java in my 3rd sem, I'm currently in 2nd sem

#

Learning c++😮‍💨😮‍💨

lyric mountain
#

then go with java, as you can use whatever you learn on 3rd sem

exotic hull
#

Fck keyboard

lyric mountain
#

one way or another, you'll need to apply it onto something

#

prog knowledge quickly decays if not used

exotic hull
#

Yeah ikik

#

How much time will it take to get to intermediate level in Java

exotic hull
lyric mountain
#

depends on how fast you learn things, and what you consider "intermediate"

radiant kraken
#

@quartz kindle can you help me with this, experienced onionpray

#

here's package.json:

  "devDependencies": {
    "@types/node": "^20.12.7",
    "@typescript-eslint/eslint-plugin": "^7.7.0",
    "@typescript-eslint/parser": "^7.7.0",
    "eslint": "^9.0.0",
    "eslint-plugin-jsdoc": "^48.2.3",
    "prettier": "^3.2.5",
    "typescript": "^5.4.5"
  }
lyric mountain
#

I always think about programming knowledge as "cant do" and "can do"

lyric mountain
#

you either can program or you cant

exotic hull
lyric mountain
#

and what do you define as beginner and master?

exotic hull
#

If you know basics clearly
If you know everything about it

lyric mountain
#

well, that's a scale that goes from 0 to infinity

quartz kindle
lyric mountain
#

hard to define where infinity / 2 is

quartz kindle
#

npm is dumb

radiant kraken
#

imo u start becoming a master when you can look at other people's code and find things to refactor/improve on it :^)

#

that's where i draw the line

lyric mountain
#

reach native is js

quartz kindle
#

reach native

lyric mountain
#

redux too from what google told me

exotic hull
#

My friend told go for java then javascript them react.js then react native

lyric mountain
#

yeah, the path forks 90º there

exotic hull
quartz kindle
#

if you wanna learn react native, then learn react native

exotic hull
#

Bruv i gotta learn other languages too

radiant kraken
#

here's mine:
python -> javascript -> (brief period: java -> c#) -> typescript -> c -> c++ -> rust

quartz kindle
#
  1. figure out what you want to do
  2. figure out what you need to know to do that
  3. learn it and do it
exotic hull
wheat mesa
#

Honestly Java -> TypeScript -> C++ -> Rust was mine

#

(With some others in between like C# but that’s basically Java)

radiant kraken
#

i dont know much about java or c# lol

#

well from my knowledge of js and c it should be quite straight forward

lyric mountain
#

my path was
expression 2 -> c -> c++ -> pascal -> js -> deplhi -> java -> lua -> python -> c# -> jsfuck -> groovy

wheat mesa
wheat mesa
#

But you’d probably be fine, they’re easy to learn

lyric mountain
#

yes, was a busy week

#

I also forgot it all already

wheat mesa
#

Java/C# are the best first languages imo

radiant kraken
wheat mesa
#

Gradle sucks and I hate it but it’s also not as bad as CMake

lyric mountain
#

oh also dart

#

learned it recently

wheat mesa
#

CMake is decent but like C++ package management in general is awful

quartz kindle
#

just be a javascript one trick pony monochampion

wheat mesa
#

(And earn the experienced role in the meantime)

radiant kraken
#

C++'s ecosystem is a giant mess

exotic hull
#

Aight imma go for java and then javascript

wheat mesa
#

Just keep in mind that Java and js are not nearly the same

quartz kindle
wheat mesa
#

They have similar syntax and that’s about it

exotic hull
#

I KNOWW

radiant kraken
#

well, syntax-wise they are

lyric mountain
wheat mesa
#

But so do many C-like languages

radiant kraken
#

still-maintained projects with 50k stars mixed with ancient projects from 1997

quartz kindle
wheat mesa
#

Crazy how a couple people cooked up the most popular programming syntax just a few years after computers were becoming widespread and we still use it half a century later

lyric mountain
#

I mean, it's a concise syntax

radiant kraken
wheat mesa
#

It is but it’s so simple that it’s genius

exotic hull
#

I'm doomed😭

#

I can't figure out which language should i go with

wheat mesa
#

What do you want to do

#

Web? Backend? Performance-heavy applications?

radiant kraken
#

^

wheat mesa
#

REST APIs?

lyric mountain
#

pacemaker software

wheat mesa
#

Etc

radiant kraken
#

what drove me was the boredom during quarantine lol

#

and curiosity

exotic hull
wheat mesa
#

2nd sem in college?

exotic hull
#

Yeah

wheat mesa
#

I wouldn’t wait because that mentality will lead to procrastination

#

I’m 2nd semester in college as well

exotic hull
lyric mountain
#

go with java, it's well estabilished and forces you to learn good practices

#

and it's a gateway to other c-like langs

wheat mesa
#

Java is always a solid choice. Every developer should learn it (or a flavor of it) at some point

#

Can’t go wrong with Java

exotic hull
wheat mesa
#

Don’t wait for your classes to “teach” you

exotic hull
#

Coz I've learn html and css so i gotta complete that web dev thing

wheat mesa
#

A CS degree is less about programming and more about theory

#

The only way you’ll learn how to actually program is by applying what you’ve learned to personal projects

exotic hull
radiant kraken
#

i'm glad i didn't take a CS degree and went for IT instead

wheat mesa
#

People that come out of uni with just a degree and no actual projects or experience have a hard time getting a job

exotic hull
lyric mountain
#

college java courses usually teach outdated approaches and use REALLY obsolete versions

radiant kraken
#

CS sounds like way too much physics for me topggSob

wheat mesa
#

CS is two semesters of physics, it’s not that hard

radiant kraken
#

i failed every physics exam in high school lmao

#

dont wanna risk dropping out

exotic hull
#

So y'all tell me which languages should i go with

wheat mesa
#

Java

exotic hull
radiant kraken
#

physics is not really my thing

exotic hull
#

Too much intriguing

wheat mesa
#

Physics is pretty easy ngl

exotic hull
#

Was*

wheat mesa
#

Once you understand the concepts the math becomes easier

#

That’s the important part

exotic hull
#

Now I'm leaned towards coding

wheat mesa
#

Maybe it’s because I’ve suffered through 2.5 years of physics but still

wheat mesa
#

Just saying

exotic hull
#

Okay😭

wheat mesa
#

Not trying to be passive aggressive sorry

lyric mountain
#

if ur reluctant in going with java then you already subconciously chose javascript

#

in which case go with js

wheat mesa
#

Java is a great language because it teaches you the fundamentals of CS without diving TOO deep into memory

#

C++ is fine to learn but is a bit more difficult to debug when you have issues as a beginner to it

exotic hull
#

No i wanna go with java but like I've learned html and css so it's like leaving web dev half behind

wheat mesa
#

HTML and CSS is markup, not a programming language. If you want to learn web dev, go ahead and learn js. If you are interested in doing other things though, I’d go with Java

exotic hull
#

I'm in such a dilemma

lyric mountain
#

it's not like you need to forfeit one to choose the other

wheat mesa
#

Your time is wasted by debating what language to learn, just pick one and learn it

#

It doesn’t matter all that much, you can always choose a different one to learn later (or even at the same time if you’re feeling confident!)

exotic hull
#

Any playlists on yt from where i should learn

lyric mountain
#

none

wheat mesa
#

Personally I’ve learned (at least on a decent level) Java, C#, C++, Rust, Go, TypeScript, and some Python

lyric mountain
#

languages evolve way too fast for yt to keep up

wheat mesa
#

Don’t learn from videos

#

They suck

#

Use the docs for the language you pick

exotic hull
#

Java docs?

lyric mountain
#

uhhh....well, somewhat but dont read it from the actual site

wheat mesa
#

Videos are fine when exploring conceptual problems, like learning about data structures and algorithms and what they do, but as for actual programming skill, don’t try to learn that from YouTube

lyric mountain
#

first step, choose a goal

#

what do you want to make?

wheat mesa
#

Just think of a reasonable starter project (maybe a small terminal app) and look things up as you go

exotic hull
lyric mountain
wheat mesa
#

That’s the wrong motivation

lyric mountain
exotic hull
#

And also in 3rd sem it's java so gotta be prepared

lyric mountain
#

like, I always try to make a snake game or a calculator

wheat mesa
#

Internships should come from your passion for learning, your passion for learning should not come from trying to get internships

radiant kraken
#

^

#

dont program just for the money

exotic hull
wheat mesa
#

I’m struggling to find internships right now

radiant kraken
#

US moment

wheat mesa
#

Applied to 100+ and no interviews

radiant kraken
#

have you tried freelancing?

exotic hull
#

Where y'all from

wheat mesa
#

I am on a final interview with a summer camp STEM instructor for engineering though so that’s promising

wheat mesa
radiant kraken
lyric mountain
#

brazil

wheat mesa
#

You’ve got a wide variety of perspectives here :p

radiant kraken
#

mr. worldwide

lyric mountain
wheat mesa
#

^^

#

That’s how you learn most new languages

lyric mountain
#

just say "I'm going to make X" (not the social network)

wheat mesa
#

Start off with something like basic user input and output

#

Something that takes a user’s name and outputs it backwards

#

Something like that

exotic hull
lyric mountain
#

ok, so here's the goal, a notes app

#

now lets break it into malleable pieces

wheat mesa
#

Or maybe even just takes user input and outputs it back to the console
What’s your name: Name
Hello, Name!

#

Etc

exotic hull
wheat mesa
#

Just to learn the basics of how to declare variables and such

radiant kraken
#

blud went from python to c++ 💀

wheat mesa
lyric mountain
#

a notes app will involve a database, a way to get user input and a way to show data to the user

radiant kraken
#

bro went from 0 to 100 real quick

lyric mountain
#

this I'm talking about a common windows app, you dont want to go into mobile just yet

wheat mesa
#

Basic C++ is not insanely hard, nor is Java. But it’s important to understand the fundamentals to move on to the intermediate concepts

exotic hull
lyric mountain
#

start by laying the foundation

radiant kraken
#

std::cout << was alien to me when i was still a beginner

lyric mountain
#

you dont need a database for now, do the other steps beforehand: user input & data visualization

exotic hull
#

using namespace std; save dme

radiant kraken
#

im not talking about that

#

im talking about the << operator overloading

wheat mesa
radiant kraken
#

shit way to introduce newbies tbf

lyric mountain
#

will you use GUI or CLI?

#

as in, visual interface or command line?

wheat mesa
#

That’s what I hate about college, they don’t show you actual real world practices

exotic hull
lyric mountain
#

said below

wheat mesa
#

Nobody would dare use using namespace std; at a top level declaration like they show in college

exotic hull
#

Difference?

radiant kraken
lyric mountain
radiant kraken
#

its always that employee struct lol

lyric mountain
#

ops

wheat mesa
#

CLIs are probably where you should start

radiant kraken
#

^

lyric mountain
#

yes, they're easier

wheat mesa
#

GUIs are a lot to digest in other languages

exotic hull
wheat mesa
#

Making a GUI in HTML/CSS and the backend processing logic in JavaScript is much easier than using something like Java Swing

#

(Probably because swing is older than most of us here)

lyric mountain
exotic hull
wheat mesa
#

Not even for personal use

#

For personal learning

exotic hull
#

Just for testing bruv😭😭😭

wheat mesa
#

Most apps you create in the beginning of learning a language you probably won’t end up running ever again after you finish with them

lyric mountain
#

oh also, I forgot one VERY important step

#

git

wheat mesa
#

But it’s about what you learned in the process

#

Yes please learn git early on. I regret not learning it and I still struggle with it to this day

exotic hull
#

You told me what should i do but from where should i learn😭

radiant kraken
wheat mesa
#

A version control system, it’s for tracking different versions of your code

radiant kraken
#

i still dont know what it does lmao

lyric mountain
radiant kraken
#

i still think it as a github cli thingy

wheat mesa
#

GitHub and git aren’t the same thing

radiant kraken
#

yeah i know

#

github has its own cli called gh

lyric mountain
#

go by that sequence, should be easy enough

wheat mesa
#

Git existed before GitHub as a local VCS

exotic hull
wheat mesa
#

Github basically shares that git repo on the internet so others can use it

#

It’s a fancier version of google drive pretty much

lyric mountain
#

think about it as a cookbook

radiant kraken
#

the only commands i know are git pull, git clone, git add, git commit, and git push topggSob

real rose
#

git >>>

wheat mesa
#

git checkout -b branch goes hard

lyric mountain
#

for versioning, you only need to know 5 commands for now:
git init
git add .
git commit -m "Your message"
git push
git pull

radiant kraken
#

or git commit -am

wheat mesa
#

(And maybe setting up remotes and such to GitHub)

radiant kraken
#

and git clone too

radiant kraken
#

your command line

lyric mountain
#

first of all install git

exotic hull
#

Link to java documentation

wheat mesa
#

Also be careful not to run this in the root dir of your computer

lyric mountain
#

then make a folder somewhere easy to find (this will be where your project will be)

wheat mesa
#

Because it’ll start tracking all of your files under git and it sucks lmao

lyric mountain
lyric mountain
#

but we'll get to this part, setup git for now

exotic hull
#

Should i go next next on it

lyric mountain
#

if you're going java then go with a proper ide

exotic hull
#

Oh yeah i remember I've it already

lyric mountain
#

ok good, did you download and install git?

exotic hull
#

I'm downloading a 2024 version I've 2022 version

lyric mountain
#

intellij or git?

exotic hull
#

Intellij

lyric mountain
#

it has a self-update button

#

u dont need to download it again

exotic hull
#

Where

lyric mountain
exotic hull
#

Where tf is that setting thing

lyric mountain
#

when you launch it should also show a popup saying there's a new version available

exotic hull
lyric mountain
#

hmm, idk how different edu version is from community edition