« first day (1869 days earlier)      last day (3080 days later) » 

12:00 PM
these two lines have to be in the <head>? <body>? <htlm>?
<script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="js/home.js" type="text/javascript"></script>
 
inside head tag
 
are you sure? I heard for increasing the load-page-speed, I can put them out of <head> and <body>
 
see what you can do
for increasing the spead
you can put below before </body>
 
@Mahadevan bullshit
 
tag
 
12:05 PM
24 secs ago, by Mahadevan
you can put below before </body>
that's more like it
 
crl
both are ok imo
 
what is wrong with you @tereško
 
@Mahadevan "below before" is the same with "under" ?
 
@AwalGarg Nope, it won't let me do it :)
var script = 'data:application/javascript;base64,' + btoa('console.log("..")');
navigator.serviceWorker.register(script, {
    scope: './'
});
 
you are in the common chat you cannot shout like that
 
12:06 PM
> Uncaught (in promise) DOMException: Failed to register a ServiceWorker: The origin of the provided scriptURL ('null') does not match the current origin ('https://chat.stackoverflow.com').
 
you bullshit @tereško
 
1 message moved to Trash can
@crl Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
<body>
    ... rest of the page ...
    <script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="js/home.js" type="text/javascript"></script>
</body>
 
<html><head></head><body></body>
<script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="js/home.js" type="text/javascript"></script>
</html>
like this?
 
no
 
12:06 PM
@tereško very thanks, I got it
 
@ivarni hrmm, did you try using URL.createObjectURL on a blob?
 
I don't see how that would change anything, they'd still not have the right origin
 
hello can i ask about jquery here or is there any other room was jquery specific
 
@sekhr 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.
 
@ivarni If you put those <script>s in the head, page will not load until all javascripts codes run. IMO
 
12:12 PM
my question is can i apply this code "
featuredArticle = $('.featuredArticle').toggleClass('blue');" .
I am new learner to jquery .
 
@Mahadevan Sure he can
 
:)
could any one plesae help me
please
 
@Shafizadeh I think you mispinged that, I wasn't talking about putting any scripts into any heads
 
with my current code i can able to clone datepicker but i have given one more functionality
if the user enter some random value 232323 will get an alert say kindly enter correct format this was working perfectly with the original text field but not on the clone one
 
i have this code imageExt["JPEG","GIF","BMP","PNG","jpg"];
console.log(imageExt); and getting error. how can i print in console
the error is Uncaught TypeError: Cannot read property 'jpg' of undefined
 
12:14 PM
Failed to register a ServiceWorker: The URL protocol of the script ('blob:https%3A//chat.stackoverflow.com/e7808631-1034-494d-8c32-40aabb65ef3f') is not supported.
wtf
 
Service workers can only be created for https
 
please tell me
 
