« first day (1784 days earlier)      last day (3165 days later) » 

10:00 AM
@JanDvorak Aren't all developers a developer of colour?
 
now imagine gow more racist it's when you append "picker"
 
Triggered
 
Also #blackdeveloperproblems means said developer wasn't serious
 
@FlorianMargaine seems fast enough so far
 
I'm voting to close this question as off-topic because this is a broad and vague question showing zero research. — Denys Séguret 18 secs ago
 
10:02 AM
@DenysSéguret Couldn't you just close it as "too broad"? :P
 
I like to insult people, that's why
 
Just don't delete it :P
 
It got me 5 easy upvotes :D
 
opvotes?
 
10:03 AM
@BartekBanachewicz cool
 
Can't think of a pun, so I'll just fix the spelling instead
 
ah. I was wondering if opvotes were a thing.
 
user3119231
 
user3119231
is this the right way to use http requests?
 
@BenFortune :D
 
10:04 AM
@Maurize no. Use xhr.onload
 
@Maurize -1 not enough jQuery
 
or that^
 
!!s/jQuery/fetch/
 
This could actually become a reversal badge stackoverflow.com/a/32395192/1835379
 
!!google caniuse fetch
 
10:05 AM
sigh
 
So I'm gonna make a mistake and install Windows 10. If the FBI takes me, ask @BenjaminGruenbaum for the goat porn stash. He'll know where it is.
4
 
@rlemon She ded again
 
Just 15 more upvotes xD
 
user3119231
@BenFortune jQuery? Y U NO SCRIPTING URSELF?
 
@Zirak Do it, it's great.
 
10:06 AM
!!s/great/better than 8/
 
@Zirak I've heard the spying core is getting backported into Win7 and Win8
 
Keep it realistic
 
user3119231
So I just typed score = 100 in console and tada, I've increased my score by this.
 
user3119231
:'(
 
@Maurize So scope it.
 
user3119231
10:09 AM
Can you give me reference?
 
it will make things a little harder to "hack"
 
user3119231
So there is no way to prevent someone from injecting some variables
 
@Maurize Plenty of ways to do it, IIFE, revealing module pattern etc
 
(function(){ var score = x; })()
 
what's this spy score?
not that I'm worried.. brb formatting hard drive
 
user3119231
10:12 AM
It isn't. It is just a self invoking function
 
Nope, it's an IIFE
 
user3119231
Ah got it.
 
IIFE = immediately invoked function expression, aka self invoking function
 
it may be known as such, but it doesn't invoke itself
 
And yay, my pam module authenticates me without password \o/
 
10:18 AM
@FlorianMargaine Nice!
 
Which means I now need to scan for block device and find my USB key and authenticate it with what's in it...
 
user3119231
no way to manipulate it.
 
user3119231
-> you only could type score() in console
 
just put a breakpoint inside the function
 
@Maurize you know, I don't need to be in the browser to send ajax requests
 
user3119231
10:19 AM
var score = (function(){
	var score = 0;
	return function(){
         return score++;
     };
})();

document.getElementById("input").onclick = function(){
	console.log(score());
}
 
user3119231
damnit
 
only way to be sure is to have the server manage the score
but then any ajax request that makes the server bump up the score has to be legitimized
 
user3119231
So handling the score on server and just send values to frontend to show them is the best way?
 
e.g. check that not too many of them come, or add some kind of signature, etc. It's always cheatable, you just have to find the balance
 
There's no way against automated clickers, period. Even if your client computes some cryptographic function, I can rip that code out and into an automated clicker.
 
10:21 AM
@Maurize If you were making a guessing game where the program creates a number and the user guesses it, the worst way to do it is all client-side since you could just check the variable of the number
You can hide it, and that's a little better, but better to use ajax request to guess and the server tells you whether or not you guessed it (and keeps track of wrong guesses)
 
the easiest way to prevent cheating is to ensure that a cheating player is only cheating themself.
 
client fakes ajax requests but they still count as wrong guesses
 
user3119231
I will simply do it serverside and just do get requests for showing scores in js.
 
that would be safest, yes.. keep in mind that anything sent from client can be manipulated so don't trust it
if you can trick the server into giving you a big score, then it is just as bad as keeping it client-side
 
user3119231
would something like this work?
 
user3119231
10:24 AM
var xhr = new XMLHttpRequest();
var xhr_array = ["name", "score"];

document.getElementById("input").onclick = function(){
	xhr.open("GET", "score.php");
	xhr.send("request=" + xhr_array);
}

xhr.onload = function(){
	document.getElementById("output").innerHTML = xhr.responseText;
}
 
user3119231
I want to make a compact request.
 
I think not.
 
