#development

1 messages · Page 108 of 1

scenic kelp
#

i kinda wanna try kotlin but i don't want to deal with jvm nonsense

lyric mountain
#

just download intellij and let it handle it

#

no need to manually install or update jdk

scenic kelp
#

idk man i just have bad experience trying to use gradle one time

#

then i try dotnet and 😍

lyric mountain
#

ngl gradle is tricky to install if ur going manually

#

but with IJ u just click new project and select options where red

scenic kelp
#

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

lyric mountain
#

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
scenic kelp
#

that looks just a little scuffed but like

#

reasonable scuff

lyric mountain
#
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)"
earnest phoenix
#

I found battleless 2.0

#

Man makes even blog posts which basically just contains the responses of ChatGPT

lyric mountain
#

ayo what

earnest phoenix
#

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

lyric mountain
earnest phoenix
#

Yeah also seen it

#

Apparently has issues with apostrophes lmao

#

Maybe the fourth edit will be the final and correct one, who knows cat_clown

lyric mountain
#

it bothers me the banner is "hire golang developers" but the site is about learning golang

earnest phoenix
#

Who knows, may just be a coincidence

slender wagon
#

what's the easiest way to connect my serverhosted projects directly to my github so whenever i push changes it automatically takes them?

sterile vault
#

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);
quartz kindle
#

also measure time taken, not only ram usage

sterile vault
earnest phoenix
#

Fourth edit is finally accurate kekwclap

sterile vault
#

anyways I still need a name for this lib 😢

quartz kindle
#

FoxArray

#

ArrayFox

#

F-Array

#

Farr

sterile vault
#

Fuwu

quartz kindle
#

Array2

sterile vault
#

i'll ask to chatgpt

quartz kindle
#

BetterArrays

#

OOPArray

sterile vault
#

there are my best ideas

#

but i can't decide

quartz kindle
#

none of them have array in it

#

:^)

lyric mountain
#

YAArr

#

Yet Another Array

sterile vault
misty mantle
#

guys anyone here uses aoi.js (no bullying pls lol)

earnest phoenix
quartz kindle
#

also, bullies SkyOPG

earnest phoenix
misty mantle
#

how is it possible to do a check for voters?

earnest phoenix
#

By asking in #topgg-api and waiting for an answer there

misty mantle
sterile vault
quartz kindle
#

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

lyric mountain
#

Tf even is aoijs

misty mantle
quartz kindle
#

same as dbscript and stuff

earnest phoenix
#

probably similar to those scripting weird things

quartz kindle
#

bdfdscript

#

ids

lyric mountain
#

Why the js?

quartz kindle
#

idk

earnest phoenix
#

like botghost or whatever

earnest phoenix
lyric mountain
#

Lmao

misty mantle
quartz kindle
#

i mean, its a js lib

#

it uses discord.js under the hood

misty mantle
misty mantle
earnest phoenix
#

they're equally bad CLk_Kekega

quartz kindle
#

what do they use now

lyric mountain
#

It's like people around here that call salad sandwich "X Salada"

misty mantle
lyric mountain
#

Even tho the X actually means Cheese and the sandwich doesn't contain cheese

misty mantle
#

discord.js will be removed for good

quartz kindle
#

lmao

lyric mountain
#

Around here the best you'll get is a chicken burger with lettuce and tomato

quartz kindle
#

and its X burger because X in portuguese is pronounced "shiz" which sounds like "cheese", ergo X burger = cheese burger

lyric mountain
#

I find it funny when people name "X Queijo"

#

Cheese cheese

quartz kindle
misty mantle
#

aoi.js@dev installs v7

#

which is not changed yet

quartz kindle
#

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?

misty mantle
#

good idea tbh

#

if its not ig its time to make a custom function

quartz kindle
#

if you want to use the top.gg rest api endpoints you can use this

#

but if you want to run a vote webhook its a different story

misty mantle
#

