« first day (3348 days earlier)      last day (1586 days later) » 
08:00 - 21:0021:00 - 00:00

8:47 AM
eh after feature update, my ps terminal starts each time with
> Try the new cross-platform PowerShell aka.ms/pscore6
what a turd
 
In PWA can I detect if added to home screen in iphone?
 
You can detect if it's running through the PWA, but I don't think you can check when it's added.
@AminFarajzadeh ^
 
9:07 AM
hi ben
 
ello
 
9:27 AM
Hey guys,
Anyone got any clue why this action doesn't work?
So in one of my components, this runs:

`this.props.login(code)`
this.props.login(code)

return this.props.navigation.navigate('Loading')
So, the login is just an action dispatch (using connect, redux)
export const login = (code) => {
	return (dispatch) => {
		getToken(code)
		.then(response => {
			updateStorage(response.data['access_token'], response.data['refresh_token'])
			dispatch(loginAction(response.data['access_token'], response.data['refresh_token']))

			return response.data
		})
		.catch(data => console.log(data))
	}
}
That's a thunk thinggy.
I'm thinking I'm doing this thunk wrong.
Because, for some reason, the promise doesn't make 'return' to 'Loading' wait.
 
9:44 AM
0
Q: React-Native: Having problems with redux-thunk assigning data on time

Hassan AlthafProblem: I have four components: Loading Login Auth Home User lands on the Loading page, it checks for the AsyncStorage for API Tokens, and if it does, it populates it to the Redux Store and forwards the user to the Login Component, where the tokens are verified and if they are valid, the us...

Just posted over here, any help would be highly appreciated
 
10:26 AM
Hi all does have a sample project for using Reactivex
 
 
2 hours later…
12:40 PM
@MadaraUchiha Just saw your post on meta about karma
Feel the same way you describe in your article: the most rep I gain are from dumb questions I should actually vote to close or dupe
 
@M.Doe Which one? There are a few
 
The one linked in your profile
324
Q: Enhance moderation ability by encouraging excellent content

Madara UchihaI have a proposal, I've been upholding it for quite a while now, and I'd like to share my efforts with the rest of the high (30k+) reputation users. I found a way to both encourage great content and potentially enhance the number of users contributing to the moderation effort we have. Some of th...

I had a question, hence I pinged you but I'm not sure if it's more suited here or meta
It is most definetly a meta question
A couple of questions I have answered recently I have gotten the comment 'Thanks, it worked', but they have not upvoted or accepted my answer, even though OP has reponded with thanks
Is is ethical / allowed to leave a comment @ them, and ask them to please accept the answer?
If off topic please feel free to move this to trash
 
If you feel like they don't know that they're supposed to accept, you could remind them that it's an option they should take. But don't bother too much about it. In the grand scheme of things those should be few and far between.
 
Hmm, it"s just I have noticed it a lot. Although I'm trying to actively increase my rep so maybe I'm focussing too much on it
 
Upvoting and marking as accepted is important so that it can found by searches.
 
12:45 PM
Out of my last 5 answers, it has happened to 3 of them (that they responded thanks it works)
 
Were they help desk questions?
 
@M.Doe there's nothing wrong with wanting rep
The system is designed to make you want to get reputation
 
Yes, in the angular tag
 
not really a big deal if he doesn't accept the answer, but no harm in asking him to either
 
Anyone remember the Accept Ratio?
Or am I the only one that old? :D
 
12:49 PM
I have left a comment on the posts
 
@MadaraUchiha For the JS chat? Like ratio requirements to join?
 
'If any of the answers helped you, please don't forget to accept them so users after you can find a solution easier'
 
@M.Doe πŸ‘
@JBis It used to be the case that in your user signature card thingy, in addition to your rep and name, the % of questions you've asked and accepted an answer for (out of the total answered questions you've asked) would be displayed.
And it would be considered bad form to have a low accept ratio.
 
ah interesting
 
Thanks for the input guys, have a good day :)
 
12:59 PM
@MadaraUchiha MANDALA!
 
@Wietlol WAIETORORU!
 
._.
 
when will you break Wietbot?
 
I probably won't πŸ˜ƒ your sandboxing is literally running on a sandbox machine, isn't it?
 
146
Q: Please don't refer to 2019 as 'a great year'

GlorfindelThere's a bug on the Winter Bash 2019 homepage: Stack Exchange invites you to celebrate the end of a great year …with HATS! As you use your site, you'll discover hats and other items hidden behind certain actions. Collect all of them, some of them, or none of them, but be quick – the hats get...

stupid question imo
 
