« first day (984 days earlier)      last day (3971 days later) » 

6:11 AM
@arifnpm 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.
 
@Neal I guess it'll be a WP plugin you'll have to write. That plugin will use the StackExchange API to get the required data. Of course you'd need to add an extra field to the user, where he can enter his SO user id.
1 message moved to bin
@Fasilkk If you have to post code, please format it using Ctrl + K.
 
 
user1125394
polar plot are not that good to represent time ..
 
6:29 AM
Questions now can be "put on hold" (see stackoverflow.com/questions/17298819/… if you're over 10k) ? What's the difference with "closed" ?
Damn.... "put on hold" seems to have replaced "closed" for all questions...
 
Jay Hanlon on June 25, 2013

It pains me when I hear people say that our sites are unfriendly, or that we chase new users away. But it’s a hard problem, because our highest priority has always been the quality of content on our sites.  And it still is. We can’t lower our standards. We won’t.

But we have been working hard to make our sites more welcoming, reminding users that feedback can be clear and nice, and helping new users learn the ropes before they get frustrated.  And, as of today, we’ve completely overhauled closing. …

You're a bit late old man! :P
 
@OctavianDamiean thanks
I should check the blog from time to time
 
This article is too verbose... Reading only the titles and subtitles bring the same amount of information than reading the whole
 
More or less, make sure to read the part about close ("hold") reasons.
 
6:38 AM
@DanyP 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.
 
I want to allow website owners to put a script tag on their website, and when their users log in, they can send specific data to my server
info from their user, such as name, signup date etc.
what are some resources I should check out to achieve this?
when one of their user login, it sends data to my server, which I retrieve and start playing with in php
 
You should have a look on AJAX and CORS
 
Hi all. ( theoretical question) :
looking at this json :
[
{
color: "red",
value: "#f00"
},
{
color: "green",
value: "#0f0"
},
{
color: "blue",
value: "#00f"
}]
isnt it a waste the color and value strings are repeating ?
( i know that it is a Js obejct which should contain keys)
but i wonder , for web , if we could remove those repeated keys , it would be much efficient
 
@RoyiNamir JSON isn't designed to be the most compact format, but a good compromise. And usually it's gziped when sent.
Personally, when my JSON files start to be very big, I often find acceptable to use abbreviation ("c" for "color", "v"), but I keep the object structure.
 
@RoyiNamir Please format your code in chat.
 
6:49 AM
!tell @OctavianDamiean read my last comment
nor ctrl K
 
!!tell RoyiNamir format
 
@RoyiNamir Format your code - hit Ctrl+K before sending and see the faq
 
(read my last comment , it doesnt work (and im probably doing something wrong)
test
test
var a=0;
(both of them are coded....)
 
As you can see, it works.
 
(both of them are coded ( "test" shouldnt be)
 
6:52 AM
Which test?
 
testComment

var a=1;
var b=1;
 
Both are fixed font.
 
oh boy.... dont you see that test Comment is also coded ? and i marked only the var declarations !
 
@RoyiNamir You didn't mark anything ... Ctrl + K prepends four spaces to every line.
 
but it does it to the whole message
and not only to the selection...
 
6:54 AM
That's what I just said ... what's the problem?
 
(well i didnt know that i cant mix) :-)
 
Well, you don't select stuff, just paste the goddamn code, hit Ctrl + K and be done with it.
 
:-)
ok
( the problem is if i write something , and then you write a message and then i paste....) --- my message wont be 1 message
 
How does that matter?
This ain't a forum it's a chat, that's how a chat works.
 
so you really should look at Jabbr
 
6:58 AM
What's with Jabber?
I'm using it everyday I use GTalk. ;)
 
@Nirdosh 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.
@Frenchguy 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.
 
i am new to jc,can some one help me to solve problem in progress bar
height:15px;
width:<?php echo $result;?>;
border-right: double 3px #000;
background:#F99;
 
That's so wrong on so many levels ...
 
it shows 100% if $result is less then 100%
 
deepschool.jaberwokkee.kodingen.com/~/threejstest.htm does it show a building thats sipnning?
 
7:02 AM
Yea.
 
It does?
Then this school Pc is just a load of BS...
Can you send me a print screen @OctavianDamiean?
 
@OctavianDamiean what i was saying that in jabbr it pastes the code to your last message ( If i recall) and not open a new one....
(i might be wrong but , nevermind)
 
@RoyiNamir Only if that was a special implementation.
 
are you in signalR room ?
(generally)
 
No, I have no idea what that is about.
 
7:05 AM
please help me
 
@Nirdosh What you're doing is wrong, if you want to keep doing it that way, you're in the wrong room as well.
 
@OctavianDamiean my company's chat is jabber :-)
I found that so cool when I got in
everybody's subscribed on jabber
and uses jitsi, which also allows us to phone to anyone
 
@FlorianMargaine Yea, a company I worked for used it as well.
 
using SIP (asterisk)
 
Anyone?
 
7:07 AM
@Nirdosh How is your question related to JavaScript?
 
window.eval = JSON.parse.bind(JSON) //a safe subset
 
@FlorianMargaine I'm planing to setup a Jabber server in our company now.
 
@OctavianDamiean do you have some kind of ldap already?
@OctavianDamiean it's especially useful for us since agencies are spread all around the country
although I mainly use it to share fun pics to the guys right across my desk
 
We're just two people in the office, so that's not really an issue for us. :)
I want Jabber for sharing, links and code snippets real quick.
 
