« first day (1174 days earlier)      last day (3781 days later) » 

9:00 PM
I found some cool functionality on a jsfiddle type website...but it seems to be hiding the jquery its using to create the function that it is performing
here is the site/code/function
i want to use this for a site that I am making but cant see the jquery
4
 
I don't think there is any jQuery
It seems to be pure CSS
 
@Skullomania lol
;)
 
And quite brilliant CSS at that
Although flickery on my machine
 
ha
 
fixed it
it was compiled...sad...very sad...and ashamed
 
9:05 PM
There was something to be fixed? The flickering?
 
neither change anything. — Daan Luttik 4 mins ago
:-(
 
i dont get flickering
but I will look in other browsers
 
c'mon @qwertynl...
window.onload = function(){
 
I got a fair bit of flickering; I'm guessing it's because they're trying to animate stuff that CSS doesn't generally animate that well.
 
:(
 
9:06 PM
@PeeHaa whats so funny
 
@RyanKinal I often find the flicker is caused by a animation value that is never initially set
 
@rlemon Could be
 
@PeeHaa What? What did I do?
Cuz I ddnt use attach event or anything?
 
@RyanKinal specifically, I noticed it hardcore when trying to set the height / width of a image element
 
It was a quick example :-P
 
9:07 PM
Yes :)
Kittens die man
 
!!>var a = new Date(); a.setSeconds(a.getSeconds()+8);a.setFullYear(a.getFullYear()-50);((Date.now()-a)‌​/ 1000 / 60 / 60 / 24 / 365.242)
 
@Shmiddty 50.0024638661693
 
:P
 
That should be less than 50
 
@PeeHaa :-P
 
9:08 PM
why is it not less than 50?
 
@qwertynl or you know, move the code to the bottom of the page.
 
@Shmiddty Because Javascript
 
why wait when you can let it execute in the correct order naturally.
 
@rlemon Yea. But I think that would just confuse the OP :-P
Still do not know why it did not work for the OP
 
it is a basic very important concept to learn if you want to work with document s
you know.... how they load..
 
9:09 PM
@qwertynl no, really
 
My guess (and It is a good one) is that you are loading the HTML in after you have loaded the page (ajax?) and therefore the js is not going to do anything. — rlemon 20 secs ago
educated guess
 
Good possibility
 
y u no delegate son?
 
@Shmiddty Because your math is off
 
9:11 PM
... because setting initial value...
 
go on...
 
@RyanKinal setting initial values indicates you know what the hell is going on in the first place.
 
@Shmiddty 365.242?
 
@qwertynl The number of days per year.
 
with jQuery you can just post a SO question and hack your way into a working function
 
9:12 PM
@Shmiddty What are you trying to solve? What is your aim?
 
@rlemon I guess. Unless you don't. Because noob.
 
@qwertynl Number of years, down to the second (or smaller)
 
@Shmiddty doesn't the Date object handle leap years?
I don't think you need to correct for that.
 
@rlemon maybe
 
Also, lolmythesis is starting to annoy me. There are interesting thesis subjects that have absolutely no content available for them.
 
9:13 PM
@Shmiddty ((new Date).getFullYear()) - (a.getFullYear())
 
anyone here wordpress savvy. I got a random question lol
 
For instance, this one made me go "OMG WHAT HOLY CRAP": Well, I basically cured Cystic Fibrosis.
 
@qwertynl That doesn't account for anything more than years.
 
!!>var a = new Date(); a.setSeconds(a.getSeconds()+8);a.setFullYear(a.getFullYear()-50);(((new Date).getFullYear()) - (a.getFullYear()))
 
@qwertynl 50
 
9:14 PM
@Shmiddty That is all you are trying to account for it seems...
 
@qwertynl That answer is wrong.
It should be 49.
 
@Shmiddty Well. jQuery.
@Shmiddty Why? They are off by seconds. Not years. So why should it be 49?
 
who can get the fastest?
 
$(document).ready(function() {
$( ".thumbnailwrap" ).click(function() {
   $(this).find("p").slideToggle( "slow", function() {
       // Animation complete.
   });
});
});
 
9:17 PM
It took you 0.329 seconds to react
 
@RUJordan 0.110 seconds.
 
will that find the child of a class and display its paragraph?
 
it will find any child p for each .thumbnailwrap element
 
hmmm how odd... its not working in wordpress :S
 
link?
 
9:18 PM
one mo
 
wordpress and jquery. What could possible go wrong ;-)
 
@qwertynl If your birthtime is 8 minutes from now, you are not yet "a year older"
what are you struggling with here?
 
@qwertynl did you seriosuly get .110 seconds?
That's a wicked reaction time
 
@RUJordan lol I just kept clicking until the message came up
 
Oh :P
do it for real
 
9:19 PM
In semi related news. OMFG github.com/phil-brown/droidQuery
 
@Shmiddty Time And Relative Dimension In Space.
 
I'm too lazy to add a cheater check for spam clicking xD
It took you 0.010 seconds to react
too easy to cheat :D
 
@RUJordan Now I got it in 0.000 seconds :-)
 
