Questions

How do you do a limit query in JPQL or HQL?

In Hibernate 3, is there a way to do the equivalent of the following MySQL limit in HQL? ``` select * from a_table order by a_table_column desc limit 0, 20; ``` I don't want to use setMaxResults if...

24 Mar at 13:35

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

i am using , and my servlet container is and my IDE is and the jar which contains the exists in the lib folder, and yet when running the application, i am getting the exception: ``` java.lang.Cla...

25 Feb at 09:29

Can I escape HTML special chars in JavaScript?

I want to display text to HTML by a JavaScript function. How can I escape HTML special characters in JavaScript? Is there an API?

15 Jun at 21:29

PHP-FPM doesn't write to error log

I've just installed a nginx+php-fpm server. Everything seems fine except that PHP-FPM never writes error to its log. fpm.conf ``` [default] listen = /var/run/php-fpm/default.sock listen.allowed_clie...

22 Mar at 06:20

Passing arguments to "make run"

I use Makefiles. I have a target called `run` which runs the build target. Simplified, it looks like the following: ``` prog: .... ... run: prog ./prog ``` Is there any way to pass arguments? So...

18 Nov at 20:24

Converting a char to uppercase

``` String lower = Name.toLowerCase(); int a = Name.indexOf(" ",0); String first = lower.substring(0, a); String last = lower.substring(a+1); char f = first.charAt(0); char l = last.charAt(0); System....

15 Apr at 12:5

Add item to Listview control

I have a `listview` in c# with three columns and the view is details. I need to add a item to each specific column but I am having a hard time with this. I have tried several things. Here is what I go...

25 Jul at 10:57

How to properly create an SVN tag from trunk?

I am creating my first project in [Subversion](http://en.wikipedia.org/wiki/Apache_Subversion). So far I have ``` branches tags trunk ``` I think I immediately need to make branches singular and ...

14 Nov at 18:7

Jenkins returned status code 128 with github

With GitHub command I have: ``` ssh -T git@github.com Hi (MyName)! You've successfully authenticated, but GitHub does not provide shell access. ``` My connection with GitHub is ok (no problem), but...

26 Sep at 10:22

Testing two JSON objects for equality ignoring child order in Java

I'm looking for a JSON parsing library that supports comparing two JSON objects ignoring child order, specifically for unit testing JSON returning from a web service. Do any of the major JSON librari...

11 Feb at 16:2

How to only get file name with Linux 'find'?

I'm using find to all files in directory, so I get a list of paths. However, I need only file names. i.e. I get `./dir1/dir2/file.txt` and I want to get `file.txt`

7 Dec at 10:18

Java reading a file into an ArrayList?

How do you read the contents of a file into an `ArrayList<String>` in Java? ``` cat house dog . . . ```

21 May at 04:12

call javascript function on hyperlink click

I am dynamically creating a hyperlink in the c# code behind file of ASP.NET. I need to call a JavaScript function on client click. how do i accomplish this?

17 Jun at 06:43

Get the index of a certain value in an array in PHP

I have an array: ``` $list = array('string1', 'string2', 'string3'); ``` I want to get the index for a given value (i.e. `1` for `string2` and `2` for `string3`) All I want is the position of the ...

30 Dec at 15:9

How to loop through an associative array and get the key?

My associative array: ``` $arr = array( 1 => "Value1", 2 => "Value2", 10 => "Value10" ); ``` Using the following code, `$v` is filled with `$arr`'s values ``` foreach ($arr as $v){ echo ...

5 Nov at 13:56

Hex colors: Numeric representation for "transparent"?

I am building a web CMS in which the user can choose colours for certain site elements. I would like to convert all colour values to hex to avoid any further formatting hassle ("rgb(x,y,z)" or named c...

4 Apr at 18:8

"Non-static method cannot be referenced from a static context" error

I have a class named `Media` which has a method named `setLoanItem`: ``` public void setLoanItem(String loan) { this.onloan = loan; } ``` I am trying to call this method from a class named `GUI...

4 May at 11:32

How to change facet labels?

I have used the following `ggplot` command: ``` ggplot(survey, aes(x = age)) + stat_bin(aes(n = nrow(h3), y = ..count.. / n), binwidth = 10) + scale_y_continuous(formatter = "percent", breaks = c(0...

11 Apr at 12:40

Set margins in a LinearLayout programmatically

I'm trying to use Java () to create a LinearLayout with buttons that fill the screen, and have margins. Here is code that works without margins: ``` LinearLayout buttonsView = new LinearLayout(this);...

10 Jan at 18:9

How to serve an image using nodejs

I have a logo that is residing at the `public/images/logo.gif`. Here is my nodejs code. ``` http.createServer(function(req, res){ res.writeHead(200, {'Content-Type': 'text/plain' }); res.end('Hell...

17 Sep at 11:24

Control the size of points in an R scatterplot?

In R, the `plot()` function takes a `pch` argument that controls the appearance of the points in the plot. I'm making scatterplots with tens of thousands of points and prefer a small, but not too sma...

26 Feb at 21:58

In CSS Flexbox, why are there no "justify-items" and "justify-self" properties?

Consider the main axis and cross axis of a flex container: [](https://i.stack.imgur.com/9Oxw7.png) [W3C](https://www.w3.org/TR/css-flexbox-1/#box-model) To align flex items along the main axis there i...

31 Dec at 19:53

Angular 4 - get input value

I would like to know how to get the value from an input on angular 4. I looked over the documentation on angular and the example with the key event doesn't work very well for me and I can't find a pro...

28 Nov at 11:27

How can I truncate a double to only two decimal places in Java?

For example I have the variable 3.545555555, which I would want to truncate to just 3.54.

12 Oct at 22:46

How can I find which tables reference a given table in Oracle SQL Developer?

In [Oracle SQL Developer](http://www.oracle.com/technology/products/database/sql_developer/index.html), if I'm viewing the information on a table, I can view the constraints, which let me see the fore...