Hello.
I came across a program with 10 header and 10 source files. I read in my text book that the functions are called from main. But how can I pass data to so many functions from main()?
Compiling my program I have this error:
/usr/include/xercesc/util/Compilers/GCCDefs.hpp:133:60: error: declaration of ‘int strcasecmp(const char*, const char*)’ has a different exception specifier
/usr/include/string.h:536:12: error: from previous declaration ‘int strcasecmp(const char*, const char*) throw ()’
make: *** [src/test/VFTImageMaterial.o] Error 1
Any idea about this conflict with string.h?
The question is how to write a program that measures how many times a character appears in a string in a generalizable way in python.
The code that I wrote:
def countLetters(str, ch):
count=0
index=0
for ch in str:
if ch==str[index]:
count=count+1
index=index+1
print count
when I use this function, it measures the length of the string instead of how many times the character occurs in the string. What did I do wrong? What is the right way to write this code?
i try to write this code to process Arabic language by python
import codecs
file = codecs.open("C:\Python27\CCA_raw_utf8.txt","r","utf-8")
text= file.read()
####################################
print "\n "," --------------------------------------------"
text=text[1:]
words=text.split()
for w in words:
if w == unicode ("?????","utf-8"):
print w
but it doesn't and take error " if w == unicode ("?????","utf-8"):
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc7 in position 0: invalid continuation byte "
why program gives this result and how we can correct that??
I want to make a program to wake me up, but if I leave it and go to sleep the pc ends up sleeping.
How can I force it to never sleep if this application is running?
I'm on Windows 7 x64.
Hi all,
In my project im using numeric up down extender, when i run my program numeric up down extender was displayed in firefox but not in Internet explorer 8. Give me a solution.
Hello there,
I was reading a little into Visual Basic and it seemed a rather simple way to implement some GUI...So I was looking for a way to interface my C++ code to a Visual Basic snippet of code. For example, receive input from a Visual Basic app and send it over to C++ code to continue the logic of the program based on the input of that event.
i need to write a program that counts the number of nodes from a certain level given in binary
tree
i mean < numberofnodes(int level){}
i tried writing it without any success because i don't how to get to a certain level then go
to count number of nodes
Hi Could anyone give me a sample program to "Create an ApplyRemoveConst template that
constructs a new typelist with remove_const applied to each element"
For example:
typedef TYPELIST_3(A, const B, B) TL;
typedef ApplyRemoveConst::Result TL2;
// TL2 is the same as TYPELIST_3(A, B, B)
Is there anything that stops the DateTime AddDays() method that doesn't run within a while loop. I have this simple bit of code;
DateTime last_day = monthCalendar2.SelectionRange.End;
DateTime first_day = new DateTime(year, month, day);
//Insert dates into vector
while (first_day != last_day)
{
dates.Add(first_day);
first_day.AddDays(1);
}
I step through the program and first_day never changes, anyone know why?!
Hello!
I imported inpout32.dll to the program and tried to do the parallel port interfacing for outputting and inputting through the port.
But when the execution reaches the statement PortAccess.Output(888,0); it throws the above exception. The PortAccess class is defined in the inpout32.dll file which i downloaded from www.logix4u.net.
Can anyone help me with this?
Hi,
I have program which writes to database which folders are full or empty. Now I'm using
bool hasFiles=false;
(Directory.GetFiles(path).Length 0) ? hasFiles=true: hasFiles=false;
but it takes almost one hour, and I can't do anything in this time.
Is there any fastest way to check if folder has any file ?
I wrote a small MATLAB program with a gui. Inside the gui I have, among other things, a plot in which the user should be able to select two points. For this I use the function ginput, which creates a crosshair for selection. Unfortunatley the crosshair extends the whole window and is not restricted to the plot, which doesn't look nice and is confusing for the user. How can the crosshair be restricted only to the area of the plot?
I just came back to C++ Builder after 5 or more years away. I seem to remember a nice tool where I could drag its pointer over the GUI of my running application and get lots of info about what was pointed at - handle, size, text, parent, children, etc
IIRC, if the exe include debug info I could also get the actual variable name as used in the source.
Does anyone know what program I am talking about? Thanks
I would like to create a C# program that creates an MSI based on a number of parameters. For example, based on user settings, certain files would be included, or runtime parameters set.
Can anyone point me towards any documentation that might help, or give me an idea where I might start with something like this?
I am developing a WPF client program for some websites. It uses XML database. I am new to XML. Would someone please explain how to create,append(Most important),edit,read&encrypt XML file. It is a big question,i know . But, it is urgent.Have to complete the work ASAP. Searched in the internet, not getting correct info.
Hi,
The same compiled .Net / C++ / Com program does different things on two seemingly same computers. Both have DOZENS of things installed on them. I would like to figure out what the difference between the two is by looking at an ASCII diff. Before that I need to "serialize" the list of installed things in a plain readable format - sorted alphabetically + one item per line.
A Python script would be ideal, but I also have Perl, PowerShell installed.
Thank you.
CodeBlocks is not linking extension SDL Libraries like SDL_mixer and SDL_image? I followed Lazy Foo's tutorial for SDL 1.2 but I am compiling my program in SDL 2.0. The compiler is showing an error with the linking of the libraries though without the mixer library it is working.
My linker setting look like this.
//This is working
-lmingw32 -lSDL2main -lSDL2
//But with the additional mixer library it is not working
-lmingw32 -lSDL2main -lSDL2 -lSDL_mixer
Please help!
I'm doing a little program and I want to distribute using this recipe:
single directory with _main_.py in it
zip this directory and echo #!/usr/bin/env python\n file.zip
making it executable
The problem is that in this package I have also extra files (I'm using pygtk toolkit and I need images and ui xml files). When I try to access these files I have the error that the resource is unavailable (the path that I'm trying to open is something like file.zip/gui/gui.ui ).
How can I handle this situation?
Hi,I have a DataSet with some Datatables and I am saving this DataSet as XML file (C#) ..is there any way to load only some parts of this XML file into the DataSet when I start my program instead of loading all the file ?
Hi there, I'm having trouble working this out. Basically my program has a standard input, I want to modify this so if the user enters a space it automatically replaces it with a / whilst they're typing. I have no idea how i'd even go about doing this or if it is even possible so I am grateful for any help either way.
Hello,
I am just wondering why programmers who program in C++ for windows always use Visual Studio 6 instead of Visual Studio 2008?
Isn't the compiler in 2008 much better than the one in VS6?
The reason I ask as I have used many sdk's that are always written in VS6?
Many thanks,
Steve