Hey guys i'm a noob with javascript. I have two scripts that generally do the same thing but each do not properly work with my code. The first script will work with adding rows and allow me to delete them, however it will also delete the top row. This is an issue because if you delete the top row and try to add a row it will not allow you to add it. Also whatever value is in the first rows cell it copys to each row you add for the first cell. It works but kind of annoying! The …

Member Avatar
+0 forum 0

Firstly, I would like to apologize for the massive number of nooby crap questions that come out of my account. I'm an emerging programmer that doesn't always know what he's doing, so I'm sorry. Secondly, the problem. I'm writing this code: class Object(): def __init_(self, vertices, color, name): self.color = color self.name = name self.vertices = vertices ##Vertices is in list form def editVertice(self, vertice): if vertice in self.vertices: self.vertices.index(vertice) else: print "ERROR: VERTICE NOT RECOGNIZED. INSERT VALID VERTICE" The problem I'm having is that when I run this, it gives an error saying that the term 'vertice' in the …

Member Avatar
Member Avatar
+0 forum 3

So here is my WORKING code. My problem lies in the output when I enter "0" or "00" for the hour in 12 midnight. No matter what it still outputs a 0 for midnight. (I want it to convert it to standard time.) I know it is something easy that I am missing. It's written in a class structure path going .h to .cpp to main.cpp so I will post them in that order. this is the specification file: //Time.h - This is the specification file for the Time class. //This file will define the Time class. #include<iostream> using namespace …

Member Avatar
Member Avatar
+0 forum 7

Hi guys, Just wanna ask what the "::" is for? ex. CRM_ContactsCommon::get_my_record() Correct me if I'm wrong, the **CRM_ContactsCommon** is a class and the **get_my_record** is a function inside the class. Now, is the "::" works the same way like in java to access a function of a class? Thank you in advance.

Member Avatar
Member Avatar
+0 forum 5

*** Systems *** OS: Windows 8.1 64bit IDK: MS Visual Studio Express 2013 for Windows Desktop Problem: I created a simple (very simple) User-defined function named func_compare that compares two numbers, it has two parameters of type Integer. It has no errors whatsoever until you compile it, and it says identifier func_compare not found. It seems to me that my compiler does not know that it was actually a user-defined function. I am also suspecting that my IDK is missing some components??? Here is my code; __________________________________________________________________ #include <iostream> using namespace std; int main(){ int num1, num2; cout << "Enter …

Member Avatar
Member Avatar
+0 forum 2

My program keeps crashing once I try to make my custom class use some of its own functions My custom class looks like this: Entity.h #ifndef _ENTITIES #define _ENTITIES #include "actual.h" #include "Manager.h" struct Position { float x, y, z; }; class Entity { public: Entity(); ~Entity(); bool Init(Actual*, int); Actual* GetActual(); Position* GetPosition(); void SetPosition(float, float, float); void SetPosition(Position*); bool IsSpawned(); bool Render(Manager*); bool Spawn(Position*); int GetID(); private: bool spawned; Actual* actual; Position* position; int entityID; }; #endif Entity.cpp #include "stdafx.h" #include "Entity.h" #include <string> #include "Debug.h" Entity::Entity() { spawned = false; } Entity::~Entity() { } bool Entity::Init(Actual* base, …

Member Avatar
Member Avatar
+0 forum 2

unable to insert data into table user_detail using jquery i've three files index.php, upload.php, function.php // index.php <?php require_once('function.php'); session_start(); if (!is_user()) { redirect('signin.php'); } $ip = $_SERVER['REMOTE_ADDR']; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Home</title> <link rel="stylesheet" type="text/css" href="css/pure-min.css"> <link rel="stylesheet" type="text/css" href="css/style.css"> <link href="css/uploadfile.css" rel="stylesheet"> <script src="js/jquery.min.js"></script> <script src="js/jquery.uploadfile.min.js"></script> </head> <body> <div class="container"> <h1>Hello <?php echo $_SESSION['username'];?>!</h1> <p>You are now logged in!</p> <a href="signout.php" class="pure-button">Logout</a> <br /><br /> <div id="mulitplefileuploader">Upload</div> <div id="status"></div> <script> $(document).ready(function() { var settings = { url: "upload.php", method: "POST", allowedTypes:"prn", fileName: "myfile", formData: {"username":"<? $_SESSION['username']; ?>"}, multiple: false, onSuccess:function(files,data,xhr) { $("#status").html("<font color='green'>Upload is …