not a webhook, just adds an amount of stars to the user

misty mantle
#

$createObject

#

objects are easier and work on slash

quartz kindle
#

thats not the point

#

json/http request is for you to access the top.gg api and get vote data

misty mantle
quartz kindle
#

welp thats literally how aoijs wants you to access external apis

#

according to their docs

idle coral
#

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.

lyric mountain
#

show where ur declaring it

#

actually

#

pages is not returning a number too

#

but show where u declaring body

idle coral
#

Alrighty

        const body = await request(url)
        .then(({ body }) => body.json())
      .catch(() => {
        throw `I couldn't find a movie with title **${query}** in pages ${pages}.`;
      });
lyric mountain
#

don't throw inside a catch block

#

instead make it return a value or smth

idle coral
#

What should I use instead?

#

Return?

lyric mountain
#

yes

idle coral
#

Alrighty

lyric mountain
#

then check if typeof body is string

idle coral
#

Sorry wifi is slow, didn't load.

#

Alright, thanks

lyric mountain
#

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

lament rock
#

parseInt(pages) is also returning NaN, so you might want to check that

quartz kindle
#

probably pages is also obtained from the request body

earnest phoenix
#

if (channel && !channel.isText()) return;
^
TypeError: channel.isText is not a function

what s the problem

deft wolf
#

Version?

earnest phoenix
#

13

deft wolf
#

Are you sure?

earnest phoenix
#

"discord.js": "^13.9.2",

hushed robin
#

upgrade to 13.14.0

#

of discord.js

#

it's an issue with the earlier versions

#

which was fixed

dense ivy
#

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'}

boreal iron
#

You need to check the header

#

It's part of the header

abstract oak
#

Hi

dense ivy
#

thanks

dense ivy
#

is there any way to run discord.py bot and flask at the same time?

atomic sun
#

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

atomic sun
#

nope

quartz kindle
atomic sun
#

didnt touch anything

spark flint
#

Update

#

What version are you running

#

For v13, update to v13.14.0

atomic sun
#

i seee..alright thanks

spark flint
atomic sun
#

is there like a discord official server or smtg to keep track of what are they messing about at their side? haha

spark flint
#

But this was a silent change

atomic sun
#

thanks! yeah...thats weird

dense ivy
#

is there any way to run flask and discord.py at the same time?

spark flint
#

I used to do it, can’t remember the actual code for it but this is what helped me

dense ivy
#

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

dense ivy
#

i tried using threading and now the bot.run got executed twice

dense ivy
#

nvm, i found a way to fix it

#

thanks

earnest phoenix
#

my god i feel like i found battleless' alt account, not possible it's someone else, acting exactly the same way

#

exactly the same kek

queen rover
#

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.

queen rover
#

Oh

earnest phoenix
#

A quick google search would've answered your question

