« first day (1294 days earlier)      last day (3876 days later) » 

16:00
Is there a quick way to convert "2014-04-26 00:00:00.0" to UTC?
@jbolanos What is it, if not UTC?
Date should be able to parse it
@jbolanos "2014-04-26 00:00:00.0".slice(0,10)
keep getting back NaN
from...
!!>new Date("2014-04-26 00:00:00.0".replace(' ','T'))
16:02
@Shmiddty null
@Shmiddty "2014-04-26T04:00:00.000Z"
Date.UTC("2014-04-26 00:00:00.0".slice(0,10));
guys
May I suggest moment.js?
guys I found gold
guys look at this gold
my mistake
16:04
-1
Q: JQuery onClick.text not working

user3585563I dont Understand why this will not work. What it is suppose to do is add the text if(checkAlt(event)) in front of all of the current onClick. It will not even alert because of the .text for some reason. jQuery( document ).ready(function(){ $('.btn-primary').click(function(e){ var te...

Date.parse("2014-04-26 00:00:00.0".slice(0,10));
works
I've never seen anybody try and set the text of the onclick attr() before
@jbolanos I was messing with you. That'll only give you the date part.
@rlemon sorry, my internet dropped dead
@Shmiddty The date is all I care about - I'm sending the resulting UTC to highcharts which then displays them at 23-MAY-2014
16:07
Interesting: See the earth from the spaceship ustream.tv/channel/iss-hdev-payload
16:18
@RUJordan Oh dear lord
hello again. being that everything exists, why does this string templateText.replace(/<TS>/g,monthYear); fails to replace the word <TS> with the supposed value ?
replace doesn't change templateText, you need to do templateText = templateText.replace(...)
oooh, that explains it :)
thanks @Zirak you're my hero ;D
how can i get the total data transferred on an HTTP request?
@MoshMage The bar to being a hero is very low these days.
@Bubbas What do you want? Total packet size, or just the body? Of which part - request or response?
If it's the request's body, then you already have it (you're the one sending it). If it's the response, it's xhr.responseText.length
16:29
Well Total packet size might help me because I want to know the impact my app has on a user's data usage (like with their data plan from their carrier ya know)
How would i do that?
@Zirak it happens when you save someone - you just did that to me ^^
Response will be useful too tho so thanks on that
You can't really know that with js. Use something like Wireshark. It's an amazing tool to have anyway.
ah ok
i mean, how much overheard is there really anyway in an HTTP request?
if i know request body and response body, thats accounting for MOSt of it right?
@MoshMage eh, after a while of not getting it, you probably would've gone to the documentation (right?)
@Bubbas You're forgetting headers. Cookies can sometimes grow in size,
On second thought, you can see all this with the browser's dev tools - Chrome's and Firefox's for sure.
Open up the network tab, I think you see the sizes.
You'll have to live with the TCP overhead :P
16:33
Right - I want to capture these numbers and send them to my DB for storage tho
hrm, I don't know about the request headers, since it's a bit browser specific, but you can get all the response headers (surprisingly, with xhr.getAllResponseHeaders)
ok, well that gets me a step in the right direction
thnx
But do a few manual checks first, see if you care about anything other than the body...which you also control in the server, who can see both the request and response.
So why not do it on the server?
You have all the info you need there.
@Anand 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.
0
Q: Returning a $promise from two resource calls in AngularJS to delay route change

PeteUse Case Using a route provider, returning a $promise in the resolve will avoid the data popping up after the UI has loaded. However, I'm having trouble processing two different resource calls and returning it as a single array. Current Implementation The current implementation works, but requ...

16:38
How to load (in html) a js file only if its not ie ? I tried, its not working properly (its not loading in firefox) <!--[if (!IE)]> <script...></script> <!--<![endif]>
@Zirak INORITE
@Anand why would you hinder IE like that? It has enough problems already :(
@Anand do a javascript check for the useragent
@Anand That's not how a conditional comment should look
@RUJordan lol
I want to share a tool created by me for testing the website responsivity: github.com/IonicaBizau/IsRespo For live demo click here.
16:40
<!--[if !IE]> -->
something
<!-- <![endif]-->
Something like that.
@u mean an extra brack is unnecesary?
@ru
@RUJordan* I'm trying to load a different version of jquery for ie (since 2.x is not supported)
or you know what.. I can just load the old version on every browser! what was I thinking.. thanks guys!
People have a tendency to ignore me when I tell them they're doing something wrong, and someone else tells them something different.
Actually, remove the conditional on that.
@Zirak: Sorry buddy, will not ignore you :)
It's too late! The damage has been done ;-;
lol
16:45
HAPPY BIRTHDAY @m59!
anyone else getting emails from recruiters at LinkedIn?
@jbolanos daily.
they always want to go out to lunch too
@JimmyBreck-McKye You have an issue with my answer?
Happy @m59 Birthday
@Loktar Ok - didn't know if they were actually hiring or just pandering for resume (since my resume is on linkedin and I assume linkedin recruiters can see it)
16:49
@jbolanos some of them carpet bomb everyone
@jbolanos They want to to apply for their job
@Loktar I've met with them a couple of times already but every few months it starts all over like they've never met me before
haha yeah same here, thats why I dont meet with them anymore
when I need a job they are still happy to help
I dunno, I've been thinking about taking @BenjaminGruenbaum's advice and start interviewing more.
definitely do that :D
16:54
Though it'd be kind of weird in my position (only been with current company 7 months)
2 months short of having a company baby.
It's the longest I've ever worked for someone!
@SomeKittensUx2666 not at all
@BenjaminGruenbaum From my experience, the #1 question will be "Why are you leaving your current job" and I'm not sure how to answer that.
"Oh, I'm just interviewing here because some guy on the internet told me to"
I actually had a really good opportunity and blew it.
I'm not leaving, I'm very happy with my job and I'm teaching and learning a lot. I'm here because I'm always interested in exploring new opportunities, learning about new options and getting to know what cool companies are doing.
16:58
Aren't you worried you're going to physically assault some of them because they do $(this).attr('id') or something?
...they won't kick you out?
Hi, if I want to create a web site that only uses JS, HTML and CSS, what type of project should I create on Eclipse? Will I need a tomcat ?
oh, interviewing in that direction
I never lie, neither to my employer or when I interview.
@Elfayer you should not use eclipse.
16:59
At that point I'd be mad at the interviewee for wasting my time
@SomeKittensUx2666 not really, they're not wasting your time.
@Elfayer Eclipse is the wrong tool for that.
@Elfayer Don't worry, you will not need to buy an airplane.
I tell them straight up that I'm happily employed but I'm always interested in new and exciting options.
It's not that your situation is bad, you're doing well, but you're interested in it being even better, and possibly you can do that for eachother.
@SomeKittensUx2666 lol dude
I interviewed after 6 weeks
17:00
What should I use ? Notepad++ ?
Emacs
Sublime, Vim, Textmate, Coda, ...
Try a few, see which one you like.
I interview all the time and I have quite a lot invested in TipRanks, the chances of leaving are very very very slim at this point.
Ok, I see =P So I have another question : How can I read a file in JS (jQuery) ?
You don't
17:02
I'm always honest about that, I'm not wasting their time if they can make it worth that while for me. Good developers are extremely hard to find, and getting to interview one is a good position for them.
@Zirak I saw $.get in jQuery
That's not reading a file, that's making an HTTP request
@Zirak I saw that i could get data from a server file. (Which is for sure in the server side because it's not loaded by the user)
*using that
See previous message
' '
17:06
isn't it the same behavior after all it's getting the content of a file^^
@Elfayer not really
Not at all. Who says your server just statically serves files?
The server is reading the file and sending you the content
You can have a call to foo/bar when there's no directory foo or a file bar
Ok, so how am I suppose to do that?
17:08
Start by learning how the web works, then googling for an html tutorial.
Make a few static pages, and then google about server-side technologies.
@Zirak But people usually learn jQuery before html and http ;S
People are idiots
-4
Q: JQuery onClick.text not working

user3585563I dont Understand why this will not work. What it is suppose to do is add the text if(checkAlt(event)) in front of all of the current onClick. It will not even alert because of the .text for some reason. jQuery( document ).ready(function(){ $('.btn-primary').click(function(e){ var te...

That's not knowing how anything works
Oh my jesus christ :O
17:11
@BenjaminGruenbaum no worries
@Zirak I want to write MD5 codes in a file and the user must not have access to it. So the file must be in the server side (I'll need a tomcat I guess?), How can I get this file content using javascript ?
went to lunch anyway
think better when not hungry
@Elfayer See, if you knew how the web worked, you would've known that's impossible.
@Zirak I have been doing web for 6 months I just don't get that, I never created a project from the begining.
Accessing something on the server is accessing it. It's an http request, no matter who makes it.
17:12
@Zirak I'm a dev app basically.
@Elfayer you're not very UI Friendly
I came here and there was 69 messages to read. what I did there.
Furthermore, when you make an http request with js, it's still just downloading something from the server - for js to access it, the user must access it.
@Connor not in web ^^
tit ;)
17:13
$Cthulhu.get('file.txt', function( error, data ) {
  if( error ) console.error('Tony the Pony','He Comes');

  alert( data );
});
alert should be removed from javascript
Cthulhu will alert if it pleases him
or DOM
@Loktar Heh, nice
@Zirak Even if I use .htaccess ? =)
17:15
An http request is an http request is an http request
@SomeKittensUx2666 I hated the job though the CEO was a douche
but honestly no one even questioned it
There's no difference between your browser and netcat and js and someone writing raw bytes on the wire.
Yeah, same reason I left my last job - everyone asked me about it
as long as you have proven exp and not a track record of skipping around a lot meh.
@Loktar Currently I have a track record of skipping around a lot
17:15
There might be jQuery plugin to make write-stream
haha well then idk
think it's joker.js
20 mins ago, by SomeKittens Ux2666
It's the longest I've ever worked for someone!
Ihave to say this. Where I'm crrently working the dude who made html managed to put a TABLE inside a TABLE; If Xzibit was here he'd say the dude likes tabes!
how many jobs have you had though? Over how many years?
17:17
!!define resposivity
idk if recruiters are still actively seeking you for jobs it must not look that bad for you
Object {} /define result
master.min.js (line 29)
TypeError: a is undefined


...dify:function(a){a=a.replace("\t","    ").split(/[\r\n]/g);return 1===a.length?"...
@Zirak ^
The fuck is a
I'll check it out later
@Loktar Three jobs and a failed startup in two years
@Zirak undefined
17:18
Thanks Captain Complexity
@Zirak Ok, I get it, so I'll have to do a GET request using ajax to a java method that will return the file content, is that it ?
I don't care what you do or how you do it. Just remember this very, VERY important rule: If the browser can do it, if javascript can do it, the user can do it.
And if the browser and user can't do it, Chuck Norris can.
@adeneo Eh, I doubt Chuck knows what AJAX is beyond the soap.
17:28
There will be no dissing Chuck here, Jon Skeet taught him everything he knows.
I've got 50 years experience with SOAP, wife still insists it's not enough
SOAP is too misogynistic, we should invent the TAMPON protocol for use with C+=
user1596138
My two day problem was a one-liner :(/:D
user1596138
Fuckin PHP
What's wrong?
user1596138
17:30
Actually debugging with breakpoints I realized I didn't even know what the script was doing
user1596138
I was like... Why the fuck isn't this breakpoint triggered?? And then I thought Eclipse was borked. But nope. Just wasn't getting it
user1596138
PHP code written by a crappy developer probs
Yeah, who wrote this anyway!?
$ git blame
....nevermind
user1596138
Me ha
woo hoo photoresistor works on the arduino
user1596138
17:36
But I managed to speed up the entire application to the point where there isn't noticeable lag between requests. There's just so much going on and I really didn't know what I was doing when I wrote half of it.
!!s/half of//
Always a good sign
@SomeKittensUx2666 But I managed to speed up the entire application to the point where there isn't noticeable lag between requests. There's just so much going on and I really didn't know what I was doing when I wrote it. (source)
user1596138
But now that it's been time for expansions I'm seeing the beauty of thinking for the future
user1596138
The quickest to think of way takes 1/4 the time but then you have to re-write it 4 times dammit
user1596138
17:39
It's hard with PHP though hahaha
@NathanK 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.
17:50
Is it possible to pass parameters between chained events in jQuery?
@BryanRoth elaborate
If I'm thinking what you're thinking, then probably not, without hard work
radioButtons.on("mousedown", function() {
    var previousRadioButton = $("input[name$='RadioButtonGroup']:radio:checked");
}).on("mouseup", function(previousRadioButton) {
        $("input[name$='RadioButtonGroup']:radio").is(':checked', false);
        $(this).is(':checked', true);

        // use previousRadioButton here
    });
@rlemon hi :)
you summoned me
yay!
I did indeedy
17:53
ctrl + k for format code...
@BryanRoth put the var outside the function like this
var previousRadioButton = null;

radioButtons.on("mousedown", function() {
   previousRadioButton = $("input[name$='RadioButtonGroup']:radio:checked");
}).on("mouseup", function(previousRadioButton) {
   $("input[name$='RadioButtonGroup']:radio").is(':checked', false);
   $(this).is(':checked', true);

   // use previousRadioButton here
});'
I'm just today starting to think about / use promises
@BenjaminGruenbaum and @Florian got me this far
don't call promisifyAll at runtime
@Esailija ok
I had it as promisify()
neither worked.
17:55
you shouldn't call promisify/promisifyAll at runtime
they create new Functions
The polyfill for Promise is huge, why? promises are simple....
so how would I handle this?
call Promise.promisifyAll(require("pg").Client.prototype))
at top level
.Client
ahh, any reason why I have to specify that?
promises are for goobers
17:56
here's the promisification tutorial
there I said it
@Connor Thanks. Let me give that a try.
var Promise = require('bluebird');
Promise.longStackTraces();
var pg = Promise.promisifyAll(require('pg').Client.prototype);

module.exports.getSubscribers = function() {
	return pg.connectAsync(connString).bind({}).then(function(client, done) {
		this.done = done;
		return client.queryAsync('SELECT * FROM subscribers');
	}).then(function(res) {
		this.done();
		return res;
	}).finally(function() {
		pg.end();
	});
};
@rlemon that's not in master branch so hard to find (it will come in 2.0)
17:57
@Connor Famous last words before trying to implement one, diving into madness, alcoholism and eventual suicide.
like this?
@BryanRoth - one has to wonder why you're not just using the change event ?
@rlemon now you can call your code promiscuous
@rlemon I need to check out pg
@adeneo I'm basically trying to determine which radio button was previously selected after checking a radio button in a radio button group.
17:58
@Esailija okay thanks, i'll read that page you sent me and see if it helps
@Esailija Yes you do.
@Zirak have you seen the polyfill?
@rlemon Didn't know about longStackTraces(), I'm using that!
meh, I give a fuck and a half about it
17:59
@AlexB 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.
var Promise = require('bluebird');
Promise.longStackTraces();
var pg = require("pg");
Promise.promisifyAll(pg);
Promise.promisifyAll(pg.Client.prototype);

module.exports.getSubscribers = function() {
    return pg.connectAsync(connString).bind({}).then(function(client, close) {
        this.close = close;
        return client.queryAsync('SELECT * FROM subscribers');
    }).then(function(res) {
        return res;
    }).finally(function() {
        this.close();
    });
};
@rlemon try like that
@BryanRoth
    var previous = null;

    radioButtons.on('change', function() {

        // do stuff with previous here

        if (this.checked) previous = this;
    });
@Esailija kk reviewing

« first day (1294 days earlier)      last day (3876 days later) »