Questions

How can I get the URL of the current tab from a Google Chrome extension?

I'm having fun with Google Chrome extension, and I just want to know how can I store the URL of the current tab in a variable?

Data binding to SelectedItem in a WPF Treeview

How can I retrieve the item that is selected in a WPF-treeview? I want to do this in XAML, because I want to bind it. You might think that it is `SelectedItem` but apparently that is readonly and th...

13 Feb at 17:31

MySQL dump by query

Is it possible to do `mysqldump` by single `SQL query`? I mean to dump the database, like `phpmyadmin` does when you do export to `SQL`

26 Nov at 13:23

Is there a query language for JSON?

Is there a (roughly) SQL or XQuery-like language for querying JSON? I'm thinking of very small datasets that map nicely to JSON where it would be nice to easily answer queries such as "what are all t...

How can I parse a time string containing milliseconds in it with python?

I am able to parse strings containing date/time with ``` >>> import time >>> time.strptime('30/03/09 16:31:32', '%d/%m/%y %H:%M:%S') (2009, 3, 30, 16, 31, 32, 0, 89, -1) ``` How can I parse a time...

27 Jan at 17:38

Making a UITableView scroll when text field is selected

After a lot of trial and error, I'm giving up and asking the question. I've seen a lot of people with similar problems but can't get all the answers to work right. I have a `UITableView` which is com...

26 Mar at 16:20

Is a Python dictionary an example of a hash table?

One of the basic data structures in Python is the dictionary, which allows one to record "keys" for looking up "values" of any type. Is this implemented internally as a hash table? If not, what is i...

NUnit vs. Visual Studio 2008's test projects for unit testing

I am going to be starting up a new project at work and want to get into unit testing. We will be using Visual Studio 2008, C#, and the ASP.NET MVC stuff. I am looking at using either NUnit or the buil...

How to find the mime type of a file in python?

Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/v...

8 Sep at 00:12

How to resolve "Cannot use import statement outside a module" from Jest when running tests?

I have a React application (not using Create React App) built using TypeScript, Jest, Webpack, and Babel. When trying to run `yarn jest`, I get the following error: ![jest error](https://i.imgur.com/b...

React Hook "useState" is called in function "app" which is neither a React function component or a custom React Hook function

I'm trying to use react hooks for a simple problem ``` const [personState,setPersonState] = useState({ DefinedObject }); ``` with following dependencies. ``` "dependencies": { "react": "^16.8....

21 Feb at 11:42

React.createElement: type is invalid -- expected a string

Trying to get react-router (v4.0.0) and react-hot-loader (3.0.0-beta.6) to play nicely, but getting the following error in the browser console: ``` Warning: React.createElement: type is invalid -- exp...

How to download files using axios

I am using axios for basic http requests like GET and POST, and it works well. Now I need to be able to download Excel files too. Is this possible with axios? If so does anyone have some sample code? ...

10 Jan at 19:24

How to call another components function in angular2

I have two components as follows and I want to call a function from another component. Both components are included in the third parent component using directive. Component 1: ``` @component( ...

5 Sep at 06:15

KeyboardEvent.keyCode deprecated. What does this mean in practice?

According to MDN, we should most definitely be using the `.keyCode` property. It is deprecated: [https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode](https://developer.mozilla.org/...

28 Jun at 21:8

How to set default Checked in checkbox ReactJS?

I'm having trouble to update the checkbox state after it's assigned with default value `checked="checked"` in React. ``` var rCheck = React.createElement('input', { type: 'checkbox', ...

20 Oct at 09:30

How can I access the value of a promise?

I'm looking at this example from Angular's documentation for `$q`, but I think this probably applies to promises in general. The example below is copied verbatim from their documentation with their co...

Docker - how can I copy a file from an image to a host?

My question is related to [this question](https://stackoverflow.com/questions/22049212/docker-copy-file-from-container-to-host) on copying files from containers to hosts; I have a Dockerfile that fetc...

23 May at 12:3

How can I set response header on express.js assets

I need to set CORS to be enabled on scripts served by express. How can I set the headers in these returned responses for public/assets?

20 May at 05:48

Spring CrudRepository findByInventoryIds(List<Long> inventoryIdList) - equivalent to IN clause

In Spring CrudRepository, do we have support for "IN clause" for a field? ie something similar to the following? ``` findByInventoryIds(List<Long> inventoryIdList) ``` If such support is not avail...

Assign multiple variables to the same value in Javascript?

I have initialized several variables in the global scope in a JavaScript file: ``` var moveUp, moveDown, moveLeft, moveRight; var mouseDown, touchDown; ``` I need to set all of these variables to fal...

10 Jul at 15:15

Android; Check if file exists without creating a new one

I want to check if file exists in my package folder, but I don't want to create a new one. ``` File file = new File(filePath); if(file.exists()) return true; ``` Does this code check without ...

1 Jan at 10:26

Copy folder recursively in Node.js

Is there an easier way to copy a folder and all its content without manually doing a sequence of `fs.readir`, `fs.readfile`, `fs.writefile` recursively? I am just wondering if I'm missing a function w...

22 Aug at 20:44

pip: force install ignoring dependencies

Is there any way to force install a pip python package ignoring all it's dependencies that cannot be satisfied? (I don't care how "wrong" it is to do so, I just need to do it, any logic and reasoning...

1 Jul at 11:41

Organizing a multiple-file Go project

Note: this question is related to [this one](https://stackoverflow.com/questions/2182469/to-use-package-properly-how-to-arrange-directory-file-name-unit-test-file), but two years is a very long time i...

10 Nov at 08:48