« first day (3519 days earlier)      last day (1422 days later) » 

2:16 AM
hello
 
hello o/
 
does anyone know how to implement freelancer api using javascript, curl --request GET \
  --url freelancer.com/api/users/0.1/self \
  --header 'freelancer-oauth-v1: <oauth_access_token>'
I want to show my freelancer review inside my website, is that possible by freelancer api? I have not much idea for this.
 
2:33 AM
|| mdn making a fetch request
 
@NIKHILCHANDRAROY ^
 
3:11 AM
Trying To Make A Check Box "Force" 2 text fields to be overwritten in adobe using (java script) when check box is checked,

Im attempting to use this horribly written Java Script... I altered a number normula for string format (please dont judge..), I have limited knowledge of javascript and would appreciate a re-write of the code below:

var A12 = this.getField("Co Buyer Street Address").valueAsString);
var A13 = this.getField("Co Buyer City, State, Zip").valueAsString);
event.value = A12 == Street Address;
 
3:42 AM
How to pass the value of observable to const/let variable?
 
 
3 hours later…
6:36 AM
@Panda const valueOfObservable = someObservable;?
 
7:29 AM
anyone who does loopbackjs here v3.x? Just wanna know the difference between a transient and memory connectors?
 
8:29 AM
How to fix the observables' is declared but its value is never read.ts(6133)
Type 'Promise<{}>[]' is not assignable to type 'Observable<any>[]'.
Type 'Promise<{}>' is missing the following properties from type 'Observable<any>': _isScalar,
    const promises = reportModules.map(
      target =>
        new Promise(resolve => {
          this.notificationService
            .getSummary(target.url, target.params)
            .pipe(take(1))
            .subscribe(
              (result: Response) => {
                // console.log(target, result);
                resolve({ target, result });
              },
              (err: Error) => {
                // return reject(err);
              }
            );
        })
    );

    let observables: Observable<any>[] = promises
 
I mean it's pretty self-explanatory, you have an array of promises that you're trying to assign to an array of observables.
Why are you using promises here if you want your results as observables?
 
 
1 hour later…
Paz
9:44 AM
Do anyone have any idea on how can I limit the count of the children I show?
For example I have a list with 5 li elements and I want to only show 3, in a dynamic way (which means i.e. if I choose to hide one of the first ones it'll show a hidden one so it will stay at 3)
I am using Vue but can use an example with react, angular etc
 
 
3 hours later…
1:13 PM
I have a div with multiple divs in it
the parent div has a max-height and overflow-y: scroll
the arrow key can be used to focus the divs, going up and down
what can I use to move the scroll bar when I focus on a div that's just below my parent div scope
in a <select> thing, it moves automatically
 
1:31 PM
wtf google. I want info how to adjust the scroll bar position when the container element is using overflow-y: scroll, so don't rub me with posts telling me how to use stupid CSS styles to fancy up the scroll bar
 
1:49 PM
guys I'm using ReactJS but gettin this error:Unhandled Rejection (TypeError): Invalid attempt to destructure non-iterable instance
  const [locale, setLocale] = useEffect({
    applyClass: 'btn-green',
    applyLabel: 'Apply',
    fromLabel: 'From',
    format: 'MM/DD/YY',
    toLabel: 'To',
    cancelLabel: 'Cancel',
    daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
    firstDay: 1,
    monthNames: [
      'Jan',
      'Feb',
      'Mar',
      'Apr',
      'May',
      'Jun',
      'Jul',
      'Aug',
      'Sep',
      'Oct',
      'Nov',
      'Dec',
    ],
  })
In this code
 
Hello there.
 
@themartinipolice seems that useEffect doesn't return an iterable. I checked some React docs and none of them mention useEffect returning anything. Examples always have useEffect standalone. I'm not well versed in React, so I don't know if I'm overlooking something but seems like you cannot use it like you do.
 
I need to "splice" a jagged array, so the elements are spliced in every sub-array. Check this example:
 
aah I suck, I used useEffect instead of useState
Thanks @VLAZ
 
{
    "titles": ["t1","t2","t3","t4"],
    "data": [["d1","d2","d3","d4"],["d1","d2","d3","d4"],["d1","d2","d3","d4"]]
}
We need to split this table in 2, so my approach was to clone the object and cut from left/right respectively
 
1:58 PM
@HéctorÁlvarez left/right relating to what?
 
{
    "titles": ["t1","t2"],  //<-- data.titles.splice(2);
    "data": [["d1","d2","d3","d4"],["d1","d2","d3","d4"],["d1","d2","d3","d4"]]
}
 
@HéctorÁlvarez Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and 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.
 
OK James, geez, forgot to CTRL K for 3 seconds
 
it's a bot
you can override an object value ya know
 
@KarelG I am well aware
I mean about the bot
but I always make snarky comments about it
@VLAZ to divide into 2 pieces
@KarelG what do you mean
I thought about looping through the table (if I may call it that way) and splicing every line).
 
