« first day (2283 days earlier)      last day (2664 days later) » 

12:34 AM
omg finally got rid of the powerline
😍
 
12:54 AM
that's sweet 0.o
actually, isn't the limit for the protocol 54Mbps?
oh nvm, 802.11n
 
1:06 AM
better than I expected
using a cellular network
 
in my experience, the network I'm on is already really really fast: beta.speedtest.net/result/5967880538
 
lol
 
1:20 AM
hey guys any idea what this is? whois 85.167.97.182
Organization: RIPE Network Coordination Centre (RIPE)
 
RIPE is a whois database
for europe I think
 
is it important?
 
very
 
my game is initialising a torrent each time with it
i want to block the game
too distracting
ah I found the ip address form the website
 
easy fix: stop playing games and do something productive with your life goddamit
 
1:33 AM
not so easy
games are made to be addictive
some minds morew prone to addiction than others
 
but you're super uber duper
your mind is not supposed to be like that
 
well it is
 
also lol, that IP is not RIPE
you got through that whois info through RIPE, but that's Telenor
you can block it if you really want to
but it doesn't look harmful
also, host doesn't seem to respond to most stimuli :/
yeah, it's probably harmful
cut it off
@SuperUberDuper
you're in the netherlands, right?
can you tell me your ip?
well, they do have working subdomains
it's just odd
subdomains seem to have fairly old designs and too weird text inputs for my likings
was probably hacked and used as some kind of zombie
lg.telenor.net/mod-perl/lg ← most likely escapable environment
 
im in uk
 
oh
 
1:50 AM
can selfcontrol app vlaock udp?
block
udp uses ip right
 
yup
an app can make it so the app won't send udp... sure
oh gosh that site is so broken
anyway, I better go to sleep
 
cya
thx
 
2:11 AM
Hi, I have a non-js question, so if no one wants to answer, that's fine. No need to tell me it's off-topic. But if someone has an answer, I'd appreciate it:
0
Q: Using command line find to encode files and save to same directory

Ali SamiiI am trying to execute a find bash command to process hundreds of video files that are all named video-original.mp4 but are in subdirectories of a parent directory. Here's an example of the directory structure: videos ├── 01a │   └── video-original.mp4 ├── 01b │   └── video-original.mp4 ├── 02a...

 
2:38 AM
Whats the difference of these for making array ?
var users = [];
var users = {};
 
{} isn't an array
it's an object
 
Hmm
thanks
 
var pattern = /burro/ && /frigorifero/;
(hardcoded) works
but writing this inside an input, then use the input value, is no longer working
how can I do?
I checked the typeof pattern, and is object
maybe the input value will be string?
I can't figure it out... please help
 
3:16 AM
Hmm... I'm building an app with Electron (node.js with Chromium GUI).
In my index.html if I try to do something when the window resizes, I can't use the correct new sizes unless I access them once before.
I can get the correct new width & height by logging them to the console first or by setting them as variables before using them.
This really doesn't seem like it should be happening, but am I just missing something?
 
@kaloncpu57 Are you saying that it returns the wrong size the first time you read it, and the correct size subsequent times?
 
So if I just try to use window.innerWidth and window.innerHeight right away, it's like nothing happens. I'm trying to resize a canvas to fit the window, but the canvas just stays the same size.
 
this is interesting: github.com/alm-tools/alm
 
@kaloncpu57 What is the definition of "right away"?
 
Probably meant as soon as the app loads.
 
3:20 AM
1 message moved to Trash can
@kaloncpu57 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
RIP Not used to markdown
gist: 2477f741cb308025a626efb6edbde9b8, 2017-01-15 03:22:17Z
//This works
window.addEventListener('resize', function(e){
  var w = window.innerWidth;
  var h = window.innerHeight;
  resizeCanvas(w, h);
});

//This does not work
window.addEventListener('resize', function(e){
  resizeCanvas(window.innerWidth, window.innerHeight);
});
 
That indeed does seem very bizarre
if that is true
 
I'm also using the p5 library (for drawing the canvas and such) and their built in "windowResized()" function does not work.
* The same way that adding an Event Listener myself does not work
 