you'll just use it to share pics, trust me
and skype is enough is that's all you want, honest
 
7:19 AM
Nah, we want something internal, something we have full control of.
 
Please, anyone?
 
Also, he's not a oh look a funny picture kind of guy.
 
@deep Yes, there is a spinning building
 
~Thank you.
bye
 
stupid question sorry, if i have var asd = 34; now i want asd to be doubled so asd = asd*2; is this right?
i just want to assign to same var his own value multiplied by 2
 
7:21 AM
@badbetonbreakbutbedbackbone yep
 
and if asd is global and i use to do beforeSend:function(){ asd = asd *2;} so in the next ajax call asd will be asd*2; right?
var asd is global in this case
 
Or just asd *= 2
 
^oh this is what i need!!
 
7:23 AM
How about
        asd = asd + asd;
 
@loading... tnx man
 
but sorry if i have ajax with beforeSend:function(){ asd *=2; } then i have element like this <a onclick="ajax(asd)"></a> , so next time i click the link asd will be *2? @OctavianDamiean
it seems it doesn't changes live and it remains at first value
 
@RoyiNamir But: read Isaac Schlueter's comment where he does some measuring.
 
multiplication is a relatively expensive operation for the cpu, and if you can achieve the same thing with addition, it is usually faster
 
7:25 AM
@badbetonbreakbutbedbackbone I have no idea how your code looks like, nor am I interested to be honest.
 
assuming that sort of thing were really important like on drivers
 
@Neil Micro-optimization that is.
 
@Neil benchmark please. Compilers aren't stupid.
 
7:25 AM
@JanDvorak if you used two variables, one of which containing the value "2", compiler isn't smart enough to optimize
 
@Neil neither are you
 
@JanDvorak your ad hominem attacks impress me
 
that was meant as a general "you"
sorry, it sounded wrong
 
@JanDvorak Well "you" are, if you know the variable contains 2
You can optimize that.. of course you cannot optimize the general case
 
Does anyone know of a self-hosted alternative to Google Docs?
 
7:27 AM
Who cares if addition is faster than multiplication...we're using javascript
 
how do i increase var on each element click sorry?
 
so, your point is that compilers are not smart enough to do constant value propagation?
 
@badbetonbreakbutbedbackbone increment by how much?
 
7:28 AM
@badbetonbreakbutbedbackbone I'm considering raising the galerry mode
 
@JanDvorak compilers will optimize if there is 0% chance of creating an incorrect value after said optimization with the code provided
 
le sigh
 
@JanDvorak uh? :P
 
@Neil which allows them to propagate constants
and to replace multiplication with numeric addition
 
which is the each('click'); solution in js or jquery ?
 
7:29 AM
@badbetonbreakbutbedbackbone neither
 
@JanDvorak Yes, assuming they're 2^n
Or a number of other "easy optimizations" revolving around easier computation
 
@JanDvorak no way?
 
@Neil do you have an example where the optimisation is incorrect?
 
Oh guys ... what a ridiculous discussion ...
 
@JanDvorak variable / 2 being converted into variable >> 1
 
7:31 AM
We're talking about JavaScript, did you forget?
 
or rather the opposite, sry
 
Also, premature and micro-optimization ...
 
@Neil I mean this optimisation 2*x ==> _=+x; _+_
 
It's so irrelevant and not constructive because in the end, no one cares. :D
 
@JanDvorak No, that I see there is no problem with that
 
7:33 AM
I'm guessing the compiler won't change x*2 to x+x because that's a stupid thing to do, and they have more important things.
 
