« first day (3371 days earlier)      last day (1799 days later) » 
00:00 - 21:0021:00 - 00:00

 
6 hours later…
USM
USM
06:10
Is it necessary to delete git brnach both in local and remote?
@USM 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.
USM
USM
@JamesBot I am not new to this group
 
1 hour later…
07:27
stackoverflow.com/a/16668731/11459517 plase find my comment and help me to solve
@SanghamitraLahiri that's not how it should be done
but you need to clarify what you meant with "it is not showing any result"
@SanghamitraLahiri define "it's not showing any result"
Do F12 for me, find the console and put this inside:
(parseFloat("4.0")/parseFloat("100")) * parseFloat("5.0")
*turns off Neil's repeat mode*
This returns 0.2. So your code "works"
You need to check the input..
Btw it is likely that your use case is sufficient to use Number(...) instead
parseInt and parseFloat should be used only in specific use case now.
07:38
@KarelG you might as well try to convince him to go for a functional programming approach for all the good that'll do
he's clearly stuck at step 0
parsefloat has some ... let's say ... odd side-effects
it only confuses people that are new in js
(like it did at me back then)
Number is a robust solution to it
@Neil and @KarelG i couldn't get you guys.
just tell what you mean with "it is not showing any result"
that code you have written should work. So explain that. What are the input data, what did you got as output? what's expected?
@KarelG means it is not showing the answer in the resultant text box
@KarelG yeah, but that doesn't really address his problem, and it is more confusing to receive advice that doesn't fix the problem you were looking to solve
07:42
eh, if a starter is using eval, aren't we yelling that he should do something else already?
@SanghamitraLahiri Listen carefully, this is an important concept. If the code "works" which we ourselves have said that it does with reasonable inputs, then the only other way it could fail is if your input is not "reasonable"
to know the whole story, we also need to know the inputs
@SanghamitraLahiri there is a condition check !isNaN(result). If that gives false, then the result is not being displayed in the resulting text box.
what are you putting in your input boxes?
so result is NaN. That means one of your inputs is not valid
@Neil I have put 10.8 in first text box and 1000.0 in the second text box
07:45
ok, so open up your console and type:
(parseFloat("10.8")/parseFloat("100")) * parseFloat("1000.0")
what do you get?
@Neil /parseFloat("100")) was unexpected at this time.
@SanghamitraLahiri copy the whole thing, parentheses included
I get 108.00000000000001
the difference between this code and the code you're using is that you're pulling values from textboxes whose ids are txt1 and txt2 (see the lines above it)
do your textboxes have ids? are their names txt1 and txt2?
my point being that if you get the right values by directly adding the values, then something is wrong retrieving those values from the textboxes to begin with
they already habve ids
07:51
@SanghamitraLahiri and their ids are txt1 and txt2 respectively?
yup i also think so
do you have several textboxes with these ids or just one with txt1 and one with txt2?
again, you can use f12 to see the source for the page and check
don't make assumptions
yup I have several textboxes with same ids
there you go
07:52
when you do document.getElementById, it expects exactly one element
if there is confusion, it could be getting the value of the textbox which isn't filled
oukay I got my answer
Honestly I think it grabs the first, but don't count on that
thank u very much
always make ids unique
np :)
 
