## Approaches for analyzing the work, critical path length and parallelism

I’d like to know where to find references and approaches on how to analyze the work, critical path length and parallelism of algorithms.

In particular, for solving the type of homework problems below:

## Why WCAG 2.0 doesn’t comply with its own line length criterion of 1.4.8?

WCAG 2.0 Success Criterion 1.4.8 clearly specifies that to achieve AAA conformance level, Reading content in a single line should not exceed 80 characters for non-CJK (Chinese Japanese & Korean) characters.

But the paragraphs which wrote the same stuff has more than 111 characters in a single line including space. (Space is also a character: ASCII code 32) Even if we omit the space, The character count is way over 80. So what is the deal here? Am I missing something?

Is there any mention of the line length requirements for AA or A?

## Finding path with specific length in weighted graph

Given a weighted, cyclic, directed graph and two nodes I am looking for a connecting path which total weight comes as near as possible to a specific value which is greater than the shortest path. Example in a real world scenario: Find a route from Washington D.C. to New York City which is 400 miles long, despite the shortest path is ~230 miles. All my considerations so far failed for one of the following reasons:

• Most routing algorithms like Dijkstra are not working in this case because there is nothing to minimize or maximize (the divergence of given weight to path weight should be minimized, but you need the finished path to calculate it)
• DFS and BFS can be used to find a path with a specific number of hops (edges), but it doesn’t consider weighted edges

## How to compute function rolling averages maximum for each possible interval length?

I’m searching for a fast way to calculate

$$g(k):=\max_{0 for $$0

given some discreet function $$f$$ defined on $$[0; T]$$.

Is there algorithm to do it faster then naive $$O(n^2)$$? If so how?

## Length of Page Concerns

This is a reoccurring problem among clients I work with, so wanted to see if anyone else had some insight. Every client I design for tends to be hyper-aware of page length, with the tendency to fret over if the user will get “lost at the bottom of the page” or need help navigating back up. The pages are of average length, and I try to assure them that users will just scroll back up if they need to. I provide multiple CTAs along the page, including top and bottom. But still, the clients want to include “back to top” elements or fixed top navs. Does anyone have ways they combat this? Any data or articles?

Thanks!

## Is the certificate for primality testing polynomial in the length of the input?

If we were to assume that primality testing was in NP.

What would the certificate be, so that a polynomial time verifier can check the number X is indeed prime?

## Run length encoding in C#

This is the original question: https://www.geeksforgeeks.org/run-length-encoding/

Given an input string, write a function that returns the Run Length Encoded string for the input string.
For example, if the input string is “wwwwaaadexxxxxx”, then the function should return “w4a3d1e1x6”.

the only change I did is that if the character appears once there is no need to print 1 after the letter.

using System; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting;  namespace StringQuestions {     /// <summary>     /// https://www.geeksforgeeks.org/run-length-encoding/     /// </summary>     [TestClass]     public class RunLengthEncoding     {         [TestMethod]         public void RunLengthEncodingTest()         {             string str = "wwwwaaadexxxxxxywww";             string expected = "w4a3dex6yw3";             Assert.AreEqual(expected, RLE.Encode(str));         }     }      public class RLE     {         public static string Encode(string str)         {             str = str.ToLower();             StringBuilder stringBuilder = new StringBuilder();              for (int i = 0; i < str.Length; i++)             {                 int counter = 1;                 if (!char.IsLetter(str[i]))                 {                     throw new ArgumentException("string should contains only letters");                 }                  while (i < str.Length - 1 && str[i] == str[i + 1])                 {                     counter++;                     i++;                 }                  if (counter == 1)                 {                     stringBuilder.Append(str[i]);                 }                 else                 {                     stringBuilder.Append(str[i]);                     stringBuilder.Append(counter);                 }             }              return stringBuilder.ToString();         }     } } 

## Timing attack – Is safe to check if strings have the same length?

In Node, you can use crypto.timingSafeEqual() to check if two strings are equal in a timing-attack safe way. But, they must have the same length, so you have to do something like that:

return stringOne.length === stringTwo.length && crypto.timingSafeEqual(Buffer.from(stringOne), Buffer.from(stringTwo)) 

Is this approach safe? In my opinion, it’s not, because it can leak the length of the string! Surprisingly, I discovered that hash_equals() of PHP works in a similar way:

// Source code from php-src/ext/hash/hash.c  if (Z_STRLEN_P(known_zval) != Z_STRLEN_P(user_zval)) {         RETURN_FALSE; }  known_str = Z_STRVAL_P(known_zval); user_str = Z_STRVAL_P(user_zval);  /* This is security sensitive code. Do not optimize this for speed. */ for (j = 0; j < Z_STRLEN_P(known_zval); j++) {     result |= known_str[j] ^ user_str[j]; } 

Do you consider this approach safe?

## SharePoint 2016 – NewForm.aspx- serialization error- The length of the string exceeds the value set on the maxJsonLength property

We have a very large list with more than 10,000 items. We can display the list. We can edit an exiting item from the list. But when we create a new item we get an error. as below: Application error when access …/NewForm.aspx, Error=Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. We did following things suggested on internet. 1. increased maxJsonLength big value very high in web.config. it did not help. 2. In web Application increased List View Threshold to 100,000 from 5000. But it did not help. I will request if any other suggestion somebody could offer. Thanks.

## Sorting an array of strings by length in linear complexity

I am trying to find an algorithm to sort an array of strings by length in O(n) time complexity, and O(1) space complexity. The max length of the strings is known. Because of that, I tried using counting sort, but I failed to do in O(1) space complexity. Because multiple strings might have the same length, I need to store the strings in some kind of 2D array for each possible length, and that is O(n) space in the worst case of all strings having the same length. How would I go about solving this problem?