@Zirak don't you use a blob's registered data url for regular workers in cap?
why not service workers :(
 
@AwalGarg Specifically service workers can't. I'll let you think why for yourself.
 
@Zirak *unless on localhost, where you can use http (nitpick, I know)
 
12:15 PM
Uncaught TypeError: Cannot read property 'jpg' of undefined
 
!!welcome Phoenix
 
@Phoenix 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.
 
@Zirak oh dammit, right. offline stuff
I feel stupid now :P
 
is the fallowing jQuery code correct ??

featuredArticle = $('.featuredArticle').toggleClass('blue');
 
But my sincere recommendation @Phoenix is that you go over some javascript intros
 
12:16 PM
@zirak please
 
You missed some basic stuff (which is okay, learning is good). Go over some tutorials, some websites, you'll see your mistake in no time.
 
ok sry
 
crl
@Phoenix what is an Array in JS? how do you make one?
 
@Zirak kindly please look my question
 
!!welcome Mahadevan
 
12:17 PM
@Mahadevan 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.
 
sorry zirak
 
@ivarni this was one of the thing which I originally thought as one of the "things in your ways", but then I thought registered urls should work :P apparently not, and quite logically as well ^^
 
when you guys have time kindly llok my question
 
@Mahadevan But I'll go against my better judgement and say that you should look up event delegation
 
@AwalGarg Yeah, I guess security needs to be tight with the amount of control you can get with serviceworkers
Oh well, back to hacking my hostfile
 
crl
12:19 PM
@Phoenix you there?
 
@Phoenix try this
<input type="file" name="myImage" accept="image/x-png, image/gif, image/jpeg" />
try something like that
 
wat
He needs to learn basic js...there's not much more to it.
 
ok
 
@crl I like to say they are "exotic objects" because it sounds cool :P
 
crl
yes hehe
 
12:36 PM
Hi.
 
12:59 PM
Anyone on Mac? What version node is installed if you install with homebrew?
 
@Zirak @copy oh man, I just went in a journey to nss. Fun stuff.
 
That doesn't sound fun. What'd you do?
 
mostly learn about how it all works
authenticate through nss-ldapd (to find the user) and use AuthorizedKeysCommand in sshd_config to get the authorized keys via a curl
(the ssh key is on another source than the ldap server)
also saw how nss modules are written... similar stuff than PAM
@Zirak since I have an idea for my next "project", I want to make sure it doesn't exist at first. Do you know if there's a linux app/daemon that automatically detects monitors, remembers the configurations and run xrandr as necessary?
 
@FlorianMargaine Probably. That scratches my memory.
arandr?
 
1:09 PM
I know that gnome/kde do that by default, but I don't want to go look at their code to steal the one part out of their huge stuff. Maybe it's just one small app though.
@Zirak afaik, arandr is a GUI for xrandr, nothing more
let me double check though
> ARandR: Another XRandR GUI - chrysn
yeah
 
You sure it doesn't have some autoconfig stuff? I vaguely remember reading about that years back
 
@Zirak the important bit is that it should call xrandr when a monitor is plugged/unplugged
@Zirak quick googling doesn't show anything
 
crl
@FlorianMargaine Did this modification on wikipedia is it ok?
because the English version has console.log too, seems better
 
@crl for the thing explained there, alert is better imho
 
Hey guys, consider reviewing my first JS project, on CodeReview here.
 
crl
1:14 PM
ah, ok I see, it felt weird too in the context
 
@HassanAlthaf why Omega.init...
 
@FlorianMargaine Was inspired by jQuery and didn't want the user to bother typing the new keyword. xD
 
you still don't need that...
you should throw errors, not strings
 
I know, it was just a learning attempt. :)
Oh.
 
you don't need to use else after a throw, that adds an indentation for no reason
 
1:16 PM
I see.
The throw gives an error to me in the console.
 
the explode method is completely useless
most of your other methods should go away too, use es5-shim if you care on ie8
 
I know. I miss the PHP function, explode() in JS. I know split is there, but still. :)
@FlorianMargaine What's es5-shim?
Is it like a Polyfill?
 
crl
why doing that object, if this is never used?
 
Array.prototype.explode = Array.prototype.split
if you really miss it.
 
heh
@FlorianMargaine Man you should compile a post for me. I bet it would be awesome. :)
 
1:19 PM
whats for lunch peeps?
 
Exceptionally awesome answers get a bounty.
 
like I care
 
Lol
You can hit 1k on CodeReview xD
Btw how is France now?
JS is so sxc. <3
 
JS is as sexy as a mutant kid
 
1:23 PM
http://jsfiddle.net/aSG6e/15/

with my current code i can able to clone datepicker but i have given one more functionality
if the user enter some random value 232323 will get an alert say kindly enter correct format this was working perfectly with the original text field but not on the clone one
guys kindly help me
 
@Abhishrek Who's a mutant kid?
 
1) if the user not enter the value in the original field type some random number get an alert

2) if user click clone type some random number get an alert this was also working

3) if the user enter the correct value in the original date and clone then if user type some randowm value in the clone field it was not working
 
@RyanKinal ryankinal.com yours ?
 
@Zirak Thanks. Seems like it. Didnt know Homebrew had the install scripts up there :) that helps :D
 
1:31 PM
@Abhishrek Look at the google+ account
 
just wanted to confirm still
 
that's why i don't add social stuff on my webpages
that badger cat wouldn't find me :p
 
@BadgerCat will find you no matter what
 
she still haven't ^^
 
That's exactly what she wants you to think
 
1:33 PM
she found a trail, but that led to a different person. There is a KarelG as webdev in belgium too ... i found that funny
 
@Zirak fine, I'll write the monitor thing then.
 
@FlorianMargaine Fine
@FlorianMargaine Be my rubber duck for a second.
 
sure.
$ ssh foo
Last login: Sat Nov 28 01:08:05 2015 from 10.0.2.2
Could not chdir to home directory /home/ralt: No such file or directory
ralt@foo:/$
fun stuff when authenticating an ldap user...
 
