transfer balance subxt

Question: I  am using subxt library . I have downloaded metadata from chain using this url wss://rpc.polkadot.io:443 . I have also implemented default example from subxt documentation of transfer balance . i want to know how can i transfer balance from account a to account b  present in  my wallet  using subxt library
Answer: The account you want to send the funds to (you need the address):
    let account_B: AccountId32 = the_address.parse().unwrap();

The account you want to send the funds from (you need the seed):
let pair = sp_core::sr25519::Pair::from_string(&mnemonic_phrase_A, None).unwrap();
let account_A = PairSigner::new(pair);

Then is the same code as the example
let balance_transfer_tx = polkadot::tx().balances().transfer(account_B, 10_000);

    let events = api
        .tx()
        .sign_and_submit_then_watch_default(&balance_transfer_tx, &account_A)
        .await?
        .wait_for_finalized_success()
        .await?;

Answer: Base on that example.
Replace the dest with:
array_bytes::hex2array::<_, 32>(your `b` account's public key here).unwrap().into()

And replace the from with:
use sp_core::{sr25519::Pair, Pair as _};
use subxt::tx::PairSigner;

PairSigner::new(Pair::from_seed(&array_bytes::hex2array(your a account's secret seed here).unwrap()))

transfer balance subxt


Why is the relativistic energy $E=mc^2$ enough for particle-antiparticle creation?

Question: This question came up while reading the Peskin's An Introduction to Quantum Field Theory first lines, where, in order to explain the need for the field theory approach, he says relativistic mechanics imply that there will be more then one particles involved "since the Einstein relation $E=mc^2$ allows for the creation of particle-antiparticle pairs."
Could anyone why this is so?
Comment: It's possible to write down theories which are relativistic and for which particles aren't created or destroyed --- these are called free theories. That is to say, $E = mc^2$ *doesn't* imply particle-antiparticle creation. However, in the real world we observe particles coming into and out of existence --- for instance, we see excited atoms spontaneously emit photons. Hence we *observe* that energy can be converted into mass, and particle number can change, and hence we need a theory that can accommodate this. This is quantum field theory.
Answer: A simple answer could be as follows. The origin of the Einstein relation, in fact, is the energy-momentum relation $$E^2+(pc)^2=(m_0c^2)^2$$
(for more detail you may see:Energy-momentum_relation)
From the energy-momentum relation one could formally take the relativistic expression for the energy $$E=±(m_0^2c^4-p^2c^2)^{1/2}$$
Dirac by deriving his equation from this relation  showed that the minus sign in this relation implies the existence of anti-particles.
Comment: This is misleading. Dirac got into a lot of trouble because he was trying to explain what cannot be explained using a theory of a definite number of particles. He kind of tried to resolve it with considering infinite seas and such but that is not the modern approach.


What is correct, "in-stock" or "on-stock"?

Question: Do we have products in stock or on stock?
Answer: The correct phrase is in stock. No hyphen.
Answer: It should be

Do we have products in stock?

where in stock functions as an adjective. If products are not in stock (available), then they are out of stock. When these adjectives precede the nouns they modify, they are compounded as in-stock and out-of-stock:

How many candles do we have in stock?
How many in-stock items have expired?
The online store displays mostly out-of-stock merchandise.

Note that there also exists the phrase, on the stocks, which means in progress/in the making:

Plans to introduce better products are on the stocks.
Answer: Products can be "in stock", "on hand", or "on the shelf". All these have the same meaning.
Comment: Ask an auto dealer whether he has a certain model "on the shelf"...
Comment: An appropriate change would be "on the lot" or "on the floor".


Does the position of the Ferrite bead matter?

Question: Often I will see a ferrite bead a couple of inches from one end of a cable. Does the position of a ferrite bead really matter?
Answer: My answer hopefully applies to beads but also ferrite clamps on cables.
If it's preventing susceptibility problems due to interference coming down a cable then its position is not that critical. However, if it's stopping emissions getting out from a device, a better position is as close to the interfering source as possible. There is every chance that interference getting onto a cable (such as from a switched mode power converter) can radiate from the cable so, best to keep the ferrite up as close to the source of noise as much as possible.
Comment: Why don't you see them on both ends then? I'm thinking of a High Speed USB Camera cable. Wouldn't the computer have just as much potential creating noise than the camera?
Comment: If its at one particular end then that end is the noisier or more susceptible.
Answer: The position is important.  There's two cases I can imagine.  In the first case, a device is radiating through the cable, and this is unwanted.  In this case, the bead should be as near to the transmitting device as possible.  This reduces the length of the radiating element.  In the second case, a device is receiving unwanted signals picked up on a cable.  In this case, again, the bead should be as close to the device as possible.  The reason we don't use two beads on a cable is that usually it's not required.  Either the communication link is unidirectional, only one device is susceptible, or one bead is enough to change the electrical length enough to attenuate the unwanted signal.
Comment: So that's is why it's on the end of the cable because it is close to the computer (that causes noise)?
Answer: Beads provide suppression by impeding (developing a voltage across the bead) and absorbing (converting to heat) magnetic fields (resulting from to currents on the wire). Beads provide the most suppression at VHF and UHF current maxima (as-in standing waves). The most likely position for a current maxima for all frequencies is near a chassis, bulkhead or other electromagnetic boundary. Undesired RF energy can form standing waves bilaterally when leaving a chassis or entering it. Placing a bead at a current maxima will shift that maxima to another yet weaker frequency dependent location where a second bead may provide some additional improvement for a particular frequency (test equipment required).


SQL Modification

Question: I have a query (Main Query) is like this. I am executing this in Toad connected to Netezza DB.
SELECT *
  FROM db1.schema1.Table1
WHERE (pd_num, pd_num_mtr, pd_num_prefix, sqr_num) IN
          (SELECT pd_num,
                  pd_num_mtr,
                  pd_num_prefix,
                  max (sqr_num) sqr_num
             FROM db1.schema1.table1
            WHERE create_date >= '01/01/2012' AND cd_operator <> 'N'
           GROUP BY pd_num, pd_num_mtr, pd_num_prefix)

When I execute this I get some 1 million records as my output. I further executed a query (Query2) to analyze the number of records belonging to the group as follows.
select pd_num_mtr,pd_num_prefix,count(*)
from db1.schema1.table1
GROUP BY pd_num, pd_num_mtr
order by count(*) desc

I get the below out put for this.
pd_num pd_num_mtr count(*)
001      15          500
002      15          200
003      30          100

Which means I have some 500 records pulled for the pd_num and pd_num_mtr combination with each of these records having an update_timestamp value. Now this needs to be modified as follows.
So among these 500 records, I need to pull only the one with maximum update_timestamp which will limit the count to only 1 record instead of 500.1 from 200 records, 1 record from 100 records with the max update timestamp value.
How can I modify the first query (main query) to acheive this? So that if the run the query2, I get the below as the output.
pd_num pd_num_mtr count(*)
001        15          1
002        15          2
003        30          3

Appreciate your help again. Thank you.
Comment: If you want to pull 1 record from each group, why would the counts be 1,2,3 instead of 1,1,1?
Answer: We will have to use row_number function for this. Assuming 'update_timestamp' as your timestamp column.
SELECT PD_NUM_MTR,PD_NUM_PREFIX
FROM
(
   SELECT PD_NUM_MTR,PD_NUM_PREFIX,ROW_NUMBER() OVER (PARTITION BY PD_NUM_MTR,PD_NUM_PREFIX  ORDER BY update_timestamp desc ) AS RK
   FROM DB1.SCHEMA1.TABLE1
)
WHERE RK=1;

Comment: Thanks. So How should the main to be modified?

SQL Modification


Dependency Inversion Principle (SOLID) vs Encapsulation (Pillars of OOP)

Question: I was recently having a debate about the Dependency Inversion Principle, Inversion of Control and Dependency Injection. In relation to this topic we were debating whether these principles violate one of the pillars of OOP, namely Encapsulation.
My understanding of these things is:

The Dependency Inversion Principle implies that objects should depend upon abstractions, not concretions - this is the fundamental principle upon which the Inversion of Control pattern and Dependency Injection are implemented.
Inversion of Control is a pattern implementation of the Dependency Inversion Principle, where abstract dependencies replace concrete dependencies, allowing concretions of the dependency to be specified outside of the object.
Dependency Injection is a design pattern that implements Inversion of Control and provides dependency resolution. Injection occurs when a dependency is passed to a dependent component. In essence, the Dependency Injection pattern provides a mechanism for coupling dependency abstractions with concrete implementations.
Encapsulation is the process whereby data and functionality that is required by a higher level object is insulated away and inaccessible, thus, the programmer is unaware of how an object is implemented.

The debate got to a sticking point with the following statement:

IoC isn't OOP because it breaks Encapsulation

Personally, I think that the Dependency Inversion Principle and the Inversion of Control pattern should be observed religiously by all OOP developers - and I live by the following quote:

If there is (potentially) more than one way to skin a cat, then do not
  behave like there is only one.

Example 1:
class Program {
    void Main() {
        SkinCatWithKnife skinner = new SkinCatWithKnife ();
        skinner.SkinTheCat();
    }
}

Here we see an example of encapsulation. The programmer only has to call Main() and the cat will be skinned, but what if he wanted to skin the cat with, say a set of razor sharp teeth?
Example 2:
class Program {
    // Encapsulation
    ICatSkinner skinner;

    public Program(ICatSkinner skinner) {
        // Inversion of control
        this.skinner = skinner;
    }

    void Main() {
        this.skinner.SkinTheCat();
    }
}

... new Program(new SkinCatWithTeeth());
    // Dependency Injection

Here we observe the Dependency Inversion Principle and Inversion of Control since an abstract (ICatSkinner) is provided in order to allow concrete dependencies to be passed in by the programmer. At last, there is more than one way to skin a cat!
The quarrel here is; does this break encapsulation? technically one could argue that .SkinTheCat(); is still encapsulated away within the Main() method call, so the programmer is unaware of the behavior of this method, so I do not think this breaks encapsulation.
Delving a little deeper, I think that IoC containers break OOP because they use reflection, but I am not convinced that IoC breaks OOP, nor am I convinced that IoC breaks encapsulation. In fact I'd go as far as to say that:

Encapsulation and Inversion of Control coincide with each other
  happily, allowing programmers to pass in only the concretions of a
  dependency, whilst hiding away the overall implementation via
  encapsulation.

Questions:

Is IoC a direct implementation of the Dependency Inversion Principle?
Does IoC always break encapsulation, and therefore OOP?
Should IoC be used sparingly, religiously or appropriately?
What is the difference between IoC and an IoC container?
Comment: *Is IoC a direct implementation of the Dependency Inversion Principle?* Possible duplicate of http://stackoverflow.com/q/6766056/126014
Comment: *What is the difference between IoC and an IoC container?* Duplicate of http://programmers.stackexchange.com/q/131451/19115
Comment: Being a question about 'conceptual questions about software development', you might have more luck getting this answered on http://programmers.stackexchange.com/. As written, this is a request for discussion, which isn't the forte of a Q&A site like SO.
Comment: @neontapir discussion requests are  _very_ poor fit for Programmers - it would be quickly voted down and closed over there, see [On discussions and why they don't make good questions](http://meta.programmers.stackexchange.com/q/6742/31260). Recommended reading: **[What goes on Programmers.SE? A guide for Stack Overflow](http://meta.programmers.stackexchange.com/q/7182/31260)**
Comment: I consider these definitions to be authoritative: http://martinfowler.com/articles/dipInTheWild.html#YouMeanDependencyInversionRight
Answer:
Does IoC always break encapsulation, and therefore OOP?

No, these are hierarchically related concerns. Encapsulation is one of the most misunderstood concepts in OOP, but I think the relationship is best described via Abstract Data Types (ADTs). Essentially, an ADT is a general description of data and associated behaviour. This description is abstract; it omits implementation details. Instead, it describes an ADT in terms of pre- and post-conditions.
This is what Bertrand Meyer calls design by contract. You can read more about this seminal description of OOD in Object-Oriented Software Construction.
Objects are often described as data with behaviour. This means that an object without data isn't really an object. Thus, you have to get data into the object in some way.
You could, for example, pass data into an object via its constructor:
public class Foo
{
    private readonly int bar;

    public Foo(int bar)
    {
        this.bar = bar;
    }

    // Other members may use this.bar in various ways.
}

Another option is to use a setter function or property. I hope we can agree that so far, encapsulation is not violated.
What happens if we change bar from an integer to another concrete class?
public class Foo
{
    private readonly Bar bar;

    public Foo(Bar bar)
    {
        this.bar = bar;
    }

    // Other members may use this.bar in various ways.
}

The only difference compared to before is that bar is now an object, instead of a primitive. However, that's a false distinction, because in object-oriented design, an integer is also an object. It's only because of performance optimisations in various programming languages (Java, C#, etc.) that there's an actual difference between primitives (strings, integers, bools, etc.) and 'real' objects. From an OOD perspective, they're all alike. Strings have behaviours as well: you can turn them into all-upper-case, reverse them, etc.
Is encapsulation violated if Bar is a sealed/final, concrete class with only non-virtual members?
bar is only data with behaviour, just like an integer, but apart from that, there's no difference. So far, encapsulation isn't violated.
What happens if we allow Bar to have a single virtual member?
Is encapsulation broken by that?
Can we still express pre- and post-conditions about Foo, given that Bar has a single virtual member?
If Bar adheres to the Liskov Substitution Principle (LSP), it wouldn't make a difference. The LSP explicitly states that changing the behaviour mustn't change the correctness of the system. As long as that contract is fulfilled, encapsulation is still intact.
Thus, the LSP (one of the SOLID principles, of which the Dependency Inversion Principle is another) doesn't violate encapsulation; it describes a principle for maintaining encapsulation in the presence of polymorphism.
Does the conclusion change if Bar is an abstract base class? An interface?
No, it doesn't: those are just different degrees of polymorphism. Thus we could rename Bar to IBar (in order to suggest that it's an interface) and pass it into Foo as its data:
public class Foo
{
    private readonly IBar bar;

    public Foo(IBar bar)
    {
        this.bar = bar;
    }

    // Other members may use this.bar in various ways.
}

bar is just another polymorphic object, and as long as the LSP holds, encapsulation holds.
TL; DR
There's a reason SOLID is also known as the Principles of OOD. Encapsulation (i.e. design-by-contract) defines the ground rules. SOLID describes guidelines for following those rules.
Answer:
Is IoC a direct implementation of the Dependency Inversion Principle?

The two are related in a way that they talk about abstractions, but that's about it. Inversion of Control is:

a design in which custom-written portions of a computer program
  receive the flow of control from a generic, reusable library (source)

Inversion of control is allowing us to hook our custom code into the pipeline of a reusable library. In other words, Inversion control is about frameworks. A reusable library that does not apply Inversion of Control is merely a library. A framework is a reusable library that does apply Inversion of Control.
Do note that we as developers can only apply Inversion of Control if we are writing a framework ourselves; you can't apply inversion of control as an application developer. We can (and should) however apply Dependency Inversion Principle and the Dependency Injection pattern.

Does IoC always break encapsulation, and therefore OOP?

Since IoC is just about hooking into the pipeline of a framework, there is nothing that's leaking here. So the real question is: does Dependency Injection break encapsulation.
The answer to that question is: no, it does not. It doesn't break encapsulation because of two reasons:

Since the Dependency Inversion Principles states that we should program against an abstraction, a consumer will not be able to access the internals of the used implementation and that implementation will therefore not be breaking encapsulation to the client. The implementation might not even be known or accessible at compile time (because it lives in an unreferenced assembly) and the implementation can in that case not leak implementation details and break encapsulation.
Although the implementation accepts the dependencies it requires throughout its constructor, those dependencies will typically be stored in private fields and can't be accessed by anyone (even if a consumer depends directly on the concrete type) and it will therefore not break encapsulation.

Should IoC be used sparingly, religiously or appropriately?

Again, the question is "Should DIP and DI be used sparingly". In my opinion, the answer is: NO, you should actually use it throughout the application. Obviously, you should never apply things religiously. You should apply SOLID principles and the DIP is a crucial part of those principles. They will make your application more flexible and more maintainable and in most scenarios it is very appropriate to apply the SOLID principles.

What is the difference between IoC and an IoC container?

Dependency Injection is a pattern that can be applied either with or without a IoC container. An IoC container is merely a tool that can help building your object graph in a more convenient way, in case you have an application that applies the SOLID principles correctly. If you have an application that doesn't apply the SOLID principles, you will have a hard time using a IoC container. You will have a hard time applying Dependency Injection. Or let me put it more broadly, you will have a hard time maintaining your application anyway. But in no way an IoC container is a required tool. I'm developing and maintaining an IoC container for .NET, but I don't always use a container for all my applications. For the big BLOBAs (boring line of business applications) I often use a container, but for smaller apps (or windows services) I don't always use a container. But I do almost always use Dependency Injection as a pattern, because this is the most effective way to adhere to DIP.
Note: Since an IoC container helps us in applying the Dependency Injection pattern, "IoC container" is a terrible name for such library.
But despite of anything I said above, please note that:

in the real world of the software developer, usefulness trumps theory [from Robert C. Martin's Agile Principle, Patterns and Practices]

In other words, even if DI would break encapsulation, it wouldn't matter, because these techniques and patterns have proven to be very valuable, because it results in very flexible and maintainable systems. Practice trumps theory.
Answer: Summing up the question:
We have the ability for a Service to instantiate its own dependencies.
Yet, we also have the ability for a Service to simply define abstractions, and require an application to know about the dependent abstractions, create concrete implementations, and pass them in.
And the question is not,  "Why we do it?"  (Because we know there is a huge list of why).  But the question is, "Doesn't option 2 break encapsulation?"
My "pragmatic" answer
I think Mark is the best bet for any such answers, and as he says: No, encapsulation isn't what people think it is.
Encapsulation is hiding away implementation details of a service or abstraction.  A Dependency isn't an implementation detail.  If you think of a service as a contract, and its subsequent sub-service dependencies as sub-contracts (etc etc chained along), then you really just end up with one huge contract with addendums.
Imagine I'm a caller and I want to use a legal service to sue my boss.  My application would have to know about a service that does so.  That alone breaks the theory that knowing about the services/contracts required to accomplish my goal is false.
The argument there is... yeah, but I just want to hire a lawyer, I don't care about what books or services he uses.  I'll get some random dood off the interwebz and not care about his implementation details... like so:
sub main() {
    LegalService legalService = new LegalService();

    legalService.SueMyManagerForBeingMean();
}

public class LegalService {
    public void SueMyManagerForBeingMean(){
        // Implementation Details.
    }
}

But it turns out, other services are required to get the job done, such as understanding workplace law.  And also as it turns out... I am VERY Interested in the contracts that lawyer is signing under my name and the other stuff he's doing to steal my money.  For example... Why the hell is this internet lawyer based in South Korea?  How will THAT help me!?!?  That isn't an implementation detail, that's part of a dependency chain of requirements I'm happy to manage.
sub main() {
    IWorkLawService understandWorkplaceLaw = new CaliforniaWorkplaceLawService();
    //IWorkLawService understandWorkplaceLaw = new NewYorkWorkplaceLawService();
    LegalService legalService = new LegalService(understandWorkplaceLaw);

    legalService.SueMyManagerForBeingMean();
}

public interface ILegalContract {
    void SueMyManagerForBeingMean();
}

public class LegalService : ILegalContract {
    private readonly IWorkLawService _workLawService;

    public LegalService(IWorkLawService workLawService) {
        this._workLawService = workLawService;
    }

    public void SueMyManagerForBeingMean() {
        //Implementation Detail
        _workLawService.DoSomething; // { implementation detail in there too }
    }
}

Now, all I know is that I have a contract which has other contracts which might have other contracts.  I am very well responsible for those contracts, and not their implementation details.  Though I am more than happy to sign those contracts with concretions that are relevant to my requirements.  And again, I don't care about how those concretions do their jobs, as long as I know I have a binding contract that says we exchange information in some defined way.
Comment: "Encapsulation is hiding away implementation details of a service or abstraction." - exactly and in your second example you have made these implementation details explicit instead of hiding them. In fact we can keep going and say that ca workplace law is not decoupled enough-let's add county services in there, and maybe the specific case law that should be referenced. It is nice that we can change all this on the fly, but now you have moved the burden to the caller for something that should be handled by a dedicated class instead. I don't know if this breaks encapsulation or just YAGNI.
Comment: Creating concrete instantiations of abstractions (or *instead of* abstractions) is not implementation. The methods defined in those classes and/or abstractions are a contract, and the code within a method defined in a contract is the implementation. And so, since the Composition Root is only responsible for filling abstractions with concrete instantiations (which, inside them have contracted methods which, inside them,, have implementations), we never expose implementation to the caller. Fulfilling Contracts does not show us the code in the methods in the classes that implement those contracts
Comment: Though, yes, I **do** show *where* the implementation detail is... in both example 2 as well as example 1.  And in both cases, they are hidden from main()
Answer: I will try to answer your questions, According to my understanding:

Is IoC a direct implementation of the Dependency Inversion Principle?
we can't label IoC as the direct implementation of DIP , as DIP focuses on making higher level modules depending on the abstraction and not on the concretion of lower level modules. But rather IoC is an implementation of Dependency Injection.
Does IoC always break encapsulation, and therefore OOP?
I don't think the mechanism of IoC will violate Encapsulation. But can make the system become Tightly coupled.
Should IoC be used sparingly, religiously or appropriately?
IoC can be used as a in many patterns like Bridge Pattern, where seperating Concretion from Abstraction improves the code. Thus can be used in order to achieve DIP.
What is the difference between IoC and an IoC container?
IoC is a mechanism of Dependency Inversion but containers are those which uses IoC.
Answer: Encapsulation does not contradict with Dependency Inversion Principles in Object-Oriented Programming world. For example in a car design, you will have an 'internal engine' which will be encapsulated from outside world, and also 'wheels' that can be replaced easily, and considered as outside component of the car. The car has specification (interface) to rotate the shaft of the wheels, and the wheels component implements part that interact with the shaft.
Here, The internal engine represents the encapsulation process, while the wheel components represent the Dependency Inversion Principles (DIP) in the car design. With DIP, basically we prevent building a monolithic object, and instead we make our object composable. Can you image you build a car, where you cannot replace the wheels because they are built-in into the car.
Also you can read more about Dependency Inversion Principles in more details in my blog Here.
Answer: I'm only going to answer one question as many other people have answered everything else. And keep in mind, there is no right or wrong answer, just user preferences.
Should IoC be used sparingly, religiously or appropriately?
My experience leads me to believe that Dependency Injection should only be used on classes that are general and might need changing in the future. Using it religiously will lead to some classes needing 15 interfaces in the constructor which can get really time consuming. That tends to lead to 20% development and 80% house keeping.
Someone brought up an example of a car, and how the builder of the car will want to change the tires. Dependency injection allows one to change the tires without caring of the specific implementation details. But if we take dependency injection religiously... Then we need to start building interfaces to the constituents of the tires as well... Well, what about the threads of the tire? What about the stitching in those tires? What about the chemical in those threads? What about the atoms in those chemical? Etc... Okay! Hey! At some point you're going to have to say "enough is enough"! Let's not turn every little thing into an interface... Because that can get too time consuming. It's okay to have some classes be self contained in and instantiated in the class itself! It's faster to develop, and instantiating the class is a ton easier.
Just my 2 cents.
Answer: I have found a case when ioc and dependency injection  breaks encapsulation . Lets assume we have a ListUtil class . In that class there is a method called remove duplicates . This method accepts a List . There is an interface ISortAlgorith with a sort method . There is a class called QuickSort which implements this interface. When we write the alogorithm to remove duplicates we have to sort the list inside . Now if RemoveDuplicates allow an interface ISortAlgorithm as a parameter(IOC/Dependency Injection) to allow extensibility for others to choose an another algorithm for remove duplicate we are exposing the complexity of remove duplicate feature of the ListUtil class . Thus violating the foundation stone of Oops.
Comment: I would not consider this scenario to be a violation of IoC or DI, but to some degree it does break encapsulation. If you never intended for the sort algorithm to be changed, then what you have here is a leaky abstraction.


Taylor Type series

Question: I'm stuck in the following series:
$$\sum_{n=0}^{+\infty} \frac{1}{n!}\frac{d}{dx^n} \left( f(n-2x) \right) \left|_{x=0} \right.$$
where $f$ is a smooth function.
At first glance it resembles a Taylor Type series, but the argument of the function depends on the index $n$ of the sum, and so it's not a Taylor expansion around a fixed point as usual.
I have no idea how to treat this sum. Any ideas, tricks or references?
Thanks!
Comment: what exactly is the question though? what do you want to accomplish?
Answer: $$\frac{\mathrm{d}}{\mathrm{d}x^n} f(n-2x) \bigg|_{x=0}=(-2)^nf^{(n)}(n)$$
So the result is not a series expansion as it does not depend on $x$, but a constant solely dependant on the function $f(x)$ used. Although the summation may not converge for example when $f(x)=n!/(-2)^n$, its value is given by
$$\sum_{n=0}^\infty \frac{(-2)^nf^{(n)}(n)}{n!}$$
Comment: Thanks Peter. The fact is that, the coeffients of the original series are really horrific; after long calculations I proved that the coeffients are exactly in the form above; my hope was that,  thanks to this false similarity to a Taylor series, I could say something on the sum.
Comment: @Papemax89 What was the original series? Perhaps you should post that in the question instead?

Taylor Type series


Who owned the pit prison in Dark Knight Rises?

Question: In the movie Dark Knight Rises Bruce Wayne is kept in prison which is in a pit. Earlier, this one in a kind prison was owed by a Warlord. But later in the story, although no official statement regarding the owner has been made, the unprecedented authority on the prison of Bane clearly makes him look like the owner. So, did Bane own the Prison? Or can anyone who has knowledge regarding the prison keep their prisoners there?
Comment: The RIAA. In the background you can see many people who torrented other Warner Bros. movies.
Answer: While it is never outright stated, an educated guess is that it is owned/controlled by the League of Shadows.  With

  Miranda Tate AKA Talia Al Ghul`

in charge and taking revenge on all those who wronged her and her family it stands to reason that she by way of Bane took control of the prison once she amassed enough power in the League.
Comment: You have to remember that the League doesn't believe that what they are doing is evil.  They don't kill without cause, so a prison to house their enemies they deem unnecessary to kill would make sense.  Plus it's a form of torture for those trapped there.
Comment: If she owns it what is the purpose of keeping prisoners? She and Bane would have easily killed anyone...
Comment: That settles it. Thanks!


Parsing links where Javascript is generating HTML?

Question: In the past, when I've used BeautifulSoup and lxml to parse webpages, it's been pretty easy because links all looked like this: Website. However, I've encountered some webpages where links appear in the browser but not in the page source.
For example, on this Edmunds.com page, the Past Long-Term Road Tests section looks like this:
1991 Acura NSX
2011 Acura TSX Sport Wagon
...

However, the source code for the Past Long Long-Term Road Tests section of the page looks like this:

The Javascript line var elink = "|acura|nsx|1991|long-term-road-test|"; gets expanded to edmunds.com/acura/nsx/1991/long-term-road-test in the browser.

Tools like BeautifulSoup and lxml aren't finding the links that are generated in Javascript. How can I parse these links?
Comment: Copy the `EDMUNDS.linkList` function I guess
Answer: Use a headless browser such as ghost.py to run the page's JavaScript, and you should have no problem scrapting the JS-altered DOM.


Why ViewDidApper and ViewWillApper are not always called?

Question: I have a method that sets the height of a UIScrollView and a UITextView based on the content of the UITextView. I realized that both, textview and scrollview are correctly resized when the method is call from viewWillAppear but not from viewDidLoad (the textview is not correctly resized from viewDidLoad but the scrollview it is).
<code>//In View1
-(void) setHeight
{
    NSLog(@"Set height");
    CGRect frame = descriptionTextView.frame;
    frame.size.height = descriptionTextView.contentSize.height;
    descriptionTextView.frame = frame;

    if([[UIScreen mainScreen] bounds].size.height == 568) //iPhone 4inch
    {
        totalHeight = 380+frame.size.height;
        [self.mainScrollView setContentSize:CGSizeMake(320,totalHeight)];
    }
    else{
        totalHeight = 250+frame.size.height;
        [self.mainScrollView setContentSize:CGSizeMake(320,totalHeight)];
    }
}
</code>
The problem is that I created a custom tab bar menu with a UIView that's a placeholder. The first time I perform the segue it works, but not if I go back and press the tab again, since viewWillAppear and viewDidAppear are not called. why are not called? How can I force them to be called?
<code>//In CustomTabBarController
-(void) selectTab{
    self.isLoaded = YES;
    self.activity_indicator.hidden = YES;

    if ([self.selectedButton isEqualToString: @"view1"])
        [self performSegueWithIdentifier:@"sg_view1" sender:self];
    else if ([self.selectedButton isEqualToString:@"view2" ])
        [self performSegueWithIdentifier:@"sg_view2" sender:self];
    else if ([self.selectedButton isEqualToString:@"view3" ])
        [self performSegueWithIdentifier:@"sg_view3" sender:self];

}
</code>
Answer: The best approach would be to using the tab bar delegate method instead of viewWillAppear:
<code>- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {

    if ([viewController isKindOfClass:someClass]){

         //do your stuff

    }
}
</code>


Can I change the transparency of a selection keeping the relative transparency each part already has proportional?

Question: I want to give the middle full opacity but let the border effect that is already existing.
Answer: Each layer in GIMP can have the transparency for each pixel specified in two ways, that add to each other:
If you imported a PNG file with transparency, you background layer already has an alpha channel - you can keep that untouched -
Just right click on the layerś thumb on the Layers Dialog ctrl + L  and pick
Add Layer Mask - that way a mask is created. It behaves as a grayscale image, where black means transparency and white means opacity - you can select if you are painting on the actual layer or on its maks by clicking on the respective thumbnails -
Just select the mask and paint it gray (by dragging and dropping a shade of gray on the canvas, or using the bucket fill) - and you have extra, prortional transparency for the whole image, without touching the original transparency levels.
Answer: One option might be to convert a color in your image to transparency:

Go to Layer -> Transparency -> Color to Alpha
This way you can choose exactly what you want to be transparent by making it a certain color and then converting that color to transparency.
Answer: If I understand the question, you are starting with a colored area that is partially transparent throughout, but at the outside edges it gradually becomes completely transparent (so the edges appear "feathered" or "anti-aliased"); and you want to make the colored area completely opaque, except for the outside edges, which you still want to gradually become completely transparent, in the same proportion to their original transparency (to retain a similar "feathered" or "anti-aliased" appearance at the edges)?
If so, one way is to duplicate the original layer on top of itself, so that each partially transparent pixel adds to itself proportionally.

Since the pixels around the outside edge were originally less opaque than the pixels in the middle, the outside pixels will add to themselves less than the more opaque pixels in the middle.

Create additional duplicates of the original layer until the middle area reaches the desired opacity.

But don't add too many duplicate layers, because even after the middle area reaches complete opacity, the outside pixels will continue adding to themselves with each new duplicate layer, until they eventually become completely opaque themselves (and you will lose the "feathered" or "anti-aliased" appearance at the edges).

Note: This method applies to the entire layer, so to apply it to a specific selection, you would need to first move the selection to its own new layer (for example, using Select > Float, then Layer > To New Layer).

Before duplicating layers
Approximately 50% transparency in the center of the circle:

After adding 5 duplicate layers
Approximately 0% transparency in the center of the circle (but still with "feathered" or "anti-aliased" edges):
Comment: Using  a layer mask  is so much simpler than this....
Comment: Sorry @xenoid, I can't figure out how to increase opacity (decrease transparency) using a layer mask; for me, even with the layer mask completely white (full opacity), the original image retains its 50% transparency from its alpha channel.  Can you provide instructions for how to do it?
Comment: It depends how you initialize the mask. If you use Transfer the layer's alpha channel you have full control. If you use other options, this is in addition (multiplication, actually) to the existing alpha, so you cannot increase the opacity. So the quickest method is to transfer the alpha channel, and use Curves/Levels/Brightness-Contrast to alter the channel.
Comment: Thanks @xenoid; using Levels > "Auto" on the layer mask (transferred from alpha channel) gave me the desired effect - and I think it's more mathematically accurate too.  I know layer masks were mentioned in other answers here, but your suggestion was the key for me, so I think it would make a good answer to the OP's question, if you're willing to post it?
Comment: Posted as an answer...
Comment: Thanks @xenoid; I've proposed an edit to your answer to give the specific example of your suggestion that worked for me; in any case, I'll up-vote your answer when I gain enough rep!
Answer: Not sure what you mean with "border effect" but here is how to have a transparent senter with a feathered border:

Layer > Transparency > Add Alpha Channel adds a transparent layer to the image if not yet present.

Select area with border effect (here Feather).

Press Del or select Edit > Clear to remove selected area leaving the transparent layer in the background.
Comment: I mean the .png I oopen in Gimp already has a good anti-aliasing effect (it's an Android star icon that I try to colorize, never though it would be that complex). I try your solution, brb
Comment: As far as I understand, your idea is to remove the picture and to keep only the alpha channel layer? Can I add a layer over an image to increase opacity unifomly?
Comment: Its the other way round: I removed the selection from the image to leave a transparent hole. Anything you paint on that transparent area will become the opacity of the paint tool used. So yes, you can add a layer to that image.
Answer: tl;dr
(Inspired by previous answers from xenoid and Reece.)
Adjust the input levels of the alpha channel of your selection.  To do this, start with your selection, then:

Colors menu > Levels... > Adjust Color Levels window:

Channel: Alpha
Under the Input Levels section:

Optional: click the black eye-dropper, then click an area of your selection that you want to be completely transparent.  (Or skip this step and just leave it at zero.)
Click the white eye-dropper, then click an area of your selection that you want to be completely opaque.

Click OK.

This sets the opacity of the entire selection so that the area selected in #1 becomes completely transparent, the area selected in #2 becomes completely opaque, and the transparency of everything in between is scaled proportionally.
Before:

After:

Too long; don't read
Here's an explanation of what the above process does.
Alpha represented as grayscale
When an image's transparency (or alpha channel) is represented graphically, it is represented as a grayscale image:

Black areas represent pixels that are completely transparent.

That is, pixels with grayscale value 0 (black) represent pixels with alpha = 0/255 (0% opacity).

White areas represent pixels that are completely opaque.

That is, pixels with grayscale value 255 (white) represent pixels with alpha = 255/255 (100% opacity).

Gray areas represent pixels that are somewhere in between.

(Assuming the alpha value is an 8-bit number, from 0 to 255.)
Using Gimp's Color Levels to adjust alpha range
In Gimp's Adjust Color Levels window, it shows a histogram of the selection's lightness/darkness levels – that is, it shows a distribution of how many pixels in the selection are at each lightness/darkness value.

In our case, we choose only the alpha channel, to adjust the lightness/darkness levels of the grayscale "color" that represents the selection's alpha channel only.  The histogram above shows the alpha channel of the "before" image, and from this, we can see that it is composed of the following:

A spike of nearly 0% opaque pixels at the left end of the graph.

These pixels are nearly black in the alpha channel's "grayscale".
(Probably the four corners.)

A spike of approximately 50% opaque pixels in the middle of the graph.

These pixels are a medium shade of gray in the alpha channel's "grayscale".
(Probably the central area of the circle.)

A small band of pixels that range from ~0% to ~50% opacity between the two spikes.

In the alpha channel's "grayscale", these pixels range in shades of gray, from nearly black to the medium gray in the middle.
(Probably the gradual fade-out around the outside of the circle.)

Above ~50% opacity, there aren't any pixels.

So in the alpha channel's "grayscale", there aren't any white pixels, nor any pixels lighter than the medium gray in the middle.

So what we want to do is to take all the pixels in the left half of the graph and "stretch them out", so that they are distributed across the entire width of the graph from 0% opacity at the left end (value = 0 or "black") to 100% opacity at the right end (value = 255 or "white") – but we want to do it proportionally, so that the graph maintains approximately the same shape after we stretch it out.  To do that, we can easily use the black/white eye-droppers under the Input Levels section:

Using the black eye-dropper, we pick a pixel from the image – a pixel with an existing alpha value that we want to be scaled down to 0 (completely transparent).

In this case, this step isn't necessary, because the alpha channel already has values all the way down to 0 – we don't want the distribution to be stretched in that direction.

Using the white eye-dropper, we pick another pixel from the image – a pixel with an existing alpha value that we want to be scaled up to 255 (completely opaque).

After we click OK to apply the change, we should see the desired effect in the selection.  If we again open the Adjust Color Levels window and choose the alpha channel, we can look at the new distribution in the histogram:

So we can see that the selection's alpha channel has been "spread out" to take up the entire range of alpha values from 0 to 255 – i.e. the opacity goes all the way from 0% to 100% – and has roughly the same proportion (relative distribution) throughout its occupied range as it did before, so that the "fade out" around the outside is still smooth from inside to outside as it was before.
Answer: Changing a transparency is done by editing the layer mask.

You create the layer mask with Layer>Mask>Add layer mask
If you only want to increase the transparency of some parts initialize the mask to white. What is white in the mask will have the initial opacity, and black will be fully transparent.
If you want full control, use the Transfer the layer's alpha channel. White will be fully opaque, and black will be transparent.
You can tell if you are editing the mask or the layer by looking as the bottom of the image window, next to the zoom indicator. It will either say {layer name} or {layer name} mask. You can switch between the two by clicking on their preview in the Layer list, or using Layer>Mask>Edit layer mask
The mask is a greyscale image that can be edited with the paint tools (brush, bucket, etc...) or any color tool  such as Curves, Levels, and Brightness-Contrast, but also other tools and filters (you can render plasma on it, for instance).
The selection applies to the tools when editing the mask. The selection being global to the image, you can use on the mask a selection you obtained elsewhere (by editing the layer itself, for instance, or another layer).

For example, to make a partially-transparent area completely opaque in the middle while proportionally increasing the opacity of existing feathered edges:

Activate the layer and add a layer mask to it, initializing the layer mask to "Transfer layer's alpha channel".

Layer > Mask > Add Layer Mask > Transfer layer's alpha channel

Make sure the layer mask is activated for editing.

Layer > Mask > ✓ Edit Layer Mask (selected)

Select the area of the layer where the transparency is to be modified.
Use the "Levels" tool to automatically scale the selection in the layer mask proportionally from black to white (thereby scaling the selection's transparency from fully transparent to fully opaque).

Colors > Levels > Auto
Answer: If your goal is to adjust the alpha levels only, while keeping colors and relative opacity, do this:

Create a selection. For example, select by color with a threshold
Colors > Levels
Select Channel: Alpha
Adjust the output sliders. The image will be adjusted immediately. For example, to decrease relative opacity, grab the slide the solid white triangle left.

Tested in gimp 2.10.8


In the case of a question that applies to many Linux OS:es, is it better to ask one question and expect mutiple answers, or ask one specific question?

Question: I have a question I would like to ask that applies to mostly all Linux distributions (and maybe even BSD), but the answer will probably vary depending on what Linux distribution it is due to varying package managers, init systems, service managers, and so on. Is it in this case better to ask one question and expect multiple answers for different distributions, or ask multiple questions that ask the same thing but how to do it on a specific distribution?
Comment: I think you should include what the actual question is, at least at a high level, to better inform the answers to this meta-question.
Comment: Unix gained its portability by rewriting hardware-independent components in C; your question may also gain portability if you can separate distro-dependent information from your core needs.
Comment: Can you please give a specific example? It seems that I am not understanding what you want here. I just cannot see how the same question can both "apply to mostly all Linux distributions" _and_ its answers will  "vary depending on what Linux distribution". It seems to me that it will always be one or the other but cannot be both.
Answer: This seems contradictory. Either the question "applies to mostly all Linux distributions (and maybe even BSD)" OR "[it will] vary depending on what Linux distribution it is due to varying package managers, init systems, service managers, and so on". It can't be both. I see three options:

The question's answer depends on the system used; phrase the question in terms of portability: I need to do foo, how can I ensure this will work on any *nix?

The question's answer depends on the system used; choose the system you are interested in: How can I do foo in BSD? And then ask multiple questions for different systems.

The question is actually applicable to multiple systems; just ask the question in its general form: How can I do foo in *nix systems.
Comment: I guess something like "how do I install a distribution-provided package" would make sense in mostly all Linuxes and BSDs, but would have very different answers in each...
Comment: well, I mean, IMO, the _question_ would apply on any system that distributes application software the user can install. The concepts there are the same, regardless of if the underlying system is apt/dpkg or yum/rpm or whatever. Just the answers won't apply to each distribution. (Now that I read it again, package managers are exactly what they mentioned there.)
Comment: I'm not sure if we have a different idea of a question applying in some context, then. I was thinking about if the X in "I'm trying to do X, but don't know how" makes sense in the context. It's not a question of the tools at that point. But ok, what if the party asking the question doesn't know beforehand if the same answer applies to all distributions? Ok, maybe in the case of package managers it's "well known" enough that they're different. But what about some other case? Should we expect the askers to know the exact limits of the subject beforehand?
Comment: @ilkkachu exactly: so it would not be "apply to mostly all Linux distributions". I just don't see how something can be _both_ applicable to various systems _and_ have different answers depending on the system. Either it is applicable to all (so, one answer) or it has different answers depending on the system and therefore is not applicable to all.
Comment: @ilkkachu yes, so if the answers depend on the specifics of the package manager, then the question is, by definition, not applicable to most distributions. I just don't see how a question can be both applicable to all _and_ have answers that are specific.
Comment: @ilkkachu of course not, but it seems that in this case, the OP does know. Which is why I find the question confusing. They are specifically asking about something that is both "applicable to all systems" _and_ "has different solutions depending on the system".  Which is not possible. Sure, "how can I install tetris" could be asked for any operating system, but obviously the answers would be different per system so the question would have to be targeted to the system the OP has.
Answer: I don't think it would be easy to ask a single question in this way, yet I'm also not convinced that only breaking it into multiple questions would fix the problem...
Too Broad
A question should be answerable in its entirety so deliberately asking a question that needs answering multiple times for different systems would (to my mind) be "too broad".
In particular you would be asking for answers derived from multiple separate skill sets so if you wanted answers for Linux-Debian, Linux-Redhat, OpenBSD, MacOS, ... then it's unlikely that any one individual would be able to answer for all systems.
The result of this is your question will most likely be closed as "too broad".
Too little effort
It's not strictly a rule but many users dislike seeing questions where the OP clearly didn't bother to research an answer before writing their question.  Note the reference to "Search and Research" here: https://stackoverflow.com/help/how-to-ask
The major problem with questions similar to the one you describe in your question is that you've almost certainly put no effort in to research it for each system yourself.  I say that because it would be unlikely to research each system and get stuck on exactly the same problem for each.
If you were to break your question into multiple (near identical) questions each about a different system, it would irritate other users and draw in the down votes.
What to do instead
What you should generally do in this situation is take some time to research an answer yourself first.  If you get stuck on one then ask a question for that system.  It may be that understanding from answers to that will help you with other systems.
It's fine if you get stuck on multiple systems, but try to space out your questions and avoid spamming near identical questions.
Answer: If you aren't sure what answers will depend on, include all the information that's potentially relevant in your question, and let people who do know what is relevant edit the title and tags to reflect what is actually relevant.


Does the mass of a planet affect the size of living organisms?

Question: I'm trying to do some world building for a game I've been working on, and so I've been designing a planet that would fit large fauna and flora. What I would like to know is if the mass of a planet has any affect on the size of organisms on said planet.
Comment: Wouldn't the basic research Worldbuilding SE asked of you have shown that the simple act of moving on larger planets with greater gravity required more muscle, basically meaning bigger bodies?

Either way, how is this not off-topic as a real-world Question?
Comment: The gravity of the planet might, but I can't see how the mass would.
Answer: Basically, yes: the less Mass, the easier it is to get big. So there is an inverse relation.
Big things need to eat either lots of small things or other (not quite so) big things, unless they are parasitic or predators in which they can live off bigger things.
A major driving force for the sheer quantity of biomass required for super large animals is always going to be plants. Given that plants thrive on CO2, there's a bounded correlation between CO2 and rampant vegetation. Dinosaurs lived on an earth that had CO2 levels which are toxic to humans.
So big fauna are more likely on large (more surface area = more sun), low density (light gravity) planets with high CO2 - all of which can provide rampant vegetation that then feeds the intermediate species allowing for gigafauna.
Oh and stability. Evolutionary complexity requires lots of time - so you need some form of protection against solar particles - such as a magnetic field driven by an iron core.
Answer: Necessary premise: we are talking about a sample with size 1, since at the time I am writing it we know only one planet hosting life.
The main effects the size of a planet might have on the maximum size of its life form is directly due to gravity, and indirectly due to the biomes supporting the large life forms.

Gravity: obviously, the stronger the gravity the larger the load on the anatomic structure for the same mass. A healthy human's legs would be crushed by the weight of the same human in Jupiter gravity.
Biomes: to sustain a large animal you need a large food chain. This has happened in the past, when for some reasons being large was quite normal (see dinosaurs).
Biomes 2: living in water or on land makes a big difference. The blue whale can sustain its 150000 kg thanks to the water it swims in.
Answer: It's reasonable to say that climate is what limits the size of current organisms on Earth, because we know that in past climates, many kinds of organism grew much larger: 70cm dragonflies, 15m sharks, 2ton rats, etc.  If the size of the planet is not what limits the size of organisms today, there's no reason to assume it was the limit in the Cretaceous period either; in other words, dinosaurs on Earth might have been even bigger with a different atmosphere.
The good news is that gives you a lot of leeway regardless of how big a planet you propose, because we have no data on what limits that imposes.  The bad news is we have no data; if you want to propose mile-high trees, it's guesswork what kind of planet you'd need.
We can do a lot of napkin calculations, though, mainly using the line-square-cube ratio: when you double an object's length, you increase its surface area by 22=4, and its volume by 23=8.
If you double the Earth's width, its volume (and therefore its mass and gravity) is eight times greater.  So the atmosphere is eight times as dense, and a cat's lungs will be able to absorb eight times as much oxygen.  But the cat weighs eight times as much, so it will need eight times as much energy to stand up, to pump blood to its head, and so on.  But on the other hand, its mass is the same so it doesn't need any more energy to move horizontally.  This (very loosely) implies that it could grow somewhat bigger, but not twice as big.
You can keep adding details to this, but my instinct is that there is no one term that will dominate as you vary the planet's size between zero and infinity – I would guess that, roughly speaking, cat length is proportional to planet size, but with diminishing returns at either extreme (a sigmoid type of curve).
Another angle of attack would be to consider that size is a function of time: it takes longer to grow bigger.  Since an organism with a lifespan of a day evolves much faster than one that lives for a thousand years, the former will always be better adapted to changing conditions.  To grow really big you need an environment that doesn't change (though this doesn't relate to planet size in any simple way).
Short version:
Within the relatively narrow range of sizes possible for solid planets (let alone Earth-like planets), there is no obvious relation to the size of organism those planets could sustain.
Comment: Important to note that insect size peaked before amniotes really diversed, in combination with a high atmospheric O2 concentration. Whilst the oxygen would have helped insects reach larger sizes, competition with vertebrates is what seems to be what limits their size. Climate itself was not the sole factor in dinosaur size. Their anatomy was simply much better than mammals at producing large body plans. High sea levels and the structure of the continents also likely played a role. As for megalodon, the emmergence of toothed whales may have also driven them extinct in combination with climate.
Answer: Yes... But no.
As mentioned already, direct factors include gravity and available biomass. It is important to remember that the rules are different for marine, terrestrial and aerial ecosystems. Marine ecosystems enable larger organisms because the bouyancy force of water negates most of an animals weight. This allows huge amounts of plankton and algae to inhabit the upper ocean which sustain must more complicated food webs than their terrestrial counterparts. On land, ecosystems are predominantly confined to two dimentions. Light does not penetrate rock like it does water, meaning that your producers are limited to the surface available. Most plants grow tall to increase their surface area, whilst roots harvest minerals from underground. Aquatic producers do not typically grow large as they can absorb nutrients straight out of their surroundings.
Terrestrial environments
Terrestrial fauna sizes are dependant on available biomass. On a lower gravity world, bones and tissue may be less dense, meaning an elephant-sized alien would have less mass than an elephant. Or more importantly, an alien with the mass of an elephant would have larger dimensions (more volume) than an elephant. This scaling would be effected by the square-cube law. This only works if the food source remains at the same density. Since leaves aren't load-bearing, leaves on a low gravity world might be just as nutricious, even though the wood of the tree is less dense. Things like grasses however could potentially be less dense (or not, there are no known alien biospheres so it's at your disgression).
Increasing the surface area of a planet would increase the amount of space for plants to grow, meaning there would be more biomass available, however, this also comes at the cost of increasing gravity unless you compromise on density (which effects your planets ability to retain an atmosphere).
The arangements of continents is probably the most important factor in determining how productive your environment is. Having all your continents bound together in a supercontinent would give your creatures a huge habitat range, but would reduce your biodiversity as the best adapted animals would simply dominate. The cretaceous is a good template as it had a warm climate with high sea levels which is hugely productive for marine or coastal ecosystems. Large continents are good but supercontinents can lead to huge desert areas (Pangea, Eurasia). Natural boundaries such as seas and oceans are essential if you want to have different types of large fauna - Compare the diversity of megafauna in North and South America before and after the Great American Interchange. Earth's surface is 75% water already so there's plenty of room to increase the land mass without increasing the size of the planet. Just don't increase it too much as oceans are neccessary for climate regulation.
Aerial Environments
In the air, the density of nutrients is only a fraction of in water because the air is 1000 times less dense. An extremely thick atmosphere can increase the productivity of aerial environments but comes at a cost. The greenhouse effect is dependant on how much greenhouse gas (CO2 being the most abundant) is in the air. Increasing the atmospheric thickness should be done with inert gasses where possible, lest you end up with venus. Oxygen is also important as respiration depends on partial pressure whilst flammability depends on concentration - at high densities, there is a trade-off between fire becoming impossible and oxygen reaching dangerous levels (oxygen is a great electron donor).
Marine environments
Marine environments wouldn't be effected much by the mass of the planet. A larger planet has a larger surface area, which increases the available energy that can be harvested from the sun. Increasing the radius of the planet however, comes at the cost of increasing gravity, which impacts terrestrial ecosystems. Blue whales are pretty damn huge but their feeding stategy becomes inneficient beyond their maximum recorded size (~33m). However, the primary limit on ocean productivity on earth is the availability of iron in the ocean. Increasing the amount of iron or iron oxide in the crust could allow iron-rich dust to saturate the oceans. If the iron input was constant, this would increase the density of plankton in the oceans, making filter feeding more economical. The maximum size and/or population of blue whales could increase significantly, potentially where predation of blue whales may be sustainable for large predators. So marine environments don't need huge planets to create huge creatures. Water also doesn't vary much in density (salinity is a bigger factor than gravity on water density) so weight would not change much with gravity.


How do I pass a platform event payload from a PB process to a flow?

Question: I read elsewhere that I can pass an event's payload to a flow from a process builder process. When I try pass values in my process all I see are the different fields from my platform event object. Do I need to pass field by field to a corresponding variable in the flow? Thanks!
Comment: Are the contents of the event payload that you would like to interact with in your flow sourced from Salesforce data?
Comment: I've been playing around with it and I had even a hard time getting the flow to let me pass a single field. When defining a process builder it required I select a different type of record (I chose contact) and it would only let me add fields from that record to the flow, not from the event itself.
Comment: looks like this is coming in [winter 20](https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/rn_forcecom_flow_pbuilder_formulas.htm)
Answer: Without custom code, yes you will need to map each Flow variable individually as per the documentation
However, it seems that you may be creating the process builder for your use case incorrectly:
In Process Builder, create a process and for The process starts when select A platform event occurs.
Add a trigger.
Under Platform Event select Platform Status Alert Event.
Answer: I typically just pass the ID and have the flow do a lookup to get the rest of the variables I need.  Thanks to cropredy for pointing out that is not possible with platform events.
You can subscribe to platform events directly in flow, in which case you can set a record variable to the platform event, and then reference the platform event fields via flow formula fields.
See this document

When the flow interview resumes, the {!vendorResponse} record variable is populated with the data from the event message (3).

That said, i just tested this in a flow and I am getting an error when I try to save the pause element : The data type of the resource you entered isn't compatible.
Its possible that is related to the new flow builder.
It seems to me that it is not possible to pass event field values directly to a flow - only to reference them in the process and evaluate against an object. It appears that the recommended approach is to subscribe to the event directly from the flow.
Comment: you can't query Platform Events by ID - no SOQL support
Comment: Thanks gorav. That is exactly why I posted this question - the data type error. Now you say the recommended approach is to subscribe directly from the flow. All the documentation I've read leads me to this error. Thanks for looking into it and try it though.
Comment: UPDATE: So I decided to go back to Cloud Flow Designer to check if the error would also show up there. Well, what do you know... NO ERROR!  So, I saved the flow, then opened it with the new Flow Builder and continued my flow. I'm still trying to get the data from the platform event into the flow. I tried passing the reply ID in the Process without success.


Oracle NoSQL Database - Developing with it

Question: I recently came in touch with the Oracle NoSQL Database. It appears as though one can connect to it only from Java (more info here). Is it possible to work with this DB from other languages, like say: Python, Erlang, C++ e.t.c. ? OR its like the usual 11G database which can be talked to via ODBC, Oracle Drivers e.t.c. ? Anyone with more info on this, i will appreciate so much
Answer: Have a look at this: https://github.com/yeysus/14a
I don't know the current developement status though, and the support of interaction might be limited, as Java is the main language to go with this DB.
If it's about NoSQL without Java and you have the choice, something like MongoDB oder CouchDB might be the better choice!
Answer: Sorry, old post. But, I will still go ahead and respond, just in case if there are other folks facing similar issues.
Oracle NoSQL does has drivers for python, javascript. Please see below links :
Python : https://pypi.python.org/pypi/nosqldb
JavaScript : https://www.npmjs.com/package/nosqldb-oraclejs


Facebook app functionality

Question: I would like to create a facebook app for my web app. I would like it to post on a user's behalf every time the user creates a new album on my site. I am hoping to make it act like Pinterest whereas users in my news feed tend to have posts saying "Emily Sue pinned to 2 boards on Pinterest". Is this automatically generated or does the Pinterest user have to hit the Facebook "share" button on Pinterest?
Answer: You have to make an Open Graph app. Facebook has a tutorial which will guide you trough the key steps.
Answer: If your app has the publish permissions you can automatically post on his wall.

Facebook app functionality


How could an AI be in the real world organically and humanely (not in a robotic body)?

Question: Say I have some artificial intelligence characters in a virtual reality world that my human characters have bonded with in ways of friendship, romance, etc before they find out they're AI. How would it be possible to organically bring those AI characters to the real world as flesh and blood without using robotics or stolen bodies (removing someone's consciousness and replacing it with the AI's), if at all? If that's theoretically possible, would it be possible for these individuals to reproduce?
Comment: Hello and Welcome to Worldbuiling. AI's are a very tricky topic, because they border on the lines of reality and fantasy. If your AI is based on science, then its very likely it will never be able to be placed in a biological body, because of the amount of information it would require to simulate a humans capabilities (and it being an analogue system), while if your AI is more science-fiction, it can do almost anything and everything you want. I feel like you are going with the latter, so as long as genetic cloning in your world is advance enough, it is possible to have AI's in human bodies.
Answer: These questions are click-bait for me; I know I shouldn't answer but the compulsion is too strong, so...
As a researcher in the field of AI, I see this kind of assumption all the time and there are some things that we need to get straight right off the bat to answer this.
1) Intelligence is not Consciousness or Liveness
A machine can be intelligent without being aware, conscious, or alive. Intelligence is merely the ability to identify and recognise complex patterns. Even in natural intelligence this is the case - someone who is more intelligent than someone else is merely able to identify and/or recognise more subtle or complex patterns than the other, or recognise the simple patterns faster. This means that even if your human fell in love with an AI, it's not reciprocal. Which brings me to sunny point number two;
2) Humans are very good at anthropomorphisation
Of course your human is going to one day fall in love with a machine. Part of our evolutionary journey (a part that made us very successful hunters) is the ability to empathise, or put ourselves in the place of others. That meant we could predict an animal's reaction to what we do, and set up conditions (through strategy) that made those reactions turn to our advantage. This also makes us more social creatures, but ultimately this 'falling in love with an AI' is really no different to us falling in love with our teddy bear, except that an AI is a very sophisticated teddy bear, capable of interacting with us.
3) Computing Architecture is not the same as Neural Architecture
Computers don't have a cerebellum, that houses driving instincts like survival, hunger, procreation etc. Nor do they contain an amygdala, which influences rational thought by introducing emotion. What that means is that if your AI is housed in a conventional computer, even if you could put it in an organic body, it won't possess the same personality. It will be something different to what the human originally fell in love with because the processing model is completely different.
The real issue here isn't whether or not AI's can be organic, it's the whole conflation of intelligence and consciousness. Unfortunately, we have always had a rather vague understanding of what these words actually mean and have often used them as synonyms outside of AI research. Even SETI scientists talk about 'Intelligent Life' and we just assume that something intelligent is alive, which is not what even the SETI scientists are intending to convey.
In point of fact, in AI research, we are only now refining how we use these words with precise (and more importantly, consistent) definitions, and based on those, I can tell you that something can be intelligent, but not alive just as much as something can be alive, but not intelligent.
Your better bet is androids, in the manner of biological creations, like Phillip K Dick describes in Do Androids Dream of Electric Sheep, better known by the movie version called Blade Runner. For your purposes, it would be far easier to create biological creatures in man's image and deal with falling in love and reproduction from that basis than trying to get an AI into a host body.
Comment: About the part that says "computers don´t have a cerebelum". Even if a robot doesn´t have amygdala or any glands at all, everythink can be simulated. You could build a robot with pherormone receptors, and program a simulated reaction in the artificial brain. You could even simulate the layered reactions of "the 3 brains" (https://www.interaction-design.org/literature/article/our-three-brains-the-reptilian-brain). And I agree with the fact that the machine will not really "feel" anything. But I think you can program a really very good simulation inside a robot.
Comment: @CarlosZamora you are indeed correct that these elements can be simulated, but that still has them operating on architecture that most closely resembles the cerebral cortex. To convert to true biological processes, you'd have to pull apart the simulation, and somehow fit the simulated emotions into the amygdala and the simulated drives into the cerebellum, assuming these can be 'programmed' at all. This would (in all likelihood) still result in changes to personality during the conversion to biological (albeit not robotic).
Answer: You need to master genetic engineering for that
If you don´t want to use robotics and don´t want "stolen" bodies, then you only have one choice:
Grown your own body
1) DESIGN
You need to start designing the ADN of the character to mimic the same characteristics it has in the virtual environment (gender, skin color, eye color, height, bone structure, fat, hair, and all the complete genotype, even the voice tone). If your virtual environment has smells, you will have to include the smell of the character also in the ADN design.
2) BUILD
Once you have designed the ADN needed, you need to make it grow. Usually it takes 9 months or so. Perhaps (with technology advanced enough) you might be able to reduce the time, but I don´t think you could reduce it much (however, you are the designer of your story. You can "handwave" a sufficiently advanced technology to do it in a month or so).
3) TRAIN
When the body is ready, you need to take it out of the container, and start to "train" it to "be" the virtual entity. Your body will start as a baby. So, you need to grow it up until the age of your avatar (your virtual entity). If your virtual character is 80 years old, it will take more time. If your virtual character is a teenager, it will take less. You will need to feed into the body all the experiences and sensations your original avatar had, by means of earphones, a visor, and electronic signals directly sent to the muscles and nerves in all its body. We are talking here about making the body "to live" all the experiences the virtual character had, more or less like the movie "The Matrix".
Of course, that must be done in an accelerated way. If my virtual character is 80 years old, I don´t want to wait 80 years until my organic body reaches that age (to appear the same) and learn all that the virtual character has learned.
As you can see, it is easier to build a robot.
Comment: You will train the body with all the memories and experiences of the AI. And yes, you can´t use directly your AI, because the question was explicit: "no robots". So this is a way to (indirectly) "download" the information from your AI to the organic body.
Comment: your answer basically just says genetically engineer a body to look exactly the way you want and then mentally and physically brainwash this person into thinking it is the AI avatar, is that really what you mean to say? Your answer doesn't even mention AI
Answer: Maybe your society develops a means to restrict the development of the frontal cortex, or surgically remove it altogether; perhaps in people who are deemed to be "unworthy" in some way, without actually killing the body or destroying the autonomous behaviour. How and why you might do this, and under what circumstances, would depend on the available technology, and how evil and uncaring you want your society to be.  So, for example, you society could rule that instead of the death penalty, convicted psychopaths would have their mind "deleted". This would leave you with functioning bodies, but with no mind.
The AI could be loaded into a compact device which is capable of interfacing with what is left of the brain in these bodies.
If the demand for AIs is sufficient, and the horrors of the legal system come to light and the law is forced to change, it might not be long before someone hits on the idea of genetically engineering bodies with little or no frontal cortex.  These 'non-people' could then be given an identity by the installation of the AI in its compact device interfaced to the brain.
In either case, if the rest of the body is unmodified, I don't see why normal human reproduction would not be possible.
Answer: An AI could grow the same way as humans do, but faster. You make something like a DNA where AI structure and future body is encoded. You feed AI fetus and it grows to a real body that is indistinguishable from humans.


One-tailed F-test with one restriction

Question: I have a regression, e.g. $Y=a+b_1X_1+b_2X_2+c_1Z_1+c_2Z_2+e$.
Is it possible test the one-tailed null $b_1+b_2\leqslant c_1+c_2$ against the alternative $b_1+b_2>c_1+c_2$? Notice that this is an $F$-test with a single restriction.
Comment: Related: [One-tailed F-test with multiple restrictions](http://stats.stackexchange.com/questions/179933/one-tailed-f-test-with-multiple-restrictions).
Answer: Yes, this is possible.
The general multiple linear regression model is
$$y = X\beta + \varepsilon$$
with the $k$ regressor values, along with a constant vector, forming the columns of $X$ and the $p=k+1$ coefficients arranged correspondingly in the vector $\beta$.  When there is no collinearity among those columns, the least-squares solution is
$$\hat \beta = (X^\prime X)^{-1}X^\prime y.$$
It fits (or "predicts") the expectations $E[y|X]$ with
$$\hat y = X\hat\beta = X(X^\prime X)^{-1}X^\prime y.$$
Assuming the "errors" $\varepsilon$ are uncorrelated and have common variance $\sigma^2$, the unbiased estimator of $\sigma^2$ is
$$\hat\sigma^2 = \frac{||y - \hat y||^2}{n-p}.$$
(This is the mean squared residual $||y - \hat y||^2/n$ adjusted by the factor $n/(n-p)$ to make the estimator unbiased.)  The covariance matrix of the estimates $\hat\beta$ can then be estimated as
$$\operatorname{Cov}(\hat\beta) \approx \hat\sigma^2 (X^\prime X)^{-1}.$$
Any linear combination $c^\prime \beta$ will be estimated with the same linear combination of parameter estimates, $c^\prime \hat\beta$.  To compare $c^\prime\beta$ to some predetermined constant $c_0$ (often $0$), compute the variance of the estimate as
$$\operatorname{se}(c^\prime\hat\beta) = \operatorname{Var}(c^\prime\hat\beta) = c^\prime \operatorname{Cov}(\hat\beta)c  = \hat\sigma^2 c^\prime(X^\prime X)^{-1}c$$
and conduct a t-test (either one- or two-sided) based on the t statistic
$$t = \frac{c^\prime\hat\beta - c_0}{\sqrt{\operatorname{se}(c^\prime\hat\beta) }}.$$
For $n$ observations, it has $n-p$ degrees of freedom.

The following R code shows how to perform these calculations and runs a (fast) simulation demonstrating that one-sided p-values do indeed have a uniform distribution when the null hypothesis holds.  The required information is extracted from an lm fit using coef to obtain $\hat \beta$ and vcov for $\hat\sigma^2 (X^\prime X)^{-1}$.
To check the simulation, it conducts a $\chi^2$ test of uniformity; the output for this particular set of 1000 iterations is a p-value of $0.4428$, evidence that the code is performing as claimed.
beta <- c(1,4,2,3)       # The coefficients
n <- 20                  # The number of observations
combo <- c(0,1,1,-1,-1)  # The contrast (starting with an intercept coefficient)
sigma <- 2               # The error SD
n.sim <- 1e3             # Number of iterations of the simulation
#
# Prepare to simulate.
#
set.seed(17)
k <- length(beta)
combo.name <- paste0("Contrast(", paste(combo, collapse=","), ")")
#
# Simulate with many different sets of regressors and responses, but all
# using the same `beta`.
#
p.values <- replicate(n.sim, {
  #
  # Create regressors.
  #
  x <- matrix(rnorm(n*k), n)
  colnames(x) <- paste0("X", 1:k)
  y <- x %*% beta + rnorm(n, 0, sigma)
  #
  # Test the combination.
  #
  fit <- lm(y ~ ., as.data.frame(x))
  beta.hat <- crossprod(coef(fit), combo)
  beta.hat.se <- sqrt(combo %*% vcov(fit) %*% combo)
  t.stat <- beta.hat / beta.hat.se
  p <- pt(t.stat, n-k-1) # A one-sided p-value
  #
  # When running this "for real," uncomment the following lines to
  # see the results.
  #
#   stats <- rbind(coef(summary(fit)), c(beta.hat, beta.hat.se, t.stat, p))
#   rownames(stats)[k+2] <- combo.name
#   print(stats, digits=3)
  #
  # Return the p-value for the (two-sided) t-test
  #
  p
})
#
# Display the simulation results.
#
n.bins <- floor(n.sim / 100)
(p.dist <- chisq.test(table(floor(n.bins*p.values)))$p.value) #$
hist(p.values, freq=FALSE, breaks=n.bins,
     sub=paste("p (uniform) =", format(p.dist, digits=3)))
abline(h = 1, col="Gray", lwd=2, lty=3)

Answer: Yes this is indeed very possible, in fact nothing changes. Use the standard F-test provided by whatever software you are using.
Actually, when you only have one parameter the F-test is just the square of a the same t-test. That is, $t^2_{n-k-1} \sim F_{1,n-k-1}$. As Whuber points out in the comments, you have to be carefull in thinking about 1 and 2 sided alternatives. And in this case, (for the above results to be true) you need a two sided alternative. But this should always be the case, unless you have a really good argument for why the statistic cannot be negative (or positive).
Comment: You seem to be claiming that the one-tailed and two-tailed tests are the same, but obviously they are not.
Comment: So I can just compute the F-stat, take the square root, and see if it is larger than my one-sided critical t-value, e.g. 1.28 for the 10% significance level?
Comment: @whuber, yes indeed. Have updated!
Comment: Is it that simple? It's not obvious to me that this should work...
Comment: So, I can only test a two-sided alternative and not a one-sided alternative with the F-test with one restriction?
Comment: You could also reparameterize the model, and then use a one sided t. But you really need to have a good reason for using a one sided test, and usually one does not have such a reason.

One-tailed F-test with one restriction


Running an FFT filter on a large data set

Question: I have a non realtime application where I need to run a bandpass FFT filter on a data array of between 5k and 10k data points. Do I break it up into (say) 256 point chunks, run the FFT on that and simply move onto the next 256 items, or is that too naive?
Comment: Bandpass FFT filter, interesting what you are trying to do... Usually overlap-add and overlap-save are used for such task.
Comment: yes break it up into chunks and do FFT filter on each chunk, but no, it's not that simple.  you need to use analysis window functions, synthesis window functions, overlap, etc.
Comment: Does that apply to realtime as well? For example audio where blocks of 256 are coming in via ADC and being processed to a DAC.
Answer: You need to know the length of the impulse response of your bandpass filter, and use an FFT longer than 256 by that length (to prevent circular convolution boundary artifacts).  Combine the longer FFT results back into a sequence of length 256 windows by overlap-add or overlap-save.
Comment: I suppose my real question is: Where can I find a C function like (for example)

void FFTBandpass( int* dataSource, int* dataDestination, int size, int upperHz, int lowerHz )
Comment: This seems useful in terms of being a code generator: http://www-users.cs.york.ac.uk/~fisher/mkfilter/
Answer: I am not sure I understand your question, and I am not sure whether you are looking for expert help with a rather esoteric filtering problem, or if you are new to digital filtering.
I am guessing you are new to this subject and you don't realize there is a much simpler way to filter data, other than with the FFT approach. If so, take a look at this: http://www.iowahills.com/
Try using either the FIR or IIR programs (free) so you can see how easy filtering is done by using the more standard convolution approach. It will take just a few minutes to design a bandpass filter and test it on your data. There is also source code available that shows how to implement FIR and IIR filters in C.
Please ignore this if you must use the FFT approach.
Comment: Thanks. The answer is "new to digital filtering". I know some of the basics from their analog equivalents but I have never coded a digital filter. Whether I need FFT remains to be seen. All I know is that an FFT filter gives me what I want in terms of cleaned up data. Whether (say) a Butterworth will do the same I do not yet know.


How could I retrive full internal storage of an Android smartphone in order to restore data?

Question: In TWRP, I originally intended to only formating Data as F2FS but didn't know that from around Android 5, data is a subfolder under /sdcard and everything in /sdcard is gone. How could I retrive a full image of Android internal storage so that I could try to use some data recovery softwares recovering as much as possible?
Comment: Data is not a subfolder of `/sdcard` this statement in your question is wrong. However both folders `/data` and `/sdcard` are located on the same "userdata" partition.
Answer: Well, basically TWRP is a tiny embedded Linux so we could do Linux things in TWRP. First we need to unmount all the unneccessary ones in Mount menu, plug in a big enough flash drive formatted using exFAT (By default, Linux couldn't write NTFS, and FAT32 has file size limitation. You may also need extra power supply to get the HDD working), and mount it. Then go to Adaveced -> Terminal and you get a busybox to play with, like other embedded Linux systems.
For phones using UFS, usually the block device for internal storage is /dev/block/sda, and you could confirm this by checking its size.
# --getsize64 would return size in bytes
~ # blockdev --getsize64 /dev/block/sda
123161542656

The returned number is the block device's size in bytes. That's around 123.16 gigabytes, consistent with the info available on LineageOS device specs (128 GB).
And for smartphones using EMMC, the block device for it should be /dev/block/mmcblk0, correct me if I am wrong.
Now we could dump all the content of that image into external storage device.
DO NOT WRITE BACK TO INTERNAL STORAGE. You would get your data overwritten and that's why I said unmounting all unneccessary volumes at the beginning.
dd if=/dev/block/sda bs=4096 of=/usb_otg/dump.img

Hint: You could utilize nohup to let dd running at background and continue other tasks in terminal, like:
# The "&" symbol at the end is necessary
nohup dd if=/dev/block/sda bs=4096 of=/usb_otg/dump.img > /usb_otg/dd.log 2>&1 &

After dd finishes, unmount your external drive. Wish you a good luck recovering data.
Comment: did you recover your data? i doubt it's possible on encrypted device


Are arbitrary constants present in a differential equation or a partial differential equation?

Question: ex:$$y=mx+c$$
$$\frac{dy}{dx}=m$$
$$y=\frac{dy}{dx}.x +c$$
The line equation has 2 arbitrary constants..it implies the DE should be second order...but it isnt and c isnt eliminated too...How do i eliminate c?
Comment: the DE is indeed second order, its $y'' = 0$. The equation $\frac{dy}{dx} = m$ is **not** the DE satisfied by **every** function of the form $mx+c$. This is only true if $m$ is a fixed number, and then yes, its first order
Answer: $$y=mx+c\quad\implies\quad \begin{cases}\frac{dy}{dx}=m\\ \frac{d^2y}{dx^2}=0\end{cases}$$
Thus the second order ODE is very simple :
$$ \frac{d^2y}{dx^2}=0$$
In solving it you check that the general solution is $\quad y=mx+c\quad$ as expected.


How to get extra vertical space before group in pgfgantt?

Question: Using the pgfgantt package, one can uniformly set vertical spacing using the y unit chart key. However, i would like to add extra vertical space before certain groups, but the package does not seem to provide for this. Is this possible? How?
Answer: You can manually add extra \\ or \ganttnewline wherever you want extra vertical space in the chart.
Please see the manual, p.10, 2.4 Line Breaks between Chart Elements (pgfgantt v4.0).


Is scrum certification enough to switch from construction project management to IT Project management domain?

Question: I had short experience in construction industry, then I completed MBA in Project management. I am equipped with MS project Primavera P6.   Now I am thinking of switching into IT industry. Will Agile scrum master certification be enough ?
Comment: Having an MBA in PM and a Scrum certification can help, but they don't guarantee anything. It depends on the jobs you apply for, on your knowledge and skills, on your motivation, and on the person who interviews you. Nobody is going to hire you just because you have two pieces of paper. People will test you at the interview to determine if you are a match for their position. And if by IT you mean software development, then you need to understand how software gets built. It's not the same as the construction industry.
Answer: No, it isn't. A Scrum certification from any of the major certifying bodies mostly just teaches you the core concepts of Scrum. It is very valuable, but it's also just a start.
Simply switching industries isn't a big problem - it all comes down to how well you can map the concepts from one industry to another in your own mind. Core concepts like communications, risk management, enabling people on the project, and clearing away impediments aren't much different between the industries. It's just what's on the surface that looks different.
Realize though that you may also be switching mindsets from a more water-fall big-delivery approach to an iterative approach. To put it in construction terms, imagine I'm building a new wing of a school. Our school is overloaded and kids are literally having classes on the lawn. Your task is to help us get kids in classrooms as fast as possible. If we have to wait until the whole wing is done, we'll have to close the school and cancel everything. So you have to deliver the ability to move kids into classes in pieces - that's become the norm for IT projects in many companies, so that's can be a pretty big shift - the scrum cert will start unpacking that change.
Answer: I think you will find it difficult. In my experience, IT people don't just hire PMs who know the PM processes and practices: they expect proven PM experience within either their own business domain (so that you can talk to the business in knowledgeable terms) or the IT domain (so you can talk to the technical people in their own terms). You also need to be sure of what the role encompasses, given the fact that there is not a formal PM role within Scrum, as others have stated.
Be aware that IT can also mean a wide range of different things to different people - I worked as a PM for several years without ever being directly involved in software development projects, while many of my colleagues had no involvement in building IT infrastructure (which was my area of activity). Others built and populated data centres, while still others worked exclusively on application and data migration projects.
Scrum is not always used in all circumstances: My observation is that it's probably most widely used in software development, occasionally in smaller infrastructure projects, and less commonly in larger infrastructure projects such as data centre builds (although I'm happy to be contradicted on this).
A further point I would make is that some organisations try to use agile processes, but don't actually manage to do so for all sorts of internal and external reasons. So I would suggest that you might want to be very sure that you know what an organisation expects from you if they are taking you on as a PM in IT - so be prepared to ask searching questions when in an interview situation, to be sure that you know what you might be getting into.
Answer: In Scrum it is the Product Owner, not a Project Manager, who decides what gets done and when; the team as a whole then plan how to do it and the PO is responsible for optimising the value of what is delivered by the team. Many software development teams prefer to operate without a PM and it seems to be a trend that former software development PMs either transition to become agile coaches or prefer to move into product management.
Product management requires domain knowledge. You don't necessarily need software development experience to be a PO but you do need to understand your customers, your product, and the business context.
To be a Scrum Master or agile coach on the other hand doesn't necessarily require a lot of domain knowledge or software development experience but it definitely helps if you understand how software teams operate and the kinds of problem they encounter. You could aim to get some experience as an agile coach or "floating" SM first. Some Scrum teams have part-time SMs shared between multiple teams and that can be a good way to gain some experience. A SM cert may help you get a SM or agile coach role but emphasizing your experience of business organization, managing people and helping teams solve problems is more valuable than the cert itself.
(Since you mentioned Scrum I'm guessing you might be interested in software projects. "IT industry" could mean a lot of other things as well however)
Answer: The toughest part will be getting your first job. You may want to try some non-profit or charity organisations as they can be a bit more flexible around your experience.
Is it enough?
I think if you have the right mind-set, then it will be:

Servant-leader
Highly collaborative


Find all files on server with 777 permissions

Question: I'm looking for a Linux command to go through all the directories on my server and find all files with 777 permission. The output would be a list of all those files with full path.
Answer: Use find:
find / -type f -perm 0777

Answer: And if you like to find all files without Permission 0777 then just enter a ! before the perm, e.g.
find / -type f ! -perm 0777
Answer: You can also change the permissions or ownership of all those files resulting from the find execution using the -exec option to avoid change them manually.
Example: In a web server you could need to grant the group to write files:
find /var/www/html -type f -perm 0777 -exec chmod 775 {} \; -exec chgrp www {} \;

Comment: Be very very careful doing this - always worth using -exec ls first in order to see what the effect of your command will do. Find is super powerful and will often find things you didn't expect it to.
Comment: It's true. My command should be used once you know which files will result from the search.
Answer: it's as easy as:
find / -perm 0777

if you only want to match files, use this instead:
find / -type f -perm 0777


Is there a way to receive notifications for threads you have starred?

Question: Now and then I click the star button for questions I think are useful, even if I don't participate directly in them. Is there a way to receive notifications whenever a new answer is added to these questions? Right now, I have to go to my profile and check each starred item manually. It's not a convenient process for checking topics I'm interesting.
Answer: Recently, a "follow" option has been added (see follow next to edit below the body of the question).
For more info see The Follow Questions and Answers feature is now live across the Network.
Comment: Thank you. I assume I should retrospectively follow the threads I starred.
Comment: Very odd that SE decided to separate the concepts of starring and following.
Comment: @DariusJahandarie The Meta post says, they are planning on rebranding the starring as "bookmarking". I personally don't really use bookmarks, but I guess it sort of makes sense to have an SE-internal bookmark for questions you liked. If you're a heavy bookmarker, you might not want to be notified of all comments / new answers for all the questions you starred/bookmarked.