636 Posted Topics
Re: > every byte in a dword gets a separate push mov call sequence, every letter in the text I am afraid you misinterpret the disassembly. Can you post the disassembler output? | |
Re: If you mean lines 79-82, the logic is as follows: [ICODE]p_clause[/ICODE] is declared as [ICODE]struct __clause **[/ICODE]. [ICODE]*p_clause[/ICODE] is [ICODE]struct __clause__ *[/ICODE], that is, a pointer. [ICODE]sizeof(*p_clause)[/ICODE] yields the size of pointer (most likely, 4), regardless of how much memory you did allocate. Do realize that (1) sizeof is calculated … | |
Re: You really need to check your spelling. It is glVewport, glClearColor, umsg, etc. | |
Re: > So this is called a "script"? No. This is called a makefile. > Does that mean this is what the code looks like? Can you clarify the question? > Also, how does each line function? [CODE]deletes.obj: deletes.c deldir.h cl /c /Zid deletes.c [/CODE] The first line tells the [ICODE]make[/ICODE] … | |
Re: Take a look at how UltraStar and/or Perfomous (both are open source) do the scoring. Looks like almost what you are looking for. | |
Re: Something is wrong here. I run your code (BTW it doesn't compile as is, and produces some warnings), and got the following results (also note that I changed the test loop count to 1E2): [INDENT]time of the(hours : min : sec) testCPPFind : 0 : 0 : 18.03 loop 100 … | |
Re: Just wonder what does it print at line 23... Do you realize that 10^100 takes 30+ bytes as an integer? For the rest, read the [URL="http://en.wikipedia.org/wiki/Cyclic_number"]math[/URL]. | |
Re: > These are all definitions. Let's get legal. They are [I]tentative definitions[/I] (6.9.2:2). All of them result in the behavior "exactly as if the translation unit contains a file scope declaration ... with an initializer equal to 0". That is, only one [I]definition.[/I] > All three foo declarations look like … | |
Re: Sure. If you insist on recursive approach, it is better to half the argument, rather than subtract a small decrement. For example, to calculate sin(0.5), your code goes down 50 levels of recursion, while halfing does only 6. Another speedup is achieved by sincos, which calculates both sin and cos … | |
Re: A wild guess: you are running on Windows, right? The png file begins with a signature ID=89h,'PNG',13,10,26,10 which contains a byte with a decimal value 26, that is ascii Ctrl-Z, which is an end-of-file for a text mode. Open your file with "rb" instead of "r" and enjoy a garbage … | |
Re: The argument is passed by the OS when the signal is delivered. The rationale is that you may install the same handler for different signals. | |
Re: Try an experiment and remove the loop at lines 2-5. After that, explain what was it trying to achieve. PS: there will still be a bug, but you'll be able to figure it out yourself. | |
Re: OS/360 clone, Fortran IV, punchcards PDP-11 clone, asm, punch-tapes CP/M, Forth, 8" floppies etc | |
Re: The tgets function has a timeout_secs argument, which you never use. You have to request a SIGALRM to be raised at that timeout. Read a man page for alarm(). The if/else in the signal handler is meaningless: the handler is installed specifically for SIGALRM, so the signum will never be … | |
Re: You created a buffer overflow, and corrupted the stack. Line 17: there's no such thing as s1[40]. The maximal index legal for s1 is 39. | |
Re: If I understand correctly what you are after, pass relevant properties as command line arguments. For example, -Dsrc=Hello (details really depend on your ant file). | |
Re: Line 52: you do not return anything from the [ICODE]else[/ICODE] clause. Didn't the compiler warn you? | |
Re: [QUOTE=quartaela;1548329]it complains about the lines which include [CODE]*(list)[/CODE][/QUOTE] Change it to (*list), perhaps... | |
Re: Libraries are linked to the project, so they should go into a linkage recipe: [CODE]LIBS = -lmingw32 -lSDLmain -lSDL -lSDL_mixer sdlTest.exe: sdlTest.o $(CC) sdlTest.o -o sdlTest.exe $(LIBS)[/CODE] Notice that since they are 3rd-party, and not likely to change, they are not listed as dependencies. | |
Re: > First of all, assuming your binary string is stored from most significant bit to least significant bit, you will have to traverse it in reverse No no no. Direct traversal is much simpler. Two methods need to be implemented: double a decimal string and add a bit value (0 … | |
Re: fread is fine. Look at a line 19. How much memory did you allocate? | |
Re: > There was something wrong with my http request (changes are on line 75 and 76) Yes. You shouldn't split those two lines. The correct request is [INDENT]GET / HTTP/1.1\r\n \r\n[/INDENT] At the 1.1 level this is not enough. You must send additional headers, such as Host (I don't recommend … | |
Re: Few problems in your code. First, your pops are in a wrong order. The last thing pushed shall be first to pop. Second, can you explain line 105? The way it is written, you are (a) jailed to state_1 and (b) bound to a stack overflow. | |
Re: > What .depend files are I didn't really understand. Usually they are hints to the compilation/build environment. Obviously, an object file depends on a corresponding source file, in a sense that it should be recompiled once the source changed. Less obvious, the object file also depends on modifications of various … | |
Re: The behaviour you describe means that a -I option is silently passed to rm. Usually it is done by aliasing rm to rm -I somewhere in the startup scripts; some people think it is a good idea. The simplest way is to directly invoke /bin/rm instead. If you are writing … | |
Re: Sorry people, it is more than I can bear. We all agree that 1. The assignment is stupid 2. The code is ugly 3. OP doesn't have a clue yet none of the above gives a reason to teach things you've not be asked for. If you have nothing to … | |
Re: What is m at line 7? | |
Re: > is this a valid approximation? I don't think so. > If not why? Yielding CPU is not necessarily a context switch: control could be returned to the same context without remapping. I don't see anything forcing a switch. The sample code gives a reliable lower bound of a system … | |
Re: > don't use fgets, it's a security bug. Care to explain? | |
Re: Line 46: How the memory for temp's data is allocated? | |
| |
Re: First of all, you must realize that on a 5081 architecture a true debugger is not possible. 8051 doesn't have a concept of exceptions, and even though a breakpoint (almost) may be emulated by a call, the resume from breakpoint seems practically impossible. It could be done with a support … | |
Re: It is (almost) beyond the programmatic control. The backspace character is processed by the console driver and not delivered to the program. You may prepare the file with embedded backspaces and redirect input from it; this way the driver is bypassed, and you will see the "\b". | |
Re: The fact that the second function works at all is an unfortunate coincidence. It returns a pointer to a local variable. You must allocate Value dynamically. | |
Re: > Is there some reasonable way of writing the internals of this function besides providing a giant switch statement? Of course. Write a separate solver for each case, and keep them in a vector (or a map). | |
Re: Profiling wouldn't help on a bad algorithm, and this is the case here I am afraid. The code tries pretty much all chains on a grid, to match each against every dictionary word. Obviously most of the efforts is wasted. My recommendation is to turn the table around, and instead … | |
Re: [QUOTE=mike_2000_17;1538549]They are shared because you can group many functions that could be useful to many different applications into one DLL and then different applications can share that DLL and its set of functions without the need for recompilation from source.[/QUOTE] Correction. Sharability is a runtime property. A static library also … | |
Re: The problem is in the Search function, specifically at lines 144 and 155. Can you explain the logic there? | |
Re: Something is wrong here: [QUOTE][CODE]kputs: ; get our first argument address into esi push ebp ... jmp kputs[/CODE] [/QUOTE] What state is the stack in when the end of string is reached? [QUOTE]It might be worth noting I have no debug tools that I know of available[/QUOTE] gdb works fine … | |
Re: Through my crystal ball I see that you need to add -llapack -lblas to your linker command line. | |
Re: > What is 'filo'? Probably [URL="http://en.wikipedia.org/wiki/David_Filo"]Filo[/URL]. | |
Re: This particular problem has an iterative solution as well. Set up an array of N ints, and treat it as a max-base number. The increment function gives you a next combination: [CODE]bool increment(int arr[], int N, int max) { int i; for(i = 0; (i < N) && ((arr[i] += … | |
Re: [QUOTE=rubberman;1531924]Tried that. No luck.[/QUOTE] Are you running Python 3.x? The code is written for Python 2.6; you need to either downgrade Python, or convert the code with 2to3 tool (a part of Python distribution). | |
Re: The line [CODE] fp=fopen("random.txt","r");[/CODE] makes me believe that the file contains textual representation of data. It must be converted to doubles via a proper format specifier of scanf, or via strtod, etc. fread doesn't do any conversion. It just reads bytes. | |
Re: [B]> I was wondering how I could display more than 256 colors with the VGA color palette[/B] You can not. It is a fundamental limitation of the VGA architecture. VGA may hold just that many colors at a time. [B]> the reason that you can't display more than 256 colors … | |
Re: Take a look at McMillan's [URL="http://davidf.sjsoft.com/mirrors/mcmillan-inc/install1.html"]installer[/URL]; looks like archives is what you are looking for. Disclaimer: I never used it myself. | |
Re: For starters, which controller are working with? Usually, the necessary toolchain is distributed by the manufacturer. Check on their site. | |
Re: While "validating" (line 49 and below) you change name and text. They are not pointing to the correct places anymore. | |
Re: Python doesn't like global variables. If you insist on using them, be explicit. Declare them as such. As for your current arrangement, the assignment at line 13 makes Python think that strPlayer1 is a local variable - it doesn't bother to check its global existence. Just add [CODE] global strPlayer1[/CODE] … |
The End.