« first day (1659 days earlier)      last day (3289 days later) » 

12:09 AM
@rlemon again:
@royhowie , i speak english just as good as u my "American" friend , and as far as what i want ... an appology maybe or ..... even better , can u undo the 9+ downvotes , for which i would hold you quite responsible (you could have always commented as to what i was asking , or even commented asking me to clarify , instead .. you choose to showcase ur witty talking skills) — Alexander Solonik 6 mins ago
 
already purged
:D
 
this guy is 100% obnoxious
 
@KendallFrey Looks like I just need to grind for the MPL: reddit.com/r/KerbalSpaceProgram/comments/34jysx/…
 
12:27 AM
English skill (or French, or Chinese) is not the same as communication skill. Many people don't seem to get that. On the same note, language skill is not the same as software engineering skill either.
 
NLP on Emoji (cc @BenjaminGruenbaum && @SomeGuy)
 
 
3 hours later…
3:05 AM
I have a cyclical dependency in my nodeJS app. Should I get rid of it?
 
@StevensHaen what did google say?
 
yes, i should
module.exports.User = mongoose.model('User', new Schema({
  id:           ObjectId,
  firstName:    { type: String, required: '{PATH} is required.' },
  lastName:     { type: String, required: '{PATH} is required.' },
  email:        { type: String, required: '{PATH} is required.', unique: true },
  password:     { type: String, required: '{PATH} is required.' },
  data:         Object
}));
What does the required field do in this model?
 
just watched snowpiercer
was the shit
how come I never heard of it
 
@Sheepy Also true of JavaScript.
 
@StevensHaen makes the field required…?
 
3:18 AM
Yes, but what does the value mean?
 
@Sheepy Or rather, communication is just as important when programming, aside from engineering.
 
window.ture = true;
window.flase = false;
 
it's what's thrown as the error when the field isn't set mongoosejs.com/docs/api.html#schematype_SchemaType-required
 
I see
 
