« first day (3229 days earlier)      last day (1724 days later) » 
04:00 - 19:0019:00 - 23:00

4:04 AM
 
 
2 hours later…
6:31 AM
is that meant to be a reference to something?
 
no idea
 
@Atulkumarsingh I literally read the entire webrtc spec and some related specs/rfcs
not the most efficient, but the most sure way you more or less get what's going on
took about 30 hrs
if you're uber stuck and you're not on an urgent deadline, I recommend you do it too
couldn't find many good resources about it online. It's a very partitioned but coupled system
 
can you guide me to a proper resource to read or see ?
 
I just did
 
6:45 AM
google "webrtc spec"
you'll find a long document
that's the one
 
okay thanks i'll have look
 
6:58 AM
@towc some RFC comments are hard to track the progress if you want to continue where you left of
 
sure, but there's some specific ones mentioned in the webrtc spec that really help clarify some things
for example, jsep and sdp
 
yup
that's why I read those if the documentation is not so sufficient or vague
 
7:53 AM
yeet
 
8:23 AM
How can I use number formaat like this in JavaScript . this is done in twig.
number_format(0,",","")
 
can you explain what is it supposed to produce?
 
is that removing the , from the output?
 
I am getting number value and in twig this number fromat is used to formaat like that. I I need to reformat like that in javascript
 
better to supply the actual number value somewhere hidden (as data-attribute)
 
@luffy sure. But I don't know twig or what their methods do. Can you show an example output you'd like to produce? Is the output variable, or will it always be a certain format?
 
8:27 AM
twig is a PHP template
 
@luffy I mean, that's invalid in PHP
 
ah been a while when I used twig: twig.symfony.com/doc/2.x/filters/number_format.html
 
I will try to dump an example.
 
so output is 0 decimal, have "," as decimal breakpoint and no "thousand" splitter
 
@KarelG yes
Like that
 
8:30 AM
!!> Number(5.5).toLocaleString('es')
 
@BenFortune "SyntaxError: identifier starts immediately after numeric literal"
 
@BenFortune "TypeError: Number(...).toLocalString is not a function"
 
toLocaleString
 
fuck you cap
 
8:30 AM
@BenFortune "5,5"
 
just use .toFixed(0) (be cautious, it rounds the value) or use Math.trunc(...)
 
@KarelG or toPrecision, for no rounding
 
does it not have a required argument > 0 ?
 
@KarelG I tried to use like this parseFloat(scan_item[1]).toFixed(0, ",", "");
parseFloat(scan_item[1]).toFixed(0, ",", "");
 
you have to check the function in the documentation to comprehend how to use it correctly first
Math.trunc(parseFloat(scan_item[1]))
that does not round btw
 
8:33 AM
RTFM
 
if you want to use rounding, use .toFixed(0)
 
You can't just pass random parameters to functions and expect it to work
 
say that to javascript :P
 
Ok thanks for feedback
 
 
1 hour later…
9:34 AM
lol. someone tried to GET myCorpDomain/%75%73%65%72%2e%70%68%70 (which is user.php)
nana. me smart. no 4cc3zz.
 
4cc3zz?
oh
took for a very long time
 
 
2 hours later…
11:08 AM
Guys, refer jsfiddle.net/431ezm2y I wanna keep the footer part sticky. What should I do?
 
1 message moved to Trash can
@RashedulIslamSagor Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
@CapricaSix ok thanks.

@RahulJain try this :

.footer {
  position: fixed;
  background: #f00;
  width:100%;
}
 
@RashedulIslamSagor Not working
I wanna keep the footer inside the container
 
11:31 AM
@RahulJain it can be googled btw. But I would be familiar with flexbox and just use it. Like jsfiddle.net/vnhLas9o Is it what you want?
 
11:42 AM
Hi guys, do you like js puzzles? )))
 
puzzles!
 
"use strict";
const string = '_';
let data;
console.assert(
  typeof (data = JSON.parse(string)) === "object"
  && data.hasOwnProperty("\u{0030}")
  && typeof Object.values(data)[0] === "object"
  && Boolean(data[+false]) === false
);



what should be placed in string value to pass assert ?
 
use ctrl + k to format, btw
 