I have a resource which I can only query once per, say, second. I can query it for one thing or multiple things at the same time, but only once per second.
 
1:37 PM
@Zirak sounds weird, but ok
 
But I have multiple things which need to query it separately and without connection to one another.
 
well, you kinda need a global handler
 
If they were "organised" in some way and gave me all their queries at once things would work fine, but I need to be a gate keeper of sorts
 
if you're using DI, switching the injected dependency to a global instance shouldn't be that hard, should it?
 
So I'm trying to build a system where I aggregate queries over some amount of time, fire them up, and have to figure out how to take apart the response and give whoever wanted their info
 
1:40 PM
use callbacks?
(for the last part)
 
I'll formalise it a bit
 
you need an asynchronous model anyway
 
Of course, that's granted. I'm just trying to think of a scheme in which I can aggregate multiple requests into one and can take apart the response
 
that really depends on the backend
 
@ivarni sorry
 
1:43 PM
@Zirak the support in the response format can only depend on the rate-limited backend :/
 
function precious(xs) {
    // you can only call me once per second
    console.log(Date.now(), xs);
    var ret = xs.map(x => x * 2);
    return Promise.delay(2000).return(ret);
}

// part A of code
precious([4]).then(console.log.bind(console));

// part B of code
precious([17]).then(console.log.bind(console));
That's sort of what happens right now
 
well, it's not rate limiting at all in there
but I get it
 
// ideal world:
var magic = compose(
    aggregateOver(1000),
    precious
);

magic(4).then(...); // 8
magic(17).then(...); // 34
 
you need a way to "follow" the [part of request]/[part of response] mapping
 
I want only one call to precious to happen. Delegating back the response is...erm...I can deal with that.
I'll make up some id system
 
1:46 PM
then you got it sorted out?
 
Just need to figure out a good way to aggregate requests...
 
@Zirak don't relay and falcor do something like that
 
crl
rxjs?
 
is it considered greedy/assholeish to post my paypal coordinates on twitter hoping for people to give me their money?
 
@Mosho -_o_/-
Yes, that's the emoticon I was going for
 
crl
1:48 PM
@towc you'll be better do it in the street with dirty clothes
 
And no, I won't include a giant ass library just for this part. I've already reluctantly included bluebird.
 
crl
(will work better)
 
perhaps look into how they did it, though I doubt it'll be simple
 
They probably had to do it in super generic and fancy ways
 
let pendingRequests = [];
let lastRequest = Date.now();
function magic(request) {
    if (lastRequest < Date.now() + 1s) {
        return pendingRequests.push(request);
    }
    send(pendingRequests).map(Promise.resolve);
    pendingRequests = [];
}
@Zirak something like that? ^
you'll have to figure out how to properly resolve the promises, but yeah
 
1:51 PM
Something like it
...that's one of the things where a defer seems like the easy way out
Bet you $4 that @BenjaminGruenbaum answered a question about this before
 
Imaginary Holy Shit
 
$ tree /sys/class/drm/card0-LVDS-1/
/sys/class/drm/card0-LVDS-1/
├── device -> ../../card0
├── dpms
├── edid
├── enabled
├── intel_backlight
│   ├── actual_brightness
│   ├── bl_power
│   ├── brightness
│   ├── device -> ../../card0-LVDS-1
│   ├── max_brightness
│   ├── power
│   │   ├── async
│   │   ├── autosuspend_delay_ms
│   │   ├── control
│   │   ├── runtime_active_kids
│   │   ├── runtime_active_time
│   │   ├── runtime_enabled
│   │   ├── runtime_status
│   │   ├── runtime_suspended_time
interesting
 
bluebird's:
Promise.props({ a: somePromise, b: somePromise })
.then(function(results) {
    console.log(results.a);
    console.log(results.b);
});
a simple way to fire off a bunch of promises and keep them associated with a key.
 
not sure if that relates to @Zirak's problem or not..
 
1:57 PM
could actually help him, yeah
 
@Luggage even better with es6
 
perhaps, but not in any material way
 
Promise.props({ aPromise, bPromise})
    .then(({aPromise, bPromise}) => {
    });
 
if this isdynamic and you are gathering lots of requests, then that won't help
 
I just saw the Promise code. Isn't it like this way, that 1 promise should be fired up first, then on resolve moving on to another promise?
 
