« first day (2056 days earlier)      last day (2891 days later) » 

4:01 PM
What's everyones fav JS libs?
 
@RhysBradbury Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@RhysBradbury I'm partial to the only true library
 
I really like any library that isn't JS
 
ffmpeg
 
laravel
 
4:06 PM
lolavole
 
@SterlingArcher Tighten that up, dude. Your calories are all over the place. I try to hit an even 1800 every day.
 
@ndugger SterlingArcher is afk: eat fresh, fuckboy
 
@SterlingArcher is that a clever Jared reference?
 
should using Array.prototype.splice.call(someArray, index, 1, element) return a new array with 1 element added in at index?
 
> Array.prototype.splice.call(someArray
I'd use Array.prototype.map.call(Array.prototype.constructor.call([], 1), _ => 1).splice(idx, 1, e)
 
4:15 PM
..
 
@corvid splice doesn't return a new array. if elements were deleted, it returns those
 
@NathanJones Yeah but that's not what I am after, I want to return the array generated by inserting or replacing some element
 
@ssube's snippet gets around that by calling map, which does return a new array
 
Need QA assistance: The accepted answer to stackoverflow.com/questions/5232295/… is incorrect, but accepted and most upvoted.
 
@NathanJones my snippet is intentionally fucked, just like his original code.
@corvid define "generated by"
@le_m explain
 
4:19 PM
The question asks for all permutations of a string ('1234', '1243', ...), the answer only works for 3-letter strings
even the poster admits that his/her answer is wrong ;)
 
@ssube Basically, it's an "upsert" behavior on an array. Find an element and update it by some property, but if it was not found, simply push it into the array and return the entire updated array
 
@le_m it works for longer strings, so far as I can see
@corvid you want a findIndex followed by splice or push
 
@corvid does order matter?
 
@ssube The number of permutations of a n-character string is n!, this answer does return fewer than that.
 
@NathanJones Nah, are you thinking hashmap?
 
4:22 PM
@le_m dv and comment, then
 
@corvid actually, I was thinking Set developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…, but i don't know the larger context so it might not be right for your use case
 
a Set would be good, if you don't care about order
 
@ssube I did, just asking for more eyes to evaluate
 
@le_m i don't think it's working right. "1234" only returns 10 results, but it should return 24 (4!) results.
 
@NathanJones Yup.
 
4:30 PM
@NathanJones Map appears to work, although it seems a bit strange to map values from a Map, I feel like I am doing it wrong
[...myMap.entries()].map((val, key) => <SomeComponent key={key} {...val} />)
 
@corvid isn't there a better approach without allocating the array [...myMap.entries()] ?
 
I always prefer being more explicit, and using Array.from rather than spreading into one, but that's just me.
 
How do you add the canvas or javascript inside the container?
 
wat
 
@le_m yes
 
4:36 PM
Those definite articles seem so out of place
 
Can't get js to b e viewed in the HTML5 , at least on inside the div, only the end of everything
 
@le_m you'll probably want to look into Heap's algorithm to generate all permutations
 
@corvid for (const e of myMap.entries()) { const [val, key] = e; console.log(val, key); }
entries returns an iterable m8
 
Why is it like that?
 
@Global You're making no sense at all
 
4:38 PM
@NathanJones I actually did yesterday, in a paper from the 1970 ;)
I implemented the optimized non-recursive variant
 
@ssube can't use const in for-of
let it be let
 
@jAndy orly
works a-ok in chrome
 
not so much in ff
 
let it = 'go'
3
 
FF is probably just still broken
 
4:40 PM
no clue if FF screws up or not
 
@ssube Yes but that doesn't really "map" it to a unique value
 
FF might as well go the way of Opera and just give up.
 
I write my <script src =...> right before </body>. But I want the context to be viewed right below header. Now it's outside the whole width & height.
 
however, why would you prefer const over let?
 
@jAndy you should always prefer const. let is a fall-back for when your code has to mutable for some reason.
 
4:41 PM
It just makes sense; make your variables more secure
@Global You're still not making any sense
 
explicitly calling out variables that could change is good practice
@corvid then combine it with a push or something...
 
variable - (n) an element, feature, or factor that is liable to vary or change
 
@nderscore which is why we don't use var for constant values, we use const
 
hello guys
 
4:56 PM
Makes sense?
 
No
 
Game should be inside the white background.
 
There is no game; what are you talking about?
 