queen rover
#

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'
}`

earnest phoenix
queen rover
#

Jsjs, well, okay. Thank you. It seems to be easier to actually search.

rose warren
earnest phoenix
#

Teaching people how to search is not a bad thing, but sure whatever

pale vessel
#

Probably not but should've worded it better I suppose

deft wolf
#

Krypton seems to be in a bad mood notlikenoot

lament rock
#

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

hushed robin
#

sounds like a chill dude

hushed robin
#

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;

digital swan
#

try it and see

rustic nova
#

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

lament rock
#

my struggle is over

#

I have defeated the cryptic thing known as midi playback

#

I hate c++

hushed robin
digital swan
#

why

hushed robin
digital swan
#

then go to pc and try it yourself

hushed robin
#

im tired

hushed robin
#

dead chat

rustic nova
grim aspen
#

do you have the error?

#

i mean like can you paste the error

hushed robin
#

why

#

bc i'm not able to try

rustic nova
#

Because you cant "AND" inner joins

hushed robin
#

oh

#

well chat gpt gave me that

#

imma test it out later

grim aspen
#

i wouldn't use Chat GPT for advice

lyric mountain
hushed robin
rustic nova
lyric mountain
#

Basically you're adding additional comparison for the join

rustic nova
lyric mountain
#

Yep

#

With all joins

hushed robin
#

im not very good at sql and i heard chat gpt is pretty goid with it

#

is*

rustic nova
#

Never worked on my end, or im confusing a different limit with it

lyric mountain
#

It's almost required for composite key joins

rustic nova
#

Either that or joining a third table

lyric mountain
#

Yep

grim aspen
#

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

hushed robin
#

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

grim aspen
#

surprised

solemn latch
#

Just ask chatgpt to write an sql query to generate some simulated data

#

^_^

hushed robin
#

big brain

maiden gazelle
#

Hi im getting a tokenInvalid error but reset my token multiple times

deft wolf
#

Discord token

earnest phoenix
#

Nice assumption kek

maiden gazelle
pale vessel
#

Very nice assumption indeed

#

You were resetting your tokens but you weren't even providing the token to the library properly

maiden gazelle
#

Wym

pale vessel
#

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

grim aspen
#

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?

fossil lotus
hushed robin
#

guys how can i make a grid system in canvas

bleak dagger
#

hey guys, is there a channel here where I can put a job ad for discord bot dev (python)?

earnest phoenix
hushed robin
#

sadly

#

python sucks anyways

bleak dagger
#

😄

#

I'd say it depends

#

do you guys know a place where I could put a job ad on?

#

looked into Discord Developers guild

hushed robin
#

uh

#

not really

#

go on fiverr

bleak dagger
#

nah, want quality people

#

FT position + equity package in SF-based startup

maiden gazelle
hushed robin
earnest phoenix
hushed robin
#

theres loads of them

grim aspen
#

assuming you read the documentation you have something like this in the code:
const rest = new REST({ version: '10' }).setToken(TOKEN);

bleak dagger
#

hm, to hire from a community of active and passionate discord devs seems more intuitive

grim aspen
#

yeah you need to put the token there too^^

bleak dagger
#

don't need like 1000+ apps 😄

grim aspen
#

#verified-jobs?

hushed robin
grim aspen
#

oh they got rid of that

hushed robin
#

tho does antone have answer to my wuestion

grim aspen
#

what question

hushed robin
grim aspen
#

um

hushed robin
#

um?

grim aspen
#

yeah i have no answer to that chief

#

best way is to follow a tutorial

hushed robin
#

why

#

i am of need in help here

wheat mesa
#

no

hushed robin
#

this channel is for help

#

so i ask here

wheat mesa
#

no

hushed robin
#

it says in the channel description

hushed robin
#

noob

#

stopclying

craggy pine
#

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.

earnest phoenix
#

why did d.js fard (i didnt even change the code for days and this happened for some reason)

hushed robin
#

whichever version you use

#

that was fixed

hushed robin
#

i need a helping hand

lyric mountain
#

a helping hand would slap you in the face

hushed robin
#

i am officially blocking you and waffle

lyric mountain
#

're

spark flint
#

lol

surreal sage
#

Node events' event emitter not receiving when emitting

surreal sage
#

fixed

wooden oak
#

Why my bots avatar is not displaying in website i changed it

surreal sage
#

Cache~~?~~!

deft wolf
surreal sage
#

he does

surreal sage
earnest phoenix
#

Already replied

#

And no it's not cache

surreal sage
wooden oak
#

Thx

hushed robin
#

can anyone help with my issue ☹️ ?

lyric mountain
#

no

hushed robin
#

a wild blocked message

#

⁉️

neon leaf
#

how old are you if I may ask?

hushed robin
neon leaf
#

you definitely dont act like it

hushed robin
neon leaf
#

like a normal person

hushed robin
#

ok

#

and

neon leaf
#

...and I suppose you should move on from here because you already ruined your reputation

hushed robin
#

no

#

i'm good

#

thanks for your input though

neon leaf
#

then dont expect anything

hushed robin
#

ok

#

i'll still ask tho

#

😁

neon leaf
#

yeah, its insane that people like that think what they are doing is normal

hushed robin
#

❤️‍🔥

wheat mesa
#

he’s just delusional

hushed robin
#

can anyone help !?!

spark flint
#

take a hint

hushed robin
#

🤣

pale vessel
#

Your name is quite misleading, I think you're having quite the battle here

hushed robin
#

no one is battling

#

🥸

quartz kindle
#

and then there's me, the dumb one who still tries to help

quartz kindle
#

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

hushed robin
#

hm ok

#

ty

misty copper
#

Hello

quartz kindle
#

hi

wicked pivot
#
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?
wicked pivot
#

None, just the music cutting off and on

wicked pivot
lyric mountain
#

u can try to

#

tho, how will you show it?

wicked pivot
#

As a video or come in the voice channel with me

lyric mountain
#

video is better

#

what lib are u using?

wicked pivot
#

discord.js@14.8.0 for bot
discord-player@6.1.1 for music
canvas@2.10.2 for image

wheat mesa
#

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

wicked pivot
boreal iron
#

You will probably need to spawn a child process dealing with your image generation, I assume

wicked pivot
#

ok? i have no idea how to do this Cat_sueur_MJ

boreal iron
#

Well developing is a continues learning curve mmLol

boreal iron
#

👍

topaz terrace
#

can i ask about OS questions here

earnest phoenix
#

Channel for chatting about development.

topaz terrace
#

oh

sharp geyser
earnest phoenix
#

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

wicked pivot
#

I did not change the code I do not understand why it gives that?

Image 1 on debian and image 2 on windows

earnest phoenix
#

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.

delicate zephyr
#

wait are you generating the image

delicate zephyr
#

if you're generating it as an image its just a matter of installing the right font

digital swan
#

(not related ik but idk where else to ask) is anyone else getting missing channels when using the new onboarding feature?

compact pier
#

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

lyric mountain
#

it might be stripping the auth header

earnest phoenix
#

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/

compact pier
compact pier
#

like pure javascript

lyric mountain
lyric mountain
compact pier
#

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

lyric mountain
#

it's the thing I said, I still don't get why is that a good thing

rustic nova
#

are you possibly using it behind cloudflare or something?

#

or some other proxy-like service?

earnest phoenix
#

c.Writer.Header().Add()

compact pier
#

because I get response

compact pier
compact pier
# compact pier well the headers are being added or set
{"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"}    
earnest phoenix
#

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

sterile vault
#

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"))

lyric mountain
#

yes 3.5s is a lot

sterile vault
wheat mesa
#

map

sterile vault
#
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

lyric mountain
#

you can also build a lookup table for results

#

that way it'll only take long the first time

sterile vault
#

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

lyric mountain
#

the what?

spark flint
#

just add a route for /

#

put that under the /:id route

#

it has to go at the bottom

rustic nova
#

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

sterile vault
#

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

sterile vault
eternal osprey
#

hey guys i am fucking back from the dead

#

i fucked my midterms lets go

rustic nova
#

still good job trying extremepet

eternal osprey
#

nah i rather meant like, i totally demolished them

#

like,they went well wahahha

rustic nova
#

oh good job!

raw nest
#

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.

queen rover
#

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'
}`