I like to write an init method, though
ticketSchema.methods.setUp = function (date, isAdult, transactionId) {
    this.date = date;
    this.hash = encrypt.randomBytes(12).toString("base64").replace(/\//g, "_").replace(/\+/g, "-");
    this.info.used = false;
    this.adult = isAdult;
    this._transaction = transactionId;

    return this;
}
so I can do something like var ticket = new Ticket(); ticket.setUp(someDate, true, someId).save(function (err) { ... });
 
3:27 AM
Object.defineProperty(window, 'ture', {get: () => [true, false][new Date%2]});
 
@mintsauce Math.random()>0.5
 
>=
 
can someone please explain me on this.why is it the output is 4,4,4
 
@mintsauce eh, I guess this is true, since the number returned isn't continuous
@jemz closures
 
@royhowie Well, 1 is never returned, so > will skew results in favour of false.
 
3:39 AM
setTimeout(function () { console.log(i) ;}, 0)
 
@royhowie, why it it 4,4,4 my thinking of this is 1,2,3 but I am wrong
 
first of all, the minimum time for a setTimeout is 4ms, so that's not going to be the same as just console.log(i);
so, after 4ms, the setTimeout calls the anonymous function. By then, i == 4
 
ah i see
 
because of closures, the anonymous function remembers the state in which it was called
so it knows that i is now 4
 
how do I debug so that I can see the execution of the loop ? using breakpoints ?
 
3:42 AM
this will print 1, 2, 3 jsfiddle.net/Luxelin/mg7uemt4
that's because the function f is immediately passed i
and it forms a new closure
 
@royhowie, I never know that setTimeout has minimum of 4ms
 
Even if it were zero, the for-loop would still finish first, by which point i would equal 4.
 
@jemz developer.mozilla.org/en-US/docs/Web/API/WindowTimers/… see the "Minimum/maximum delay and timeout nesting" section
 
Ok thank you
 
@jemz that actually could've been a good question to ask on SO!
(although it might've been a duplicate; let me check)
 
3:48 AM
ok
 
Even if there was no minimum delay for setTimeout, it still gets pushed onto the browser's event loop and wouldn't be executed until the current script is finished.
 
is it better to close vote an old question or just delete it?
stackoverflow.com/questions/23302337/… there's no way anyone could really answer it
(no longer reproducible)
but because no one has answered it, I can just delete
 
It's probably worth pointing out that the delay means 'no sooner than'. With setTimeout(f, 0), f could potentially execute a day later.
 
only if the comupter is really slow or gets hibernated at just the right time
 
Yeah. No guarantees though.
 
4:17 AM
meta.stackoverflow.com/questions/292104/… we made it to meta (for alleged rudeness and toxicity)!
@BenBowen I'll help you with your code problem (if you still have it)
 
@royhowie it was a complete misunderstanding as you can see, I just kinda freaked out because it was the first time i'd joined the room
 
@BenBowen no hard feelings
did you resolve the issue with jQuery versions and jsfiddle?
 
I fixed the problem that I came in with, but I have a whole new set unfortunately :/
 
hmm?
 
@royhowie it's likely that i'm just not understanding the syntax of JS properly, but i'm wanting to have the JQuery progress bar(standard package) to increment by an amount each time the user checks a radio button
 
4:25 AM
link?
 
I know, my code is disgusting, right/.
?*
 
jsfiddle.net/Luxelin/chrjnrLu/3 you should put script in the appropriate box
 
Where's the form variable defined?
 
4:29 AM
also, this isn't going to work, since you don't have the jQuery plugin
 
Perhaps you meant document.forms, but you don't have a form named a anyways, just an input of that name.
 
... and input elements don't have numeric indexes
 
I tidied up your code
 
I have the jquery-ui-1.11.4.custom folder
 
4:32 AM
You need to tell the browser to load it as well
 
add that to external resources (on the left)
 
it's only meant to run locally, this will never make it to a live server
 
Yes, but jsfiddle needs the plugin, so that it can use it
 
doesn't mean the browser will automagically load every JS file in the directory. Quite the opposite.
 
ok, so in the external resources section i've pointed it to my local JQuery files, yet the progress bar is still missing, even though it displays fine when launched in chrome?
 
4:39 AM
Are you pointing jsfiddle to your hard drive? That won't work
 
Oh, I guess that would be it then, you can really tell I only started using fiddle today :/
So where should I be pointing to for external resources? the devpage?
ok, I can see that I require more handholding than is probably acceptable for the room, so i'll leave here, thanks for the help anyway guys
 
5:16 AM
@BenBowen are you just learning javascript? you might consider doing a course at code academy on javascript
 
5:40 AM
@AwalGarg Haha, I never have to be in the same room when they're watching TV
 
Does anybody here know if Mongoose.js subdocuments can have instance methods to update themselves?
From an instance method, I try this.save and it doesn't work.
The callback gets hit, but the saved field is empty.
 
@royhowie i tried it and its just little helpful , though its cool
 
Hi, i have a question to every one, how to send Ajax using post method, answer with example.
 
good morning
 
@RaviPrakash do your homework yourself !!
@RaviPrakash show us code you have tried and we will try to help you
 
5:58 AM
$.ajax.post(url, {data:'data'}) thar ya go
 
@Shea
Not in jQuery in JS
 
@RaviPrakash what error are you getting ? show to us
 
wasn't there a canonical on that recently written?
also, why in the world was stackoverflow.com/questions/29996675/… closed for the reason it was?
the reason should've been that it is not a programming question
 
!!tell RaviPrakash google javascript ajax -jquery
oh my bad
 
6:02 AM
@NullPoiиteя I've tried basic code, but nothing shows including HTML page containing that code
 
6:14 AM
whoa wait....
if you want it in JS, jQuery is a valid answer
 
@RaviPrakash may be you are opening wrong file
if nothing shows including html than problem may be at anywhere else
 
good night
 
later
 
in python, am able to ...
>>> nums =  [5, 2, 6, 3]
>>> nums[0] = nums[:]
>>> nums
[[5, 2, 6, 3], 2, 6, 3]
>>>
in java script what is the equivalent syntax for nums[:]?
 
nums[0] = nums
an array in is not a collection of homogeneous objects ... unlike in java
 
I dont think so
 
why
you can have [1, "a", 2]
 
that goes recursive
 
6:32 AM
ou ..
 
same in python
you are doing this
but I want ..
For doing this... we say nums[0] = nums[:] in python but in javascript?
 
hm .. I understand .... i am thinking .. although some other gguys could have answered faster
what is that operator in python?
 
in python, check this >>> nums[0:] and >>> nums[:-1]
 
ok I got it .. range like ... JS would be splice or slice
does doing num[1:2] create a new instance ?
 
@argentum47 yup, thanks
 
6:40 AM
In python we say slicing
 
@overexchange @AwalGarg
 
@overexchange slice, splice, have fun
Python's foo[a:b:step] is syntactic sugar for the slice ilk library functions.
 
howbut nums[0] = nums.slice(0)
slice would create a new innstance
 
slice returns a shallow copy
 
yeah, but its a new array .. when doing nums[0] = nums , it would be recursive .. because num's are linked.
:( what am I saying
 
6:48 AM
 
I get that ...
 
this is what we want, so he says nums.slice()
ok
 
ok
 
6:52 AM
in Teenage Programmers Chatroom, 6 hours ago, by Awal Garg
@RaviPrakash Y U NO TEACH ME JAVA SCRIPT???
in Teenage Programmers Chatroom, 1 hour ago, by Ravi Prakash
@AwalGarg First tell me who are you and what you want to learn.
Sometime, you said that you want to learn HTML now you are saying JS, what's your actual question?? Or, you are spamming and asking random questions?
^this guy is too good :D
 
lololol
 
in Teenage Programmers Chatroom, 14 hours ago, by Ravi Prakash
@ProgramFOX @ByteCommander @Unihedron @JacobGray
Can anyone kick me?
 
@argentum47 you missed all the fun :D
 
I was working with the notification feature in my SO clone .. I am thinking of doing php again.. it would be a waste to loose everything that /i learnt by myself for over 3 years ,,,,
just for duh sake of job
 
6:57 AM
php is on demand for jobs?
 
I want to f uc ork PHP and make string concatenate with + and change the \` to .` :( I don't even know C
 
well php has been in the web industry for a long time ... and it has really developed in the past coupe of years ... plus its easy to get started .. so there are a lot of companies and people who do php ... @overexchange
 
@AwalGarg why ? like i wanted to change + to . in js :D
 
@AwalGarg you will know C at college ... thumbs up
 
@argentum47 ...not turbo c
 
7:00 AM
before we learn php, is it mandatory to understand front end stuff html/css/javascript?
 
like how far is this copying going to go?
 
Can anyone here help me with Yeoman?
All I did was:
mkdir client
cd client
npm install -g yo
npm install -g generator-angular
yo angular
...and it did not end up successfully. Here is the debug log: https://gist.githubusercontent.com/rahul-desai3/9f1d1d0a1ddeec2a4ad0/raw/npm-debug.log
 
@NullPoiиteя Just that that's how it happens in most other languages I use, so it feels like a standard practice :/
 
@AwalGarg but you have linux .. you have gnu C.. and in coleges I dun think they care about the differences in the compiler ..
 
C is never taught in US universities except you need OS api's. they use dyn lang scheme/lisp/python
 
7:02 AM
I am on Windows 8.1 and I was doing this in command prompt with Admin rights.
 
@argentum47 turbo c === compiler for ugly and bad code. they teach ugly and bad code so that it can compile in the compiler they use.
 
@overexchange no ... not necessarily, you can be all backend or all front end .. but most of us i guess prefer full-stack .. so learn it along with php :P
 
Also, I know most C/C++ that college will teach me. But that knowledge is useless to hack on the php interpreter.
 
true, it require work experience to hack on php interpreter
 
7:04 AM
hm .. they teach nothing of that ... they can even take away some of your marks if you even ask that.. attleast that how it was here .. like I committed a felony ..
 
@argentum47 This is most unfortunately true. Most of the vamps I see here are "all front end" and it is very difficult for them to use help :/
 
vamps will be vamps ... werewolves will be werewolves
 
Any idea, guys?
 
@argentum47 do we also need to learn frontend/backend frameworks apart from lang to get a job
 
its a matter of choice ... some prefer no frameworks, writing everything of their own ...so that they know every ins and outs and can tweak everything to their need.. and some prefer convention over configuration ... You do need to know php before you start laravel ...
 
7:17 AM
laravel?
 
laravel is nice , and best with vagrant + homestead environment
 
its a php framework
 
ok
as we know javascript, why to go for php instead of node.js for backend?
 
@overexchange you dont need to learn framework to get job
 
ok
I am moving to NZ, to get job on web dev. am learning some programming using python and do some webdev using javascript
 
7:19 AM
I dunno that :D ... for me, I didn't know javascript when I started php .. I just knew C and that I had to built the next facebook XD
python also has a few web dev frameworks ... like django
 
Hello Javascript! Should I be relying on for (let each of iterable)?
or var each in iterable then use iterable[each]?
 
@overexchange afaik php only lag at real time app due to apache else php is fine
and its because php module weren not built with persistent connection in mind.
 
Q: Why do Java developers wear glasses
A: Becoz they can't C#
 
7:36 AM
tl;dr—use node.js (or io.js)
@Unihedron pretty sure for-each is deprecated
 
@royhowie but it works
 
@Unihedron for-of is its replacement
 
Ok, thanks!
 
you need ES6, though, so stick to for-in loops for now (on client side): for (var x in obj) obj[x] = true
 
7:48 AM
@SomeKittens Wow, that's awesome! word2vec seems very useful
How did you come across that post?
 
@NullPoiиteя learning node.js will allow me to avoid learn one more syntax from php
syntax wise moving from python ---> javascript ----> node.js is very easy
 
Can anyone help me with this please? I am stuck badly.
0
Q: 'yo angular' throwing errors

Rahul DesaiI am following this tutorial to create a MEAN stack application: https://www.youtube.com/watch?v=OhPFgqHz68o. I am having Windows 8.1 and I have setup the backend with Node.js which has no problem. When I started with the frontend, all I tried to do was: mkdir client cd client npm install -g ...

 
@SomeGuy the twitters
 
9528 error Please try running this command again as root/Administrator. ?
 
@Jhawins Okayish
 
8:08 AM
@argentum47 I did it as admin itself.
 
hm googling also shows no definite answer .. some say installing the lastest version helps, but you already have that ... could you try without the grunt contrib watch ? or any other generator ..
 
@argentum47 I have added the errors that I got in the question: stackoverflow.com/questions/29999733/yo-angular-throwing-errors
 
Raise your hand if you don't know the difference between its and it's. I'll hate you for that.
 
I mean I see only two errors in the log other that "no readme data" ... one is unpacking a tar file and the other was the loads.js error
 
@argentum47 Did you check EDIT 2 ?
 
8:14 AM
ow .. i was seeing the gist
 
nevermind
I am badly stuck at this point :/
 
uninstall windows and swap it for unix
that'll probably solve your problem
 
you have npm install -g grunt-cli ? I dunno how to fix that tar.unpack untar error .. lemme see
 
yes
 
I was clearly kidding; if you just dv'd me, that's not very nice =(
 
8:23 AM
and github.com/npm/npm/issues/1488 is all I could find
sudo npm cache clean and reinstall maybe .. I dunno ...
for the windows character path limitation .. there is npmjs.com/package/fenestrate
 
8:41 AM
If I dynamically create html elements, how can I attach events to them with jquery?
 
$(document).on("eventType", "selector", functionNameHere);
 
ah thanks
 
i am not a fan of hooking elements on document level. You can bind event on the element itself
 
Only if the element exists
 
ofc ...
 
8:49 AM
which is not the case here
 
you can hook events on dynamically created elements, just do that after the creation. Or am i not understanding you well ?
 
then you need to watch their creation
 
eh ?
 
It breaks separation of concerns when content creation code is required to be aware of all code regarding that content.
and impossible when the content manipulation code is a userscript
 
@MadaraUchiha context?
 
thanks
 
hah, that large pistol
 
@FlorianMargaine github.com/mattly/emacs-farmhouse-theme hi, another theme :D
 
9:35 AM
@MadaraUchiha found this in the comments
 
@KarelG There's one with a glock too methinks
 
demn office PPT
it doesn't have a nice process wizard which allows you to point to a previous process.
 
hey people.
I am having some trouble with angular.js. any help would be great. I have posted the question here as well: stackoverflow.com/questions/30000766/…
i am going mad with angular's DI
for god's sake, save my brain!! hehe..
 
9:51 AM
@Zirak yummy, I like this
I wrote an oauth2 handler yesterday... It was simpler than I expected.
 
@FlorianMargaine Do you want to revisit the bash.org clone? I've got some ideas.
 
10:47 AM
Mornin
Happy Birthday @m59!!!
13
hehe, I'm tricking OP into solving their own problem
So put it as a string in your example. Also, can you write the logic of what's bigger between two elements (let's call them p1 and p2) - say a function foo that takes a player p1 and a player p2 and just returns 1 if p1 is bigger, 0 if they're equal and -1 if p2 is bigger? If you do that I can give you an answer :) — Benjamin Gruenbaum 1 min ago
 
11:34 AM
@Zirak sure, send me a mail?
 
@FlorianMargaine is that ^ your email?
 
@Zirak this one ^
@BenjaminGruenbaum I'm on mobile in case this was for me
 
Check it out later
 
@BenjaminGruenbaum I don't think I'll be able to before ~10 hours... We'll see
 
12:03 PM
!!stat
 
@AlperTuran You (http://stackoverflow.com/users/4749719/alper-turan) have 716 reputation, earned 24 rep today, asked 10 questions, gave 9 answers, for a q:a ratio of 10:9.
avg. rep/post: 37.68. Badges: 0g 0s 20b
 
@BenjaminGruenbaum You (http://stackoverflow.com/users/1348195/benjamin-gruenbaum) have 69144 reputation, earned 29 rep today, asked 63 questions, gave 1293 answers, for a q:a ratio of 21:431.
avg. rep/post: 50.99. Badges: 19g 137s 220b
 
@FlorianMargaine Sent
 
!!stat Zirak
 
12:10 PM
@BenjaminGruenbaum Zirak (http://stackoverflow.com/users/617762/zirak) has 15123 reputation, earned 0 rep today, asked 15 questions, gave 194 answers, for a q:a ratio of 15:194.
avg. rep/post: 72.35. Badges: 6g 41s 70b
 
Hey @BenjaminGruenbaum you tried to help me at this post stackoverflow.com/questions/30001377/… however the sort still does not work. Any further clues?
 
You have not created an isolated fiddle. Check out the examples for .sort on MDN @shawwy
 
The weirdest thing is that it returns the values, the function is correct.
Jup, tested, it returns correctly 1, -1 and 0-s but i don't understand why the sort does not work
 
12:31 PM
because your array is undefined...
 
It's not undefined
it's global variable as i mentioned. Doing playerLst[0].name will give result just fine for example
i think i understand what the problem is
it does just fine
but it shows them in ascending order right?
i would like to get in descending order
like it shows the smallest first and largest last
i want it to show largest first and smallest last
 
@Zirak answered in 3 mails
 
Wanna make my life harder, eh?
 
@Zirak 2.9
 
Where is the specification for ES7 async functions?
 
12:44 PM
You didn't google
 
@AwalGarg on the internet
 
@Zirak @BenjaminGruenbaum I got this - github.com/lukehoban/ecmascript-asyncawait - but it doesn't look like the official specification/draft :/
 
@AwalGarg it is though.
This is how ES7 works now, through GH mostly
There is no one unifying paper for it yet
 
I googled "es7 async function" and found the strawman
 
ok
@Zirak no I got an article in which the usage was described and a link to this link was left.
I might be ignorant but what happens when an async function is called in the main thread and the return value is to be assigned to a variable?
say this:
let foo = myAsyncFunctionWhichTakes50sToComplete(); // do something with foo later
Will the main thread be blocked?
 
1:01 PM
you can try to experiment that yourself ?
 
It seems that it returns a promise (with babel) but then I can't see how is it useful :(
babeljs.io/repl/… I am... missing something :/
 
Async functions return promises.
Also, you didn't have Evaluate ticked (the checkbox) so the code didn't run
 
Well I can see that, but that "spec" doesn't say that anywhere :/
 
Sure it does...
> For async functions, a Promise<T> is returned, and the type of return expressions must be T. Yield's arguments are any.
 
ah yeah, the last line right
 
1:15 PM
Does
    if (!req.user) {
        res.redirect('/login');
      } else {
        next();
      }
    }
in Nodejs with body-parser mean that the user isn't in an active session?
 
Does it? Try and answer that yourself. Have 10 minutes.
 
You have an extra } at the end? And that indentation...
 
might be a c/p of a snippet which is a part of a function
 
m59
@BenjaminGruenbaum thanks :)
 
1:31 PM
Hey all :) I am learning javascript, been doing so for 1 year now.
I have a webpage using ajax to change the text in the page, when the menu is clicked, so pretty standard functionality.
How would I code the onpopstate function, to use with my webpage?
I have problems with getting there myself, any help would be much appreciated!
As it is now, I call my ajax function with onclick on my menu items(I know this is oldschool, it will be replaced by clickevent), and in my menuitems I use this kind of function: "ajaxFunction(parameterHereIUseNameOfTextFile.php) return false;"
 
you can put these states in the GET parameter and let the PHP handle that. By this you can exchange URL's simply
 
Can you post your code?
 
@StevensHaen What does body parser do?
 
stores the body of the request
This has to do with the user object that we create for the session
I was wrong
 
Oh hey Meredith, you helped me with this last time, I just couldn't understand the code to the full extend!
I have read some in the books you tipped me about, it just takes a loong time getting through it all: )
 
1:38 PM
Oh were you the one asking about the router object?
 
that is correct ;)
 
Alright what do you have so far?
 
anyone willing to play some starcraft2 ?
I really don't want to play against the bots
 
hi @tereško : i have installed the game and played the online part to realize that i suck at RTS against others.
 
Well, I have just read a lot in the books, I am still on first book. "Learning javascript".. Can't say I have tried coding to much, the router function got my head spinning to much :p
 
1:40 PM
moved on to single player campaign of TW: shogun 2
 
@KarelG lack of practice
 
@sunto Yeah but what code do you have now? Like what you've added since the last time we've talked
 
actually nothing, I have been focusing on reading up on it all
I tried for a long time, to work my head aroung the router function, and I tried to understand it all, just couldn't wuite get there!
 
What don't you understand?
 
when thinking at "router function" i think at a real router with functions to progress packages... but that's not what you're talking about right ?
 
1:49 PM
It handles the routes in your app
 
Well, alot i guess. First of all, I don't get, where to use what. You wrote, implement this, for 1:call pushstate with page, 2: use AJAX to load page, and 3 call callback with the httpRequest. I tried to shift around my code to get it working, and write it a bit different, but it seems i misunderstood something
So I guess, I am struggling with everything about it.. I can read it, and see the logic setup you did there. I just can't combine it with my already "working" httpReq..
 
What does your loadPage function look like?
 
lel, my newspaper webpage (of which i have a subscription of a paper version) shows an article about the birth of a "princess" of william and kate in UK. It covers the whole window ... I am not interested in that medieval thing.
 
hm, well this is the router func you sent me
http://puu.sh/gkkHD.txt
 
My facebook is full of news of the newborn princess, too.
 
1:55 PM
Yeah
You said you tried to implement that loadPage part
Can I see what you have there?
 
Any objections against generating keys on device in javascript
 
and then encrypting data with the private key of the device and sending it to server to authenticate its validity (ofc the server will have the public key)
 
I still have the same code, as you may remember it is still called with onclick's, and I tried to you know, change my ajaxfunction to work with the router, but honestly, I have no clue as to where to start!
 
the advantage is the server returns back a signed version (with the servers private key) to the device, which it can use to perform nfc handshakes
b/w peers
 
1:58 PM
When running headless, bot still has a REPL (@SomeKittens, @SomeGuy, if you care)
 
how-old.net says I'm 26
 
@darkyen00 seems good, but don't forget to encode the keygen.
 

« first day (1659 days earlier)      last day (3289 days later) »