« first day (1938 days earlier)      last day (3005 days later) » 

12:05 AM
@rlemon damn dude
that looks amazing
 
12:28 AM
I am working with a slider plugin and I want to disable the sound on the background video by default. Here is the code for the video...
function uploadVideo(container) {
container.find('.cd-bg-video-wrapper').each(function(){
var videoWrapper = $(this);
if( videoWrapper.is(':visible') ) {
// if visible - we are not on a mobile device
var videoUrl = videoWrapper.data('video'),
video = $('<video loop><source src="'+videoUrl+'.mp4" type="video/mp4" /><source src="'+videoUrl+'.webm" type="video/webm" /></video>');
video.appendTo(videoWrapper);
// play video if first slide
if(videoWrapper.parent('.cd-bg-video.selected').length > 0) video.get(0).play();
fixed it ...nvm
 
hy guys, can I ask some help? mostly JS but involves webdec stuff too
 
@ZoltánSchmidt Welcome to the JavaScript chat! Please review the room rules. Please don'task if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
12:52 AM
 
@ndugger absolutely incredible
 
I almost want to pin it
 
room topic changed to JavaScript - Spread Knowledge; Abolish Ignorance: Topic: JavaScript, ECMAScript. Read this: javascriptroom.github.io/rules. Before asking inform yourself on the XY problem goo.gl/taIqf | devdocs.io Documentation™ Helps. Room meta discussions: github.com/JavaScriptRoom/culture [ecmascript] [es6] [javascript] [nodejs] [promises] [xandercoded]
 
user4883426
hi guys, does anyone know how to do an onerror() callback for an object svg tag?
 
1:10 AM
Man I really like how the redis docs show you a method's time complexity
 
m59
1:52 AM
Can this not be closed programatically? github.com/sindresorhus/opn
 
Booo, Dave Mirra is dead
 
But on the bright side I just finished proper redis player connections
client.smembers("game-1", (err, reply) => {
	reply.map(x => {
		client.hgetall(x, (err, reply) => {
			if (reply.id == socket.request.session.player.id) client.hdel(reply.id, socket.request.session.player);
		});
	});
});
client.srem("game-1", socket.request.session.player.id);
 
2:08 AM
Uhhhh, maybe
ok
Yes, though I'm not entirely sure what I'm looking at
Oh, yuck. Yeah, that connect stuff can be kinda gross at times
The only thing I would suggest is to make use of ES6+. It's 2016--if this is a personal project, you have no excuses.
oh, pishposh. There's nothing magical or strange about es6
 
2:29 AM
I just showed my brother my game and he was super impressed :D
 
s/game/;)/
 
oh
So I think the bearing being calculated from the angle is correct, but I don't think the angle is quite correct
It's either the improper order of calculation, or there's something off in the calculation math
 
2:51 AM
Yup, angle is wrong lol it's returning 90 a south bearing lol
 
3:03 AM
@KendallFrey can I borrow your super math skills?
 
make it quick
 
function angleFromAtan(a) {
        if (a > 0) {
                return (a * 360 / (2 * Math.PI));
        } else {
                return ((2*Math.PI + a) * 360 / (2*Math.PI));
        }
}
I don't understand @ssube's if statement reason here
You calculate the arctangent, and run it through this function to calculate the angle
It seems to be returning .. not quite the opposite?
 
looks like this is converting an angle from radians to degrees
 
Right
So if my players are on the same grid, then on moves south, it displays east on the other players sense when it should display north
 
it also converts angles from -360 to 0 into 0 to 360
 
3:07 AM
Like the absolute value?
 
well, it looks like it tries to
It should probably use modulus
 
Instead of dividing?
 
user5711741
hi
 
radToDeg = a => a * 180 / Math.PI;
normalize = a => (a % 360 + 360) % 360;
then normalize(radToDeg(a)) would serve as a replacement for the above code
however, I suspect this isn't related to your problem
 
github.com/RUJodan/SourceUndead/blob/master/routes/… at the bottom is everything put together
I'm trying to figure out what's wrong. Whether it was the players distance in the wrong order
But that wasn't it
So I figured it must be either the arctan or the convertion to degrees
 
3:12 AM
I know almost nothing about your situation
but
Tell me this: What direction does an angle of 0 degrees point?
 
that would explain it
atan2 has 0 as +x, and 90 as +y
i.e. east and north, if I understand you
if you swap the x and y, it might fix it
 
Math.atan2(+uv.y, +uv.x)
You mean these values?
 
yes
assuming y is north
 
YOU BRILLIANT MAN YOU
You just fixed the hearing sense
 
3:16 AM
lol
 
So why does x have to come first for atan2?
The docs have y first and x second
But it does say first num second num...
Maybe just a coincidence lol
 
because you're using the clock way of measuring angles instead of the normal way
I don't know the real terms
 
Interesting
I need to study up on my arcs
 
it just so happens that they are the mirror of each other wrt x/y
zzz
 
Bed time?
yahp
me too
Thanks @KendallFrey, much appreciated
 
3:38 AM
@SterlingArcher quick question are you sending entire game state
or delta updates ?
 
@Abhishrek I'm not sure if I follow what you mean?
 
@SterlingArcher in your game do you send the entire game state to every client
or just the data that has changed ?
 
Just the data that has changed
redis does the heavy lifting for me
 
and how do you achieve that ?
oh erm um x_x
our games are s different :P
 
by sending instructions on how to change data
 
3:43 AM
lol well when a player changes coordinates, they get updated in redis. Then I have a few checks for proximity and same tile, and sends data to specific clients who match those checks
 
coming along nice
 
kerballll
 
4:51 AM
@littlepootis -_-, I was wondering how is he doing that in Redis :P
 
5:03 AM
 
 
2 hours later…
7:15 AM
@Abhishrek Yes, I'm telling you'll have to instruct redis to change the data in the database :P
 
7:36 AM
this is pure gold:
> Due to the unintuitive character sequence to exit vi (":q!"), hackers joke that there is a proposed method of creating a pseudorandom character sequence by having a user unfamiliar with vi seated in front of an open editor and asking them to exit the program.
this whole thing is gold, I'm surprised it's actually a thing according to wikipedia:
Editor war is the common name for the rivalry between users of the Emacs and Vi (Vim) text editors. The rivalry has become a lasting part of hacker culture and the free software community. Many flame wars have been fought between groups insisting that their editor of choice is the paragon of editing perfection, and insulting the others. Related battles have been fought over operating systems, programming languages, version control systems, and even source code indent style. == Differences between Emacs and vi == The most important differences between Emacs and vi are presented in the following...
 
> Do I have to make new accounts and ask questions, whenever my older accounts are banned? I find this kinda buries the idea behind banning people.
... I don't even....
 
user3119231
7:58 AM
moring and lol to cerbrus
 
atc
8:17 AM
:x is my preferred method :)
 
user3119231
@Cerbrus shame for germany.
 
@PetahChristian, btw. I find the idea of high quality questions etc. rather ridiculous as high quality is by no means well defined. I consider a question to be proper, if it suffices the common sense qualities, (quality - in the sense of level of knowledge or skill has nothing to do with it) — blauerschluessel 2 mins ago
@blauerschluessel: "Common sense" includes a clear problem statement, and some kind of effort by the OP. Basically, it's common sense to write a good question if you want a good answer. — Cerbrus 1 min ago
This guy seems to think he can just dump questions on SO without considering the quality of it...
 
Hi guys.. I need some help..

I have a <select> element in the HTML, but want the element to blur (lose focus) when the currently selected option is selected again, or when the actual select element is clicked again. Not only when a new option is selected..

Any suggestions?
 
user3119231
element.addEventListener("click", function(e){ -- unfocus select .. });
 
user3119231
This would be my suggestion
 
8:28 AM
Do I do that in the document ready function?
 
user3119231
No, place it in the script section of your body
 
In doc ready.
 
user3119231
but why?
 
You can't attach event listeners to elements if the elements don't exist yet.
 
user3119231
Doc ready func if it is external and called before dom.
 
user3119231
8:30 AM
due the html document is parsed from "top" to "bottom" it depends.
 
Thanks for the help, but this only triggers when the element goes from blur to focus
 
1 message moved to Trash can
@HowlinWulf Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
document.getElementById("countrySelector").addEventListener("click", function(e){
    if (this.hasClass("isOpen")) {
      alert ("already open");
    }
  });
 
user3119231
create a jsfiddle.net to show us what you tried
 
8:47 AM
Wow this dashboard looks simply awesome - wrapbootstrap.com/theme/…
any thoughts ?
 
user3119231
CREDITS

    AngularJS
    angular-bootstrap
    angular-ui-router
    oclazyload
    angular-breadcrumb
    ngStorage
    ngprogress
    angularjs-breakpoint
    angular-ui-switch
    angular-datepicker
    bootstrap-daterangepicker
    ng-bs-daterangepicker
    AngularJS-Toaster
    angular-aside
    angular-slimscroll
    angular-ui-select
    angular-translate-loader-url
    angular-translate-loader-static-files
    ng-focus-on
    angular-loading-bar
    angularMoment
    NgSwitchery
    ui.sortable
 
user3119231
Hell this is a bunch of librarys and frameworks
 
user3119231
If they split the 19 dollar for each everyone would just gain 0.5$ :D
 
user3119231
@HowlinWulf what error do you get?
 
8:53 AM
No error, it is just not firing on every click
It only fires when the element goes from blur state to focus state
 
user3119231
you checked the console?
 
@rlemon @Loktar @KendallFrey /o/
 
user3119231
tz
 
Ah, got it now
finally
 
@Maurice exactly
I agree with u
 
8:57 AM
thanks @maur
@Maurice Thank you
 
using all open source libraries then selling them, but there might be few things they did added up
 
user3119231
@Mathematics If you create something just with vanilla and stuff I would say "Okay, this could be much work..."
 
user3119231
If I include every library there is on the market, so I just need to createTemplate() and boom 50% is done. THen I say "nah".
 
user3119231
@HowlinWulf Nice! :)
 
9:10 AM
@Maurice I wish if someone created something similar I could get for free
 
user3119231
If there is no free version, just go ahead and create one.
 
@Maurice there must be one, just can't find it ;)
 
user3119231
9:25 AM
 
user3119231
I like this (sure it is no web based)
 
@Maurice That looks nice. Is that one of the popular free admin panels for Linux these days then?
 
@RoelvanUden It's like a free c-panel.
It's also terrible.
 
Why is it terrible? Is there a non-terrible one? I'd like one for my servers. :P
 
If you're not willing to pay for one, then no. :P
 
9:34 AM
@RoelvanUden what do you need?
 
Basic server administration; terminal, configuring cron, monitoring, lamp management
 
@RoelvanUden Webmin is alright.
 
@RoelvanUden cron/lamp should be done in e.g. puppet
monitoring = nagios
 
Hi! Guys, how does one reference entire html page through javascript? I know, that document.body is a reference to <body></body> element, but how can I reference <html></html> element? If I can at all.
 
@FlorianMargaine Puppet looks nice. I'll look into both, thanks.
@BenFortune Webmin was terrible a few years back :D
 
9:39 AM
@RoelvanUden puppet is more about automation of all this stuff
 
@RoelvanUden I never said it was good, I said it was alright. It's much better than it used to be anyway :P
@Eugene document
 
Or document.documentElement
 
Okay. Will try that out. Async libraries are such a pain IMO.
 
Then don't use them.
 
10:26 AM
Async Libraries ? what is that ?
 
10:39 AM
Quick question about async await
How are they implemented by browsers ?
 
Simple callback or timeout, usually.
 
hello all. how to remove every element of an array except first and last?
 
Only Edge implements async/await, right? Or Chrome too?
 
IIRC its only Edge
 
@macroscripts remove? or build a new array (slice(1,-1)) ?
 
10:44 AM
what ever gives me the solution.
so that slice code will remove all except first and last?
ok gonna fiddle it
 
Do you want to modify the original array?
Or do you want a new one?
 
@BenjaminGruenbaum it did help. Thank you. Or was question about my opinion regarding async libraries?
 
damn how did they animate the hair on the trumpet site
 
@DenysSĂ©guret jsfiddle.net/45q5sLma GJ .now how to get the removed elements'
*
?
 
10:48 AM
@jAndy Use the source Luke!
 
@Abhishrek yea I can't figure it. Seems like it is in one big canvas element, but it looks wierd anyway
 
@jAndy tons of PNG's
 
@macroscripts What is the problem. Are you not getting the non-first, non-last elements?
 
@jAndy ^
 
oh boy.. :P
ok I hoped it was some kind of magic
 
10:50 AM
@jAndy @rlemon has a much better magic
 
DISAPPOINTING
 
with his jsfiddle where he grew hair on my head :P he probably can achieve that magic
@jAndy :P most cool stuff is disappointing (Pop music for instance) or Windows ;-)
or Java ^^
 
