What can I do about "ImportError: Cannot import name X" or "AttributeError: ... (most likely due to a circular import)"?
I have some code spread across multiple files that try to `import` from each other, as follows: main.py: ``` from entity import Ent ``` entity.py: ``` from physics import Physics class Ent: ... `...
- Modified
- 11 Aug at 04:6
How to parse JSON using Node.js?
How should I parse JSON using Node.js? Is there some module which will validate and parse JSON securely?
- Modified
- 3 Aug at 10:22
In Python, how do I convert all of the items in a list to floats?
I have a script which reads a text file, pulls decimal numbers out of it as strings and places them into a list. So I have this list: ``` my_list = ['0.49', '0.54', '0.54', '0.55', '0.55', '0.54', '0....
How to send FormData objects with Ajax-requests in jQuery?
The [XMLHttpRequest Level 2](http://www.w3.org/TR/XMLHttpRequest2/) standard (still a working draft) defines the `FormData` interface. This interface enables appending `File` objects to XHR-requests (...
- Modified
- 23 May at 12:34
Check if a word is in a string in Python
I'm working with Python, and I'm trying to find out if you can tell if a word is in a string. I have found some information about identifying if the word is in the string - using `.find`, but is there...
Sending multipart/formdata with jQuery.ajax
I've got a problem sending a file to a serverside PHP-script using jQuery's ajax-function. It's possible to get the File-List with `$('#fileinput').attr('files')` but how is it possible to send this D...
- Modified
- 13 Dec at 16:17
Inserting data into a temporary table
After having created a temporary table and declaring the data types like so; ``` CREATE TABLE #TempTable( ID int, Date datetime, Name char(20)) ``` How do I then insert the relevant data which is alr...
- Modified
- 25 Nov at 15:58
You need to use a Theme.AppCompat theme (or descendant) with this activity
Android Studio 0.4.5 Android documentation for creating custom dialog boxes: [http://developer.android.com/guide/topics/ui/dialogs.html](http://developer.android.com/guide/topics/ui/dialogs.html) If...
- Modified
- 20 Jan at 06:42
Can grep show only words that match search pattern?
Is there a way to make grep output "words" from files that match the search expression? If I want to find all the instances of, say, "th" in a number of files, I can do: ``` grep "th" * ``` but th...
- Modified
- 10 Dec at 15:17
Format date and time in a Windows batch script
In a Windows (Windows XP) batch script I need to format the current date and time for later use in files names, etc. It is similar to Stack Overflow question [How to append a date in batch files](htt...
- Modified
- 23 May at 12:3
Convert a string to int using sql query
How to convert a string to integer using SQL query on SQL Server 2005?
- Modified
- 10 Jan at 11:25
The type or namespace name could not be found
I have a `C#` solution with several projects in `Visual Studio 2010`. One is a test project (I'll call it ""), the other is a `Windows Forms Application` project (I'll call it ""). There is also a th...
- Modified
- 2 Nov at 11:14
Remove empty strings from a list of strings
I want to remove all empty strings from a list of strings in python. My idea looks like this: ``` while '' in str_list: str_list.remove('') ``` Is there any more pythonic way to do this?
CSS background image to fit width, height should auto-scale in proportion
I have ``` body { background: url(images/background.svg); } ``` The desired effect is that this background image will have width equal to that of the page, height changing to maintain the propo...
OnChange event handler for radio button (INPUT type="radio") doesn't work as one value
I'm looking for a generalized solution for this. Consider 2 radio type inputs with the same name. When submitted, the one that is checked determines the value that gets sent with the form: ``` <input ...
- Modified
- 2 Mar at 15:29
How Do I Convert an Integer to a String in Excel VBA?
How do I convert the value "45" into the value "45" in Excel VBA?
- Modified
- 18 Jun at 20:39
Why am I getting a NoClassDefFoundError in Java?
I am getting a `NoClassDefFoundError` when I run my Java application. What is typically the cause of this?
- Modified
- 11 Apr at 10:38
How can I merge two commits into one if I already started rebase?
I am trying to merge 2 commits into 1, so I followed [“squashing commits with rebase” from git ready](http://www.gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html). I ran ``` git r...
Get property value from string using reflection
I am trying implement the [Data transformation using Reflection](https://web.archive.org/web/20210122135227/http://geekswithblogs.net/shahed/archive/2008/07/24/123998.aspx) example in my code. The `Ge...
- Modified
- 24 Nov at 15:8
Redefine tab as 4 spaces
My current setting assumes 8 spaces; how could I redefine it?
- Modified
- 20 Aug at 15:0
What is the --save option for npm install?
I saw some tutorial where the command was: ``` npm install --save ``` What does the `--save` option mean?
Opacity of background-color, but not the text
How do I make the cross-browser (including Internet Explorer 6) transparency for the background of a `div` while the text remains opaque? I need to do it without using any library such as jQuery, etc...
Difference between == and === in JavaScript
What is the difference between `==` and `===` in JavaScript? I have also seen `!=` and `!==` operators. Are there more such operators?
- Modified
- 9 Nov at 14:31
How to return a result from a VBA function
How do I return a result from a function? For example: ``` Public Function test() As Integer return 1 End Function ``` This gives a compile error. How do I make this function return an intege...
- Modified
- 1 May at 22:55
JavaScript: Upload file
Let's say I have this element on the page: ``` <input id="image-file" type="file" /> ``` This will create a button that allows the users of the web page to select a file via an OS "File open..." di...
- Modified
- 7 Apr at 21:36