Creating objects in Java question

Question: In PHP, to create a new object you would do something like this, $dog = new Dog;. But in Java you would do something like, Dog x = new Dog; or Dog x;. Could someone explain why you need to say the Dog class in front of the variable?
Comment: Because php, well... s**ks. (highly subjective)
Answer: You need to precise the type because Java is a strong and static typed language.
If you declare x as a Dog, it can only be a Dog or a subclass of Dog.
Another example :
public class Animal {
}

public class Dog extends Animal {
}

public class Cat extends Animal {
}

The following code is valid because x is declared as Animal, it can be a Dog or a Cat, or any subclass of Animal :
Animal x;
x = new Dog();
x = new Cat();

Comment: +1 for good, complete answer. I will just add that the type of the variable can be an interface too, as long as the class after the 'new' implements this interface.
Comment: It's possible to have a strong and static typed language that doesn't require you to declare the type twice (e.g. Scala). I think a more accurate answer is what you said plus "... and Java does very little in the way of type inference."
Answer: Java statically and explicitly typed.
The type of the variable may be different from the type of the value it holds, due to inheritance. For example:
Animal dog = new Dog();

Here the type of the dog variable is Animal, but the value it holds is a reference to an instance of Dog.
Now in some other languages (C# 3 being the obvious example as a near neighbour of Java) you can use implicitly typed local variables when you actually want the type of a local variable  to be the same as the type of the expression used to initialize it:
var dog = new Dog(); // Equivalent to Dog dog = new Dog();

(The type inferencing capabilities of some other statically typed languages go well beyond this.)
So, to go back to your original question, the answer is:

The dog variable has a type which is known at compile-time; this isn't true in PHP
The type of the variable has to be explicitly stated in Java; this is related to static typing, but isn't a requirement of static typing
Answer: In Java you would call the constructor like this (in case it has no parameters):
Dog x = new Dog();

By writing the class-name in front of the variable, you tell Java that your variable x is of type Dog. This allows Java to find out you're doing something wrong when writing:
Dog x = new Cat();

See PHP Variables at w3schools:

PHP is a Loosely Typed Language
In PHP, a variable does not need to be
  declared before adding a value to it.
In the example above, you see that you
  do not have to tell PHP which data
  type the variable is.
PHP automatically converts the
  variable to the correct data type,
  depending on its value.
In a strongly typed programming
  language, you have to declare (define)
  the type and name of the variable
  before using it.
In PHP, the variable is declared
  automatically when you use it.
Comment: It seems you like cats and dogs too ;)
Answer: I think it is because Java is strictly typed. You need to put the type of the object at compile time.
Answer: Thats java syntax for creating an object of a class, also called as creating an instance.
For example, Dog adog;
where adog is a reference variable of type Dog.
Dog adog=new Dog(); where adog is a reference variable of type Dog which is now referring to the Dog object in memory.
And you use the dot(.) operator to access the object's instance variables and methods.
Answer: your class name object name = new class name();
 For Example
class Animal(){
//your code
}
Animal dog = new Animal();

Creating objects in Java question


Is there a way to roll back inside a SQL Server 2012 stored procedure?

Question: In a stored procedure, several "update" sql statements are being called.  If any of them fails, I want to roll back the previously executed update statements in the same stored procedure.  Is there a way?
Comment: Which answer you like will depend on whether you mean, "Roll back every previous update," or "Roll back TO the previous update."  Ben and I read your question differently.  :)
Answer: You could wrap the whole thing in a begin tran/end tran.  To quote from MSDN:

BEGIN TRANSACTION represents a point at which the data referenced by a
  connection is logically and physically consistent. If errors are
  encountered, all data modifications made after the BEGIN TRANSACTION
  can be rolled back to return the data to this known state of
  consistency. Each transaction lasts until either it completes without
  errors and COMMIT TRANSACTION is issued to make the modifications a
  permanent part of the database, or errors are encountered and all
  modifications are erased with a ROLLBACK TRANSACTION statement.

In response to your comment, combining this with nested Try/Catch might work for you.
Comment: Rereading:  Are you sure?  He says, "If any of them fails, I want to roll back the previously executed update statements in the same stored procedure."  Roll them all back, not just the first.
Comment: I don't think this meets the OP's requirements. He wants it such that if the second one fails, roll back to just after the first.
Comment: In the above example, if the first fails, not execute the remaining two. If the second update fails, I want to roll back the first and not execute the third.  If the third fails, roll back the first two.
Comment: My fault; my mind inserted the word "to" as in "roll back *to* the previously executed..."


What is sense of interface?

Question: I am still not so familiar with interfaces in Java. I know that interface tells which methods should have classes that implements that interface. But what is sense? Why to use it? Is not easier to create instance of class that implements interface instead of instance of interface? Or do I something important miss?
Comment: http://stackoverflow.com/questions/639592/why-are-interfaces-preferred-to-abstract-classes
Comment: http://stackoverflow.com/questions/504904/how-are-java-interfaces-actually-used & http://stackoverflow.com/questions/444245/
Comment: Also http://stackoverflow.com/questions/667139/what-is-the-purpose-of-interfaces-closed
Comment: And I think you mean "purpose" rather than "sense".
Comment: Most horrible English I seen in quite some time. -1 from me.
Comment: And how to write it in good English?
Answer: Try reading about "programming to an interface" and "inversion of control".
Answer: Java does not support multiple inheritance, but it does allow a single class to implement multiple interfaces.
This makes it possible to define functionality in terms of the expected "contract" a class should fulfil, i.e. "it must be enumerable, it must be serializable, and so on", rather than "it must be of this particular type".
Answer: Many people use interfaces to define abstract classes - all the members of a class, without the explicit implementation.  I frankly don't see a lot of value in that.
I prefer to use interfaces to do one of two things:

Show the orthogonal capabilities of a class
Declare the requirements that a class has

The second one is, I think, the more interesting, and probably deserves more explanation.  You might write a class that requires teh ability to load or save some data.  Rather than directly talking to whatever data store you'll use, you can declare an interface that has the methods you want to be able to call.
Then, implement a class that has those methods (implements that interface), and pass it to the class that wants it.
This gives you good abstraction and separation of responsibilities.
Answer: An interface is essentially a contract guaranteeing that a given class will have the listed set of methods.
This allows you to just say that you have an object which happens to oblige to  "List"-contract, so you know you have e.g. a "size()" and an "add(...)" method, which you can then just call.
This may allow you to hide immense amounts of complexity behind a simple interface.  Just think of JDBC Connections...

What is sense of interface?


Accessing a dll with ctypes crashes python.exe

