Which screen resolution (Largest or smallest) is best for developer hand-offs?

I am currently designing a web app to cater for the following screen resolutions:

  1. 1920 x 1080
  2. 1600 x 864
  3. 1366 x 768

I’m wondering:

  • Which is the default/primary resolution I should design in for developer hand-offs. (It’s a huge web app and I can’t possibly replicate it in all the resolutions.)
  • What trade-offs am I making, or what precaution should I take if I select 1 resolution over another. (I’m currently inclined to design in 1366×768 since it’s easier for developer to imagine scaling up)

real analysis – Largest Component Interval Proof

I want to check whether the proof for the following is correct:

Every point in an open set $Ssubset mathbb{R}$ belongs to one and only one component interval of $S$, where an open interval $I$ is a component interval of $S$ if and only if $Isubset S$ and there exists no open interval $J$ such that $Isubset Jsubset S$.

Here’s my attempt:

Claim: The interval $I_{x}=(f(x),g(x))$, where $f(x)=infleft{a:(a,x)subset Sright}$ and $g(x)=supleft{b:(x,b)subset Sright}$, is the desired component interval (and the largest).

Proof: By the definition of $I_{x}$, there exists no open interval $J$ such that $I_{x}subset Jsubset S$. Then $I_{x}$ is the largest component interval of $S$.

If $J_{x}$ is another component interval of $S$, since $I_{x}$ is the largest, $J_{x}subset I_{x}subset S$. This forms a contradiction from the definition of component intervals, and so $I_{x}=J_{x}$.

Is the last paragraph logically sound? In Apostal, he uses unions but I don’t quite understand why $J_{x}cup I_{x}=J_{x}$. Is it because of the above arguments I was using?

java – Largest Sum Contiguous Subarray – Kadene’s algorithm

I am looking forward to an answer to improve this code?

Thanks.

Test class

package test;

import main.algorithms.LargestSumContiguousSubarray;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class LargestSumContiguousSubarrayTest {

    LargestSumContiguousSubarray largestSumContiguousSubarray;

    @Before
    public void setUp(){
        largestSumContiguousSubarray = new LargestSumContiguousSubarray();
    }

    @Test
    public void testSumContiguousSubArray(){
        int() a = {-2, -3, 4 - 1, -2, 1, 5, -3};
        int sum = 7;
        Assert.assertEquals(sum, largestSumContiguousSubarray.kadenesAlgo(a));
    }

}

LargestSumContiguousSubarray.java class

package main.algorithms;

public class LargestSumContiguousSubarray {

    // O(n)
    // Kadene's algorithm
    public int kadenesAlgo(int() a) {

        // This is also works for negative numbers
        int max_so_far = a(0);
        int curr_max = a(0);

        for(int i=0;i<a.length; i++){
            curr_max = Math.max(a(i), curr_max+a(i));
            max_so_far = Math.max(max_so_far, curr_max);
        }
        return max_so_far;
    }
}

how to create a MySQL View to select the smallest and largest Records?

i have a table contains items units details (st_items_units) like :-

-------------------------------------------------------
id ------ stitems_ID  ------unit------ stitemsu_UnitNum --- unit price -----
1  ------ 1           ------u1  ------ 1 ------------------ 2 --------------
2  ------ 1           ------u2  ------ 10 ----------------- 20 -------------
3  ------ 1           ------u3  ------ 100 ---------------- 200 ------------
4  ------ 2           ------u1  ------ 1 ------------------ 5 --------------
5  ------ 2           ------u2  ------ 12 ----------------- 60 -------------
6  ------ 3           ------u1  ------ 1 ------------------ 10 -------------
8  ------ 4           ------u1  ------ 1 ------------------ 3 --------------
9  ------ 4           ------u3  ------ 12 ----------------- 36 -------------
9  ------ 4           ------u4  ------ 100 ---------------- 300 ------------
----------------------------------------------------------------------------

as the table every item may be have only one unit or 2 unit or 3 unit or more.
i want to create 2 view :

1- to select the two smallest unit (if there is one unit for the item , repeat the only one ). as this table :

-------------------------------------------------------
stitems_ID ---- stitems_Name ---- SmallUnit ---- LargeUnit ------ SmallUnitPrice ---- LargeUnitPrice ---- UnitNum
1          ---- item 1       ---- u1 ----------- u2        ------ 2              ---- 20             ---- 10
2          ---- item 2       ---- u1 ----------- u2        ------ 5              ---- 60             ---- 12
3          ---- item 3       ---- u1 ----------- u1        ------ 10             ---- 10             ---- 1
4          ---- item 4       ---- u1 ----------- u3        ------ 3              ---- 36             ---- 12
------------------------------------------------------------------------------------------------------------------

2- to select the smallest unit & the largest Unit (if there is one unit for the item , repeat the only one ). as this table :

