## How many elements are too many for one screen of a mobile (iOS/Android) application?

Without scrolling, what would be the maximum amount of centered buttons I could arrange on a vertical axis before it became too cluttered? Interface Builder gives suggested distances between elements, but should there be whitespace on the top and bottom as well?

Specifically, I have a simple utility app with a single screen. On this screen is an ad, two lines of text, two function buttons, and a footer image. I am thinking of adding a third feature. Although this is the specific instance, I’m looking for more general guidelines. When is it too much? When does it all become visual clutter?

## SharePoint 2013 – Render Page in iFrame without Navigation Elements?

I’m in a SP environment that is tightly controlled and for instance don’t have access to Designer.

I’m attempting to setup a page to have the user select contents from buttons, which will then load those ‘content’ pages into an iFrame. I have a test case setup and working. However, when I click a button and a page loads within the iFrame it brings with it the global navigation and left menu bar. I’ve tried:

1) Appending ?Dlg=1 to the URLs. No change.

2) Applying following code to the

<style type="text/css">      #s4-ribbonrow, .ms-cui-topBar2, .s4-notdlg, .s4-pr s4-ribbonrowhidetitle, .s4-notdlg noindex, #ms-cui-ribbonTopBars, #s4-titlerow, #s4-pr s4-notdlg s4-titlerowhidetitle, #s4-leftpanel-content {display:none !important;}      .s4-ca{margin-left:0px !important; margin-right:0px !important;}  </style> 

3) Applying following code through CWEP, but SP keeps overwriting it.

<style> .ms-core-navigation { DISPLAY: none } #contentBox { margin-left: 0px } </style> 

Any help would be appreciated!

## Returning sorted lowest k elements in a binary heap

Given a binary heap of size $$n$$ and a number $$k\le n$$. How can I return an array with size $$k$$, which contains the $$k$$ lowest elements in the binary heap, so that it will be sorted in the end?

The problem is that the time-complexity needs to be $$\Theta(k \log(k))$$.

## Multiple elements same action

I have a fundamental question. Is it gonna be a bad UX practice if I use two separate elements, with different UI design, to do the same task? For example, I wish to have a fancy button on the middle of the landing the page, that does the same thing as my “services” link that could be accessed through clicking Menu > Services on the same page.

## Minmum sum of elements, taken 2 at a time

The question is: Given an array of integers say [8,4,6,12,10] You can pop any two elements at a time and place the sum back into the array. Repeating until a single element (final sum) is remaining. What is minimum final sum, given that you are allowed to pop any two elements at a time?

My approach is two pop the minimum two elements in the array, push the sum back. Repeat this until a single element is remaining.

My solution is as follows:

1. Sort the array
2. Pop first two elements, add them, get the sum
3. Place the sum in the array in such a way that it remains sorted (to avoid sorting again)
4. Repeat steps 2 and 3 until we have less than two elements in the array

Code:

function join(parts) {   if(parts.length < 2) {     return parts   }   sum = parts[0] + parts[1]   sliced = parts.slice(2)   placed = place(sliced, sum)   return join(placed) }  function place(arr, x) {   index = 0   for(i=0;i<arr.length;i++) {     if(arr[i]>x) {      index = i      break     }    }   first = arr.slice(0,i)   second = arr.slice(i)   return [...first,x,...second] } function process(parts) {   parts.sort((a,b)=>a>b)   return join(parts) }  process([8,4,6,12,10]) 

Is this best possible approach? Can you think of any better optimized approach?

## How to find a position of replaced elements in a list

I have two sets of elements

a={3, 4.8, 5, 4.2, 3.6, 2.3, 4.5, 3.7}

b={2.8, 4.7, 5.3, 3.5, 4.7, 2.8, 4.2, 3.4}

and I create a new set which compare elements of sets and take their minimum

c=MapThread[Min, {a, b}] 