IMPOSSIBRU
 
Should have gotten a SC... one sec ill try again.
 
9:21 PM
@Shmiddty because a.getFullYear will still return the same year.
you are only comparing years at the end.
a.getFullYear() === 1964
(new Date).getFullYear() === 2014
 
I'm not calling getFullYear
 
ahh I was looking at the wrong code
 
Math.floor((today-this.birthday) / 1000 / 60 / 60 / 24 / 365.242);
 
@KirstyHarris The DOM elements are not loaded yet
 
9:23 PM
@KirstyHarris really..
REALLY
<div class="thumbnailwrapper">
	<div class="thumbnailwrap">


<div class="titlewrap"><a href="http://www.milknhny.co.uk/bob/">Bob</a></div>


	</div>
		</div>
THERE IS NO p HERE!!!!
 
lol
 
Ca'Maaan!!!!
 
oh haha... ARGH lol
sorry slack fuck.. it was annoying me, as it was showing EVERY title!
 
lol
pfft, it is totally the JS. you can't screw up HTML!
 
bd = new Date("1988-06-04")
console.log((Date.now()-bd)/ 1000 / 60 / 60 / 24 / 365.242)
Works for me @Shmiddty
returns 25.582741529043552
 
9:24 PM
lol! honestly.. its my bad.. been a loooong ass day
yay! working :D ta @rlemon... knew your a dab hand at noticing my feck up
 
!!> (Date.now() - new Date("1970-01-02T14:30:00-07:00"))/864e5/365.242
 
@Shmiddty 60.58994299732955
 
@KirstyHarris nice pixel fonts
 
dab hand?
 
its silkscreen @nderscore x
 
9:26 PM
@Shmiddty 44.000957733921005
 
@rlemon Yes?
 
sorry english slang, means hes pretty good lol
 
should be 43 until 2:30PM
 
nderscore, if u want will email it you
 
which english? lol american or british?
(I'm guessing british?)
 
9:27 PM
british lol
 
British
 
hmmmf ran out of taboo
 
u wot m8?
 
@KirstyHarris I'm aware of it. Haven't used it in many many years. It hit me with a bit of nostalgia.
 
lol! :)
i dont realise my stupid comments at times XD
 
9:28 PM
-9
Q: Alternative Power, connecting 3 power sources

user246666How can I connect solar Panels to a water wheel and a wind turbine without blowing myself up?

lol
 
argh... no taboo, and ginger pussy taking home on ones chest... shit... i will walk with him to the kitchen... need top up
 
I almost want to upvote that
what on earth did I just read?
 
I know ginger puss! she is great on /r/gonewild
 
@KirstyHarris Here's some more if you ever need different sized pixel fonts: dsg4.com/04/extra/bitmap/index.html
 