Java ain't cool in any way :P
 
@jAndy roll back 20 years :D
 
@jAndy Are you using an Android phone?
 
10:58 AM
@Sheepy Android isn't cool either.
 
> In February 2016 Trump was nominated by 'an anonymous US politician' for the Nobel Peace Prize, for his 'vigorous peace through strength ideology'.
 
@Sheepy of course not
but yeah.. what Abhi said
 
@littlepootis lmfao
 
At least Java is a consistent language. How does Objective-C fares now?
 
@Sheepy [meme:bitch_please Swift]
Holy Smoke, I confused Python and Swift!
 
11:02 AM
ă„ź( â–”, â–” )ă„Ź
 
Anyways @Sheepy your argument is valid, Java is Cool :P
(as a concept)
 
lol
 
Java is not that bad.
But it's old and overused.
 
@Sheepy Java java = new Java(); java.equals("Cool"); // false !
 
It is practical. I use it for the same reason that I only buy phone with replacable battery.
 
user3119231
11:08 AM
Java reminds me of android :D
 
Java reminds me of coffee, and hence its cool because coffee is cool!
 
user3119231
nah coffee is hot.
 
Java reminds me of that drink my mother used to give me when I was a kid.
 
Bourbon?
Oh, wait, I know! Rat poison!
 
