« first day (1591 days earlier)      last day (3582 days later) » 

10:00
@dystroy oh, lol. Twitter does that.
@BenjaminGruenbaum I don't actually care that much in chrome either, stack trace takes me to the function anyway :P
@AwalGarg pingg
@argentum47 o/ miaou?
@darkyen00 can you come to miaou?
I cam I pinged I slept.
Well. If you have foo().bar().baz().bak().bin().boo() it'll now tell you which was undefined. Sort of.
10:01
@argentum47 :D
I have a small problem. At home, my PC is connected to a Cable (internet). Then I run python3 -m http.server to run a server on my working dir. And then I run ngrok 8000 and I can connect to my localhost from my android device. And I was accessing the internet in the android device using a AccesPoint from my PC. But at office my PC is itself on a WiFi. I can't access my localhost using ngrok from my device. :(
@Zirak I am liking 7 weeks book a lot so far. Thanks for recommending!
which book
@BenjaminGruenbaum umm...
-1
A: Invert the key and value of an object while the value is an array

Rohan KumarTry this, var object = { a: ["A1"], b: ["B1", "B2"], c: ["C1", "C2", "C3", "C4"] }; var keys = Object.keys(object); var obj = {}; $(keys).each(function(k, v) { for (var i = 0; i < object[v].length; i++) { obj[object[v][i]] = v; } }); console.log(obj); var object = { a:...

10:08
If you have chained method calls it will tell you which of those is undefined.
Including jQuery for the sole use of $.each :/
@BenFortune yes, that user has a lot of rep too :/
He edited though.
@BenjaminGruenbaum you can still do that. Just click on the stack trace, and the cursor will jump to the position at which the undefined function was called... and the stack trace shows the name of it.
Or atleast that's what I thought :/
What if the stack trace was sent to you from the client?
As in - you're monitoring client-side errors and you got one via email? Although you get a stack trace anyway.
I guess it's just a quick time saver.
yeah, it is just a time saver. I like the code formatting more :D
the undefined is not a function was always a fun fact for me :P
10:12
Is it being added to V8 or just chrome?
As in, can it be used in Node/IO too
@BenFortune Presumably, just chrome.
@BenFortune v8
my bad then
hi, anyone here ever worked with kendo ui scheduler?, i´m having a hard time understanding how to get data from the server on the resources part: stackoverflow.com/questions/28613403/…
can anyone take a look please?
10:19
    var price = this.cart.items.reduce((price, item)=>{
      return price + (item.quantity * item.medicine.mrp);
    }, 0);

    var taxPerc = this.cart.tax_percentage;
    var discountPerc = this.cart.discount_percentage;
    // var priceWithTax = price + ( price * (tax/100) );
    var totalTax = price * ( taxPerc/100 );
    var totalDiscount = price * (discountPerc/100);

    [price, totalDiscount, totalTax] = [price, totalDiscount, totalTax].map( p => +(p.toFixed(2)) );

    var totalPrice  = ( price + totalTax ) - totalDiscount;
!!tell darkyen00 format
if only we had a Decimal :-(
@darkyen00 Y U { return Foo } instead of Foo in arrows?
let price = this.cart.items.reduce((price, item) => price + (item.quantity * item.medicine.mrp), 0);
Although I'd probably split it a bit.
i generally make the reduce quite long
3-4 lines, its just a habit.
I agree here the => makes moer sense (updated)
@darkyen00 Meh,
10:30
Item.prototype.price = function(){
    return this.quantity * this.medicine.mrp;
}
Wait, no, that wouldn't work.
var price = this.cart.items.reduce((price, item) =>
  price + (item.quantity * item.medicine.mrp)
,0);
Needs a getter, for the whole cart
Yeah, a getter would also work. I prefer functions to getters when I can get away with them though.
Then you could do:
let price = this.cart.items.reduce((price, item) => price + item.price(), 0);
var price = this.cart.items.reduce((price, item)=>(
    price + (item.quantity * item.medicine.mrp)
), 0);
stop using var
10:31
@darkyen00 Drop the ()s, but yeah. Like I said I'd put price as a getter on the item.
You have actual logic in your app (yay!), structure it properly.
@FlorianMargaine :-/ ouch
Tax calculations are a classic use case for "strategy" but YMMV.
class Item {
    constructor(..) { .. } // your existing logic for making items from whatever
    get price() {
         return this.quantity * this.medicine.mrp;
    }
}

class ItemCart extends Array {
    constructor(...) { } // cart creation
    price() {
        return this.reduce((x, y) => x + y.price, 0);
    }
    taxedPrice() { // possibly apply strategy
        return (this.price() * this.taxPercentage) / 100);
    }
}
Hi everyone
@Loki Hiya
@BenjaminGruenbaum i don't like having logic in my app
i'd prefer dumb clients.
but some things like optimistic updates, require pricing to be updated
10:39
@darkyen00 it has as much logic as it had before - but the logic is on the objects now and not procedural.
True, I can see that being much cleaner :-)
I'd probably extend an ImmutableJS List over an array though.
I was just replying to the Yay !
the payment thing clients are dumb as dumbness overshoot !
It isn't taking into consideration the roundoff of item price and the roundoff of taxedPrice
So I've an Angular question. Is there an event or something that allows to insert logic between app initialization and routeChangeStart?