2:01 PM
only static.
 
@Luggage on args i usually use ...promises
 
@nickB you can do that, too.
 
and promise.all
 
command and conquer html5
 
2:02 PM
yea, promise.props is just an altenate that takes an object, but it's otherwaise exactly like promise.all
 
i know :-)
I like the ({ arg1, arg2 })
 
kind of like named arguments
 
im online now, only player
 
yea, me too, but that's only good when you knwo all the keys ahead of time, not for a dynamically built object
 
2:03 PM
true :-)
also have you seen
fn({a = defaultA, b = defaultB } = {}){

}
 
both of these are the same in JavaScript?
if(var == ''){}
if(!var){}
 
default arg + destructuring, yeah
@Shafizadeh no
 
@Shafizadeh hm.. they MIGHT resolve to the same answer with the same input, but they have slightly different meanings
only because of =='s type coersion would they maybe be the same
 
@FlorianMargaine yes I think like you. but I tested. they have identical bihavior
 
2:05 PM
what luggage said
 
@Luggage I see. tnx :-)
 
if (!someVar) {} is equivalent to if (!Boolean(someVar)) {}
 
alright
 
in short, use === for strict equality unless you purposefully want the looser equality.
 
crl
2:08 PM
!!> [ ![], !Boolean([]) ]
 
@crl "false,false"
 
@SuperUberDuper nice
 
@Abhishrek join the room)
 
@CapricaSix var a = []; a['22'] = 3;
sorry
 
I'm already up-to-date on my atheist sermons.
My sense of superiority over others is healthy.
 
2:16 PM
@Abhishrek seriously? I wonder how that'll end
 
@Mosho Don't care
I just enjoy hearing Krauss
i skip the religious bullshit
 
krauss porn
 
@Abhishrek Haven't you been obsessed with him lately?
 
@SomeGuy Not really.
 
krauss porn ?
!! urban krauss porn
 
2:21 PM
@KarelG No definition found for krauss porn
 
!!urban kraut porn
 
@Mosho No definition found for kraut porn
 
linode's giving $25 free credit to errybody
 
T_T
 
the sad thing is I don't have a credit card to preload the account :(
 
2:24 PM
@Mosho Rule 34 violation!
 
@AwalGarg wahahaha
 
laptop porn: MSI GT72S for 2700 $
 
@Luggage just because it's not on ud doesn't mean it doesn't exist
 
@KarelG not really
Macbook Pro is laptop porn
 
heh, that device is better than macbook if you simply check the hardware
 
2:25 PM
@Abhishrek whatatatatata?
 
-_- its not about better
 
at $150% the price, i hope so
 
FWIW I have had an Asus Gaming Laptop (topnotch) it died in 1 year.
 
but it's ok, you're paying for that sleek well-designed MSI
ohh, no, that was the macbook
 
@Abhishrek from asus ROG ?
 
2:27 PM
yes
worst laptop ever :P
 
since my laptop died, i bought one. 2 months in use. 10 months to see if it would break your statement
 
!!should I switch to "awal@js.org" everywhere or keep with the gmail one?
 
@KarelG use it as a laptop, not as a desktop :P
 
@AwalGarg You should switch to "awal@js.org" everywhere
 
take it move it around, take a flight, etc stuff
 
2:28 PM
but... that'd take sooo much time :(
 
@Abhishrek well, i use this laptop for work ...
 
why is nose-picking so ridiculously satisfying
 
but sometimes i play games when i have to wait for meetings :p
 
:D
I got a dell recently $759 but 960M Gpu and accessible Ram is a win win
 
if you like that, try picking at a scab.
 
2:29 PM
6th gen i5 :D
 
i know that mac has better technology with their battery, but this laptop can run 7 hours in normal business use. Not bad IMO
 
@Luggage haven't had a scab in years
 
my prev one barely hit 4h
 
brb injuring myself
 
my macbook can reliably do 4+ hours. not sute bout 6.
 
2:30 PM
I'm thinking I'll get an XPS next week
 
with brightness all the way up and lots of recompiles
 
pretty nice sales for BF
 
BF ?
boyfriend ? :D
 
512GB SSD. 16GB RAM, 6th gen i7
yeah, for my boyfriend, @Zirak
and intel HD graphics 5500 :D
 
@Zirak That was great! Thanks!
 
2:32 PM
I just noticed I have 11 followers on github o.O
 
