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();   } } 

I’m having problems with Hydra cracking

I’ve tried hydra to crack one of my friends’ web

my line is – hydra -l ” -P /usr/share/wordlists/rockyou.txt.gz http-post-form “/admin:passwd=^PASS^

the thing is, i don’t know if it’s working because the site only has password form, no username

another point is it doesnt output any error mesage

the web is

Are there any more Game-Mechanical Advantages for having a second set of arms like those an Aegis’ suit can provide? [closed]

Are there any more Game-Mechanical Advantages for having a second set of arms like those an Aegis’ suit can provide besides…..

+3 circumstance bonus to Climb checks and CMD against grapple attempts for each extra arm that is not holding anything and multi-weapon fighting.

Like bonus craft checks or make crafting faster, swim checks, writing or drawing. So far all I can think of is blacksmithing where one or two limbs holds on to a piece being forged and two to three other limbs with hammers shaping it.

How to deal with players not having fun and not roleplaying?

first post here, so I apologize if I am breaking some conventions I am unaware of.

I am currently running a group of six people through Tomb of Annihilation (I will not be taking care to avoid spoilers, so you are warned beyond this point). The campaign is decently well. The group of players is slightly rockier than what I’m used to, but all in all I’m fairly confident I can have all of my players enjoy themselves.

My problem is with one person. My group of players is mostly a mish-mash of nationalities, so we play on Roll20, but two of them are real life friends of mine. One of those friends has always told me he enjoys the “game” part of D&D 5e more than the roleplaying, which is fair to me. Not everyone enjoys the same things about D&D and he happens to prefer the mechanics and such. He knows that I include a healthy portion of roleplay in my campaigns, but also like to provide challenging and interesting content that does not involve roleplay.

My first alarm bell should’ve rung when he purposefully made a mute character (An Aarakocra Monk) so he doesn’t have to RP as much. I didn’t think much of it at the time because his character communicated through writing and he had agreed with a different player to share a backstory. While this player indeed took a backseat to RP, he was still involved in the game. This has all changed over the course of the game. As time went on and everyone was chatting and having fun, he became more and more reclused, simply not roleplaying and just being there to play. I have talked to him several times during this period but he assured me he was enjoying himself, so I left him be. This situation did get jarring when the character his shared a backstory with died and he did absolutely nothing in character to react to this.

As time went on, he also stopped talking less in our out of character conversations in addition to not roleplaying, limiting his interactions in the game to just making rolls when I called for it, declaring his attacks and asking if he could craft items during travel time. It was also at this point he unlocked “Stunning Strike” as a monk, leaving him to use it constantly in order to get an advantage in combat. This is fine of course, but limited his interactions even further to just rolling his attacks and declaring he used Stunning Strike.

Finally, this situation came to a head when the party faced Tzindelor, a Young Red Dragon. The party was well prepared and had already done massive damage to her. This player came up and did Stunning Strike as many times as he could. Tzindelor passed most rolls, but critically failed one check, meaning she would be stunned and this epic battle everyone had in mind (it had only lasted a round or two at this point, her health was melting ridiculously quick) would’ve been reduced to the group just hitting a sandbag on HP. So at this point I made snap DM fiat decision and declared Tzindelor has Legendary Resistance.

Now we can all discuss on whether or not this was an appropriate thing to do (Please do make a side note in your reply if you want to, I am interested in other opinions), but the point is that this player has beyond frustrated about this. Right after the event, he found the magical Greataxe in the dragon’s hoard and refused to give it to the barbarian player in the group, despite the fact he can’t effectively use it as his current character.