@SomeGuy lol
@Maurice Heathen !
 
11:09 AM
@Abhishrek You're the heathen! Coffee's meant to be hot
Though I like cold coffee better myself
 
Ratpoison sucks.
 
@littlepootis you like rats ?
or you want to use guns to shoot em ?
or eat them ? // We are predatory specie after all!
 
user3119231
Nah just make friends with them.
 
user3119231
They can help you in many ways...
 
11:11 AM
@Maurice ls rat-helpful-*
 
@Abhishrek You sure are. Humans are know to feed us TNT: popsci.com/science/article/2011-01/…
 
@Sheepy Hahaha
 
@littlepootis yeah, get a real wm
 
user3119231
I've heard that some humans have them as pet
 
11:12 AM
> Ratpoison 1.4.8 has been released!
 
like awesome wm or xmonad if you want something tiling... some friends like openbox too
 
I love Openbox.
 
Or just install windows ?
 
@Abhishrek I'd rather kill myself
 
@littlepootis yeah, I've contemplating switching too, for something fresh... but lazy
 
11:14 AM
@littlepootis Your face is red, The screen is Blue, You got windows, nothing can unfuck you!
 
How can i make the LoginForm disappear on click? : jsfiddle.net/tj07vs99
 
@Abhishrek Because I'd be fucked already?
 