2:03 PM
 
@VLAZ yes, but that's already done.
Data comes from a stringified JSON from 3rd party, so we can clone and splice easily through JSON.parse()
 
@HéctorÁlvarez that message is ... not for here :D. Sorry
 
The question at the moment would be how to splice the data
 
what's the expected output on that? two objects with all arrays being split in half?
 
{
    "titles": ["t1","t2"],
    "data": [["d1","d2"],["d1","d2"],["d1","d2"]]
}
 
2:06 PM
@HéctorÁlvarez Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and 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.
 
What's the expected result from splicing it? [["d1","d2","d3","d4"]] and [["d1","d2","d3","d4"],["d1","d2","d3","d4"]]
Ah, I see.
 
!~tell Jamesbot reee
 
bit weird use case :P
 
nvm this one wasn't summoned
@KarelG we had a response from a service, and now the spec requires splitting the result in 2 because it's too big to fit in a doc file.
They don't want to touch the presentation layer, so it's on us to edit the JSON with minimum performance hit
 
is it always idempotent?
 
2:08 PM
(IDK why the performance stuff when they are failing completely at other places but w/e)
 
eg four titles -> data is nested array with four elements?
 
@KarelG nope, but arrays have a fixed length where all lines in the "table" are as long as the headings (titles).
but it can produce different results for the same query
 
@KarelG thanks for the other day, i solved my problem
really helped, really thanks
 
(which is probably irrelevant for this issue)
so yes, we could say it's idempotent for what's meant to be right now
@KarelG yes
 
I would introduce a function
 
2:12 PM
@HéctorÁlvarez this?
 
function split(arr, startIndex, endIndex) {
  return arr.slice(startIndex, endIndex)
}
then you can do
const urObj = {
  title: split(obj.titles, 0, 2);
  data: obj.data.map(arr => split(arr, 0, 2)),
}
yeah you cna repl 2 with .length / 2
 
Also I named the function a and b because I'm terrible at names.
 
hmm a small error
fixed
@VLAZ alice and bob would be happy tho
 
honestly better names than I normally go with...
I tend to name stuff aaa or abc
 
heh your functions aren't really flexible ;D
 
2:16 PM
I know...
 
what if you want quarters!
 
Name them firstHalf and secondHalf. There you go :P
 
@VLAZ yes, awesome
 
^ at least it helps him
|| shrug
 
¯\_(ツ)_/¯
 
2:17 PM
I mean, it does the trick. My solution was much more rudimentary, I for-looped and spliced.
Not sure if I can do that in my environment, I have to use Rhino because it's a Java environment
Nashorn is also available
 
that is being removed
(nashorn)
 
You can transform the arrow functions to normal functions. Not sure if Rhino supports them.
 
AFAIK
 
@KarelG I try not to use it. Rhino is much more versatile, and much more similar to JS on web engines than Nashorn
Although sometimes we get some legacy stuff that requires using Nashorn
 
eh, that library I want to use
it was not producing the behavior I want. So I placed debugger; yet it did not get called
so looked into the source
found this: this.match = settings.match || this.match;. So decided to put debugger there
not called
that library is not even using that function.
-.-
unless I want to extract data. GJ HER HER
 
2:36 PM
Is it normal that VSCode just stops debugging NodeJS scripts when an error occurs? I'd expect it to behave like VisualStudio, where it breaks at the location of the error.
 
There might be an option for Break on Exception. I've seen a similar option present in a lot of places but I haven't tried debugging with VSCode.
 
@VLAZ omg you are right. thanks so much
you could've saved me 2 hours haha
 
:) by the way where is that option? I'll probably need it at some point. I'm trying to use VSCode recently
 
'Run' tab bottom left under 'Breakpoints'. Keep in mind that Microsoft is developing a new JS Debugger that is enabled by default if you are an insider
 
2:51 PM
Thanks!
 
can i ask here about css sense css room is empty?
 
The only thing we prefer people to not ask is whether or not they can ask a question
 
you are right sorry about that
can you guys explain me how can i make a horizontal drop of water effect on image not using rotate?
 
I don't know what that means
 