solemn latch
queen rover
#

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.

tulip ledge
#

Did you install the module?

earnest phoenix
#

boat

jaunty basalt
#

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?
earnest phoenix
#

Don't put the locale to be en-US

#

Put indian locale instead

jaunty basalt
earnest phoenix
#

You can find it in Google

jaunty basalt
#

Ohk

sick agate
#

i want to overwrite var in css and i am using lightingcss

pale vessel
sick agate
wooden oak
#

No more discordjs

#

?

spark flint
#

🙏

earnest phoenix
#

Did they really copied the same April fool's joke as last year

#

Much originality

jaunty basalt
winged linden
#

"message":"channel.isText is not a function"

getting this error on my button interactions why? it used to work fine before

quartz kindle
#

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

winged linden
winged linden
quartz kindle
#

latest v13 or v14

#

whichever you are on

winged linden
#

i am on v13 currently not latest pretty sure

#

how can they fuck up interactions bruh

spark flint
#

discord™️

#

they did it a while ago too but fixed it quick

#

then did it again

deft wolf
knotty quartz
#

Huh

#

Wait what

deft wolf
#

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

knotty quartz
#

Lmao

#

Lol

copper bridge
#

Hi

compact pier
#

What is the next lib for discord.js?

rugged dawn
quartz kindle
#

