« first day (4356 days earlier)      last day (815 days later) » 

09:23
Hello
How to concatinate Icon component with text in React?
09:50
@GiorgiMoniava yes, but I would explain why you're asking a question that may seem to have an answer, and why you think the answer is insufficient
10:14
If we receive <b> or <i> from server
how to convert that to correct HTML syntax ?
response is type of ReactNode
10:48
@JaromandaX I see, ok, thanks
11:06
I'm having some trouble understanding this code: this.wrapped.apply.apply(this.wrapped, arguments); This.wrapped is an object and apply is a method on that object. That part I fully understand. What I don't understand is the second apply there. This.wrapped.apply does not have a function / method in it at all. It just returns an array.
I know it's a long shot someone can help with that, but I really hope someone can make some sense of it to me
11:33
just think call by call: Apply calls a method with this and arguments so this.wrapped.apply.apply(this.wrapped, arguments); calls the method (this.wrapped.apply) with this.wrapped as this and arguments as arguments which in turn is: (this.wrapped.apply)(...arguments)
@makadev Thank you! That makes more sense to me.
@makadev I see you're also in the PHP channel. Do you happen to know how I'd best translate that to PHP? At first I was thinking Closure::fromCallable($this->wrapped->apply)->bindTo($this->wrapped)(\func_get_args()); but that was pretty wrong, lol
this.wrapped.apply.apply(this.wrapped, arguments) is a (bad, IMO) shorthand for Function.prototype.apply(this.wrapped, arguments)
Wait, what I said might be wrong. Ugh, I don't like these. Which I'll use as further evidence for "bad"
11:49
@VLAZ Ye that's honestly what I thought at first too, but when I just passed it along like that, it didn't like it. Since I'm trying to turn this NodeJS library into a PHP one, it's proving challenging.. Most parts are already done, but weird things like this are getting me stuck
Not enough coffee or something but I have huge trouble parsing it.
||> wrapped = function () { return "Hello" + arguments[0]};
wrapped.apply.apply(wrapped, ["world"])
@VLAZ 'Helloundefined' Logged: [ ] Took: 0ms
@icecub not sure, not doing much meta programming in php, I remember there is something like call user func array which can be used to call a method on an object with custom arguments
That might actually help. I'll see if I can use that somehow
Ugh, OK, so it's taking arguments and applying that as the this value of this.wrapped. But only works with one or zero items in arguments
||> wrapped = function () { return this} ;
wrapped.apply.apply(wrapped, ["world"]);
11:54
@VLAZ 'world' Logged: [ ] Took: 1ms
||> wrapped = function () { return this} ;
wrapped.apply.apply(wrapped, []);
`'TypeError: Converting circular structure to JSON
--> starting at object with constructor \'global\'
--- property \'global\' closes the circle'` Logged: `[ ]` Took: `60ms`
@VLAZ try typescript
@makadev Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
let x = {
    name: "x",
    fun: function() { console.log(`AHHH from ${this.name}`) }
}
let y = {
    name: "y",
    fun: function() { console.log(`WHOO from ${this.name}`) }
}

