Questions

Retrieving the output of subprocess.call()

How can I get the output of a process run using `subprocess.call()`? Passing a `StringIO.StringIO` object to `stdout` gives this error: ``` Traceback (most recent call last): File "<stdin>", line ...

16 Jan at 19:31

How to select a single field for all documents in a MongoDB collection?

In my MongoDB, I have a student collection with 10 records having fields `name` and `roll`. One record of this collection is: ``` { "_id" : ObjectId("53d9feff55d6b4dd1171dd9e"), "name" : "Sw...

18 Feb at 11:54

mysql Foreign key constraint is incorrectly formed error

I have two tables, `table1` is the parent table with a column `ID` and `table2` with a column `IDFromTable1` (not the actual name) when I put a FK on `IDFromTable1` to `ID` in `table1` I get the error...

15 Aug at 04:26

How do I get a list of all subdomains of a domain?

I want to find out all the subdomains of a given domain. I found a hint which tells me to dig the authoritative Nameserver with the following option: ``` dig @ns1.foo.example example.com axfr ``` But...

5 Jul at 14:32

How can I solve the error LNK2019: unresolved external symbol - function?

I get this error, but I don't know how to fix it. I'm using Visual Studio 2013. I made the solution name This is the structure of my test solution: ![The structure](https://i.stack.imgur.com/uRUex.pn...

27 Jan at 19:50

In Android, how do I set margins in dp programmatically?

In [this](https://stackoverflow.com/questions/2481455/set-margins-in-a-linearlayout-programmatically), [this](https://stackoverflow.com/questions/7981456/setting-buttons-margin-programmatically) and [...

24 Jul at 21:38

Editing legend (text) labels in ggplot

I have spent hours looking in the documentation and on StackOverflow, but no solution seems to solve my problem. When using `ggplot` I can't get the right text in the legend, even though it's in my d...

31 May at 09:46

How to draw checkbox or tick mark in GitHub Markdown table?

I am able to draw checkbox in Github README.md lists using ``` - [ ] (for unchecked checkbox) - [x] (for checked checkbox) ``` But this is not working in table. Does anybody know how to implement che...

Filtering a data frame by values in a column

I am working with the dataset `LearnBayes`. For those that want to see the actual data: ``` install.packages('LearnBayes') ``` I am trying to filter out rows based on the value in the columns. For...

11 Apr at 16:45

Displaying Windows command prompt output and redirecting it to a file

How can I run a command-line application in the Windows command prompt and have the output both displayed and redirected to a file at the same time? If, for example, I were to run the command `dir > ...

13 Apr at 13:40

JavaScript open in a new window, not tab

I have a select box that calls `window.open(url)` when an item is selected. Firefox will open the page in a new tab by default. However, I would like the page to open in a new window, not a new tab....

5 May at 01:40

Use of exit() function

I want to know how and when can I use the `exit()` function like the program in my book: ``` #include<stdio.h> void main() { int goals; printf("enter number of goals scored"); scanf("%d"...

29 Jun at 18:16

How do I force my .NET application to run as administrator?

Once my program is installed on a client machine, how do I force my program to run as an administrator on

Most efficient way to create a zero filled JavaScript array?

What is the most efficient way to create an arbitrary length zero filled array in JavaScript?

18 Aug at 18:11

How do I format a number with commas in T-SQL?

I'm running some administrative queries and compiling results from `sp_spaceused` in SQL Server 2008 to look at data/index space ratios of some tables in my database. Of course I am getting all sorts...

7 Dec at 13:56

HTTP GET Request in Node.js Express

How can I make an HTTP request from within Node.js or Express.js? I need to connect to another service. I am hoping the call is asynchronous and that the callback contains the remote server's response...

Pandas Replace NaN with blank/empty string

I have a Pandas Dataframe as shown below: ``` 1 2 3 0 a NaN read 1 b l unread 2 c NaN read ``` I want to remove the NaN values with an empty string so that it looks like ...

20 Oct at 20:38

How can I get an HTTP response body as a string?

I know there used to be a way to get it with Apache Commons as documented here: [http://hc.apache.org/httpclient-legacy/apidocs/org/apache/commons/httpclient/HttpMethod.html](http://hc.apache.org/http...

Unable to import a module that is definitely installed

After installing [mechanize](https://pypi.org/project/mechanize/), I don't seem to be able to import it. I have tried installing from pip, easy_install, and via `python setup.py install` from this re...

20 Sep at 14:23

How can I show the table structure in SQL Server query?

``` SELECT DateTime, Skill, Name, TimeZone, ID, User, Employee, Leader FROM t_Agent_Skill_Group_Half_Hour AS t ``` I need to view the table structure in a query.

18 Aug at 14:48

Dynamically creating a specific number of input form elements

I've read many blogs and posts on dynamically adding fieldsets, but they all give a very complicated answer. What I require is not that complicated. My HTML Code: ``` <input type="text" name="member...

28 Oct at 15:17

How can I open Java .class files in a human-readable way?

I'm trying to figure out what a Java applet's class file is doing under the hood. Opening it up with Notepad or Textpad just shows a bunch of gobbledy-gook. Is there any way to wrangle it back into a...

25 May at 18:29

Generate sql insert script from excel worksheet

I have a large excel worksheet that I want to add to my database. Can I generate an SQL insert script from this excel worksheet?

29 May at 16:4

Join vs. sub-query

I am an old-school MySQL user and have always preferred `JOIN` over sub-query. But nowadays everyone uses sub-query, and I hate it; I don't know why. I lack the theoretical knowledge to judge for ...

3 Nov at 18:0

How to resolve cURL Error (7): couldn't connect to host?

I send an item code to a web service in xml format using cUrl(php). I get the correct response in localhost, but when do it server it shows > cURL Error (7): couldn't connect to host And here's my ...

31 Jan at 15:39