« first day (3512 days earlier)      last day (1659 days later) » 

02:43
HiAPL works!
I compiled my first script!
yayayyayayayayya
03:06
i got it! Object declarations and initialization use attributes!
 
5 hours later…
08:10
@Feeds first time I am totally clueless of that xkcd ._.
ok just checked explain.xkcd, it is about a postcast and an odd non-SI unit. And then the last panel ... ugh. Not a good comic this time.
@KarelG I think it's the astrophysics equivalent of throwing in buzzwords
playing off of "quantum foam" and "Planck yeast"
yeah, those inventions must have some machine learning involved, using a neural network to find its actual value
I honestly didn't even know "millibarns" was a unit of measure
08:31
how can I disable an input field when another input field is not empty
add an event onblur to the input field you need to test
add/remove a disabled="disabled" attribute to the other input based on whether or not the value of the input causing onblur event is empty
pretty straightforward really
but how can I check if the first field has some input value
input.value.length > 0
or if you want to exclude the possibility of spaces, you can apply a regex check on it
do i need to use if condition?
its a dynamic add/remove input value, when the first instance of input field is created and the filled with value, it will then automatcally disable the second instance
08:57
@Neil no .trim?
@KarelG if that's all you require, sure
10:01
Does anyone know how to make this code snippet terminate naturally? I have tested similar async functions this way, by running node file.js, but this is not terminating.
Respected members, greetings. I am using google drive File picker scenario by following the link gist.github.com/Daniel15/5994054 but i think i am making some sort of mistake in filepicker.js file. because i am seeing the error in console as following:
Uncaught TypeError: Cannot read property 'access_token' of null
at window.FilePicker._showPicker (filepicker.js:53)
at window.FilePicker.<anonymous> (filepicker.js:44)
10:26
@hirazzz the error seems pretty straightforward
whatever is getting returned prior to your call to .access_token is null
if google drive file picker is returning null, then it probably means the file doesn't exist?
just a guess
@Neil i think there is just an issue of access token. and everything seems fine. dont know where i am lacking.
that's not what the error is saying though
it isn't saying access_token is null, it's saying that its parent is null
Hi All
i was using request module for making a post call to hubspot
hiya
it is working fine, now i have to change the approach and use axios
im getting exception as Invalid input JSON: No content (empty input stream)
i will share my sample code here
var options = {
                method: 'POST',
                url: ''https://api.hubapi.com/contacts/v1/contact/,
                qs: { hapikey: APIKeyHere },
                headers: {
                    'Content-Type': 'application/json'
                },
                body: {
                    properties: [
                        { property: 'email', value: [email protected] },
                        { property: 'firstname', value: 'JamesBond' },
                        {
                            property: 'lastname',
10:53
@SamSam I'm not familiar with axios
but I would double check where you're supposed to provide the json to be sent
also you have an error in your url value
 
2 hours later…
13:13
Does anyone know how to set up integration tests to test firebase applications, in particular the callable firebase functions?
hi, can you send an email confirmation through plain javascript?
@Dipzera 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.
if the javascript is running through node.js, yes
or if you can otherwise reach a mailserver
14:02
Javascript in ejs is not running through node.js.can anybody help me?
Javascript in ejs is not running through nodejs.Can anybody help me?
?
question does not compute
ActuallY I am trying to get values from ejs page to my node js using req.body
but am not able to get them
Hi, this is my codepen https://codepen.io/lakshmi123__/pen/yLYGoVP?__cf_chl_jschl_tk__=662e308049cae9e8c4a82cebcc474a206488f9dd-1590673107-0-AVJ-Rj1l5ozeIRC4rjKUDjnvoUV33irkFvYHv4htrkaXog-vZ0KAbFjIcVmE1a60FllMG-JNPjOsKlkO3OoAVzKDg7lVek23eh9vYo19chO9NbHh5wtLvOSG0784un9uptHWRtrkJg8SAFNmwAkzysqCFINcJ7M36VZbVOv8ezt7DuB1152gHkhqYbYoipGAHP6STk2jeJr1IcjrkKAPgIVnNdJeqocNEbWyFtYGvoE6CzrOW8VMhHu6g_ha0B-KpsKVYzlc7TQvEaBazBVp4pZID3D1HdQR0o8ykDAN8_3Mc7B4vGn2RXp1G2vLxeYyaYxcxF2j3v4hCkm6HcgAhCLwKMmgRO83EtNHUcbftreR
as I am getting an error like cannot read property
@user14 ejs is a tempting language. Please show some code of how you are trying to access the request body.
14:06
ok
@user14 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
1 message moved to Trash can
@user14 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
1 message moved to Trash can
@JBis Can you help me?
@user14 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
@user14 not your ejs code, your javascript code
14:11
@JBis ok
you cannot access the request body in ejs (unless you pass it)
|| starspam
!stars {1}
the star feature is not meant to be used as a "like" feature. Please respect it
app.post('/wyg_email', function(req, res){

	console.log(req.body.emailId);

	var email = req.body.emailId;

	var sql = "INSERT INTO whatyougot_mail(email) VALUES(' "+ email +"')";
	con.query(sql,function (err, result) {
        	if(err) throw err;
        	console.log("1 record inserted");
	  });
	res.render('whatYouGot');

});
but am able to get values when I run this as a html file
function alert_email(){
                    	var email = document.getElementById('Email-ID').dataset.value;
                    	if(email.length == 0)
                    	{
                    		alert("Please enter Your email id.")
                    	}
                    	else{
                    		alert("Thank you,Your email got submitted");
                    	}
                    }
@user14 are you use express?
@JBis yes
14:14
Sidenote, your sql is vulnerable to sql injection
@user14 what does the first console.log log here? Anything?
@JBis am just using it to get the value on cmd
yes, and does it show?
@JBis no
ok so whoever is posting to your page isn't including email id in the request
your are accessing properly (minus the sqj injection)
yes
but am not able to get the values and getting an error like TypeError: Cannot read property 'emailId' of undefined
at F:\mysql-test\instarecipes.js:77:23
at Layer.handle [as handle_request] (F:\mysql-test\node_modules\express\lib\router\layer.js:95:5)
at next (F:\mysql-test\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (F:\mysql-test\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (F:\mysql-test\node_modules\express\lib\router\layer.js:95:5)
14:21
What is undefined?
@KevinB It was saying that the emailId was of undefined type but I have mentioned it in input tag
no
it's saying you're trying to access a property named "emailId" on something that is undefined and therefore has no properties
what is the something
    <div class="form-group">
				<form action="/wyg_email" method="post" name="what_you_got_email" class="form">
            		<input type="email" class="form-control" name="emailId" id="Email-ID" aria-describedby="emailHelp" placeholder="Enter email"><button  type="submit" class="click" onclick="alert_email()"><span>Submit </span></button>
        		</form>
        	</div>
@user14 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
that's... a div and a form, it's not the something the error is complaining about
14:25
ok.So how can I resolve this?
> TypeError: Cannot read property 'emailId' of undefined
**at F:\mysql-test\instarecipes.js:77:23**
ninja'd
the error is telling you where to look
@KevinB at console.log(req.body.emailId)
so req.body is undefined
that tells me you don't have any middleware for accepting what that form is sending to the server
14:28
@KevinB req.body is used to get values right
if... there's values on it
@KevinB yes but I have written emailId as a name for the input
1 min ago, by Kevin B
that tells me you don't have any middleware for accepting what that form is sending to the server
just accessing req.body isn't enough
can you tell me clearly
you need the part that takes the incoming data and puts it there
it's called middleware
14:29
ok
for handling form data
so what can I do now
add the middleware
How?
14:36
@KevinB I have required body parser but haven't used it
Thanks a lot it worked for me
But there is another issue for me
15:09
interesting, there seems to be two "contexts" in JavaScript. A block context, and an 'expecting result' context. Expecting result context can only have call expressions, literals, and identifiers. Block statements can have everything else.
if(/* expecting result context*/){
    /* block context */
}
/* block context */
const x = /* expecting result context */;
while(/* expecting result context*/){
    /* block context */
}
i don't know if i'd call it a context
what would you call it?
Also, for loops seem to be the only exception.
an expression
but it can be a literal or identifier, both of which are not expressions
example?
15:15
if(x){

}
x is an expression that returns x
x isn't a expression, its an Identifier
yes, but it's being used as an expression.
function foo () {} is a function
but it can be used as an expression
15:16
if(function foo () {}){

}
interesting, thats valid
when used as an expression, it wouldn't create foo as a callable function except within foo itself
yes, but thats still a sub class of "Expression"
so its valid
what you're calling a context can't have it's own this, it can't have it's own variables, it... has nothing a context typically has
so...
not a context?
Yes. Not the correct word. Didn't mean "context" in the context of run time JS "contexts" ;)
ah, that explains the confusion then
so...
i guess i don't understand the point
> An expression in a programming language is a combination of one or more explicit values, constants, variables, operators and functions that the programming language interprets and computes to produce another value.
in both of the examples you gave, it's still an expression
whether it's x or x === 2
it's still an expression
15:21
hmm
so why call it a context?
lol
in both of those cases, the /* expecting result context*/ is interpreted and used to produce a singular value
Ah, I guess you are right. "Literal expression"
I wonder, if I SSH into a server, where is the bash history saved, at my local computer or at the server on the account I used to log in?
server
once you enter ssh, ssh program takes over. So they are def not on your local computer. Similar to vim, you don't see everything you typed in your bash history, just the vim command because vim takes over.
15:51
uh could be that the ssh program at your computer manages the commands
16:09
Could be wrong, just my guess
Hey there guys, I have a modal "object" that I would love to use in all my JS files, but I am using JQuery and am in it pretty deep. Most of the time, I just copy and paste an object into a file, but there has to be an easier way to do this. How would I make this into a plugin or a file that I can just "import"?
https://codepen.io/byuilazenbyt/pen/VwvJboo
16:55
This is something I have wanted to do for a long time
just include it as a library
have a dedicated javascript library which defines this object
then include it on every page where you use it
I have never done libraries, how do I do that?
well like you include jQuery, you'd include your own
<script src="/js/common.js"></script>
Right I understand that. But I have tried that, and it doesn't grab that object even if I include it before my called sheet
Do I need to not include it inside $(function() {}); ?
well you have to assign it to a variable like you would do if it were in any other javascript script
no, but when you use it you should include it inside $(function() {});
17:03
Like let a = new Modal();
sure
Except that its not a class
then use use "a" variable in another script
Its defined as a constant
it wouldn't matter
17:04
so even if I have

const Modal = {//properties};

I can do

let a = new Modal;
?
no.. if you separate code in its own file, it still has to make sense as if it were together with every script which follows
you could define class Modal, then you can use Modal as a class, like you would if it were all one big script
Hmmmmmm I wanted to do a class but I remember there were some things I couldn't do.... I can't think of them right now though
make it work all in one script, then you can cut and paste the common code in its own file and have it included first
inside a $(function() {}); right?
again, same rules applies as if it were all together in one script
you can define a function and call it immediately
generally you want to wait until the page is completely loaded, but you can be sure all the script up to that point has been loaded
if it didn't work that way, a lot of pages would break
ideally, everything is outside the $(function() {});
17:11
hmmmmmm
and you use that just to get the ball rolling
oh wow, I didn't know that was a thing, coding jQuery outside the start function
but it works
you don't need to use jquery for that either
document.onload = function() {
};
this will do it too
hmmmmm interesting
it's easy to start with jQuery but difficult to wane off of it, so I would advise you to try to find the non-jQuery equivalent of everything
there are 1-to-1 solutions to mostly everything that jQuery offers these days
couldn't be said when it came out though
17:21
Oh that's not an issue for me, just wanting to make it more "object" oriented, so I can make a little framework for my design. For me, jQuery is just a lot less troublesome with event listeners and Ajax requests.
17:39
meh
17:50
meh
Are the parenthesis () just a short form to return multiple lines of code? Instead of doing return {...} I can omit the return and do ({...}) ? And furthermore, those parenthesis are used to distinguish between an object ({obj}) and a block of Code {code..}?
errr, no, not necessarily. I think you're getting confused by the arrow function syntax
it's a special syntax that only applies to arrow functions
x => 5 is a function with an x argument that returns 5. you can wrap 5 in parenthesis, and it will have no effect. If you wrap it in curly brackets, you'll have to use the return keyword. when returning an object using the first form, parenthesis are needed to differentiate between it being a code block and an object.
18:05
who has done some webrtc sutff?
@Suisse me
theres a cancel star feature? cool
18:27
posted on May 28, 2020 by Prudhvikumar Bommana

The Chrome team is excited to announce the promotion of Chrome 84 to the beta channel for Windows, Mac and Linux. Chrome 84.0.4147.30 contains our usual under-the-hood performance and stability tweaks, but there are also some cool new features to explore - please head to the Chromium blog to learn more! A full list of changes in this build is available in the log. Interested in switching rel

help
im doing something so wrong
@Injectable()
export class AppService {
  usersURL = 'http://localhost:4000/users';  // URL to web api
  private handleError: HandleError;

  constructor(
    private http: HttpClient,
    httpErrorHandler: HttpErrorHandler) {
    this.handleError = httpErrorHandler.createHandleError('AppService');
  }
I keep getting this error.
@ChristianMatthew Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
ERROR ReferenceError: ErrorEvent is not defined
what's the stack trace pointing to
i assume somewhere within httpErrorHandler.createHandleError
ERROR ReferenceError: ErrorEvent is not definedkkkkkkkkkkkkkkkk
18:30
?
right
but not defined where
HttpErrorResponse {
  headers: HttpHeaders {
    normalizedNames: Map {},
    lazyUpdate: null,
    headers: Map {}
  },
  status: 0,
  statusText: 'Unknown Error',
  url: 'http://localhost:4000/users',
  ok: false,
  name: 'HttpErrorResponse',
  message: 'Http failure response for localhost:4000/users: 0 Unknown Error',
  error: ProgressEvent {
sorry
If you can hook into whatever is sending that error response, you might be able to access a stack trace
the client error isn't going to be much use
hook into how?
dunno
18:44
im lost
here is the code it's simple
const httpOptions = {
  headers: new HttpHeaders({
    'Content-Type':  'application/json'
  })
};

@Injectable()
export class AppService {
  usersURL = 'http://localhost:4000/users';  // URL to web api
  private handleError: HandleError;

  constructor(
    private http: HttpClient,
    httpErrorHandler: HttpErrorHandler) {
    this.handleError = httpErrorHandler.createHandleError('AppService');
  }
you need to know what is throwing the error
the error message doesn't match any of that code
  /** POST: add a new user to the database */
  addUser (user: IUserProfile): Observable<IUserProfile> {
    return this.http.post<IUserProfile>(this.usersURL, user, httpOptions)
      .pipe(
        catchError(this.handleError('addUser', user))
      );
  }
this is the error service
import { Injectable } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';

import { Observable, of } from 'rxjs';

import { MessageService } from './message.service';

/** Type of the handleError function returned by HttpErrorHandler.createHandleError */
export type HandleError =
  <T> (operation?: string, result?: T) => (error: HttpErrorResponse) => Observable<T>;

/** Handles HttpClient errors */
@Injectable()
export class HttpErrorHandler {
  constructor(private messageService: MessageService) { }
Nowhere in that code is ErrorEvent
i just change it to httpErrorResponse but it was after the error.error
Request URL: localhost:4000
Referrer Policy: no-referrer-when-downgrade
   */
  handleError<T> (serviceName = '', operation = 'operation', result = {} as T) {

    return (error: HttpErrorResponse): Observable<T> => {
      // TODO: send the error to remote logging infrastructure
      console.error(error); // log to console instead

      const message = (error.error instanceof ErrorEvent) ?
        error.error.message :
       `server returned code ${error.status} with body "${error.error}"`;

      // TODO: better job of transforming error for user consumption
      this.messageService.add(`${serviceName}: ${operation} failed: ${message}`);
what's crazy is that it does the post but it just never resolves
19:06
@JBis I love you.
2
glad my "me" was so helpful
@JBis it motivated me in my doing... to know there is another being which is suffering from webrtc
lol
i used mediasoup for most of the webrtc stuff
ewww
god help you if you are implementing it yourself
19:21
I just "implemented" a simple broadcaster and signaling with websocket
its doing "somehow"
"ICE failed, add a TURN server and see about:webrtc for more details" here and there I got this.. but ehm yeah no idea what it means and why it means and how and omg help me please! :'(
hehe had some days till found out that on android videos don't autoplay
oof
yeah yeah I am excited if its going to work ^^
i can't figure it out
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
this is network request. is json not listed there. is that the issue?
i can't believe something so simple could go so wrong
19:41
Do any of you use CakePHP and if so, do you have a preferred JS framework?
I have a Vue component where I have <input type="date" v-model.lazy="myDate" /> but the change in myDate registers as soon as I hit any key rather than when I click out of the control.
@KevinB
for sure it is that post call.
could it be cors?
is it a cors error?
I can use the request handler
directly but not through angular
you need to find the source of the error
to me, it sounds like the error is on the server
if you're not getting a CORS error, it's not a CORS error
19:52
it's just angular cli
what is it the server?
why*
angular cli creates a server that serves the angular js does it not?
the same server that you're using to get data for your app, right?
angular is receiving an err response from the server
why is the server sending an error response
because... an error is happening on the server
mmmmmmmmmmmmmmm
I think i know what's happening
are you good with angular
I have a question about react.js.
When importing local css files that will be used by all files, should I link these stylesheets in the index.html header in the public folder, or my app.js file in the src folder?
20:06
@ButterJones 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.
ok the api works when I hit through post man but it does hang
this is for the post
when I do the get request
it renders fine
actually are you good express
I think I need to send a resp
res.send(result);
oh jesus
lol
I think that was it
let me deploy that
while i'm deploying that
callbacks should be necessary right if you create an async / await operation?
in this code could I rearrange it to not use a callback?
const createUser = (client, callback, req) => {
    // Get the documents collection
    const collection = client.collection(documentName);
    // Insert some documents
    collection.insertOne({
        name: req.body.name,
        firstName: req.body.firstName,
        lastName: req.body.lastName,
        email: req.body.email,
        tokenId: req.body.tokenId,
        userPhoto: req.body.userPhoto
    }, (err, result) => {
        // console.log('err **** -------- ', err);
        // console.log('Result -------- ', result);
20:22
if you don't want to wait, you can call the callback immediately... but that'd probably be a bad idea. you wouldn't want something trying to access the user before the insertion is done.
I don't mind waiting. I am more speaking about the format of it being a callback?
that's fine
i'd prefer using promises, but not everything supports it
ahhhh so you mean. in order for that to work the fucniong collection.insertone would need to be a promise?
it would need to return one.
20:25
right return one
and that was you you could async await it
which... i'd be surprised if it didn't
got it. that makes more sense.
most modern things do
in one way or another
you'd be surprised if it didn't have a promise to return?
redis doesn't lol
but that's more by design
20:33
posted on May 28, 2020 by Marina Kazatcker

The Dev channel is being updated to 84.0.4147.21 (Platform version: 13099.14.0) for most Chrome OS devices. This build contains a number of bug fixes and security updates. Systems will be receiving updates over the next several days. If you find new issues, please let us know by visiting our forum or filing a bug. Interested in switching channels? Find out ho

meh
im skeptical of any article that suggests upgrading to firefox
for the meantime
I implemented an express server with HiAPL!
haha
Did anybody use any immutable data structures libraries? Any recommendations? I'd like to try immutability for a while to get used to it. I've heard of Immutable.js before and there is also Immer.js, not sure if there are others or if these ones are even considered good.
21:28
i dont' even know what that is
It's like a mutable data structure but the opposite :P
lol yea it's called const
@ChristianMatthew const creates an immutable binding not an immutable data structure.
@VLAZ why would you want that?
well can't you bind a data object to it?
21:29
||> const arr = []; arr.push("a");
@VLAZ 1 Logged: `` Took: 0ms
ok what about typescript
||> const arr = []; arr.push("a"); arr
@JBis ["a"] Logged: `` Took: 0ms
just use and interface or a class
21:31
@ChristianMatthew TS has a readonly helper but it just removes the mutation methods. You don't benefit from structural sharing for one thing.
what is structural sharing
is that like sex
It's like sex but the opposite :P
3
lol
no but seriously what is S&S
Structural sharing is when you add to existing structure and re-use it. If you have a list and add an item, you preserve the old list and add one node. If you remove the item, you get back the old list.
a -> b if you do an .add(c) you get a -> b -> c reusing the first two. If you remove c you get back to the first list.
so what is any use of this. arrays' do such things but in reality if I call upon something I need it to just be what I am expecting. The more vodoo you put into something the voodoo you will get out
its my voodoo in voodoo out theory
21:35
Less objects in memory and you can also easily test for equality because list1 == list2 will be the same
VIVO
It's like TiVo but the opposite ;)
if I made list2 I expect it to be different than list1
why else would you make list2
Because there is no memory cost to it. You can implement algorithms that walk a stack easily, for example. Also useful with concurrency and multithreading - you never have problem with mutating the same data structure from different threads. True, less of a concern in JS but it's still something you get for free.
Think of list1 and list2 as pointers to the same list, rather than different lists.
i mean...
Although both of these are true. Any sub-list is still a list. And each node is just a reference, after all.
can't you do all of that without fancy immutable libraries
that's just an object
21:45
I could use an object and freeze it. Even deep freeze it. But where is the fun in that?
@KevinB thanks for the help so I 3 issues that were plauging me on this. 1st. the docs for the driver kept using MongoClient.close() so when I used it I couldn't get it straight why that wasn't working. Since it's a global instance I don't need the close. Geez wouldn't you think it would be nice to say such a thing in the docs.
2. I learned in express you have to res.send(result) in your route handlers
3. I can't figure out how to do a mock ssl on angular universal so the mock response I was sending was fighting me. lol jesus
like 3 random things in one error just killing me. with error code of
message: 'Http failure response for localhost:4201/users: 0 Unknown Error',
#2020
22:39
posted on May 28, 2020 by Krishna Govind

Hi everyone! We've just released Chrome Beta 84 (84.0.4147.27) for Android: it's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Krishna Govind Google Chrome


« first day (3512 days earlier)      last day (1659 days later) »