but its only for js2, not for js

compact pier
quartz kindle
#

probably not

#

:^)

compact pier
#

discord just pissed out a lot of bot dev :)))

spark flint
compact pier
spark flint
#

hhave you seen the date

compact pier
spark flint
#

lmfao

hushed robin
#

ain't no way bro believed that ☠️

spark flint
#

lol

#

its something you would od

hushed robin
#

if it wasn't april fools probably

earnest phoenix
#

can someone know where the dyno bot is, not the normal one but like the rainbow one

earnest phoenix
#

In the sky

wooden oak
#

After i did Authorisation in my bot its not added to authorized apps

lyric mountain
#

whenever you see this specific line, install whatever is written inside quotes

proven lantern
#

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
}
lyric mountain
#

\✏️

#

try this instead

#

the emoji u used isn't an emoji apparently

proven lantern
#

thanks!

slender wagon
#

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

lyric mountain
#

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

slender wagon
#

okii

#

ty

lyric mountain
#

just as a note, it's better if you create components yourself than to use the specialized swing components (like grid)

slender wagon
#

like next?

lyric mountain
#

next?

slender wagon
#

components like nextjs

#

(i have no idea)

lyric mountain
#

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

slender wagon
#

okay

lyric mountain
#

it's much more maintainable if you create the components yourself (simply extend JComponent and write the logic)

slender wagon
#

okay

#

i kinda get it now

#

may ask u more questions as i go through the process

#

also is intelliJ available for Linux

lyric mountain
#

I think so, it's made in java after all

#

and sure, feel free to ask, I'll answer if I can

slender wagon
#

oki

#

ty

lyric mountain
#

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

slender wagon
#

i have to use java for this one

wheat mesa
#

Swing is terrible

#

Enjoy

lyric mountain
#

just made the menu btw

wheat mesa
#

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)

lyric mountain
#

it's surprisingly easy to do it entirely through Canvas/JPanel

sharp geyser
#

Look at the nerds talking

simple sandal
#

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

lyric mountain
#

...what?

wheat mesa
grim aspen
#

That’s a scam

deft wolf
#

I guess everything related to NFT on discord is a scam

grim aspen
#

Pretty much

#

Although I was expecting to be rickrolled but nope

deft wolf
#

Pls help, im poor student from polando

#

I nid monej

slender wagon
#

so starting my java project

#

what sdk should i use

wheat mesa
#

It doesn’t really matter, I’d recommend either oracle or Amazon

slender wagon
#

oki ty

wheat mesa
#

They both support the same stuff though

slender wagon
#

this is so confusing compared to what i have been using (only editors)

wheat mesa
#

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

lyric mountain
#

the new ui is more friendly for newbies

slender wagon
#

Oh okay

#

I just turned off my pc cuz it gave me a seizure

#

Will do that tomorrow

wheat mesa
#

It also looks much nicer imo

sudden geyser
#

OpenJDK to my knowledge is not fully free

slender wagon
#

Its ok i am kinda rich

sudden geyser
#

oracle will bleed you dry

