Questions

Using margin:auto to vertically-align a div

So I know we can center a div horizontally if we use `margin:0 auto;`. Should `margin:auto auto;` work how I think it should work? Centering it vertically as well? Why doesn't `vertical-align:middle...

11 Aug at 13:32

What's the best way to build a string of delimited items in Java?

While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could...

21 Apr at 20:5

Unable to copy file - access to the path is denied

I am using Visual Studio 2005. After taking code from version control first, the c#.net application runs correctly. But, after doing some modifications, when I build I am getting the following error...

20 Feb at 18:59

An attempt was made to access a socket in a way forbidden by its access permissions. Why?

``` private void StartReceivingData(string ipAddress, int iPort) { try { if (!_bContinueReciving) { //initializeMainSocket(ipAddress, iPort)...

4 Aug at 15:33

Powershell: How can I stop errors from being displayed in a script?

When my PowerShell script tries, for example, to create a SQL Server object for a server that doesn't exist ("bla" in my case), PowerShell displays lots of PowerShell errors in red. Since my script c...

6 Dec at 12:15

Java Returning method which returns arraylist?

I have one class with a method like this: ``` public ArrayList<Integer> myNumbers() { ArrayList<Integer> numbers = new ArrayList<Integer>(); numbers.add(5); numbers.add(11); number...

27 Jul at 05:57

Cannot deserialize the JSON array (e.g. [1,2,3]) into type ' ' because type requires JSON object (e.g. {"name":"value"}) to deserialize correctly

I have this JSON: ``` [ { "Attributes": [ { "Key": "Name", "Value": { "Value": "Acc 1", "Values": [ ...

13 Dec at 17:19

Running bash script from within python

I have a problem with the following code: ``` import subprocess print "start" subprocess.call("sleep.sh") print "end" ``` ``` sleep 10 ``` I want the "end" to be printed after 10s. (I know th...

6 Dec at 14:25

How to build and run Maven projects after importing into Eclipse IDE

I am learning building a Java project in Eclipse using Maven. I created a Java project `HelloWorld` from “maven-archetype-quickstart” template in a folder `D:/maven_projects`. Then to convert the Mave...

15 Feb at 14:1

Update MongoDB field using value of another field

In MongoDB, is it possible to update the value of a field using the value from another field? The equivalent SQL would be something like: ``` UPDATE Person SET Name = FirstName + ' ' + LastName ``` ...

Plot smooth line with PyPlot

I've got the following simple script that plots a graph: ``` import matplotlib.pyplot as plt import numpy as np T = np.array([6, 7, 8, 9, 10, 11, 12]) power = np.array([1.53E+03, 5.92E+02, 2.04E+02,...

24 Aug at 13:59

Select columns with NULL values only

How do I select all the columns in a table that only contain NULL values for all the rows? I'm using . I'm trying to find out which columns are not used in the table so I can delete them.

3 Feb at 12:13

Pull request vs Merge request

What is the difference between a Pull request and a Merge request? In GitHub, it's a Pull Request while in GitLab, for example, it's a Merge Request. So, is there a difference between both of these?

14 Aug at 17:45

What are the differences between "=" and "<-" assignment operators?

What are the differences between the assignment operators `=` and `<-` in R? I know that operators are slightly different, as this example shows ``` x <- y <- 5 x = y = 5 x = y <- 5 x <- y = 5 # Er...

15 Jun at 16:16

Convert date to UTC using moment.js

Probably and easy answer to this but I can't seem to find a way to get moment.js to return a UTC date time in milliseconds. Here is what I am doing: ``` var date = $("#txt-date").val(), expires =...

26 Apr at 01:28

How do I enable C++11 in gcc?

I use gcc 4.8.1 from [http://hpc.sourceforge.net](http://hpc.sourceforge.net) on Mac OSX Mountain Lion. I am trying to compile a C++ program which uses the `to_string` function in `<string>`. I need t...

9 Oct at 14:53

How to convert these strange characters? (ë, Ã, ì, ù, Ã)

My page often shows things like ë, Ã, ì, ù, à in place of normal characters. I use utf8 for header page and MySQL encode. How does this happen?

Counting repeated characters in a string in Python

I want to count the number of times each character is repeated in a string. Is there any particular way to do it apart from comparing each character of the string from A-Z and incrementing a counter? ...

23 May at 10:30

String literals and escape characters in postgresql

Attempting to insert an escape character into a table results in a warning. For example: ``` create table EscapeTest (text varchar(50)); insert into EscapeTest (text) values ('This is the first pa...

2 Jan at 22:34

Can I use multiple "with"?

Just for example: ``` With DependencedIncidents AS ( SELECT INC.[RecTime],INC.[SQL] AS [str] FROM ( SELECT A.[RecTime] As [RecTime],X.[SQL] As [SQL] FROM [EventView] AS A CRO...

13 Dec at 22:35

Download/Stream file from URL - asp.net

I need to stream a file which will result in save as prompt in the browser. The issue is, the directory that the file is located is virtually mapped, so I am unable to use Server.MapPath to determine ...

29 Dec at 20:35

What is the best JavaScript code to create an img element

I want to create a simple bit of JS code that creates an image element in the background and doesn't display anything. The image element will call a tracking URL (such as Omniture) and needs to be si...

14 Feb at 14:25

Can I fade in a background image (CSS: background-image) with jQuery?

I have a `div` element with text in it and a background image, which is set via the CSS property `background-image`. Is it possible to fade in the background image via jQuery? ``` div { background-...

14 Jun at 16:49

Replacing Pandas or Numpy Nan with a None to use with MysqlDB

I am trying to write a Pandas dataframe (or can use a numpy array) to a mysql database using MysqlDB . MysqlDB doesn't seem understand 'nan' and my database throws out an error saying nan is not in th...

4 Jan at 12:20

Change the Blank Cells to "NA"

Here's the [link](https://www.dropbox.com/s/ttwiitihjtb7mec/data2.csv) of my data. My target is to assign "NA" to all blank cells irrespective of categorical or numerical values. I am using . But it...

2 May at 15:29