« first day (1507 days earlier)      last day (3666 days later) » 

00:00
PHP is nice, but sometimes impractical
Time to relax from answering questions all day to gain reputation. Goodbye.
00:39
any reason to use request module in node rather than createClient ?
easier to use?
> ... That Java is the right language for all jobs. (I pause here while you vomit in your mouth.)
01:06
Clearly Haskell is the right language for all jobs.
JavaScript is the right language
m59
m59
I've been studying and thinking on this, still not getting past my current opinion. I can't see how libraries aren't bad as compared to writing a ton of modules.
what's the difference?
m59
m59
Server-side, it doesn't matter so much, but client-side, it's a big deal to me.
noms suggested that if you want to use lodash for something, then using a cdn is the solution for the bulk that comes with it
So, if I write a useful client-side function, or just some function that's great for either server/client, and I use lodash, then I'm forcing myself and anyone else to get it from a cdn at best
and that still comes along with that whole script having to be executed
and at worst, also downloaded if it isn't available from a previous site
and in memory.
01:22
so, don't use jQuery as a really bloated QSA?
m59
m59
Even things like bluebird, it could all be modularized.
So you're ok with having several dozen modules load?
m59
m59
Yeah.
It's trivial work to require what I need, and the gain is pretty significant.
So, I might have to write 5ish extra requires. That sounds fine to me.
doesn't to me. Sounds like I'll spend more time managing my dependencies than coding.
m59
m59
This issue makes me never want to touch client-side again.
The way I've started to think about code, due to James Halliday (substack) mainly, I have a lot of trouble considering using a library, rather than thinking in terms of how to solve a problem.
npm install thing-that-solves-this-problem
done
That thing should pull in whatever dependencies it needs and that should be the end of it. If they're already in the project, even better.
But, who wants to use a solution that forces them to include an entire library, and who would write a solution that includes an entire library for one function from it?
and if you then solve the problem by just writing that function right in the script with the solution, then you're setting yourself up to write that function over and over everytime you need it again.
And that throws DRY,modularity,reusability,abstraction right out the window.
01:34
There is no difference between a module and a library. A library is simply a set of functionality; so it is a modular component. Something being a library doesn’t mean that it’s a super complicated and huge thing with lots of features.
m59
m59
lodash/underscore/etc are
Just because there are some libraries that want to do everything in a slightly different less-vanilla way, that doesn’t mean that this defines the term “library”.
!!> 'lib' > 'module'
m59
m59
I'm not sure what you're trying to communicate here.
a module should be a piece of software doing a specific thing
01:37
Just saying that you shouldn’t rage against “libraries”, and that there are indeed libraries that do exactly what you want, i.e. solve just a very specific problem.
a lib should be a collection of similar modules in the same category or of the same type
Nobody forces you to use those huge bundled do-it-all things, so if you don’t like them, don’t use them, and instead choose those tools that actually help you get work done.
so.. should
var db = require('nbe-' + require('../config').db.type);
well, that was poorly thought out.
m59
m59
var wrap = require('lodash-wrap'); <-- solve my problem with no drawback
var _ = require('lodash'); <-- solve my problem by losing performance all around
@poke I still don't see how what you're saying applies to what I'm saying. What you're saying would mean I should fork lodash and modularize it ;D
01:40
Well, why not?
m59
m59
If I'm right, that's exactly what i'm going to do.
But no one agrees with me, and I can't understand how that is.
If you can see some individual parts being useful without having to depend on the rest, then sure, just pick those what you need. And if it’s a good selection—or just very modular—then make it available to others.
Well, people are lazy and don’t care about performance. That’s why the average JavaScript question always contains an answer (or a comment) like “Why don’t use use jQuery?”
m59
m59
You're inadvertently calling kittens, phenom, and the library devs non-caring =D
I'm more inclined to think I'm wrong.
I never got why you'd use lodash
Arrays have the most important stuff since always anyway.
No, those huge libraries are a great thing—for sites that completely build on them. If you have a huge interactive site, yes, jQuery is probably very useful. But it’s not the right tool for everything you can do in JavaScript. So choose the right tool, the right big-ass library—or none—for the right situation.
01:45
Like, I don't get it, a lot of people write node only modules and do _.map(_.filter(_.map(arr, fn), fn2), fn3) and not arr.map(fn).filter(fn2).map(fn3)
m59
m59
@BenjaminGruenbaum to me, it's not about "most" things. It's about not having a lingering function in a script that doesn't really relate. It's something reusable and should be it's own thing.
In this case, I have my own wrap function that does the same thing as lodash.wrap
@m59 you are correct, in fact you're so correct that 5 years ago people said "hey, that's really useful - we should put it in the language"
m59
m59
It's just silly for me not to be able to just use that one.
JS has a wrap function like that?
@m59 Ah, the human condition.
No, but it's trivial to do it without a wrap function.
01:47
@BenjaminGruenbaum If you think the main usage of lodash is mapping and filtering... I'm not sure you've really used much lodash.
var oldFoo = foo;
foo = function(){
    // code that runs before foo
    var val = oldFoo.apply(this, arguments); // change arguments etc
    // code that runs after
    return val; // or some processing of
};
m59
m59
Yeah, mine is like that.
And yes, I don't care about performance until it starts being an issue.
Premature optimisation and all that.
Why put it in a function though? What I did there is very simple.
@Retsam what would you consider "most usage"? (Assuming I don't use stuff like _.template that is.)
m59
m59
Because I need to use it like 6 times in the same file?
Heck, that's all I do in that script.
01:49
Yes, but you have no less lines of code and you can go wrong exactly everywhere you'd go wrong sooner.
@BenjaminGruenbaum Probably varies from person to person; I find _.pluck and _.find to be pretty invaluable; _.invoke can be a nice time saver, _.mapValues has its usages; stuff like _.any, _.every, _.some help make conditionals more readable...
@Retsam every and some are JS native
@Retsam .some and every are JS natives... you're proving my point..
@BenjaminGruenbaum So it’s a Python decorator.
Also, _.filter supports shorthand syntax not supported by native. _.filter(collection, {id: "foo"})
01:53
@poke yeah, _.wrap is a python decorator although JS has better functions than Python (one of the few things it does better)
(Not that python has bad functions or anything)
“JS has better functions than Python” – I’m willing to discuss that. :P
@Retsam one I rarely need and imo just obfuscates intent - that's subjective though.
StackOverflow isn't loading for me
@poke JS has function expressions for one.
and all my work grinds to a halt.
01:54
@SomeKittens yup, me too
@Benjamin On that I agree. lambda is very limited. But then again, anonymous functions are not really encouraged in Python.
wait, figured it out
@poke they're not encouraged but I like them - I generally think that functional syntax when appropriate is better than query syntax - and you see that mostly in C# that has both syntaxes.
(Both python like comprehensions and JS like .map.reduce.etc
@BenjaminGruenbaum I definitely don't think it obfuscates the intent; you can pretty much read left to right as an english sentence: "filter collection by id 'foo'"
And it works without having to name another variable.
@Retsam That shorthand syntax is very limited though. What if you want to filter on even bar values? You will need a separate filter function; so you have a second, different syntax for another filter query.
01:58
Also, find is in ES6, so you can just polyfill it.
@poke Well then you're no worse off than you were by not using lodash?
how do I do if pathing with promises?
You're including a library that does what the language can do anyway - only slower.
@SomeKittens typically - you'd use an if.
@BenjaminGruenbaum Libraries aren't always slower than vanilla.
@BenjaminGruenbaum I was asking for that.
@Retsam Exactly. Then what’s the point of willingly adding overhead when you end up using the original vanilla way anyway?
01:59
@SomeKittens that's true, but lodash is :P
@SomeKittens I don't get it
@BenjaminGruenbaum "I was asking for that" in the colloquial sense (i.e. I said something stupid, and you caught me)
somePromise.then(function(foo){
     if(foo) return bar();
     else return baz();
});
Ah
but I want to chain off of bar but not baz
Then I’d rather want a library to give me a equalityPredicate function which gives me a function that I can then use with the JS filter? E.g. collection.filter(equalityPredicate('id', 'foo'))
do I sub-then?
02:01
@BenjaminGruenbaum citation? I was pretty sure lodash delegated to native where possible.
Yes, just like ifs
@poke Umm, the cases where I can use the shorthand, for one.
@Retsam meh, it's not that performance matters anyway since if it did you'd use a for loop.
@BenjaminGruenbaum You're the one who brought up performance as an issue;
And then retracted that.
02:04
is JS a scripting language?
No one knows what the term "scripting language" means anyway.
@CSᵠ Sure, why not?
what's the difference? really
between a programming lang and a scripting one?
Scripting languages are programming languages.
@CSᵠ Scripting languages are programming languages.
02:06
1 min ago, by Benjamin Gruenbaum
No one knows what the term "scripting language" means anyway.
i really need to survey ppl who take out the 'scripting lang' argument and ask what it means... (for them at least)
got no real answer so far...
There is none, terminology is the easiest thing to argue about and the least useful.
Usually people call interpreted languages scripting language..
In my book if I write code with it it's a programming language.
If someone brings up semantics as a counterpoint, you can tell they don't care about the topic and only want to argue.
02:08
Interpreted language is another funny term which I don't understand.
In some cases "scripting language" is meant as "interpreted language", but generally it's a perjorative term used by people arguing for "real" languages, I find.
@BenjaminGruenbaum some people 'program in html' (4) :)
@BenjaminGruenbaum Interpreted is not that hard actually; interpreted languages are languages that are not compiled into some other form.
They can program in HTML - I don't think that they're not programmers.
@CSᵠ Some people are wrong.
02:10
HTML is a language, a markup language (it’s in the name!), but not a programming language.
@poke no languages are compiled or interpreted, languages just are.
Hello!! Is there anybody that knows ALGOL??
What reads them an executes code in them is orthogonal.
somewhere
@MaryStar well that's something I thought I wouldn't hear. What's your question?
@poke I think it's a language and that they write code in it and build stuff with it - the difference is so hard to define so why bother.
02:12
@BenjaminGruenbaum Don't some languages require compilation at a language level due to their features? My view was that "interpreted languages" could be compiled, but not generally the other way around.
@Benjamin I’m just saying what I would base my definition on if I were to bother to argue about it.
so.. dogescript would be a programming language because it compiles to js, but js is a scripting language because... it doesn't compile, it's just interpreted...
so that makes sense ^ ?
@Retsam what do you mean? Take a look at Java for example - it can run natively (on Java machines), it can run interpreted (like it did initially), it can be JIT compiled (like on the desktop) or it can be compiled ahead of time (like on Android 5) - none of that has much to do with Java.
@Retsam I think Benjamin’s point is that every compiler is also an interpreter, and what compiler produces is some other sort of code that’s then interpreted by something else. That doesn’t directly affect the language you are writing though.
@BenjaminGruenbaum How can we write the command: printf("%d->%d", X, Y); in ALGOL where X and Y are the arguments of the recursive function. Do we have to write something like: write "X -> Y"; ?
02:13
@CSᵠ Stop using "programming language" as an alternative to "scripting language"
@MaryStar what variant of ALGOL are you using?
@Retsam is C or ASM a scripting language?
@CSᵠ what it compiles to is irrelevant.
@CSᵠ yes, it is.
lol
mindfuk :)
02:15
@CSᵠ Scripting languages and compiled languages don’t have an order; so one language being interpreted has no advantage nor disadvantage over a language being compiled. That’s why one can be compiled into another that is going to be interpreted. And that’s usually what happens with every language. At some point, the machine interprets and runs machine code.
And as Benjamin made clear, scripting or compiled is not necessarily a property of the language.
@BenjaminGruenbaum It is called pidgin ALGOL
@MaryStar Hmm, haven't used that in a while :) Algol68 would be something like WRITEF("%N -> %I4*N", X, Y)
I've been thinking about commits as "Do one thing" lately and it's really helped my focus.
@poke benj does make a great point, my q was in defining the term, categorize, comparison is off the table
It's simply not a part of the language - how you run something and what it is are different concepts.
It's hard to define the term because there are several conflicting definitions.
02:18
Well, those terms are just hard to define. Just like strong or weak typing. Everybody uses it to define their language, but rarely one can give a clear definition.
this was good, thanks
m59
m59
@BenjaminGruenbaum here's where my head is: jsbin.com/wiwoxu/2/edit
option 4 just seems optimum. Maybe it's all trivial, but it makes me happiest.
@m59 Out of curiosity: How often do you need to do that?
I'd probably promisify `.ready
:P
02:23
It probably makes sense to not keep calling twttr.ready for whatever single task you have to do. Depending on what twttr even is (xD), it might make sense to just wrap all twttr-related stuff into a single function that’s then passed to twttr.ready.
twttr is really the name of the official Twitter library? Wow, that’s bad.
I'd probably promisify the rest of the API later - decorate each function to return a promise and do .ready before it runs.
m59
m59
Everything about that library is awful.
Looking at the docs there actually seems to be Promise support.
m59
m59
@poke it's trivial, like I said. I just hate it :)
twttr.ready should be called internally.
And it's not?
m59
m59
02:27
I mean, if all I'm doing is creating a single button or creating several things in the same code block, it would all be inside of one twttr.ready, but I haven't thought about all that.
Well, got to sleep - afk good night :)
m59
m59
One step at a time ;D
!!afk sleep
m59
m59
@BenjaminGruenbaum ah dern :/
2
Q: Why does this Twitter library delay the assignment of its object properties?

