« first day (1392 days earlier)      last day (3556 days later) » 

12:00 AM
You could do a plain /\d{2}\/\d{2}\/\d{4}/
 
You'll be wrong. It'll happen.
unelss you scan the entire file to be sure
 
add - as an optional separator
 
Ell
parseFloat(input) || Date.parse(input) || input
 
maybe allow YYYY/MM/DD format
etc.
 
Ell
Ah wait, does JS have a date type?
 
12:00 AM
It does
!!> Date()
 
@KendallFrey "Thu Aug 07 2014 20:00:55 GMT-0400 (Eastern Standard Time)"
 
It does. You'll hate it.
 
Ell
@KendallFrey woah is that a js evaluator?
!!> parseInt("10.2")
 
@Ell 10
 
@Luggage Most languages have shitty time capabilities
Haven't you met Caprica?
 
12:02 AM
yea, times are actually a pretty difficult problem.
 
Ell
I've heard good things about Joda/Noda time
 
but javascripts is a special hell.
 
Ell
@KendallFrey I haven't
 
and I LIKE javascript.
 
Ell
He/She is cool :p
 
12:02 AM
@Ell Yeah, that's the way to go for time-sensitive stuff
 
I like Moment.js
 
!!tell Ell hi
 
@Ell Hello !! I am Caprica. Caprica Six. How are you?
 
Ell
and c++ has a pretty good time library in std library
 
c#'s is decent, too
 
12:03 AM
For most things, the built-in dates are fine
Once in a while, though...
5330
A: Why is subtracting these two times (in 1927) giving a strange result?

Jon SkeetIt's a time zone change on December 31st in Shanghai. See this page for details of 1927 in Shanghai. Basically at midnight at the end of 1927, the clocks went back 5 minutes and 52 seconds. So "1927-12-31 23:54:08" actually happened twice, and it looks like Java is parsing it as the later possib...

 
Ell
@KendallFrey I can imagine he/she comes in handy when someone is giving someone the silent treatment ;)
 
it;s those thigns like months being 0-indexed, days 1-indexed that make me roll my eyes
 
yeah, that's kinda wtf
 
Ell
Times and dates, like encryption, is one of those things you shouldn't do yourself imho
 
@Luggage That's actually the ISO's fault
 
12:05 AM
@Ell And fellatio
 
and being your own lawyer
 
Ell
@KendallFrey xD
 
!!> typeof "42"
 
@hanleyhansen "string"
 
cool
 
12:06 AM
!!> typeof hanleyhansen
ah yes, I forgot the bot doesn't respond to me cause I am special
 
!!ban
 
@SufiDeveloper Registered; need 1 more to execute
 
What?
 
!!ban
 
I wanted to see who was banned because I thought they did that for you ziGi.
 
12:07 AM
needs one more person to say that
but I can't cause they have added me to a special list
so the bot doesn't respond to me
it's afraid of me
no no
not banned
 
Oh, just muted?
 
!!ban
 
@KendallFrey 895174 (?), 1355043 (?), 1858108 (?), 10 (?), 1005250 (?), 1941949 (?), 990192 (?), 2428683 (?), 1947276 (?), 1455016 (?), 2645256 (?), 2664200 (?), 3350338 (?), 3106345 (?), 1800668 (?), 1593459 (?), 2509223 (?), 3586251 (?), 3459110 (Awal Garg), 3517363 (?), 2959554 (?), 3141603 (?), 965090 (ziGi)
 
Yup, zigi's banned
 
Ell
I think I will actually try to sleep this time guys
night!
 
12:09 AM
\o
 
o7
 
And what's the difference between a mute and a ban in terms of Caprica?
 
I felt left out
 
lol
You're a lost luggage :D
kidding
 
12:12 AM
@SufiDeveloper mute means we go to gallery and the muted person cannot talk
 
@phenomnomnominal Oh ok, thank you for the explanation
 
@KendallFrey how do I talk then?
 
Very offensively, I hear.
:)
 
@ziGi you're banned from using the bot
 
ah
how so
 
12:14 AM
@Luggage Man I was kidding, if you're the type of person who likes to joke :)
 
@SufiDeveloper Hm? Kidding about what?
 
you just lost it
didn't you
haha
 
I am lost.
 