@kaloncpu57 can you reproduce it in a fiddle
because that seems quite unlikely
 
I could try, and I guess if that doesn't work, it might be an issue with Electron? That seems weird, because it's just using Chromium.
 
3:28 AM
if you can reproduce it in a contained manner I will load it with electron
 
If you can make a small reproducible example in Electron I'll be happy to look at it myself
 
@KendallFrey there can be only one
 
one to many. :P
I was wondering how I can somewhat simulate the behavior of async/await with just promises.
 
As in C#-style async functions?
 
3:30 AM
Turns out it's not simple as I thought it was.
es7+ async/await.
or whenever that's coming.
 
I think in ES6 you can do something similar with generators and promises
I haven't tried
 
you can use generators and get a little more support
 
Yeah, looking at generators now. Is it just while looping until you get done: true ?
 
you can use bluebird coroutines for example
 
Everything seems to be working properly in JSFiddle
Here's the fiddle, but again, it works just fine here. lol
https://jsfiddle.net/kaloncpu57/psh9c4wg/1/
lol I just realized I'm using Firefox right now. Let me hop onto Chromium. I'm used to just using Chrome on my Windows laptop, but I'm on my Linux machine right now.
Still working just fine..
 
3:57 AM
!!> var x = NaN; console.log(x===x)
 
@FlyingGambit "undefined" Logged: false
 
@shriek with generators?
 
4:16 AM
yeah. checking co's source code.
 
4:30 AM
why lol
 
@shriek mmm, yes I think so
 
5:29 AM
cljs.user=> 3
3
cljs.user=> 3 + 4
3
cljs.user=> (+ 3 4)
7
Took me a moment
 
@copy that shouldn't even run
 
@copy ha
 
6:32 AM
function foo(a) {
  console.log( a + b );
  b= 2;
}
foo(2);
why is the answer to this referenceError ? I thought b would get hoisted as a global variable
!!> function foo(a) {console.log( a + b ); b= 2;} foo( 2 );
 
@FlyingGambit "ReferenceError: b is not defined"
 
Does Caprica use strict mode?
 
!!> function foo () { b = 2 }; foo(); b;
 
@FilipDupanović 2
 
!!> function foo () { 'strict mode'; b = 2 }; foo(); b;
 
6:37 AM
@FilipDupanović 2
 
I am not understanding why b was not hoisted
 
From what I understand, it doesn't get hoisted when the function is defined but when the function is executed. If you're looking for why that is, I have no idea. :>
 
variable gets hoisted when its declared, not for assignments. if b =2, then b would have been a global avariable
if I go line by line , console.log(a + b) // b should undefined
b = a // b becomes global and gets assigned value of a
 
6:58 AM
@Luggage Hey, buddy. Do you remember the question I asked several days ago? I may have failed to state the question accurately. Here is what I asked:
*I came across an idiom or a slang in Core Java which means someone has run out of any tricks of doing something, or someone has tried all the methods he could think of and can't figure out another way of doing something. But I can't recall that. Any native English speakers can help me out?*
Now I have found the answer. The expression I was seeking is "paint oneself into a corner".
 
If you try to overwrite a global variable this way, it still waits until the function executes.
var food = "apple";

function sayFruit() {
  console.log(food);
}

function sayVeggie() {
  food = "carrot";
  console.log(food);
}

sayFruit(); // logs "apple"
sayVeggie(); // logs "carrot"
sayFruit(); // logs "carrot"
 
@FlyingGambit You got the point. Variables get hoisted only when they are declared. If you expect b to be hoisted, you need to declare it using "var b = 2".
 
@ZhengquanBai Yeah, I realized that later
 
When you code "b = 2", you are not declaring b as a variable, but assigning the value 2 to a property named "b" on "this", the global object.
 
user6434012
7:20 AM
hey there, I am trying to create coloring game for children using html5 and javascript. does anyone has experience in creating this program?
 
@DominicCobb 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.
 