like this
but if i use rotate, the image rotate too...not only the shape
 
3:01 PM
BTW I never said thanks, so thanks for the help
 
@DJ_cascurity Well how are you making the shape in the first place?
 
i'm using this class
.teste {
   width: 25%;
   border-radius: 50%;
   border-top-right-radius: 0;
   transform: rotate(45deg);
}
 
@DJ_cascurity Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and 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.
 
Maybe you can put the image in a container, apply the border-radius and rotation to the container, and apply a counter-rotation to the inner image
 
hum...ok
 
3:06 PM
Guys any idea why this regex is not valid? Invalid regular expression: /clip/(.*?)(?=?)/: Nothing to repeat
clip\/(.*?)(?=\?)
This is the one i'm trying to match, and the i get that error in the console
 
(?=?)
 
in react we can use like :
        <Container className="test1">
          <CardMedia image={imageUrl} title={title} className="teste" />
        </Container>
 
you probably want (?=\?)
 
mystring.match('clip\/(.*?)(?=\?)')[1]
this is what i'm doing
uhm
 
mystring.match('clip\/(.*?)(?=\\?)')[1]
 
3:08 PM
there, i thought your (?=?) was the answer
 
No, that was the problem
 
why do i need to escape the \ ?
I want to select a ? at the end
i mean i want to select stuff in between
but ? is the the limiter at the end
It worked tho
 
Because you have a string - if you want a backslash in a string, you need to escape it. And you need a backslash in a string because you feed the content of the string to the regex engine
 
ooooh it's for the string not for the regex lol
i gotcha thx for the help mate
 
Well, both. You need to escape the ? in the regex. But to have \? for the regex engine, you need \\? in the string.
 
3:11 PM
yeah yeah i got it lol
i was too focuse on the regex
 
gotta escape the escape character :P
 
yeah lol
 
there are some characters that are special, but once you know which they are, it's pretty straightforward
this site is a huge help for debugging regular expressions
 
yeah i used it
 
shows you as you're typing the regular expression what it matches
 
3:13 PM
and my regex worked
but it didn't work once you try in javascript
cause that's a string escape aswell so yeah but it's fixed now
 
ah, weird
 
You're in PHP mode
At least, it looks that way on my end
 
if you select js it works aswell tho :<
oh well it's fine tho lol thx
 
I notice that your capture group doesn't work in JS mode.. but I also don't know what your actual question was lol
 
3:16 PM
You can also drop the lookahead and use [^?]* - any amount of non-question mark characters. Example
 
@forresthopkinsa thanks for the help mate
 
how can you capture the id only with that?
 
cool, thx i'll remember that :D
 
3:35 PM
my image now dont show inside container
<Container>
   <CardMedia image={imageUrl} title={title} className={classes.media} />
</Container>
 
 
3 hours later…
6:25 PM
@RahulDesai Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and 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.
1 message moved to Trash can
 
I have this piece of code:
  const updatedValues = {
    ...values,
  };
somehow updatedValues is still keeping a refernce to values so if anything in updatedValues is changed, it affects values. lodash's cloneDeep solves this problem but I have been asked not to use it (its like a drug :P)

How do I improve this code?
 
6:47 PM
||> const one = {a: 'foo'}; const two = {...one}; two.a = 'bar'; return one
 
@forresthopkinsa {"a":"foo"} Logged: `` Took: 1ms
 
Notice that the source object did not change
Your problem isn't with the spread, your problem is that you're passing a reference within that spread
 
7:15 PM
posted on June 04, 2020 by Prudhvikumar Bommana

The beta channel has been updated to 84.0.4147.38 for Mac, Linux and Windows A full list of changes in this build is available in the log. Interested in switching release channels?  Find out how here. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Prudhvikumar Bommana Goo

 
 
1 hour later…
8:20 PM
Hey guys, I'm trying to add a new property to one object. The object is an array of objects, each object inside have some properties and an ID (ticker), I want to check on other object (if this id is the same) and add a property from that other object to the original one.
  let mergeTooltipTable = rowData.data.map ((el, idx) => {
    searchId = el.ticker.split(' ')[0]
    filter = tooltipTable.filter(el => {
      const key = Object.keys(el)
      const value = Object.values(el)
      if (key[0] == searchId) {
        return value
      }
    })
    return {
      ...el,
      'tooltipTable': filter
    }
  });
This is what I'm trying to do, but for some reason the tooltipTable property ends getting a key value before desired data. What I wanted is tooltipTable to receive the value returned inside the filter, but there is a key being returned as well
 