m59The Twitter widget library exposes a global variable twttr. I'd like to modularize this library on the fly using webpack with exports-loader. The problem is that, while the twttr variable is immediately exposed, it's properties are still undefined when accessing it synchronously. console.log(twt...

Would anyone be interested in Flow for the monthly challenge?
02:29
@Benjamin I was actually about to ask you about promises. I haven’t caught up with the ES6 development of it, and since you seem to know them very well, I would be interested to hear if there’s anything new. And I would like a recommendation for a lightwight polyfill (I still use es6-promise for node). I would appreciate if we could talk about it tomorrow :)
You've effectively done the OP's homework for them, and thus deprived them of the opportunity to learn something. Not only that, by answering, you've helped further encouraged horrible "gimme teh codez" and other "lack of effort"-type questions. Answering these questions is strongly discouraged, and it is far better to flag, and/or leave a comment asking the op to provide further information. — Paul Richter 1 min ago
support this post plz
m59
m59
02:47
@poke btw, I just had a thought about how you said libraries like that are good for sites that build on them
Perspective can be hard to communicate, but this is what I was referring to when I talked about thinking in terms of "solving a problem".
Libraries like that solve lots of problems.
I mean, you ideally build something out of a ton of little problems, and should be able to deal with them all individually.
Building something based on a library just sounds like a ton of coupling.
or unnecessary restriction
or helpful guidance
hah :D
@m59 I’m going to watch that tomorrow, thanks
But for now, I’ll go to bed, good night :)
m59
m59
@poke goodnight!
dreams come true
 