unfuck you*
 
I wouldn't use an OS so insecure.
 
@littlepootis I am joking my friend.
Also OpenBox++
 
11:18 AM
You better be.. :P
 
I have a shaky relationship with MS ;-)
 
let go
 
I wish :P
 
@SterlingArcher @GNi33 youtube.com/watch?v=j-qQ_brIsfY
 
@rlemon Are those side tanks intended to go along with the ship? Because I have one word for you: flex
 
11:26 AM
> if you have epilepsy this video will probably kill you
 
Haha, I haven't actually seen the video
I listen to music on Google Music
 
@SomeGuy request subscribe
(Ping me with that kinda music too)
 
crl
How do you do when you share a var between css and js? (a resizer width) hard-code?
 
@Abhishrek Haha cool
 
@crl what exactly do you want to do ?
I have once applied the class to an element measured its bounds and used that in JS
 
crl
11:31 AM
I have a resizer: .col-resize { .... padding: 0 3px; ...}
 
okay ?
 
crl
and in js I need to offset the left position by 3, to be centered, when setting the position
 
can you gimme a repro ? Cause margin: 0px -3px;
 
crl
oh I could add the css stylesheet, but well
 
should set it back to where you want without the
need of js at all
 
crl
11:32 AM
yea, I thought about margin, hmm, wait, checking, thanks
 
