How do you compare items in Diablo 2?

Question: How do you compare items in your inventory to what you have equipped?
Answer: You will have to compare the items manually. This feature does not exist in any automated form in Diablo II.
To find the ranges of stats on items, you will need to use a source outside of the game such as The Arreat Summit.
In Diablo III however, it is possible to compare items in an automated fashion.

If you are using the popular third party Slash Diablo servers and modified client, they offer and allow their own Maphack which shows stat ranges.
Comment: Unfortunately not. You'll have to mouseover one item, and then the other. And so on. Keep in mind that Diablo II was released in 2000, long before such convenience features were common.
Comment: @Nicole Do bear in mind that you can still screenshot the game with the tooltip for one of the items showing - paste it into Paint or whichever program you prefer. If you have two screens, slap it on the other one and you can at least see both tooltips at the same time. Otherwise you might have to screenshot the second tooltip as well and combine it with the first screenshot. It's inconvenient, but if you really feel you need to do it, that's one way of going about it. Also, if your screenshots come out completely black, put the game into windowed mode and try again.
Comment: Is there a way to see the 2 items side by side?
Answer: One way to quickly see how item A and item B affect your basic total stats is to equip them back and forth while the character stats screen is open. You'll see how your total damage, dexterity, strength, vitality, stamina and resistances change depending on which item is equipped.
Comment: This would work so much better if the character screen didn't frequently lie to you. Unfortunately, it does; there are all kinds of things it doesn't take into account, or just straight calculates incorrectly. Your name, level, and experience count are literally the only things on the screen that you can always rely on.
Comment: That's how you did it back then! Good call.
Comment: True dat, but at least it shows the approximate values. In any case, trial and error is how you usually find out if a new item works for you or not better than any stats can predict.
Comment: @KRyan This is also the case in Diablo III unfortunately
Comment: @user1306322 For some cases, it's not even a useful approximation; granted, those are the weird cases like Dragon Tail, Dragon Talon, Smite, and Whirlwind, but still. For those skills, the numbers have almost nothing to do with the damage you actually deal.
Comment: To anyone interested, there are all sorts of online stats calculators that will show you the actual values for any items that may display incorrect stats in-game.

How do you compare items in Diablo 2?


Practical uses for AtomicInteger

Question: I sort of understand that AtomicInteger and other Atomic variables allow concurrent accesses. In what cases is this class typically used though?
Answer: There are two main uses of AtomicInteger:

As an atomic counter (incrementAndGet(), etc) that can be used by many threads concurrently
As a primitive that supports compare-and-swap instruction (compareAndSet()) to implement non-blocking algorithms.
Here is an example of non-blocking random number generator from Brian Göetz's Java Concurrency In Practice:
public class AtomicPseudoRandom extends PseudoRandom {
    private AtomicInteger seed;
    AtomicPseudoRandom(int seed) {
        this.seed = new AtomicInteger(seed);
    }

    public int nextInt(int n) {
        while (true) {
            int s = seed.get();
            int nextSeed = calculateNext(s);
            if (seed.compareAndSet(s, nextSeed)) {
                int remainder = s % n;
                return remainder > 0 ? remainder : remainder + n;
            }
        }
    }
    ...
}

As you can see, it basically works almost the same way as incrementAndGet(), but performs arbitrary calculation (calculateNext()) instead of increment (and processes the result before return).
Comment: Your understanding of the first use is kind of true - it simply ensures that if another thread modifies the counter between the `read` and `write that value + 1` operations, this is detected rather than overwriting the old update (avoiding the "lost update" problem).  This is actually a special case of `compareAndSet` - if the old value was `2`, the class actually calls `compareAndSet(2, 3)` - so if another thread has modified the value in the meantime, the increment method effectively restarts from the beginning.
Comment: I think I understand the first use. This is to make sure the counter has been incremented before an attribute is accessed again. Correct? Could you give a short example for the second use?
Comment: "remainder > 0 ? remainder : remainder + n;" in this expression is there a reason to add remainder to n when it is 0?
Answer: The absolute simplest example I can think of is to make incrementing an atomic operation.
With standard ints:
private volatile int counter;

public int getNextUniqueIndex() {
    return counter++; // Not atomic, multiple threads could get the same result
}

With AtomicInteger:
private AtomicInteger counter;

public int getNextUniqueIndex() {
    return counter.getAndIncrement();
}

The latter is a very simple way to perform simple mutations effects (especially counting, or unique-indexing), without having to resort to synchronizing all access.
More complex synchronization-free logic can be employed by using compareAndSet() as a type of optimistic locking - get the current value, compute result based on this, set this result iff value is still the input used to do the calculation, else start again - but the counting examples are very useful, and I'll often use AtomicIntegers for counting and VM-wide unique generators if there's any hint of multiple threads being involved, because they're so easy to work with I'd almost consider it premature optimisation to use plain ints.
While you can almost always achieve the same synchronization guarantees with ints and appropriate synchronized declarations, the beauty of AtomicInteger is that the thread-safety is built into the actual object itself, rather than you needing to worry about the possible interleavings, and monitors held, of every method that happens to access the int value.  It's much harder to accidentally violate threadsafety when calling getAndIncrement() than when returning i++ and remembering (or not) to acquire the correct set of monitors beforehand.
Comment: From my perspective, it's mainly the encapsulation you get with AtomicIntegers - synchronization happens on exactly what you need, and you get descriptive methods that are in the public API to explain what the intended result is.  (Plus to some extent you're right, often one would end up simply synchronizing all methods in a class which is likely too coarse-grained, though with HotSpot performing lock optimisations and the rules against premature optimisation, I consider the readability to be a greater benefit than performance.)
Comment: Thanks for this clear explanation. What would be the advantages of using an AtomicInteger over a class where methods are all synchronized? Would the latter be considered as "heavier"?
Comment: This is very clear and precise explaination, Thanks !!
Comment: Finally an explanation that properly cleared it up for me.
Answer: If you look at the methods AtomicInteger has, you'll notice that they tend to correspond to common operations on ints.  For instance:
static AtomicInteger i;

// Later, in a thread
int current = i.incrementAndGet();

is the thread-safe version of this:
static int i;

// Later, in a thread
int current = ++i;

The methods map like this:
++i is i.incrementAndGet()
i++ is i.getAndIncrement()
--i is i.decrementAndGet()
i-- is i.getAndDecrement()
i = x is i.set(x)
x = i is x = i.get()
There are other convenience methods as well, like compareAndSet or addAndGet
Answer: The primary use of AtomicInteger is when you are in a multithreaded context and you need to perform thread safe operations on an integer without using synchronized. The assignation and retrieval on the primitive type int are already atomic but AtomicInteger comes with many operations which are not atomic on int.
The simplest are the getAndXXX or xXXAndGet. For instance getAndIncrement() is an atomic equivalent to i++ which is not atomic because it is actually a short cut for three operations: retrieval, addition and assignation. compareAndSet is very useful to implements semaphores, locks, latches, etc.
Using the AtomicInteger is faster and more readable than performing the same using synchronization.
A simple test:
public synchronized int incrementNotAtomic() {
    return notAtomic++;
}

public void performTestNotAtomic() {
    final long start = System.currentTimeMillis();
    for (int i = 0 ; i < NUM ; i++) {
        incrementNotAtomic();
    }
    System.out.println("Not atomic: "+(System.currentTimeMillis() - start));
}

public void performTestAtomic() {
    final long start = System.currentTimeMillis();
    for (int i = 0 ; i < NUM ; i++) {
        atomic.getAndIncrement();
    }
    System.out.println("Atomic: "+(System.currentTimeMillis() - start));
}

