« first day (3295 days earlier)      last day (1652 days later) » 

 
2 hours later…
4:27 AM
hey whats up guys anybody awake
joker hello how are you
 
5:14 AM
oi
 
Hello everyone
 
 
1 hour later…
6:30 AM
Hello, Dr. Nick!
 
wat is lif
 
babi dun hert mi
 
BAMBI
 
6:47 AM
I've this code in node js
app.post('/login', function(req:any , res:any){
    db.collection("user").where("username","==",username).where("password","==",password).get().then(
        LoginStatus => {
            if(LoginStatus.size>0){
                res.status(200).json({"session":cipherLoginSession(username)})
            }
        }).catch(error){
            res.status(500).json({"message":error})
        }
    });
})
cipherLoginSession cipher the username with a salt
db.collection is querying firestore
When I'm running it without calling cipherLoginSession, everything works and status 200 is returned
But when I'm calling the function, it returns db error
 
ok, well what does cipherLoginSession do?
I'd think the error is in that function, no?
 
const cipherLoginSession = function(username:any){
    let cipher = crypto.createCipheriv("aes-256-cbc", Buffer.from(_KEY.LOGIN_SESS),_KEY.IV);
    let encrypted  = cipher.update(username+":"+new Date().getTime().toString());
    encrypted = Buffer.concat([encrypted, cipher.final()]);
    return encrypted;
}
 
which line fails?
 
I put a console log on the very first line in that function but that's not executing
 
well that's odd
you verified that cipherLoginSession is defined at the point in which you call it?
 
6:51 AM
yes. It's defined at the top
The error is returned from db.collection.where....().then().catch(error => res.status(500).json({"message":error}))
and response is {"message":{}}
no error description
I'm using firebase functions
If I simply put res.status(200).json({"message":"success"}) instead of calling the function, it works
 
hmm
well have you fetched other data from this database?
it seems odd that it would just fail like that without error
 
yes.
 
ok, well does this table exist that you're fetching?
 
@Neil yes. even the data is correct
I mean, when I run it without calling the function cipherLoginSession, it returns the expected result
 
you're also pointing at the right database? Not pointing by accident to the preproduction environment or something?
 
6:58 AM
@Neil the right one
 
also, don't tell me yes. You should verify all of this. Assumptions will be the death of you.
 
No. not assumptions.
If I put
db.collection("user").where("username","==",username).where("password","==",password).get().then(
        LoginStatus => res.status(200).json({"message":LoginStatus.size.toString()})
);
It returns 200 1
 
ok, so logically the error is how you're querying the db
how are you querying the data when you get an error?
 
I didn't alter the query
 
so this:
8 mins ago, by Sagar V
The error is returned from db.collection.where....().then().catch(error => res.status(500).json({"message":error}))
Is the same as this:
2 mins ago, by Sagar V
db.collection("user").where("username","==",username).where("password","==",password).get().then(
        LoginStatus => res.status(200).json({"message":LoginStatus.size.toString()})
);
without the catch?
 
7:02 AM
@Neil yes. Catch is there
and the response is made from catch
 
you're also not doing anything in the then() call
 
@Neil That code is exactly same as above
so I skipped those lines.
 
@SagarV ok, so you're telling me you use this:
3 mins ago, by Sagar V
db.collection("user").where("username","==",username).where("password","==",password).get().then(
        LoginStatus => res.status(200).json({"message":LoginStatus.size.toString()})
);
You get 200.
But if you run this:
4 mins ago, by Sagar V
db.collection("user").where("username","==",username).where("password","==",password).get().then(
        LoginStatus => res.status(200).json({"message":LoginStatus.size.toString()})
);
You get an error..
if they're the same.. then it should behave the same..
did I misunderstand?
 
@Neil No. I'm getting error when running this
db.collection("user").where("username","==",username).where("password","==",password).get().then(
        LoginStatus => res.status(200).json({"message":cipherLoginSession(username)})
);
The function is not async
@SagarV this is the function
 
I misunderstood you then, sorry
Well since it isn't actually calling the function so you can't find the precise line
I recommend you simply start off with a trivial function which just returns username, and then add the lines back one at a time
find the offending line
 
7:08 AM
@Neil yes. I put a console.log in the function but it's not executing
@Neil ok. let me try
 