lol @ \u{0030}
 
no
 
11:44 AM
I am just pointing out that the unicode is a giveaway
 
ooops ) my bad in this case )) thought it was your answer )
My friend trying to solve this about 2 days. I just saw this. and have no idea also
 
Looks like an interview question
 
yea I think it is
but anyway ) could we solve this? I'm curious
 
done it
 
yeah it is an array with one element in it
 
11:50 AM
?
 
the Boolean(data[+false]) === false is bit tricky one to figure out the element. But if you get it, you got the string
 
so how to modify the string?
 
Try to comprehend what happens in the assert
 
Protip
!!> Boolean(null)
 
@BenFortune false
 
11:55 AM
@David I'd recommend thinking what karel pointed out the tricky part is. If you can't figure this out using your knowledge, try console logging what +false is
 
yeah trying right now
 
Also there's more than one correct answer
@Michael go away
 
omg its michael
 
o.o
 
thanks for helping guys. P.S. Damn tricky JS ))
 
12:18 PM
Fight me
 
does 100vh === Math.max(document.documentElement.clientHeight, window.innerHeight || 0) ?
 
Well obviously, since you pulled it from an SO answer.
Oh, 100vh, no
9
Q: JavaScript calculate with viewport width/height

Tobias AltI am trying to set a responsive point in my mobile Webview and did this: var w = window.innerWidth-40; var h = window.innerHeight-100; This works great so far. But the values -40 and -100 are not in the viewport scaling height and width. When I do this: var w = window.innerWidth-40vw; var h...

 
12:38 PM
@BenFortune what do you mean with Oh, 100vh, no?
 
I mean no, your statement is false.
 
it can be true.
but mostly falsey
 
Yo boys
 
@Aurelius if you want to have your viewport that size, just set that in CSS
Hi Baldrani
 
Im on vue and I just want a tiny tips
 
12:43 PM
@vue
where is he
 
@KarelG I need to have the number in computed in javascritp
 
@Aurelius Check the link I posted
 
Any idea on how to transform this :

:params="{ 'photo[sort_keys[author]]': customer.firstname }"
 
well, execute that snippet in the right operand?
 
Into something like { 'photo[sort_keys[author: customer.firstname]]' } but with the customer.firstname evaluated ?
I can make it works with computed but if i can avoid it
 
12:44 PM
@KarelG I did and it works but @BenFortune says the stetement is false
 
fuck me
 
@BenFortune I did
 
please read the context ...
@Aurelius that comment might be true, that is what Ben is saying. The right operand can be 90 or 953 or 11.3525 or whatever the viewport is
 
1:02 PM
How can I use here
var grd = ctx.createLinearGradient(0, 0, 170, 0);
instead of 170 a computed value
with CSS' calc
 
That's a canvas. It has it's own resolution
 
yes but how can I use calc instead of a javascript number?
 
You write javascript code to do a calculation
 
lol
 
I can't
 
1:05 PM
you can
 
already did that
 
ctx.createLinearGradient(0, 0, a+b, 0);
like that
I believe in you
 
I can't because the server can't do this:
const h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
 
why is the server looking at the dom?
do that on the client
duh
 
and the result is that the first paint of the page can't have computed values
then when the client kicks in it computes the stuff
and goes right
but the first paint can't be done
 
1:07 PM
so you want to avoid the UI shift when the UI is 'corrected' with JS?
 
apparently
 
there is like 1000000 articles on how to accomplish this depending on your setup
 
Personally, I'd use document.body.onload.
 
@Aurelius is this for the height of the canvas
 
@JennaSloan why?
 
1:10 PM
The code you pasted was for a gradient
 
also what does that have to do with his problem?
it isn't an issue of waiting for the DOM to load, it's an issue of reading the DOM in a place that it exists.
 
I don't know what you mean
 
@Cereal the gradient depends on the viewport heigh
 
@Cereal he wants the height of the canvas to calculate the gradient
 
ctx.createLinearGradient(0, height - 20, 0, 50);
 
1:11 PM
@rlemon does that not depend on the resolution of the canvas?
if your canvas is 400x300, it doesn't matter how big it is in the dom
 