On my PC with Java 1.6 the atomic test runs in 3 seconds while the synchronized one runs in about 5.5 seconds. The problem here is that the operation to synchronize (notAtomic++) is really short. So the cost of the synchronization is really important compared to the operation.
Beside atomicity AtomicInteger can be use as a mutable version of Integer for instance in Maps as values.
Comment: @Andrzej sure, not as key which are required to be unmutable but a value.
Comment: I don't think I'd want to use `AtomicInteger` as a map key, because it uses the default `equals()` implementation, which is almost certainly not what you'd expect the semantics to be if used in a map.
Comment: The test are quite old now (more than 6 years) it might me interesting to retest with a recent JRE. I didn't went deep enough in the AtomicInteger to answer but as this is a very specific task it'll use synchronization techniques that are only working in this specific case. Also mind that the test is monothreaded and making a similar test in a heaviliy loaded environment might not give such a clear victory for AtomicInteger
Comment: @SupunWijerathne: This only tested the no-contention case where no other threads ever take the lock.  I wouldn't be surprised if that JVM version used an atomic RMW both to take the lock (for `synchronized`) and to release it.  Although in that case you'd expect exactly a factor of 2, assuming a typical x86 where `lock add [mem], 1` is the same latency as `xchg [mem], reg` or `lock cmpxchg [mem], reg`. (https://uops.info/).  Maybe just the extra store/reload of the non-atomic `++` between atomic RMWs and release-store to unlock were a factor.
Comment: @gabuzo Any idea why atomic integer performs well over synchronized?
Comment: I believe its 3 ms and 5.5 ms
Comment: I don't remember as it's has been done more that 7 years ago but as I put calls in the loop I guess I probably set NUM high enough to last a couple of seconds.
Comment: (Assuming of course that the atomic RMW JITed to a loop with no memory accesses except for `lock add [mem], 1`, or maybe `lock xadd [mem], eax` if the JIT doesn't take advantage of the return value being unused.)
Comment: If this had been a multi-threaded test: Threads have to contend for a lock, and then after getting ownership of the lock, actually access the `int` which is probably in a different cache line.  The store part of the `notAtomic++` increment has to commit to cache before it can unlock the lock.  So it wouldn't be surprising to nearly doubles the latency from getting exclusive ownership to releasing exclusive ownership.  Or worse, since some threads would ping-pong the cache line to themselves *without* getting lock ownership, delaying unlock.
Comment: In a real-world case where you have multiple threads all doing not much besides hammering on a shared counter, 1. your design sucks, a single thread with non-atomic variables would probably be faster, even if it did have to write-only store each incremented value to its L1d cache.  2. yes, AtomicInteger is probably faster since each hardware step succeeds at doing an increment.  (Except sometimes with LL/SC machines, unlike x86).
Answer: For example, I have a library that generates instances of some class. Each of these instances must have a unique integer ID, as these instances represent commands being sent to a server, and each command must have a unique ID. Since multiple threads are allowed to send commands concurrently, I use an AtomicInteger to generate those IDs. An alternative approach would be to use some sort of lock and a regular integer, but that's both slower and less elegant.
Comment: Thanks for sharing this practical example. This sounds like something I should use as I need to have unique id for each file I import into my program :)
Answer: In Java 8 atomic classes have been extended with two interesting functions:

int getAndUpdate(IntUnaryOperator updateFunction)
int updateAndGet(IntUnaryOperator updateFunction)

Both are using the updateFunction to perform update of the atomic value. The difference is that the first one returns old value and the second one return the new value. The updateFunction may be implemented to do more complex "compare and set" operations than the standard one. For example it can check that atomic counter doesn't go below zero, normally it would require synchronization, and here the code is lock-free:
    public class Counter {

      private final AtomicInteger number;

      public Counter(int number) {
        this.number = new AtomicInteger(number);
      }

      /** @return true if still can decrease */
      public boolean dec() {
        // updateAndGet(fn) executed atomically:
        return number.updateAndGet(n -> (n > 0) ? n - 1 : n) > 0;
      }
    }

The code is taken from Java Atomic Example.
Answer: Like gabuzo said, sometimes I use AtomicIntegers when I want to pass an int by reference.  It's a built-in class that has architecture-specific code, so it's easier and likely more optimized than any MutableInteger I could quickly code up.  That said, it feels like an abuse of the class.
Answer: I usually use AtomicInteger when I need to give Ids to objects that can be accesed or created from multiple threads, and i usually use it as an static attribute on the class that i access in the constructor of the objects.
Answer: You can implement non-blocking locks using compareAndSwap (CAS) on atomic integers or longs. The "Tl2" Software Transactional Memory paper describes this:

We associate a special versioned write-lock with every transacted
  memory location. In its simplest form, the versioned write-lock is a
  single word spinlock that uses a CAS operation to acquire the lock and
  a store to release it. Since one only needs a single bit to indicate
  that the lock is taken, we use the rest of the lock word to hold a
  version number.

What it is describing is first read the atomic integer. Split this up into an ignored lock-bit and the version number. Attempt to CAS write it as the lock-bit cleared with the current version number to the lock-bit set and the next version number. Loop until you succeed and your are the thread which owns the lock. Unlock by setting the current version number with the lock-bit cleared. The paper describes using the version numbers in the locks to coordinate that threads have a consistent set of reads when they write.
This article describes that processors have hardware support for compare and swap operations making the very efficient. It also claims:

non-blocking CAS-based counters using atomic variables have better
  performance than lock-based counters in low to moderate contention
Answer: The key is that they allow concurrent access and modification safely. They're commonly used as counters in a multithreaded environment - before their introduction this had to be a user written class that wrapped up the various methods in synchronized blocks.
Comment: I see. Is this in cases where an attribute or instance acts as a sort of global variable inside an application. Or are there other cases that you can think of?
Answer: I used AtomicInteger to solve the Dining Philosopher's problem.
In my solution, AtomicInteger instances were used to represent the forks, there are two needed per philosopher. Each Philosopher is identified as an integer, 1 through 5. When a fork is used by a philosopher, the AtomicInteger holds the value of the philosopher, 1 through 5, otherwise the fork is not being used so the value of the AtomicInteger is -1.
The AtomicInteger then allows to check if a fork is free, value==-1, and set it to the owner of the fork if free, in one atomic operation. See code below.
AtomicInteger fork0 = neededForks[0];//neededForks is an array that holds the forks needed per Philosopher
AtomicInteger fork1 = neededForks[1];
while(true){
    if (Hungry) {
        //if fork is free (==-1) then grab it by denoting who took it
        if (!fork0.compareAndSet(-1, p) || !fork1.compareAndSet(-1, p)) {
          //at least one fork was not succesfully grabbed, release both and try again later
            fork0.compareAndSet(p, -1);
            fork1.compareAndSet(p, -1);
            try {
                synchronized (lock) {//sleep and get notified later when a philosopher puts down one fork
                    lock.wait();//try again later, goes back up the loop
                }
            } catch (InterruptedException e) {}

        } else {
            //sucessfully grabbed both forks
            transition(fork_l_free_and_fork_r_free);
        }
    }
}

Because the compareAndSet method does not block, it should increase throughput, more work done. As you may know, the Dining Philosophers problem is used when controlled accessed to resources is needed, i.e. forks, are needed, like a process needs resources to continue doing work.
Answer: Simple example for compareAndSet() function:
import java.util.concurrent.atomic.AtomicInteger;

public class GFG {
    public static void main(String args[])
    {

        // Initially value as 0
        AtomicInteger val = new AtomicInteger(0);

        // Prints the updated value
        System.out.println("Previous value: "
                           + val);

        // Checks if previous value was 0
        // and then updates it
        boolean res = val.compareAndSet(0, 6);

        // Checks if the value was updated.
        if (res)
            System.out.println("The value was"
                               + " updated and it is "
                           + val);
        else
            System.out.println("The value was "
                               + "not updated");
      }
  }

The printed is:
previous value: 0
The value was updated and it is 6
Another simple example:
    import java.util.concurrent.atomic.AtomicInteger;

public class GFG {
    public static void main(String args[])
    {

        // Initially value as 0
        AtomicInteger val
            = new AtomicInteger(0);

        // Prints the updated value
        System.out.println("Previous value: "
                           + val);

         // Checks if previous value was 0
        // and then updates it
        boolean res = val.compareAndSet(10, 6);

          // Checks if the value was updated.
          if (res)
            System.out.println("The value was"
                               + " updated and it is "
                               + val);
        else
            System.out.println("The value was "
                               + "not updated");
    }
}

The printed is:
Previous value: 0
The value was not updated
Answer: Atomic classes are not general purpose replacements for java.lang.Integer and related classes. They do not define methods such as equals, hashCode and compareTo. (Because atomic variables are expected to be mutated, they are poor choices for hash table keys.) Additionally, classes are provided only for those types that are commonly useful in intended applications. For example, there is no atomic class for representing byte. In those infrequent cases where you would like to do so, you can use an AtomicInteger to hold byte values, and cast appropriately. You can also hold floats using Float.floatToRawIntBits(float) and Float.intBitsToFloat(int) conversions, and doubles using Double.doubleToRawLongBits(double) and Double.longBitsToDouble(long) conversions.
Reference: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html

Practical uses for AtomicInteger


How to apply the boundary condition when global stiffness matrix is stored in csr format?

Question: I am solving the poisson equation and I constructed the global stiffness matrix in compressed row storage format. Then I wrote the preconditioned conjugate gradient solver for solving the system of equations. Now my problem is how I can apply the boundary condition when I have the global stiffness matrix in csr format. I can assemble the global stiffness matrix as a sparse matrix and then easily apply the boundary condition by removing some column and row but it's not an efficient way. I would be grateful if you help me with detail.
Comment: No,it doesn't, I stored the global stiffness matrix in csr format,it means I build three row vectors. The first row vector store the non_zero element, second one stores the column index of non_zero element and the last one is a pointer to the first non_zero element in each row. I can remove the column an row in the big sparse matrix and apply the boundary condition. But it's not just about solving the poisson equation,it's about memory optimization and solving the system of linear equations parallelized with mpi. So I need to apply the boundary condition in csr format.
Answer: The process is not entirely trivial, but you might be interested in watching video lectures 21.6 and 21.65 here:
https://www.math.colostate.edu/~bangerth/videos.html
Comment: Thanks, I watched these lectures before but they don't answer my questions. By the way thanks for your help.
Comment: @Resa Then I don't know what your question is. That may also be because your question does not, in fact, have a question (or question mark).
Answer: I do something similar for a structural mechanics problem but I don't remove any rows or columns. I use the penalty method by modifying the diagonal term of the degree of freedom where I want to impose some BC (Dirichlet).
I don't know exactly how you're assembling your global sparse stiffness matrix but I keep a track of where in the global stiffness matrix are the entries belonging of the ith degree of freedom. So basically a lookup table of where the diagonal entry of the ith dof falls and I can modifying exactly that value without disturbing the rest of the matrix. Hope that helps.
Comment: Thanks for your reply, are using csr format for storing non-zero element?
Comment: Yes, storing in CSR format and solving using Intel MKL direct sparse solver to solve. I modify only the non-zero values vector, not the column_index and row_ptr vectors.
Comment: I assembled the global stiffness matrix such a way that I don't construct the big sparse matrix. So the only thing I have is the non-zero element as a row vector, col_index of each non-zero element and the row_ptr vector as a pointer to the first non-zero element. And I'm using preconditioned conjugate gradient method. I can use some software to apply boundary conditions but I need to know what is going on internally. Do you have any source about this?
Comment: Yes I know what you're saying. I'm do the same thing, I never construct the full matrix but only the CSR representation. But with information about how many non-zeros you have for each degree of freedom, you can locate where you're diagonal entries are within the CSR representation. For example if you know the each degree of freedom has 10 entries, you know that the the diagonal entry for the 10th element will be at the 100th position. Highly simplified but hope you get the point I'm trying to make.  Check this: https://link.springer.com/article/10.1007/s42102-020-00041-y
Comment: It not trivial, but can be done depending on how much time you can invest in it
Answer: It's not that hard and there is a fortran code example that illustrates that. It is from John Burkardt collection of code examples. Also C and C++ version is available with a simple search within same collection.
This is coordinate format, or as he calls it sparse triplet. With a simple modification to store pointers to elements starting the row in ia instead of row numbers you get CSR version.
The procedure is to store position of diagonal elements in the array of sparse matrix elements, of size nnz. You access it and set it to one if it corresponds to node/DOF at Dirichlet boundary, while the corresponding element in the right-hand side vector gets value of the Dirichlet BC.
subroutine dirichlet_apply_dsp ( node_num, node_xy, node_condition, &
  nz_num, ia, ja, a, f )

!*****************************************************************************80
!
!! DIRICHLET_APPLY_DSP accounts for Dirichlet boundary conditions.
!
!  Discussion:
!
!    It is assumed that the matrix A and right hand side F have already been
!    set up as though there were no boundary conditions.  This routine
!    then modifies A and F, essentially replacing the finite element equation
!    at a boundary node NODE by a trivial equation of the form
!
!      A(NODE,NODE) * U(NODE) = NODE_BC(NODE)
!
!    where A(NODE,NODE) = 1.
!
!    This routine assumes that the coefficient matrix is stored in a
!    sparse triplet format.
!
!    This routine implicitly assumes that the sparse matrix has a storage
!    location for every diagonal element...or at least for those diagonal
!    elements corresponding to boundary nodes.
!
!  Licensing:
!
!    This code is distributed under the GNU LGPL license.
!
!  Modified:
!
!    12 July 2007
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, integer ( kind = 4 ) NODE_NUM, the number of nodes.
!
!    Input, real ( kind = 8 ) NODE_XY(2,NODE_NUM), the coordinates of nodes.
!
!    Input, integer ( kind = 4 ) NODE_CONDITION(NODE_NUM), reports the
!    condition used to set the unknown associated with the node.
!    0, unknown.
!    1, finite element equation.
!    2, Dirichlet condition;
!    3, Neumann condition.
!
!    Input, integer ( kind = 4 ) NZ_NUM, the number of nonzero entries.
!
!    Input, integer ( kind = 4 ) IA(NZ_NUM), JA(NZ_NUM), the row and column
!    indices of the nonzero entries.
!
!    Input/output, real ( kind = 8 ) A(NZ_NUM), the coefficient matrix,
!    stored in sparse triplet format; on output, the matrix has been adjusted
!    for Dirichlet boundary conditions.
!
!    Input/output, real ( kind = 8 ) F(NODE_NUM), the right hand side.
!    On output, the right hand side has been adjusted for Dirichlet
!    boundary conditions.
!
  implicit none

  integer ( kind = 4 ) node_num
  integer ( kind = 4 ) nz_num

  real ( kind = 8 ), dimension(nz_num) :: a
  integer ( kind = 4 ) column
  integer ( kind = 4 ), parameter :: DIRICHLET = 2
  real ( kind = 8 ), dimension(node_num) :: f
  integer ( kind = 4 ) ia(nz_num)
  integer ( kind = 4 ) ja(nz_num)
  integer ( kind = 4 ) node
  real ( kind = 8 ), dimension ( node_num ) :: node_bc
  integer ( kind = 4 ) node_condition(node_num)
  real ( kind = 8 ), dimension(2,node_num) :: node_xy
  integer ( kind = 4 ) nz
!
!  Retrieve the Dirichlet boundary condition value at every node.
!
  call dirichlet_condition ( node_num, node_xy, node_bc ) ! SUPPLY THIS FUNCTION
!
!  Consider every matrix entry, NZ.
!
!  If the row I corresponds to a boundary node, then
!  zero out all off diagonal matrix entries, set the diagonal to 1,
!  and the right hand side to the Dirichlet boundary condition value.
!
  do nz = 1, nz_num

    node = ia(nz)

    if ( node_condition(node) == DIRICHLET ) then

      column = ja(nz)

      if ( column == node ) then
        a(nz) = 1.0D+00
        f(node) = 0.0D0 ! node_bc(node) FIXME
      else
        a(nz) = 0.0D+00
      end if

    end if

  end do

  return
end
```

Comment: That's basic linear algebra, that row will multiply solution vector so in that case...
Comment: Thanks for your answer but I don't understand why we need to put one instead of diagonal an zero out of diagonal elements


Tubing for explosive gas or hydrogen transfer

Question: Recently, I heard that there is a law/ OSHA/ ASME piece of regulation dictating that hydrogen should be transferred (suppose from a tank of hydrogen to another location) by using specially approved tubing. Is this true?
Answer: I would say that it is true and for that case there will be many relevant codes / regulations that need to be respected. Make sure you read them all before designing / altering the system.
Comment: Although this doesn't include any supporting information, I have to agree that it is more likely than not the case, just based off the situation.  Often hydrogen is stored in some sort of pressurized container.  Already you need to make sure that the pressure can be safely contained and discharged.  The bigger point is the flammability of hydrogen.  If hydrogen meets with enough oxygen it will combust, and any ignition sources would be extremely dangerous.  [Some info](https://en.wikipedia.org/wiki/Hydrogen_safety).  You likely need approved tubing and connections and precautions in the area.
Comment: Could anyone direct me to a source in the literature on the matter? I was able to find this: Safety Alert – Improper Tubing for Flammable Gases from Arizona State University       I guess that if that is how they say it should be handled, it kind of answers the question in its own right.
Answer: This is a complex topic, if you are responsible for designing/altering such a system, I would say you should consult an expert in hydrogen transport. You will need input on the appropriate materials for the pipe (e.g. MOC of pipe for hydrogen embrittlement) and the types of joints required at the minimum.
Starting reading regarding the MECHANICAL design of hydrogen piping (note the scope) -
NFPA 50A: Standard for Gaseous Hydrogen Systems at Consumer Sites, 1999 Edition
On the PROCESS design for hydrogen usage, it would be the same as any other gas transport application, using the appropriate materials and developing the proper process parameters.
Answer: Assuming the question pertains to smaller quantities as may be used in a laboratory or specialized heat-treating : H can easily be handled with ordinary materials = carbon steel, copper and stainless steel. A major concern with H is that if there is any leakage it will rise and collect at the top of any enclosure. So design needs to include things like  explosion proof/ gas tight light fixtures.
Comment: I know that there are many materials that can be used to transport hydrogen gas, but I was asking with regard to existing regulations about what material a tube must be made of to transport the hydrogen legally.
Answer: Well, I have used regular acrylic tubing for the gaseous state. However, if any spark contact may occur, use spark resistors, a bubbler, ect. If it is in liquid state I would assume that more would be required. My project this year used hydrogen as a fuel source produced through electrolysis that was run through solar energy. My hydrogen output was in a gaseous state for efficiency.


Number of items in a menu

Question: I can't find if WordPress stores the number of items in a menu. Basically I need to find out how many items are in a menu to work out the percentage each item should take up in the header bar. Is there a function? Or is the best way to achieve this doing something with WP_Query?
Answer: I was curious and decided to check it out, regardless if it's relevant for a CSS problem ;-)
I first peeked into the database tables to find more about the menu structure:
Menu - building blocks
Each navigational menu is registered as a term in the nav_menu taxonomy.
Then when we add items to that menu, we are creating new post objects of the type nav_menu_item.
Now the tricky part, where's the tree structure for that menu stored?
It's not the stored in the post_parent field of the nav_menu_item posts, as expected.
We actually find it in the post meta table where it's stored under the _menu_item_menu_item_parent meta key, for each nav_menu_item post.
Now there are various ways to get the count. Here are few examples:
Example - get_term_by() / wp_get_nav_menu_object()
First the easy one: If we need to get the number of items in a particular menu we can actually get it from a term query, because it's stored in the count column of the wp_term_taxonomy table.
First we get the menu term with:
$menuterm = get_term_by( 'slug', 'some-menu-slug', 'nav_menu' );

There's exists a wrapper for this, namely:
$menuterm = wp_get_nav_menu_object( 'some-menu-slug' );

To get the total count of items in the menu, we can then use:
$total_count = ( $menuterm instanceof \WP_Term ) ? $menuterm->count : 0;

Example - WP_Query() / get_posts()
If we only want to count menu items without parents, then we can collect all the post objects within our menu with:
if( $menuterm instanceof \WP_Term )
   $pids = get_objects_in_term( $menuterm->term_id, 'nav_menu' );

where $pids is an array of post IDs.
Then we can make the following meta query:
$args = [
    'post__in'            => $pids,
    'post_type'           => 'nav_menu_item',
    'fields'              => 'ids',
    'ignore_sticky_posts' => true,
    'nopaging'            => true,
    'meta_query'          => [
        [
            'key'       => '_menu_item_menu_item_parent',
            'value'     => 0,
            'compare'   => '=',
        ]
    ]
];

$count = count( get_posts( $args ) );

There's also a way with:
$q = new WP_Query();
$count = count( $q->query( $args ) );

or just:
$count = $q->found_posts;

with the common trick, posts_per_page as 1, to reduce fetched data.
Example - wp_get_nav_menu_items()
There exists handy wrappers in core, like wp_get_nav_menu_items( $menu, $args ) where $args are get_posts() arguments.
Here's one way:
$count = count(
    wp_list_filter(
        wp_get_nav_menu_items( 'some-menu-slug' ),
       [ 'menu_item_parent' => 0 ]
    )
);

We can also use:
$args = [
    'meta_query'    => [
        [
            'key'       => '_menu_item_menu_item_parent',
            'value'     => 0,
            'compare'   => '=',
        ]
    ]
];

$count = count( wp_get_nav_menu_items( 'some-menu-slug', $args ) );

Example - filter/hooks
There are many filters/actions that we could hook into to do the counting, e.g. the wp_get_nav_menu_items filter. Even hooks within the nav menu walker.
We could even hook into the wp_update_nav_menu that fires when the menu is updated. Then we could count the items with no parents and store it e.g. as term meta data.
Then there are also various ways with javascript.
Hopefully this will give you some ideas to take this further.
Comment: Thanks, Marked this as the most useful answer because you gave me a lot to go on and work from there. Posted the solution I came up with to solve the problem below in case you want to check it out.
Comment: You're welcome, good to hear it helped you work out a solution that suited you best @LewisSelf
Answer: Thanks for the help birgire. That gave me a lot to think about. Eventually I have came up with a solution using a filter I can count the number of parents the menu has. The only problem with this approach is that it will run every time a menu is displayed.
function my_nav_menu_objects($sorted_menu_items, $args)
{
  if($args->menu == 'header_menu')
  {
    $counter = 0;

    foreach($sorted_menu_items as $sorted_menu_item)
    {
      if($sorted_menu_item->menu_item_parent == 0)
      {
        $counter++;
      }
    }

    echo 'Menu Count: ' . $counter;
  }

  return $sorted_menu_items;
}
add_filter('wp_nav_menu_objects', 'my_nav_menu_objects', 10, 2);

Change the "header_menu" to what ever the slug of your navigation you want to check is. You could then store this into an option and call it when needed.

Number of items in a menu


Illustrator align to object without moving one of them

Question: This is super frustrating feature that I can't overcome. I often want to align one object to another, without moving the one I'm aligning to. I've tried selection, key object but it keeps moving both elements.
Answer: Once you've selected the objects you want to align, click on the object you want to align relative to again. You'll notice that object gets a thicker outline—it is now the "Key Object". You'll notice the "Align to" button in the Align panel also changed to a key icon.
You can also just change the "Align To" in the Align panel to "Align to Key Object" and it will automatically set the top object to be the key, although you can click another object in the selection to change.
As long as you see that key icon, whichever object is the key object will not move.

You can read more here: Illustrator Help — Align or distribute relative to a key object
Comment: Is there anyway to make it so Illustrator ALWAYS thinks the first selected object is the "Key Object", regardless of top/bottom order of objects in the layer(s)?
Comment: From the docs: "you don't need to hold down Shift as you click this time"
Comment: Just found out that with Shift a multiple selection is made and with CTRL+Click the Key Object is selected within the already selected set of objects (with "Align to Key" option set in the alignment toolbox).
Answer:
Select two objects
From Align panel choose
Further reading How to align all objects in the center of the artboard using Illustrator?


How do aircraft instruments determine the aircraft's orientation relative to the ground?

Question: Autopilots exist for airplanes and drones, how is orientation measured with respect to ground? In particular how is the direction of gravity detected and how is it differentiated from acceleration due to thrust?
Comment: This strongly depends on the kind of aircraft you have in mind. Large airliner or small GA aircraft? Analog instruments or digital displays?
Comment: Small, maybe even RC sized
Comment: Related: [How can aircraft determine true north for inertial navigation systems?](https://aviation.stackexchange.com/q/25654/3201). In the answer you'll find how gravity is sensed too.
Answer: In analog-instrumented planes, orientation with respect to ground is established by a feature inside the attitude gyro called the erection system which senses the long-term average of the direction of gravity. It then slowly urges the gyro to establish and hold the correct position of the horizon while still indicating short-term excursions from level flight in pitch and roll.
In vacuum-driven gyros, the erection system consists of small air leaks in the rotor support gimbal which are opened or closed by small vanes that are hung so they swing freely under the influence of gravity. When they are open, they apply a tiny thrust to the gimbal which gently precesses or "drifts" the gyro into its erect position in which the horizon line is perfectly perpendicular to the direction of "down" as sensed by the vanes.
The time constant for the erection process is of order ~minutes- that is, it furnishes a multi-minute-long average of the downward direction.
Comment: So it basically takes a long term average. Do digital ones exist? Can this be done with a kalman filter?
Comment: Digital ones exist but I do not know how their sensor networks function, I do not know what a kalman filter is. -NN
Comment: A Kalman filter outputs a best guess by repeatedly using new measurements for corrections of that best guess. Large deviations of the newly measured value aren't fully trusted but only applied partially. They are used to correct for noise in the measurement. If you interpret banking effects as noise, then yes, a Kalman filter works similarly. But there are better ways for attitude measurement.
Comment: How do you do it then? Banking effects could be integrated right?
Comment: @FourierFlux, yes, this is routinely done with a Kalman Filter. See my answer for a brief explanation and a lot of links. Your instinct is right that, in an airplane, the centrifugal forces arising from banking can be used to refine the understanding of an airplane's attitude.
Comment: In the case of the mechanical attitude indicator, a key point in understanding how the drift correction works is that in the reference frame of the gyro platform-- as opposed to the reference frame of the aircraft-- the direction of the g-load compont created by turning is not constant, but goes round and round.  That's why circling in the same direction for hours on end wouldn't "confuse" the instrument.
Answer: From standard sensors, we can completely determine attitude
Attitude estimation is a mathematically rich domain. If we have sufficiently precise measurements across sufficient degrees of freedom we can completely, and uniquely, solve for the attitude. However, the way any particular application goes about solving it is highly dependent on the goals (autonomous navigation or just keeping the wings level and the nose pointed in the right direction?), so it's no surprise that there are a multitude of solutions, one written by yours truly.
Formal definitions

SO(3)  means roll-pitch-yaw
T(3) means x-y-z, i.e. latitude, longitude, and altitude
SE(3) means the combination of roll-pitch-yaw and x-y-z

Solving for SE(3) means being able to measure/infer both T(3) and SO(3).
Position
T(3) is straightforward, as that easily comes from a GPS-style system, aka GNSS. (Although it could also come from some other ground-based reference system combined with an altimeter of some kind, so it's not restricted to GPS-style sensors.)
Attitude
SO(3) is more complex to get just right, since the reference is to the ground and yet there are no deployed ground-based systems to measure the plane's roll, pitch, and yaw. Therefore, we have to make do with sensors mounted on the moving inertial system, i.e. the aircraft.
Without getting too much into the details, in modern autopilots we typically measure the turning rate with gyrometers and integrate that to get an attitude reference. Because these attitude solutions inevitably drift, we correct roll-pitch with accelerometer measurements, and yaw can be corrected with a yaw measurement such as a magnetometer.
In airplanes, which typically fly in a coordinated manner, we can isolate gravitational acceleration by taking the measured acceleration and subtracting the predicted centripetal acceleration (which in constant-speed flight and at a given bank angle is identical for all airplanes).
Combining position and attitude
It's very helpful to use the aircraft's position to refine its attitude estimation. After all if we hvae a good understanding of the aircraft's flight dynamics-- e.g. airplanes can only fly forward, helicopters can fly any direction, and balloons don't have a well-defined forwards direction-- then we can draw good conclusions about how the aircraft must be oriented. So fusing all these measurements together is how we can come up with a very solid estimate of attitude.
Extensions
Recently, we are also seeing RTK-GNSS (with a precision of several cm) being used to fully characterize an airplane's SE(3) state. This is done by placing the receivers as far apart as possible and using the extended baseline to definitely locate the aircraft's extremities. If we know where the nose, tail, and wingtip are in T(3), then because we know the plane's shape we also know the plane's attitude and position.
The downside is that if the plane rolls over than the antennas no longer have a clear view of the sky, but this can be easily corrected for in the short term by using inertial measurements.
Definitely the sum is greater than the parts.
Appendix
If you are interested in more details, I can refer you to what we did at Tau Labs, a drone autopilot ecosystem which existed from roughly 2011 to 2017.

EKF: theory and code
Complementary filter: theory and code
Comment: That gets sticky. If I spell out GNSS, should I also spell out GPS? GPS is just the American implementation of a GNSS, but Galileo, GLONASS, and Beidou are also equally valid sources. Indeed, we use as many of those satellites as we can when getting a global localization fix. Hopefully we'll stop using GPS to generically refer to all these systems, as it's US-centric.
Comment: Note access to the [RTK correction network](https://rtkfix.com/) is not free. In Europe it is sold about 1000 €/year.
Comment: Please tell us the words accompanying some of the initials you used (eg GNSS, RTK).
Comment: Interesting point, but I would suspect that most readers know what GPS means but not the other things.  But feel free to spell out what GPS means as well!    Of course there is always google and wikipedia, but...
Comment: I added links to wikipedia pages, think that's okay?
Comment: I'd personally prefer to see them spelled out at least once, but thanks for adding the links.  Very informative answer.
Answer: One simple method is that orientation is detected, calibrated, and fixed in place prior to flight. The aircraft can be assumed to be on the ground at systems startup. Gyroscopic instruments are spun up and zeroed while the aircraft is on the ground.
Comment: Yes but there exists drift which will destroy absolute orientation.
Comment: Also without drift, the gyroscope maintain orientation relative to the universe, but as the aircraft flies, the Earth curves below it and the attitude indicator is supposed to follow it.
Answer: This is a surprisingly hard problem. Initially, the answer was: Just look out of the window. Of course, this became less helpful when flying in clouds. With unmanned aircraft it has become the hard problem I mentioned.
The usual recommendation for glider pilots who get sucked up into a cloud is: Let go of stick and rudder, open the speedbrakes and hope for the best.
Accelerometers will only give you the combined result of gravity and inertial loads, and only the magnitude of the signal can be used to separate obviously false readings from probably correct ones. Combine them with gyros, a barometer and clever software, and always be aware that both, sensor and software, will not be error-free.
What you do is to use a well-calibrated high quality gyro and do some common sense checking: If the load factor is permanently above 1, don't use that attitude to reset the gyro. Instead, make sure there is enough flying time straight and level for a proper reset and your maneuvering does not take long enough for drift to build up to a significant level. You can even perform checks during flight with a small roll attitude change and then a check how the other parameters behave to establish what is level.
Answer: The modern solution is to use an Attitude and Horizon Reference System, or AHRS. The system includes both rotation rate sensors and linear accelerometers for all three axes.  In the short term, the rotation rate sensors are the key players, but GPS data and magnetometer (magnetic compass) data is used to help seperate acceleration due to turning or changing airspeed from acceleration due to gravity, to allow the system to use gravity to correct the system for "drift" from various sources and accurately keep track of which way is "up" over a long flight.  This system of correction and calibration means that it is not absolutely necessary to initialize the system on the ground with the aircraft level and stationary, though this step may help the system reach optimum performance more quickly.
Following the principles given in this related answer,  it is possible to create a similar system without utilizing GPS data and magnetometer data to help with drift correction, but such systems invariably require much more expensive (and larger and heavier) components to achieve the same level of accuracy.
Naturally, some military navigation and attitude reference systems are designed to still work in the event that the GPS network is eliminated.


Inclined Plane and Center of Mass

Question: Say there is a block sliding down an inclined plane that rests on a frictionless table. There is kinetic friction between the block and inclined plane. If the block slides downhill, then the kinetic friction acting on it points uphill. By Newton's third law, the inclined plane will experience a friction force pointing down hill, in the direction of the block's velocity/acceleration. Shouldn't the plane want to move with the block, then? If it does, then wouldn't the center of mass move with the block and plane too? There's no friction on the block–plane system, however, so the center of mass should not move, but my analysis claims that it does. Where have I gone wrong?
Answer: You are forgetting the normal force between the block and the wedge (inclined plane). This force has a horizontal component, pushing the wedge to the left as the block slides down to the right.

The 2 forces acting on the wedge due to the block are the normal reaction $N$ and the friction force $F=\mu |N|$ (see diagram). Both have horizontal components : $N\sin\theta$ and $F\cos\theta$ respectively. The net horizontal force acting to the left on the wedge is $N\sin\theta-F\cos\theta=(\tan\theta -\mu)N\cos\theta$.
The condition for the block to start sliding down the incline is $\tan\theta \gt \mu$. So if the block slides to the right then the horizontal force on the wedge is always +ve to the left.

Note that in this situation the normal force is not $N=mg\cos\theta$. The wedge accelerates to the left away from the plane of contact with the block, so the normal force is reduced from this value.
Comment: Excellent answer, but I suggest that you remove the disclaimer and put mg cos$\theta$ back in there for N.   The force which drives acceleration isn't reduced by the acceleration.  In this case that force is (tan$\theta$-$\mu$)N cos$\theta$, so N doesn't change.  You may be confusing this with the change in the normal force exerted on a scale by a person in an elevator accelerating downward.  But in that case the acceleration of the scale isn't driven by the normal force exerted on it.
Comment: Thank you for the suggestion. However, I think this situation *is* like the accelerating elevator. There is a component of acceleration perpendicular to the plane of contact, so the normal reaction is affected.
Comment: I see it as more like me pushing my car, and the car pushing back.  As the car accelerates  it pushes back with an equal force.  I could put a bathroom scale between me and the car and read the force.  By contrast, in the elevator I push down on the stationary scale with my weight, but when it and the elevator accelerate away from me the scale reads less because my weight isn't causing the acceleration.
Answer: Treat the plane and the block as a system
When you will treat the block and the inclined plane as a system you find that the only forces which are acting on the system are in the vertical direction. therefore the center of mass of the system will accelerate ( if it does ) in a vertical line only. also the net force vector in this case will point downwards so the center of mass will accelerate downwards.
or to simplify the center of mass won't be accelerated in the horizontal direction.
The inclined plane does want to move with block
The friction which acts on the inclined plane definitely opposes the relative motion between them but what you forgot to count I think is the normal form the smooth friction-less table. The table may be smooth but it can still exert a normal force on any body that presses it.
Also as a representation of forces you may look at the diagram I have attatched
Comment: I can't understand this answer very well, the way you write is unclear.

Inclined Plane and Center of Mass


Modal vs Non-Modal

Question: I'm making an app that works on phones and tablets and allows the users to annotate an image. The user drags over an annotation mark and enters data related to the mark. The user may also draw on the image (Pencil, Arrow, Rectangle, Circle tools). The user would often times put more than one annotation mark per image, highest expected number or marks around 20 but there's no hard limit. The data they enter can be filled in immediately or later when they go back to that image, and usually consists of several (~ 5-10 ct) text fields and checkboxes.
The app will work both on tablet and phone, so the more closely related the two experiences are - the better.
The question here is what would you think is better - a modal pop-up (lightbox) or a slide-in from the side, pros and cons for each approach.
I would greatly appreciate adding quotes from studies or authoritative sources that line up with your answer.
Here's a scribble of what the window looks like:

Option (A): a modal popup with data fields shows when the user drags over an annotation mark:

Option (B): a list of data fields slides in from the side when an annotation mark is dropped:
Answer: Seeing where the marker is on the image while entering the info seems important.  Therefore, I would prefer option B.  On the phone, the image might need to be a much smaller portion of the screen, but I still think seeing the image would be useful.

Modal vs Non-Modal


Sharp bevel effect in Photoshop

Question: I am trying to create a bevel effect similar to the attached image. I have set the depth to 30%, size to 1px and soften to 0px, but the final effect has bevels which are not as crisp as those on the attached image - the bevels look very slightly blurred. Any advice on the necessary settings to recreate the bevels seen in this image please?
Answer: Set size to 0px on the Bevel to get it very crisp. But 1px schould do exactly what you see in the picture you posted. What I also see in your image is an inner glow (black) which might add to the desired effect you are looking for.
This is depth 100% and size 1px plus an inner glow of 5px and 25%:
Comment: Setting the size to 0 helped a lot - thank You! I tried your second suggestion b as well, but when I add the drop shadow and set its angle to -90, it also adjusts the angle of the inner shadow?
Comment: Deselect the box that says "Use Global Light" in the drop shadow preferences
Answer: Try setting your mode to "Chisel Hard". If that doesn't work, try working with the bevel profile (next selection down on the tree).
Comment: Setting the mode to Chisel had no visible effect unfortunately

Sharp bevel effect in Photoshop


Does a native speaker say "recharge oneself"?

Question: If I feel I'm lacking some kind of skills and I'm desperate to learn something, can I say "I need to recharge myself"?
Comment: Nowadays you might say something like "I need to level up," where "level up" is a joking reference to gaming. This phrase may not have a sense of desperation, but may be closer to the phrase you're looking for. The reply from alephzero is accurate in describing how"recharge" is typically used.
Answer: "Recharge myself" is a good phrase, but it has the wrong meaning.
"Recharge my batteries" is perhaps more common than "Recharge myself."
The Oxford dictionary gives "recharge" with no object, -i.e. "I need to recharge," not "I need to recharge myself", as well as "recharge my batteries."
However, the meaning is "I am mentally or physically exhausted and need to take some time out to recover," not "I am lacking some skills and need to learn them."
Comment: At least as I've seen/heard it used, it's almost always refers to mental exhaustion.  Physical would be "I need to rest".
Answer: Recharge myself is not a phrase I've ever encountered, but it's a nifty metaphor. However, I would take it to mean "do things to get myself more motivated and energetic":

I need to take a vacation to recharge myself.

When we speak of fundamental training or re-training to acquire new skills or roles the current catchphrase is re-invent myself:

I need to re-invent myself as a teacher.
Comment: I haven't heard that use of recharge used as a reflexive. I'd normally expect just "I need to take a vacation to recharge."
Comment: I don't think "reinvent myself" is quite what OP is looking for.  It generally implies a complete change in nature, or in occupation, or whatever.  It seems to me that OP is talking about learning some new skills to improve themselves in their current role.
Comment: Maybe, if the OP likes technical metaphors, "upgrade" would be fitting.
Answer: And if the skills you do have are not as relevant now as they once were, there is the phrase to retool, that is, to acquire a different set of skills than the ones you have now.

She knows all there is to know about Microsoft Windows but because the market is shifting away from desktop applications to mobile apps, she really needs to retool.

P.S. This manufacturing term has been "co-opted" for general use in AmE. It is used figuratively in a wide variety of  contexts from golf swings to school course offerings to football team rosters to the set of legal skills a law firm has to offer to software and tech skills, as in my example.
Comment: That, or "retrain"
Comment: That sounds like an entry for middle-manager-business-speak-bingo, like "take it offline" or "low hanging fruit".  "to retool" is not something you'd use outside of a business meeting - maybe as it sounds too much like "a tool" (as in an idiot, "what a tool"  / "he's such a tool").   `Retrain` or `Refresh my skills` would be more suitable in this scenario.
Comment: @freedomn-m  Please see the P.S.
Comment: Ok, must be AmE, in BrE it sounds offensive.
Comment: @freedomn-m Just give it a year or two, and you'll be hearing it everywhere too :) Your local coffee shop will be retooling its espresso blend and Man U will be retooling their attack.
Comment: Given the implication (and also slang) of "tool" in the UK, I still doubt it, but we'll see if ManU will all be getting penis replacements in the near future :)
Answer: It's a phrase not very likely to be said by a native speaker. It sounds like a direct translation of a non english analogy.
I need to rest, to have a rest, take a break, get my energy back, to chill out, are far mor common. Charge is from latin and is mostly the same in all latin languages, it vaguely means to load.
If you are lacking in skills and you need to learn something, you would say: I need to learn, to study, to do a crash course, to refresh my knowledge on.
Comment: *It sounds like a direct translation of a non english analogy* --- this is very spot-on; we use precisely that expression in Italian, for instance, so I can easily imagine an Italian speaker saying that.
Answer: As other answers have pointed out, "recharge myself" IS a phrase, but it means something else.
To say what you are asking for (in a way that sounds like the phrase you used), that you want to gain skills that you are lacking, you may want the phrase "refresh my skills" or that you "need a refresher." That implies that you already KNOW the skills, and you just need to relearn them, or expand on them.
To learn NEW skills, especially if you are "desperate" like you said, you could say that you need a "crash course." Which would be a quick way to learn skills, albeit more of an overview of them.
Answer: "I've got to recharge myself" = "I've got to go recharge myself" = "I've got to recharge" = "I've got to recharge my batteries"...
Meaning: Eat, sleep rest; as in rejuvenating oneself.
 Being desperate to learn something is quite different than that; though resting is part of the process of learning. "Recharging oneself", could be physical and/or mental.
 If you wanted to express "desperation" to learn; it's ok, but not the best. Many people equate "desperation" with weakness; though not so much when your expressing a desire to learn. A more positive way to express this may be to say,  "I am very interested in learning more about...".

Answer:
I'm desperate to learn something, can I say "I need to recharge myself"?

You charge a battery with what it's supposed to be charged with (chemical energy), not something new.   That's because the prefix re- means "again".
https://www.dictionary.com/browse/re-

a prefix, occurring originally in loanwords from Latin, used with the meaning "again" or "again and again" to indicate repetition, or with the meaning "back" or "backward" to indicate withdrawal or backward motion:

Thus, as mentioned in an earlier answer, you recharge yourself with something that you need again: enthusiasm, determination, love, etc.
@StoneyB's answer of using "reinvent" is correct in that when you learn something new to change the course of your life, you are "inventing (creating) yourself again" (since you invented your current self at a younger age).


What happens to spare rovers?

Question:
I found a picture on Wikipedia that seems suggest that NASA is keeping rovers from previous missions for testing and flight spares.
Do they have full set of science instruments or are they stripped down versions?
What happens to them after the mission is over? Are they being used for anything, either as a whole or in part (for example the science instruments)?
Comment: This depends on which "spares" you are talking about, though I imagine many of them are preserved after the mission is over. I highly doubt there is much re-use of parts from these.
Answer: These are not actually "spare" rovers.  They are either fully functional duplicates or media mockups.  In the case of the former, they are used by NASA's Jet Propulsion Laboratory for testing.  Sometimes when they run into troubles with a rover, or they just want to try making it do something new, they test it on one of these first.  For example, when Curiosity was having wheel troubles, they brought out their copy and drove it over sharp rocks so that they could better understand what was causing the damage.  JPL has a special area called the "Mars Yard" to do this testing in.  They also have stripped-down models to be used for more specific tests.
They do have spare parts for some of the instruments and other parts, and sometimes these are used for testing or just kept as mementos.  However, in some cases they are repurposed for use on other missions.  When they built Curiosity, they made some duplicate parts.  The spare heat shield, which was never used, will be used for the Mars 2020 rover.  Some of the Entry, Descent, and Landing (EDL) radar will also be reused.
Some of the copies are nonfunctional, or are just minimally functional.  These are used essentially as props, to take to schools and show kids, or to demonstrate to the media different parts of the machine.  They look as close as possible to the real thing, and can sometimes be driven around, but lack the science instruments.
Also, most notably, any of these copies will lack the RTG power source that Curiosity contains, and are powered via more traditional batteries.
After the mission is over, they are usually kept, just in case they might be useful for future missions.  NASA reuses a lot of designs for future missions, since they know these designs work.  Otherwise, they're just used as teaching and media aids.
Comment: The Sojourner in the picture is identified as "flight spare". I take that to mean that if the rocket blew up on launch, they would use the flight spare on the next launch.
Comment: I believe that, as far as Sojourner was concerned, that was an option. The MER and MSL rovers were larger, so creating spares in case of an accident was likely not an option.  Plus, when a rover leaves the cleanroom it was assembled in, it either does so to be used for testing or it is sealed in a sterilized container, to prevent any earth microbes from getting in.  So if it was used for testing at all, it could not have been re-sterilized.
Comment: @Phiteros I'm sure the testing versions are kept and displayed once the mission is over.
Answer: These are known as Engineering Test Units. They can differ from flight units in a number of ways:

They have to function in Earth's gravity, so they might be more sturdy than the launched items.
They might have lower cost parts. Many processors have a space grade vs commercial grade quality, which the difference in cost is quite large.
The quality control for these units is typically not as high. They likely wouldn't be built in a clean room, for instance, nor undergo as much testing. Conversely, they might have undergone extreme testing which would ensure the spacecraft could not be used for launch, as the launch artifacts are only qualified to undergo the event once.
They are quite useful on the ground. They are used to test Earth based samples to see how they compare to their Martian counterparts, to get out of difficult situations, and to test unusual command stacks. They are also used to test software on the ground.

Bottom line, they might be able to send them, but the ones on the ground are of lower quality. After a mission is over, they will likely end up as some kind of a museum piece, either internal to NASA, or even somewhere like the Smithsonian.
Comment: Are they equipped with science instruments?
Comment: It depends on what the purpose of the model is. But typically they won't be as extensive as the instruments on board. Cameras are pretty likely to be included, more complex ones less likely.

What happens to spare rovers?


How to delete files bypassing trash

Question: When I select the file and push delete this file is automatically landing in the trash. How can I delete files bypassing trash without using a mouse?
Comment: It is really easy to shut off in Raspbian - a simple preference. But in Ubuntu they have kept it this way for a LONG time. Nobody has ever explained why. In any case, 6 years after this question was asked, it is now July 2017 and in Ubuntu 16.04 LTS, this is the best you can do:   First, go to Appearances and set it so the menu will show up in the window title, then go to the File Manager and select Homes/  Press Alt-E then pick Preferences and there is an option there to turn on a Delete option under Move to Trash in the context menu of files or directories.
Answer: Select the files and leave SHIFT pressed while pressing the DELETE button or option.
Example: Select with CTRL several files while clicking on them.
Leave SHIFT pressed while pressing the DELETE button will delete them permanently.
To select multiple files. Click the first file and then leave SHIFT pressed while selecting the last file you want to select. It is the same thing as dragging the mouse while pressing the left mouse button.
Answer: In Nautilus -> Preferences select the following

to have the option to delete files rather than putting to trash in the right-click context menu.
Comment: If by "adapt my question" you mean the revision of the title, Takkat did not do that. Look at the revision history for details. In my opinion the revision did make the question more understandable (and more importantly, more Googleable). http://askubuntu.com/posts/18863/revisions
Comment: @alfalive: At the time of my answer I couldn't see anything related to "keyboard only" in your question. As this was already perfecty anwerded by CYREX I felt that a reference to standard Nautilus settings is badly missing. Unfortunately from your last  edit of your question my answer looks pretty off topic now.  Please consider that other people may also read this ;)
Comment: Hey Takkat you shouldn't adapt my question to fit your answer! I asked clearly. Delete file using keyboard.
Answer: Without using a mouse, you can delete (bypassing trash) straight from the command line, if you're comfortable doing that.

Open a terminal window.
Use the cd command to change directory to where the file is.
Use the ls command to list the files in the directory you've changed into, to make sure you're looking at the right place. (Use ls | less if the output is too long to read; then q will quit from reading the list and back to the terminal.)
Use the rm -v command to verbosely remove the file (deleting it, bypassing trash).
If you get errors: rm -Rfv is necessary to forcibly Recursively remove a directory. And rm -fv will force other deletions that are sticking against your will.

For example:
me@mypc:~$ cd /home/steven/Downloads/
me@mypc:/home/steven/Downloads$ ls
file1
file2
file3
.
.
.
me@mypc:/home/steven/Downloads$ rm -v file14
'removed 'file14'
me@mypc:

How to delete files bypassing trash


How can I re-add a friends posts to my newsfeed?

Question: A while ago I removed one of my friend's posts from my Facebook news feed. I'd like to add them back to the feed, but can't find any way of doing this. I suppose I could un-friend & re-friend them but that seems like overkill and is likely to wipe all of our wall-to-wall info.
Answer: Home => News Feed (Most Recent) => Scroll to the bottom of the page and click Edit Options => Under the Hide remove the blocked friend
Answer: Nowadays (2018), there are two options to stop seeing posts from someone, and they can be canceled from the same location: unfollow and snooze.
Remove friend's posts

Unfollow

Unfollow Bob
Stop seeing posts but stay friends

Snooze

Snooze Bob for 30 days
Temporarily stop seeing posts

Those can be chosen from the three dots menu  at the top left (or right, if using an RTL language) of each post:

Note that both actions can be undo immediately after applied, from the news feed, at the exact location it was done (assuming you stayed there).

Bring back this friend's posts

Open your friend's profile
On the cover photo, there are three buttons, the middle one is for following settings.

The default:

See first:

If you unfollowed and want to re-follow:

If you snoozed and want to end it:

Blocking
If you blocked a friend, which is something else (although you also won't see their posts), you can unblock them from the Blocking tab on Facebook settings
More details from Facebook Help pages

How do I follow or unfollow a profile or Page?
What does it mean to unfollow someone?
How do I snooze a person, Page or group?

A little while after you first unfollow someone, Facebook will show you this on your feed, to let you understand better what it means:

The learn more about unfollowing redirects to here
Answer: From your home page:

Hover over the News Feed bookmark in the left column
Click the  icon that appears to the left and select Edit Settings
Click X next to the name of the friend, Page, group, event or app whose stories you want to unhide
Click Save


Control 12v lock switcher with Arduino Nano

Question: I have 12v poser supply for electronic lock. It has 3 valuable pins: +12V, GND and PUSH. So, when I want to unlock the lock, i need to push PUSH pin to GND. How can I push 12v line to ground with Arduino Nano?
Comment: You can likely just use a MOSFET.  For a definite answer, you should provide a link to a datasheet or product page for the electronic lock.
Answer: A definite answer isn't possible without more information about the lock.  You likely want something like this:

simulate this circuit – Schematic created using CircuitLab
Drive IOPIN HIGH to ground the PUSH pin.
Many other parts could be used in place of the IRLML2502. It's convenient for driving directly from an IO pin. Whether you need the flyback diode D1 depends on the lock.
Comment: Yes, exactly what i need!
Comment: Why I cant connect IOPIN to PUSH directly and send logical 0 (push to GND), or 1 (push to +12V)?
Comment: If you did that, the IO pin of your Arduino Nano would sink whatever current flowed out of the PUSH pin of your lock. They can probably only sink about 30mA (check the datasheet), but the lock may source much more than that. Without more information about the lock, it's impossible to say. It probably does, and the result would be permanent damage to your Arduino.


Why was Rene Descartes not knighted?

Question: I am curious to learn in more detail why Rene Descartes was not knighted like Isaac Newton and many other great mathematicians.
Comment: Because he was French and sir is an English distinction; he could have been made a count or a marquis or something else, but don't forget that he lived a good part of his life outside France (in the Netherlands and Sweden). Also note that his philosophy was in direct opposition to that of the Scholastics who still ruled the Sorbonne.
Comment: @BernardMassé I've incorporated some of your comment in my answer, hope you don't mind.
Answer: The French word for "knight" is "chevalier". Descartes did not need to be knighted; he inherited the title "chevalier" and was frequently called "Chevalier du Peron" or "Chevalier Seigneur du Peron", as in this portrait:
http://www.britishmuseum.org/research/collection_online/collection_object_details.aspx?objectId=3610101&partId=1&people=88521&peoA=88521-1-6&page=1
Answer: This answer was based on an earlier version of the question which asked why Descartes was not made a Sir
The primary reason is that "Sir" denotes a knighthood in the British honour system, and is normally open only to British subjects(*).
René Descartes was a French subject and therefore not eligible.
As noted by Bernard Massé in his comment, the equivalent in 16th-century France would have been to make him a count, marquis or similar title. There are at least two factors which may have contributed to this not happening: firstly he lived a good part of his life outside France (in the Netherlands and Sweden), and secondly his philosophy was in direct opposition to that of the Scholastics who still ruled the Sorbonne.
(*) According to the official website of the UK monarchy, honorary knighthoods are occasionally bestowed on foreign citizens, but they are not entitled to call themselves "Sir".
Answer: Another point is that Isaac Newton, as well as other important mathematicians in England and France, was also a civil servant (Master of the Mint and other offices). He was president of the Royal Society and Member of Parliament.
For instance, Viete was privy councillor to two Kings of France and a high-level civil servant.  Brouncker was already noble by birth.
Descartes went to the Netherlands for freedom of thought and study as well as to learn from Dutch scientists and was not member of the french establishment, although most members of his family were distinguished civil servants (member of provincial parlements), with land properties, mostly in Britany and Poitou.

Why was Rene Descartes not knighted?


Programming Arduino

Question: I'm new to electronics. Professionally I'm a software developer. I want to know whether it is possible to program Atmel AVR 8-bit and 32-bit Microcontrollers using Arduino IDE. If yes could any one guide me on the process or direct me to any site where I can learn about it.
Comment: Downvoted because, well, it's a lousy question. You need more detail. This is not the kind of question I would expect from a software developer with professional experience.
Comment: You can Google AVR. There are tons of tutorials. Google is your friend.
Comment: Understood. Just to be clear, there is no such thing as an Arduino programming language. You can program an Arduino with c or cpp with the Arduino library.
Comment: "Arduino" is not a programming language. It's C++ with an IDE that does most of the drudge work of dealing with hardware and libraries.
Comment: Yes I do have winavr to program it but I would like to know whether Aurdino programming language can be used.
Answer: Yes, it is possible. In fact, this is how the whole 'Arduino' concept works - programming 8/32 bit AVR microcontrollers with the Arduino IDE.

program Atmel AVR 8-bit and 32-bit Microcontrollers using Aurdino IDE

This has two parts actually:
1. Generate compiled HEX targeting AVR
Using the Arduino IDE you could utilize the Arduino libraries (aka working with assist utility functions like digitalWrite for example), which are built on top of the AVR tool-chain. The official Arduino IDE comes with pre-built support for several 8-bit/32-bit Atmel AVR micro-controllers, the full list of supported boards can be found on the Arduino official website or in this Wikipedia page.
You did not specify a specific MCU, therefor you should check if the MCU you would like to work with is in that list.
2. Uploading an Arduino sketch to a compatible AVR
Arduino IDE uses avrdude under the hood. avrdude is

an utility to download/upload/manipulate the ROM and EEPROM contents
  of AVR microcontrollers using the in-system programming technique

(From their website).
The best place to start is the official Arduino.cc website, in the 'Getting Started' section. If you haven't picked any specific Atmel AVR chip yet, consider that each has slightly different features, size, I/O pins etc. so make sure to research a bit before purchasing one (reference the table in the Wikipedia link above to compare between the different kinds).
Answer: http://arduino.cc/ is good place to start. It includes articles about how to get started, library references, and user forums. The Arduino IDE will certainly get you started, but as an experienced developer you'll most likely hit its limitations pretty quickly.
Later, or quite possibly sooner(!) you can use same toolset (compiler, loader, libraries) in several less limiting environments: Eclipse IDE, edit/make at the command line, and Atmel's AVR Studio. C and C++ are mainstream; I've seen references to the existence of (but never tried) AVR Forth and AVR python.
Though you'll see occasional references to an 'Arduino language' it's really nothing more than C++ with some attempt to be smart about detecting references to library packages and auto-inserting the relevant #includes.
You probably won't want to take advantage of such shortcuts, and keep to good programming practices, if you think you'll ever want to move up from the Arduino IDE.
I personally use Eclipse (supplementing with a few command line tools) and I'd recommend it once you've tried the Arduino IDE.
Answer: Just to complement the other responses. You can program some AVR chips using the Arduino IDE, but for it to work out-of-the-box just by using a USB cable it needs to be an Arduino or "Arduino compatible" board, mostly because these come with the Arduino Bootloader.
The bootloader is a small piece of software that runs at power-up and is responsible to load your program into the chip (as well as other configuration stuff, for more info read the previous link). If the AVR chip does not have the bootloader already flashed, then you will have to use a programmer (connected to its ISP pins) to burn it first.
So, it's not like you can just buy random AVR chips or development boards online and start using them. But taking in consideration the wide selection of official boards and "Arduino compatible" ones, you should be able to find something to fit your needs.
Comment: Although if you have a programmer there's no need to have a bootloader at all, since the IDE supports uploading the code via programmer.
Comment: Also, you can also buy bootloader-loaded chips, and you can program a chip with another Arduino or your homemade-duino.
Comment: Thanks  Ignacio Vazquez-Abrams just for clarification if I have Arduino programmer I can program my Atmel Avr MCU without a bootloader.

Programming Arduino


Is it too late for me to become good at piano?

Question: I am 13 and starting to learn piano. I have been asking many people online, who claim to know piano, how long have they been playing. Most, if not all, say that they started between 5-9. I have a dream of becoming a concert pianist one day, decades from now of course. But in general I just want to be pretty good at it, is it too late? Can I not become good since I'm starting late compared to them?
Comment: I'm 47 and taking piano lessons and have gotten close to a skill level I never thought I'd reach. It's never too late.
Comment: I wish I'd started at 13... You may never reach concert level - you really DO need a teacher for that - but youtube videos are an excellent place to start. We're not supposed to recommend in here, so I won't say anything like Pianote. You should get to 'Church level' very quickly.
Comment: If you work hard towards your dream, there is nothing that you cannot achieve.
Comment: Welcome to the site! Are you learning with a teacher?
Comment: Ironically enough, Pete, I might get actually lessons when we move. California is very expensive (the lessons plus gas is too much)  but when we're in Texas I will. I have family over there that can teach me, I just need the internet for my current situation. I do know that I won't get super mega good on my own. Are books a good for me to learn something?
Comment: Does this answer your question? [Is It too late to start learning keyboard again?](https://music.stackexchange.com/questions/12441/is-it-too-late-to-start-learning-keyboard-again)
Comment: You need to define "good". Good enough for Carnegie Hall? Not everyone who starts at 5 years old gets that good. Good enough for the school orchestra? Certainly! How good do you yourself want to be? Whatever, start now and practice every day and see how it goes. But don't give up the day job.
Comment: I'm twenty. I started playing violin last year. At this point I sound decent. It's a wonderful thing to play an instrument and I don't think there's such thing as "too late." The point is not to be a Carnegie hall star but the process of practicing, the joy of playing for yourself and other people. It adds spice and texture to regular life.
Comment: Oh hi! Sadly, I am not learning with a teacher since I live in a small town that doesn't have affordable piano teaching. Also, the ones out of town are too expensive for me. I am going to be learning on one of those online courses, I'm still deciding on which one though.
Comment: Oh thank you, thank you! I'm really eager to learn and I will work my hardest, I'll try not to overdo it though. I don't want to be burnt out hah.
Comment: Related comic : https://xkcd.com/447/
Comment: When I was in school (40-50 years ago), the school band was offered starting in 5th grade. While there are some children who start learning instruments on their own earlier, most waited until around this time, and you could still expect to become good (but not necessarily great) if you devoted yourself enough. It's no different from any other skill.
Comment: @RedSonja Good for me is being able to play in a church or for a school of some sort.
Comment: https://www.beautifulnews.com/i-was-told-i-was-too-old-play-jazz-pianist-challenges-limits-age
Comment: If you are passionate about your instrument, it's never too late. There was no possibility for me to start playing saxophone when I was a kid/teenager, and I had only started at the age of 25. At the age of 28 I picked up flute in addition to the saxophone.
Answer: How good you will become and how soon will depend on three things -

How much time you practice per day. If you practice for an hour a day you will improve almost twice as fast as if you practice for half an hour a day.
When you give up playing. If you stop enjoying it or other things in your life become more important then you will either drastically decrease the amount you practice and play or stop altogether. This is what happens to most youngsters.
The quality of the tuition you receive. If you try and learn completely online then your progress will be much slower and likely to also stop much sooner.

Why starting very young seems to be important for becoming a soloist is that if you fall in love with a particular instrument at a very young age then that love is more likely to preclude love for anything else than if you start later. Start later and you may already love other pursuits but if your love for your instrument and dedication and hard work matches the early starters for as long then you should achieve similar results.
On the subject of just how much to practice, I particularly like something attributed to the late 19th and early 20th century violin teacher, Leopold Auer, who trained most of the greats of the first half of the 20th century.

Practice three hours a day if you are any good, four if you are a
little stupid. If you need more than that, stop. You should find
another line of work

Three hours a day when you are a complete beginner is obviously far too much. Apart from anything else you are likely to develop overuse injuries, but his advice has a lot of merit for advanced students. A real teacher will help you avoid injury.
The other thing to note about practice is that it must engage the brain to succeed in the long run. You have to think about what you are doing for most of the time you are practising. Mindless repetition is more likely to make you worse than better. Again, a real teacher will be of enormous help here.
Comment: Disagree with the amount of practice time equating to how much improvement. It's more what gets put into that time, and how soon the boredom kicks in. Some may be capable of practising fruitfully for hours - others, like me, find 10/15 mins is all we can cope with.
Comment: @Fly-GooglyEyes - Tuition once a week combined with practicing an hour per day is close to the ideal mix for a beginner.  You can use books and online resources to complement in-person schooling, to keep yourself challenged and improving.
Comment: Thank you for the input, I kinda have to learn online since my town doesn't offer much when it comes to music. When there is something it is normally very expensive. But I can also use books, will they help? My schooling is only once a week so I will have free time to practice once an hour. Luckily I know a little when it comes to music practice like how not to just play the things I have achieved. Thank you once again!
Comment: I've got to agree with Tim here. IMO It takes many months to build up to say an hour. Agree on the 10/15mins, definitely more focused and measurable. You can more easily say or journal what you've done in a smaller time period. And you're more likely to be consistent with a smaller time-frame and stick at it. [Aside, I've done this recently with silent meditation, took 3 months to comfortably stick to over 20 mins]
Answer: The accompanist for the choir I sing in just finished his doctorate in piano performance at UT Austin.  (Butler School of Music is a very good school.)  I know a few graduates of this school, and this guy is a cut above all of them.  Perfect technique and control, yet not robotic.
He didn't start piano until he was 16.  I'd guess his age now would be 33-ish.  But he was pretty good 5 years ago when he was working on his masters degree.  And he has played at Carnegie Hall, not as the soloist, but accompanying someone.
Second story:  I started learning pipe organ at age 50.  I'm now 60.  I wouldn't call myself "good", but I can sub for the real organist at church on the Sundays she's gone.
Since you're a little older you'll learn the basics faster.  You'll have no trouble catching up to the guys who started at age 5.
Answer:
I am 13...

I stopped reading at that point. Of course it's not too late! Don't limit yourself. Don't let someone else limit you.

...I have a dream of becoming a concert pianist one day, decades from now of course. But in general I just want to be pretty good at it...

OK, I continued reading... Now we get to the real issue: what actually is your goal?
"Concert pianist" and "pretty good" aren't interchangeable goals. Adding things like "I have a dream" or "in general I just want" IMO only obscure what you really want. It's important to know what you want, because there is a risk of giving up if you don't.
But instead of burdening yourself with questions of what the future holds ask yourself what you are prepared to do now! I'm sure you have read about how many hours a day the most serious musician practice. Figure out how much you can commit yourself to practicing. (The fact you are thinking about this at age 13 makes me think you are very self motivated.)
Start to feel out how much time you can practice and how to fit a daily habit into your life. Also, develop a sense for self assessment. Practice where you are weak then move on to something new after you make improvements.
Take time to find good method books and pedagogical (teaching) material. Look for material that covers ergonomics (body mechanics) so you develop good form for the beginning. Also look for classic teaching material - stuff like Klavierbüchlein für Wilhelm Friedemann Bach or Clementi's Introduction to the Art of Playing on the Pianoforte - or well developed graded material like the ABRSM syllabus. There is a lot to choose from. There isn't one best source. The important thing is to use your judgement and don't take any old Youtube tutorial.
A large part of your question is about comparing yourself to others. Ranking musicians and performance grades/competition has always struck me a strange and for the individual it's fraught with disappointment. Being #1 isn't what music is about. Expression and enjoyment are the point. Regarding skill the important comparison to make is you to yourself.
Start now. Don't stop. Play what you like to play.
Comment: My goal, that I think is right for me, is just to have enough skill to play with a whole group of people that is advanced, like at a church or at a school. Of course I want to be at the same level as them. I didn't word it well sorry. I know not to take a Youtube Tutorial, I just need something online for my current situation(it is not YOutube) but in a year or so I'll get actual lessons. I just have issues with comparing myself to others and I though it was too late.
Comment: If the goal is to play with a group of people, the first step is to pick any other instrument than piano. It's the one instrument with most competition and very few groups have room for more than one pianist.
Comment: @ojs Ironically enough, I used to play clarinet. I have some skill in that. And my goal, more specifically, is to play piano in that group since a lot of instruments aren't really my taste. (I am square if you want to say that). So my goal isn't that one-sided lol, I should've been more specific. I might pick more things when I am older though.
Answer: I started at the age of six and at the age of nine won a national piano competition in my country - Poland. As a professional pianist and piano teacher I can only say, that it is never too late to start working on yourself. Music and especially piano requires lots of work and time spent on it. But it is never too late to enjoy it, which is the most important.
Comment: Dang, at that young?! I will say that working hard and research is my strength, so that is a good thing for me, I think. May I ask, are books a good source of information for piano? I like to read and I want to know if I can put that skill and, a  lot, into my progress.
Answer:

I have a dream of becoming a concert pianist one day, decades from now of course.

But in general I just want to be pretty good at it,

is it too late?

It is definitely not too late for 2. I took up guitar at the age of 16. I changed to classical guitar at 18 and managed to get into music college a few years older than the other students. I qualified as a teacher and taught for many years, occasionally giving local concerts. However I was never of concert standard compared to the virtuosi who were out there. In any case I didn't want the lifestyle of always living in hotel rooms in different countries.
With regard to 3. From my own experience I can guarantee that, provided your hands and feet work well enough, and you practise sufficiently, it is not too late to become excellent, not just pretty good.
With regard to 1. History is full of people who have defied the odds. Who are we to say you can't do it? There is also a demand for excellent accompanists to classical singers for example. These require a different skill-set from those performing concertos etc.
There is an old saying, 'It's better to have loved and lost than never to have loved at all'
I think this could be extended to, 'It's better to have tried to become a concert-pianist and only become a very good pianist than never to have tried at all'
Good luck!
Answer: One advantage you have over 5 or 6 year-olds is that your hands are close to being the size they will be for the rest of your life! That's something younger beginners have to cope with.
Age is, as they say, just a number. More important is your musicality, ability to practise properly, and propensity to make sacrifices, which will happen in the next few years if you want to become really good.
It is quite possible to learn from the internet, with no real teacher, but you'll have to sort the wheat from the chaff. How will you know if a site is good, bad or indifferent?
Having a piano, time and place to practise, and the yearning is all boding well, but having a live teacher will make a huge difference to your progress and understanding. Without, you'll need to set your own goals, and work on whatever at a pace you decide. A (good) teacher will improve all that.
So, no, it's not too late - it's never to late to learn, particularly music, so get on with it NOW !
Answer: Whether or not it's "too late" depends on your goals and expectations.
The fact is that in the performing arts one needs to start as early as possible to develop the skills necessary to get into a conservatory by high school or college, in you teenage years.  But this is because one has an expectation of starting their career in their early 20s. This is true in athletics, ballet dancing, etc.
In addition to the above consideration, mastering a musical instrument requires constant practice and attention to your development.  This is a life long pursuit and most musicians get better with age up to a point where age can no longer be ignored.  No matter how much you practice if you life into your 90s your skills will begin to decay.  By how much depends on lifestyle and genetics.  I saw Andre Segovia perform in his 90s and it was not great.  That being said, if you start too, way too, late then entropy will win.
I think 13 is a perfect time to start, you are not too late.  But you have posed a specific goal, that of being a concert pianist.  To accomplish this specific goal would require entering a conservatory at an early age, perhaps by age 16, or at least by college.  Again, this is to meet the expectation of a career as a concert pianist at a reasonable age.  If you really dedicate yourself to practice now, and make good progress this is possible.
On the lighter side, if you just want to enjoy playing and get "good" at it you are definitely NOT TOO LATE.  Most kids don't start until their early teens and many become virtuosos.  I can only cite anecdotal cases.  For example, a good friend of mine didn't start music lessons on any instrument until age 16 and became an exceptional percussionist and guitarist.  I worked with him in several bands in college.  He is not a professional musician, working as a manager in some tech industry but he is good enough to compete with classically trained musicians for spots in orchestras, etc.  Myself, I started on violin at age 5, eventually moving to guitar at 8, then classical bass in high school, at 16.  I do work as a musician but in college changed majors to physics.  I have no doubt that starting early gave me an advantage in terms of picking up new things easily (drums, horns, etc), but some friends of mine who started lessons late in high school rapidly surpassed me by sheer dedication.
You are very young and can progress quite a bit before college if you start now.  If you are serious about making a life long hobby or even a career as a musician I would start lessons now, and get involved in any programs your school or community has for music.  This will connect you to the music education community and will provide support for developing in the right direction, getting the skills needed to do what is expected.  When I was in high school we were required to compete in all state music competitions as part of our grade, sort of like athletes competing at matches, etc.  This is the kind of experience that will prepare you for entering a conservatory and a music program later in life.
Comment: I can't really join anything at the moment, Covid and my school never offered anything that involved piano. Just, brass, wind, some string, and percussion instruments. My community is low income and is very small so that is a big no. I  have to learn on my own for now ( when I move in a year that will change).
Answer: At worst, you'll be a little "behind" your peers who started at a younger age, but this really only means that you won't be performing in big-name stuff until your late 20s or early 30s. Realistically, you're young enough that you should have no trouble "catching up" if you put in the time.
13 is a great age to begin learning piano. And since you're just starting and are still plenty young, be open to other avenues for the skill. Maybe you'll find something else that fits you even better than your current dream of being a concert pianist.
You will go as far as you are willing to take it seriously and practice the amount necessary to achieve your goals.
Answer: Always do what you want anyway, as you might not know what it really is. You might end up somewhere you'd never expect to be and still be perfectly happy with it. Happiness is the road.
Answer: You can certainly become good starting at age 13.
It would be difficult to become great.
Adults have an ability to learn the piano in less time  than kids do but other factors limit how well they can end up becoming which has more to do with their brain and dexterity but mostly the brain.   And  the brain has more to do with music in general than piano per se.  Sort of like it is easier to learn a second language when you are young than to do it when you are grown up.