Questions

Is it possible to implement a Python for range loop without an iterator variable?

Is it possible to do following without the `i`? ``` for i in range(some_number): # do something ``` If you just want to do something N amount of times and don't need the iterator.

29 Jul at 13:50

How to dynamically load a Python class

Given a string of a Python class, e.g. `my_package.my_module.MyClass`, what is the best possible way to load it? In other words I am looking for a equivalent `Class.forName()` in Java, function in Py...

29 Sep at 21:27

Choosing the default value of an Enum type without having to change values

In C#, is it possible to decorate an Enum type with an attribute or do something else to specify what the default value should be, without having the change the values? The numbers required might be s...

20 May at 10:38

Set keyboard caret position in html textbox

Does anybody know how to move the keyboard caret in a textbox to a particular position? For example, if a text-box (e.g. input element, not text-area) has 50 characters in it and I want to position t...

23 May at 12:10

Map and Reduce in .NET

What scenarios would warrant the use of the "[Map and Reduce](http://en.wikipedia.org/wiki/MapReduce)" algorithm? Is there a .NET implementation of this algorithm?

9 Jan at 16:44

Why is C so fast, and why aren't other languages as fast or faster?

In listening to the Stack Overflow podcast, the jab keeps coming up that "real programmers" write in C, and that C is so much faster because it's "close to the machine." Leaving the former assertion f...

11 Feb at 15:37

String vs. StringBuilder

I understand the difference between `String` and `StringBuilder` (`StringBuilder` being mutable) but is there a large performance difference between the two? The program I’m working on has a lot of ...

13 Jul at 10:6

Parsing error: Cannot read file '.../tsconfig.json'.eslint

The error `Parsing error: Cannot read file '.../tsconfig.json'.eslint` shows in all `.ts` files in the `src` folder including `index.ts`. I have no idea how to set up configs. The issue just shows a r...

The environment is inconsistent, please check the package plan carefully

I tried to update or install new packages from anaconda and lately, this message has appeared: ``` The environment is inconsistent, please check the package plan carefully The following package are c...

30 Jan at 10:18

Google Colab: how to read data from my google drive?

The problem is simple: I have some data on gDrive, for example at `/projects/my_project/my_data*`. Also I have a simple notebook in gColab. So, I would like to do something like: ``` for file in g...

22 Jan at 08:23

using process.env in TypeScript

How do I read node environment variables in TypeScript? If i use `process.env.NODE_ENV` I have this error : ``` Property 'NODE_ENV' does not exist on type 'ProcessEnv' ``` I have installed `@type...

19 Jul at 15:11

Unit Tests not discovered in Visual Studio 2017

I have been struggling with VS 2017 since I installed it. Now it seems Unit Tests will only run from the command line "dotnet test." My project is .NET Core 1.1.1. I have the SDK and the framework up...

6 Mar at 00:38

How to implement debounce in Vue2?

I have a simple input box in a Vue template and I would like to use debounce more or less like this: ``` <input type="text" v-model="filterKey" debounce="500"> ``` However the `debounce` property has...

31 Mar at 14:18

Running NPM scripts sequentially

Let's say I have ``` "scripts": { "pre-build": "echo \"Welcome\" && exit 1", "build_logic": "start cmd.exe @cmd /k \"yo esri-appbuilder-js:widget && exit 1\"", "post_build": "start C:\\...

29 Nov at 16:16

Webpack.config how to just copy the index.html to the dist folder

I am trying to automate assets going into /dist. I have the following config.js: ``` module.exports = { context: __dirname + "/lib", entry: { main: [ "./baa.ts" ] }, output: { ...

20 Jun at 09:12

pandas: multiple conditions while indexing data frame - unexpected behavior

I am filtering rows in a dataframe by values in two columns. For some reason the OR operator behaves like I would expect AND operator to behave and vice versa. My test code: ``` df = pd.DataFrame({'a'...

Remove All Event Listeners of Specific Type

I want to remove all event listeners of a specific type that were added using `addEventListener()`. All the resources I'm seeing are saying you need to do this: ``` elem.addEventListener('mousedown',...

4 May at 16:22

Delete a single record from Entity Framework?

I have a SQL Server table in Entity Framework named `employ` with a single key column named `ID`. How do I delete a single record from the table using Entity Framework?

2 Feb at 06:45

How to commit changes to another pre-existent branch

I just made changes to a branch. How can I commit the changes to the other branch? I am trying to use: ``` git checkout "the commmit to the changed branch" -b "the other branch" ``` However, I don...

18 Aug at 12:47

Dynamically add script tag with src that may include document.write

I want to dynamically include a script tag in a webpage however I have no control of it's src so src="source.js" may look like this. ``` document.write('<script type="text/javascript">') document.writ...

18 Oct at 12:47

How to get a file or blob from an object URL?

I am allowing the user to load images into a page via drag&drop and other methods. When an image is dropped, I'm using `URL.createObjectURL` to convert to an object URL to display the image. I am no...

6 Feb at 14:48

Fragment onResume() & onPause() is not called on backstack

I have multiple fragment inside an activity. On a button click I am starting a new fragment, adding it to backstack. I naturally expected the `onPause()` method of current Fragment and `onResume()` of...

What data type to use for money in Java?

What data type should you use for money in Java?

20 Sep at 09:26

Fastest way to check if string contains only digits in C#

I know a few ways of how to check if a string contains only digits: RegEx, `int.parse`, `tryparse`, looping, etc. Can anyone tell me what the way to check is? I need only to the value, no need to ac...

21 Dec at 15:9

Rails: Missing host to link to! Please provide :host parameter or set default_url_options[:host]

I have been googling for about 90 minutes now and still don't have an answer to this. Where do I set `default_url_options`? I've already set it for `config.action_mailer.default_url_options` to solv...

3 Aug at 16:43