« first day (3405 days earlier)      last day (1768 days later) » 

02:11
How do you write a function which return sum of all the numbers? when
How do you write a function that sums all the numbers sum(3)(4)(5)....(n) where n is also number. There will be no trailing ()
@Proo1931 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.
to sum
what do you mean by n as a number?
var arr = [1,2,3,4,5,6,7];

var sum = arr.reduce(function(accu, current)
{
  return accu + current;
});
console.log(sum);
sum + arr.length ? at the end ?
02:33
@Proo1931 Your function should return the value of sum(3)(4)(5) and also should be enabled for sum(3)(4)(1)(6)(7)(0). Numbers for addition is not constant is what i meant
02:50
@BhumilSarvaiya @BhumilSarvaiya yes sure.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
let router = express_1.Router();
router.get("/validateUser", (req, res) => { return res.end("success"); });
exports.default = router;
 
4 hours later…
06:42
hi JS world
07:30
Hello, world!
Hi All
im getting some issue with the routing
below is my ts code
class UserRoute {
 constructor() {
	router.get('/getValidData', (req: any, res: any) => {
		//my application logic here
	});
  }
}

module.exports = router


app.js

var userroute = require('./routes/userroute');

app.use("/users", userroute);
this code works fine and the api hits if i test it using postman if i remove the class structure
if i only have

router.get('/getValidData', (req: any, res: any) => {
		//my application logic here
	});

module.exports = router
this code works fine
well what does the documentation say about .use?
is this possible?
I don't assign router information inside a class, rather I use classes to handle router requests
07:46
@Neil - you like Leo? he won oscars again.
@Neil you mean i should not have the router.get inside a class
@CommonMan good for him I suppose. Why would you assume I like Dicaprio?
@SamSam Just that for that to work, you'd have to create a new instance of that class. You're not doing that.
@Neil - I didn't assume... just asked. :)
@SamSam If app.use is doing this, then great, but you should inform yourself if that is the case. Otherwise, don't do it like this
he was a heartthrob when I was in high school, so naturally I hated the guy for it :P
but he's not a bad actor, I don't mind him at all nowadays
:)
i liked him in Django and Revenant
07:55
supposedly when he slams his fist on the table and cuts his hand on the glass, that actually happened
he just went along with it and they kept it in the film
I haven't seen revenant
but I've heard good things about it
hi could any of you help with this please
postman test pm.expect(obj.hidden.notEquals).to.eql(data['Valuecon']);});} - this works but i want to take notEquals from a data set, any ideas?
so cycle through your data set and for each value do this check
no i want to input the word notEquals from a data set or variable i tried pm.expect(obj.hidden(data['logop'])).to.eql(data['Valuecon']);});} and pm.expect(obj.hidden.{{logop}}).to.eql(data['Valuecon']);});} but none work. the path changes so want to up date with a variable
@Neil not sure if he really meant DiCaprio
he did not won one
heck, he's not on the shortlist AFAIK
08:07
well we're here talking about Revenant and Django
unless you know of another Leo in those films
no once upon a time in hollywood ?
won some oscars. Even Pitt won one
didn't see it
though I should. I tend to like Tarantino films
I wasn't so crazy about hateful 8 though
the "twist" wasn't really such a twist
I mean it was I suppose, but it didn't justify the behaviors of the characters up to that point
I don't want to give away any spoilers
once upon a time in hollywood was rubbish didnt get it at all
what was the plot?
pretty much zero plot with a fucked up ending - nothing really happens
08:20
lame
any ideas on my problem ?
the reason I like Tarantino films so much is because he writes them like they were plays, except anything but family friendly plays with lots of tension
@deephect Not too familiar with that library, sorry
@Neil yes, i tried doing that as well like below
module.exports = new UserRoute()
@SamSam ok, but if you don't have a particular reason for doing it this way, don't
why should you be creating an instance in order to set router info?
but i get the below error
Router.use() requires a middleware function but got a Object
08:23
it's expecting a function to call
not a class
if i try to do it like below then also i get the issue'
module.exports = { UserRoute, router}
Hey guys, I have a simple question for you.

