Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. In the modern world, we solve this problem with CSS media queries by hiding the elements of the page you don't want printed.
  2. I'm not sure what you're saying either, but I'm pretty sure the response goes something like "yeah no, that's not how these sorts of things work" if not an outright "no, you can't force them into doing something like that".
  3. Step 1: What actual data do you need to store, and what are the relationships between the different pieces?
  4. It inserts what as what?
  5. Are you exporting and importing from the same version of MySQL?
  6. A snippet of the code you had posted is $sql_l = "SELECT * FROM users WHERE id = '$user_id'"; if ($conn_l->connect_error) { die("Connection failed: " . $conn_l->connect_error); } $sql_l = "SELECT id, movie FROM users"; $result = $conn_l->query($sql_l); Looking at that, it seems that the first $sql_l was what you intended to use and the second one overwriting it was accidental.
  7. And what is the "issue" with indexing? Kinda missing the part where you mention what the problem is.
  8. While it's good that you found the answer, one of the most beneficial parts of having a public forum like ours is that people having a similar problem can learn from your experience. So maybe next time, keep the post up and simply reply to yourself stating that you found the answer - and for bonus internet points, what that answer was too. I'm guessing your problem (which I can see as an admin) was that you were using the results from that second SELECT query which was fetching the first row from the table instead of the first query which was fetching the row specific to the user?
  9. You don't need physics - just a simple if/else. Assuming you're talking about vertical and horizontal walls (like those of the containing box). Give it a thought yourself and you'll probably find it's easier than you expect. You're already calculating the ball's "angle" using X,Y components so consider what happens to them if you have, say, a velocity {x=1, y=2} at the time when the ball encounters a horizontal wall...
  10. You probably ought to be using canvas for this instead of the DOM. You aren't "painting" anything here. All you need to do is use CSS's top and left to position the object where you want it to go.
  11. There's a lot of files there so I can't personally spend the time to review the whole thing. Honestly, neither will a prospective employer. If you have specific questions or want opinions on specific files then that's something I could help with much more easily... A portfolio typically needs multiple smaller pieces of work that can be viewed, not single larger projects. Remember that what you're demonstrating is the sort of results you could provide to someone who will hire you - and most of them are not going to ask you to write a social network from scratch. They'll want a code sample to see that you know what you're doing with PHP, or that you can use a particular framework, or that you understand various algorithms or design patterns. I'm not saying that this Social-Network-MessBox thing is a waste of time. Every programmer should have a project or two they can work on during their spare time to keep improving as a developer, and this seems quite suitable to that end. But it's not going to be as useful in a portfolio.
  12. You've said what you can't do, but haven't mentioned what happens when you try. You've also posted some code, but not the code that actually includes the links in question. How about a little more description about what's going wrong first before we worry about the code?
  13. Do you want to be a backend or frontend developer? How large of a company are you looking to start with? Are you interested in companies with their own home-made applications or ones that use existing applications and frameworks to build their business? More often than not, companies will be using public frameworks - for PHP that mostly means Symfony or Laravel. That means you should try to demonstrate some amount of knowledge with those, and spend less time showing projects where you "reinvented the wheel" and wrote from the ground up.
  14. "Best practices" only apply to very specific questions. There is no single answer to "how do I make a login page" but there are a couple for "how do I handle password resetting". If you're looking to learn frontend Javascript then the most common answer is React, but there are also others like Vue and Angular that have a following.
  15. So I guess if you can't protect yourself from the very few sophisticated attackers then there's no point protecting yourself against an army of dumb attackers?
  16. Do yourself a favor and match the entire set of data, then keep from it the part you want. Also do some preprocessing: it looks like you can skip lines 0-8 every time because those will be occupied by the header, then there are pairs of output on lines 9/11 and 13/15 (skipping the ones in between). If you merge the paired lines together you get dwn-p2p Tagged 222 1/1/1/1/gpononu 1-1-1-257-gponport-222/bridge UP D 00:02:71:db:bb:eb D 216.19.250.121 dwn-p2p Tagged 222 1/1/1/2/gpononu 1-1-1-258-gponport-222/bridge UP D 00:02:71:db:bb:df D 216.19.250.138 which is going to be much easier to use with a regular expressions for getting the parts in between.
  17. What error? Undefined variable?
  18. 1 message per second is what they give you in the sandbox. If you're using this for real messages then you should not be in the sandbox...
  19. Are you sure you're passing data to the view correctly? That array keys in your $data will turn into variables inside the view file?
  20. You'll probably want to switch to using a cookie at some point - that's nicer than having to use that query parameter all the time. Although I feel like I've forgotten something - maybe Xdebug sets the cookie for you? Something like that, maybe?
  21. Rather than guess at what docs are correct, use the official ones. Like that Step Debugging link, which tells you: 1. Set xdebug.mode=debug 2. Since you're a "complex setup" with a remote setup and SSH tunneling, set xdebug.client_host=localhost and client_port=9003 (which your SSH session will forward, provided you have that running at all times). 3. To use triggered debugging for a web application, either (a) set ?XDEBUG_SESSION_START=session name in the URL of the one page you want, (b) an XDEBUG_SESSION cookie, or (c) call xdebug_break() in code. You can also look at the All Settings page to discover that settings like remote_autostart, remote_handler, and remote_mode don't exist anymore.
  22. You have code that ends up doing something like this: $variable = false; echo $variable->current; That is wrong and broken. It needs to be fixed, and making the warnings go away does not do that.
  23. Right: since the animation is based on progress (0-100%) instead of time, what you have to do is (1) increase the animation duration to include the amount of time when it isn't doing anything, then (2) figure out what percentage 2-3 seconds into the animation is and use that in the keyframes. It's not the cleanest solution possible - that would be literally making it not animate during that initial pause - but it is easy, and with an interstitial page like this, no one's going to notice.
×
×
  • 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.