Member Avatar
Member Avatar
+0 forum 2

Hi all, I am developing calculator app using C#.I have successfuly implemented its standard arithmetic functions but a bit trapped in implementing scientific functions such as sin,cos.tan etc. I take an operand1,then operator and finally second opernad to workout arithmetic calculations.In the very first attempt to do scientific calculation i for the sake of programme format first takes input followed by sin/cos/tan etc and then out result. Here is my code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Calculator { public partial class Form1 : Form { string input = …

Member Avatar
Member Avatar
+0 forum 5

I am trying to make a function that rounds number.. I declared the function above the main and voided it Then I recalled the function in the program and listed the variables needed in brackets and then I wrote the function I can't work out what is wrong. [ICODE]#include<stdio.h> #include<math.h> void round2int(float,float); int main (void) { float roundednum,x; do { printf("Enter a number (Enter zero (0) to quit program)"); scanf("%f",&x); round2int(x,roundednum); } while(x!=0); fflush(stdin); getchar(); return 0; } void round2int(float test, float number) { float number,test; number=floor(test+05); printf("%f",number); }[/ICODE]

Member Avatar
Member Avatar
+0 forum 8

Hello, I am working on some code that does a remote call to a licensing server to validate whether the license is valid, invalid, expired and suspended. I have a login code that is using prepared statements: function login($email, $password, $mysqli) { // Using prepared statements means that SQL injection is not possible. if ($stmt = $mysqli->prepare("SELECT id, username, password, salt FROM members WHERE email = ? LIMIT 1")) { $stmt->bind_param('s', $email); // Bind "$email" to parameter. $stmt->execute(); // Execute the prepared query. $stmt->store_result(); // get variables from result. $stmt->bind_result($user_id, $username, $db_password, $salt); $stmt->fetch(); // hash the password with the …

Member Avatar
Member Avatar
+0 forum 6

I am tring to perform a calculation in my query. I've been working on it for hours, so I need another pair of eyes to see what I am missing. Everything in the query is working except for the g.courseFee part. The course fee is not being added to the calculation. I am not sure if the issue is in the select clause or the left join clause. Below is my query and any help is greatly appreciated: SELECT COALESCE(SUM(c.amount),0)+COALESCE(SUM(g.courseFee),0) AS 'Balance', a.termCode as 'Term', a.stuID AS 'Student ID', CONCAT(d.lname, ', ', d.fname) AS 'Student Name', a.comment AS Comment FROM …

Member Avatar
Member Avatar
+0 forum 3

Good Day Daniwebbers! Wonder if I can have some help. I am trying to build an 'admin panel' of sorts where the user can add content to their website, edit and delete it, all from one spot (Not unlike a CMS system I guess but purely for the purpose of uploading news/case studies ect) Now pretty much have everything done except for this one edit function that I cannot seem to fathom (I have the other edit functions working but this one is eluding me) So basically to summarise the problem, The user navigates to a list of case studies, …

Member Avatar
Member Avatar
+0 forum 2

Hi there, I am having a problem of passing arrays to functions, here is my code: void zeroMatrix(float **arr); void main() { float e[2][2]; zeroMatrix(e); } void zeroMatrix(float** arr) { int i,j; for (i=0;i<2;i++) { for(j=0;j<2;j++) { *( *(arr +i)+j) =0; } } } The problem is I want to allocate dynamically an array and to pass to a function. Cheers guys

Member Avatar
Member Avatar
+0 forum 5

I'm totally new to programming and taking an intro class. When i prompt the user for a state code the program just exits, nothing in my book really goes over this and all im given is crappy youtube videos for reference. Any help is greatly appreciated. #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 2 // initially to test kept it to SIZE 2 typedef struct { char firstName[30]; char lastName[30]; char street[35]; char city[20]; char state[3]; int zip; char phone[15]; int accountId; } Customer; Customer getCustInfo(int a ) { Customer cust; char firstName2[30]; printf(" Enter Data for Customer %d\n", …

Member Avatar
Member Avatar
+0 forum 3

Am trying to get a function call but i cant get it to print. Please help here. This is the code: def foo(): name = input ('>>').lower().split() for item in name: if name == foo: print ('foo here!') else: bar() def bar(): name = input ('>>').lower().split() for item in name: if name == bar: print ('bar here!') def start(): print('Welcome Home') name = input foo() start()

Member Avatar
Member Avatar
+0 forum 2

I'm trying to figure out a way to define my function for loaning a book within a class. This is what I have so far: class Library: # the class constructor def __init__(self, books, patrons): self.books=books self.patrons=patrons def __str__(self): s="Patron(" for patron in self.patrons: s+=str(patron) + ', ' if len(self.patron) != 0: s= s[:-2] s+=']' for book in self.books: s+=str(book) + ', ' if len(self.books) != 0: s= s[:-2] s+='])' return s and I have my function: def loan_book(self, patron_id, book_id): existence= False for i in self.patrons: if i.patron_id==patron_id: return True raise LookupError for i in self.books: if i.book_id==book_id: return …