8:35 PM
I have figured it out, needed to use a .map in the end
 
wow, today my phone exploded, or well, battery decided to expand to 4 times the thickness breaking the screen.
Maybe I should get a new one.
 
8:58 PM
@paul23 that sucks
 
idunno, i think maybe some ductape could fix it
 
My trusted s5 though :(
 
i've never had a phone stop working, or a screen crack, nothin
 
Screen is now literary in the middle pushed 2-3 mm out of the casing XD
Friends told me to stop using it cause it might explode
actually explode
 
if you remove the battery, it'll probably be fine
well, i mean
it won't expode anywya
cuz the explosive bit would be gone
 
9:07 PM
yeah but I knid of still need it till i get a replacement :P
you know, to call people
Am now doubting between one plus 6, pixel 3a xl and samsung a51.. All about the same price here.
 
oneplus!
 
i like my Xs
 
6 is already the 'dated' model though ;P
 
well, except for losing the thumb login
i dn't use the facial crap
 
oh I don't wish to store any credentials on my phone, gmail etc I use pc for.
Or bluestacks for whatsapp.
phone is just for calling and throw away accounts.
 
Nyk
9:19 PM
hey y'all. how's it going?
 
@Nyk Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
awesome
🦠
 
Nyk
haha, for real. ->🦠 on week 10 of social distancing myself.
I'm hoping this might be the right place to bang my head against the wall and ask for some ui.droppable help.
 
only week 10?
 
Nyk
How long for you paul23?
 
9:27 PM
Mar 16 at 18:51, by Kevin B
i've been self isolating for decades
but in all seriousness things around here started on apr 2nd, and then the guidelines were removed at the start of may
we're still seeing an upward trend in cases
 
here it's been since early march.
 
got to work remote for 4 weeks before they called me back in
or was it 6
think it was 6
because office stayed closed for a few extra weeks
 
Nyk
9:45 PM
Started March 16th for me so I guess I'm actually about to finish week 11. It all blurs together.
 
@paul23 swollen battery, popular in lithium phone batteries
especially older iphones
 
I'm sorry but I just have to vent. I read one of the stupidest questions posted on SO and...I just can't even. Here is the premise - OP calls some function like this validateElemId(maleDOB, maleDOBError); but apparently that's too much code and wants to call something like this validateElemId(maleDOB); - passing a single argument and then using code to derive the actual two arguments.
Actual quote from the question:
> But since these elements share a common prefix, it would be cleaner and terser to just pass that prefix to the function as a string and then interpolate it in the function
 
Nyk
@VLAZ Aside from just being flat our wrong, wouldn't that cause way more code in the long run?
 
@Nyk bingo. It's not "cleaner" since at the very least it completely ties the function to the way you call it. So, to re-use it you have to create the EXACT same naming convention for the variables. You cannot name them, say, femaleDOB and commonDOBError
So, the function is brittle - changing something completely unrelated to what it does can break it like renaming a variable. It's also tightly coupled - you cannot necessarily change the implementation of the function without changing the way it's called or vice versa.
If you need similar logic, you're likely better off just writing a new function that does the same thing. Leading to code duplication.
 
10:00 PM
meh
i've seen worse
 
That's before we even tackle the fact that we cannot just lookup random variables. So, to be "universal", you'd need to make all variables global somehow.
@KevinB @KevinB OK, I would agree normally. I've seen worse from people who don't know better. But this comes from a user whose account is a decade old. They have posts from a decade ago, so it's not just hat they registered then. Moreover, the account has 9k rep. This isn't somebody who is inexperienced. This is why I think it's the worst - the bar should be way higher in this case.
 
yeah, i used to follow around such a user
they had given away 10's of thousands of rep in bounties on their own questions
i haven't seen them in years, but lat time i did they were at ~ 2k questions
i just can't fathom how you can realistically have so many questions
 
10:55 PM
hmm I have trouble defining the difference between sass and jss... Tools online seem to conflate the two
 
Well both are ways of producing CSS without writing actual CSS. But the syntax, grammar, and the way you produce said CSS is different in both cases.
 
yeah but I haven't really found any feature comparisons, and actually for jss (which I use in material ui, right?) I tend to look at tutorials for sass..
 
Sorry, I can't really tell you the differences myself, either. I've only used SASS and it's basically CSS with some syntactic sugar on top. JSS I've mostly heard about and it seems more like JS code that approximates CSS declarations in order to describe your styles and produce CSS at the end.
 

« first day (3519 days earlier)      last day (1422 days later) »