637 Topics
| |
Hello all, I am working on an upload script. This one is taken straight from php.net. I tried to get it to work but can't seem to. Could you help out? This is the code: <?php $uploads_dir = 'file:///PETBookPro09/Users/petuser1/Desktop/'; foreach ($_FILES["pictures"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK) … | |
Hello I am trying to run a perl script on tomcat server. I am putting the incoming http request in a variable data which collects the headers as well as the text file attachment data. The code is like this : .... while(<>){ $data = $data . $_ ; } … | |
Hello, I am hoping someone can help me understand a piece of code i found. Since php is not my primary language, and what i googled returned vague results, i am unsure exactly how a number or integer value can be used directly as a boolean in a while operation. … | |
#include<stdio.h> #include<stdlib.h> int input(int *a) { int n,i; printf("enter the no of elements:"); scanf("%d",&n); for(i=0;i<n;i++) { printf("enter the element:"); scanf("%d",a++); } return n; } int key_input(int *a,int key) { int k; printf("enter the key value which have to be searched in the array of no's provided:"); scanf("%d",&k); return k; } … | |
Hey guys, I'm trying to create a iterative heapsort program and for some reason when I input 10 random numbers into the array, only 9 numbers are sorted. Here is an example of my input/output: Input: 45 15 2 44 30 83 30 86 66 49 // 10 random numbers … | |
I'm trying to compare the element pointed by an iterator to an integer, but so far i haven't had any luck in doing so. please correct whatever i'm doing wrong. Thank you. vector<int>::iterator y; for (int i = 0;i<n2;i++) { cin>>temp; cnt = 0; y = lower_bound(a.begin(),a.end(),temp); if (*y == … | |
While lunching the application in TOMCAT 5.5 and JDK 1.5 I am getting below exception could some help me in resolving the issue Jul 25, 2012 4:12:50 AM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:572) at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:401) at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248) at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162) at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418) at … | |
| #include <iostream> #include <cmath> #include <string> #include <cstdlib> #include <cstring> using namespace std; int main() { char chouseing_alphabet[27]={'a', 'b', 'c', '\0'}; string abc[27]; cout << "This program encrypts messages using Ceaser Cipher\n"; cout << "NOTE:capital letters are not allowed in this program\n"; cout << "\n---------------------------------------------------------"; cout << "\n---------------------------------------------------------"; cout << … |
Hi everyone I'm having a problem with this program giving me the wrong output. The question is • void getScore() should ask the user for a test score, store it in a reference parameter variable. This function should be called by the main once for of the six scores to … | |
Hi, If I have a value inside the try{} how can I read it outside, is it possible try { int num=0; } | |
my code is messing up. help: if (mysql_query("CREATE DATABASE $dbname",$con)) { echo "Database Created<br>"; $dbase = $_POST["CallSign"]."char"; mysql_select_db($dbase, $con); $sql = "SELECT * FROM $dbase"; $result = mysql_query($sql); if ($result) { echo "CallSign Accepted<br>"; mysql_select_db("my_db", $con); $sql="INSERT INTO users ( CallSign, Email, FirstName, MiddleName, LastName, Gender, BirthMonth, BirthDay, BirthYear, Location, … | |
Im not seeing it but its not working here is the code: mysql_select_db("my_db", $con); $sql = "CREATE TABLE stream ( waveID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(gameID), userID int, wave varchar(25), waveTime TIMESTAMP DEFAULT NOW() )"; // Execute query if(!mysql_query($sql)) { echo "Couldn't do it"; } else { echo "alright"; … | |
hi all! lame programmer here again.Please explain this thing..seems like it has truth table and stuf.anding oring etc..plz explain how this will execute.need simple explanation so i wont forget throughout my life..:D if (!(mysql_query($sql,$con)) || !(mysql_query($sql_pin,$con))) { if(mysql_errno()==1062) { $error_flag=1; echo mysql_error(); echo "error no:".mysql_errno(); die("error:".mysql_errno()); } $error_flag=1; } else … | |
| Whats wrong with this code? I have not any errors from ie. <html> <script type="text/javascript"> var a = 1; var b = 2; if (a < b) { document.write("CONDITION TRUE :D") } else { document.write("CONDITION IS FALSE D:") </script> So? |
Good day to every one. First here is my code so far import java.io.*; public class Program2 { public static void main (String[]args) throws IOException{ BufferedReader bv = new BufferedReader (new InputStreamReader(System.in)); String a, b, c, x; Float d, e, f, g, h, i, j, k, l, m, ave; System.out.println("ENTER … | |
Hi Everyone, I have a foreach array that prints out images one per line. How can I print images out so I have 3 per line ? here is the code I am working with. if (count($friendDataRawArray) > 0) { foreach ( $friendDataRawArray as $id => $friend) { //$name = … | |
void quick_sort (int *a, int n) { if (n < 2) return; int p = a[n / 2]; int *l = a; int *r = a + n - 1; while (l <= r) { while (*l < p) l++; while (*r > p) r--; if (l <= r) { … | |
Good day to everyone.. First Here is my code so far.. import java.io.*; public class Inventory { public static void main (String[]args)throws IOException{ BufferedReader bv = new BufferedReader (new InputStreamReader(System.in)); String x, z; boolean y = true; int a, b, c, d = 0; do { System.out.println("--------------------------------------------------------------"); System.out.println(" M I … | |
I am having problems with my code. I think it is the print function, but I'm not sure. Everything compiles correctly. Just no output. Any help is appreciated. Thanks Here is what I have: #include <iostream> using namespace std; struct node* tree = NULL; struct node { int data; struct … | |
HI Could yu please tell me how to get previous values from current iteration in the below example : public void parseDtoCollection(Collection dtos) contains list of dtos in private AssetClassVersion createNewAssetClassVersion(AssetDTO dto) method i am iterating but i want to get to get previous itearation values in current iteration if … | |
I am hoping this is an easy question. I am not well versed in Java, I am a ITSM admin, but the ITSM product we use comes with Tomcat as it's web server. I am trying to find out if there is a simple way to set index file (welcome … | |
I can't seem to figure out what I'm missing. After the end user selects one or more classes, they go to a page that runs a foreach statement to determine which discount to use on each class. But it doesn't seem to be adding the resulting total to the array, … | |
Quickselect, based on quicksort, and counting select, based on counting sort. Each is capable of finding the kth smallest element in an unsorted/sorted list/array. This is some example code for a QuickSelect algorithm. This doesn't include the partition function. // return the kth smallest item int quickSelect(int items[], int first, … | |
Hi all, I am having trouble figuring out a good way to go about looping my database results. Currently, my code looks something like the following (abbreviated for simplicity): $db_results = $wpdb->get_results("SELECT * FROM table"); echo '<table><thead><th>Name</th><th>Number</th></thead>'; echo '<tbody>'; foreach ($db_results as $result) { echo '<tr>'; echo '<td>' .$result->name. '</td>'; … | |
If I have an arraylist of arrays (each item in the arraylist is itself a one-dimensional array), how can I iterate over each element of each array contained in the arraylist? | |
I need a simple script to echo current date 600 times once every second redirect it to a text file and follow the file as it grows using a tail command. | |
i have to do a pyramid with a pattern like this [iCODE] 1 1 2 1 1 2 4 2 1 1 2 4 16 4 2 1[/iCODE] i just realized dani web didnt take my center pyrmaid thing it moved to the side no matter what spacing i did … | |
so the code is pretty simple. it just loops and if statements. first i have a main. i took the headers and prototypes out to make it smaller. In main all iam doing is asking user to enter command and call one funtion. // main.c int main(int argc, char *argv[]) … | |
Hi all, I actually need to use a sorted map.So i tried using Tree Map.But the problem is that This works well with sort key having values upto 9. With more than 10 items I see abrupt results with sort key arranged in the order = 1, 10, 11,12,--------17, 2, … | |
hi i am using fedora 14 and 16....while executing the parallel programs in c i am getting segmentation fault(core dumped) when i give the array size more than 100000 .... |
The End.