Other players asked in character if he wanted to give the axe to the barbarian (the other irl friend) since he could actually use it. He did not respond and just said he wished to keep it out of character. I did talk to him about this particular axe later, just asking why he wanted to keep it. He said something along the lines of him finally getting some loot. It’s true he didn’t get much in the way of magical items or upgrades, but then again there’s only been two notable magic items in the group so far, an Alchemy Jug and the Ring of Winter. The Ring in particular is incredibly powerful, but I am slowly punishing the player for using it over time. (more details on how the ring ended up with the players can be provided on request). Eventually he did end up giving the axe to the barbarian because he was asked in real life by that character’s player..

Finally, I’ve heard from a different GM from a different campaign that this player has been still bringing up this incident with the legendary resistance to him. Citing I am making him completely useless. While I can definitely understand the frustration at this particular instance, I have not stopped him from using Stunning Strike before and I genuinely believed the fight was more fun for it. I would happily offer some form of compensation, but I have no idea what to do since he doesn’t roleplay and only spams Stunning Strike. I’ll definitely let him wail on a boss sometime, but somehow I don’t think that will really fix much (Confirmation bias is a pain).

I have invited this player for a talk, face to face, in the coming days. Can anybody offer advice on how to talk to this player? Suggestions for how to make him enjoy the game more would also be welcome. I will provide details as requested and provide an update after the conversation. Currently I am considering just asking him what he wants, what I could do to help. If we can’t reach any solution, I might gently suggest this game might not be suited to his playing style and offer him the option of leaving. I’m not planning on telling him to leave. If he leaves, it will be because he agrees it’s for the best.

I do genuinely hope to come to some sort of solution. The tension this has been causing has not only killed his enjoyment of the game, but is also affecting the atmosphere of the entire group, and nobody wants that.

Can you reload two crossbows with Aegis Greater Extra Arms or having multiple arms and Crossbow Mastery feat in the same round?

Can you reload two crossbows with Aegis Greater Extra Arms or having multiple arms and Crossbow Mastery feat in the same round?

Extra Arms, Greater: The extra arms on the aegis’s astral suit function at nearly the same capacity as his normal arms. Each arm can now wield or use a light or one-handed weapon, shield, or any other item that he could normally use. Alternatively, the aegis can use one or both arms when wielding a two-handed weapon, possibly allowing him to wield a pair of two-handed weapons. The circumstance bonus on Climb checks and CMD against grapple attempts increases to +3 per extra arm that is not holding anything. The aegis must be 8th level and have the Extra Arms and Lesser Extra Arms customizations before selecting this customization.


Crossbow Mastery

Having issues with CMB2 uploader and fields saving in IOS and Safari [closed]

I’m using a WordPress theme and everything works fine on Chrome, Firefox and Edge, but on Safari and iOS the CMB2 image uploader does nothing and the php form also submits empty fields (randomly).

This seems to only be happening with Safari and iOS.

I can attach the form process if anyone could point me in the right direction it would be a great help.

If the Lorenz cipher machine was so much more advanced than the Enigma, how was it broken without having a physical machine?

The Enigma was commercially available before the war, and even during the war, they got their hands on “live” such machines, heavily helping them in breaking the encryption used by the Germans.

The Lorenz was said to be much more secure, required mains power, was much bigger and heavier, and they never got a single “specimen” to look at. Yet they somehow “deduced its inner workings” without having ever seen one, well before the end of the war.

How is this possible? How could this highly complicated machine be reverse-engineered remotely with nothing to go by except the encrypted messages? I fundamentally don’t understand this.

I know that very simple ciphers can be determined by checking how often patterns repeat over time, which helps the attacker because they can tell which letters these correspond to, but this simple technique seems to fall apart completely once it’s anything but the simplest form of cipher. This massive electro-mechanical machine, made specifically to be secure and superior to the cheap and affordable Enigma, ought to have been utterly impossible to break.

I really don’t get it. I “get” how somebody much smarter than I can calculate the math and physics to get a rocket to fly out in space, even though I couldn’t do it myself, but breaking these cipher machines without even having a physical machine to look at… it frankly seems impossible. Almost as if they had access to some kind of supernatural “black magic”.