1:13 PM
How does one search for something other than letters and numbers in chat search again?
 
@MadaraUchiha ye :D
 
he just cared about something people shouldn't care about.
 
^
 
I have to explicitly state that the box has any features at all
 
Thanks @KarelG
 
1:15 PM
such as net traffic
and it has 0 access to any meaningfull files
 
btw i opened an issue on isolate-vm to get it to work with worker threads. Will make James' eval more secure.
 
@M.Doe why? it got deleted because of your self-promotion πŸ˜›
 
I deleted it myself
 
lol
 
Because it's a duplicate :p
I can't cast votes to close / dupe then do it myself
 
1:27 PM
Is it worth obfuscation and/or minification of my js if I am going to try and sell an electron app?
I understand it won't entirely prevent piracy but may help deter.
 
@JBis Selling it?
Just sue whoever leaks your code or reverse engineers it
Also, how would it prevent piracy? Someone can just share the executable
 
make sure it gets borked :D
 
@MadaraUchiha If I implement any piracy code and then obfuscate it could be slightly more difficult to do.
@MadaraUchiha Yeah. Whats wrong with selling it?
My hope is that people won't be assholes and will pay for it if they need especially since its cheap.
 
Can't you just use a licensing server
 
@JBis Nothing, really, I misread
 
1:42 PM
@BenFortune I am looking into this but someone can still just alter the part of js that confirms licenses keys.
unless i am misunderstanding
 
I can think of ways to make that impossible
For example, most of the real code is kept as an encrypted string, the license server verifies the user's license and responds with a decryption key.
Then the string gets decrypted, and eval()d
 
cant someone just intercept the key and share?
 
That, too, is not infallible, but it's all a question of how far you're willing to go, and how far you expect a malicious actor is willing to go in the other direction.
@JBis Different key for each user.
Still, someone could conceivably be able to make a real user, buy the program, get their key, and then reverse-engineer your app to include a hardcoded version of the key, and share that
I do think that plain ol' minification should be sufficient for most use-cases, especially if the program is cheap and not very high-profile.
 
@JBis the only legit way to protect a key is to never make it available encrypted or otherwise to the end user
everything else is just making it difficult for them, but no guarantees
 
app needs to decrypt it somehow
 
1:50 PM
and as it happens, the only way to make sure the key is never made available to the end user is by having a backend that does things on your behalf
if the client has the backend too, then it becomes even more sophisticated, requiring yet another master backend that will lease tokens to your client backends and perform checks
since at that point, the client has also the backend and therefore has a means to potentially decrypt the key
you need a backend that nobody will see the code for, basically
 
Anti-piracy seems to be something no one can figure out entirely. Even adobe can't prevent it.
 
adobe is doing it incorrectly
you can potentially reverse engineer anything that exists entirely on your hard drive to work
 
How do you suggest they do it?
Even the way @MadaraUchiha suggested where you decrypt the code can be broken
 
that when you buy their software, they give you a key which is generated and it is unique to your particular version
When you open the client, before letting you use it, it authenticates to a backend using that key
and that backend checks that A) that key exists and B) nobody else is actively using it
and quite possibly, C) the ip where it's coming from (though that could change)
 
but if you alter the assembly you can bypass all that
 
1:56 PM
@Neil Unless you get continuous service from the server, I can just edit your binary to avoid the entire auth session.
 
Ninjaed ;)
 
if you alter your host file, you could probably set up your own proxy :D
 
The only actual real way to do anti piracy is to not send the code
 
and then mock it :D
 
well ok, it would have to be sufficiently difficult to do that
you would send the binary, not the code clearly
though there are ways around that I know
 
1:58 PM
@Neil Editing binaries isn't as difficult as you might think.
The only real 100% safe way is to have all the interesting logic on the server, and not deliver the code to the client, but provide a service.
 
I have done it before, took me like 20 min of a youtube video to do a simple app. Obv more complicated with bigger apps but still.
 
so basically a web page
 
@Neil You could look at it like that, yes.
 
@MadaraUchiha Ofc, but that would require adobe to do all the rendering and everything. Not conceivable.
 
But client-server relationships predate the WWW.
@JBis Yes, not really workable for things like Photoshop.
 
1:59 PM
though it could conceivably be a client software which relies heavily on the server
 
just have your client running code on the server
 
5 mins ago, by JBis
Anti-piracy seems to be something no one can figure out entirely. Even adobe can't prevent it.
 
only api calls with token
 
@JBis Adobe has it especially rough.
 
I honestly don't think Adobe even want to lmao
 
2:00 PM
nowadays, you can play high-definition games using purely an internet connection
 
