print ("The scope of this program is to multiply two matrices together\ and print the result") while True: matrix1_rows = input("How many rows does matrix one have? ") matrix1_columns = input("How many columns does matrix one have? ") print ("Matrix one is a", matrix1_rows, "x", matrix1_columns, "matrix") print() matrix2_rows = input("How many rows does matrix two have? ") matrix2_columns = input("How many columns does matrix one have? ") print ("Matrix two is a", matrix2_rows, "x", matrix2_columns, "matrix") if(matrix1_columns != matrix2_rows): print("\nSorry, cannot multiply these two matrices, must be (mxn)*(nxp)") else: break print("----------------------------------------------------------") print("\nThe system will now take values for matrix …

Member Avatar
Member Avatar
+0 forum 3

i have a repeater in one page to which me load the data from database now i want to click a button and i get the value of a repeater specific row data and kept data in session and access that data an another page.plz help me any one have any idea or any simple code. i will be very thank full for yours this kindness. YOur sinser Regard Mian sahib Jan . me have the following code.now i to access these value from a repeater and keep it in session. ///// <asp:Repeater ID="Repeater1" runat="server" > `` <table border="1" width="100%"> …

Member Avatar
+0 forum 0

Hello, I am just after some information if anyone knows how to create a system in php that auto assigns a user at random when a record is logged in a mysql database I have been tasked to build a logging system for which uses a database to store the data but auto assigns users based on a user data database of arround three users to start with, so each time you log a new call is auto assigns a differnet user, this is so each call gets allocated correcly Does anyone know how I can achieve this Thanks, Martin

Member Avatar
Member Avatar
+0 forum 3

My code has a couple of "multiple assigments" and somehow I think there should be a nicer way to do this in Python. This is how it currently looks like: # sum price fields paf = paf + float(pa) pbf = pbf + float(pb) pcf = pcf + float(pc) pdf = pdf + float(pd) pef = pef + float(pe) pff = pff + float(pf) pgf = pgf + float(pg) phf = phf + float(ph) # format to 2 decimals pas = "%.2f" % paf pbs = "%.2f" % pbf pcs = "%.2f" % pcf pds = "%.2f" % pdf pes …

Member Avatar
Member Avatar
+0 forum 11

I want to assign a value to a variable in radi button. I tried a code like this <form method="post" action=""> <input type="submit" name="task" value="CONTINUE" onclick="$lax="5"> $task = $_POST['task']; switch( $task ) { case 'CONTINUE': echo $lax; i want the variable lax to get the value 5 while entering the switch case. I'm very new to php pls help.

Member Avatar
Member Avatar
+0 forum 1

CONFIG_FILE="${HOME}/sample/seq.cfg" count=`awk 'END {print NR}' $CONFIG_FILE` echo $count t=1 while [ "$t" -le "$count" ] do output_var=`awk -v v1=$t '$1 ~ /v1/ { print $1 }' $CONFIG_FILE` input_var=`awk -v v1=$t '$1 ~ /v1/ { print $3 }' $CONFIG_FILE` echo "O=" $output_var echo "I=" $input_var done the above code is giving blank values for *output_var and input_var* ?? Can someone tell me why it is not assigning values to it. the config file is as follows : 1 = 4 2 = 2 3 = 9 4 = 87 5 = 6

Member Avatar
Member Avatar
+0 forum 20

Hello! What I am trying to do is assign the values from a mysql query and store them in an array. I have some code that queries the DB by using SHOW COLUMNS. I then loop through dynamically assigning the name of the DB field to input fields of a form. That way I can build the form and give the text inputs a name without actually knowing the name up front. This depends on what the user selects from a link on a previous page. For example...I show DB's on the index page and then dynamically create links with …

Member Avatar
Member Avatar
+1 forum 2

[CODE]void Load() { book *newptr,*p,*q; string id,title,author,year,price,date; ifstream file1; head = NULL; file1.open("books.txt"); if (file1.fail()) { cout << "Error opening file.\n"; exit(1); } while (!file1.eof()) { newptr = new book; // getline(file1,id); getline(file1,title); getline(file1,author); getline(file1,year); getline(file1,price); getline(file1,date); //copy values from the file to the newptr newptr->id.assign (id) ; newptr->title.assign (title) ; newptr->author.assign(author) ; newptr->year.assign (year) ; newptr->price = atoi(price.c_str()) ; newptr->date.assign (date) ; if(head == NULL) head = newptr; else { p = head; q = NULL; while(p != NULL && p->id.compare(newptr->id)>0) { q = p; p = p->next; } if(q == NULL) { newptr->next = head; head = newptr; …

Member Avatar
Member Avatar
+0 forum 6

I am a beginner of C++. i want to print out the list like the following [ATTACH]22433[/ATTACH] but what i get is this [ATTACH]22435[/ATTACH] and this is my code [ATTACH]22436[/ATTACH] It looks like i did something wrong when i trying to assign the value that i calculated to the array rent[]... please help. i will be appreciated.

Member Avatar
Member Avatar
+0 forum 2

This is related to [url]http://www.daniweb.com/software-development/python/threads/111526[/url] However, in this case, I don't necessarily know the value of the var from which I am getting the name using vars(). Is there a way to get it? [CODE]prefix = 'char' lidControls = [] lidControls2Make = ['uprLid', 'lwrLid','lwrLidTrack', 'uprLidTrack','uprLidRef','lidRig'] for control in lidControls2Make: objTmp = prefix + '_'+control cmds.spaceLocator(n=objTmp) lidControls.append(objTmp) # Assign the name to the control so we can access it by name later: vars()[control] = objTmp # So far, so good. The task is accomplished # But how do I get the name of the variable created by vars()[control]? # I want …

Member Avatar
Member Avatar
+0 forum 2

I'm required to construct a three-dimensional array (a "universe"), but unlike traditional array navigation where you go to the end of the column, row, etc., increment and start at the beginning, I am required to move in reverse (like actually navigating a cube). The precise instructions: - Move along a row (through the columns) until it comes to a side edge - Move one layer deeper and then travel back along the row until it is back at a side edge - Repeat these movements until the back edge is reached. Then move down to the next row. - Move …

Member Avatar
+0 forum 0

im a newbie here, im taking intro to programming wth VB in college and im having problem with the homework here's what im supposed to do 36. Read 10 digits contained in a text file into an array and then display three columns in a list box as follows: column 1 should contain the original 10 digits, column 2 should contain these digits in reverse order, and column 3 should contain the average of the corresponding digits' in columns 1 and 2. i asked someone else for help and they gave me a layout, they offered me their code but …

Member Avatar
Member Avatar
+0 forum 7

here is the code: [code=python] def main(): totalBudget = 4000 printOptions() option = input("What would you like to do? ") while option != 5: if option == 1: newExpence = addExpence(totalBudget) totalBudget = totalBudget - newExpence printOptions() option = input("What would you like to do? ") elif option == 2: removeExpence = removeExpence(totalBudget) totalBudget = totalBudget + removedExpence printOptions() option = input("What would you like to do? ") elif option == 3: newRevenue(totalBudget) printOptions() option = input("What would you like to do? ") elif option == 4: removeRevenue(totalBudget) printOptions() option = input("What would you like to do? ") else: print …

Member Avatar
Member Avatar
+0 forum 2

Nevermind.

Member Avatar
+0 forum 0

The End.