« first day (2501 days earlier)      last day (2439 days later) » 

12:11 AM
i feel like this should be true.
function a() {
	var b = function b() {
		return this;
	}
	return b();
}

console.log(this == a()) // true or false?
i'm getting true in chrome console, but false in Node.. ?
 
12:36 AM
what's this in the console.log referred to?
 
log typeof this in chrome and node
 
'object' in chrome
'object' in node
 
@AlexBollbach I get true in the Node REPL
 
yeah i get true in the repl too
but not with node testThis.js
 
I tested that too
 
12:41 AM
i copy that same code into the file and exec it with node and get false, odd
 
Apparently in that context this in the global scope doesn't refer to the global object
Which explains why it says false
But I don't know why this is what it is
 
i've always read that this in node refers to the node global like browser refers to window
 
That's clearly not the case
 
i need explanation
quite hard
:\
 
I think it has something to do with being in a module context instead of a normal context
this is set to module.exports instead of global
 
12:46 AM
what's this bounded to after b()?
 
There's no difference before or after
But this apparently refers to the global object within functions
 
so this bound to nothing?
 
i don't know. i just started learning about this and how its starkly different from self in other languages. my assumption was that when I invoke b, it "captures" the value of this and returns it and when i log out a() it will tell me what this was in b
my initial thinking was that this in b would be different from this in a, since this is assigned a value based on who is invoking the function. then again, a is invoking b, and was invoked globally, so b's this should equal a's this, which should equal the global.
 
oh, so the case that someObj.b(), this will bounded to someObj, all other cases bound to a global obj?
 
So you get this: const isInGlobalScope = this === module.exports; // kek
@AlexBollbach In JS, the value of this comes from foo in foo.bar(), and if it's just bar() then it falls back to he global object.
 
12:50 AM
that i know
 
However, you can override it permanently with bind
 
and apply/call
 
No, that just applies it for one call
just like foo.bar()
 
its no permanent
 
@AlexBollbach That's all correct, so if you did console.log(global === a()) it should say true
 
12:53 AM
yeah, == bares true as well
basically, the moral of my snippet is global !== this, in that context?
 
In the node module context, yes
 
console.log(b()) print a big obj... why?
 
educational devolution
 
That's the global object, it contains all the objects and functions available to your code
 
i thought b wasn't the global?
at least in the script
 
12:58 AM
It is
It's this that isn't
 
oh, but is a is invoked in the module's context?
 
but if i run console.log(this) before function a(){...} it print {}
 
meaning this in a == module.exports (or module, or w/e you found)
 
@AlexBollbach No, that's backwards. this is module.exports in the global scope, and global in functions.
 
so
function a() {
	console.log(global === this)
}
a()
console.log(global === this)
is true, false
got it
but this is false
module.exports = function a() {
	console.log(global === this)
}
module.exports()
 
1:04 AM
Thank you @KendallFrey
it's exactly what you said
console.log(`${this}`); // [object Object]

function a() {
    (function() {
        console.log(`${this}`);
    })();
}

a(); // [object global]
 
