ASP.NET: 1.1 to 2.0 upgrade

Question: what are some things i should be aware of before i begin this project? i've notice a few differences between this 1.1 site and our 2.0 sites: i noticed that every code behind file has a "Web Form Designer Generated Code" region which i'm guessing i won't need to transfer over to the 2.0 site.(?) There's also a "sitename".dll file in the bin folder which i was told is also a 1.1 thing and that dll file won't need to be transferred over to the 2.0 site.(?) at this -LINK-, the second answer mentions that my new 2.0 site should be created as a Web Application Project and not a Web Site project - does this apply to all 1.1 to 2.0 upgrades and should i consider doing this?
i would appreciate any advice at all on a 1.1 to 2.0 upgrade that you have. i should also mention that i am not allowed to upgrade to either 3.5 or 4.0 - it has to be 2.0. thanks.
Answer: 2.0 brought a new project type for websites which, in the simplest terms, does not produce a dll for the website like 1.1 projects would.  There was a patch released that supported the 'older' project type if you really hated the new website project (which I did).
To be honest I did not have that much trouble converting my sites over to 2.0 way back when it came out.  Visual studio automatically converted my projects and I only had a few bugs to work out to be honest.
Try using the automatic upgrade (simply open the project in visual studio 2005 after you install 2.0) and see if you have any issues.
Comment: He won't have to worry about "web site projects" assuming he installs at least Visual Studio 2005 SP1. He can just ignore them.
Comment: is the new project type included in the service pack?  Thats nice!
Answer: Be sure to install the latest service packs and be sure to test, test, test. .NET 2.0 added some fixes that amount to breaking changes in .NET 1.1. You may run into them especially in the area of XML processing in general, and XML Serialization in particular.
Note also that .NET 3.5 is nothing more than .NET 2.0 plus some additional assemblies that your code does not use. There is no good reason to not upgrade to .NET 3.5 SP1.
There are potential reasons to not upgrade to .NET 4.0, though not very many.

ASP.NET: 1.1 to 2.0 upgrade


What dictates the order of languages used by the UN?

