199,114 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for avinash_545

Dear All, I am currently working on a web assignment. But I do not know what is wrong with this ^piece of code. Can anyone of you find the bug in it please ;[code]<? $con=mysql_connect("localhost","root",""); if(!$con){die("could not connect".mysql_error());} mysql_select_db("idareyou",$con); echo("dbconnect is working"); $fname=a;//$_GET('search_fname');echo $fname; $lname=a;//$_GET('search_lname'); // include("dbConnect.php"); echo "blaljfkdjfjdfk"; echo …

Member Avatar for avinash_545
0
211
Member Avatar for Asset

def getAverage(numList): total = 0 for i in range(0, len(numList)): total = float(numList[i]) total = total + numList[i] average = total/len(numList) return average Hi, I'm really, really new to python, I'm having error on this function and I can't solve it yet, so can someone help? Thank-you :)

Member Avatar for Asset
0
713
Member Avatar for Teiji

Hi, I was checking out the unittest module and try out the sample code. I save the code below in a file call "testrandom.py" and run it using IDLE (Python's default IDE), but I get the following in red. Obviously, the tests run fine as indicated by OK, but why …

Member Avatar for TrustyTony
0
366
Member Avatar for micahgeorge

How can I set the time to 00:00:00, now i set it to DateTime startTine=DateTime.Now but i want to show the time as 0 everytime and run the calculation from that(0)starting time........

Member Avatar for Momerath
0
8K
Member Avatar for gizmo7008

For my class, I am creating a rock paper scissors game. My code is not all the way done, but I am stuck on a certain part of the process. For some reason, I am getting errors on the "==" in: [CODE] while (true) { human = humanChoice(); computer = …

Member Avatar for gizmo7008
0
213
Member Avatar for Nassarofficial

The first one is: A program that searches within a file and by user input for a word, and counts how many of this word in the file, and if its in the file or not. Thats what i reached so far: sword, line= 0, 0 filename= raw_input("please input file …

Member Avatar for griswolf
0
96
Member Avatar for hurkagurk

Thank you very much for reading this. I've been programming for 15 years (VB, a lot of PHP, etc), but I've never considered myself a 'real' programmer. Mainly I'll build things that I need that are too specialized to be made by anyone else - simple programs and scripts to …

Member Avatar for Kimpl
0
201
Member Avatar for somon

Hi, Please can anybody help me a little bit with my assignment , The thing is that I was kinda ill , so i missed many important lessons, but now teacher told that i need to do assignment, Can anybody help me with beggining , * we use Xcode. 1. …

Member Avatar for m.e.nergiz
0
121
Member Avatar for ZIPB

Can anyone tell how to call a class function from a switch statement example [code] number number::operator+(number) { inputs } [/code] [code]switch (option) { case 1: number number::operator+(number); break; [/code] IS THAT THE CORRECT WAY TO CALL THE ABOVE FUNCTION?

Member Avatar for VernonDozier
0
146
Member Avatar for hannlim
Member Avatar for lynneh3979

I am new to this. I am trying to write code to update every other element in an array. Here is all I have.... can't find anything to show me how to do this. [CODE]#include<iostream> using std::cout; using std::endl; int palpha = 0; int main() { char* alphabet[] ={ "A", …

Member Avatar for VernonDozier
0
145
Member Avatar for Seagull One

I've been working hard all day to get this to work. I'm playing around with the math module in python. I eventually want the following code to help me control the speed of a servo motor. The idea is to get the servo speed to accelerate and then decelerate as …

Member Avatar for woooee
0
194
Member Avatar for TrustyTony

I write usually many versions of the functions, sometimes writing functions from scratch again. Sometimes the parameters change from version to version, sometimes they are refering to library of functions that also has multiple versions. Has somebody advice on how to manage best this kind of situation? Should I define …

0
135
Member Avatar for karthikdebbadi

Hi all, I am very much new to any forum or discussion.I am working on C++ on ubuntu. My problem is I have to transfer a file from my domain to a remote server which maintains these files using sftp which is provided by my linuc machine. I am not …

Member Avatar for karthikdebbadi
0
269
Member Avatar for miha2

Hello guys, I know it's been asked a lot about it here, but that's what I should do (though I'm not quite sure what the teacher wants, is n should be 100, 1000 and further, or use prime numbers. The "first draft" is due this Sunday, the "final draft" is …

Member Avatar for miha2
0
2K
Member Avatar for Shawneal

I have just started a basic class in programming and I am totally lost. Can someone help me out? I have to write pseudocodes and create flowchart and don't have a clue. I need help with the following: flowchart, pseudo-code, Input and Output variables, and also an Program Desk Check …

Member Avatar for aasadi
0
261
Member Avatar for Micko

Hello, I'm playing with win API functions readFile and WriteFile. Is it possible to open file using CreateFile in binary mode just like using fopen standard C function. I tried with function WriteFile to write string to a file but it seems that file is opened in textual mode. What …

Member Avatar for progneer.soft
0
8K
Member Avatar for Hey11
Member Avatar for SasseMan
0
99
Member Avatar for j855

I have a question. I have a list of numbers like: Bobby 9 9 8 4 8 5 6 7 3 8 6 5 5 7 6 9 6 4 6 4 3 4 7 6 6 I have already written a code to take the numbers in range (1,15) …

Member Avatar for TrustyTony
0
113
Member Avatar for phfilly

Hi. I would like help on undoing and redoing using the memento design pattern. I want to save a state that a board is in. Like a chessboard. If the user uses the undo option a previous board should be loaded and all of the states that the pieces was …

Member Avatar for phfilly
0
597
Member Avatar for fantasma

Greetings from Portugal I've been stuck for some hours now, since I can't get my n00b code to work as I want. Could someone give me a hint of what to do or what am I doing wrong? I have a file that writes something like this: 1001,Loja1,10 1002,Loja2,20 And …

Member Avatar for fantasma
0
155
Member Avatar for mushahidh

hi evereyone, i have some problem related to graphics in c++ that is when i include graphics.h in my program and use graphic command like draw line etc..then suddenly windows has been closed and messages appears that "NTVDM CPU HAS ENCOUNTERED AN ILLEGAL INSTRUCTION", and some error code and two …

Member Avatar for Taywin
0
154
Member Avatar for Chalandria

Need help please. This program is supposed to be a do while loop and convert fahrenheit to celcius and vise versa using user defined methods but as of right now it just doesn't work. I need to make a do while loop in main method too, but was just trying …

Member Avatar for Taywin
0
137
Member Avatar for babbu

Hi All, I am using visual studio 2005 and Access 2007. I want to update a table in access 2007 using C#.net. I have written the following code but it doesn't seem to work and neither does it throw any error. [CODE] OleDbCommand updateTransactionCost = new OleDbCommand(); updateTransactionCost.Connection = Module1.oledbcon; …

Member Avatar for babbu
0
89
Member Avatar for showman13

OK, I've been searching numerous discussion boards and searching the archives and the web for just the right answer to this question, even posted related questions on a couple, and got some responses, but they never really 'Solved' my dilema. I've concluded that I can't use a url like [url]http://username.domainname.com[/url] …

Member Avatar for showman13
0
179
Member Avatar for Razultull

Alright well im trying to code a multiplication table for a webpage im making. This needs to be in a separate java Servlet as opposed to an inline javascript. Basically the code should output embedded html code something like [code] <table> <tr><td>4*0=0</td><td>4*1=4</td><td>4*2=8</td></tr> <tr><td>5*0=0</td><td>5*1=5</td><td>5*2=10</td></tr> <tr><td>6*0=0</td><td>6*1=6</td><td>6*2=12</td></tr> </table> [/code] There is an HTML …

Member Avatar for Razultull
0
154
Member Avatar for powerson65

Hi i have a program with a JFrame and it has two jpanels on it, one containing the buttons needed and the other which is going to be used for plotting graphs, but when i try to plot an x, y graph on the plotting jpanel it does not show …

Member Avatar for powerson65
0
109
Member Avatar for Bounty Hunter

I am filling a dropdown list and an HTML page with the contents of a MySQL database (the tablename is in the variable $tablename2). The file contains a single field, "BusinessCat", with 20 or so unique records. The code below is an attempt to display every category on an HTML …

Member Avatar for diafol
0
354
Member Avatar for eladreznik

i am trying to create a nextrow button to work with a bound datagridview the problems i have: 1. the row moves down, but the first row is the one who has the focus (the little black triangle is staying to it's left. 2. i am trying to set a …

Member Avatar for eladreznik
0
95
Member Avatar for ybsolar

I want to create a double pointer and make it point to an double dimension array, then output the content of the array through the pointer. However Gcc warn me that "assignment from incompatible pointer type". Just like this: [CODE]#include <stdio.h> #include <stdlib.h> int main() { int i,j; int **p; …

Member Avatar for gerard4143
0
135
Member Avatar for lais90

I wish to change the color of my printf statement. I use following code: [code]#include <stdio.h> #include <stdlib.h> void main() { system("color e"); printf("An enemy appears\n"); system("color c"); printf("This is an apple.\n"); }[/code] I wish to print the statement which is "An enemy appears" in yellow color and "This is …

Member Avatar for mitrmkar
0
714
Member Avatar for xikkub

I'm writing an application to patch assembler instructions according to memory addresses. I have been using C/stdio for FILE operations (fopen, fseek, fprintf), but I would like to have a C++/fstream implementation as well (.open, .seekp, .put). I've had no problems patching file memory with stdio, but fstream/ofstream methods corrupt …

Member Avatar for xikkub
0
234
Member Avatar for myk45

Hello, i have 2 small doubts regarding pointers. 1)im trying to defererence 4 bytes as shown, and im initializiing each byte using a char pointer. But im getting runtime errors. Code [CODE] char a = 65; char *ptr = (char *)malloc(4); int *ptr1; ptr = &a; ptr1 = &a; *ptr …

Member Avatar for myk45
0
265
Member Avatar for bkafroboy69

can anyone help me look over my code? The Course class A Course object should store the department, course number, and course title. It should have linked lists of prerequisites and "subsequents" (the courses for which this course is a prerequisite). The constructor should construct a course given a department, …

Member Avatar for bkafroboy69
0
119
Member Avatar for creeps

This one is pretty strange (or at least I can't figure out what triggers it). I have the piece of code below, but there seems to be a bug with the second call of [icode]scanf[/icode]. It simply gets skipped. So the input should be something like [code] 10 3 fbfbfbfbfb …

Member Avatar for creeps
0
104
Member Avatar for mana_panigrahi

Hi All, Can anybody share PHP code to generate excel file by querying MySQL database. Thanks in advance..

Member Avatar for avocado_juice
0
885
Member Avatar for Naveen

hi can any1 send me the source code to the bellman-ford and djikstra routing algos please? regards, naveen.

Member Avatar for byomakesh mahap
0
138
Member Avatar for caitlins5

Hello, I have an asp form page that works in IE but I receive an error in Firefox that says: "There was an error on this page. Error description: undefined Click OK to continue" Here is the code of the page below: [CODE] <html> <head> <script src="/backoffice/includes/jquery-1.3.2.min.js"></script> <script src="/backoffice/includes/jquery.validate.js"></script> <script …

Member Avatar for ArtistScope
0
202
Member Avatar for getack

We have this massive project due tomorrow - a chess game that enables two or more players to play against each other. We have a board class, that contains a 2D array of Piece object pointers representing the lay area of the board. In the board constructor, the Piece array …

Member Avatar for getack
0
259
Member Avatar for TechySafi

Wait you don't need to read the whole things :) Just scroll down, and see what I've asked :) [CODE]stdClass Object ( [friends_count] => 54 [description] => i'TS THE digiTAL vERSiOn 0b devilZ! tECH & mUUsic fReak. sImpLE buT.......! [screen_name] => 2020Volt [profile_sidebar_border_color] => 181A1E [status] => stdClass Object ( …

Member Avatar for TechySafi
0
160
Member Avatar for richies

public class Test { public static void main(String[] args) { int max = 0; max(1, 2, max); System.out.println(max); } public ststic void max( int value1, int value2, int max) { if (value1 > value2) max = value1; else max = value2; } }

Member Avatar for stultuske
0
120
Member Avatar for ceyesuma

Hello I am trying to get to a Component On a JInternalFrame. I have a reference to the frame on the frame there is a panel. on the panel there is a JTabbedPane. to add a tab to the JTabbedPane I need to reference the Pane. Is there a way …

Member Avatar for ceyesuma
0
169
Member Avatar for Robban

Hi, I have a javaproblem that I just can't solve. "Write a [B]recursive[/B] method who returns the largest value in an array with the signature: [CODE]public int max(int[] v)[/CODE] (Hint: If you need to, use a private help-method) It would be easy if it was allowed to change the signature …

Member Avatar for JamesCherrill
0
190
Member Avatar for moufoo

Hello, It's been a few months since I haven't been able to launch Codeblock's debugger, when I launch the debugger I always get this (example): [B]Adding source dir: C:\Users\Me\Desktop\L2\SDD\TP2\ Adding file: bin\Debug\TP2.exe Starting debugger: failed[/B] I have tried: [LIST] [*]Reinstalling [*]Reinstalling (uninstall done using Revo Uninstaller) [*]Installing latest version of …

Member Avatar for Ancient Dragon
0
737
Member Avatar for shelexelex

hi everyone. my name is chris..i am new to javw pogramming i just have the feelings that i can get what i hv been looking for here.. i startd reading java sometimes ago and i got chocked whn i got to evnt handling... i relly wantto be a java pogrammer..i …

Member Avatar for shelexelex
0
104
Member Avatar for jdiddy

hi, i am creating a small program for an assignment to store and retrieve information from a database. I have created arraylists to add and retrieve the data. just wondering if i am going about it the right way. One of the problems is that when the information is displayed …

Member Avatar for jdiddy
0
88
Member Avatar for saraswathy6

Hi, I need to call a public static method that returns in xslt. I'm using jstl to do the transformation and hence using the jaxp parser which would use XSLTC or Xalan internally. The way I have the namespacee declaration for my xslt is <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:autn="http://schemas.autonomy.com/aci/" xmlns:myUtil="http://xml.apache.org/xalan/java/com.csa.porter.scat.CategoryUtils" xmlns:java="http://xml.apache.org/xalan/java" …

Member Avatar for saraswathy6
0
617
Member Avatar for jmcorpse

I just need a little advice. This code I have written works well. The only problem I am having is that the output is not lining up and I don't know what to do. If everything was entered line by line I could get it to line up. Since it …

Member Avatar for Ancient Dragon
0
73
Member Avatar for KrazyKitsune

I'm working on a self-project called 'Project Calculus' (Not that you care about the name). It's a huge calculator that works cross-platform and only uses 'already implemented' modules (So no SymPy, no NumPy, no SciPy, et cetera.) in it. I need help (If you even bother to cooperate with a …

Member Avatar for KrazyKitsune
0
126
Member Avatar for ivan3510

Hi! Sorry for my bad english! I want to make a function that will replace "[LINK=url]Some text[/LINK]" with "<a href=url>Some text</a>". I tried, but the code is too long. Is there any shorter code for this. Here's how I do this (but this code make only first [LINK] into <a …

Member Avatar for ivan3510
0
151

The End.