How to create custom backend admin menu in different languages?

So I’ve found absolutely nothing about this subject online.

What I’ve done: I successfully programmed a custom admin menu in english for my wordpress backend, according to https://webkul.com/blog/how-to-add-menu-in-wordpress-admin-panel/, so that’s all good.

What I need: If I change the language of the backend (via the user settings in the wordpress backend), every admin menu gets translated to the new (selected) language, except from my custom admin menu, which of course still appears in English. My question is: How / Where do I need to store custom admin menus in other languages, such that they also get their language changed according to the language selected for the backend ??

Different way of solving boolean satisfiability

I know there are commonly used boolean satisfiability problem-solving methods (such as DPLL etc.). As far as I know, such methods mostly depend on converting boolean expression into the CNF or DNF form. However, I’m trying to solve the given expressions “as-is”, without conversion to other forms. So, for boolean expression, I’m building a tree, consisting of many logical gates (AND, OR, NOT, XOR, VAR, CONST) and trying to propagate the right values by applying boolean laws.

step 1 – Common boolean laws

In such an approach there are some trivial steps like if AND has a value of 1 then the inputs must be both 1 and 1, or if XOR has a value of 1, and one input is 0, then the second input must be 1, etc. This step I call “propagation of values”, and it is performed until there are no values to resolve.

step 2 – Resolution by conflict

The second step is to assign value to the random gate, without a value assigned/resolved yet, name it X temporarily, then do “propagation of values”, and observe if in the expression tree some conflicts occurred. By conflict, I mean illegal state of the gate like AND(1,1)->0. So if the conflict occurred, this tells us that value assigned to the X gate is illegal, so I can assign the opposite value, and get back to the first step. This step I call “resolution by conflict”.

step 3 – Resolution by commons

The third step is to assign a value of 0 to the random gate, without a value assigned/resolved yet. Perform “propagation of values”, collect results (the assigned values of gates from the tree), in other words, do a “snapshot” of the tree after assignment. Then back to the original state before this step, assign a value of 1 to the same gate, perform propagation of values, then collect the second “snapshot”, then back to the original state again. Now, if the snapshots are both conflict-free, we could look at values that are both the same in the first and the second snapshot. These values are independent of the initial gate assignment and valid, so we can safely assign them to their gates. This step I call “resolution by commons”.

These steps were tested by me (program in C++) and worked pretty well.

Question

So, the question is, what other kinds of steps can apply for this kind of resolution / BSAT solving? I’m asking because there are still some problems that with these steps I can’t go further (algorithm with these steps “see” that is nothing to do more).

If something is unclear, please let me know in the comments. Also if such an approach is known I’ll be thankful for references or links to resources about the topic.

Different background colors on different dates in DateListPlot

I have a time series plot

DateListPlot[{1, 1, 2, 3, 5, 8, 11, 13, 17, 21}, {2000, 8, 6}] 

I would like to have a background which is white upto Aug 10 and yellow from Aug 10 on to enphasize these later days. In general: how can you have different background colors on different dates?

I think I saw this done in the documentation center, but cannot find where.

Can you suggest how to do it?

How is Authentication Required different from Access Denied [closed]

I was trying a bug bounty challenge and I was given a vulnerable URL which needs a password to access it.

  • Case 1: When I try to do SQL-Injection in Username and Password, I get a page: access denied “Username not found
  • Case-2: If I keep entering random normal usernames and passwords, I get the “Enter username and Password” dialog box, and after so many trials I get the page which says: WWW-Authentication needed!

How are the two scenarios different?

Is Case 1 different than Case 2 in terms of vulnerabilities?

enter image description here

Relative Value of Different Consequences

A discussion of handling of mechanics for characters who quickly regenerate their wounds resulted in an idea of implementing regeneration by changing the type and/or number of Consequences a regenerating character has: if it has multiple Mild Consequences and no Severe (or even Moderate) ones, this results in the system naturally producing mechanical effects that closely match what happens in the fiction – character genuinely getting wounded, but being at full or near-full health in a few scenes.

This seems like an elegant ways of making the pacing and mechanics follow the fiction. However, it raises one big question: what is a fair exchange rate between Consequences of different severity levels? Or, alternatively, how much is a Consequence of a given severity worth in terms of other ‘currencies’ of the game?

Before you try to frame-challenge: The answer may be academic for a party that all consists of immortals/werewolves/T-1000s/trolls, but is of interest for a more varied party where some PCs would have such traits and others wouldn’t. It’s certainly a concept that comes up from time to time and that I’ve seen discarded for reasons of lack of confidence about the mechanical utility of such benefits.

Prior research and factors to consider:

It seems that the relative utility of a Mild Consequence hovers around a level of a bit less than 1 Refresh (or 1 Stunt), maybe half of one:

  • In general, a Mild Consequence is about as good as one Invocation for preventing a Take-Out, but it comes with one free Invocation for an enemy. It is unambiguously worse than Armour:2 (which is often priced at a Stunt), since it’s only used once per Conflict.
  • In a campaign with about 5+ scenes and about a couple or more appropriate-type Conflicts per Minor Milestone, it’s plausible to maybe fill and recover a couple of Mild Consequences per Minor Milestone, but that requires lucky timing. (In my experience that never happened even once so far. On the contrary, Conflicts seem rare in games I’ve been in, even in action-oriented games.)
  • A Consequence can be of use as a Success at a Cost and some other similar applications, but those seem rare.

