Kyupa Supa

Ranch Hand
+ Follow
since Jun 23, 2012
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
10
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kyupa Supa

A list of courses is displayed and user has to select 1, so I used radio buttons. The course list vary from one student to another.

If I have more than 1 courses displayed and user selects one, everything is ok, but if I display 1 course, the test is JavaScript seems to not be right...

Validate if radio button(a course) was checked:



If I have 1 course, ok = 1 (due to textbox(es) only, ignoring the selected course). ok = 2 so the form will be submitted
I have a

Enter URL:
in my form and I want in JSP to become a clickable URL.

I tried with:
11 years ago
JSP
Hi

I have to upload a text file in a HTML form and then insert the file into a SQL table.
I also must be able do download the file chosen by user from those in the table.
(I'm using JSP)

Could you give me some good resources for beginners in files?

Thank you
11 years ago
JSP
I did as so now and it works Thank you

11 years ago
I want to restrict the user from entering duplicate assignments into DB, actually in the bridge table.

I have 2 tables: professors and courses an a bridge table containing prof_id and course_id as FKs.
In a jsp file user assigns professors to courses: 1 prof. to 1 or many courses.

I have:


In my method I receive and pname(professor's name) as parameters from the form in the JSP file

Knowing pname's id, the FK, I want to insert now into DB but to make sure user didn't choose 1 or more courses that the professor is already assigned to.

then I


where pname is a String(professor name), titles is a String Array(titles[] containing the courses I have to assign)

I tried with Set, Collections but I managed to enter the current courses+ again the already assigned courses
I also read about OUTER JOINS because I thought it might help.
I would kindly ask a reasonable way to solve it because I am intermediate...

Thank you.
11 years ago

Dennis Deems wrote:What you want to do is add all the elements of courses to cCourses, then call removeAll(result) on cCourses. The boolean returned by removeAll indicates whether cCourses has changed. It should be true since two elements have been removed.



Works so cool Thank you very much

Campbell Ritchie ,sorry that is too advanced for me now. Thank you for yout time though!
11 years ago
I want to store that complement in an ArrayList called "cCourses" :

This is returning a boolean.

When the cCourses will contain the complement of "result" I will return cCourses ;

My method is:

11 years ago
I have result with and courses with

I want to obtain the complement of result:

I tried with

And http://code.hammerpig.com/find-the-difference-between-two-lists-in-java.html

It says it can't apply for Strings.
11 years ago
I found out how:

String sqlQuery =

I forgot to take into account that user chooses a professor name, I look for he's ID and then I use this Query.

Thank you for your time
Sounds nice fore me

All I know, that my trainer told me, is when you make a website for someone make sure you notice if the person is introvert or extrovert. An introverted will appreciate a website that has smaller icons/pictures, thin text,...; An extrovert would choose a website which has big pictures, colors that are strong, more bold text,... I think you get the idea.

11 years ago
rcoin = x;
for(i = 1; i<=n; i++)
if(coin[i]==x)
found=coin[i]; // found = x


11 years ago
I have 2 tables:
professors(professor_id INT PK, name VARCHAR), courses(course_id INT PK, title).
I also have a bridge table: professors_courses(prof_id INT FK, course_id INT FK).

I still didn't find a query for something like this:
given the professor name, "x"

Using the bridge table, find all the courses for professor X.

**professors**
prof_id | name
1 John

**professors_courses**
prof_id | course_id
1 2
1 3
1 5
2 1

**courses**
course_id | title
1 English
2 French
3 Italian
4 Japanese
5 Polish

Given the name "John", seems he has the following courses: French,Italian,Polish
I was told by teacher to use Lists now. Not Array, as I chose, because I'll need not a fixed length
11 years ago
You can get cell value with JS even when click on the cell:



I wrote the HTML table in JSP.
**Course** is is a type. For example Course cs, cs= object of type Course which had 2 attributes: id, title.
**courses** is an ArrayList of Course objects.

The HTML table displays all the courses titles in each cell. So the table has 1 column only:
Course1
Course2
Course3
......
Taking aside:



This means that after user selects a table cell, for example "Course2", the title of the course- "Course2" will travel to the page where the URL is directing the user: . "Course2" will arrive in FoundS.jsp page. The identifier of "Course2" is courseId. To declare the variable courseId, in which CourseX will be kept, you put a "?" after the URL and next to it the identifier.
It works.
Oops... SORRYYY, I modified a line of code AFTER I mentioned the exception here and now I don't have exception anymore, but it displays:

null
null
null

3 times,

instead of:

French
Spanish

They are actually just 2 courses.

11 years ago