@AlexBollbach Yes, because the function has a this context (and it's nothing to do with module.exports in that example)
console.log(`${this}`); // What the shit, Lana?
 
originally i added some text ahead...
sorry
 
now im lost lol
 
panic not, here is my confusing example:
var that = this, thatThat, thatThatThat;

console.log(`this before ${this}`);

function a() {
    (function() {
        thatThat = this;
        console.log(`thie inside b ${this}`);
    })();
    thatThatThat = this;
    console.log(`this inside a ${this}`);
}

a();
console.log(`that == thatThat: ${that == thatThat}`);
console.log(`that == thatThatThat: ${that == thatThatThat}`);
console.log(`thatThat == thatThatThat: ${thatThat == thatThatThat}`);
false false true
 
can i assume ${a} is equivalent to console.log(""+ a) for the purposes of that code?
 
1:20 AM
For all intents and purposes, yes. Well, for this intent and purpose, anyway.
 
haha
the "this" is implicit in the phrase
 
1:32 AM
f.bind(context) is only applied at the moment the f actually be executed?
var outsideThis = this,
    insideThis,
    insideThat;

(function() {
    (function() {
        insideThis = this;
    }).bind(outsideThis);

    (function() {
        insideThat = this;
    }).bind(outsideThis)();
})();

console.log(outsideThis == insideThis); // false
console.log(outsideThis == insideThat); // true
 
good morning lovelies
 
morn
 
happy monday
 
@Niing interesting, yes looks like only in the second inner iife did the assignment even take place, not sure if it has to do with bind.
 
it's really annoying that youtube keep showing the same advertising to me.
 
1:40 AM
whats a youtube ad?
 
fu*ing tree house
 
@Niing I don't think insideThis is ever assigned there
 
Oops, bad example :P
 
1:58 AM
does anyone use vs code to do js development?
 
@Niing i agree, because the bound method isn't ever called.
or @KendallFrey i agree lol
 
it's ok, i like the sound
 
@Niing
 
Hi guys
I need further understanding this answer
6
A: How to add two numbers in Javascript "without using `+` or `-` operators"?

MicrosmsmWe will use bitwise operators and using recursion You use this method when you have few low resources, read more when to use this method! var getSum = function(a, b) { if (b == 0) { return a; } else { return getSum(a ^ b, (a & b) << 1) } };

 
2:16 AM
lol, so you need further understanding of ... your own answer?
 
it's a rewrite in js from another language I didn't develop it on my own
 
ok, let me try~
 
@rlemon yeah I love this guy actually
one of the reason I got the printer lol. The hairy lion is great
 
2:31 AM
If i understand it right: getSum(resultWithoutCarries, theCarries) @Microsmsm
since with a ^ b you will get the resultWithoutCarries, and a&b the theCarries
but you need the shift theCarries 1 bit left
when the theCarries is 0, means there is no more carries, so return a
every round a ^ b: a is the current value, b is theCarries, which has been shifted
i.e.
  110
 +111
-----
a  : 001
b' : 110
b  :1100

  1100
 + 001
------
a:1101
b:0000 // no more carries

return a
 
@BenjaminGruenbaum absolutely agree
 
:\ hope this help
i upvoted it btw
i'm sorry if it's too brain fuck
 
I didn't understand your example very well is it a hard implementaion or I am stupid?
 
@Microsmsm the recursion overhead will trump whatever speed gains you achieve using bitwise operators. Also, javascript runtimes are optimised for arithmetic, so this probably is unnecessary
And it only works for integers
 
2:47 AM
When you add two numbers, normally, we add them digit by digit.@Microsmsm
But for computer it's not
resultWithoutCarries and theCarries will be added finally at once.
so you shift b' 1 bit left, and add a and b like a boss
 
3:03 AM
Man, aside from the wind, which i think I solved, the go pro makes a dope motovideo
 
Not to be confused with Montevideo
 
im already confused
 
A K
3:26 AM
need a bit of guidance with mobx
so with redux, i normally connect my components with the store in order to pass my props directly
what's the equivalence with mobx called?
 
4:01 AM
has anyone built projects in sublime text 3 and webpack, and managed to have cmd+s trigger a app reload and also save all files in the project?
i guess option+cmd+s is fine..
 
trigger a app reload?
you meant hot reload?
 
 
i'm not sure precisely what "hot reload" really means. but if its re-fetch the current URL on save than yes. only caveat being I want my entire project to be saved instead of the currently editing file.
turns out option-cmd-s in sublime text will save all currently opened files
i figured it'd have to be a webpack-dev-server thing but this works fine
 
4:17 AM
Hey everyone :) Is anyone here good at machine learning?
or data science?
 