However, even taking that in mind, I find it harder to compare the value of Consequence of other severity:

  • they act to absorb more Shifts…
  • …while still only providing 1 Free Invocation to the enemy;
  • but they are significantly slower to recover from, meaning you can only use them rather rarely.

I’ve seen opinions going in both directions about whether Moderate and Severe Consequences are more or less powerful than Mild ones (and used to hold the latter opinion, but by now am no longer confident in it after seeing the main drawback pointed out to me).

Could anyone please help me evaluate their relative values, whether backed up by mathematically well-founded theorycraft, or by sufficient actual-play experience and practical comparisons?

As a DM how can i manage a group with different amount of free time?

I’ve started playing D&D 5e with a group of friend recently. I’m the DM and there are 4 players. In this time of crisis, one is still working and is only available during week ends and the other 3 (and me) have quite a lot of spare time and are eager to play on a daily basis.

Is there a viable option for me and the 3 players to do some side questing or something else and play while not creating a gap between the players ?

Solutions like doing a side campaign without earning neither experience point nor gold seems to ruin the experience. I thought of multi classing but it seems to really impact the character even if the player only use its original class.

I see 3 solutions so far, but none are satisfying : 1: make player create another character 2: create a copy of the current character which will evolve separately 3: do an adventure where all exp and gold won’t be carried over to the main adventure

So i wondered if there is anything that i didn’t’ think of. Sorry if this is a duplicate but i didn’t find anything cause i don’t really know how to write the question in the first place.

How can this Line-Breaking algorithm consider spaces as having width different than 1.0?

The Divide & Conquer Algorithm for Line-Breaking described here is given below, both in Python and in Dart (which is similar to Java/C#).

Line-breaking is also known as “line wrap”, “word wrap”, or “paragraph formation”, and this algorithm is used for achieving minimum raggedness.

This algorithm works, but it considers each space as having exactly width = 1.0 .

My Question:

How can I modify this algorithm so that it ignores spaces? In other words, make it consider spaces as having width 0.0? (or it would also work for me if I could define any width I wanted for the spaces, including 0.0).

Python Implementation:

def divide(text, width):     words = text.split()     count = len(words)     offsets = [0]     for w in words:         offsets.append(offsets[-1] + len(w))      minima = [0] + [10 ** 20] * count     breaks = [0] * (count + 1)      def cost(i, j):         w = offsets[j] - offsets[i] + j - i - 1         if w > width:             return 10 ** 10         return minima[i] + (width - w) ** 2      def search(i0, j0, i1, j1):         stack = [(i0, j0, i1, j1)]         while stack:             i0, j0, i1, j1 = stack.pop()             if j0 < j1:                 j = (j0 + j1) // 2                 for i in range(i0, i1):                     c = cost(i, j)                     if c <= minima[j]:                         minima[j] = c                         breaks[j] = i                 stack.append((breaks[j], j+1, i1, j1))                 stack.append((i0, j0, breaks[j]+1, j))      n = count + 1     i = 0     offset = 0     while True:         r = min(n, 2 ** (i + 1))         edge = 2 ** i + offset         search(0 + offset, edge, edge, r + offset)         x = minima[r - 1 + offset]         for j in range(2 ** i, r - 1):             y = cost(j + offset, r - 1 + offset)             if y <= x:                 n -= j                 i = 0                 offset += j                 break         else:             if r == n:                 break             i = i + 1      lines = []     j = count     while j > 0:         i = breaks[j]         lines.append(' '.join(words[i:j]))         j = i     lines.reverse()     return lines 

Dart implementation:

class MinimumRaggedness {    /// Given some [boxWidths], break it into the smallest possible number   /// of lines such as each line has width not larger than [maxWidth].   /// It also minimizes the difference between width of each line,   /// achieving a "balanced" result.   /// Spacing between boxes is 1.0.   static List<List<int>> divide(List<num> boxWidths, num maxWidth) {      int count = boxWidths.length;     List<num> offsets = [0];      for (num boxWidth in boxWidths) {       offsets.add(offsets.last + min(boxWidth, maxWidth));     }      List<num> minimum = [0]..addAll(List<num>.filled(count, 9223372036854775807));     List<int> breaks = List<int>.filled(count + 1, 0);      num cost(int i, int j) {       num width = offsets[j] - offsets[i] + j - i - 1;       if (width > maxWidth)         return 9223372036854775806;       else         return minimum[i] + pow(maxWidth - width, 2);     }      void search(int i0, int j0, int i1, int j1) {       Queue<List<int>> stack = Queue()..add([i0, j0, i1, j1]);        while (stack.isNotEmpty) {         List<int> info = stack.removeLast();         i0 = info[0];         j0 = info[1];         i1 = info[2];         j1 = info[3];          if (j0 < j1) {           int j = (j0 + j1) ~/ 2;            for (int i = i0; i < i1; i++) {             num c = cost(i, j);             if (c <= minimum[j]) {               minimum[j] = c;               breaks[j] = i;             }           }            stack.add([breaks[j], j + 1, i1, j1]);           stack.add([i0, j0, breaks[j] + 1, j]);         }       }     }      int n = count + 1;     int i = 0;     int offset = 0;      while (true) {       int r = min(n, pow(2, i + 1));       int edge = pow(2, i) + offset;       search(0 + offset, edge, edge, r + offset);       num x = minimum[r - 1 + offset];        bool flag = true;       for (int j = pow(2, i); j < r - 1; j++) {         num y = cost(j + offset, r - 1 + offset);         if (y <= x) {           n -= j;           i = 0;           offset += j;           flag = false;           break;         }       }        if (flag) {         if (r == n) break;         i = i + 1;       }     }      int j = count;      List<List<int>> indexes = [];      while (j > 0) {       int i = breaks[j];       indexes.add(List<int>.generate(j - i, (index) => index + i));       j = i;     }      return indexes.reversed.toList();   } } 

Remove less secure ciphers from WHM by decrpyting different convoluted references to the same ciphers

I have previously removed less secure ciphers from WHM (Web Host Manager) however it has been a while and I want to learn how to fish, not be handed a fish.

The trouble seems to stem from the fact that there is little-to-no consistency in how ciphers are referenced or even where they are defined.

WHM Cipher Definitions

Ciphers seem to be listed in two places: Exim Configuration Manager and Apache Configuration ⇨ Exim Configuration Manager.

  • The Apache Configuration has a field “SSL/TLS Protocols” which is currently defined as ALL:!ADH:!AECDH:!EDH:!RC4:+HIGH:+MEDIUM:-LOW:-EXP.
  • The Exim Configuration Manager currently has a field “SSL/TLS Cipher Suite List” which is set to ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256.

Definition of Weak Ciphers

Here is the SSL Labs test for my domain. I have everything except TLS 1.2 and TLS 1.3 disabled and many less secure ciphers disabled. The test lists the following ciphers as being weak:

TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) ECDH x25519 (eq. 3072 bits RSA) FS WEAK 128 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) ECDH x25519 (eq. 3072 bits RSA) FS WEAK 256 TLS_RSA_WITH_AES_128_GCM_SHA256 (0x9c) WEAK 128 TLS_RSA_WITH_AES_256_GCM_SHA384 (0x9d) WEAK 256 TLS_RSA_WITH_AES_128_CBC_SHA (0x2f) WEAK 128 TLS_RSA_WITH_AES_256_CBC_SHA (0x35) WEAK 256 