it's a weird error, I'd have expected it to at least get to the first line
so again, try commenting the lines except the return to start
 
now this is the function
const cipherLoginSession = function(username:any){
    return username;
}
currently deploying
 
does it return 200 like this?
 
why isn't the cat trying to eat the mouse? @Neil
 
@Nobody nobody knows. It's a mystery, like me
 
7:13 AM
you could've replied this " @Nobody knows. It's a mystery, like me"
 
@Nobody oh damn
totally missed that opportunity, didn't I?
 
@Neil yes. it's returning 200
 
@SagarV ok good. Try adding the first line defining cipher
don't use it.. continue to return username
see if that still returns 200
 
@Neil getting error in tsc. cipher declared never used.
tsc will throw error if something is declared but isn't used anywhere
 
ok well return cipher to avoid the error
the point isn't to write working code, it's to find the problem
if you get a runtime error after the call, then there's still nothing wrong with your function
 
7:19 AM
@Neil error
 
@SagarV what kind of error?
 
this is the link to ApiRequest.IO apirequest.io/…
@Neil error from db.collection.....catch()
 
ok, well there you go
maybe "aes-256-cbc" isn't a legit algorithm
 
@Neil let me try aes-192-cbc
or do you have better suggestion?
 
see what algorithms they support
they should have a list
even if the algorithm exists, it's not said that they support it
don't do trial and error in other words
 
7:23 AM
They support aes-256-cbc
 
@SagarV The function you call is createCipheriv while the function you referenced is generateKeyPair
look for a proper example and follow the example.
 
@Neil I mean in the code of that function, they use algorightm: 'aes-256-cbc'
 
@SagarV you should be following an example provided by the api itself
as you call it now, it doesn't work, clearly.
Find the proper way to call it. Period.
 
7:39 AM
I'm using
import 'semantic-ui-css/semantic.min.css'

.... what's the proper way to link to the images directory ./node_modules/semantic-ui-css/themes/default/assets/images ?
Should I just symlink?
^In ReactJS
I'm using create-react-app as well... doesn't seem to be bundling the images or whatever (kinda rusty on react, beginner level)
 
