Categories
Mastering Development System & Network

OpenVPN using UDP is terrible slow over cellular networks

I have a weird problem with OpenVPN for around two weeks now. I am running the OpenVPN server on a Virtual Server (German Hoster netcup) on UDP port 1194. Using this setup clients connecting through a mobile network have an extremely slow downstream (!) through the VPN tunnel (Less than 1 Mbit/s). The upstream speed […]

Categories
Mastering Development

Handling Fragments onBackPress inside Activity

I have one Activity B that extends AppCompatActivity I add (not replace) two fragments on this fragment’s container FrameLayout and also add them to the back stack FragmentA Fragment B supportFragmentManager .beginTransaction() .addToBackStack(null) .add(containerId, fragment, fragment::class.java.simpleName) .commit() My Activity’s onBackPress(): override fun onBackPressed() { if (fragmentBackStackCount == 1) { super.onBackPressed() } else { supportFragmentManager.popBackStack() } […]

Categories
Mastering Development

Its correct to not include a dependency on purpose on useEffect to avoid re-renderes when using react-route?

In my case here, I want to avoid the component <Checkout/> from re-rendering once I replace the url props.history.replace(props.match.path + ‘/contact-data’ to load the component <ContactData/>. As it can be seen on useEffect when <Checkout/> loads it gets a query tail on the url, something like this: http://localhost:3000/checkout?cheese=0&salad=0&special=0&veggie=1. Then I redirect to the url, having […]

Categories
Mastering Development

ReactJS Image Upload form issues with space in filename

so I have this ReactJS app, I created a registration form where people can add their own pictures, and is working, but I’m thinking ahead and I want to solve this issue before happens. There will be people that will add files with space in the name, but I don’t know how to make it […]

Categories
Development

function arbitrarily loses access to closure

Symbol.toPrimitive method, invoked within tagged template literal loses access to the closure. To reproduce, simply paste the provided code snippet in dev console, run it with and without tag-function. Any relevant articles are highly appreciated. P.S. I would also appreciate if you give me an idea how and where to debug js code (including node.js). […]

Categories
Development

OAuth 2.0 Discovery URL

The xero Oauth 2.0 provider discovery URL is available on: https://login.xero.com/identity/.well-known/openid-configuration And it returns all information as it is supposed to: {“issuer”:”https://identity.xero.com”,”jwks_uri”:”https://login.xero.com/identity/.well-known/openid-configuration/jwks”,”authorization_endpoint”:”https://login.xero.com/identity/connect/authorize”,”end_session_endpoint”:”https://login.xero.com/identity/connect/endsession”,”check_session_iframe”:”https://login.xero.com/identity/connect/checksession”,”token_endpoint”:”https://login.xero.com/identity/connect/token”,”userinfo_endpoint”:”https://login.xero.com/identity/connect/userinfo”,”revocation_endpoint”:”https://login.xero.com/identity/connect/revocation”,”introspection_endpoint”:”https://login.xero.com/identity/connect/introspect”,”frontchannel_logout_supported”:true,”frontchannel_logout_session_supported”:true,”backchannel_logout_supported”:true,”backchannel_logout_session_supported”:true,”grant_types_supported”:[“authorization_code”,”client_credentials”,”refresh_token”,”implicit”,”delegation”,”oauth1_migration”],”response_types_supported”:[“code”,”token”,”id_token”,”id_token token”,”code id_token”,”code token”,”code id_token token”],”response_modes_supported”:[“form_post”,”query”,”fragment”],”token_endpoint_auth_methods_supported”:[“client_secret_basic”,”client_secret_post”],”subject_types_supported”:[“public”],”id_token_signing_alg_values_supported”:[“RS256″],”code_challenge_methods_supported”:[“S256″]} And my OAuth2 client can fetch the document. However, the online docs say the token url is: https://identity.xero.com/connect/token However, the discovery URL says: “token_endpoint”:”https://login.xero.com/identity/connect/token“ Anyone else noticed this […]

Categories
Development

Cannot read property ‘map’ of undefined in react/redux

before adding the map function i was getting the state after adding map function i get. I am not able to pinpoint the location of the problem.saw many posts on stackoverflow but none solved my probem import React,{Fragment,useEffect} from ‘react’ import PropTypes from ‘prop-types’ import PostItem from ‘./PostItem’ import {connect} from ‘react-redux’ import {getPosts} from […]

Categories
Development Kotlin

KotlinNullPointerException when trying to fetch data using retrofit and display using recyclerview

I am trying to display list of repositories from github using the retrofit library and then display it using the recyclerView library. I have checked before adding recyclerView that data is fetched successfully. But after adding recyclerView, I am getting NullPointerException. Below is code for my Viewmodel, fragment, adapter and data class ListViewModel.kt package com.kunalrai.githubtrends […]

Categories
Android Development Google

Android studio get user location when google map is in a fragment

I’m trying to implement google map in a fragment, I have succeeded adding the map and markers on it, but now I need to show current users location and when it updates. I’ve tried following answers on this, but all answers were not giving any results only closing application instantly or giving error without even […]

Categories
Development

Set Antd’s Menu defaultSelectedKeys value using React and Redux

I’m using antd for building a react application. I’m using antd’s Layout to design the layout. Also, I’m using react-router for routing and redux for state management. In antd’s Menu I’ve set the defaultSelectedKeys to a blank array so that when page loads I don’t want to show the active menu item. Instead, When the […]