« first day (1753 days earlier)      last day (3196 days later) » 

7:00 AM
hmm, i'll check thank you
$("#ImgDoc").animate({ scrollTop: $(document).height() }, 'slow'); -- WORKED :)
 
@MadaraUchiha It's not a magical unicorn that does things Date can't do, but it has a much much nice API in my opinion. If you're happy with the native Date there's no need to pull it in
 
@ivarni The few things I do with date has native methods anyway so...
 
Morning
 
user3119231
@MadaraUchiha why do things the easy way when you can make them complicated :D
 
7:18 AM
@JohnSnow o/
 
@MadaraUchiha I was going to post an answer just like yours, but I figured I'd wait for the data structure
 
Hey @MadaraUchiha
 
@Maurize No xDDD But I ended installing angular-moment and killed many birds in a shot
 
user3119231
@Frondor there are several ways to kill many birds as possible but the clue is to find the smartest.
 
@Frondor As well as shoot yourself several times
@Maurize A nuclear bomb is most effective at killing a large number of birds.
It isn't, however, the smartest way :P
 
user3119231
7:23 AM
This is what I meant to say. ;)
 
@Maurize Well, I said it first. SO HAH!
 
!!s/A/E
so what happened to Caprica?
 
Does somebody work with bower here?
 
@Frondor Yeah, don't work with bower.
Just use npm
 
Well, I think I'm working with whatever I like to work ^^ But thanks anyway.
 
7:26 AM
@Frondor Bower is a stripped down, worse version of npm.
 
guys what is node.js really ?
it acts like a server at client side right ?
 
A program that allows JavaScript to interact with your whole computer
 
@royhowie How the hell did that get an upvote?
It's not even close to what OP is asking
 
whole computer in the sense ?? can you more clear pls
 
@Simply NodeJS is JavaScript on the server
 
user3119231
7:29 AM
@Simply It can create websockets which allows expanded communication between clients.
 
It doesn't run in the browser, but directly on the server.
 
user3119231
Correct me if I'm wrong
 
@Simply It's really just that. It's a JavaScript run-time in a process that can access everything on the machine it runs on. "Can I do X with it?". Yes. You can do anything you want with nodejs.
 
@Maurize You're not wrong, but you're confusing
 
The thing is... I've installed Urish's angular-moment directive (github.com/urish/angular-moment) and I need to add the locale file for another language. The problem is that I'm using a yeoman generator (grunt/npm/bower) and everytime a create my buildthe <script> tag with locale file disappear, and only moment.js and angular-moment.js libraries are left... How can I deal with it?
 
7:29 AM
Client-side JavaScript can create webskcoekts which allows expanded communication between clients.
 
@MadaraUchiha well, I think they were suggesting a possible alternative
 
oh cool, thank you lot, i got
 
I voted to close the question, since there's no way (in its current state) an accurate answer can be provided
 
@royhowie An alternative to what?
"How do I test if a collection satisfies a condition?" ~"Hurr durr use filter"
 
@MadaraUchiha "I also noticed that you are verifying a collection of users, wouldn't it be better to return those which are valid?"
 
7:30 AM
That's not even close to a correct answer
 
I'm not saying I agree; I'm just pointing out their line of reasoning.
 
@royhowie Well, OP did ask for short circuiting specifically.
He's obviously not interested in the valid items, just if there are any of them which are valid.
 
doesn't Array.prototype.every short-circuit automagically?
 
@royhowie Yes, it does. And so does [].some.
Which is exactly why I used it, and not filter.
 
I wonder whether it's implemented recursively or iteratively
 
7:34 AM
@royhowie Probably iteratively for performance
But the great part is that you don't care :D
 
@MadaraUchiha that was my guess
 
It's abstracted for that reason.
 
Morning everybody; any alternative to ace editor to embellish some js code (like <pre> or <code> tags)
 
@MadaraUchiha it's easier to write it iteratively
 
@FlorianMargaine Yup
 
7:38 AM
validate (users, key) {
    return users.some(user => users.providers.some(provider => provider.some(data => data.path === key )))
}
 
@royhowie Beautiful :)
 
I can't fix the code formatting
 