({c=2.8, 4.7, 5, 3.5, 3.6, 2.3, 4.2, 3.4})

And now I want to find positions of elements in new set which were changed for smaller. So I would like to get something like

{{1},{2},{4},{7},{8}}

Any ideas how could I do it? Thank you for any advices.

## partially commutative elements in powers of augmentation ideal

Let $$\vartheta$$ a relation of parcial commutation over a set $$X,$$ and consider the respective free parcially commutative group $$F(X, \vartheta).$$ Let $$K[F(X, \vartheta)]$$ the parcially commutative free group ring. Let $$\varepsilon \colon K[F(X, \vartheta)] \to K$$ $$\sum\limits_{\overline{x} \in F(X, \vartheta)} \alpha_{\overline{x}} \overline{x} \mapsto \sum\limits_{\overline{x} \in F(X, \vartheta)} \alpha_{\overline{x}}$$ We define in $$K[F(X, \vartheta)]$$ the augmentation ideal $$\mathfrak{X} = \ker(\varepsilon).$$

Denote by $$\frac{\partial f}{\partial \omega}$$ the Fox derivative, with $$\frac{\partial x_i}{\partial x_j} = \delta_{ij}$$ for $$x_i \in K[F(X)],$$ and

$$\frac{\partial^n f}{\partial x_{j_n}\partial x_{j_{n-1}} \cdots \partial x_{j_{1}} } = \frac{\partial}{\partial x_{j_n}} \left( \frac{\partial^{n-1} f}{\partial x_{j_{n-1}} \cdots \partial x_{j_{1}} } \right)$$

Also, $$\varphi \colon K[F(X)] \to K[F(X, \vartheta)]$$ is defined by $$\varphi(x_i) =\overline{x_i},$$ for $$x_i \in F(X).$$

We can define a derivation in $$K[F(X, \vartheta)],$$ letting $$D(\overline{x_i}) = \overline{x_1}-1$$ for $$\overline{x_i} \in F(X, \vartheta)$$ and

$$D(\overline{f}) = \sum\limits_i \varphi\left( \frac{\partial f}{\partial x_i}\right) (\overline{x_i} – 1)$$

How can I prove that $$\overline{f} \in R[F(X, \vartheta)]$$ is in $$\mathfrak{X}^n$$ iff $$\varepsilon\left( \varphi\left(\sum\limits_{\omega \in \overline{\omega}} \frac{\partial f}{\partial \omega}\right) \right) = 0 \quad \forall \overline{\omega} \in F(X, \vartheta), |\overline{\omega}|\le n-1?$$

## Python: Compares elements of each list of lists to corresponding ones in different list

Goal: To reduce processing time significantly (if possible) by making this working code more efficient. Currently 50k row by 105 column data taking about overall 2 hours to process. Share of this piece is 95%.

This piece is a key part of my python 3.6.3 script that compares two set of list of lists element by element regardless of datatype. Spent long hrs but seems I reached my limits in here. Running in Win 10.

“””
Sorry about lots of variables. Here is description:
Ap, Bu – list of lists. Each list within list:
a) may contain any datatype (usually String, Number, Null, Date).
b) 1st element of list within list is always unique string.
c) has equal number of elements as other lists
d) each list in Ap has corresponding list in Bu (if 1st element of a element list of Ap matches that of Bu, that’s considered there is corresponding match)

prx – is index of a list within Ap
urx – corresponding/matching index of a list within Bu, as evidenced by urx=l_urx.index (prx)

cx – is index of an element in a single list of Au ux – is a corresponding element index of an element in a matching list of Bu, as evidenced by ux = l_ux.index(cx)

rng_lenAp – is range(len(Ap))
rng_ls – is range(individual list within Ap)

To visualize (just example):
Ap = [[‘egg’, 12/12/2000, 10, NULL], [‘goog’, 23, 100, 12/12/2000]]
Bu = [[‘goog’, ‘3434’, 100, 12/12/2000], [‘egg’, 12/12/2000, 45, NULL]]

