Hello
I am using RSA7 as IDE, I need to use profiler in my IDE for memory analysis.
Can any one suggest me
From where I can free download it?
How can I use it with RSA7?
Many Thanks
I have two mapped types, related many-to-many.
@Entity
@Table(name = "students")
public class Student{
...
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(
name = "students2courses",
joinColumns = { @JoinColumn(
name = "student_id",
referencedColumnName = "_id") },
inverseJoinColumns = { @JoinColumn(
name = "course_id",
referencedColumnName = "_id") })
public Set<Course> getCourses() {
return courses;
}
public void setCourses(Set<Course> courses) {
this.courses = courses;
}
...
}
__
@Entity
@Table(name = "courses")
public class Course{
...
@ManyToMany(fetch = FetchType.EAGER, mappedBy = "courses")
public Set<Student> getStudents() {
return students;
}
public void setStudents(Set<Student> students) {
this.students = students;
}
...
}
But if I update/delete Course entity, records are not created/deleted in table students2courses. (with Student entity updating/deleting goes as expected)
I wrote abstract class HibObject
public abstract class HibObject {
public String getRemoveMTMQuery() {
return null;
}
}
which is inherited by Student and Course.
In DAO I added this code (for delete() method):
String query = obj.getRemoveMTMQuery();
if (query != null) {
session.createSQLQuery(query).executeUpdate();
}
and I ovrerided method getRemoveMTMQuery() for Course
@Override
@Transient
public String getRemoveMTMQuery() {
return "delete from students2courses where course_id = " + id + ";";
}
Now it works but I think it's a bad code.
Is there a best way to solve this problem?
I am working with the sample Home application project on http://developer.android.com/resources/samples/Home/index.html
I've added another value to the THUMBS_IDS and IMAGE_IDS Integer arrays in the Wallpaper class for a total of four wallpaper options.
When I run the application with Device API version 7, Skin: HVGA, hw.lcd.density: 160, in portrait layout, the fourth wallpaper option is not shown.
I need to use the directional keys in the emulator to see the 4th wallpaper option, because the first option is centered.
I have modified only the wallpaper.xml file with a variety of android:layout_* options with no success at this point.
How do I show all four of my wallpaper options?
i have a gwt url and i am trying to get next page by clicking a button. that button is an image. but when we click that button i got blank page. that url is:
http://www.ichotelsgroup.com/redirect?brandCode=hi®ionCode=1&localeCode=en&path=asearch&errorURL=/h/d/6c/1/en/rates&successURL=/h/d/6c/1/en/rates/BOSGC&availabilitySearchSuccessURL=/h/d/6c/1/en/rates/BOSGC?ias=y&actionName=availabilitySearch&hotelCode=BOSGC&checkInDate=2&checkInMonthYear=62010&checkOutDate=6&checkOutMonthYear=62010&numberOfAdults=1&numberOfChildren=0&numberOfRooms=1&smokingPreference=3&secure=false&rateTypeCodes=6CBARC&rateChangePeriod=&_IATAno=99609020&cm_mmc=mdpr-_-kayak-_-USCSR-_-BOSGC
i am trying to click "view rates button"..
Here is a simple thread pattern that I use when writing a class that needs just one thread, and needs to a specific task.
The usual requirements for such a class are that it should be startable, stopable and restartable. Does anyone see any issues with this pattern that I use?
public class MyThread implements Runnable {
private boolean _exit = false;
private Thread _thread = null;
public void start () {
if (_thread == null) {
_thread = new Thread(this, "MyThread");
_thread.start();
}
}
public void run () {
while (_exit) {
//do something
}
}
public void stop () {
_exit = true;
if (_thread != null) {
_thread.interrupt();
_thread = null;
}
}
}
I am looking for comments around if I am missing something, or if there is a better way to write this.
Edited 7th June,14
My Android app needs to have a feature where clients can upload their files. I want AWS S3 as my storage. Moreover i dont want to use SECRET_KEY and ACCESS_KEY_ID on client side. What is the the best way to do this. Can someone provide the working code too ?
I read that i can request to AWS for a signed URL and then make client directly upload to that URL. How to achieve this ?
I am newer to ejb and hibernate and don't have any idea to how to link or connect those technologies mentioned above.
I have just created individual module for ejb, hibernate and servlet.
but I need to pass the data from servlet to ejb and then ejb to hibernate and store into MySql database.
Problem for me, how to connect ejb to hibernate.
I tried some ways and it couldn't work for me.
Please someone help me.
Thank you
I have the following model
@Entity
class Element {
@Id
int id;
@Version
int version;
@ManyToOne
Type type;
}
@Entity
class Type {
@Id
int id;
@Version
int version;
@OneToMany(mappedBy="type")
Collection<Element> elements;
@Basic(optional=false)
boolean disabled;
}
and would like to allow Type.disabled = true only if Type.elements is empty. Is there a way to do it atomically?
I would like to prevent an insertion of an Element in a transaction while the corresponding Type is being disabled by an other transaction.
OK so, is there an efficient way to detect on what array you're currently on by using the KeyListener?
My code: http://www.javadan.pastebin.com/X68VyuGL
What I am trying to do here is see if the current tile I am on is BLOCKED.
Thanks.
I've seen in applications a popup that prompts me what I do want to do with a text. I am prompted to choose from Send by SMS, Send by Email, Send by Bluetooth, Send by Fring etc.
How do I make such a popup, it seamed to be automatically built?
Also how do I tell what message to use?
And if needed how do I tell who the contact is? Maybe chooses the options based on the contact, (if has email, show email)
Quite new to maven here so let me explain first what I am trying to do:
We have certain JAR files which will not be added to the repo. This is because they are specific to Oracle ADF and are already placed on our application server. There is only 1 version to be used for all apps at anyone time. In order to compile though, we need to have these on the class path. There are a LOT of these JARS, so if we were to upgrade to a newer version of ADF, we would have to go into every application and redefine some pretty redundant dependencies. So again, my goal is to just add these JARs to the classpath, since we will control what version is actually used elsewhere.
So basically, I want to just add every JAR in a given directory to maven's classpath for when it compiles. And without putting any of these JAR files in a repository. And of course, these JARs are not to be packaged into any EAR/WAR.
I'm currently working on some code for my Programming Languages course. I can't post the code but I'm permitted to talk about some high level concepts that I'm struggling with and receive input on them. Basically the code is a recursive DFS on a undirected graph that I'm supposed to convert to a concurrent program. My professor already specified that I should create my threads in the recursive DFS method and then join them in another method. Basically, I'm having trouble thinking of how I should keep track of the threads I'm creating so I can join all of them in the other method. I'm thinking an array of Threads but I'm unsure how to add each new thread to the array or even if that's the right direction.
My code tries to replace "," with "/" in a string. Should I escape "," in the regex string? Both of the two code snippets generated the same results, so I am confused.
Code snippet 1:
String test = "a,bc,def";
System.out.println(test.replaceAll("\\,", "/"));
Code snippet 2:
String test = "a,bc,def";
System.out.println(test.replaceAll(",", "/"));
Should I use "," or "\,"? Which is safer?
Thanks.
Hi.
In my Struts form I've got a list. In a JSP I iterate over it like this:
<c:forEach items="${MyForm.auspraegungen}" var="auspraegung">
<tr>
<td>${auspraegung.name}</td>
<td>${auspraegung.forced}</td>
<td>${auspraegung.cbx_uebernehmen}</td>
<html:checkbox property="auspraegung.cbx_uebernehmen" />
</tr>
</c:forEach>
Now the <html:checkbox isn't working. I'm always getting the following error:
Caused by: javax.servlet.jsp.JspException: No getter method for property auspraegung.cbx_uebernehmen of bean org.apache.struts.taglib.html.BEAN
But actually there is a getter for this property in my form class. It's written like this:
public Boolean getCbx_uebernehmen() {
return cbx_uebernehmen;
}
When I remove the checkbox it's also possible to display the property as in the <td>-tag above so I don't know where the problem is.
Maybe I'm accessing it in the wrong way?
Class<? extends Algorithm> alg = AlgorithmAllFrom9AndLastFrom10Impl.class
Constructor<Algorithm> c = alg.getConstructors()[0];
For "alg.getConstructors()[0];" I am getting a warning in eclipse
Type safety: The expression of type
Constructor needs unchecked conversion
to conform to Constructor
How do I fix this?
Hi!
Scenario:
I have some @Statefull bean for user session (not an http session, it is web services session). And I need to manage user`s session per user.
Goal:
I need to have possibility to get collection of @Statefull UserSession`s instances and control maximum number of session`s per user, and session`s life time.
Q: Is it possible to get Collection of ejb`s instances from ejb container, instead of storing them in some collection, map etc. ?
I am using glassfish v3 , ejb 3.1, jax-ws.
Thank You!
Hello All,
I'm using Apache Commons VFS / SFTP, we are trying to download files from the IBM MVS system.
The download part is all good, however, we can not open up the zipped files after downloading. Seems like the zip file was compressed using a different algorithm or something
Anyone has any pointers?
*Note, the same function works fine if we connect to a regular unix/linux SFTP server.
Below is an example of what we did
String defaultHost = "[my sftp ip address]";
String host = defaultHost;
String defaultRemotePath = "//__root.dir1.dir2.";
String remotePath = defaultRemotePath;
String user = "test";
String password = "test";
String remoteFileName = "Blah.ZIP.BLAH";
log.info("FtpPojo() begin instantiation");
FileObject localFileObject = fsManager.resolveFile("C:/Work/Blah.ZIP.BLAH");
log.debug("local file name is :"+localFileObject.getName().getBaseName());
log.debug("FtpPojo() instantiated and fsManager created");
String uri = createSftpUri(host, user, password) + ":322"+remotePath+remoteFileName;
remoteRepo = fsManager.resolveFile(uri, fsOptions);
remoteRepo.copyFrom(localFileObject, Selectors.SELECT_ALL);
I want to create a LinkedHashMap which will limit its size based on available memory (ie. when freeMemory + (maxMemory - allocatedMemory) gets below a certain threshold). This will be used as a form of cache, probably using "least recently used" as a caching strategy.
My concern though is that allocatedMemory also includes (I assume) un-garbage collected data, and thus will over-estimate the amount of used memory. I'm concerned about the unintended consequences this might have.
For example, the LinkedHashMap may keep deleting items because it thinks there isn't enough free memory, but the free memory doesn't increase because these deleted items aren't being garbage collected immediately.
Does anyone have any experience with this type of thing? Is my concern warranted? If so, can anyone suggest a good approach?
I should add that I also want to be able to "lock" the cache, basically saying "ok, from now on don't delete anything because of memory usage issues".
I wish to test the new features that will came with the next JDK like project coin, project lambda etc. but the last JDK 7 to download will not have any already implemented!
From which build can I test them?
I think it's incredible that, now in may 2010 at few months to the official final release (november 2010????) for we developers there is no possibility to test any of this features!!
Hi All,
We are storing sound from mic to pc via sound forge.
We would like to broadcast the sound which comes from the mic to the pc as live streaming audio.
Basically a person speaks in a mic, we like to give it as live stream audio.
The web-site is hosted on yahoo server.
Can you please let me know in what are the ways we can achieve this?
Thanks,
Kathir
I'm trying to generate top-level abstract class with JCodeModel library, but I can't find any way to change class modifiers.
It's possible for nested classes (JDefinedClass API provides methods that get modifiers as parameters). But for creation of top level classes I found only JCodeModel API methods that get fully qualified name with or without ClassType (class/interface/annotation/enum) as parameters.
Does anybody can suggest me how to change modifiers of JDefinedClass to make it abstract?
As from subject, I have an awt.List object. When I add something to the list I would like to scroll it down to show the last inserted object.
For instance:
myList.add("sometext");
myList.select(myList.getItemCount()-1);
myList.showSelectedItem(); // Or something like that
The documentation does not seem to list any method that does something like that, can anybody help please?