slender wagon
#

Hopefully not

lyric mountain
sharp geyser
lyric mountain
#

intellij never downloads oraclejdk

sharp geyser
#

Idek how I would begin to search google for a solution

sudden geyser
#

No, I'm pretty sure OpenJDK is still problematic.

#

Oracle had a page about it somewhere but I don't know where it is

sudden geyser
sharp geyser
#

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

wheat mesa
#

Because that's not how arrays work..?

boreal iron
#

Imagine your language doesn't support named keys

wheat mesa
#

That's just not how arrays work in general

boreal iron
#

That's not the point

#

Would have worked if named keys exist in JS

wheat mesa
#

but...then...the array is just a map...

#

well

#

yeah

lyric mountain
wheat mesa
#

What fake said

#

Find takes a function, not a string

#

array.find(x => x === string)

lyric mountain
#

kinda finished the boss encounter

#

I just need to figure out how to spawn waves properly

cold hearth
#

undertale if it was good

lament rock
#

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

solemn latch
#

👀

lament rock
#

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

sharp geyser
#

I made sure Windows SDK is installed, added rc.exe to path and all that

civic scroll
#

@sharp geyser sussy path

sharp geyser
civic scroll
#

that path is not likely to be correct

sharp geyser
#

Indeed now that you mention it

#

idk why rc is looking at PROGRA~1

sharp geyser
earnest phoenix
earnest phoenix
#

Open that directory, then open Lib, and then open the directory with the highest version number

sharp geyser
earnest phoenix
#

Open um\x86

sharp geyser
civic scroll
#

because the builder is 32bit methinks

sharp geyser
hushed robin
#

how can i draw an image in the center with canvas

quartz kindle
#

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, ...)

next storm
#

why does it shows [object Object] in reason when I use kick?js <GuildMember>.kick({ reason: "Reason" })

deft wolf
#

Because reason should be a string, not an object

deft wolf
#

It's more like .kick("Reason")

next storm
deft wolf
hushed robin
# hushed robin no like

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

next storm
#

in ban if we pass object then it works, right?

deft wolf
#

Yes, .ban() accepts ban options object

quartz kindle
#

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

hushed robin
#

i don't want it centered in the middle of the canvas

rustic nova
#

perhaps you're using an image with transparent padding around it?

#

that could be the cause

surreal sage
#

GNU screen command
Open session and run command and exit?

rustic nova
#

like actually exit or just detach?

surreal sage
#

Reattach, run command, deattach

#

screen -dm [cmd]

#

missing the name of the session

#

being minecraft1 in this case

rustic nova
slender wagon
#

tim how do i make my java program pretty

surreal sage
#

screen -S minecraft1 -dm [cmd]

#

?

rustic nova
#

yes

#

well

#

iirc screen -Sdm name [cmd]

#

lemme check

quartz kindle
quartz kindle
rustic nova
surreal sage
#

-dmS

rustic nova
#

or -dmS

#

both work

#

for example

#

dmS probably looks better lmao

#

but are essentially the same

surreal sage
slender wagon
surreal sage
#

I got that screen session in another terminal tab

#

I don't see anything new

rustic nova
#

dont put the screen name in "" I think

#

screen names dont support spaces nonetheless iirc

grim aspen
surreal sage
#

/n behind

#

I think

#

na

grim aspen
#

i think it's the other slash

#

\

surreal sage
#

na

rustic nova
#

it does create it nonetheless

grim aspen
#

i swear it's backslash

#

that would work in node because it cancels the space

#

if i remember

rustic nova
#

oh yeah, keep in mind that you cant just send commands into screen sessions

grim aspen
#

^

rustic nova
#

you need to send a stdin into that session

surreal sage
#

How do I do that in a shell script

#

got it

#

/usr/bin/screen -S minecraft1 -X stuff "echo "stop\r""

#

just copy pasted

#

😩

rustic nova
#

fair enough