the only thing at my laptop is the keyboard... really who checks the keyboard at the sale ? It has Home/ PgUp / PgDown / Power. Fucking no End button. It got replaced by the power button. So i don't have an End, unless i turn off the num pad ...........
 
the ultra-book or the 'normal'?
 
@Mosho err HD5500 ?
that must be a ultrabook
@AwalGarg I have even worse
 
@Abhishrek XPS 13
yeah, it's pretty sleek
 
Have used it :D
 
2:33 PM
@AwalGarg i have 0. :)
 
its a great ultrabook.
 
11 followers is "worse"? for my nearly empty account it is astonishing that 11 people cared to click it :P
 
@Abhishrek what's truly great is the $500 off
on the newest model
 
looks nice, if it's got multi-touch and a keyboard with a home/end, then nice.
 
^--- lol
FU
 
2:35 PM
@Mosho really cool !
 
:)
 
I bought my dell recentely soley because its 20ish % off + Worldwide warranty (phew)
 
yeah
makes you wonder about their margins without the sales
 
@Mosho Oh I know for sure they make it ~2x price of production
to account for the cost of development, logistics, QC, Windows
 
Hi all, anyone have experience messing around with CSS keyframe animations via JS?
 
crl
2:43 PM
dev? well the shitty additional softwares pc brands do
 
@Zirak the monitor stuff is interesting. there's a standard data structure called "edid" that provides all the information you want about a monitor
@Jimbo the js part with keyframes is usually adding/removing classes
 
@FlorianMargaine Imagine you don't want to just play / pause though, but have a draggable slider to move backwards and forwards in an animation - struggling to figure which event to be looking out for / changing to fake this. Looking at animation delay atm
 
crl
very unclear what you're doing, fiddle?
 
^--
but there are drag events fyi
 
@Jimbo looks like something I'd do with many classes or just style property changes instead of keyframes
e.g. jquery's animate
 
2:50 PM
Basically my colleague who is now on holiday has come up with an algorithm I'm struggling to understand that controls keyframes via a slider. I can't paste the whole animation + keyframes because it's IP but... here's the code... if nobody can make sense of it that's fine
var timeline = document.querySelector("#js-timeline-control");
    var allSlides = document.querySelectorAll('[data-fluid-component="fluid-slide"]');
    [].forEach.call(allSlides, function (slide) {
        var delay = +window.getComputedStyle(slide)["animationDelay"].split("s")[0];
        console.log(delay);
        Object.defineProperty(slide, "fluidAnimationDelay", {
            writable: true,
            value: delay
        });
    });

    timeline.addEventListener("input", function (e) {
So you get your timeline, loop through and get the animation delay property, then add a new fluidAnimationDelay property that's writeable. Then on input change of the slider, get the delay and do some magic
(-5 - slide["fluidAnimationDelay"]) + (14.5 * e.target.value / 100) // wtf is this?
Meh, maybe I can't get help in here without pasting. Just in case anyone had done CSS stuffs via JS, I'll wait until he's back :-)
 
crl
just some operations
he reads the existing style and updates it
 
I've messed around with the numbers (maths isn't my forte), -5 seems to change where the animation starts from if you change it, and the 14.5 where it ends. I can't procedurally change those to accept any animation without knowledge of how it's figured out :P
 
crl
-5 means... -5
 
Yes, but why would it be -5?
Well, actually "-5s"
I thought all animations would start at zero seconds, then go upwards. But here's a minus
 
crl
the end result should be >0
 
2:55 PM
Hmm
 
crl
14.5 * e.target.value / 100 - 5 - slide["fluidAnimationDelay"])
A - 5 - B
 
your coworker needs to learn how to use parentheses
 
crl
yeah
 
lol
Oh, and also this doesn't work in safari, but does in chrome. Was thinking -webkit prefixes but no difference :D
 
is it (14.5*e.target.value)/100 or 14.5*(e.target.value/100)? no idea
 
2:58 PM
What order does JS do it?
 
crl
same
 
@crl is it? I mean, mathematically, yes. but with floating point numbers?
 
[].forEach.call ... every or map would be more ... comprehensible :P
 
crl
ah.. :) does it matter there
 
@Jimbo no idea. I've never wanted to keep these ops precedences in my head.
 
2:59 PM
lol
 
hence, Lisp.
 

« first day (1869 days earlier)      last day (3080 days later) »