Questions

Plotting a fast Fourier transform in Python

I have access to NumPy and SciPy and want to create a simple FFT of a data set. I have two lists, one that is `y` values and the other is timestamps for those `y` values. What is the simplest way to f...

6 Mar at 13:0

Print array to a file

I would like to print an array to a file. I would like the file to look exactly similar like how a code like this looks. `print_r ($abc);` assuming $abc is an array. Is there any one lines solution...

21 Feb at 09:27

Converting Long to Date in Java returns 1970

I have list with long values (for example: 1220227200, 1220832000, 1221436800...) which I downloaded from web service. I must convert it to Dates. Unfortunately this way, for example: ``` Date d = ne...

17 Jan at 15:44

How to do exponential and logarithmic curve fitting in Python? I found only polynomial fitting

I have a set of data and I want to compare which line describes it best (polynomials of different orders, exponential or logarithmic). I use Python and Numpy and for polynomial fitting there is a fun...

Python can't find module in the same folder

My python somehow can't find any modules in the same directory. What am I doing wrong? (python2.7) So I have one directory '2014_07_13_test', with two files in it: 1. test.py 2. hello.py where ...

13 Jan at 13:24

gpg failed to sign the data fatal: failed to write commit object [Git 2.10.0]

I followed few articles over the [pretty](https://coderwall.com/p/euwpig/a-better-git-log) attributes on [Git 2.10](https://github.com/blog/2242-git-2-10-has-been-released) release note. Going through...

23 May at 12:10

How to draw a line in android

Can anybody tell how to draw a line in Android, perhaps with an example?

4 Nov at 01:16

How to keep environment variables when using sudo

When I use any command with sudo the environment variables are not there. For example after setting HTTP_PROXY the command `wget` works fine without `sudo`. However if I type `sudo wget` it says it ca...

17 Aug at 17:6

How to customize <input type="file">?

Is it possible to change the appearance of `<input type="file">`?

10 May at 11:56

What is the equivalent of "!=" in Excel VBA?

The problem is that `!=` does not work as a function in excel vba. I want to be able to use `If strTest != "" Then` instead of `If strTest = "" Then` Is there another approach to do this besides `...

11 Jul at 15:36

How to generate UML diagrams (especially sequence diagrams) from Java code?

How can I generate UML diagrams (especially sequence diagrams) from existing Java code?

30 Mar at 11:0

How do I group Windows Form radio buttons?

How can I group the radio buttons in Windows Form application (a lot like ASP.NET's radiobuttonlist!)? So I can switch between each case chosen from the options.

2 Apr at 08:13

adb shell su works but adb root does not

I rooted my unlocked Galaxy S3 (SGH-T999) Now, I'm trying to run `adb root` from Windows , however, I'm getting `adbd cannot run as root in production builds` error. So, the very first thing I checked...

3 Mar at 19:3

Why am I getting an OPTIONS request instead of a GET request?

``` <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script> <script> $.get("http://example.com/", function(data) { alert(data); }); </script> ``...

How do I parse a string with a decimal point to a double?

I want to parse a string like `"3.5"` to a double. However, ``` double.Parse("3.5") ``` yields 35 and ``` double.Parse("3.5", System.Globalization.NumberStyles.AllowDecimalPoint) ``` throws a ...

16 Nov at 18:1

Convert ^M (Windows) line breaks to normal line breaks

Vim shows `^M` on every line ending. How do I replace this with a normal line break in a file opened in Vim?

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 13: ordinal not in range(128)

I'm using NLTK to perform kmeans clustering on my text file in which each line is considered as a document. So for example, my text file is something like this: ``` belong finger death punch <br> has...

4 Sep at 07:54

How can I align text directly beneath an image?

I used to know how to put an image on top and then justify the text below the image so that it stays within the borders of the width of the image. However, now I have no idea how to do this. How is ...

21 Aug at 15:45

How to pass command line arguments to a rake task

I have a rake task that needs to insert a value into multiple databases. I'd like to pass this value into the rake task from the command line, or from rake task. How can I do this?

Remove characters after specific character in string, then remove substring?

I feel kind of dumb posting this when this seems kind of simple and there are tons of questions on strings/characters/regex, but I couldn't find quite what I needed (except in another language: [Remov...

23 May at 11:47

Is there a concurrent List in Java's JDK?

How can I create a concurrent List instance, where I can access elements by index? Does the JDK have any classes or factory methods I can use?

15 Feb at 22:55

If list index exists, do X

In my program, user inputs number `n`, and then inputs `n` number of strings, which get stored in a list. I need to code such that if a certain list index exists, then run a function. This is made m...

21 Jan at 18:4

Check if a value is within a range of numbers

I want to check if a value is in an accepted range. If yes, to do something; otherwise, something else. The range is `0.001-0.009`. I know how to use multiple `if` to check this, but I want to know i...

31 Jan at 15:36

Trying to get property of non-object - Laravel 5

I'm trying to echo out the name of the user in my article and I'm getting the > ErrorException: Trying to get property of non-object My code: ``` 1. News class News extends Model { pub...

27 Dec at 05:12

PHP: settings memory_limits > 1024M does not work

For bad reasons I need to set higher than 1 GB for a directory, but on my PHP 5.2.17 on a [Debian 5.0](https://en.wikipedia.org/wiki/Debian_version_history#Debian_5.0_(Lenny)) (Lenny) server when I u...

26 Oct at 17:7