The usecse is rather typical: init the app, fetch user details, then block parts of the UI based on user details
10:41
Results will be slightly different, bewarned
@Loki why can't you use resource resolvers ? or better yet promises ?
@Loki the typical way would be to use resolve in the router.
Ha :)
@BenjaminGruenbaum I now find good things about angular, after using react & flux.
I guess I should do more of room challenges, I'd learn even more.
10:43
Thanks for the propt response, but something with resolves feels off. Give me a moment to describe
@Loki are you concerned about having to handle loading in each resolve?
Yeah, neatly summed up
@Loki well, the "real" answer is to embed it in the JS you have on the server side to save additional cycles between the client and the server
@Loki what @phenomnomnominal said can be solved by iterating the routes in a loop or decorating when. It's just a bunch of objects after all.
Additional cycles is really not an issue. I don't like the idea of sticking the same service call in each of routeprovider.when()s
@BenjaminGruenbaum Where and when do I put the iterators then?
I mean, where's the common place for them?
Hi guys, I have a little question: how to get number from "-1.5"? ...please, help, I don't know what to do :(
10:46
var myPromise = $http.get(myResource);
function myWhen(obj){
    obj.resolve = obj.resolve || {};
    obj.resolve.myStuff = myPromise;
    router.when(obj);
}
int or number ?
And assign routes with myWhen, just for example.
@BenjaminGruenbaum parseInt(-1.5)
That will dump the mantissa though
question updated.
!!> parseInt('-1.5');
caprica honey ?
10:47
!!> +'-1.5'
@Loki I know how to parseInt, thanks though. Also in general we don't believe in giving people straight answers here but rather telling them where to find them :P
Well, the question was labeled quick :)
@phenomnomnominal it returns -1, not -1.5
@PDKnight Then parseFloat()
@PDKnight nope.
... use Number
@BenjaminGruenbaum Give me a moment to process that
\o/ @Loki parseFloat() works perfectly!
Why is everyone so eager to help the vamp?
10:51
@PDKnight All of the proposed solutions should have too though :) + '-1.5' does a generic conversion, should have worked in your case
@phenomnomnominal @FlorianMargaine +"number" works perfectly, too, thanks, guys!!
!!afk work.
11:10
@BenjaminGruenbaum Because they haven't been sucked dry. Many times.
@Zirak First time I saw that I was holy shit :O
Is there a good guide somewhere to setting up front-end development? Things like how to manage dependencies, how to run a local webserver (I'm currently using Python's SimpleHTTPServer)?
so...anyone here with experience on kendo ui components?
Miaou news: There's now avatars on Miaou
5
And there are many ways to choose your avatar :
So a polar bear walks into a bar and says, "I'll have a beer... ... and a shot of tequila." The bartender says, what's with the pause? The polar bear replies, "I dunno, I was just born with them."
waiting for a joke explainer
it's joke monday, I can post as many as I like hahahaha!
@dystroy thats old news ...
jokes monday :3
11:41
@darkyen00 Old ? I launched that yesterday evening and didn't speak about it apart on miaou...
I wish firebase had cloud code
@dystroy lol
Adding insult to injury with the â„¢ symbol
11:56
guys anyone wanting to help with api design?
This being said, there might be more and more libraries going incompatible with node, at least for a time if they don't fill the gap on V8 versions. Miaou isn't compatible anymore
@BartekBanachewicz Given that you're not a noob, maybe you should explain why you think you need help, and on what
@rlemon done
@dystroy I'm such a noob
anyway a spritesheet is a rectangular greed of equally-sized images, sized n x m, used in games
assuming I'm providing an API to access a sprite from a spritesheet, do I take one number (a consecutive index) or a tuple of two numbers?
What's the semantic ? Why do you choose one sprite rather than another one ? Do those numbers have a meaning ?
12:01
Both can be reasonably justified I suppose.
@dystroy They are typically representing either consecutive animation frames or tiles for a tiled map
theoretically in both of the scenarios what you want is just one number
I guess this API is very specific to a certain game or data format?
If there's no meaning in the n and m, I think you shouldn't show them, it's implementation leaking, so an index, or better an id, would be better
however, internally it's u-v calculation that uses two numbers to find an offset in the texture
@dystroy mmm
Hi everyone, I am looking for some opinions about sails.js
theoretically, for a fully featured spritesheet API, you want a rectangle passed in
12:02
@KendallFrey I'm assuming a square right now, divided evenly into n x m parts
Well, a rectangle should also work
posted on February 23, 2015

