« first day (3330 days earlier)      last day (1843 days later) » 
00:00 - 20:0021:00 - 00:00

00:00
hey
Is there any Redux store middleware that returns result of store.getState as an Observable?
I don't see any from a quick search at least
00:56
FYI
new Set().add(...[])
01:18
@JBis Fix what?
by not allowing Array constructor to accept moe than 1e8
1e9 is erm 1B :P
1 Billion bytes would be 1GB
1 Billion bytes * 64 = 64 GB
obviously you'll run out of heap
01:35
Yeah need to put a memory in time limit on my bot
 
2 hours later…
03:36
@Hypersapien As long as you are creating objects instead of DOM elements, 100 to 200 is not much and should not pose obvious overhead. If the properties has a default and/or the methods are shared, consider using class or prototype to share them, i.e. standard OOP. Note that functions are object, so if you are creating new functions for each object you'll get around a thousand objects instead.
04:08
@Hypersapien If you need the objects, you need the objects. Performance doesn't seem relevant.
There's no performance cost for holding objects in memory
Performance is relevant when using your data structures for some purpose, and doing so inefficiently, though that probably is also irrelevant for a few hundred objects in an array.
 
4 hours later…
07:54
Hi Anyone having idea how to get the final redirect url in node js, I tried something with request but it's giving first 301 redirected url, I need to get the final url and return as response from function
It should be returning the new address as well
08:08
const getStatusCode = async(url)=>{
  const { statusCode, data, headers } = await curly.get(url)
  if(statusCode == 301){
    let redirectUrl = headers[0]['Location'] || headers[0]['location']
    await getStatusCode(redirectUrl,true);
  }
  else if(statusCode == 200){
    return {
      statusCode:statusCode,
      redirectUrl:url
    };
  }
}
@Gowri 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
I tried this but It's returning undefined
08:54
@Gowri could be that you reached the "else" branch that isn't present so the function returns a "void"
@Gowri You're not returning what is getting returned by getStatusCode
with other words statusCode isn't 301 or 200
(fyi use === when comparing in javascript)
also true, if it isn't 301 or 200, you get undefined
and in your first if block, the last statement is await getStatusCode(redirectUrl,true); of which you aren't returning.
ect
so, use the debugging tool
Enjoy that 301 infinite loop
09:05
getStatusCode(redirectUrl,true) is a mistake getStatusCode(redirectUrl)
@Neil: return true solved my issue
thank you so much!!!
well gotta verify that it works too :P
Sorry oh no, it just returns true in the final promise!! instead object
you are confusing me with "returning true" while the function name is getStatusCode
my guess is that you should be returning the results of calling getStatusCode recursively
but using the new url
if you use the same, it's just an infinite recursive chain
const getStatusCode = async(url,redirectedUrl = false)=>{
  const { statusCode, data, headers } = await curly.get(url);
  console.log(statusCode);
  if(statusCode === 301){
    let redirectUrl = headers[0]['Location'] || headers[0]['location']
    await getStatusCode(redirectUrl,true);
  }

  if(statusCode === 200){

    let response = {
      statusCode:redirectedUrl?301:200,
      redirectUrl:url
    };

    console.log(response);

    return response;

  }
  return true;
}
09:11
@Gowri 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
This is the modified code, I am expecting response as result but just getting true
@Neil: Yes I am passing the new url from header location property, so it's not infinite loop
@Gowri what do you think await does?
it isn't a return
I'm calling this method like this
 getStatusCode(url).then(response=>{
  console.log("=====",response);
 });
well if you're getting true as the result of the call, then it means it's reaching the end of your function
I'm guessing that if you're at the end of the function, then something went wrong
@Neil: I haven't used aync/await much, Can you tell me how to get result , I thought await will hold the function not to reach next line to execute
09:18
@Gowri yes, that's what it does, but you're not doing anything with the results of that call
if you did say, return await getStatusCode(redirectUrl,true);
then you'd also be returning the results of the call
@Neil: Oh yeah it was stupid mistake, thank you for helping to understand
@Gowri that is true, but you forget two aspects.
that what Neil has said
// if you do
const myVar = await myPromiseMethod();
// then the code waits when myPromiseMethod has returned a promise. Then it "unboxs" the value in the promise and then assigns it to myVar

// now you have
await myPromiseMethod();