Member Avatar
Member Avatar
+0 forum 1

frequent utility of inline function

Member Avatar
+0 forum 0

The title says it all but I am curious if it's acceptable or even efficient for that matter. If others were to read my code or work on a project with me is this generally accepted among others or yourself if you work on an enterprise level? Is this memory efficient to split things up for developer "ease-of-use"?

Member Avatar
Member Avatar
+0 forum 5

Hi I need PHP functions for calculating the area and volume of a cylinder? I will be thankfull for your answer. <form action="functions.php" method="POST"> Enter the radius = <input type="text" name="radius"><br> Enter the height = <input type="text" name="height"><br> <input type="submit" name="submit" value="Calculate"><br> </form> <?php //calculates the volume of a cylinder //Volym = π r2 h function volumeCylinder($r,$h) { $pi = 3.141592653589; $volume = 2 * pi *radius *(radius + height); //return volume; echo "The volume is", volume; } ?>

Member Avatar
Member Avatar
+0 forum 16

Hello all, So here is my problem: I have 2 functions that one uses the other's calculations and result: int functionA(int a, int b) { int x = a+b; return x; } int functionB(int a, int b, int c) { int xx = x(a,b); int f = xx * c; return f; } I have reached a point in a program I am trying to write, where I need functions that take too many parameters and I was thinking whether or not there is a better way to do it, like calling the function A or its result directly without …

Member Avatar
Member Avatar
+0 forum 4

write a function named, smallestValue, that accepts five integers and return the smallest integer accepted.( just write a function)

Member Avatar
Member Avatar
+0 forum 2

ALTER FUNCTION [dbo].[customers_udfMin2] ( @decission tinyint ) RETURNS int AS BEGIN -- Declare the return variable here DECLARE @min int Declare @default int = 10 -- Add the T-SQL statements to compute the return value here if (@decission = 1) Begin SELECT @min = MIN(customers.cus_id) from customers End else RETURN 0 Return @default END in every case it returns @default , y ? even i sent 1 as a parameter.

Member Avatar
Member Avatar
+0 forum 3

I m trying to convert C code to C++. Facing some difficulties help me out! //This is struct typedef struct index { int id; char word[20]; int count; }indexs; // Function prototype void fileScanner(FILE * ifp,int i); void fileRead(FILE *ofp); int findString(char s[],char u[]); int searchEntry(indexs [],char key[],int n); void StoreIndexInFile(FILE *); // <---is this correct? void fileDisplay(FILE *ifp,FILE *ofp); // Function to be called void StoreIndexInFile(FILE *ifp,indexs ind[],int n) { indexs *i; fprintf(ifp,"\nid word(root) frequency\n\n"); for(i=ind;i<ind+n;i++) { fprintf(ifp,"%d %-20s %d \n",i->id,i->word,i->count); } } How can I call this function(with parameters)?

