#development
1 messages · Page 197 of 1
then the ephemeral msg goes away
also tried it on mobile, doesnt work its data, not body 
and how would I use ts-node? Can I use it without the runtime extension?
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
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
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
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
JS FTW!!!
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
you mean just pure jsdoc or something else
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?
this usually happens when a non-2xx responses code is sent back to the webhook
it’ll retry
are you using a library or just doing it yourself
https://docs.top.gg/docs/Resources/webhooks#retrial this is the documented behavior but seems to not be much correct anymore
Webhook integration for receiving vote data
its not pure jsdoc
its like ts-powered jsdoc (aka this: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html)
vsc does that natively if you have typescript installed
pure jsdoc has its own type annotation system, which is slightly different from ts
Oh ok
So I just return 200
With empty body?
whatever you’d like
k
ah i see
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
vsc actually does an ok job inferring types
i dont need to annotate every single line
mostly just functions/methods and a few things here and there for type enforcing/converting
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
waffle is the only weirdo I know here that tried to make one
you can use assembly if you really wanted to
or you can use an already made language to make one
sure you want to make a native compiled language?
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
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
you mean you wanna compile the language down to assembly and then assemble it?
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
so you refer to the variables with the correct offsets since pushing new variables and doing stuff changes that offset constantly
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
unless you want to go down that rabbit hole
inb4, chitty goes down the rabbit hole
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
how to add photo in description
I'll assume you mean in an embed on Discord. It isn't in the description field, it's in the image field
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
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
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
I agree
you can just bypass it
even on mobile
(love gestures)
surprised you didnt get chatgpt to write a follow up reply
although whats the point
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
Been working on a game. I have a few days of dev time in it. Just a few.
nice, what is the game about?
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
sure
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.
looks like a ChatGPTed generated text
totally
hippity hoppity modal get the fuck off my property
I vaguely remember watching some anime with that plot
dont remember which one was it tho
https://www.mathworks.com/help/sdl/ref/universaljoint.html idk if this is what you're looking for.
The Universal Joint block represents a rotational coupling between two driveline shafts.
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.
why not just a rope of objects
As in like js { question: "", yes: {...}, no: {...} }
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
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?
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
well, your idea of a bitfield is not bad
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
ill see how the bitfield ideas faires and ask any questions, thank you!
Hi
Yo
i had to create a game once for school.... i ended up paying a fiverr dev
unity is so fucked
i wish you luck
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)
Kinda. I'm getting around its jank quite well in ways that make sense so it’s not too bad. Just gotta have that understanding
wtf
Why did you refuse?
it gives the reason there
reach out to the BR if you have questions
I, the bot + help programmer, had an idea
The future, AI will just tell you to use a package.
not a bad idea tho the point of a package is to do some large thing instead of the person writing it
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
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
yep that is sloppy for lack of better word
but its moreso aimed at people that are very new and dont know what theyre doing so not surprised
I always write low level wrappers to avoid idiots like that
i installed the same kinds of packages when i started out so can i blame them
(they barely worked most of the time)
those libs are also written by people who dont know what they are doing
:^)
i am aware
i looked through the code of one and it was abysmal
at least 10 vulnerable entry points for prototype pollution
is 110 mb/s good for a hdd? 😭
you dont put "good" and "hdd" in the same sentence
hdd is not good 
good if you don't move anything beyond 110mb
else you will have to wait for quite a while
7gb movie yk
yeah........... it will take around 70 seconds
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
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
"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
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
What do you mean?
useEffect(() => {
console.log("changed")
setQuestion(word.get())
}, [word.permissions])
oh i meant this one, i'm sorry
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
ohhh so change permissions to public and try it, that yields the same result
did you try it?
also put the console.log before the setter, so we can know whether it's looping infinitely
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
perhaps the issue is with ```js
// word.answer(QuestionPermission.InitialQuestion)
setQuestion({number: question.number + 1})
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
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
so it should be state_permissions(the permisisons presently had) & permission(the permission i'm checking if it has)) == permission
yes
always compare with the mask itself
u could also just !!(state_permissions & permission) since ur in js/ts
Now it always returns invalid question
as 1 is truey
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>
);
}
initialquestion should be 1 << 0
not 0
which is 1
1 << 1 is 2
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
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
"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
Are you using a prepare database somewhere?
yea
I found out the issue though
I am using transactions and forgor to commit them
💀
yup thats it
Now it works properly
also, transactions dont really benefit the database unless its like in the millions of rows
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
Ah you're using it for the rollback feature
Yea
Transactions advertise some performance benefit
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 
Join the newsletter and then you can escape
Quick question is it recommened to use sharding when you have 53+ servers or no?
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
nope
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
Ok thanks guy.
what does sharding mean
sharding means splitting something into multiple copies
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
hm. ok i gotcha, never knew that worked like that
maybe one day i’ll get to the point of learning to do that
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!");
}
}
if you're talking about the customid field, yes you can do that
as long is it fits the limits
it's their own "gg mono" so you'll have to get the files yourself inside your client's source. it looks similar to "source code pro" that they used previously though
How do you guys stage your bots? Just create a new Discord Bot for each stage?
"Stage"?
yeah
basically how you test your bots before reaching production
Dev, Tst, Prd
never seen someone writing it like that
it's dev, a-b (test), and then prod for me
2, one for dev / test
another for prod
or if you feeling ballsy - one for all
dev should already be test
after all you are not making an enterprise-grade application
I just adopted it from work. We use 3 letter names, sometimes a or b is appended. dev, tst, int, acc, edu, prd are the stages we use.
i use full name
only shortened for well-known
Lol, is your mod a permissions mod or was that some super funky bug?
gg mono
jb mono is in fact the apex of monotype
nah
roboto mono ftw
even consolas is great
fira code with ligatures
will look into it
lookin pretty fire https://github.com/tonsky/FiraCode
Does discord support markdown badges? I can´t get mine to work like in GitHub.
discord doesn't support markdown images
Discord doesn't support 50% of markdown
even if they do, you probably need to convert them to png instead of svg (some of the badges support that afaik)
doesnt work with embed images too btw, since discord really doesn't like dynamic image urls
the caching doesn't allow it
random query params 👍
client.application.owner give null
🫱🔮🫲 hmmm lemme see
nop, nothing, not even the crystal ball knows the issue without the code
💀
thats the most creative way of telling someone that you can't do shit without code i've seen

if i remember with d.js getting your application or the details in the application client its not as straight forward
you have to fetch the application
sounds about right
client.application.fetch().owner
iirc
though it returns a promise so you have to await it
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*
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.");
}
});
couple of issues in your code but its likely because your ID's "hyperID, nickID, bestonID" are defined as numbers
IDs on discord as defined as strings so you need to wrap the IDs with quotes
so "" or ''
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
what could i do other than cache?
you should ideally do something like await client.users.fetch(ID) instead
ok
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
this happened...
unlike .fetch which may ask the discord API for the user which takes a random amount of time
ok i fixe dit thanks Chloe
oh thats fun
Anybody have any idea why my GH is looking like this I cant fix
Cant click anything either its weird
Broken CSS and JS?
Not sure its on safari but ive cleared everything and getting the same issue
what kind of protocol does postgres use when making connections?
willing to bet its some dark mode theme/extension thats conflicting with the page
how is sql sent to postgres
cant help you
documentation says it uses tcp which is about standard
but not sure about the structure or kind of data that gets sent
no i'd imagine it would first establish a tcp connection, then once all the negotiation is done the client sends a query across the connection and server responds with the response to that query
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
🤔
which in the other case will use some more complex structure which will still contain your SQL query as text but with additional information
hm
why do youw anna know anyways
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
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
that's what I am currently doing
definitely much better and reliable than trying to write your own postgres client on roblox at least
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
thats pretty easy to do tbh
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
yeah in theory its simple and i have implemented that before but its easy to mess up and write a suboptimal solution
especially one thats vulnerable to attacks
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
I dont understand a word ur speaking lmao
thats ok i was talking to tim
what kind of help do you need
come to DMs
@frosty gale you left??
Ok - nvm
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
I has a question in the design of it.
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

so youre saying youre doing something like SELECT * FROM x WHERE col = ${some_variable_from_request_here} and want to protect against injection without templates/params processing?
Essentially yea
I am dynamically forming the sql query based on the table they are sending
👀 @quartz kindle
https://i.imgur.com/L8oscMR.png
That example right there is what they would send if they are creating a table
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
wdym by templates
params
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
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
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
why not just create a pg user for each person who signs up
if they sql inject their own db

I made my own orm which generates statements with prepared statements. I think it's a good reference. Mind you this is made for postgres, but it won't take much to get it to work for mssql based systems https://github.com/AmandaDiscord/Amanda/blob/restart/packages/sql/src/orm.ts
I use postgres
Welp then there you go!
tbh I dont think i actually have to worry about sql injection
You do
I mean, I will be having it run on their own user
its quite dangerous letting users execute arbitrary queries even if you have isolated users because its easy to mess up and databases usually arent designed to be secure around that
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
There are guards against UPDATE all and DELETE all
for the columns cant you just do something like that users can specify the columns in an array so ["column1", "column2"], then iterate over the entire array and see if they are actual columns in the database and are characters A-Z 0-9 and if not, reject it
then you can safely insert those columns into the query
I need to extend my orm because it only supports simple statements. It isn't class or context based
what is your aim for this overall
nothing like select(columns).from(table)
letting users set up their own database and query it?
how would it look like to a user using it
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
That could be dangerous
It could be, but it is more saner for me.
and even if it isnt for the security aspect a user can just run a query that completely cripples your system because its an intensive query

until someone bombs your server
Look Ophidian, idk shit about db management 😭
Then are you sure doing this is a good idea
ye, im insane (as in mentally ill)
probably not, but im not going to let a hiccup stop me from experiementing
Alright then I won't persuade you otherwise
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

how come you get an experienced role
no fair
whats the requirement
dafuq
;p
sneaky

i mean he is like 30
how does age have anything to do with it
last time a special role like this was made, it was later removed because people got jealous
thats an insult
coded for ages lol
why are you getting offended for him
he knows i wouldnt purposefully insult him (i hope)
Im not getting offended for him, im offended at the idea that experience comes with age
So now it's time to completely stay away from this server
rather than hard work
Do you want it removed?
Nah, it was a joke
its all talent my dude, i dont work at all, let alone hard
Shit I been doing this for 7-8 years. Still not tim level tho. I think Tim earned it 👍
:^)
We don't want it to feel forced on anyone, so if you do want it removed let someone know
honestly you deserve it as well, i've seen your work, its pretty good
You flatter me
i mean in general it does and its a common trend to believe that way when it comes to life
I disagree
If you work hard enough you can become just as experienced as those with a larger age gap than you
sure, i agree with that
jsut want to strongly emphasise this has nothing to do with age and i have no idea how old any of you are
It's just a role name, I wouldn't go this far into it.
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"
inb4 the role is removed because it caused a discussion
XD
experience usually refers to the amount of time youve been doing something so thats what ive been talking about
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.
ofc you could do something for a year and be better than someone thats done it for 10 years
btw what does the role actually mean? for all we know it could mean experienced in nsfw things :^)
I agree that tim and NyNu should have the role
a lot of others as well
haku, chloe, papi
to name a few
bro basically wrote the v8 engine tbh
He knows the v8 engine like the back of his hand
oh wait forgot hes banned like the many good people that were here for some arbitrary reason
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. 
(not directed at Tim, just the context of your message I wanted to bring up
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^ 
ty for wall of text
:^)
ong
can't wait to link it when I see someone stomp their feet for not having a snot green role

I just need people to ask questions about rust 🦗
Time to learn ts and js
I was more thinking mouldy Easter egg color.
time to play maplestory instead of working
real
time to make something so I can also be in staff picks /j
btw woo
how's life been haven't seen you in a bit

Music boat
Busy busy busy. For someone who is online all the time I've not been at my desk much in the past month
I miss it here 
irl job got me fucked up
sup
Run away
no ty
<3
We are talking about the development of our lives fish
you wouldn't understand
😔
👍
What even is the staff pick role
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 ^-^
firewall can restrict ips likely
Or if you can only access it via LAN then just dont port forward
Oh good idea
https://discourse.pi-hole.net/t/how-to-bind-pi-hole-to-a-specific-ip-alias-on-a-system-using-netplan/60469/7 maybe this is what you are looking for? idk what you are using
The total solution to my initial post is: In /etc/dnsmasq.d/99-pihole-cust.conf (the name does not really matter): bind-interfaces listen-address=1.2.3.4 In /etc/lighttpd/external.conf: server.bind = "1.2.3.4"` Set the address 1.2.3.4 in both to the address you wish to bind to DNS.
This is likely just binding the listen server to an ip
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
I think firewall is the move
yea
thank you also sorry for the confusion I was in a rush and was wondering why it was not working not used to having to use fetch and using another line
Is there a way to revert this back to normal? is is this just another needless change that discord devs are upto?
you could revert your discord version I guess 
I see no issue with it why do people complain
its not version spesific, its like this on an alt.
Then it definitely is
Your client could be different then what your alt is logged in as
cuz its a bot... not an application though
But it is an application
Oh it is an app
nah i switched back to my main and nothing is updated
fair
hello. is it possible to like display only the icon (arrow) of an OptionMenu/ComboBox for tkinter?
is it possible to have the bot kick out all users with a specific role ID?
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.
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
more than 10 is already a lot tbh
ah
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
you could just make the bot slowly kick them if you're not in a rush
or yes do what flaze said.
i mean i kinda did this with my prune command
just have a significant delay between the kicks, maybe 10s. eventually you'll kick them all
i know the limit is 100 messages but i’ve got it looped for anything more than 100
15m to kick all 91 members 
better than doing it 1 by 1 loool
ok i’ll try this
Honestly you should be fine to do it in small batches
iirc thats what dyno does
or did
can't remember which
iirc? googles
if i remember correctly
Dyno kicks one every 1 - 3 seconds I believe
Dyno doesn't have an increased rate limit by any chance? I once heard something that these larger bots have this option
This is only for their identify limit
I see
The standard rate limit for identifying is 1 shard per 5 seconds. But bots in over 150k servers can identify 16 shards in parallel. Apart from that there are no special rate limit increases I'm aware of.
App is not that bad, look at polish version. This is one of the reasons I use the English-language discord, because just as the bot does not translate into Polish, the app can be translated, which makes it look a bit "weird"
アプリ
The "app" badge is often longer than the name of the bot itself 
Amazing
In German it would be "Applikation" but they let it on APP
maby bc APP would also be the abbreviation in german? idk
probably will be fixed tbh, my guess it's just localization not aware of constraints
lmao
in slovenian its probably "APLIKACIJA", with an extra I in it, but idk i use english
best way to store your gpg keys 
Nice U got experienced role
i forgot my gpg passkey a few hours after setting it up 
wtf is wrong with my brain
who reads that anyways
is topgg hosted serverless or serverful?
i dont think thats public info
ah understandable, was just having a debate with @low orbit and this would've resolved it :(
ah
i think its serverless actually
somehow
yes
multiple, if the service is deploying to edge. the point is it’s easier to maintain and scale
not so much with lambda, but services like cercek and netlify make it easy as hell
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
this took way longer than it shouldve
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
what happens if you 10s 10s
20000
oh, so it considers repeated statements
yeah, 1w -1d 2d is same as 1w 1d
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
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
So first java and then javascript
they're not connected at all
Ik but someone told it'll be easier to learn javascript after you learn java
does it have numeric dates? like your Jan 2 2022 example but with only numbers
like 1 2 2022
no
both languages only share "java" on the name, their approach to a lot of stuff differ to the fundamental level
nevermind it works
you'll have an easier time either way because the syntax is vaguely similar
then you need to check for current locale
Ik it's as similar as car and carpenter but still i gotta decide which one should i learn first
yeah, Date should do that right?
if it's US, then mon day year, else day mon year
ah
are you learning to learn or learning to make something?
like, do you have an end goal?
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++😮💨😮💨
then go with java, as you can use whatever you learn on 3rd sem
Fck keyboard
one way or another, you'll need to apply it onto something
prog knowledge quickly decays if not used
And about end goal i wanna learn react native and redux
depends on how fast you learn things, and what you consider "intermediate"
@quartz kindle can you help me with this, experienced 
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"
}
I always think about programming knowledge as "cant do" and "can do"
lmao
you either can program or you cant
Between beginner and master
Nice thought process
and what do you define as beginner and master?
If you know basics clearly
If you know everything about it
well, that's a scale that goes from 0 to infinity
you have eslint 9 but ts-eslint/parser uses eslint 8, so npm doesn know what tf to do
hard to define where infinity / 2 is
npm is dumb
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
...
thanks, experienced ❤️
reach native is js
reach native
redux too from what google told me
My friend told go for java then javascript them react.js then react native
ignore your friend
yeah, the path forks 90º there
So what should i do
if you wanna learn react native, then learn react native
Bruv i gotta learn other languages too
here's mine:
python -> javascript -> (brief period: java -> c#) -> typescript -> c -> c++ -> rust
you learn based on what you need to know
- figure out what you want to do
- figure out what you need to know to do that
- learn it and do it
I'm currently studying c++ in college
Honestly Java -> TypeScript -> C++ -> Rust was mine
(With some others in between like C# but that’s basically Java)
i dont know much about java or c# lol
well from my knowledge of js and c it should be quite straight forward
my path was
expression 2 -> c -> c++ -> pascal -> js -> deplhi -> java -> lua -> python -> c# -> jsfuck -> groovy
Not really close to the same language
jsfuck lmao
But you’d probably be fine, they’re easy to learn
Java/C# are the best first languages imo
yup, i've familiarized myself with gradle
Gradle sucks and I hate it but it’s also not as bad as CMake
CMake is decent but like C++ package management in general is awful
just be a javascript one trick pony monochampion
(And earn the experienced role in the meantime)
C++'s ecosystem is a giant mess
Aight imma go for java and then javascript
Just keep in mind that Java and js are not nearly the same
its not an ecosystem, its an ecological disaster and mass extinction event
They have similar syntax and that’s about it
I KNOWW
well, syntax-wise they are
cmake is great if you're using it, not so much if you're using it
But so do many C-like languages
can confirm
still-maintained projects with 50k stars mixed with ancient projects from 1997
boost is the asteroid
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
I mean, it's a concise syntax
i got it all handled 
It is but it’s so simple that it’s genius
^
REST APIs?
pacemaker software
Etc
Honestly idk i just wanna learn different languages rn, I'm currently in 2nd sem so i got time to think about it
2nd sem in college?
Yeah
I wouldn’t wait because that mentality will lead to procrastination
I’m 2nd semester in college as well
Ik but i need some guidence
go with java, it's well estabilished and forces you to learn good practices
and it's a gateway to other c-like langs
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
Java will start in August when I'll be in 3rd sem idk till then if I'll forgot basics coz after basics of Java I'll go with javascript
Don’t wait for your classes to “teach” you
Coz I've learn html and css so i gotta complete that web dev thing
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
Nah i gotta learn before that
i'm glad i didn't take a CS degree and went for IT instead
People that come out of uni with just a degree and no actual projects or experience have a hard time getting a job
I joined college for sake of degree, rest i gotta learn myself
college java courses usually teach outdated approaches and use REALLY obsolete versions
CS sounds like way too much physics for me 
CS is two semesters of physics, it’s not that hard
So y'all tell me which languages should i go with
Java
Physics sucks now, i was good back then
physics is not really my thing
Too much intriguing
Physics is pretty easy ngl
Was*
Now I'm leaned towards coding
Maybe it’s because I’ve suffered through 2.5 years of physics but still
..
Okay😭
Not trying to be passive aggressive sorry
if ur reluctant in going with java then you already subconciously chose javascript
in which case go with js
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
No i wanna go with java but like I've learned html and css so it's like leaving web dev half behind
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
I'm in such a dilemma
Okay java it is then
it's not like you need to forfeit one to choose the other
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!)
Any playlists on yt from where i should learn
none
Personally I’ve learned (at least on a decent level) Java, C#, C++, Rust, Go, TypeScript, and some Python
languages evolve way too fast for yt to keep up
Java docs?
uhhh....well, somewhat but dont read it from the actual site
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
^^^ Oracle’s docs for java are pretty outdated and rough
Just think of a reasonable starter project (maybe a small terminal app) and look things up as you go
Nothing just for internship purpose (rn)
and javadocs is nigh unreadable from web
That’s the wrong motivation
you need a goal to learn
And also in 3rd sem it's java so gotta be prepared
like, I always try to make a snake game or a calculator
Internships should come from your passion for learning, your passion for learning should not come from trying to get internships
The thing is i wanna learn so much at one time I'm in such a dilemma
I’m struggling to find internships right now
US moment
Applied to 100+ and no interviews
have you tried freelancing?
Where y'all from
I am on a final interview with a summer camp STEM instructor for engineering though so that’s promising
US
southeast asia
brazil
You’ve got a wide variety of perspectives here :p
mr. worldwide
let's start it correctly: choose ONE simple project to make with java, doesn't need to be anything useful
just say "I'm going to make X" (not the social network)
Start off with something like basic user input and output
Something that takes a user’s name and outputs it backwards
Something like that
How about i keep a goal rn "a notes app"?
Or maybe even just takes user input and outputs it back to the console
What’s your name: Name
Hello, Name!
Etc
I've learnt python on a beginner level and learning c++ so not that much basic
Just to learn the basics of how to declare variables and such
blud went from python to c++ 💀
That’s still pretty basic
a notes app will involve a database, a way to get user input and a way to show data to the user
bro went from 0 to 100 real quick
this I'm talking about a common windows app, you dont want to go into mobile just yet
Basic C++ is not insanely hard, nor is Java. But it’s important to understand the fundamentals to move on to the intermediate concepts
My college bruv, blame it
start by laying the foundation
std::cout << was alien to me when i was still a beginner
you dont need a database for now, do the other steps beforehand: user input & data visualization
using namespace std; save dme
Too bad you never want to do this in the real world
shit way to introduce newbies tbf
Ohk
That’s what I hate about college, they don’t show you actual real world practices
What's...that💀
said below
Nobody would dare use using namespace std; at a top level declaration like they show in college
Difference?
uhm actually ```cpp
class Employee {
public:
std::string name;
int age;
}
GUI
its always that employee struct lol
CLIs are probably where you should start
^
yes, they're easier
GUIs are a lot to digest in other languages
Who would like to get output like that💀
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)
I do, but doesn't matter for now, you dont need to sell your app
me
Yeah just for personal use
Just for testing bruv😭😭😭
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
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
You told me what should i do but from where should i learn😭
What's git
A version control system, it’s for tracking different versions of your code
i still dont know what it does lmao
so your project will involve 4 knowledge areas:
1 - versioning
2 - user input
3 - data visualization
4 - database
i still think it as a github cli thingy
GitHub and git aren’t the same thing
Yeah
go by that sequence, should be easy enough
Git existed before GitHub as a local VCS
Should i learn from documentation?
Github basically shares that git repo on the internet so others can use it
It’s a fancier version of google drive pretty much
yes, but dont read it like a book
think about it as a cookbook
the only commands i know are git pull, git clone, git add, git commit, and git push 
git >>>
git checkout -b branch goes hard
for versioning, you only need to know 5 commands for now:
git init
git add .
git commit -m "Your message"
git push
git pull
or git commit -am
(And maybe setting up remotes and such to GitHub)
and git clone too
Where should i execute it
your command line
Link to java documentation
Also be careful not to run this in the root dir of your computer
then make a folder somewhere easy to find (this will be where your project will be)
Because it’ll start tracking all of your files under git and it sucks lmao
you dont need a site, you'll have it right on your hands
In vscode
but we'll get to this part, setup git for now
Should i go next next on it
no no, this will make you tire and give up
if you're going java then go with a proper ide
Oh yeah i remember I've it already
ok good, did you download and install git?
I'm downloading a 2024 version I've 2022 version
intellij or git?
Intellij
Where
Where tf is that setting thing
when you launch it should also show a popup saying there's a new version available
hmm, idk how different edu version is from community edition