Question: In the image below, what dictates the order of the languages on the top banner (e.g. why English and then French?
Answer: The rules don't provide any directive on order of languages. It seems likely that the order is "Alphabetical in English".
So Arabic (the only right-to-left language is placed first (on the right). Then the left-to-right languages are in alphabetical order Chinese, English, French, Russian, Spanish, from left-to-right
The rules of procedure of the security council name these as the official and working languages in alphabetical order.
Comment: Any vertical ordering example?
Comment: Well look at the image.  The only language that can be written vertically is Chinese, and it is written horizontally.  So, no the question doesn't contain a vertical example.


Itunes won't display total number of songs when I'm in my music playlist

Question: Itunes used to display my total number of songs/hours/days when I was in the MUSIC playlist. It displays this info for all of my playlist, just not in MUSIC. I know how to use control +/ to get the info to appear, just can't figure out why it won't show the info for all of my 15,000 songs...
Comment: Try toggling the "Show/Hide Status Bar" item in iTune's View Menu. It *should* toggle that info for all media types, but perhaps it glitched once and needs a little prod to work correctly again.
Comment: Thanks, tried that, still doesn't work, so odd...
Answer: If you're still looking for an answer, go to Playlists, then on the right side it will have a drop down menu that says Songs, if you choose Artists instead, it will show you how many songs you have on the left side
Answer: Sometimes the max screen is too large, you might need to

On the Start screen, press and hold the tile you want to resize. (If you're using a mouse, right-click the tile.)
Tap or click Resize.
Choose the size you want.


Calling a subclass method from superclass

Question: I am in an introductory java course and we just started learning about inheritance. I am working on a task that asks that we create a "Pet" superclass with name and age; and three subclasses, each with their own unique trait (I have chosen "Dog", "Cat", and "Bird"). After we have all these built, we are to create a Main class to test everything, and this is where I am running into problems. I am attempting to call the get methods for these unique traits within Main, but it seems to only find methods that are in the superclass.
Here is the Main class:
public class Kennel {
    public static void main(String[] args) {
        // Create the pet objects
        Pet cat = new Cat("Feline", 12, "Orange");
        Pet dog = new Dog("Spot", 14, "Dalmation");
        Pet bird = new Bird("Feathers", 56, 12);

        // Print out the status of the animals
        System.out.println("I have a cat named " + cat.getName()
                + ". He is " + cat.getAge() + " years old."
                + " He is " + cat.getColor()
                + "When he speaks he says " + cat.speak());
        System.out.println("I also have a dog named " + dog.getName()
                + ". He is " + dog.getAge() + " years old."
                + " He is a " + dog.getBreed()
                + " When he speaks he says " + dog.speak());
        System.out.println("And Finally I have a bird named "
                + bird.getName() + ". He is " + bird.getAge() + " years old."
                + " He has a wingspan of " + bird.getWingspan() + " inches."
                + " When he speaks he says " + bird.speak());
    }
}

Here is my superclass
abstract public class Pet {
    private String name;
    private int age;

    // Constructor
    public Pet(String petName, int petAge) {
        this.name = petName;
        this.age = petAge;
    }

    // Getters
    public String getName() { return(this.name); }
    public int getAge() { return(this.age); }

    // Setters
    public void setName(String nameSet) { this.name = nameSet; }
    public void setAge(int ageSet) { this.age = ageSet; }

    // Other Methods
    abstract public String speak();

    // toString
    @Override
    public String toString() {
        String answer = "Name: " + this.name + " Age: " + this.age;
        return answer;
    }
}

And here is one of the subclasses (they all look the same and are having the same error)
public class Cat extends Pet {
    private String color;

    // Constructor
    public Cat(String petName, int petAge, String petColor) {
        super(petName, petAge);
        this.color = petColor;
    }

    // Getters
    public String getColor() { return(this.color); }

    // Setters
    public void setColor(String colorSet) { this.color = colorSet; }

    // Other Methods
    @Override
    public String speak() { return "Meow!"; }

    // toString
    @Override
    public String toString() {
        String answer = "Name: " + super.getName() + " Age: "+super.getAge()
                + " Color: " + this.color;
        return answer;
    }
}

So what is happening is I can't get the main method to find the cat.getColor() method, or any of the other ones unique to the subclasses.
Answer: When you declare a variable as having the type of the superclass, you can only access (public) methods and member variables of the superclass through that variable.
Pet cat = new Cat("Feline",12,"Orange");
cat.getName(); // this is OK
cat.getColor(); // this is not OK, getColor() is not in Pet

To access the methods in the concrete class (Cat in this case), you need to either declare the variable as the derived class
Cat cat = new Cat("Feline",12,"Orange");
cat.getName(); // OK, getName() is part of Cat (and the superclass)
cat.getColor(); // OK, getColor() is part of Cat

Or cast it to a type you know/suspect is the concrete type
Pet cat = new Cat("Feline",12,"Orange");
((Cat)cat).getName(); // OK (same as above)
((Cat)cat).getColor(); // now we are looking at cat through the glass of Cat

You can even combine the two methods:
Pet pet = new Cat("Feline",12,"Orange");
Cat cat = (Cat)pet;
cat.getName(); // OK
cat.getColor(); // OK

Comment: Deleted mine because this is the more complete and completely correct version.
Comment: This saved my life
Comment: Can't we access the protected methods and member variables of the superclass?
Comment: @Beginner You can, but only from within subclasses.  The examples above were assuming access from outside (e.g. an unrelated class or non-member function)
Answer: Pet cat = new Cat("Feline",12,"Orange");
^^^
This is the error.

Pet does not have a Method called getColor()
You need to do:
Cat cat = new Cat(...);

Answer: When you do this :
 Pet cat = new Cat("Feline",12,"Orange");

The compiler see  the variable cat as Pet. So you can't use the specific method of Cat classe.
You have to declare cat as Type Cat to resolve your problem.
Regards.
Answer: Here you are trying to create Superclass type object(cat) using the constructor (Cat) which is a subclass method, that is not possible. this is violating the rule of Inheritance.
Pet cat = new Cat("Feline", 12, "Orange");
Answer: You can also add these empty methods to your Pet class:
public String getColor() { }
public String setColor() { }
public String speak() { }

This way you can call this method from the Pet object without having to cast it to a Cat. Once it is called, Cat's method overrides a method from superclass.
The drawback of this trick is that you have to declare an empty method in your superclass for every method that you intend to call from a subclass, which might get messy if there are multiple methods to be added. So only do it for the methods that will get used in many different subclasses.


List of types of orders available at each brokerage firm

Question: I use Merrill Edge but I find that the types of orders available to investors are quite limited. I would like to see the list of types of orders available for each major brokerage firms.
Comment: You will have to make an account with each firm and find out. Such a list would be continually changing, and is out of scope for this site.
Comment: Order types are fairly standardized and change very little.  Occasionally, brokers add some new ones but Market,  Limit, Stop, GTC, AON, orders are never going away.
Comment: OP, what's your evaluation of the Merrill Edge platform?
Answer: Basic order types available at  brokers include:

Market
Limit
Stop
AON
GTC

Some traditional discount brokers (like Ameritrade) offer additional order types:

Stop to open
Stop-limit to open
Fill or kill/all or none
One cancels other

For more than that you have to look into platforms for traders such as:
Interactive Brokers offers 60+ order types and algos:
https://www.interactivebrokers.com/en/index.php?f=4985
TradeStation offers algo apps and the platform allows you to construct your own.
Comment: Interactive Brokers has some bad reviews at https://www.yelp.com/biz/interactive-brokers-greenwich...
Comment: Some of the criticism of Interactive Brokers on Yelp is valid.  Some of it is baseless.  People with complaints are more vocal than happy campers.  If you look up other brokers on Yelp, you'll find that they all have negative reviews.  So if a negative review is going to prevent you from using a brokerage, forget about investing.


Are D-latches and D-type flipflops volatile?

Question: If there is a power cut to the CPU, will be registers clear or keep their memory?
Answer: Normal flip-flops are volatile, in that they don't remember their state when power is lost.  Usually CPU registers are made from such flip-flops, which is why you need to save stuff you want to remember accross a powerdown to special memory for that purpose.  Since non-volatile is a important attribute, this will be clearly mentioned in any datasheet for a non-volatile memory.  If it doesn't say it's non-volatile, then it's volatile (data lost on power down).
Nowadays, most non-volatile memories are EEPROM (Electrically Erasable Programmable Read-Only Memory).  Flash is a type of EEPROM that you often hear about.  It has tradeoffs that make it cheap for large memories, usually at the expense of write speed and total number of lifetime writes before it wears out.
Answer: They will loose the data as will all latches and flip-flops. They don't have a capacitor to hold charge as does flash.
Answer: Some flip flops and latches are specified to always come up in a known state when power is first applied, if the power voltage waveform meets certain requirements (typically it must start below some voltage and rise monotonically until it has reached some higher voltage).  If the power supply voltage changes in a way which does not meet that criterion, the device may or may not be reset to a known state.
For many other flip flops and latches, however,  the behavior when when the supply voltage falls below the stated requirements is completely unspecified.  As such, if a latch was high when power was switched off, it may or may not be high when power is switched back on.  Likewise if it was low when power was switched off.  Some such devices are "biased" so that when they are switched on they will likely to power up in a particular condition.  Some others, however, are not.  It is sometimes possible for a CMOS latch to "remember" its state for many seconds or even minutes when the supply voltage is zero or close to it.  What happens, typically, is that each latch contains a pair of logic gates which are wired so that when one is on the other will be forced off.  On power-up, both gates will start to switch on until one succeeds, whereupon that gate will force the other one off.  If the two gates are well-matched and neither has any residual charge, the power-on state may be largely random, but if either state has any residual charge left over from the last time the device was powered on, that residual charge may cause the latch to power up in the state it last held.
Incidentally, it's possible to design a latch with internal capacitors that will bias its power-on state to the opposite of its last state.  I've never seen this done with chips, but I have seen it done with latches made from discrete transistors; such circuits can be useful for things like divide-down counters.
Answer: These are volatile memory....they don't contain floating gate transistors....which are used to store information in absence of power supply (in case of flash memory)


Circuit containing only Hadamard gate returns bad results

Question: I am new to quantum computing. My circuit contains only one qubit, one Hadamard gate and an operation to measure the state of the qubit. So, as I understand, the qubit is in superposition state after doing through the H gate, and has a probability of 50% of being in both states 0 and 1. After I measure it, (as in we force it to get out of its wave-like state or superposition state),I always end up with an output of 1? Is not it supposed to be random (quantum randomness) ?
Comment: perhaps you could show your code? It's easier to help if we know exactly what you've tried to do!
Comment: actually its not a code but only a visualition of these quantum gates on the q-sphere. I added a picture. thank you for your help
Comment: What is the plus in a circle?
Comment: its for changing the phase and state of the qubit
Comment: Perhaps try first without those + operators. You can also try [quirk](https://algassert.com/quirk#circuit={%22cols%22:[[%22H%22],[%22Measure%22]],%22init%22:[0,1]}) to double check the results
Comment: okey thank you for your help
Answer: The problem comes from the fact the in simulation a measurement gate really measures. In other words, the result is either 0 or 1. Try to remove measurement and you will see 50:50 states 0 and 1. Then try to run your circuit on simulator. The result should be also 50:50, or very close to this distribution.
Note that you do not have to reset the qubit. At the beginning it is always in state 0. Moreover, two $X$ gates cancel each other, so you can remove it. To change the phase of your state, use only one negation.
Comment: okey i understand thank you very muuch!!
Comment: @Wiss: you are welcome. Could you please accept my answer provided your problem is solved? Thanks.


Which OAuth2 flow should I use?

Question: Context
I'm trying to build an hybrid multi-tenant API using OAuth2.0 using Laravel 8 Passport, so my system has 2 parts: one process the request from the tenant application, and the other part process the request from my front-end which allows to enable/disable features on the tenant application
Research
I'm confused with OAuth2 flows, I found multiple articles about OAuth2 flows but these 2 are the best from my point of view:
DigitalOcean Article
https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2
OAuth2 flows

OAuth 2 defines three primary grant types, each of which is useful in
different cases:
Authorization Code: used with server-side Applications
Client Credentials: used with Applications that have API access
Device Code: used for devices that lack browsers or have input limitations

In my case I didn't find useful device code, so I am going to paste only Authorization Code and Client Credentials
Grant Type: Authorization Code

The authorization code grant type is the most commonly used because it
is optimized for server-side applications, where source code is not
publicly exposed, and Client Secret confidentiality can be maintained.
This is a redirection-based flow, which means that the application
must be capable of interacting with the user-agent (i.e. the user's
web browser) and receiving API authorization codes that are routed
through the user-agent.

Grant Type: Client Credentials

The client credentials grant type provides an application a way to
access its own service account. Examples of when this might be useful
include if an application wants to update its registered description
or redirect URI, or access other data stored in its service account
via the API.

Paradigma Digital Article
(Sorry this article is in Spanish because its my native language, I pasted in English the fragments that I consider relevant)
https://www.paradigmadigital.com/dev/oauth-2-0-equilibrio-y-usabilidad-en-la-securizacion-de-apis/
OAuth 2 Flows or grant types

OAuth flows also called grant types refer to the way an application
obtains an access token that allows it to access the exposed data
through an API.
The existence of these flows by the standard arises to respond to all
the business scenarios that can occur in the consumption of APIs
according to three variables:
The type of consuming application.
Your degree of confidence.
How is the interaction by the user in the process.

Grant Type: Client Credentials

This flow represents the case in which the application belongs to the
user, so there is no need for the user to authenticate or help the
authentication server in any way to decide if access for that
application is guaranteed, that is, the access token sent by the
server is obtained by authenticating only the application, not the
user.
The main difference with the rest of the flows is that the user does
not interact in the process, so the application cannot act on behalf
of the user, only on its own behalf.

WHEN IT'S USED?

Consumer application type: Internal applications of the organization
or the data that the API exposes is not sensitive.
User interaction: none.
Application confidence level: high, usually internal, or the data
exposed by the API is not sensitive.
Communication type: server-server.

Grant Type: Authorization Code

This flow is characterized by user intervention to explicitly
authorize access to their data by the application and by the use of a
code provided by the authentication server so that the application can
obtain an access token.

WHEN IT'S USED?

Type of consumer application: web applications, it can also be used in mobile applications, but without storing the client secret and
making use of the PKCE extension, which protects against attacks that
intercept the authorization code.
Degree of trust of the application: an untrusted third party.
User interaction: explicit consent through a browser.
Communication type: commonly used in client-server communications.

Questions
From my point of view I have to use 2 flows: Authorization Code with PKCE for requests from the tenant application (considering that it is an untrusted third party) and Client Credentials for request from my front-end
Can you give me additional beginner-friendly resources to know best practices of OAuth flows (storage, requests, etc)?
What do I have to keep in mind?
Can you give me some tricks?
Can you explain me OAuth flows better or with the resources I have is enough?
How Google Cloud services such as Google Maps API Keys work?
What type and flow of authentication do they use?
Why do they generate client and secret API Keys?
Am I in the right path?
IF NOT
Which flows should I use for my multi-tenant API and why?
Can you give me some resource to help me understand OAuth2 better?
Useful links
You can read more about Laravel Passport here:
https://laravel.com/docs/8.x/passport#deploying-passport
You can read more about hybrid multi-tenancy here:
https://blog.sharetechlinks.com/hybrid-multi-tenant-saas-application-system-design/
Answer: Only PKCE is considered best practice for authentication where your client cannot securely store a secret. Think of an SPA that does not share the same TLD. If you're on the same domain or a subdomain passport can set an http only cookie when your client uses the normal laravel login. The jwt is only needed if you're on different domains or need that portability.

Which OAuth2 flow should I use?


References in supplemental material - include in main reference section?

Question: I have some supplemental material that condenses results from a couple of studies in a table (Supplemental Table 1). In the manuscript I refer to my supplemental table. My question is: where should I include the references from Supplemental Table 1? I cannot include them in the main manuscript (right?) as I do not cite these studies in the text and any journal would just list them as references that have not been cited before. I would tend to just list them right under Supplemental Table 1. Is there any correct practise?
Comment: Which journal is it?
Answer: It's common practice, however, these might differ between journals.
Likely, when you include them in the main references, they will be flagged as not being mentioned in the manuscript and removed. Unless otherwise instructed in the author guidelines of your journal of choice, simply add them to the supplementary material and see what happens.
Comment: Then again, if not being cited in the manuscript they might not be indexed by databases.


Is it possible to screenshot a window without the frame?

Question: Can I screenshot a window without its frame so the Title, the Close, Minimize, Maximize Buttons and the System time will not be visible?
How?
Answer: You can use custom screenshot area.
Press Shift+PrtScr, then select the area you want.
Comment: While this is true, it does not accurately answer the question, as there is no guarantee to always get the full window frame every time. One must be exactly accurate when doing this, which can be quite difficult on high resolution screens (200+ dpi). One cannot select an area, adjust the selection, and then capture the result. Good for some things, like grabbing sections of a window, but not great for other things, like all of a window without the title bar.
Comment: this is pretty cool and saved a lot of time I usually spend in cropping.
Comment: This will generate a PNG on `~/Pictures`. With **C**trl to clipboard. More [here](https://askubuntu.com/a/951312/349837)
Answer: There is an application called Shutter. You can use it to take a screenshot of a specific area, window, your whole screen, or even of a website – apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window.
You can download the software directly from Ubuntu Software Center. Search for Shutter.
You can also go to this link to view the installation instruction.
To exclude window decorator, go to:
Preferences -> Advanced -> Window Capture:

then uncheck Include window decoration when capturing a window
Also when you run the application, you can click on the Selection button to select a specific part of the window.
If you want to customize shortcuts to make it more suitable, thanks to User: Redbob for pointing it out, have a look here.
Comment: Sorry, I didn't notice that it was on Ubuntu Software Center. I have updated my answer.
Comment: yes but does Shutter have an option specifically for this? If so, how do I select it? If not, how can I most easily approximate this effect? Also, since the app in in Ubuntu repositories, it can be installed with `sudo apt install shutter`. Is there a compelling reason to install it a different way?
Comment: It is not necessary to install additional software to perform the action asked for in the question. There are plenty of additional apps that can do it as well, Shutter is a personal preference.
Comment: If you prefer, you can customize shortcuts to make it more suitable. Look at this: https://askubuntu.com/questions/252717/how-to-make-shutter-as-the-default-screenshot-tool
Answer: Yes, and no, depending on several factors. Applications which use client side decorations will not be able to hide the frame.
To take a screenshot without decorations, when it is possible to do so, you can run the screenshot tool from the dash (or gnome-screenshot), and select to Grab the current window, and then un-check the options for Include the window border.
You can also create a custom keyboard shortcut so that pressing the Print key, will open this app instead of automatically saving a screenshot, in System Settings.
Update 2022: The screenshot tool has been changed somewhat dramatically in recent GNOME releases, and the window border option is no longer there, as GNOME relies heavily on client side decorations and so there is no separation between the border and the window as such, any longer.
Comment: "and then un-check the options for Include the window border." recent version of this tool seems to have removed that option :-(
Answer: A pure command line solution also suitable for scripts is scrot, which does not capture the window manager border by default when in window mode. To choose a window with your mouse (-s) and save a screenshot of it in ~/screenshot.png, do:
scrot -s ~/screenshot.png

To save a screenshot of the then active window (-u) in ~/screenshot.png 5 seconds after you started the command (-d 5) and automatically open it in gimp (-e 'gimp $f') afterwards, do:
scrot -u -d 5 ~/screenshot.png -e 'gimp $f'

Further reading

man scrot


Kaluza Klein theories, dilation field, and dimensional reduction

Question: I am reading something about Kaluza Klein theories and compactification. I have some conceptual question:
(1) Why do we call the fifth scalar field $\Phi$ the dilation field? Is there any scaling property for that?
(2) What happens to this field after dimensional reduction?
Many thanks if you can provide me with further reading material! :)
Comment: As John Rennie pointed out it is called the [dilaton field](http://en.wikipedia.org/wiki/Dilaton). It is related to the size of the manifold we are using for the compactification.
Comment: *dilation* or *dilaton*?
Comment: Thank you! Sorry I guess it is a auto correction of words generated by my Mac. It seems Mac does not know dilaton at all...:)
Answer: Let us quickly run through the standard KK compactification. We start with a $d+1$ dimensional
theory
$$
S = \frac{1}{16\pi G_{d+1}} \int d^{d+1}x \sqrt{G} R_{d+1}
$$
More general actions on the $d+1$ dimensional space can be considered, but this will suffice for our purposes. The metric $G_{MN}$ can be decomposed as
$$
ds^2 = G_{MN} dx^M dx^N = e^{2\Phi} \left( dt + A_\mu dx^\mu \right)^2 + g_{\mu\nu} dx^\mu dx^\nu
$$
We assume now that $t$ is the compactified direction with $t \sim t + 2 \pi R$. The theory has the following symmetries

$d$-dimensional diffeomorphims, $x^\mu \to x'^\mu(x)$ under which $A_\mu$ and $g_{\mu\nu}$ transform as rank 1 and 2 tensors respectively.
Gauge transformations along the compactified directions, $t \to t + \lambda(x)$, $A_\mu \to A_\mu - \partial_\mu \lambda$. This symmetry essentially describes the local choice of origin in the compactified direction.

Now, if the length scales of our problem are large compared to the radius of the compactified circle $R$, we then assume that $\Phi$, $A_\mu$, and $g_{\mu\nu}$ are only functions of $x^\mu$ and not $t$. (This is only done here to make things simpler. One can consider the more general case where the fields are expanded into modes in the $t$ direction. This gives us massive particles in the $d$-dimensional space. We will not consider this here). With this assumption, we find
$$
R_{d+1} = R_d - 2 e^{-\Phi} \nabla^2 e^{\Phi} - \frac{1}{4} e^{2\Phi} F_{\mu\nu} F^{\mu\nu},~~ \sqrt{G} = e^{\Phi} \sqrt{g}
$$
The action then takes the form
$$
S = \frac{2\pi R}{16\pi G_{d+1}} \int d^d x \sqrt{g}  e^{\Phi} \left[  R_d - \frac{1}{4} e^{2\Phi} F_{\mu\nu} F^{\mu\nu} + \nabla_\mu \Phi \nabla^\mu \Phi \right]
$$
Thus, we note that in the $d$-dimensional space, we have a gauge field and a scalar field. The action is not quite in the Einstein-Hilbert form since the scalar field $\Phi$ couples to $R_d$ and $F_{\mu\nu} F^{\mu\nu}$ non-trivially. Also, the kinetic term for $\Phi$ has the wrong sign. This field is called the dilaton.
To understand why $\Phi$ is called the dilaton (related to dilation, or in other words scale), let us go back to the $d+1$ dimensional metric. Consider the $S^1$ living at a fixed point $x^\mu$. The induced metric on this circle is
$$
ds^2_{S^1} = e^{2\Phi(x^\mu)} dt^2
$$
The size of this circle is
$$
\int ds_{S^1} = \int_0^{2\pi R} dt e^{\Phi(x^\mu)} = 2\pi R e^{\Phi(x^\mu)}
$$
Thus, we see that the effective radius of the circle at $x^\mu$ is $R e^{\Phi(x^\mu)}$. In other words the dilaton field controls the size of the circle.
As an aside, the compactified action above is written in what is called the string frame (name comes from string theory). It possible to go to the more standard Einstein frame (where the action takes the form $\sqrt{g} R$, etc) by doing a field redefinition $g_{\mu\nu} \to e^{2\omega} {\tilde g}_{\mu\nu}$ and appropriately choosing $\omega$. In this frame, the scalar kinetic term has the right sign. However, we still have a non-trivial coupling to $F_{\mu\nu}F^{\mu\nu}$.
Comment: $t$ is not a time-like coordinate (take a look at the metric signature). The remaining $x^\mu$ might have a time-like coordinate if you wish. The discussion however, is completely general.
Comment: Thanks a lot! Sorry for delayed reply. Your answer is very informative and helpful. :)
Just two quick question. (1) So in the first compactification scheme you eliminate coordinate $t$, and $\mu$ denote the index range from 1 to d. So in the remaining coordinate will there be timelike direction? Namely is Minkowski signature preserved here? (2)Also, what about other compact manifold for $t$, will the statement that the dilaton field control the geometrical size of the manifold still holds?
Comment: Can I ask something about this scalar field (dilaton). I read that originally it was just put constant, but I dont see why this is the case. On the other if it has its own dynamics, than how can we fix the radius of extradimension and also wouldnt it affect the other two terms in the action due to its coupling to them? Thanks


Ajax.Actionlink, partial and webgrid issue

Question: The issue is same as the one posted here Ajax.Actionlink, partial and webgrid issue
The solution to use "Refresh" method does not work for me because I have three webgrids in my page. Please suggest how to solve this.
Answer: You webgrid is obviously using AJAX, i just didnt use AJAX to solve my issue.
Obviously not a real solution, but i will do for now until i can sit down and look at it again.
Btw i am the OP from that thread.


Largest Heap used in a managed environment? (.net/java)

Question: What is the largest heap you have personally used in a managed environment such as Java or .NET?  What were some of the performance issues you ran into, and did you end up getting a diminishing returns the larger the heap was?
Answer: I work on a 64-bit .Net system that typically uses 9-12 GB, and sometimes as much as 20GB. I have not seen any performance problems even while garbage collecting, and I have been looking hard as I was not expecting it to work so well.
An earlier version hung on to some objects for too long resulting in occasional GCs that freed up 3GB+. Even then, there was no noticeable impact on performance. The system is running on a 16-core server with 32GB RAM, which probably helps...
Answer: In .Net, on Windows 32-bit, You can only really get to about 1.4 GB of memory usage before things start getting really screwy (out of memory exceptions).   This is due to a limitation in 32 bit windows that limits a single process to using more than 2 GB of RAM.  There is /3GB switch you can put in your boot.ini, but that will only bring you a little bit further.  If you want to use lots of memory, you should seriously consider running on a 64 bit version of windows.
Answer: I currently have a production application with 6 GB of memory. You'll need a 64-bit box as well for the JVM to be able to address that much.
The garbage collector is really the only thing (that I've found so far) where performance degrades with size, and then only if you manually kick off a System.GC, which forces the JVM to bring everything to a screeching halt as it traverses 6 GB worth of objects. Takes a good 20 seconds, too. The default GC behavior does not do this, BTW, you have to be dumb enough to make it do that. Also worth researching JVM tuning at this size.
You can also find things like distributed and clustered JVMs, sorry, don't have any good references as I didn't look into this option too closely, although I did find references to larger installations.
Answer: I am unsure what you mean by heap,  but if you mean memory used, I have used quite a bit, 2GB+. I have a web app that does image processing and it requires loading 2 large scan files into memory to do analysis.
There were performance issues. Windows would swap out lots of ram, and then that would create a lot of page faults. There was never any need for anymore than 2 images at a time as all requests were gainst those images (I only allowed  1 session per image set at a time)
For instance, to setup the files for initial viewing would take about 5 seconds. Doing simple analysis and zooming would be fairly fast once in memory, in the order of .1 to .5 seconds.
I still had to optimize, so I ended up preparsung the files and chopping into smaller peices and worked only with the peices that were required by the user at the time.
Answer: I have used from 2GB to 5GB of memory in java, but usually when I get to more than 2GB I really start thinking about memory optimization. Diminishing returns can vary from not optimizing when it's necessary because you have a lot of memory, to not having memory available for the OS/Disk caches (which can help your application overall).
For Java, I recommend watching your memory usage per generation over time. Do you create a lot of temporary objects or have long-lasting objects that consume a lot of memory? A lot of optimization of memory can be done when knowing those things.


a secure password VS a strong password

Question: I wonder whether a secure password and a strong password are synonyms or not.
Could you tell me please the difference between them?
Comment: https://security.stackexchange.com/
Answer: "Strong password" will likely be used if you have an algorithm that measures password strength. But such algorithms can be wrong, and a "strong" password may be insecure. "Secure password" is a password that is actually secure.
For example, a password may be very strong, 20 letters and digits. But if you use the same strong password on many sites, and one of those sites is careless and leaks your password, then it is still strong but not secure anymore.
Answer: The terms are often used as synonyms, but they indeed have slightly different implications.
A strong password typically refers to a password that is difficult for others to guess or crack through automated methods (such as brute force) involving a combination of letters, numbers, special characters, and length.
A secure password is a broader concept, taking into account additional factors, such as management practices and the overall security of the accounts it protects. In other words, it adds the way that the password is managed and protected (for example, how many times you change your password, if you share it with other people, where you store it).
Even though is hard to affirm that a password is 100% safe, MFA and password managers help with security. Basically, combining both strength and good security practices is your best bet to keeping it safe online.
Answer: The two are often used interchangeably, but they're not the same. A "strong password" is one that's relatively difficult to guess by brute force.
There's no such thing as a "secure password" because no password is truly secure. All passwords have vulnerabilities, including being phished.
I don't know what the context is you're talking about but "strong password" is almost certainly the better choice.

a secure password VS a strong password


The use of be form twice in one sentence

Question: Is it correct to write a phrase like "The guy that is responsible is David"?
Comment: Why do you think it might be incorrect?
Comment: The sentence is correct. It could be shortened to "The guy responsible is David".
Comment: If you think it sounds weird, it's because in speech and informal writing the first "is" would probably usually be contracted - The guy that's responsible is David.
Comment: @LawrenceC Is Armen's sentence correct where he put the adjective after the noun?
Answer: Well, it's OK if you're just chatting, but when writing more formally or academically repetition like that is not considered to be good style so it would be better to change one of the verbs e.g. "David is the person responsible."
Comment: Who say's it's not good style? The use of 'guy' rather than 'man/person' may make this particular sentence informal, but the construction itself is not informal.
Answer: You can have two of the same form of 'be' in one sentence if they are in separate clauses. In this sentence, the main clause is 'The guy is David', and subordinate clause is 'that is responsible'.
Comment: Or even if they aren't: "She's being silly."
Answer: There isn't any rule analogous to the "double negative" rule for be verbs.
If you're worried that you're producing two verbs for the sentence, let's take a look at what you're saying:

The guy that is responsible is David.

Here, that is used to mark a non-essential clause. These phrases provide extra information, and can be removed from a sentence without compromising the grammatical structure of the sentence. Let's do that.

The guy is David.

A rather simple sentence, and perhaps a bit awkward, but technically correct, nevertheless. This shows that your non-essential clause wasn't making your sentence incorrect. In proper context, it could even be usable:

"We need a guy who really knows his way around Oracle systems." "'That guy' is David."

Here, the first speaker desires an employee who's good at working with a specific piece of software. The second employee points out that they already have someone hired with the proper qualifications. I changed "the" to "that" because it is more idiomatically appropriate, and most likely how you'll see a sentence with that structure used.


How does firefox cache DNS requests/replies?

Question: I was wondering how, if it all, does firefox cache say, google.com to its respective IP?
Answer: It caches it short-term, but I don't know the particulars of the backend. You can see this when DNS doesn't resolve, and you use the refresh button only to find you quickly land on the Server Not Found page again; but, if you click the "Try Again" button on that page, it re-queries the DNS server. Or, if you close and reopen Firefox, the cache will have cleared.
I've found this out through pure experimentation; I've been doing quite a bit of DNS settings changes lately.
This article claims that "In Firefox, by default, the DNS requests are cached for only 1 minute." but it is dated August 2007, so things may have changed by now. (see below)
To control the cache settings, you might try the DNS Cache extension or the Clear Dns Cache extension.
You can also tweak the about:config setting network.dnsCacheExpiration to manually set the cache time; its default is 60 seconds, confirming the above article. Or network.dnsCacheEntries controls the maximum number of cache entries. You will likely need to add these settings to the about:config page yourself (New > Integer), and setting either one (or both) to 0 should disable the cache.
Comment: Values shown in `about:networking#dns` reveal that Firefox seems to be adding the `about:config` values `network.dnsCacheExpiration` (default 60) and `network.dnsCacheExpirationGracePeriod` (default 60), arriving at a default TTL of 120 seconds (not honouring the TTL returned by the name server, which to my knowledge is against the DNS spec, as caching _longer_ than TTL is forbiddn).
Comment: However, setting these values so that the sum is less than 60 still seems to result in 60 seconds appearing in `about:networking#dns`. Also, [this article](https://daniel.haxx.se/blog/2018/06/03/inside-firefoxs-doh-engine/) and [this code](https://searchfox.org/mozilla-central/rev/9ee63566281365f26e7a4b06c9d4e2219e64c3e8/netwerk/dns/nsHostResolver.cpp#1577) suggest that if DNS-over-HTTPS ("TRR") is used, then Firefox will honour the TTL.
Comment: I found the [code](https://searchfox.org/mozilla-central/rev/9ee63566281365f26e7a4b06c9d4e2219e64c3e8/netwerk/dns/nsHostResolver.cpp#217) responsible for setting the sum < 60 not working. `valid` here is `dnsCacheExpiration`, `grace` is `dnsCacheExpirationGracePeriod`. Indeed it uses `valid + grace`, and make sure that it's at least 60.
Answer: In the end of 2008 (released in 2009) Mozilla implemented DNS prefetching or pre-resolution in Firefox 3.1 (3.5), the discussion and code changes are available at bugzilla's bug 453403. Since then the defaults are network.dnsCacheExpiration equal to 180 seconds and network.dnsCacheEntries equal to 400 entries. This ensures more cache hits, especially useful when DNS prefetching is enabled. Previous values were 60 and 20, respectively. Check your settings in about:config and if these two have old values update them for better performance.
A look at Firefox's code reveals that network.dnsCacheExpiration is converted to minutes as an integer, so for instance every value in the range 120-179 for this setting equals 2 minutes of TTL. Negative records are cached for exactly 1 minute (not configurable; hardcoded).
If you perform a request for a domain which has been negatively cached Firefox displays the Server not found page with the "Try again" button. At the same time an attempt to resolve the domain again is performed in the background. That's why when there has been just a short problem clicking on the "Try again" button opens the site immediately.


In memory links or hidden properties to a node

Question: Are in memory links or hidden properties to a node possible in Neo4j or using it's related languages(Cypher, Gremlin etc.,)?
Answer: The closest you can come to in-memory relationships is to begin a transaction, create the relationships, do your query and then roll back the transaction. However that imposes a write lock on the start and end nodes of the relationships you are creating.


How do I publish an answer to a question I had which was not asked here?

Question: I figured out an answer to a question, and I wanted to share it with the community. How do I do that? I posted a "question" whose body contains my suggested solution, but that seems misaligned with the process implied as I understand it.
Comment: If I understand you correctly you *can* answer your own question, happens all the time.
Answer: Questions exist for good answers, so of course it's OK to ask a question if you already have a good answer.

https://apple.stackexchange.com/help/self-answer

I find making the question as short as possible and the answer as detailed as needed works best, but the editing process can clean up most posts if needed later.
Just be sure that you don't put any part of the answer in the question section - there needs to be two parts since this isn't a forum or blog hosting service.
Comment: Thanks for the tip! I followed your advice (I think ...) and posted an actual question and answer.


How to extract the x and y positions of several circles on an illustrator file

Question: Someone would have already used a code with power shell to extract the x and y positions in text file of different circles of the same illustrator file ? I tried with different codes found on this website but they don't work on power shell
Comment: is there any particular reason why you want it to be done in powershell? Also is there a particular reason why it needs to be put into AI trough code. I mean you can compse SVG, EPS, DXF or PDF directly too. What does the file look like?
Comment: You could use ExtendScript within Illustrator and do something like this: https://graphicdesign.stackexchange.com/a/100961
Comment: there isnt really any reason you couldnt use powershell. But rather its a bit pointless without knowing why one would bother to make a tool that strictly works outside of normal ecosystem for no benefit. The question then arises why bother going there if you dont know how to translate the VB api documentation to powershell yourself? And is that even on scope here? But yes i might answer if the question is sufficently motivating.
Comment: @sbmae Yeah but thats not true at all. Illustrator comes with extendscript toolkit so all of the extendkit toolkit scripts work as is even if you dont have anything else. Also why dont you just export the file as dxf directly form illustrator no scipting involved.
Comment: Why don't you just export to DXF then? Illustrator can export to DXF.
Comment: You need to tweak the code to fit your needs. It was just meant as inspiration.
Answer: No answer to the question, but your shown image is so simple and regular that you can easily calculate the coordinates of the circles one by one with a calculator or all of them at a same time with a spreadsheet.
Think a plane filled by a pattern of equal equilateral triangles. The circles are at the vertices of the triangles. If the X distance between the midpoints of adjacent circles on horizontal lines is 1 unit, the Y-distance between two horizontal lines is 0,866 units and the adjacent horizontal lines have X-difference 0,5
The 0,866 is actually a rounded version of the exact number. Instead of 0,866 use in your calculations the squareroot of 3/4. Use as many digits as your calculator gives for the best possible accuracy.


.NET ListView row padding

Question: There doesn't seem to be a way to change the padding (or row height) for all rows in a .NET ListView. Does anybody have an elegant hack-around?
Comment: Not specifying the View makes the question either too broad or unclear.
Answer: I know this post is fairly old, however, if you never found the best option, I've got a blog post that may help, it involves utilizing LVM_SETICONSPACING.
According to my blog,
Initially, you'll need to add:
using System.Runtime.InteropServices;

Next, you'll need to import the DLL, so that you can utilize SendMessage, to modify the ListView parameters.
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);

Once that is complete, create the following two functions:
public int MakeLong(short lowPart, short highPart)
{
    return (int)(((ushort)lowPart) | (uint)(highPart << 16));
}

public void ListViewItem_SetSpacing(ListView listview, short leftPadding, short topPadding)
{
    const int LVM_FIRST = 0x1000;
    const int LVM_SETICONSPACING = LVM_FIRST + 53;
    SendMessage(listview.Handle, LVM_SETICONSPACING, IntPtr.Zero, (IntPtr)MakeLong(leftPadding, topPadding));
}

Then to use the function, just pass in your ListView, and set the values. In the example, 64 pixels is the image width, and 32 pixels is my horizontal spacing/padding, 100 pixels is the image height, and 16 pixels is my vertical spacing/padding, and both parameters require a minimum of 4 pixels.
ListViewItem_SetSpacing(this.listView1, 64 + 32, 100 + 16);

Comment: `LVM_SETICONSPACING` only applies to ListViews in Icon view.  Any way to do an equivalent thing when in Details view to change the row padding (not the row height, which as @Joel Lucsy says can be done with an imagelist)?
Comment: Please post relevant content from the blog post in your answer.
Comment: Where does the value `53` come from in `const int LVM_SETICONSPACING = LVM_FIRST + 53;`?  Shouldn't that be a constant with a comment describing its purpose and meaning?
Comment: The reason I ask is I'm dealing with different DPIs and trying to calculate layouts based on ratio.  I don't know if 53 has something to do with pixels in which case it would be different at DPI != 100%.
Answer: A workaround is to use an ImageList that is as tall as you want the items to be. Just fill a blank image with the background color. You can even make the image 1 wide so as to not take much space horizontally.

.NET ListView row padding


Which are the differences between the verbs "to say" and "to tell"?

Question: i don't know in which contexts I have to use One of these two verbs?
Can anyone help me?
Comment: Do you have specific examples that you are unclear about? Please [edit] these into the text.
Answer:
say (v): Utter words so as to convey information, an opinion, a feeling or intention, or an instruction.
tell (v): Communicate information to someone in spoken or written words.

At a basic level, "say" is to utter information out loud.  "Tell" is to the same thing, to other people.  This is why "say" has only a direct object,

I have something I want to say.

while "tell" normally has both a direct and an indirect object.

I have something I want to tell you.

Not quite a duplicate question, but more information
Keep in mind that both "say" and "tell" are fundamental verbs with many definitions, all of which you should learn by hearing native speakers use them in context.  For example:

A: It's so hot!  What does the thermometer say?
  B: I can't tell.  The humidity has fogged up the glass.


Is it safe to make chicken stock, forgot to turn crock pot on!

Question: I cooked a whole chicken in the crockpot today and then put all of the veggies/herbs in to make stock from the bones. I just realized I forgot to turn it on for the stock and it's 5.5 hours later. Is it be unsafe to make the stock at this point?
Comment: A couple questions for clarification.  I assume you cooked the chicken in water or broth first (meaning the crock pot was hot when the chicken finished cooking)?  What did you do next?  Did the chicken spend any part of that 5.5 hours still hot in the crock pot or did you remove everything to cool?  Basically, can you elaborate on the steps you took and what was hot and what was cooled during the process and how long those steps took - I think the safety can be better assessed knowing how much time the components spent in temperature transition.
Answer: Bone broth is supposed to be cool when you add the vinegar to it. And then it's supposed to sit up for a half hour or so in order to let the vinegar draw the minerals, etc., out of the bone. So really at the time of this writing you've let the stock, which has already had all potentially harmful micro-organisms neutralized by way of boiling, sit up for just a few additional hours. On top of that, in order to make a good poultry bone broth you're going to bring it all to a boil again and let it simmer for another 24 hours. There's no chance anything bad is going to survive that onslaught. And there's no way mere stock, fresh off its cool down cycle, has had a chance to take in any new micro-organisms capable of forming the kinds of toxins which aren't resistant to such treatment. You're fine. And hats off for going paleo!
[EDIT]
By saying that the stock hasn't had a chance to take in any new micro-organisms capable of forming the kinds of toxins which aren't resistant to such treatment, this really is to acknowledge that some micro-organisms cannot be destroyed by boiling and, as pathogens, are the by-products of bacterial growth; since your stock has not had the time/opportunity to engender or accommodate bacterial growth, (thus the term new), there can be no reason to anticipate a consequent whose known antecedent is lacking. No new bacteria, no possibility of new toxins ...unless introduced from some flukish or otherwise uncommon manner of uncarefulness, (a cat's paw?), which would be a whole other matter. It is almost always possible to imagine contingencies which, for their very particulars, disallow of what would normally be sound advice.
Comment: Here observing the occasion of a down vote, please know that I would welcome as a courtesy any clarification as to what might be incorrect and am sure it may also help other readers to avoid confusion who, upon seeing a down vote, find themselves unclear on what might be incorrect too.
Comment: I am not the downvoter, but I suspect the -1 is because you have not described any of the risks inherent in having food at the temperature danger zone for several hours. There are some things reboiling can't fix (like build-up of toxic waste matter from some types of bacteria).
Comment: Also not the down voter have just upped it for you. I'd hazard a guess at a member of the 'if in doubt throw it out' brigade is responsible.
Comment: This seems to make a lot of assumptions about the OP's process.
Comment: @sourd'oh, if you would be willing to take time to describe any of what you have in mind I would be glad to modify my answer in such a way as to make sure it more fully reconciles with the principles of reason.


Why is HistGradientBoostingRegressor in sklearn so fast and low on memory?

Question: I trained multiple models for my problem and most ensemble algorithms resulted in lengthy fit and train time and huge model size on disk (approx 10GB for RandomForest) but when I tried HistGradientBoostingRegressor from sklearn the fit and training time is just around 10 sec and model size is also low (approx 1MB) with fairly accurate predictions. I was trying out GradientBoostRegressors when I came across this histogram based approach. It outperforms other algorithms in time and memory complexity. I understand it is based on LightGBM from microsoft which is gradient boost optimised for time and memory but I would like to know why is it faster (in more simple english than explained in docs) and low on memory? If you could post some resources which explain this better, would help too.
Answer: In case you hadn't seen the User Guide section for this method, the explanation there is pretty good:

These fast estimators first bin the input samples X into integer-valued bins (typically 256 bins) which tremendously reduces the number of splitting points to consider, and allows the algorithm to leverage integer-based data structures (histograms) instead of relying on sorted continuous values when building the trees.

In the usual tree-building algorithm, for a continuous feature, every split point between consecutive data values is considered. By binning, the number of split candidates is vastly reduced (for large datasets with continuous features).  Memory needs are also reduced, because the actual feature values aren't always needed, just counts (and other statistics?) among the bins.


Deep Learning for Time series

Question: Deep Learning is an excellent model for classification problem such as image recognition or object detection. Can we use deep learning for regression problems - Time Series prediction ? So if it can, how can we build structure of deep learning. I mean how to building layer to extract features from time series.
Answer: Recurrent neural networks (RNNs) can work with series as input or output or both.
Even a simple one-layer RNN is effectively "deep" because it has to solve similar problems as multi-layer non-recursive networks. That is because backpropagation logic in a RNN has to account for delay between input and target, which is solved by backpropagation through time - essentially adding a layer to the network for every time step of delay between first input and last output.
RNN architecture has become more sophisticated in recent years by using "gating" techniques such as Gated Recurrent Units (GRU) or Long Short Term Memory (LSTM). These have multiple trainable params - 3 or 4 - per neuron, and the schematics are more complicated than feed-forward networks. They have been demonstrated as very effective in practice, so this extra complexity does seem to pay off.
Although you can research and implement RNNs yourself in a library like Theano or Tensor Flow, several neural network libraries already implement RNN architectures (e.g. Keras, torch-rnn)
Comment: You have any experiments about tuning RNN parameters? In particular, I still have stucked in choosing optimal parameter.
Comment: @TrầnĐứcNhuận: No, sorry. I am still learning about RNNs and don't have much experience yet, just what I have seen in blogs, video lectures.
Comment: @TrầnĐứcNhuận You can use random search to find an almost optimal set of hyperparameters for your model.

Deep Learning for Time series


How can an email sender include his PGP key, so I can answer with an encrypted mail?

Question: Let's say I were to post my e-mail address and public PGP key to my website. When a client contacts me, they would have to include their PGP public key in the e-mail so that I can respond to them in encrypted PGP format, am I correct? Or is there some other way to reply to them without them having to include their PGP public key in the email?
Answer: If the correspondent's key is posted to a public key server, e.g. pgp.mit.edu, your email client can probably find it.  If not, the correspondent has to to supply it.  Read carefully the answer by fgrieu concerning trusting keys supplied in message from another.  It's not safe.
(You should consider posting your public key on a key server, too, and read about PGP/GPG key signing: https://www.google.com/search?q=pgp+key+signing because a signed key is less susceptible to attacks that replace your key with another's.)
Comment: @user80160 If the answer satisfies you, please accept the answer. Thanks!
Answer: You are correct that you need your client's PGP public key in order to use PGP to either

send to your client confidential information ;
confirm that information allegedly from your client is actually from that source.

But it is questionable that you can safely get your client's PGP public key using only the procedure considered:

When a client contacts me, they would have to include their PGP public key in the e-mail

Problem is, you do not know for certain if the email you received contained your client's PGP public key, or a public key apparently from your client (with your client's name or/and email) but actually made by Eve impersonating your client, and Eve the only holder of the corresponding private key.
One way to confirm that a PGP public key belongs to someone is to cross-check the key's fingerprint in a face-to-face meeting; or, by extension, by phone.
Another is to to check that the public key comes with signature certifying that the public key actually belongs to who it appears to belong to (as identified e.g. by the name and email in the public key), the signature being made by someone/something for which you already have a trusted public key, and who you trust to make correct decisions when signing PGP keys; PGP makes this relatively easy, see PGP web of trust.
Note: if your client is defined as whoever actually prepared that initial email's attachment, then your procedure is indeed secure.
Note: As to an alternate mean to get your client's alleged PGP public key (using a server), NOT solving the above confidence-in-the-key issue, I refer to this answer; it also gives the valid advice to try and have your own public key signed by reputable parties.
Answer: Some options:

Ascii armor the public key and provide it as an attatchment for all emails
Sign the email with the private key
Utilize a web of trust to link a mutual relationship between you and the sender


Variations in regional terms in USA

Question: I was born in East Tennessee and have traveled extensively in Middle Tennessee and West Tennessee.  I live in South Florida and have visited Northern California.  Does anyone know why there is a difference in the construction of the modifiers to the state names?  East Tennessee, and so forth, are part of the Tennessee State Constitution.
Comment: To clarify, are you asking why it's NorthERN California not North California, East Tennessee not EastERN Tennessee, etc?
Comment: pbasdf, you have understood me perfectly.
Answer: Tennessee is unusual among states; most geographical designations are not defined in law.  For example, West Texas and East Texas have no specific boundaries, and people have different ideas about how a line between them might be drawn. This is true as well of Northern and Southern California.
Wikipedia notes about East Tennessee:

Unlike the geographic designations of regions of most U.S. states, the term East Tennessee has legal as well as socioeconomic meaning. East Tennessee, along with Middle Tennessee and West Tennessee, comprises one of the state's three Grand Divisions.

https://en.m.wikipedia.org/wiki/East_Tennessee
There are some geographical designations that cover more than one state, such as the Great Plains or Appalachia, which includes East Tennessee, as you know, and all or parts of other states.  Southern California includes the high desert and the loe desert, designations that are sometimes used in weather reports.
Comment: In Britain we have East and West Sussex (counties) and Northern Ireland (a country, province or region). These all have legally defined boundaries.
Comment: Thank you!  You have provided me with some historical context.
Comment: I forgot North, West, and South Yorkshire, three counties. There is Western Australia (a state), and Samoa (a nation) was called Western Samoa before 1997.

Variations in regional terms in USA


Is the VNA incident signal sine or cosine?

Question: I wonder what kind of the input power signal is in the S11 parameter. Is the sine or cosine I know correct?
Answer: Well, a S11 number is a phase and amplitude for a single frequency, so yes, w.r.t. that frequency the excitation is a harmonic oscillation (i.e. a cosine with any arbitrary phase, which includes the sine). These are the only signals that have only one frequency, so your question answers itself!
However, there's nothing wrong with testing multiple frequencies at once, when looking at a linear system (like the ones you can describe with S-parameters). In that case, the signal is composed of harmonic signals – but that, says Fourier, can be done to any sufficiently well-behaved signal, anyways.
Note that a VNA might still choose to only emit a clean-as-possible single tone – if any of the system parameters is non-linear, you'd be in deeper trouble if you had multiple tones to intermodulate.
Comment: Is there any product marketed as a VNA that uses a stimulus other than a single tone sinusoid? If an instrument uses a non sinusoidal stimulus I might call it a TDR,or something else, and it might be able to do equivalent measurements,  but I wouldn't call it a VNA.
Comment: Don't know about *products*, but I've seen multiple SDR projects approach things like that. Also, not the craziest thing to do if you're able to produce a frequency comb to begin with (but I don't think these things are called VNA in the optical domain). But yes, as said, there's very good reason to *not* go multi-tone (or even wideband) for sensing. (Unless you're building a passive intermodulation tester + VNA, which is a thing, too.)
Answer: The only difference between a sine and cosine is the phase, or time reference. When your VNA generates a single frequency, you can describe it as sine or cosine, or -sine or -cosine, the signal is the same but for the reference.
The in the S11 measurement, the incident signal at the reference plane is taken as the reference for the reflected signal, so the S11 measurement is the same however you describe the incident signal.


ROC curve question

Question: I know the the discrimination of a ROC curve is optimal when the curve goes through the top left corner. But does this also count for the bottom right corner?
Answer: Yes it does count for the bottom right corner. If the ROC curves inwards perfectly to the right corner it means you've got your results inverted but you are still correctly identifying all TRUE positives(but calling them FALSE) without any FALSE Positives (all your TRUE negatives are called TRUE). You just need to invert your results, i.e. convert all your FALSEs to TRUE and TRUEs to FALSE.
Comment: If this response answers your question, please select it as your answer by clicking on the check mark.

ROC curve question


How can I tell if I'm in a rest area?

Question: I must be missing something obvious, but I can't figure out how to tell if I'm actually in a rest area or not.  Is there some buff or tooltip I'm missing?
Comment: Doesn't it pop up a big notice in the middle of the screen when entering and exiting rest areas? Alternatively, Cantina's are rest areas. As is your ship (I think).
Comment: For additionnal info, The imperial fleet and the republic fleet (on the main level) are rest areas.
Answer: Anywhere in your ship is a rest area. Most parts of cantinas and in the fleet are rest areas.
You can tell when you enter and exit them by a screen message, and an ops message in your log.
But if you missed the enter message, the easiest way to check if you are currently in a reset area is to mouse over the experience bar and leave your cursor there for a bit. If you are in a rest area, it should start ticking up your accumulated rest amount fairly quickly. Earlier levels not as quick, but once you reach level 15 or so the rest should be ticking up by 1 every couple seconds or so. (That's just an estimate; the point being it doesn't take too long for it to increase, if you're in a rest area.)
As far as I know, there aren't any persistant UI indicators for being in a rest area, unlike some other MMORPGs — if that's what you were hoping.
UPDATE: Since free-to-play has been implemented, it has been changed in that free-to-play users do not receive rest XP. Therefore the "rest XP" numbers won't increase for you until you become a paid subscriber. You will see a message to this effect when you mouse over the XP bar in a rest area.
Comment: Another way to distinguish is trying to log out: in a rest area, you are given a *yes/no* choice; outside a rest area you're given an *immediate/no* choice.
Comment: under those numbers he's talking about, it also says "You are in a rest area, as you stay here you build up double exp" all in the same popup tool tip.
Comment: Either by client is broken in this regard, or they've changed it: I see neither the rested xp ticking upward (I see a change when I move the mouse off the bar and back: the rested value has changed), nor do I see a "You are in a rest area".
Comment: The free to play model has changed this. Non-subscribers do not get rest XP and therefore do not see the described UI effects.

How can I tell if I'm in a rest area?


3 way swing arm wall mount lighting

Question: Looking to buy a wall mount swing arm lamp, and it has a 3 way switch in it with a 60 watt minimum rating to 150 watt maximum rating. I understand the reason for maximum rating but not minimum rating ? I want a lower low setting around 30 to 40 watt but mfg. said 60 minimum....Why
Comment: Actually you're much better off with a 3 way led - might be 6w/10w/16w or similar. Model # of lamp?
Answer: A standard 3-way bulb consists of two filaments (or light sources in non-incandescent bulbs). Low is when the dimmer of the two are on, medium is when the brighter of the two is on, and high is when both are on. So, you'll find that the high wattage is equal to the low plus the medium wattages.
Take a look at Amazon's stock of three-way bulbs. There are lots of 50-100-150 bulbs, plus smaller numbers of 50-200-250, 30-70-100, and 100-200-300 bulbs. In each case, high = low + medium, and generally the medium wattage is twice to four times the low.
If you want a very low low setting, then that has to be the same as the difference between the brightest and the next-to-brightest setting. So, let's say you want a 150W bulb whose lowest setting is 10W. To get that, the bulb will have a 10W filament and a 140W filament, giving you a 10-140-150 bulb. They don't make such bulbs, because the high and medium would be indistinguishable, and consumers would complain.
Comment: Well, maybe I misunderstood your question. Would you post more info on the lamp, perhaps a picture of the switch?
Comment: Three way bulbs come in various wattage whether incandescent or led, and power is applied to different lamp parts to increase or decrease wattage. But why would the mfg. say 60 watt minimum ?

3 way swing arm wall mount lighting


Is $\text{Cov}(|a|,|b|)\geq \text{Cov}(a,b)$?

Question: The above seems intuitively true, (where $|a|$ refers to the absolute value of $a$), but I'm struggling to prove it - would be very grateful for either a proof or a reference.
Answer: Unfortunately, it's not true, so you won't get far trying to prove it.
Counterexamples are easy to come up with.
Imagine $X\sim U(-1,1)$ and $Y=X+1$
$\text{Cov}(X,Y) = \text{Var}(X)=1/3$
Note that $|Y|=Y$
So  $\text{Cov}(|X|,|Y|)= \text{Cov}(|X|,Y)$
but by the symmetry of $X$ about $0$, and hence the fact that the relationship between $|X|$ and $Y-E(Y)$ is an even function, we can see that $\text{Cov}(|X|,Y) = 0$.
So as stated, it isn't so; let's generate some data which illustrate the general sense of what I'm getting at there:
Comment: You should not feel bad about posting what is a fine question for the site.  It's the sort of thing many people would share your intuition about, and it's useful to know some counterexamples as they can help generate better intuition. Untrained intuition about these things is quite rare, and even experienced practitioners can get surprises; indeed, basic texts in stats often have surprising errors about things like skewness or the central limit theorem. That said, the suggested reference is a good one.  *Counterexamples in Probability And Statistics*, Romano and Siegel (1986) may help later on
Comment: I like to collect neat counterexamples (and also to generate my own); not only does it help clarify where our intuitions fail, collecting them can serve as a whispered *Memento homo* in ones ear-- a useful reminder when we apply intuition not to trust the ideas it leads us to. We all have our intuitions, but it helps to try to break the ideas we get (find counterexamples to them) before we try to prove them. Practice at finding counterexamples also seems to generate a degree of intuition.
Comment: As much as it makes me feel a bit silly this is a great answer! Thanks!!
Comment: You desperately need to improve your intuition in probability. Per my answer in http://stats.stackexchange.com/questions/33776/real-life-examples-of-common-distributions/156843#156843 , I recommend you buy and read at least the first 6 chapters (first 218 pages) of William J. Feller "An Introduction to Probability Theory and Its Applications, Vol. 2" http://www.amazon.com/dp/0471257095/ref=rdr_ext_tmb . At least read all of the Problems for Solution, and preferably try solving as many as you can. You don't need to have read Vol 1, which in my opinion is not particularly meritorious.
Comment: Certainly not my finest hour! Thanks for the reference, looks like a read will do me good - I'll take a look.
Comment: @Glen_b The suggestion of counter examples as a route to challenging and strengthening intuition is a wonderful one - I had previously not thought about them like that at all - shall definitely take a look at the book you recommend. Many thanks.
Answer: A somewhat more extreme example, let $a \equiv b$ be distributed as
$$\mathbb{P}(a = 1) = \mathbb{P}(a = -1) = 1/2.$$
Then $\text{Cov}(a, b) = \text{Cov}(a, a) = \text{var}(a) = 1$, while,
$\text{Cov}(\left|a\right|, \left|b\right|) = \text{Cov}(1, 1) = 0$. Hence the conjecture is not true.


Magento Tag Url Rewrite and Generate

Question: I added lots of rewrite rules for tags in Magento. For example,
Request Path: tag/abc
Target Path: tag/product/list/tagId/7/
Type: Custom

Everything is going well in the request and response. But I am wondering how to change the tag URL in the front? Although the rewrite rules run perfectly it will not change the URL which has been rewritten.
I found the getTaggedProductsUrl() method in tag module and eventually, like others, it calls getUrl() method in core/url Model. I tried to add, '_use_rewrite' => true to the route params. But it does not generate the right URL.
I really would like to know what's wrong about this!
Answer: If you rewrite the tag/tag model and override the getTaggedProductsUrl() with the following it will work:

public function getTaggedProductsUrl()
{
    $fullTargetPath = Mage::getUrl('tag/product/list', array(
        'tagId' => $this->getTagId(),
        '_nosid' => true
    ));
    $targetPath = substr($fullTargetPath, strlen(Mage::getBaseUrl()));
    $rewriteUrl = Mage::getModel('core/url_rewrite')->loadByIdPath($targetPath);
    if ($rewriteUrl->getId()) {
        return $rewriteUrl->getRequestPath();
    }
    return $fullTargetPath;
}

This is assuming you are using the target path without the base url as the "ID path" and the "Target Path" property, e.g tag/product/list/tagId/30/.
If you don't want to duplicate that setting then you will need to use the tag resource model and manually adjust the SQL to match the target_path column instead the id_path, because the resource model doesn't come with a method predefined for you.
Still, you can use the Mage_Tag_Model_Resource_Tag::loadByRequestPath()method as a reference.

Magento Tag Url Rewrite and Generate


How to save webhooks page data to Salesforce custom object?

Question: In my requirement my webhook url having some data. when i am updating or inserting some data in my webhook page i want to save those data automatically in salesforce custom objects.
Is there a way to get Webhook updated/inserted data to Salesforce? how to integrate webhook to salesforce?
Answer: You can check Zapier.com this will be to consume Response
Salesforce + Webhooks Integrations | Zapier
If you use webhooks that capture client contact information, Zapier can automatically add that information to Salesforce for you. Once the webhook is activated, Zapier will automatically extract the necessary information from the webhook and add it to Salesforce as a lead.
Comment: how to map my webhook url data in zapier catch hook ?


Including metadata on QGIS 3 models?

Question: Models on QGIS 3 are stored following a XML schema. Do you know if it is possible to embed metadata, may be using Dulin Core or ISO? I have noted that the modeler's help take in account subjects like: author, version, documentation and so on. But I am not sure how to include metadata information on .model3 files.
Answer: Not 100% on this but I think metadata is a work in progress, being approached from a number of angles.
If you have metadata to save, apparently it can be saved to a file which sits in the same directory as the data. As per this answer QGIS Default Metadata
If you are trying to read existing metadata from another system (your case) I presume QGIS is expecting to read a *.qmd file.
There is a plugin which apparently used to help some users, but apparently it no longer works with updated version of QGIS. https://github.com/nextgis/metatools/issues
Comment: Please do not provide the same answer to multiple questions. If it truly applies to more than one question then those questions are probably duplicates and should be flagged as such.

Including metadata on QGIS 3 models?


Apple Cash Family - "Family member already has Apple Cash enabled"

Question: I'm attempting to set up Apple Cash Family in a family sharing group. I experience an issue when attempting to add a minor (under 18 years of age), telling me that Apple Cash is "already enabled" on their account. However, Apple Cash does not show as enabled on their device - further, attempting to turn it on from their device (for a personal Apple Cash account) says that they do not meet the age requirements. How can I find and disable this "already enabled" account?
Answer: This can happen if the minor has previously created an Apple Cash account but was unable to verify it due to not meeting the age requirements. The account does not show up because it is not active, it cannot be enabled because they do not meet the age requirement, and yet it prevents them from having an Apple Cash Family card created on their behalf.
To resolve this issue, you can call Apple Pay support at (877) 233-8552. Once they verify the minor's identity, they will be able to close the empty account so that you can create a new one.
Comment: I had an additional issue that I'd tried to give said minor some cash via Messages, and there was a balance on the [unusable] account that prevented it being closed easily. Some escalation to the manager later and the balance magically was "refunded", but just a heads up for anyone else in that situation. I also had to wait for manager clearance for the "Apple Cash Specialist" to access my account and the Family minor's at the same time. It was not a smooth experience, but eventually was straightened out. This answer was exactly the situation.


How do I change/remove styling (top border) on main menu for active page and hovering (Avada Theme)

Question: As per the title, how do I change/remove styling (which is a white top border) on the main menu for both the active page and on hovering a menu item? I am using the Avada child theme and started out with the Architecture demo content. I'm new to web dev and using Custom CSS but can figure most things out with a little guidance. Have checked the forum for existing threads but nothing I have tried has works so far. Thanks in advance.
Comment: You can put your own css properties to change styling. Use google inspection tool (f12) to check in which class you need to change properties.
Answer: Go to you theme admin panel then Appearance > Editor. Then paste this code bellow into Stylesheet (style.css):
<code>.fusion-main-menu .current_page_item > a {

    border-color: #000 !important;
}

.fusion-main-menu > ul > li > a:hover {
    color: #000 !important;
}
</code>
Hope it solve your problem
Comment: Will that code also work if I paste it in the Avada > Theme Options > Custom CSS area?
Comment: yes it will work fine


Cloudcompare Cut at specific coordination by one reference cut (third part of question)

Question: according to these two previous question:
Cloud compare Cut at specific coordination by one reference cut
and :
Cloud-compare Cut at specific coordination by one reference cut (second part of question)
I have test compare one target stl file with two the same reference file which one of the has aligned with the main target fie and the second stl reference file was aligned with another target file already like this for compared  with aligned refrence:

and the target file compare result data with the same reference file only change is this reference file is aligned with another target file !:

by this cut coordination for both of them:

So the variance and mean average values has been changed,so this change in values  thins is because of cloud-compare is trying to change the reference stl coordination in aligning process.
so i asked here for sure and to know have i can have had one specific cut in reference and target stl file based of Constance coordination of reference which is means every cut in two new stl files must be based of the reference coordination and be Constance for every two stl aligned models?
also asked here:
https://www.cloudcompare.org/forum/viewtopic.php?f=9&t=4541&p=20675#p20675
update:
I have one mistake in my cutting process which i have cut also some tiny part of the final cut by dimension by segment tool which made that difference in the results, so by repeating the above process i get the same results for both of those cut by the same target and two same reference stl file with different alignment like this:

so it means by the same coordination and same reference STL file it would cut new aligned two stl file in same coordination.
Thanks.
Answer: I have one mistake in my cutting process which i have cut also some tiny part of the final cut by dimension by segment tool which made that difference in the results, so by repeating the above process i get the same results for both of those cut by the same target and two same reference stl file with different alignment like this:
enter image description here

so it means by the same coordination and same reference STL file it would cut new aligned two stl file in same coordination.


NEC 220.82c Panel Load Calcs and Multi-zone HVAC

Question: When doing panel load calcs, the section on HVAC loads isn't quite obvious to me regarding multiple zones—hopefully one of you sparkies can clear things up.  My house has two-zone HVAC—downstairs is A/C plus gas furnace (7500VA), upstairs is a heat pump (outdoor unit 3000VA, blower 500VA) with aux heat (4500VA).  If each was alone, it'd be 7500 or 6425.  Together, is it as simple as adding them up and calling the HVAC load 13925VA?
Answer: You're adding in parallel-series when you should be adding in series-parallel lol.
Put it this way, do you often run the heat upstairs while running the A/C downstairs?  I would think not.
So you contemplate the house in heating mode/season.  Figure a Load Calc with all the air conditiony stuff taken out (A/C no, heat pump yes, strip heat per the formula).
Then contemplate the house in cooling mode/season, this time with all the heaty stuff taken out. No auxiliary heat, however 98% of a furnace's electrical load does apply with A/C because you are using the furnace's air handler to push the A/C around the house.
Comment: I mean, I knew a person would use the higher load of cooling vs. heating, but the question was more along the lines of "do I just use the higher of System A or System B (whether both are cooling or heating) or do I add them together?"


Deserializing a generic type using gson in kotlin

Question: I have a generic type Animal implemented as a sealed class that can be a Dog or a Cat.
sealed class Animal(val typeOfAnimal: String) {
  data class Dog(val barkVolume: Int): Animal("dog")
  data class Cat(val hasStripes: Boolean): Animal("cat")
}

According to http://jansipke.nl/serialize-and-deserialize-a-list-of-polymorphic-objects-with-gson/ you can deserialize an Animal by registering a RuntimeTypeAdapterFactory
val animalAdapterFactory = RuntimeTypeAdapterFactory.of(Animal::class.java, "typeOfAnimal").registerSubtype(Dog::class.java, Dog::class.java.qualifiedName).registerSubtype(Cat::class.java, Cat::class.java.qualifiedName)
gson = GsonBuilder().registerTypeAdapterFactory(animalAdapterFactory)

But if I try to deserialize an animal that looks like
jsonStr = "{barkVolume: 100}"
gson.fromJson(json, Animal::class.java)

RuntimeTypeAdapterFactory complains that it can't deserialize Animal as it does not dfine a field named "typeOfAnimal"
To my understanding typeOfAnimal is a field you add to differentiate the subtypes and not something you need in the json you are deserializing.  Because my json is really coming from an api I cannot add the field.
Comment: looks like you're using "json" as a function arg instead of "jsonStr"
Answer: typeOfAnimal is required because gson must know which class should choose to deserialize your json. There is no way to guess the type, but you can implement your own deserializator. In a custom deserializator you can implement logic such as:
if (jsonObject.get("barkVolume") != null) {
    // retun Dog object
}


Capital lettering in old Italian names

Question: I want to use the name Leonardo da Vinci name for a presentation, but I I can't fit his whole name and would only like to use "da Vinci"
My question is...which is more proper, using "Da Vinci" with a capital "D" or "da Vinci" with a lowercase "d"?
Answer: His whole name is just "Leonardo". The 'da Vinci' part means "from Vinci". Typically in old days people had just one name and they were further identified by their profession, birthplace or who their father was. Typically the 'da' part is not capitalized because it is just a preposition.
Furthermore contemporary people would not call him just "da Vinci", they should always call him "Leonardo" or "Leonardo da Vinci" if just Leonardo isn't identifying enough. If even that isn't unique enough (like if you're in Vinci, there's probably multiple Leonardos), then he is the son of gentleman Piero, so "Leonardo di ser Piero" or "Leonardo di ser Piero da Vinci". But never just "da Vinci".
Of course, in modern days we often apply the modern styling of names to him and treat "da Vinci" as if it was his surname. But still, when used, whether alone or with his name, it should not be capitalized, unless of course it happens at the start of the sentence.
Answer: This isn't a problem in just Italian but many languages use un-capitalized words that are the equivelent of "from" or "of" as part of their name.   In all cases, it should be followed by that language's customs, not Engilsh as names are never "translated" in a shared writing system (there are rules for Transliteration between two alphabets).   Typically, rendering the proper last name is to follow the way the person presents it) So that Leonardo da Vinchi would be "da Vinchi" if refering to him by his last name, to distinguish him from "DiCaprio" or "the Ninja Turtle" (the actor is an example where the two word last name was changed to a single name with two capitilizations, probably as part of immigration officials not knowing the proper spelling... which is common in non-English last names).   Other famous people include the former U.S. President with the Dutch last name "van Buren" and the German-American Rocket Scientist "von Braum".
Though this format isn't always used with all languages so you will have to check.   A person with a Portugese name like "Leonardo Santa Cruz de Silvia" would be addressed as "Mr. Silvia" if following proper language customs (and just so we're clear, most names in Spanish and Portuguese, the middle name "Santa Cruz" is usually the mother's family name, not a given middle name as it would be in English).
It's best to identify the root language of the name, and follow the customs unless the individual gives a preference.
Answer: All of the answers seemed from the point of view of the Italians at the time of Leonardo da Vinci's life.
The OP is writing a presentation in the current day. In the current day if I saw a slide with "da Vinci" on it, I would fill in Leonardo, regardless of the capitalization.
Though, if I couldn't fit it all in one line, I'd use two lines so I could get his first name there. I wouldn't care so much about the grammar, but I feel he deserves a first name. I admire the guy that much.
Answer: I'd use Da Vinci since it seems more formal.
Leornado Da Vinci simply means Leornado the Vinci. So if you are writing it as "da Vinci" it would translate to 'the Vinci'.Doesn't look like proper English ,does it?
So I'd suggest using the Capital D
Comment: It doesn't mean 'the Vinci', it means 'of' or 'from' Vinci.

Capital lettering in old Italian names


How can I customize my nft collection with the smart contract?

Question: I want to add a logo and banner image on my nft collection. What I want to do is to add the logo and banner image when i deploy my contract so that no matter what the marketplace platform is I always get the image  and banner image for my collection.Otherwise I have to add logo and banner image seperately on each marketplace platform i.e opensea, Larva Labs/CryptoPunks etc.
Answer: Opensea provides a standard in the form of contractURI() which can be added to the contract, and provides default values to the NFT collection. Check out this article to know more. I think this can resolve your query.