Hi,
I want to use IntelliJ's find-and-replace feature to perform the following transformation:
// Replace this
model.put('foo', 'bar')
// With this
model['foo'] = bar
I've tried the following:
Text to find: model.put\((.*),(.*)\)
Replace with: model\[\\1\] = \\2
But Intellij doesn't seem to recognise \\1 and \\2 as backreferences. ...
I generated 100 random numbers from 0-9, i am supposed to count how many times each number appears. Storing it in an array of 10 integers and count it.
heres what i have so far, i cant figure out the count part
Random r = new Random();
int[] integers = new int[100];
for (int i=0; i<integers.length; i++)
{
integers[i] = (r...
I've got it working when I get the wsdl based on configuration, but I'd like to just tell it to use a specific address for the service call and use a local copy of the wsdl.
MyWebService serviceDefinition = new MyWebService(new URL(wsdlLocation));
service = serviceDefinition.getMyWebServicePort();
Does anyone know the best practice fo...
Hi there,
If you were to create a checklist of things you needed to do before you deploy a typical jee webapp that makes use of servlets, ejbs, o/r mapping, relational databases, etc what would be on it? Like any sort of time out properties and settings, pool sizes, jndi related properties, etc. that are crucial at production deployment...
Heya guys,
I'm in desperate need of help.
I have a Java servlet that is accessed by a HTTP Get URL with eight parameters in it.
The problem is that the parameters are not exclusive to English.
Any other language can be in those parameters, like Hebrew, for example.
Now, when I send the data - either from the class that is supposed to...
I am looking to right an application that limits the number of times a user can print something, its there anything in Java that will allow me to control the printing dialogue to this aim?
Im going to look into these:
http://www.wildcrest.com/Software/J2PrinterWorks/documentation/J2Printer14.html
http://www.softframeworks.com/products/...
hello, in java it is possible to give an enum a constructor as well as member variables and functions.
i was wondering if something like this is possible in c# enums as well. if so, how?
thanks a lot!
...
What are the best practices and patterns to be followed for designing APIs?
How to achieve implementation hiding the best way (C++/Java)?
Designing APIs which are generic in nature?
Any reference books/links which guide with neat examples to beginners?
...
Hi
I have a little java+swing app. Until now it worked OK, on OS X and on windows.
But recenly a user has noticed that on his OS X (version unknown yet, nor the java version) that all texts in the GUI are shifted up and cut (as you can see on the screenshot).
And HTML link is shifted down and cut. All those elements are JLabels.
Th...
String contains a bunch of useful methods such as String.replace(CharSequence, CharSequence) that are completely missing from StringBuilder. Is there a reason why?
Is there an easy way to implement these methods without the huge overhead of invoking StringBuilder.toString() which copies the string every time?
...
Hi,
We are using dom4j 1.6.1, to parse XML comming from somewhere. Sometime, the balise have mention of the namespace ( eg : ) and sometime not ( ). And it's make call of Element.selectSingleNode(String s ) fails.
For now we have 3 solutions, and we are not happy with them
1 - Remove all namespace occurence before doing anything wi...
A friend raised this on Twitter: @name_removed doesn't understand why binding generators seem to think writing pages of XML is vastly superior to writing pages of C++...
Having never encountered binding generators before, I decided to look them up. Seems pretty self-explanatory, convert C++ classes to XML format. But now I need someone ...
I have the following code
private Map<KEY, Object> values = new HashMap<KEY, Object>();
public void set(KEY key, Object value) {
values.put(key, value);
}
private Object getObj(KEY key) {
return values.get(key) == null ? key.getDefaultValue() : values.get(key);
}
public List<E> getList(KEY key) {
return (List<E>) getObj(key);
}
...
Hi
I need to know what kind of Java Smart Card to buy and where I can get some from? What are the factors i should consider while choosing a card / vendor? Thanks
...
Hello
I generate Java classes from my XSD schema file using XJC command line tool. The ObjectFactory class generates incomplete content. It generates creation methods without JAXBElement<Type> createType decoration.
What may be the reason of this?
Regards
Dominik
...
Hi!
I just discovered an algorithm for finding the power set. I googled after solutions, but found none that worked any good, so I figured out one myself. But I wonder what algorithm it is, because I cannot find it on the net or in any books. I mean, does it have a name? I hardly think I'm the inventor of it. But compared to the algorit...
I got into an interesting discussion in a forum where we discussed the naming of variables.
Conventions aside, I noticed that it is legal for a variable to have the name of a Unicode character, for example the following is legal:
int \u1234;
However, if I for example gave it the name #, it produces an error. According to Sun's tutori...
Code is below:
MimeMessage mail = new MimeMessage(session);
mail.setFrom(from);
MimeMultipart multipart = new MimeMultipart("related");
MimeBodyPart htmlPart = new MimeBodyPart();
htmlPart.setContent(bodyText, "text/html");
multipart.addBodyPart(htmlPart);
MimeBodyPart imgPart=new MimeBodyPart();
String path = "/ivr/imagelogos/accentu...
I'm currently using Jung to draw graphs (I really mean graphs not charts!).
The problem:
Vertex and Edge Labels are overlapping with the Vertexes and the Edges. This leads into strange looking graphs:
the "produces" label is overlapping with the vertex and the "60" edge-label is also overlapping with the vertex.
Are there any possib...
I am using Apache Commons HttpClient 3.1, and I found that HttpURLConnection from Sun drops the 100 Continues from the stream.
So therefore I don't seem able to get the 100 Continue as they are apparently dropped by Sun's code.
I am unable to move forward to HttpClient 4.0 as that would require many changes to already existing code so ...