Questions

How to get text box value in JavaScript

I am trying to use JavaScript to get the value from an HTML text box but value is not coming after white space For example: ``` <input type="text" name="txtJob" value="software engineer"> ``` I o...

23 Jul at 11:41

Switching a DIV background image with jQuery

I am making an expand/collapse call rates table for the company I work for. I currently have a table with a button under it to expand it, the button says "Expand". It is functional except I need the b...

26 May at 14:45

How to add number of days to today's date?

I need to be able to add 1, 2 , 5 or 10 days to today's date using jQuery.

21 Dec at 05:7

Should I use 'has_key()' or 'in' on Python dicts?

Given: ``` >>> d = {'a': 1, 'b': 2} ``` Which of the following is the best way to check if `'a'` is in `d`? ``` >>> 'a' in d True ``` ``` >>> d.has_key('a') True ```

10 Apr at 12:20

What is the difference between CMD and ENTRYPOINT in a Dockerfile?

In Dockerfiles there are two commands that look similar to me: `CMD` and `ENTRYPOINT`. But I guess that there is a (subtle?) difference between them - otherwise it would not make any sense to have two...

26 Jul at 23:56

How to write a foreach in SQL Server?

I am trying to achieve something along the lines of a for-each, where I would like to take the Ids of a returned select statement and use each of them. ``` DECLARE @i int DECLARE @PractitionerId int D...

16 Sep at 22:38

Do I use <img>, <object>, or <embed> for SVG files?

Should I use `<img>`, `<object>`, or `<embed>` for loading SVG files into a page in a way similar to loading a `jpg`, `gif` or `png`? What is the code for each to ensure it works as well as possible?...

10 Sep at 16:5

How to find Java Heap Size and Memory Used (Linux)?

How can I check Heap Size (and Used Memory) of a Java Application on Linux through the command line? I have tried through jmap. But it gives info. about internal memory areas like Eden/ PermGen etc., ...

How to print a dictionary line by line in Python?

This is the dictionary ``` cars = {'A':{'speed':70, 'color':2}, 'B':{'speed':60, 'color':3}} ``` Using this `for loop` ``` for keys,values in cars.items(): print(keys) ...

3 Apr at 11:10

Correct way to try/except using Python requests module?

``` try: r = requests.get(url, params={'s': thing}) except requests.ConnectionError, e: print(e) ``` Is this correct? Is there a better way to structure this? Will this cover all my bases?

How do I make a splash screen?

I want my app to look more professional, so I decided to add a splash screen. How should I go about the implementation?

1 Apr at 10:10

How can I get column names from a table in Oracle?

I need to query the database to get the , not to be confused with data in the table. For example, if I have a table named `EVENT_LOG` that contains `eventID`, `eventType`, `eventDesc`, and `eventTime...

23 May at 11:54

How do I store an array in localStorage?

If I didn't need localStorage, my code would look like this: ``` var names=new Array(); names[0]=prompt("New member name?"); ``` This works. However, I need to store this variable in localStorage ...

17 Feb at 15:2

Bootstrap align navbar items to the right

How do I align a navbar item to right? I want to have the login and register to the right. But everything I try does not seem to work. [](https://i.stack.imgur.com/G2o6H.png) ## This is what I hav...

How to fix Error: listen EADDRINUSE while using NodeJS?

If I run a server with the port 80, and I try to use [XMLHttpRequest](https://github.com/driverdan/node-XMLHttpRequest) I am getting this error: `Error: listen EADDRINUSE` Why is it problem for NodeJS...

6 Dec at 17:12

What is the difference between #include <filename> and #include "filename"?

What is the difference between using angle brackets and quotes in an `include` directive? - `#include <filename>`- `#include "filename"`

Run C++ in command prompt - Windows

I know that everyone uses an IDE nowadays, but I just find it simpler to write my code in notepad++, compile it using a command prompt command, and run it from there too. At least that works for Java ...

14 Mar at 13:30

Why is access to the path denied?

I am having a problem where I am trying to delete my file but I get an exception. ``` if (result == "Success") { if (FileUpload.HasFile) { try { File.Delete(...

Trying to use fetch and pass in mode: no-cors

I can hit this endpoint, `http://catfacts-api.appspot.com/api/facts?number=99` via Postman and it returns `JSON` Additionally I am using create-react-app and would like to avoid setting up any server...

How can I check if a string represents an int, without using try/except?

Is there any way to tell whether a represents an integer (e.g., `'3'`, `'-17'` but not `'3.14'` or `'asfasfas'`) Without using a try/except mechanism? ``` is_int('3.14') == False is_int('-7') == Tr...

11 Jan at 19:45

How can I convert a Unix timestamp to DateTime and vice versa?

There is this example code, but then it starts talking about millisecond / nanosecond problems. The same question is on MSDN, [Seconds since the Unix epoch in C#](https://learn.microsoft.com/archive/...

22 Feb at 00:48

How to include js file in another js file?

How can I include a js file into another js file , so as to stick to the [DRY principle](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself) and avoid duplication of code.

23 May at 12:10

ERROR 1396 (HY000): Operation CREATE USER failed for 'jack'@'localhost'

I seem to be unable to re-create a simple user I've deleted, even as root in MySQL. My case: user 'jack' existed before, but I deleted it from mysql.user in order to recreate it. I see no vestiges of...

25 Apr at 20:53

How do I execute cmd commands through a batch file?

I want to write a batch file that will do following things in given order: 1. Open cmd 2. Run cmd command cd c:\Program files\IIS Express 3. Run cmd command iisexpress /path:"C:\FormsAdmin.Site" /po...

23 Mar at 20:23

What does "collect2: error: ld returned 1 exit status" mean?

I see the error very often. For example, I was executing the following snippet of code: ``` void main() { char i; printf("ENTER i"); scanf("%c", &i); clrscr(); switch(i) { default: ...

22 Jan at 01:57