There is a certain library I use in my project. This library has an interface which has about 15 methods. The purpose of this interface is to make it possible to subscribe for some events that are generated in the library. A listener class in application can implement this interface and register itself as a l…
Why does cucumber run @Before in all glue code files
I have a problem with my cucumber tests. It runs the @Before method in all the glue classes. For example. This feature file have one glue code in the MainStepDef.class. The MainStepDef: I have an additional glue file called: OtherStep.class And finally I have my runner class. When I run this I get the runtime…
toString() representation output
I have a bug in the code and believe me I’ve run debugging many times to find what’s wrong with code but cannot understand what is wrong. I have to output the contents of 2d Arraylist. For example, if I do: it outputs me the following: But when I change the fourth value, 3, to higher number, for e…
READ_EXTERNAL_STORAGE permission for Android
I’m trying to access media files (music) on the users device to play them; an easy “hello world”-music player app. I’ve followed some tutorials and they basically give the same code. But it won’t work; it keeps crashing and telling me: Now, this is my manifest file: This is my Ja…
I get many select @@session.tx_read_only, would one do the same?
I am using Python to insert value in a database through an API written by someone else in Java. The insertion goes quite slow, and when I look at the mysql log of the transcactions for one insert I see that it often does select @@session.tx_read_only: From http://docs.oracle.com/cd/E17952_01/refman-5.6-en/ser…
Ways to make maven build faster?
I have a multi module java project. Maven takes almost around 40 secs to build it. I have tried maven with multi threaded builds too by specifying -T and -C args for no of threads and cores to be used. But I haven’t seen any significant improvement in wall time of my builds. I am using maven 3.2.3 and s…
net.sf.jasperreports.engine.JRException: Invalid page index range : 0 – -1 of 0
When I try printing the Jasper report it gets me the message: “net.sf.jasperreports.engine.JRException: Invalid page index range : 0 – -1 of 0”. Code: Report: Could someone help me to figure out why is it happening? Answer JasperFillManager likes to get a data source, even when you don’…
How to add image along with title name for all pages in that project in one code in Struts 2
I wrote the mentioned code in head section of JSP page and it is able to display the image along with the title name of the page but what I want is it should be reflected on all my pages of project. So what should be done ? Note: Made a favicn.ico and environment is Java Struts 2 Answer Create
How do I convert [[Ljava.lang.String;@7defb4fb] to a String
I am trying to print the String, below is the code: but I get following output in the console: I have tried the following snippets: But all of these are giving similar strange output: How do I get the string value out of it? ** Edit: ** My problem was to print and array of an array in Java. First
How to enable CSS editing in Intellij
I just switched to IntelliJ IDEA because I thought it would be great for developing JavaFX application. I must be doing something wrong because when I am editing a CSS file, there is no code-completion. When I am trying to create a new CSS file there is no option for CSS files. I am using the community versio…