Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. Ghost

    Python input/function (help)

    You could set up your data so that each country corresponds to a continent. For example: countries = { "japan":"Asia", "canada":"North America" } answer = input("Country Continent Search\nPlease type in a country's name. Then press ENTER.\n") #answer = 'japan' if answer.lower() in...
  2. Ghost

    Python Dealing with 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

    Well, updating the specs is great, but it may end up having similar issues if you scale up. It really depends on your future plans. I always like to think that there's always 2 options (usually to pitch to a client) - Quick, easier fix that doesn't cost as much money (but may have issues...
  3. Ghost

    JavaScript How does setInterval() affect the website's performance?

    Whenever you change the value of the variable, the variable remains the last set value. So like... var x = 5; x = 7 x = 9 + 3 x = "LAST" console.log(x) // LAST
  4. Ghost

    JavaScript How does setInterval() affect the website's performance?

    A dynamic data type in JavaScript (or others) means that the variable can be of any type. What types? Well, we have "strings", integers like 1, 2, 3 and floats (decimals) 1.2, 2.5, 3.1, and other formats too... [ ] , { } , etc let somevar = 2; let somevar = "hello"; let somevar = 5.7; let...
  5. Ghost

    JavaScript How does setInterval() affect the website's performance?

    If it just one user then you will be completely fine. One thing I like to do though is detect activity so that if you leave the computer for a while, it stops auto updating and then updates when you return.
  6. Ghost

    JavaScript How does setInterval() affect the website's performance?

    This might not neccessarily hurt the browser / user experience, but it can affect your server. Solutions like this work great to get a web app up and running quickly, but they're hard to scale. Imagine having hundreds of thousands of users, or millions, all logged in and requesting data from...
  7. Ghost

    Python Dealing with 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

    Run your queries and then run this code separately : SHOW ENGINE INNODB STATUS You can also try to show tables where it's "in use" > 0, which will show you table locks. Basically you are running a transaction, which is fine, but table locking is causing your table to be inaccessible (most...
  8. Ghost

    browser extensions

    Yes, I have built one on Firefox and multiple Chrome extensions. I built some tools for: - url shortening - website crawling for data (various sites for clients) - custom Facebook theme "Syracuse Orange" when my cousin (Paschal Chukwu) got a free ride to play basketball - this was a tough one...
  9. Ghost

    Python I need the solution

    I can't write this all for you because it's a pretty large assignment, but I do have an existing project that has everything you need - Multiple choice questions... https://github.com/NerdiOrg/pyQuiz/blob/master/quiz.py Or here is my Python IPIP BFFM code...
  10. Ghost

    App Building

    If it is your first app I highly recommend using PhoneGap. It's a bit easier to work with as a beginner and there are tons of starter projects. On the other hand you can search Github for open source projects that are similar to what you want. For example, here is an iPhone app that lets people...
  11. Ghost

    PHP I can’t read a file in a browser

    Can you show us an example of what's in the text file? That way we can replicate your code to test it out. What happens when you just read and echo the entire file instead of line by line? Can you convert the while to not include !feof() and then inside the while put if(!feof($wp)){ echo 'end...
  12. Ghost

    ForEach “implicitly-synthesized declarations” Error in Swift Tik Tok clone :(

    I am not 100% sure how to fix this myself, but perhaps this will help you with the random access collection - https://stackoverflow.com/questions/56311257/swift-make-string-conform-to-randomaccesscollection
  13. Ghost

    HTML & CSS 3D Tetris game from 1989 called BlockOut in HTML5

    I really, really love the UI and its retro feel, and the difficulty level is really nice for a beginner. It seems simple and then quickly becomes harder as you go on if you make any silly decisions. Good job, keep it up!
  14. Ghost

    PHP Need help

    I understand. There are a few things that need to be done, so it definitely is a fair bit of work. If you have any specific PHP or other code that you can post here for us to help you with then I am definitely willing to take a look! Have you checked out any plugins for a CMS or other site...
  15. Ghost

    PHP MYSQLi multiple select

    I'm not going to write the whole query because @Peter already figured it out with someone else, but the jist of it is most likely that you need to just have a simple SQL query with 2 joins for connecting the products (by SKU) with the media reference table & media table. I think it would be...
  16. Ghost

    PHP Ajax Sample

    Well, AJAX is a part of JavaScript specifically. PHP, Python, or other files just echo / print out information on the page. The JS will fetch the output / results of the file. json encode in PHP for example makes it so the PHP array is compatible with JS. If you want to fetch a new value of...
  17. Ghost

    PHP Ajax Sample

    If you are wanting to output JSON it's very easy! <?php $arrayhere = ["you", "can", "json", "if", "you", "want", "to", "you", "can", "leave", "your", "friends", "behind"]; /* $sql = $database->prepare("SELECT * FROM table"); // execute sql, store result, check num rows, then use json encode of...
  18. Ghost

    JavaScript Currency info

    The following JavaScript code will calculate a currency exchange between a starting and ending currency. It will provide the exchange rate and the final amount. I published this code to Github, so I really really hope that it can benefit anyone trying to program a currency exchange rate...
  19. Ghost

    JavaScript Easier way to if/or?

    This will allow you to quickly determine if the answer is allowed or not, by forcing the answer to be lowercase, and also trimmed of spaces before or after. var answer = "yes"; // correct // var answer = "incorrect"; // not in valid answers array var validanswers = ["y", "yes", "ye", "ya"]...
  20. Ghost

    PHP Help with redirect after Upload

    You cannot use your header location after there has been output on the page. It can be a little finicky. If any HTML, other headers, or even blank space has been outputted on the page then it will not redirect. If you have errors enabled on your site and your script has just 1 non-fatal warning...
Back
Top Bottom