// which is essentially
returnValue;
// you are not using `return` so the program proceeds to the next statement. Since there is no another statement, the program performs an implicit return: `return;`
hence you are returning "void"
and the second aspect is that using async function always returns a promise
eg
async function getOne() {
  return 1;
}

const p = getOne(); // p is a Promise object with resolved value "1"
// so
getOne().then(val => console.log(val)); // puts 1 to the output
you cannot do
@JBis you need to write a sane bot
sane as in sandboxing well done
don't run it in node
node murders JS security model
const isThree = 2 + getOne(); and expect that it is 3
@ShrekOverflow he has added a vm for bot commands
this one if I read it right (was not reading the whole conversation yesterday)
@KarelG trust me he still has a crypto miner
vm.runInContext is still running native code
a mistake and boom
09:29
🤔
heh.
Remember I work for Auth0
what would you suggest then?
We have Rules :P
@KarelG not letting client sent code run in node
a browser is goodish
because the browser sandboxing is stronger by default
so his jamesbot has to operate two scripts, one for node and the eval command locally?
or
use a service that scales that kinda work
Right from the docs

> The vm module is not a security mechanism. Do not use it to run untrusted code.
again browsers aren't a good solution either, but a wee bit safer
as they by design try to block native access
containerization and proper sandboxing is a hard topic 😛
09:39
I can tell from experience
a manager had a bright idea to "allow an application user to interact with a ML subsystem so that it can be steered and being used in his tooling"
I was on holiday and my upper manager was on the meeting and said that it is ok, so my team can implement that
Had to cry and be angry together when I heard that
@KarelG brilliant
the ML subsystem is on a server. So we tried to containerization (kubernetes) it
I don't have an idea to do it properly and my team tried many things
eventually the project is on hold
I only hope that the idea-monster does not remember that idea again so that he won't ask for any status or something >.>
 
2 hours later…
hello
I have an issue with ajaxStop
HAMMERTIME!
I have some code dependent on ajaxStop event, but sometimes ajaxStop doesn't fire
after ajax requests completes
I have been debugging it for many days, I didn't find any issue
detected stop
HAMMERTIME!
@AbhishekPandey how are we supposed to help if we don't see the code?
Magic Crystal Ball? :)
would be nice to have one of those
It'd replace my rubber ducky
11:51
@KarelG I know, I can't post the code, because I don't even know which one is not working, I have 1000 lines of code
You debugged it for many days and still don't know where in your code something isn't working?
all I can say is I have ajax method and ajaxStop event
@geisterfurz007Stopthischaos ajax is working no errors, but ajaxstop is not working
it happens sometimes only
how can we help then?
no always
just show the ajax method?
11:54
@KarelG I'm just wondering that anyone else has same kidda issue
@KarelG sure
@AbhishekPandey learning how to debug is crucial in this field. Don't ask for someone to do this for you because it won't do you any favors, I promise
If anything, ask questions on how to debug
I can only say that the ajaxStop should work properly as it is been around for ages.
$.ajax({
  type: "Post",
  url: getUrl(), // this is getting url
  data: {...},
  success: function(result) {
    if (typeof callBack == 'function') {
      callBack(callBack1);
    }
  },
  error: function(error) {

  }
})


