« first day (2795 days earlier)      last day (2169 days later) » 

4:00 PM
Do I need to make any changes in settings -> keyboard on mac remote desktop
@tyler
 
@SterlingArcher JAVASXRPS CHTROMM
 
@TylerH I am on windows machine but working on remote mac
 
@TeddyKoker split your text and code into two messages
code should be indented with 4 spaces (ctrl+k does this for you)
 
@Loktar lol
 
@SterlingArcher girl I was chasing (and have been chasing for like 2.5 years now) is just a disaster. I've finally thrown in the towel. Things were going really, really well, but I think when you combine two people with the same mental illness, you don't get understanding and patience, you just get more mental illness, lol. I'm working a lot on myself lately, and I think she's been stagnant, or just isn't as far in recovery. In any case, I ended this whole escapade this morning.
 
4:01 PM
@stonerock wait, shouldn't this be asked on a Superuser chatroom instead, then?
 
@TylerH Ok I will ask
 
@ndugger that's why addicts aren't allowed to date when they're in rehab
 
user1596138
 
user1596138
 
/** Approach 1 */
async function delay(ms) {
    await new Promise(resolve => setTimeout(resolve, ms))
}
async function test() {
    for(;;) {
        await delay(5000)
        /* Code to run here */
    }
}

/** Approach 2 */
async function test() {
    /* Code to run here */
    setTimeout(test, 5000)
}
 
user1596138
4:02 PM
#EasyButton
 
What are the pros and cons of the above approaches?
 
@TeddyKoker the two examples don't do the same thing
 