2 hours later…
09:30
syntax highlighting issue in chrome developer tools after update Version 79.0.3945.117 (Official Build) (64-bit)
09:48
Is that a question?
@BenFortune error message with firefox 42. ERROR MESSAGE WITH FIREFOX 42!
Can anybody help me with React?
Hi Gunter, just ask your question
10:04
I am refactoring a class component to a funtional component and would need access to the this´´ keyword. How do i access this´´ on funtional components?
Can anybody help me with Javascript?
@G.Lakshmi 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.
stackoverflow.com/questions/59642771/… Please read this question and please help me with this.
@GunthervonGoetzenSanchez you can bind it
or more cleaner: pass the object
can i show you the code?
I am getting crazy with this thing
10:15
Can anyone please help me
@GunthervonGoetzenSanchez sure
Can i invite you to a private chat room?
@G.Lakshmi that code has numerous serious issues
and asking why it isn't retained from one page to the next would suggest that you're missing some fundamental concepts regarding how http works
Can you help me @Neil
@G.Lakshmi lets start with this.. if you update the web page, you're always updating the client's version of the webpage
if you navigate away, no changes will be retained
if you want to save them, you need to communicate it somehow to the server, say via submit or ajax
10:30
Ok
But upto now I had saved them in the local storage and navigating its working
local storage is always local though, remember that
also, you're creating ids like main_1, main_2, main_3
so the local storage it will be in my pc thats it not the others pc?
conceivably you could have a main_567, but your code is handling only up to 9 like this
that's an antipattern
yes, it is only saved locally on the client's computer
yes I am having 9 cards so I took upto main_9
better to give them all a common class like say class="mainCard card6 mt-3"
10:34
no actually I am getting the card details dynamically to display on the web page
like this, you no longer have to call them by id, but you can write $('.mainClass').click exactly once
from database I am getting the card details and displaying on web page
and also I have a restriction like the user can click only one card in the displayed cards
10:51
@G.Lakshmi ok, so you're reading from the server just fine, you're missing the part where you tell the server to add the new cards
I didnt understand
which part didn't you understand?
tell server to add new cards
because when you load the page, the server determines which cards to load on the page
if you don't change that, it will always give the same data for that page upon reload
unless you intend for new cards to be saved strictly client-side (so per PC)
11:19
@Michael_B ?
Would anyone happen to know why trigger('click'); could cause the error: "Maximum call stack size exceeded"?
Here's the full code. $form.find('[data-formpage="' + current_page + '"]').find('.cf-page-btn-next').trigger('click');
@nicarpe recursive call in DOM
that jquery function isn't a good one. Use .triggerHandler (which is better IIRC)
yeah I tried to use .triggerHandler however it was causing the same issue. I'll give it a go again, one sec
yeah, it's the same issue.. :/
want me to link the site?
there is a class selector in the .find, so I think it might be the problem. I am not certain tho. Try ....find('.cf-page-btn-next').each(function(){$(this).triggerHandler('click')}) instead;
11:35
yeah, same outcome unfortunately...
._.
if you'd like I can attach a screenshot of the full code?
are you sure you refreshed the page, so that the old script is not used (caching?) 😛
best to link the site
and where I should click to reproduce the error
(or what action I should do)
alright sure thing. is it fine if I use a short link? I found Google likes to index the chatroom and I'm not sure if it would affect the SEO haha
so the form on the right needs to switch pages automatically upon a click of one of the buttons
11:52
@MadaraUchiha, in case you were still recognizing canonical answers with a bounty... cheers! stackoverflow.com/q/45367864/3597276
hey guys!
Succubus Senpai:
hola
how you doin
im gay
I'm happy as well
:)
sorry that was my mate, I know that came off as a bit disruptive in the conversation. apologies
12:01
I'm not your mate, pal
I'm not your pal, buddy
I'm not your buddy, honey
im not your honey, dude
yeet
Good morning everyone!
good mornin'
12:08
😂 there were problems with adding records to a table in a not-much-used database. The log was not clear on this because it is not clear (stupid dev sent a method name instead and without stacktrace). Yet there were no releases in meanwhile. So we don't know what happened. Until I checked the table. It got locked. lol wtf.
so I asked. Response in mail: "Storage issue"
> We ran out of storage
I've had that happen in prod before
ouch
just get all the storage 4head
formulated a response that there were complaints about it. Followed by "I decided to point them to you because you are working on it 👍"
= not my problem anymore
12:24
Who put the bomp in the bomp bah bomp bah bomp
Who put the ram in the rama lama ding dong
Who put the bop in the bop shoo bop shoo bop
Who put the dip in the dip da dip da dip
 
1 hour later…
13:28
Note to myself:
Never try to handle JWTs in C code
Never try to undo what I did in JS code in C code
(more fun, I have strict 4Kb ram)
A better idea is just not using C
@ShrekOverflow you should use either C or work with instruction code of the device.
( set of OPCodes :P )
greetings progams! and happy new year
sorry bud but new year's already over
does not matter
13:40
brain dead tis morning. trying to use arrow functions to filter an array using two criteria. with one i know it's as straightforward as output = myArray.filter(x => x.id === external_id) and that works great for filtering out ids like a key search. but what if I need to filter the array from two external keys, like an oid and cid (to make the filter return only one match).
@SuccubusSenpai I can kick you just for the name
i think it has something to do with curried arrow functions, but still getting my head around that. any prodding in the right direction is appreciated!
it is a friendly greeting to wish everyone a good year this year
so being friendly is highly adviced
@KarelG there is more to the problem
see I am trying to transfer ATs over QR
the QR scanner is my iPad Pro (such irony) for now
which talks over BTLE
are you still on that? 😛
13:41
soo ... the max data we have is ~110-200 bytes
A usual token is ~500bytes+
you can reserve 1kB for token data
and google is fairly useless for what i'm trying to do >.<
(is there no hdd hotspot swap?)
@KarelG you can't transmit 1kb over QR
it'll be impossibly complex
so here is what I did