correct
but if his canvas is set to the viewport
onload
he should do this in the same place
if his canvas is set via css, he's fucked and just doesn't know it yet
 
but why can't I just use a normal linear gradient? linear-gradient(...
 
I feel like setting a fixed resolution for canvas, like 1920x1080, or whatever, makes canvas a lot easier to use
 
@Aurelius you can
 
@rlemon really? How can I convert it?
 
it is used to fill a plot done with react-chartjs-2
 
if that isn't what you mean, then you need to walk away for an hour and learn how to ask questions. because you're confusing as fuck and constantly creeping in more information
and no one wants to help people who do that
 
what do you mean? what you sent seems really relevant and helpful
 
Because you went from does 100vh === some calculation to I want a linear-gradient on my canvas
 
in a library
 
1:16 PM
To "im using this charting lib in react"
 
sorry guys you are right, I just didn't wanted to give you a big problem to solve for me and instead ask simple questions. But I recognize it turned out harder for you and worst
 
Apology accepted. Now don't do it again
;)
 
what a plot twist here
 
With Three.js, Is it possible to do change the colors of a textured 3D model akin to CSS's "hue-rotate()"?
 
1:29 PM
you can reapply the material, right?
I think
There most likely is better ways to go about this, though
 
3
A: Use a texture and a color on a cube three.js