@ndugger this:
		<script src="javascript/game.js"></script>
		<script src="javascript/game_levels.js"></script>
		<link rel="stylesheet" href="css/game.css">
		<script>runGame(GAME_LEVELS, DOMDisplay);</script>
which ain't gonna do no good in a fiddle
 
runGame is not defined
 
5:03 PM
damn
 
0
Q: Linux related firewall API

eranga jayaweeraAre there any Linux related firewall API? And What are preferable language use for implement firewall shake-hand. Is it possible to use JavaScript?

 
the person using this computer last, installed a bunch of those 'windows font smoothing' things and now my fonts are a bit screwy
i know it's offtopic but does anyone know how to search and remove them?
perhaps they are unrelated but it's the only difference when coming back: i.imgur.com/OeIMc7k.png
 
Guys I am doing some practice excercises can you tell me what's wrong with my function ?
function maskify(string) {}
 
does anyone have any idea?
@Ajit nothing
 
@Ajit it looks correct
 
5:05 PM
@Ajit your function compiles, at least. what do you think is wrong with it?
 
@Ajit 8/10 would call
 
The game is working.. but it's outside the main content.
get it?
 
Sorry about that I hit enter and it posted :) I'll copy from an editor then
 
@Ajit use pastebin.com
 
@Global no, since you still haven't provided a working example. Don't ask again unless you can give us something to debug.
 
5:08 PM
(if anyone can help with my unrelated win10 font issue i'll send you the rarest memes)
 
@SterlingArcher My pants are starting to fit weird; like they're not loose quite yet, but I can feel them getting there.
 
HI ppl
 
1 message moved to Trash can
@Ajit Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
return a ? b : c;
don't return inside the ternary
 
@CapricaSix, what did you doooo
 
5:09 PM
@ndugger SterlingArcher is afk: eat fresh, fuckboy
 
@ndugger save all of your larger clothing. then when you get to your final final goal you can do the 'big pants' picture. then when you get pets you can turn them into sweet pet beds that smell like you
 
lol
 
function maskify(string) {
	string.length > 4 ? return ( "#" + maskify(string.slice(1)))
	: return string
}
I am trying to mask all but last 4 letters of a string
 
why recursive?
 
5:13 PM
@ndugger :D Mine are buttoning easier too it's awesome
I'm down a belt notch
 
@Ajit you can't have a return statement in the middle of a statement like that
 
dugger I can't provide the whole game.
 
@Ajit you can't return at the position in the code
 
4 mins ago, by rlemon
return a ? b : c;
 
I usually don't wear a belt; I'm gonna have to start soon, though
 
5:13 PM
4 mins ago, by rlemon
don't return inside the ternary
 
@ndugger what? why? how?
 
@ssube Fat enough that the pants stay up on their own
 
my pants stay up on their own, but belts still make them sit better
 
So that's how marriage works
 
5:18 PM
 
function maskify(str){
return str.replace(/.(?=....)/g, '#');
}
 
@SterlingArcher shame the poor toilet is a whore
 
@nderscore why do you think recursion is a bad idea? Sorry I am new to javascript (programming)
 
There is no need for it
in your scenario
 
5:20 PM
@BadgerCat oh my god...
People said "Too soon? Fuck it" on this one
 
@ndugger my pants stretch through the day
they fit fine in the am, falling off in the pm
@SterlingArcher CHECK G+
 
SO do mine, but they've still fit.
But now that they're starting to get loose around the waist, I'm gonna have issues with holding them up
 
@Ajit because at some point you're going to hit the call stack limit :P
 
Perhaps if you do infinite recursion... but not liking recursion at all is just foolish
 
@nderscore oh, you mean if the string is too long
 
5:25 PM
@ndugger recursion makes sense in some cases, but in this case it could be handled with a simple loop
 
function poop(str) {
  return Array(str.length-4).fill('#') + str.slice(-4);
}
 
@Ajit that's not really going to happen with strings unless you royally botch everything
you'd need a very long string
but recursion is just complicating the function here
 
might need a join in there
;)
 
@nderscore Just wondering .. because I find it easier to think in terms of recursion than loops if there are valid not to use it javascript I would have to change my habit :)
 
!!> const str = "1234566778899032345245"; Array(str.length-4).fill('#').join('') + str.slice(-4);
 
5:28 PM
@rlemon "##################5245"
 
