Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by requinix

  1. If you want it to submit then make it submit. Fix the searchValue function so it does that.
  2. Use SMART and tools to monitor health, then RAID the drives until they fail!
  3. Hey, when we pay those people thousands of times more than we pay our teachers, it only makes sense we'd want to protect them.
  4. Rugby? Oh, you mean European Football?
  5. Nah, I've gone this long without having a Facebook account for myself, no need to start now. Oh yeah, we have a git cloud account thing somewhere I keep forgetting about...
  6. Use a loop that looks like this: do { update the pick number, and if needed the round number fetch appropriate pick from table fetch information about the pick } while (the selected employee does NOT have weeks available to use); Important note: make sure that you have first verified there are any weeks available, for any employee. If there aren't then you can stop the process - and you definitely don't want to run the above code because it will never stop. Technically you're still vulnerable to a race condition though. The loop is to keep searching for an employee (which, according to the above sentence, you know there is at least one of) when the one you just looked at doesn't have any weeks to use. What's inside the loop should look something like what you already have... I assume you're running this code when an employee has made their pick and you're setting up for the next person, right?
  7. So you claim, but then you turn around and say in the very next sentence something that is factually incorrect. IMAP software does not receive emails. SMTP software is what does that part of the process. Most of the time mail servers use one software suite to provide all the mail services needed: SMTP, IMAP, sendmail, all of it. (Not necessarily bundled together.) Like on Linux, postfix is more or less the reigning king, so after installing postfix itself (which provides SMTP/mailbox and sendmail functionality) if you wanted IMAP support as well then you'd install a postfix-compatible IMAP service (eg, courier). If your emails are being stored in the database in the way that I described, and therefore the IMAP server is loading the emails from the database, IMAP will no longer show those emails because they were deleted.
  8. vac_admin also needs to know the current round number. Let's pretend you call that "current_round_number". You can determine which employee picks next by grabbing the vac_pick_order row with pick_order = (current_pick_staff + current_round_number - 2) % (number of employees) + 1 So, - The very first employee (current_pick_staff=1, current_round_number=1) is pick_order = (1 + 1 - 2) % 3 + 1 = 0%3 + 1 = 1 - The second employee (current_pick_staff=2, current_round_number=1) is pick_order = (2 + 1 - 2) % 3 + 1 = 1%3 + 1 = 2 - The third is pick_order = (3 + 1 - 2) % 3 + 1 = 2%3 + 1 = 3, and then you reset current_pick_staff=1 and increment current_round_number=2 The first round is 1, 2, 3. - The fourth (current_pick_staff=1, current_round_number=2) is pick_order = (1 + 2 - 2) % 3 + 1 = 1%3 + 1 = 2 - The fifth is pick_order = (2 + 2 - 2) % 3 + 1 = 2%3 + 1 = 3 - The sixth is pick_order = (3 + 2 - 2) % 3 + 1 = 3%3 + 1 = 1 The second round is 2, 3, 1. And so on.
  9. I kinda suspected it should have been along those lines... If the order is simple like that - fixed sequence but shifts by one each round - then what I said before except you also store the round number. Given the round number and current staff member you can determine who the next is, and whether to advance to a new round.
  10. Does the order of staff change? If so then generate the list and store it somewhere for each period. Store with the period the staff member who gets to make the next choice. It starts with the first person. When they make their choice, switch to the next person who has weeks left. Repeat until you get to the last person.
  11. You can't prevent someone from replaying the video if it downloaded to their computer. Most you can do is prevent them from downloading the video a second time, which you would do by creating a one-time URL that allows you to know when the video was requested and when another attempt to download through that same URL should be blocked (which implies routing the video through a PHP script instead of giving direct access).
  12. To make sure I understand this, You have some sort of custom application you're working on, right? It's not something you went out and bought. Nobody else really has this software because it's yours and, apparently, still in development. Now you have a requirement to define/alter the behavior of the application in a specific way, and you're asking if there's something out on the internet you can download that will do it for you? Someone out there just happens to have knowledge of your application and has done the work you need to do for you? And you need to find out where it is? Good luck? Or could it be that I'm misunderstanding and you're willing to write code for your application so that it works the way you want it to work?
  13. No, I'm saying there isn't anything to delete anymore. Look. IMAP server software is something that runs and gives people on the internet access to the emails stored on the server. The IMAP software does not "have" the emails. It does not possess them. It merely has access to them. The actual place the emails could be stored is absolutely anywhere - files, database, monkeys, whatever - and as long as the IMAP software knows how to get them then you can connect to it and read your email. So hopefully you are understanding now that the place where the emails and the IMAP software are two different but related things, yes? What I'm saying about deleting is that the emails, when they're received by the email processing service, go into your database. That is where the emails get stored. The emails get stored immediately in the database. This has absolutely nothing to do with IMAP. IMAP is about accessing the emails. I'm not talking about accessing the emails. I'm talking about where the email messages go the SMTP software receives them. Okay? So now you have the emails being stored in a database, right? With them in the database you now have to set up the IMAP service to connect to and read from that database. How you do that depends on the service. Whether you can do that easily or have to install something new or, worst case, have to write some code and/or scripts to do the work because there's no built-in support to do this, depends on the service.
  14. If you're intending to act as a proxy then the behavior of proxies when it comes to returning headers is defined for HTTP and you should mirror it. If you're intending to just kinda act as a middleware between the client and the actual source you're communicating with then I would whitelist by mapping the headers you know the remote server will return to headers that your service should return.
  15. Laravel uses a /api prefix for api.php routes by default. Should the path be /api/user-timelogs? Does either URL work from the browser?
  16. Oh yeah, we have an actual website I keep forgetting about... How does the feed work? Cron and database? Fetch and cache? After having it cover all the sources we want, which may need some coding, can we edit it to support a query string filter, then have IPB import the feed into the forums? Besides the news aggregation here, the nice thing is that making them IPB threads would allow commentary. We have a Facebook? Huh. Okay. What can we use it for? Content promotion? Or is that a Twitter thing?
  17. PHP and ASP are two very different languages and programming styles. Don't try to find PHP versions of the ASP things you know and instead learn the PHP way of doing it. Whatever editor you want. There is no best one.
  18. You have a query there already. It returns a count. If you don't want a count and you want data instead then change the query to suit...
  19. If I had MySQL on hand to test with then I would test whether the DATE format allows values like "0000-00-120" (120 days). If not then you can just use a regular text type. Combined with DATE_ADD or +INTERVAL you should be able to add that interval to your date values inside queries. That's if you need to do the date math in SQL. If it was just PHP then I'd still test the DATE format for its convenience, but otherwise you can use a standard interval format like "P120D" and PHP's date functions.
  20. If it's for passwords, password_hash and friends. If it's other purposes, the hash extension (assuming you want something other than MD5 or SHA1).
  21. Regexes cannot modify the text that they capture. You'll need to find another method.
  22. It wasn't 😛 Yours doesn't work properly for the year 2000.
  23. Storing the emails in the database does not mean copying them. It means that is the source of emails. There is no IMAP server anymore. There is nothing to delete. Attachments are not separate files. They're part of the email message itself. ...I'm not sure you actually understand what you're talking about anymore.
  24. If you're fine with your client being the only means to access emails then sure, go ahead and store them in a database. The process depends on your mail server, but generally they have some sort of plugin that would be relevant - run a script when a message arrives, something like that. If not, or if you don't have control over your mail server, then stick with PHP. You can cache email content in the database in order to reduce the bandwidth between PHP and the IMAP server, but you should still be querying it for basic information (eg, message lists) in case that's modified by some other mail client.
  • 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.