137 Posted Topics

Member Avatar for GDICommander

Hi, everyone! I'm writing a program in C# that needs to know opened files in a Photoshop CS4 window. The old versions of Photoshop have a MDIClient window in the program that can be getted with GetWindow() and GetClassName() calls. So, I can get the name from the window title …

0
175
Member Avatar for harshadap

Check this page: [url]http://java.sun.com/j2se/1.4.2/docs/api/java/util/Random.html[/url]

Member Avatar for harshadap
0
126
Member Avatar for Acute

Looks good, but there is a piece of code I would like to show you: if(is_door_opened==true) You can simplify this conditionnal expression with: if (IsDoorOpened()) and make this method private, if no other entity external to the class has a need for it. This is a refactoring tip (Simplify Conditional …

Member Avatar for Acute
-2
126
Member Avatar for iammfa

For the step 13, it tells Visual Studio to include these libraries for the link, because the functions you are using with SDL are implemented in these libraries. The librairies must be in the additional library directories (in Linker/General) or in C:\Program Files\Microsoft Visual Studio (your number)\VC\lib.

Member Avatar for GDICommander
0
143
Member Avatar for invisi

If you are using UNIX, you can use valgrind to check for memory leaks. You need to add --tool=memcheck on the command line to check for leaks.

Member Avatar for invisi
0
141
Member Avatar for group256

[url]http://www.codeguru.com/forum/showthread.php?t=366064[/url] You can use std::sort with a STL container, like a vector or a list. You will need to write a function that determines if a element is greater that an other one.

Member Avatar for GDICommander
0
233
Member Avatar for Aprentchacker

Are you sure that the file denoted with the name you provided exists? I'm pretty sure that the answer is yes, but do you really have gSize vertices in your file? Do you really have a line at each end of a vertex definition in your file that is -999? …

Member Avatar for Aprentchacker
0
170
Member Avatar for vivekarora

This site helped me a lot to understand the design patterns: [url]http://sourcemaking.com/design_patterns[/url]

Member Avatar for mrnutty
0
122
Member Avatar for methmignonne

It is normal that you jump directly to system("pause") when the operator is not correct the first time. You are leaving the if-else clause after the second input prompt. You should do something like... while(input is not correct) { //Ask for input //Verify it. }

Member Avatar for methmignonne
0
312
Member Avatar for jko2326

You should pay attention to how you have divided your problem into functions. A function like computeCommission(int price) can be useful...

Member Avatar for GDICommander
0
146
Member Avatar for Majestics
Member Avatar for blsnls

This behavior is expected, because the operator >> of cin reads input in his stream until a end-of-line or a whitespace is found. So, the next operator>> call finds remaining input (the other words after the whitespace) in the cin buffer and takes the data. If you want to prevent …

Member Avatar for mrnutty
0
85
Member Avatar for trikker

[url]http://www.csse.monash.edu.au/~jonmc/CSE2305/Topics/10.19.OpOverload/html/text.html[/url] On this page, look the Complex class example at the bottom. It explains that you need to declare the prototype of the function as "friend" in the class.

Member Avatar for GDICommander
0
146
Member Avatar for GDICommander

Hello everyone! I'm having a bad time trying to find a solution to my problem: I'm developping a client-server application. On the server side, I am calling a method, Recoit (receive), that calls internally msgrcv(), a UNIX system call for message-passing purposes. The problem is that I always receive a …

0
74
Member Avatar for GDICommander

Hello, everyone! It's been a long time using C++ and I have a link problem. This is the code... [CODE] #include <iostream> #include "libc++/pcslib.h" int main() { std::cout << "About to load the server and all the clients." << std::endl; Pcs serverProcess("server"); Pcs clientProcess("client"); serverProcess.Join(); clientProcess.Join(); std::cout << "After joining …

Member Avatar for GDICommander
0
116
Member Avatar for GDICommander

Hello everyone! I'm looking for a class in the Java API that can take the complete structure of a directory in itself and that can be passed on sockets, so it can be used on other machines of a network. Is there someone that can show me an existing class? …

Member Avatar for kvprajapati
0
107
Member Avatar for GDICommander

Hello, everyone! I have a problem with memory free. Here is the necessary code to understand the problem: [CODE] void fillArray(char** referenceArray, FILE* grid) { //Chaîne qui va contenir une ligne du fichier. char* lineContent = malloc((width + 1) * sizeof(char)); //Pour contenir le "\0" int i, j; for (i …

Member Avatar for jephthah
0
302
Member Avatar for GDICommander

Hello everyone! I'm developping a chat application in a client/server context and every client has a shared directory. I want the server to know the directory structure of each shared directory of every client. I'm asking myself if there's an existing class in the Java API that can keep a …

Member Avatar for ~s.o.s~
0
209
Member Avatar for GDICommander

Hi, everyone! I'm having problems with the implantation of a free camera in a 3D world. For now, I'm using the A/D/W/S keys to make the camera go right, left, forward and backward. The problem is that I don't see the effects of the forward and backward movements. Even with …

Member Avatar for MattEvans
0
2K
Member Avatar for rana03

You can use the chdir function from Perl. Maybe the cd command doesn't change the current working directory. You can check it with the getcwd function from Perl. [url]http://perldoc.perl.org/functions/chdir.html[/url] [url]http://www.perl.com/doc/manual/html/lib/Cwd.html[/url] Hope this helps.

Member Avatar for crb3
0
123
Member Avatar for Audette

There are options in the "Compiler" section in Code::blocks to make a faster executable. This will result in a longer compilation, but the program will be faster. On Visual Studio, you can compile release and debug versions. Release versions are faster, because they don't contain debugging symbols (in the generated …

Member Avatar for GDICommander
0
292
Member Avatar for aksshe10

Ok, so you want to create, modify and execute a BINARY FILE inside a program? That's a hard job... Make yourself more clear... If you want to execute other programs from a main problem, consider using Windows or Linux system calls for that. You can also use a script that …

Member Avatar for aksshe10
0
186
Member Avatar for PhiberOptik

If the file you want to copy is already used by an another process (if this is it), you cannot have access to it (except if you have special permissions). This is very useful program for spotting file handles for every process: Process Explorer. Google it if you have a …

Member Avatar for naugiedoggie
0
132
Member Avatar for daffer

Well, I don't know what's wrong: you have created a constructor for Plane that takes an AudioClip object and a Graphics object and you have passed your objects correctly. Looks ok to me. What's wrong? (Can you edit your post and put code tags? Reading the code will be better...)

Member Avatar for javaAddict
0
128
Member Avatar for rom87

If you want to remove an element and not reduce the size of the vector, erase() is not an option. You can have a vector of pointers of Suitcases and point the pointer to 0 (after freeing the memory of the element, if necessary) at the wanted position. You can …

Member Avatar for GDICommander
0
91
Member Avatar for jam7cacci

Do you have a 64-bit machine? Have you tried to restart Visual Studio and build again your solution? Also, I know that a "Clean Solution / Rebuild Solution" solves a lot of problems. You can click on the error message and press F1. If you're lucky, that will lead you …

Member Avatar for jam7cacci
0
149
Member Avatar for punitdam
Member Avatar for jagsrocknfl

Ok, I suppose that you are using a list to keep each term of the polynomial, like the first element as the first term (like x), the second element as the second term (like x^2), and so it goes... Just insert all the "terms", use your find method to find …

Member Avatar for Lerner
0
2K
Member Avatar for lauren316

stackThree.push(stackTwo.pop()); Note that the elements will be in reverse order. If you want the same order, you should use a queue or an array (or another thing that keeps the stack content). An operator=() may exist, too.

Member Avatar for lauren316
0
156
Member Avatar for dekaya

There's no way to ask the stream for the filename. I know that the stat or stat64 function on Unix (it's _stat or _stat64 on Windows) returns a struct that name the filename inside. The problem is that you must provide a file descriptor or a path: that implies that …

Member Avatar for dekaya
0
2K
Member Avatar for sautap4u

See strtok(), a C library function. It may solve your problem. [url]http://www.cppreference.com/wiki/c/string/strtok[/url]

Member Avatar for Ancient Dragon
0
270
Member Avatar for easytrucker45

Please use [CODE][/CODE] tags around your code. Are you putting all the classes in one file? Java requires that each file contains only one class. I hope that it helps. In your method main(), why are you doing new Movies(); and new java.util.Scanner(System.in); without affecting their return values to a …

Member Avatar for easytrucker45
0
253
Member Avatar for linhngoc2100

Start by looking this: [url]http://java.sun.com/docs/books/tutorial/java/nutsandbolts/for.html[/url]

Member Avatar for GDICommander
0
107
Member Avatar for sreya.n

You can use DOM (XML content represented in a tree) in PHP. Get a DOM node on the tag that contains the attribute, get the attributes map of that node and remove the pair that has "width" as key.

Member Avatar for GDICommander
0
64
Member Avatar for veledrom

You should manipulate DOM (XML content represented as a tree) in Javascript. Look at this page for an introduction: [url]http://www.htmlgoodies.com/primers/jsp/article.php/3594621[/url]

Member Avatar for GDICommander
0
75
Member Avatar for student_x

Use a function that returns the last element of the queue (depending of the representation of the queue), then search in the queue for that value and if you find something, use delete and set correctly the pointers or whatever how your queue is represented.

Member Avatar for student_x
0
6K
Member Avatar for saltysnack

Ok, first, it is very ugly to do: [CODE] string(change.begin() +i,change.begin() +i+1) [/CODE] Instead, do this: [CODE] change[i] [/CODE] It will return the ith character of the string.

Member Avatar for GDICommander
0
103
Member Avatar for Argo54325

I don't understand the meaning of the lSwitch... Can you check the true length of the filename (with debugging)? It may have unwanted spaces at the end... Did your terminal screen have more than 80+15+other characters for width?

Member Avatar for GDICommander
0
98
Member Avatar for javaman2

First, you should access the static methods (add, minus) in a static way, like Money.add( ... ) and Money.minus ( ... ). Accessing a static method on an object (ok) is not supposed to change the object, because it is a static method, you don't have to instantiate a class …

Member Avatar for darkagn
0
150
Member Avatar for RoselineM

Is sizeP the height of the pyramid you want? You can print line by line the square containing the pyramid. You already know the form of the pyramid you want in that square. You surely have noticed that the number of characters on the first level of your pyramid is …

Member Avatar for DangerDuke
0
128
Member Avatar for denniskhor

You can still use a refactoring tip: Introduce Explaining Variable. Declare, for each equals(), a bool that contains the result of this operation and use them in the if statement instead of the ugly list of equals() calls.

Member Avatar for denniskhor
0
99
Member Avatar for PRATS 1990

See this page: [url]http://www.cppreference.com/wiki/keywords/switch[/url]. Google showed me this Web site in less than 1 second and it took that amount of time to see the content.

Member Avatar for csurfer
0
116
Member Avatar for GDICommander

Hello, everyone! I am using Xalan to parse a XML document. This is a glimpse of what I do: [CODE] std::string fileNameStr = fileName.Tofilename(); XalanDOMString strFileName(fileNameStr.c_str()); LocalFileInputSource srcFile(strFileName.c_str()); XalanDocument* document = parserLiaison.parseXMLStream(srcFile); [/CODE] What I want to do is to know the encoding of the source document. There is no …

Member Avatar for GDICommander
0
120
Member Avatar for daviddoria

I don't know why you ask this question: if you are calling std::find to get an iterator and after, find the position of the iterator on the vector, this is not a good approach. First, you are searching on all the vector for 7 with find, and after, if I …

Member Avatar for StuXYZ
0
95
Member Avatar for teh_man

You're sure you want to use Internet Explorer? (This MS software can have problems opening XML files). Use Notepad or an another text viewer, if you can.

Member Avatar for GDICommander
0
262
Member Avatar for jimjohnson123

C++ provides a default destructor. It will do just fine here. If you had pointers or dynamic memory in your state variables, this is the place to free memory. And one more thing, why are you calling delete[] on variables that are not dynamic arrays? It's an error to do …

Member Avatar for ArkM
0
147
Member Avatar for haven_u

I think that you are using pointers and you are printing the pointer and not its content. For example, you may be doing this: int* a = new int(5); cout << a; //This prints 0xsomething... cout << *a; //This prints 5 delete a; Maybe you should do: cout << (*(*array[i])[j]); …

Member Avatar for GDICommander
0
100
Member Avatar for power_computer

The sorting algorithm you should choose depends on the number of elements you want to sort: A bubble sort is good if you have few elements, let say less than 30-40. Theorically, it is faster that more complex sorts (like the quicksort). If you want a good sorting strategy for …

Member Avatar for GDICommander
0
98
Member Avatar for GDICommander

Hi, everyone! At work, I'm having problems to run a XPath using the selectNodeList() method from Xalan. The XPath I want to execute is: //pam:message//prism:coverDate The error message I have is: The prefix 'pam' is not declared. expression = '//pam:message//prism:startingPage' Remaining tokens are: ('/' '/'). I have searched on the …

Member Avatar for GDICommander
0
125
Member Avatar for GDICommander

I need help with the code below. At root->removeChild(nodeToRemove), I have a NOT_FOUND_ERR code. It is not supposed to return this code, because I look in the DOM Tree with IsInDocument. Can someone tell me what's wrong with this code. I'm becoming blind with this code. [CODE] DOMNode* nodeToRemove; if …

Member Avatar for GDICommander
0
165

The End.