x.fun.apply.apply(y...
11:56
@makadev Would be the same. But yeah, maybe the intention is to provide two items in arguments: a this value and an array of arguments. And then this.wrapped is called with those.
ye, not sure if apply is overrideable, also if it's a port from a functional language it might not have an actual intention and is just something that was ported like that and Function.object.apply(...) would be better
I guess it would make sense as something like this:
class Foo {
    private wrapped;
    constructor(fn: Function) {
        this.wrapped = fn;
    }

    metaCall<ThisValue>(newThis: ThisValue, args: any[]) {
        return this.wrapped.apply.apply(this.wrapped, arguments);
    }
}
@icecub well, your solution looks more modern sooo, I'd stick with that
@VLAZ Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
Which means that it's mostly equivalent to this.wrapped.apply(newThis, args)
"mostly" being because maybe there is a slight difference if args is empty or null or something. But also probably not. I can't think of an example where the two would be differnet.
12:03
@makadev If it was working, sure. But it isn't. I mean, this.wrapped.apply is expecting a string as its only parameter, but for some reason it's passing along the this.wrapped param to it still
@icecub .apply() expects two parameters - the first is the value to be used for this, the second is an array-like of arguments to call the function with.
fn.apply(a, b) is basically a.fn(...b) (well, to paraphrase it a bit. It won't actually start existing on a if it wasn't there). So, .apply.apply calls the apply function itself, giving it this.wrapped as the this value and arguments as the parameters for the first apply(). Therefore, it only works with zero, one, or two items, and the last one (if present) must be an array-like
@VLAZ Ye I know. I was talking about the object's apply method. Not the native js apply function: this.obj. >> apply << .apply(.. , ..); That apply method is expecting a string: public function apply($str){ ... }
Oh, PHP, sorry
Wait, why does it expect a string? That's strange. What does it actually do in PHP?
It applies an operation on a string. I'm trying to turn ot.js into a PHP backend server instead of NodeJS. It's about operational transformation (collaborative editing)
@icecub Ah ok, at least it LOOKS ok'ish, maybe $args = \func_get_args(); call_user_func_array([$this->wrapped, $args[0]], array_shift($args))?
but dunno
12:12
Can at least give it a try
Nah, that didn't work. Uncaught Error: Object of class MyApp\WrappedOperation could not be converted to string
ah
ye
it expects a method name and "$this->wrapped" does not seem to be one
No that's an object. The method would be $this->wrapped->apply
Hence the double apply, which is making it confusing as hell..
ye hehe
in that case uhm.. \call_user_func_array([$this->wrapped, "apply"], \func_get_args());
that should call apply on $this->wrapped with given args
but there is no rebinding
I actually did return \func_get_args(); call_user_func_array([$this->wrapped->apply, $args[0]], array_shift($args)); which seems to work. Crashed at the next problem, but that's a different matter
doesn't that simply return \func_get_args() and the rest is dead code?
12:26
Could be. I'm not yet seeing the output I need, so I should probably add some more debugging there to be sure
Ye you were right. Works with your code though. It actually completely stopped crashing or dishing out errors at this point. Finally!
:thumbs_up:
How should I approach the scraping issues related with dynamic content websites ? For instance, I cannot see the pdf link inside the source code but pdf file can be downloaded.
example link > www.domainname.net/javax.faces.resource/dynamiccontent.properties.xhtml?ln=primefaces&v=6.2&pfdrid=3e742317f6d77c0adcd1488455adfb10&pfdrt=sc&pfdrid_c=false&uid=f3a61a93-a817-46cd-9fa5-2c55040ffe72
Any rough idea you can suggest ?
 
2 hours later…
14:21
use a tool that can process JS, or request the additional content the same way the website is.
 
3 hours later…
17:10
posted on September 19, 2022 by Ben Mason

Hi everyone! We've just released Chrome Stable 105 (105.0.5195.147) for iOS; it'll become available on App Store in the next few hours. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Harry Souders Google Chrome

 
4 hours later…
21:26
> Than Why parseInt() or int values in JavaScript, because we need int values to make sure our complex mathematical expression return us error free result
I'm not really sure that's why integers exist in general. For example 10 / 4 might produce unintended result as integer division (the result is 2).
No wonder the answer that contained that (among other statements) was deleted.
That's new. Instead of complaining about getting downvoted, this dude is complaining about not getting upvoted xD
@Cerbrus It answers the OP's problem and more. No upvote, why? You're not being consistent — mhodges 4 hours ago
22:13
i mean
you did in fact do something opposite from 'change' the vote, rather, you removed it
very inconsistent indeed
!!skyrim or subnautica
subnautica
2 days in a row
the new truck dock is awesome
i had no idea i needed it

« first day (4356 days earlier)      last day (815 days later) »