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...
- Modified
- 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...
- Modified
- 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?
- Modified
- 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...
- Modified
- 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...
- Modified
- 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....
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...
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 ...
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...
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...
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`
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 . . . ```
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?
- Modified
- 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 ...
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 ...
- Modified
- 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...
- Modified
- 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...
- Modified
- 4 May at 11:32
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...
- Modified
- 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...
- Modified
- 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...
- Modified
- 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...
- Modified
- 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.
- Modified
- 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...
- Modified
- 17 Jul at 15:22