1 hour later…
04:30
Downvote?? Seriouslyy??? stackoverflow.com/a/27210857/586051
That awkward bubble of time dilation between when your delivery goes and the truck and when it actually arrives...
My new monitor is mere hours away!
@SterlingArcher ;lka j;lakiklsjdflhk4eoscnmpapo8w paoi;ejnsg
pls halp?
04:45
lol
04:56
The world is so unfair. They asked for a new app icon, I made it. No more reviews on my app thereafter :( marketplace.firefox.com/app/my-todo-list
05:18
@RahulDesai Now it's too good
Reduce the quality of the icon this instant!
@monners really?
No, not really.
I want to get it on PhoneGap and put it on Android and iOS
What makes it different to the hundreds of other note-taking apps out there?
a cool UI, maybe?
05:25
Hey everyone!
ASR
ASR
how do I get timezone value using offset?
Ahoy hoy
05:51
!!weather turin
right...
what was the site cap linked to?
06:24
!!weather pune
07:12
@CapricaSix wake up yo!
^ How come global object is changing here?
the global variable is changing even before calling the function :/
I think I am missing some points about javascript here.
@Mr_Green by global object do you mean a?
That is how assign-by-reference works
@Mr_Green The second fiddle only demonstrates a debugger lag
The debugger shows objects in the state as they were first observed
07:33
hi there,
I have a sql query response from my javascript function

I am passing it to a view page.

how do i read rows objects of that sql query in an html page?
"sql query response from my javascript function" - I think not.
@JanDvorak ohh ok thanks
[{ id:9, user_name:'abc', pass: '1234' , firstname: 'mon', lastname: 'than'}]
how to get the firstname from this row :-|
allright :-|
That's not SQL, and (client-side) javascript can't access whatever database resides on the server without the server assisting
07:38
res.render(
'login',
{"login": data});

my data has :
[{ id:9, user_name:'abc', pass: '1234' , firstname: 'mon', lastname: 'than'}]

which I am passing it to the html page.

I am trying to access saying login.rows[0].firstname
but it is giving me an error
oh
I misread, sorry
what error?
the page crashes
Error: Failed to lookup view "error" in views directory "C:\nodejs\nodetest\views" at Function.app.render (C:\nodejs\nodetest\node_modules\express\lib\application.js:492:17) at ServerResponse.res.render (C:\nodejs\nodetest\node_modules\express\lib\response.js:802:7) at Layer.module.exports [as handle] (C:\nodejs\nodetest\app.js:63:9) at trim_prefix (C:\nodejs\nodetest\node_modules\express\lib\router\index.js:235:17) at C:\nodejs\nodetest\node_modules\express\lib\router\index.js:208:9 at Function.proto.process_params
something like this.
Seems it Failed to lookup view "error" in views directory "C:\nodejs\nodetest\views"
07:58
dead morning --- i'd say dead as zombie morning
08:11
Playing too much Minecraft?
user1804599
Hey guys.
user1804599
In a browser, if I have setTimeout(a, 1000); setTimeout(b, 2000); is it guaranteed that a is called before b is called? I'm working with some crappy code that uses timeouts where it shouldn't and I want to know if I can depend on this.
No; most browsers will respect that, though, I think
user1804599
08:33
Oh I see. Thanks!
@rightføld No its not garunteed
if you set multiple callback timeouts in chrome
there is a limit iirc 1 per second in background mode
but afaik it used to be a list so you wouldn't knw the difference
09:17
@rightføld yes, it is guaranteed.
It is not guaranteed that they'll run exactly 1 second and 2 seconds after the call but iti s guaranteed that a is called before b.
user1804599
Now I'm confused.
> Wait until any invocations of this algorithm started before this one whose timeout is equal to or less than this one's have completed.
The setTimeout(b, 2000) must wait for the setTimeout(a, 1000) to fire before it fires. It is guaranteed although indeed crappy.
TIL, thanks and sorry
To be fair - I have no idea if setTimeout in node respects that though since it's not specced by the DOM API
09:28
@FlorianMargaine ?
> since it's not specced by the DOM API
Right, node's timers are not specced under the dom API
Oh wait, I see how you read it nvm.
aaaah
yeah, my bad
I should probably write better sentences - I feel my English has deteriorated. Makes sense since I don't read as often and when I do it's usually technical.
@BenjaminGruenbaum Mai inglish gud
09:46
hello gentlemen!
@SecondRikudo hi!
@AwalGarg Morning
@BenjaminGruenbaum audiobooks FTW
o_O new monthly challenge
So who was the Zirak from the previous one?
@AwalGarg Zirak was.
yay!
I need to find time to write something to put on github :?
@FlorianMargaine mind === blown
@Unihedron @HamZa ^^
in RegEx - Regular Expressions, Nov 7 '13 at 22:09, by HamZa
Regex as a game http://regexcrossword.com !
Morning
Hi. What is a good exercise I can give students so that they learn about apply, bind, call, etc...and where it can be used?
10:03
Sep 21 '13 at 17:47, by copy
Nice, http://regexcrossword.com/challenges/experienced/puzzles/1
@BenjaminGruenbaum woops
@BenjaminGruenbaum well... over a year ago :P
Jun 6 '13 at 11:24, by Jan Dvorak
http://regexcrossword.com/
@BenjaminGruenbaum How was your trip btw?
I was unfortunately too busy (school, work and paperwork...)
@tereško That might actually be a good idea altough I really like reading - I'm just kind of lazy :/
10:05
regex guys...
@HamZa It was awesome. Had lots of fun - still recovering :)
He smoked a lot of... tomatoes.
ahaha
I never tried it :P
@BenjaminGruenbaum I like reading too, but when I go on a book-binge, 16h of nonstop audiobook is much easier on my organism than 16h or reading black letters on stark white background
than*
10:06
(and, yes, I have not read a dead-tree book in ~12 years)
@HamZa damn .. again
always think about "then" as time/order
@tereško My book reader has night mode, which is a lower contrast white-on-black kind of thing
I did the same mistakes...
I read "‎And the Mountains Echoed" last week and I had a hard time following it (I was very sleepy in my defense) - if I get confused on such an easy book I definitely need to read more. I should probably pick up something by Dickens, I love that dude.
@tereško Just remember the difference between "I'd rather kiss you than die." and "I'd rather kiss you then die."
4
10:08
messing with me...
@SecondRikudo lol
@SecondRikudo hahaha
The original uses a different word than "kiss", but you get the message.
mahahaha
...man
10:12
can anyone please help me with this fullcalendar issue
0
Q: events sharing each other in full calendar

Alex ManI have created an application in full-calendar, the application is working fine but the problem is that under the week view i have two events for today (Nov 9 - 15, 2014)- Meeting 1 and Meeting 2, both are within the boundary levels which you can see a light green event. The problem which i am fa...

@SecondRikudo What's the catch? Already beat that game and all user levels three months ago.
10:32
@BenjaminGruenbaum can has Scala challenge on monthly challenge?
@SecondRikudo go for it
I'd bite
@BenjaminGruenbaum I don't know Scala enough to know something that would be easy to implement and still educating enough
@SecondRikudo it's just a language - whatever would take an hour or two in php or C# or Java would take about as much in Scala as much as this challenge is concerned.
there should be a CSS challenge
@AwalGarg Post one
10:42
Hi. Is this post outdated:? stackoverflow.com/a/11886626/145682
@BenjaminGruenbaum it seems as if there are 4-5 people determined to kill the monthly challenge initiative
-5 on question, -3-4 on all answers...
@SecondRikudo meta police - good luck to them I don't care. Haters gonna hate.

« first day (1507 days earlier)      last day (3666 days later) »