« first day (2252 days earlier)      last day (2923 days later) » 

07:02
403 is forbidden, depends on your server but should be a 404
My website says "You don't have permission to access / on this server."
I think it's a problem with my DNS settings.
07:27
I set it to redirect from / to /index.html
Anyone knows socket.io
Now it says "404 Not Found" :P
@user3304007 shoot your question
I have a 3 second interval ajax function which retrieves messages.php
İnstead, I just want to retrieve messages.php when there is new message.
How can I tell server there is new message, instead of checking every 3 seconds
its just between 2 people chat.
@user3304007 sockets!
Websockets to be precise
07:31
um can anyone help me format this question , I am not able to display the images stackoverflow.com/questions/41157257/…
Server sends information to the client without being invoked by the client
Eliminates the need to perform polling
@user3304007 you sound like using AJAX..thats strange becuase Websockets does that out of the box
@user3304007 do you want o identify just duplicate msgs ?
but havent used websockets before
07:33
or want the server to send you only new msgs
no need. I only need a ping to server to retrieve messages when there is new message.
@user3304007 The moment you add a receive handler to your application you need to make AJAX request, just need to write the receive handler function that will UI the UI processing
You don't need to ping
WebSocket connection keeps open
Sorry, let me rephrase, "You DON'T need to make ajax request"
sorry I am new on websockets. But doesnt it need to fetch it from mysql ?
no it does not
07:35
If you want to save into DB, that is your choice, but websockets server will send and receive msgs by default with just handler and proper server setup
guys anybody know how to disable controls autohide on chrome video element?
I want to make it always visible, no autohide
Oh got it.
so its between 2 users without server
No! server is there if you are building a proper application but just for two HTML5 already has that built it, you can create your own on any usual sserver
https://www.tutorialspoint.com/websockets/websockets_events_actions.htm
just to get you started on Websockets events
I mean server is just handing message.php with ajax when user sends message and adding it to db
but as I understand, I dont need to retrieve mysql again and again for checking new messags
you don't need that PHP layer at all, every thing can be handled without hat
don't unerstand it with typical AJAX based chats, where you had to save to DB then retrive back
there is no DB layer by default here, msgs are sent accross constant open connection
Imagine it like a server without request response system (although this example is wrong but just for your understanding)
07:39
but how you store the chats ? I mean if I want to check yesterday's messages
both the parties and send and receive
then you will have to add the DB layer
save the msgs on one end and give them normal functionality of DB read and display on UI
so the ajax will only post when he send new message to db
no there will be no ajax, you will only use that when you are retriving old msgs from database
only need when you first open messages
@user3304007 you are from which country ?
07:41
to retrieve old ones
Turkey
yes!
do you have post boxes there ? I don't know if you do but tell me!!
where you post your letters
?
what that means
Do you post letters is post boxes right ?
I am trying to give you an example
@phenomnomnominal @OliverSalzburg @SankarRaj @KarelG Could anyone of you edit this question so that images become visible ? Currently, its giving me an error saying that it is not properly formatted.
-2
Q: Why my table headers are not getting hidden in xs resolution?

Flying GambitI am trying to make a table change its layout for different resolutions. This is what I am after [![enter image description here][1]][1] [![enter image description here][2]][2] [![enter image description here][3]][3] I am trying to hide some rows on XS-resolution, I tried using visible-sm, v...