TIL you can start steam games from command line
 
@littlepootis yikes!
 
Hey all, how can i get jquery to not round numbers?
 
TIL : I can publish games to Steam
 
> steam steam://rungameid/440
 
11:33 AM
its causing a choppy animation in safari
 
repilase 440 with appid
 
you can also just do steam://rungameid/440 in browser.
 
@littlepootis should work without the first steam
 
and depending on os you can just do open / type the url / favorite browser command
 
11:33 AM
@KendallFrey not on linux
 
@littlepootis steam rungame 440
?
 
crl
@Abhishrek nah, I need to have a cursor: col-resize, and with that it has no width at all
 
:-|
 
crl
hmm wait
 
2 mins ago, by little pootis
> steam steam://rungameid/440
 
crl
11:36 AM
@Abhishrek yea I will set the width to 6 and margin-left to -3 thx
 
Hello all
Can someone have a look at my question?stackoverflow.com/questions/35223093/…
 
crl
Hellol
 
touches too many touchy subjects ^
@SomeGuy Is this movie already banned in India ?
 
Haha, I have no idea
 
Will definitely be banned
"I have been called by many names, Rama, Krishna, Yahweh... total ban!"
 
11:39 AM
Haha
I bet they'll ruin Deadpool
 
@SomeGuy doubtful, this Rama and Krishna thing will cause a shitstrom
 
@SterlingArcher @SomeGuy youtube.com/watch?v=D7E_rp-LsBM
dat intro
 
@Abhishrek Yeah, I know. I used to run TF2 servers. But it's not the same thing as playing.
 
what the hell is wrong with this year?
now Dave Mirra died too, oh my god
 
11:47 AM
@GNi33 Haha, nice
 
jsfiddle.net/tj07vs99/2 Any ideas why this isn't working?
 
one of the many reasons why onclick is freaking horrible
hint, I didn't change any of the code
 
@GNi33 Im kind of confused right now :D
 
there's an option in jsFiddle in the js panel where you can specify where the JS code gets inserted
I changed that to <head> so the function will be defined before the browser parses the DOM
 
@GNi33 Okay, but in my Projects it's in the head. And it doesn't work there
 
11:54 AM
alright, that's kinda weird. check the console for errors
 
@GNi33 sadly, no errors
 
even better: get rid of inline attributes and bind some nice event handlers to your dom elements
 
!!add 173kb to project or write amazon thing myself
 
@Abhishrek write amazon thing myself
 
@GNi33 restrted firebug;ReferenceError: visible is not defined
 
11:55 AM
user image
4
 

« first day (1938 days earlier)      last day (3005 days later) »