java

Felix/OSGi: How to use SCR components that are not OSGi services?

Apache Felix's SCR allows to declare (via annotations or XML) components that will then be instantiated, hooked up to their dependencies, and registered as OSGi services. It is also possible to skip the service registration part, and just have SCR create the component (by specifying @scr.component, but omitting @scr.service). I was thin...

Find an Image within an Image

I am looking for the best way to detect an image within another image. I have a small image and would like to find the location that it appears within a larger image - which will actually be screen captures. Conceptually, it is like a 'Where's Waldo?' sort of search in the larger image. Are there any efficient/quick ways to accomplis...

What are the differences between LLVM and java?

I dont understand the difference between LLVM and the java (bytecode), what are they? -edit- by 'what are they' i mean the differences between LLVM and java (bytecode) not what are LLVM and java. ...

Split Java String by New Line

I'm trying to split text in a JTextArea using a regex to split the String by \n However, this does not work and I also tried by \r\n|\r|n and many other combination of regexes. Code: public void insertUpdate(DocumentEvent e) { String split[], docStr = null; Document textAreaDoc = (Document)e.getDocument(); try { doc...

Difference between "int[] myArray" and "int myArray[]" in Java

Possible Duplicate: Difference between int[] array and int array[] I've wondered for a long time whether or not there is a difference between the following: int[] myArray; and, int myArray[]; ...

What interfaces are programmable in the Nokia N73?

I have a Nokia N73 and I'd like to program it to interface with external hardware using any available interface. (POP Port?) Using any of the available platforms: Open C++ Symbian C++ Java Flash Lite Python ...

Where can I get started learning about Rule Engines?

I'm currently designing a Java application where a Rule engine could be useful. Where is a good place I can learn about how to use them, how they work, how to implement them, see samples, etc.? ...

Eclipse editor plugin: "ERROR" when opening file outside project

I'm developing an editor plugin for eclipse. It works fine on files within eclipse projects, but when an external file is opened via the "File -> Open File" menu (which works file with, e.g. Java files), I get a page displaying nothing but a horizontal blue line and the word "ERROR". The Error Log of eclipse is empty, as is the log file ...

Get Raw XML from java web service call in .NET

Hi, I am calling a Java web service using a .NET client, the return message is badly formatted since the deserialzation process throws an exception. Is there a way to view the raw xml data being returned by the web service in the .NET Client. Many thanks ...

Programming Problem - Fax Compression

I'm preparing to go to a computer science contest by completing problems from past contests. Most of them are pretty easy, but this one is bugging me...it seems simple but I'm just not being able to do it. If you have a string of ones and zeros: 100111010001111100101010 What would be the code to take that as an input and then output ...

Samples from Xpand -

Can i get some good tutorials on XPand.. i need to get info on commands like LET. It would better if some one could post some samples on it. The problem i am facing is like.. i run a "for" loop and after checking some condition i need to increment a counter . but i am unable to do so. when i increment the counter, it gets printed to the...

Pointcut not working with Spring AOP

In order to implement Logging using Spring AOP I followed these simple steps. But it seems like its not working. Any help would be useful 1) Created MyLoggingAspect class import org.aspectj.lang.ProceedingJoinPoint; public class MyLoggingAspect { public MyLoggingAspect() { super(); System.out.println("Instantiated M...

How to setup Connectivity between the web component and java app

I am confused about the approach for application that am writing. I have developed the application jar and will be distributing via java webstart. Now i need to putup a website supporting my app. doubts i have 1)Can i pass this username and password to the jar that i will be launching? 2)Can the webcomponent calculate the time for w...

What is the best way to read a text file two lines at a time in Java?

BufferedReader in; String line; while ((line = in.readLine() != null) { processor.doStuffWith(line); } This is how I would process a file line-by-line. In this case, however, I want to send two lines of text to the processor in every iteration. (The text file I'm processing essentially stores one record on two lines, so I'm sendin...

JTextArea - very small size with long text

I'm using a JTextArea to display a long text JTextArea _definition = new JTextArea(5, 50); with word-wrap _definition.setLineWrap(true); _definition.setWrapStyleWord(true); embedded in a JScrollPane add(new JScrollPane(_definition), gbc); All that is part of a JPanel with the GridBagLayout. Everything is working fine with short...

Displaying fancy equations with Java

I'm working on a Java applet that needs to display "fancy" equations. Is there any Java renderer for MathML or LaTeX that's open source? Ideally it would be a pure Java solution that doesn't use JNI. Ideally it would also allow to animate the generated glyphs (e.g. animating adding a constant to both sides of a equation, lines going thr...

How to find intersecting periods in a huge list of periods?

I need an idea for an efficient index/search algorithm or datastructure for a particular problem. So far I could not come up with something fast and elegant... Consider a huge collection of objects with every object having a date period (start / end). Huge as in a few million elements. The element periods can be large or small, they can...

Are there compelling reasons not to use Groovy?

I'm developing a LoB application in Java after a long absence from the platform (having spent the last 8 years or so entrenched in Fortran, C, a smidgin of C++ and latterly .Net). Java, the language, is not much changed from how I remember it. I like it's strengths and I can work around its weaknesses - the platform has grown and decidi...

Suggestions for Java email templating?

we have an application that needs to send out various different types of template email. The current code is very cumbersome and not very flexible. Does any one konw of a library to help with this type of work... We are looking for some kind of templating library for email. ...

run periodic tasks on server in the background

What's the best/easiest way to run periodic tasks (like a daemon thread) on a tomcat/jetty server? How do I start the thread? Is there a simple mechanism or is this a bad idea at all? ...