How can a civilization tell that their "Sun" is actually a black hole emitting hawking radiation?

Question: Imagine a primordial black hole so heavy that it is a blackbody and there are many planets orbiting around it, there is a moon thriving with intelligent life orbiting a gas giant. I am wondering would the intelligent alien species be able to tell a blackhole "Sun" against a fusion furnace?
Comment: The visual size and mass are going to be dead giveaways; the larger the black hole, the lower the temperature of its Hawking Radiation.  To get Sun-hot, your black hole is going to be asteroidal in mass, and its event horizon, microscopic.
Comment: I note that from their point of view, it will be a question of realizing that most of the stars in the sky are not blackholes but fusion furnaces.
Comment: I don't quite understand the technical details but this answer (https://physics.stackexchange.com/questions/130209/how-can-it-be-that-the-sun-emits-more-than-a-black-body) suggests there are slight differences in terms of emission spectrum.
Comment: There might be other ways to distinguish the two objects than spectrum though. I imagine the black hole will be completely static and uniform, and the sun will have visible currents, geysers, and be hotter in some places than others.
Comment: ...but a Sun-hot, microscopical-sized black hole would have not enough power to even detectable from 1 AU.
Answer: Mismatching Spectrum and size
If their "sun" emits the same total energy of light as our Sol, then it will be only:
total luminosity : matches Sol = 5e26 watt
diameter: 1/ 10 000 th of a proton. (1e-24 m diameter)
peak emission: about 4.2e16 electonvolt. That is deep, deep, deeeeeeep cosmic ray, at about 6 millijoule PER PHOTON.
It would also only mass about 1 tonne,
and they would have a few microseconds to observe it before it evaporates.
A black hole large enough the be the gravitational center of a solar system, especially a "black hole so heavy that it is a blackbody" will have virtually nil detectable radiation of its own. Maybe from an infalling accretion disk, but that has a very visible and distinct signature.
Here' a nice tool to play around with, to see the size & mass & luminosity of black holes.
Answer: It's really hard to have a black hole involved in a habitable system. As others have pointed out, the black hole you describe would be a tiny point of light, and it would immediately evaporate in a burst of gamma radiation.
Another alternative would be a quasi-star, a massive object heated by a black hole accreting matter at its core. These would be obviously unlike normal stars, being thousands of times as massive as the sun and outputting as much light as a small galaxy. They might provide heat and light to a planet orbiting another star that itself is too dim. However, they would only last 7 million years or so, and since stars move, it's unlikely a planet would end up in the habitable zone for even that long.
A stellar black hole with an accretion disk seems more plausible, though you have the problem of explaining how the planet survived the creation of the black hole in suitable condition for life, and the accretion disk seems likely to produce harmful radiation and to be too unstable a source of heat and light for life to form.
However you arrange it, it seems unlikely for complex life to evolve locally in the time available: the aliens would almost have to themselves be alien to the world they're on, having come from somewhere else. Refugees from the formation of the quasi-star, settling a world that it's made habitable for the next few million years?
Answer: Assuming that they follow the same path of scientific evolution that we had, they would notice that its mass is rather large.
How did we determine the mass of the Sun?

We start by determining the mass of the Earth. Because we know the radius of the Earth, we can use the Law of Universal Gravitation to calculate the mass of the Earth in terms of the gravitational force on an object (its weight) at the Earth's surface, using the radius of the Earth as the distance.
Knowing the mass and radius of the Earth and the distance of the Earth from the sun, we can calculate the mass of the sun (right), again by using the law of universal gravitation. The gravitational attraction between the Earth and the sun is G times the sun's mass times the Earth's mass, divided by the distance between the Earth and the sun squared. This attraction must be equal to the centripetal force needed to keep the earth in its (almost circular) orbit around the sun. The centripetal force is the Earth's mass times the square of its speed divided by its distance from the sun. By astronomically determining the distance to the sun, we can calculate the earth's speed around the sun and hence the sun's mass.

A similar approach would lead to estimating the mass of the light emitter.
However be advised: a black hole with peak emission at 400 nm would have a radius of 10 nm, a mass about 1 millionth of Earth and a luminosity of 1 millionth of a Watt. In this world it's probably true that the Sun orbits around the Earth, but it would be very feeble.


How much can you shorten an armor wearing scene in a comics?

Question: Let's say the armor is important, do we have to show let's say the guy wearing the helmet in one panel, then the legging and then the breast plate? Or we can shorten it even more? Usually, I would skip this scene, but only using 2 panels might be strange or too short. How would you make it as short as possible without making it seem out of the blue and confusing your readers?
Comment: By "wearing" you mean "putting on"?
Comment: It all depends on what you're trying to do. Showing someone getting tooled up for battle can be used to build tension or reveal character, but equally there's plenty of cases where you don't know someone is armoured until they get hit and then they go "ha! I was wearing a bullet-proof vest!" So think about why the armour is important and what effect you want to have on the reader.
Comment: You wouldn't show a character putting on their underpants, then their socks, shirt, and shoes every time they got up or went out? So why do you need to do it with armor?
Answer: A single large panel showing the character(s) putting on the armour would let you highlight any importance about the armour or putting it on without taking much "time" from a reading panel-by-panel perspective. That way, for someone reading quickly, the size of the panel can be the first thing that strikes to the importance of this scene without taking time.
As for highlighting it's importance then that comes in more through the lighting and general design of it (or how the character(s) are interacting with it/examining it.
Answer: If you've been creating the right expectations in your readers, then in most cases I don't see why you would need a scene to establish that characters are wearing armor. If people are going into battle, why would they not be wearing armor?
But, if you do need to establish upfront that the characters are wearing armor, you could do it with a single overview shot.
For example, if Princess invited everyone to the beach - a situation were you wouldn't expect people to wear armor - you could have a nice overview shot of everyone having arrived and looking at the ocean. Everyone is wearing swimwear, except Knighty McKnightface who is in full plate armor, because he doesn't understand the concept of going outside of the castle for anything other than battle. And no one commented on it until they got to the beach. Because it's funnier that way.


Realtime audio processing using Dynamic