@Ajit if you don't strictly need to recurse, use a loop.
 
Loops are much easier to understand, but recursion is prettier
 
It's the basis of tail recursion
loops are generally cheaper and easier to read, so use them when you can
 
@rlemon fails if the string length is less than 4
 
so don't do that
 
5:37 PM
function slide(poop){
    return '#'.repeat(Math.max(0,poop.length-4)) + poop.slice(-4);
}
 
woa! that UCLA shooting was over stolen source code.
 
> a note he left at the scene of the UCLA shooting asking whoever found his body to go and check on his cat.
what a creep
 
Apparently he was a shit student that had poor quality work
So he got mad
what a bitch
(If you flag that, you condone school shootings)
 
if you like ice cream, you condone killing panda babies
^ literally the worst type of argument
 
5:48 PM
@ssube that's the creepy part? It's the only thing that showed some humanity
 
2tru
 
LOL I just got a message from a client with my PM cc'd, asking me for integration notes.. and my PM immediately emails me only back with:
> JORDAN DO NOT ANSWER THAT EMAIL FOR THE LOVE OF GOD
2
 
respond with this ^
 
@ndugger that makes me worry about some of our borderline-expelled students here
 
5:50 PM
so I didn't plan this out -- and I have no one feeding raphael and donatello
 
I'm so naming my next cat donatello
 
i.imgur.com/OkmNozt.gif late night imgur strikes during the day
 
@SterlingArcher why did your 7 day steps go down? I thought you were at 40k, now fitbit says you're at 32k...
 
@rlemon can you leave excess food for them?
@ndugger that's for the last 7 days
 
raphael and donatello are my turtles
 
5:51 PM
I was on the beach, so I didn't have my fitbit on most of the weekend
 
Ah
I for some reason thought I saw it at 40k before
 
the food would rot if I gave them more than a feedings worth.
 
Yeah lol it'll go back up, then down again
I'm going to a lake this weekend, so my steps will drop again
Then finally maybe the weekends will be free to workout and not leave the state
I never desired a sleep in weekend so hard
 
Hi guys
 
I'm not working out at all on sunday's. It's my one true rest day
 
5:52 PM
@SterlingArcher What kind of project is that
 
Jordan builds airplanes with jquery plugins
 
@Magisch we're building a security layer device using location based authentication (not GPS, triangulation, etc)
 
I have 1 html page
 
I have 1 peanut
 
I have 1 apple
 
5:53 PM
I have 1 friend
 
@SterlingArcher So
What are integration notes and why cant you mail them
Im an apprentice so I have no clue
 
Because we don't have any yet. We're building the prototype device.. we haven't even reached any sort of integration phase yet
 
@Magisch they are whatever your company decides they are
> npm ERR! rofs EROFS: read-only file system, open '/root/.npmrc'
 
^ also that
 
really npm? really?
you're going to be read-only and you're going to like it
 
5:55 PM
Now is there any performance difference between firing 1 ajax request vs firing 2 ajax request
 
@Learning yes
one of those two does one things, the other one of the two does two things, and one of those is one thing more than the one thing the original one did
 
less is more
 
God that cake... don't tempt my diet
 
5:56 PM
I was tempted with cookies yesterday and it was hard not to have one
But I done diddly did it
 
We have cheesecake at the office today; I didn't have any
 
see
my only big project yet was a customized driver for a special family of handscanners
 
It's good I don't like cookies or cake
 
Recently I argue on this and my senior pointed out that there won't be any performance problem with firing 2 ajax request vs 1 ajax request
So at the end I was proved wrong
 
@SterlingArcher thats how I imagine them
 
5:57 PM
@Learning before claiming there is a performance problem, you should benchmark it.
 
Cookies are the only sweets I enjoy. Especially soft cookies
Cake? Ice cream? candy? Meh, easy to resist
 
@rlemon what's your weak spot?
 
try rasgulla :P @SterlingArcher
 
If I can't spell it drunk, I won't eat it
 
@FilipDupanović back of the neck
 
5:58 PM
@ssube does firing ajax request takes up browser memory
 
@Learning yes
 
@SterlingArcher I dare you!
 
Like if I have html page running for 1-2 hours
 
> html page running for 1-2 hours
this is odd to read
 
lol
html doesn't "run"
 
5:59 PM
yet you are on an html page that has been 'running for hours'
 

« first day (2056 days earlier)      last day (2891 days later) »