Questions

Function to convert timestamp to human date in javascript

How to convert this timestamp `1382086394000` to `2013-10-18 08:53:14` using a function in javascript? Currently I have this function: ``` function cleanDate(d) {return new Date(+d.replace(/\/Date\((...

NumPy array is not JSON serializable

After creating a NumPy array, and saving it as a Django context variable, I receive the following error when loading the webpage: ``` array([ 0, 239, 479, 717, 952, 1192, 1432, 1667], dtype=int...

18 Apr at 20:15

Cleaning up old remote git branches

I work from two different computers (A and B) and store a common git remote in the dropbox directory. Let's say I have two branches, master and devel. Both are tracking their remote counterparts orig...

14 Apr at 11:32

Sequence contains no elements?

I'm currently using a single query in two places to get a row from a database. ``` BlogPost post = (from p in dc.BlogPosts where p.BlogPostID == ID select p).Single(...

24 Aug at 19:25

How to determine if .NET Core is installed

I know that for older versions of .NET, you can determine if a given version is installed by following ``` https://support.microsoft.com/en-us/kb/318785 ``` Is there an official method of determin...

31 Jan at 13:24

INSERT with SELECT

I have a query that inserts using a `SELECT` statement: ``` INSERT INTO courses (name, location, gid) SELECT name, location, gid FROM courses WHERE cid = $cid ``` Is it possible to only select "na...

14 Jan at 20:55

Getting the name of the currently executing method

Is there a way to get the name of the currently executing method in Java?

30 Jul at 12:8

Converting string to numeric

I've imported a test file and tried to make a histogram ``` pichman <- read.csv(file="picman.txt", header=TRUE, sep="/t") hist <- as.numeric(pichman$WS) ``` However, I get different numbers fro...

8 Feb at 10:18

Entity Framework 5 Updating a Record

I have been exploring different methods of editing/updating a record within Entity Framework 5 in an ASP.NET MVC3 environment, but so far none of them tick all of the boxes I need. I'll explain why. ...

11 Mar at 10:36

Is there a "null coalescing" operator in JavaScript?

Is there a null coalescing operator in Javascript? For example, in C#, I can do this: ``` String someString = null; var whatIWant = someString ?? "Cookies!"; ``` The best approximation I can figur...

ImportError: No module named 'MySQL'

I have downloaded the Connector/Python for MySQL successfully. I used the following code in Python's shell to test my connection: `import mysql.connector` I received the following error message: `...

1 Oct at 00:32

How to hash some String with SHA-256 in Java?

How can I hash some `String` with `SHA-256` in Java?

What is console.log and how do I use it?

> [What is console.log?](https://stackoverflow.com/questions/4539253/what-is-console-log) I see this line in a lot of jQuery scripts out there. I assume it's used for debug. Where can I see t...

23 May at 11:46

Calling onclick on a radiobutton list using javascript

How do I call onclick on a radiobutton list using javascript?

12 Dec at 12:34

'node' is not recognized as an internal or an external command, operable program or batch file while using phonegap/cordova

I am using phonegap/cordova. Everthing is installed propelry i.e cordova, phonegap, ant,sdk,jdk. But now it says "node is not recogzed as an internal or external command"

6 Feb at 12:41

Drop a temporary table if it exists

I have two lines of code in SQL that create two tables on the fly, i need to do something like ``` IF TABLE EXISTS DROP IT AND CREATE IT AGAIN ELSE CREATE IT ``` my lines are the following...

22 Jan at 19:57

How can I return two values from a function in Python?

I would like to return two values from a function in two separate variables. For example: ``` def select_choice(): loop = 1 row = 0 while loop == 1: print('''Choose from the foll...

19 Aug at 17:43

PHP Redirect with POST data

I did some research on this topic, and there are some experts who have said that it is not [possible](https://stackoverflow.com/questions/3045097/php-redirect-and-send-data-via-post), so I would like ...

1 Aug at 16:50

Change the color of glyphicons to blue in some- but not at all places using Bootstrap 2

I am using the Bootstrap framework for my UI. I want to change the color of my glyphicons to blue, but not in all places. In some places it should use the default color. I have referred to these two ...

23 May at 12:26

How to get the date and time values in a C program?

I have something like this: ``` char *current_day, *current_time; system("date +%F"); system("date +%T"); ``` It prints the current day and time in the stdout, but I want to get this output or assi...

11 Mar at 10:14

Eclipse fonts and background color

I have been trying to change the background color of Eclipse's windows to black and customize the font colors. There doesn't seem to be a way to do this, at least not in an obvious way. I am using ver...

How to subtract X day from a Date object in Java?

I want to do something like: ``` Date date = new Date(); // current date date = date - 300; // substract 300 days from current date and I want to use this "date" ``` How to do it?

Can I use a binary literal in C or C++?

I need to work with a binary number. I tried writing: ``` const char x = 00010000; ``` But it didn't work. I know that I can use a hexadecimal number that has the same value as `00010000`, but I want...

19 Sep at 13:27

TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

I having trouble passing a function as a parameter to another function. This is my code: ``` def display_pageviews(hostname): pageviews_results = get_pageviews_query(service, hostname).execute(...

8 Aug at 19:24

How to use double or single brackets, parentheses, curly braces

I am confused by the usage of brackets, parentheses, curly braces in Bash, as well as the difference between their double or single forms. Is there a clear explanation?

25 May at 18:24