i know what a support vector machine is
not really :(
 
lol thanks anyway guys
 
4:40 AM
machine learning
 
@Niing 😬 that's no joke man
my mother in law had kittens that did that
we'd have to kick the car, honk the horn, etc
one day we did that, even backed up a tiny bit slammed the brakes
thought they were all out....
one fell out a little bit down the driveway with a crushed head
so sad
 
...
 
lol sorry the pic just reminded me of that shitty time
 
oh no
 
happened like 5 or so years ago, my wife was actually driving
and OF COURSE that was my mother in laws fav kitten lol
 
4:46 AM
why did you say that :'(
 
Butterscotch.. rip
 
:( i'm so sorry
 
haha sorry guys, just a random story for Sunday night/ Monday morning
lmao it's alright @Niing the pic just triggered that memory for obvious reasons haha
in reality a good pet owner shouldn't let kittens run around like that (In our situation)
 
I feel wrecked today
Stayed up all night
14h of awake ahead of me
 
@KamilSolecki damn, I'm about to head to bed here, almost 1am
 
4:48 AM
it's monday afternoon and that was awful lo;l
 
ouch that sucks man
 
@Loktar good for ya. Ive been working a little on my fun side project
 
 
1 hour later…
6:10 AM
GOOD MORning! have you prayed to your lord and savior, webpack, today?
 
there's only one true god
which one, I haven't decided, but it's one of vue, debian and lambda
 
If I use socket.io in a chat application and mongodb to store the data, how can redis help here? only in terms of pub/sub not for storing data
 
Why do you think you need redis?
 
6:36 AM
@CatBoss I don't think. I was just curious if I can use pub/sub here for things like user notifications and stuff
 
6:54 AM
@marukobotto You don't want redis
You want something like RabbitMQ or any other Stomp implementation
 
@MadaraUchiha why not?
 
@marukobotto Because you don't hammer a nail to the wall with a screwdriver
It might be technically possible, but you'd probably be doing it wrong.
 
morning
 
7:10 AM
@MadaraUchiha well no experience with redis on a large scale, so didn't get it. But nice humour
 
While you can implement your own solution with RabbitMQ or similar, I think it's perfectly valid to reach for a tool like github.com/socketio/socket.io-redis
 
user1731387
7:27 AM
hi all good morning
 
user1731387
error create-react-native-app@1.0.0: The engine "node" is incompatible with this module. Expected version ">=6".
error Found incompatible module
 
user1731387
any have idea about this issue
 
user1731387
i'm using yarn
 
user1731387
yarn version 0.27.5 to create react native app
 
user1731387
afiter installed yarn i have give command yarn add create-react-native-app
to create app
 
user1731387
7:30 AM
but it saying like this above error
 
user1731387
please help me to find out this
 
Install NodeJS 6 or higher
 
@OliverSalzburg hmm socket-io-redis. Interesting
 
Is anyone else having trouble with npm?
 
7:45 AM
Working here
Oh wait, it's cached
Nope, working
 
@MadaraUchiha Had some issues with private packages last week. 406 errors
 
@OliverSalzburg Having it now with @types/node
Coworker can't reproduce
 
npm support told me it was just me
It was temporary though. But I'm running an npm i right now and it's taking longer than expected
 
@OliverSalzburg if its just you, then find another job
 
Task at hand - generate reports in pdf + xlx format with charts, maps and text data in table format

Plan of action

Fetch data and do the transformation work. Use either jade or ejs for templating and feeding values to the html file using the same. To generate charts there are node.js libraries which will help to get images as output and maps part is still not complete.

And then convert that html file to either pdf or xlx.
Sounds okay?
 
7:50 AM
@MadaraUchiha status.npmjs.org There a small peak right now
 
@GandalftheWhite Sounds good
 
Wtf is xlx?
 
The yarn registry is also affected
 
You'll need a headless browser or phantomjs to render those charts though
Oh, you're generating them as images, nvm
 
8:03 AM
@OliverSalzburg A computer restart seems to have solved it
It's still significantly slower than normal, even with yarn.
 
What the fuck, why is my node version 0.12.7
Literally never installed that on this pc before
 
Hmm, maybe a spoke too soon?
 
@MadaraUchiha I'm currently only seeing slowness myself, no hard failures
It's tough to decide when it's slow and when it's just npm being npm
 
Just reinstalled it
node -v
v0.12.7
WHY
 
which node then take it from there
But I feel like we've had this talk once already :P
 
8:07 AM
/e/WampDeveloper/Tools/NodeJS/node
what the fuck is that
 
lol
Gotta love Windows.
 
That has nothing to do with Windows
 
@OliverSalzburg No, because you'd install Wamp on anything but?
 
@MadaraUchiha I don't see how the installation of a software package and thus fucking up your PATH is the fault of the OS
 
It's not in my PATH god damn it
fucking windows
 
8:09 AM
lol I just got a segfault in Yarn :D
 
morning
 
> WampDeveloper Pro is the best (and fastest) way to create and run multiple websites on Windows, using Apache + PHP + MySQL + phpMyAdmin.
Best and fastest. Holy shit
 
@OliverSalzburg Marketing bullshit, but it actually works quite well
 
Wamp is shit, everything descendent from it is shit
 
8:11 AM
"best"
@OliverSalzburg sauce?
 
Handles all my SSL and vhosts
 
The only good thing about it is that it's up and running in 10 seconds
@BenFortune You mean like nginx, but worse?
 
10 seconds holy shit
3 max
no more
or i wont use it
 
@MadaraUchiha Yeah, but all our sites use apache :(
 
8:12 AM
[ctrl]+[f] "best" (0 matches)
 
@Wietlol Work your way through devside.net/server/webdeveloper
 
1 min ago, by Madara Uchiha
@BenFortune You mean like nginx, but worse?
 
htaccess :(
 
That actually kinda works somewhat
Meaning it supports a fraction of the stuff I'm throwing at it. Doesn't do so well with conditions :P
 
@BenFortune Generating images for both maps and images
 
8:35 AM
I have a function that, whenever I step into it, it crashes the Node debugger. Fun
And I keep running into it :P
 
8:47 AM
cc @BenjaminGruenbaum sounds like your forte ^
 
@OliverSalzburg run "npm uninstall"
it wont crash your debugger any more
 
o/
 
"Hey! It compiles! Ship it!"
 
9:03 AM
@Wietlol That is not a valid command
 
@MadaraUchiha Its missing: Syntactic sugar causes cancer of the semicolon
:D
 
9:15 AM
should I flag answers that use jQuery if there's no javascript/jquery tag or nah?
 
morning allo/
 
@Nick Answers that use jQuery to a non-JavaScript question are kinda weird. In general though, if they solve the problem, I don't see why they should be flagged
 
@KamilSolecki you mean that its bad to use a semicolon or that it is bad to not use a semicolon?
 
Most people don't understand how to properly tag anyway
 
that's why I'm not sure whether I should flag it or not. It might be useful for some people that find the question in google
but it's not an answer on the question
 
9:17 AM
Which is due to "most people" being users unfamiliar with the platform ;D
 
@KamilSolecki I don't see what you mean
 
@Nick Share the link please
 
32
Q: Can I style an image's ALT text with CSS?

MawgI have a dark blue page and when the image is loading (or missing) the ALT text is black and difficult to read (in FF). Could I style it (with CSS) to be white?

 
function foo() {;;;
;;let i = 0;;;;;;;;
;;return () => i++;
};;;;;;;;;;;;;;;;;;
Look at how beautiful this is
 
@MadaraUchiha Oh, you haven't heard that joke / saying?
 
9:19 AM
@Nick Your comment on the answer is needlessly aggressive
 
It's not wrong though
 
And I don't think it should be flagged. Downvoted maybe if you feel like it
@Nick Regardless, the author will just respond being defensive and you won't get anywhere productive
 
I won't get anywhere and my comment won't make him delete the answer, which is fine. but I hope that in the future he'll look at the tags before answering, that's why I commented
 
> I am downvoting this answer because the OP specifically asked for a CSS-based approach and this isn't one.
 
Does vue.js require any server-side rendering?
 
9:21 AM
Something like that would be better IMHO
 
I'm making a app that needs to be offline
 
I'll remember that for when I see it again
 
@Daruchini take it offline then
@Daruchini no one requires server side rendering, thats a feature
 
@CatBoss I've never used a framework before so I wasn't sure if it did or not
 
@CatBoss It's not an unreasonable assumption
Many past frameworks/libraries required the DOM to look in a certain way
 
9:30 AM
Wasn't attacking the dudette, just saying
 
@Daruchini No, it requires at least one element on the page which you render your app into.
 
@MadaraUchiha @CatBoss thank you both :)
 
you guys saw that one?
 
Aye
Although sounds fake
 
i assume he didnt use git
lets just start digging
 
9:37 AM
Still, recovering files isn't sorcery
 
true
except when you made new files :D
 
Honestly, who goes on a 5k file project without any sort of source control or backup whatsoever?
 
if you removed files and literally did not touch anything after that, you can retrieve them
honestly, who goes on a 5k file project?
 
Maybe he deleted the whole project, but 4999 files were node_modules and 1 file is package.json
 
honestly, who goes on a node.js project?
... shit im in the Js room
 
9:41 AM
@Wietlol People who want their code to actually run? :)
 
@CatBoss lmao
 
@MadaraUchiha people who use Js
 
@MadaraUchiha "cannot even find them in the recycle bin" in that post screams fake though
 
@KamilSolecki There is a possibly
 
i have many programs that literally remove files from the depth of their existence
even one that nullifies their old data on the disk
i think many trash management programs do the same
stuff like CCleaner etc
or they are lazy and just delete the files and then clear the bin
 
9:46 AM
I've never trust programs like those
Always feels like malware to me.
 
i find them rather useful
 
@Wietlol I just opt to not use Windows
 
except for the popup every 3 hours saying "you can remove 5 GB of data"
 
Problem solved.
 
while I still have 1.9TB of free space
 
9:48 AM
does it also say where the 5 GB of data is stored?
or is there a chance that you delete document/pictures/ without knowing
 
Programs like CCleaner are garbage and cause more harm than anything else
 
@CatBoss webcache.googleusercontent.com/… For all those wondering
 
Worst of all, they give you a false sense of being useful
 
@Nick it does in the details
but it never would remove those kind of stuff
@MadaraUchiha its still trash
need more drama
@OliverSalzburg on a side note, CCleaner once saved me
i had 400k files in my trash folder
 
@Wietlol Both the issue and the user behind it were deleted
 
9:51 AM
windows crashed on opening the folder
or clearing it
 
@Wietlol Did you delete a node_modules folder?
 
i dont use node
 
@Wietlol I know. Every CCleaner user has a story that completely justifies using that awful application
 
it was 7gb in total so not that much
 
Funniest thing that ever happened to me in this context was that I reached absolute 0 free space on my linux machine
 
9:52 AM
but i still couldnt clear it
CCleaner could
 
@MadaraUchiha Nice efficiency
 
Since everything is a file (even process IDs), I didn't even have enough disk space to spawn a rm process to start cleaning things up
 
@MadaraUchiha no problem, just install CCleaner and clean some stuff up
i mean... ow wait
 
@Wietlol So could have a thousand other programs
 
So I had to mount the disk on an external system, and delete stuff there
 
9:53 AM
CCleaner was just the one i used
 
It was a fun day.
 
the days that your computer is literally digging its grave are always fun
 
@MadaraUchiha Astonishing, truly.
 
@OliverSalzburg most likely because there must be a certain point when someone is forced to actually use it :P
The ones I trust the least are registry cleaners
Too sketchy
 
i once had a program that keeps track of all programs on what they do
it was on my old pc which i had many troubles with virusses and stuff
 
9:56 AM
Sounds like spyware
 
i forgot what it was called
 
Anyone watch funfunfunction
 
@KamilSolecki the use of it is that you can easily see where your programs store stuff
lovely stuff when dealing with expensive programs that have a full package trial period
or when you have to remove all traces of any virus from your computer
 
An antivirus should manage that too though
 
still it was an amazing program
 

« first day (2501 days earlier)      last day (2439 days later) »