Question: I want to access functions of a dll with python and ctypes. I use python 3.6.1 32 bit with Visual Studio Code running on Win10 64 bit.
The dll is part of a test software and does some configuration and calls some further dlls.
It creates an image, loads the image to a video test hardware and a DUT gets tested with this image.
I have no access to the dll and can't modify it. There is only a .h available.
First, I want to describe the relevant part of the  .h file:
<code>#ifdef __cplusplus
extern "C" {
#endif

#ifdef BUILD_INTERFACE_DLL
#define EXPORT_TO_INTERFACE_DLL __declspec(dllexport)
#else
#define EXPORT_TO_INTERFACE_DLL __declspec(dllimport)
#endif

struct Interface_t;
typedef struct Interface_t Interface;
EXPORT_TO_TESTINTERFACE_DLL Interface * createInterface(const char* versionTag);
EXPORT_TO_TESTINTERFACE_DLL int initConnection(Interface* Interface, const char * deviceId);
EXPORT_TO_TESTINTERFACE_DLL int generateImage(Interface* Interface,char* pathToImage, size_t maxFileNameLength);
</code>
Here is my Python script:
<code>import ctypes as ct
lib = ct.CDLL("./TestInterface.dll")

libEcu.createInterface.restype = ct.POINTER(ct.c_int32)
libEcu.createInterface.argtypes = [ct.c_char_p]
libEcu.initConnection.restype = ct.c_int32
libEcu.initConnection.argtypes = [ct.POINTER(ct.c_int32), ct.c_char_p]
libEcu.generateImage.restype = ct.c_int32
libEcu.generateImage.argtypes = [ct.POINTER(ct.c_int32), ct.c_char_p, ct.c_int32]

CamDeviceId = (b"SomeConfigString")
MaxFileNameLength = 1000
pathToImage = (b"generatedTestImage.bmp")
versionTag = (b"SomeVersionString")

Interface = lib.createInterface(versionTag)
lib.initConnection(Interface, CamDeviceId)
lib.generateImage(Interface, pathToImage, MaxFileNameLength)
</code>
Here is my issue:
createInterface and initConnection are working OK. I get some messages on the terminal confirming that the interface is created and the connection is successfully initialized.
When calling "generateImage", i get the error message "Python stopped working" with the option to debug or close the program. No error message in Visual Studio Code.
The function executes correctly, the image gets generated and sent to the test hardware.
As I have no further possibility to debug in Visual Studio Code, I had a look at the Event Viewer of Windows. The crashed application is "python.exe", the crashed module is "python.dll" and the exception code "0xc0000005"
Any help on this issue?
Is there something I did wrong? I'm quite new to Python.
When accessing the dll with a C program, every function works properly.
Thank you and Regards
Comment: Oh, is `generateImage` *returning* something?  I noticed the 2nd parameter is not const.  You'd need `create_string_buffer()` to make a writable buffer.  Providing a working C version of using the library would help ambiguity.
Comment: Are you sure that Python and the DLL are 32bit? Can you show the relevant part of the working C program?
Comment: It looks correct, although for `generateImage.argtypes` the last parameter is more correctly `c_size_t`, but if using 32-bit Python `c_int32`  is the same size, and `c_void_p` is typically used for opaque interface pointers.
Answer: @MarkTolonen
Replacing
(b"generatedTestImage.bmp")
with
ct.create_string_buffer(b"generatedTestImage.bmp", MaxFileNameLength)
solved the issue.
The issue was the length of the buffer. It needs to be defined and not too small (30 crashes, 50 works). I set it to MaxFileNameLength = 1000, which I copy&pasted from some working C-code example.
Thank you very much!
Comment: Not a very good DLL function if it crashes when you give it a valid buffer and length.  If should return an error code that indicates BUFFER_TOO_SMALL at least.


Implementing Fluent API kind of method in C# for ef Code-First

Question: I am using EF 4.1 code first, and using fluent API for entity Configuration.
I am using following way to configure my entities. Almost every table key in my db is composite of "ICustomerId + TableKey", hence, every foreign key relationship requires it to refer it also.
<code>  HasRequired(x => x.Company)
  .WithMany(y => y.CompanyContacts)
  .HasForeignKey(p => new { p.ICustomerID, p.CompanyID })
  .WillCascadeOnDelete(false);
</code>
I want to implement a method in my base class (which inherits from EntityTypeConfiguration), which will take TargetEntity, TargetKey, and will perform above foreign key creation (by including ICustomerId automatically.
My Clas Defintions:-
<code>public class CompanyContactsMapping
               : BaseInsightTypeConfiguration<CompanyContacts,int>
{...

public class BaseInsightTypeConfiguration<T, TKeyType>
               : EntityTypeConfiguration<T> where T : BaseInsightEntity<TKeyType>
{...
</code>
Any Idea, how can I implement such method?
Answer: KeyType.... are you sure, that type of key will uniquely identify you key? I would go with names and reflection perhaps.


Launch Firefox using a custom GTK theme

Question: I found how to launch Firefox using this line of code with custom theme:
bash -c 'GTK_THEME="Arc-Darker-GalliumOS" firefox %u'

The thing is that when I open a link from an application it uses the default theme, which doesn't work well with Firefox.
So I opened up Preferred Applications and set as default web browser this line of code.
When I tested that, instead of opening the URL, it just went to www.%u.com
How can I fix that?
Answer:
from bash (terminal emulator)
GTK_THEME=Arc-Darker-GalliumOS firefox

from a shortcut icon (~/.local/share/applications/firefox.desktop)
Exec=env GTK_THEME=Arc-Darker-GalliumOS firefox %u

Launch Firefox using a custom GTK theme


relation between current,voltage and resistance

Question: i want to know the relation between voltage,current & resistance , apart from this ohm's law V=IR.Because in zener diodes,current does not increase accordingly with the voltage.At BREAKDOWN POINT, voltage remains the same as the current increases manifold.And in several other cases,even if there is a low voltage,there exists a high current flow.How are they possible!!!
Answer: The resistivity of any material is related to the mobility of the charge carriers within it by:
$$ \rho = \frac{1}{ne\mu} $$
where $\mu$ is the mobility, $e$ is the electronic charge and $n$ is the number density of charge carriers. I've deliberately used the term charge carriers rather than electrons because in semiconductors like diodes the carriers can be holes as well as electrons.
Obviously the electron charge $e$ is a constant, so changes in the resistance arise either from changes in the mobility or the carrier density. In a metal neither of these change with applied voltage, so in a metal the resistance is independant of voltage.
By contrast in a reversed biased diode the carrier density is not constant. As you increase the voltage you increase the energy of the electrons flowing across the depletion layer. At some point the energy gets high enough to excite bound electrons into the conduction band and we get an avalanche beakdown. The carrier density rises rapidly and hence the resistivity falls rapidly, so in a diode the resistance is strongly dependant on voltage.
This argument applies to any material. If you see a resistance that varies with voltage, temperature or whatever else, this will be due to changes in the carrier mobility and/or density.
Answer: I'm not sure what you are asking, but I'll address one point.
Ohm's Law, like many other physical laws, is an idealization.  It applies only to ideal systems, and ideal systems do not exist.  But Ohm's Law is useful because it accurately describes a very large class of real systems.  Even for systems within this class it is only an approximation.  One will find very slight deviations from Ohm's Law if one looks carefully enough with very accurate, precise equipment.  And for any system, eventually some breakdown voltage will be reached beyond which Ohm's Law obviously fails to apply.
As you point out, there are many materials for which Ohm's Law simply does not apply.


Why are nodes sometimes called clients?

Question: Sometimes I see people say the phrase "client" when referring to the node. Why is it called that? Really its not a client, because that depends on the client-server model.
Answer: It's called client because it is a client that implements the network protocol to interface to the peer-to-peer network, rather than a client connecting to a server in the client-server model.
Functionality-wise, the p2p client will have a client-server "server" listening out for connections from other peer's client-server "client" connection requests, and the p2p client will also have a client-server "client" reaching out to connect to other p2p node's client-server "servers".
It is like a BitTorrent client - from Comparison of BitTorrent Clients:

The BitTorrent protocol coordinates segmented file transfer among peers connected in a swarm. A BitTorrent client enables a user to exchange data as a peer in one or more swarms. Because BitTorrent is a peer-to-peer communications protocol that doesn't need a server, the BitTorrent definition of client differs from the conventional meaning expressed in the client–server model.

And from BitTorrent:

To send or receive files one uses a BitTorrent client; a computer program that implements the BitTorrent protocol. Such clients include μTorrent, Xunlei, Transmission, qBittorrent, Vuze, Deluge, and BitComet. BitTorrent trackers provide a list of files available for transfer, and allow the client to find peers known as seeds who may transfer the files.
Comment: In a `peer-to-peer` network how to identify the `client`? And a BitTorrent client is the UI like uTorrent.
Comment: Okay, so what do you call web3.js - a client-client?  Or a an RPC-client?
Comment: I would call web3.js an Application Programming Interface (API) or a "wrapper" as it translates your JavaScript calls into RPC calls to/from your p2p client and then handles the events and results.

Why are nodes sometimes called clients?


OS X 10.10.2 Grey screen and progress bar at start-up normal?

Question: Running OS X 10.10.2 and has for a long time had a grey screen at start-up which occasionally freezes but most of the time just starts up after a while.
Is this normal?
At last upgrade the process froze after several hours and the above situation has been since then
Answer: I'd run the 'usual suspects' before anything else.
Disk Utility > check/repair disk.
Then get OnyX (free/donationwear) & reset ACLs (Maintenance tab > permissions, check the box at the top.)
Then re-apply the 10.10.2 combo update.
Comment: verifying disk permission, and a lot of issues with printer appeared. Don't know if thats of importance. Disk verified without issues. May I ask why you suggest 10.10.2 combo and not 10.10.4 ?
Comment: Because you said you had 10.10.2 - fix the existing install before updating. Printer installs often seem to show permissions issues, first pass should fix them
Comment: did the two first steps you mentioned (in fact, ACT permission issues), but weren't able install the 10.10.2 combo, as I got this when trying to: "OS X Update Combined can't be installed on this disk.  This volume does not meet the requirements for this update." Then tried this https://support.apple.com/en-us/HT203482 which however didn't solve it. Now went ahead with the 10.10.4 update but still the same grey start-up screen...
Comment: That support link has nothing to do with your issue. You've now probably compounded whatever issue you did have & the next thing to do is run from Internet Recovery & re-install the OS - https://support.apple.com/en-gb/HT201314


Why we don't see time dilation in stars orbiting black hole?

Question: We have images of stars orbiting black holes or black holes destroying near stars, but why do we see the stars moving normally?  I mean, if time dilation does exist, shouldn't we see that stars slow down and speed up?  Why do we see stars orbiting at a normal rate?
Comment: Seems like all you're doing is looking at an animation an assuming things should be going slower than they look like they're moving.  The only way to say the effect isn't being observed is with a quantitative analysis which I'm sure would reveal that they are slowed down exactly as much as predicted.  You're just imagining more slowdown than there actually is.
Comment: @BrandonEnright: be aware that there is expected to be a large amount of non-luminous matter around these objects, so perehelion precession will also be governed by this superious matter.
Comment: @BrandonEnright i though that being so close to a super-massive black hole it would show a stronger time dilatation effect , also the time scale are just a few years. But as your said with out and analysis we wouldn't exactly know
Comment: I think the easiest thing to see would be the precession of the perihelion of their orbits.
Answer: Those objects are orbiting closely to SgrA${}^{*}$, certainly, but they are not orbiting closely enough to exhibit significant time dilation effects.  In particular, consider the Schwarzschild spacetime.  The inner most stable circular orbit around the central obect is at $r = 6M$, three Schwarzschild radii away.  This makes the time dilation factor:
$$\sqrt{1-\frac{2M}{r}}= \sqrt{1-1/3} = \sqrt{2/3} = .82$$
So, even the farthest in stable orbit is only running 18% slower than a distant clock.  You can cheat at this a bit by giving the central black hole spin, which will draw in the innermost orbit, but generically, you don't see huge time dilation effects for orbiting bodies.
Wikipedia gives the orbit of the closest of those stars, S2, as being 17 light hours.  We can now compare this distance to the schwarzschild radius of the black hole to guess how much time dilation we should see.
$$\begin{align}
r_{s}
&= \frac{2GM}{c^{2}} \\
&= \frac{2\times\bigl(6.11*10^{-11}\; {\rm N \cdot m^{2}/kg^{2}}\bigr)\times\bigl({10^6}\times(2\times 10^{30}\;{\rm kg})\bigr)}{(3*10^8\;{\rm m/s})^{2}} = 2.7 \times 10^{9}\; {\rm m} \\
r_\text{S2} &= 17 \;\text{light-hours} \times (3\times 10^{8} \;{\rm m/s})(60 {\rm \;s/min})(60 \;{\rm min/h}) = 1.8\times10^{13}\; {\rm m}
\end{align}$$
So, S2 is roughly ten thousand Schwarzschild radii away from SgrA${}^{*}$, and no significant time dilation is expected.  Now, you might ask "why is this evidence that there is a black hole there, then?"  The reason why is that this is still a HUGE amount of mass in an area roughly the size of the solar system.  General relativity predicts that there is no possible stable configuration of matter of this density that is NOT a black hole.
Comment: @eli.rodriguez It's important to understand that Jerry's first paragraph- *i.e.* the ISCO notion - is rather general and holds for *any* Schwarzschild metric, it's not an observation confined to the special case of ${\rm SgR^*}$. (Sorry Jerry - I'm making an assumption that the OP will slip up the first time on meeting this concept in the way that I did - no slight meant on your writing style). There's a good, clear, simple writeup of this notion in Box 33.5, Section 33.8 in Misner Thorne and Wheeler "Gravitation". As Jerry says, other metrics can vary from this a bit, but its a ....
Comment: fantastic answer with all the hardcore maths. thanks that explain me alot
Comment: ..good, back of the envelope estimate. The ISCO is the radius at which the eigenvalues of the linearized equations of motion of a test particle cross into the right half plane, thus meaning that perturbations to an orbit grow with time rather than being damped.
Answer: If I'm interpreting your post correctly, you may be misunderstanding time dilation. Time dilation will not cause the stars to seem to move more slowly. The apparent velocity of a star in your frame of reference is the apparent velocity, and relativity will not change it. What time dilation would change is the apparent rate at which a clock moving with the star ticks. So if there was a clock following one of those stars around and we had a very powerful telescope with which to see the time on this clock, we would be able to see it ticking more slowly than our clocks.
I'm not entirely certain, but relativity may cause the apparent velocity of a star in an orbit to change very close to a black hole compared to what we expect from Newtonian mechanics, but this is not just time dilation. And my educated guess is that this would be almost unnoticeable except on very extreme scales (very close to the black hole). For a radius at which a stable orbit is possible, Newtonian mechanics should give a very good approximation so that nothing seems strange.
Comment: @eli.rodriguez: also note what I said in my answer when talking about accretion disks.  Largely, they are still in orbits until they do the final plunge, but the final plunge is very fast, so the bulk of the luminosity of the disk will come from the plasma orbiting at a radius greater than $6M$ for a Schwarzschild hole.
Comment: i read that if you see a person fall in a black hole you will see him slowly stop and freeze that person, I know that is a very extreme case but in this case i would hope that the black hole in the middle of our galaxy , a super-massive one would be massive enough to show some time dilatation effect to starts orbiting around it
Comment: But also we have images of black holes tearing apart stars and gas clouds and i don't see any time dilatation effect
Comment: @eli.rodriguez You're talking about effects of presence of event horizon - sth else than time dilation.
Comment: @Mithoron Well, the effect he describes does involve time dilation, but as I mentioned, if these are orbiting stably they're definitely far enough that time dilation won't be significant enough to see in a .gif like this, as Jerry showed in his answer.
Comment: @JohnnyMo1 There's a difference between time dilation simply due a relativistic velocity and gravitational time dilation.
Comment: @eli.rodriguez You are correct. An observer outside the black hole will never actually see something cross the event horizon since γ approaches infinity as you get closer to the event horizon.
Answer: We do "see it" but the effect is smaller than you imagine. As already pointed out, the effects of time dilation are too small to have any visible apparent influence on the orbits in that animation. This is because even the closest orbits are still $>1000$ Schwarzschild radii from the black hole. Nevertheless, the effects have been detected in two ways.

The stars do carry their own observable clocks, in the form of the radiation they emit. For the star S2, which comes within 1400 Schwarzschild radii of the black hole, this causes a relativistic redshift of its spectral lines, part of which is caused by gravitational time dilation
(Gravity Collaboration 2018). The time dilation component of this redshift, caused by the "clocks" on the stars amounts to an equivalent redshift of 200 km/s in its spectral lines (about 2 parts in 3000).

In slightly more general terms, the time dilation caused by the non-Euclidean spacetime around the black hole has also been found in the non-Newtonian shape of the orbit of this star. The orbit is not a perfect ellipse and the line joining the black hole to the point of closest approach precesses by 12 arcminutes every orbit, as predicted by General Relativity (Gravity Collaboration 2020).


Creating a shortcode with a variable (Woocommerce)?

Question: I'm new to PHP. I want to create a shortcode that outputs a user's order number, but I'm having trouble.
All I know is that the order ID variable is "$order->get_id();"
Comment: You need to provide a lot more context. Using a variable is nothing special or unusual. If the variable is available, just use it. The problem is, what is the variable, and when it is available. `$order` doesn't just exist, you have to get it from somewhere. In the case of WooCommerce, users can have many orders, so what order are you using? How are you getting it? Where is the shortcode going to be used?
Answer: Would need to know how you are planning to use this shortcode because doing what you are asking raises the issue of what you want the shortcode to do if the user has multiple orders?
If this shortcode is going to be displayed on a page or post that is specific to a specific order then the shortcode can be created as follows:
The following two functions should be in your themes functions.php file or in your plugins main php file.
This registers your shortcode:
function register_my_shortcode() {
add_shortcode( 'get_current_order_number', 'get_current_order_number_callback' ) );
}
add_action( 'init', 'register_my_shortcode', 10 );

This is the function callback that builds what you want to do with your shortcode:
function get_current_order_number_callback( $atts ) {
// This is where you can get your order number.
global $post;
$order = new WC_Order($post->ID);
$output = '';

// Good to do a check that the order number is not empty.
if ( ! empty( $order->get_order_number() ) ) :
// This is where you can declare attributes that you can add in your shortcode.
$atts = shortcode_atts( array(
        'id' => 'default-id',
        'container_class' => 'default-container-class',
        'class' => 'default-class',
    ), $atts );

// Now you can build the elements that you want to display the order number in.
$output .= '
;
$output .= '' . $order->get_order_number() . '';
$output .= '
';

// If order number is not empty will return your shortcode build above.
return $output;

endif;

// If order number is empty will return false.
return false;
}

Your shortcode will look like this and with no atts will use your defaults:
[get_current_order_number]

or with atts added:
[get_current_order_number id="43" container_class="custom-container" class="order-number-text"]


Can I list my aunt, who has been my primary caretaker, as my parent on the FAFSA application?

Question: I have lived with my aunt for all of my high school and most of my elementary school years. She has cared for me and paid EVERYTHING for me. She also carries me as a dependent on her taxes along with my elderly grandpa. I am reviewing FAFSA application for college financial aid consideration. Can I list her as my parent even though there is no formal adoption arrangement?  In my mind and heart she is my parent and has always been so.
Answer: Studentaid.gov has quite a bit of information about filling out your FAFSA - the one answer that seems particularly relevant to your question is here:

What if I live with someone other than my parents?
It doesn't matter if you don't live with your parent or parents; you still must report information about them. The following people are not your parents unless they have legally adopted you: grandparents, foster parents, legal guardians, older brothers or sisters, uncles or aunts, and widowed stepparents.

If you look at other questions on that page, you'll see that there are ways to report extenuating circumstances that may help identify your particular situation, bit it seems clear that you should not list your aunt as your parent without some sort of formal adoption in place.


limited-edition or a limited edition

Question: I am going to make up two similar sentences below.
(1) This colorful vase is limited-edition.
(2) This colorful vase is a limited edition.
Which one is correct?
Comment: Google returns practically no results at a phrase "limited-edition". I think the variant without the hyphen and with an indefinite article in front is right.
Comment: The correct one is limited edition,  no dash.
Answer: Looking at the website of Oxford Dictionaries (https://en.oxforddictionaries.com/punctuation/hyphen), it does not seem like there is a specific rule concerning hyphens which would apply here.
Grammar Book goes into it a little bit deeper (http://www.grammarbook.com/punctuation/hyphens.asp), however, no rules which indicate there should be a hyphen can be found there.
Adding that to the fact that there are only a few search results for "limited-edition" and many for "limited edition" (including Wikipedia and some dictionary websites), I think it should be written as "limited edition".
(Also, concerning the "a": I would use an article here, so it would be "a limited edition".)
Answer: If the phrase were reversed, it would be correct to use the hyphen to say a limited-edition vase. (In other words, if limited edition is used as an adjective prior to the noun, it should be hyphenated.)
Answer: I'd say OP's #1 is less common, but perfectly credible (there are many instances of (model) was a limited edition in Google Books, but none at all for the same without the article).
I think the hyphenation is pretty much "optional" in both versions, though personally I'd be more likely to hyphenate the "adjectival" article-less usage in #1, not the "noun" one in #2.

It does also partly depend on whether the speaker is referring to the vase/model/etc. as a "collective" (representing both itself and all others in the limited-membership edition/set/issue/etc.) or simply stating an attribute of the specific object. I find OP's #1 more "natural" in the former context.
For example, an advertisement encouraging you to buy their "collectable" commemorative plates (for display) might reasonably include this plate is limited-edition in their list of favourable attributes. They don't mean to reference any specific plate there - they mean the entire collection, collectively.
Answer: Correct would be "a limited-edition" though you could leave out the "a" but it wouldn't sound right.  Would be like saying "This vase is blue one" I understand, but saying "This vase is a blue one" is gramatically correct and makes more sense
Answer: This is an interesting question which leads to an answer which is not straight forward due to the advice available online.
Both are correct, and it is down to whether indefinite articles are used within the sentence, or not.
Rule 5 within the Grammer Book link @user12048 provided, gives a clue as to what you need to look at.

Rule 5. Never hesitate to add a hyphen if it solves a possible problem. Following are two examples of well-advised hyphens:
   Confusing: Springfield has little town charm.
     With hyphen: Springfield has little-town charm.
Without the hyphen, the sentence seems to say that Springfield is a dreary place. With the hyphen, little-town becomes a compound adjective, making the writer's intention clear: Springfield is a charming small town.
   Confusing: She had a concealed weapons permit.
     With hyphen: She had a concealed-weapons permit.
With no hyphen, we can only guess: Was the weapons permit hidden from sight, or was it a permit for concealed weapons? The hyphen makes concealed-weapons a compound adjective, so the reader knows that the writer meant a permit for concealed weapons.

The sentence

This colorful vase is limited-edition.

has the need for a hyphen, because, without it the sentence would not make sense.  "This colourful vase is limited edition" would say that the vase is limited, (limited by what? — Use?), but then you have the word edition laying loose on the end of the sentence.  You could add the word by into it to say "limited by edition" but then that would signify that the number of editions are limited.  Without the hyphen, the sentence would need to be rearranged to "The edition of the colorful vase is limited" in order for the sentence to make sense, but then you would need to add, for example, "by quantity" or "by number of these vases manufactured" on the end to be sure the reader understands the context.  (The edition is limited by what?)
Using the hyphen joins the words limited and edition together to say that the edition is limited.

This colorful vase is a limited edition.

is different because the indefinite article — a — splits the sentence
this colorful vase is ¦ a limited edition
indicating that the edition is limited and the vase is colourful.

limited-edition or a limited edition


How does the triangle inequality correspond to a triangle?

Question: In the very first chapter in my class "mathematical analysis 1" I've seen something called the triangle inequality, which is $||a| - |b|| \leq |a \pm b| \leq |a| + |b|$. Now the thing is that I do understand why this is true, but i fail to see what this actually has to do with triangles. It was never explained nor proven. I'd like to know how this inequality relates to triangles to get a better understanding of it, because it's also used a lot further on. Would someone be able to explain this?
Comment: The name makes more sense in the more general case where you replace scalars with vectors and absolute value with euclidean norm (or any other norm).
Comment: A plot like this might be useful: https://upload.wikimedia.org/wikipedia/commons/0/08/Vector_triangle_inequality_vw.PNG (NB: this is for the case where $a,b$ are vectors and $|a|$ denote the length of the vector $a$)
Answer: In Euclidean space with Cartesian coordinates, let $+$ denote vector addition, and let $O$ denote the origin. Choose points $a,b$, and form a triangle with vertices $a,b,O$. One side of this triangle has side length $|a|$, another has side length $|b|$, and the third has side length $|a-b|$. Now as we all know, the shortest path between two points is a straight line. So, the shortest path between the two points $a,b$ has length $|a-b|$. There is a longer path one can take which goes around the other two sides, the length of that path is $|a| + |b|$. So, $|a-b| \le |a| + |b|$.
Answer: Suppose $a$ and $b$ are complex numbers, so that they correspond in the Argand-Cauchy plane, to two sides of a triangle, the third side corresponding to $a-b$. Then these inequalities correspond to well-known from middle school inequalities about triangles – namely that the length of a side of a triangle is between the difference and the sum of the lengths of the two other sides.


How do I virtually disconnect an external monitor?

Question: I have a iMac that is connected to an external monitor to extend my screen. Into that same monitor I have a separate Windows box that I need to run sometimes. The Windows box goes in through VGA and the iMac through HDMI. The problem I'm running into is that when I want to use the monitor for Windows, there is no simple way to get my iMac back to just that monitor. If I leave it extended, some apps are open in the other 'monitor' and I can't access them without work arounds. If I turn on mirroring, the resolution on the iMac drops significantly, even if I tell it to keep the iMac screen size. I can't turn the other monitor off as that defeats the point. I have to unplug the HDMI to get it to perform correctly. Is there any way (command line, an app, preferences, etc) to toggle between using the display and not on my Mac?
Comment: In case you're open to some other options, I run Windows under Parallels on an iMac with second display, and it's extraordinarily slick. Highly recommended if you're not gaming or something else intensive on the windows box.
Comment: I have VMware fusion, but in a development enviornment sometimes I need an extra tower. My work also provided it with windows already installed so I kind of have to keep it that way for licensing purposes.
Answer: There is no way to "virtually" disconnect a display on a Mac, like you can on Windows. The Mac needs to disconnect physically. The easiest way to do this is by purchasing an inexpensive KVM Switch, to physically switch between the Mac & PC.
Answer: This similar question has an answer that refers to SwitchResX.  The marketing information for that application says SwitchResX can let you disable an unused Display.
Answer: Use VLC player to play your movies. Go to Preferences → Video and choose black screen when in full screen.


80s or earlier fantasy series about a world without metal

Question: I'm looking for a fantasy series (at least 2 books) I read in the mid-80s. Most of it was set on a world without metal, so they had found other ways to make weapons. A second world, with metal, tries to take it over. I remember two main characters -brothers- on the first world, one becomes a ruler and the other is trying to learn about the second world.
Answer: Could it be Raymond Feist's Magician series / Riftwar saga?

I'm looking for a fantasy series (at least 2 books) I read in the mid-80s.

Check: Magician came out in 1982, and the series (with subsequent series, spin-offs and prequels) is over 20 books long.

Most of it was set on a world without metal, so they had found other ways to make weapons.

Most of the second half of the first book is situated on Kelewan, where metals are scarce and precious. Laminated wood is used instead to craft swords and armor.

A second world, with metal, tries to take it over.

You might have it the wrong way around: The world our protagonists start on - Midkemia - is rich in metals, and it is this world that is invaded by Kelewan through several magical portals between worlds.

I remember two main characters -brothers- on the first world, one becomes a ruler and the other is trying to learn about the second world.

Kinda strokes with Magician: Pug is adopted by Tomas' parents. Pug learns the Kelewan ways of magic after being captured on his home world Midkemia (in an attempt to close the primary portal) and sent to do slave labor. When his aptitude for magic is detected, he gets sent off to a huge magics academy, and eventually becomes a politically relevant figure on Kelewan.
Meanwhile, Tomas is transformed into something that could kindly be called a Dragonborn and marries into the Elvish Royal family - Just one of those weeks, amirite?
Does this match the stories you're looking for?
Comment: That's it! I'm home sick so I downloaded it. The "brothers" who had stuck in my mind were Lyam and Arutha.
Comment: Thank you for you quick help!
Comment: Riftwar was the bomb, but the series got pretty metaphysical as the series wore on.
Comment: Urgh. This was my first thought at "world without metal", but I dismissed it because the other details weren't quite correct. Good on you for giving it a try.
Comment: @Randal'Thor yeah, stuff connected between the metal, the brothers ruling and learning and the invasion. It just occurred to me that the invasion was remembered the wrong way around...
Answer: This actually reminds me of Bob Shaw's Land and Overland books (The Ragged Astronauts, The Wooden Spaceships, and The Fugitive Worlds).  The story starts on Land, a world with little metal (though they have brakka wood which is nearly as hard and strong), where two natural chemicals, pikon and halvell ("orange and purple") are hypergolic when brought into contact -- they're used as fuel for jet engines that propel the balloons that are the highest advance of transportation.
Unfortunately, it turns out that either harvesting or use of pikon and halvell promotes a floating menace -- the incredibly toxic ptertha, which explode at a touch and whose residue leads to pterhacosis, a fatal affliction.
With ptertha growing more and more common, Land is becoming uninhabitable, so the decision is made to flee -- to Overland, the "moon" in Land's sky, orbiting close enough that both are tide locked and joined by a "neck" of thin atmosphere which, in the first novel, is found to be traversible by a suitably designed balloon.


Driving in the US but lost UK paper licence

Question: I am in Florida, USA.  I cannot find my card UK licence, but have the separate paper part to the licence. Is it OK to drive with just the paper part?
Comment: The question is whether a Florida police officer would recognize the paper part as a license.  You have a license so could prove that in the long run, but the short time hassle is hard to say since I am not sure what the "paper part" looks like
Comment: If by "paper part" you are referring to an IDP, the answer is no-- it must be accompanied by the actual license and confers no privileges on its own.
Comment: I don't know for certain, but I personally wouldn't risk it. In the UK, you have to show both parts of your driving license to the police, so I don't think it would be ok to just rely on the paper part in the US. When I drove in the US, I took the card and paper part, plus the IDP.
Comment: Related:[Can you use a UK paper license counterpart in New Zealand?](http://travel.stackexchange.com/questions/9788/can-you-use-a-uk-paper-license-counterpart-in-new-zealand)
Answer: From USCarHire.com:

The new style UK driving licence consists of two parts - a photo card
  and a paper licence. The licence is not complete without BOTH parts.
  You are advised to take both parts when collecting your vehicle as you
  may be asked for them both.
Often the rental company will only ask to see the photo part, so in
  most cases you will be OK to drive, but in the event they do ask for
  the paper part (which lists any points and endorsements) and you don't
  have it with you, then you will not be allowed to drive, nor will you
  then be entitled to a refund on your rental.
If you do not have the paper part and the rental company do not ask
  for it, so you collect your car, then you also run the risk of
  problems in the event you are pulled over by Highway Patrol and asked
  to show your license, as they may insist on seeing both parts. As it
  is a legal requirement to carry your FULL license with you in the car
  at all times when driving, then you could face legal consequences.

So you do in fact (probably) need both parts of your license, unless you literally 'get away' with it. However, if you're in an accident or similar, you're going to be in some serious trouble.
Comment: It's going to be interesting how awkward things are going to be for a while once the UK paper counterpart is no longer issued: https://www.gov.uk/government/news/driving-licence-changes


How to call Microsoft Graph from non-MVC Web app c#

Question: I've got an existing ASP.NET web app which is non-MVC and I would like to get it to call the Microsoft graph. I read up on the ASPNET MVC tutorials and got those to work but I am looking for some code samples of calling the Microsoft Graph that don't use MVC or OWIN to acquire an access token. This is because I would like to avoid rewriting my entire app into MVC. Any pointers?
Answer: Microsoft has a number of samples on Github. Here's a console app one.


Potential energy of external force

Question: The potential energy is a property of a system, being defined only for internal conservative forces. From the work energy theorem, we have
$$W_{ext} + W_{\text{internal cons. forces}} = \Delta K $$
We define the (change in) potential energy as $\Delta U = -W_{icf}$ giving us
$$W_{ext} = \Delta K + \Delta U$$
My question is, why leave out the external force? If the external forces are also conservative, then they can also store some potential energy. We can take that term and define a potential energy change for the external force too can't we? For example, if we had a ball and the earth, we could take the ball as the system, and due to the external force of gravity $mg$ it would have a potential energy $mgh$ with it.
Answer: You can think of a change in the potential energy of a system as being work done by external forces on the system. However, some work done by external forces may also go into changing the kinetic energy of the system - this is why $W_{ext} = \Delta K + \Delta U$. So we want to restrict the change in potential energy to being work done by external forces that stores energy internally within the system. But a less ambiguous way to express this is to say that the change in potential energy is the work done by internal forces in opposition to external forces (as a result of Newton's Third Law).
In your ball example, it is the ball and the Earth that are the system, and the potential energy is the energy stored in the gravitational attraction between them, which is an internal force. The work done by external forces on the system may be greater than $mgh$ if it increases the kinetic energy of the system - or it may be less than $mgh$ if the kinetic energy of the system decreases.
Answer:
We define the (change in) potential energy as $\Delta U = -W_{icf}$

If $W_{icf}$ stands for internal conservative force only, then the definition is incorrect. $W$ can be the work done by internal or external forces, as long as the forces are conservative. So it should be written
$$\Delta U=-W_c$$
Whether the conservative forces are internal or external to a system depends on how the system is defined. But regardless of whether the force is internal or external, the change in potential energy depends only on the work done by conservative forces.
Hope this helps.

Potential energy of external force


How to to remove "paypal/express/review" step on Magento2.4

Question: When ordering using paypal in magento2, it takes you to paypal, paypal already displays a confirmation, you confirm, you get redirected to another confirmation page (/paypal/express/review), it is an extra step that is unnecessary for user experience, I would like to remove it and make the order automatically placed when user confirm on paypal page, once leave paypal if order successful the customer should see the success page.
Answer: Go to Store -> Configuration-> Sales -> Payment Method -> Paypal -> Express Checkout -> Basic Settings - PayPal Express Checkout -> Advanced Settings -> Skip Order Review Step -> Yes
select "Skip Order Review Step" --> "Yes"
Cheers !!
Comment: After SETTING according to your method, it doesn't work. I feel that there is no order confirmation page because I only go through the shopping cart process
What I want is to directly click paypal on the product details page, enter my paypal account, and click Continue. I need to jump to the order confirmation page. I don't want this confirmation page.


British citizen - Remote work in UK for French company

Question: I am a British citizen and have a 90-day fixed term contract with a French company. Do I need a French work permit in order to work remotely from the UK?
Answer: As littleadv's answer correctly states, French immigration law doesn't apply and you don't need any kind of permit to be working in Britain as a British citizen.
If you are an employee (i.e. not working freelance or a contractor), your French employer might however struggle to accommodate you and follow all the tax and payroll procedures without a French address. They need to report your hiring to the tax and welfare agencies (déclaration préalable à l'embauche) and they are also legally liable to check that people they hire in France have the relevant permits.
I am not familiar enough with the procedure to know if there is a way to circumvent it or explicitly hire someone abroad but I wouldn't expect the average HR person to know either so you really need to double-check with them that they understand the specifics of your situation and do not expect you to show up with a French residence permit.
You also ought to worry about the tax and insurance implications on the British side. You may know more than I do about that and it may not be an issue from your perspective but I have also heard about employers refusing to hire people in your situation (physically present in another country) because they are afraid it would create some liability for them and they don't want to go through the trouble of figuring it out so that's another thing to clear with them as soon as possible.
Answer:
I am a British citizen & have a 90-day fixed term contract with a French company. Do I need a French work permit in order to work remotely from the UK?

You're outside the French jurisdiction. You only need to comply with the laws of the country you're in or citizen of. So no, you don't.
Comment: You need a work permit in the country where you physically are. If you worked for a UK company and decided to rent a place in the French countryside for three months, you'd need a French work permit. If they know about it.


Check Raise vs Donk Bet

Question: I am confused. What is the EV difference between a donk bet and a check raise? In which cases is it better to be donk betting and in which cases is it better to check raise?
Answer: This is an important question. It's discussed on many sites and forums. I don't want to copy-paste the text as it would be my own, so:
HERE you can find the summarized pros and cons of donkbet and check-raise.
And HERE are a good list of the situations when to use them.
To understand the second link, You must understand first polarization. You can find info HERE about it.
Answer: This really depends on many factors.
This is the thought process though:
<code>-Fold equity difference between check raise & and donk bet.
-Line consistency with represented range(Do I want villain to call or fold? Which line best represents the range I want to represent for him to fold/for him to call?).
-Pot growth potential vs villain call frequency.
-What will I do if my donk bet gets raised?
</code>

Check Raise vs Donk Bet


Can you display RSS feed with SimplePie on the blog it was pulled from?

Question: I want to fetch an RSS feed that my Wordpress site creates (let's call it site1.com/feed) using Simplepie, and I want to display that feed on the homepage of the same Wordpress site (site1.com). But I can't get the feed to display at all.
I've pulled the feed and put it on a different website (site2.com), which worked. However, when I try to display the WP feed (site1.com/feed) on the site it's generated from (site1.com), I get nothing.
Sorry if the explanation is a bit convoluted. It's hard to get it out in a succinct way. But anyway, is this an issue with Simplepie itself? Can you just not display a feed on the site that generates it?
Answer: Why use simplepie? Just use the standard Worpdress code to output your feed within your site.


Find a linear bounded automaton that accepts the language $L = \{ a^{n!} : n \geq 0 \}$

Question: I need to construct linear bounded automaton for the language $L = \{ a^{n!} : n \geq 0 \}$. I know how LBA functions, however, I don't have a thought how it can check the n! that to in the power of a. I might want to hear a few suggestions, as I am experiencing difficulty in developing the specific LBA for it.
Answer: The LBA maintains a counter $c$, initialized by $1$, which is stored on a parallel track. It thinks of the rest of the tape as an integer $m$. It then repeatedly executes the following instructions: divide $m$ by $c$, and increment $c$. The algorithm terminates when one of the following happens: $m = 1$, in which case you can declare success; or $m$ is not divisible by $c$, in which case you can declare failure.
Comment: The idea seems good, yet would you be able to give more knowledge by really assembling the LBA, as I don't have the foggiest idea how I may continue with this, I took reference in Peter Linz book yet missed to do so.
Comment: Think of it like a programming exercise. It's your exercise, you should spend the effort. Start with easier tasks, such as just implementing the division step.
Comment: Alright Thank you, I will attempt the problem, could you give some learning resources, as I see I am able to grasp algorithm however I don't have a clue how to check if I made a right one.
Comment: Unfortunately I'm not aware of such resources. Perhaps you'll have to write a simulator yourself.
Comment: Okay, thank you for your time.


Laboratory and commercial preparations of aniline other than reduction of nitroarenes

Question: Till now I could only find one laboratory preparation of aniline, i.e. reducing nitrobenzene with $\ce{Sn}$ and concentrated $\ce{HCl}$. I'm confused if Hofmann degradation is only commercial.
I'd like to know if there are other processes to prepare aniline in laboratory.
Comment: Why would anybody prepare aniline in lab?
Comment: Catalytic hydrogenation of nitrobenzene over Pd/Pt/Ni catalysts
Comment: Is Hoffmann Bromamide reaction only commercial or a laboratory method? I only want to know, I don't perform these experiments so don't ask me why to prepare in laboratory or whatnot.
Comment: Check this [2009 paper](https://onlinelibrary.wiley.com/doi/pdf/10.1002/9780470682531.pat0391) which gives loads of palladium catalyzed and copper catalyzed reactions.
Comment: @AkshSarma Hoffman Bromamide is pointless from a synthesis perspective; if you have to prepare aniline, it is much easier/cheaper to use nitrobenzene as a raw material than Acetanilide. Chances are if you have acetanilide, you will also have aniline.
Comment: @AniruddhaDeb ... also the yields are generally poor in HBR because it requires a lot of distillation, decarboxylation and the usage of already a volatile reactant i.e bromine. This reaction is better studied for academic purpose only.
Answer: It is true that until recently, the syntheses of primary anilines mostly rely on the reduction of corresponding nitroarenes. However, recent publications allow the synthesis of primary anilines or their derivatives in laboratory.
One such method is Buchwald–Hartwig amination:

The palladium-catalyzed cross-coupling of amines and aryl (pseudo)halides, now commonly known as the Buchwald–Hartwig amination, was first reported 25 years ago. Since the simultaneous breakthrough reports of Buchwald and Hartwig in 1995, this reaction has transformed the way synthetic chemists think about synthesizing aromatic amines... (Ref.1):

A continuous process for Buchwald–Hartwig amination in different scale synthesis has also been introduced recently (Ref.2). Further, a version of Buchwald–Hartwig amination for the preparation of primary arylamines has been introduced recently as a general method (Ref.3):

The importance of the method is reflected by the development of a synthetic route to manufacture the drug candidate AMG 925 on kilogram scale using Buchwald–Hartwig amination (Ref.4):

Another amine synthetic method not following nitro reduction is Ullmann amine synthesis and its variations (Ref.5 and references therein):

In addition, secondary or tertiary amine can be prepared using Chan-Lam coupling reaction. For example see following reaction (Ref.6):

Other than using aryl halides, there is an another method to convert phenol derivatives to anilines. One such example describes a direct conversion of phenols into primary anilines with hydrazine catalyzed by palladium (Ref.7):

References:

Paola A. Forero-Cortés, Alexander M. Haydl, "The 25th Anniversary of the Buchwald–Hartwig Amination: Development, Applications, and Outlook," Org. Process Res. Dev. 2019, 23(8), 1478–1483 (https://doi.org/10.1021/acs.oprd.9b00161).
Sebastian Falß, Giovanna Tomaiuolo, Antonio Perazzo, Paul Hodgson, Polina Yaseneva, Jacek Zakrzewski, Stefano Guido, Alexei Lapkin, Robert Woodward, Rebecca E. Meadows, "A Continuous Process for Buchwald–Hartwig Amination at Micro-, Lab-, and Mesoscale Using a Novel Reactor Concept," Org. Process Res. Dev. 2016, 20(2), 558–567 (https://doi.org/10.1021/acs.oprd.5b00350).
Giang D. Vo, John F. Hartwig, "Palladium-Catalyzed Coupling of Ammonia with Aryl Chlorides, Bromides, Iodides, and Sulfonates: A General Method for the Preparation of Primary Arylamines," J. Am. Chem. Soc. 2009, 131(31), 11049–11061 (https://doi.org/10.1021/ja903049z).
Caroline Affouard, Richard D. Crockett, Khalid Diker, Robert P. Farrell, Gilles Gorins, John R. Huckins, Seb Caille, "Multi-Kilo Delivery of AMG 925 Featuring a Buchwald–Hartwig Amination and Processing with Insoluble Synthetic Intermediates," Org. Process Res. Dev. 2015, 19(3), 476–485 (https://doi.org/10.1021/op500367p).
Andrea Francesca Quivelli, Paola Vitale, Filippo Maria Perna, Vito Capriati, "Reshaping Ullmann Amine Synthesis in Deep Eutectic Solvents: A Mild Approach for Cu-Catalyzed C–N Coupling Reactions With No Additional Ligands," Frontiers in Chemistry 2019, 7, Article 723 (14 pages) (https://doi.org/10.3389/fchem.2019.00723)(Full Paper).
Carolin Fischer, Burkhard Koenig, "Palladium- and copper-mediated N-aryl bond formation reactions for the synthesis of biological active compounds," Beilstein J. Org. Chem. 2011, 7, 59-74 (https://doi.org/10.3762/bjoc.7.10)(Full Paper).
Zihang Qiu, Leiyang Lv, Jianbin Li, Chen-Chen Li, Chao-Jun Li, "Direct conversion of phenols into primary anilines with hydrazine catalyzed by palladium," Chem. Sci. 2019, 10(18), 4775-4781 (https://doi.org/10.1039/C9SC00595A)(Full Paper).


Would winglets add fuel efficiency on a Concorde?

Question: Would adding winglets to a Concorde have a had a positive impact on its performance and fuel efficiency in retrospect, considering the technology was not widespread or developed at the time these machines were flying and would that at all have reduced/increased its sonic boom?
Answer: The answer is no and the airplane in question is intentionally designed this way.
Standard sweptback wings produce the characteristic vortices st the wingtips.  The concentration of these vortices at this point in combination with little lift being produced by the vortices makes a singlet an effective feature to reduce induced drag.  Delta wings on the other hand produce vortices along the entire length of the wing, particularly at low speeds and high angles of attack.  Concorde designers took this into account in order to produce better low speed handling characteristics as well as the olgive delta wing provides a very clean high speed wing.  The wing was one of the most heavily researched and planned features of the jet during development.
The upshot of which is that adding winglets onto a Concorde not only is fairly ineffective way to reduce wingtip vortices and induced drag but impinges upon low speed flight capabilities, requiring greater takeoff and landing rolls and high approach AoA.
Answer: No they would not.
Winglet technology for supersonic aircraft was already a known factor when Concorde was designed. The XA70 Valkyrie Mach 3 bomber prototype first flew in 1964 and had folding down wingtips: extended during subsonic flight, folded downwards like winglets during high speed supersonic flight, for increasing lift by riding the shock waves. The Concorde designers had their own elegant solution to merge high- and low speed requirements in the wing design, in which winglets had no place.
Image source
The sonic boom shocks form at every point the airflow hits the aircraft structure, limiting the magnitude on the ground is more a matter of spreading the shock wave out.
The magnitude of the sonic boom depends mainly upon:

Length of the aircraft, the shorter the louder.
speed of the aircraft, the closer to the speed of sound the louder.
Altitude of the aircraft, the lower the louder.

None of these factors are influenced by the addition of wingtips.
Comment: Also the cross sectional area of the airplane. The more abrupt the change in area; the louder.


End game patrols?

Question: I heard that if you complete the main quest by siding with the Minutemen, you'll end up with numerous patrols of Minutemen in the Commonwealth, who fight raiders and mutants.
That sounds awesome, but I'm currently siding with the Railroad, and was wondering if there was still a possibility to get those patrols with the Railroad ending?
Answer: Yes, you'll get patrols from the faction you complete the game with throughout the Commonwealth.
Answer: As the previous answer says, you indeed get patrols of whatever faction you end the game with.
I just wanted to mention a couple of other things, first one being that almost everytime you see a patrol, there is a power armor hidden there. And second, that Diamond City rises over 5 flags of your faction all around the city.

End game patrols?


nose multiprocess problems

Question: I'm having a problem running nose tests.  When I run my suite from Eclipse, using Run As>Python unit-test with the test runner set to Nose test runner and arguments --verbosity=2 --processes=2 --process-timeout=300 in the Eclipse preferences for PyDev>PyUnit, I get a nice, orderly run where 4 new python processes spin up, and I get results back for my 19 tests (a class derived from object with 2 test generator methods, the first dispatching 6 tests, the second 13) in a few minutes (the tests are each making a sequence of REST calls then doing some validation).  However, when I run the same file from the command line using nosetests --processes=2 --verbosity=2 --process-timeout=300 testfile.py, it spawns 100s of new Python processes that seem to be organized in groups, with one having a bit over 6k in memory usage and the others having 50-500k.  These processes keep spawning indefinitely, and the tests never complete, until I start manually killing the processes.  If I run the tests from the command line without multiprocessing, they complete just fine as well.
Is Eclipse doing some extra corralling of the test processes?  Could I potentially be running different versions of Nose in Eclipse and from the command line (even though I only see 1 nose install, in site-packages)?
Answer: Try to play with:
_multiprocess_can_split_
and
_multiprocess_shared_

in your test classes.
doc: http://nose.readthedocs.io/en/latest/doc_tests/test_multiprocess/multiprocess.html

nose multiprocess problems


"As such,he helped saved 6 lives..." What grammar category

Question: I need help in identifying the grammar category. Why is Past Participle used after the word "helped" and what grammar category to refer to understand?
"In August 2017, Elijah Mayhew, 15, of Florida died of a gunshot wound there.Weeks earlier, he had told his mom that he wanted to be an organ donor. As such, he helped saved six lives, including one chronicled in the Journal Star, part of the USA TODAY Network"
Comment: It's a typographic error. It should be _he helped save six lives_.
Comment: Writers often insert words as alternatives: *helped save?* or *saved?*. Being human, they then forget to remove the unwanted choice, and editors occasionally let the typo slip through. Big oops.
Answer: Normally, this is an error. I have never found it (ngram).
However, it appears that from about the turn of century people have begun to write that and so, presumably, they've begun to use it in everyday speech some little time before that. Quite a few books written in the period I mention show this form: ref.. At least 50 books show that form. From an examination of all occurrences it is clear that the form has been used a lot with a separating comma (helped, saved) and there is even a case of "helped/saved". It is clear from that this otherwise ungrammatical form is a verbal form introducing what you could call binary verbs. However, it is not clear that "helped and saved" is an equivalent, as it would be for "helped, saved". This is probably an American linguistic invention and there is no guarantee it will be successful even in America. Personally I wouldn't use it.
Comment: If we put a comma in the sentence, it would not create a non-defining relative clause  "As such, he helped, saved six lives.."  as it is not suitable/reasonable to define "As such" with "he helped"?
Comment: @AnfisaIbragimova For a relative defining clause or as well for a non defining one you need a pronoun (which, that, …); you are not concerned with that then. It's really equivalent to a coordination when you use a comma.


For a trade to occur, should the ask price EXACTLY match the bid price, down to the last decimal point?

Question: I had a doubt when going across the ways in which a trade happens. I have read that fora  trade to happen, the buy order's price (bid) must match the sell order's price (ask). Now, what happens, if they are off by say 1/100th of a dollar. Will the trade still not happen? If it does, at what price will it trade?
Answer: All exchanges have minimum price fluctuations, or tick sizes, which is the smallest increment at which prices are discrete.
The buyers bid price must match the sellers ask price down to the tick size. Orders can't be listed beyond the minimum price fluctuation so by definition, a sellers price can't be "off" by any amount beyond the minimum price fluctuation.
Orders either match down to the tick or they don't.
CME Globex Tick Size and Pricing Data


CSP violation when trying to whitelist site

Question: I'm going through the Build a Community with Knowledge and Chat module on trailhead and keep getting the same CSP violation when I try to whitelist the snap-in chat in the community builder. I have made sure my security settings allow whitelisted third party scripts, but I get the CSP violation whenever I try to whitelist the snap-in chat. I've also tried adding it to trusted sites and still get the same violation. Is there anything else I should be doing?
Answer: When adding sites to Trusted Sites (and often to the main Salesforce Trusted URLs list) add as https://*.salesforceliveagent.com to avoid duplication.  When I was adding the Zendesk Chat bot to an Experience site recently, I had to click through each CSP error url to find the next domain.  By the end of it, I had added:

https://*.zopim.com
https://*.zdassets.com
https://*.zendesk.com
Answer: I had the same issue. Instead of trying to add the entire URL under whitelisted sites, Please try adding only until salesforceliveagent.com. Found the answer here. stackexchange
It solved my issue.


Why does a contract have an account?

Question: Why do contracts have an account? I mean, their code is entered to the blockchain and their balance can be computed by previous transactions, so why is there an account of it?
Answer: As you pointed yourself, ethereum contracts have balance, just as regular user accounts (Externally Owned Accounts), so they can store, receive and transfer ether. That fact alone indicates that they need to be an account and not a transaction. Accounts are for storing ether and in case of contract accounts data and logic too, whereas transactions are about sending value or data from one account to another.
You can read more about Ethereum network architecture here:
http://ethdocs.org/en/latest/contracts-and-transactions/account-types-gas-and-transactions.html
Comment: I see, so the whole account thing is for balance managing? can't it be calculated via the blockchain?

Why does a contract have an account?


Meaning of sentences using "didn't", "wasn't" and "wouldn't"

Question: What are the meanings of the sentences below?
What exactly is the difference in meaning?
Do sentences using wasn't and wouldn't have the same meaning?

a) "...but he didn't leave."
  b) "...but he wasn't leaving."
  c) "...but wouldn't leave."
Answer: Sentence (a):

But he didn't leave.

makes a statement about something that happened in the past, as if a person were recalling it afterward. Imagine a situation where a person had been sitting in a bar, drinking a glass of beer. Then (for example),

He pushed the empty glass away and looked around. But he didn't leave.

Sentence (b):

But he wasn't leaving.

expresses action in the continuing past, rather than in the simple past. For example,

He was slowly counting the money from his pocket, after looking groggily at the clock above the bartender's head. But he wasn't leaving.

Sentence (c):

But he wouldn't leave.

describes a conditional situation. In this case, wouldn't, the negative form of the conditional verb would, focuses on a person's unwillingness to do something. Idiomatically, "would not" means "refused to." Thus, for example:

The bartender told him that it was time for the bar to close and for him to go home. But he wouldn't leave.
Answer: Let's examine each example one at the time:

a) …he didn't leave

It is simple past, that is an action started and completed somewhere in the past; as we can see that's the way the negation is made.

b) …he wasn't leaving

It is simple past too, it can express a same kind of action as previously shown but can also express the idea of some continuity in the past, between some unspecified time sequences, or an interruption or not of the action by another action:

he was leaving when I came, or he was not leaving when I came.
c) …he wouldn't leave

It can express the future (the negative form):

he said he wouldn't leave

or it can express the conditional (the negative form):

If I went there he wouldn't leave
Answer: a) If he truly "didn't leave", that means he's still there. However, if you specify that he didn't leave AT SOME PARTICULAR TIME, then he might have left later.
b) At that particular time in the past he was not in the process of leaving. We do not know whether he left after that.
c) He refused to leave. (We asked him to, but he would not.)

Meaning of sentences using "didn’t", "wasn't" and "wouldn't"


Time Travel possibility and Paradoxes of The Past

Question: can one travel back in time and if not so, what laws prevent time travel to the past. this is quite a challenge to understand.
Comment: Possible duplicate of [Is time travel possible? Is it possible to go back in time?](http://physics.stackexchange.com/q/2166/)
Comment: If our's traveling speed is greater then Velocity of Light we can travel to past, but that is not possible due to law of relativity
Answer: In special relativity the answer is simple: no, you can't (unless the universe is topologically strange).
For general relativity the answer is more complicated: it is possible to construct spacetimes with what are called 'closed timelike loops': curves which are timelike (ie where the curve lies within the lightcone of all points on it) and which are closed: the curve forms a loop.  And I am pretty sure you can also arrange things so that the curves are smooth enough to be physically sensible (ie they have no sharp corners).
Such a curve is fairly bad news, any point on such a curve is in its own future (and past).  In other words such a spacetime does allow you to travel into your own past.
So the question to answer is: are such spacetimes physically plausible?  In particular do they represent stable solutions without silly energy conditions, and could they arise from plausible initial conditions?
Now, my knowledge of this is seriously out of date (as in: more than twenty years out of date), but the situation then was that people strongly suspected that they were not physically plausible, in the sense that you could not arrive at such a solution from physically plausible initial conditions.  However, at the time, there was no really convincing proof of this.
Personally, I would be extremely surprised if such solutions are physical.  Indeed, if they turn out to be plausible in GR I would regard that as strong evidence that there is something wrong with GR (and I'm saying this as someone who has the field equations on a t-shirt!)


UK visa and regular income

Question: So I applied for UK visa with a regular income of 129,429 . However , when I was paid it reflected in my account statement has 129,400 . I am worried that this little difference mine cause trouble with the Embassy
Comment: Welcome to TSE. You haven't specified the currency you're referring to, but a difference of 29 seems pretty insignificant. Did you provide paperwork to prove your income eg pay slips, employment contract etc?
Comment: It's a difference of about 0.02% so it shouldn't be much of an issue by itself, but the discrepancy may lead them to examine things more closely, so the rest of your application needs to be bulletproof.
Comment: If it's £129,400 (GBP) per annum, that will put you comfortably in the top 1% of incomes in the UK. A difference of £29  ( 0.025% ) is less than the daily currency fluctuations, so should be ignored when checking your income
Answer: A discrepancy of less than 0.1% in your salary is not going to be a problem, no matter what the currency.
Answer: Discrepancies with funds are one of the main reasons UK visa applications are rejected, however the discrepancies have to be materially significant to cause a problem. In your case, the difference is trivial and it won't have any effect on your application at all.
Visa officers know that salary payments going into bank accounts vary due to all sorts of factors and this is the same for most people regardless of currency. It would have to be a significant difference for it to have an impact on your application.
Comment: bon_vivant, please only post a link if it is not from a commercial site, as your post did run the risk of being deleted as a spam message, because of the link now taken out.

UK visa and regular income


Which Bluetooth Module can I use with Arduino Micro/Mini?

Question: I need to use a Bluetooth module with an Arduino Micro/Mini.
Please suggest which one would be the best, HC 05/06, or any other?
Comment: It depends on what you want the module to do. For just serial communication the HC modules are fine. For anything more complex you may want to look at BLE.
Comment: What research have you done so far?
Answer: I have had good results using the Bluefruit LE UART Friend module from Adafruit with a 32u4 micro Arduino type module, there are only a few pins to connect up to get things going (do remember to follow the instructions to pull the CTS pin to ground).
As per the previous answer it really does depend on what you want to do with it - but this module does Low Energy, can be configured as a "Beacon" and there is a companion App for Android/iOS.
Answer: Do you require slaves or masters?
Both modules are actually the same, it is just the firmware that is different, and in turn that changes how they use the pins. HC05 can be both Master and Slave, and has a full set of AT commands, whereas HC06 can only be a slave, and has a more limited set of AT commands at its disposal.
Otherwise, for low power projects, then BLE modules, such as HC-10 or HC-11 might be worth considering.
Really, it all depends on what you want to do with them, what is the overall project? You could get away with one HC-05 and one HC-06, but it is really task dependant. It is probably worth you having a read up of some articles on the web, and looking at some example projects to see other people's configurations. This will hopefully help you to see what you actually require for your project.
FWIW, I looked into this a few months back and wrote a short blog, BlueMoon, on it, which contains some example projects and links to video tutorials - this may help give you an insight...


Could we make space roads? Like a space elevator between planets?

Question: We hear a lot about space elevators that could place something in orbit, but what about a space road between planets? Suppose you had a long tube or flat road placed between Earth and Mars by chemical rockets, could you use a vehicle with solar panels and electric motors to reach Mars using just electricity? Also since there's no force of gravity the engineering would be simpler than a space elevator.
Comment: "Also since there's no force of gravity the engineering would be simpler than a space elevator"; except there IS the force of gravity, both at the planet you leave, at the planet you arrive at, everywhere in between and everywhere else too. It's why the planets orbit and stars collect into galaxies.
Comment: @phil1008 topics you generally like to promote? you're listed as one of the editors. I think you've changed timestamps now so it just shows a concept from a paper you have commercial interest in promoting instead of immediately also mentioning The Atlantis Project, which you also have commercial interest in promoting, but **it's your responsibility to mention that to not be a spammer**
Comment: @phil1008 oh gee, The Atlantis Project and Newtonian Screw Shafts. Where have I seen this before without someone clearly disclosing their interest in promoting it?
Comment: Hasn't this been debated for a long time?
Comment: Well technically yes, but it wouldn't be a straight line, it would be lots of orbital rings attached to each other. Check out this episode from Isaac Arthur https://m.youtube.com/watch?v=LMbI6sk-62E&pp=ygUab3JiaXRhbCByaW5ncyBpc2FhYyBhcnRodXI%3D
Comment: The question makes me think of the [Interplanetary Transport Network](https://en.wikipedia.org/wiki/Interplanetary_Transport_Network).
Comment: Possibly also of interest: [Space Elevator Between Doubly-Tidally Locked Bodies](https://space.stackexchange.com/questions/5193/space-elevator-between-doubly-tidally-locked-bodies)
Comment: Yes, fair point. I forgot that I was listed as an editor since he asked me to check his script for errors.
Answer: The trouble you're going to run into there is that the planets spin and move, which makes it hard to have a road or whatever in place. It's a little like trying to build a tower to reach an airplane that's in flight. You can't do it, the plane won't hold still.
First, we have the rotation problem. Suppose you want to build an elevator to the moon. We have a base somewhere on Earth's surface, and attach the other end to the Moon. Only... if you wait twelve hours, the earth has turned around to face the other way, and the moon is now on the wrong side of the planet. Your structure can't go through the planet to reach the moon, so that's gonna be a problem right there.
The concept of a space elevator is to string your elevator between the surface and a station placed in geosynchronous Earth orbit ("GEO") -- that is, an orbit at a very particular altitude where it takes exactly 24 hours to go around Earth, and thus hovers directly over a single point on the surface.
What if we don't try to fix it to Earth's surface, though?  We could start from somewhere in orbit, maybe beyond the moon, and built a highway to Mars.
Well... This is the revolution problem. Before we build a highway, let's just put a string in place. If you imagine stretching a single thread between Earth and Mars, well, Mars takes around 687 days to go around the sun once, while Earth makes the same revolution in 365 days (give or take a bit).  If we string our thread when the planets are at the absolute closest point, then wait a bit, the planets will move apart, so we have to feed out more thread or it'll break.
Worse, it takes nearly 2 Earth years for Mars to go around once, so if we wait six months or so, we inevitably end up in a situation where Mars and Earth are on opposite sides of the sun, which is to say, our thread is passing directly through the sun. This is generally considered unsafe for travel.
There are other options, though. If you build a space elevator on Earth (impossible with current technology) and then also build a space elevator on the Moon (which could be done with currently available material, if you could get it there or make it on the moon in sufficient quantities), you could go up to the GEO station by solar-electric power, make a relatively cheap rocket trip to the moon station, and then go down the elevator there by solar-electric power, and that would cut most of the cost off of your trip.
Actually, if you have a GEO station and then extend a counterweight out into an orbit beyond GEO, in theory the counterweight would be getting pulled along faster than orbital velocity, which is to say you'd feel as if the counterweight was "down" from the GEO station -- centrifugal force would be pulling you away from Earth, and grow stronger the further from GEO you got. You could slide down and let go at the end of the counterweight line to be flung into an elliptical orbit that could potentially reach the moon without any fuel at all. There's some tricky physics involved, but it's entirely possible that with the right timing, you could have regular moon service without spending any rocket fuel, which isn't a road, but might be the next best thing.
Comment: "which isn't a road, but might be the next best thing." Honestly, it's probably better in every way, both from the economic and engineering standpoint of not having to build the road, and the time standpoint of not having to travel interplanetary distances at the kind of speeds you can interface with a road or track at.
Comment: "our thread is passing directly through the sun. This is generally considered unsafe for travel." lol
Comment: The limitation is timing -- a road would always be there, ready to use, while the counterweight scheme is more like a daily launch window.  I agree that it's probably a better plan from the engineering standpoint than building hamster tubes to other planets.


Cat won't stop trying to take off her head cone, that keeps her from touching her injury

Question:
My kitty cut her eye today so we took her to the vet, they gave her eye drops so everything is fine just now. She has a cone to prevent her from pawing it or hitting it off something, but she won't stop trying to take off the cone. Any way to prevent this?
Answer: Any way to prevent what?
Of course she is trying to take the cone off; she has no idea why you are making her wear this annoying thing and she certainly doesn't want to do so. You would object too, if someone put one on you with no explanation you could understand.
But it is better for her to be frustrated and a bit uncomfortable for a while than to risk her interfering with treatment.
You can try to distract her from thinking about the cone, but realistically the answer is that since she will only be wearing it for a short time it isn't worth trying too hard. Give her extra cuddles and/or treats, if you want, but she's just going to have to put up with the cone as long as the doctor said she should.


~くなりました with ない

Question: For example, if I want to say "(this food has) become not tasty", would the correct way to say that be "おいしくなくなりました"? How would this be distinguished from おいしく亡くなりました, "died tastily", however meaningless that may be? Is there some more idiomatic way to say the former, and can I expect ない to behave perfectly like a 形容詞?
Comment: How about 「寂しくなくなった」? ^^ This is quite ambiguous, no? :p
Comment: @istrasci Thank you, I should have been able to come up with this...
Comment: 無い and 亡い share the same etymology, so what other answer do you expect but "by context"? I cannot imagine any situation where the tastiness of some foodstuff changes, so I have trouble thinking of this example properly. But 好きじゃなくなりました is a common expression (and doesn't mean 好きでは亡くなりました).
Comment: No one would *ever* think it meant "died tastily".  @Earthling:  If you left perishable food unrefrigerated, it could easily `おいしくなくなる`.
Answer:
For example, if I want to say "(this food has) become not tasty",
  would the correct way to say that be "おいしくなくなりました"?

Yes, this would be a correct way of saying "(this food has) become not tasty".

How would this be distinguished from おいしく亡くなりました, "died tastily",
  however meaningless that may be?

Context. Precisely because it's meaningless, and because it's a common grammar point, and in writing due to the lack of kanji for 亡くなりました. The same way おいしくなりました is not likely to be おいしく鳴りました, "rang tastily".

Is there some more idiomatic way to say the former

おいしくなくなる is fine, but you could phrase it positively like まずくなる

can I expect ない to behave perfectly like a 形容詞?

I think this ない is classified as 助動詞, while the ない in something like ケーキがない is a 形容詞 (Sources: goo dictionary, goo dictionary, oshiete!goo).
But I believe you can just think of it as an i-adjective in terms of conjugations.
Comment: I have the same feeling, I was just trying to think of different ways of saying it for him if he didn't like using おいしくない.
Comment: Just thinking about it now they have a lot of overlap but I think they might have a bit of a difference in nuance. Like おいしくなくなる has more emphasis on the fact that you know it used to be おいしい.
Comment: I would say that おいしくなくなる is more common than まずくなる.
Answer: I think homophones are generally distinguished by:

Syntax.  If a homophone is ungrammatical, it's not considered as a possibility.
Semantics.  Whichever homophone makes more sense is more likely.
Pragmatics.  The distinction between semantics and pragmatics is a bit fuzzy, but I'll define it this way: whichever makes sense in the larger context is more likely.

I think that's true of all languages, but Japanese has a fourth way, which applies only to the written language: you can write something with a particular kanji to specify a particular homophone.
In this case, I don't think they're distinguished syntactically, so you're left with semantics and pragmatics.  Devoid of context, "died tastily" is basically nonsense, so I think you'd need a very exceptional context for anyone to interpret it that way.  (You could use the kanji to specify 亡くなる, but unless you came up with a context where it made sense, I think readers would assume it was a typo.)

~くなりました with ない


How to setup a .NET core HTTP Proxy in IIS

Question: Need help to configure .NET Core HTTP proxy application on IIS on Windows 10.
I did build an proxy app to help me inject the SOAP headers before passing the request to the Final WS endpoint.
I had build this proxy because the client wont have a capability to send on headers on the request
I am mimicking the code that was shared by Andrea Chiarelli in the following link
Auth0 .NET Core Proxy
When I run the application locally on VS Code Everything works well
But soon I deployed to IIS server sing VS 2017. I ran into a problem
Web.Config
<code>    <?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\EMCIProxy.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  </system.webServer>
</configuration>
</code>
I am getting a strange response that I cannot access the specific URL resource
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module
   IIS Web Core
Notification
   Unknown
Handler
   Not yet determined
Error Code
   0x8007000d
Config Error
Config File
   \?\C:\inetpub\EMXI_Proxy\web.config
Requested URL
   http://localhost:8085/
Physical Path
Logon Method
   Not yet determined
Logon User
   Not yet determined
Config Source:
   -1:
    0:
I am trying to access the URL http://XYZ123:8085/services/SearchClient which should be routed to
https://testxyz:7443/EMXI/services"
Just want to mention I exactly have one method public async Task Invoke(HttpContext context) similar to the one on the example provided in the above URL
Any points of advice/suggestions welcome. I am trying to leave it very generic as much as possible.
Answer: I just figured out that ASP Windows Hosting Module was not installed on my machine. Just want to point to another stack question, where I found the solution
enter link description here


Pronunciation of trailing "i" in Latin-derived words

Question: Some pronounce the trailing "i" in Latin-derived words (e.g., "Gemini") as a long "e" and others pronounce it as a long "i." I was taught the long "e," but is this mere preference or is there a firm basis for one or the other?
Comment: When in doubt, you can always look up the word. In the case of Gemini, [both pronunciations](http://education.yahoo.com/reference/dictionary/entry/Gemini) are listed as acceptable.
Comment: IPA transcription: long "e" = [i] and long "i" = [aɪ]
Comment: Related: [Pronunciation of words ending with "‑ae"](https://english.stackexchange.com/questions/40671)
Answer: Up until the sixteenth century, English scholars pronounced their Latin '-i' the same way as everybody else did, viz /i:/ ('-ee', if you will).
But when the English long vowels made their  great trek around the mouth  over the next two centuries, they took the Latin vowels with them on the trip.
So between then and the early 20th Century, in most contexts English scholars (and lawyers) pronounced Latin words more or less as if they were English, hence bizarreries like "Decree nisi" (/naɪsaɪ/).
Some time in the 20th century, classicists realised what had happened, and endeavoured to return Latin (and Greek) scholarship to something very much closer to how the classical languages had actually been pronounced. This didn't have much effect Latin words that had entered English - except when it did.
The consequence is that there is confusion between /i:/ and /aɪ/ for '-i', and between /aɪ/ and /i:/ for '-ae'. Go figure.
Answer: The trailing i on most masculine
nominative plurals in Latin is usually a "long e"
/iː/,
as has already been stated, like ee in levee or tree.  Latin pueri
(the boys) would be /pu.eri/ poo-air-ee.
A trailing ae like that found on most feminine nominative
plurals is a diphthong which sounds a lot like a "long i"
(/aɪ/,
[äɪ̯]), but, as it is a diphthong, is more of a switch in
sound starting with a "short a" /ɑ/ and ending with a "long e"
/iː/,
similar to the pronunciation of aye or eye
/aɪ/.
Thus, Latin puellae (the girls) would be poo-ell-aye
/puɛlːaɪ/.
I's at the beginning of words are pronounced like the y /j/ in yet
/jɛt/
or yellow
/ˈjɛloʊ/,
and C's were usually hard
/k/.
So, Julius Caesar (which
would have been written ‹Iulius Caesar›, as they didn't have J's), would
have been pronounced something like Yul-ee-us Kai-sar /ˈjuː.li.ʊs
ˈkae̯.sar/,
the pronunciation of which is where Germans get the word Kaiser,
Russians get Czar, and Arabs get Qaysar, amongst a dozen other
languages that have words rooted in the word Caesar.
Comment: In this answer, you describe the "Reformed pronunciation" that would be used by English speakers in a Latin class, and that is meant to approximate classical pronunciation. However, this pronunciation is not used for all Latin-derived words in English. I have never heard anyone say "ahl-guy" for "algae."
Comment: Note that u was pronounced oo.
Answer: Traditionally, when learning Latin, one is taught to pronounce a trailing 'i' such as that in Gemini as "ee." So if you want to hew closer to the classical pronunciation of such words, such as the Oracle of Delphi, go with the "ee." (Warning: In US English, this will generally sound astoundingly pedantic and pompous.)
Answer: If you're familiar with the wide variety of pronunciations of English words, it probably won't surprise you to know that Latin — which has arguably been spoken for longer and in more countries — should also suffer the same fate.
Nobody knows how Latin was originally spoken.
There is no firm basis, therefore, for any particular way of speaking. Latin has been kept alive more by the Church (in her many denominations) than any other body, in which an end of i is pronounced with the long e, possibly best known from Enigma's "Sadeness":

In nomine Christi, Amen.

Long e works better when sung (a long i having more than one part to it, sounding more like aahyee when sung slowly*).
However, I blame just one thing in particular for spreading the i sound, and it's this:

Q: What do you call a mushroom who buys all the drinks?
  A: A fungi [fun guy] to be with.

We all get to learn this joke at six years old in our Christmas crackers. Any other pronunciation is therefore doomed, or at least turned into an exotic curiosity, in our childhood.
*Please feel free to introduce me to the art of phonetics. I'm curious.
Comment: We know quite a lot about how Latin was pronounced; it is just that Latin pronunciation is only one of our many considerations when determining how we want to pronounce or actually pronounce modern English. Latin i was pronounced like ee, ae like eye, a like ah, and u like oo.
Comment: *This may help: http://en.wikipedia.org/wiki/Wikipedia:IPA_for_Latin
Comment: * [aɪ] is (as you might guess from the IPA) a [diphthong](http://en.wikipedia.org/wiki/Diphthong).  In English we are supposed to sing them by holding the [a] for most of the note, only slipping to the [ɪ] at the last moment.  This isn't necessarily true in other languages; I have a vague recollection that in Italian, you hold the _last_ vowel sound of a cluster rather than the first.
Comment: I think I need to ask a question about which of those three alphabets to use...
Comment: Ah, I got it. Thank you! That explains a *lot*. Now at least I can decipher some of the strange code on this site, as well as sing the score to *Pygmalion*.
Comment: Well, we know how Latin was *classically* pronounced. Think about the number of ways in which English is pronounced in England alone. It's unlikely that a far larger Empire with multiple parts originally speaking different languages would have had just one pronunciation.


AppSocket/HP JetDirect - how to find host and port number

Question: In connecting to a network printer using AppSocket/HP JetDirect, how does one determine the host and port number?
Answer: The host is the printer itself. You have to configure the JetDirect card in the printer to a proper IP address. Is the printer use autoconfigure options (like dhcp - what mostly is a bead idea) you may print the configurtion of the JetDirect card from the printer status menu.
The port normaly is TCP/9100 for the raw-printing protocol. Have a look here for a overview of used ports.


How to know if the token is ERC20 or ERC233?

Question: as I stated on the title because I am very confuse on how to know if the token is ERC20 or ERC233. I bought Thore Cash on Mercatox and I didnt know if it is ERC20 or ERC233 but they said they supported the swap but i just want to make sure.
Comment: It's easy to spot by looking at the contract code. Why not post the address of the token contract for those who aren't familiar with it? You're looking for a call to `tokenFallback()` in the token's `transfer()` function. That is the definition of ERC223.
Answer: The easiest and reliable way to determine which standard a token is following is to look at its source code. The easy and fairly trustable path to that is to

head over to Etherscan.io
find the token by searching for its address or name
double check with a trusted source that you got the right smart contract address, there are thousands of fake token contracts out there. Take it from one of your own transactions for example.
In the Profile Summary on the right, click the contract address, then click the "contract" tab
hit ctrl+F or cmd+F and search for ERC. This will probably yield ERC20 and possibly other numbers corresponding to other types of tokens, which usually are a superset of ERC20.

If that does not yield satisfactory results:

search for a piece of code that is specific to this kind of token, e.g. as suggested by Rob Hitchens for ERC233: "tokenFallback", or "extcodesize", which must appear in the transfer function.
Answer: ERC-223 transfer to contracts consumes less gas than ERC-20.
Comment: Can you give more details? or an example where it shows
Comment: Refer to https://medium.com/wepower/erc-standards-to-move-ethereum-forward-erc-20-erc-223-erc-721-e1712456449d
Comment: The article has the same answer but it shows no proof or any other evidence.
Comment: This is plain wrong. An ERC-223 transfer function is the exact same code as an ERC20's with the addition of some code to check for the destination's "extcodesize", revealing if the tokens landed on a smart contract (in which case it reverts the tx if the smart contract can't handle ERC233). So it can only cost more gas. ERC233 have many other advantages though. cf. https://github.com/Dexaran/ERC223-token-standard/blob/master/token/ERC223/ERC223_token.sol#L55