OOOOOOOOOOOOOO
 
9:30 PM
@rlemon /r/gonewild? (Do I even want to know?)
 
probably :P
disclaimer: it is porn.
 
i like those! @nderscore! thanks! bookmarked
 
THIS IS THE PERFECT FUCKING SITUAtiON WHERE !> spoiler WOULD HAVE COME IN HANDY
 
I JUST realized how funny this is.
 
@KendallFrey
 
9:31 PM
yep i have a ginger pussy called george, he likes boobs and is fast asleep... and i have no taboo,.... speaking on random @rlemon you would be proud of me, ... i started back up code academy today on the js side. :)
 
cool
 
user1596138
 
I just started to appreciate SCSS and HAML
 
yea,... its kinda sinking in!
 
user1596138
 
9:31 PM
in a fashion
 
user1596138
The reply. Haha. He was being totally serious and then THAT was the reply.
 
gosh that took all my brain cells just to digest
 
SCSS is the CSS where it uses variables, right?
(more or less)
 
user1596138
That's $answer
 
@RUJordan one of many pre-processed css solutions available.
 
user1596138
9:33 PM
I think I'll just start answering vamps with "$answer"
 
I used to use LESS but am beginning to see the light of SASS/SCSS
 
user1596138
(Not that you're a vamp!)
 
SASS that's the one I used. My co-worker showed it to me and I was kinda blown away
 
it is fun / useful
HAML on the other hand is nice because I fucking hate writing HTML
 
ooohhh
 
9:34 PM
Person.prototype.getAge = function () {
    var today = new Date(),
        years = today.getFullYear() - this.birthday.getFullYear(),
        months = today.getMonth() - this.birthday.getMonth(),
        days = today.getDate() - this.birthday.getDate(),
        hours = today.getHours() - this.birthday.getHours(),
        minutes = today.getMinutes() - this.birthday.getMinutes(),
        seconds = today.getSeconds() - this.birthday.getSeconds();

    if (months < 0 || days < 0 || hours < 0 || minutes < 0 || seconds < 0){
 
^ that is stupid, but it works.
 
@rlemon
 
@RUJordan what?
 
It died real freaking quick in here
 
9:38 PM
@Shmiddty I DISAGREE
 
didnt it!
 
With what?
 
@KendallFrey read the post above the ping. Wasn't it you who wanted the !> spoiler in chat?
 
What your arrow is pointing at ;-)
 
Kitties are real real dumb
but they don't work
 
9:40 PM
lol,... hes gorgeous!
 
@Shmiddty how about...
Person.prototype.getAge = function(){
    var today = new Date(),
        years = today.getFullYear() - this.birthday.getFullYear(),
        things = ['getMonth', 'getDate', 'getHours', 'getMinutes', 'getSeconds'];
    for(var i = 0; i < things.length; i++){
        if(today[things[i]]() - this.birthday[things[i]]() < 0){
            years--;
            break;
        }
    }
    return years;
};
 
Anyway. Heading out for the day. Later folks.
 
Later brah
 
!!afk food, code, games, sleep
 
@RyanKinal Just go already!
 
9:41 PM
@RUJordan Yes, it was.
 
@nderscore better... ;)
what are the parens for though?
oh nvm
 
11 mins ago, by RUJordan
THIS IS THE PERFECT FUCKING SITUAtiON WHERE !> spoiler WOULD HAVE COME IN HANDY
 
function getAge( start, end ) {
  var one_day=1000*60*60*24;
  var date1_ms = start.getTime();
  var date2_ms = end.getTime();
  var difference_ms = date2_ms - date1_ms;
  return Math.round(difference_ms/one_day) / 365;
}
gives me my accurate age.
 
!!> (new Date().getTime() - new Date("1970-01-02T15:00:00-07:00").getTime())/864e5/365.242
 
@Shmiddty 44.00093331086979
 
9:44 PM
nope.
 
function getAge( birthday ) {
  var one_day=1000*60*60*24;
  var date1_ms = birthday.getTime();
  var date2_ms = Date.now();
  var difference_ms = date2_ms - date1_ms;
  return Math.round(difference_ms/one_day) / 365.242;
}
var bday = new Date(1986, 9, 5);
console.log(getAge(bday));
// 27.24768783436735
^ I mean... that is my age.
 
make the bday be an hour from now
or a few minutes from now
 
22.363255047338477 for me
 
well as you can see I only check on days there @Shmiddty
Math.round(difference_ms/one_day)
 
so i have a function that i need to run multiple times. in it i return a object with a success key. my success key is bound to a function that i want to run to determine success. currently to stay in line with how the rest work the outer function just returns the object with the success key. should i move the logic out of the success key function and just set a flag
 
9:47 PM
how accurate do you want it?
 
@rlemon Down to the second, as I first stated. :P
 
user1596138
@KirstyHarris Nice pussy.
 
user1596138
!!afk time to go home
 
@Jhawins Why are you leaving me!?
 
I think leap years are throwing it off.
 
9:47 PM
awww ta @Jhawins
 
and floating point arithmetic.
!!afk cancersticksinmymouth
 
@Shmiddty Just go already!
 
The things I would do for a cig right now
 
puffs away on his personal electronic nicotine inhalation system
mmm... raspberry tea and lychee flavor
 
user1596138
@nderscore YOU!!
 
9:50 PM
@Jhawins You saw that whore again, didn't you!?
 
user1596138
Yeah but shutup I'm busy
 
user1596138
@nderscore I'd like to ask you your opinion on some of them. We talked the one time and all. But I have to go home, so maybe another time.
 
feel free to shoot me questions: _ [at] nderscore.com
 
Date.prototype.isLeapYear = function(utc) {
    var y = utc ? this.getUTCFullYear() : this.getFullYear();
    return !(y % 4) && (y % 100) || !(y % 400);
};
 
Anyone who took my interview trial thanks, it's working well.
I need to think of a second test idea now, any suggestions are welcome.
 
9:59 PM
@BenjaminGruenbaum Hmmm Make a quick guessing game?
 
I think my stomach just meow'd
 
Wait. Does it have to do with stocks @BenjaminGruenbaum ?
 
@qwertynl guessing gtame?
@qwertynl no, anything.
Something to test web development.
 
@BenjaminGruenbaum Yea. Like hangman?
 
Should not be too hard, kind of like the first one.
 
10:00 PM
hangman should be quite easy... no?
 
can I ask question here? sorry first time on chat...:-)
 
