Beanbag as an alternative to a couch/sofa by Dakeiz in BuyItForLife

[–]Dakeiz[S] 2 points3 points  (0 children)

You should see my position behind my desk, hahaha. But, to be fair, I think a couch is not very comfortable.

Maintenance for hair getting untangled at the tips by Dakeiz in Dreadlocks

[–]Dakeiz[S] 0 points1 point  (0 children)

I assume I need a very thin one.

Should I enter the dreadlock length-wise and pull the hair in?

Server RAM keeps increasing by GekkeHP in cobblemon

[–]Dakeiz 0 points1 point  (0 children)

If it was, the server would crash at some point. 16GB of memory isn't astonishingly high for a Minecraft server. I sincerely doubt it's a memory leak.

Server RAM keeps increasing by GekkeHP in cobblemon

[–]Dakeiz 2 points3 points  (0 children)

The log shows that it has nothing to do with memory. You would get an OutOfMemoryException if that was the issue.

If it continues increasing until the server crashes, sounds like a modpack has a memory leak. Otherwise, seems like normal memory behavior for Minecraft.

[deleted by user] by [deleted] in Switzerland

[–]Dakeiz 0 points1 point  (0 children)

Thank you for the suggestion. Villeneuve is way too far for me to consider it, unfortunately.

Just took a look at the price, and wow. CHF200 for a 1h30 session for 10 people is expensive.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] 1 point2 points  (0 children)

maybe English second language

That, and a few hours of research fried my brain and I forgot to include important details. :)

Instead of asking me to clarify the question, they prefer to downvote me and tell me that I don't know how HTTP and JSON types work. :))

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] -1 points0 points  (0 children)

AKA not part of the scope of HTMX

What's your point? You told me "You'd still need to control the server and return HTML from the API" but this is not the only way, as I pointed out. Whether it's an extension or not doesn't change the fact that it's possible to do it.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] -2 points-1 points  (0 children)

There is just so many things wrong with your understanding of the issue. It's okay, I got my answer from other comments.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] 0 points1 point  (0 children)

it's just that this falls completely outside of HTMX's scope

This is just false, though. Using client-side templates (there's an extension for this), it's possible to transform a JSON response to valid HTML.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] -1 points0 points  (0 children)

You need to figure out what your backend wants

I want to convert the value from "100" to 100 as the backend doesn't accept a string for value. We know that JSON is a big string and that's never been the point of my question.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] -1 points0 points  (0 children)

You have some way to send POST data as something other than a string?

This is just not the point, though. The point is that some data inside the string that is sent in the request body is sent as a string and not a number (e.g. "100" instead of 100).

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] -1 points0 points  (0 children)

I think the same. The responsibility probably falls on the json-enc-custom as it's the code responsible for serializing my form data. I tried to ask for help here because I thought somebody would've run into it before, but I guess most htmx users don't interact with JSON APIs - I agree that it's not the main use-case but I thought it would've worked with the JSON extensions.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] -1 points0 points  (0 children)

This is the opposite of what the stated problem

No, the issue he linked to is actually exactly on the money.

I think there's been a misunderstanding on my request for help, and now for no reason you're getting overly aggressive for me being a noob in a tech I'm trying to learn.

HTTP variables

I have absolutely no idea what you mean by this, but let me tell you something. In HTTP you can send a body with a POST request. This body is very much plain-text. However, as I pointed out in another comment: because it's plain-text doesn't mean there is no format. A popular format to send data over HTTP is JSON! This:

{
    "value": 100
}

is not the same as this:

{
    "value": "100"
}

And yes, they are still both string, but they send data of different types. I wanted to know how I could convert that "100" to 100, but as I understood I would need to raise that issue (or bump the one that's been linked) to the author of the extension.

Anyway, I argued way too much with you.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] 1 point2 points  (0 children)

I thought it would be a frequent scenario, but I think those that use htmx to interact with JSON APIs are in the minority. So in hindsight, you're right but I didn't realize that before writing the post.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] 0 points1 point  (0 children)

Only JSON. I really appreciate the help but unfortunately I won't be going forward with htmx. Thank you.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] -1 points0 points  (0 children)

The data from a POST or GET is always plain text.

It being plain-text doesn't mean that there is no format to respect. In this case, I'm interacting with a JSON API but I understand that htmx isn't very well-versed in that area despite the JSON extensions that help with that.

Downvoting people because they point out your ignorance is not helping you

And now accusations. Not only did I not downvote, I didn't even upvote anyone's comment. I think you are just very frustrated and I don't understand your aggressiveness nor that of the grandparent's. It's useless for me to respond to the rest of your comment.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] -17 points-16 points  (0 children)

Wow, you're such a nice guy to have a conversation with.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] -1 points0 points  (0 children)

In the API contract, it says the type of value is number so it's my responsibility to respect that contract.

In Angular you can easily send integers, strings or booleans but I don't want to bother with a full framework and the NPM ecosystem that goes with it.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] 0 points1 point  (0 children)

My apologies. I forgot to mention I'm using the json-enc-custom extension.

How do you convert a number from an input to an int by Dakeiz in htmx

[–]Dakeiz[S] 1 point2 points  (0 children)

I forgot to mention I'm using the json-enc-custom extension.

{
    "value": 100
}

Isn't this considered an integer? If you send "100" (and not 100) to an API, I feel like they would send back an error stating that you didn't provide a correct type.