Jump to content

PlutoNZL

Member
  • Posts

    98
  • Joined

  • Last visited

Reputation Activity

  1. Informative
    PlutoNZL got a reaction from ghorbani in Arduino LED-URL Confirmation   
    Unfortunately I don't have an Arduino so I can't run your code. I think the issue may be that your response is malformed. Update your response to be just this:
    if (c == '\n' && currentLineIsBlank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(); client.println("<html>"); client.println("<body>"); client.println("<a href=\"/?0\"\">Turn On LED</a>"); client.println("<a href=\"/?1\"\">Turn Off LED</a><br />"); client.println("</body>"); client.println("</html>"); break; } If that works, that shows that the issue you're getting is because of your response format.
  2. Agree
    PlutoNZL got a reaction from unlock21 in JavaScript get information from server   
    You need to use the HTTP prefix in your request URL. For example "http:///api.openweathermap.org/data/2.5/weather?id=3464008&APPID=SECRET".
     
    You don't need to set up a local server.
     
    Here's my working example:
    <html> <head> <script> function myFunction() { var xmlHttp = new XMLHttpRequest(); xmlHttp.open("GET", "http://api.openweathermap.org/data/2.5/forecast/city?id=524901&APPID={YOUR_APP_ID_GOES_HERE}", false); xmlHttp.send(); document.getElementById("x").innerHTML = xmlHttp.responseText; } </script> </head> <body> <p id="x"></p> <button type="button" onclick="myFunction()">Try it</button> </body> </html>  
  3. Agree
    PlutoNZL reacted to 79wjd in Need Answers To This Short Assignment ASAP   
    It shouldn't take anywhere near that long. Four of the six questions are simple one line answers and the last two are a bit more involved, but still not that involved. If you have a few hours, then you have enough time to figure it out. 
  4. Agree
    PlutoNZL reacted to vong in Need Answers To This Short Assignment ASAP   
    I think you should do your own research then....
  5. Like
    PlutoNZL got a reaction from Cylon Muffins in Need Answers To This Short Assignment ASAP   
    You posted the exact same questions a week ago. A week is more than enough time to learn the material and answer the questions. 
  6. Like
    PlutoNZL got a reaction from RumSwift in Need Answers To This Short Assignment ASAP   
    You posted the exact same questions a week ago. A week is more than enough time to learn the material and answer the questions. 
  7. Agree
    PlutoNZL got a reaction from Yamoto42 in Need Answers To This Short Assignment ASAP   
    You posted the exact same questions a week ago. A week is more than enough time to learn the material and answer the questions. 
  8. Like
    PlutoNZL got a reaction from 79wjd in Need Answers To This Short Assignment ASAP   
    You posted the exact same questions a week ago. A week is more than enough time to learn the material and answer the questions. 
  9. Agree
    PlutoNZL got a reaction from P4ZD4 in Need Answers To This Short Assignment ASAP   
    You posted the exact same questions a week ago. A week is more than enough time to learn the material and answer the questions. 
  10. Like
    PlutoNZL got a reaction from SSL in Need Answers To This Short Assignment ASAP   
    You posted the exact same questions a week ago. A week is more than enough time to learn the material and answer the questions. 
  11. Agree
    PlutoNZL got a reaction from Electronics Wizardy in Need Answers To This Short Assignment ASAP   
    You posted the exact same questions a week ago. A week is more than enough time to learn the material and answer the questions. 
  12. Agree
    PlutoNZL got a reaction from Menzenski in Need Answers To This Short Assignment ASAP   
    You posted the exact same questions a week ago. A week is more than enough time to learn the material and answer the questions. 
  13. Informative
    PlutoNZL got a reaction from Shammikit in How to access a variable from a private class in java?   
    If your private Class is a top level Class, it is impossible to access. Why do you need this Class to be private?
     
    If something is private it is only accessible within the Class it is defined. This means that a private Class will only be accessible by the Class that contains it. If the private Class is not contained in another Class, it is impossible to access it.
     
    Here's an example of a private inner Class being accessed by an outer Class:
    public class MyPublicClass { public void MyMethod() { MyPrivateClass p = new MyPrivateClass(); System.out.println(p.myPrivateVariable); } private class MyPrivateClass { public int myPrivateVariable = 1; } }  
  14. Informative
    PlutoNZL got a reaction from Sergio45 in Help! JavaScript giving me an extra image when not needed.   
    What I said above is true, but that condition won't even be executed when user == "bat" because you are using and else-if.
     
    The reason you are getting 1 "unknown" is because "done" is considered an "unknown". Here's your code with comments:
    var user; // Right now user has no value. if (user !== "done") { // User does not equal done n -= 1; user = prompt("bat,witch, or ghost").toLowerCase(); // Suppose "done" is entered. user is now equal to "done" if (user === "bat") { bat += 1; } else if (user === "ghost") { ghost += 1; } else if (user === "witch") { witch += 1; } else if (user !== "bat" || user !== "ghost" || user !== "witch") { // This condition evalutes to true because "done" is unknown. unknown += 1; } }  
  15. Agree
    PlutoNZL got a reaction from straight_stewie in [C#] splitting a 2D array   
    I don't understand the issue you are having. You just explained the task, not what you're having an issue with. 
     
    Can't you just split the square into four quadrants and call the split method on each quadrant until the square is a 2x2?
  16. Agree
    PlutoNZL reacted to fizzlesticks in Python List Type Container In C++?   
    Use a vector.
  17. Like
    PlutoNZL reacted to Mark77 in what's eof in c   
    EOF = End of File
     
    So basically that program is just reading from STDIO (ie: console),  and will keep reading until it encounters "\n" (which has a specific meaning in C), or the EOF symbol.  Hence, "flushing input".
     
    getchar() is just like getc(), instead it defaults to reading from STDIO instead of taking a file descriptor.
  18. Like
  19. Agree
    PlutoNZL reacted to xMishax in Enter the RX 480 AIB Cards   
    no 4gb versions?
  20. Agree
    PlutoNZL reacted to dionkoffie in Enter the RX 480 AIB Cards   
    4gb???
  21. Agree
    PlutoNZL reacted to SSL in Ways to make a little money as a beginning programmer?   
    Don't. Qualified programmers do not want to deal with code written by beginners. Sit tight and work on personal projects, then go to school for a CS degree and get an internship. Then you can start making money on your skills.
  22. Agree
    PlutoNZL reacted to Nuluvius in How useful are all those algorithms at work?   
    It really helps to understand them such that you appreciate the ramification of their use in a particular context. However unless you are doing something quite specialised or niche then you'll likely just be using existing types, structures and libraries that make use of them 'under the hood'.
  23. Like
    PlutoNZL reacted to vorticalbox in In need of a dev to help me   
    just post the error here, we probably will fix it for free.
  24. Agree
    PlutoNZL reacted to HKZeroFive in Is that a good build ? Would you change anything in it ?   
    Yeah, in case you haven't noticed, I REALLY don't like people like him. Going on an 'anti-AMD' policy because of a bad experience doesn't dictate the whole company. As for date, well, I'd ask you to wait but he seems adamant.
     
    So I can't help you there unfortunately but just heed my advice of a better PSU and his build should be fine.
  25. Agree
    PlutoNZL reacted to Aytex in Is that a good build ? Would you change anything in it ?   
    Tell him to wait for the rx 480, or just have less preformance with the 960, you know all down to him
    everything else looks good except the psu, any seaonic, XFX unit will do fine (avoid XT from XFX)
×