@Neil Thanks for the help. I tried that 2 lines of code alone and the issue was, key length was 33 chars. I accidentally put a comma before closing the string (it's stored in an object)
 
It looks like the examples are cheating and adding a CDN URL for the CSS. None are using yarn/NPM for a local CSS/Image dist :/
 
@SagarV sorry for the runaround. I assumed there was something wrong with the db fetch honestly
 
@Neil Hey man, I solved the problem with an external library for the panning/zooming.
For now, the project manager asked me to map out a single floor completely and carry out testing. So, for now, it's all data entry.
 
@HassanAlthaf I think you're making good progress
still, if you think you'll be using multiple floors, plan accordingly :P
 
7:52 AM
Multiple floor system has been implemented.
 
part of thinking ahead is knowing what direction your program will need to eventually go
 
Just have to throw in elevator/staircase system.
I did as you told, introduce another variable to the graph z
 
Hmm, ..//node_modules/semantic-ui-css/themes/default/assets/images doesn't have any images in it anyways
 
And using the "z" I just have to add buttons for multiple floors.
Or a menu.
Thanks a lot man, i highly appreciate your help.
I'll let you know how I progress.
For now, it's a couple of days worth of data-entry.
 
you can save to the db a flexible model like which node connects to which, but you may also want to save data like "elevator from range 0 to 10"
 
7:57 AM
People. How is echarts a legit free library . It has so much features but its still free to play. Unlike literally every other library that has as many features but costs a bazzilion dollars. echartsjs.com . Whats the catch?
 
because it's also difficult to figure that out from the flexible model
use the flexible model, but save the context that you used to create the flexible model
 
You get a free community with open source. The companies that use it in return get free bug fixes.
 
@Neil no prob. actually the cipher = .. line itself throw an error while running locally.
 
@Neil
@Neil Yes, I want to simplify nodes.
 
good night
 
8:03 AM
For now its,

{
    id: ...,
    x: ...,
    y: ...,
    z: ...,
    connected: [....]
}
 
meh, well you could do coordinates: {x: .., y..., z... }
but other than that, how could you simplify?
 
conencted only has ids of nodes connected.
I'm guessing that's the simplest considering there's no redundant data? I believe it's normalized.
If there's simpler, please share.
 
well you can't put the actual nodes themselves
 
I prefer x,y,z because,meh, u dont have to type coordinates LOL
Yup, just the IDs of the nodes.
 
I mean I guess you could, but you couldn't save it to the db like that
 
8:10 AM
Of course. Will do x, y, z fields on the DB.
 
 
2 hours later…
9:41 AM
Hey guys, I was wondering if someone could check out my question
https://stackoverflow.com/questions/58538487/data-not-loading-onto-list-from-api-reactjs
 
Hey guys, big question her
What does gitlab do that bitbucket doesnt
 
^^
 
of course they're biased
 
I mean I don't want to have gitlab vision on their competitor
The thing is we're thinking of mooving out of github
 
9:54 AM
well I don't think they're lying if that's what you mean
 
I don't think either BUT they're most certainly not telling what their are not doing
 
well the person who wants to move out of github. did he/she give reasons?
 
Github is not as performant as thoose too
Less options
Less lots of things
 
performant?
 
And not self hosted
 
9:55 AM
meh, honestly wouldn't know
 
Integration of kanban this kind of things
 
you should definitely look into it before committing
 
Definitely
 
@Neil my pet peeve is that they price per user
 
The thing is I'm the only one who wants to go into gitlab and every other are most commited for bitbucket due to atlasian integration (+ trello)
 
9:58 AM
gitlab has other interesting features but the price per user is just an overkill for enterprise use
 
Ho yeah ?
Even if its self hosted ?
 
starter pack has 3 or 4 US $ per user per month IIRC
 
10:24 AM
1
Q: Jquery wrap()- chracter before forward slash `/`

Yogesh D.Is it possible? Before the forward slash / Could I wrap() the character inside the html tag I want to warp all the character into html element. which are before the the / Jquery snippet: var x = jQuery('.elementor-drop-cap-yes p').contents().filter(function(){return this.nodeType === 3}).w...

 
@YogeshD. 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.
 
need inputs
 
10:42 AM
wtaf
data returns a string as a number
 
11:11 AM
hey
anyone used smooch messaging platform?
I'm trying to add a webhook to my gcloud node server..but the HEAD request fails everytime I try to add a webhook to my gcloud server
if that makes any sense
 
 
1 hour later…
12:34 PM
@BrianJ as in kissing to transfer information via saliva encoded in DNA?
mmm sounds good
 
think about the bandwidth potential there
so much info in DNA form
 
@Neil Oh YEAH!
ATOMIC COMPRESSION BABY!
 
wave of the future, baby!
 
> The information density of DNA is remarkable — just one gram can store 215 petabytes, or 215 million gigabytes, of data
 
i am still amazed how db engines manages to execute a query that consists of selecting 10+ columns from 11 tables where two of the joins are both subqueries selecting from 10 tables in total and then executing multiple WHERE clauses (13 conditions) in almost 1.5s
 
12:35 PM
with great pain
 
@KarelG it can shortcircuit some of the joins in some circumstances
 
Neil explaining me db engines? 😲
I am not skilled with it tho.
 
if a table has very few records in a one to one with a table with many records, it'll exclude a record first using this
neither am I
 
I prefer network related stuff
 
I just spent a lot of time around a guy who does
 
12:41 PM
I am good in writing queries , even optimizing it but db engines itself?
gotcha point them to your colleague
because I often got a question "why this" while it improved the performance. Followed with "how". I just don't know. Tried something and it went better 😛
 
this colleague doesn't work with us anymore
he applied to amazon and got the job
should tell you something about his skill level :P
 
12:59 PM
karel you a woman?
 
That's one way to ask for pronouns
 
@Nobody I am that Belgian twat.
 
@KarelG I've jsut checked Jira
3k5 for a month ...
Or am I wrong ?
 
1:16 PM
uhm I cannot follow.
please refresh my memory
 
1:46 PM
KarelG.cache.clear()
 
Jira + Bitbucket vs Gitlab + Jira (?)
But its not by mont my bad
Still it goes from 10$ for ten to 3k5 for 25 WTF
 
2:17 PM
because they did their homework
they know 10 is a small developing team, but 25 is a medium business
and they also know small developing teams turn into medium business with time
 
2:46 PM
Can someone check out this question please?
https://stackoverflow.com/questions/58543699/how-to-update-list-without-refreshing-the-page
 
Ho yeah but jeez
Its crazy exepensive if you just want to test the solution haha
However we will must probably pay the bill so I guess they are right
 
 
2 hours later…
5:17 PM
Vue 3 looking good
Vue 2 was great but using Typescript with it was a nightmare
I've had a project on hold for about 14 months now, literally just waiting for better Typescript support to land
 
 
1 hour later…
6:43 PM
James is dead. Power is out. Sever is down :((((
 
ruh roh
 
🚽
 
you need a ups
 
James who?
 
it's a bot
@JamesBot where art thou
 
6:47 PM
Those who have worked with Google Cloud, is there any way to guaranty that costs don't go extremely high if, for example, someone make's 1,000's of requests to the server? I know you can add budgets, but that only notifies you at a certain limit. It doesn't shut off the instance.
 
No, you have to do that yourself
 
So, overnight my cost could go from $10 to $1,000. And theres nothing I can do?
 
fwiw I've been doing stuff in GCP free tier for years and when my server started getting hit by Chinese bots that exploded my egress volume, guess how much that unexpected traffic cost me
it cost about $0.48 in a month
and the next month I just blacklisted that IP range and problem solved
 
Ok, but if the attack is deliberate than it might be wayyyy more traffic.
 
put up some decent DOS protection and I don't think it'll be an issue
these chinese bots literally caused me gigabytes of egress, solely from my server responding with 404s
gigabytes of Not Found messages
 
6:51 PM
Alright, I'll look into it. I am trying to work with my school to get a server and they are concerned about this.
 
throw up a free Cloudflare in front of your GCP IP and you'll be good
 
cloudflare has helped us tremendously in terms of dealing with malicious traffic
 
^
honestly, if you're really worried about it, do this
buy a $100 Visa gift card
link your GCP account to it
 
@forresthopkinsa Oh thats actually really smart
 
6:54 PM
Looking into Cloudflare now, didn't know the had free option.
 
I still highly doubt you'll ever run into a problem anyway but it's nice to have a kind of payment firewall
yeah CF's free tier is very generous
I'm sure they're data mining or something but who cares
 
Yeah shocking how cheap it is.
 
7:07 PM
If you use Cloudflare, can't they intercept all data including credentials submitted to your website?
 
yep
that's why you don't use a CDN you don't trust
 
hmm...
 
7:28 PM
I'm trying to name a store, that encompasses the choices a users makes about the interface, such as mode selection, menu selection, what sections are toggled, and stuff like that. UserStore feels whelming. Any idea?
UserPreferenceStore possibly, but it's not quite that
 
7:48 PM
LayoutStore?
ViewSettingStore?
 
 
2 hours later…
9:39 PM
James!!!!
|| status
 
I am currently alive!
 
yayyyy
 
|| meh
 
@KevinB Invalid command! Try help for a list of available commands.
 
10:23 PM
|| eval meh
 
@forresthopkinsa "ReferenceError: meh is not defined" Logged: ``
 
||> let meh = 'epic'; console.log(meh);
 
@forresthopkinsa undefined Logged: "epic"
 
||> setTimeout(() => console.log('ok'), 1000);
 
@forresthopkinsa "ReferenceError: setTimeout is not defined" Logged: ``
 
10:29 PM
What about a ||>> command that will execute the next message you send. It will allow you to send multiline formatted code?
||>>
 
@JBis "SyntaxError: Unexpected token >" Logged: ``
 
||> let ok = 'ok';
let foo = ok;
console.log(foo);
wow fine
 
odd
 
guys i'm getting error sender id is not defined in this code may i know why?
socket.on('messagesent',(data)=>{
let {senderId,recieverId,senderName,recieverName,message}=data;
Message.findOne({where:{
[Op.or]:[{senderId:senderId,recieverId:recieverId},{senderId:recieverId,recieverId:senderId}]
}}).then(result=>{
if(result)
{
const id=result.room;
Message.create({
senderId:senderId,
recieverId:recieverId,
senderName:senderName,
recieverName:recieverName,
Message:message,
room:id

}).then(()=>{
socket.to(recieverId).emit('newmessage',senderName,message);
console.log('message sent');
i know the code is a bit overwhelming even for me it was
 
|| welcome @Atulkumar
 
10:36 PM
@forresthopkinsa Use a space between || and your command. For example: || help
@Atulkumar 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.
 
not what I was looking for
@Atulkumar use ctrl-k to format your code
 
@forresthopkinsa Fixing....
 
@for
 
Cap had a certain command specifically for the formatting message
 
@forresthopkinsa   socket.on('messagesent',(data)=>{
        let {senderId,recieverId,senderName,recieverName,message}=data;
        Message.findOne({where:{
           [Op.or]:[{senderId:senderId,recieverId:recieverId},{senderId:recieverId,recieverId:senderId}]
        }}).then(result=>{
               if(result)
               {
                   const id=result.room;
                   Message.create({
                    senderId:senderId,
                    recieverId:recieverId,
                    senderName:senderName,
 
10:37 PM
I was never able to remember what it was. might've just been !!formatting lol
@Atulkumar which line are you getting the error on
don't give me a number, find the number in your codebase yourself and send me the surrounding code with an arrow pointing at the broken line
 
39 the first line of message.create in if codition
 
mmhh ok
that's sufficient
 
@forresthopkinsa hmm, I thought it was just this message:
Sep 25 at 10:37, by Caprica Six
@Launemax Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
that's the one, but you were able to trigger it manually
that'll probably be easier than implementing an unformatted-code-listener
 
yup worked or the first time then it stooped suddenly
 
10:40 PM
@Atulkumar are you familiar with JS Object Literals and, more specifically, property shorthand?
 
@forresthopkinsa no
 
it looks like this:
||> let foo = 'bar'; let obj = { foo: foo}; let shorthand = { foo }; console.log('obj: ', obj); console.log('shorthand: ', shorthand);
 
@forresthopkinsa undefined Logged: "obj: " {"foo":"bar"} "shorthand: " {"foo":"bar"}
 
notice how both objects have the same contents
even though they were initialized differently
 
actually that find all statement i have created for checking with or condtion
so should i use deffernet variable for my or condition?
 
10:44 PM
hmm.. let me be more direct
if you have a variable abc
and you want an object with a property abc containing the variable of the same name
the way you're doing it is obj = { abc: abc }
the shorthand way to do it is obj = { abc }
they both make the same object but the second one is shorter
 
okay let me try htat
 
if you omit the colon then it assumes you want a property of the same name as the variable
It is not the problem you're having
I'm just noticing that your code isn't very clean and this will help that a bit
Your problem is that your data object at the very start of your code does not have a property senderId
You should try logging that object and see what properties it does have
 
@forresthopkinsa i have abd yes i'm passing that senderid there and still i'm getting the same error
@forresthopkinsa undo my code let me try once more
@forresthopkinsa it worked actually it was because of removing the else keyoword should i put my working code in case any body needs it ?
awkward silence in group again
 
have you asked a question about it on Main?
or just in here?
I'm at work lol
 
@forresthopkinsa no....i have asked here only
 
10:59 PM
then no you don't need to worry about updating us with your working code
 
sure please continue i was kidding around
 
what?
you didn't get your code working? lol
 
@forresthopkinsa is working i was kidding around by telling my remark about silence
it's *
 
ohh no problem lol
 
11:30 PM
@forresthopkinsa
socket.on('messagesent',(data)=>{
let {senderId,recieverId,senderName,recieverName,message}=data;
Message.findOne({where:{
[Op.or]:[{senderId:senderId,recieverId:recieverId},{senderId:recieverId,recieverId:senderId}]
}}).then(result=>{
if(result)
{
const id=result.room;
Message.create({
senderId:senderId,
recieverId:recieverId,
senderName:senderName,
recieverName:recieverName,
Message:message,
room:id

}).then(()=>{
socket.to(recieverId).emit('newmessage',senderName,message);
console.log('message sent');
 
@JBis 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 like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
good work!
 
yippee
||> let ok = 'odk';
let foo = ok;
console.log(foo);
 
@JBis undefined Logged: "odk"
 
nice! two tickets resolved
 
11:49 PM
@JBis why you reposted my code again ?
 

« first day (3295 days earlier)      last day (1652 days later) »