07:44
@user3304007 okay, now in typical letter sending procedure, after your post your letter it is first retrieved by the post office authorities, they based on address send the letter where it has to go!
now consider post office authorities DB and post boxes your web-interface
this is how server works, Request-Response
in case of websockets
remove the post office authories, letter is directly sent to the recipient
then how can I add it to mysql if there will be no message.php post request
so there is no Storage (i.e. authorities) to question where are the old msgs, if you have lost them form UI but post-boxes themself can deliver the msgs
On the user end write the script to do so
the moment you get the message, first show them on UI then save in DB
07:46
make an ajax post to PHP to do that!
but message sending and restrival will be seperate
already did :)
now tell me your next requirement
what you need next ?
well to be honest I understand the procedure but dont know how to implement websockets
asocket.io is a good choice ?
socket.io
yup, it is node based
yes it is
your best bet will be to watch one video on youtube
things will be much clear
which video
07:49
any good 20-30 minutes video on "building chat application in sockets.io"
you will find plenty
do I also need node js ?
for sockets.io you will, I will recommend you to use Typical HTML5 websockets
that is suffice for your requirement I belive!
ok
do I need to install websockets to server ?
isntall sockets.io via NPM
that will do
07:53
node package manager
are you new to JS ?
I do javascript and jquery
@FlyingGambit don't intend your tags with 4 spaces, otherwise it will interpret the line as a code, which is then displayed (thus ignoring the tag)
but not familier with node js or angular
I will watch the video now. thanks for your help
@KarelG Earlier when I had no indentation, it complained saying that code is not formatted and would not allow me to post the question
So I was forced to code format it
@user3304007 You just happen to land with someone earning a living out of chat apps :)
you are welcome BTW :)
08:10
Programmer's pub quiz: I have some checks like: (stringA === stringB) === boolean. Can I safely remove the (), and why?
yes because it executes from left to right ?
@FlyingGambit: you win a 🍪
what is that lol, my company's web blocker removed it
:cookie:
08:13
must be a turd, but wild guess
Aren't those emoticons a font?
yes but still got removed
Do you see a square box, or nothing at all?
ice cream
That's strange :/
08:15
@ptorsson Welcome to the JavaScript chat! Please review the room 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.
@Cerbrus just a square box
Well, not technically a font, more like a unicode character
@FlyingGambit That just means your computer doesn't recognize the character
a = b = 3 === 3 ? false : true ..... what do you think the answer would be ? No cheating :D
@Cerbrus It happens to me when I use company wifi on phone, it just eats away my smileys
08:18
True, you're assigning 3===3 to a and b
@FlyingGambit did someone tell you that's silly, yet?
answer is wrong
@Cerbrus its false :D
Got ya ;)
@Cerbrus The IT dept is not sure what to block, so if he sees us having fun on some random website, he blocks it the next day :D
!!afk gone for lunch
@Cerbrus not sure if i would call unicode symbol as a font
@Shashi oh thats nice to here, I am lucky :)
I have made a social network on web
user6820627
a = b = 3 === 3 ? false : true
false
but need to modernize the chat side of it by using sockets :)
user6820627
08:32
use webrtc instead @user33
Hmm, better ?
user6820627
yes, user3304007 http://peerjs.com/
but as it seems, its for video chat =
?
@KarelG Yea, it's not a font
@FlyingGambit Oh, you inverted it with the ternary
@Cerbrus FlyingGambit is afk: gone for lunch
08:36
Derp
user6820627
@user3304007 for all kind of chat. it send messages and what chat is depend on how you parse the messages. RTFD.
When I ran a = b = 3 === 3 ? false : true in console, a and b were both false after it evaluated. Why?
oh wait never mind I see
user6820627
3 === 3 ? false : true
It's really a = b = (3 === 3 ? false : true)
user6820627
^ that evaluate to false
08:41
the assignment has lower precedence. He only responded too quickly
I'm so glad I never have to care about operator precedence in my daily life
eh
if you use () all times, then yes
btw, how to ensure that a var is numeric: apply mustache operator! :P
If you write code that relies on operator precendence it's time to refactor in my opinion
a co-worker just came to my desk yelling "what the hell is this"
anyone aware of jsPdf here ?
@KarelG is he your friend too ?
08:45
@KarelG what is the "mustache op" ?
@CSᵠ ~~<ur var here>
!!> ~~10
@KarelG 10
!!> ~~'a'
@KarelG 0
user6820627
Another obfuscated JS code: hastebin.com/hitudekoyi.md Can you decode it?
08:46
it's just a simple hack for ensuring that an arg is numeric.
@KarelG that will convert type, because ~ is a Number op
"ensuring" should be a check with bool return
(z=new Image).src='data:;base64,'+btoa(g.slice(215));C=document.createElement('canvas').getContext('2d');for($=_='';C.drawImage(z,$--,0),X=(q=C.getImageData(0,0,64,32)).data[0];_+=String.fromCharCode(X));(e=eval)(_)
@LearnHowToBeTransparent ^
@KarelG careful when you use it
user6820627
@BenFortune nice try. but my code was shorter than that.
Implying you wrote it.
user6820627
08:53
@BenFortune answer: alert("3.141592653589");console.log([1,2,3,4,51324/32,6+23413]);
@CSᵠ arg = (~~arg !== 0) ? arg : 0 <-- now i'm sure that arg is an integer. Even if someone accidentally pass '100'
@KarelG is actually wrong. ~~ was invented as a conversation piece amongst hipster web developers
:)
@KarelG you must hate parseint
no, but i do hate its return in case of failure: NaN
also, it casts doubles.
user6820627
@KarelG do this instead
user6820627
09:06
function add(a,b) {
if (a.constructor !== Number || b.constructor !== Number) {throw "NaN"}
return a+b
}
undefined
add(3,5)
8
add("dsfa","few:")
VM174:2 Uncaught NaN
user6820627
@BenFortune what is wrong?
i would allow the addition of string. Spares me cascading +
just map + array :D
but there is a join() :|
@KarelG ~myArray.indexOf(someValue)
@user3304007 whats the URL ?
share the link
09:18
Hi Guys..... one quick question..... is Bootstrap table compatible with AngularJS?
why wouldn't it be ?
@sh
@shaashi will tell when its finished :) just little left.
a bootstrap is like a boot in a trap. don't use it bro.
The socket io makes it easier
@Phoenix check this codepen.io/anon/pen/VmVzrq, that code i was using inside an angular controller
09:20
@FlyingGambit :I dont know. Why do Angular have a dedicated Bootstrap like UI.Bootstrap?
@KarelG I wish I could give you 5 cookies for that
@shaashi I am trying to udnerstand what should I use
var socket = io.connect('http://localhost:8080')
on my web linux server ?
serverip:8080 ?
@Phoenix I though skipped the UI.Bootstrap and I used twitter Bootstrap with Angular JS. and everything works almost fine :D
@FlyingGambit : Thanks
How can ~0 = -1 ?
09:28
@FlyingGambit Because that's what it does
I have an answer about that somewhere...
56
A: Why does bitwise "not 1" equal -2?