$(document).ajaxStop(function() {
  UIComponents.uiframeworkInitiate();
  UIComponents.draggableModal();
  $("body,html").removeClass("wait");
});
@Neil no offense, I know debugging quite well, I often don't ask such questions here, if I had any idea, I would have posted this as question on SA
@KarelG I agree, that's why I'm pissed
@KarelG I honestly think we need to start from scratch
for both web apps and native apps
Web is just Google's Native platform
while Native was originally murdered by Microsoft
Apple kinda saved it a bit, now it's being completely tormented by Google
@Neil the worst part is I'm unable to find any pattern that when it's working when it's not :/
12:19
@AbhishekPandey that should work. But you might have forgotten something important of ajaxStop
HAMMERTIME!
@JBis ^ add word boundary to the regex detector
the ajaxStop event is only fired if there are no other ajax requests running atm.
I believe that this might be your problem
@ShrekOverflow do you have heard of the parable of a banana on a stair shelf?
that's how it got evolved to what it is now.
@KarelG Nope
it is up to the "stubborn" minority to point out that it is still wrong. People like you.
but Looking at some of APIs on Android I am wondering was there any thought put into this
if at all
12:23
@ShrekOverflow i.snag.gy/kdu77.jpg .
@KarelG Yeah, I know the fact, anyway I'll see if I can figure out something, I thought if there would be any known issue with ajax which is I'm not aware of.
the answer on that is "no".
@KarelG ah that one yes
like Android < 6 basically lets any app be "I am domain.com" without any verification (wtf?)
oh yes
I was like "no wai"
I had to check it again
then nope'd
Lol
Then I look at Google's Intent(ional) mess
like wow :|
I wonder if the OG idea was to stream them straight to Google
Not saying iOS is any good either
they are way too conservative to the point to allow developers to do anything
You want to send any data over NFC, why why would you ever want to do that?
It's not like NFC was a protocol developed for near field communication or something :|
on the other hand, Google just lets you open a browser from an NFC tag without user consent (WTF?)
Their defense was: "Oh yeah but it needs user to tap 'Always Allow' and then the phone needs to be unlocked"
Have those folks ever travelled in a Train or bus?
THe pinnacle is web though
We can't trust the web to know which codecs the browser can actually play, but we can totally trust it to scan and connect to bluetooth devices.
12:55
@AbhishekPandey Sorry that I didn't respond immediately (lunch break).
Fair enough. It can happen that you don't know where to start I suppose
13:07
@KarelG have you ever pondered if all apps would be considered insecure by default by the operating system? Like we do on Web 😃 ?
many would stop with processing or not even start up
@KarelG And that is how it should be
for those old apps you can always just halt them from OS level and render a consent prompt
a reasonable consent prompt
iOS taps itself on the shoulder with state of the art privacy settings and yet there is not option to allow One time or only last 10 picture access to apps :|
on the other hand Android just lets any app read SMS records like hey just read it, what sensitive information ends up in SMS anyway? (IIRC they finally fixed it, but sitll not good enough, as the user is never involved in these processee)
and don't get me wrong I am not asking for spam of consent prompts, I am asking reasonable OS level design decisions when accessing something like the BTLE Radio
we have speculative code execution (not available on intel near you), why can't we have speculative abuse detection
my phone keeps asking to access files folder for pictures when i go through my contact list
^ See my point
wait I haven't made it
like I said "no" multiple times.
13:17
Yep
Why on earth can Tinder just access all of my pictures
if you said "yes" then they don't ask anymore
Why can't iOS / Android just make a customizable file selector
if "no", be prepared to be asked again
most apps file selectors just need a bit of design update anyway
@KarelG Android?
yes
13:18
Ah yes htats another fun one
Always Allow
Allow
No
actually OxygenOS
They forgot the "Never"
but it is just android with an extra layer over it
I know
I just went through 207 pages of NFC docs
by Google and Apple
utter mess for something that could be much simpler
docs or standard?
13:19
No no, docs
._.
and guess what? they are exactly the same
Apple came first, so seems like Google copied the API (I may be wrong but IIRC PassKit was released in 2013, while the new Google APIs are from 2017)
but then went really far to hide that it's the similar API
on NFC its a mess, because why not confuse the developer?
@KarelG I am sure the standards people died in rage
While they both use NFC they actually use a different protocol

