64,152 Solved Topics
Remove Filter ![]() | |
Hello, I’m trying to increment numbers in a file – for instance, I would like to change the below 3 lines in a file by incrementing the numbers by 2 (or whatever the user gives). Mikef<20:40> JoeyS<23> Samt<14:39> So the end results should look like this: Mikef<22:42> JoeyS<25> Samt<16:41> I … | |
I am very new to python and I have this code that I wrote... I am trying to make it so the turtle will bounce if it touches any of the box.. but somehow the turtle does not fuction the way it suppose.. I wonder can anyone give me a … | |
What are the ways to find substring in string in Python? Which way is most effiecient? | |
What is the best way to sort a list of words with the case insensitive? | |
Could someone help me with this. I need to know how to write this in code for C. "if hashValue(variable) has a non-zero bit in the 4 leftmost (highest) bits" It has to do with bitwise shifting and is basically just an if statement's condition. Thanks | |
Hello, I'm very new to python script and I am attempting to understand a part of a program developed at my work place because the have the most computer knowledge here, though still very little and the person who developed the program is no longer accesible. Here's the problem i'm … | |
I'm almost done with my project, due in great part to the support and well-reasoned criticism here at Daniweb. But there's one last little problem that's only hitting me in release mode. In debug, the following function works fine to set information from a user-entered string to the CString/CString Map. … | |
ok, so i have been working on a program that i call "Sharppad" any ways it is a text editor. it has all teh basic functions. but it can also speak teh text you type. and convert text to .wav files. so you can listen to what you type. it … | |
I hear a lot about PyGame for writing games and that I understand is SDL in a Python coat. Is DirectX used in a similar fashon? Any examples? | |
Alright, I think my previous post about this subject was very confusing so I will try again. First off I appreciate all the responses to my prior post (Setting a Variable to the Exit Code). It is my understanding that when a script completes it returns an exit code. I … | |
sizeof (int) gives me 4 bytes...is it sufficient to say that my machine is of type 32-bit | |
Hello to all!How can i make a list from all the small letters of the alphabet without writing every one?Is there an operator/function that does that,something like ['a'-'z'].I've tried in many ways but i'm new in Python and if there is that operator i haven't discover it yet.My appreciation! | |
Ok well I've hit a snag... i'm trying to write a program that makes Acronyms from user input... I can get all the letters capitalize, but the problem i am having is, well, taking the first letter from each and puting them together to make an acronym!!!!! | |
Hey everybody... Does sombody knows how can i use the getattr function in order to call to a sub function defined inside another one? somthing like this code: # ---------------------------- def func1 (self, func_name) : def func2 () : print "Blaaaa" def func3 () : print "Yaaaaa" getattr(?, func_name)() self.func1("func3") … | |
I have been doing most all of my python programming in a linux bash shell. I mean I run all of my scripts from a bash shell. If my script produces an error(hardly ever happens :-), the error is outputted to the shell, so I am able to fix it. … | |
#include<stdio.h> int main() { float f1,f2,f; double d1,d2,d; char s1[]="2.0045",s2[]="1.00056"; f1=atof(s1); f2=atof(s2); f=f1-f2; d1=atof(s1); d2=atof(s2); d=d1-d2; printf("\n%s %s",s1,s2); printf("\n%f %f : %f",f1,f2,f); printf("\n%ld %ld : %d\n",d1,d2,d); return 1; } Output: 2.0045 1.00056 1271310336.000000 869988544.000000 : 401321792.000000 -67108864 1104343465 : 1870659584 Desired Output: 2.0045 1.00056 2.0045 1.00056 : 1.00394 2.0045 1.00056 … | |
Ive searched through google and most are not free, and the ones that are are being declared have a virus inside by norton as well as ewido. BTW im trying to do this because there was a PSP (playstation protable bin loader released) [URL=http://www.psp-hacks.com]website and article here[/URL]. I wanted to … | |
I am just starting to look at writing class in Python. Can a class that I write inherit Python calendar? | |
Does anyone have a meaningfull example of the use of the Profiler included in Python? | |
I know that lambda is some kind of function in Python. What does it do? Why would one use it? | |
I hope the spelling isn't too far off, but what is list comprehension statement and why would one use it? | |
Hello! I'm a total dummy when it comes to programming, and now I have a heck of a data extracing job to do for my graduation thesis :cry: Hopefully somebody can help me in the right direction here, because a whole day of surfing didn't get me to the right … | |
hey, um i was wondering if anyone could help me with a program where if the user inputs a number no more than 5 digits and the program tells you how many times the number 2 appears in that number. i know that the modulus and division have to be … | |
[B]Python and the JPEG Image File, Part 1, The Header[/B] [B]Intro[/B] The JPEG image file format (.jpg) is very popular on the internet because you can pack a lot of picture information into a relatively small file. There are competing file formats like GIF and PNG. GIF is rather limited … | |
:mrgreen: I've just started learning and doing examples out of the book but I wanted to see if I could actually make something besides just copying stuff out of a book. So I tried to make an addition calculator. This isnt the entire source code but just a few snippets … | |
Can anyone help us out in this dept, everytime I go through my program when it terminates I get the famous windows: "main.exe has encountered a problem and needs to close. We are sorry for the inconvencience ........ Debug, Send Error Report, Don't Send Yep that one... Can anyone offer … | |
[php] hangman::hangman( char * surname, int size) { name = new char[size]; encryption = new char[size]; strcpy(name,surname); for (int i = 0 ;i <size; i++) { encryption[i]='*'; } lives = 5; found = 0; } [/php] encryption seems to be heading over its borders!! the size = 45 ; I've … | |
Hi all, I have a problem that is hopefully easy to solve for you guys: I have written a rather large C++ program as part of my Master's. Now, I have to use an open source C-library ([url]http://www.tbi.univie.ac.at/~ivo/RNA/RNAlib_toc.html[/url]). I have never tried to combine C and C++. To figure out … | |
[php] int j; for ( j= 0 ;j <sizeOfArray ; j++) { if( letter == array2[j] ) { ++found ; encryption[j] = array2[j]; } } if ( array2[j] =='\0' && found!=0) { cout << "not found" <<endl; --looselife; cout << "You now have" << looselife << "remianing" <<endl; } [/php] … | |
[code] char *name; cout<<name; [/code] and [code] char*name; name=new char[20]; cout<<name;[/code] both of these work....then why do i need memory allocation....where does the first code fails | |
[B]Intro[/B] When you declare an integer variable in C, the variable is assigned a fixed memory location with enough space to hold the type integer. When you then initialize the variable with a value, the value is put into that space. Take a look at the C code sample below: … | |
Hi everyone, I require some help for this project I am currently working on. Basically what I have to do is read from two text files, then calculate some numbers from both files (eg: add the numbers and average them) and after that, write the results to a another file. … | |
I am currently finishing up my B.S. in Computer Science at a local private University. When I started a couple of years ago, C++ was taught in the intro to programming course for freshmen. About two years later, Java was taught as a first language. (I disagree with that because … | |
Is there a way one can interrupt the sleep() function with a key press in Python? | |
For my simple programs I have wirtten, I have just been using a simple editer with syntax highlighting. This seems sufficient. What kinds of thing can a good IDE do for me? | |
Couldn't sleep last night, so I was browsing and found the "Starting Python" thingy. I must say Python looks interesting from the examples. I learned C++ in school, Python sure looks easier to understand. Does any one think it's better than C++? | |
ok so i open notepad and paste this code [code] ContactsXPortPath As String = "E:\Ipod\Contacts" Const CalendarXPortPath As String = "E:\Ipod\Calendars" Const NotesXPortPath As String = "E:\Ipod\Notes" Const EmailXPortPath As String = "E:\Ipod\Notes" Sub ExportAll() ExportToVCard ExportToiCalendar ExportToText ExportToEmail MsgBox ("Export to iPod Complete") End Sub Sub ExportToVCard() Dim ns … | |
Why are my exceptions not working? here is the teststack.cpp #include <iostream> #include <iomanip> #include "teststack.h" using namespace std; struct StackFullException { StackFullException(); }; StackFullException::StackFullException() { cout << "The stack is full."; } struct StackEmptyException { StackEmptyException(); }; StackEmptyException::StackEmptyException() { cout << "The stack is empty."; } Here is the … | |
Python is relatively new to me. I have mostly programmed in C and C++. I read that Python has a good build-in debugger, but I can not understand the information in the reference manual. Can anybody please give an actual commented example how this works. | |
Hello all what i am really trying to do is to use POST method to send info to next page with just HYPERLINK; Here is what i want: Get method: [CODE] <a href="http://www.someting.com?date=9/15/05&age=21">age and time</a> [/CODE] I want this to be in POST method without using forms. also i am … | |
Hello, noob here. I just started taking a C++ class this semester and I've been understanding everything so far, but I'm sorta confused on the nested if statements. My homework is to have the user enter a number and it'll show the roman numeral. However whenever someone enters an invalid … | |
hello fellows, I seem to have a little problem: I tried to use the function getattr([I]object[/I], [I]attribute[/I]) with two strings which is being read from a xml file as arguments, and seem to have a problem with sending the first one as a string. the function thinks that the string … | |
Hi, I am looking for a text justification algorithm that fully justifies the text. I suppose that I could design one of my own. However, why reinvent the wheel? I tried googling and doing other stuff, but it surprisingly was unable to find anything useful. Any help will be greatly … | |
I have a vector of objects of the Virus class. This vector is called 'Viruses.' I have a deque of objects of the Host class. Each Host class object has a deque of pointers to Virus objects, i.e., deque< Virus * > currentInfections Each Host object is randomly infected with … | |
I have read vegaseat's "Projects for the Beginner" sticky and got really interrested in the eqaution solver for physics or mathematics problem. I just need a little Python hint how to get this started. | |
Thanks a lot for the help on my last question. I have another problem that I need help with. I need to generate the check digit for an ISBN number. Like if the input is 076372339 the function should return 8. To find the check digit, which is the last … | |
I know Python has adopted Java's decorator, but I can not make much sense from the reference manual example. It would be nice if soemone could give a good example of the implimentation of a Python function decorator. | |
What is wrong with this: [code] for(int b = 0;b < c.length();b++) { temp[b] << S.Pop(); // or temp[b] = S.Pop(); } [/code] to have a string made up of the contents of the stack? When I do this and cout << temp, temp is blank. This iterates through the … | |
What is happening here? [code] void palindromemgr(ifstream& in, ofstream& out, Stack& S) { string c; //candidate while (true) { cout << "entering first loop" << endl; //debugging line if (in.eof()) break; in >> c; cout << "this is the value in c :" << c << endl; //debugging line for … | |
Okay, another easy one, but I can't remember how to do it. I have a table that I want to be able to update multiple records in. I thought I could just run an update query, but I have 2 yes/no fields and one text field that I want to … |
The End.