multiplication is slower than addition
did benchmark
 
So friggin what
 
@Zirak I took a drivers course at my university, man.. a course like that will change a man...
 
Using javascript is slower, big deal.
 
!!s/man/man, man/
 
7:34 AM
@JanDvorak @Zirak I took a drivers course at my university, man, man.. a course like that will change a man... (source)
 
Wrong man :-/
 
@Zirak Ah you're no fun :P
 
Have you looked at the v8 JIT, or at closure-compiler? They do insane stuff. Turning multiplication into addition can be done, but that's so irrelevant compared to the other things they can do.
 
@Zirak name a few please
 
well the multiplication operator is very hard to optimize
 
7:38 AM
Folding and extracting functions, eliminating dead code paths, splatting conditions into simpler ones, inferring constant values, I saw plans to optimize typeof and instanceof (when they're sure about the types)
 
just use shifts with -+1 if you need the performance
 
cool
typeof is just constant value propagation, isn't it?
 
oh btw, yesterday I checkoutted + compiled + disassembled some code using v8. Took me ~5 minutes.
 
well if the operand is constant
 
Not just. You can do var x = 4, then x = 7. It'll still be the same type, but a constant value can't be determined.
oh yeah, they also do some really cool stuff with strings...I forgot what exactly it was. Turning ['a', 'b', 'c'] into 'a b c'.split(' ') maybe? It was a cool algo.
 
7:41 AM
hey i got strange problem
 
14
Q: Why does Closure Compiler insist on adding more bytes?

qwertymkIf I give Closure Compiler something like this: window.array = '0123456789'.split(''); It "compiles" it to this: window.array="0,1,2,3,4,5,6,7,8,9".split(","); Now as you can tell, that's bigger. Is there any reason why Closure Compiler is doing this?

Now, that's cool
 
i'm on sublime text and if i do function asd(/*here a comment*/){} it doesn't parse it as a comment :/
 
wait, you are talking about closure compiler not v8?
 
i see that as wrong comment while it is not , any clue dudes?
 
@badbetonbreakbutbedbackbone fiddle?
 
user1125394
7:42 AM
is it bad to have a sql table without primary keys?
 
@JanDvorak no i mean i got problem on sublime ide :( somenthing is broken i think
 
@Esailija Both
 
i can't put comments inside method declaration asd(/*coment*/)
 
@badbetonbreakbutbedbackbone Then submit a bug report
 
it doesn't highlights as comment :(
@Zirak but i'm sure it's my problem cause time ago it worked
can i re-install sublime without making changes to packages and so on?
what you think :P?
 
7:44 AM
uh, 7?
Try it...it's just an editor. Save your config if you worry about it too much.
 
ok i'll try! thanks
@Zirak ok definitely a ide issue
@Zirak do you know where i can submit the issue? official link ? cause github page seems it doesn't allows
 
I dunno, I don't use sublime. Try their website.
 
So many interesting questions to read, so little time ...
 
*so little time
 
7:51 AM
That's what I said. :D
 
guys how do i check if array is empty? can i go for if(typeof array === 'undefined'){} ?
 
@lulezi 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.
 
if (index < array.length) {
  // do stuff
}
 
@HamedKamrava 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.
 
7:54 AM
i have array of json documents, can't i just do if(json.length> 0 ){} ?
for example
 
yes.. fine what is problem??
 
ok ok no problm i was just trying figure out best practice :P
thanks
 
o/
 
@vinod8812 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.
 
hello
 
is there any way to get GPS location from javascript without having internent connection..if device is GPS enabled
 
dudes how do i format date in js having timestamp to -> Y-m-d h:m:i ?
 
device location API works without internet
but it does use wifi i assume
so it isn't gps
 
@phenomnomnominal but I am asking to get GPS location without any internet connection
 
@vinod8812 html5 geoLocation !?
 
8:10 AM
yes that will work too
 
congrats, google the geolocation api and see what it says
 
can you give me the link plz
 
the link to google, are you fucking serious?
 
also this should work in IE10
 
8:11 AM
well then you'll have to look for yourself and see if IE10 supports it.
 
dudes :( unxitimestamp to -> Y-m-d h:s:i ? please :(
 
ok.will this work without internet
 
@dystroy In times like this, we have our stand-by mod, @ThiefMaster! Could you take a look? It does look a bit spammy
 
@vinod8812 go find out for yourself...
 
!!/tell badbetonbreakbutbedbackbone mdn Date
 
@badbetonbreakbutbedbackbone new Date(timeString)
 
That has all the information you'll need. Well, not ever, but for this specific case.
 
@ThiefMaster, @Zirak I flagged one of those comments, maybe it's enough (but I'm not sure, with all those flags mods must handle I see very often strange rejections)
 
"helpful" edit : no, that was another flag...
 
8:15 AM
i tryed new Date(json[i].timestamp,'M D, Y h:s')
but doesn't works \m/
 
Because...there's no reason it will
 
Show me what you read that would make you assume that the Date constructor would work like that.
 
yep i thought i can pass a pattern php style
sorry
can't understand how to format ufff
 
I tried var myCode = new Function('write me a function that produces pi to a bazillion decimal places'), but it didn't work.
 
uff without a pattern it's hell i need somenthing like this stackoverflow.com/questions/5416920/…
-1 point to js
 
8:18 AM
No.
Negative a billion points to you.
 
The js stdlib isn't big, that's not new
Make a formatting function
 
@phenomnomnominal lol
@Zirak yeah sure needed
but using getDay() i can't get day names only day number !?
sorry i mean getMonth()
 
@user2046410 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.
 
i would like to get Jun, May, Feb etc but that returns only numbers of months
 
I need a SSD ...
 
8:27 AM
hello every one can i ask?
 
you just did
@badbetonbreakbutbedbackbone bro, just write some fucking code.
 
@user2046410 You just ignored the welcome message?
 
@phenomnomnominal here i am what you think about? pastebin.com/mvF7BPJC
 
> 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.
 
going on with format but i think i'm going to goal
 
8:31 AM
@badbetonbreakbutbedbackbone copy pasta
 
@phenomnomnominal little bit :P some inputs needed
what about date.getDay() it doesn't returns 03 for example only 3 for third month's days
how can i return 03 or 04 for example? mmm
 
That's sounds like a problem that programming could fix!
 
yeah but i need a if condition :/
if day < 10
put 0 before bad approach i think
 
well, maybe you could write an if statement
 
right...
but i don't think it's clear approach anyway is the ony solution i got :P
ternary could help i think !?
 
8:34 AM
you do realise that getDay returns the weekday, right?
 
@GNi33 yes dude but i need 03 not 3
 
0 for sunday, 1 for monday and so on
the returned value will never be over 10
 
uh ... uhm omg
and how to return month date?
 
getDate
 
ok but problem persists since it returns 1-31 i need 01-31
going for an if statment?
 
8:37 AM
@badbetonbreakbutbedbackbone Add a fucking padding?
 
var month_day;
if(date.getDate() < 10){
month_day = 0+date.getDate();
}else{
month_day = date.getDate();
}
is the only solution i got
 
probably, yeah, or add a string - padding - function
 
what is padding mates?
padding:0px?
 
ಠ_ಠ
 
hehe, no, that has nothing to do with CSS
 
8:38 AM
yeah i do not use it brokes layouts (joking) :))
 
string - padding is filling up a string with a specific character to a given length
 
need to google for it , don't link me so i got no "do you think we are here to google that for you" answers!
:)
@GNi33 awesome i'll document on it ;) thanks really much!
 
