Recent content by gmar

  1. G

    PHP Using PHP and cURL to submit POST requests to a website

    You say curl_exec() returns true indicating success. What does "success" mean? Let's say curl successfully runs, successfully contacts the destination webserver, and successfully transmits your message. However, the server is responding with "200 OK" and "Busy, please try again later!" instead...
  2. G

    C/C++ [C++] Never have more than 1 return statement?

    There's an underlying issue here that I think people are on different sides of and perhaps not realising. This is, "Do you believe that your coding standard is part of your project's specification?" If you do, it's easier to come to the decision to reject non-compliant code. Especially in...
  3. G

    Java [Javascript] How do I make a hitbox?

    I really like that website. I might have to start sending more people there. I thought it was just for maths. I would suggest an improvement, make the objects you are dodging/collecting all spherical. Then you can test for collision by distance to the centre. This would alleviate player rage...
  4. G

    Java I want to better write this JavaScript procedure

    Is this homework? If not then nothing you can write in JS will outperform the built-ins. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split I am not fully familiar with JS but it looks like you want a set, or a failing that, a standard dict...
  5. G

    C/C++ [C++] Never have more than 1 return statement?

    I don't see how those opinions differ. I just did some Google-fu. I think we are in agreement. I didn't know he was involved in the project until I noticed he wrote "we". I guess that commerically, C++ did "need" some kind of high-profile embedded project. I am not at all convinced by...
  6. G

    C/C++ [C++] Never have more than 1 return statement?

    There's a lot of points to cover in this thread. We know their (Google's) C++ style is possibly controversial but the point is, firstly if a Googler said "only use single points of return" then, assuming he meant C++, it has to borne in mind the environment in which he works, and secondly, when...
  7. G

    C/C++ [C++] Never have more than 1 return statement?

    I am not sure this is a C++ question. The OP did not mention what language the Google engineer he quoted was working with and the OP himself chose to consider the statement only within C++. If the original source was referring to C++, you have to also consider Google's C++ style guidelines...
  8. G

    Using a length() function in a loop's condition

    You should be probably be doing this instead: http://en.cppreference.com/w/cpp/language/range-for
  9. G

    C/C++ [C++] Never have more than 1 return statement?

    One community's pattern is another community's anti-pattern. This is quite common in C. function allocate_and_process (): a = allocate () if test (a) == fail: goto UNDO_A b = allocate () if test (b) == fail: goto UNDO_B c = allocate ()...
  10. G

    C/C++ [C++] Never have more than 1 return statement?

    That's weird since doing a custom extension for an existing extensible code formatter is probably a weekend's work for an intern. My programming background is embedded systems in C. We do a lot of things the majority of non-realtime coders don't like, but in all honesty, the majority of...
  11. G

    Python Web Scraping with Python 3.4: Getting Started

    What is all this? while i < len (x): print (x[i]) i +=1 Is that Python? It looks a C programmer tried to write Python. Might I suggest this: things = ["alice", "bob", "carol"] for t in things: print (t) If you need the index, use this...
  12. G

    C/C++ [C++] Never have more than 1 return statement?

    There is certainly some dispute over the former issue. As for the latter, your editor or IDE can automatically reformat code when you open it. I am much more interested in the GOTO issue that was mentioned earlier in the thread. It's actually standard practice in quite a lot of places...
  13. G

    How can I improve my text encryption scheme to make it more secure?

    Don't roll your own crypto. When sorcery like this starts flying around most people should realize they are in way over their head and use a standard library. http://en.wikipedia.org/wiki/Timing_attack So you might think, OK I'll just add a random delay. But, if you can miss something...
  14. G

    C/C++ [C++] Never have more than 1 return statement?

    In some languages that is OK.
  15. G

    Can I create a website/forum with wordpress?

    https://wordpress.org/plugins/bbpress/
Back
Top