1          ---- item 1       ---- u1 ----------- u3        ------ 2              ---- 200            ---- 100
2          ---- item 2       ---- u1 ----------- u2        ------ 5              ---- 60             ---- 12
3          ---- item 3       ---- u1 ----------- u1        ------ 10             ---- 10             ---- 1
4          ---- item 4       ---- u1 ----------- u4        ------ 3              ---- 300            ---- 100
------------------------------------------------------------------------------------------------------------------```

javascript – Largest Triple Products without using sort?

I implemented the Largest Triple Products algorithm, but I use sort which makes my time complexity O(nlogn). Is there a way to implement it without a temporary sorted array?

The problem:
You’re given a list of n integers arr(0..(n-1)). You must compute a list output(0..(n-1)) such that, for each index i (between 0 and n-1, inclusive), output(i) is equal to the product of the three largest elements out of arr(0..i) (or equal to -1 if i < 2, as arr(0..i) then includes fewer than three elements).
Note that the three largest elements used to form any product may have the same values as one another, but they must be at different indices in arr.

Example:

var arr_2 = (2, 4, 7, 1, 5, 3);
var expected_2 = (-1, -1, 56, 56, 140, 140);

My solution:

function findMaxProduct(arr) {
  // Write your code here
  if(!arr || arr.length === 0)  return ();
  
  let helper = arr.slice();
  helper.sort((a,b)=>a-b);   // THIS IS THE SORT
  
  let ans = ();
  let prod = 1;
  for(let i=0; i<arr.length; i++) {
    if(i < 2) {
      prod *= arr(i);
      ans.push(-1);
    }
    else {
      if(i === 3) {
        prod *= arr(i);
        ans.push(prod);
      } else if(arr(i) < helper(0)) {
        ans.push(prod);
      } else {
        const min = helper.shift();
        prod /= min;
        prod *= arr(i);
        ans.push(prod);
      }
    }
  }
  
  return ans;
}

combinatorics – Given $n$, what is the largest $m$ such that $m^2prod_{i=1}^n(p_i-2)+prod_{i=1}^n(p_i-1)le prod_{i=0}^np_i$?

(Using $p_n$ as the $n+1$th prime, i.e., $p_0=2$.) After starting with attempting to find the largest $m$ such that
$$sum_{i=1}^m(2i-1)prod_{j=1}^{n}(p_j-2)le p_n#-varphi(p_n#)$$
I rearranged this inequality to

$m^2prod_{i=1}^n(p_i-2)+prod_{i=1}^n(p_i-1)le prod_{i=0}^np_i$

One immediate point is to note that $p-2lt p-1$ while $p_{i+1}-2gt p_i-1$ giving that $p_nprod(p-2)ge prod(p-1)$, and as a follow-up we generally have $p_napproxlog (p_n#)$ with $varphi(p_n#)approx frac{p_n#}{log(p_n#)}$ giving that $mapprox p_n$ is a reasonable starting point. The first couple $m$ (with $p_0=2$) are
$$n=1, m=2\
n=2, m=2\
n=3, m=3
$$

Are there any other approaches for this question or known estimate improvements that would give a better estimate than $p_n$ for $m$?

arrays – Largest subarray with sum greater than K

I was trying to understand the code of [https://www.geeksforgeeks.org/largest-subarray-having-sum-greater-than-k/amp/]
but could not understand.

Specifically, I did not understand the following

1.what does minInd array hold?

2.What is the use of minInd in keeping track of largest subarray?

3.What does find method return?

Illustration with an example would be highly appreciated.

command line – How to show top 10 largest items from git history

I found this command to get the top 10 largest files from my git history (in this closed issue https://github.com/18F/C2/issues/439)

git verify-pack -v .git/objects/pack/pack-7b03cc896f31b2441f3a791ef760bd28495697e6.idx 
| sort -k 3 -n 
| tail -10

It now shows something like this:

32f0dac6ee67325ca12b9c03279ee2dbc7790567 blob   12732444 11425432 1091676437
c63c2851049c51eabbcd54cb46cad367d4e0d593 blob   14368670 12189261 246241495

What do these numbers represent? What of them is the file size? Also I would be very grateful if anyone could break down and explain the top command. I don’t understand it.

formal languages – Largest set of 10-digit numbers where none have Hamming Distance = 1 with any other

I’m working on a system that will require manual data entry of 10-digit numbers (Σ = 0123456789). To help prevent data errors, I want to avoid generating any two strings that have a hamming distance of 1.

For example, if I generate the string 0123456789 then I never want to generate any of these strings: {1123456789, 2123456789, 3123456789, …}

What is the largest set of unique strings in the universe of possible strings that satisfy the constraint where no two strings have a hamming distance of 1? If this set can be identified, is there any reasonable way to enumerate it?

dnd 5e – What Class or Class combination will raise the largest controlled undead (skeletal) army in 48 hours?

I am planning on making a Necromancer type with the largest undead army available in 5e D&D. He has 48 hours to build it. I have an existing strategy but would like to hear your ideas.

  • Hardcover books only, no 3rd party or UA.

  • You cannot polymorph into a Beholder… (It breaks the story) You have to be a standard race caster.

  • No outside help. You are solo.

  • No prep beyond the 48 hours you have to create the army.

  • Assume you are at a graveyard with access to enough bodies.

  • Lv 20 character, no epic boons unless you have a way to get them through a feat.

  • Prefer no magic items, however if you have one that really makes a huge difference let us know.

  • We are looking to specifically raise Skeletons. No generals required unless it increases the overall army size.

  • All spell slots are available to go towards the army.

  • Buffing the army is not necessary, but if you have a way to do it without diminishing its size, I’d love to hear it.