I'm tasked with writing a DSL (domain specific language) - so I need to write a lexer and a parser in order to obtain an AST which I can interprete.

I'm not sure whether I should use BNF (I never used BNF) and something like Jison to generate a parser for me, or if I'm better off writing everything by hand.

Is it possible to generate a parser which outputs an AST using readily available tools? If so, are there any you could recommend?

The parser needs to be able to run in JavaScript.
:48557681 if i dont export the router object, i get the exception of
Router.use() requires a middleware function but got a Object
8 mins ago, by Neil
@SamSam ok, but if you don't have a particular reason for doing it this way, don't
@Neil so i should create the instance of the class or not?, as in anyways im getting exception.
08:33
don't use a class here
this is not what classes are meant to be used for, even if you could get it to work this way
ok, but actually i was trying to follow a sample application project of Udemy.
without class then it is working fine.
08:52
Hi guys
I got a question
Don't ask to ask, just ask
!rules
sorry
So
I'm using jquery
to create an infinite carousel
that keeps scrolling with an interval
The problem is
Wait
to achieve that I clone the first image at the end
I scroll to it
then I scroll back to 0 without animating
and I remove the last image
when I debug it works just fine
But not in debug mode It doesn't animate the last scroll
09:14
in debug, you're inserting time through breakpoints
without the breakpoints there is no time delay, so you just see the end result
it doesn't work like you'd think, animating each minor change you request
1
Q: Live streaming: node-media-server + Dash.js configured for real-time low latency

MaorationWe're working on an app that enables live monitoring of your back yard. Each client has a camera connected to the internet, streaming to our public node.js server. I'm trying to use node-media-server to publish an MPEG-DASH (or HLS) stream to be available for our app clients, on different networ...

09:31
I tryed to add .delay() before .animate
10:25
we are working in an application where they have been using tabulator.js which is a third party plugin... this integration was done by a different firm...
var table = new Tabulator("#example-table", {
    selectableCheck:function(row){
        //row - row component
        return row.getData().age > 18; //allow selection of rows where the age is greater than 18
    },
});
this is the snippet they explain about making a row having a checkbox selectable or not
I have implemented the same in the application but it's not taking effect...
I understood I am missing somehting...
what i wanted is .. to enable and disable checkbox a row based on a java web services call.
parameter....
I am thinking if anyone can guide me on this...
11:02
var table = $("#my-enrollments-table");

    table.find('"tabulator-field=case_status"').each(function (i) {
        console.log(i);
    });