7:32 AM
hello friends: I am trying to decipher code from this answer: stackoverflow.com/a/17117613/2757916. It sets up an intermediary function which verifies arguments' types before running a condition
What I don't understand is why/how variable arguments refers to the arguments supplied when calling ds and not the arguments supplied to typedFunction
that sounds really confusing. Basically I understand typedFunction returns a function that checks parameter types. However, the function it returns declares "arguments" as a variable. in my eyes that "arguments" variable should represent the arguments passed to TypedFunction, but instead it picks up the arguments supplied to the variable ds
 
8:07 AM
@GovindRai Ultimately variables are just references to a particular piece of memory in the system, Creating a variable that points to a function is just referencing the piece of memory that has that information
In the setup of that function before the console.log(d.etc) is established the former memory must be performed which is why you can't get the answer out at the bottom if any of the error statements are meet
also typed functions just establishes a format of what is exspected through the parameters
because new date() returns a simmilar structure it can be passed and parsed by the function
 
@GovindRai "arguments" represents the arguments passed to the function in which "arguments" is used.
@GovindRai In that case, "arguments" is used in the function that is returned by calling typedFunction.
 
javascript.info/tutorial/arguments Arguments in the case of the typedFunction I think are also unnamed in this case and are accessed using the arguments keyword
 
@GovindRai The function returned from typedFunction invocation is referenced by "ds". So the arguments passed to "ds" are retrieved from "arguments" in that returned function.
 
@ZhengquanBai Am I right in saying there unnamed here?
I had to google to find out but because they were represented in the passed function call I just presumed because there present in the parameter tokens there accessible in the function as unnamed parameters
 
8:27 AM
@lix Btw, when you say "there", do you actually mean "they are"?
 
Ahh yeah I should of used they're
 
Is it your personal taste or a practice adopted by most English-speaking people?
 
Most English people, were not so articulate in explaining ourselves unless it's in like formal writing or something :D
It gets even worse the further you move north in my exspierence
the word their might as well not exist up there
 
good to know
 
So am I right in asserting there unnamed arguments?
 
8:34 AM
Yeah, "arguments" is indeed an implicit variable you can use to access the actual passed arguments. So you can say it's an unnamed variable because it exists there automatically without you explicitly creating a variable.
 
Good to know :-)
 
8:54 AM
@lix @ZhengquanBai thank you so much guys.
you guys are absolutely right. I got confused because I saw variables being used both inside and outside the scope of the returned function
However, I am reading up on closures now and all is well.
 
9:06 AM
@lix how did the demo go?
 
@FilipDupanović It went very well, the lecturer like a lot of the dev op stuff and the pressions
How have you been? :-)
 
gr8! doing well myself, thanks o/
 
            testDate.setMonth(testDate.getMonth() - 1);
why if testDate is december 31st
then this makes it 1st of december
rather than nov
forget it, normal javascript
 
\o I have two assignments due for tommorow woke up at 5am gmt
handin is 10am and 11am tommorow
What is it with the media and disrespecting millennial's, as if the baby boomer age wasn't stupid as it is..
 
10:21 AM
@misha130 what did you expect? 30th nov?
 
yes
 
you're going to have to do the checking yoursel, I'm afraid
 
i did and i think its absurd
 
tough luck
it's really not that hard btw
you need to set a max day for each month, then you Math.max the date of the month with the one of the month you want to change to
 
I worked around it but its a really simple task that I should be able to complete without work arounds
oh boy
I gotta stop crying about this
 
10:44 AM
 
Hallelujah!
 
11:42 AM
Salvation is comming!
 
12:15 PM
I bet it's some Big Lebowski fan
 
When your the 'dude' the worlds your oyster brah.
 
hey guys, is there a way to start a program on my server via javascript ?
 
@ViktorG 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.
 
@lix oysters are defined in tampopo youtu.be/k5KMplmtFmM?t=29
 
@ViktorG if the program can detect http calls, then you can use a standard xhr in javascript
 
12:27 PM
@towc I want to start R and input a file for it to process
 
1) start R program normally
2) tell the program to call a certain function if a request to, say `/api/call-R` is done
3) in that function, write the program you want to be ran
anyone know good places to buy, say, a moped (the vehicle) online?
or alternatives to a moped
 