for(;;) { //this is an infinite loop
 
user1596138
@TeddyKoker Well for starters the first one has an atrocious for, that's a con
 
Looks like it is for a spider
(;;)
 
4:04 PM
@SterlingArcher Hardest shit I've ever had to do. She still means the world to me, but if I don't stop sacrificing myself for her over and over again, I'm not going to be long for this world.
 
@SterlingArcher I think this is standard for generator functions
 
can't really compare two different methods if they don't have the same purpose. One never resolves because the for loop never ends, the other runs some code after a few seconds, but the async function returns undefined immediately and thus resolves the promise immediately, not waiting 5 seconds.
Sure, but this isn't a generator
 
@SterlingArcher ugh, so verbose
 
it's an async function, so it will just never resolve
It will however continue to run code every 5 seconds indefinitely
 
What do you mean by never resolve?
 
4:07 PM
the async function never reaches an end condition
Nothing is ever returned to it because the for loop can't end
 
oh, wait. that's not a generator function.. yeah why is there an infinite loop there?
 
it's essentially a setInterval without a clearInterval
 
The idea of the function was to continuously sync data with the server so it would be basically running as long as the user is on the page
 
yeah, use setInterval if you want things to run on an interval. But if you're performing HTTP requests with it, setTimeout is better.
 
oh. what about push technology?
 
4:09 PM
^
 
sse/sockets/whatever
 
Unfortunately those are not options with the server api I am usgin
Essentially I have a client cache that I want updated from the server every x amount of time
 
yeah, you just want a setInterval or a request that on complete, runs a setTimeout that starts the next one.
The former if the delay is very long, latter if it is less than 1 minute.
No need for async/await
 
Whats your reasoning regarding the length of the delay?
 
If the request takes longer than the delay to respond, requests can start to stack up, over time causing problems.
You don't want to start the next request before the previous has completed
 
4:13 PM
Ah that makes sense
 
worth noting that setInterval doesn't guarantee a delay where setTimeout does: javascript.info/settimeout-setinterval#recursive-settimeout
 
And the function should be async so I can await http requests inside correct?
 
If you need to, yes, but you won't be able to make use of the promise it returns
 
async function update() {
    try {
        await httpRequest(/*...*/)
    } catch(err) {
        // handle err
    }
    setTimeout(update, 5000)
}
So something like this?
 
Why are you going recursive, why not use setInterval instead?
 
4:17 PM
3 mins ago, by Kevin B
If the request takes longer than the delay to respond, requests can start to stack up, over time causing problems.
 
async function update() {
    for(;;) {
        try {
            await httpRequest(/*...*/)
        } catch(err) {
            // handle err
        }
        await new Promise(resolve => setTimeout(resolve, 5000))
    }
}
 
0
A: Bind the values of diffrent elements in an array (JavaScript)

Jonas W.Just use objects and reference them: var array = [{v: 1}, {v: 2}, {v: 3}, {v: 1}]; array[0] = array[3]; array[0].v = 7; console.log(array[3].v); To get slightly more readable code, you might wanna implement a custom map: class LinkMap extends Map { get(k) { return (super.get(k) || {})....

what on earth
 
o_O
array[0] = array[3]
 
Since the setTimeout is awaited wouldn't this also wait until the http request is complete, then delay, then continue the loop right?
 
4:21 PM
yes
 
They are essentially the same right?
Im just wondering if one would have worst performance
 
I mean... it'd do the job.
 
@TeddyKoker I like it
 
and performance in this case isn't about speed, it's about whether it will last for 24 hours without crashing
 
I ended up answering my own question
0
A: Transfer learning by merging last classification layer

NeoaresIt turns out that it was an issue related with the order of classes being loaded in the model. Let's assume I have the following structure root -train1 +a +r -train2 +b +y -all +a +r +b +y Where a, r, b and y are classes (folders with images). I first tra...

 
4:23 PM
leaks etc
 
Yeah I was wondering if the recursive calls in the first approach would end up using memory up
 
I haven't really messed with that kind of thing in 5-6 years, i've always had access to push notifications
 
Although I guess since its inside setTimeout its not technically a recursive call correct?
 
so had no reason to do interval based requests
 
I see ... unfortunately that would involve a fairly comprehensive api rewrite in this case, i appreciate the help however!
The other issue in this application is the frequency and quantity in which data needs to be sent up, so I am trying to group messages that need to be sent and then send them to the server in intervals if that makes sense
 
user1596138
4:35 PM
 
i keep hoping they catch the next one
 
I love how the guy up there just watches like "ah well". Not even a warning that I can see
 
What are you talking about, they did catch it
 
well, i mean it slams into the truck pretty hard, could've damaged the chair
 
or the person...? I think they take priority
 
4:44 PM
he didn't lose a shoe, obviously okay
 
5:05 PM
One of those gifs where you appreciate what they're thinking
 
5:16 PM
hi! how can I convert a string "/Date(1514512800000)/" to a real date in JS?
Can u give me a hand?
 
How did you end up with that as a string?
 
I serialized in my Asp.Net Mvc Project using JsonResult
 
Well clearly you messed something up there, and should fix it there instead of trying to do obscure string parsing
 
user1596138
@SterlingArcher Yea that was actually a awesome attempt
 
It's very sad that a lot of devs are handling with this problem, and manipulating the string stackoverflow.com/a/726869/5071902
I'll find a best solution, thanks for the help ndugger!
 
user1596138
5:28 PM
!!> new Date("/Date(1514512800000)/".replace(/\D/g, ''))
 
@Jhawins null
 
user1596138
Oh does it have to be a number
 
user1596138
!!> new Date(Number("/Date(1514512800000)/".replace(/\D/g, '')))
 
@Jhawins "2017-12-29T02:00:00.000Z"
 
user1596138
For example anyway
 
user1596138
5:30 PM
Better solution would be not to serialize it that way, makes no sense when you are in control
 
user1596138
-2
A: Strip all non-numeric characters from string in JavaScript

Frank Wisniewskiwe are in 2017 now you can also use ES2016 var a = 'abc123.8<blah>'; console.log([...a].filter( e => isFinite(e)).join('')); or console.log([...'abc123.8<blah>'].filter( e => isFinite(e)).join('')); The result is 1238

 
user1596138
What the fuck is this destroy please
 
@Jhawins Nice Jhawins! Thanks!
 
@Jhawins careful about comments on Main, if you get flagged enough you can get a rough suspension
 
user1596138
@SterlingArcher That is one of the most necessary comments I ever made
 
user1596138
5:41 PM
I stand firmly behind it. I'm not here to encourage a bunch of terrible terrible practices
 
You don't have to defend it, I was thinking the same. But saying it... well you already know :P
 
user1596138
I expect all you aren't either, so bring the downvotes and bury it lol
 
Just trying to keep you safe :)
 
user1596138
It has 6 upvotes somehow
 
user1596138
Bruh I am the least safe user on this site. They know me by username and will jump at the opportunity to fuck me :)
 
user1596138
5:56 PM
@ndugger I like the order of our messages in the stars
 
watup guys
I'd like to add a 1-click button to MyAnimeList pages to add anime/manga to my list with "plan to read" or "plan to watch" parameter
 
Anyone know how to achieve this condition with RegExpressions?

'abcdefgh' match 'beg' character set only when all 3 characters are available

/[beg]{3}/g This expresssion matches but only when the characters are next to each other
 
I barely know my way around js, and I've managed to whip up an xmlrequest thing once but it took me like 4 hours
this seems very simple and shouldn't take much time from someone with experience
if you have 10 minutes, please write a usersscript for me or at least help me do it quicker than several hours
 
We will not write a userscript for you
 
not typically a good strategy to ask for code
 
6:07 PM
You should, however, look at the fetch api; it's much simpler than XMLHttpRequest
 
the request is fairly simple
{"manga_id":899999,"status":6,"score":0,"num_read_volumes":0,"num_read_chapters":0,"csrf_token":"token goes here"}
as a post request to https://myanimelist.net/ownlist/manga/add.json
 
You're asking people for a free service. We do not write code for people for free, we help people learn javascript so they can achieve their own success
If you don't want to learn JS, I suggest hiring a freelancer
 
well, this is not success, this is for my personal manga list lol
I just thought maybe someone can do this, since it seems to be simple enough
 
Unfortunately you won't find that here
 
I mean people help out with regex all the time, this is the same thing in my opinion
 
6:10 PM
you wouldn't ask a photographer to take your portraits for free just because it seems to be simple enough
"people take photos of me with their smartphone, this is the same thing in my opinion"
 
posting code in a chat and setting up a photo shoot is kinda different, don't you think ? :p
I get it you guys, I'm not forcing you
 
It's all good, you were nice about asking
 
well, you were nice about explaining why you don't wanna do it, but I don't think it's right to say it can't be done or "I won't find it here"
 
it can be done, but no one works for free
 
Anything can be done, but again, StackOverflow is not a free code giveaway
 
6:13 PM
@user1306322 what your are asking for has more overhead. You have to provide more specifics
 
maybe someone else will be kinder and not be all "we don't work for free"
 
if it was an interesting problem, someone would probably do it
 
lol
 
I've been in this chatroom for several years, and I know all the regulars enough to say that they won't just write code for you
 
What error are you getting? What API are you using?
 
6:13 PM
@HelloWorldPeace the request body and the url is all the specifics there are, so it's really actually that simple
@HelloWorldPeace I'm using tampermonkey and my hands to write a userscript but my dumb brain can't make it all work and it's already been 1 hour :p
 
If it's that simple, you should have no problem doing it yourself. You aren't allowed to be passive-aggressive to us since we won't give you free code.
 
Feel free to ask questions about doing it
 
Do most web devs build sites from scratch?
 
I'm not being passive-aggressive to you, I'm saying you're being uncool about it and turning it into "this is work, we won't work for you for free"
people ask about regex all the time, and it's the same type of work
 
Are there major pitfalls in doing so?
 
6:15 PM
anyway, I don't want to continue this discussion
 
I too think it's time for this discussion to move on
 
@HelloWorldPeace do you want to find all lines where characters b, e and g are present or what?
 
@HelloWorldPeace I have no idea what you're asking, but is it ([bed]?){3}
 
@user1306322
Sample text: 'abcdefgh'
Match: 'beg' ...only when all 3 chars are present

/[beg]{3}/ ...matches only when the chars are next to each other
 
6:19 PM
You want to evaluate one of b, e, or d, (which may or may not exist) 3 times?
 
@SterlingArcher for posterity I'd like to say that I've been in other chat rooms and we've done things like write userscripts, css themes, c# apps and batch scripts for each other for free, and shared out collective efforts online for free for others to google and use, and I think that's the kind of spirit most such communities should strive for
 
Oh, then I have no idea
 
I just happen to be bad at js and userscripts, but good at other things
 
People in the c# room make entire apps for people?
 
teach a man to fish, etc. etc.
 
6:21 PM
That's fine, but we're not that kind of community. We believe in teaching to promote achievement, versus providing time
 
and since my guys are not online at the moment, I thought I'd ask here
I'll just have to wait for my folks to return from the weekend
 
what are you good at? maybe we can trade
 
i've be testing it on regexr.com but can't seem to reach the condition i want
 
@HelloWorldPeace give me some example strings you wish your regex to match
and some which shouldn't match
 
I listed it above @ 14:19
 
6:24 PM
@user1306322 He wants to match a string that has exactly 3 occurrences of b, e, or d
 
I'm sorry it's 21:23 here so I don't have chat history from that long ago
 
21:25 here :p
 
never assume someone's timezone
 
what @Cereal said ...set of b & e & d ,
 
6:27 PM
examples of lines that should match please
multiple different examples
 
'abcdefgh' match b & e & d only when all 3 are available
 
that's example #1
 
bbb would also match
bed would match
ddd would match
dddd would not match
bee would match
 
@HelloWorldPeace is that ^ right?
 
thats correct for /[beg]{3}/ ... not for what i want
 
6:30 PM
well, post lines for what you want then
I don't understand what you want so far
 
i want specifically b AND e AND g not b OR e OR g
 
or, so literally the word bed
 
There is no character which is both b and e
 
/(beg)/ but globally
 
Oh no, you mean
 
6:32 PM
Do you mean specific sequence of characters?
 
It has to have the letters b, e and g
 
Sorry, misunderstood
 
ohhi
 
Sounds like you just need three includes checks
 
6:34 PM
does the order of the characters matter?
 
@KendallFrey is that similar to a look around?
order does not matter
 
No, it's a method call
string.includes("b") && string.includes("e") && string.includes("g")
 
user1596138
Does the order matter
 
...
 
user1596138
6:36 PM
To him.
 
user1596138
Oh shit
 
lol
 
var string = 'abcdefgh'
string.includes("b") && string.includes("e") && string.includes("g")
true
not what I was thinking of but it works so thanks all.
 
user1596138
You could do it with regex but tbh this might be as as or more performant
 
user1596138
Also it's very very clear what it's doing
 
6:42 PM
If you do it with regex you'll just end up simulating includes.
there's not much point of that unless you're golfing or something
 
user1596138
Pretty much. I just am referring to his comment that this is "not what I (he) was thinking"
 
user1596138
Also works a lot better for dymamic character arrays lol
 
right, I was looking at the wrong tool for the job
 
Which regex usually is
For being a self-proclaimed regex expert, I spend enough time telling people not to use it.
 
regex is best used for parsing markup
 
user1596138
6:44 PM
const string = 'abcdefg';
const charsToMatch = ['b', 'e', 'g'];
charsToMatch.every(char => string.includes(char))
 
like xml or, ideally, html
 
I like the idea behind regex as a tool, but i almost never use it
 
@forresthopkinsa wait a sec, i have just the thing
 
there's usually an easier tool to use
 
6:50 PM
it's.... it's beautiful
 
chrome says it's invalid
 
Question: When referencing an object property via object destructuring, why does it always list the property type as 'string', even if the type is a number or boolean?

Example: https://gist.github.com/rmullins-convene/132a196e52ec229b0849427c2f4620a5
 
> typeof `${property}`
because you're literally putting it in a string
 
typeof 'foo'
 
Didn't know that's what the backticks did... thought it was just syntax
 
6:55 PM
you thought it was syntax, but no idea what for?
 
You cant reference it without the backticks
 
uhhh, wrong
 
typeof property
??
 
backticks are just a string with interpolation
"a" === 'a' === `a`
 
that works ^^
typeof property
sorry, i was under the impression u had to reference the obj.prop via `${prop}`
 
6:57 PM
Not sure were you read that
But don't read it again
 
lol
thx for the clarification y'all
but then whats the point at all of the `${prop}` when you can reference it just by 'prop' (the property name alone) ?
 
for creating strings without all the 'foo' + ' ' + bar + etc
 
ok makes sense
ty
:-)
 