String("00" + yourDate).slice(-2);
something like that, i didn't test it right now so I could be wrong
 
nice thanks dude !!
 
So far you are ranking top in my list of incompetent wannabe engineers.
 
8:42 AM
lol dude
so last one question are you ready?
 
Anyway ... off to physiotherapy.
 
damn i got physiotherapy for 3 months too
 
@OctavianDamiean I'm so sorry :'(
 
@GNi33 Not you ...
I <3 u.
 
:D
 
8:43 AM
!!ilove GNi33
 
dudes so if i want hours and minutes in 24 hours format?
 
me loves you too, dude. guylove! :P
there is a pretty good documentation about all that, you know?
 
yeah alreayd on it
following that ;)
just i have same problem 8 > 08 for hours and minutes
so need one more slice
thanks
 
Morning All
 
8:47 AM
hello
 
hows it going
 
@FranJMartínez 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.
 
@badbetonbreakbutbedbackbone code.google.com/p/simple-javascript-date-formatter maybe?
 
@Connor yeah nice one, but i really need somenthing smaller , thanks for the link i bookmarked!
 
@GNi33 nice, didn't think of that when I did this
 
8:57 AM
how is it possible that a js timestamp and a php timestamp are different? :/
 
really?
 
will you find the difference?
> Returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
> Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).
 
GMT - UTC !?
omg
 

« first day (984 days earlier)      last day (3971 days later) »