I have a rather strange question... maybe I thinking about this wrong but I need some suggestion.
 
ask away
 
I have a compareObjects(obj1, obj2); function.
And I want it to change the values of the objects and return... both of them.
 
and what's the issue?
 
12:36 PM
how would I go about doing that? I'm thinking of merging those two objects into one...
 
that way you only have 1 object
the objects are not going to be identical, as they are references
 
@towc electric bikes are nice and you can take them on a bus
 
if that's what you want
@FilipDupanović do you have a preferred place for buying them?
lol, I could buy a segway
this doesn't look too bad: amazon.com/dp/B00J4TX59Q/…
it's still a month's rent though
more
 
@towc if I call compareObjects(obj1, obj2); and that function doesn't return a value but it mutates the objects passed to it. Does it mutate the objects outside of the scope?
 
yup
 
12:40 PM
So say my function call is compareObjects(obj1, obj2); will obj1 and obj2 change if I do stuff to them inside the function scope, and not return anything at all?
 
unless you clone the objects in a separate variable and mutate those
they will
you have enough knowledge to test that
 
yes
 
@towc dunno, I'd probably buy a used one and ask around for someone who's experienced to help me find something locally
 
!!> var a = {}; function b(){ a.c = 'd' }; b(); a
 
@towc {"c":"d"}
 
12:42 PM
@FilipDupanović fair enough
 
How can you iteratively access all the layers of an object? Can you treat it like an array and do object[0][1]?
 
no, but you can do for..in and check if the property is an object, then you repeat
fun fact: not-too-bad used cars cost less than new-ish bikes
 
@towc and do a for in inside a for in?
 
yeah
it's called recursion
you have an outside function that contains the for...in, then you call that function again within the for..in on a new object you may encounter
I'm kinda tempted: used cars for 1€
 
yeah lol, there's so many cars being traded
 
12:48 PM
they probably put the number wrong
I also don't know how to drive (yet), and am way too young for a license in most european countries, so that may be a problem
oh wait, I can get a driving license in this country in a month. Sweet
 
@towc but what if the object looks like this obj = { person : {id:1,name:"will"} } - doing what you said starts to iterate through the string "p e r s o n"
 
I really hate psychological biases
 
@Thaenor no
 
especially the one where you connect yourself to anything your read :(
 
if you want me to write a script for you, I'd appreciate a small payment
 
12:50 PM
@towc but I just tested that out and that's what it did
 
@Thaenor because you did it wrong
 
@towc is best, I recommend him, I mean I really recommend him!
 
@Abhishrek what were you reading now?
 
I have used his services 3x
@towc About Psychopaths and Sociopaths
now I'm scared :'/
 
is that european country german?
 
12:51 PM
@jacobian 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.
 
@towc I did exactly what you said
 
@Abhishrek and you never even told me ;)
@Thaenor show me the script
 
@towc -_- I was trying to help you :P
 
@jacobian no
 
the code is a bit messy...
 
12:52 PM
ich bin lernen deutsche
 
yh, thanks :)
 
Well if you are interested in a frontend Job at @Auth0 I'll recommend you :P [quite honestly]
 
@Abhishrek what's the place like?
 
I and @SomeGuy work here
and we have a lot of very young frontend engineers (for some weird reason)
 
Like I just said, the code is a bit messy because I'm trying multiple things out - codepen.io/Thaenor/pen/LxZryx?editors=0011
 
12:53 PM
I Like it :) Learnt a helluva lot :P
 
googling it :)
@Abhishrek we're cheap :P
 
LeL
not really
depends on country
 
lol, being an evangelist is an actual job
 
@towc well, yeah, because if you don't tell people to use your stuff... they actually won't use your stuff
 
what a messed up world we live in
anyway, that seems to be the only job that I can actually do for the company
except the page is broken and I can't scroll down to see the salary/requirements
luckily I know how to inspect things
really need to work on this:
> Preferably have strong knowledge of Java or .Net, with ability to understand other languages such as JavaScript, PHP, Python, Ruby, Go, etc.
oh, @Abhishrek, have you see my list?
 

« first day (2283 days earlier)      last day (2664 days later) »