64,152 Solved Topics
Remove Filter ![]() | |
How do I have the algorithm below to sort my list in opposite direction (right to left) instead of left to right. Also, how do I make it sort simultaneously or alternatively in both directions? Thanks. [code=python] def bubblesort(l): for passes in range(len(l)-1, 0, -1): for index in range(passes): if … | |
hi I'm doing an exercise from a book, where I created a project called "Example.cs". When I wrote the code, here are the steps involve: 1. Select New Item. This causes the Add New Item dialog to be displayed. Select Code File and then change the name to Example.cs, 2.Next, … | |
I am getting further with my Property to let program, but i need help working out the above error, it happens when the user selects the option to delete a property from the text file. The user is supposed to be able to enter in a number and that deletes … | |
I have a table off which I need to parse out the data using certain criteria. The table contains 3 datetime columns called '[B]ReadingTakenOn[/B]', '[B]StartedOn[/B]', and '[B]StoppedOn[/B]' Here's the criteria for selecting the records: The Dates in the 'ReadingTakenOn' column should lie between the Start Date and Stop Dates (both … | |
Is there anyway to compare lists or check to see how many of the objects in one list are the same as the other list? eg: L1 = [dog, cat, john, moo] L2 = [dog, cow, moo, stuff] there is two of the same "things" in it I'm trying to … | |
Hi, Here's my code [code] #include<iostream> #include<fstream> #include<string.h> #include<math.h> #include<stdlib.h> #include<stdio.h> using namespace std; int cIndex(char *x,char **featlist,int len) { int i; for(i=0;i<len;i++) if(strcmp(x,featlist[i])==0) return i; } int main(int argc,char *argv[]) { std::ifstream featFile(argv[1],ios::in); std::ifstream trainFile(argv[2],ios::in); // std::ofstream svmFile(argv[3],ios::out); char line[20000]; char feat[100]; char **featlist; int i=0,len=0,fl=0,j; char* x; int … | |
hi,i m making a windows forms application and i want to make a treeview which displays input of textbox Under the Parent Node . i have tried searching over the internet,but nothing seems to be working. i have added the parent nodes from the properties tab,but how do i change … | |
[QUOTE]Hi I have an INSERT INTO SQL that keeps on retuning an Syntax error in Insert Into. I cant seam to see where the error is, can anyone Help. This is my SQL.[/QUOTE] [ICODE]Dim DesignSQL As String = "INSERT INTO Design_tbl (CustmrID,[User],Builder,Model,Type) values ('" & _ CustID & "', '" … | |
Plink is a command-line version of PuTTY, a Windows SSH client program. I am trying to get the output from plink to display in a textbox within a VB form. I can get it to work but I must hit the ENTER key twice before it shows anything, everytime. So … | |
how do I get the maximum, minimum and the average of an array? this may be different but how do I get to stop inputting number in an array. for example if the array is 20 and i only need 10 of them. i think its something about EOF but … | |
Hi, Following code snippet show the maximum number of nodes to be created. I execute this code and show the count : 7874 My problem is that I want to create more node than 7874. I have compiled this code by Turboc version 3.0 on Windows XP. [CODE]#include <stdio.h> #include … | |
Hello, all: I am trying to get this script to work... What I'm trying to do is to be able to email back customers whose emails I have saved on in my database. So pretty much the emails get sent as it runs the "while" loop. Somehow it doesnt seem … | |
hi, i have spent more than whole day trying to figure out what is wrong in this php sript LINE 3 AND 14, ihave changed the quotes, but it didnt work, it works normal when you enter the date to GUESS THE NUMBER, but in the start page the ERROR … | |
hi everyone! I have two files, main.py and sprite_class.py. sprite_class.py is in a separate folder called lib. here's a quick diagram: ------------------------------------ /folder engine/ main.py /folder lib/ sprite_class.py ------------------------------------ ...sprite_class.py contains a class called Sprite: [CODE] # sprite class class Sprite(): def __init__( self, start_x, start_y, image_path ): self.x = … | |
Hello, I have a form that has several checkboxes. It looks similar to this: [CODE]<input name="service_needed[]" type="checkbox" value="service1" class="checkbox" /> <input name="service_needed[]" type="checkbox" value="service2" class="checkbox" /> <input name="service_needed[]" type="checkbox" value="service3" class="checkbox" /> [/CODE] I'm trying to store the values of whichever boxes are checked inside of one variable so that … | |
Hey everybody, I need a bit of help please. I need to create an 8086 application that will draw a line between two points on the screen that you click on. It's using Bresenham's line algorithm to do the calculations between the two points. I'm using Tasm and Tlink to … | |
Hey guys, How would I partially specilize a template in a manner as below? Is that even possible? I have these two functions: [code=cpp] bool node::read(const char *filename) { ifstream f(filename); if (!f.good()) return false; bool success = read(f); f.close(); return success; } bool node::write(const char *filename) { ofstream f(filename); … | |
hello, i have just begining learn php, in this form every things looks ok, however a error message that i can't solve it. please give some help because i cant move on before solve this problem. thanks **HTML FORM CODE** <html> <head> <title>simple HTML FORM</title> </head> <body> <form method="post" action="listing9.2.php"> … | |
Well, I don't want to do lot of copy-paste in my code, so, I'm just wondering - is it possible to have two different names of one functions(I prefer that function name describe what is used for): ex: [CODE]int do_my_client(int info) { blah blah blah; .... .... return inf; } … | |
Hi there, I am having a problem with the following code: [CODE]#include <iostream> #include <string> #include <fstream> using namespace std; int findRows( string line ); int main() { string line; int rows = findRows( line ); cout << "Number of rows: " << rows << endl; } int findRows( string … | |
Following is my client code....I am receiving data of equal size of JPG file... so if anyone can help me out with reading buffer properly and writing it in to jpg file at client side ================================================ do { memset(buffer,0x0,BUFFER_SIZE); // init line rc = read(sd, buffer, BUFFER_SIZE); if( rc > … | |
Hi, I am expected to use sscanf function in a program, but I couldn't understand how it works. Can you explain it with an easy example? Thanks -- newbiecoder | |
I have a drop down box in a form like this... [code]<select name="product[]" id="unitcost"> <option value="92">92mm</option> <option value="130">130mm</option> </select>[/code] The value selected is passed to a shopping cart. However, I also need to pass a unit price which is different depending on the value selected. Can anyone give me any … | |
I'm having a problem with the substr function. I want it to be dynamic in a for loop as follows: [code="perl"] for ($i = substr $bin, $sub, 1 ; $sub < $len2 ; $sub++){ [/code] You can probably guess what this code is meant to do. I want to read … | |
Hi, I've written a program that reads object information from an ASCII file (exported from 3dsmax) so that an object/objects can be reproduced in OpenGL. It works fine at the minute and can read multiple objects from a single file but what I want to be able to do is … | |
Hello everyone, first little explanation about what i want my program to do: i use wget to download a webpage but instead of downloading it into a file i want the webpage sourcecode in a variable so that i can parse it and put it in a database later. Now … | |
Hi folks, I need a little help working out a 2 tier navigation that is database driven as I'll need to use CMS to insert new categories and topics at a later date. The navigation is in unordered list format looking similar to below. Two category listed navigation with two … | |
Hi, I dont know much about programming, however I have a c++ program(i didnt write it) that I need to use it to do some experiments. When I compile the program I get this errror. [code] dynn.cpp: In function ‘void make_near()’: dynn.cpp:374: error: name lookup of ‘j’ changed for new … | |
First off thanks in advance, everyone here has been a great help in the past and know you will be this time.. What i'm trying to achomplish is to submit data from a form into multipule tables in the Mysql DB. However I want the user to select which table … | |
Hi, I have a question with ofstream, is there anyway to ask the user for a file name, then create the file, and write to it? Like: [CODE] string file; cout << "Enter filename:"; getline(cin, file); ofstream ofile; ofile.open(file); ofile << (stuff....); ofile.close; [/CODE] ...except that doesn't work properly.:S Thanks … | |
I need to perform a sha-1 hash on a byte array. The byte array needs to be hashed with all combinations of a minimum of 4 bytes to a maximum of all 9 bytes of the following bytes: 00 01 02 03 04 05 06 07 08 So the following … | |
Hello, Im currently writing code for a program that translates a line of text from English into German then back again. Its a big loop that needs to be executed the same number of times as words in the text. I'm almost there but there doesn't seem to be anything … | |
the code seems to be fine dont know why its not working. when i execute the same sql directly in database it works fine. the error is get is oledbexception was unhandled syntax error in from clause. please help me thanks is advance. Private Sub Button2_Click(ByVal sender As System.Object, ByVal … | |
I've gotten about 90% of this program done, but I can't seem to figure out how to do one last operation in it that is needed. What I'm having a hard time figuring out, is how to make a total for each person in the file? I'm sure it's deceptively … | |
I am having a problem getting a value from my dictionary object. The TryGetValue Method returns true which indicates that it is finding the key in the dictionary but emps variable is not being populated with the value in the dictionary. What am I doing wrong? thanks for your help! … | |
I am new to Win32 API and am having trouble setting up the menu. Here is what I have at the moment (my new way of doing the main.cpp code is from another member) but I cannot understand where to put in the function call for the menu.. main.cpp [code] … | |
ok, hi all, i have a problem, i want to check all values and keys from $_POST or $_GET files. My checkings criteria are: 1-) the key must be set; 2-) values must not be empty. Because $_POST and $_GET values is a array i have the following code: [CODE=php] … | |
ok so i wanted to make a number randomiser like so: [CODE]#include <iostream> #include <windows.h> using namespace std; int main() { srand((unsigned)time(0)); int random_integer; for(int index=0; index<20; index++){ random_integer = (rand()%60)+1; MessageBox(NULL, "Random Number: ", "Bingo",MB_OK | MB_ICONINFORMATION); Sleep(2000); } return 0; } I want to put the randon_integer result … | |
Hello all, I have this strange problem. 1. I have one file in a sub directory which has code for displaying images - images are stored in main directory . 2. Now the reference to that image is retrieved from MySQL database table row[image]. here is the code i am … | |
relative php noob needs help, have tried 3 or 4 differnet ways to get an image along with other post data from an html form to save into a mysql db. other data saves fine, no luck at all with image. php and form code below. HELP. Thanks in advance. … | |
I have two files and I would like to call addition function from functions.cpp in main.cpp. But I get error: [COLOR="Red"]In function `int main()': error: `addition' has both `extern' and initializer error: initializer expression list treated as compound expression warning: left-hand operand of comma has no effect error: `addition' cannot … | |
Hey everyone, I'm writing a program with a Tkinter GUI for my job and I was wondering whether there is a way to create an icon on my desktop to start it so I don't have to start Idle and run the program from that (computer un-savvy people will need … | |
![]() | The page in question is located at [URL="http://www.uforecordingsusa.com/contact.asp"]www.uforecordingsusa.com/contact.asp[/URL]. I'm integrating reCaptcha ASP code I obtained and having trouble w/ catpcha validation. I've fixed some minor syntax issues (I think) from the original code as well as expanding the cdoConfig.Fields. I've got Javascript code checking the required contact form fields: Name, … ![]() |
Im writing this program that draws a bar graph showing an investment growth. and this error keeps coming up and i cant figure it out. this is the syntax that python keeps telling me. Traceback (most recent call last): File "C:\Python26\lala.py", line 68, in <module> main() File "C:\Python26\lala.py", line 47, … | |
I am embedding Python 3.0.1 on Windows, using MSVC 2008 sp1. I do not pass FILE* structs to Python, so I think compiler version differences is not a problem. The following code has a problem, in that the "txt" string that comes out at the end only contains the character … | |
Hey, I'm writing a function that searches for an id in an array of a structure, for some reason it returns -1 everytime, so I was just hoping another set of eyes could help me clarify this. [code=cplusplus] int searchAr(student studentar [], int size, int searchid) { int i; for(i … | |
I am new to C++ and am trying to do this [CODE]void rolodex::createCard(){ char* userData = "\0"; cout << "\n\nEnter first Name - "; cin >> userData; currentCard.setFirstName(userData); cout << currentCard.getFirstName(); count++; } [/CODE] when I try to execute it gives me an unhandled exception, access violation error What am … | |
I'm new to C++, and I have a function, [inlinecode]char* parse( char* buf, char* find_this )[/inlinecode] which finds an instance of [inlinecode]find_this[/inlinecode] inside of [inlinecode]buf[/inlinecode]. Once it finds that, it looks ahead in the [inlinecode]buf[/inlinecode] text, (which is actually JSON formatted) finds the value in the text, and it returns … | |
I'm trying to figure the topic out. To begin, lets say I have different sets of points in a file with the following format: 2 //1st number represents number of points within set 3, 4 //following lines are points 5, 6 3 3, 4 5, 6 6, 2 ..etc I … | |
I am trying to execute this program, but I am getting errors this is the code [CODE] import java.util.*; public class DateUtils { static final int MILLS_IN_DAY = 24*60*60*1000; public static Date getCurrentDate() { GregorianCalendar currentDate = new GregorianCalendar(); currentDate.set(Calendar.HOUR,0); currentDate.set(Calendar.MINUTE,0); currentDate.set(Calendar.SECOND,0); return currentDate.getTime(); } public static Date createDate(int year, … |
The End.