« first day (1654 days earlier)      last day (3288 days later) » 

12:00 PM
what is javascript? I only code on node.js
 
@BenFortune yes, that's because node is now mainstream. I miss the old times when only good JS coders were doing node. Questions were less stupid.
 
@BenFortune same with browser, ending up with shitty jQuery code.
 
...and meeting the same problems they would if diving into browsers
 
node.js is just php without the dollar signs
 
12:00 PM
kek
 
@Meredith You don't know node, it seems
 
import $ from 'jquery';
 
@Meredith Also PHP has a slightly safer async model :P
 
@dystroy I was joking
 
thats an insult to node
 
12:02 PM
@AwalGarg php has an async model?
 
You trollin?
 
I like that node has a bunch of sync functions
It's like they're baiting bad programmers
 
I only ever use sync for requiring, when I need things loading before the startup
 
@BenFortune I use(d) sync when writing small scripts
 
If you can justify using it, then you're good
 
12:04 PM
who needs sync functions when you have sleep()
 
reminds me of sleepsort
#!/bin/bash
function f() {
    sleep "$1"
    echo "$1"
}
while [ -n "$1" ]
do
    f "$1" &
    shift
done
wait

example usage:
./sleepsort.bash 5 3 6 3 6 3 1 4 7
 
just sleep the whole server xD
 
I use sync functions when writing cli scripts with node.
 
(sleep sort actually works.)
 
JK
 
12:04 PM
Oh god why
 
I should use node more :/
@argentum47 I need helps.
 
sures
 
come to miaou
 
