Questions

Convert XML String to Object

I am receiving XML strings over a socket, and would like to convert these to C# objects. The messages are of the form: ``` <msg> <id>1</id> <action>stop</action> </msg> ``` How can this be done...

16 Jun at 17:13

Copy the entire contents of a directory in C#

I want to copy the entire contents of a directory from one location to another in C#. There doesn't appear to be a way to do this using `System.IO` classes without lots of recursion. There is a meth...

22 Jan at 08:36

Conversion of a datetime2 data type to a datetime data type results out-of-range value

I've got a datatable with 5 columns, where a row is being filled with data then saved to the database via a transaction. While saving, an error is returned: > The conversion of a datetime2 data type...

Position a div container on the right side

I want to develop some kind of utility bar. I can position each element in this bar side by side using `float:left;` But I want the second element to be positioned at the very right of the bar. This ...

7 Mar at 16:53

Clone only one branch

I would like to know how I could clone only one branch instead of cloning the whole Git repository.

28 Jun at 00:0

How to handle the modal closing event in Twitter Bootstrap?

In Twitter bootstrap, looking at the [modals](http://twitter.github.com/bootstrap/javascript.html#modals) documentation. I wasn't able to figure out if there is a way to listen to the close event of t...

How to access the last value in a vector?

Suppose I have a vector that is nested in a dataframe with one or two levels. Is there a quick and dirty way to access the last value, without using the `length()` function? Something ala PERL's `$#...

1 Jan at 14:54

How do I add a new column to a Spark DataFrame (using PySpark)?

I have a Spark DataFrame (using PySpark 1.5.1) and would like to add a new column. I've tried the following without any success: ``` type(randomed_hours) # => list # Create in Python and transform ...

Can I store images in MySQL

> [Images in MySQL](https://stackoverflow.com/questions/1665730/images-in-mysql) [Storing images in MySQL](https://stackoverflow.com/questions/3014578/storing-images-in-mysql) I'm trying to ...

23 May at 10:31

Checking for NULL pointer in C/C++

In a recent code review, a contributor is trying to enforce that all `NULL` checks on pointers be performed in the following manner: ``` int * some_ptr; // ... if (some_ptr == NULL) { // Handle n...

4 May at 16:50

How to use "raise" keyword in Python

I have read the official definition of "raise", but I still don't quite understand what it does. In simplest terms, what is "raise"? Example usage would help.

24 Jan at 10:58

How to clear react-native cache?

In react-native development, there are multiple caches used when the app is built: 1. React-native packager cache 2. Emulator cache 3. Java side cache (.gradle) folder (only in android) 4. npm cache ...

What is the intended use of the optional "else" clause of the "try" statement in Python?

What is the intended use of the optional `else` clause of the `try` statement?

22 Mar at 18:15

What represents a double in sql server?

I have a couple of properties in `C#` which are `double` and I want to store these in a table in SQL Server, but noticed there is no `double` type, so what is best to use, `decimal` or `float`? This ...

Full screen background image in an activity

I see many applications that use a full-screen image as background. This is an example: ![Full screen background image](https://i.stack.imgur.com/j1qzY.jpg) I want to use this in a project, the best...

CSS Progress Circle

I have searched this website to find progress bars, but the ones I have been able to found show animated circles that go to the full 100%. I would like it to stop at certain percentages like in the s...

Is there a way to specify which pytest tests to run from a file?

Is there a way to select `pytest` tests to run from a file? For example, a file `foo.txt` containing a list of tests to be executed: ``` tests_directory/foo.py::test_001 tests_directory/bar.py::test_s...

8 Jul at 22:46

Fatal error: Class 'SoapClient' not found

I'm trying a simple web service example and I get this error even though I uncommented `extension=php_soap.dll` in the `php.ini` file: > Class 'SoapClient' not found in C:\Program Files (x86)\EasyPH...

17 Aug at 08:7

Compare two files in Visual Studio

I saw the new comparison tool in Visual Studio 2012 for comparing two files or two versions of a file. I like it. But when I tried to find it I couldn't it, because I don't use [TFS](https://en.wikipe...

'printf' vs. 'cout' in C++

What is the difference between [printf()](http://en.cppreference.com/w/cpp/io/c/fprintf) and [cout](http://en.cppreference.com/w/cpp/io/basic_ostream) in C++?

7 Jun at 13:54

How do I use variables in Oracle SQL Developer?

Below is an example of using variables in SQL Server 2000. ``` DECLARE @EmpIDVar INT SET @EmpIDVar = 1234 SELECT * FROM Employees WHERE EmployeeID = @EmpIDVar ``` I want to do the exact same thin...

13 Apr at 18:10

In Typescript, what is the ! (exclamation mark / bang) operator when dereferencing a member?

When looking at the sourcecode for a tslint rule, I came across the following statement: ``` if (node.parent!.kind === ts.SyntaxKind.ObjectLiteralExpression) { return; } ``` Notice the `!` oper...

10 May at 11:21

Member '<member name>' cannot be accessed with an instance reference

I am getting into C# and I am having this issue: ``` namespace MyDataLayer { namespace Section1 { public class MyClass { public class MyItem { ...

25 Aug at 19:32

Variable length (Dynamic) Arrays in Java

I was wondering how to initialise an integer array such that it's size and values change through out the execution of my program, any suggestions?

11 Mar at 16:22

How to get DropDownList SelectedValue in Controller in MVC

I have dropdownlist, which I have filled from database. Now I need to get the selected value in Controller do some manipulation. But not getting the idea. Code which I have tried. ## Model ``` pu...

27 Mar at 20:44