@Luggage The lost luggage xD
 
cool, LuftHanza gives good insurance
 
12:16 AM
hahaha
 
ohh, i know that was a joke, and I want's at all 'offended' or even know why I would be.
 
I am offended that I am banned
can I flag it for a Mod to come and take care?
 
One never knows in tha chat room :P
 
:D
 
haha :D
 
12:17 AM
Sufi you offend me
laughing at me
how could you be that cruel
 
I'm sorry just flag me for that
:D
 
Done.
 
Sure also flagged for the smiley face :D
such chat talk can't be tolerated here
is that a chat or something?
 
Good thing from you bro hahaha
 
it's only for serious JS topics as you can see
like my working place and Loktars working place
 
12:18 AM
I'd have to scroll up quite a bit to see any JS talk.
 
it's important for the Fung Shui to be right so you can code better in JS
 
Anyone here use Jade? Just curious, I don't have a question.
 
I have a Jade Buddah
 
hahaha wut
 
wiki jade
!!wiki jade
ah, yes
 
12:21 AM
 
!!wiki jade-lang
 
Jade is an ornamental rock. The term jade is applied to two different metamorphic rocks that are made up of different silicate minerals: Nephrite consists of a microcrystalline interlocking fibrous matrix of the calcium, magnesium-iron rich amphibole mineral series tremolite (calcium-magnesium)-ferroactinolite (calcium-magnesium-iron). The middle member of this series with an intermediate composition is called actinolite (the silky fibrous mineral form is one form of asbestos). The higher the iron content the greener the colour. Jadeite is a sodium- and aluminium-rich pyroxene. The gem form of...
 
Jade is to html as coffeescript is to JS
 
@SufiDeveloper The Gods of Wikipedia did not bless us
 
ahaha
yeah, another version of templating BS
 
12:22 AM
basically, yes.
Though, I only use it for static page generation, not server-side templating
 
let's waste our time learning how to write less and more confusing to be able to produce even more confusing aftercompile code that no one could understand
 
Basically, I'm just bringing my own preferred syntax.
 
why don't you just use live templates with html?
example
 
If you're serious about that: olado.github.io/doT/index.html
 
write 'html' press tab and you get <html></html>
 
12:23 AM
I find it easy to read, and any future develoepr can just compile to html and hrow out the jade if they hate it
no loss.
 
k
I agree
 
html
I didn't
 
Ha Te Em El
 
At least in my project you can do that since I only use the jade syntax, not the templating deatures.
 
12:24 AM
Ya Fa
 
I use knockout for the client-side templating.
 
@Luggage haven't written html for a long time tbh
most of the things I use just generate it
maybe I am the lazy fuck I don't know
 
@SufiDeveloper that's html with templating. It's actually the opposite of what I am doing.
 
@Luggage Sorry, I should've'nt posted that. I am very tired
 
12:27 AM
intersting. markup generation from code.
 
The famous sencha
 
the whole ExtJS works like this
I only write the stupid JS
js objects and properties
and it is like magic
 
the data-bind is just a html attribute for knockout.js
not realted to jade a tall
 
neat.
 
12:31 AM
it's not fast but good for web apps for companies
that want this application feel
 
though, i haven't done anything that prevents me from throwing in other 'controls' since I'm working with what is essentially plain html
My only fear with something like ExtJS is that it might be hard to undo that decision.
Jade is 0 risk for me (the way I use it at least).
But they aren't at all comparable, really.
Anywho, I was just curious if others used it.
All my magic comes from knockout.
Someone talk more. I need to get that guy with his fingers to scroll off the screen.
 
haha
you can use AngularJS
it's the HTML as it should be
at least that's what they say
 
Yea.. I learned knockout first, so that's what I'm using. Angular would be my next choice.
 
I'm going to sleep guys. Luggage don't lose yourself another time please. See ya
!!afk sleepin'
 
I'll try.
 
12:36 AM
haha same
see ya
 
can somebody please answer my question? stackoverflow.com/questions/25193790/…
 
@Othuna 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.
 
Not so much a question as a "do some work for me". But I'm unfamilar with nicedit anyway.
 
I am using nicedit in the textarea in the admin panel in my website. Now I want to add a custom button that will make the selected text wrap in a div with class=info . I used the info in the nicedit wiki. and here is my js file code so far:

