In what cases is solving Binary Linear Program easy (i.e. **P** complexity)? I’m looking at scheduling problems in particular

In what cases is solving Binary Linear Program easy (i.e. P complexity)?

The reason I’m asking is to understand if I can reformulate a scheduling problem I’m currently working on in such a way to guarantee finding the global optimum within reasonable time, so any advice in that direction is most welcome.

I was under the impression that when solving a scheduling problem, where a variable value of 1 represents that a particular (timeslot x person) pair is part of the schedule, if the result contains non-integers, that means that there exist multiple valid schedules, and the result is a linear combination of such schedules; to obtain a valid integer solution, one simply needs to re-run the algorithm from the current solution, with an additional constraint for one of the real-valued variables equal to either 0 or 1.

Am I mistaken in this understanding? Is there a particular subset of (scheduling) problems where this would be a valid strategy? Any papers / textbook chapter suggestions are most welcome also.

How to remove any words containing two adjacent characters with different cases?

I have a list of permutations of ABCabc and I want to remove any permutations with two adjacent characters with different cases (uppercase and lowercase).

For example,

  • ABCcab is kept.
  • ABCacb must be removed because Ca contains two adjacent characters with different cases.
  • AbBcaC must be removed as well.

Attempt

Here is my attempt but without filtering.

Select[StringJoin /@ Permutations[Characters@"ABCabc"],....] 

what is wrong in following code in Java (Switching cases)?

package ifelse; import java.util.Scanner; import java.util.*;  public class SwitchCasese {     public static void main(String[] args) {         Scanner sc = new Scanner (System.in);         System.out.println("enter your day ");         String day = sc.nextLine();         String result;                  switch (day){         case "monday ":             result = "working";             break;         case "Tuesday":             result = "Studying";             break;         case "wednesday":             result = "riding";             break;                                   }            System.out.println(result );                            }  } ``` 

leetcode 10. Regular Expression Matching edge cases

Please tell me how to deal with edge case such as s:"aa", p:"a*"in else if (p[j] == '*') branch. One way I know is to increase the size of dp like vector<vector<bool>> dp(s.size() + 1, vector<bool>(p.size() + 1, false) ); However, in that case the index of dp will not be the same with the index of for loop.

The problem is as follows:
Given an input string (s) and a pattern (p), implement regular expression matching with support for ‘.’ and ‘*’.

'.' Matches any single character. '*' Matches zero or more of the preceding element. 

The matching should cover the entire input string (not partial).

Here is the code:

class Solution { public:     bool isMatch(string s, string p) {         vector<vector<bool>> dp(s.size(), vector<bool>(p.size(), false) );         dp[0][0] = (s[0] == p[0] ? true : false);                  for (int i = 1; i < s.size(); i++) {             for (int j = 1; j < p.size(); j++) {                 if (s[i] == p[j] || p[j] == '.') {                     dp[i][j] = dp[i - 1][j - 1];                 } else if (p[j] == '*') {                     dp[i][j] = dp[i - 1][j] || dp[i][j - 2];                 } else if (s[i] != p[j]) {                     dp[i][j] = false;                 }             }         }                  return dp[s.size() - 1][p.size() - 1];     } }; 

Non malware use cases of LSASS dumping

I recently looked up some techniques for dumping credentials from LSASS and came across an article that says PPL and other protections were not enabled by default in Windows because some non malicious programs from third parties (including antivirus companies) uses them.

However I was unable to find if actually some programs interact in a non-conventional way with LSASS, which programs do it and why.

Does anybody have information regarding this?

Attack of Oppertunity 5E DnD – some corner cases (and spectres)

We had a 5E DnD session where a Spectre besides a character and a wall “moved” into wall without leaving the reach range, but depending on how you consider reach with obstacles to work and when you leave it, would there be Attack of Opportunity? (AOO)

Rules as written: “In a fight, everyone is constantly watching for a chance to strike an enemy who is fleeing or passing by. Such a strike is called an opportunity Attack. You can make an opportunity Attack when a Hostile creature that you can see moves out of your reach. To make the opportunity Attack, you use your Reaction to make one melee Attack against the provoking creature. The Attack occurs right before the creature leaves your reach. … You also don’t provoke an opportunity Attack when you Teleport or when someone or something moves you without using your Movement, action, or Reaction. For example, you don’t provoke an opportunity Attack if an explosion hurls you out of a foe’s reach or if gravity causes you to fall past an enemy

  • So we have normal case where someone Hostile moves past the Defender, and gets hit leaving * since moved out of reach, getting AOOed.
---*->H  .D.  ... 
  • Then we have case where someone moves in circle around defender – no AOO
---+  .D|  H-+ 
  • So what if someone runs by an open door, or an alcove or something. A tunnel opening by someone with reach like a lance? Is there AOO (feels like there should)? Where AOO? What about 10ft reach? Things are getting a bit weird now, but seems like there should be AOO at one of [?]
---???->H ===.===  ..D..  .....  ..... 
  • Ok, so what of some hostile runs a circle around someone, and there is a wall or pillar or something enough to give 100% giver temporarily? Now we have a case where hostile arguably is better off than the No AOO circle (cover some of way), yet is arguably worse off than running across doorway (less cover yet it felt right door runner had got AOOed. Technically reach not needed if thin iron plate of right size, but for sake of ascii art…
--?->H  ..=..  ..D..  .....  ..... 
  • And the case that got us thinking about it all. Spectre beside Defender (no reach) and a wall moves into wall. AOO? Spectre did not leave reach by distance, yetis not reachable. But if AOO, what if spectre just “fell” through floor? Falling by someone does not cause AOO? By now the whole thing just seem broken.
.-|->S .D| ..|  

Any suggestions on what RAW and (perhaps) what common sense says about these cases?

[ Politics ] Open Question : Why do people keep claiming the mortality rate among confirmed cases is over 3 percent in the U.S.?

19,777 confirmed cases and 276 deaths equals a mortality rate of about 1.4 percent, Of course if we included all the minor cases that are never tested and not confirmed, the rate would be notably lower than even that. Are there political agenda reasons why the mortality rate is being misrepresented? Both confined cases and deaths have been updated since I posted this, but the rate similar, now at. 1.3.    https://www.worldometers.info/coronavirus/country/us/ P.S.  I’m not in anyway claiming this shouldn’t be taken seriously.  I’m just wondering why many continually misrepresent the mortality rate.  What’s their motive?