for asking for score? you don't really even need to send ["name", "score"] unless you wanted to dynamically determine what values get sent back
 
1
Q: Detect when scrolled to last li

CornerI need to check if the user has scrolled to the end of a list item <li> on my page. I want to perform an AJAX call, when this happens. How to know if the user has scrolled to the last list item. This is what I've tried till now. if ($('li:last').is(':visible')) { alert('Scrolled to last li...

 
user3119231
@Neil I want to sent array to server so I can return all values from server
 
10:28 AM
@Maurize ok, well your call not mine
 
*send an array
 
user3119231
40
A: Send an Array with an HTTP Get

BalusCThat depends on what the target server accepts. There is no definitive standard for this. See also a.o. Wikipedia: Query string: While there is no definitive standard, most web frameworks allow multiple values to be associated with a single field (e.g. field1=value1&field1=value2&field2=value...

 
well, your code won't do that.
 
@Maurize xhr.send(JSON.stringify(xhr_array))
 
user3119231
10:32 AM
@Neil you don't say :D
 
@Maurize >:(
Don't bite the neck that ... err...
 
10:47 AM
Let's close this
SPAM!
Hammer Time!!!
 
user3119231
no. :(
 
don't close spam, flag it
six flags = gone
 
user3119231
What kind of satan font is this?
 
by font, do you mean alphabet?
 
user3119231
no. font-family: satan.
 
10:51 AM
orly?
 
font-family: Verdana, Arial, sans-serif;
 
11:11 AM
@Tushar oh, and don't onebox spam
1 message moved to Trash can
 
uhh.. someone want to run some estimates for this guy?
 
Sure: "More time than it does to close the question"
 
Yeh?
 
No, Hey
 
11:20 AM
Facebook is rebuilding React from scratch ^^ announcement
16
 
shit
you guys got me third time
 
Hm, testing
Nevermind xD
 
user3119231
so i have this:
 
user3119231
var xhr_array = {
    "name": "guest",
    "score": 0
};
 
user3119231
11:26 AM
how can I loop through it and get key names?
 
Object.keys(xhr_array)
 
Object.keys(xhr_array)
Damnit
 
Object.keys(xhr_array)
 
user3119231
Object.keys(xhr_array)
 
user3119231
Thanks @phenomnomnominal
 
11:27 AM
stop replying to yourself
 
user3119231
Stop replying to myself. - You forgot the dot.
 
capital S
 
@Maurize for(var key in xhr_array), just to be special
 
@Maurize for (const key of xhr_array), just to be in your future
Hm... I think I'll make a pam module to authenticate with no pass
Or just anything. No validation, you always pass.
 
Thou shalt not pass.
 
11:38 AM
Useful for people having desktops and don't want to care about security and the likes... Just do it™
I had issues with my wife's laptop who wanted just that... It's a simple laptop and she doesn't care... But Linux needs passwords or some stuff doesn't work
 
@Maurize for(var key in xhr_array){if(xhr_array.hasOwnProperty(key){... -- this is the ghost of javascript past speaking to you
 
Object.keys(xhr_array)
 
I'll be able to remove it with that
Or not touch it...
 
call it TSP: thou shalt pass
or perhaps thou shalt not password
 
user3119231
Thanks. So many good answers.
 
user3119231
11:45 AM
*many.
 
user3119231
Y U NO using punctuation marks?
 
I do sometimes?
 
11:57 AM
 
Let's eat grand, ma!
 
Also, proper capitalization is the difference between helping your uncle Jack off a horse and helping your uncle jack off a horse
 
I was about to mention that one
 
is jack a verb?
or jack off
 
jack off.
 
12:00 PM
what does it mean?
 
Google it :D
 
user3119231
Done. Synchrone arrays. :D
 
!!urban jack off
D:
 
Cap's ded
 
> stimulating your penis with your hand to cause orgasm and ejaculation. Male masturbation.
Brian had the blue balls so bad he had to jack off as soon as he got home.
k
 
12:01 PM
switching tabs
 
Lies, you were typing, @JanDvorak
 
12:15 PM
Does anyone know how to set the files to UTF-8 encoding when you use IntelliJ to develop Node?
 
This conversation is amusing and nobody had to even try to make a joke out of that
 
I once helped my uncle Jack jack off a horse.
 
Thanks for sharing
 
I suppose the horse was thankful as well, not like they can do it on their own
 
user3119231
are 2ms for a get request via ajax much?
 
12:23 PM
@ivarni: You'd be wrong in that, actually
 
@Maurize What do you think?
 
They can
 
Pics or it didn't happen
 
user3119231
@Zirak I think it isn't
 
They just don't use their limbs.
 
12:23 PM
Wait, on second thought I'll just believe it
 
Bleh... Is it better to use a collection hook or some kind of autovalue for calculated fields in a database?
 
@Maurize What'll be your ideal value?
 
user3119231
@Zirak 1ms.
 
Good luck.
 
12:25 PM
@JanDvorak He's doing it wrong
 
@JanDvorak Horse used dig, it's not very effective.
 
might be narcolepsy, or just Clop
 
user3119231
 
user3119231
Thanks, but I don't need luck.
 
> Localhost
 
user3119231
12:26 PM
It is only local.
 
2ms on localhost is a bit slow
 
user3119231
Put your glasses on. 1ms
 
4 mins ago, by Maurize
are 2ms for a get request via ajax much?
 
groan
 
12:28 PM
@Cerbrus Not what your mum said
 
@BenFortune I'm embarrassed to say that this made me laugh out loud and my coworkers to look at me
 
Hm, can you bounce a "premature" joke with a "your mom"?
 
@Cerbrus Ask your mum
 
-.-
Too easy
 
I don't know where I'm going with this.
 
12:30 PM
Just going with it? Neither did your mom
 
@Cerbrus That's what she said (???)
 
@Neil 2/10
 
Meh
 
TWSS
 
Hm... what's the most efficient way to find in nested lists of objects? Here's the object I have:
{ name: 'thing',
plan: [{
  _id: '1233',
  name: 'Duck A'Lorange,
  times: [{ period: 'Dinner', count: 1 }]
}, {
  _id: '6788',
  name: 'Eggs',
  times: [
    { period: 'Breakfast', count: 2},
    { period: 'Dinner', count: 4 }
  ]
}] }
I want to find everything that occurs for the time period of Breakfast
 
12:40 PM
So, you want to filter the plan array?
 
oh, _.filter... now it seems obvious
 
 myObject.plan = myObject.plan.filter(function(item){
    return item.times.some(function(time){
        return time.period === 'Breakfast' ;
    });
});
That should do the trick
 
Awesome, thank you good sir
 
MLM
Just fell into this trap; window.length is a thing and Array.prototype.slice.call(window) gives an array of the iframes in the document.
I was checking if an item was array-like with this logic item && item.length && !Array.isArray(item) which then did the slice and it was giving me Uncaught SecurityError: Blocked a frame with origin when trying to use it. Now my array-like check is
 
seems window is an array-like, then
 
MLM
12:50 PM
item && item.length && !Array.isArray(item) &&
// The window object acts as an array of the iframes in the document (undesired effects for my use cases)
(window && !(item instanceof window.constructor))
It was a intermittent problem probably because the iframe is only added to the window's array-like once the frame is loaded
 
How did you even get to the situation where you're trying to iterate over window?
 
MLM
domUtility.on(window, 'scroll DOMMouseScroll', (e) => {
  console.log(e);
});
 
ah. hehe.
 
jQuery scroll plugin solves everything dude
 
12:57 PM
@MLM Array.from is your friend
 
@Zirak [...a]
Array.from is too verbose
 
You can't pass syntax to functions
 
!!s/verbose/mainstream/
 
@Luggage DENIED
 
!!info
 
12:58 PM
@rlemon I awoke on Fri, 04 Sep 2015 12:19:49 GMT (that's about 38 minutes ago), got invoked 1 times, learned 401 commands
 
...
y u no respond to Luggage?
 
!!s/Luggage/anyone/
 
We had an awkward breakup
 
whistles innocuously
 
!!ban
 
12:59 PM
@rlemon 895174 (?), 1355043 (?), 1858108 (?), 10 (?), 1005250 (?), 1941949 (?), 990192 (?), 2428683 (?), 1455016 (?), 2645256 (?), 2664200 (?), 3350338 (?), 3106345 (?), 1800668 (?), 1593459 (?), 2509223 (?), 3586251 (?), 3517363 (?), 2959554 (?), 3141603 (?), 2249815 (?), 91696 (?), 2272617 (?), 4155172 (?), 4463826 (?), 3967621 (?), 4202350 (?), 4330208 (?), 2668766 (?), 3277047 (?), 5128971 (?), 5029740 (?)
 
nope
 
MLM
Array.from(window) falls into the same trap? Thank you for pointing it out though @Zirak
 
@rlemon Remember when SO's WS server went down the other day, they haven't changed anything have they?
 
@BenFortune don't think so
!!help
 
@rlemon Information on interacting with me can be found at this page
 
1:00 PM
she still works.
only thing that did was boot her from the rooms till this morning
 
@MLM Instead of the arr.slice hack, I mean
 
!!mdn Object.setPrototypeOf
 
MLM
@Zirak ahh, cool
 
@Zirak neat neat neat. Also: want me to shift the dom and css in a shadow root?
 
1:02 PM
@AwalGarg huh, I haven't thought about that.
 
(I mean, I just wanna play with shadow stuff :D)
@Zirak well cr35+ is shadow stuff without flag so it could probably shine stuff a bit (and avoid some edge cases)
 
@AwalGarg "It could shine stuff a bit"?
 
the code part. it will look cooler.
 
You're right it's a good idea
 
If you don't have time, I will be glad to do it :)
 
1:06 PM
@Luggage I'd probably use __proto__
And not setPrototypeOf
 
@AwalGarg If you wish
 
ohh, i'm not really setting any prototypes, just testing Caprica.
 
I'll never say no to free labour
 
@Zirak make me a sandwich
 
1:07 PM
@JanDvorak You are now a sandwich
4
 
lmao
 
2.9
 
da hells "linux test project"
 
linux is a test project
 
1:10 PM
:OOO
 
user406009
Unit testing linux I guess. Seems like a worthwhile endeavour.
 
"sudo make me a sandwich" "Sudo: You are now a sandwich"
 
user406009
There's probably tons of hidden bugs in Linux.
 
They didn't need to mention bootstrap on that page. We can tell.
 
@Neil that'd actually be a great easter egg to be shipped with sudo
 
1:11 PM
@AwalGarg heh
 
more like a bootstrap test project
 
@AwalGarg That's actually a thing. Add Defaults insults to the sudo configuration, and mistype a password.
 
user406009
Eh, I would rather a default bootsrap look than a god-awful custom one.
 
i want to agree, but it's getting old, now
at least use one of the others, like foundation.
 
So if you recompile sudo you can change the insults dictionary, which is awesome.
 
1:13 PM
Hey
 
or just choose a font and add a few colors.
 
@FlorianMargaine currently getting down!
 
o/
 
Someone make me some game art :P
 
1:23 PM
do it procedurally
 
@Zirak I have it on since forever, but it never said that to me :( then again I don't often mistype my password :/
 
@rlemon I need some tower defence sprites :c
 
Didn't we already get a few wednesday links ?
like... pinned
 
1:31 PM
Morning Guys ! :)
 
now, everybody must recognize this youtube key ^^
 
How can I create a method like .find() of jQuery in javascript ? :P
 
user406009
@rlemon I wonder how long it will take them to undo their rollback and kill all of our star stuff again.
 
dunno
lost interest
same thing happened with flags
 
@ZahidSaeed querySelector
 
1:32 PM
always ruining my fun
 
@Zirak Doesn't query selector searches for dom for that specific element ?
 
Isn't that what find does?
 
context.find(selector) is basically equivalent to context.querySelector[All](selector) @ZahidSaeed
 
@rlemon @CapricaSix pls ban
 
1:52 PM
ohh shit
!!googl𝖾 Canada in recession
 
cc @KendallFrey
 
Hey guys,
I try to make MongoDB request with 2 "wheres"
My code looks like: http://pastebin.com/E7E48QVC but dispite this fact I just verified data for this case_id and calculation_id are in DB server return me just blanked array.
Any advise?
 
> On a scale of 1 to 5, which number is your favorite?
1 2 3 4 5
I don't think this question makes sense
 
3
 
1:56 PM
"on a scale" and "which <something>"??
 
I'm building a timer application where the time must be pretty accurate, the stopwatch type code I am using currently uses t = setTimeout(add, 1000); Can this be expected to be fairly accurate across devices/timers for 1 second?
 
@bobbydoogle Welcome to the JavaScript chat! Please review the room pseudo-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.
 
@bobbydoogle no
 
is there a semi accurate way to do this with javascript?
 
!!tell bobbydoogle google delta timing javascript
 
1:56 PM
Server error (status 500) occured (message probably too long)
 
well that sucks
 
@bobbydoogle define "fairly accurate". The device will try but there can be various reasons it will delay
 
google delta timing sounds better : ' )
 
var lastUpdate = Date.now();
var myInterval = setInterval(tick, 0);

function tick() {
    var now = Date.now();
    var dt = now - lastUpdate;
    lastUpdate = now;
    // check if dt >= 1000, if it is action.
}
 
however the devices will be on mobile data connections, wonder if contacting google frequently like that will work...
rlemon, okay, so that should then be fairly reliable/accurate?
 
1:58 PM
define "fairly accurate"
 
@rlemon how did I not notice that broken character <3
 
It doesn't look very kind on the battery life though
 
@KendallFrey <3
 
well within a second over an hour
 
1:59 PM
@bobbydoogle yes
@bobbydoogle that is generally how game timing works.
 
thanks ill try that
 

« first day (1784 days earlier)      last day (3165 days later) »