BrakebeinThe color of a material has always an effect on the appearance of the object even there is an texture on it. The default color value is white and the texture looks just normal. But if you set the color to red, the texture will turn reddish (e.g. if you have a black/white texture, you will get a b...

 
I dunno, the models are loaded with ColladaLoader
 
2:08 PM
Hey all
const app = require('./src).createApp(require('./src/repositories').repos);


opinion time... what do you think about initializing your repositories while creating app in express + node.js setup
i am looking at someone's else code btw
 
repositories as in?
 
as in your app runtime cares about the way it is being distributed?
 
Bueno
 
2:23 PM
dias
 
I'm starting to like Angular and NgRx
Does that mean there's something wrong with me?
 
You are questioning that to yourself? Well yes then, no? *nods*
 
Most people here really dislike Angular. But after using it for quite a while I think I like it quite a bit.
But I did initially hate it.
So I'm not sure what that means. Are they wrong? Am I out of touch?
 
most people here don't like being locked into a model
if you write Angular, everything is Angular.
 
I disagree with that from a general perspective. Are you talking about the template syntax they custom wrote?
And the NgRX pattern?
 
2:30 PM
you disagree with what? that people don't like being locked in? or that angular isn't an opinionated framework you must work within
 
Sorry, the third statement, "If you write Angular, everything is Angular"
 
> an opinionated framework you must work within
 
@Vap0r out of touch? depends of the angular version. It is just a framework as another. One may like it, another does not. IMO angular seems ok but if used badly, it leads to dirty codebase. Key problem is that many angular developers does not use it correctly. I have tried that and when reflecting on my first project, I have considered that Angular is just not good for me. It is just the design schemes that does not fit in how I think what MVC stands for
 
means exactly that
 
Well I mean, ES6 is an opinionated framework you must work within too, techinically
 
2:31 PM
no
 
How so?
 
ES6 is not a framework. It is a standard
 
^
 
Fair, doesn't make it any less opinionated
 
Angular runs on top of JavaScript code which may use ES6 features.
 
2:32 PM
I don't think you understand what opinionated means here
 
Maybe not.
 
people hate on JS generally for being unopinionated about things
 
So not opinionated in the sense that it is created through consensus and opinions, but opinionated in the sense of how the designers feel you should write your code?
 
correct
 
well, a standard typically dictates how you must write your code, not how you should write your code
e.g. syntax
 
2:34 PM
@TylerH ie8 and 9 would like a world lmao
 
I hate JS for being not sync... and you have to use async and await keywords to make it sync
 
stylistic things like using switches instead of for, indentation amounts, new lines, etc. are not really a 'standards' topic, but rather a best practice conversation
 
@rlemon I can see that though, I would say all frameworks are opinionated, but definitely can see how Angular is more-so.
At least more-so than react and vue (the only other frameworks i have experience with)
 
@Vap0r Yeah, I had to support IE8 and 9 in websites/apps til 2-3 years ago
now I get to support IE11 and up
 
I think we still support IE7
 
2:36 PM
How do you do that replacement thing again?
I'm trying to replace "IE7" with "vulnerabilities"
!!/IE7/vulnerabilities
 
@Vap0r That didn't make much sense. Use the !!/help command to learn more.
 
rats
!!/help
 
@Vap0r Information on interacting with me can be found at this page
 
23 users does not warrant support
 
2:39 PM
^
I still get records from that user that is unable to use a service or two because of he's using an out-dated browser
 
<1% honestly doesn't warrant support
 
I even wrote this
Aug 12 at 13:17, by KarelG
OS: Windows XP
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
  |-- Browser: Firefox
  \\-- version: 3.5.2
followed by
> I immediately marked bug as "By design" because I aint no doing shit letting the page functioning for that version.
I just provide support for IE, albait only version 11. Rest can FO.
 
Same would be nice to drop IE11 too though
 
I support whatever is easy to turn babel down to support
pretty sure that's ie11 now
 
@Loktar Yeah
 
2:42 PM
might just be edge tho
 
IE11 is pretty easy to support
 
I think we will do that here once everyone's officially moved off of Windows 7 to Windows 10 *looks at myself in the mirror *
 
so I bet it's IE11 for you @rlemon
there are just some small annoyances with it that I'd prefer not to deal with
 
probably. I setup that env a while ago and haven't touched it since
 
@TylerH Win 10 ships with it
 
2:43 PM
I don't test on IE or edge
 
it's fucking annoying
 
if it works, it works.
but my client facing code is all targeting mobiles.
so I have my own set of issues
 
Win 10 is pretty annoying about letting you use IE11 though, telling you to use Edge instead
 
@Loktar by default, Edge is suggested. But users can search for "internet explorer" tho. MS could have binned it.
it is just a tab page ben?
 
That's the real issue
there is no EoL for IE11
 
2:45 PM
actually I like that MS does it because people should really stop using it. Yet it is annoying for us when we have to test the functionality in IE
 
they said they will continue to update it as long as Win 10 is updated :/
 
Meteor has a way to pretend async code is sync in node
uses fibers, I think
 
> Security updates, compatibility fixes, and technical support continues for IE 11 on Windows 7, 8.1, and 10.
A lot of people still seem to use it which is so annoying lol
 
lol, blame flash/java applet instead Loktar
 
Friends don't let friends use Meteor
 
2:46 PM
there is plenty legacy company apps that requires IE to function because newer browsers are more secure.
 
There is an internal app here that still runs on shockwave flash
 
@BenFortune sorry, Canada only got it last week
 
bleh.
 
2:49 PM
It's really not bad
 
probably
 
@Loktar I loved this comment
> Create a Chromium-based browser with an IE 11 skin. call it “IE Next”
 
I'm sure KO isn't bad either.
but it's just old
 
Peek around this
It's super modern
 
@KarelG hah, yeah I remember when Google tried that
With IE6
Google Chrome Frame is a plug-in designed for Internet Explorer based on the open-source Chromium project. It went stable in September 2010, on the first birthday of the project. It was discontinued in February 2014 and is no longer supported.The plug-in works with Internet Explorer 6, 7, 8 and 9. It allows suitably coded web pages to be displayed in Internet Explorer by Google Chrome’s versions of the WebKit layout engine and V8 JavaScript engine. In a test by ComputerWorld, JavaScript code ran 10 times faster with the plug-in on Internet Explorer 8.Development of Google Chrome Frame was required...
 
2:49 PM
They should re-brand as a build tool. Make the ddp layer optional
 
Couldn't convince the gov to use it though lol
 
@Cereal "super modern" -> meteor + mongo
 
You don't have to use mongo, that's what I meant by make the ddp layer optional
 
@Cereal I haven't tried it in a while, last I heard was DDP didn't scale well at all
 
If you removed the ddp layer, you remove the mongo requirement, and it becomes just a buidl tool
And that's what a lot of people do, afaik
But yeah, I heard it doesn't scale well
 
2:51 PM
It uses apollo now doesn't it?
 
Nope, they just make apollo
 
Still too bloated IMO, takes me back to feathers and sails
I used to love sails
 
I've just been using the defaults. It's nice for my projects, since no one's going to use them anyway
There's no worry about scale
 
Until there is 😃
 
Won't happen
 
2:53 PM
<- lone dev here
 
using apollo is just 10 lines or so I think, and then you remove the reactive whatever package
 
future you will hate past you
trust me
 
Pfft
Like I maintain personal projects
 
3:33 PM
What is good my fellow JSers!!
> future you will hate past you
present me too!
 
posted on August 19, 2019 by CommitStrip

 
I'm writing a humdinger of a JS app! Would anyone be interested in perusing my code text?
 
3:48 PM
wut
 
Lol sorry I'm in a weird mood.
 
 
1 hour later…
5:07 PM
hmm what is the replacement for the css min() function people use right now?
 
@SureshKommuri Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@Vap0r yeah
 
@paul23 use?
 
applied to this function ?
 
5:21 PM
1 message moved to Trash can
@OtávioBarreto Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@OtávioBarreto Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
    function changecolor(input) {
  document.getElementById('tag').innerHTML =
    input.value.replace(/((\#|\@|(https?:\/\/))[^ ]{1,})/g, '<span style="color: blue">$1</span>');
}
how to make this function above
applied to this function bellow?
<script  type="text/javascript">
$(document).ready(function(){
    $("#img_description").keyup(function(){
        // Getting the current value of textarea
        var currentText = $(this).val();
         // Setting the Div content
        $("#text_output").text(currentText)
        //$("#text_output").text(currentText);
        //$("#text_output").value(currentText);
         $("#text_output").attr("value", currentText);
    });
});

</script>
 
.html if you want the span to be rendered as a span
rather htan presented as text
however, note that that means all other html put in the textarea will also be rendered
 
I only need $("#text_output").text(currentText)
 
right
.text creates text
your span will be presented as text if you just replaced the value using the regexp above.
 
$("#text_output").html(currentText) ?
but hot to apply the regex with the currentText var?
how
 
5:26 PM
copy paste
 
how would u do?
 
the .replace does what you want right?
so copy it from the snippet you don't want to the one you do. Literally copy paste it.
 
$("#text_output").html(currentText).replace(/((\#|\@|(https?:\/\/))[^ ]{1,})/g, '<span style="color: blue">$1</span>'); ?
 
well, no
you want to replace stuff on currentText
That code replaces on the return of .html... but will fail because .html('sometext') returns a jquery collection.
 
5:44 PM
how should I do so?
 
@rlemon for as in an div (containing an image) I wish to scale to either 50% of page width, or 256 px, whatever is smaller.
Using min/max width isn't working due to stackoverflow.com/questions/57557477/…
 
got this
 var currentText = $(this).val().replace(/((\#|\@|(https?:\/\/))[^ ]{1,})/g, '<span style="color: blue">$1</span>');
         // Setting the Div content
        $("#text_output").html(currentText)
        //$("#text_output").text(currentText);
        //$("#text_output").value(currentText);
         $("#text_output").attr("value", currentText);
would I have some problem with $("#text_output").attr("value", currentText);?
 
why would you do that instead of .val() ?
 
$("#text_output").html(currentText.replace(/((\#|\@|(https?:\/\/))[^ ]{1,})/g, '<span style="color: blue">$1</span>')); ?
I think it's
 
6:09 PM
yuck, jquery
 
If I'm using an object hashmap or a javascript Map there's not really many great ways for filtering them, is there?
 
@rlemon yeah but that causes aspect ratio problems if you have (say) max-height at 128px -- or if you use content-fit: contained style it causes the containing grid to still be 256 px wide.
Thus having a 128 pixel "padding".
 
6:25 PM
so show me your actual problem then 😛
ask generic questions -> get generic answers
 
Well the problem is the linked question... One solution I found that works is using only width instead of min/max width, however that had another problem for responsive design.
1
A: Force image to stay between height & width "boundaries", as well as keep aspect ratio

HưngIn order for the image to maintain aspect ratio, use css property "object-fit: contain;" on the image tag

Have to go now though, appointment in 5 mins
 
04:00 - 19:0019:00 - 23:00

« first day (3229 days earlier)      last day (1724 days later) »