Questions

"The import org.springframework cannot be resolved."

Here is my POM.xml file: ``` <project> <properties> <jdk.version>1.6</jdk.version> <spring.version>3.2.2.RELEASE</spring.version> <spring.batch.version>2.2.0.RELEASE</spri...

13 Nov at 13:22

Is it possible to have empty RequestParam values use the defaultValue?

if I have a a request mapping similar to the following: ``` @RequestMapping(value = "/test", method = RequestMethod.POST) @ResponseBody public void test(@RequestParam(value = "i", defaultValue = "10"...

19 Jan at 05:21

Cell spacing in UICollectionView

How do I set cell spacing in a section of `UICollectionView`? I know there is a property `minimumInteritemSpacing` I have set it to 5.0 still the spacing is not appearing 5.0. I have implemented the f...

22 Dec at 12:27

log4j:WARN No appenders could be found for logger in web.xml

I already put the log4jConfigLocation in web.xml, but I still get the following warning: ``` log4j:WARN No appenders could be found for logger ⤦ ⤥ (org.springframework.web.context.ContextLoader)....

5 May at 10:35

How to read request body in an asp.net core webapi controller?

I'm trying to read the request body in the `OnActionExecuting` method, but I always get `null` for the body. ``` var request = context.HttpContext.Request; var stream = new StreamReader(request.Body);...

24 Sep at 07:27

How can a LEFT OUTER JOIN return more records than exist in the left table?

I have a very basic LEFT OUTER JOIN to return all results from the left table and some additional information from a much bigger table. The left table contains 4935 records yet when I LEFT OUTER JOIN ...

21 Sep at 19:25

Get number of digits with JavaScript

As the title of my post suggests, I would like to know how many digits `var number` has. For example: If `number = 15;` my function should return `2`. Currently, it looks like this: ``` function getl...

30 Jan at 07:2

How to get text of an input text box during onKeyPress?

I am trying to get the text in a text box as the user types in it ([jsfiddle playground](http://jsfiddle.net/VDd6C/3/)): ``` function edValueKeyPress() { var edValue = document.getElementById("ed...

4 Jan at 13:34

How to merge two sorted arrays into a sorted array?

This was asked of me in an interview and this is the solution I provided: ``` public static int[] merge(int[] a, int[] b) { int[] answer = new int[a.length + b.length]; int i = 0, j = 0, k =...

16 Apr at 22:53

How to hide the bar at the top of "youtube" even when mouse hovers over it?

I am attempting to embed a youtube video, however, I have not discovered a way to keep the bar at the top from showing when the mouse hovers over it. For my purposes it is important that users are not...

20 Aug at 18:33

Subtract a value from every number in a list in Python?

I have a list ``` a = [49, 51, 53, 56] ``` How do I subtract 13 from each integer value in the list?

4 Oct at 00:39

UTL_FILE.FOPEN() procedure not accepting path for directory?

I am trying to write in a file stored in c:\ drive named vin1.txt and getting this error .Please suggest! ``` > ERROR at line 1: ORA-29280: invalid > directory path ORA-06512: at > "SYS.UTL_FILE", li...

2 May at 13:0

How to use EOF to run through a text file in C?

I have a text file that has strings on each line. I want to increment a number for each line in the text file, but when it reaches the end of the file it obviously needs to stop. I've tried doing some...

24 May at 06:54

'NOT LIKE' in an SQL query

Why does this simple query return 'ORA-00936: missing expression' (the database is Oracle as you can tell): ``` SELECT * FROM transactions WHERE id NOT LIKE '1%' AND NOT LIKE '2%' ``` I feel silly,...

25 Apr at 15:59

Simplest PHP example for retrieving user_timeline with Twitter API version 1.1

Because of the Twitter API 1.0 retirement as of [June 11th 2013](https://dev.twitter.com/blog/api-v1-retirement-date-extended-to-june-11), the script below does not work anymore. ``` // Create curl r...

24 Jun at 15:39

How to escape special characters of a string with single backslashes

I'm trying to escape the characters `-]\^$*.` each with a single backslash `\`. For example the string: `^stack.*/overflo\w$arr=1` will become: ``` \^stack\.\*/overflo\\w\$arr=1 ``` What's the mos...

7 Aug at 11:33

How to query for Xml values and attributes from table in SQL Server?

I have a table that contains a `Xml` column: ``` SELECT * FROM Sqm ``` ![enter image description here](https://i.stack.imgur.com/nVgUG.png) A sample of the `xml` data of a row would be: ``` <Sqm...

How do I split a string in Rust?

From the [documentation](https://doc.rust-lang.org/std/primitive.str.html), it's not clear. In Java you could use the `split` method like so: ``` "some string 123 ffd".split("123"); ```

12 May at 17:25

Select query to remove non-numeric characters

I've got dirty data in a column with variable alpha length. I just want to strip out anything that is not 0-9. I do not want to run a function or proc. I have a script that is similar that just grab...

How to find a min/max with Ruby

I want to use `min(5,10)`, or `Math.max(4,7)`. Are there functions to this effect in Ruby?

26 Feb at 08:56

How to get elements with multiple classes

Say I have this: ``` <div class="class1 class2"></div> ``` How do I select this `div` element? ``` document.getElementsByClassName('class1')[0].getElementsByClassName('class2')[0] ``` That does ...

18 Jul at 05:15

How do I get a list of connected sockets/clients with Socket.IO?

I'm trying to get a list of all the sockets/clients that are currently connected. `io.sockets` does not return an array, unfortunately. I know I could keep my own list using an array, but I don't thin...

30 Aug at 10:41

How to re import an updated package while in Python Interpreter?

I often test my module in the Python Interpreter, and when I see an error, I quickly update the .py file. But how do I make it reflect on the Interpreter ? So, far I have been exiting and reentering t...

26 Mar at 01:19

How to convert an XML string to a dictionary?

I have a program that reads an XML document from a socket. I have the XML document stored in a string which I would like to convert directly to a Python dictionary, the same way it is done in Django's...

In C#, should I use string.Empty or String.Empty or "" to intitialize a string?

In C#, I want to initialize a string value with an empty string. How should I do this? What is the right way, and why? ``` string willi = string.Empty; ``` or ``` string willi = String.Empty; ``...

12 Jan at 00:11