Hi
I want to know that can two different jvm run in the same machine?
I also want to know more about jvm working.Can any one provide some useful links.
Thanks
Hey Guys
I want to set two different look and fields on one frame.
I have two different panels in that.
i want to set two different look and field for both.
Can I do that?
And if yes then how?
Currently anybody can access the solr admin page by going to my_ip:8983/solr
I can't have it like that, so how can I make it prompt for password or something?
I have setup my servers apache2.conf file to prompt for password whenever my site is accessed by www.mydomain.com.
But when using another port, the "require password" wont show up.
Any ideas how to secure this?
Don't point me to the SolrSecurity wiki because it's simply too outdated. I have tried it without luck.
Thanks
hello everyone,
Can anyone please tell the way to find out the mac address of a system which is:
1. Shutdown
2. Power plugged in
3. Connected to Lan
4. Nic card ON.
Kindly post the solution as i urgently need it in my project...
thank you
I am currently stuck with a homework assignment, question below;
Define a default constructor for Deck that initialises the deck field with an array of size 0.
Also define a constructor that takes an integer parameter and initialises the deck field with an array of that size. The constructor should also initialise every element with a new random MovieCard. The cards should be uniquely named.
so far my code is
public class Deck {
MovieCard[] deck = new MovieCard[] {};
public Deck() {
MovieCard deck[];
}
public Deck(int size) {
MovieCard deck = new MovieCard[];
}
}
Obviously this is incomplete by I can't find any references in my previous notes about referring a parameter into an array and setting this as the length.
Hello eveyone,
i using elastic in my script.
I have also jQuery Tabs (every will be get over AJAX and content a textarea) and a timer for Saving content all 3 minutes. So some JS code...
I have 2 parts on my site, left and right. On the right side i have 2 tabs (jQuery not AJAX) with each one textarea. And Left side between 5-10 Textareas each in Tab but they gonna be loaded only if Tab is activ (AJAX).
my Problem is:
If i paste a lot of text in a Textarea (1000 characters) the writing get slowed, not fluid, jerky.
It ist 100% the elastic problem, without elastic there no Problem while writing.
Have some one an idea for the solution of this Porblem? Is it Overload?
This seems like a simple request, but google is not my friend because "partition" scores a bunch of hits in database and filesystem space.
I need to enumerate all partitions of an array of N values (N is constant) into k sub-arrays. The sub-arrays are just that - a starting index and ending index. The overall order of the original array will be preserved.
For example, with N=4 and k=2:
[ | a b c d ] (0, 4)
[ a | b c d ] (1, 3)
[ a b | c d ] (2, 2)
[ a b c | d ] (3, 1)
[ a b c d | ] (4, 0)
I'm pretty sure this isn't an original problem (and no, it's not homework), but I'd like to do it for every k <= N, and it'd be great if the later passes (as k grows) took advantage of earlier results.
If you've got a link, please share.
I have a certain value of date and time say 28-3-2012(date) - 10:36:45(time) . I wish to convert this whole timestamp to nanoseconds with the precision of nanoseconds. As in the user would input the time and date as shown but internally i have to be accurate upto nanoseconds and convert the whole thing to nanoseconds to form a unique key assigned to a specific object created at that particular time.
Could some one please help me with the same..
I'm trying to get the resultCode to be OK inside my onActivityResult function. However, it keeps coming back as 0. I have spent several days on this, and can't figure out why it doesn't work. Here's my code. If anybody can help me, I'll be very grateful, Thanks.
My Activity1 class:
private class MyTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
// process
return result;
}
@Override
protected void onPostExecute(String result) {
Intent i = new Intent(Activity1.this, Activity2.class);
i.putExtra("Value1", "This value one for ActivityOne ");
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivityForResult(i, REQUEST_CODE);
textView.setText(result);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK && requestCode == REQUEST_CODE) {
// do something
}
}
My Activity 2 class:
@Override
public void finish() {
Intent data = new Intent();
data.putExtra("returnKey1", "return 1");
setResult(RESULT_OK, data);
super.finish();
}
My manifest:
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Activity1"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activity2"
android:label="@string/app_dialog_name"
android:launchMode="singleTop"
android:excludeFromRecents="true"
android:taskAffinity=""
android:theme="@android:style/Theme.Dialog">
</activity>
</application>
Lets say I have a class A that is fairly simple like this -
public class A{
private int randomField = 0;
protected int key;
protected double dmg;
}
Now I want to write a number of sub-classes that inherit the protected fields and only differ based on the initial values that are assigned to those fields - for example, if I wrote two subclasses B and C, the only difference between those two sub-classes would be that the values key and dmg would have different values. They would share a method, set, which would be exactly the same, in that it would affect the same variable.
I find when I'm writing these sub-classes I'm repeating myself, as I just change the constructor to set different initial values to key and dmg, and simply copy and paste the set method.
Is there a 'good' way to do this?
I have a program where i have a button to change the background color to red and another button to set back the default panel color.
How do i get back the default color for panel??
Which one of the following is NOT a pitfall of inheritance?
Base-derive classes should be totally separate and do not have an is-a relationship.
Base-derive classes should have been aggregate classes instead.
Inheritance may be inverted, example: Truck<-Vehicle should be Vehicle<-Truck.
Incompatible class hierarchies may be connected because of multiple inheritance.
Aggregation should have been used instead.
Functionality is transferred from a base class to a derived one.
In my opinion, NOT a pitfall of inheritance meas can use inheritance.
1 seems do without inheritance
2 aggregate substitute Base-derive I don't know
So, I think 5 is the answer.
Ok, a friend of mine go back and forth on what "interface" means in programming.
What is the best description of an "interface".
To me an interface is a blueprint of a class, is this the best definition?
I know add() adds the specified (signed) amount of time to the given time field, based on the calendar's rules.
And roll() adds the specified (signed) single unit of time on the given time field without changing larger fields.
I can't think of an everyday usage of roll() I would do everything by add().
Can you help me out with examples when do we use roll() and when add()?
public class Node{
Node p,l,r;
int height;
String s;
{
/** class body**/
}
}
String[] S=new String[5000];
int i=0;
while (i<5000){
Node x=new Node();
x=S[i];
}
I want to make 5000 Node object.
above code assign same variable name x every time but i want different variable name .
then how to declare 5000 class variable name without declaring it manually.
is there something by which i can create 5000 Node class object with ease.
Using an oracle database, I need to perform a check to see if a user in my 'users' table is banned or not. The user is banned if his column 'banned' has a value of '1', '0' if he is not.
I have the following working code here:
public boolean banUser(String username)
{//TODO check if user is banned already
try
{
pstmnt = conn.prepareStatement("UPDATE users SET banned = 1 WHERE username = ?");
pstmnt.setString(1, username);
pstmnt.execute();
logger.info("Banned User : " + username);
return true;
} catch ( SQLException e ) { e.getMessage(); }
return false;
}
I'm not sure how to perform an if statement on top of a prepared statement. Any ideas?
Maps collection is referred to an dictionary because of the way it works.
Each entry into a maps collection involves a pair of objects.
In a maps collection, an object associates the key which determines where the object is stored in the map.
The key object in the maps collection can be duplicated.
A stack which has Last In First Out storage mechanism can be considered as a maps collection.
I think #1,#2,#3 and #5 are Correct in above, but I have doubt with #5. Am I correct?
I set an request attribute in my action class as follows:
request.setAttribute("xFg",Boolean.TRUE);
I want to retrive this in my JSP. I want to retrive them using JSTL tags. I tried this :
<c:if test="${requestScope.xFg}">
<c:set var="showlist" value="true" />
</c:if>
But c:if didnt work, i mean it didnt goto c:set
I tried to print the sameusing c:out but nothing got displayed. What is wrong or How should i test request attribute value. I havent used requestScope so far. Is requestScope the option to get the request value? pls help.Thanks in advance.
Am having some arguments say (String a, Treeset b, Set c)
and i try to get the class by arguments[i].getClass(); of the above arguments..
is it possible to get the class of the interface .
ex.,
Class[] argumentTypes = new Class [arguments.length];
for (int i = 0 ; i < arguments.length ; i++)
{
argumentTypes[i] = arguments[i].getClass();
}