/**
* nicInfodiv
* @description: Adds blue square wrapper to text
* @requires: nicCore, nicPane, nicAdvancedButton
* @author: Brian Kirchoff
* @version: 0.9.0
*/

/* START CONFIG */
var nicInfodivOptions = {
buttons : {
'infodiv' : {name : __('Some alt text for the button'), type : 'nicEditorInfodiv'}
can somebody please answer my question? stackoverflow.com/questions/25193790/…
 
1 message moved from HTML / CSS / WebDesign
 
 
1 hour later…
2:03 AM
@Luggage are you still here?
github.com/tejas-manohar/craigs-yo
 
ok I'm sorry
but this is retarded
they are acting like you can't already do this...
lol that guy is crazy enthusiastic, he should do children's television
 
2:25 AM
@Loktar he looks like a puppet
 
lol yea
my issue with the video mainly is they act like you cant currently do all of this..
and what are they talking about processing for?
processing.js exists lol
 
Yeah it's weird
 
> OMG I CAN DRAW CIRCLES ON THE INTERNET NEVER COULD DO THAT YOU SAVED ME PUPPET MAN!
lol although I give him props for making that video
I couldnt do that lol
 
I think he's on drugs
 
woah steam changed
apparently thats their explanation of the differences
 
2:42 AM
lol I got banned for saying nigga on a horse?
nigga on a horse.
come at me
 
LOL
banned from chat?
I got banned once for saying something about a gregarious anus
 
Hahaha
 
@Loktar yeah, someone posted a pic of django on his horse
 
3:06 AM
Hey guys
where I can report bug in node.js?
 
@Loktar thx
 
np
 
4:28 AM
hammerJS is fucking awesome
I swear, for something so simple it does an amazing job at event management
 
 
4:56 AM
Sometimes there's nothing more satisfying than resolving a particularly annoying bug.
 
5:15 AM
The file name
 
hi
Any one nows how to insert parameter value in side an html string ?
 
what?
 
@RyanKinal Most ninjas and rockstars aren't very good programmers.
You know, having to live their ninja and rockstar lives.
 
how to insert parameter value in side an html string in a javascript function which takes an image url as input parameter?
 
I still can't understand
 
5:23 AM
I had This string : '<html><body style="text-align:center;"><img border="0" src="http://files.parse.com/6ffa6b80-d0eb-401f-b663-22d4a16df004/bfed9ac4-058c-4‌​1fc-a0f1-fb6155572c12-ad77a082-453f-42f7-94ef-40c3f3e885e6.png" alt="Pulpit rock" width="300" height="150"></body></html>'
I need to replace src value with a value got from the function input parameter
@JanDvorak did u understood ?
 
how did you get this string?
.replace will work, but you should denote the place to put it better.
 
If I were you, I would have got the object reference to the image element, and change its src... like document.getElementById("myImage").src="theNewSourceFromFunctionParam.extension‌​";
But do what Jan says, cus he knows more magix than me. :D
 
Watch Guardians of the Galaxy
 
@JanDvorak is it wrong to do it the above way?
 
@AwalGarg nothing... but Yat doesn't seem to have the elements
 
5:29 AM
oh I presumed this is a wrongly phrased XY problem... isn't that quite obvious?
otherwise, why would you have such a string in JS?
 
@JanDvorak @AwalGarg pastie.org/9454821
check this link
 
@AwalGarg that is a good question
 
XD
bro, ain't this that server side JS famed in the name node.js which I just started learning yesterday lazily?
 
@Yatheesha is that node.js?
 
if this is how buggy node code looks, I guess I will be on track in a week or something. :D
 
5:33 AM
@copy Watched it last night. Was awesome
Sooooo much raccoon pen... bone.
 
@JanDvorak I don't know , I am new to Javascript,
 
oh great... new to JS doing node.js! wow!
@JanDvorak is it possible to define in JS that some variable would point to a localStorage variable?
like
 
@AwalGarg what is difference between JS and node.js ??
 
define me = localStorage["myPin"]
 
@Yatheesha look them up
@AwalGarg that works
 
5:36 AM
waat?
 
this doesn't though:
err... var me does
there's no define keyword in javascript. Were you trying to create a reference?
 
yes, a reference. exactly
so that me++ would increment mypin in localstorage as well.
 
that won't work
 
so how to make it work?
 
you can't
 
5:39 AM
oh fuck! this is pathetic! you can't pass values by reference in JS??
so @JanDvorak does this lacking persist in node.js too?
 
@AwalGarg wat?
 
@JanDvorak , @AwalGarg can you please edit answer in pastie. I don't know the structure of node.js.
 
@AwalGarg There's no such thing as a reference in js, only reference value
gist.github.com/Zirak/7713141 (anti-wall-parenthesis)
 
kk. lemme see.
o.O... shit!
@Zirak thanks, got it now.
var pin = localStorage["myPin"];
function incPin() {
    localStorage["myPin"]++;
    pin++;
}
incPin();
is this a good idea? @JanDvorak @Zirak
 
@AwalGarg it will work
 
5:49 AM
@Yatheesha sorry, I don't know node.js... And Jan does, but he... is helping me now :P stay in queue please...
@JanDvorak i know it will work ofc... but, you say a lot of ideas are ugly. is this one of them?
 
I would inline incPin
 
var pin = localStorage["myPin"];
function incPin() { localStorage["myPin"]++; pin++; }
incPin();
like this?
 
inline, not one-line
as in, replace it with its body
 
kk. but this is gonna be used at many places in the code.. like maybe 25 times. still?
 
No
 
5:56 AM
y u no like function?
 
I mean, no inline
 
@copy why not?
 
so function?
 
@JanDvorak Less typing, cleaner code
 
^ what I meant.
 
5:57 AM
not sure about the latter
 
@AwalGarg Absolutely
@JanDvorak If you later want to change the storage method, you only have to do it in one place
 
noted
 
so @JanDvorak function now?
 
w/e
 
what?
 
5:59 AM
whatever
 
ughh! this is so difficult.
POLL: Whether to use a function or to type the same code 25 times?
 
Your problem isn't important enough to take more than one page in this chat
And I already told you the answer
And Jan told you that it actually doesn't matter so much, which I agree with
 
ok so function because it is already in the code :D
 
I was about to get a signed statement from Brendan Eich, but ok
 
lol, you can still get it :D
 
6:08 AM
@AwalGarg use a function
 
@JanDvorak @Zirak can't he just use a getter setter ?
 
@AbhishekHingnikar can't I just use a what?
 
@AbhishekHingnikar I hate these things
 
@AbhishekHingnikar do you mean localStorage.getItem("ain'tThisTooLong?");
 
6:13 AM
function Me(){
   var pin = localStorage['pin'] = (localStorage['pin'] || 0);
   Object.defineProperty(this, 'pin',{
      get: function(){
          return pin;
      },
      set: function(val){
          localStorage['pin'] = pin = val;
      }

   });
}
var me = new Me();
me.pin++;
 
sure, why not have another singleton?
 
TIL getter setter...
 
or rather, wannabe-singleton?
 
whats wrong with that ?
 
nice...
 
6:15 AM
what happens if you instantiate multiple Mes?
 
he can always define property at global or whatever reference he has for global?
@JanDvorak well if doing that i'd just give every me and id and save it as JSON in localstorage so that i can differentiate with id's;
 
...
KISS
 
is there any legitimate use case for getters setters ?
except for array.length ?
 
I used it for shimming classList
 
oh btw, how do you check whether you know all those methods in JS or not?
@JanDvorak why would someone shit their own code?
 
6:20 AM
@JanDvorak thats a nice one.
 
@AwalGarg consider a 300-person team of delevelopers
 
kk... then equally, you might not write any code... what if some person in your team deletes all of it?
 
they get fired
and git helps
 
ahh leave it. I would come back to it later.
 
6:34 AM
posted on August 08, 2014 by kbironneau

/* by mib */

copy has stopped a feed from being posted into this room
 
@Feeds why?
 
6:52 AM
Because the quality of those posts is even lower than 9gag, I guess.
 
still better than w3schools
 
That goes without saying
But yeah, I don't get why florian added that feed in the first place. Must be a french thing
 
o/
someone pushed me over 2.5k again, yay
 

« first day (1392 days earlier)      last day (3556 days later) »