• Advertisement

Kippesoep

Member
  • Content count

    1075
  • Joined

  • Last visited

Community Reputation

892 Good

About Kippesoep

  • Rank
    Contributor
  1. Textbox to char

    The native number is in little-endian format, but network code expects big-endian format. Instead of RemoteAddress.sin_port = port; use RemoteAddress.sin_port = htons (port); The "hton" in that function stands for host-to-network. The s stands for "short" (a 16-bit integer).
  2. Pointer based on size?

    When not using VBO's, glVertexPointer and glTexCoordPointer do indeed take a regular void pointer. When using VBO's, this must become an offset. To be able to use the same function, without changing the function signature, it should be cast to a pointer. It doesn't need to be (char *), but can be any pointer type, as the function accepts void pointers. So, it's not creating a pointer, it is casting an int to a pointer.
  3. How do I obtain the size for one pixel?

    That is exactly what Scet mentioned. Use an orthographic projection matrix, that basically eliminates perspective and all units are the same size regardless of depth. That also allows you to set unit size and pixel size equal. In DX9, simply check out the D3DXMatrixOrthoLH/D3DXMatrixOrthoRH functions (there's also "OffCenter" ones, if you want the origin at another place than the centre of the screen).
  4. multi-dimension array compression

    You could use some space partitioning. Have a coarse 3D array of pointers to blocks. Rather than a map of say 5000x5000x10, have an index of 100x100x10, that points to blocks that themselves are 50x50x1 tiles (use whatever makes sense for your levels) or has a NULL if they are completely empty. This can then be used for quickly seeking within your level data. The smaller blocks can in turn be run-length encoded. Note that you may sometimes need multiple blocks if the player character is at the edge of the block he's in. In the most extreme case (exactly at a corner), you'd need to extract 8 blocks.
  5. OpenGL Strange GLUI problem

    An unresolved external most commonly means that a library can't be found by the linker. I know you say all libraries are being "included", but one does not "include" a library, only a header file. Check your project settings and find the linker settings (on Visual Studio, press Alt-F7, Choose "All Configurations" in the dropdown at the top, then expand "Configuration Properties", then "Linker" and see the "Input" category). Put your library name in the "Additional Dependencies", probably "glui.lib" or something. If it's not that, then either the library is in an incorrect format or simply doesn't match the definitions in the header files that you're using.
  6. Window Z-order

    Try the WindowFromPoint or ChildWindowFromPoint(Ex) functions.
  7. Don't add the actual object to the list then, just a pointer. Also, why clear and add everything each frame? Just resort the list itself.
  8. newbie PHP writing to file help

    Quote:Original post by charpi Kippesoep, YOU ARE RIGHT!! Man do I feel so grateful to you for your help now. But any ideas on how to prevent this then? Thanks I'm afraid not. While the hidden variable (or checking the request method) will work around things on the PHP side, it doesn't actually fix the underlying problem. You may want to post a new topic in a forum appropriate for Mac development. The Cocoa/Objective C experts will be more likely to find the issue or point you in the right direction. Of course you can simply try tweaking the code to see if disabling any of these things causes the extra request to go away. One thing some Googling shows me is that you need not initialise response to anything other than NULL. Most code samples also don't specify anything for error, just specifying error:nil. I don't see how that would influence this, however.
  9. newbie PHP writing to file help

    Quote:Original post by hplus0603 That's a brilliant deduction! I would put money on you being right. Biscuits will do nicely :P Quote:Original post by hplus0603 Generally, I always include a "cmd=blah" HIDDEN field in any form, which means that a non-POST request to the same URL would not dispatch to the POST action. QFT. Another way would be to check for $_SERVER ['REQUEST_METHOD'] == 'POST', but the hidden field would also allow you to carry out different commands in the same script.
  10. newbie PHP writing to file help

    Quote:Original post by charpi AHA now we are getting somewhere!! The array is...empty. Hmmm, then why does my echo return a correct string? I'm the newbie here, care to explain? And suggest what should I do after that? Thanks so very much Ok, if the array is empty, the file requestlog.txt itself shouldn't be, but it would contain Array ( ) Just to make sure... Anyway, you should try this with $_SERVER and $_GET too. Of particular interest $_SERVER ['REQUEST_METHOD'] which will tell you whether the request was made as a GET or POST request or something else. I don't see anything with your PHP that could cause this, but I don't know enough about Objective C to see what may be going wrong there. Personally, what I think is happening is this: 1. you do your POST and see the output 2. the file gets written correctly 3. after the POST a GET is issued (this is normally done after a 303 response to a POST, but it may be because of something else here) 4. the GET has no parameters in the $_POST array (for obvious reasons) 5. the output is ignored 6. the file written in (2) is overwritten To see if this is the problem, change the code to open the file in append mode ("a" instead of "w"), delete the text file and then do the request once. I'll bet you a biscuit you'll see two lines in the file that is created. (Well, one, as there's no linefeed in between). "My name is noob and my age is 20.My name is  and my age is ." is the expected result. You could probably also tell more of what's going on by using a HTTP proxy (Fiddler is a great tool on Windows, I'm sure similar stuff is available for MacOS). Anyway, because of the above, I'm convinced the issue is in the Objective C code, not in your PHP code. PHP simply does not behave this way without conditions like those I outlined.
  11. newbie PHP writing to file help

    Have you tried dumping the entire $_POST array to a file, like this: file_put_contents ("requestlog.txt", print_r ($_POST, 1));
  12. newbie PHP writing to file help

    Quote:Original post by horrain Its sounds like the PHP process doesn't have write access to your file system. You need to play around with chmod and the target directory, and grant the php process write accesses to those files. Then it wouldn't write at all. It does indeed seem like a character set problem. Have you looked in the test.txt file with a hex editor? If it's been posted with a multi-byte character encoding and PHP didn't recognise it, it may have been seen as an empty string instead. Just to be sure, change the form tag in your HTML to have the attribute accept-charset: <form accept-charset="ISO-8859-1" action="..." method="POST"> might be appropriate. You could also use "UTF-8", of course, or even "us-ascii" if you're not going to use special characters.
  13. Debug vs Release

    Almost all such problems in debug vs. release mode stem from uninitialised member variables. In Debug mode, the compiler automatically initialises variables and members to a special value like 0xCCCCCCCC so you can easily spot them. In Release mode, they can have whatever value is stored on the heap at the time. Check to make sure everything is properly initialised.
  14. weird bug...

    It's a result of the way keyboards are made. Check out Keyboards Are Evil.
  15. WinMain vs Main

    Quote:Original post by SiCrane How would you have it not create a console window? There's a linker option that changes the subsystem to console (/SUBSYSTEM:CONSOLE) and that is actually what causes the console to be created. By using /SUBSYSTEM:WINDOWS that won't happen. It selects the default for, but is otherwise independent of the entrypoint (/ENTRY option). The default for console apps is (w)mainCRTStartup (calling (w)main), whereas the default for Win32 apps is (w)WinMainCRTStartup (calling (w)WinMain). Normally, one doesn't mess with that, as it is simply set when choosing to create a console or Win32 app, but it is possible.
  • Advertisement