> Apple VAS and Google SmartTap
what's wrong with that one defined in the nfc standard?
it is simple
@KarelG No clue
But you can't just use Apple Wallet or G Pay as an NFC Tag
you have to write an app for it
On Apple, you can send 64 Bytes of data at max and would require Apple VAS on the other side to read
Google requires google's own protocol.
One reason I can see is that because this is payment they probably want some kind of certificate exchange before you transmit the information
wait, I did not have written apps that use nfc but ... is there no internal API for it?
or am I just misreading that sentence
13:26
There is the NDEF API on both
but you need to write an app
well?
is it not a purpose of apps?
Just to transmit a string? Over a standard protocol?
both of these geniuses allow QR to be used as-is
(you can put a Gigantic blog) and they'll render QR for you
but not NFC, because reasons.
bank apps uses QR to validate the other "recipient"
See my point
QR / NFC are both transmission technologies
they just tried to work out electronic payment between 2 persons without any shizzle required
13:28
I'd be ok with specific requirements for Apple Pay, G Pay
I was like "just show a bar code that shows the other's IBAN, scan it and write over money"
just let me send a god-damned STRING FFS
so now I am writing the app 😐 to transmit data
that it already has
This is the closest thing I have found developer.android.com/guide/topics/connectivity/nfc/hce
but i don't want to emulate a card
And from Apple's POV this is easily doiable using their extensions framework
what's your current project btw?
How can i split this string "XXXXE6CB3301EE9BAE70986F55C1843" to this one "XXXX3E6C-B8FE-1EDA-84B9-2D7B45743ECD" on a efficent way? So after every 8-4-4-4-12 CHAR?
writing a payment app thing?
13:34
@KarelG nope just exploring if we can connect to devices using wallet
imagine a kiosk you show up tap your wallet card and use (for say my beer dispenser)
This makes total sense, the better Google API is where it should never be exposed [arguable -- actually I'm in favor of all for web, but we need better consnet managemnt for web], Web: w3c.github.io/web-nfc
@BayLife use grouped regex
or with a handy function
hm okay, thanks
there is a .substring for that lol
14:05
.substring
.substr
.sub
seems meta no ?
Oh nice firefux also supports it chromestatus.com/feature/6261030015467520
there are different ways to get a part of string in js
but .substring is the way to go
14:29
thought of a smarter way than this :D
console.log(str.substring(0,8));
console.log(str.substring(8,12));
console.log(str.substring(12,16));
console.log(str.substring(16,20));
console.log(str.substring(20,32));
what if someone asks to have a different structure than that? :)
That is how you fixed it?
you can just do module.require
||> module.require("fs").readFileSync("~/.ssh/id_rsa.pub").toString('utf8')
require=undefined hehe
Good Afternoon!
14:36
@KarelG input and output is to a SAP system, they will not change :P Othwise i´d be happy, because i dont have to support their old shit anymore
@user400654 Cookies have nothing to do with authentication
they are a state storing mechanism not authenticating mechanism
they can be used for storing your tokens / state what not
What I have learnt today is if I want to be mean I, I, I'll find a way
they can be used as a way of staying "logged in"
but it depends on having a token that's only temporary, and then after you use it, it gets invalidated so you have to replace it with another
but it's not particularly secure, as anyone using that pc can have access
@Neil so can localStorage, sessionStorage, browser fingerprinting (if you get creative enough), asking the user to manually enter a token
@ShrekOverflow yeah, it's just storage ultimately
oh and yes RAM
14:42
did Kevin clear his profile name?
@KarelG Probably he faced Jarraxus
(NDugger) and just left
This network is cancer.
wow this is so pathetic stackoverflow.blog/2019/11/25/…
Do stack-exchange folks exist in a timeline that doesn't have politics or ahem, people?
pfft I just don't pay attention
10% of responses saying unwelcoming ins't actually that bad
Try asking immigrants the same questions (esp the ones going to US)
People have norms, and 10% of people will most likely not understand that ther are norms to be followed / or have respect for them anyway then complain anyway ffs
Have they seen the C community? lol
15:02
@ShrekOverflow 1. No you just didn't read the code. The line above that clears out the module object. 2. Look at the other branch, it's being rewritten
@JBis are you trying to challenge me to find a way to get access to your require?
enable the eval :)
lets play
@ShrekOverflow You wanna play? Ok give me 10 min.
ill even let you see the source code

Test My Bot

A room for discussing and asking questions about SO/SE bot cre...
15:25
@KarelG done
@ShrekOverflow bot is open for cracking
15:41
and I was out for coffee 😃
eval is backon for james
if any issues are found please at me and i'll shut it down
16:04
Better but still, be warned people will find a way 😃 lol, are you atleast cycling vms b/w runs?
Yes.
Or at least it should be. The only thing that doesn't change is the isolate module it self. If you are able to corrupt that, it will be persistent throughout runs (until the bot is restarted).
I could also implement an auto restart ever day.
16:38
@MadaraUchiha Just out of curiosity, what happens if you permalink a message from a mod only room into a public room?
 
1 hour later…
17:48
hoooray
18:39
Anyone can help me for my question?
stackoverflow.com/questions/58863744/…
People are more likely to go there if they can just click the link instead of having to copy-paste it :)
 
1 hour later…
19:53
@geisterfurz007Stopthischaos Sorry
2
Q: How to manage a multi-step form with React?

th3g3ntl3manHere is the code of my multistep form: import clsx from 'clsx'; import React from 'react'; import PropTypes from 'prop-types'; import { makeStyles, withStyles } from '@material-ui/styles'; import Step from '@material-ui/core/Step'; import Stepper from '@material-ui/core/Stepper'; import StepLabe...

00:00 - 20:0021:00 - 00:00

« first day (3330 days earlier)      last day (1843 days later) »