Questions

The AsyncTask API is deprecated in Android 11. What are the alternatives?

Google is deprecating Android AsyncTask API in Android 11 and suggesting to use `java.util.concurrent` instead. you can check out the commit [here](https://android-review.googlesource.com/c/platform/f...

Visual studio code cmd error: Cannot be loaded because running scripts is disabled on this system

Inside of visual studio code, I'm trying to execute a script.bat from the command line, but I'm getting the following error: > File C:\Theses_Repo\train-cnn\environment\Scripts\activate.ps1 cannot be...

What is the difference between HashRouter and BrowserRouter in React?

I am new to programming which makes things slightly difficult for me to understand if I read the official docs. I was reading about [React Router 4 from here](https://medium.com/@djoepramono/react-rou...

7 May at 20:41

'router-outlet' is not a known element

I have a mvc 5 project with a angular frontend . I wanted to add routing as described in this tutorial [https://angular.io/guide/router](https://angular.io/guide/router). So in my `_Layout.cshtml` I a...

Unexpected outcome of node.js vs ASP.NET Core performance test

I am doing a quick stress test on two (kinda) hello world projects written in [node.js](/questions/tagged/node.js) and [asp.net-core](/questions/tagged/asp.net-core). Both of them are running in produ...

In typescript, how to define type of async function

I tried to define a type of async function, but failed in compilation, see below: ``` interface SearchFn { async (subString: string): string; } class A { private Fn: SearchFn public asyn...

3 Aug at 13:47

Docker Compose keep container running

I want to start a service with docker-compose and keep the container running so I can get its IP-address via 'docker inspect'. However, the container always exits right after starting up. I tried to ...

31 Dec at 12:13

How to decode JWT Token?

I don't understand how this library works. Could you help me please ? Here is my simple code : ``` public void TestJwtSecurityTokenHandler() { var stream = "eyJhbGciOiJSUzI1N...

How to add a constant column in a Spark DataFrame?

I want to add a column in a `DataFrame` with some arbitrary value (that is the same for each row). I get an error when I use `withColumn` as follows: ``` dt.withColumn('new_column', 10).head(5) ``` ...

React-Router: No Not Found Route?

Consider the following: ``` var AppRoutes = [ <Route handler={App} someProp="defaultProp"> <Route path="/" handler={Page} /> </Route>, <Route handler={App} someProp="defaultPr...

22 Jul at 12:29

Fatal error compiling: invalid target release: 1.8 -> [Help 1]

Similar problem like one posted on [invalid target release: 1.7](https://stackoverflow.com/questions/19891423/invalid-target-release-1-7) but after following the blog my problem is still unresolved. ...

23 May at 12:18

How do I make WRAP_CONTENT work on a RecyclerView

I have a `DialogFragment` that contains a `RecyclerView` (a list of cards). Within this `RecyclerView` are one or more `CardViews` that can have any height. I want to give this `DialogFragment` the co...

How to enable C# 6.0 feature in Visual Studio 2013?

I was going through the latest features introduced in C# 6.0 and just followed an example of auto property initializer, ``` class NewSample { public Guid Id { get; } = Guid.NewGuid(); } ``` b...

Doing HTTP requests FROM Laravel to an external API

What I want is get an object from an API with a HTTP (eg, jQuery's AJAX) request to an external api. How do I start? I did research on Mr Google but I can't find anything helping. Im starting to wond...

23 May at 11:33

HTTP Error 503. The service is unavailable. App pool stops on accessing website

There are number of posts on this and I have tried many a things by now. But to no avail. Myself a Winforms Developer basically, started working on this Web stuff few days back as my company is taking...

23 May at 12:10

How to clone all repos at once from GitHub?

I have a company GitHub account and I want to back up all of the repositories within, accounting for anything new that might get created for purposes of automation. I was hoping something like this: ...

15 Oct at 22:57

Convert unix time to readable date in pandas dataframe

I have a dataframe with unix times and prices in it. I want to convert the index column so that it shows in human readable dates. So for instance I have `date` as `1349633705` in the index column bu...

split string only on first instance - java

I want to split a string by '=' charecter. But I want it to split on first instance only. How can I do that ? Here is a JavaScript example for '_' char but it doesn't work for me [split string only on...

23 May at 11:55

What is difference between functional and imperative programming languages?

Most of the mainstream languages, including object-oriented programming (OOP) languages such as C#, Visual Basic, C++, and Java were designed to primarily support imperative (procedural) programming, ...

22 Aug at 12:37

Java Equivalent of C# async/await?

I am a normal C# developer but occasionally I develop application in Java. I'm wondering if there is any Java equivalent of C# async/await? In simple words what is the java equivalent of: ``` async ...

16 Dec at 08:13

Is there a way to do repetitive tasks at intervals?

Is there a way to do repetitive background tasks in Go? I'm thinking of something like `Timer.schedule(task, delay, period)` in Java. I know I can do this with a goroutine and `Time.sleep()`, but I'...

10 Sep at 12:2

Adding data attribute to DOM

``` $('div').data('info', 1); alert($('div').data('info')); //this works $('div[data-info="1"]').text('222'); //but this don't work ``` I'm creating element within jquery. After that, I want t...

20 Sep at 06:44

How to use sed/grep to extract text between two words?

I am trying to output a string that contains everything between two words of a string: input: ``` "Here is a String" ``` output: ``` "is a" ``` Using: ``` sed -n '/Here/,/String/p' ``` incl...

25 May at 04:39

How to do a https request with bad certificate?

Say I want to get `https://golang.org` programatically. Currently golang.org (ssl) has a bad certificate which is issued to `*.appspot.com` So when I run this: ``` package main import ( "log" ...

24 Aug at 09:0

Restart node upon changing a file

For someone who is coming from PHP background the process of killing node and starting it again after every code change, seems very tedious. Is there any flag when starting a script with node to autom...

17 Jul at 08:34