@royhowie Paste, CTRL+K, Enter
You can't reply with code though
validate (users, key) {
    return users.some(user => users.providers.some(provider => provider.some(data => data.path === key )))
}
 
got it
 
7:49 AM
@FlorianMargaine what is a "lisp idiom"?
I see the term being thrown a lot
 
Monring
 
@MadaraUchiha like "<any language> idiom"?
i.e. what's usually used
 
@FlorianMargaine So... common practice?
(I know English idioms for things like "skeleton key" and "cry your eyes out", never heard the word used in the context of programming langauges)
 
@MadaraUchiha yeah, e.g. "idiomatic way to handle default arguments" for es5
I believe this boils down to the question of "Should you write idiomatic code and force people to that level? or write non-idiomatic code that spells out everything explicitly?" — MichaelT Jul 2 '13 at 20:54
 
mooorning
 
7:59 AM
@FlorianMargaine Alright, thanks
I'm finally getting the hang of Macros :D started doing the practical chapters without looking at the code samples
 
@MadaraUchiha ah nice :)
@MadaraUchiha for the exercise, you can write a couple of macros without backtick
 
@FlorianMargaine I tried once, ended up having nested lists and quotes XD
 
backticks are not for macros only, is what I mean
@MadaraUchiha yeah, that's the point ^^
 
@FlorianMargaine people really think x = x || 'default value' is "trying to be clever"?
 
@FlorianMargaine Yeah, they're ' with selective evaluation
 
8:02 AM
@MadaraUchiha yup. And ,@ can be useful, e.g. github.com/ralt/dpkg-fs/blob/master/src/dir-content.lisp#L15
aka "free concat/flatten"
 
@FlorianMargaine Yeah, that's assuming path is a list in your example
 
yup
it's a list of strings
 
Yeah, I know. Took some time for the penny to drop too :D
`(list 1 2 ,@(list 3 4 5) 6) ==> (LIST 1 2 3 4 5 6)
 
ttj
i have a reusable header & footer i'd like to reuse in my files. using angular2, how can i do that?
 
8:05 AM
build-source runs, between others things, github.com/ralt/deb-packager/blob/master/src/source.lisp#L37
 
@FlorianMargaine Doesn't it cause problems if you don't use a gensym?
 
@MadaraUchiha no, the variable is gone at runtime...
gensym is when you introduce a runtime variable
e.g.
 
am i in LISP room ? :o
 
(defmacro foo ()
  `(let ((bar))
    ;; need gensym there ^
    ))
 
@KarelG Yes.
 
8:09 AM
@FlorianMargaine Aha
 
@KarelG no, Common Lisp
 
Yeah that makes sense
 
LISP is an old language
 
@FlorianMargaine I haven't tried recursive macros yet :D
 
@KarelG Just pretend it's ClojureScript
 
8:09 AM
@MadaraUchiha it's not different from normal macros
you just have to be aware of runtime/compile time...
 
Yeah, I can imagine
 
