Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by ydoaPs

  1. You need a ready made script to convert strings to camelcase and don't even know what a factorial is, and you expect us to believe that you're competent enough in both programming and computer science to make headway in computer vision? Sounds legit. Why? What makes molecules fizzing capable of information transformations that gates buzzing aren't?
  2. As far as I can tell, it's not C++ itself that is causing your problems in that course; It's not clear that you understand the fundamentals of programming. If you can't grok that, then any specific language will be a burden. If math and logarithmic thinking in general are such stressors, perhaps it would do you some good to switch majors. I've known quite a few people who have benefited a great deal personally by switching majors. It sounds like this would be a good avenue for you as well.
  3. Wikileaks released an email cache yesterday. This email gets rid of some of the mystery about why Clinton never released her speech transcripts. It contains several excerpts that the campaign deemed more damaging than releasing the transcripts. Do you think that it was smarter for them to keep them than to release them, or would it have worked better for them to have released them in the first place?
  4. Necronomicon It is a powerful thing. Need supervision
  5. ! Moderator Note We give homework help, not homework answers. What answers are you leaning toward, and why?
  6. ! Moderator Note We give homework help, not homework answers. What options are you leaning toward, and why?
  7. I'm wondering how many values 5Worlds wants to hold in this list. When do we start worrying about incredible RAM usage from holding the ridiculous list affecting the speed instead of the time it takes to evaluate a for loop? Also, where do we draw our arbitrary cutoff? Just go until the list is big enough to slow the computer to the point that computation is faster? And why are you talking about python lists when you're not using python?
  8. Not to mention that your breakout condition provides the correct answer for 0!.
  9. Nice recursive (but not infinitely so) code. It's clear and actually does a factorial.
  10. A common analogy is to comment like you're explaining it to a rubber duck.
  11. I noticed that a lot of the programming questions here, while phrased in terms of coding in specific languages, are actually rooted in a broader context of programming itself. People are having problem with the ideas behind programming in general. If we help people with algorithm building, the language-specific syntax falls into place. So, this thread is for tips on programming in general. This isn't about programming in python or programming in java. This is about the fundamental heart of what one needs to do. If anything, it's tips on how to code in PseudocodeTM. I'll start: One of the biggest thing about programming is being able to break a problem down into chunks and then break those subproblems down. Keep doing that until you get a picture of what specifically you need to do to accomplish each major step. So, if your program needs to do things in three big steps, start even lower than pseudocode; start with a list. Step 1 Step 2 Step 3 Then, take each of those steps and do the same thing. Step 1: Step 1a Step 1b Step 1c Step 2: Step 2a Step 2b Step 2c Step 3: Step 3a Step 3b Step 3c You may or may not notice the indentation. That brings up my second tip. Use indentation, called "whitespace", in your programs and even pseudocode. Some languages require you to have whitespace indentation (like python and the never ending tabs v spaces war), but many do not. It is still good practice for writing though. Most languages have interpreters or compilers that ignore anything about whitespace other than whether there is at least one space between two letters, so it won't hurt the program but it will help you. Writing, or at least planning, with whitespace keeps ideas organized. Look at the example in the previous tip. You see each substep, and it's clear where in the logic that it belongs. It makes code easier to read and understand, even if it's not required. Speaking of readability and understanding, that's where my last two tips come in. Make good names. Names like "MyFunction" or MY_CONSTANT are bad names. They don't tell you what the function is doing or what the constant is for. Make names descriptive, and your code will be easier to understand and easier to read. Rename (or "refactor") if you need to. Many programming environments will even let you replace all instances of one name with instances of the new name, so it won't even be a long tedious thing. Renaming, if giving a new name, is a good thing. It promotes clarity. Comment everywhere. Comment to the point that you think you're overcommenting, and then comment some more. Future you will likely have no idea what your code is doing, so leave good notes for future you to use to figure it out. Your turn.
  12. Unfortunately, it's currently unobtainable.
  13. ! Moderator Note We give homework help, not homework answers. Thread closed.
  14. ! Moderator Note Thread moved to Speculations.
  15. ! Moderator Note "Do not respond to this moderation" means do not respond to this moderation. Any dispute over moderation is to be done in PMs with the staff.
  16. Some people use their names instead of silly scenarios about Swans being all jacked up on Tea.
  17. The most important part of programming is being able to break your problem down into parts. Get general steps. Once you've got big steps, go to each step and break it down. Repeat until you know exactly what code you need to write. So, for this one, you have: Step 1: Make sure the angle is between -90 and 90. Step 2: Tell the user if the angle is invalid. Now, you don't need to convert the angle yet, since you're comparing against degrees and the input is degrees. So, if you have the input stored as a variable and the converted angle stored as a variable, use the input. Having an angle in degrees, what operation do you need to perform to check to see if the angle is within 90 degrees of 0? Those parts I talked about before? You want to do them outside of the main function. Make each big part its own function and give it a good name. Then your main function should be mostly calling your other functions. So, break this list into steps, and tackle them one at a time. Step 1: Take a value from the user. Step 2: Make sure it is within 90 degrees of 0, and notify the user if it isn't (or if it isn't in degrees or a number at all). Step 3: Create a new variable holding the angle in radians. Step 4: Output the angle, sin, cos, and tan for the input angle. Break each step down more if possible, and tell us what you have. Don't worry about C++ syntax yet. Just think about the logical steps. What big picture things do we need to do? Because you instructed to do so and they didn't understand why. We need to help the OP with the actual algorithm first and then we can talk about code. The problem here seems to be rooted in "How do I program?" instead of "How do I code in C++?".
  18. ! Moderator Note We don't give out answers, but we do give help. What do you have so far? Where are you stuck? Is there anything specific that you feel like you don't understand? Perhaps you could start by making a mockup with pseudocode.
  19. He's pretty big in the Loop Quantum Gravity world. A lot of his stuff is on ArXiV.
  20. There are atemporal models, but they obviously don't conceive of motion as the same object in different places at different times. Rovelli's evolving constants model is particularly intriguing.
  21. With the minkowski metric, we get a pretty neat spacetime distance equation. (spacetime distance)2 = (temporal distance in a frame)2 - (spatial distance in the same frame)2 A neat feature of the spacetime distance is that it's frame invariant. It's the same for all observers. So, for each observer (those for whom the events are simultaneous and those for whom it is not), the spacetime distance is the same. So: (temporal distance in frame 1)2 - (spatial distance in frame 1) = (temporal distance in frame 2)2 - (spatial distance in frame 2)2 In a frame where the events are truly simultaneous, their temporal distance is zero. So: (spatial distance in simultaneous frame)2 = (spatial distance in a non-simultaneous frame)2 - (temporal distance in the same non-simultaneous frame)2 So, the further apart in time two events are in a frame, the further apart they are spatially in that frame. The simultaneous frames will have the minimum spatial distance between the two events.
  22. Considering that they're back in the state of a statistical tie with Hillary continuing her pattern of trending downward, wouldn't that imply that she alienates "entire swaths of people" at an even higher rate? Like her history of putting profits over the safety of people and their environment by pushing fracking on the US and the world? Like her history of being anti-LGBTQ+? Like her history of destroying black communities by supporting and advocating for "welfare reform", by being sponsored by private prisons, and by enthusiastically advocating for continuing the war on drugs? Like her using superPACs and sharing tax havens with Donald Trump? If we're going by deeds rather than words, then Hillary is an awful choice. After all, just look at her foreign policy experience that she's so proud of. In contrast, during that primary season, the Clinton campaign was in full on race baiting mode. They fueled the aforementioned conspiracy by disseminating photos of Obama in African garb. Unlike McCain, who flat denied birtherism calling it ridiculous, Clinton did *wink wink nudge nudge* "I don't know".
  23. The second to last sentence. Again, read what the FBI actually announced. A great deal of it was pointing out that she in fact did things that would get anyone else reamed.
  24. Now, that's not the same claim. As someone who worked with classified material everyday in the US and absolutely would not have gotten off with zero consequences having done what Clinton did, yeah, I can.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.