grim aspen
#

it's not like that happens in stack overflow

surreal sage
#

totally

#

How do I sudo reboot and pass in the password in the password prompt?

hushed robin
grim aspen
surreal sage
#

shell script

grim aspen
#

assuming linux with python?

surreal sage
#

ubuntu server, shell script

#

it's just shell script

earnest phoenix
#
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

surreal sage
#

agreed

earnest phoenix
#

Thank god people spend their time on this madness

surreal sage
#

im people

earnest phoenix
#
echo "password" | sudo -S reboot
surreal sage
#

didn't work

earnest phoenix
#
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

surreal sage
#

How do I run a command on boot...

#

What I have isn't working

earnest phoenix
#

You setup a proper service

boreal iron
surreal sage
#

ima use nodejs + pm2 trollHD

earnest phoenix
#

No that's some command in a script

boreal iron
#

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)

surreal sage
#

or I just

boreal iron
#

ouch

topaz blaze
#

still learning discordjs, this should work right?

if (member.user.bot) return;
solemn latch
#

that will return if user is a bot.

topaz blaze
quartz kindle
#

@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

shut zenith
#

a

hushed robin
earnest phoenix
earnest phoenix
# quartz kindle <@456226577798135808> (or other compiler experts) pls help what are the differe...

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

quartz kindle
#

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

earnest phoenix
#

Can you show me what error it exactly throws on Windows?

quartz kindle
#
  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]
earnest phoenix
#

(Also why is type in single quotes but everything else is in double quotes troll_skull)

quartz kindle
#

i was testing stuff

#

didnt lint it yet

#

:^)

earnest phoenix
#

Can you show me the link logs of the static library one as well?

quartz kindle
#

no idea how to see that

#

lmao

#

ah you mean just the build logs like abve?

earnest phoenix
#

Yeah I mean that, that's the link (or linking) logs

quartz kindle
#
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

earnest phoenix
#

Is there a swisseph.lib file at all?

quartz kindle
#

only when built as static

#

when built as shared there is a .dll file instead

earnest phoenix
#

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

quartz kindle
#

from what im seeing on the web, it apparently needs both the dll and the lib

#

but it doesnt compile the lib??

#

@_@

hushed robin
#

who can help with this

#

been a month

#

no solution in sight

earnest phoenix
earnest phoenix
#

Try adding this to your first target:

"libraries": ["-Wl,-rpath,./build/Release/"]
quartz kindle
#

but

#

LINK : warning LNK4044: unrecognized option '/Wl,-rpath,.\build\Release\.lib'; ignored [D:\Projects\github\sweph\build\sweph.vcxproj]

earnest phoenix
earnest phoenix
#

Try changing the build architecture of your project to x64 and try again

quartz kindle
#

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]

sharp geyser
#

but idrk how to do that in clion

quartz kindle
#

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]
earnest phoenix
sharp geyser
#

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

earnest phoenix
quartz kindle
#

yeah well the only way i can get a .lib is if i make it static

sharp geyser
#

looks like I gotta download Visual Studio

sharp geyser
#

it seems to be a rc.exe error unless I am reading it wrong

earnest phoenix
earnest phoenix
quartz kindle
quartz kindle
#

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

earnest phoenix
#

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

quartz kindle
#

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

earnest phoenix
#

Well if it fails then you have no choice but to hard-code it :^)

#

Or build it twice

quartz kindle
#

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

hushed robin
#

why does sqlite do this

quartz kindle
#

i think you're supposed to end your queries with a semicolon

#

otherwise it expects more stuff

#

but idk never used the sqlite cli

hushed robin
#

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;
#

🙁

boreal iron
#

why does this not work

Excellent description of your issue freerealestate

hushed robin
#

it's literally not working

#

it's not returning anything

#

what else do i say

boreal iron
#

Well doesn't match your conditions then if no error occurs

hushed robin
#

hm

#