!!welcome kasper
 
!!welcome kasperTaeymans
 
@kasper 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.
@kasperTaeymans 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.
 
JINX!
 
10:00 PM
lol
 
I'm building a javascript application where the user can validate urls (through an ajax call). The validation is done server side (php) by doing a head request for every url (curl). The server responds (to the client) with json containing info about the url. this json data is used to update the view. for example the user inputs 100 urls... should I do 100 separate post/get requests OR split it in let's say 20 requests dealing with 5 urls OR post all 100 urls at once?
 
I was thinking of a very basic promises library implementation - is that too hard?
 
@BenjaminGruenbaum For example? a queue? or animation queue?
 
@kasperTaeymans this depends on user experience you want? It's a tradeoff.
I'd probably do it on all 100 if it's an internet thing and for every one if it's intranet.
@qwertynl yeah, an asynchronous queue is a good idea too, I'm just scared it's too hard.
 
mmm I have a look at the asynchronous queue thing first.
 
10:03 PM
11
A: Semaphore-like queue in javascript?

NealHere is a nice Queue class you can use without the use of timeouts: var Queue = (function () { Queue.prototype.autorun = true; Queue.prototype.running = false; Queue.prototype.queue = []; function Queue(autorun) { if (typeof autorun !== "undefined") { this.a...

Quick google search
 
@qwertynl yeah I wrote half of that when neal was here :P
Note my comments there too
 
Too easy to find though, no?
 
this is on-site.
Also it's rather bad :P
 
Ahh. so no internet allowed this time?
@kasperTaeymans We were not talking abt ur case silly
I just thought of the perfect test.
 
:-) yes but it is helpful though
 
10:06 PM
They need to create a clock that will tick at specific intervals given by the user (the clock can look like how ever they want with as much animation as they want or just pure text) but it has to autoupdate based on user input
So if I enter 33 it would have to update every 33 seconds and if in the middle of the 33 seconds i change it to 5 it would have to change accordingly, etc
Is that good @BenjaminGruenbaum ?
 
iirc.
TOO EASY.
 
ha
Well 1st you said too hard :-P
Hmmm
I still think a quick small game would be hard enough to be easy :-) @BenjaminGruenbaum
like black jack or dice.
 
@qwertynl head home soon! mta is shutting down express subway service at 545 alert.mta.info/status/subway/ACE/23145004
 
@qwertynl a queue sounds nice actually.
 
@nderscore shiiite thanks!
 
10:09 PM
lemme make one real quick see how long it takes without looking
 
night guys :)
 
night bro
 
@nderscore night
@BenjaminGruenbaum Well let me know your progress on the morrow. I need to leave very soon based on @nderscore 's message :-Z
 
I'm pretty much done. That was easy.
 
10:11 PM
@BenjaminGruenbaum too easy?
 
Not sure. Maybe I'll ask for this and an event emitter.
 
faaancy
 
Only in NY: "impending weather"
 
Where is this job? :-)
 