i would like to use ` tabulator-field=case_status ` as a identifier...
11:21
where do I go to for help on redux saga ?
@HarshLimaye 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.
Hi guys I found answer myself... please ignore my question
11:59
👍
12:22
morning..
Built my new computer correctly like I said, neighbor came over and put windows 10 on it
he also hacked the key so its activated for free now XD
and ill say, none of my games at full highest graphics really "lag" anymore
win 10 home are at 20 $.
bruh im poor boi
20$ is my annual cash :3
and please check if there is no # of days at the bottom or in the registry.
besides, even linus tech tips all crack windows
Dont worry, its activated
he might claim he hacked it but for the same money, you only got a trial period
12:24
Its a program that just edits the OS's internal install code, and basically re-installs it a little, but with a fake key
Dude, hes my neighbor weve known for 5 years
hes not going to "trick me"
My dads known him longer though
military friends or whatnot
Anyways, hes a professional IT, and he just says "Theres no point buying a new windows install EVERY time you make a new computer, considering I make 2-3 a month, its not worth it"
you can recycle keys
Besides, my old windows 7 computer lets me claim a free copy of windows 10 home pro using the old upgrade software that microsoft NEVER fixed.
however I cant move that version over to the new pc, so no point
so pantsy :P
pantsy?
I was just saying that it can happen that your activation gets revoked. So don't be sad if that occur. The chance is slim tho. I have experienced it once.
at other side, at 20 bucks you have a nice subscription with updates
12:29
it still updates
okay I get that you don't have money but you can do chores for it
I dont remember what the program was, but its a virus that was reverse engineered years ago, and they turned it into an exploit to crack windows for free
something like that
i know it sounds sketchy, but if an IT working with computers for 10 years, and doing computer work for over 40 restaurants in the area is telling me, i should use it, im going to use it
@KarelG oh I just saw the chores thing, well, unfortunately I have bone problems in my knees, so all I can do outside the house is the drive mower. I already do dishes, trash, and my bathroom every day, and my dad doesnt give "chore money".
ive never really had allowances
so I dont really get the point in them... free money? pssh like that exists...
@TaylorS Get a job
12:44
14 years old, Highschool + Extra curriculars
no thanks, already struggling
I have to be 15 for a job here
@TaylorS I did household chores as well, for free. I meant something like helping cutting trees, mowing grass for neighbors, ect
Substitute some useless extra curriculars for some real job experience
So do it when you are 15
Sorry dude, Im not going to.
I cant drive, I got bone problems, and Im not even old enough
not to mention homework
Ill just stick to programming in my off time
12:48
Yeah but what if you could program in your free time, but get paid for it
But alright
lolrip
13:26
Hi All
/can i not declare a function inside a class in typescript
how are you declaring it
its usually declared like:
class NAME {
 constructor() {

 }
 customFunctionName() {

 }
}
yes
like that onlY
press up arrow to edit mistakes :D like this
As for typescript, Ive never used classes in it
typescript is a bit different with some things
class UserController {
    constructor(){}
    welcomestatus(req: any, res: any) {
        res.json({
            response: 0,
            message: 'this is working',
        })
    }
    function disp_details(id: number, name: string, mail_id?: string) {
        console.log('ID:', id)
        console.log('Name', name)

        if (mail_id != undefined) console.log('Email Id', mail_id)
    }
}
Has the same class syntax though: typescriptlang.org/docs/handbook/classes.html
nononono
no function
just the name :)
13:29
i have tried the above two ways both are not working
so like
class foo {
 functionNameHere() {

 }
}
No actual "function" + FunctionName
@TaylorS yes, with and without function keyword
hmm
Have you tried just running a basic class without any typescript arguments
yes
the problem im facing is in the file which calls this controller
try just running this on its own:
class foo {
 functionNameHere() {
  console.log("confirm");
 }
}

const API = new foo();

API.functionNameHere();
13:31
@TaylorS 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.
shush bot
const express = require('express')

const userController = require('../controller/users/usercontroller')

const router = express.Router()


router.get('/welcomestatus', function(req: any, res: any) {
    userController.welcomestatus(req, res)
})

module.exports = router
here i get the exception as
userController.welcomestatus is not a function
it isnt.
You dont have a code block
{}
and my class code is as below
class UserController {
    constructor() {}
    welcomestatus(req: any, res: any) {
        res.json({
            response: 0,
            message: 'this is working',
        })
    }
}