backticks without interpolation will cause linting errors however
 
That depends on entirely on what your linting rules are
 
7:01 PM
also yes, but it's still a good practice
 
you're a good practice
There's this attractive 20 year old I matched with on Tinder. I think she's too young for me, so I haven't responded to her latest message.
If we can't get drunk and make out in a pub, what are we even doing here?
 
elope to canada
 
Oh, right
 
also weed or something
 
user1596138
I just thought I should mention what i did this weekend, pretty easy to guess
 
user1596138
7:08 PM
Floated 3.5 hours down a river on a inflatable orca
 
yeah pretty predictable
 
user1596138
I mean for me at least
 
user1596138
Sailor Jerry fell into the water tho at 2.5 hours :(
 
Did you have a backup?
 
user1596138
Yes, he was replaced by the good Captain Morgan
 
user1596138
7:11 PM
There was like 23 of us floating. My buddy owns land along the river so we just got out on private property where we left the rest of the beer haha
 
user1596138
My legs are burnt.
 
get new legs
from the leg store
 
user1596138
 
user1596138
@SterlingArcher
 
^ I appreciate this
 
7:22 PM
🚽
 
I recently found out that I can look up my entire youtube comment history, and so I scrolled all the way to the bottom. All 9 years of it. I used a browser console command to extract all the links for it, and now I've got a 14k line file where the bit I want the most has the format
VM1654:1 http s://ww w.youtub e.co m/watch?v=XxXxXxXxXxX&lc=SoMeChArAcTeRsTrInG
VM1654:1 http s://ww w.youtub e.co m/watch?v=XxXxXxXxXxX
every other line. I want just the lines with the &lc= bit since the rest are redundant.
 
@0xFFF1 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.
 
i mean, yeah, you could have something read the file line by line, moving anything with an lc param to a new file.
 
user1596138
@0xFFF1 Simply do your selection again and don't store the ones you don't want....
 
user1596138
You compiled the list. Compile it better lol
 
user1596138
7:30 PM
> I used a browser console command to extract all the links for it
 
user1596138
Otherwise simple regex. Subliem Text is Python and you can take a few seconds to delete every line not containing lc=
 
i code kiddied it from someplace else because I was lazy
 
cat file.txt | grep &lc= > new.txt
 
ah, windows console means I dont have to install a dev environment program just for this
thanks
 
user1596138
^.+&lc.+$
 
user1596138
7:32 PM
It's a one time opreration who cares about a good regex
 
user1596138
 
I care
 
user1596138
!!stat 0xFFF1
 
@Jhawins 0xFFF1 (https://stackoverflow.com/users/2331718/0xfff1) has 101 reputation, earned 0 rep today, asked 0 questions, gave 0 answers, for a q:a ratio of http://i.imgur.com/F79hP.png.
avg. rep/post: T͎͍̘͙̖̤̉̌̇̅ͯ͋͢͜͝H̖͙̗̗̺͚̱͕̒́͟E̫̺̯͖͎̗̒͑̅̈ ̈ͮ̽ͯ̆̋́͏͙͓͓͇̹<̩̟̳̫̪̇ͩ̑̆͗̽̇͆́ͅC̬͎ͪͩ̓̑͊ͮͪ̄̚̕Ě̯̰̤̗̜̗͓͛͝N̶̴̞͇̟̲̪̅̓ͯͅT͍̯̰͓̬͚̅͆̄E̠͇͇̬̬͕͖ͨ̔̓͞R͚̠̻̲̗̹̀>̇̏ͣ҉̳̖̟̫͕ ̧̛͈͙͇͂̓̚͡C͈̞̻̩̯̠̻ͥ̆͐̄ͦ́̀͟A̛̪̫͙̺̱̥̞̙ͦͧ̽͛̈́ͯ̅̍N̦̭͕̹̤͓͙̲̑͋̾͊ͣŅ̜̝͌͟O̡̝͍͚̲̝ͣ̔́͝Ť͈͢ ̪̘̳͔̂̒̋ͭ͆̽͠H̢͈̤͚̬̪̭͗ͧͬ̈́̈̀͌͒͡Ơ̮͍͇̝̰͍͚͖̿ͮ̀̍́L͐̆ͨ̏̎͡҉̧̱̯̤̹͓̗̻̭ͅḐ̲̰͙͑̂̒̐́̊. Badges: 0g 0s 2b
 
user1596138
No participation of any kind ever?
 
user1596138
7:35 PM
That image lmao
 
classic
he's participated but deleted the question
 
i have participation from other sites on this site
 
Hello
 
it's a shit question anyways
 
7:37 PM
first questions tend to be
 
I am making a pacman game.
I want to see tree to find the shortest path.
I found this : https://code.tutsplus.com/articles/data-structures-with-javascript-tree--cms-23393
I have make the function find_neighbours(x,y)
Now i want to make the function find_way_for_pacman(x_start,y_start,x_end,y_end)
 
you're looking for pathfinding
 
Any help would be usefull.
 
Pathfinding or pathing is the plotting, by a computer application, of the shortest route between two points. It is a more practical variant on solving mazes. This field of research is based heavily on Dijkstra's algorithm for finding a shortest path on a weighted graph. Pathfinding is closely related to the shortest path problem, within graph theory, which examines how to identify the path that best meets some criteria (shortest, cheapest, fastest, etc) between two points in a large network. == Algorithms == At its core, a pathfinding method searches a graph by starting at one vertex and exploring...
 
A*
 
7:40 PM
@ndugger what
 
@ndugger thanks
 
@forresthopkinsa what to do when you are on windows so you dont have access to grep?
 
you download a better shell lol
easiest way is probably gnuwin32
 
@forresthopkinsa arongranberg.com/astar
 
OH. Gotcha.
 
7:44 PM
erm, en.wikipedia.org/wiki/A*_search_algorithm
great, link parsing breaks on asterixes lol
 
@ndugger I started thinking "why is that not asterices", then I realized it's "asterisks"
 
first link is some dude's unity plugin
I don't care about spelling anymore. My brain cells need a break from being a pedant.
 
remember that only one of that pacman ghosts runs around randomly
another heads straight towards you in the most efficient way, the next attempts to move ahead of you to cut off your escape, and i forget the last one
 
aren't you writing it hahahahaha
oh no that's @ChrisP ok nvm lol
 
Blinky directly chases pacman, Pinky chases 2 tiles ahead of pacman, Inky chases pacman based on his relative position to Blinky, Clyde will chase pacman in a predictive manner until he gets within 8 tiles of pacman, then will flee
 
7:53 PM
clyde's such a coward
 
I don't know if I feel liberated or sad that my 2.5 year long pursuit of this girl is at a close. I think the only thing to do is go on a tinder-rebound escapade
 
user1596138
Did ndugger just reveal himself to be towc
 
yes
 
user1596138
Hell of a Monday
 
I am a 13 year old european that sleeps on boxes at a hackathon
 

« first day (2795 days earlier)      last day (2169 days later) »