@SomeKittens There goes the neighbourhood.
 
10:12 PM
Israel
 
@BenjaminGruenbaum Boo. Can it be in NY instead? :-)
 
-6
Q: simplifying the javascript code

user3147521How can we simplify the below code document.getElementById('overlay').onclick=function() { $('overlay').hide(); $('#wrap').hide(); }; document.getElementById('close').onclick=function() { $('#overlay').hide(); $('#wrap').hide(); }; document.getElementById('close').onclick=f...

 
event emitter, asynchronous queue, and what third pattern do we want here?
 
@BenjaminGruenbaum Module? Objects? prototyping?
 
there's nothing to implement. I was thinking DIC but that's too hard
2
I'm looking for something to implement, not language concepts :P
 
10:14 PM
@BenjaminGruenbaum DIC?
I have not heard that term
 
dependency injection container
 
ahh ok. got it :-)
Good night people!
 
user1125394
10:28 PM
is there a quick way in Js to generate [{prop:null},{prop:{foo:1}}] where prop is variable?
 
I don't understand your question?
 
user1125394
!!s/generate/create/
 
@ctrl is there a quick way in Js to create [{prop:null},{prop:{foo:1}}] where prop is variable? (source)
 
Like, you want prop to be some arbitrary string?
 
user1125394
other than var a1 = {}; a1[prop]=null; var a2={};a2[prop]={foo:1}; [a1,a2]
 
10:33 PM
Son of a bitch I didn't know hitting escape erased the textbox contents..
 
user1125394
@Retsam yep, but prop will be taking values from a list
 
@ctrl What you have there is probably the best you're going to get... though I don't particularly get why you'd want to store the property name in a variable
 
user1125394
@Retsam it's a format for a db driver (mongo)
 
0
Q: javscript: does valueOf always override toString?

user3124390Is there any expression where by an object's toString method is implicitly called overriding its valueOf method? In the examples below, valueOf is always called implicitly (overriding toString). "4" + { toString: function () { return "4"; }, valueOf: function () { r...

 
Ah; I've never used mongo
 
user1125394
10:38 PM
!!> var prop='test'; eval('[{'+prop+':null}]')
 
@ctrl [{"test":null}]
 
Id' avoid eval; the first solution is better than using eval.
 
user1125394
nah jk probably do some constructors
 