They have a high profile software, that must run strictly on the user's machine, and that needs to work without an internet connection.
 
I think adobe can legit offer their services entirely online
 
@Neil Are you talking about Stadia?
 
The way I see it is that you should implement some deterrent methods but in the end if your product is good enough some people will want to pay for and the cost of preventing others isn't worth it.
 
he does I think
 
2:00 PM
@MadaraUchiha yep.
 
Adobe makes money by piracy. People pirate and then purchase, almost like trial.
 
Adobe doesn't have the kind of hardware or budget to pull that off.
 
I've seen it in action. It doesn't merit most of the bad rep it gets
 
@Neil some companies are even trying to counter it by having a degraded graphics shipped to stadia
 
Hello guys, Please how do one create a phone verification for a site
 
2:02 PM
|| magic
 
(∩ Ν‘° ΝœΚ– Ν‘°)βŠƒβ”β˜†οΎŸ. * ο½₯ q α΅€α΄΄α΄± ᴳᴬᴹᴱ
 
with other words: if you purchase the game to run your own pc, you can get the graphics in all of its glory. But stadia? Nah here: low resolution
 
@NobMusic twillio or sms gateways
 
@NobMusic send a sms
with a code
and ask user to enter the verification code
 
@KarelG yes boss
 
2:03 PM
@Neil They released with too high a price, and too low a game collection.
They should have, in my opinion, in order to increase adoption, taken a loss on some of the games they offer, and even, maybe, on the initial hardware.
 
meh I do see the advantage of stadia but really ... why?
 
@KarelG Because most end-users don't even own a PC nowdays
It's either a console (which costs a lot) or on the mobile phone (which doesn't have good games)
 
do they have a phone?
 
@JBis does twillio do the same thing @KarelG is saying
 
It allows you do the "send a sms" part
but so does sms gateways and they are freeeeeee
 
2:06 PM
@MadaraUchiha the subscription and network cost won't be high on long term?
 
@KarelG 🀷
 
but use twillio its better
 
@JBis how do one now generate a different code for different users and
 
I don't like where we are headed, I rather have the processing done locally. Especially with privacy concerns.
 
@JBis Like I said, for most use-cases, I'm guessing just minification should be sufficient
It won't stop everything, but unless it's something that's going to be high-profile, I don't think you'd get enough attention that would make a large portion of people to actively seek pirating you
 
2:09 PM
Ok. I have to figure out how to set it up so I can just click "build" and it will work.
 
@JBis Rule of thumb, never trust the client
 
Yeah. I will worry about it if it gets that big, which it prob won't. I will be lucky if I get my $100 back.
@BenFortune ofc.
and I'll but a popup when you open the app that asks people to please not pirate my app even tho its pretty easy to do
thanks for help everyone :)
 
@MadaraUchiha they needed/need a good flagship game is what it amounts to
 
lmao just don't do what Sony did
 
but that's true for any console
 
2:14 PM
A scandal erupted in 2005 regarding Sony BMG's implementation of deceptive, illegal, and harmful copy protection measures on about 22 million CDs. When inserted into a computer, the CDs installed one of two pieces of software which provided a form of digital rights management (DRM) by modifying the operating system to interfere with CD copying. Neither program could easily be uninstalled, and they created vulnerabilities that were exploited by unrelated malware. Sony claims this was unintentional. One of the programs installed, even if the user refused its end-user license agreement (EULA), would...
 
the advantage to using stadia is that you can quite literally go to a friends house and start playing there, with very little installation time
 
@BenFortune Wow
How have I never heard of this?
 
the lag is from what I've seen, no worse than what you can expect connecting to a multiplayer server
I was trying to do the math on that one.. I thought it would be twice as bad, since it has to send your controller commands, and it has to send you the consequence of those controller commands, so it makes a full trip
but then I realized that that's not so different from what already happens in multiplayer games
the difference is that both are on the same side
probably makes the network code of a game far far simpler too
 
Is any processing done on the client with things like Stadia?
like if you happen to have a good graphics card can you subsidize some processing so your game works faster
 
My guess is that you legit could have games with 1000 players in it using stadia, assuming you had the server resources for it
@JBis no, my understanding is that it's 99% server and 1% your controller input
 
2:20 PM
bleh
 
you could play it on a smart tv
at 4k resolution if you wanted
meh, I'm optimistic at least
I see the potential there
 
So it will turn to a quality based subscription service
 
imagine a VR stadia..
that would be something else..
 
VR is overrated. I want to feel the bullet wound when someone shoots me.
 
super high definition quality VR that you could play anywhere with an internet connection
 