Is there a way to call javascript function from another page?
I need to call the below script myscript.js and the code is anohter.js fle


         $.fn.ipModuleInlineManagementControls = function (method) {
                if (methods[method]) {
                    return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
                } else if (typeof method === 'object' || !method) {
                    return methods.init.apply(this, arguments);
                } else {
 
Ctrl + K
 
12:07 PM
@Meredith I use sync functions in my small scripts or in my program initialization steps. Just because there's no reason to make things complex there
 
miaou is a life saver! :P @dystroy
 
Yeah they're not bad
But you know there are people who are tempted to use them when they should be using the async ones
 
true
 
@user2736704 when you say "another page" do you mean another javascript file?
 
but you don't make good programmers by hiding tools
 
12:08 PM
@Neoares yup
 
@user2736704 if both are in the same page, just call it
 
@AwalGarg Really ?
 
Anyone use Atom?
 
@dystroy YESSSS OMG IT SAVED MY LIFE ONCE!! :O
 
wait , I forgot email password :(
 
12:09 PM
$.fn.ipModuleInlineManagementControls('My object goes here');
 
@user2736704 but be sure the function you want to call is defined before calling it
 
@AwalGarg It's not a huge leap behind.
It's a huge leap in thought process
 
btw @dystroy I will be using miaou on a personal server too soon because hangouts is not good enough for me :/
 
Just searched, there's only one "Sync" in the whole Miaou : github.com/Canop/miaou/blob/master/libs%2Fchat.js#L14
 
In approach
 
12:10 PM
@AwalGarg You know my own server is open to you too, right ?
 
@dystroy I know. Use it daily :)
@MadaraUchiha oh, then I understood you wrong. My bad.
 
Try to speak about it around you : I need more users
 
sure!
 
Should I be using it
 
@dystroy Needs moar promises.
 
12:13 PM
@dystroy I usually just use it for stuff like
fs
    .readdirSync(path.join(__dirname, './endpoints'))
    .forEach(function(file) {
        if (~file.indexOf('.js')) {
            this[file.substring(0, file.indexOf('.'))] = require(path.join(__dirname, './endpoints', file))(this);
        }
    }.bind(this));
 
@MadaraUchiha Well, there are a lot of promises in the Miaou code
 
@dystroy NEEDS MOAR
 
@MadaraUchiha well, go down a few lines in the same file
 
Bonsoir
 
@dystroy MOAAAAR
@dystroy I should probably have a look on Miaou's code. Last time I looked my JS wasn't very good. Now I can probably do a lot more
 
12:15 PM
I have a question that would like to relate abstraction with object that has properties and behaviour. let me be more clear on this..
 
A sentient question with its own will. We are doomed.
 
@MadaraUchiha lol. The file is 60 lines. One Sync, 5 promise methods :D
 
Might work from home more often, can eat mackerel without people complaining about the smell :)
 
@dystroy What would it take to introduce babel into Miaou code?
@FlorianMargaine NEEDS MOAAAAAAAAAAAAAAAAAAAAAAAR
 
@MadaraUchiha a whole build step
 
12:19 PM
@FlorianMargaine Nah, Babel has a require hook
 
@dystroy you run miaou on io right?
 
yep
he already got stuff like const
 
@dystroy Is it running iojs or nodejs? And what version?
 
iojs
 
Someone should fork php and do what io did to node.
 
12:20 PM
And I don't want to use babel. I prefer to introduce new constructs when they're ready and optimized in V8
 
@AwalGarg That's PHP 7
 
Babel's string interpolation is buggy :/
@MadaraUchiha needs less $$$
 
@dystroy You're already using bluebird, right?
 
@MadaraUchiha yes
Almost from the start, more than 2 years ago
 
@dystroy Most of your promise returning functions can benefit from Promise.coroutine
 
12:25 PM
Does anyone know if hapi has dynamic asset handling? Like express.static. nvm
 
@MadaraUchiha Example ?
 
@dystroy On it
exports.appGet = Promise.coroutine(function*(req, res) {
    try {
        yield db.on();
        var roomId    = +req.params[0],
            userId    = req.user.id,
            room      = this.fetchRoomAndUserAuth(roomId, userId),
            ban       = this.getRoomUserActiveBan(roomId, userId),
            userPrefs = prefs.get.call(this, userId);
        room.path = server.roomPath(room);
        req.session.room = room;
        var theme = prefs.theme(userPrefs, req.query.theme);
        if (ban || (room.private && !auths.checkAtLeast(room.auth, 'write'))) {
I hope I got it right @dystroy ^
 
not really
 
Maybe add a .bind(this) somewhere in there
 
db.on() makes a db transaction (bound to the promise)
there can be several running parallel
 
12:30 PM
@dystroy Not in the current function it isn't. at least, you're not using it.
 
this.fetchRoomAndUserAuth(roomId, userId),
this is the transaction, thanks to a bound promise
 
In that case, why not var transaction = yield db.on(); ... transaction.fetchRoomAndUserAuth(roomId, userId);
 
ok, I just spent 10 minutes watching this
 
@MadaraUchiha I'm not sure it would be simpler. Why use a generator here ?
 
@dystroy Promise.coroutine(generator) will yield to resolved promises.
 
12:32 PM
I'll think about the idea but I'm unsure
 
Effectively making it an await/async function
Flat like a sync function, all the async goodness of a promise.
 
I get how it works, I'm just unconvinced it's useful here
 
@FlorianMargaine only looked at the title, but is it something about a spoon?
 
how do you handle the many map I use ?
 
@dystroy It reads better and has no significant downsides.
 
12:33 PM
@AwalGarg yes
 
lol, brilliant one :P
 
@MadaraUchiha In any case this is interesting, thanks.
 
@MadaraUchiha hey congrats for your 100k messages :)
 
(but I'm also interested in how you handle map here)
 
I have >25k messages \o/
 
12:37 PM
@FlorianMargaine where do you see that ?
 
@dystroy user profile on chat
 
Oh, that's this small unlabeled number at bottom right ?
 
@dystroy How so?
Give me a promise example, I'll try to make the coroutine equivalent
 
@dystroy Where db.on(ids) returns a promise for an array?
Or an array of promises?
 
12:41 PM
a promise for an array
it's just an irrelevant little shortcut
db.on(someArray).spread(f).then...
is the same as
db.on().then(function(){ return f.apply(this,someArray) }).then...
 
var items = yield db.on(ids);
var messages = yield Promise.map(items, db.getMessage);
return messages.map(function(m) { ... });
Or something like that
 
Looks like monads to me
 
Is it the same as "looks like Chinese to me" ?
 
Although, wait, no
@dystroy In this particular case, I wouldn't change the code
 
@dystroy Nope. Monads are a pretty powerful construct. The coroutine syntax looks similar enough, even if just a little more verbose
 
12:48 PM
Maybe add yield before db.on(ids) and use try{}catch{} instead of .catch() there
Also, @dystroy Y U NO USE Promise.using() instead of .finally()?
 
@MadaraUchiha That's what I thought too. Your coroutine construct is still interesting in some cases because it makes it easier and less hacky to deal with variable scope though.
@MadaraUchiha No, because there was no such construct at the begining of bluebird and I had more fun things to do than to rewrite the db management part
 
@dystroy I see
Got problems with JavaScript? Just spray some AJAX on the problem!
 
@dystroy Learn Haskell. You will love monads. You will love coroutines.
 
res.on('data', file.write);
or
res.on('data', function(chunk) {
  file.write(chunk);
});
part of me is saying the latter is more clear.
 
@rlemon Depends, in this particular case, I would agree.
 
12:50 PM
@rlemon the thing is the first one doesn't work
 
@rlemon meh. I like point-free style but the latter makes it obvious there's only one argument
 
However, with
 
@dystroy why not?
 
@rlemon context
 
res.on('data', file.write.bind(file));
 
12:51 PM
ahh well yea
I would have gotten there
 
values.filter(Boolean) // clearer
values.filter(function(value) {
    return Boolean(value);
}) // less clear
 
values.filter(function(value){return value})
 
yes
 
@JanDvorak filter(Boolean) still more readable.
 
It's just javascript lacks a built-in id function
 
12:53 PM
@JanDvorak Indeed
 
I think Underscore has one ;-)
 
.filter((!).(!)) // clearest
 
But even .filter(returnSelf) is less clear than .filter(Boolean)
 
@MadaraUchiha I disagree
 
.compact() // courtesy of Ruby
 
12:55 PM
@KendallFrey Fine, var truthy = Boolean; values.filter(truthy)
 
Are coroutines well optimized on V8 ?
 
compact = filter id
 
@dystroy That's @BenjaminGruenbaum 's area.
 
I do admit Haskell has otherwise as an alias for True, though :-)
compact = filter toBool
 
12:56 PM
Is that how otherwise works? lel
 
@dystroy I think no
 
@KendallFrey I'm pretty sure the compiler eliminates the condition anyways ;-)
 
well hopefully
 
Not sure if it works with pattern conditions, but it does shout at you if you put less specific patterns before more specific ones
 
@dystroy But I've used them (well, generators and yield) a lot in a game server and had no problems
 
12:59 PM
.filter(Brita)
 
!!urban lel
 
@JanDvorak Lel Unlike what many people think lel is not an acronym in the same fashion that LOL is (it does not mean laughing extremely loud, laughing extra loud or similar). Lel (and variations including lal) resulted from the use of random vowels substituted in place of the 'o' in LOL. These vowels were used in an attempt to be different from the millions of internet game fags. The word however, in essence, still means LOL.
 
lil
 
wayne
 
1:01 PM
lul
 
weezy
 
Should I write an article on how to make a whatsapp clone with azure mobile services in < 3 hours ?
 
modern English looks a lot like illiteracy
 
trell
!!should darkyen waste 3 hours?
 
@AwalGarg Impossible
 
1:02 PM
Lol
 
there ya go
 
Would the article writing or the whatsapp cloning take less than 3 hours ?
 
@dystroy whatsapp cloning
 
!!would the impossible happen?
 
@AwalGarg I can neither confirm nor deny
 
1:03 PM
there is a literal setting in azure push settings called "messaging"
 
@dystroy ^ fair answer
 
more or less they built a whole god-damned thing there.
 
I get src response on ajax but mozila says TypeError: answer.srcElement is undefined while it works fine in other browsers
?
 
blog.pusher.com/pusher-on-windows-azure < this is even better though
 
morning friends
 
1:04 PM
@user2736704 What did you set as responseType?
 
@AwalGarg actually lets collaborate on this
its a fun side project but might help us getting you hang of azure :P
 
@user2736704 why are you using srcElement?
 
// for now we are using azure <3
 
src element contains the path of the img
 
but first lemme make a very important voice authentication module inside my application
its called "azure account" lol
 
1:06 PM
@darkyen00 Last time I used azure for a client, it's approach to solve problems was like... PHP. Except more bad.
 
 if (xmlReq.status == 200) {
          var response = jQuery.parseJSON(answer.srcElement.response);
          callback(response.fileName);                                      //call callback function
        }
 
Lets chat on hangouts ?
 
@darkyen00 sure. You have my email already.
 
ping me abhishek@goph.me
 
@user2736704 Are you using jQuery but not jQuery.ajax?
 
1:07 PM
yeh am using xml http request
 
Why?
 
why not jQuery.ajax
 
I didn't need that...!
 
Then why jQuery?
 
any diff?
 
1:09 PM
Why jQuery.parseJson in particular? You don't support IE7 anyways.
 
You should probably parse xmlReq.responseText
 
Guys anybody know about magento datepicker??
 
@Santhucool Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
which is in javascript
0
Q: Issue while disable the previous days, today, and tomorrow in magento date picker

next2uTo disable the previous days, today, and tomorrow in magento date picker I use the below code. var calendarSetupObject = { inputField : "datefd", ifFormat: "%Y-%m-%e %H:%M:%S", showsTime: true, button : "dbtn", ...

 
@dystroy Why? Why not use the already parsed response property?
 
1:11 PM
@Santhucool Your use of fixed-width text is confusing
 
@Oliver I did not get it. Can you explain??
If post an answer it will be so much helpful
 
@dystroy so that's working fine with xmlReq.responseText :)
 
websites that sell websites (CMS builders and shit): Why are their own websites never coded well. like TERRIBLE JS on this site
 
@rlemon Because people who use those sites can't tell anyway
 
let us ignore the fact that they have class names 1, 2, 3, etc.
 
1:16 PM
@rlemon They probably use their own CMS :P
 
    $(".1").click(function() {
        $('html, body').animate({scrollTop: $("#main-para").offset().top - 95}, 1000);
        $(".1 a").addClass("fill");
        $(".2 a").removeClass("fill");
        $(".3 a").removeClass("fill");
        $(".4 a").removeClass("fill");
    });

    $(".2").click(function() {
        $('html, body').animate({scrollTop: $("#cms-para").offset().top - 95}, 1000);
        $(".1 a").removeClass("fill");
        $(".2 a").addClass("fill");
        $(".3 a").removeClass("fill");
and it isn't their CMS
it is some bootstrap site
 
Hory shet
 
yea
the entire front end looks like this
 
@OliverSalzburg any idea buddy??
 
lawd
 
1:16 PM
and boss is meeting with one of their sales guys today to discuss their CMS and possibly using it
I'm veto'ing it
 
@AwalGarg Don't you need IE10+ for that ?
 
@rlemon Using it for your own sites? Or for clients'?
 
@rlemon so pretty...
 
@Santhucool I was merely commenting on the formatting of the question. It isn't optimal. My personal approach would be to use momentjs.com and simply utilize the isBefore() and isAfter() helpers, which should make the intention of the code much clearer
 
@MadaraUchiha our own website
I told boss man we're going to do a WP install
it is a static site and we sell nothing on it
 
1:18 PM
Hello! What is the best algorithm for symbolic gestures recognition?
2
 
@OliverSalzburg unfortunately I cant use that I have to edit the default package of magento and make like that in Question
 
@QueueOverflow Depends. How many gestures, what accuracy, what speed, what coding complexity?
Also, what price?
 
I have done that but after disabling the current month enabled dates become unclickable
 
@rlemon WP is actually the sane choice in most cases.
 
@Santhucool I find the question confusing and the code even more so. Which days are actually supposed to be disabled? All days before and including tomorrow?
 
1:21 PM
Sad as it may sound, it's just the best at what it does. vOv
 
@JanDvorak We need only algorithm, not his implementation, so I suppose, that it should be free. Few gestures (5-10), high speed, high accuracy, coding complexity is not important for me.
 
If so, then I don't understand the complexity of the disableFunc
 
When wordpress cocks up though, it does it majestically
 
@OliverSalzburg I need to disable Today , Tomorrow and all previous days
suppose Today is May 1 then I can select only from May3
got it???
 
@Santhucool So... that's what I said, right?
 
1:23 PM
I done that right
 
this code is so terrible.
 
But the problem is that I am unable to select dates
 
@QueueOverflow crop, downscale to a small grid, posterize, hardcode every possibility :-D
 
When I click it is not working
Problem is only with current month
 
@Santhucool That sounds like a completely different problem now
 
1:23 PM
for a slightly more serious answer, replace the last step with "pass through a neural network"
 
@OliverSalzburg hope u got that
 
@JanDvorak Could you give a link to a paper, that describe this method?
 
I disabled all the dates correctly
 
Yeah, I'm getting it, by slowly pulling the relevant information out of you :P
 
!!tell queue google brain.js
 
LARGE chunks of html commented out but left in, same with the JS. no selector/element is EVER cached, HUGE chunks of repeating code, class names called 1 and 2, links with javascript:void(0) that don't do anything... at all.. I could go on
 
@JanDvorak I use now $P, but his accuracy is not quite well.
 
there is nothing about this site that makes me happy
 
@dystroy IE9 IIRC (not sure). I usually use my own wrapper for XHR though so it contains a shim.
 
@QueueOverflow more training
perhaps even retrain online
 
1:25 PM
@OliverSalzburg when I select the dates from current month then it is unable to select
@OliverSalzburg but the interesting thing is that Suppose I am going to next month and coming back then it works!!
I do n't want is happening. Totally confusing!!
 
Sounds weird. Maybe it's a problem in their component
 
@JanDvorak You told about $P algorithm?
 
Did u read that question buddy?? Any idea??
 
@rlemon What's the name of it? So we can publicly ridicule said website.
 
I wanna find out who wrote the website first
they don't have a demo of their CMS online
so I can't ridicule that
 
1:28 PM
lol, just heard a coworker yell over the phone to someone: "I CAN'T SEE WHAT YOU'RE POINTING AT, WE'RE ON THE PHONE!"
10
I'm dying
 
Does editing still trigger desktop notifications?
 
@BenFortune If ping exists in new revision, yes.
 
@MadaraUchiha Need to write a userscript to mute pings from edits :P
 
@CapricaSix The worst in the neural network is a impossibility of guess the accuracy of my solution and quite bad speed.
@CapricaSix But I will look at it. Thanks for idea.
 
-3
Q: Importance of uninvoked function?

NitI'm currently working with some Sharepoint display templates. Below is an oddity I stumbled upon in one Sharepoint built-in method: var f = function () { ULSKKT:; /* Other operations, unrelated to the above follow */ } Where f is called numerous times later on in other built-in functio...

I must be missing something
 
1:31 PM
@AwalGarg I'm all ears
@dystroy one closevote
 
THE
!! google find element with biggest height in dom
 
@JanDvorak I assume you have fingers too, since you're typing stuff
 
@ShotgunNinja I didn't say "literally"
!!tell shotgun define all ears
 
@shotgun [all ears](http://en.wiktionary.org/wiki?curid=94367) (idiomatic) listening intently; fully focused
The students were all ears when they found out the topic of the film was "reproduction." They were disappointed to discover that it was also about fish.
 
@dystroy You didn't properly copy the code to your bin
The code executes perfectly fine
 
@OliverSalzburg Can you copy it for me ?
 
lol
 
You missed the function() part
 
@OliverSalzburg That's not the original code
@OliverSalzburg No, OP did
 
user2620028
1:36 PM
i just loaded up the internet radio from home and it makes me feel a lot better haha
 
@KendallFrey I wasn't aware that edits are no longer recognized on SO ;D
 
@OliverSalzburg there's no "function" here in OP code
 
@OliverSalzburg comments were made before the edits were made
 
@KendallFrey Yeah, I see that now. A bit confusing
 
A bit?
 
1:38 PM
@KendallFrey No, massively!
 
user2620028
@kendall i got really close to solving that problem btw
 
This guy is an asshole
@dystroy See the above comment, your discussion doesn't offer any value unless you actually read the question. — Nit 1 min ago
 
!!letitgo
 
@MadaraUchiha That didn't make much sense. Use the !!/help command to learn more.
 
Huh
Was sure it existed.
 
1:43 PM
!!/help
 
@Neoares Information on interacting with me can be found at this page
 
kek
 
lol :P
 
lol
lel
 
1:47 PM
just unaccepted an answer from @FlorianMargaine because a better one came (long after) :\
 
!!listcommands
 
@Neoares 666, help, listen, eval, coffee, refresh, forget, info, listcommands, tell, afk, ban, unban, convert, define, doge, google, hang, jquery, learn, put..it..back...ლ(ಠ益ಠ)ლ, phucket, gtfo, lol, moneycantbuylove, catmode, coffeetime, lifeban, stopmyself, instagram, kendallfrey, excited, manigga, meinneger, dgaf, infiniteriot, okay, feelsgoodman, fabulous, sausage, playerpimp, installjavascript, moarkittens, kendall, banana, kfc, uwot, nsfw, facepalm, somekittens, erase, fry, dudeism
hahastillhere, onebox, morecoffee, steve, whoosh, burn, woosh, roomowner, phony, really, inur, coffeescri
 
wtf
!!666
 
ಊ(╰◣▂ ◢╯)Ψ
 
1:49 PM
hahahahahahahaha
 
@Neoares, If you want to play with the bot, go into the sandbox room.
 
yes, she is so sexy :d
 
or you can keep playing here for 2 more minutes and get kicked by someone.
 
but ok, i'll keep in mind :)
 
That's what I did once :/
@dystroy so just curious, once miaou loads, all the interaction between client and server is through a single socket, right?
 
1:52 PM
@AwalGarg most of it
 
@dystroy what is not a part of the websocket?
image uploads, I guess
 
profile loading, watched room messages display on hover
 
ah. gotcha.
 
MDN is dead again
 
!!catmode
 
1:54 PM
works for me
 
works for me too
 
@MadaraUchiha OK
 
It is an audit message.
 
THE
why the hell if I change hidden element's height/width to 5000px would ever make any different to visible elements ???
I would smash i head on jQuery if it was a thing
 
jquery doesn't render, it just changes properties
 
1:57 PM
also, display: none; doesn't effect other elements
 
I have problems accessing doc sites. Is the "scope" of a label in js the enclosing function ?
 
is it hidden with display: none or visibility: hidden
 
THE
yeah, but it's just too slow
 
@THE Define "hidden"
 
opacity: 0 and visibility: hidden do
 
1:57 PM
visibility:hidden just acts like the element is transparent i think
 
@THE position: fixed.
 
@Meredith correct
 
THE
@rlemon let me replicate it on jsfiddle, but I am working on SharePoint framework, 1000s of styles are applying, i just hate working on front end @SharePoint
 
I don't need a fiddle.
 
@THE I just hate SharePoint.
2
 
1:58 PM
we've already covered the cases
 
how are you hiding it?
 
THE
@Luggage display:none in style
 
I race hate conditions
 
THE
gonna go for today, will continue tomorrow
 
@rlemon They aren't fond of you either.
 

« first day (1654 days earlier)      last day (3288 days later) »