Questions

nodemon app crashed - waiting for file changes before starting

After further testing, I have found that this is happening with both gulp and grunt on this app and on the default install of mean.js. I'm running this locally on a Mac. When I running either app u...

Key Value Pair List

I have a list with below elements: ``` {[A,1] ; [B,0] ; [C,0] ; [D,2]; [E,0] ; [F,8]} ``` When Variable =3 -> i want the return value to be A,D When variable =11 -> return value to be A, D, F whe...

14 Sep at 12:4

Cannot define variable in pipeline stage

I'm trying to create a declarative Jenkins pipeline script but having issues with simple variable declaration. Here is my script: ``` pipeline { agent none stages { stage("first") { ...

27 Oct at 20:16

How do I avoid 'Function components cannot be given refs' when using react-router-dom?

I have the following (using Material UI).... ``` import React from "react"; import { NavLink } from "react-router-dom"; import Tabs from "@material-ui/core/Tabs"; import Tab from "@material-ui/core/T...

6 Jun at 20:28

What does "export default" do in JSX?

I want to ask what the last sentence means and does (export default HelloWorld;) but I can't find any tutorials about it. ``` // hello-world.jsx import React from 'react'; class HelloWorld extends ...

21 Dec at 19:26

How to store Emoji Character in MySQL Database

I have a MySQL database configured with the default collation `utf8mb4_general_ci`. When I try to insert a row containing an emoji character in the text using the following query ``` insert into table...

14 Jul at 06:15

javax.faces.application.ViewExpiredException: View could not be restored

I have written simple application with container-managed security. The problem is when I log in and open another page on which I logout, then I come back to first page and I click on any link etc or r...

14 Nov at 12:32

Uploading multiple files using formData()

``` var fd = new FormData(); fd.append("fileToUpload", document.getElementById('fileToUpload').files[0]); var xhr = new XMLHttpRequest(); xhr.open("POST", "uph.php"); xhr.send(fd); ``` uph.php: ```...

Cannot delete directory with Directory.Delete(path, true)

I'm using .NET 3.5, trying to recursively delete a directory using: ``` Directory.Delete(myPath, true); ``` My understanding is that this should throw if files are in use or there is a permissions ...

10 Aug at 10:15

threading.Timer - repeat function every 'n' seconds

I want to fire off a function every 0.5 seconds and be able to start and stop and reset the timer. I'm not too knowledgeable of how Python threads work and am having difficulties with the python timer...

Is it possible to access an SQLite database from JavaScript?

I have a set of HTML files and a SQLite database, which I would like to access from the browser, using the file:// scheme. Is it possible to access the database and create queries (and tables) using J...

25 Jun at 17:33

What is the uintptr_t data type?

What is `uintptr_t` and what can it be used for?

30 Sep at 08:6

JavaScript - Get Portion of URL Path

What is the correct way to pull out just the path from a URL using JavaScript? Example: I have URL [http://www.somedomain.com/account/search?filter=a#top](http://www.somedomain.com/account/search?fil...

4 Aug at 16:4

Does C++ support 'finally' blocks? (And what's this 'RAII' I keep hearing about?)

Does C++ support '[finally](http://java.sun.com/docs/books/tutorial/essential/exceptions/finally.html)' blocks? What is the [RAII idiom](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initializ...

14 Sep at 13:33

How to timeout a thread

I want to run a thread for some fixed amount of time. If it is not completed within that time, I want to either kill it, throw some exception, or handle it in some way. How can it be done? One way of...

26 Feb at 17:20

Actual meaning of 'shell=True' in subprocess

I am calling different processes with the `subprocess` module. However, I have a question. In the following code: ``` callProcess = subprocess.Popen(['ls', '-l'], shell=True) ``` and ``` callProcess ...

27 Dec at 01:6

Fatal error: Call to undefined function mysqli_connect()

For 2 days now I'm trying to solve this, but unfortunately no result. Let me tell you my story about the problem. I've bulid an application on a site, and the application deals with the reviews. But, ...

15 Apr at 01:21

Git log to get commits only for a specific branch

I want to list all commits that are only part of a specific branch. With the following, it lists all the commits from the branch, but also from the parent (master) ``` git log mybranch ``` The oth...

29 Jul at 23:18

Find the day of a week

Let's say that I have a date in R and it's formatted as follows. ``` date 2012-02-01 2012-02-01 2012-02-02 ``` Is there any way in R to add another column with the day of the week associated...

8 Jul at 12:38

How to set radio button status with JavaScript

What method would be best to use to selectively set a single or multiple radio button(s) to a desired setting with JavaScript?

28 Feb at 04:55

Automatically set appsettings.json for dev and release environments in asp.net core?

I've defined some values in my `appsettings.json` for things like database connection strings, webapi locations and the like which are different for development, staging and live environments. Is the...

Sequence contains no matching element

I have an asp.net application in which I am using linq for data manipulation. While running, I get the exception "Sequence contains no matching element". ``` if (_lstAcl.Documents.Count > 0) { fo...

11 Jul at 22:57

How do I use su to execute the rest of the bash script as that user?

I've written a script that takes, as an argument, a string that is a concatenation of a username and a project. The script is supposed to switch (su) to the username, cd to a specific directory based ...

Dictionaries and default values

Assuming `connectionDetails` is a Python dictionary, what's the best, most elegant, most "pythonic" way of refactoring code like this? ``` if "host" in connectionDetails: host = connectionDetails...

6 Jan at 03:35

Console.log statements output nothing at all in Jest

`console.log` statements output nothing at all in Jest. This was working for me yesterday, and all of sudden, it's not working today. I have made zero changes to my config and haven't installed any up...

30 Jan at 18:29