« first day (2182 days earlier)      last day (2991 days later) » 

01:15
@rlemon D:
 
1 hour later…
02:33
Quick unscientific poll: If you had to choose colours to match the sounds of low pitch, high pitch, and white noise, what would those colours be?
They seem obvious to me but I'm not sure that I don't have some kind of bias or synesthesia
It was a virus, mom!
> I was getting off my chair so it wouldn't see me.
Oh my fucking god.
I'd choose grey for white noise
interesting, thanks
I was definitely for red low-pitched sounds
I've been doing that for my light strip animations, but I realized I didn't know of a compelling reason for it
Other than long wavelength sound == long wavelength light, etc.
audio hardware is weird
unplugging my headset from computer A adjusts the volume on computer B
the two are only connected via line out/in
 
2 hours later…
04:23
@Baldráni Sorry, I think you can return anything from PHP and ignore it from JavaScript, no? Don't you have control over what happens to the returned value?
 
2 hours later…
05:54
0
Q: Mongoose Long input not working, using it with insertmany

Gandalf the WhiteI have JSON data in this format which I am fetching from a remote link and then I am trying to save them in mongodb from my node.js server. [ { "x": 1462125381603, "y": 67 }, { "x": 1462126382603, "y": 69 }, { "x": 1462127383603, "y": 70 ...

06:13
Anyone using cordova?
Hope all are doing fine. Can anybody help me on stackoverflow.com/questions/39867892/…
06:49
Hi all , I have a small question, I am following the angular JS tutotial on docs.angularjs.org/tutorial. Using which I am trying to setup my environment. After doing a npm install, I noticed that it has downloaded bower. As far as I understand we don't need both , as both can handle the packaging independently. so why was the bower package downloaded ?
Mongoose Long issue
anyone?!
0
Q: Mongoose Long input not working, using it with insertmany

Gandalf the WhiteI have JSON data in this format which I am fetching from a remote link and then I am trying to save them in mongodb from my node.js server. [ { "x": 1462125381603, "y": 67 }, { "x": 1462126382603, "y": 69 }, { "x": 1462127383603, "y": 70 ...

user6438653
Hio
07:08
how can I view a sourcemap?
for debugging
user6438653
dunno
user6438653
sorry
user6438653
@GandalftheWhite I know node, but i dunno about mongoose, sorry.
user6438653
bye
07:17
@Sheepy No worries, I've just did it an other way. Less accurate but still working.
07:33
Hi, how can I use a npm package in a meteor project (client-side)?
For example I have installed meteor npm install --save material-timepicker but when I try to use this package with const timepicker = new TimePicker(); it says TimePicker is not defined
did you require it?
or whatever the meteor equivalent is?
@phenomnomnominal No, how can I require it? I'm sorry I'm really new to npm.
I don't know meteor
but in general with JS, you have to call require to use a module
either that or an import statement if you're using modern JS syntax
wonderful :)
user3119231
08:04
A general question. I told my friend that javascript isn't (normally) used for brute force attacks. I'm right, or?
define "normally"
user3119231
It's slow af. People with knowledge would prefer other ways
I know for a fact my parents don't use javascript for brute force attacks for example
I thought the latest trend in brute force was using GPUs with lots of parallell processing power for which JS isn't a very good fit
@Maurize I've done javascript site copier that open multiples Ajax and grab things in parallel, so it's doable. This year I redo it with Java, but speed is similar given the same number of thread. Network and the target website's respond speed is the bottleneck, not JS.
@Maurize But if you want to brute force password hash, yeah, don't use js.
08:21
@Loktar it was just a tasteless joke.. >.>
@Mosho i still don't understand it lol
0
Q: Mongoose Long input not working, using it with insertmany

Gandalf the WhiteI have JSON data in this format which I am fetching from a remote link and then I am trying to save them in mongodb from my node.js server. [ { "x": 1462125381603, "y": 67 }, { "x": 1462126382603, "y": 69 }, { "x": 1462127383603, "y": 70 ...

@GandalftheWhite x : {long: SchemaTypes.Long}, that doesn't look right
var schemaname = new Schema({
    x : SchemaTypes.Long,
    y : Number
});
hi all, I am having a little trouble adding promises to my node server script. I need two asynch functions i believe, but i am unsure on how to actually add a promise
@BenFortune I am using mongoose-long plugin, it is mentioned in the question
it works properly if I am fetching mongolong datatype from mongodb via mongoose
08:36
yeah, that is the example i followed previously to try to get my promise working, but i think I am messing the brackets up or something, therefore I have receiving a silly error somewhere along the line
@DaveDavidson what's the error?
parsing error: unexpected token
the exact strack trace is:
SyntaxError: Unexpected token (
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:148:18)
at node.js:405:3
@DaveDavidson copy and paste your code in here
although you just have a superfluous bracket, jslint will give you super clear error messages that may help you understand
okay i will do thanks
08:41
the name of my script is server-copy-new-promise.js
what if your file is an instance of a node
> at node.js:405:3
above this syntax error should be something like
however, i already have lint built into my ide (atom) therefore it's not really giving me that much more info than my ide similar to jslint
path/to/file.js:25
theError(
node.js is not an "instance of node"
08:42
that will give you an indication of the line number and ~where~ the error is
it's a JS file called node.js
I mean, it exists somewhere
but yeah, go back in the stack
@DaveDavidson look at the few lines just above this, it should look something like this, there it gives you the line number and the place in the line where the error is, indicated by the up arrow
user6438653
08:57
Hey guys
user6438653
Why does .className = ""; do this: <div class>?
user6438653
Why doesn't it just remove class?
user6438653
Guys?
user6438653
Also:
@shad0wk because you're setting the attribute's value to an empty string, and chrome just formats attributes like that
user6438653
09:00
Ohh okay.
user6438653
With node.js, which is better?
user6438653
WebSocket or Socket.io?
if you want to remove the attribute, then
!!mdn element.removeAttribute
@bitten Something went on fire; status 403
Depends, do you want fallbacks for browsers that don't support websockets?
09:01
@CapricaSix dood
user6438653
@BenFortune no. So soket.io it is.
user6438653
@shad0wk Something went on fire; status 403
@shad0wk Use ws
user6438653
404, yeah ws is what i was using.
09:03
@shad0wk thanks
Socket.io also has some other nice features, such as rooms and volatile emitting
user6438653
@bitten All good. :)
user6438653
@BenFortune Ahh okay.
user6438653
Okay, nevermind.
user6438653
09:07
I have socket.on(...) but it's not working.
user6438653
Client:
user6438653
main.server.socket = io();
main.server.socket.emit("get_player_info", { nick: String(pNick).trim(), skin: Math.floor(pSkin) });
user6438653
Server:
user6438653
  socket.on("get_player_info", function(info) {
    if (!gotInfo) {
      socket.emit("player_info", { x: 0, y: 5, d: 0 });
      player = addPlayer(info.name, info.skin);
      gotInfo = true;
    }
  });
user6438653
Also:
user6438653
09:11
var pNick = "Test";
user6438653
var pSkin = 0;
user6438653
var pSkin = 0;
user6438653
But the server output is { nick: '', skin: 0 }
user6438653
Guys?
user6438653
!! help
09:13
@shad0wk Information on interacting with me can be found at this page
user6438653
!!user BenFortune
@shad0wk That didn't make much sense. Use the !!/help command to learn more.
user6438653
@BenFortune? @bitten?
@shad0wk just before this, console log out the values you are sending in
@shad0wk i advise you not to ping people, it's rude ^^
user6438653
I know sorry.
user6438653
09:17
ohh okay, "" socket is working.
user6438653
Okay this aint working:
user6438653
playBox.value
user6438653
var playBox = document.querySelector("#p");
post some memes, then you're more likely to get help
@shad0wk what's "not working"?
user6438653
document.querySelector("#p").value
user6438653
09:24
#p is an input box
user6438653
Okay, nevermind, it's a bit late, sorry.
@shad0wk it's too vague, there are a lot of factors here
@shad0wk heh it's alright.. just take a rest and don't let it stress you out
user6438653
Sorry for being retarded.
move on if you have to
09:39
posted on October 06, 2016

Sometimes I read a paragraph that makes me wish I had written it. Last Monday that happened again: I became profoundly jealous when I read this: We know libraries, in fact, we have the best libraries. Our libraries are huuuge It’s the best part of a hilarious dialogue (that I also wish I’d written) between a newbie web developer who needs a simple REST/Ajax site and an “

user6438653
user6438653
What if there are multiple clients with the same name?
user6438653
I have a problem
user6438653
  connect: function() {
    main.server.socket = io();

    main.server.socket.on('connect', function () {
      main.server.socket.emit("get_player_info", { nick: nickBox.value, skin: 0 }, function(info) {
        return [info.x, info.y, info.d];
      });
    });

    return [0, 0, 0];
  },
user6438653
^^ Client side
user6438653
09:52
io.on("connection", function(socket) {
  socket.on("get_player_info", function(info, returnFn) {
    var pos = { x: Math.round(Math.random() * 80000 - 40000), y: Math.round(Math.random() * 80000 - 40000), d: Math.random() * Math.PI };

    returnFn(pos);

    addPlayer(info.name, info.skin, pos);

    console.log(pos);
  });
});
user6438653
^^ Server side.
user6438653
But the connect function is returning [0, 0, 0];
user6438653
not pos
@shad0wk that's because you've written return [0, 0, 0];
user6438653
Yeah?
09:54
i think you're a bit caught up in async functions
user6438653
Ohh okay, I though io.on was async.
user6438653
How can i wait for it?
@shad0wk it is
user6438653
@bitten dangit
user6438653
Okay, how do i make it not async?
09:57
this function(info) { return [info .. ] } is your callback function, what runs when you have the data. you cannot return from it into a variable since it's async
user6438653
ohh, right.
@shad0wk ah, i really do not have the time to explain
i'm so sorry
user6438653
it's fine.
user6438653
I get it.
@shad0wk look up callbacks in javascript
user6438653
10:00
okay.
refer to this question
read the answers, especially the second and and the one with the comic
that's a classic question isn't it
how to make an async call not async O_o
yep
i don't know shadow's level so it could be 5 minutes or 50 minutes of research too
hard to know where to start
user6438653
Okay, understood.
user6438653
I can't always use prototypes.
user6438653
10:15
Yay! got it working.
user6438653
Thanks @bitten.
user6438653
bye guys
11:03
hey guys does anybody has experience with phonegap + js?
11:17
@rlemon cute
and did you see this @rlemon?
TIL NASA uses Angular
11:57
NASA uses node
-3
Q: Is plain JavaScript faster than all of it's frameworks?

Dawid ZbińskiI cannot find the answer anywhere and I'm just wondering... I saw a lot of statistics about the speed of JavaScript frameworks like Vanilla, Angular 1/2, Coffee, etc. If I understand it right, every JavaScript Framework is created from plain JavaScript to make coding for developers faster, easi...

nuke it
I do understand that OP's intention tho. Frameworks and libs seem outdated with all the latest development of ECMA and HTML specs. Look what we have right now, some good points can be made about why we don't need any 3rd party "script" anymoaaarr
12:12
so late, wee are all accustomed to used jquery & co...
and es6 is not implemented everywhere
And.. no i dont want to write "document.body.querySelectorAll" when i can write $("")
@cedric.salaun $ = document.body.querySelectorAll
yes but there is some issue
for ex. when that match only one things, i think $ will return an array but i want just an object
Then write a 4 line wrapper
:P
or know when you're accessing a collection vs a single element and act accordingly.
this is just 'one' exemple
12:19
to eliminate jQuery today in a single person project is almost no work.
dont like re-write the things actualy exist
And I'm sure the 'other' examples are similar issues of minor discomfort which you can address individually
@cedric.salaun i didn't know
var $$ = e => document.querySelectorAll(e); var $ = e => document.querySelector(e);
@cedric.salaun Why? When those things are trivial and beneficial?
i'm never sur to cover all this 'little' things
12:20
Then over 'time' you will
function $(selector, context) {
  context = context || document.body;
  const found = context.querySelectorAll(selector);
  return found.length > 1 ? found : found[0];
}
@bitten :D
but why does the 'selector function' need to return both?
@rlemon ah nice touch with the context :p
it doesn't
there is probably one lib on the internet that do what you write... so.. :/
a jQuery 'lite'
So you should give up on programming and just whatever
12:22
copy-pasta programming is the best zirak
no work, all the monies.
re-write things that actualy exist, this is just idiot
sigh
it's too early for this
@rlemon you could also shortcut your 3rd line to const found = (context||document.body).querySelectorAll(selector);
now it's only 2 lines!
local variables are insanely cheap (or free) and add more readability and overall niceness
use them
love them
cuddle them at night
12:29
@Zirak whats up with you and ants?
The ants hate him.
i agree but we need our jquery replacement to be as small as possible
Only the ants?
@Zirak is just so sweet. the ants can't get enough
@bitten your readable version isn't that
@bitten write your own
12:30
minification will take care of everything else.
@littlepootis it's been done already
@rlemon oh i thought we were going for 'ready to ship'
then i retract
who are you? towc?
haha
12:31
If Zirak is sweet then why is he shouting over ants. I am not convinced. This is all very mysterious and convoluted.
i'm not sure what to make of that
poor ants
Doesn't jQuery allow you to build your own "lite" version?
yeah
there are very few things in JQuery that I would even consider using... and those numbers are dropping.
12:33
but tree shaking should do that anyway
.animate used to be my only real reason, but css animations and GSAP are much better
@cedric.salaun This is something that, sad enough, isn't so common knowledge, but programming (like everything else) isn't about black/white rules. It's never "do this" or "do that", you never go and do the same things every time. It's about trade-offs, about one thing being better at the expense of something else being worse
Sometimes rewriting is better
ajax isn't useful since xhr2 and things like fetch
gsap reminds me of the small time i was playing with actionscript, it's really nice
the dom methods are sloppy
if I was tossed into a team and we used jQuery for consistency -- no (little) complaints.
12:35
@bitten u w0t m8
@AwalGarg Fuck ants in the fucking anthole
better that than uncles in the unclehole
So... I am implementing closures in my programming language. Tell you what, I thought it'd be easy since first-class functions were easy. But closures are a fucking bitch to implement. I don't understand what to do, let alone how to do it. Everytime a function expression is found inside a function body, I know I have to do something. Probably something with the stack frame. "something". I just don't know what. And what to do at call site to handle it. Help me think
err. link?
@KendallFrey m8888, u avin a giggle or u wona go?
12:38
@Zirak yep, but i'm too humble to think i can re-write jQuery on my own with all the benefit (compatibilty of numbres of nav). so, when i write a webiste, i use jQuery. in absolute, i agree with u.
The current state is that the "closure" actually runs in the scope of the caller because it basically just gets the function "value" and ... runs it. I have lost my brain.
@AwalGarg My guess is you'll want to put all variables that are closed over into an object on the heap, rather than leaving them on the stack.
That's how all the languages I know of do it.
@KendallFrey but how do I preserve the "live bindings"? I mean, if the closure mutates a closed-over-variable, what happens?
The bonus there is that both the outer function and inner function have a reference to the object, and once the outer function finishes and the inner function goes out of scope, the object can be GCed normally
cc @BenjaminGruenbaum @Zirak @FlorianMargaine ^ please read the above few messages thanks
12:40
@AwalGarg it sets a property of the closure object, instead of changing a local variable
@KendallFrey no the outer function finishing does not mean the inner function goes out of scope, since the inner function could have been leaked by means of scope or by returning it.
Is your language going to be precompiled, or interpreted?
@KendallFrey interpreted
@KendallFrey uhh, I didn't think of this. Are you sure this actually works fine?
@AwalGarg The word "and" in that case means "only true if both are true"
@AwalGarg That's basically how C# does it, and I imagine a number of other languages
You just need to replace all references to a local variable (in both the outer and inner function) with a reference to the object's property.
hmm....
12:45
@KendallFrey imgur.com/a/0wkfR lol
that was me like a month in
thankfully not years in :D
well tbf they are a relatively recent addition
But so nice
before that I was using MJ for landings
I barely remember having to steer on the way down
my first landing attempt I didn't think about surface velocity
was just watching my alt. then noticed the ground moving by REALLY fast
that didn't end well.
I once upon a time wrote a kOS script for landing
It's surprisingly hard
I may reuse or write a new one, if I get back to my RemoteTech save
remoteTech + RSS defeated me
Kind of bugs me that RemoteTech disables the advanced SAS modes without a connection
12:51
I ended up shelfing that save and removign RSS
fn foo() {
  let x = 2;
  fn mutate() { x = 1; }
  fn use() { x } // auto return
  (mutate, use) // returning a tuple of functions
}

@KendallFrey In this example, when mutate and use are called from outside, and the implementation is done in the way you described, wouldn't the `use` function not return the updated value since `mutate` only mutated x on it's own closed environment?
I got as far as mars. had a ship half assembled -- was gonna send a rover
@AwalGarg No, the closure object is shared between the parent function and all child functions
but I was also playing science, and ran out of science to do and didn't have engines powerful enough to get anywher eelse.
so I need to get fancy with my ship design
The problem with RSS is that KSP stock parts are nerfed from IRL
RO has some more realistic parts
12:53
yea, I just got overwhelmed with RO
there are too many parts
that's a bit... hard to do in rust
@rlemon Me too, I had to start in career mode so I was gradually introduced to new parts
I never got past LEO
It's a lot of work
@AwalGarg you are not awal
ohh I tried career first. but I can't fly planes in KSP and ran out of money
got into orbit tho
You made planes in RO?
or RSS
12:56
no, I've not done RO
installed in once a long time ago
I'm just talking remotetech + rss
I have a couple of solid STS-style shuttles
They're nice
the best plane I've made could actually fly well, but I couldn't land it
and it didn't go fast.
and stalled if I went too high
I overdesigned the big one to the point where it can lift a Big Orange™ to LKO
@littlepootis Who is "Awal", really? Just a name on the internet? Does "Awal" actually mean anything beyond that?
My cat's breath smells like catfood.
12:58
@littlepootis sharing accounts again?
Am I the only one completely lost in this Kerbal space program talk?
@rlemon Yeah it's really hard to break through about 1700m/s to orbital speed
@KendallFrey well back to remote tech + outer planets, I'm going to try to design a shuttle finally.
@rlemon no, it's a joke
I made a mk2 shuttle once, NEVER got the hang of launching it
12:59
@AwalGarg idk. maybe. no.

« first day (2182 days earlier)      last day (2991 days later) »