#development
1 messages · Page 108 of 1
just download intellij and let it handle it
no need to manually install or update jdk
idk man i just have bad experience trying to use gradle one time
then i try dotnet and 😍
ngl gradle is tricky to install if ur going manually
but with IJ u just click new project and select options where red
oh yeah it's totally not a fair comparison since i use VS for everything to do with C#
but C# make happy :D
it just kinda works yk
u should try groovy one day, it's awesome for scripting and quite fun to use
and has some cursed stuff like making an object out of an array
public Test {
Test(int a, int b) {
...
}
}
def t = [2, 5] as Test
public Test {
Test(int a, int b, int c, int d) {
...
}
}
def arr = []
4.times { arr << it } // same as "for (int it = 0; it < 4; it++)"
def t = arr as Test // same as "new Test(0, 1, 2, 3)"
I found battleless 2.0
Man makes even blog posts which basically just contains the responses of ChatGPT
ayo what
And apparently as of August 2021, the latest version apparently, Go was in stable version 1.17
Then the second edit claimed that it's in version 2.2. as of August 2021
And now it claims it's 2.2 as of 29 march 2023
Now they edited it again and it's apparently 1.2
how did youâ[][]re find this?
Yeah also seen it
Apparently has issues with apostrophes lmao
Maybe the fourth edit will be the final and correct one, who knows 
it bothers me the banner is "hire golang developers" but the site is about learning golang
Maybe because it's pasted
Who knows, may just be a coincidence
what's the easiest way to connect my serverhosted projects directly to my github so whenever i push changes it automatically takes them?
While you are discussing about dotnet and golang i've done some performance test with PHP (memory only) and i got shocking results:
Simple array sorting (with PHP Vanilla):
echo memory_get_usage();
$array = array([
"foxworn3365",
"foxworn3365",
"barbara d'urso",
"foxworn",
"pogiolo"
]);
sort($array);
echo "<br>".memory_get_usage();
Ram used (bytes): 664
Array sorting with object oriented arrays (my lib):
echo memory_get_usage();
$array = new NextArray([
"foxworn3365",
"foxworn3365",
"barbara d'urso",
"foxworn",
"pogiolo"
]);
$array->sort();
echo "<br>" . memory_get_usage();
Ram used (bytes): 640
It's crazy because with the __construct function of the object NextArray i do some checks and it import this array with another function:
new NextArray(array $array = NULL)
| if ($array !== NULL)
+ NextArray::internalImport($array)
| | if ($array instanceof NextArray)
| | // is false so skipping to else statement
| | foreach ($array as $value) {
| | | NextArray::add($value);
try running it in a loop with like 1 million iterations
also measure time taken, not only ram usage
time taken is slightly higher
HE DID IT!
Fourth edit is finally accurate 
anyways I still need a name for this lib 😢
Fuwu
Array2
i'll ask to chatgpt
library also manages string and associative arrays
guys anyone here uses aoi.js (no bullying pls lol)
nop
also, bullies SkyOPG
Either way drop the php
how is it possible to do a check for voters?
By asking in #topgg-api and waiting for an answer there
rip

like top.gg voters? if aoijs does not have a built in stuff for that then you'd have to implement your own
idk how aoijs works with custom non-aoijs code
okay then
Tf even is aoijs
$djsEval[]
same as dbscript and stuff
probably similar to those scripting weird things
Why the js?
idk
like botghost or whatever
to make it look cool
Lmao
no botghost is bad
yes
not anymore™️
they're equally bad 
It's like people around here that call salad sandwich "X Salada"
with the new v7 it becomes a standalone package
Even tho the X actually means Cheese and the sandwich doesn't contain cheese
discord.js will be removed for good
it does, at least i get cheese on mine
lmao
Around here the best you'll get is a chicken burger with lettuce and tomato
and its X burger because X in portuguese is pronounced "shiz" which sounds like "cheese", ergo X burger = cheese burger
cool, but for now it seems its in a very early stage, i took a look at the v7 repo and theres basically nothing there yet
its v7 dev so
aoi.js@dev installs v7
which is not changed yet
not yet it seems
@dev is currently linked to 6.0.0-dev.3979fab.1661655211
not yet v7
unless im in the wrong repo/package
anyways did you try asking about the voting thing in the aoijs server?
no
good idea tbh
if its not ig its time to make a custom function
if you want to use the top.gg rest api endpoints you can use this
$httpRequest either posts to or retrieves data from an API.
but if you want to run a vote webhook its a different story
theres also this for json requests https://aoi.js.org/docs/functions/Misc/jsonRequest
$jsonRequest will send a GET request to a given URL.
not a webhook, just adds an amount of stars to the user
very bad idea
$createObject
objects are easier and work on slash
thats not the point
json/http request is for you to access the top.gg api and get vote data
yeah, i guess its time to go to ask the server ig
welp thats literally how aoijs wants you to access external apis
according to their docs
I keep getting this error:
/home/runner/Gage/SlashCommands/General/movie.js:40
const movie = body.results[parseInt(pages) - 1];
^
TypeError: Cannot read properties of undefined (reading 'NaN')
at Object.run (/home/runner/Gage/SlashCommands/General/movie.js:40:29)
In this part of code:
const movie = body.results[parseInt(pages) - 1];
if (!movie) {
throw `I couldn't find a movie with title **${query}** in pages: ${pages}.`;
}
Side note: "pages" is an integer argument representing the amount of result pages it shows.
Result pages for movie results. The command is a movie searcher basically. You search for movies with your query, and one page of results will pop up. Yet, if you put in lets say 2 pages. It sends 2 pages worth of results.
results is undefined
show where ur declaring it
actually
pages is not returning a number too
but show where u declaring body
Alrighty
const body = await request(url)
.then(({ body }) => body.json())
.catch(() => {
throw `I couldn't find a movie with title **${query}** in pages ${pages}.`;
});
yes
Alrighty
then check if typeof body is string
if it is a string, then it fell into the catch
if it isn't, it'll be the body of the request
u can also make it return an empty object and check if (!body)
btw u don't need to put return, simply remove the braces like u did in then
parseInt(pages) is also returning NaN, so you might want to check that
probably pages is also obtained from the request body
if (channel && !channel.isText()) return;
^
TypeError: channel.isText is not a function
what s the problem
Version?
13
Are you sure?
"discord.js": "^13.9.2",
upgrade to 13.14.0
of discord.js
it's an issue with the earlier versions
which was fixed
is there any way to check the authorization thing through flask webhook?
i tried testing it and theres no authorization data in it
{'user': 'id', 'type': 'test', 'query': '', 'bot': 'id'}
Hi
thanks
is there any way to run discord.py bot and flask at the same time?
is there smtg wrong with the discord servers? My discordjs buttons suddenly stop working
/app/node_modules/discord.js/src/client/actions/InteractionCreate.js:48
if (channel && !channel.isText()) return;
^
TypeError: channel.isText is not a function
did you update djs?
nope
didnt touch anything
i seee..alright thanks
is there like a discord official server or smtg to keep track of what are they messing about at their side? haha
thanks! yeah...thats weird
is there any way to run flask and discord.py at the same time?
https://stackoverflow.com/questions/48693069/running-flask-a-discord-bot-in-the-same-application see this
I am building a Discord bot in Python and would like to receive HTTP requests from Twitch.tv's API (See Webhooks Guide & Webhooks Reference) (To subscribe to events like; X streamer has gone li...
I used to do it, can’t remember the actual code for it but this is what helped me
they dont seem to be working
AttributeError: loop attribute cannot be accessed in non-async contexts. Consider using either an asynchronous main function and passing it to asyncio.run or using asynchronous initialisation hooks such as Client.setup_hook
i tried using threading and now the bot.run got executed twice
my god i feel like i found battleless' alt account, not possible it's someone else, acting exactly the same way
exactly the same 
Hello, I have an error in my terminal, when I want to start my bot. I get the following:
`const fetch = require("node-fetch");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\catri\OneDrive\Escritorio\YaoiBot\node_modules\node-fetch\src\index.js from C:\Users\catri\OneDrive\Escritorio\YaoiBot\index.js not supported.
Instead change the require of C:\Users\catri\OneDrive\Escritorio\YaoiBot\node_modules\node-fetch\src\index.js in C:\Users\catri\OneDrive\Escritorio\YaoiBot\index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (C:\Users\catri\OneDrive\Escritorio\YaoiBot\index.js:4:15) {
code: 'ERR_REQUIRE_ESM'
}`
Do you know what could be happening and what can I do? Thank you so much.
Oh
A quick google search would've answered your question
Wow hehe, thank you.
🙂
Aaah ok, I had the old version installed. I have to install the new one. Thank you very much for your help.
Hello, I have another question, I got this error when solving the previous one, when I wanted to start my bot. What can be happening? Thank you Jeje.
`throw new DiscordjsTypeError(ErrorCodes.ClientMissingIntents);
^
TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\catri\OneDrive\Escritorio\YaoiBot\node_modules\discord.js\src\client\Client.js:489:13)
at new Client (C:\Users\catri\OneDrive\Escritorio\YaoiBot\node_modules\discord.js\src\client\Client.js:78:10)
at Object.<anonymous> (C:\Users\catri\OneDrive\Escritorio\YaoiBot\node.js:12:16)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'ClientMissingIntents'
}`
I will let you do it yourself this time
Jsjs, well, okay. Thank you. It seems to be easier to actually search.
Hey Krypton! Please remember the #development etiquette
Thank you!
#development message
Teaching people how to search is not a bad thing, but sure whatever
Probably not but should've worded it better I suppose
Krypton seems to be in a bad mood 
qt
today has been "super fun" for me. I'm trying to seriously learn c++ just so I can make nodejs addons and this one will be for timidity, a library that converts midi files to wav
I have never wanted to off myself more
it is worth it though since one of my donators has put midi support very high on the requested list and the only midi libs I've found that don't suck are for browsers
not sure who kibbab is
sounds like a chill dude
guys wil this work with sqlite
SELECT
t1.type,
t1.value,
t1.timestamp,
((t1.value - t2.value) / t2.value) * 100 AS percentage_increase
FROM
data_table t1
INNER JOIN
data_table t2
ON t1.type = t2.type
AND t1.timestamp > DATETIME('now', '-2 hours')
AND t2.timestamp >= DATETIME('now', '-2 hours', '-1 hour')
AND t2.timestamp < t1.timestamp
GROUP BY
t1.type, t1.value, t1.timestamp
HAVING
percentage_increase = MAX(percentage_increase)
ORDER BY
percentage_increase DESC;
try it and see
gonna suggest to give the tables understandable names
to avoid confusion later on
depending on sqlite version,
ON t1.type = t2.type
AND t1.timestamp > DATETIME('now', '-2 hours')
AND t2.timestamp >= DATETIME('now', '-2 hours', '-1 hour')
AND t2.timestamp < t1.timestamp
could fail
you also need to group by percentage_increase, as its included in the select
my struggle is over
I have defeated the cryptic thing known as midi playback
I hate c++
good job
why
no
why
not at pc
then go to pc and try it yourself
dead chat
You would actually know if you'd try it
but
why
bc i'm not able to try
Because you cant "AND" inner joins
i wouldn't use Chat GPT for advice
You can
well
Agreed
Basically you're adding additional comparison for the join
Can you actually?
Never worked on my end, or im confusing a different limit with it
It's almost required for composite key joins
Either that or joining a third table
Yep
i understand that Chat GPT can be good for stuff you have questions on, but it really doesn't know much on how programming works and gives code that is straight nonsense. unless you're able to be really specific for it to understand otherwise it won't work
well
ill see if it works
it does partially work because i ran it and there were no errors, but there was no data so ill have to try again when i get some
surprised
big brain
Hi im getting a tokenInvalid error but reset my token multiple times
What token
Discord token
Nice assumption 
Very nice assumption indeed
You were resetting your tokens but you weren't even providing the token to the library properly
Wym
Look in the error
Check how you're giving the lib the bot token
It's either not a string or null/undefined or anything falsey
it seems like it was overrided
also i think the new discord.js version it makes you put your token twice in two different spots
which version of discord.js are you using?

guys how can i make a grid system in canvas
hey guys, is there a channel here where I can put a job ad for discord bot dev (python)?

no
sadly
python sucks anyways
😄
I'd say it depends
do you guys know a place where I could put a job ad on?
looked into Discord Developers guild
i use 14.8.0
if your hiring a serious developer then go on any hiring website
On websites made for that purpose
theres loads of them
assuming you read the documentation you have something like this in the code:
const rest = new REST({ version: '10' }).setToken(TOKEN);
hm, to hire from a community of active and passionate discord devs seems more intuitive
yeah you need to put the token there too^^
don't need like 1000+ apps 😄
no
#verified-jobs?
then don’t accept 1000 applications
oh they got rid of that
tho does antone have answer to my wuestion
what question
this
um
um?
no
no
it says in the channel description
The problem is is that while this channel is for sure for help, questions like that and a lot of other questions we've seen you ask take 2 seconds of googling to find. We encourage people to learn and try to learn before asking here and discourage people getting spoon fed.
why did d.js fard (i didnt even change the code for days and this happened for some reason)
upgrade to the latest version of 13 or 14
whichever version you use
that was fixed
this is very complex
i need a helping hand
a helping hand would slap you in the face
your a liar
i am officially blocking you and waffle
're
lol
Node events' event emitter not receiving when emitting
fixed
Why my bots avatar is not displaying in website i changed it
Cache~~?~~!
he does
You have to wait, cache

Thx
can anyone help with my issue ☹️ ?
no
how old are you if I may ask?
old enough
you definitely dont act like it
don't act like what?
like a normal person
...and I suppose you should move on from here because you already ruined your reputation
then dont expect anything
yeah, its insane that people like that think what they are doing is normal
❤️🔥
he’s just delusional
can anyone help !?!
take a hint
Your name is quite misleading, I think you're having quite the battle here
no
no one is battling
🥸
and then there's me, the dumb one who still tries to help
with math, like total width divided by number of columns = width of each column, multiplied by column number = X position of the column border, same for rows
drawImage accepts parameters for resizing and repositioning the content, so you can match it with the X,Y,width,height of said column and row
Hello
hi
const { createCanvas, loadImage } = require('canvas')
const {AttachmentBuilder} = require('discord.js')
module.exports = async(data, progress) => {
const canvas = createCanvas(960, 1280)
const ctx = canvas.getContext('2d')
let background = await loadImage('./src/img/background.png')
ctx.drawImage(background, 0, 0, canvas.width, canvas.height)
let album = await loadImage(data.thumbnail)
ctx.drawImage(album, 168, 470, 640, 640)
ctx.lineWidth = 5
ctx.strokeStyle = '#ffffff'
ctx.strokeRect(168, 470, 640, 640)
ctx.font = 'bold 60px sans-serif'
ctx.textAlign = 'center'
ctx.fillStyle = '#ffffff'
ctx.fillText(data.title.slice(0, data.title.indexOf('(')), 480, 150)
ctx.font = 'bold 40px sans-serif'
ctx.fillText(data.author, 480, 200)
ctx.font = 'bold 30px sans-serif'
ctx.fillText(progress, 480, 340)
const attachment = new AttachmentBuilder(await canvas.toBuffer(), {name: 'nowplaying.png'})
return attachment
}```
Hey I need help stabilizing my bot.
When I create an image the bot "bug".
To be more precise my bot plays music and when I create an image for half a second the creation time and once the image create the music resumes.
Is there a way to fix this?
any error?
None, just the music cutting off and on
It's strange to explain, but I can show you if you want?
As a video or come in the voice channel with me
discord.js@14.8.0 for bot
discord-player@6.1.1 for music
canvas@2.10.2 for image
at three seconds we hear the cut while the image is being created
If I’m understanding correctly it’s probably a threading issue
Js is single threaded so it’s possible that canvas is blocking the thread while it does some heavy lifting to create your image
I understand, and is there a parameter applicable in the launch to not limit the threads?
You will probably need to spawn a child process dealing with your image generation, I assume
ok? i have no idea how to do this 
Well developing is a continues learning curve 
child process works thanks
👍
can i ask about OS questions here
Channel for chatting about development.
oh
I dont see why not depending on the kind of question
That's why I sent that
If they believe it's related to development, can ask
If it's how to turn off a setting in a horrible windows OS, doesn't really belong here
I did not change the code I do not understand why it gives that?
Image 1 on debian and image 2 on windows
Because that's how OSes works, they don't have the same character encoding. So you will not get the same characters on two different OSes, especially if they're weird characters like a circle.
wait are you generating the image
are you generating an image or sending it as a message
if you're generating it as an image its just a matter of installing the right font
(not related ik but idk where else to ask) is anyone else getting missing channels when using the new onboarding feature?
I'm trying to send a GET request to gin-gonic backend server
const { data, headers } = await axios("http://192.168.178.2/users/@me", {
method: "GET",
withCredentials: true,
headers: {
Authorization: `Bearer ${token}`,
},
})
but some how the server cannot read the Authorization header. I tried to play with Origin header and stuff, but still doesn't work
func CorsMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
header := c.Writer.Header()
header.Add("Access-Control-Allow-Origin", "*")
header.Add("Access-Control-Allow-Methods", "DELETE, POST, GET, OPTIONS")
header.Add("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With")
c.Next()
}
}
When I log the Authorzation header, it says null
what webserver are you using?
it might be stripping the auth header
Also consider not using Axios, it's very bloated and is a root source of very strange bugs and errors, use https://undici.nodejs.org/
A HTTP/1.1 client, written from scratch for Node.js.
what do you mean?
I call it from frontend, I think nodejs doesn't support their
like pure javascript
sometimes the auth header gets stripped before reaching the destination
pure javascript has fetch
I'm using go-gin as backend and react native + axios
tried fetch() too, it doesn't work
I think my firewall is blocking the Authortization header or something
If I use X-Token it works
I don't touch the Firewall or something, I still don't why
it's the thing I said, I still don't get why is that a good thing
are you possibly using it behind cloudflare or something?
or some other proxy-like service?
You're editing/adding to a copy of the headers and doing nothing with it. Your code is doing absolutely nothing
c.Writer.Header().Add()
well the headers are being added or set
because I get response
the server is behind cloudflare but i'm testing on local and both doesn't work
{"access-control-allow-headers": "X-Token, Authorization, Accept, Accept-Encoding, Content-Length, Content-Type", "access-control-allow-methods": "DELETE, GET, POST", "access-control-allow-origin": "*", "content-length": "72", "content-type": "application/json; charset=utf-8", "date": "Fri, 31 Mar 2023 15:27:54 GMT"}
And how do you print the sent header's value
You should allow the OPTIONS method for preflight requests made by the frontend
And handle these requests as well
in your opinion 3.5 seconds are too much for detecting verbs in a Italian phrase?
I remember that Italian is a complex language with lots of "people" (Like you, we and they are completely differents)
(It took 3.5 seconds to handle the following sentence: "Ciao mi chiamo federico vivo da solo in soffitta con molta ansia oppure paura non ne ho idea" (In english: "Hi my name is federico I live alone in the attic with a lot of anxiety or fear I have no idea"))
yes 3.5s is a lot
but the italian language has 20'000 verbs and for each verb about 8 tenses and for each tenses we have 6 different declination outputs 
map
verb
|
+-- present
| |
| +- io (I)
| +- tu (you)
| +- lui (she/he/it)
| +- noi (we)
| +- voi (you)
| +- essi (they
|
+-- past
... etc ...
Example with a verb
mangiare (eating)
|
+-- present
| |
| +- io mangio (I eat)
| +- tu mangi (You eat)
| +- lui mangia (he/she/it eats)
| +- noi mangiamo (we eat)
| +- voi mangiate (you eat)
| +- essi nangiano (they eat)
|
+-- past
... etc ...
but we have three declination outputs so this is only for the 1° declination
eventually the program in those 3.5s does this with all three verbs:
1) For each termination he removes from every word the termination
2) For each verbs (20'000) he removes the "end" (each declination have an end: "are", "ere", "ire")
3) Compare the word without termination with the verb without end
The 6 declination to which I referred earlier are the 6 persons that Italian has, I carelessly used the wrong term
use a binary tree
you can also build a lookup table for results
that way it'll only take long the first time
classification would complicate things even more because I cannot trace the declination from the verb used in the sentence
However, in Italian the concordance of verbs (only for tense and person) is often mandatory since it comes directly from Latin.
When I implement well a function that will use this trick it will take that long just to find the first verb that will suggest person but impose the time of the verb for searching the others
the what?
Van i give you a suggestion @sterile vault
Can*
Handling verbs, norms etc yourself is as painful as making your own timezone handler/time date handler
lol
there aren't PHP libraries for italian verb handling so i have to do by myself :(
In addition, Italian grammar is difficult to handle as it is full of exceptions and divergences
When I implement well a function that will use this trick it will take that long just to find the first verb that will suggest person but impose the time of the verb for searching the others
From 3.5s to 1.25s
still good job trying 
oh good job!
Does someone know a script or even better a GitHub Action to check for outdated docker images in docker files in this repo?
Like it messages me or creates an issue or whatever when a docker file has an older version of the image than the newest.
Hi how are things? I have an error with my code to start my bot, does anyone know what could be happening and what can I do? Thank you.
`throw new DiscordjsError(unrecoverableErrorCodeMap[error.code]);
^
Error [ShardingRequired]: This session would have handled too many guilds - Sharding is required.
at WebSocketManager.createShards (C:\Users\catri\OneDrive\Escritorio\YaoiBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:250:15)
at async Client.login (C:\Users\catri\OneDrive\Escritorio\YaoiBot\node_modules\discord.js\src\client\Client.js:226:7) {
code: 'ShardingRequired'
}`
The error is pretty descriptive.
Once a bot gets to a certain number of guilds it will need to be sharded.
You can read your libraries docs for more information.
Thanks hehe, now I understand. I must have a better host team for the bot then.
However, I really have a problem... I have, apparently, the code well done to make it work. I try to put the command, that the prefix is "ya!", but it absolutely does not happen, the console does not send me any type of error.
Did you install the module?
boat
Hey I have this code-
let a = 125897;
a = a.toLocaleString('en-US');
console.log(a);
// Output: 125,897```
I want to display the number like this- 1,25,897 (in Indian number system.)
How can I do that?
And what is that?
You can find it in Google
Ohk
i want to overwrite var in css and i am using lightingcss
You quite literally just did that...yourself?
well i cant do it
🙏
Lol I forgot
"message":"channel.isText is not a function"
getting this error on my button interactions why? it used to work fine before
discord fucked up
then djs fucked up
and somehow they broke stuff
so now you need to update djs
also afaik isText has been renamed to isTextBased
bruhhhh
to v14 or?
i am on v13 currently not latest pretty sure
how can they fuck up interactions bruh
Yes, you will have to check one bot per month if you want your bot to stay on the site
Otherwise, it will be deleted
Hi
What is the next lib for discord.js?
create your own lib
discord.js2
but its only for js2, not for js
discord just pissed out a lot of bot dev :)))
is this because its depreciated
yes
NO WAY
lmfao
ain't no way bro believed that ☠️
if it wasn't april fools probably
can someone know where the dyno bot is, not the normal one but like the rainbow one
In the sky
After i did Authorisation in my bot its not added to authorized apps
whenever you see this specific line, install whatever is written inside quotes
are all the emojis in these groups the only options to use for emojis in select menu items? Is this the full list? I tried using ✎ as an emoji, but Discord give a 400 error when i use that emoji
good
emoji: {
name: "🏆",
id: null
}
Bad
emoji: {
name: "✎",
id: null
}
thanks!
guys the time has come, i need to start to work on a desktop program with java. Suggest me some frameworks etc etc and IDE's
there's not really much option regarding framework, you'll deal with Swing like it or not
for IDE the only sane option is IntelliJ
just as a note, it's better if you create components yourself than to use the specialized swing components (like grid)
like next?
next?
never used it, but that's because swing components are horrible to work with
like, you have a huge boilerplate just to add data to a grid
okay
it's much more maintainable if you create the components yourself (simply extend JComponent and write the logic)
okay
i kinda get it now
may ask u more questions as i go through the process
also is intelliJ available for Linux
I think so, it's made in java after all
and sure, feel free to ask, I'll answer if I can
if ur not constrained to java specifically, you can try to use groovy instead
it's a superset of java (like ts and js), and has a ton of QoL features like string interpolation
i have to use java for this one
just made the menu btw
Wait that’s sick
I still need to add a UI system of some sort into my engine
Unfortunately that’s not priority rn since I need to get tile maps and such going
(And fix my camera)
it's surprisingly easy to do it entirely through Canvas/JPanel
Look at the nerds talking
Hello team, I want to test the nft staking contract on the testnet so please someone explain which functions I need to call to set the reward just after the deployement of the contract So user can get reward after staking?.(this is staking contract address-> https://cronoscan.com/address/0x7ac1e36c85D42f9efA10339f35458bfA61D260Cf#code
...what?
I’m probably going to implement my own custom system for it
That’s a scam
I guess everything related to NFT on discord is a scam
give me money
It doesn’t really matter, I’d recommend either oracle or Amazon
oki ty
They both support the same stuff though
this is so confusing compared to what i have been using (only editors)
Just double click on the Main file
That’ll show you the code
Don’t worry about most of the tabs and buttons and such, when you have a use for them you’ll find them
If you’re ever looking for something specific, there’s a Find Action tool that might give you what you’re looking for
ctrl + alt + s -> appearance -> new ui -> enabled
the new ui is more friendly for newbies
Oh okay
I just turned off my pc cuz it gave me a seizure
Will do that tomorrow

It also looks much nicer imo
I'd recommend AdoptOpenJDK
OpenJDK to my knowledge is not fully free
Its ok i am kinda rich
oracle will bleed you dry
Hopefully not
it is, OracleJDK is the one that's not free
https://hatebin.com/aajkkqahys wtf is this Cmake error
intellij never downloads oraclejdk
Idek how I would begin to search google for a solution
No, I'm pretty sure OpenJDK is still problematic.
Oracle had a page about it somewhere but I don't know where it is
take one of the errors and plop it into google with quotes around it
I did it is unrelated to me
mainly cause they put the results in french and the translator doesnt seem to be working

the one answer I found on jetbrains clion forum thing that had the exact error I was facing didn't work
So idk
Imagine your language doesn't support named keys
That's just not how arrays work in general

@wheat mesa https://i.imgur.com/lzXiUCw.mp4
kinda finished the boss encounter
I just need to figure out how to spawn waves properly
undertale if it was good
Just spent all day doing nothing while my infrastructure is on fire

All of my audio nodes got rate limited within 3h post a new deploy I made so I just said fuck it
👀
I was trying to follow redirects in case some url search params became known when they're sometimes unknown, but something broke and tried to follow for all requests
short story I'm dumb
that coupled with being one of the few bots that supports INSERT SITE HERE
https://hatebin.com/aajkkqahys this shit is the problem null
I made sure Windows SDK is installed, added rc.exe to path and all that
@sharp geyser sussy path
no idea what that is
from the logs
that path is not likely to be correct
@earnest phoenix this is the problem
The linker is trying to use libraries that either doesn't exist on your system, or it doesn't know where they are, go to C:\Program Files (x86)\Windows Kits, what do you see?
a folder called 10
Open that directory, then open Lib, and then open the directory with the highest version number
Open um\x86
why not x64?
because the builder is 32bit methinks
Alright well I opened it
how can i draw an image in the center with canvas
get width
get height
divide both by 2, now you have the center point in X and Y
get the image width
get the image height
divide both by 2, now you have the image center point in X and Y
now set the drawing X and Y to canvas center point minus the image center point
example ```js
const X = canvas.width / 2 - image.width / 2;
const Y = canvas.height / 2 - image.height / 2;
drawImage(X, Y, ...)
why does it shows [object Object] in reason when I use kick?js <GuildMember>.kick({ reason: "Reason" })
Because reason should be a string, not an object
no like
It's more like .kick("Reason")
ok wait lemme try
i'm drawing these images on the canvas and because the image on the end has white space it's being pushed down so i wanna draw then all in the center so that doesnt happen
like the center of a specific y value
Yes, .ban() accepts ban options object
everything in canvas is done the same way, with X and Y coordinates
so if you want vertical centering, the process is the same, canvas height divided by 2 minus the image height divided by 2
im not sure where are you getting the "whitespace" thing, canvas does not care about whitespaces
i don't want it centered in the middle of the canvas
whitespaceeeeeeeeeeeee
perhaps you're using an image with transparent padding around it?
that could be the cause
GNU screen command
Open session and run command and exit?
like actually exit or just detach?
Reattach, run command, deattach
screen -dm [cmd]
missing the name of the session
being minecraft1 in this case
How can I get screen to execute a command and then detach (That is, automatically in a single script without further input beyond initially starting the script)? e.g. I run myscript.sh and it
tim how do i make my java program pretty
that just looks like the image is badly cropped
uninstall java sdk
yes this one
-dmS
or -dmS
both work
for example
dmS probably looks better lmao
but are essentially the same
what 💀
dont put the screen name in "" I think
screen names dont support spaces nonetheless iirc
correct
na
it does create it nonetheless
i swear it's backslash
that would work in node because it cancels the space
if i remember
oh yeah, keep in mind that you cant just send commands into screen sessions
^
you need to send a stdin into that session
How do I do that in a shell script
got it
/usr/bin/screen -S minecraft1 -X stuff "echo "stop\r""
just copy pasted
😩
fair enough
it's not like that happens in stack overflow
so how do i resolve
which program are you using
shell script
assuming linux with python?
const PortRegex = "^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$"
i hate regex forever
agreed
Thank god people spend their time on this madness
im people
😩
echo "password" | sudo -S reboot
didn't work
echo "password" | sudo -S -v
sudo reboot
Or it may have worked the one above but a bit too fast so
echo "password" | sudo -S sleep 1 && sudo reboot
could do the trick
All depends on your OS and sudo version you're running as well
Sometimes it's
echo "password" | sudo -kS reboot
as welll
The -S is definitely needed as it makes sudo read from STDIN
You setup a proper service
Is that your crontab list?
ima use nodejs + pm2 
No that's some command in a script
Just use the crontab then to start the script
crontab -e
Then add your line
@reboot /home/xx/xxx.sh
make sure the shell script is executable
If you're unsure it is or not change the permissions
chmod +x /home/aa/whatever.sh
which will make it executable without touchen other permissions
(unless it isn't already)
ouch
still learning discordjs, this should work right?
if (member.user.bot) return;
that will return if user is a bot.
awesome thanks
@earnest phoenix (or other compiler experts) pls help
what are the differences between a static library and a shared library, and why does the static one work on windows but the shared one gives link error 1181 cant read .lib file (there is no .lib file, only .dll file)
both are built with node-gyp
both is the same library, just one has type: shared_library the other has type: static_library on its gyp file
shared works on linux but doesnt work on windows, static works on both
a
a
Did you resolve your issue or do you still need help? If so what's inside that directory?
Static libraries are libraries where all it's functions/classes/structs/etc etc are all directly linked into the executable at compile time, which can make the executable size big depending on what you're linking into the executable (static libraries are .a on both Linux and macOS, and .lib on Windows). You take and use the entirety of the static libraries into your program, a whole copy
Meanwhile shared libraries are libraries that only the symbols of the functions/classes/structs/etc etc are compiled into the executable, the actual functions reside in other executables which are all shared to be used between other programs more easily without copying the entire library into the program (shared libraries are .so on Linux, .dll on Windows, and .dylib on macOS)
The reason the shared one doesn't work for you on Windows, I think you're setting something incorrectly because if it's trying to read a .lib file then that's incorrect because that's a static library, not a shared library, a shared library would be a .dll file
It could be just a simple compilation configuration mistake
all configuration is done by gyp
my bindings file is just this ```json
{
"targets": [
{
"target_name": "sweph",
"sources": [
"src/sweph.cpp",
"src/functions.cpp"
],
"include_dirs": [
"<!(node -p "require('node-addon-api').include_dir")",
"src"
],
"dependencies": [
"swisseph"
],
"defines": [
"NAPI_DISABLE_CPP_EXCEPTIONS"
]
},
{
"target_name": "swisseph",
'type': "static_library",
"sources": [
"swisseph/swecl.c",
"swisseph/swedate.c",
"swisseph/swehel.c",
"swisseph/swehouse.c",
"swisseph/swejpl.c",
"swisseph/swemmoon.c",
"swisseph/swemplan.c",
"swisseph/sweph.c",
"swisseph/swephlib.c"
],
"direct_dependent_settings": {
"include_dirs": [
"swisseph"
]
}
}
]
}
if i set type to static it works on both linux and windows
if i set type to shared it only works on linux, not on windows
Can you show me what error it exactly throws on Windows?
swecl.c
swedate.c
swehel.c
swehouse.c
swejpl.c
swemmoon.c
swemplan.c
sweph.c
swephlib.c
win_delay_load_hook.cc
Generating code
All 4 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
Finished generating code
swisseph.vcxproj -> D:\Projects\github\sweph\build\Release\\swisseph.dll
sweph.cpp
functions.cpp
win_delay_load_hook.cc
LINK : fatal error LNK1181: cannot open input file 'swisseph.lib' [D:\Projects\github\sweph\build\sweph.vcxproj]
(Also why is type in single quotes but everything else is in double quotes
)
Can you show me the link logs of the static library one as well?
Yeah I mean that, that's the link (or linking) logs
swecl.c
swedate.c
swehel.c
swehouse.c
swejpl.c
swemmoon.c
swemplan.c
sweph.c
swephlib.c
win_delay_load_hook.cc
swisseph.vcxproj -> D:\Projects\github\sweph\build\Release\\swisseph.lib
sweph.cpp
functions.cpp
win_delay_load_hook.cc
Generating code
All 713 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
Finished generating code
sweph.vcxproj -> D:\Projects\github\sweph\build\Release\\sweph.node
it looks like sweph is looking for a static dependency on both cases, but gyp should handle that automatically from the dependencies object plus the type field
Is there a swisseph.lib file at all?
Well for some reason the linker is still looking for a .lib file when it should be looking for a .dll, that's strange that it looks for a .so correctly on Linux instead of looking for a .a
from what im seeing on the web, it apparently needs both the dll and the lib
but it doesnt compile the lib??
@_@
In which directory does it put the .lib or the .dll file it builds?
build/Release
Try adding this to your first target:
"libraries": ["-Wl,-rpath,./build/Release/"]
here is everything in the x86 folder
huh interesting, now it did make a .lib instead of a .dll
but
LINK : warning LNK4044: unrecognized option '/Wl,-rpath,.\build\Release\.lib'; ignored [D:\Projects\github\sweph\build\sweph.vcxproj]
Actually try this instead:
"libraries": ["-L<(module_root_dir)/build/Release/"]
Hmm... You don't seem to have any of the static libraries the linker is looking for
Try changing the build architecture of your project to x64 and try again
nevermind, i was building the static version not shared lol
switched back to shared, now this
LINK : warning LNK4044: unrecognized option '/LD:\Projects\github\sweph\build\Release.lib'; ignored [D:\Projects\github\sweph\build\sweph.vcxproj] LINK : fatal error LNK1181: cannot open input file 'D:\Projects\github\sweph\build\Release\swisseph.lib' [D:\Projects\github\sweph\build\sweph.vcxproj]
I can try
but idrk how to do that in clion
still no lib file, only dll file
"libraries": ["-l<(module_root_dir)/build/Release/swisseph.dll"],
D:\Projects\github\sweph\build\Release\swisseph.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2F0 [D:\Projects\github\sweph\build\sweph.vcxproj]
Go to File > Settings > Build, Execution, Deployment > Toolchains
And then choose Clang, and then change the architecture
What
Clang is not an option
if I want to use a custom compiler I have to do a system config and architecture is not an option
You can't just add a .dll as a library there, it must be a .obj, .lib, or .res file according to Microsoft
https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1107?view=msvc-170
yeah well the only way i can get a .lib is if i make it static
looks like I gotta download Visual Studio
https://paste.gg/p/anonymous/543484b18050476cae56f8b8aa709d16 well different error this time
it seems to be a rc.exe error unless I am reading it wrong
Go to the same directories I told you before, but instead of x86, go to x64, so you see mt.exe there?
Try putting conditions in your binding.gyp file, for example:
"conditions": [
["OS==\"win\", {
"libraries": ["<(module_root_dir)/build/Release/swisseph.lib"],
"copies": [
{
"destination": "<(module_root_dir)/build/Release/",
"files": "<(module_root_dir)/build/Release/swisseph.dll"
}
]
}]
]
And see what happens
There's also someone who wrote about this
https://www.anthonyvardaro.com/blog/how-to-link-dll-gyp
Anthony Vardaro, Software engineer
D:\Projects\github\sweph\build\sweph.vcxproj(162,5): error MSB4035: The required attribute "Include" is empty or missing from the element <CustomBuild>.
i saw that before, but like all others, it assumes i have a .lib file
i mean, i could just build it twice lol, once as static and another as shared
that way i'd get both .lib and .dll
but that sounds so stupid
But I guess you have no other choice, I don't have much experience with node-gyp but I suppose doing that is the correct way
or i just give up
and make it static only
thats pretty much what i always had until now
but i saw somewhere that the recommended thing is to set type to <(library) instead of hardcoding it, so it can be configurable from cli at install time
but then it defaults to shared and fails on windows unless the user does npm install --library=static_library
Well if it fails then you have no choice but to hard-code it :^)
Or build it twice
Interestingly this is how node-canvas does it
https://github.com/Automattic/node-canvas/blob/master/binding.gyp
yeah i saw that as well
their situation is a little different, their dependencies are system installed
on another note
i was finally able to setup an aws lambda from a docker image
only took the whole day
jesus fucking christ they couldnt have made it any more complicated if they tried
why does sqlite do this
i think you're supposed to end your queries with a semicolon
otherwise it expects more stuff
but idk never used the sqlite cli
ohhhh
forgot abt that
ty
guys
why does this not work
SELECT
t1.type,
t1.value,
t1.timestamp,
((t1.value - t2.value) / t2.value) * 100 AS percentage_increase
FROM
history t1
INNER JOIN
history t2
ON t1.type = t2.type
AND t1.timestamp > DATETIME('now', '-2 hours')
AND t2.timestamp >= DATETIME('now', '-2 hours', '-1 hour')
AND t2.timestamp < t1.timestamp
GROUP BY
t1.type, t1.value, t1.timestamp
HAVING
percentage_increase = MAX(percentage_increase)
ORDER BY
percentage_increase DESC;
🙁
well
it's literally not working
it's not returning anything
what else do i say
Well doesn't match your conditions then if no error occurs
Then remove condition by condition and debug which one isn't right
The question is what data type is that column
Yeah the type should have timestamp as name at least as alias
what
Just use t1.timestamp > NOW() - INTERVAL 2 HOUR
what
what what
idk what that means
SELECT
t1.type,
t1.value,
t1.timestamp,
((t1.value - t2.value) / t2.value) * 100 AS percentage_increase
FROM
history t1
INNER JOIN
history t2
ON t1.type = t2.type
AND t1.timestamp > NOW() - INTERVAL 2 HOUR
AND t2.timestamp > NOW() - INTERVAL 3 HOUR
AND t2.timestamp < t1.timestamp;
Try that as first
Took me ages to edit that on mobile
Tf really?
the only place I saw HAVING is in firebird
Thought it may be an alias of something else
lmao
Don't really know if the type columns even match
Literally got 0 informations
Since he didn't say anything about an error occurring I'm now really confused about that keyword
@hushed robin did you try what I wrote you?
Not surprising they're using GPT instead of trying to learn sql
SQL ain't complicated but dealing with sql errors is the master discipline
no
Error: near "2": syntax error
it's complicated
i'm not wasting my time learning SQL
what
there are the same
i copied and pasted
and got error
Error: near "2": syntax error
yeah there's no syntax error... must be sqlite specific or I am blind
missing a space maybe after hour?
or in between
If you think your wasting your time learning something then you should just drop the project entirely. SQL is pretty much english.
SELECT <something> WHERE <thing> = <something>
yes
ik how to do that
thats simple
this is much more complex
and i am not quitting
maybe you are a quitter i am not
wait, could be needed to use ( )
not a quitter indeed
yes
its very complicated
SELECT t1.type, t1.value, t1.timestamp, ((t1.value - t2.value) / t2.value) * 100 AS percentage_increase
FROM history t1
JOIN history t2 ON (t1.type = t2.type AND t1.timestamp > (NOW() - INTERVAL 2 HOUR))
ORDER BY percentage_increase DESC;
test this
i dont even know the table structure
same error
and i dont even know if that join method makes sense at all
id (integer) | type (string) | value (integer) | timestamp (integer)
Imagine using keywords to name 2 columns
Hi, I have a problem... I have, apparently, the code well done to make it work. I try to put the command, that the prefix is "ya!", but it absolutely does not happen, the console does not send me any type of error.
is history t1 and history t2 the names of the tables?
history is the name
Did u enable message intent?
I'm not even sure if the SQL timestamp data type even is an integer or internally being managed differently
Timestamp is a double afaik
then what is t1 and t2?
how many tables do you have?
2
what are their names
games and history
Yes, it's all. Can I show you my code?
lol
then chatgpt gave you bad code
t1 and t2
I'm at mobile, but sure
JOIN is used to merge multiple tables, it makes no sense to use JOIN on the same table
Depending on the length I might not be able to understand it
okay hehe, a moment..
bru
you use JOIN if you want to select stuff from both history and games tables
no i don't
well...
everything is in the history table
then why join lol
what do you wanna show then?
bro
which table
chat gpt gave me it
It may be a bit long. But I won't show you everything, just the important part, what should be working.
history