how do i make it match

boreal iron
#

Then remove condition by condition and debug which one isn't right

hushed robin
#

i think it has something to do with DATETIME

#

what does that take

#

to use

boreal iron
#

The question is what data type is that column

hushed robin
#

unix timestamp

#

and it's stored as a number

#

or integer ig

boreal iron
#

Yeah the type should have timestamp as name at least as alias

boreal iron
#

Just use t1.timestamp > NOW() - INTERVAL 2 HOUR

hushed robin
#

what

boreal iron
#

what what

hushed robin
boreal iron
#
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

lyric mountain
#

for context, they didn't write that sql

#

it was gpt

boreal iron
#

Took me ages to edit that on mobile

boreal iron
lyric mountain
#

yep

#

battle knows jackshit about sql

boreal iron
#

Never heard about the keyword HAVING before

#

Can't even google it atm

lyric mountain
#

the only place I saw HAVING is in firebird

boreal iron
#

Thought it may be an alias of something else

quartz kindle
#

lmao

boreal iron
#

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?

craggy pine
#

Not surprising they're using GPT instead of trying to learn sql

boreal iron
#

SQL ain't complicated but dealing with sql errors is the master discipline

boreal iron
#

Well then go on doing it

#

I might loose interest if not

hushed robin
#

Error: near "2": syntax error

boreal iron
#

Can you screenshot me the query please

#

Can't see the code block perfectly on mobile

hushed robin
#

i copy and pasted what u wrote

#

wym

hushed robin
#

i'm not wasting my time learning SQL

boreal iron
#

I can't compare those 2 on mobile

#

oof

hushed robin
#

what

#

there are the same

#

i copied and pasted

#

and got error

#

Error: near "2": syntax error

boreal iron
#

yeah there's no syntax error... must be sqlite specific or I am blind

#

missing a space maybe after hour?

#

or in between

hushed robin
#

idk

#

i am not good at sql

craggy pine
#

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>
hushed robin
#

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

quartz kindle
#

ah yes

#

it's complicated
i'm not wasting my time learning SQL

boreal iron
#

wait, could be needed to use ( )

quartz kindle
#

not a quitter indeed

hushed robin
#

its very complicated

boreal iron
#
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

hushed robin
#

same error

boreal iron
#

and i dont even know if that join method makes sense at all

hushed robin
lyric mountain
#

Imagine using keywords to name 2 columns

queen rover
#

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.

quartz kindle
#

is history t1 and history t2 the names of the tables?

hushed robin
#

history is the name

lyric mountain
boreal iron
#

I'm not even sure if the SQL timestamp data type even is an integer or internally being managed differently

lyric mountain
#

Timestamp is a double afaik

quartz kindle
hushed robin
#

idk

#

thats what chat gpt spit out

quartz kindle
#

how many tables do you have?

hushed robin
#

2

quartz kindle
#

what are their names

hushed robin
#

games and history

queen rover
boreal iron
#

lol

quartz kindle
#

then chatgpt gave you bad code

boreal iron
#

t1 and t2

lyric mountain
hushed robin
#

bruh

#

L chatgpt

quartz kindle
#

JOIN is used to merge multiple tables, it makes no sense to use JOIN on the same table

lyric mountain
#

Depending on the length I might not be able to understand it

queen rover
#

okay hehe, a moment..

quartz kindle
#

you use JOIN if you want to select stuff from both history and games tables

hushed robin
#

no i don't

boreal iron
#

well...

hushed robin
#

everything is in the history table

quartz kindle
#

then why join lol

boreal iron
#

what do you wanna show then?

hushed robin
#

bro

boreal iron
#

which table

hushed robin
#

chat gpt gave me it

queen rover
#

It may be a bit long. But I won't show you everything, just the important part, what should be working.

hushed robin
boreal iron
#

which is this?

#

id (integer) | type (string) | value (integer) | timestamp (integer)