1. Extract only the dynamic fields from the token
2. Create a protobuf version of this
3. Put that + the original singnature as QR
reserve as using 1kB of those 4kB. Then you know the limitations
13:42
my bad lol I was trying to be ironic with that message
Now theoritically the static data should be on the client
and so the client recreates the original payload of the JWT
and the signature should match
that requires a dedicated chipset
Reversing that in C though is fucking nuts xD
(if you don't want to programmatically handle it)
@KarelG so that is ideally what I will end up with, the board should just validate this, then raise that to a main board or something
13:43
apparently QR codes can store up to 3kB.. according to this article qrcode.meetheed.com/question7.php
@thedigitalmouse yes but you need a really good scanner
for being able to read a QR that dense
it'll look identical to noise on a 1.9" reperesentation
how about... compression on the data, QR that, then reverse on the otherside? well ok as soon as i typed that it probably would not work for static non-lossable data :(
but fun stuff nevertheless
@ShrekOverflow neat
@thedigitalmouse I already mentioned that
I am going even further then compression
13:45
@thedigitalmouse there is always a bottom limit in data-compression
@KarelG I think the ideal thing I should do
like a nice Apple Fanboy
is reverse the process on the iPad
and not the arduino
Anime is pretty bad though isn't it?
13:46
what if someone wants to use a different scanner?
which higher/fewer scan resolution? :P
Ideally we should have a different data-format :D
"scan density" is a thing as well eh
CBOR/CWT would end up being the right size
*puts hands in air*
@KarelG agreed, but this is a demo :P
:D and ... I'll eventually do it in C
13:48
just get a higher qulity scanner? :D
quality*
but for now, lol no
@thedigitalmouse More than an iPad Pro? Most QR Scanners scan essentially < 64 bytes of data
anyway thanks for insights! :D
@KarelG I shall sahre the final demo as a YT video!
@ShrekOverflow why are your keys so big?
@JBis not keys tokens
RS 256 + A bunch of http uris
the RS 256 signature is about 380 ish bytes on its own
so I changed to HS256 that leads much smaller sigs
the JWT format itself is very descrptive though
it was never intended to be used as efficient token, rather a way for claims to be passed around two parties
And what do you need this for?
there's a type of QR which uses colors that can significantly boost the amount of data which can be represented
13:55
can't you put those bunch of http uris on a single uri which would store like a plaintext file of the uris that you need
why need to scan it with we reader?
@Neil Wait waht?
honestly I don't see why we should stick with simply black and white
@JBis Long story short, arduino cool demo, (not for production) just exploring experiences
@Neil FUCK yes, if I could do that life would be great
I am scanning on an ipad anyway lol
that device has the compute power for my mac
QR code (abbreviated from Quick Response code) is the trademark for a type of matrix barcode (or two-dimensional barcode) first designed in 1994 for the automotive industry in Japan. A barcode is a machine-readable optical label that contains information about the item to which it is attached. In practice, QR codes often contain data for a locator, identifier, or tracker that points to a website or application. A QR code uses four standardized encoding modes (numeric, alphanumeric, byte/binary, and kanji) to store data efficiently; extensions may also be used.The Quick Response system became popular...
13:56
Would anyone here happen to know what would cause the following code to throw a "Maximum call stack size exceeded" error?
$form.find('[data-formpage="' + current_page + '"]').find('.cf-page-btn-next').triggerHandler('click');
Can you not store all the data you need in a db and then scan a code that is looked up in a db?
I think you have indirect recursuon @nicarpe
your .triggerHandler is indvertantly calling itself (probably)
Pro_tip, you can add debugger
to stop exuction as a last resot :D
hmmm
but honesetly set a breakpoint
13:57
I'll pastebin the code right quick if it's okay?
and single step!
hmm then it must be related to the event handler
@JBis Possible, but then the duino needs to connect to the DB
because if I try to e.x. throw an alert, it just keeps looping the alert over and over on the event
even though the event is a single occurance
Probably easier than trying to fit huge amounts of data in a qr code
13:59
@JBis I already solved the data problem ;)
So here is the (experiment) and this is not for production or deployment.

1. User logs in to the app, kinda like SB app, that adds a store card into their Apple / Google Pay Wallet with the QR code.
2. The user goes to our _machine_, scans QR makes use of the machine (kiosk)
Well in that case. Ignore me :)
The way I did that is basically remove most in-efficient parts of the JWT (static uris, key names etc)
that ended up with a highly compressed 110 byte artifact :D lol
so i'm guessing there are no arrow function warriors awake just yet? :D
14:00
@ShrekOverflow still think db should be used
that way you can store what ever you want
But it's a pretty cool idea, I like it!
@JBis I really hate DBs lol
If I can do something stateless
I will lol
@thedigitalmouse myArray.filter(x => x.id === external_id && x.whatever === external_whatever) ?
@nicarpe no idea
dangit :/
no idea what to do from here
hmm
@nicarpe did you .each it?
14:06
the event handler?
the code is here: pastebin.com/HpKgy6g9
3 hours ago, by KarelG
there is a class selector in the .find, so I think it might be the problem. I am not certain tho. Try ....find('.cf-page-btn-next').each(function(){$(this).triggerHandler('click')}) instead;
that forces jquery to evaluate the situation on the element level instead of in a collection
(when handling triggerHandler)
is there a way to force jQuery to re-evaluate its own usefulness and fade out of existence?
yet again not 100% certain it would work. jquery does sometimes odd things under the hood
ah Neil, legacy code. I am still walking in the jsp scriptlets puddle
yikes
and last monday I discovered a ***ing separate service that got built in java 3 within its own java EE container.
it would break if we update the baseline because that version does not support 2048bit keys we intent to use
(fun fact: the code got written in C++ style heh)
14:16
oh that sounds like fun
could locate the source code on an old svn repo
but I don't have access to that repo. So cannot add my creds
now sent a mail if someone still has access it :P
btw @ShrekOverflow I saw you swearing, and thought I'd tell you to maybe stop doing that since even kids are on the site
@SuccubusSenpai don't care
any further attempts at confrontation
will also be met wit hthe same attitude
So unwelcoming
fuck off weeb
14:32
let's imagine that he would react like his avatar
Alright
This is beginning to be in poor taste, please stop.
HAMMERTIME!
@JamesBot Not now, James..
14:53
well..
15:21
can someone help me with my attempt to make a front-end website to provide functionality for some library services using a simple rest API server?
@drleechy 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.
@drleechy that's pretty vague, but what you can do is ask questions on specific problems you're having and we can try to help you out
if you're not sure where to start, then this probably isn't the right place to ask
so i'm trying to search for a user's details by their name, but all i can do is get the list of names on the server to print to the console, which i'm now thinking means i've somewhere got the url of the server as a console.log print
@drleechy well you've got to do something with those names
check if it matches the input provided by the user, and if you only get one result, then you've found it
alternatively you can simply pass the input from the user to the server directly, and let the server do that for you and return a list of matching names
If you think you may end up with many names, the second option here is probably best
@Neil it prints the array of users on the server
15:28
@drleechy well check for where you're printing it. I presume it'll be where you're writing console.log(name) or something similar
can i post my API request code here?
pastebin.com is useful if it is more than a few lines
@drleechy the handler for the ajax call is processResponse
so presumably it's getting printed to the console there
it may be defined in a js file you're including to the page
is that relating to onreadystatechange function i have?
15:34
apparently it's another way of handling the ajax request
I don't see where you're assigning onreadystatechange, but yeah
i've ended up with about 170 lines of JavaScript and basically only now realising that some of it may be irrelevant, i'm quite new to JS and everything i've read so far seems to be pointing me in the right direction but i've got myself confused with all the codes i've got!
from what I see, if anything prints out the values it's the function processResponse
@drleechy once you figure out what is being done (or not being done), trim the fat
🤔
15:36
keep extra code laying around will only confuse you
yeah, deciding to start again D:
if anyone feels like tagging along and watching what i'm doing to point out where i go wrong feel free to let me know haha
you can take pieces from existing code
actually I would encourage that
just add only what you know you need and adapt it if necessary
yeah i'm taking new text editor and copying the stuff i know that works
15:52
Every time I delve more into this outsourced project, I hate the people who developed it more and more.
@KevinB I literally thought he was you
because that 🚽 is somewhat your "trademark"
16:19
Is there a way to get babel to check my code for code that needs transpiling, but instead of actually transpiling it just issue a warning/error eslint style? Lemme know if this is OT, happy to move it elsewhere...
@Crisfole 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, I'm sorry for the clutter. I got some more ideas for searching after the fact and found github.com/amilajack/eslint-plugin-compat-demo
17:07
I have this project where someone has created invisible buttons with onclick functions, and in javascript functions is triggering the onclick events through code instead of just calling the function. Is there any purpose for this?
17:32
I'm using Bootstrap vue table with contentful and could use some help with my code. I'm attempting to use a for loop to iterate over an array and get the property values. The console.info(); call prints out each iteration for my variable, but I am unable to get the same result outside of the loop. Using return only returns one result even outside of the for each loop. Any help would be greatly appreciated
@ShawnW 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.
 