2:22 PM
@JBis Just get yourself shot, much cheaper
 
@BenFortune yeah, but you only get one life that way
 
^
 
My game as of late is Deep Dark Galactic
you're a dwarf in space mining minerals and fighting swarms of alien spiders :)
very fun coop game
 
@JBis there is something like haptic skin :3
 
Anyone has experience with react-native?
Error: Network Error
    at createError (createError.js:16)
    at XMLHttpRequest.handleError (xhr.js:81)
    at XMLHttpRequest.dispatchEvent (event-target-shim.js:818)
    at XMLHttpRequest.setReadyState (XMLHttpRequest.js:574)
    at XMLHttpRequest.__didCompleteResponse (XMLHttpRequest.js:388)
    at XMLHttpRequest.js:501
    at RCTDeviceEventEmitter.emit (EventEmitter.js:189)
    at MessageQueue.__callFunction (MessageQueue.js:436)
    at MessageQueue.js:111
    at MessageQueue.__guard (MessageQueue.js:384)
 
2:28 PM
just ask
 
Axios generating that.
 
@KarelG no way that can work that well
 
Updated the Info.plist on Xcode, ut still get that. Any clue guys?
 
@Neil there is a concept model tho.
yet when that got announced, a lot comments was about that it has a huge value for the porn industry
keh
 
A full-body haptic suit.. I know what that's going to be used for, and it ain't halo
 
2:30 PM
@Neil there seems to be no haptics in that area
 
I have heard of something for that.. cough.. you know a friend told me..
 
@Neil Hey man whats up
long tim eno see
 
@HassanAlthaf Heya, Hassan, what's up?
 
Nothing much.
Axios killing me.
 
Tell him to stop killing you
 
2:32 PM
lol
wish i could
 
2:46 PM
@JBis if it aint there, then it's a bug.
 
@KarelG (Ν‘° ΝœΚ– Ν‘°)
 
3:08 PM
My boss doesn't seem to understand that dragging a programmer's attention away from what they're doing to discuss problems that will be worked on at a future time is a BAD THING.
Especially when I'm perfectly aware of the problems
 
@Hypersapien oh yeah, as I tell my friend at work, 3 days of constant interruptions is equal to one single day with no interruptions, at least for me
 
user7732694
4:02 PM
hey guys. does anyone feel like giving me any tips regarding loading in options for a select dropdown button through api call?
 
@Miraclefruit 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.
 
0. clear `<select>` box
1. get options as json from api
2. turn into `<option>` elements
3. add to select
ahrph multi-line formatting fallacy
 
user7732694
so the options in the dropdown is gunna be the keys of an array (passed from api)
 
user7732694
im able to populate the dropdown with the keys
 
user7732694
but how do i retrieve the values of the key once the user submits a choice?
 
user7732694
4:11 PM
var keys = Object.keys(resp.msg.cohorts);
  let $dropdown = $('#cohortType');
  $dropdown.empty();
  $.each(keys, function(index,item) {
    $('<option></option>')
      .attr('value', index.cohorts)
      .text(item)
      .appendTo($dropdown);
  });
 
var has no place in any js code written in the last year :)
 
meh
 
and $.each() for a normal array? use keys.forEach((item, index) => {...})
 
user7732694
@ThiefMaster wait, whats the difference?
 
please don't use stars as upvote or like system
 
user7732694
4:17 PM
sorry, i thought it would only mark it on my end
 
everyone sees the stars being casted
 
just not who cast them
 
@Miraclefruit $.each() is jQuery's implementation, keys.forEach is Array.prototype.forEach which is the native implementation provided by the browser.
$.each's advantage is that it can iterate regular arrays as well as jQuery structures (like lists of nodes), but if you know it's an array, better use arr.forEach
 
for a jquery structure you'd probably want foo.each(...).. and i'd say code mixing both without you knowing what you get is ugly to begin with
 
That's fair
 
user7732694
4:21 PM
got it, thanks!
 
user7732694
.attr('value', index.cohorts) only returns the key again and not the value :/
 
what do you mean
 
Icon design for my app, what y'all think?
 