the same macro with gensym would be this btw:
(defmacro foo ()
  (let ((bar-var (gensym)))
    `(let ((,bar-var))
      ;; yay hygienic macros
      )))
@MadaraUchiha also, "anaphoric macros" is a thing: en.wikipedia.org/wiki/Anaphoric_macro
 
@FlorianMargaine I like the with-gensyms macro
(You pass variable names and it replaces them with gensyms for you :D)
 
@MadaraUchiha yeah, I don't remember this one
I don't remember the last time I used gensyms though :P
 
@FlorianMargaine It's not stdlib
 
8:14 AM
@MadaraUchiha I know, but I read PCL too :P
 
(defmacro with-gensyms (syms &body body)
  `(let ,(loop for s in syms collect `(,s (gensym)))
    ,@body))
 
btw, after you know your way around CL, Let Over Lambda is a very interesting book
 
ew macros
 
How to call a defined function from a string? Example I have a function named sort(). Can I call sort from a string?
function checkString(param){
sorry
Any help please
 
@HendryTanaka Unless it's defined on an object, you can't. Nor you should, almost surely.
 
8:21 AM
@HendryTanaka eval(string)
 
You mean like "foo".myFunc();
 
@Bimper don't do that
@HendryTanaka if you want to be really careful, you can use eval inside of a switch
but you should probably just use var fn = 'someStr'; if (typeof myObj[fn] === 'function') myObj[fn]()
 
@royhowie I'm gangsta, I do what I want.
 
@Bimper eval is dangerous
but you probably know that
 
@royhowie eval is for real gangstas. Also, it's the only thing that does what does what the poster asked for.
 
8:26 AM
@Bimper we gave our golden the lion cut—he looked so funny
sometimes he would go and hide, as though he could tell that people were laughing at his haircut
 
@royhowie Careful with that, there might be dentists around
 
@Bimper That's nice. But no.
 
@royhowie show me
 
@ivarni hahaha
 
What OP more often than not is not what OP needs.
 
8:27 AM
@Bimper I don't have a picture on hand (and this was a year ago)
but we didn't even ask for the lion cut—the groomer just did it
 
@MadaraUchiha it's great that you know better than him what he wants/needs. Good for you bro
 
@Bimper If what you want is eval, what you need is most definitely something else. Yes.
 
@MadaraUchiha like with
 
@royhowie GET OUT
 
with (eval) winning?
 
8:29 AM
Crockford will get out of his grave for that
 
@FlorianMargaine he finally died?
 
No, but you just killed him
 
hahaha
user image
4
 
lol
 
8:32 AM
while we're on the topic of programming-inspired cleaning solutions
 
@royhowie i didn't get you. Why eval() is dangerous?
 
@HendryTanaka what is it exactly that you're trying to do?
 
@HendryTanaka if I give you an example, can you promise to execute it within a node process in your terminal?
 
Why do you need to call a function from a string?
 
8:37 AM
:o
user input?
 
in which case GBYS
 
my keyboard sets to english every time he wants lol
Cortana is trolling me
 
@JanDvorak Great bro, you're screwed?
 
I mean, Hendry's soul
 
@Neoares your first problem is Windows
 
8:39 AM
your first problem is hate
 
@Neoares No, not really.
 
@MadaraUchiha I legitimately used eval yesterday fwiw
 
@royhowie Your first problem is jumping to conclusions
 
I just uninstalled english keyboards, so fixed
 
8:40 AM
I've read that yesterday
 
!!summon 139
 
@Bimper You're saying it as if you're proud of it
 
I have most of that options disabled
 
cap's back?
!!are you alive?
 
!!s/alive/dead
 
8:41 AM
doesn't seem to be like it... darnit
 
@MadaraUchiha I'm not proud, I'm just not lovin' the hate
 
@Bimper can we see the use case?
@JanDvorak can't the same be said of your reply?
 
@Bimper lol? the hate?
The hate is justified, I'll tell you that.
There are no legitimate uses for eval. No one has convinced me otherwise in several years now.
 
webpack in dev-mode is fastest when it uses eval
 
8:44 AM
@MadaraUchiha Used it once for server-side templating - only accessible through admin tools and the admin promises not to screw up.
 
user3119231
@MadaraUchiha scared the shit out of me
 
Boss's requirements
 
@JanDvorak "My boss told me" is not a legitimate use case.
Also, server-side templating has libraries for server-side templating
Very good libraries too
 
@royhowie sure, I built a "learn how to sql inject" playground for a project I'm volunteering in. It's hacked together in 4 hours so lots of "bad" code, but still: benjamingr.github.io/PizzaHack
 
@MadaraUchiha such that you can change the template through web interface and those templates let you do everything the server can?
 
8:46 AM
Goals are: login, login as admin, recover admin password, enumerate search, add your own pizza, find out the schema, etc.
 
@Bimper touché
 
@royhowie Runs SqlJS etc.
 
I've once used eval in a kata. Mathematical expression evaluator. Guarded by a regex.
 
@JanDvorak Yeah, I'd much rather expose an interface to hot editing handlebars templates from a web interface, than I would using evals and allowing the user to perform atrocities with the full power of JS.
 
Pretty cute, let me know what you think about it - hacked it together in an evening.
 
8:47 AM
@Bimper consider including this library
 
@JanDvorak katas and code golfs are exceptions.
 
You also need to remove the pizza that causes an AD in the enumeration. Do not open the devtools too much.\
 
Anything goes :P
 
@MadaraUchiha t'was PHP
 
@JanDvorak All the better, hot edit the PHP files.
 
8:47 AM
@MadaraUchiha fallback for JSON - used by jquery
 
@royhowie why? eval invokes the compiler. It's ez
 
@JanDvorak ...
 
Before IE7 was wiped out
 
If you code for IE7, you hereby have my permission to use eval.
Your life is miserable enough without further restrictions/
 
@MadaraUchiha if you code for IE<9, you hereby have my permission to sepukku yourself
 
8:49 AM
How about if I'm forced to work with and accept a single-quoted or unquoted "JSON"?
 
@JanDvorak I'd build a parser.
It's 5 lines and doesn't expose you to horrible HORRIBLE mitm attacks.
 
@MadaraUchiha Can I see those 5 lines?
 
I wrote such a parser for my current workplace, which allows for JSON with functions in it
 
@JanDvorak is there a max column width?
 
@JanDvorak Hidden behind proprietary I'm afraid. I'll try to whip something up later tonight if you remind me.
 
8:51 AM
Just a gist of it
 
@royhowie Yes I will...
@MadaraUchiha Nothing, just curious.. ^ ^
 
@HendryTanaka You can do something like this, if you use an object
var obj = {
    func1: function() { return 1; },
    func2: function() { return 2; },
    func3: function() { return 3; }
};

console.log(obj["func2"]()); // 2
 
White page showing before app load in android cordova application?

please can any help me how to remove this white page.
 
Of all the issues to have...
"run this script, it works!" scripts end up DDOSING us
 
@JohnSnow 50,000 HTTP requests?
 
8:56 AM
Yup
 
Well, to be fair.... what did you expect? :D
 
My boss deleted my code splitting it up
And he told me to use his script
With 50 000 http requests
 
does anyone has experience with rooting an android smartphone ? I'm curious what the chances could be for bricking it ? A bud of mine asked me what he can do with his one which got bricked. I suppose that the only thing he can do is send it to the manufacturer to repair it ?
 
I was curious to see if he had done some magic to make it work
 
@KarelG Do you know why they call it "bricking" your phone??
Because once you've done it, your phone is a very expensive equivalent to a brick.
 
8:58 AM
@KarelG manufacturer aint gonna do shit :)))
 
yes, but i never had experienced that. :p
 
They might sue you
 
no feedback :/
 
then I guess it should be called "knifing" rather than "bricking" in case of Macbook Air
 
Why knifing?
 
8:59 AM
@MadaraUchiha Just blow my mind. Thanks...
 
"I totally just cardboarded my Macbook Air"
 
If your friend bricked his phone your friend should learn from this valuable experience :D
 
I have all my Android rooted.
 
@MadaraUchiha wtf
 
9:00 AM
@KarelG It's not the video I was going for
 
@MadaraUchiha Marvelous
 
But that works just as well :D
 
still, doesn't cut well ;)
 
But it cuts it
 
You can use a screwdriver as a hammer, doesnt make it. a good idea lol
 
Oh, transparent youtube UI!
 
@Sippy why should these manufacturers sue you for breaking something you have bought ? It's the customer fault, and rooting the phone = voided warranty. So he only have to pay all repair costs
 
user3119231
This shall be enough posts!
 
I don't like Youtube's new UI, BTW
 
You wont hard brick it, unless you screw up the bootloader..
 
9:03 AM
didn't knew they got a new UI... but it's only that transparent menu and autohide
 
@KarelG i dunno? I never bricked a phone, i just know that he might as well buy a new one
 
Nobody likes new YouTube UIs the first week :P
Change is scary.
 
@RoelvanUden It's more modern, but I dislike the fact that it covers the video, rather than go around it.
 
user3119231
new ui? it is the same like weeks before?
 
but this change makes it objectively less compact
@MadaraUchiha but hey, that fancy useless empty black bar at the top is useless and empty, but still fancy
 
9:04 AM
@JanDvorak Yup
I hate UI elements which have absolutely no meaning other than trying to make things prettier.
If it doesn't serve a function, it's useless. If it's useless, it shouldn't be there.
UX 101
 
@MadaraUchiha does your wife wear jewelry?
 
@JanDvorak I have no jewelry on my right hand, no.
 
@JanDvorak protip, wife !== user interface
 
Someone is Fappy Happy
 
9:08 AM
@JanDvorak "No officer, I do not consent to search at my home or vehicle."
 
"tvt ropes dot org" sounds a bit scary
 
@ivarni so does expert sex change dot com.
 
> Since 1943, we have told a consistent story to all who have asked.
 
I need to display the % of progress out of a github repository open/closed issues number. How should I calculate it? Math.floor((open / closed) * 100); doesn't work :S
 
that's not how you calculate out the %
 
9:14 AM
i have this,

<div onclick="showTarget(event);"><span>Ha</span></div>
 
I always want to get target as div, even if they click on span;s "Ha"
 
or maybe Math.floor((open / open+closed) * 100); ?
 
it is ( amount_of_which_you_want_the_% / total amount) * 100
yes, that gives the % open issues
 
Alright, gonna try :D thanks
 
9:16 AM
that's different
 
anyone knows solution to my prob
 
@Frondor read it again
 
the number 2 is taken as 100% (total amount)
 
@Learner You don't. You want the handler context to be, which it is.
 
@JanDvorak what can i do
 
9:17 AM
@Learner bend yourself to conform to the truth
 
@Learner attach the click event on those divs ?
 
@KarelG In that question it doesn't say which number is total, that's why I came here. But that helped a lot! Thank you!
 
@KarelG not doing that already ?
 
@Learner Hold on, let me pull out my magic 8-ball to see if you do
 
just use event.target. There is your div ?
 
9:18 AM
@KarelG that would be the span
Just use this
 
....
reason I need div is because I have a custom data attr attached to it
I will check if it's null then it will be span, and i will get target's parentelement
 
ah yes,
forgot how it behaves
 
@Learner That's... bad
 
@KarelG you don't forget how you drink though...
 
@Learner You can forget how much you drank, though
 
9:21 AM
why we all forget everything but eating, drinking etc... a big question
@JanDvorak well, i got no choice based on my knowledge of freedom
 
not a big question ...
 
@KarelG put it in a box then
 
it's called genetic memory
not going to explain that, you can do the research yourself if you want.
 
without knowing it's name, I can think what it is, but still where it came from ? goes to where this earth came from and soo on... so it's a big question
 
uh, what?
 
9:26 AM
e = e || window.event;
var target = e.target || e.srcElement;
if (target.is("span"))
    target = target.parentElement();
var selectedID = target.getAttribute("data-mid");
 
@Learner ew
What's e?
 
event
onclick='Gov(event);'
 
comn mn
I know i should be using on ("click", fun...)
but for now I want to solve above issue
 
You have jQuery and you use on-attributes????
 
9:30 AM
* picks up cleaner, dirty stuff detected *
 
* sets Karel's cleaner to detect Learner *
 
9:53 AM
O.o
Why doesn't node wait 5s to print 'hi' with this code:
var hi = 'hi';

setTimeout(console.log(hi), 5000);
it appears within the second O.o
 
How would it?
 
isn't it because console.log is being executed immediately?
wait, is that even valid syntax? :s
 
the syntax is valid. You call console.log, which returns undefined, which is then scheduled to not do anything in five seconds
 
But it prints hi O.o
 
function(){console.log("hi")}
use this
 
9:57 AM
So it has to be an anonymous function wrapping it?
 
console.log.bind(null,hi)
 
s/null/console/
 
Oh, wait that was for promises.. delay .. man im sleepy
 
Ah, I see
 
@JohnSnow u did what i said?
 
9:59 AM
*you
 
it only takes a function, it can't take a function with a parameter.
 
@JohnSnow setTimeout accepts a function as the first argument.
 
@JanDvorak u
 
The result of console.log("hi") is undefined.
 
@Neoares wanna kick?
 
9:59 AM
The parameter of the function needs to be in that function's scope
 
?
 

« first day (1753 days earlier)      last day (3196 days later) »