Last week Niels Leenheer of HTML5 Test told me he’d released a simple Android app that mimics a browser but runs in the device’s WebView. This is ideal for testing WebViews, a topic I’ve ignored so far. I downloaded the app to all my Android 4/5 phones except for the Huawei C8813 (Chinese firmware) where Google Play won’t run, and catalogued which browser the WebView i

In your company we have a great service, and we are migrating to node.js
@KendallFrey like, pixel/texcoord rectangle?
@BartekBanachewicz simplicity or flexibility, pick one
@BartekBanachewicz yeah
@KendallFrey that sounds like an Atlas not a Sheet in my vocabulary
12:03
but we are in doubt to use pure express or sails.js
in general, spritesheets could be organized any way
I'm planning to do it separately, indexed by strings
read from JSON or something
@dystroy joke monday
@BartekBanachewicz for the record, php has a convention of having a generic function called foo, using the least parameters possible, calling a function named foo_ex, as in "extended", that has all the needed flexibility
following PHP conventions is probably the last thing I want to do in my life.
12:04
Well, if sprites are organized by a single number, I would accept a single number and make the spritesheets only expand in one dimension
internally, that said. Not for userland side.
I did this with fonts
@BartekBanachewicz it's stupid to say "I ignore it because php". It's a good API imho to have this kind of thing
@KendallFrey so, IOW, abstracting the fact that the actual image might be square-ish
that makes sense
good PoV, thanks.
@FlorianMargaine I do that all the time but I typically just use where bindings for those helpers
that being said, I was asking about the outside API
This is my "spritesheet":
super easy to parse
12:07
Anyone where have any consideration on using express over sails.js?
@KendallFrey also pretty inefficient I suppose
@BartekBanachewicz why is that?
@KendallFrey because of the memory layout of textures in internal GPU implementations
Well, it's not used in the GPU afaik
@KendallFrey then it should be pretty obvious why it's inefficient :)
jk of course, you don't always need to use GPU-based rendering
12:09
lol
It's all software rendering
it's adequate
my lib is backed by OpenGL
@FlorianMargaine I installed Wireshark on Ubuntu (just sudo apt-get install wireshark, it's free under a GPL license). What's the filter I need to add there? I tried with frame contains "my name is", but doesn't show any results...
12:35
mongo 3 looks amazing, maybe I dont need postgresql
@SuperUberDuper What's new? There's been a lot of complaining here about Mongo and write performance and predictability. Is that 'solved'?
which are the best new features of mongo 3?
I don't know
just what they said is new
7x performance etc
So... you think you don't need a relational db because the authors of mongo say their new version is faster than the last one ?
Reminds me of hipster hacker
If it aint mongodb its the wrongodb
2
@hipsterhacker, The distant present
My code is poetry, meanwhile yours is oh-noetry.
92 tweets, 44.8k followers, following 10 users
Did you see those series of books ? lol github.com/getify/You-Dont-Know-JS
You Don't Know JS (book series)
I've heard the're great ( never read though , but tend to)
12:56
I've just seen a few extracts, some of them in SO questions. Those extracts looked like trolling and exhibition of knowledge more than like teaching material
@SuperUberDuper lol
@RoyiNamir As far as I've heard they are inconsistent, wrong, and poorly written. Of course, that's just what I've heard; I haven't actually read it. I'd always recommend Eloquent JS though.
@RoyiNamir Great in what way? As an actual source of information? Or as a good comedic read?
(Heard = from FB friends) you can see the actual content. it's free actually so it's you to decide
@RoyiNamir I have no friends, so that assumption is clearly wrong.
I already told you I didn't read it. Why are you even arguing about it?
Read it if you want.
13:00
Haters will hate....
@RoelvanUden I think Royi was saying he had heard it from his friends. I think you misunderstood
I just posted the comments sections and you are welcome to decide if it's deep enough or not
@RoyiNamir uh, he isn't hating.
He just said he heard they're bad.
@BartekBanachewicz "Why are you even arguing about it?,"Read it if you want."....
it's a bad attitude
@dystroy Oh, that might be it. It didn't read like that, but if so, apologies for my clearly wrong statement @RoyiNamir
13:01
(his words)
@RoyiNamir it's not.
Just posted those links if someone find it useful.....(please don't shoot me for that)
bang
Can someone please explain me "WATCHING TEMPLATES" section in this page? smashingmagazine.com/2012/12/05/client-side-templating
It is going from top of my head always
Yeah dystroy , you're right. I heard it from my FB friends. I don't have any pre-info about those books.
13:04
@RoyiNamir I thought you were asking about whether or not the book series was good? If you haven't read it, and you aren't asking about it, how can you recommend it as useful? Anyway, try eloquentjavascript.net
but I'm gonna.... after all , i'm willing to learn anytime anywhere :-)
^ "read it"?
or "learn it"
read it ( which is overlapping with "learn it") ... ( not all , only what's really interest me)
13:19
@BenjaminGruenbaum It lets you do stuff with tags. Very useful ;)
anyone use parse?
JSON.parse ?
fb parse
goodbye
13:34
@SuperUberDuper We used to, for a brief moment
Until we realized that they provide nothing other than trouble :P
like what trouble bruv?
Like push notifications not being delivered and you're left without a clue what the problem is
so they will fix that bug one day..
And they provide a neat SDK to make everything really simple for you, except that it is a PITA once you decide you need to move to a different solution because they are unreliable :P
I'm not a fan, YMMV
just use jquery; it does all things
14:02
@OliverSalzburg well I can use it untill I get investment:)
then hire backendists
@Thennarasu you need a profile pic:)
What, are you the avatar police?
@dystroy oooh, shots fired
Using insertRule to add css to a file, insisting that jQuery's .css() is slow...
All of jQuery is slow
14:16
Relatively, sure
(I agree)
But adding rules to css files like that? Yikes.
I've never inserted a stylesheet like that
I never did but I was thinking about doing it, yesterday...
There are cases where it might be useful
no regrets
If you'd like, you can deconstruct a super tiny lib that I made for notifications, and roll your own github.com/ndugger/Herald.js /shamelessplug — Nick Dugger 30 secs ago
14:32
Don't hate me because I'm beautiful....
kids going places
> 'Bout to drop the sickest nursery rhyme of 2015
I want to die, but I can't stop listening! It's so enticing!
> 1 2 3 ready for a bus ride
14:42
Jesus christ, managed to avoid that song for a whole year
I'm sad that there's only one song
Hi, just wondering when people make slideshows for websites is the number of slides they write the slideshow code for fixed. For example, scroll to the right X pixels because there are X slides?
No, that would be terrible design
Get the number of slides, and multiply by a slide's width
ok, so if you implement the same code onto another website with lets say 6 slides it would...
var slides = 6;
No
No need to save a number of slides in memory. Just count how many there are in the DOM
keep it dynamic
14:51
use classes
how would you do that in javascript, and not jquery
@Neoares Not helpful... at all.
:eq is in jquery
@IPAddress document.querySelectorAll(".slide").length
14:52
oh yeah... ooops
thats a class, as I said :)
@Neoares It can be anything. Using classes has nothing to do with his question.
thank you very much
I know, I just said I would use classes
well I would use a knife
14:53
so good luck xD
also, is a sliding horizontal slideshow achieved by having a div wrapper with an overflow:hidden property and the images in classes inside the div wrapper with the property float:left. then...
one question, why you didn't use getElementsByClassName?
I am cloning one <tr> from a table, but I want to get the cloning <tr> id is it possible
14:56
using javascript or jquery get the images to slide
????//
@Fairoz yes
@Neoares QSA is more capable, better support, and the speed difference is moot if your page is coded well
jquery
QSA has better support
@rlemon ok thanks :)
14:57
posted on February 23, 2015 by Amaan Cheval

Read the Wikipedia article here. (I really think you should read this one. The Wikipedia article has a lot more information than I've included here. What it is You may have heard about this on an episode of House or on South Park, but if not: Alien hand syndrome (AHS), a rare neurological disorder that causes hand movement without the person being aware of what is happening or having

pls anybody guide me .....
@Fairoz google
@Fairoz var foo = bar()
why don't you show us what you've tried?
14:58
if alert items.clone() I am getting object object
!!rewick or suffer
@rlemon rewick
@Fairoz don't use alert for debugging
@Fairoz DO NOT USE ALERT FOR DEBUGGING
it calls .toString()
you will have a bad day
14:59
the console exists for a reason
use console.log so you can see what the object contains
or console.dir in IE, because reasons
!!> ({}).toString()
@rlemon "[object Object]"
^ this is what you are seeing
14:59
let me try it

« first day (1591 days earlier)      last day (3582 days later) »