CerbrusThere are 2 integers between 1 and -2: 0 and -1 1   in binary is 00000000000000000000000000000001 0   in binary is 00000000000000000000000000000000 -1 in binary is 11111111111111111111111111111111 -2 in binary is 11111111111111111111111111111110 ("binary" being 2's complement, in the case of a b...

it depends on how negative binary numbers is represented
one's complemented or two's complemented
@Cerbrus thanks
oh its a 2's compliment
09:45
Added a snippet to that answer, just because I can :D
.as-console-wrapper { max-height: 100% !important; top: 0; } hacky
But helpful
yes indeed
SO should integrate that. You're not the first with some console hack edits because the standard one is fugly
And here's a feature request to remove that ability altogether... To which I said: please don't.
09:58
They should just give us a checkbox: "show console only"
i'm not voting for a removal, only that the console output could be placed on top instead of that big vertical space
10:16
I wish I could downvote comments.. bad practices in someone's example code ends up in someone else's codebase and it's usually an innocent 3rd party who gets to fix the mess
user3119231
o/
Morning, any humans in here
@Mathematics None found.
@ivarni Doesn't matter.
I agree with the feature request.
Nothing you can do in CSS or JS may affect jsfiddle or jsbin or whatever
SO's equivalent should not be different.
That's a fair point
And @Cerbrus se the comment on your answer.
"leverage" isn't a valid point for making it very easy to mess up by default.
10:28
@MadaraUchiha: The FR is to completely sandbox the console. Make it impossible to style it through a snippet
That, I don't agree with
@Cerbrus I don't mind that either, actually.
But compromises can be made.
And the current situation is bad.
Something like you said seems like a good option
That said, that change would break existing answers using those css console tweaks, not?
I'll post an answer then
@Cerbrus Hmm, that's true.
.as-console-wrapper { max-height: 100% !important; top: 0; } is easy to mass-replace with something that works, but still
That's 1 specific case
* shakes fist at @Wiktor Stribiżew *
10:34
@MadaraUchiha that's good
10:47
@ivarni Just do what everyone else does and start a flamewar in the comments. It's just as useless
@MadaraUchiha: regarding the sandboxing meta: the last comment on that question contains an ad hominem... The OP could also do with voting instead of constantly agreeing in comments. (I must admit I'm slightly biased). Something to act on?
How long does it take SO to give me a tumbleweed badge ?
At least a week after asking it.
Then it should have awarded it to me by now
Give it a day
10:53
did your Q got not enough views ?
that badge is quite funny
@KarelG just 18 views , question was asked Oct 21
you should have gotten the badge
dont go visit and increase the views XC
What's the question's title? Is it's score 0?
@KarelG thats what I was also thinking
SO is broken, Score 0 , 18 views , title "Which Angualar JS package manager to use?"
I asked that when I was new to angular XD , the question now seems silly
10:55
@OliverSalzburg I don't mind a good flamewar but I'm a bit preoccupied with work atm :)
according to the records, it got 400+ views
keh, incorrect query
it's 19
somebody visited it XC
it was 18
@ivarni Aw, damn :D
25
A: Tumbleweed Badge- how low exactly is "low views"?

Martijn PietersLow views is at most 60 views in its first week of existence; Oded checked the code.

Not sure why you haven't got it yet
Better ask about it on meta. Make sure to link to the question.
No! Don't link to it! You will get additional views ;P
10:59
@OliverSalzburg very true , I am doomed
@Cerbrus okies, will do later
@FlyingGambit I was joking about the link, by the way
Partially joking about the meta
@Cerbrus Hard to see your wicked smile after the joke
So tempting to find that question and comment on it now :p
let's don't and say we did
If you do that you will get kissed by all the old ugly ladies in your neighborhood
>.<
11:16
it's something
Ok, I am working on v1.4 temporarily, so from one of the controllers i am trying to access the elements but $element.children() gives me an empty array. Earlier this used to work for angularv1.5 component controllers. Did I do something wrong ?
Is it mentioned in the changelog? Might have been a new feature in 1.5? Apart from that, no idea... I managed to get out of angular before I flipped
@ivarni Components is a new feature of v1.5
ok this also does not help angular.element("canvas")
and google is full rubbish results Xd
11:41
i'm not into angular
but does it support canvas?
@KarelG yes it does, you play around with it using angular. angular.element("canvas") is trying to find canvas on the DOM
@KarelG are you serious ?
@FlyingGambit Well, does it have any children?
@KarelG what are you expecting angular to do with canvas ?
11:43
> If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or jqLite.
ok ...
@KarelG .children() is supported without selectors in jqlite
yeah, the doc that flying has posted says so :P
@SterlingArcher listen, chair person, by default I look down on you
it's not the only one
anyways...
!!afk lunchie brunchie
@OliverSalzburg ^
11:50
How to create an array with 10 elements in it?
I always forgot this :(
I tried new Array(10)
but the map on it isn't changing anything
you need to fill it up
Array(10).fill(true).map(..)
I need es5 solution..
11:52
for (...)
Array(10).join(',').split(',') ?
:(
oh ok thanks
lolno
but will go with for because of performance
@Zirak thats so wrong
11:53
@FlyingGambit But it feels so mildly correct
your face feels mildly correct
@Zirak what if he wants to initialize it with the numbers 0
@Mr_Green go with the for()
may the for() be with you
@FlyingGambit Array(10).join(',').split(',').map(_ => 0)
why not just use a for loop if all you want to do is loop x times?
11:56
@Zirak Stop coming with solutions XD
@Zirak Thats so dirty
Array.from({length: 10}).fill(0)
@BenFortune He needs to use es5 he says
@OliverSalzburg any clue ?
Array.from(Array(10),_=>0);
Array.from O.o thats something new for me
Array.from({length: 10}, _ => 0)
Ooh, I like it
12:00
Yea, from has a filler
// create an array and fill it
var array = Array(10);
for (var i = 0, l = array.length; i < l; i++) {
  array[i] = 0;
}
finally the loop
Always add comments.
!!> Array.apply(0, Array(10)).map(function(){return 0})
@rlemon [0,0,0,0,0,0,0,0,0,0]
12:03
!!> [...Array(10).keys()]
@BenFortune [0,1,2,3,4,5,6,7,8,9]
ok, now I am going to ask a bit out of context question, are you guys ready ?
@FlyingGambit That didn't make much sense. Maybe you meant: ead, really, redo, reply
Where we all developers can learn these magic words to calm down project managers... when we are stuck with a task
12:07
!!ead
Eat a Dick™
lol
She is naughty, just the way I like it
indeed
dick also means cop or police
!!urban dick
12:09
@FlyingGambit [dick](http://dick.urbanup.com/95030) 1.The male genitals
2.An abrasive man
3.Short-form for "Richard"
ok, Caprica does not know it yet
is point 3 true?
who is richard here?
that is urban dictionary.. so no
so Richard Dickinson is Dick Dickinson?
In 1920's comic book, dick was a popular term used for the good guys :D
12:10
@Neoares Yeah.
One of my clients is called Richard Love.
Dicktardness in the air!! :D
!!> 'ز؎؃نء؇؋؃و'.split('').map( l => {return String.fromCharCode( l.charCodeAt( 0 ) ^ 0x666 );}).join('');
@jAndy "The Game."
man you maybe need to forget about that game
so you'll avoid losing everytime :D
tell that the prime minister man...
12:15
In the same way rob->Bob, Richard -> rich -> Rick -> dick
At least that's what I've been told.
so you can be rich or be a dick
and it's the same
12:42
@FlyingGambit About what?
@OliverSalzburg why I am not getting any children chat.stackoverflow.com/transcript/message/34611126#34611126
@FlyingGambit Maybe you should see a doctor
Lol thats not what I meant XD
I have enough sp3rm to make my own nation
12:49
1 hour ago, by Oliver Salzburg
@FlyingGambit Well, does it have any children?
@OliverSalzburg It actually does have many, atleast in the template, however I cannot access it from the controler
btw how did you quote that ?
can we not write arr1 = eval('arr'+1).map(x => x.id); as eval('arr'+1) = eval('arr'+1).map(x => x.id);
?
I see eval ...omg eyes they are burning x_x
You can do a lot of things
@Zirak apparently it's not working
Since it's happening dynamically, I don't know which variable I will be working for. So, I have to set the result in that variable number. Here consider ('arr'+1) to be ('arr'+variable).
12:56
@nickborti why not use ~~arr + 1 ?
i guess that i shouldn't point you of the dangers doing eval with dynamic input
@FlyingGambit Using the permalink
oh I see
@FlyingGambit what's this?
another way to write eval('arr") + 1
12:58
@KarelG any other options?
@nickborti In your case its ~~(arr + 1)

« first day (2252 days earlier)      last day (2923 days later) »