Questions

Most efficient way to convert an HTMLCollection to an Array

Is there a more efficient way to convert an HTMLCollection to an Array, other than iterating through the contents of said collection and manually pushing each item into an array?

21 Oct at 18:4

Django datetime issues (default=datetime.now())

I have the below db model: ``` from datetime import datetime class TermPayment(models.Model): # I have excluded fields that are irrelevant to the question date = models.DateTimeField(def...

13 May at 12:55

Import regular CSS file in SCSS file?

Is there anyway to import a regular CSS file with Sass's `@import` command? While I'm not using all of the SCSS syntax from sass, I do still enjoy it's combining/compressing features, and would like t...

7 Jan at 07:31

Receiving JSON data back from HTTP request

I have a web request that is working properly, but it is just returning the status OK, but I need the object I am asking for it to return. I am not sure how to get the json value I am requesting. I am...

3 Aug at 23:56

The create-react-app imports restriction outside of src directory

I am using create-react-app. I am trying to call an image from my public folder from a file inside my `src/components`. I am receiving this error message. > ./src/components/website_index.js Module n...

How to find the standard error of the mean?

Is there any command to find the standard error of the mean in R?

16 Dec at 10:7

What is the difference between --save and --save-dev?

What is the difference between: ``` npm install [package_name] ``` and: ``` npm install [package_name] --save ``` and: ``` npm install [package_name] --save-dev ``` What does this mean? And what is...

20 Sep at 06:45

How do you calculate program run time in python?

How do you calculate program run time in python?

11 Apr at 15:5

How to format numbers?

I want to format numbers using JavaScript. For example: ``` 10 => 10.00 100 => 100.00 1000 => 1,000.00 10000 => 10,000.00 100000 => 100,000.00 ```

25 Nov at 14:20

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

I am getting an interesting error while trying to use `Unpickler.load()`, here is the source code: ``` open(target, 'a').close() scores = {}; with open(target, "rb") as file: unpickler = pickle.U...

7 Sep at 11:38

What is token-based authentication?

I want to understand what token-based authentication means. I searched the internet but couldn't find anything understandable.

How to decrypt a SHA-256 encrypted string?

I have a string that was salted, hashed with SHA-256, then base64 encoded. Is there a way to decode this string back to its original value?

20 Dec at 14:38

C# find highest array value and index

So I have an unsorted numeric array `int[] anArray = { 1, 5, 2, 7 };` and I need to get both the value and the index of the largest value in the array which would be 7 and 3, how would I do this?

7 Dec at 00:18

How to initialize a dict with keys from a list and empty value in Python?

I'd like to get from this: ``` keys = [1,2,3] ``` to this: ``` {1: None, 2: None, 3: None} ``` Is there a pythonic way of doing it? This is an ugly way to do it: ``` >>> keys = [1,2,3] >>> dic...

22 Jul at 19:30

How to enable CORS in ASP.net Core WebAPI

I have a backend ASP.Net Core Web API hosted on an Azure Free Plan (Source Code: [https://github.com/killerrin/Portfolio-Backend](https://github.com/killerrin/Portfolio-Backend)). I also have a Cl...

19 Jan at 16:28

How to declare strings in C

Can anyone explain me what is a difference between these lines of code ``` char *p = "String"; char p2[] = "String"; char p3[7] = "String"; ``` In what case should I use each of the above ?

23 May at 12:2

How to get a form input array into a PHP array

I have a form like the one below which is posted to , and the user can dynamically add more with [jQuery](https://en.wikipedia.org/wiki/JQuery). ``` <input type="text" name="name[]" /> <input type="te...

18 Sep at 22:11

node.js, Error: Cannot find module 'express'

I am new to Node.js, try to learn express to build my first web application. I got stuck on my very first sample code and need some help to get it running. Before I post this question, I did search o...

20 Jan at 07:48

C++ performance vs. Java/C#

My understanding is that C/C++ produces native code to run on a particular machine architecture. Conversely, languages like Java and C# run on top of a virtual machine which abstracts away the native...

29 Dec at 18:4

How to use/install gcc on Mac OS X 10.8 / Xcode 4.4

I have install Mountain Lion (Mac OS X 10.8) and now gcc doesn't seem to be available anymore. I've also installed Xcode 4.4 so there is no more /Developer directory. I need gcc both for mac ports a...

19 Feb at 21:32

Returning Arrays in Java

I have absolutely no idea as to why this code won't return an array... I feel like there is a problem with my compiler: ``` public class trial1{ public static void main(String[] args){ n...

7 Sep at 12:26

How to go from one page to another page using javascript?

From an admin page if the user is valid then the browser should go to another page. When a user enters his user name and password, then clicks the OK button then another page is displayed and the log...

The data-toggle attributes in Twitter Bootstrap

What does `data-toggle` attributes do in Twitter Bootstrap? I couldn't find an answer in Bootstrap API. I have seen a similar question before as well, [link](https://stackoverflow.com/questions/10481...

Use a JSON array with objects with javascript

I have a function that will get a JSON array with objects. In the function I will be able to loop through the array, access a property and use that property. Like this: Variable that I will pass to t...

6 Jan at 08:51

Remove characters from C# string

How might I remove characters from a string? For example: `"My name @is ,Wan.;'; Wan"`. I would like to remove the characters `'@', ',', '.', ';', '\''` from that string so that it becomes `"My name ...

15 Apr at 17:37