Dinesh Remje

Ranch Hand
+ Follow
since Jan 26, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dinesh Remje

I am trying to push notification using gcm from my java code to the android app. Following is my code which i have done.



When I run this code I am getting the response as follows


But on the application I am not able to get any notification. What could be the problem.
8 years ago
I changed my code to somewhat like this

But now it gives me some another error which is as follows


I am not able to understand why it giving me an error for the QuestionBank in Exam.java file for which the code is
[code=java][
@ManyToMany(cascade = { CascadeType.ALL })
@JoinTable(name = "QuestionBank_Exam_Mapping", joinColumns = { @JoinColumn(name = "examid")},
inverseJoinColumns = { @JoinColumn(name = "questionid") })
private Set<QuestionBank> questionBank = new HashSet<QuestionBank>();
/code]

I want to create just exam entry by giving an userinteface to the user where he will enter some required parameters like exam name, exam date, exam duration etc. There is a another dependency where again i have to make an entry for the exam created by using the examid in advt_exam_post table mapping. I have advtid and postid in session, so i can make an entry in that table. My confusion is why it is showing me error for the questionbank. In questionbank and exam table mapping there is dependency with the examid and questionid, which will be filled only when the user selects a particular question for a particular exam. Currently I am fetching the Questions form the QuestionBank table and using it in the controller for creating exam but still it gives me the same error.
I am new to Hibernate and while searching on the net i came to know some method for inserting into database.
I used those method in my code, but now I am facing a new problem that is my session comes as null and hence my program throws an exception before saving the object

Now exception is thrown on the getSessionFactory().openSession(); it comes as null.
the exception thrown is as follows:

Please let me know the solution for it. Wasted a load amount of time in debugging this . Please guide me.
No, i don't want to use two hashmap at a time it is not that worth....

Yup my list is extremely small, but at this point of time, my application is basically does a lot of searching in the arraylist, once storing the values in the arraylist is done.

Will Comparator inteface will help in searching the arraylist, by overriding the compare method.
11 years ago
I dont want to use for loop as the size of the arraylist can increase in future. Also if the string which i want to search is present at last in the arraylist, then i have to traverse the whole arraylist, each time when i want to search the same string and hence i don't like for loop.

Also i have used linkedhashmap and it worked also, but sometime i want to search for the name with the help id and at that time i need to make id as the key and sometimes i want to search the id with the help of name i need to make string as the key and thats where i need to create two linked hashmap and hence i dropped it. And hence i stick to the use of an arraylist. Can you please let me know how to use the arraylist for searching.
11 years ago
Can anyone let me know that how can i search for a particular string in object ArrayList.
I have an ArrayList in which i store stateid and statename.
Now i want to get the stateid by searching for the statename in the arraylist. I dont want to use a for loop.
I came to know about the comparator inteface, but can anyone let me know about how can i use it for searching.
11 years ago


Now the above drawline i have written in paint method. Now i want to draw these lines using some delay(i mean i want to show some animation). Can anyone give me some examples of drawing lines using some delay or guide me to how to do it.
12 years ago
Thank you guys i was able to do it with the help of string buffer and then writing it all at once at last.


Thanks
Dinesh
12 years ago
@santosh: thanks for the reply, i was able to do it, but i did it in the other way round i.e


But now my problem is each and every time it is creating the file instance and hence it is retaining only the last record from the database, so what could be done in order to retain all the 10 ID's.

As mentioned by Rob Spoor i tried it by creating the file out of the while loop but it doesn't help.



Dinesh
12 years ago
@Rob Spoor: Ok i got that why i was able to write only single character on the file. But can you tell me why i am not able to write the value of "i" on the file. Instead it is writing some symbol on the file which is like this "ኸ".
12 years ago
@santosh: I am not getting any exceptions. I am able to write on the file, but the only thing is that instead of the particular ID it prints some symbol in the file.
12 years ago
As i got this topic, i am posting my question in the same topic.

I am able to retrieve the records from the database but i am not able to write it to the text file, so what could be the reason.
I am posting my code as follows:

12 years ago
Actually i want to update a particular column named "status" whose default value is "enrolled".
Now there are 3 buttons that i have provide namely "confirmed", "waiting" and "enrolled".
Now after clicking the particular button i want to update the column named status to the particular button clicked i.e suppose i click on confirmed button then status should be changed to confirmed for a particular row and colum.
Now my question is how can i do this without migrating to another page or refreshing the page.
Also the values displayed in table are from database and i am able to update those value easily by connecting it to database but how can i change the particular row and column value without refreshing the page or migrating to another page. Can anybody can give me small example to show how can i achieve it.
Thanks in advance.
Hello Timothy Schmelter,

Thanks for your reply. I will note down your suggestions and will try to improvise my code. But any other notifications can you mention inorder to retain the radio button selected values.
12 years ago
JSP


The above code i have written for a radio button menu.
Now when i refresh the page the "BE/B.Tech" value gets selected. But i want to retain the values selected different than "BE/B.Tech" so how can i retain the values selected even after the page is refreshed.
What should be done in this case. I know since i have done checked on "BE/B.Tech" value it is always selected even after the page is refreshed.
Thanks in advance.
12 years ago
JSP