Hi, I tried to change the form action based on selection option and hoping that my javascript validation function working properly too... I found out one solution and hoping this javascript can do that kind of thing. I tried so many ways and I think there's something wrong with my function since my validation function not working and also the form action. I hope you guys can give some advise on my code. So here's my code for your references : [JAVASCRIPT] function validate(myForm) { with(myForm) { .................... }; return true; }; function onSelectedOption(sel) { if ((sel.selectedIndex) == 3) { …

Member Avatar
Member Avatar
+0 forum 4

Here is the code for [B][COLOR="Red"]Insertion Sort, Bubble Sort and Selection Sort[/COLOR][/B] [B]Insertion Sort[/B] [CODE] #include <stdio.h> main() { int i,j,key; int a[5]={5,2,3,4,1}; for(i=1;i<5;i++) { key=a[i]; while(i>0 && a[i-1]>key) { j=a[i]; a[i]=a[i-1]; a[i-1]=j; --i; } } int k; for(k=0;k<5;k++) {printf("%d ", a[k]);} printf("\n"); } [/CODE] [B]Bubble Sort[/B] [CODE] #include <stdio.h> main() { int i,j,x; int a[5]={5,2,3,4,1}; for(i=0;i<5;i++) { for(j=i+1;j<5;j++) { if(a[i]>a[j]) { x=a[i]; a[i]=a[j]; a[j]=x; } } } int k; for(k=0;k<5;k++) {printf("%d ",a[k]);} printf("\n"); }[/CODE] [B]Selection Sort[/B] [CODE] #include <stdio.h> main() { int i,j,x,min,k; int a[5]={5,3,2,4,1}; for(i=0;i<5;i++) { min=i; for(j=i+1;j<5;j++) { if(a[min]>a[j]) { min=j; } x=a[min]; a[min]=a[j]; a[j]=x; } } …

Member Avatar
Member Avatar
+0 forum 18

I'm new at C++ ..and I dont know what should I do whith my program ... this program's input for exg. is: 5 mary sara kimi lili olive : : and then sorting them .. but my problem is that when I submit my home work they score me "0" and Icant find out why..! #include <iostream> #include <string.h> #define MAXNAMES 100 using namespace std; int compare(string s1, string s2){ int i; for ( i = 0; s1[i] && s2[i]; ++i) { /* If characters are same or inverting the 6th bit makes them same */ if (s1[i] == s2[i] …

Member Avatar
Member Avatar
+0 forum 2

I'm new to mobile development. I'm using html5,php,cordova,phonegap for the development of mobile application. I have done everything which i need.But i need to populate the dropdowns dynamically based on the previous dropdown selection. i.e., Based on the state the cities to be populated and based on the cities the locations need to be populated. Please help me out how to solve this problem. Thanks in Advance.

Member Avatar
Member Avatar
+0 forum 1

could anyone tell me how to dynamically select an item in a listview?? i tried `listview.setSelection(1);` and `listview.performItemClick(listview,3,listview.getItemIdAtPosition(3));` both of them don't work..please help me.

Member Avatar
Member Avatar
+0 forum 1

i need to create 2 selection; 1st selection has fix option and the second selection will be base on the selected selection 1 selection 1 option 1 = number option 2 = letter option 3 = char number option 1 = 1 option 2 = 2 option 3 = 3 letter option 1 = abc option 2 = def char option 1 = ! option 2 = @ option 3 = #

Member Avatar
Member Avatar
+0 forum 2

I'm supposed to create a program to sort a names.dat file. It compiles but nothing is displayed. names.dat Collins, Bill Smith, Bart Michalski, Mel Griffin, Jim Sanchez, Manny Rubin, Sarah Taylor, Tyrone Johnson, Jill Adams, Andrew Moreno, Juan Wolfe, Bill Whitman, Jean Moretti, Bella Wu, Jeff Patel, Renee Harrison, Rose Smith, Cathy Conroy, Patrick Kelly, Sean Holland, Beth #include<iostream> #include<fstream> #include<cctype> using namespace std; void read_names(string names[],ifstream& infile,int& index); void selection_sort(string names[],int size); void print_names(string names[],int size); int main() { ifstream infile("names.dat"); if(!infile) { cout <<"" << endl; } int index = 0; string array[100]; read_names(array, infile, index); selection_sort(array,index); print_names(array,index); …

Member Avatar
Member Avatar
+0 forum 6

When selecting from DataGridView as program line below: Diameter = DesignationsDataGridView.Rows(e.RowIndex).Cells(0).Value I get following exception message box:- System.ArgumentOutOfRangeException was unhandled Message="Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" If I select 'continue' from message box then I return to datagridview for further attempt. Please can anyone tell me how to deal with this exception? (other than not to click on header, of course)

Member Avatar
Member Avatar
+0 forum 2

We are struggling with color identification in a selection filter for a digital image website. I want to have the ability to let the user pick a color value in a variety of perspectives, i.e., pantone, hex, RGB, CMYK, etc. and also to select the closeness of the match. Then I want to have the color profiles of the images compared against that selection. Is there an routine available that does this? I also want to extract the 10 most prevalent colors in the image when I am loading them on my website. The processes I am finding are not …

Member Avatar
+0 forum 0

Hi there, I am interested in phone selection by using if..else statement. so after viewing the phone specification we can select the phone and purchase that. so do you have python sample codes for that? a rough idea is enough. Thank you. and python is really interesting.

Member Avatar
Member Avatar
+0 forum 3

Hello good day. Thank you for trying to help. My problem is as follows. A few columns in my table, use a JComboBox as the editor for their cells. Each cell, in a row (via JComboBox) presents the same choices to the user. The user is allowed to choose from the options, just not the same option more than once for that row. That being said what I wish to accopmlish is this: Whenever selections are made from any JComboBox the next cells should present as options the remaining unselected choices. So basically whenever a particular choice is made, I …

Member Avatar
Member Avatar
+0 forum 23

Hi Folks – I am trying to identify a good desktop primarily for use doing statistical computing with the R language. Not sure if I should be posting here or in custom builds or somewhere else. I have some very large files (Census & BLS stuff, mainly – as much as 14 gig in a file) and R likes to hold what it is working on in RAM, so I need to max out the RAM – I am thinking 16 gig to start, but with the expansion slots to go up to 64 if that proves to be necessary …

Member Avatar
Member Avatar
+0 forum 2

Dear friends pl help me I want to select data from a data base table Tran with two selection criteria one is number and the other one is text When i use one criteria it works well But i am failed to use the two criteria my code is here for one criteria `TRS.Open "SELECT * FROM Tran WHERE Acno =" & Val(TxtAsnno.Text), CN, adOpenStatic, adLockOptimistic I want to use Acno=val(txtAcno.text) and Name= txtName.text Please help me

Member Avatar
Member Avatar
+0 forum 16

Good days folks, I have a dgv where I have to select a text in a certain cell. For example in a cell there is a text like - "A SELECTED TEXT". What I want to do is when I highlight the word "SELECT" in "A SELECTED TEXT" it will appear in my textbox. I have been doing this for hours but still no luck. Hope you can help. Thanks.

Member Avatar
Member Avatar
+0 forum 1

can you help me with the code for that using the logic: 1) randomly select the start point 2) predetermine the distance you need that car to travel using nextGaussian() 3) identify all the end points that are that distance away 4) randomly select one as you can see, i don't know how to do steps 3 and 4 for (int i = 0; i < Math.random() * 10; i++) { int drivingDistance = 0 int mean = 50; int stddev = 30; Random r = new Random(); //randomly pick start points int startX = (int)(Math.random() * gridWidth); int startY …

Member Avatar
Member Avatar
+0 forum 1

Hello! I'm just a beginner in java and also a newbie,in fact this is my first post. I already programmed some stuffs such as games, calculators and other stuff. I also have a good grasp on the language and some of it's libraries . I am planning to take my experience to the test by making my first BIG project. Well, because I love science, I decided to make a program that could simulate evolution. So far, here are my ideas: OOOOThe world is random generated,it is 2d and tile-based, with randomly placed obstacles. There will also be a start …

Member Avatar
Member Avatar
+0 forum 4

Upon resizing an anchored combobox - I noticed the text was always selected. This sparked the initiative to fix this problem. (Microsoft decided not to) So by extending the combobox class we can fix this. The following class can be dropped into a form for designer manipulation or as a user control. This is an extremely simple fix.

Member Avatar
+2 forum 0

I have been working on this assignment for a while now and I can't figure this one issue out. I was given four files, Name.java, SortableArrayList.java, NameListDriver.java, and SortableArrayListWithBubbleSort.java. The program is meant to take a text file with a list of names and sort them alphabetically. Part one of the assignment was to change the bubble sort to a recursive selection sort. I seem to have completed that part as I am able to sort the list of names. The second part requires me to make a driver that does the following things: • Creates a reference to an …

Member Avatar
Member Avatar
+0 forum 2

Hi guys, I have a php code that displays a list of dishes where a user can check on those dishes and then save the selection to the database. My code works find when selecting and saving the data. But the problem is that when I try to uncheck one of the dishes that is previously been saved, it won't remove the unchecked dish in the database. Here is the class file I am using: class.php <?php class Food { private $_con; function __construct(){ $this->_con = mysql_connect('localhost','root','') or die(mysql_error()); mysql_select_db('food', $this->_con) or die(mysql_error()); } function getDishes(){ $query = 'SELECT * …

Member Avatar
Member Avatar
+0 forum 13

Hello guys im in need of a help. I have a checkbox on a Listview1 and i also have listview2, textbox and 2 buttons. On listview1, i have a list of items and its subitems. Then im going to put a check on the one of the listview item then once i click the button1 the value of the sub item of that item will be put into textbox. Then on button2 i have the select statement where it's WHERE is textbox.text and it will display the data of that item from database to listview2. Once i run my program, …

Member Avatar
Member Avatar
+0 forum 5

hello i am trying to use selection formula with crystal report viewer i write the formula in string and set it to crystalReportViewer1.SelectionFormula here whe i use this formula " {Customer.LastYearSales} > 11000"; it said a string is required here & when i change it to this " {Customer.LastYearSales} > \"11000\""; it said a number is required here please help me with the above errors

Member Avatar
+0 forum 0

hello i am trying to use selection formula with crystal report viewer i write the formula in string and set it to crystalReportViewer1.SelectionFormula here whe i use this formula " {Customer.LastYearSales} > 11000"; it said a string is required here & when i change it to this " {Customer.LastYearSales} > \"11000\""; it said a number is required here please help me with the above errors

Member Avatar
+0 forum 0

Here's the entirety of my code. The problem I'm having trouble with is in the sortArray function. The first part of that function is used to sort the words gathered in a text file from A to Z, the second part is meant to find any duplicate words, ie 'a' appearing 3, and moves that duplicate to the end of the array where it won't be found again, and then increases .WordAmt for that index by 1, so when everything's out put, it'll show the letter 'a' for an index and have a WordAmt of 3. Here's where I'm at …

Member Avatar
Member Avatar
+0 forum 4

Hello, I'm trying to have my program locate any duplicate strings in an array, say, there were two instances of the word 'man', it would add 1 to the Word Amount of that word, and move the duplicate to the back of the array in some way. The problem is, I cannot figure out for the life of me how to do this correctly. As of right now, when I try to run the program, it'll find the first duplicate and add 1 to the word amount of that word, but then it goes wonky and adds an empty line …

Member Avatar
Member Avatar
+0 forum 8

HI, I have a doubt in multiple selection fetching data whil edit the page. output data stored in database as comma separated.

Member Avatar
Member Avatar
+0 forum 1

void selection_sort (int *a, int n) { int i, j, m, t; for (i = 0; i < n; i++) { for (j = i, m = i; j < n; j++) { if (a[j] < a[m]) m = j; } t = a[i]; a[i] = a[m]; a[m] = t; } } int main () { int a[] = {4, 65, 2, -31, 0, 99, 2, 83, 782, 1}; int n = sizeof a / sizeof a[0]; selection_sort(a, n); return 0; } hi, can u pls help me understand this code line by line.. i understand how selection sort works. …

Member Avatar
Member Avatar
+0 forum 3

Dear All, Please suppose that I have this line of code, and that my selection range goes from div element with id=1, starting at '2', to div element with id='2', ending at '8'. `<div id='1'>1`2`3</div>456<div id='2'>7`8`9</div>`. I'm using chrome, I would like to get the position of the cursor inside each element. I would get position 1 in div with id='1', and position 1 as well in div with id='2'. Thank you so much for yout help, Regards

Member Avatar
Member Avatar
+0 forum 1

Hi all, Heres my problem, not sure if this is the right place but daniweb users seem to answer every other question I have so here goes. I have windows 7 on my laptop. I have a repair disc that I have made from the same machine when it was working. Now after my mum done something to it, it won't start up. So I have put the repair disc in, booted it from the cd, and I have got to the language select screen. Selected it, and clicked to continue. Then it gets to a windows background and does …

Member Avatar
Member Avatar
+0 forum 3

Hello again, I am asked by my professor to create a program using selection sort in a linked list. Selection sort with sorting only the data is pretty easy, but I'm having a hard time because he made us sort the nodes themselves. Can anyone help by giving atleast the algorithm in sorting the nodes. Thank you. Here is my code so far, it's only about sorting the data: #include <iostream> #include <iomanip> using namespace std; typedef struct node { int DATA; node *NEXT; }; node *HEAD = NULL; void Create(int data); void Display(); void Sort(); int main() { int …

Member Avatar
Member Avatar
+0 forum 6

Hello. I am learning C++, and I am a little stuck. Right now, I'm working on pointers. The problem I'm working on requires sorting an array of structures, using pointers instead of array indices, using a selection sort. My code is not working, and I can't quite figure out why. I am able to do the problem using a bubble sort, however. I am pretty new to pointers and sorting algorithms in general, so it's possible I am just missing something really simple. Here is the code: [code=c++]void selection_sort(Student *ptr, int size) { int start, min_index, min_value; Student temp; for …

Member Avatar
Member Avatar
+0 forum 1

The End.