How to find the size of gaps between entries in an array so that the first and last element of the array is filled and the gaps are all of equal size?

I have an array a of n entries. I need to place a token on the first and last position of that array, so a[0] = 1 and a[n-1] = 1.

I now want to place additional tokens into that array with a distance inbetween each index i where a[i] = 1 that is greater than 2 (so placing a token on every index is invalid as well as alternating using and not using an entry is invalid). Phrazed differently: I want that sum(a) < n/2 . The gap inbetween each token should be the same, so say with an array of size 16,

a[0] = 1, a[3] = 1, a[6] = 1, a[9] = 1, a[12] = 1, a[15] = 1

would be a solution with a gap size of 2 (distance of 3).

How do I find all gap sizes that are possible to fill said array with the given constraints?

Imagine a street inbetween two crossroads where a lamppost should be placed on each crossroad and then additional lampposts should be placed equidistant to each other and for some reason only natural number distances are allowed.

(The actual problem I want to solve is where to place Sea Lanterns in my Minecraft Project so do not disregard this problem as an assignment question I want a solution for.)

How to protect my code from “insider” threats when hiring my first employee?

I quit my job to start my own SaaS product. I’m now looking to hire my first employee (another developer).

I will be taking appropriate legal precautions to protect my IP, but I’m wondering what other reasonable actions that I can take to further protect my code / data. The last thing that I want happen is what happened to Tesla where someone dumped the source code onto iCloud and ran off with it to a competitor.

I know that it is practically impossible to prevent this 100% from happening and that I need to make sure that I hire quality people and offer meaningful pay and have the appropriate legal documents signed. Apart from this, what else can I do to protect myself from inside threats? I am pouring in my entire life’s savings into this and I will be devastated to lose what I spent the better part of 2 years coding.

Here’s what I’ve thought of so far:

  • Buy a work laptop for them
  • Encrypt the hard drive (like with Bitlocker)
  • Disable all USB ports
  • Create a non-admin / limited user account with no install permissions and just the IDEs (e.g. Visual Studio) installed. I use Windows 10 for most development with the exception of a Mac for the iOS portion of the app development.
  • Install some kind of employee logging software.
  • Disable access to file hosting websites.
  • Somehow detect and stop when a certain folder is being uploaded or copied somewhere?
  • Somehow make the git repository only accessible from that machine.
  • Install some kind of remote admin management system? Azure Active Directory or something?

This must be a common problem for businesses but I must be searching for the wrong thing because I can’t seem to find a guide anywhere on this issue.

Head First Java, 2nd Edition 2nd Edition

View attachment 253039
Get the book here
Learning a complex new language is no easy task especially when it s an object-oriented computer programming language like Java. You might think the problem is your brain. It seems to have a mind of its own, a mind that doesn't always want to take in the dry, technical stuff you're forced to study.

The fact is your brain craves novelty. It's constantly searching, scanning, waiting for something unusual to happen. After all,…​

Head First Java, 2nd Edition 2nd Edition

User defined function for creating Row only listing first column of matrix or first element of a vector

I cannot figure out why my rowNameValue[] is only listing the first part of a column or vector. Below is the code.

objectName = Function[Null, SymbolName[Unevaluated[#]], {HoldFirst}]; ClearAll[m, b] m = {{1, 0, -5}, {0, 1, 1}, {0, 0, 0}}; MatrixQ[m] b = {1, 4, 0}; VectorQ[b] rowNameValue[symbol_, name_ : Null] := Block[{id, fn},    id = If[Head[name] === String, name, objectName[symbol],       objectName[symbol]];    id = If[MatrixQ[symbol] || VectorQ[symbol], Style[id, Bold], id,       id];    fn = If[MatrixQ[symbol] || VectorQ[symbol], MatrixForm,       TraditionalForm, StandardForm];    {Row[{id, " \[Rule] "}, " "], Apply[fn, symbol]}    ]; dataIn[m_, b_] = Block[{}, Grid[{     rowNameValue[m, "m"],     rowNameValue[b, "b"]     }]] dataIn[m, b] 

Is it possible to bring undead back to life directly, without destroying them first?

In previous editions of D&D, you couldn’t bring undead back to life. You had to “re-kill” them and then resurrect their corpse. In 5e, Resurrection states that it can’t bring undead back, but Revivify, Raise Dead, and True Resurrection do not.

Does this mean you can bring undead back to life directly as long as you use a (lowercase) resurrection spell that isn’t (uppercase) Resurrection?

NFA that ends with 0 and doesn’t have 11 after the first 0

So as the title says i m trying to find this NFA. So far i thought to make an NFA that “guesses” what comes after the first 0 and i got this: enter image description here

After some time trying to get rid of all the extra (7 !) states i put in i got to this beauty: enter image description here

But now i cant figure out how to get rid of the one extra state. Also if you have any tips on how to go to simpler NFA’s instead of what i did (like a thought process for this problem) i would appreciate it a lot. Thank you

Revolution Slider – Hide a layer forever at the end of first loop

Is it possible to hide a layer once and forever in Revolution Slider? I’d like to show a logo only at the beginning of the slider (when you first load that page) and then hide it once and forever, keeping the rest of the slider go in loop as usual… I can’t find a “Play Once” option for layer animations anywhere…

If a spell caster loses concentration on greater invisibility, and an opponent has readied a reaction, what happens first?

As an example, both the spellcaster and the opponent (“the archer”) have 1 hp remaining, so whoever completes there action first will knock the opponent unconscious. The spellcaster casts Create Bonfire, On the archer’s space. However, The archer has readied an arrow targeting the spellcaster for “as soon as the spellcaster is visible.”

My question is, who’s action will go off first?

The relevant information on concentration can be found in the PHB (p.203):

You lose concentration when you cast another spell that requires concentration. You can’t concentrate on two spells at once.

and XGtE (p.5):

As soon as you start casting a spell or using a special ability that requires concentration, your concentration on another effect ends instantly.

Readied actions can be seen in the PHB (p.193):

When the trigger occurs, you can either take your reaction right after the trigger finishes or ignore the trigger. Remember that you can take only one reaction per round.

From this, it seems unclear who will complete there action first. What counts as the archer’s trigger finishing? does it finish when the spellcaster finishes casting their spell, as this action is what began the trigger? Or does the archer get to fire their arrow as soon as the spellcaster is visible, as they “finish” being invisible as soon as they begin casting the second spell?

Is this an LL(1) grammar? How to solve First – Follow conflict?

im trying to check if this grammar is LL(1).

S -> L = R
L -> * L | id
R -> L | R + R | num

As you can see there is a Left recursion on R production. So i remove that and what i get is:

S -> L = R
L -> * L | id
R -> L R’ | num R’
R’ -> + R R’ | ε

Now the problem that i have is that First and Follow set of R’ rule have a common non-terminal (“+”) and also FIRST(R) and FOLLOW(R’) has a common non-terminal. So i wonder how to create the parsing table if there’s this conflict. My question is: is there a way to solve this problem or simply this isn’t an LL(1) grammar?


Computing FIRST and FOLLOW

Given the following grammar with terminals $ VT=\{[,],a,b,c,+,-\}:$

$ S \rightarrow [SX]|a$

$ X \rightarrow +SY|Yb|\epsilon$

$ Y \rightarrow -SXc|\epsilon$

This should be the FIRST function:

$ first(S) = \{[,a\}$

$ first(X) = \{\epsilon,+,-,b\}$

$ first(Y) = \{\epsilon,-\}$

What would the FOLLOW function be?