“””

for prx in rng_lenAp:     urx = l_urx.index (prx)     if Ap[prx][0] == Bu[urx][0]:         for cx in rng_ls:             ux = l_ux.index(cx)             #If not header, non-matching cells get recorded with their current value             if cx!=0 and Ap[prx][cx] != Bu[urx][ux]:                 output[prx].append (str(Ap[prx][cx] + '^' + str(Bu[urx][ux]))             #Unless it is row header or ID in column, matching cells gets 'ok'             elif cx!=0 and prx!=0 and urx !=0 and Ap[prx][cx] == Bu[urx][ux]:                 output[prx].append ('ok' +'^' + 'ok')             # Anything else gets recorded with their current value             else:                  output[prx].append (str(Ap[prx][cx] + '^' + str(Bu[urx][ux])) 

There must a way to reduce processing time drastically. Currently it is taking cell by cell comparison of 50k row by 100 column data to 50k row by 100 column data about 2 hrs. Expected under 30 min. 3.1 Ghz, 4 cpu (8196MB RAM).

## For a collection $S$ of weighted sets $S_i$, find those $k$ elements that maximise the sum of weights of all sets $S_i$ covered by them

I have a collection $$S$$ of sets $$S_i$$. Each $$S_i$$ has a weight given by how many times this set was observed in some data. I now want to find the $$k$$ elements that maximize the cumulative weight of all sets that can be covered by those elements (that is, those sets that contain only elements from those $$k$$ selected).

As an example, let $$S$$ consist of the following sets and corresponding weights: $$\{1\} = 20 \ \{2\} = 10 \ \{3\} = 5 \ \{1,2\} = 10 \ \{2,3\} = 40 \ \{1,3\} = 5 \ \{1,2,3\} = 5\$$

In this case, I want my solution for $$k = 2$$ to be $$\{2,3\}$$, as $$\{1,2\}$$ has a cumulative weight of $$20+10+10=40$$, $$\{1,3\}$$ has a cumulative weight of $$20+5+5=30$$ and $$\{2,3\}$$ has a cumulative weight of $$10+5+40=55$$.

I have the feeling that my problem resembles a maximum coverage problem, but with a limit on the elements, not the sets, and with the sets having weights instead of the elements.

## “How am I supposed to change the fore color of the elements of a particular column in a crosstab of a japer report in jaspersoft studio?”

I am trying to make crosstable in which I want to change the fore color of elements in a prticular column.How am I supposed to do it?

I am working on jaspersoft studio v6.8. I am using a database that i have created myself

          <bucketExpression><![CDATA[$F{Status}]]></bucketExpression> </bucket> <crosstabColumnHeader> <cellContents mode="Opaque" style="Crosstab_CH"> <textField> <reportElement x="0" y="0" width="110" height="30" forecolor="#000000" uuid="84d31711-373c-473e-b8a7-381998d96d7d"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="14"/> </textElement> <textFieldExpression><! [CDATA[$  V{Status}.replace("Closed-Delayed","Delayed").replace("Closed-Timely","Timely").replace("Overdue","Overdue")]]></textFieldExpression>                         </textField>                     </cellContents>                 </crosstabColumnHeader>                 <crosstabTotalColumnHeader>                     <cellContents mode="Opaque" style="Crosstab_CT">                         <staticText>                             <reportElement x="0" y="0" width="90"    height="30" forecolor="#FFFFFF" uuid="d795c6ed-d5d1-41a7-b5a8-3caccacfebec"/>                             <textElement textAlignment="Center"       verticalAlignment="Middle">                                 <font size="14"/>                             </textElement>                             <text><![CDATA[Total Status]]></text>                         </staticText>                     </cellContents>                 </crosstabTotalColumnHeader>             </columnGroup> 

I want that the column which has status overdue should print its elements with red fore color,but its always black.