module.exports = UserController
oh..
lol im blind
Also, why are you calling this: module.exports = UserController
13:33
if i dont use the class and directly use the export function approach, it works fine. But im trying to do it in the way as above.
Well firstly, are you making an API out of this?
Id reccomend NOT using classes unless you need this to be Re-usable
@TaylorS even if i dont have it i still get the same issue
try... instead of module.exports = UserController try module.exports = new UserController();
With a class, you want to re-use the object, calling a new instance of it every time you use it
so const NewAPIUse = new APIClass();
but typescript is just a little different
simply calling the API wont due, because now your basically just calling a REALLY bulky function, its only a single user
excuse what I said "every time you use it" you can call the same functions from the same instance of new APIClass(); or whatever, but if you want to use the API again without problems, youd wanna call a new instance
how to disable a checkbox in tabulator js third party plugin?
@CommonMan No idea, this is a JS chat, we mainly deal with vanilla JS
not too often libraries
because not everyone knows them
13:40
Yes I agree... @TaylorS. thanks
@TaylorS ok, what im understanding is, instead of using classes i should have plane functions and export and use them.
In your use case, probably
if you were making a Dynamic API to be called multiple times in the same JS file and to be used with dynamic values and functions (meaning they can change and still work), then yes, youd want classes
then again some people make APIs out of literally just a single variable... not classes, but what do I know
@TaylorS thanks for the information
5 hours ago, by Neil
this is not what classes are meant to be used for, even if you could get it to work this way
@SamSam now that two people have told you this, will you actually take the advice being given?
@Neil yes absolutely. thanks for the advice.
13:51
lol
14:10
o.o
> o.o
??
not okay Taylor?
See that as like I'm putting my nose on the window
TO CHECK INSIDE
leeeroooy jenkins
What the living hell did I just read
???
Im not sure I understood that lol
But it made me laugh
that's from WoW
(world of warcraft)
lookup
dude kinda ended becoming an internet meme
I was just curious originally what made you all "surprised" (0.0)
15:03
Has anyone ever had issues with embedded google calendars throwing 404s when not signed in? They're set to publicly viewable but they dont show up unless logged in, giving net err aborted 404 errors
 
1 hour later…
16:09
Hi, I have a javascript obj/array structured like this when I do console.log:
[Array(1)]
0: Array(1)
0:
HostName: "host2.com"
IPAddress: "10.10.10.1"
MACAddress: "00:57:99:AA:BC:A9"
ConnectedTo: "switch1"
PortNumber: "Po97"
PortName: ""
VLAN: "50"
__proto__: Object
$$hashKey: "object:3"
length: 1
__proto__: Array(0)
length: 1
__proto__: Array(0)
I have having hard time accessing the value in javascript
$scope.result = response.data; // This is where the data is stored
Hello, does any one knows a good place to find a list of types for typescript x frontend and backend js frameworks?
I am right now developing with vue/vuex using typescript and I am struggling knowing how to properly type things through the application
have you looked at DefinitelyTyped
no, I have never heard about it before
I'm gonna check it!!
It's a project that puts together type definitions for a lot of popular untyped npm modules
@forresthopkinsa I see, thank you! But also, one of my problems is not the fact that typescript won't recognize one of the types I want to use. But rather I am not sure what type to use
16:22
Explain
for instance, in my vuex module I have the following
const actions = {
	async fetchTodos({ commit }: any) {

    }
};
I have no Idea what should be the appropiated type for commit
so I just used any to keep going, but I wanted to type it with the proper type for it
16:53
well do you know what properties commit will have?
I haven't used vuex so I don't really know
here's an article that might help:
@forresthopkinsa thanks a lot! I guess there's no easy way around it right? Like in Java if you're using an specific function from an interface, the IDE will already tell what kind of params the function expects and its types
feels like there's no out of the box autocomplete service like that for typescript, could be that I am just missing out on something
no I'm pretty sure that if you're implementing an interface then TS will assume the types you're inheriting
what IDE are you using?
check this out
notice the error I have on line 9
it's because the interface I'm implementing mandates that myFn returns a string
I see! it makes sense!!
I am actually using vscode
is definitely me still learning how to deal with typescript, not the ide
vscode has the typescript engine built-in so you should be good there
17:12
like for instance in the tutorial you linked me form medium they type the commit variable as any as well:

fetchData({ commit }): any
this variable comes from

actions: {
    increment (context) {
      context.commit('increment')
    }
  }