This might be the dumbest question ever, but is there a viewable source code for javascript?
 
@RUJordan Yes. There's the spec, as well as open-source engines (i.e. V8) that implement it
 
10:50 PM
Welcome back, and thanks. Is the source technically javascript or is JS implemented by another language?
 
spec: http://www.ecma-international.org/ecma-262/5.1/
V8 (Chrome): https://code.google.com/p/v8/
SpiderMonkey (FF): https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
Usually C/C++ for speed
 
Whoa, that's like a legal document documentation
 
If you want to understand the internals the spec is probably a better choice.
 
Go head ECMA-International
 
It's pretty easy to read and understand
 
10:54 PM
> Invoking a constructor without using new has consequences that depend on the constructor. For example, Date() produces a string representation of the current date and time rather than an object.
I kind of feel this is bad design; I remember being really confused by that...
 
@SomeKittens @ThiefMaster thanks :)
 
No problem. Yay for folks getting better at JS!
 
Here's another interesting one.. Can you use a variable as a condition? (safely)? Take into consideration..
var derp = "1 > 0";
if (eval(derp)) console.log("herp"); //logs herp because true
Is there a way to do that safely?
 
no, there is no clean way to do that
why do you need it?
 
Just wondering -- I've always wondered f you could do dynamic conditions like that
 
11:07 PM
that's like if('false') { /* will be executed because the string is truthy */ } Technically possible but I'll stab you
 
@RUJordan You could first parse it I guess. But you probably really don´t want to do it +'
 
I would never use eval (that was literally the first time I used it), it just kinda floated in my head how dynamic conditional statements could be
I wish there was an easy way to have say a dynamic operator
 
I just saw that DIC is too hard.
 
@Shmiddty You've got some balls, coming back here after what you did.
 
How often would you need it? @RUJordan
 
11:11 PM
@PeeHaa I could have used it a while back when I wrote a crafting engine for a game
 
Want some real fun with dynamism? window[prompt('gimme a function')]()
 
But nawhp, had to write a monster switch statement
 
hehe
 
welp, home time
 
@RUJordan Why are you leaving me!?
 
11:14 PM
!!afk train chasing in the snow
I JUST SAID WHY
 
user1125394
well damn sometimes function signature matching would be useful
 
user1125394
I don't want to put an if in the function
 
11:25 PM
If I poop with the door open my cats insist on coming in and watching....
 
As long as they don't start licking or scratching your balls...
 
meow
 
sour
@ThiefMaster no but the one always wants pets.. I can imagine this going through his head:
> Yissss... master has pants down, if I sit in them he cannot get away and must pet me
 
11:42 PM
@rlemon I had mine try to jump on my lap. With her claws.
 
m59
If anyone knows about crypto-js - I did this var hash = CryptoJS.HmacSHA512(jsonStr, secret); and get an object.
I was expecting a string, such as what php would create with hash_hmac
 
    var hash = CryptoJS.SHA256("Message");

    alert(hash.toString(CryptoJS.enc.Base64)); // L3dmip37+NWEi57rSnFFypTG7ZI25Kdz9tyvpRMrL5E=

    alert(hash.toString(CryptoJS.enc.Latin1)); // /wf��ûøÕ���ëJqEÊ�Æí�6ä§söܯ¥+/�

    alert(hash.toString(CryptoJS.enc.Hex)); // 2f77668a9dfbf8d5848b9eeb4a7145ca94c6ed9236e4a773f6dcafa5132b2f91
docs, getting started guide ^^
 
m59
I read all the docs =D
I couldn't wrap my head around what that was doing.
I still can't heh.
 
log the object
inspect it and see what it contains
 
m59
11:57 PM
Did they extend the toString()?
Right, that's why I don't see how toString() is returning what I want it to.
 
user1125394
 
user1125394
> See environ(7).
 
user1125394
they could say fuck off as well
 

« first day (1174 days earlier)      last day (3781 days later) »