Question: Can I make real time audio processing with Mathematica in the same way I can do with images using Dynamic[CurrentImage[]].
I know that is possible to use SystemDialogInput["RecordSound"] function, but you can't make real time dynamics on it.
For example, I would like create one notebook that could make an alert when sound's beyond some level.
It's possible?
Comment: The best I have seen for real time work with MMA was this: a live stream of Conrad Wolfram doing face recognition to block it in real time.  https://twitter.com/conradwolfram/status/573416811728904192 .  Since he did it live on stage in front of an audience I would have though some audio processing would be possible providing the bandwidth was low enough.  I should note that the frame rate and resolution were typical webcam quality - ie low.
Comment: I don't think so... Let's pray ;)
Comment: On Linux this is not possible. I add my prayers :)
Comment: In my case I use a Mac. It's strange that it's so easy to do it with a cam, but not with a microphone.
Comment: Also see [here](http://mathematica.stackexchange.com/a/20998/12) for interacting with chuck.
Comment: Eventually, something may come from the relatively new [devices functionality](http://reference.wolfram.com/language/tutorial/DevelopingDeviceDrivers.html) but I haven't seen anything happen there yet.
Answer: Generally, Mathematica is just not good at real-time anything.  It was not designed for this.  Audio processing has very strict requirements on latency.  The delay between input and output must be tiny, on the order of milliseconds, otherwise the delay will be noticeable.
Mathematica is simply not meant for this and doesn't have precise timing facilities.  I'm fairly confident that the practical answer to this is no, it's not possible.
For non-real time audio processing or things like algorithmic music, I see many uses.  But it's not a tool for real-time work.
Comment: @Philipp There are many interesting possibilities for uses in music, just not when it must be real-time ... it might be possible to hack something together for simple uses, but I wouldn't feel comfortable with it ... I definitely wouldn't trust it enough to use during a live performance with an audience.  Well, at least not without very very extensively testing it first.
Comment: Thank you very much! I'm aware of the latency, but this is not really an issue. I would use it to create something like "soundscapes". So, it's not very important that the timing is very accurate. More important is a vast variety of possibilities to manipulate sound in order to create new and interesting approaches in performing. But based on you answer, I assume that it's still no the best software to do something like this. Thanks...
Comment: @Mr.Wizard Yes, I agree.
Comment: @Szabolcs I would like to close and *merge* this as a duplicate of [(13656)](http://mathematica.stackexchange.com/q/13656/121) to keep all relevant answers in one place.  That question could be edited to be more general of necessary.  Do you agree?
Answer: Advise if this is best relegated to comment status.
There are server-based real-time analytics of life science experiments using the Wolfram Language provided by these guys http://emeraldcloudlab.com.
Note the Mathematica 9 logo in their materials, indicates webMathematica rather than a private Wolfram Cloud.
I'll agree that real-time acoustic analysis may be difficult in Mma at present. There are very interesting ~10fps image processing examples I'm aware of but can't provide details of, other than this is a friendly upper limit to aim for.
Disclaimer: no connections to emeraldcloud.com
Answer: You can do this now. If you provide AudioStream a function from a list of times (in seconds) to a list of audio samples, it will call that function repeatedly and pipe the result directly to your sound card.
This plays an infinite 300 Hz sine tone:
stream = AudioStream[t |-> Sin[300 2π t]]
AudioPlay[stream];

The AudioStream reference page has several examples of real-time interactivity using Dynamic[], including buttons to start and stop the audio stream, and real-time spectrum analyzers.

Realtime audio processing using Dynamic


How to pass a function as a parameter in Java?

Question: In Java, how can one pass a function as an argument to another function?
Comment: http://stackoverflow.com/questions/4685435/what-is-the-cloest-thing-to-a-function-pointer-in-java
Comment: you can pass an Object which you have defined some method you want to use as parameter
Comment: Define Consumer, Supplier, Predicate or Function as type of argument in another function, e.g. `Function func`, and pass your function like `this::foo`, and then use it like: `func.apply(param)`
Comment: More answers on how to use a Lambda function, or pass it as a parameter: [simple example parameter as a function java](https://stackoverflow.com/a/53219950/7747942).
Answer: Java 8 and above
Using Java 8+ lambda expressions, if you have a class or interface with only a single abstract method (sometimes called a SAM type), for example:
public interface MyInterface {
    String doSomething(int param1, String param2);
}

then anywhere where MyInterface is used, you can substitute a lambda expression:
class MyClass {
    public MyInterface myInterface = (p1, p2) -> { return p2 + p1; };
}

For example, you can create a new thread very quickly:
new Thread(() -> someMethod()).start();

And use the method reference syntax to make it even cleaner:
new Thread(this::someMethod).start();

Without lambda expressions, these last two examples would look like:
new Thread(new Runnable() { someMethod(); }).start();

Before Java 8
A common pattern would be to 'wrap' it within an interface, like Callable, for example, then you pass in a Callable:
public T myMethod(Callable<T> func) {
    return func.call();
}

This pattern is known as the Command Pattern.
Keep in mind you would be best off creating an interface for your particular usage. If you chose to go with callable, then you'd replace T above with whatever type of return value you expect, such as String.
In response to your comment below you could say:
public int methodToPass() {
        // do something
}

public void dansMethod(int i, Callable<Integer> myFunc) {
       // do something
}

then call it, perhaps using an anonymous inner class:
dansMethod(100, new Callable<Integer>() {
   public Integer call() {
        return methodToPass();
   }
});

Keep in mind this is not a 'trick'. It's just java's basic conceptual equivalent to function pointers.
Comment: So for the 100+ methods I need to do this for, I need 100+ interfaces. ggreatttttt =/
Comment: I would need a much more simpler solution. Can anyone help?
Comment: @XAleXOwnZX you could use a single Callable<> interface, but you would need to create 100+ anonymous inner classes of type Callable<>. Of course, you can now use Java 8 lambda expressions to simplify this, which was not available when I wrote this response.
Comment: @TomeeNS - here is a simple example, where foo() is the function passed as a parameter, and demo() is the function that takes a function as a parameter.

    void demo(final Callable func){ func.call(); }

    void foo(){ return null; }

    demo(new Callable() {public Void call() {return foo();}}
Comment: Would you be able to show what exactly would be passed into the following:

public void DansMethod(int i, ){
}
Comment: Is it possible to create a base AsyncTask class and pass your desire method in it. can we create this scenario .. kindly elaborate..
Comment: It is a trick, it's just an idiomatic trick. :) Java doesn't consider methods or functions to be first-class objects.
Comment: @videogameboy76 translating your example to the answer given here: how do you actually call `myFunc` in `dansMethod`? `Callable` appears to be defined in `java.util.concurrent.Callable` as an interface, but only defines a `call` function which takes no parameters... how do you pass the parameters?
Comment: @jk. Lets say `MethodToPass` relied on a value belonging to it's class, and that it was passed to a function/class in another object. If the value it relied on changed somehow, would `MethodToPass` reflect this inside of the function/class it got passed to? If not, how could one achieve this functionality?
Comment: Does passing from a runnable not work?
Answer: You could use Java reflection to do this.  The method would be represented as an instance of java.lang.reflect.Method.
import java.lang.reflect.Method;

public class Demo {

    public static void main(String[] args) throws Exception{
        Class[] parameterTypes = new Class[1];
        parameterTypes[0] = String.class;
        Method method1 = Demo.class.getMethod("method1", parameterTypes);

        Demo demo = new Demo();
        demo.method2(demo, method1, "Hello World");
    }

    public void method1(String message) {
        System.out.println(message);
    }

    public void method2(Object object, Method method, String message) throws Exception {
        Object[] parameters = new Object[1];
        parameters[0] = message;
        method.invoke(object, parameters);
    }

}

Comment: @Tim Bender: or inside the "mirror" perhaps?
Comment: Ah Java idiosynchrasies... What would we do without them?
Comment: What if your function has no parameters and returns nothing?
Comment: @AloneInTheDark: If you look at [the documentation](https://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html#invoke(java.lang.Object,%20java.lang.Object...)) you'll notice that the arguments to `invoke` are optional. Also, `void` methods return `null`.  __P.S. And for your particular case: [suggested reading](https://en.wikipedia.org/wiki/Loneliness#Treatments_and_prevention).
Answer: Lambda Expressions
To add on to jk.'s excellent answer, you can now pass a method more easily using Lambda Expressions (in Java 8). First, some background. A functional interface is an interface that has one and only one abstract method, although it can contain any number of default methods (new in Java 8) and static methods. A lambda expression can quickly implement the abstract method, without all the unnecessary syntax needed if you don't use a lambda expression.
Without lambda expressions:
obj.aMethod(new AFunctionalInterface() {
    @Override
    public boolean anotherMethod(int i)
    {
        return i == 982
    }
});

With lambda expressions:
obj.aMethod(i -> i == 982);

Here is an excerpt from the Java tutorial on Lambda Expressions:

Syntax of Lambda Expressions
A lambda expression consists of the following:

A comma-separated list of formal parameters enclosed in parentheses. The CheckPerson.test method contains one parameter, p,
  which represents an instance of the Person class.Note: You
  can omit the data type of the parameters in a lambda expression. In
  addition, you can omit the parentheses if there is only one parameter.
  For example, the following lambda expression is also valid:
p -> p.getGender() == Person.Sex.MALE
    && p.getAge() >= 18
    && p.getAge() <= 25

The arrow token, ->
A body, which consists of a single expression or a statement block. This example uses the following expression:
p.getGender() == Person.Sex.MALE
    && p.getAge() >= 18
    && p.getAge() <= 25

If you specify a single expression, then the Java runtime evaluates the expression and then returns its value. Alternatively,
  you can use a return statement:
p -> {
    return p.getGender() == Person.Sex.MALE
        && p.getAge() >= 18
        && p.getAge() <= 25;
}

A return statement is not an expression; in a lambda expression, you must enclose statements in braces ({}). However, you do not have
  to enclose a void method invocation in braces. For example, the
  following is a valid lambda expression:
email -> System.out.println(email)

Note that a lambda expression looks a lot like a method declaration;
  you can consider lambda expressions as anonymous methods—methods
  without a name.

Here is how you can "pass a method" using a lambda expression:
Note: this uses a new standard functional interface, java.util.function.IntConsumer.
class A {
    public static void methodToPass(int i) {
        // do stuff
    }
}

import java.util.function.IntConsumer;

class B {
    public void dansMethod(int i, IntConsumer aMethod) {
        /* you can now call the passed method by saying aMethod.accept(i), and it
        will be the equivalent of saying A.methodToPass(i) */
    }
}

class C {
    B b = new B();

    public C() {
        b.dansMethod(100, j -> A.methodToPass(j));   //Lambda Expression here
    }
}

The above example can be shortened even more using the :: operator.
public C() {
    b.dansMethod(100, A::methodToPass);
}

Comment: "A functional interface is an interface that has one and only one abstract method, although it can contain any number of default methods (new in Java 8) and static methods" what are you saying, that in Java 8 we now can have static methods in interfaces?
Comment: @Celeritas Yes, I explained it in detail [here](http://stackoverflow.com/a/22714153/2846923).
Comment: `j` is an integer?
Comment: @rupinderjeet47 Yes. In class `A`, `methodToPass()` take an `int` as it's argument.
Answer: Thanks to Java 8 you don't need to do the steps below to pass a function to a method, that's what lambdas are for, see Oracle's Lambda Expression tutorial. The rest of this post describes what we used to have to do in the bad old days in order to implement this functionality.
Typically you declare your method as taking some interface with a single method, then you pass in an object that implements that interface. An example is in commons-collections, where you have interfaces for Closure, Transformer, and Predicate, and methods that you pass implementations of those into. Guava is the new improved commons-collections, you can find equivalent interfaces there.
So for instance, commons-collections has org.apache.commons.collections.CollectionUtils, which has lots of static methods that take objects passed in, to pick one at random, there's one called exists with this signature:
static boolean exists(java.util.Collection collection, Predicate predicate)

It takes an object that implements the interface Predicate, which means it has to have a method on it that takes some Object and returns a boolean.
So I can call it like this:
CollectionUtils.exists(someCollection, new Predicate() {
    public boolean evaluate(Object object) {
        return ("a".equals(object.toString());
    }
});

and it returns true or false depending on whether someCollection contains an object that the predicate returns true for.
Anyway, this is just an example, and commons-collections is outdated. I just forget the equivalent in Guava.
Comment: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Function.html is Guava's generic single method interface.
Comment: Mooched a solution with the java 14 java.util.function.Function interface from your answer :)
Answer: Java supports closures just fine. It just doesn't support functions, so the syntax you're used to for closures is much more awkward and bulky: you have to wrap everything up in a class with a method. For example,
public Runnable foo(final int x) {
  return new Runnable() {
    public void run() {
      System.out.println(x);
    }
  };
}

Will return a Runnable object whose run() method "closes over" the x passed in, just like in any language that supports first-class functions and closures.
Answer: I used the command pattern that @jk. mentioned, adding a return type:
public interface Callable {

    public O call(I input);
}

Comment: Similar to JavaFx [Callback](https://docs.oracle.com/javase/8/javafx/api/javafx/util/Callback.html)
Answer: I know this is a rather old post but I have another slightly simpler solution.
You could create another class within and make it abstract. Next make an Abstract method name it whatever you like. In the original class make a method that takes the new class as a parameter, in this method call the abstract method. It will look something like this.
public class Demo {

    public Demo(/.../){

    }

    public void view(Action a){
        a.preform();
    }

    /**
     * The Action Class is for making the Demo
     * View Custom Code
     */
    public abstract class Action {

        public Action(/.../){

        }

        abstract void preform();
    }
}

Now you can do something like this to call a method from within the class.
/...
Demo d = new Demo;
Action a = new Action() {

    @Override
    void preform() {
        //Custom Method Code Goes Here
    }
};

/.../
d.view(a)

Like I said I know its old but this way I think is a little easier. Hope it helps.
Comment: Callable works fine for that situation, or simply using Runnable. It is more common to use an interface, even if you made a custom one, as it provides a more flexible hierarchy.
Comment: Your solution does not provide an easier method. Using an already existing interface to perform this task is more intuitive than creating your own custom abstract class. While there is nothing wrong with your solution, and it does provide an alternative, I don't see the value or reason for using this approach over an interface.
Comment: From what I saw on the Interface examples it only lets you use return values. This is more oriented for if you wanted a void result. In certain cases this alternate could have some beneficial uses.
Answer: Java does not (yet) support closures. But there are other languages like Scala and Groovy which run in the JVM and do support closures.
Comment: Java has supported [closures](http://en.wikipedia.org/wiki/Closure_%28computer_science%29) since version 1.0. You're probably talking about lambda expressions or at least functions defined without being syntactically contained in an explicit class definition.


Use serverless-iam-roles-per-function plugin with provider level iamRoleStatements

Question: Is it possible to use both of these methods when defining a serverless file? I want to use serverless-iam-roles-per-function because I was running into Maximum policy size error from serverless framework
But rather than having an IAM role per function for all of my functions I want to do it for a few, the rest I would like them to use one role until the policy size is reached. I tried defining a role to a few functions and the rest of the functions I left blank so that it would use the iamRoleStatements defined at the provider level. The problem was that the few functions that I gave roles to are still included in the global role so I still reach the maximum-policy-size.
Is there a way to exclude a few functions from the global iamRoleStatements and only apply the functions to the roles defined by serverless-iam-roles-per-function?
Thanks in advance.
Answer: "if iamRoleStatements are not defined at the function level default behavior is maintained and the function will receive the global IAM role. " is what it reads here https://www.serverless.com/plugins/serverless-iam-roles-per-function


What is the modern day equivalent of Firesheep?

Question: Firesheep came out on the scene in 2010 and rocked the world... and never made it to version 1.0. Mozilla has since released 15 major versions of Firefox and is incompatible with the extension. Is there a version that works with the latest Firefox or is one the 1000 forks on GitHub considered the successor to Firesheep?
Comment: @oliver. Firesheep was a way to really easily (as in point and click) hijack other peoples website sessions on things like facebook because the websites only ssl encrypted the login phase. It made alot of noise in the news due to people using it on public wifi hotspots. Many sites have since either began using ssl for everything by default or by a user-set option.
Comment: @Sirex is correct.  And StackExchange, sadly, is not yet one of those sites that have switched to full SSL.
Comment: What is Firesheep?
Comment: bear in mind a lot of the security holes firesheep exposed on popular sites have since been closed.
Comment: The modern equivalent is to use HTTPS in the first place. Other than that you'll not need Firesheep for using Firefox...
Answer: Cookie Cadger, being developed by a colleague of mine.  Terrifying Java app that steals cookies from a large number of apps:
http://igniteshow.com/videos/cookie-monster-unnoticed-threat-open-wi-fi
Edit: Available now at https://www.cookiecadger.com/
Comment: I would guess that making this a Java app in the current context makes it even easier to steal information.
Answer: To my understanding, all that Firesheep did was sniff out unsecured packets and pulled the information from there. Unfortunately there isn't a replacement extension (to my knowledge), but there are other options.
Wireshark does exactly this. I'm not as well versed in it's proper usage as I'd like to be, but there are many guides out there that can help you utilize it's functionality.
Answer: There is also DroidSheep for Android (requires root). The source is also available.
Comment: driodsheep is used to get the password of a wpa wpa2 wifi connection not to get passwords for website log-ins i'm sure some of the base code could be used to make an adaptation to firesheep if someone was feeling froggie though
Comment: @tinkeringgnome: What are you talking about? Neither Firesheep nor Droidsheep get WPA Wi-Fi passwords. They "just" intercept cookies from HTTP connections.


Where is the string that generates the hash with 18-20 zeroes?

Question: When bitcoin miners mine, they have to solve a difficult and extremely repetitive math problem using the SHA256 algorithm. The miners are trying (basically playing lottery and almost always working in large groups) to get a hash with (currently) at least ~18.81 zeroes. (I put a decimal/float number because the value is inconsistent.) But, I want to put the hash into a hash function and get that super hard-to-compute number for a story I have where a superhero calculates this number. How do I get this string (nonce) that calculates to this zeroed hash and where do I find this on a block explorer, such as blockchain.com, or on bitcoin-cli?
Comment: Bitcoin PoW uses _double_ SHA256, sometimes written SHA256d. See https://en.bitcoin.it/wiki/Block_hashing_algorithm for the format of the block header an example. Note this data is binary (aka bits) and 'string' is usually used in computing for characters, so if you are using a program or API designed to hash 'strings' it may not work for bitcoin, although some languages like C++ and python2 do support arbitrary binary strings.
Comment: Sorry, I'm not secure to undestend the your question, you want have a method for calculate the nonce and you want find the nonce on the explorer, right?
Comment: Yeah. That's what I wanted to do. The nonce has already been computed.
Comment: That's true, I did some research and found that you can get the info as the block heading/header
Answer: To calculate the PoW hash, all the data of the header of the block is concatenated. The nonce is also concatenated within that data.
Then, that concatenated data is put through the SHA256 algorithm and the result is compared to the current target. The resulting hash needs to be smaller than the target to be valid.
So, it's not about how many zeros it has, but if it's smaller than the target.
Seeing it in terms of zeros could help to understand it, but that is miss leading. There could be 1 hash that has exactly the same number of zeros as the target and still not be valid, because it may not be smaller than the target.
For example, let's assume that the target is:
00000000000000000004f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
And our SHA256 hash is:
00000000000000000005f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
It would not be a valid PoW hash because it's not smaller than the target. They both have the same amount of zeros, but our hash is greater than the target.
Both together:
00000000000000000004f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6 00000000000000000005f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
If we keep changing a bit the data, by increasing the nonce by 1 and then concatenating it again with the data of the block header, and pass it through the SHA256 alright again and again, eventually we will get a hash that is smaller than the target.
For example:
Target:
00000000000000000004f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
Our hash:
00000000000000000003f34860a8c59d52c4472ec3798c16f394a699f5e6d8b6
As you can see, our hash now is smaller than the target and is a valid PoW hash for our block.
The hash of the block header data could even be way smaller than the target, and it's valid. It can have more zeros, but finding a hash like this is less probable in average:
00000000000000000000000000a8c59d52c4472ec3798c16f394a699f5e6d8b6
To visualize it better, you can go to this site that has a simple blockchain implementation to visualize how a blockchain works: https://andersbrownworth.com/blockchain/blockchain
I've concatenated the data of the block 5 and passed it through a SHA256 function:
Concatenated data:
529742data0000ae8bbc96cf89c68be6e10a865cc47c6c48a9ebec3c6cad729646cefaef83
SHA256 hash of that data:
0000d73c6ecf38aa53a8fbace738ff59540fd5e519e6d9aa496f61ce70110a09
If we compare the hash of block 5 with this one, it's the same.
Answer: If I undestend the your question,
This is an example of the proof-of-work algorithm.
The nonce is a component of the block, the strucure of the block contain the value, inside the blockchain.com you can find the value inside the propiety "nonce"
I hope I answered your question


an two different bases be used when calculating the determinant of a linear map from V to V?

Question: I am trying to create a matrix for a linear map from V to V and calculate the determinant. This would be way easier if I could use two different bases on the horizontal and vertical directions, but I'm not sure if this is correct. Can I do this?
Comment: It depends. You're looking at a linear transformation $f:V\to V$. For *some* purposes you may use different bases in the domain and the codomain. Are you interested only in the zeroness/nonzeroness of the determinant? In this case, yes. If, on the other hand, you are interested in the specific nonzero numerical value of the determinant, the answer is no.
Answer: To choose a basis is to choose an isomorphism $\phi : V \to \Bbb R^n$. Then the matrix $M$ is the linear map defined by $M = \phi\circ f\circ \phi^{-1}$, and
$$\begin{align}\det M &= \det(\phi\circ f\circ \phi^{-1})\\
&=(\det \phi)(\det f)(\det \phi^{-1})\\
&=(\det f)(\det \phi)(\det \phi)^{-1}\\
&=\det f\end{align}$$
But suppose you use a different isomorphism $\psi$ for one of the conversions:
$$\begin{align}\det M &= \det(\psi\circ f\circ \phi^{-1})\\
&=(\det \psi)(\det f)(\det \phi^{-1})\\
&=(\det f)(\det \psi)(\det \phi)^{-1}\end{align}$$
But there is no guarantee that $(\det \psi)(\det \phi)^{-1} = 1$. Both values are non-zero, since the maps are isomorphisms, but that is all we can say. Because they are non-zero, $\det M = 0 \iff \det f = 0$, but we cannot conclude that $\det M = \det f$.


Disable Tool Dialogs in GIMP

Question: I would like to know if there's a way to disable tool dialogs in GIMP like the one in the picture. I would rather use tools without it since it blocks the project I'm working on and there isn't a lot of room for me to move it.
Answer: I suggest other way:
The dialog is movable. It opens next time where you placed it. The dialog is your possiblity to input numeric values or to see what numeric value gives the right looking result.
If there's not enough room, do as I have done. Invest $15,- and get secondary display. I took mine from a second hand shop where $15,- gave 5 possible models to choose from. Of course it's not 40" 4k nor haven't calibrated wide gamut color range, but it shows all those dialogs or a reference document well enough.
Be sure you can test what you buy. I connected available units to electricity, watched the settings menu and tried how the controls work. An old laptop would have been useful, but my thinking didn't reach that long beforehand.
You have not to be especially lucky to get one for $2,- or even free. Many people have too much unnecessary stuff which they gladly change to a can of beer if you promise to never bring it back.
Answer: You can toggle the display of the toolbar and palettes with the tab key, but not the transform dialog. There's no way to prevent it displaying.
As for when there isn't enough room to make a transform, you could just zoom out of the image a bit so you can see the edges of the image, then use the Rotate tool.  If you have a mouse with a scroll wheel, you can zoom by holding down CTRL and scrolling it.

When there is a transform dialog in the way, you can move it out of the way by clicking and dragging it.

It's also possible to move the image out of the way.  If you press and hold Space Bar you can move the image over to one side.

Another possibility is to exit Single Window Mode, and then you can move the image window anywhere you want.

Disable Tool Dialogs in GIMP


What happens to public shares if a company is bought out?

Question: What happens to stocks you purchased if the company is taken over and made private? Take, for example, Twitter. I read from the news "Musk will pay $54.20 a share for Twitter". But currently the price for Twitter is sitting at $52. Doesn't this guarantee a gain of $2.20 per share? If so, why aren't investors buying in?
Comment: Does this answer your question? [When the market price for a stock is below a tender offer's price, is it free money (riskless) to buy shares & tender them?](https://money.stackexchange.com/questions/30090/when-the-market-price-for-a-stock-is-below-a-tender-offers-price-is-it-free-mo)
Comment: Also related: [Could the stock price of the target firm fall when a buyout is announced?](https://money.stackexchange.com/q/131651/34875), [Why do stocks gap up after a buyout is announced?](https://money.stackexchange.com/q/70837/34875), [Can a buyout announcement cause a short squeeze above the announced takeover price?](https://money.stackexchange.com/q/86871/34875), [How to interpret option trades in a stock pending buyout](https://money.stackexchange.com/q/129866/34875)
Comment: In general: https://money.stackexchange.com/search?q=buyout
Comment: With $54.20 being a hard threshold, the price won't rise above that (why buy a share for $55 if you know you're only getting $54.20 back?). And if the share price *does* hit $54.20, it can still go down if someone decides to get out early (because they think the deal will fall through) and they can only find buyers willing to pay less than $54.20. Remember, quoted prices are just the last sale executed, not a definitive statement of value.
Comment: @chepner If the price shot up to $100 and Twitter went through with going private at $54.20, the SEC would start knocking at their door rather quickly.
Answer: If the company is bought out, all the public shares are acquired. At some point remaining shareholders are compelled to sell. This is known as a squeeze out and leads to the new owner owning 100% of shares.
You can gain $2.20 on Twitter shares if the sale actually goes ahead. There is some chance it doesn't, e.g.:

Musk changes his mind about the acquisition (this would trigger more clauses in the agreement).
The SEC (aka the law/regulators) blocks the deal.
Shareholders vote against selling. Right now Musk doesn't own the requisite 50% to force a squeeze out; if the remaining shareholders are against selling they could stop the acquisition.

Etc.
If you believe these things won't happen then yes, it's $2.20 profit. But if they do, TWTR is likely to crash, and you'll suffer a loss. Ultimately, it's your risk to take.
Edit: Musk says $44 billion Twitter deal on hold over fake account data illustrates the danger of speculating on this. TWTR dropped 20% in the wake of that announcement, although it later regained some ground when Musk said he's still committed to the deal. TWTR is still well below the proposed takeover price though, indicating that the market considers the proposed takeover less likely than it did in April. As mentioned above, ultimately it's your risk to take.
Answer:
But currently the price for Twitter is sitting at $52. Doesn't this
guarantee a gain of $2.20 per share? If so, why aren't investors
buying in?

Even if the sale ultimately happens, it can take weeks, months, or even years.
Not all announced deals happen. Some are stopped by the company being bought. Some have the financing fall apart. Others are stopped by the national governments involved.
Sometimes the announced deal doesn't happen because another company/investor bids a higher amount.
People who own shares now have to decide if they want to wait or sell. Those who don't own have to decide if they want to buy and hope the deal takes place, or an even better one comes along.

What happens to stocks you purchased if the company is taken over and
made private?

There will be a processes that has to be followed for the board/shareholders to approve the deal. If that happens then all the shares will be purchased at the specified time schedule. Mutual funds will also have to sell their shares. Shares owned in taxable and retirement accounts will also be sold.
Once that happens it will no longer be listed on any stock exchange, and will disappear from all indexes.
By being made private the number of remaining shareholders will be very small. It can be more than one. Once they are private the need to report profits and losses to the public disappears.
Answer: After both firms surrender their current shares, the new company created as a result of the M&A will issue new shares. The shares of the acquiring company are unaffected in the event of an acquisition. When a firm is acquired, its stock is no longer traded on the market.


What is the immigration process when leaving the Philippines?

Question: I am a first time traveler and I've been refused boarding on a flight to India due to lack of needed documents. Now I have the documents from my sponsor in India. He bought me a ticket on MakeMyTrip. From the Philippines, I will go via Singapore to fly to India. What is the process? Will Philippines Immigration ask me lot of questions?
Comment: Boyfriend you've never met = that is not normal. Real people do not do that. Real people want to *meet* their partners, and do *other things* with their partners, heh heh.  If he's the wealthier one, **he'd have come to you already**.  SCAM. This guy probably has 50 "girlfriends" on the dangle, and keeps paperwork on each one so he doesn't mix up your details. Most likely, what awaits you is "being trafficked", for a girl, unimaginable horror.
Answer: First, you must be sure that your sponsor is legitimate. The Philippine government put that process in place because a lot of pinoys have been tricked into slavery or prostitution in foreign countries by sponsors who appear to be trustworthy.
If your sponsor is someone you know well and who has visited you in Philippines, then you should know enough about them and about your trip to be able to answer questions that immigration staff ask you. Even then, there is a risk that this is a scam.
Allow plenty of time at the airport so you don't miss your flight.
Comment: Sorry but that sounds like a scam. There are people who put a lot of work into being convincing boyfriends but really just plan to exploit you. The reason I think it's a scam is that if he can't find a few days to visit you in the Philippines when you've been together _3 years_ then telling you he's busy with work is just an excuse.
Comment: @MariedithEstrada Those documents do prove your bf's existence, but not scam vs genuine relationship. Even if he is busy, you should be important enough for him to make the time to visit you on your home ground, where you have family and/or friends. That would be much safer for you, especially if you have no experience of international travel.
Comment: Also, during a visit in the Philippines you could generate documentation, such as photos of you and your bf together, that would help with the exit interview.
Comment: thank you for your response, My sponsor is my BF we are in relationship for 3 years and we haven't meet yet since he is so busy at work. However he send me a notarize invitation letter, Indian ID , Passport bank statements. All is stamped by their Govt. Would this be enough documents to convince immigration and less chance for me to be offloaded again?.


How to edit pdf in SharePoint online or PDF annotation in SharePoint Online

Question: I want to edit PDF file in SharePoint online document library. I have uploaded PDF in document library and also edit fie and save in same location(Document Library).
Comment: Please, specify the use case you want to know more about. I mean, if you have a PDF file in a document library what's the next action? Do you want to open and edit it in the browser? Do you want to open it in the desktop app and save it automatically after all changes have been done? I think several ways can apply and different solutions can be told.
Comment: @jaloplo  : Yes next action will be like, once i upload PDF file in document library then i want to edit file and save in same library. it would be good if i can add text,remove text,high light text in PDF file.
Comment: @jaloplo
 Flow -->  Once i upload PDF file in doc library then file will go for approval, in this case if approver can add text for high lighting some text part. it is like PDF annotation.
Comment: Did you check to use a different format (Microsoft native format) like Microsoft Word for doing this kind of things? If you want to finally have a PDF file you can do it by using 3rd party applications like Nintex Workflow or Nintex Forms. Did you check them?
Comment: Yes i want to go with PDF only and i did not check with Nintex.
Answer: Now we can edit the pdf files from SharePoint online with the recent integration of Adobe PDF cloud with Office 365. You need to deploy the Adobe PDF cloud integration with Office 365 plugin into your office 365 tenant.
For details implementation refer to the below article :
SharePoint Online – O365: How to Edit PDF File in SharePoint Online library


Custom search for entire site collection in sharepoint

Question: I want to create custom search using c# for share point site collection. In that
site collection I have some document libraries are there. It is like keyword based search. I want to search based on the keywords. It's like a OOTB search but I want custom code using C#
Plz help me.
Comment: Why don't you want to use the OOTB search?
Comment: I have asp.net application. From that application i uploaded some documents to share point server. The documents will be saved in to the share point server. From share point site we can use OOTB search. But here i want to use search from asp.net application.
Answer: There is a pretty solid MSDN article with C# examples of using the search API:
Using the SharePoint search Query APIs


Need help with Euclidean Algorithm in $\mathbb{Z}[i]$

Question: I'm trying to find the GCD of $(85,1+13i)$ and $(47-13i,53+56i)$. I've tried, but to no avail. I keep setting it up and trying to do it with the same mindset as if i'm doing polynomial division, is this incorrect? I believe I need to do "synthetic division", is that correct? Yeah, if somebody could help me out that'd be great
Comment: To use the Euclidean Algorithm to find $\gcd(a,b)$ in $\mathbb Z[i]$, assuming $|a| > |b|$, what you need to do is to divide $a$ by $b$, get the quotient $a = qb$, where $q \in \mathbb Q[i]$. Then you need to round $q$ to the nearest $q' \in \mathbb Z[i]$ and get the residue.
Comment: Yes. The main ingredient is that you need to get $a = q'b + r$ where $|r| < |b|$. It is not hard to see that the $q', r$ obtained this way satisfy our needs.
Comment: Okay, so the process is indeed a little different than doing synthetic division in $\mathbb{R}[i]$ or polynomial long division in that you get a quotient in $\mathbb{Q}$ and then round it to get a remainder?
Comment: So I divided $85$ by $1+13i$ and got $85 - (1105/(1+13i))$ and now $(1105/(1+13i))$ = $(221/34) - (2873/34)i$.. where these rational numbers are $6.5$ and $8.5$, so I should round them up to $7$ and $9$ and get negative remainders? Or should I round them down?
Comment: Whichever is fine, as long as the remainder you get is less than the original numbers.
Answer: $$
\frac{85}{1+13i} = \frac{85}{1+13i} \frac{1-13i}{1-13i}\\
= \frac{85 - 85*13 i}{1+169} = \frac{85}{170} + \frac{-1105}{170}\\
= (0 - 7 i) + (\frac{85}{170} + \frac{1}{2}i)\\
(1+13i)(-7i) = 91-7i\\
85 - (91 - 7i) = -6 + 7i\\
GCD(85,1+13i) = GCD(85-(1+13i)(-7i),1+13i)\\
=GCD(-6+7i,1+13i)
$$
Keep going like this. I suggest writing a script to do this automatically as part of the exercise.
Comment: editing in progress sorry
$$
\frac{85}{1+13i}
= (0 - 7 i) + (\frac{85}{170} + \frac{1}{2}i)\\
$$

I get what you did to get this far, and then after this you wrote:

$$
(1+13i)(-7i) = 91-7i\\
85 - (91 - 7i) = -6 + 7i\\
(85,1+13i) = (-6+7i,1+13i)
$$

Do you also need to multiply $(1+13i)$ by $(\frac{85}{170} + \frac{1}{2}i)$? I'm a bit confused what you did from there


NAT + load sharing

Question:
I would like to do NAT while load sharing is active on R1 and R2 (cisco routers).
Do you have any ideas how should I do it effectively?
Is there some way to share a common NAT table between the 2 routers?
Comment: NAT cannot handle asymmetric routing. You will need to make sure that any flow only uses one of the routers, not both. A NAT table is not shared between the routers.
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
Answer: In that scenario, the load-balancing decision needs to be done before branching to either router - within the core switch or between R1/R2 and the core switch. Also, there's no way to share a NAT table between routers, especially when their public IPs differ.
A more viable scenario is to connect both WAN links to each router and run the routers in a fail-over setup (e.g. VRRP or HSRP). Then you can load balance the L4 sessions based on source IP (range), destination IP (range), protocol, current link load, ... - depending on the router capabilities.
Load balancing within each L4 session isn't possible.
Answer: Ether channel will solve your problem.
Following load balancing options are available in a switch.

dst-ip—     Load sharing is based on the destination-host IP
address.
dst-mac—    based on the destination-host MAC
address of the incoming packet.
src-dst-ip— based on the source-and-destination
host-IP address.
src-dst-mac—based on the source-and-destination
host-MAC address.
src-ip—     based on the source-host IP address.
src-mac—    is based on the source-MAC address of
the incoming packet.
Additionally you can try with FHRP protocols as well

NAT + load sharing


Moderators to delete duplicate questions

Question: A moderator or trusted user should be given right to straight away delete duplicate questions with answers that won't change over time, as they would already have enough experience to understand which questions differ from each other. The user can then be given option to edit the question or remove it if he thinks its duplicate too.
Comment: Why is it so important that duplicates be deleted immediately (or at all, for that matter)? We believe that duplicates server a useful role in that different searches will find different questions - having a link to the duplicate is a good thing.
Comment: See [Dr. Strangedupe: Or, How I Learned to Stop Worrying And Love Duplication](http://blog.stackoverflow.com/2010/11/dr-strangedupe-or-how-i-learned-to-stop-worrying-and-love-duplication/)
Comment: @prince Can you provide some examples? I'm not really understanding what you're trying to say in your latest comment.
Comment: duplicate as in same question with a change in the terms used and similar things. Duplicate doesnt mean question on the same topic.
Answer: Moderators already have the ability to do this as well as merge duplicate questions, although it is never really necessary. Trusted users should not have this ability, usually duplicate questions serve as signposts which direct users to a canonical answer. We shouldn't be promoting their deletion by suddenly allowing trusted users to delete them.
Also keep in mind that sometimes people answer duplicate questions many years after the original with more up to date code, which we have to account for.


What's the point in modelling the base mesh?

Question: On a thread, I saw someone mentioning that sculpting leads to triangle faces which I myself saw happened to me lately but I find myself sculpting for the final touches even after modelling it 60 percent. Is there a point in modelling at all if I can just sculpt the entire thing from start to get the same result (I really don't wanna model the entire ting from start to final product) ?
Answer: This is my personal view, based on my own experience, so some others may see things differently: Sculpting from scratch is possible, but works best with purely organic forms which don't have a lot of lengthy or technical structural features. If they do have these, then it can be expedient, I believe, to begin with a modeling process instead of a sculpting process. You can use both processes, of course, and alternate between them. It can sometimes be efficient to begin with a modeling process and move over to a sculpting one, once the overall structure is in place, and you now want to create finer details. You can also get a lot of good use out of booleans when sculpting because the resulting topology issues aren't yet a concern. Also, bear in mind that sculpting only leads to triangle faces when Dyntopo is enabled. If disabled, sculpting brushes only push vertices around, but don't actually change the topology, which is one possible approach that might be more compatible with a workflow that switches back and forth between modeling and sculpting. So don't discount the use of both methods. I would never want to suggest that one of these methods is always preferable to the other.
Comment: I see. I was modelling a female character and stuff like joints looked better when I sculpted them in instead of making cuts with knife but the tutorials kept using the knife cuts instead of just sculpting them in so I thought there was a un-written rule followed there
Comment: Yeah, I think maybe what was going on there, if I had to guess, is that the author of the tutorial was focusing on creating a low-poly base mesh, which would later either control or be converted to a higher resolution mesh. In this case, it might make sense to use the cuts, since the poly count remains currently at a minimum.
Comment: One thing I didn't make clear about the possible advantages of beginning with  a modeling process over a sculpting one, even on an organic character, is the "sense of proportion" problem. This is more an artistic consideration than a technical one, but sometimes it's easier to start with modeling because it gives your whole subject a sense of proportion that you can then reference as you continue to develop it. This is harder to gauge when you start sculpting right off the bat. Or, at least, it takes more time to finalize the base shape without the aid of modeling tools.


Flying to Scotland from the US, where do we check in?

Question: We're flying to Scotland, from ATL to JFK and then on to GLA. Where do we check in for international flights? Is it ATL where we check in, or in JFK for our connecting flight?
Comment: Welcome to TSE. Did you book two separate flights, or is this all on a single ticket? Which airlines are operating each segment?
Answer: If you booked both flights on the same ticket, you'll normally do all your checking in at the first airport.
If you booked the flights separately, then you will normally check in twice, once for each flight.  For the second flight, the airline won't pay attention to how you're arriving at the airport, whether by plane, train, taxi, on foot, or otherwise.  All they care about is that you're there on time.
Your question is a little puzzling because checking in for an international flight is not much different from checking in for a domestic flight.  The only difference is that the airline will verify that you have adequate documents to pass through the immigration checkpoint at your destination.  For a US citizen going to Scotland, this means that they will check that your passport is valid.
Even if you check in for both legs at the first airport, you might still have to show your passport again at the second airport.  Sometimes there's a detailed immigration document check at the gate before you board; sometimes they just verify that your passport and boarding pass match when when you present the boarding pass to get on the plane.


Is it possible to have your Outlook agenda show the days your are in the office?

Question: I work full time, with regular office days from Monday - Friday (that's my workweek, also in Outlook). 2 days a week I'm in the office, the rest of the week I work from home. Using the scheduling assistent in Outlook, people can see if I'm available for a meeting (an empty timeslot) or if I already have meeting planned (a blue block in my agenda, they cannot see the title etc of a meeting). Is it possible to have my agenda show from where I will be working any specific day so people can schedule a face2face meeting in the office on the days I will be in the office, without having to ask me when that is?
Comment: If the issue has been resolved, please mark the helpful replies as answers.
Answer: Outlook calendar have an option called "work elsewhere", you could set your calendar availability status to "Working Elsewhere" on the dates they are working off-campus. This provides insight when scheduling meetings to ensure the proper meeting format is available.

Open the Outlook desktop application.
Select the Calendar icon from the bottom left corner of the screen.
Select New Appointment from the options ribbon at the top of the calendar screen.
Enter a Subject (optional) such as "Working Remotely".
Enter the Date (select all day) or Date and Time for when you will be working remotely.
Select Working Elsewhere from the Show As drop-down in the Outlook Ribbon.
Select Save & Close.


Does compost replace fertilizer?

Question: I make compost in my backyard.  I also buy fertilizers for vegetable and fruit plants from the big box stores.  My question is really when to use compost vs. fertilizer?  Can I eliminate the use of fertilizers if I have enough compost or do I have to continue to use the combination. If the latter, when do I use each of these?  Interested in practical suggestions based on what other's are doing.
Comment: This was an excellent question.  Not sure if it has been answered though.  Is this normal?
Answer: No, you can not replace 'fertilizer' with compost.  You do have to consider the amount of necessary chemicals available and what chemicals your particular compost adds.  Fertilizing includes not only the 3 biggies; Nitrogen, Phosphorus and Potassium but at least a dozen micro nutrients as well. Too much of just one of these chemicals in the soil can cause deficiencies as well as excess for plants.
Compost might have lots of nitrogen available but during the composting Nitrogen is used in high quantities.  There might be residual bits of all kinds of necessary chemicals the plants need but to think one can do one or the other is ABSOLUTELY NOT.
One of the best information sources I found and use an awful lot is Shane Smith's Green House Gardening.  Excellent charts, excellent break down of chemicals to include 'excessive' and well as deficiency symptoms of these chemicals.  Since we humans have to be in charge of replacing chemicals, water...we have to be able to SEE symptoms in the plant and do quite a bit of investigation.  No one thing will determine the next step.
We humans are learning ways to communicate with plants.  There are so many variables we all have to learn to be successful with plants; what plants or a plant needs, what your soil's composition contains, light, water, micro and macro organisms (and they need fed), climate, humidity and individual maintenance rules. Without basic knowledge of plants and there is an awful lot, to learn how to SEE what a plant is telling you...more Nitrogen or more Iron or more Molybdenum, Boron, Calcium, Magnesium etc. Or wait, there is plenty of Nitrogen but too little Iron, or there is too much of one chemical that inhibits another chemical.  Top it all off, pH of the soil is so very important to KNOW.  One can give their plants plenty of chemicals, in the correct proportions but if the pH is too alkaline or too acid for that particular plant, that plant will not be able to uptake Nitrogen for example. Far more complicated than people are hoping.
Decomposed organic matter or compost is important for soil texture and feeding the micro/macro organisms in the soil.  You have to know what is in that compost before augmenting with fertilizers.
The best method is being frugal with fertilizer and learning what your plant is telling you it needs by colors, textures, patterns. Shane Smith's book and there are others (another great book that has this information is Jorge Cervante's Cannabis Encyclopedia) to help you to understand what your plant is 'telling' you it needs.
Over fertilization is far worse than too little!  Once you've gone 'over the line' that plant will most likely die.  Too little the plant can live quite awhile until the human in charge can see what that plant is saying (screaming) it needs.
NO, compost is NOT a replacement for fertilizer.
Answer: No, but it could sensibly reduce or remove needs of fertilizers.
It is not very probable that the compost has the required exact proportion of fertilizer. It is also not so probable that one single fertilizer has the required proportions, but we have many different fertilizers, to choose..
It is possible not to use fertilizers, using compost, straw, hay (meadow, wetland) and different type of manures (cows, horses, chickens), and ev. also with ashes [all of these have different percent of fertilizers and minerals].  But this is complex to calculate, and the above ingredients have a lot of variance, so one should do soil analyses often, to correct deficiencies.  Not a thing to do for home garden (but instead it is ok for a large organic farm, where possibly they could analyse the composition of the ingredients).
Answer: I have never fertilised any of my vegetables or fruit trees apart from using compost and compost tea. I would challenge that you need to add fertiliser to your vegetable garden especially if you use crop rotation and plant diverse range of vegetables together as companions.
I use worm casting from my worm farm to brew my compost tea. Making compost tea: http://www.homecompostingmadeeasy.com/composttea.html
Example
https://youtu.be/mcry6iT6nvo
Comment: Well you are fertilizing your vegetable and fruit trees - you're giving them compost tea, which counts as a fertllizer - natural, homemade and a good thing, but still a fertilizer, which is different from simply improving the soil.
Comment: But otherwise, +1
Answer: Your home produced compost is a very valuable addition to soil, but it's not the same thing as a fertilizer. Fertilizers are prepared products with specific nutrients which are intended to feed plants directly - compost, and other humus rich materials, improve the soil in order to allow plants to seek out their own nutrients easily, which are more likely to be present because of the composted material. Adding humus rich materials to soil on a regular basis raises soil bio diversity, and that's a good thing - the more organisms per square foot of soil there are, the richer and more fertile the soil becomes, making a much healthier environment for growing plants. This is the approach used in organic growing, where the soil is of primary importance, rather than feeding plants directly with fertilizers, and is an approach which is worthwhile following as far as is possible.
I haven't used a fertilizer regularly on ornamental plants in gardens for ten years or more, with one exception - roses, which do get a specialist rose food twice a year, and in some years (if the winter's been very wet) a single topdressing of Growmore (NPK 7-7-7) in spring annually to the whole garden, topped off with organic mulch (usually composted animal manure), as growth begins. Applications of composted materials to the soil are made at least annually as an absolute minimum, to keep the soil in as good a condition as possible, preferably applied as a mulch, coupled with no digging as far as possible to preserve soil structure.
The same is not true of potted plants - they will need fertilizer applications.
As well, if you are growing your own vegetables, amendments may be necessary - to raise or lower ph a little, or to increase nitrogen or phosphate levels, depending on what you're growing.

Does compost replace fertilizer?


Connection between rational functions and matrices

Question: $$
y = \frac{ax+b}{cx+d} \Longleftrightarrow x = \frac{dy-b}{-cy+a}, ad-bc \ne 0
$$
on the other hand
$$
\left( \begin{array}{cc}
a & b  \\
c & d  \\
 \end{array} \right)^{-1} = \frac{1}{ad-bc}
\left( \begin{array}{cc}
d & -b  \\
-c & a  \\
 \end{array} \right), ad-bc \ne 0
$$
This looks amazing to me. Is there any meaning to this connection between rational functions and matrices? Can it be generalized for matrices of higher ranks?
Comment: $$\left( \begin{array}{cc}1&-y\end{array} \right)
\left( \begin{array}{cc}a&b\\c&d\end{array} \right)
\left( \begin{array}{c}x\\1\end{array} \right)
=
\left( \begin{array}{cc}1&-y\end{array} \right)
\left( \begin{array}{c}ax+b\\cx+d\end{array} \right)
=ax+b-cxy-dy.
$$
By setting this equal to zero you get the "rational equation" your question starts with.  But I don't see quite how to expand this to larger matrices or more variables, or how the inverse can apply.
Answer: Let's say that when $A$ is a $2\times 2$ matrix $\begin{pmatrix}a_{11}&a_{12}\\a_{21}&a_{22}\end{pmatrix}$ we will write  $M_A(x)$ for the rational function $$ \frac{a_{11}x + a_{12}}{a_{21}x + a_{22}}.$$  Then notice that $$M_F(M_G(x)) = M_{FG}(x).$$
That is, to compose two functions of this type, you multiply their matrices.
(You can see this by just writing out the expression  for $M_F(M_G(x))$ and simplifying it until it is in the form $\frac{ax+b}{cx+d}$, whereupon the coefficients $a,b,c,d$ will have the right values for $M_{FG}(x)$.)
This kind of correspondence:
$$\begin{array}{ccc}
2\times2\text{ matrices} & \implies &  \text{rational functions}  \\
\text{matrix multiplication} & \implies  & \text{function composition}
\end{array}$$
is called a homomorphism.  Group theory tells us that if there is a homomorphism from the group of $2\times 2$ matrices to the group of functions as there is here, then the two groups' identity elements and  inverses must also correspond.  In this case that means that the identity function $f(x) = x$ will correspond to the identity matrix $\begin{pmatrix}1&0\\0&1\end{pmatrix}$, and the inverse of a function $M_A(x)$ will be the function $M_{A^{-1}}(x)$, which is your observation.
I don't know if there is any corresponding homomorphism between rational functions and matrices of higher order; I suspect it would not be too hard to prove not.  (For one thing, the set of functions $x\mapsto \frac{ax+b}{cx+d}$ is closed under composition, but this is not true of higher-degree rational functions.)  It would suffice to rule out such a correspondence for $3\times 3$ matrices, since the $n\times n$ matrices for $n>3$ contain the $n=3$ matrices as a special case.  So all one needs to do is find some algebraic property of $3\times 3$ matrices that can't be reflected in the group of functions.
(The next paragraph is to give you some keywords to search for if you are interested in pursuing this in more detail.)
The rational functions $x\mapsto \frac{ax+b}{cx+d}$ are called Möbius transformations.  This relation between the Möbius transformations and the $2\times 2$ matrices is well known. The group of Möbius transformations has the curious name $PGL(2,K)$, where $K$ is $\Bbb R$ if you consider them to be functions of a real argument, and $\Bbb C$ if you consider them to be functions of a complex argument. (In general $K$ can be any system in  which the expression $\frac{ax+b}{cx+d}$ makes sense; such a system is called a field.)  The "$2$" here refers to the fact that the matrices are square matrices of rank 2.  The $PGL(2, K)$ groups are well-studied and $PGL(2, \Bbb C)$ in particular is of great importance in complex analysis and mathematical physics. Your question about the matrices of higher rank, put into the language of group theory, would seem to be about $PGL(n, \Bbb R)$ for $n≥3$.  I see that the Wikipedia article on the PGL groups  mentions the correspondence between $PGL(2, K)$ and the rational linear functions, and that the page on Möbius transformations mentions it also, but neither place mentions any analogous correspondence with higher-rank $PGL(n,K)$ groups, which suggests either that none is known, or that it only appears in a very abstract way.
Answer: Let me use MJD's notation: a $2 \times 2$ matrix $A = \left( \begin{matrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{matrix} \right)$ is associated with the Möbius transformation
$$ M_A(x) = \frac{a_{11} x + a_{12}}{a_{21} x + a_{22}}. $$
The connection between $A$ and $M_A$ indeed has a meaning, and you can actually use this connection to prove that $M_A \circ M_B = M_{A B}$. Yes, it's not hard to check that with a simple computation anyway.
Let me stick to matrix with coefficients in $\mathbb{C}$, but you can use $\mathbb{R}$ if you like. The connection between $A$ and $M_A$ comes from looking at the projective line $\mathbb{C}P^1$, which is defined as the quotient $\mathbb{C}^2 \setminus \{0\}$ where you identify proportional points, i.e. $(z,w)$ is identified with $(\lambda z, \lambda w)$ for any $\lambda \neq 0$. It's customary to use the notation $(z : w)$ for a point in $\mathbb{C}P^1$ corresponding to $(z,w) \in \mathbb{C}^2 \setminus \{ 0 \}$.
Points $(z : w)$ are almost in correspondence with points in $\mathbb{C}$, just by taking $z/w \in \mathbb{C}$ (notice that it's well defined, as $(\lambda z : \lambda w)$ would give the same result). The only exception is $(1 : 0)$, which we associate with infinity (whatever that means, but you can make sense of it if you like). In result $\mathbb{C}P^1$ corresponds to the complex plane $\mathbb{C}$ with an added point at infinity.
Now consider an invertible linear map $A \colon \mathbb{C}^2 \to \mathbb{C}^2$. Because it's linear, we have $A \cdot (\lambda \cdot v) = \lambda \cdot (A \cdot v)$, and thus $A$ gives rise to a function $M_A \colon \mathbb{C}P^1 \to \mathbb{C}P^1$. To see this, first consider the composition
$$
\mathbb{C}^2 \setminus \{ 0 \} \ni (z,w) \stackrel{A}{\longmapsto} (z',w') \longmapsto (z' : w') \in \mathbb{C}P^1
$$
and then notice that it always maps $(z,w)$ and $(\lambda z, \lambda w)$ to the same point in $\mathbb{C}P^1$, allowing us to define a function on $\mathbb{C}P^1$ instead of $\mathbb{C}^2$. Now the main point: the correspondence $A \mapsto M_A$ is a group homomorphism by the very definition.

OK, let me just connect this construction with the things you mentioned in your question. First, by choosing the standard basis, we can associate invertible linear maps $A \colon \mathbb{C}^2 \to \mathbb{C}^2$ with invertible $2 \times 2$ matrices. If we identify points in $\mathbb{C}P^1$ with points in $\mathbb{C}$ (with infinity added), then the composition above is
$$
(z,w) \stackrel{A}{\longmapsto} (a_{11}z+a_{12}w, a_{21}z+a_{22}w) \longmapsto (a_{11}z+a_{12}w : a_{21}z+a_{22}w) \cong \frac{a_{11}z+a_{12}w}{a_{21}z+a_{22}w} = \frac{a_{11}\frac{z}{w}+a_{12}}{a_{21}\frac{z}{w}+a_{22}}.
$$
If we remember that $(z:w) \in \mathbb{C}P^1$ corresponds to $z/w \in \mathbb{C}$, then the resulting function $M_A$ is just
$$
u \stackrel{M_A}{\longmapsto} \frac{a_{11}u+a_{12}}{a_{21}u+a_{22}},
$$
the Möbius transformation we know and love.

PS. You can use the same construction in $\mathbb{C}^n \setminus \{ 0 \}$, which results in the projective space $\mathbb{C}P^{n-1}$, but its points no longer correspond to numbers. Here, $\mathbb{C}P^1$ is topologically a sphere (called the Riemann sphere), whereas $\mathbb{R}P^1$ is the real line $\mathbb{R}$ with infinity attached, so topologically a circle. The projective plane $\mathbb{R}P^2$ is also an example you may have heard of for other reasons.


How to measure if investors are diversified in a stock market?

Question: My question is related to this question but it is not the same.
Consider the US stock market. How can I tell if people trading in this market hold properly diversified portfolios?
Is there some literature on this? I cannot find anything.
Answer: I think the first step is to define what you mean by "properly diversified". A traditional/fundamental standpoint would be that the portfolio is comprised of many different sectors, industries, ect. The more "quant-like" approach and in my opinion, a more realistic approach, is to understand correlation between portfolio assets and the dynamics of said correlation. A key observation would be that correlation between assets tends to increase when the market falls. In a practical sense, one might look towards beta-weighted delta (perhaps to the SP500 or to the predominant index in the market being modeled) as a proxy for correlation. Now that we are comparing apple to apples (all our delta is weighted towards a single index), we know what our exposure is vs. the "market" (our index).
As for determining what other people are doing, the answer is not clear and a very quick search seems to yield few results. Here's a little exercise, if you will, that might help:

Assume we have an index like the SPY to beta weight.
Assume the beta-weighted delta of a participant's portfolio is a proxy for diversification.
Assume that participant's only hold assets within the index.
As the market goes up, it is natural that long-delta participants will lose delta (sell for profit) and short-delta participants will gain delta (buy to cover losses). The opposite is true for a down market. Participants who are delta neutral stay neutral.

Depending on the initial distribution of long and short portfolios, the amount of selling for profit/buying to cover losses or vice versa may or may not be evenly distributed. Therefore, the lack of uniformity in the distribution would create more pressure to the long or short side of the market as a whole (again this is a strong supply and demand-like assumption). One could potentially develop a metric of sorts that takes a guess at the initial distribution of portfolio deltas via the buy/selling levels as the market moves (one would need to define "buying/selling levels).
Overall, going through a process like this can't hurt and maybe it would produce something useful if certain constraints can be relaxed. The method I have outlined is naive and I hope someone can point out some terse work on this question.
Comment: I agree with Joseph. Goal is to find out how the portfolios of investors differ from the market. Finance theory copes with this issue by regressing the returns of each the investor portfolios on risk factors( market, size, value, momentum). Another idea would be to define the tracking error and information ratios for the portfolios of the investor.


How do I find other players on little big planet?

Question: How do I know what levels other players are in?
Comment: When having selected or hovering over a level it should say how many people are playing it right now. But I think the game should be dead by now, so you won't find any players
Comment: Bass is right, unless if you're playing LBP3 then there might be some people. The first 2 are probably almost totally dead.
Answer: As of September 21st 2021, the servers for LittleBigPlanet 1 have been shut down. Unfortunately, this means it is no longer possible to play LBP1 online with other players.
The only alternative way of playing LBP1 levels online with other players would be via the PS4 version of LittleBigPlanet 3.
Answer: To the right of the community option you can search for levels using different filters. If your looking for your friends levels go to the left planet in your pod and select your friends. When you click on a friend it will load any levels they have on the middle planet.


Turn off water supply but leaving heat burner on?

Question: If a house has a water heater for hot water, and a burner for heat (natural gas, baseboard heating). When one goes on vacation in winter and turn off water supply to avoid frozen pipes, should they leave the burner and heater ON? Won't that damage both because there's no water to the burner and heater anymore?
Comment: What does "turn off the water supply" mean? Are you draining down the system? Because just closing the valve doesn't protect against freezing, and if the system is empty you absolutely should not be heating any of it.
Comment: Please revise your post to make that more clear and tell us more about the hardware.
Comment: You mention and don't appear to differentiate between a water heater and a boiler. It is unclear if you have two separate items or one that does both. It's also unclear if you are draining the heating loop and turning off the heat, or merely turning off the water suply to limit the size of a flood in case of the loss of heating (where heating is left on, but problems may occur when unattended.) Please [edit] to clarify.
Answer: With the water turned off to standing pilot gas water heaters, I suggest leaving the controller in pilot; that way it can not turn on the burner and damage the tank. This also keeps the pilot running and those pesky little spiders that love to build nests in the tubing away; then, when you return, just turn it to the proper temp: no hassle having to relight the pilot. But you need to drain the pipes as no heat and water in the pipes can damage them.
If you have electronic ignition turn the control to off.
Since this is a recirculating heating system, though, I would suggest leaving the water in the system and turning it down. That will keep the pipes warm so breakage is not a problem unless your vacation is extended (a month or more, then draining makes more sense).


How to initialize a member variable in a constructor with CodeDOM?

Question: I hope can help me, the problem is this,
I want to initialize a member variable in the constructor of a class with CodeDOM to achieve something like this:
Public Sub New()

    MyBase.New

    Me._myOfficeApp = New Microsoft.Office.Interop.Excel.Application

End Sub

The code I use to do that is:
' Create a Public Class Constructor
Dim aConstructor As New CodeConstructor()
aConstructor.Attributes = MemberAttributes.Public
Dim ca As New CodeAssignStatement()
ca.Left = New CodeFieldReferenceExpression(New CodeThisReferenceExpression(), "_myOfficeApp")

ca.Right = New CodeTypeReferenceExpression("New Microsoft.Office.Interop.Excel.Application")

aConstructor.Statements.Add(ca)

My question is that I do not think I'm doing it the right way, maybe you could help me about this,
I think there is another way to initialize the variable without having to manually put the "New" statement.
Sorry for my English
I really hope can help me. best regards
Answer: for the statement
ca.Right = New CodeTypeReferenceExpression("New Microsoft.Office.Interop.Excel.Application")

you can use
ca.Right = New CodeObjectCreateExpression("Microsoft.Office.Interop.Excel.Application")


How using many tables and JOINS affect performance vs. using limited number of tables and lesser JOINS?

Question: I want to design a db schema concerning a schedule.
I. I can use all fields in the same table, for example:
id | shop_id | mo (varchar) | tu (varchar) | we | th | fr | sa | su
 1 | 1       | 08:00-12:00  | ...

II. or I can use more tables one for schedule with structure:
id | shop_id | mo_id | tu_id | we_id | th_id | fr_id | sa_id | su_id

and then one table for each day... for ex: monday with structure:
id | form_time | to_time

III. or I can use one table for schedule with structure:
id | shop_id | weekday_id

and then only one table for weekdays with structure:
id | day | form_time | to_time

Which structure of these 3 structures you think is better in performance?
Answer: You are obviously familiar with data normalization and joining tables.  Not to dismiss your question, but I would focus more on a solid design that captures the information in the simplest way and without putting undo constraints on your application.  I think you'll find then the performance works itself out.  I'm wondering what's wrong with this:
TABLE events
  id | shop_id | title | desc | from (DATETIME) | to (DATETIME)

To figure out a day's schedule, you then have to do some work on those DATETIME fields to figure out whether they were on Mon, Tue, etc.  But that's pretty easy,  and now there's all sorts of other ways you could slice this data.  You could even create 7 VIEWS (S,M,T,W,T,F,S) that return only events on each day of the week, if that's so important.
Comment: Or use Google Calendar.
Answer: It's going to depend on many factors.
First, you should understand that JOINs don't necessarily hurt performance.  If you have proper indexes they can work very well.
The structure you pick should depend on how your actual data is structured.
If you use the first option, is it likely you will need the row to be inserted all at once or will you be updating later?
How many fields do you need to return with your queries?  Will you always need all the fields from all related tables, or just a certain weekday?
Answer: A table structure like
id | shop_id | mo (varchar) | tu (varchar) | we | th | fr | sa | su
 1 | 1       | 08:00-12:00  | ...

looks wrong to me. Example of one problem: what if a shop has two time slots in one day?
Your schema number III looks better but how will you handle something like "Shop A will change its schedule (eg close on Mondays instead of Sundays) during next Christmas period"? So you may want to add validity period to your schedule table.
Anyway, you should not worry about joins and performance at this stage. You will have to cache all this information anyway.


What is the normal battery draw for a 2009 Honda Fit?

Question: I know that each make and model varied in battery draw, please tell me what the normal is for a 2009 Honda Fit?
Comment: Normal under what conditions? Running? All accessories turned on? Off with nothing turned on?
Answer: 75 - 100 milliamp
This is standard across most modern cars.
Answer: There is no "normal" battery draw. It varies depending on whether the engine is running, what the load on the alternator is, how much electricity the alternator is generating, and what accessories are in use.
More accessories being used creates a larger draw. When the engine is off and no accessories or lights are on, there should be minimal draw on the battery; a few milliamps to allow remote entry, theft prevention, stereo memory, and such features to work properly.
Comment: I think the OP is talking about when the vehicle is off, and nothing being used. I could be wrong but when most people talk about battery draw they are talking about a parasitic load. With the exception of short term overloads if the electrical system is working correctly on an automobile you don't draw any power from the battery when the engine is running.


What is the dual table in Oracle?

Question: I've heard people referring to this table and was not sure what it was about.
Comment: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1562813956388 details about dual
Comment: The best ans is here all about dual https://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:1562813956388 , people are not giving more attention to the above comment link that is why i am commenting here .. have a look at it , you wont regret
Answer: It's a sort of dummy table with a single record used for selecting when you're not actually interested in the data, but instead want the results of some system function in a select statement:
e.g. select sysdate from dual;
See http://www.adp-gmbh.ch/ora/misc/dual.html
As of 23c, Oracle supports select sysdate /* or other value */, without from dual, as has been supported in MySQL for some time already.
Answer: It is a dummy table with one element in it. It is useful because Oracle doesn't allow statements like
 SELECT 3+4

You can work around this restriction by writing
 SELECT 3+4 FROM DUAL

instead.
Comment: From Oracle Database 23c `select ` works; it's no longer necessary to include `from dual`.
Answer: From Wikipedia
History
The DUAL table was created by Chuck Weiss of Oracle corporation to provide a table for joining in internal views:

I created the DUAL table as an underlying object in the Oracle Data Dictionary. It was never meant to be seen itself, but instead used
  inside a view that was expected to be queried. The idea was that you
  could do a JOIN to the DUAL table and create two rows in the result
  for every one row in your table. Then, by using GROUP BY, the
  resulting join could be summarized to show the amount of storage for
  the DATA extent and for the INDEX extent(s). The name, DUAL, seemed
  apt for the process of creating a pair of rows from just one. 1

It may not be obvious from the above, but the original DUAL table had two rows in it (hence its name). Nowadays it only has one row.
Optimization
DUAL was originally a table and the database engine would perform disk IO on the table when selecting from DUAL. This disk IO was usually logical IO (not involving physical disk access) as the disk blocks were usually already cached in memory. This resulted in a large amount of logical IO against the DUAL table.
Later versions of the Oracle database have been optimized and the database no longer performs physical or logical IO on the DUAL table even though the DUAL table still actually exists.
Answer: I think this wikipedia article may help clarify.
http://en.wikipedia.org/wiki/DUAL_table

The DUAL table is a special one-row
  table present by default in all Oracle
  database installations. It is suitable
  for use in selecting a pseudocolumn
  such as SYSDATE or USER The table has
  a single VARCHAR2(1) column called
  DUMMY that has a value of "X"
Answer: It's the special table in Oracle. I often use it for calculations or checking system variables. For example:

Select 2*4 from dual prints out the result of the calculation
Select sysdate from dual prints the server current date.
Answer: A utility table in Oracle with only 1 row and 1 column. It is used to perform a number of arithmetic operations and can be used generally where one needs to generate a known output.
SELECT * FROM dual;
will give a single row, with a single column named "DUMMY" and a value of "X" as shown here:

DUMMY
-----
X

Answer: Kind of a pseudo table you can run commands against and get back results, such as sysdate. Also helps you to check if Oracle is up and check sql syntax, etc.
Answer: The DUAL table is a special one-row table present by default in all Oracle database installations. It is suitable for use in selecting a pseudocolumn such as SYSDATE or USER
The table has a single VARCHAR2(1) column called DUMMY that has a value of "X"
You can read all about it in http://en.wikipedia.org/wiki/DUAL_table
Answer: DUAL is necessary in PL/SQL development for using functions that are only available in SQL
e.g.
DECLARE
x XMLTYPE;
BEGIN
SELECT xmlelement("hhh", 'stuff')
INTO x
FROM dual;
END;

Answer: More Facts about the DUAL....
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1562813956388
Thrilling experiments done here, and more thrilling explanations by Tom
Answer: DUAL we mainly used for getting the next number from the sequences.
Syntax : SELECT 'sequence_name'.NEXTVAL FROM DUAL
This will return the one row one column value(NEXTVAL column name).
Comment: That's not necessary since 11g.  Sequences can be used natively in PL/SQL.
Answer: another situation which requires  select ... from dual   is when we want to retrieve the code (data definition) for different database objects (like TABLE, FUNCTION, TRIGGER, PACKAGE), using the built in DBMS_METADATA.GET_DDL function:
select DBMS_METADATA.GET_DDL('TABLE','<table_name>') from DUAL;

select DBMS_METADATA.GET_DDL('FUNCTION','<function_name>') from DUAL;

in is true that nowadays the IDEs do offer the capability to view the DDL of a table, but in simpler environments like SQL Plus this can be really handy.
EDIT
a more general situation: basically, when we need to use any PL/SQL procedure inside a standard SQL statement, or when we want to call a procedure from the command line:
select my_function(<input_params>) from dual;

both recipes are taken from the book 'Oracle PL/SQL Recipes' by Josh Juneau and Matt Arena
Answer: The DUAL is special one row, one column table present by default in all Oracle databases. The owner of DUAL is SYS.
DUAL is a table automatically created by Oracle Database along with the data functions. It is always used to get the operating systems functions(like date, time, arithmetic expression., etc.)
SELECT SYSDATE from dual;

Answer: It's a object to put in the from that return 1 empty row. For example:
select 1 from dual;
returns 1
select 21+44 from dual;
returns 65
select [sequence].nextval from dual;
returns the next value from the sequence.

What is the dual table in Oracle?


Compare values of two features by FME

Question: Can you help me to compare fields in two tables? I have two tables, which contain ID and Measure fields. I need to take stroke by stroke values from field1(table1) and find all values in field1(table2) which are less than sought-for value. And then take largest of them and put it on stroke field2(table1). Example showed on picture below.
Comment: you seem to round down 25 to 20 and 35 to 30 is that correct?
Comment: No, i need to find nearest value from another table
Comment: It's basically nothing to do with the ID field. It all comes down to Field1 and Field2.
Answer: OK, so you basically need to compare each of the records in table 2 against each record in table 1. To me that suggests you are going to need a loop of some sort. You could either use a loop (or nested loops) inside a Custom Transformer, or you could do an alternative type of loop using a list.
For the Custom Transformer, check out this FMEpedia example, or read chapter three of the FME Desktop Advanced training course.
For the list-type looping, check out my blog post on the subject.
Hope this helps. It's a tricky problem, but one that should be solvable with a little work.
Answer: I am a bit confused by your image.  It looks like you're trying to join two tables.  But your resulting table appears to have incorrect values in Field 2.
I'm going to assume you're trying to join the two tables based on the ID field.
This is a fairly straightforward process in FME.  You can use the FeatureMerger Transformer.
Connect Table 1 to the Requestor port and Table 2 to the Supplier port.  In the FeatureMerger dialog, you'll select the attributes that you'll be joining on.  In your case, this will be ID.

As long as there is no geometry and it's just tables, your Merge Type will be Attributes Only.
If you are then trying to find the smallest of the two fields, you will use an Attribute Creator Transformer and set the value using the Conditional option. I've called my attribute "Smallest" in this example.

And your condition would look something like this:
Comment: It seems to me he needs to find the closest value in table 2 to the value in table 1, that is also less than the table 1 value. Sort of like "The Price is Right"! Table 1 would be the list of prices, table 2 would be the contestant guesses. The contestant needs to be as close to the price as possible without going over. I'll have a think about it.

Compare values of two features by FME


How to make ContentControl listen to non-routed event inside its ContentTemplate

Question: I have some reusable ContentControl, which acts as a pseudo-modal popup inside another view.
It is always there and only its visibility makes it appear or disappear.
When instantiated, within the ContentControl there will be a custom ContentTemplate, bound to some ViewModel and representing the content of the "modal popup".
<Dialogs:ModalDialog DialogHost="{Binding ElementName=layoutRoot, Mode=OneTime}"
                     Content="{Binding ViewModel.CurrentEditItem}"
                     IsShown="{Binding ViewModel.IsInEdit}">
  <Dialogs:ModalDialog.ContentTemplate>
    <DataTemplate>
      <ItemEditor:ItemEditorView />
    </DataTemplate>
  </Dialogs:ModalDialog.ContentTemplate>
</Dialogs:ModalDialog>

Now I want to reach the following: the root of the ContentTemplate (here: ItemEditorView) should implement the following interface.
public interface ICloseMe
{
  event EventHandler<EventArgs> CloseMe;
}

Whenever the CloseMe-Event is fired, the surrounding ModalDialog should be "closed" by setting its VisibilityProperty to Hidden.
The view within the popup (here ItemEditorView) should not care, whether it is shown in a ModalDialog or another context, i.e. it should not even know that such class exists. This excludes a walk through the Logical or Visual tree.
It shall only fire the CloseMe-Event, when Cancel/Save-Buttons are pressed.
Further, the mechanism should not be implemented/configured in the view instantiating the ModalDialog, the view should be as dumb as possible.
Instead, the "outer" ModalDialog should do the active part and listen to the CloseMe-event.
How can I implement this in a rather clean, MVVM-compliant way and without introducing unnecessary dependencies? Is there any event, occuring after a ContentTemplate is initialized, s.t. the ModalDialog could then evaluate, if the root of it extends ICloseMe?
Answer: How about making the ICloseMe include a Closed property that you could setup a trigger against in the XAML?
Comment: Would be ok in a sense of not creating additional dependencies, but how will the ModalDialog be connected to the Closed-Property of the ItemEditorView then?