user7732694
for example, if my array is {fruit: [apple, orange]}, and i want to load in the keys into the dropdown - fruit is an option in the select. now when i do
$('#cohortType option:selected').val();
it returns 'fruit' instead of [apple,orange
 
 
4:36 PM
@Miraclefruit yea, to get apple,orange, you have to go back to the first object to retrieve the array for that key.
 
user7732694
like do, find key in array and then retrieve value?
 
well, {fruit: [apple, orange]} is an object
so you'd just do theObject[theValue]
 
user7732694
ok that should help, thank you so much
 
4:57 PM
How do I add a prototype to a custom element? I can only find info on the old registerElement(); from v0 webcomponents
this whole "prototypes are missing from docs" bullcrap is started to annoy me
Just placing prototype: prototypeName in your webcomponent wont work anymore
window.customElements.define('con-', class extends HTMLElement {
 constructor() {
  super();
 }
});
so how do I define the proto
 
?
why?
What do you need access to the prototype for?
 
I need to define the function log() to my custom element
 
can't you added it to your class?
 
I tried
its not recognized correctly
it doesnt function like a class
 
did you look at the resulting prototype?
 
5:01 PM
Not sure why
nevermind, im just being an idiot
placing my code BEFORE The class .-.
 
5:30 PM
fetching a html file gives me cross origin error what should I do
 
well, if it's not your html file.... nothing. if it is, then your server needs to be configured properly to serve it to your client
 
fetching an HTML file? Why
You should only send your client to the site, not download it from the server on an already loaded page
I dont see a logical reason for that
 
what, you load all html templates up front?
that'd be silly if it's a page with a large number of conditionally-required templates.
bsides, the fact that the target is html is irrelevant to the question.
 
5:49 PM
Hello guys, anyone here who can help me with a react project that I try to open it on a subdomain on nginx?
It might not be the right place but can't find any group
 
just ask your question, if anyone can help and wants to they will
 
after I do yarn start and open the subdomain in console I receive GET subdomain.example.cm/main.js net::ERR_ABORTED 404 (Not Found)
but if I move the files on the main domain everything works well
 
what does your config for that domain do?
is it reverse proxying to a node server, or is it serving up a static folder
 
it is using proxy on port 4000
 
1 message moved to Trash can
@MarkusHayner Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it. For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
@MarkusHayner Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. 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
 
5:53 PM
location / {
proxy_pass 127.0.0.1:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
 
so this is what I am using for proxy and the express server starts on port 4000
 
what is try_files
 
it was in the file don;t know what is used for
I am really new to this nginx
 
i've never used try_files before, and there seems to be a lot of questions surrounding it's usage with proxies
 
ok let me try and remove it
 
5:59 PM
based on what i'm reading i do think it's something you want... it just might not be being used correctly
but removing it will let node.js serve the static files... which is fine for testing/dev
 
well I wish to give you a beer for this
removing that line made the magic
 
Are you just serving up a react app, no node.js backend?
 
it is working with nodejs server
 
the reason i ask is... the react portion of it typically lives in a folder, such as './dist' or './build', you can tell nginx to serve that folder as the root of the domain
rather than having node.js serve it
that'd be the ideal setup
leaving the proxypass to only target requests that don't match a file in that folder
 
so in this case I should start the seever separately?
server*\
 
6:03 PM
yes, using something like pm2
well, that all depends i guess
 
ok amke sense now
thanks a lot for help and advise
 
 
2 hours later…
8:03 PM
anyone know of a good minifier/slight obfuscate thats easy to integrate with electron>
 
> Starting February 15, 2021, G Suite accounts will only allow access to apps using OAuth. Password-based access will no longer be supported.
Wow! Death to ROPG!
Hey all btw!
 
8:21 PM
how am i supposed to run something like github.com/mishoo/UglifyJS2#readme in an electron environment? Do I have to iterate all the files?
 
you can use a bundler with any environment
webpack your app
 
I've never used webpack
 
hmm maybe not worthwhile if you just want to uglify then
gulp is easy
 
would it just be easier to use walk and an uglify (like the one above)?
oh
thats pretty cool
 
8:44 PM
you could definitely script it out yourself but the "right" solution is to use some kind of build tool
 
Ok. I am trying gulp.
 
yeah that npm library looks very convenient
gulp is not as powerful as webpack but its simplicity is very relaxing compared to wp
 
It seems that gulp is command line
whats the point? Shouldn't the build process be automated?
 
yup
err, they're all command line
gulp, grunt, webpack,
some of them have utilities that allow them to auto-run when changes are detected
I prefer not to use them
 
oh
So where do I put the gulp script? Because I need to require gulp howerver its supposed to be installed globally so I can call from command line.
 
8:55 PM
I don't agree with installing things globally
if you need to use it from a shell then use npx
otherwise, put the commands you run often in npm scripts
npm scripts have access to run locally installed dependencies
I try to keep things inside my project as much as possible, prevents "works on my machine" issues
 
yeah i agree, i think i see how this is supposed to work
 
08:00 - 21:0021:00 - 00:00

« first day (3348 days earlier)      last day (1586 days later) »