Member Avatar
Member Avatar
+0 forum 1

i am getting result of average in int instead of float, tell me where i have made mistake. this is the code. #include<iostream> using namespace std; void getData (int a[], int s); int numbersSum (int a[], int s); float average (int sum, int size); int main() { int size=0; int a[size]; cout<<"how many numbers: "<<endl; cin>>size; cout<<"Enter "<<size<<" numbers:"<<endl; getData (a, size); int sum=0; sum=numbersSum (a, size); cout<<"sum of these "<<size<<" numbers is "<<sum<<endl; float avg=0; avg=average (sum, size); cout<<"the average of these "<<size<<" numbers is "<<avg<<endl; return 0; } void getData(int a[], int s) { for (int i=0;i<s;i++) { …

Member Avatar
Member Avatar
+0 forum 3

Hi, I have been trying to create a little jquery plugin for myself so that I can reuse some helpful multiple button submit code. This plugin will allow me to have a class as a selector for every button I want to use on a webpage, a class for everything I want to show/hide and set the toggle speed to slow, medium or fast. The issue I have is that what I want as my default settings ie the p tag and slow are acting as hard coded to the plugin rather than taking the parameter inputs of the function …

Member Avatar
Member Avatar
+0 forum 4

[B][I][U]Introduction [/U][/I][/B] [COLOR="Red"]Hey everybody welcome to a tutorials on classes in PYTHON. The purpose I made this tutorial for is that when I was learning classes in python I dint found any good tutorials on Classes. Maybe I was wrong. But here's my tutorial.[/COLOR] [B][I][U]Layout[/U][/I][/B] In this tutorial i'll be covering everything I know about classes. Topics are as follows :- [COLOR="Green"][COLOR="Red"] 1.What is an object? 2.What is a class? How do we declare it in python. 3.Declaring functions in Classes. 4.What is “self”? 5.Parent class and Child class. 6.How to inherit multiple classes. 7.Overwriting Variables So let's get started.[/COLOR][/COLOR] …

Member Avatar
Member Avatar
+1 forum 11

Hi, This question is related to the below. http://www.daniweb.com/software-development/cpp/threads/352685/error-c3861-menu-identifier-not-found I used that to solve my issue. What I would like to understand is why the function prototype is to be declared before the main function? In my textbook that I am following the function prototype wasn't there. I did as written in that thread and my error got resolved. As the program gets complex, it would be a bunch of prototypes on top. Any way to get around this? Am I doing something wrong? Here's my code: // My first C++ app #include <iostream> using namespace std; void print(int i); …

Member Avatar
Member Avatar
+0 forum 4

function smile () { document.getElementById("textfield_width").value = width; //set the elements with id "textfield_width" some value the value of the variable width--> document.getElementById("textfield_height").value = height; // set the elements with id "textfield_height" some value the value of the variable height --> }

Member Avatar
Member Avatar
-1 forum 4

Hi all am am trying to reduce duplicated elements in a php page. How can I create a function that will pass the different values in the array. Thanks in advance D for ($i=$index-$x+1; $i<=$index; $i++) { echo "<div class='partner_description' id='partner_description_" .$partners_id[$i]. "'>"; echo "<p>".$description_value[$i]. "</p>"; echo "<div class='url'>"; echo "<a href='http://".$url_value[$i]."' target='blank'>".$url_value[$i]." </a></div>"; echo "</div>"; }

Member Avatar
Member Avatar
+0 forum 6

Hi , i would like to include a normal conventiional function in to my obcetive c project. I have tried putting the body of the function outside the implementation section , inside the @implemenation section. I know it wont be part of the class i'm defining , but do i have to declare it somewhere in aheader file. i just get build errors An example(or link to a an example) would be brilliant . i just dont know how you do it???.please help !!

Member Avatar
Member Avatar
+0 forum 1

The End.