1 hour later…
18:37
Good afternoon everyone.
I am creating a javascript or jquery survey app.

The app saves everything inside the phone itself, to be sent to the server, because there is not always a good internet signal.
Question:
How to upload file from file as I have only the link from where it was saved?

I thank everyone who can help me.
function upsync() {
  db.transaction(function (tx) {
    tx.executeSql('SELECT ID, id_ar, id_ambiente, foto, obs FROM vistorias_fotos WHERE id_ar=?', [id_ar], function (tx, resultado) {

      let rows = resultado.rows;

      for (var i = 0; i < rows.length; i++) {


        $.ajax({
          type: "POST",
          url: "https://testes.musite.net/app/up_vistorias.php",
          data: {acesso: 'ok',
                 id_ar: rows[i].id_ar,
                 id_ambiente: rows[i].id_ambiente,
                 foto: rows[i].foto, //->   file:///storage/emulated/0/Android/data/br.com.nomedoapp.
18:54
Can anyone help me?
If this is not the correct form, what would it be?
Why are you making db calls from the client?
@JBis In this part, I'm inside the app. This link will receive information coming out of the app to store online.
Huh?
I will take the information that is in SQLite, and send it to MySQL that is online, and also the image that is on the phone, send to the server.
Are you sure your server side code is working?
Are you receiving an error or what?
18:59
My question is how to send the image file using the previously saved path.
The data saves, but the file does not upload.
17
A: Ajax Upload image

RITUHTML Code <div class="rCol"> <div id ="prv" style="height:auto; width:auto; float:left; margin-bottom: 28px; margin-left: 200px;"></div> </div> <div class="rCol" style="clear:both;"> <label > Upload Photo : </label> <input type="file" id="file" name='file' onChange=" r...

@JBis But my case is different. I am not using a form. I want to send using the file path that is already saved.
file:///storage/emulated/0/Android/data/br.com.nomedoapp.app/cache/1578505903880.jpg
I'm not sure what platform you are on but you need to access to file somehow
@JBis I'm doing the tests via chrome browser.
I'm confused. Is this on a computer or phone?
Or a phone emulated on a computer
19:19
@JBis As it is javascript's to test on the computer first, Once it works, I test on the mobile.
You can't access files without the user granting permissions
@JBis The user already gives permission at the beginning when accessing the camera, but this is not my question. My question is in the image upload. Since the image path has been saved, I need to upload the image. This is my doubt.
right.
but the path is irrelevant
ajax doesn't need the image path, it needs the image
so do what you need to do to get the image, and then send it.
 
1 hour later…
20:40
is it worth converting james to typescript?
4
Q: Is it against the rules to proselytize your favorite things instead of answering the question?

Nathan HawksSo I'm basically at the boiling point with Microsoft's Cult of Typescript. When I ask a question in Javascript and someone uses the Answers or Comments to deride me for not using Typescript, can I report that message as a site rule violation? This question differs from Is the answer “Don't do th...

..ok...but how does that answer the question?
@JBis what do you hope to achieve with it?
i guess practice but its not really necessary
to learn typescript?
then definitely
20:53
yes. Also maintainability.
use any hobby project to learn something by going fully at it
hmm ok thanks
maintainability is more about discipline tho
but... yes... TS can be quite a bit easier than JS to apply that discipline
I wrote Wietbot as a microservice set... might not be the best for a chat bot... but at least I get to play around with all the features it has
and I still have to fix a few issues with it
such as unnecessarily long startup times
00:00 - 21:0021:00 - 00:00

« first day (3371 days earlier)      last day (1799 days later) »