Questions

Node.js heap out of memory

Today I ran my script for filesystem indexing to refresh RAID files index and after 4h it crashed with following error: ``` [md5:] 241613/241627 97.5% [md5:] 241614/241627 97.5% [md5:] 241625/...

Attempted import error: 'Switch' is not exported from 'react-router-dom'

I don't know why I am getting this error and I can't find an answer for it anywhere. I have uninstalled the `react-router-dom` package and reinstalled it, but it continues to tell me that the switch m...

3 Feb at 22:12

Setting different color for each series in scatter plot on matplotlib

Suppose I have three data sets: ``` X = [1,2,3,4] Y1 = [4,8,12,16] Y2 = [1,4,9,16] ``` I can scatter plot this: ``` from matplotlib import pyplot as plt plt.scatter(X,Y1,color='red') plt.scatter(X...

29 Dec at 19:48

Python import csv to list

I have a CSV file with about 2000 records. Each record has a string, and a category to it: ``` This is the first line,Line1 This is the second line,Line2 This is the third line,Line3 ``` I need t...

15 Feb at 06:7

How to set a default value for an existing column

This isn't working in SQL Server 2008: ``` ALTER TABLE Employee ALTER COLUMN CityBorn SET DEFAULT 'SANDNES' ``` The error is: > Incorrect syntax near the keyword 'SET'. What am I doing wrong?

How to check Django version

I have to use [Python](http://en.wikipedia.org/wiki/Python_%28programming_language%29) and [Django](http://en.wikipedia.org/wiki/Django_%28web_framework%29) for our application. So I have two versions...

1 Oct at 05:48

How to pass a function as a parameter in Java?

In Java, how can one pass a function as an argument of another function?

28 Jan at 15:39

Is there a Sleep/Pause/Wait function in JavaScript?

Is there a JavaScript function that simulates the operation of the `sleep` function in PHP — a function that pauses code execution for x milliseconds, and then resumes where it left off? I found some...

5 Sep at 12:44

Encrypting & Decrypting a String in C#

What is the most modern (best) way of satisfying the following in C#? ``` string encryptedString = SomeStaticClass.Encrypt(sourceString); string decryptedString = SomeStaticClass.Decrypt(encryptedSt...

1 Nov at 15:31

Creating a range of dates in Python

I want to create a list of dates, starting with today, and going back an arbitrary number of days, say, in my example 100 days. Is there a better way to do it than this? ``` import datetime a = date...

14 Jun at 18:3

How can I add a border to a widget in Flutter?

I'm using Flutter and I'd like to add a border to a widget (in this case, a `Text` widget). I tried `TextStyle` and `Text`, but I didn't see how to add a border.

28 Feb at 16:56

makefile:4: *** missing separator. Stop

This is my makefile: ``` all:ll ll:ll.c gcc -c -Wall -Werror -02 c.c ll.c -o ll $@ $< clean : \rm -fr ll ``` When I try to `make clean` or `make make`, I get this error: ``` :makefi...

5 Jun at 05:20

How to find event listeners on a DOM node in JavaScript or in debugging?

I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event? Events ...

11 Aug at 04:11

Checking oracle sid and database name

I want to check SID and current database name. I am using following query for checking oracle SID ``` select instance from v$thread; ``` but table or view does not exist error is coming. I am usi...

9 Jun at 04:32

How do I get the file extension of a file in Java?

Just to be clear, I'm not looking for the MIME type. Let's say I have the following input: `/path/to/file/foo.txt` I'd like a way to break this input up, specifically into `.txt` for the extension. ...

20 May at 17:31

GitHub: invalid username or password

I have a project hosted on GitHub. I fail when trying to push my modifications on the master. I always get the following error message ``` Password for 'https://git@github.com': remote: Invalid user...

10 Nov at 13:49

An existing connection was forcibly closed by the remote host

I am working with a commercial application which is throwing a SocketException with the message, > An existing connection was forcibly closed by the remote host This happens with a socket connection b...

15 Apr at 18:9

Font Awesome icons are not working, I have included all required files

I am trying to use Font Awesome icons of version on my website but they are not working, I have referenced them in the `head` of my page. I have tried using two methods. 1. <a class="btn-cta-freequo...

28 Aug at 11:56

wget command to download a file and save as a different filename

I am downloading a file using the `wget` command. But when it downloads to my local machine, I want it to be saved as a different filename. For example: I am downloading a file from `www.examplesite....

31 Mar at 12:4

“Origin null is not allowed by Access-Control-Allow-Origin” error for request made by application running from a file:// URL

I'm developing a page that pulls images from Flickr and Panoramio via jQuery's AJAX support. The Flickr side is working fine, but when I try to `$.get(url, callback)` from Panoramio, I see an error i...

Python: How to ignore an exception and proceed?

I have a try...except block in my code and When an exception is throw. I really just want to continue with the code because in that case, everything is still able to run just fine. The problem is if y...

2 Jan at 01:3

Apache2: 'AH01630: client denied by server configuration'

I get this error when trying to access localhost via a browser. ``` AH01630: client denied by server configuration ``` I checked my site folder permissions using: ``` sudo chmod 777 -R * ``` Her...

10 Nov at 22:42

What's the difference between %s and %d in Python string formatting?

I don't understand what `%s` and `%d` do and how they work.

22 Sep at 17:7

How do I pass multiple parameters into a function in PowerShell?

If I have a function which accepts more than one string parameter, the first parameter seems to get all the data assigned to it, and remaining parameters are passed in as empty. A quick test script: ...

Get month and year from a datetime in SQL Server 2005

I need the month+year from the datetime in SQL Server like 'Jan 2008'. I'm grouping the query by month, year. I've searched and found functions like datepart, convert, etc., but none of them seem usef...

4 Apr at 00:30