basically context is a object that has the commit property
which is a function
I wish that when I hovered over commit it would say something like "vue.context.commit" as a type or something like that
but maybe only someone with more experience in vuex would know something like that
17:47
@littlepootis {...myUser, ...newUserProperties} best! thx
Jpv
Jpv
18:42
Hi Guys, quick questions. im trying to append some html when button is clicked. but this is only outputting text and no html.
@Jpv 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
Jpv
Jpv
    $(document).ready(function(){
                                       $('.addLi').click(function(){
                                            var parent =  $(this).parents('li');
                                            var code = '<li><div>Content <button type="button" class="addLi">ADD</button></div></li>';

                                            if(parent.length > 0){
                                                if(parent.children('ul').length > 0){
                                                    $(this).parents('li').children('ul')[0].append(code);
posted on February 11, 2020 by Michaël Zasso

Notable changes New assert APIs The assert module now provides experimental assert.match() and assert.doesNotMatch() methods. They will validate that the first argument is a string and matches (or does not match) the provided regular expression: const assert = require('assert').strict; assert.match('I will fail', /pass/); // AssertionError [ERR_ASSERTION]: The input did no

19:26
there is no parents() right? its only parent() @Jpv
ok there is
@Jpv create a jsfiddle and post it here
19:46
How do I make a angularJs filter work with this orderBy? w3schools
 
2 hours later…
21:18
guys some one can explain me how that javascript script work ?
@bulletvz 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.
|| magic
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
what javascript?
sorry link wont send
      var _0x323ex24 = "ielyJfjdCI6InRqTFRWdkEVaTVdSbkcRXUFRpWmRhUaWZoVGR3eFJNbnhZYUJuSW00Q2gxelZycThtNHZscEZYR3hMU3NERW9zVjIiLCJpdiI6IjhmMTcyYWMxNDNhZjZhMTVkYWZhYmEzMDQ4MWUzOWQzIiwicyI6IjA0M2FkZWM1NDk5MjlhMjcifQ==";
        var _0x323ex10 = [40, 30, 20, 5, 2, 0];
        for (var _0x323ex25 = 0; _0x323ex25 < _0x323ex10.length; _0x323ex25++) {
            _0x323ex24 = _0x323ex24.slice(0, _0x323ex10[_0x323ex25]) + _0x323ex24.slice(_0x323ex10[_0x323ex25] + 1)
        };
        console.log(_0x323ex24)
how it work ?
21:21
@bulletvz 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
it builds a base64 string and then decodes it
its base64 data but its obfuscator and that code will unobfuscator.io/
@bulletvz which part of this don't you understand?
yeah i try to tranfaster it to python
and php but there is no way
i mean
it's just string maniplulation
there's no reason php/python can't do it
21:24
yeah i know i try to learn how that work for 4 hours :)
python can do it
but i dont know how :)
u have any experience about php or python?
not any worth mentioning
oh do u think that code was just remove character 40 , 30 , 20,5,2,0 ?
that my ask in stackoverflow "https://stackoverflow.com/questions/60142740/how-that-code-of-javascript-work-with-slice"
I have a form with checkboxes and dropdowns. I'm trying to monitor when one is checked/unchecked and get the ID of the one changed (same with dropdowns, get value selected). I currently have $('#form-tag-id').change(function(){alert("changed");}); and ticking and unticking triggers ok
how do I get the ID of the checkbox clicked?
21:39
err
well, only one of them have that id
and you bound an event directly to it
so you can assume the id is "form-tag-id"
it is when I Try to get this or data etc. Ok so I guess my listener approach is wrong then
forget my code I have, how do I listen to a form change and get the ID that is changed so I can trigger something?
event.target.id
just make sure you accept the event parameter
ah ok that's working - thanks :)
 
1 hour later…
22:50
Hello guys, I have a little question about angular js, it's a newbie question, anybody here use angular js and can try to answer me ? thanks :)
@MaxDev99 just ask your question, if someone's around and wants to answer they will

« first day (3405 days earlier)      last day (1768 days later) »