I attempted to “translate” though after updating the values in both sections and running cPanel’s AutoSSL I still got the same results on the test.

Translating Cipher References

I attempted to reference the TLS 1.2 standard as well as some documentation from OpenSSL. I made numerous other search queries and spent hours reading through documentation, standards and forums without luck.

Here is my attempt to make the lists look more similar to each other:

From the Exim Configuration Manager:

  • ECDHE_ECDSA_CHACHA20_POLY1305
  • ECDHE_RSA_AES128_GCM_SHA256
  • ECDHE_RSA_AES256_GCM_SHA384
  • ECDHE_RSA_AES128_SHA256
  • ECDHE_RSA_AES256_SHA384
  • ECDHE_RSA_CHACHA20_POLY1305

From the SSL Labs Test to be removed:

  • ECDHE_RSA_WITH_AES_128_CBC_SHA
  • ECDHE_RSA_WITH_AES_256_CBC_SHA
  • RSA_WITH_AES_128_GCM_SHA256
  • RSA_WITH_AES_256_GCM_SHA384
  • RSA_WITH_AES_128_CBC_SHA
  • RSA_WITH_AES_256_CBC_SHA

The list says to remove two ECDHE and the rest don’t have ECDHE. In that example how do I remove something not defined? Secondly it suggests removing CBC though that is not defined in the first list.

Desirable Answer Format

Learning is the detection of patterns so I’m really looking for an answer with a table where column A lists the ciphers from the SSL Labs test and column B references how they are referenced (to be defined (for stronger ciphers) and disabled for weaker ciphers). Just enough that I can detect the pattern of how the test references the same ciphers as Apache (or whichever software directly handles all of this). A good reference URL with such a table (and where on the page if it’s more than just a few paragraphs) would be very helpful.

It would also be incredibly useful to know how to have the server define a preferred cipher and to know which is considered the strongest if possible please.

Why do Amdahl’s law and Gustafson’s law give us different speedups, when applied on the same task?

I am given a task, where exactly 50% of the work is parallelizable. When applying Amdahl’s law to calculate speedup when using 2 processing units instead of one, I get a different result than the one I get when calculating the same speedup using Gustafson’s law. I don’t understand why is that.