Information in electromagnetism and electromagnetic waves

Question: I'm reading Griffith's electrodynamics and in it he mentions in section 10.2.1 that news travel with the speed of light in electromagnetism. To my understanding the news he is talking about are the electromagnetic waves, which travel through space. Later in the example 10.4 he calculates the electric and magnetic field of a point charge moving at constant velocity. Now my question is: if a charge moving at constant velocity doesn't produce EM waves, how does it create an EM field in a point in space if the charge and the point can communicate only via EM waves?
Comment: The computer you are using - and if you use DSL internet connection, that as well - are not using EM waves yet you have information coming to you. You are confusing EM waves with electric (and magnetic) fields.
Comment: I know I'm confusing something but I can't understand how an electromagnetic field can be created without electromagnetic waves, also in Griffith's in example 10.2 he talks about how a suddenly created current creates and electromagnetic field. For time less than s/c (where s the distance from the cable in which the current is produced) there is no electric field. This means that the electric and the magnetic travel through space. Still even in this case we don't talk about em waves. I hope I made clear what exactly is causing my confusion
Comment: Unfortunately I dont have time to post a comprehensive answer, but I will try to alleviate confusion with a, maybe not completely accurate, metaphor. Image EM waves as sound. They exist and are regions of low and high pressure. Now the fields is just the pressure. It can be higher or lower. You have wind from big regions of high and low pressure for example and it is not sound. Yet if sound exists or not comes from how this pressure is excited. Maybe it is not the most correct metaphor. I am hoping that someone with a good grasp of ED can give you a comprehensive answer, though.
Comment: (just a quick comment. A suddenly created current will have to create an EM wave, a pulse with large bandwidth. But then you need to distinguish between what is an EM wave and which are the created electric and magnetic fields)
Comment: To my understanding EM waves travel to create the EM field. Just like my voice for example will create the sound wave that will create the pressure difference at someones ear. Is this reasoning wrong ?
Answer: In-depth research shows that clearly: Magnetic field and electric field are unified, magnetic field is just the one appearance of electric field, there is not independent magnetic field in the world;
To say it simply, magnetic field interaction is the electric field interaction that be effected by motion. Motion can take weak effect to the electric field interaction, the electric interaction between two electrons increase by the increase of relative motion velocity of them (Lorentz force had said it), the electric interaction is the weakest when the two electrons keep relatively static (is electrostatic interaction, but not Coulomb interaction);
Compare with electrostatic interaction, the ratio of the increase of electric interaction is 1:10^11 when the relative motion velocity is 1m/S;
And can be 1:10^4 to the two thermal movement electrons.
These changes can take some effect to the world obviously, and the effect is just magnetic interaction.
To say it accuturely, magnetic field is not a pure field, it is the combine of electric field and motion.
I recommend that you read this first,about the nature of magnetic field:
https://phyyz.kinja.com/the-theoretical-analysis-of-the-field-1828705659?rev=1589649761587
The article is written in Chinese
Answer: If a charge is moving at constant velocity for inertial frame $A$, it is always possible to make a change of coordinates, applying Lorentz transformation, to the inertial frame of the particle, say $B$.
For frame $B$, the field is static all over the space. And frame $A$ is moving around this static field. So, there is no signal or information to be transmitted.
Of course we can think that the charge was not always there. At some moment a device separated positive and negative charges, and surely some acceleration was involved. EM waves were emitted then, sending the information through the space.
Comment: So at some point the electric or magnetic field created by the charge at a certain point in space had to be created by an EM wave, but once the charge stops accelarating the emition of EM waves stops?
Comment: yes, because any inertial frame is equivalent in SR.


Require Nokogiri? No such file to load

Question: I'm trying to get started with using Nokogiri. I ran the command
gem install nokogiri

as an administrator in Windows 7 (64-Bit). The console said "successfully installed" and "1 gem installed".
When I type in
gem list --local OR gem q --local

I see Nokogiri on the list of "Local Gems".
However, when I try to use it via the require statement (in NetBeans), I get an error that there is "no such file to load".
What am I doing wrong? I'm not a Ruby professional. This is also the first gem I've installed. Please dumb it down for me.
Comment: Netbeans comes with built in ruby - jRuby. Wich version is used in project's properties - yours or built-in?
Comment: Which Ruby version are you using?
Comment: Try RubyInstaller http://rubyinstaller.org/downloads/
Comment: Yes Viacheslav, you are correct! I was using JRuby by accident. I have corrected the problem. Thank you!
Answer: With Ruby 1.8, you have to require 'rubygems' before requiring any libraries installed as gems. With Ruby 1.9, that is not necessary anymore.
require 'rubygems'
require 'nokogiri'
...

Comment: Thanks for the tip. I have tried using your suggestion, and it does not work. However, I do have Ruby 1.9 anyway.
Comment: Oh, I have figured out the problem! NetBeans was using JRuby 1.5 instead of 1.9. Thank you for pointing out versions, or I would not have checked this!
Answer: I realize this post is pretty old, but others may stumble here with the same problem, as I did.  Novices like me may not realize that
require 'rubygems'

must precede
require 'nokogiri'

At least, based on another URL post that gave me the idea, the addition of that line solved the problem for me with nokogiri.
Answer: Netbeans comes with built-in jRuby.
You can specify or check wich version of ruby currently used in your project in project's properties (higlighted section).
Comment: A picture is worth a thousand words. Thanks, Viacheslav!
Answer: I was struggling with this one for a while, having upgraded to ruby 2.0.
The fix was to install nokigiri using apt-get
apt-get install ruby-nokogiri

As a side note dependencies can be seen using
$ gem dependency nokogiri

Gem nokogiri-1.6.1
  hoe (~> 3.7, development)
  hoe-bundler (>= 1.1, development)
  hoe-debugging (>= 1.0.3, development)
  hoe-gemspec (>= 1.0, development)
  hoe-git (>= 1.4, development)
  mini_portile (~> 0.5.0)
  minitest (~> 2.2.2, development)
  racc (>= 1.4.6, development)
  rake (>= 0.9, development)
  rake-compiler (~> 0.8.0, development)
  rdoc (~> 4.0, development)
  rexical (>= 1.0.5, development)

Require Nokogiri? No such file to load


In python, is it considered better to define a module with functions or a module with a class that contains functions?

Question: In my code either of the above two options would work equally well but I am interested in finding out the pros and cons of both approaches.
Answer: It honestly depends on your needs.  Most of the time a module of functions will be what you're looking for.
Python classes (imho) shouldn't be thought of like classes in C# or C++ or Java, there needs to be a logical reason to group a set of functions into a larger parent, data structures would be a good example of this, you want a congruent set of functions that apply directly to the class instead of a loosely collected set of functions that are general purpose.

Module of Functions: general purpose, utility, and more "global" functions
Module of Class of Functions: grouped classes of similar needs, different linked list data types or audio processing functions or different tree types.

A module is for the overall hierarchical grouping of similar systems, I usually have all utility functions under a single module, all data under another, my data layer and connectors under a more "parent" type module. Since a module is just a mental grouping it's less about what types of systems are in it (classes or functions, honestly probably a mix of the two) and more about the logical connections between the systems under the module.
Comment: I don't understand the contrast between a Python class and other languages.  In what language would you have a class with with functions that have no logical reason of being grouped?
Answer: The basic question is if you need to have different instances of your module/class. a python module is like a singleton - you refer always to the same object, i.e. if you need instances, you need a class.
However, if you do not need instances you might still have the need to set up your "object" to an initial state. while this is clearly possible with a plain module, if the initializing is more complex than just setting some values, I would advice to have initializing code in a class's <code>__init__</code> method for readability.
Comment: @thbusch, yes, this is implied in _needing instances_.
Comment: it might be worth pointing out that you probably are talking about something that has state, e.g. a module with global variables vs a class with member variables. if your class only has methods but no state, there is little reason to have multiple instances
Comment: When you talked about the need for an instance that made me understand module vs class. Like if I needed to make multiple cars then a class would be appropriate vs a calculator module where I don't need to make a bunch of calculators I just need to use the add and subtract methods from that module.


Would it be considered gauche to reference my website?

Question: I have a website which contains a list (with images) of Hugo award winners. Later, it will also contain Nebula award winners. Would it be considered crass commercialism to divulge the URL of my site, or considered OTOH an interesting tidbit?
Answer: The behavior page suggests that if your site is part of a "good, relevant answer" to a Stack Exchange question and you disclose your association with the site, that'd be just dandy (remember to "add context around the link" and "quote the most relevant part" of it). But just announcing the site without the context of answering a question would be inappropriate for the main site.
However, you're free to link it in your user profile, mention it in chat, and consult the advertising/promotion links at the bottom of the behavior page to see if those are options you'd like to use.
Comment: Does the "good, relevant answer" rule have a loophole, in that you might be answering your own question?
Comment: @user14111 In theory, yes. But: It is unlikely that the community will consider "good" a question to which that link is the answer under any circumstance. And since it would be the *only* question this poster asked on sf&f.se, "overt self-promotion" would be claimed pretty quickly. If Clay Shannon first developed a solid reputation as a valuable sf&f.se citizen, then the "loophole" might be indulged. Maybe.
Comment: Yes, the link is there in my user profile.
Answer: If you want to do this, then it seems to me that your profile page would be the most appropriate place for it (the profile page does contain a "website" field, after all), and I personally wouldn't see any issues with that (others with more authority than me may or may not agree).
It wouldn't be appropriate to cite it as a reference in an answer, as it wouldn't be an independently verifiable source, and mentioning it in a more ad-hoc manner doesn't seem to be in keeping with the purpose of this site either.
Comment: I do have the link in my user profile, but who looks at that?


Birthday Problem Confusion Using the Counting Rule

Question: I am stumped by the below confusion:
Question: How many people do we need in a class to make the probability that (at least) two people have the same birthday more than 1/2? (For simplicity, assume 365 days a year.)
I know that the answer to this question is $n=23$ people, but I was wondering why the following method does not work using the counting rule:
Out of $n$ people, choose any 2 people to share the same birthday. For that same birthday, there are 365 choices. For the other $n-2$ people, each one has 365 choices of birthdays. Therefore, the probability that at least two people have the same birthday is
$$
\frac{\binom{n}{2} 365 \times 365^{n-2}}{365^n} = \binom{n}{2} \times \frac{1}{365} = 0.5
$$
which solving for gives us roughly $n=20$.
Where did I go wrong here? Thank you very much!
Comment: You are double counting cases where there are two pairs of people sharing a birthday and triple counting cases where three people share a birthday, once for each pair of the three.
Comment: You're overcounting the number of ways two people out of $n$ can share the same birthday.
Comment: Now a question: Does it make a difference that this is a (school) class, which could mean a non-linear distribution of dates of birth?
Comment: That will depend on how the school class is determined. If, for instance, first-graders are determined by all students born in one specific calendar year, and if we pretend that all birthdates are equally likely (in real life, they are not), then the standard solution to the birthday problem applies. But most school classes are not determined this way, at least where I live.
Answer: To elaborate on Joshua Wang's comment, your approach considers each possible pair of people, and correctly calculates the probability that they share a birthday to be $\frac{1}{365}$. However, when you sum over all pairs, you may be overcounting the number of possible situations where this occurs.
In particular, if three people $A,B,C$ all share the same birthday, then this situation is triple-counted: once for the pair $A,B$, once for the pair $B,C$ and once for the pair $A,C$.


How to decrease number of noises in stochastic differential equation

Question: I have a Quantum SDE containing both white and color noises (open quantum system).
$$ \dot\rho(t) = A\rho_s + (\nu_{1t}\hat{c}^\dagger \hat{X}^-_1 + \omega_{1t} \hat{X}^+_1 \hat{c})\rho_s +(\nu_{2t} \hat{X}^+_2\hat{c} -\omega_{2t}\hat{c}^\dagger \hat{X}^-_2)\rho_s   $$
Here A is a constant, $\hat{c}^\dagger$ and $\hat{c}$ are creation and annihilation operators belong to system. $X^\pm_j$ are operators belong to fermionic environment.   The order of $X^\pm_j$, $\hat{c}^\dagger$ and $\hat{c}$ is fixed (no commutation or anti-commutation relation exist between $X^\pm_j$ and $\hat{c}^\dagger$, $\hat{c}$ ). $\nu_j$ is white noise, $\omega_{1t}$ and $\omega_{2t}$ are defined as
$$ \omega_1(t) = \int_{t_0}^{t} C^+(t-\tau)\nu_{1\tau} d\tau$$
and
$$ \omega_2(t) = \int_{t_0}^{t} C^-(t-\tau)\nu_{2\tau} d\tau $$
Where $C^\pm$ is defined as
$$C^\sigma(t)=\int_{-\infty}^{\infty} d\omega e^{i\sigma\omega t} f(\omega) J(\omega)$$
My question here is that how can we decrease the number of noises by combining white noises $\nu_j$ and color noises $\omega_j$ while they are connected to different operators. I know how to decrease the number of noises if they are connected to same operators. Any idea about different operator case, any article, book ? Your help will be appreciated.
Comment: Can you give an example how you "decrease the number of noises" for the same operator case? It might help to clarify your question.
Comment: For example, For a case where $\nu_{1t}$ and $\omega_{1t}$ are connected to same operators,  $\nu_{1t}$ and $\omega_{1t}$ can be replaced by one noise, i.e ,  $$\dot\rho(t) = A\rho_s + (\nu_{1t}\hat{c}^\dagger \hat{X}^-_1 + \omega_{1t} \hat{c}^\dagger \hat{X}^-_1 )\rho_s +(\nu_{2t} \hat{X}^+_2\hat{c} -\omega_{2t}\hat{c}^\dagger \hat{X}^-_2)\rho_s $$  In above equation the 2nd term on R.H.S can be written as $(\nu_{1t}+ \omega_{1t} ) \hat{c}^\dagger \hat{X}^-_1 \rho_s$ . Now $(\nu_{1t}+ \omega_{1t} )$ can be replaced by another noise $\alpha_{t}$ whose auto and cross-correlation can be found.
Answer: Thank you for your clarification. The best I can propose is to write the operators in terms of a quadratic form $$\left[\begin{array}{ccc}
c^{\dagger} & X_{1}^{+} & X_{2}^{+}\end{array}\right]Q\left[\begin{array}{c}
c\\
X_{1}^{-}\\
X_{2}^{-}
\end{array}\right]\rho_{s}$$ , where $Q$ is a $3x3$ matrix that contains the $c$-number noise terms.
 as you see, there are 9 entries, one for each possible operator combination.
 in your example case in the comments, the form is
$$\left[\begin{array}{ccc}
c^{\dagger} & X_{1}^{+} & X_{2}^{+}\end{array}\right]\left[\begin{array}{ccc}
0 & \nu_{1}+\omega_1 & -\omega_{2}\\
0 & 0 & 0\\
\nu_2 & 0 & 0
\end{array}\right]\left[\begin{array}{c}
c\\
X_{1}^{-}\\
X_{2}^{-}
\end{array}\right]\rho_{s}$$ but in the question the form is
$$\left[\begin{array}{ccc}
c^{\dagger} & X_{1}^{+} & X_{2}^{+}\end{array}\right]\left[\begin{array}{ccc}
0 & \nu_{1} & -\omega_{2}\\
\omega_{1} & 0 & 0\\
\nu_{2} & 0 & 0
\end{array}\right]\left[\begin{array}{c}
c\\
X_{1}^{-}\\
X_{2}^{-}
\end{array}\right]\rho_{s}$$ and there are  4 noise terms. You could consider some kind of similarity transformation on the $Q$ but it seems to me that the transformation would have to be noise dependent.
Comment: Thanks for your response, will this similarity transformation decrease the number of noises ?


Is stress-timed rhythm true?

Question: It is said that English has stress-timed rhythm.
Is it true? because it sounds that syllables with stress doesn't necessarily get a beat and make isochrony.
If it is true, I would like to hear how you feel the rhythm while using it.
Comment: There was a Linguistics SE question about isochrony a while back with a nice answer that I gave a bounty to: [What's the evidence for and against isochrony?](https://linguistics.stackexchange.com/q/12089/) It seems like stress-timing and syllable-timing form a spectrum rather than a dichotomy, and the concept of isochrony, while possibly valid in some way, is far from being literally true on the surface level. (That's not to say that it's not useful: this and similar concepts such as "morae" may be useful in analysis even if they don't correspond perfectly to measured units of time.)
Comment: I studied Japanese and can tell you that the isochronous nature of your language makes it very difficult for you to learn rhythm in a non-isochronous language, especially English. Our language codes for different things than yours does. For example, the untrained native English speaker will not even hear a difference between, say, 地図 and チーズ. Both use the same phoneme, and that is all we hear. Our language must sound awfully sloppy and capricious to you, who have always relied on syllables to be more or less like ice cubes in a tray.
Comment: Robust: Thank you for your comment.  It's so helpful.  You said English is non-isochronous but I heard that English has isochrony with every stressed syllables.  Is it a lie?
And because you studied Japanese and sound like understanding it well, I would like to ask you, if you are OK, that you hear all English sound into phonemes even if some vowels reduced greatly and change it's timbre, for example into a schwa.
Comment: Changing an English vowel from stressed to unstressed reduces its profile and its duration as well (though not always). But the syllables are never in a measured, isochronous relationship. Depending on how much stress we apply, a syllable gets louder *and* longer. Unstressed syllables pour out pretty much at the fastest rate that they can be pronounced (given a basic rate of speech). A series of unstressed syllables may sound isochronous to you, but you probably don't hear secondary stresses. For example, the word *accelerating* has a primary stress and a secondary stress. Can you hear them?
Answer: English almost never walks its way into real isochrony, possibly because that would make even poetry sound too regimented. Too bad we don't have audio tools available here, because it really requires something like that to give you an illustration of what I mean.
Take the sentence

Well, I don't know—what do you think?

Sometimes we might say it quickly, entirely in curt syllables, indicating nothing in particular but an absence of affect.
To show we're thinking something over, we might stretch some syllables as we stress them:

Welllllll, I don't knooooooow—what do youuuuuuu think?

To transfer the onus of answering the question back to the other person, we might just stress (stretch) one word:

Well, I don't know—what do youuuuuu think?

Note that there is a big difference in nuance between

What do you think?

and

What do you think?

In fact, any one of those words could be stressed, resulting in a completely different idea being expressed.

What do you think?

(I am interested in the result of your thought process.)

What do you think?

(It just occurred to me you might have an interesting take on a subject. Also any of a number of other things.)

What do you think?

(Turning the question back on you after you've asked what I think, or you've just given me what someone else thinks and now I want your own answer to the question.)

What do you think?

(I'm being dismissive, or condescending, or any of a number of other nuances.)
In each of those cases, the stressed word might be slightly drawn out, elongated, as well as given more vocal force.
I don't know if any of this helps you, but perhaps it might point you in a direction from which you might ask a more targeted question.

Is stress-timed rhythm true?


Postgres: What could cause the error "cannot call populate_composite on a scalar"?

Question: I have a column of type JSONB, where each row contains a JSON with an array of objects, eg:
[
    {
        "grade": "4.44/5",
        "endYear": 2011,
        "startYear": 2006,
        "userId": "defg"
    },
    {
        "grade": "9.133/10",
        "endYear": 2010,
        "startYear": 2006,
        "userId": "abcd"
    }
]

I'm attempting to expand those JSONB collections into rows, like:
| grade    | startYear | endYear | userId |
-------------------------------------------
| 4.44/5   |    2006   | 2011    | defg   |
| 9.133/10 |    2006   | 2010    | abcd   |
-------------------------------------------

..using the following query:
WITH arr AS (SELECT jsonb_array_elements(jsonbrecords) AS jsons
             FROM "table-with-jsonb"),
    lines AS (
      SELECT x.*
      FROM arr, jsonb_to_record(jsons) AS x(
                "field1" VARCHAR
                 )
  ) SELECT *
    FROM lines

I'm using Datagrip, which paginates results, and the query finishes fine for the first 500 rows.
However, when I try to load the last page of results, I get this error:
[22023] ERROR: cannot call populate_composite on a scalar
Googling this error shows almost no useful results (a first for me) except for the Postgres source code.
I don't speak C, but since the jsonb_array_elements CTE evaluates fine on its own, I am assuming the problem is that some row(s) have a scalar value in jsonbrecords column instead of a proper JSONB.
To ensure I had only JSONB values, I stripped the rows that didn't contain '{' with this query:
UPDATE  "table-with-jsonb" SET jsonbrecords = NULL
WHERE jsonbrecords :: TEXT !~ '{'

This deleted about a dozen rows, but the error remains.
I've also tried to find the problem by inspecting the raw JSONB rows in the table, but have found nothing.
Am I correct in thinking the error means a row has a non-JSONB value in it? If so, how can I fix? If not, how can I debug?
Answer: Unrelated, but: you can simplify your query to:
SELECT x.*
from the_table,
     jsonb_array_elements(jsonbrecords) AS t(doc),
     jsonb_to_record(t.doc) as x ("grade" text, "userId" text, "endYear" int, "startYear" int);

Now for the actual question. The error can be avoided by not using jsonb_to_record and accessing each key individually instead:
SELECT t.doc ->> 'grade' as "grade",
       t.doc ->> 'endYear' as "endYear",
       t.doc ->> 'startYear' as "startYear",
       t.doc ->> 'userId' as "userId"
from the_table,
     jsonb_array_elements(jsonbrecords) AS t(doc);

You don't really lose flexibility as you need to specify the column list with jsonb_to_record() as well.
Online example: http://rextester.com/VVGJ34083
Answer: I've figured this out. The problem was in a specific row of data:
[
    {
        "grade": "4.44/5",
        "endYear": 2011,
        "startYear": 2006,
        "userId": "defg"
    },
    {
        "grade": "9.133/10",
        "endYear": 2010,
        "startYear": 2006,
        "userId": "abcd"
    },
    null
]

The null in the end was breaking jsonb_to_record. Once I deleted it, everything works.
I don't know if this could happen thru normal usage, but in my case, I think this was because I wrote the data to the DB from a nodejs script, but accidentally set the destination column to type TEXT instead of type JSONB.
I changed the type to JSONB with the data already in it, so the null must have sneaked in that way.


In Rev, 4:5, we are told that the 7 lamps of fire, burning before God's throne, are the 7 spirits of God, but what, or who, are we talking about?

Question: The seven spirits of God are actually associated with the seven lamps of fire and later in John's revelation, to the Lamb's seven horns and seven eyes, see Rev, 5:6. We would appear to be talking about spiritual angels here, as opposed to say: the fullness of the Holy Spirit. The same angels, it would seem, that sent salutations, along with God and Jesus, to the seven churches in Asia, see Rev, 1:4,5. Now, given the association with the seven lamps of fire, could these angels be the self same angels that are later given the seven bowls of the wrath of God, by one of the "four living creatures", see Rev, 15. They are seen standing on a sea of glass, similar to that mentioned in Rev, 4:6, the very next verse to the verse now in question, after all??
Answer: The seven spirits of God are mentioned in the beginning of the book, Revelation 1:4-5 and then mentioned again as before the throne, Revelation 4:5-6.
The first mention is immediately followed by the letters to the seven churches which are represented, in vision, as lampstands, that is to say as vessels which contain (presumably) oil and are lit to create a fire and a light.
Then, the second mention is followed by large portions of the visionary book which deals extensively with the activity (from heaven to earth) of seven angels.
I suggest that both activities, that of the Holy Spirit come from Christ to enliven and invigorate and enlighten the seven churches and that of the Spirit of God, in might, energising the angelic powers are demonstrated by the naming of 'seven Spirits' in the beginning of the book and in depicting in vision seven lamps burning before the throne.
Seven lampstands burn on earth, sending their light throughout the earth as a burning witness and testimony to the risen Christ.
And seven lamps burn before the throne in heaven as a multitude which no man can number worships God and the Lamb.
One Spirit, seen in diversity, in both earth (within the church) and in heaven (before the throne).
One Divine Spirit, burning in diverse activity, activates angelic judgment from Christ upon the throne of God and also energises the body of Christ in a fiery testimony, again as from Christ seated on the throne of his Father.
Comment: Hmmm! I see thoughtful, spiritually infused, and carefully chosen words and good sentence structure here, which may, or may not, have got to the "nitty gritty". We, as you already know, differ on what constitutes "spiritually infused" but that's by the way here. I'm not sure that your: *"And seven lamps burn before the throne in heaven as a multitude ....."* is a correct assumption, given the neuter aspect. I need to think about this some more but need to leave right now. I'll get back to you later.
Comment: Sorry, I knew I shouldn't have tried to rush the above. The neuter aspect doesn't apply to the *seven lamps* but rather the *seven spirits of God*, which would appear to be a demonstration of angelic power, for the use thereof, hence the neuter aspect. These *seven spirits of God* then presumably become the *seven bowls of God's wrath*, to be poured out into the earth by the *seven stars/angels*, at Christ's *fiery* direction. Although, no one can really know for sure. Thank you for this. It's now an upvote from me.
Answer: In the book of the Revelation, angels are angels are angels. They are distinct from humans. They are distinct from God. They are distinct from the Lamb. They are distinct from the Holy Spirit. And that is the case throughout the entire New Testament.
This means that when you state, "We would appear to be talking about spiritual angels here..." the response has to be, "No, we are not talking about spiritual angels here." Well, at least, not until scriptural proof can be offered for such a claim. Then it could be considered. But that bald statement has no foundation upon which to rest. Consider what the verses in question actually state.

"And out of the throne proceeded lightnings and thunderings and
voices: and there were seven lamps of fire burning before the throne,
which are the seven spirits of God. And before the throne there was a
sea of glass like unto crystal: and in the midst of the throne, and
round about the throne were four living creatures full of eyes before
and behind." Revelation 4:5-6

Chapter 4 discloses the vision of the Lord God Almighty on the throne set in heaven, and the things that pertain to that throne. John is enabled to ascend in the Spirit through a door opened in heaven. The first three verses depict the throne, the Lord God Almighty seated on that throne, the rainbow, and the 24 crowned elders seated on thrones around God's throne. Then we get to the two verses in question. At no point are angels mentioned. It is not until chapter 5 verse 2 that a particular angel is mentioned. This means that the context of chapter 4 has nothing to do with angels.
Here is one explanation revealing the significance of the 7 lamps of burning fire:

"In the tabernacle under the old covenant the seven branched
menorah, or candlestick, burned with seven lamps of fire before the vail, before the holy of holies, in which the ark of the covenant,
covered by the kippurim, or - so-called -  mercy seat, contained the
two stone tablets of the law. Above this covering, the glory of the
Lord appeared.
Likewise in the new testament, John testifies, 'And I turned to see
the voice that spake with me. And being turned, I saw seven golden
candlesticks; and in the midst of the seven candlesticks one like unto
the Son of man,' Rev. 1:12,13... The Holy Ghost, who dwelt among the
children of Israel, now dwells within the ecclesia or church of God,
here represented by the seven golden candlesticks. He also appears in
his infinite divinity as the seven lamps of fire burning before the
throne. It is he who dwells within the assembly, where they that
have an ear to hear what the Spirit saith, find that he throughly
purges away all their tin and all their dross, making them to become
as gold like glass.
As he is within the saints severally gathered in the seven assemblies,
so he is before the throne of God Almighty... He is the sevenfold -
perfect in himself and in all his interior operations - I say, he is
the sevenfold Spirit, sent forth into each of the seven churches, yet
in a mystery abiding before the throne of God. To this, all who would
overcome must become conformed... the overcomers are purged of the
flesh, both of the fleshly mind, the will, and the affections, to be
purified by heavenly fire in conformity to the Lord, whereunto they
were predestined. The Holy Ghost personally identifies himself with
each church, and identifies each church with himself, whilst at the
same time in the flames of his perfection sanctifying and uniting all
in his one person." The revelation of Jesus Christ, pp. 99-100, John
Metcalfe, http://www.johnmetcalfepublishingtrust.co.uk/contact_us.htm

The number seven is highly symbolic, especially in the book of the Revelation, signifying heavenly perfection. This points to the heavenly perfection of this burning Spirit of God, who is as the fire that purges gold till it is so refined, and so free from dross or any kind of contamination, that it appears as like a sea of glass, like crystal, before the throne of God in heaven. This is who is being depicted in mystical language, in Revelation 4:5-6.
Comment: I wrote some notes for comment, but then after reading Dan's A. decided to comment there first. Anyway, here are my thoughts: Angels are indeed distinct from humans, God and the *so called* HS. But to my mind, and not just mine, the **lamb**, in his pre existence to being the lamb, may well have been, not only the **Word**, but also the **Archangel Michael**, the *chief angel*. Jesus as the ... 7 lamps of fire *burning before the throne*, I see as a stretch by JM. Likewise as regards Jesus being the sevenfold spirit - sent to the churches... tbc...
Comment: .... continuing on... JM's idea that the saints were to be conformed, transfigured from the fleshly aspects as it were, and then purified by heavenly fire is somewhat misleading, as they had to already have been changed (from the earthly to the spiritual) just to have been able to enter heaven in the first place. I also don't like his *sea of glass* analogy.  The number 7 *is* highly symbolic and whether one can be justified in conflating *the 7 stars* in Jesus' right hand, which we *are* told *do* represent angels, with *the 7 spirits of God*, could very well be just conjecture. Although ...
Answer: The seven lamps of Rev. 4:5 appear to be related (whether consciously by the author or not) to the seven lamps in the prophet Zechariah's spiritual vision of a menorah in the heavenly realm.

"I see a solid gold lampstand with a bowl at the top and seven lamps
on it, with seven channels to the lamps. Also there are two olive
trees by it, one on the right of the bowl and the other on its left."
(Zech. 4:2-3)

In John's description of his own vision, there are seven separate bowls rather than one bowl feeding seven channels of oil into the seven lamps. But the vision is similar enough to be more than coincidental. The two olive trees of Zechariah also seem to be related to the two olive trees of Revelation 11:4. However in Zechariah they rather clearly symbolize two contemporary figures (the governor Zerubbabel who was a descendant of David and thus a candidate for anointed king; and Joshua, the high priest, who would likewise be an 'anointed one.') In Revelation they symbolize two unnamed future "witnesses" who will prophecy during the time of tribulation. In John's vision, as the OP suggests, the oil in the bowls, as well as the flames that it feeds, is related to God's wrath. In Zechariah it seems to relate both to the physical flames that will be rekindled in the rebuilt Temple and also to the anointing of the future kind and high priest.
So we may conclude at least that in the Book of Revelation the vision of the seven-branched menorah suggests God's wrathful judgment, while in Zechariah it present a hope for the immediate restoration of the Temple under the leadership of two anointed leaders. In Revelation the New Jerusalem does not have a Temple and it will be Christ himself who is the lamp, not a menorah.

I did not see a temple in the city, because the Lord God Almighty and
the Lamb are its temple. The city does not need the sun or the moon
to shine on it, for the glory of God gives it light, and the Lamb is
its lamp. (Rev. 21:22-23)

Nevertheless, in the early chapters of the book we are told:

The one who is victorious I will make a pillar in the temple of my
God. Never again will they leave it. I will write on them the name of
my God and the name of the city of my God, the new Jerusalem, which is
coming down out of heaven from my God; and I will also write on them
my new name. (Rev. 3:12)

I have attempted only a partial answer, since the Book of Revelation is highly symbolic and open to so many opinions. I hope this will be helpful to readers in interpreting these passages even if it does not directly answer the question.
Comment: This partial answer is, indeed, helpful, even though it does not directly address the Q. I hope nobody downvotes it for that reason. One up from me!
Comment: I was aware of the conflation with Zechariah, where I see the 7 lamps with 7 spouts being identified with the *eyes of the Lord*, which range to and fro throughout the earth, which would seem to suggest, then at least, *angelic* usage/affirmation by God's spirit; the **top stone**; Jesus himself, and therefore **NOT** the HS, as, if I'm not mistaken, you also seem to imply *... and also to the anointing of the future kind and high priest.* Thank you for, as the OP suggests ... is related to God's wrath. Christ himself, will indeed be the lamp, rather than a menorah, in the New Jerusalem. + 1.
Answer: My own preferred explanation, as used in my book, is as follows;
"The number 'seven', in Revelation, is almost a label meaning "belonging to God". So here is 'the seven-fold Spirit', or 'the Spirit belonging to God'. That is, the Holy Spirit."
In ch1 vv4-5, the effect of this interpretation is that the Holy Spirit is associated with the Father ("who was and who is and who is to come") and with the Son ("Jesus Christ the faithful witness") in the offering of grace and peace. It becomes a fully trinitarian offer.
In ch4 v5 the effect of this interpretation is that the Holy Spirit is found in the throne-room of God, along with the Son the Lamb, who appears later in the scene.
In ch5 v6, the effect of this interpretation is a reminder that the Son, the Lamb of God, was endowed with the Holy Spirit at the baptism in the Jordan, when the Spirit descended upon him "like a dove" (Mark ch1 v10).
In the same verse, the same principle of interpretation allows us to understand the seven horns of the Lamb as "the power of God", since horns appear all the way through the Old Testament as a symbol of power.
Incidentally, I understand the "sea of glass" as the firmament, seen from above, so it is associated with God's throne as a whole. There are parallels elswhere in scripture. The mobile throne in Ezekiel is on "the likeness of a firmament" (Ezekiel ch1 v22, RSV). The elders at Sinai see under their God's feet "as it were a pavement of sapphire stones" (Exodus ch24 v10), which I understand in the same way as the firmament in the Ezekiel vision. It gives them a s sense of being in the true throne-room of God.
Comment: With me not being a trinitarian, I cannot hold with this Holy Spirit explanation. The explanation of the horns I can go along with. Completeness of power is being conveyed I feel, for sure. I can also go along with the "firmament" analogy for the "sea of glass". I like that a lot. Because of your "HS" view, however, this obviously precludes you from contemplating on the **seven bowls of the wrath of God** idea, but thanks for responding.
Comment: @Nigel J The symbolism of Revelation is not really subject to proof. We can only lay a tentative hold on what seems to work best. If angels are flames. that does not prove that all flames are angels.
Comment: But please consider also my observations on ch1 vv4-5
Comment: Point taken.Comments deleted, but see my answer also.
Answer: "And from the seven spirits who are before His throne."
There is no justification for the capitalization of "spirits". This is not a description of the nature of God.
This statement cannot be understood apart from 4:5 which reads

"And there were seven lamps of fire burning before the throne, which
are the seven Spirits of God;"

The seven spirits which are the seven lamps of fire that burn before to throne are the seven churches to whom this revelation is sent (verse 20),

"As for the mystery of the seven stars which you saw in My right hand,
and the seven golden lampstands: the seven stars are the angels of the
seven churches, and the seven lampstands are the seven churches."

Their position is "before" the throne.
The significance of "before the throne" could be for the purpose of judgment, particularly since we will see this judgment of the fidelity of these seven churches weighed in the balances in chapters two and three.
Since this is found in the body of the salutation, "before the throne" could also simply represent the position that the church holds as those who belong to God hence the expression "which are the seven spirits of God;" ('Which are' – ἃ – nominative neuter plural).
Comment: It is pleasing to me that you, a trinitarian, agree that the word "spirits" should not be capitalized, thus implying a non appreciation of the *unnamed* spiritual personage of the *so called* Godhead here. However, you conflating the "lampstands", churches per se, in **Rev, 1:20** with the "lamps" and "spirits" in the v. in question, would seem to be at odds with the **Salutation** in **Rev, 1:4**, where the "seven churches" are distinctive from the "seven spirits". I do find it interesting, though, that the rel' pronoun (an NNP), implying "which/that", is associated with the "seven spirits".


Specific sections with coplot in r

Question: I coded a coplot function to create a separated graph depending on z. First, is it possible to create graphs depending on specific section of z, say i want a section from 0 to 150, 150 to 200, 200 to 250 and so on?
all_pit_data<- read.table("ALL_PIT_DATA.csv",header=TRUE,sep=",")
cols <- terrain.colors(462)
windows()
coplot(all_pit_data$x1 ~ all_pit_data$y1 | all_pit_data$z1,
   number = 9,
   overlap = 0,
   col = cols[all_pit_data$z1],
   xlab= c("x", "z"),
   ylab="y")

Second, I would like to obtain a color filling like on this picture. the filling depends on the z variable. Any idea how it is possible?
Answer: To answer your first question:
The "given.values" argument in coplot lets you define the conditioning variable intervals (a in the formula y ~ x | a), but the input format is specific. It must be a matrix with 2 columns and n rows - the first column has the start points for each interval, and the second column has the ending points for each interval.
To break z into the intervals you stated above:
Create the matrix with the intervals:
given.z <- matrix(c(0, 150, 200, 250, 300, 350, 400, 450, 150, 200, 250, 300, 350, 400, 450, 500), nrow = 8, ncol = 2)

Create the plot:
coplot(x1 ~ y1 | z1, data = all_pit_data, given.values = given.z, xlab= c("x", "z"), ylab="y")

Specific sections with coplot in r


Can someone suggest me method to extract carotenoids?

Question: I want to extract carotenoids, but want to use some inexpensive method.
can you suggest me some method?
Answer: It depends on what your raw-material is, and what you want to do with the extract. Carotenes are only soluble in very non-polar solvents like hexane and acetone.
I have not worked specifically with carotene, but some years ago I had to analyze some xanthophylls, and during that, I experienced that they were pretty soluble in vegetable oil (I think it was rapeseed oil). You could try this, but off course it leave you with the problem of how to get rid of the oil :-)


To authorize an App Service to get keys from Key Vault, do I need to use the IAM blade or the Access Policies blade?

Question: I'm unclear about how I authorize an Azure App Service to get a key from Azure Key Vault using System Assigned Managed Service Identities. Do I use the IAM blade and give the App Service Identity the Reader role? Or do I got to the Access Policies blade and find the Principal for the App Services identity and give it key permissions? Or do I do both?
Answer: Assuming you just need your managed identity to read data from inside the Key Vault, then you use the Access Policies blade.
The access policies blade controls access to reading the content of the vault. The IAM blade controls access for managing the Key Vault object its self in Azure.


How to convert microsoft word para/range to html?

Question: I am working a project which has requirement to convert specific paragraphs in word document to HTML. I will have the range object of para or paras , from that range I can get WordOpenXML, I want to convert that to HTML. ( it should not have the html, head, body tags as it is not full document but just a small html chunk )
I saw Eric White's open XML articles, he did great articles on this topic and power tools for openxml has html converter which converts entire document to html, my requirement is to convert a specific para or range to HTML. Can any one guide me in right direction.
For example, If a word document has
This is para1.

This is para2.

This is para3.

My requirement is to convert para2, which is available with me as para object. So, basically I am looking to write a function like
public string WordOpenXMLToHtml( string sWordOpenXML) {
    // do the transformation
    return sHtml;
}

Answer: You could try the HtmlConverter object. More info here Transforming Open XML WordprocessingML to XHTML Using the Open XML SDK 2.0


How long should you wait after you set a cold-expansion fitting before pressurizing the system?

Question: Some people online say you should wait after using cold-expansion fittings before adding pressure to the system. With Uponor pipe, is there any guideline on this?
Comment: You posted a link to their documentation a couple of days ago, is there anything in there?
Comment: @FreeMan nothing whatsoever that I saw. But I found many random people on the internet saying you should wait 20 minutes to pressurize the system and if a leak occurs, even if later fixed, you should cut the fitting off and affix it again.
Answer: In the absence of any directive from the instructions, if conventional wisdom says to wait 20 minutes, then that seems reasonable.
Unless you're making a repair, 99% of your fittings will have had a 20+ minute "rest" prior to pressurizing the water supply system. The only likely exceptions would be the last couple of fittings being crimped.
If this is new work, those fittings will likely have a day or more while you're waiting for the inspection, and the finish fittings probably won't be done for days.
If this is replumbing or repair work, that 20 minute wait can easily be absorbed by cleaning up messes & putting tools away.
If the wait is only 20 minutes, it seems that the time between making up the last fitting and actually turning water on will make it rather a moot point in any case.
I'd plan on waiting, just to be safe. Or, if you're into experimenting, make up a connection to a valve, close the valve, hold it over a bucket (just in case) and turn the water on right away, just to see what happens.


How much implementation detail to include in PhD thesis

Question: If I developed a library during my PhD (in physics, not CS), but the topic is focused on what I used it for, rather than the code development itself, how much implementation detail should I give in my thesis? The entirety of the code was written by me (and my supervisor) and a significant portion of my time was spent on the development, but I'd also like to avoid going through every module and every class.
Comment: What does your advisor think?
Answer: As the comment says, best talk to your adviser but some things to consider when writing about the implementation:

Is there anything novel in the implementation?
Do you want to provide information about how someone could run the same experiments as you?
Did you use standard packages or algorithms which would help place your work in the correct context?
Is the hardware you target relevant?
Were there any difficulties in translating equations or algorithms into code?
Answer: If at all possible, avoid hiding hard work under a bushel!
It's common in pursing a PhD to have to do many things that appear only tangentially related to the "real" topic. However, frequently, those tangential things require ingenuity, creativity, insights and understanding, and just plain hard work. Unless the code is trivially obvious, and required no special understanding of the more central problem of your PhD research, I think that it would be a mistake to minimize it's importance. Moreover, by incorporating a discussion of the code into your thesis, you can show yet another aspect of the mastery you have of your subject matter.
It you cannot see an obvious way of putting the code into the body of the thesis, consider incorporating it into an appendix. Frequently, it is the unexpected, tangential things in one's research that end up being of more importance to the community of other researchers than the thing that was the primary focus. Consider, for example, Don Glaser, who was awarded the Nobel Prize in physics for the invention of the bubble chamber ... a side-show to his real interest which was investigating subatomic particles.


"Clear" button necessary in request/query form?

Question: I have a book request form where user enters his user id details, no of books, no of pages delivery mode and other booking details(comes to around 5-6 input fields). It has Submit, Clear and Cancel Buttons. Is it necessary to keep clear button ??? will user expects for clear button?? Just because user makes mistake in 1 or 2 fields, we need to clear all?
also if in case every field needs correction(worst case) user can edit then and there itself?? any suggestion on this is welcome!!
Comment: Is your site responsive? You might want to consider a mobile pattern where deleting fields isn't as easy as it is on desktop.
Answer: According to Jakob Nielson ( Reset and Cancel Buttons), removing the clear button from the form will improve the usability of the application for the following reasons,

It eliminates the possibility of a user clicking the reset/clear
button by mistake.
With only "Submit" visible, the user knows exactly what they have to
do next. Having two or more buttons will force the user to spend a
few seconds to decide which button is the one they want to click.
Having an extra button means the user will have more options, which will require extra thinking from the user.

It also suggests that a reset/clear button would be useful in a case where the same user will fill the same form multiple times. That is if the form remembers data from the previous submission.
But that also depends on the nature of information that is being filled. If its easier to edit existing data than filling in new data then a reset/clear button is not required.
Comment: Thanx!! am in the same page...will consider that
Comment: Hm.... What if it wasn't a button where it visually competed? And what if the form was responsive? I think a clear button could be beneficial to the user via mobile to clear forms easily instead of go through every single field and click "delete" a thousand times to clear it out.
Comment: @Majo0od It would depend on the type/amount of information the user is entering. If the user is filling out a simple form, such as what op has mentioned, (User ID, No. Books, Delivery Mode) between editing and correcting the field the and there and looking for the clear button (which causes them to start again), the former is faster because less thinking is required. And also how often would someone want to clear the entire form when so little information has been added.
Comment: @Majo0od But if a large form which a user is most likely to refill again is auto completed (ex: editing billing information - 1. info was auto completed from another transaction , 2. user is very likely to change or edit the details the next time) then a clear as you mentioned is very useful.
Comment: I agree with those mentioned notes!


How to generate a Vanity domain in windows 10?

Question: Basically what the title says. I cannot find a tool that does it for me for Windows 10 in 2021.
Comment: This question belongs on [tor.se].
Comment: Does this answer your question? [How do you get a specific .onion address for your hidden service?](https://security.stackexchange.com/questions/29772/how-do-you-get-a-specific-onion-address-for-your-hidden-service)
Comment: @vidarlo no, as I cannot run it on my computer... do you have something that I can use?
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Answer: You cannot.
Tor names are hashes. In the past some services brute forced a series of hashes until they found one that was close. The new longer hashes are even more difficult to brute force. You can try, and you may get something acceptable, but there is no tool.
Comment: How can I try that?
Answer: Well, the hidden service names are derived from key pairs, so the one and only way to do so - is just a bruteforce, as it's done by a lot of software.


Can I interpret the inclusion of a quadratic term in logistic regression as indicating a turning point?

Question: In a Logistic Regression with linear and quadratic terms only, if I have a linear coefficient $\beta_1$ and quadratic coefficient $\beta_2$, can I say that that there is turning point of the probability at $-\beta_1 / (2\beta_2)$?
Answer: Yes, you can.

The model is
$$\Pr(Y=1) = \frac{1}{1+ \exp(-[\beta_0 + \beta_1 x + \beta_2 x^2])}.$$
When $\beta_2$ is nonzero, this has a global extremum at $x = -\beta_1 / (2\beta_2)$.
Logistic regression estimates these coefficients as $(b_0, b_1, b_2)$.  Because this is a maximum likelihood estimate (and ML estimates of functions of parameters are the same functions of the estimates) we can estimate the location of the extremum is at $-b_1/(2b_2)$.
A confidence interval for that estimate would be of interest.  For datasets that are large enough for the asymptotic maximum likelihood theory to apply, we can find the endpoints of this interval by re-expressing $\beta_0 + \beta_1 x + \beta_2 x^2$ in the form
$$\beta_0 + \beta_1 x + \beta_2 x^2 = \beta_0 - \beta_1^2/(4\beta_2) + \beta_2(x + \beta_1/(2\beta_2))^2 = \beta + \beta_2(x + \gamma)^2$$
and finding how much $\gamma$ can be varied before the log likelihood decreases too much.  "Too much" is, asymptotically, one-half the $1-\alpha/2$ quantile of a chi-squared distribution with one degree of freedom.
This approach will work well provided the ranges of $x$ cover both sides of the peak and there are a sufficient number of $0$ and $1$ responses among the $y$ values to delineate that peak.  Otherwise, the location of the peak will be highly uncertain and the asymptotic estimates may be unreliable.

R code to carry this out is below.  It can be used in a simulation to check that the coverage of the confidence intervals is close to the intended coverage.  Notice how the true peak is $-1/2$ and--by looking at the bottom row of histograms--how most of the lower confidence limits are less than the true value and most of the upper confidence limits are greater than the true value, as we would hope.  In this example the intended coverage was $1 - 2(0.05) = 0.90$ and the actual coverage (discounting four out of $500$ cases where the logistic regression did not converge) was $0.91$, indicating the method is working well (for the kinds of data simulated here).
n <- 50            # Number of observations in each trial
beta <- c(-1,2,2)  # Coefficients
x <- seq(from=-3, to=3, length.out=n)
y0 <- cbind(rep(1,length(x)), x, x^2) %*% beta

# Conduct a simulation.
set.seed(17)
sim <- replicate(500, peak(x, rbinom(length(x), 1, logistic(y0)), alpha=0.05))

# Post-process the results to check the actual coverage.
tp <- -beta[2] / (2 * beta[3])
covers <- sim["lcl",] <= tp & tp <= sim["ucl",]
mean(covers, na.rm=TRUE) # Should be close to 1 - 2*alpha

# Plot the distributions of the results.
par(mfrow=c(2,2))
plot(x, logistic(y0), type="l", lwd=2, col="#4040d0", main="Simulated Data",ylim=c(0,1))
points(x, rbinom(length(x), 1, logistic(y0)), pch=19)
hist(sim["peak.x",], main="Estimates"); abline(v=tp, col="Red")
hist(sim["lcl",], main="Lower Confidence Limits"); abline(v=tp, col="Red")
hist(sim["ucl",], main="Upper Confidence Limits"); abline(v=tp, col="Red")

logistic <- function(x) 1 / (1 + exp(-x))

peak <- function(x, y, alpha=0.05) {
  #
  # Estimate the peak of a quadratic logistic fit of y to x
  # and a 1-alpha confidence interval for that peak.
  #
  logL <- function(b) {
    # Log likelihood.
    p <- sapply(cbind(rep(1, length(x)), x, x*x) %*% b, logistic)
    sum(log(p[y==1])) + sum(log(1-p[y==0]))
  }
  f <- function(gamma) {
    # Deviance as a function of offset from the peak.
    b0 <- c(b[1] - b[2]^2/(4*b[3]) + b[3]*gamma^2, -2*b[3]*gamma, b[3])
    -2.0 * logL(b0)
  }
  # Estimation.
  fit <- glm(y ~ x + I(x*x), family=binomial(link = "logit"))
  if (!fit$converged) return(rep(NA,3))

  b <- coef(fit)
  tp <- -b[2] / (2 * b[3])

  # Two-sided confidence interval:
  # Search for where the deviance is at a threshold determined by alpha.
  delta <- qchisq(1-alpha, df=1)
  u <- sd(x)
  while(fit$deviance - f(tp+u) + delta > 0) u <- 2*u # Find an upper bound
  l <- sd(x)
  while(fit$deviance - f(tp-l) + delta > 0) l <- 2*l # Find a lower bound
  upper <- uniroot(function(gamma) fit$deviance - f(gamma) + delta,
                   interval=c(tp, tp+u))
  lower <- uniroot(function(gamma) fit$deviance - f(gamma) + delta,
                   interval=c(tp-l, tp))

  # Return a vector of the estimate, lower limit, and upper limit.
  c(peak=tp, lcl=lower$root, ucl=upper$root)
}

Comment: +1, great answer. You mention some caveats re the asymptotic approach; what do you think of bootstrapping the CI in cases like this? I once did that to show that the peak of a quadratic curve fit for one group was greater than that of the other group.
Comment: It might work, @gung, but the bootstrapping theory also is for large samples. In your application perhaps a permutation test could be justified.
Comment: Cool. But might not the turning point be outside the data range? And then it would be dangerous to extrapolate.
Comment: @Peter That's right, which is why I commented that "This approach will work well provided the ranges of x cover both sides of the peak."
Comment: @whuber  Oops, I missed that. Sorry


Weight & Balance with multiple stops

Question: When you have multiple stops for a single flight, without refuelling, how do you do deal with the weight and balance ?
For every single leg, or just from departure to arrival ?
Comment: What type of aircraft are you referring to?
Comment: Any other load changes at the stops? Passengers? Baggage? Cargo?
Comment: @757toga it's a GA aircraft, Cessna 172.
Comment: @FredLarson no changes, just a stop, to see the airport. And then the flight continues.
Comment: When you say 'deal' what are you asking?
Comment: Can you edit your question to add in those relevant clarifications?
Answer: (In the U.S.) According to 14 CFR 91.9(a) which states in pertinent part:

Except as provided in paragraph (d) of this section, no person may operate a civil aircraft without complying with the operating limitations specified in the approved Airplane or Rotorcraft Flight Manual, markings, and placards, or as otherwise prescribed by the certificating authority of the country of registry. (emphasis is mine)

And, 14 CFR 91.103, which states:

Each pilot in command shall, before beginning a flight, become familiar with all available information concerning that flight. This information must include -

(a) For a flight under IFR or a flight not in the vicinity of an airport, weather reports and forecasts, fuel requirements, alternatives available if the planned flight cannot be completed, and any known traffic delays of which the pilot in command has been advised by ATC;

(b) For any flight, runway lengths at airports of intended use, and the following takeoff and landing distance information:

(1) For civil aircraft for which an approved Airplane or Rotorcraft Flight Manual containing takeoff and landing distance data is required, the takeoff and landing distance data contained therein; and

(2) For civil aircraft other than those specified in paragraph (b)(1) of this section, other reliable information appropriate to the aircraft, relating to aircraft performance under expected values of airport elevation and runway slope, aircraft gross weight, and wind and temperature. (emphasis is mine)

These regulations, in my opinion, obligate the pilot-in-command to ensure that the aircraft weight and balance and operating performance are within the required limitations prior to each flight.
However, the regulations do not state that you must make a written computation of the weight and balance calculation prior to each flight.  Consulting the POH weight and balance section, and performance tables, will show you whether or not your takeoff and next leg will remain within the (w&b) center-of-gravity envelope and in compliance with the necessary takeoff performance requirements.
Again, the obligation for the pilot-in-command is to ensure that the aircraft is always operated within the regulatory required and safety mandated limitations.
Comment: Then there's the question of what constitutes a *single* "flight," and IIRC the FAA has been rather liberal in allowing pilots leeway to log different "legs" as being part of one "flight."
Comment: @randomhead - *Flight Time* is defined as when the aircraft moves for the purpose of flight until it comes to rest after landing.  I think the regs are clear that every takeoff, enroute, and landing has to be completed in accordance with all operating limitations.  So performance, weight and balance requirements, etc. must be constantly satisfied. What methods the pilot uses to ensure this is a broader question.
Answer: It's pretty simple on that type of aircraft if you're not adding or removing load at each stop. On the chart you simply calculate your CG without fuel (zero fuel weight), and with your max fuel load of the day. Draw a line between the two and if the whole line is in the envelope you know that each flight that day will be within limits. Carry that with you in case you get a ramp check so you can show you've considered the weight and balance for that flight.
Answer: From a private flying perspective there's no regulation stating you absolutely must do a weight and balance calculation before a flight, you have to ensure you are operating within the airplane's limitations.
I fly 172s and PA-28s mostly, usually just myself with just a flight bag, and I don't do a weight and balance calculation before every flight because I've done them for each airplane I fly already, and I know it will be within the envelope as nothing has changed. If I change those parameters, i.e. take more people or carry bags/cargo in the back I will do weight and balance. When I do the calculations I'll look at variable fuel loads so I will know how it will change as I burn fuel and ensure I'll be within limits for the duration of the flight, or be within limits for the return flight. So I won't do a weight and balance for the return leg unless something changes, for instance take on a passenger.
Performance calculations are not to be ignored, especially if you are operating close to weight limits, out of a short field, or at a high density altitude. You don't need to do the balance for that, just calculate the weight.
Answer: Depends. The question is one of takeoff performance mostly.  I would do a W&B on the initial departure leg only, if my only weight changes on each leg are from fuel burn, and the subsequent legs are from airports with ample takeoff distance margin.
However, if an airport on my route is marginal from a takeoff distance perspective, my All Up Weight when taking off from that airport becomes critical and I would do a W&B adjustment to account for the reduced All Up Weight in determining if can get out of the strip in the first place.  But I would be doing that estimation before I departed on the first leg anyway, and probably revisit it when at the airport in question to make sure my assumptions still applied.
Otherwise, if you just hopping around from 4000 ft airport to 4000 ft airport, there's really no need.  In fact as a general practice I only do detailed walkarounds and engine runups on the first flight of the day, with more of a cursory once-over on subsequent legs to make sure nothing happened to it while it was parked.

Weight & Balance with multiple stops


How to prove a theorem using Sentential Derivation

Question: I have to prove that [¬ A → ¬ (A → B)] → A is a theorem using the rules of SD.
Any hints or advice?
Comment: sentential derivation
Answer: Mauro has already provided one correct derivation, but since you asked for help and advice, here's an expansion on the technique:
When doing a derivation like this, you want to look at the overall structure of the final result.  If proving something of the form A -> B, assume A and derive B.  If proving something of the form A & B, you usually want to prove A first, then B, then put them together.  If all else fails, assume the opposite of what you want to prove, and derive a contradiction.
In this case, the larger form of this is [complex expression] -> A, so you'll first want to assume the complex expression (Mauro's step 1).  From here you'll want to derive A, so assume the opposite and look for contradictions (Mauro's step 2).  The next steps require a little creativity --basically you want to look for anything you can create that contradicts something you already have. You have NOT A so you can get NOT ( A -> B), which is an obvious statement to try to contradict.  This means that you want to create A -> B, which is a problem like the one you started with, except easier and simpler.
In general, that's the whole technique of natural deduction --try to break a longer, harder problem into a series of shorter, simpler problems.
There are purely mechanical ways to get the same results, but in my opinion, natural deduction leads to greater understanding.
Answer: Because this looks like homework, I won't give you a full answer, but just a hint. I also don't know what SD is (unless you mean Service-dominant logic, which is off topic here and doesn't seem applicable), but here's a method for propositional logic.
You could make a truth table of parts of your expression. Like this:
<code>A | B | expr 1 | expr 2 | ...
--+---+--------+--------+-----
0 | 0 | ?      | ?      | ...
0 | 1 | ?      | ?      | ...
1 | 0 | ?      | ?      | ...
1 | 1 | ?      | ?      | ...
</code>
Now as expressions you can take first (A → B), which is a part of your theorem. Then you take ¬ (A → B), which you can, because you know the truth table for (A → B) - you just wrote it down. Like this, you proceed, until you have the full expression in the rightmost column.
If this column contains only 1, that means that the theorem is true for any values of A and B. Thus, the theorem would be proven.


Story from old anthology of sci-fi

Question: Trying to find an anthology which has a story in it about a lucky man who seems to be in god's favour. Things always turn up for him. Ends with him driving out from a parking bay, just in time to leave it empty for the real god's favourite to enter. Might have been published by Penguin. Thanks.
Answer: Trying to find an anthology which has a story in it
That's "The Importance of Being Important", a short story by Calvin W. Demmon, originally published in The Magazine of Fantasy and Science Fiction, March 1963, available at the Internet Archive. You would have read it in either a hardcover or a paperback edition of 100 Great Fantasy Short Short Stories, an anthology edited by Isaac Asimov, Terry Carr, and Martin H. Greenberg.
about a lucky man who seems to be in god's favour. Things always turn up for him.

Stanley Scheer believed himself to be the most important person in the world. He believed that everybody else in the whole world had been put there to help Stanley Scheer.
[. . . .]
And he believed that if he needed a parking space someone unimportant would get a Message or something from Them and pull out right in front of Stanley Scheer.

Ends with him driving out from a parking bay, just in time to leave it empty for the real god's favourite to enter.

One day Stanley Scheer got his bankbook down from the shelf, took the waiting elevator down to the garage, and drove to the bank. As he pulled into the crowded parking lot, a car pulled out of a parking place directly in front of him, leaving him a vacant space. It was the only vacant space on the lot. Stanley Scheer smiled, drove into the space, stopped his car, and got out. He walked into the bank, deposited his paycheck, walked back to the parking lot, entered his car, and started it up. Then he dropped it into reverse and spun out of the parking space, barely missing a car which was waiting behind him. He mashed the accelerator to the floor and roared out of the parking lot, careening wildly around corners and rocketing down the street with smoke pouring from his exhaust pipe.
In the bank parking lot, the car which had been waiting behind Stanley Scheer pulled into the space. The Most Important Man in the World got out, shook his head, smiled sadly, and walked towards the bank.
Stanley Scheer, who was killed in a head-on collision on his way home, had fulfilled his Ultimate Purpose.

Note: John Christopher's "Man of Destiny", which was suggested in another answer, is a completely different story, about a spacewrecked astronaut; you can read it at the Internet Archive.
Comment: Thanks sincerely for the info, very much appreciated. Especially as there were other stories I miss.
Answer: That sounds like "Man of Destiny" by John Christopher. The story is exactly as you describe - the main character has an unbroken string of luck that makes him believe he is chosen for some vast, mysterious purpose, and the last paragraph explains that purpose - events in his life have been arranged so he'll pull out of a parking spot at the exact time for the REAL most important man in the universe to pull in.
Here's a page with listings of where it has been anthologized: https://www.isfdb.org/cgi-bin/title.cgi?55243
I read it in "101 Science Fiction Stories"
by Martin H. Greenberg (Editor),  Charles G. Waugh,& Jenny-Lynn Waugh.
Comment: "Man of Destiny" by John Christopher can be read in the may 1951 edition of _Galaxy SF_, for instance in [this archived copy](https://ia800604.us.archive.org/30/items/galaxymagazine-1951-05/Galaxy_1951_05.pdf). It features a man landing on a far away planet, trying to be a god to the natives. No parking lots whatsoever.
Comment: Sorry, wrong story. Please see my answer.

Story from old anthology of sci-fi


Want to confirm $(f^{-1})'(x)\neq(f')^{-1}(x)$

Question: I'm just making sure, that when I have "the inverse of the derivative of $f(x)$", that it's notated as $$(f')^{-1}(x)$$ and not the opposing "the derivative of the inverse of $f(x)$" which I think would be $$(f^{-1})'(x)$$
Comment: You are right, although you should ensure your reader doesn't mix up your inverse-notation with $\frac{1}{f'}$
Comment: Hmm. I would write the former at $f'(x)^{-1}$, possibly adding more parentheses for clarity: $\bigl(f'(x)\bigr)^{-1}$. When you write $(f')^(-1)(x)$, one interpretation could be different: $(f')^{-1}$ would be the inverse of the derivative, itself a map. And then you evaluate it at $x$.
Comment: Followup to my previous comment: For example: $f(x)=x^4$, $f'(x)=4x^3$, $(f')^{-1}(y)=(y/4)^{1/3}$. Not what you intended, I think.
Answer: You're correct. For example, let $f: (0,\infty)\to\mathbb R$ such that $f(x)=x^2$. Then:
$$\begin{align}f'(x) &= 2x\\
f^{-1}(x) &= \sqrt x\\
(f^{-1})'(x) &= \frac{1}{2\sqrt x}\\
(f')^{-1}(x) &= \frac{1}{2x} \end{align}$$
The correct formula is
$$(f^{-1})'(x) = \frac{1}{f'(f^{-1}(x))}$$
Comment: For a possible ambiguity, see my second comment on the question.
Comment: Well wait now I feel like something's a little off or ambiguous...that looks like the inverse function theorem, but your last line...it would read as "the derivative of the inverse of f(x)..." "is equal to the reciprocal of the derivative of the inverse of f(x)"
Comment: The RHS would read as "he reciprocal of the derivative of $f$ evaluated at the inverse of $f$ at $x$".


Processing Wifi Packets

Question: Im trying to use GNUradio 3.8 with an sdr to pick up some wifi packets 2.4 and 5 GHz but im seeing a ton of dropped samples from my sdr. Im wondering if my dropped samples have to do with the sample rate. Ive seen online sdrs have a mixer that downconvert the frequency band to baseband and then its sampled. But i believe one cannot configure arbitrary sample rates, as the receiver expects a given number of samples per symbol. Is this correct. If im trying to sample 2.4Ghz and 5Ghz a/b/g/n how do i figure out my sample rate/dropped samples issue. Thanks
Comment: Does your SDR <-> PC has a large enough data rate? For a complex signal with bandwidth $B$ quantized to 16 bits, you'll need at least $16 \times 4 \times B$ bits per second. Also: can your CPU handle that many samples?
Comment: Im a little confused can you explaion where 16 and 4 are coming from? Is 16 a standard quantization rate for 802.11 ac? Is 4 the quadrature? Your saying I need a read/write speed of 16bits*4*20Mhz = 1280 Mbps which is inline with what ive seen but my PC has a read/write of 550/520 MB/s. Im operating over PCIE gen 1.1 which has a data rate on the order of GB/s. But still seeing only drops... Also using an intel core i-5 2.1Ghz.
Comment: I assumed a USRP or similar radio, which usually quantize to 16 bits per sample. You need to sample both I and Q, at rate at least $2B$. I'm pretty sure an i5 is not going to cut it.
Answer: At the very least, you'll need a sampling rate that's high enough to capture the full bandwidth of your Wifi transmission. In a typical WiFi receiver, that puts the sample rate at exactly the OFDM width: 5, 10, 20 or 40 MHz, depending on your Wifi.
Your dropped samples simply happen because your computer isn't fast enough to keep up with that many samples per second. There's only two solutions to that:

Get a faster computer
Make your computer do less per sample.

Also note that the sustained write rates of permanent storage devices can be lower than your sample data rate, so even just writing to disk can be a fatal bottleneck.
Sadly, we don't know the processing you're currently doing, but maybe have a look at gr-ieee802-11, which is optimal enough that a modern midrange laptop can receive 20 MHz wide Wifi with it, continuously.
Comment: you're confusing the data rate that some wireless standard can transport, and the data rate necessary to store the raw RF signal. Anyway, as said, storage is one of the factors that can be too slow, not the only one.
Comment: Thank you for the input. Im a bit confused, I know the data rate of 802.11 ac is <1300Mbps, Im operating over PCIE gen 1.1 (2.5Gbps) with an ssd read/write of 550/520 MB/s.

WI-FI < SSD < PCIE data rate

and im using an intel i-5 2.1 GHz proc. Your saying the bottle neck is occuring somewhere along the pipeline? Am i underestimating the Wi-Fi input rate?
Answer:
Ive seen online sdrs have a mixer that downconvert the frequency band to baseband and then its sampled

I think your question can be answered by clearing up the misunderstanding that made you write this part of your question.
All data captured by an SDR is translated down from its original frequency down to being centred around a frequency of 0 Hertz (sometimes called DC).
If you tune to 100MHz, and sample at 2Msps, then you get the chunk of spectrum between 99 and 101MHz, and it gets delivered to you as -1MHz to +1MHz. That is, centered around zero.
"Negative frequency" is a mathematical artefact, and you'll get used to it. Obviously there's no physical pendulum, or clock, that ticks with a negative frequency.
Wifi is between 20 and 160MHz wide, depending on channel width. If you have fewer than 20Msps then you cannot decode a 20MHz channel. The information just isn't there. Just like how you can't hear an FM radio signal if you put a very narrow 100Hz filter in your receiver. You can still decode morse code, but not a broadcast FM signal. (of course analog signals don't just disappear, but degrade, as you see less and less of the spectrum)
So no, if you don't process at least 20Msps, then you cannot decode a 20MHz signal.
This is getting less true with Wifi 6, which uses OFDM. OFDM is lots of separate signals, all much smaller than 20MHz, each carrying data that you can decode. Because the signals then are each smaller than 20MHz. But if you don't capture the whole 20MHz spectrum, then you can't decode all of them.
But yeah, sounds like you need more CPU power. Make sure you're not using a rate higher than you need, and reduce the rate earlier in the flowgraph, where possible.
Comment: Thank u only took a year and a half to get a good answer lol

Processing Wifi Packets


How can I include transformed dll to an Azure deployment

Question: For my Worker role I run a custom task to modify the dll. However, when I use VS to publish the project to Azure the original binary is deployed and not the modified dll. Why is this happening? How to include the modified binary in the package from within VS
This is with sdk+tools v1.6
Comment: Can you clarify what you mean by custom task? Is this a post build task or something else?
Comment: yes that's a post build task.
Answer: A possible workaround that I see, is to extract all the code/logic that requires assmebly modification in a separate class library project. Do the custom post-build modification on the class library.
In your worker add reference to that class library. If it also does not work when you add the reference as a project reference, then just copy the resulted modified assembly in a common external references folder for the solution, and add the reference from there (just browse to the final assembly).
I don't know the nature of your modification, but I think that if you cave all your "private" code in a separate class library it will be enough. As the worker implementation will just be calling a "Run()" or similar method of your class library, inside the Run() method of the RoleEntryPoint.


How can a definite acceleration integral be useful in mechanics and why is an indefinite integral not used?

Question:
We have an acceleration function and in order to find the displacement function, it would be logical to take an indefinite integral 2 times. Then we would get a function. Why is it proposed here to take a certain integral from 0 to t, because this way we will get a number that will also show the difference between the area of the graph above the X axis and the area of the graph below the axis. What's the point of that? How can a definite acceleration integral be useful in mechanics and why is an indefinite integral not used?
Comment: The author has imposed boundary conditions $s(0)=0,\,v(0)=0$. The former is a translation convention; the latter is a reference frame convention.
Answer: Both indefinite and definite integrals are useful in mechanics. When you want a function then you will do an indefinite integral. When you want a number then you will either do a definite integral or you will evaluate an indefinite integral.
With indefinite integrals it is important to remember that they produce constants of integration. These constants must be determined by boundary conditions. Choosing a constant of integration for an indefinite integral is equivalent to choosing one of the bounds for a definite integral.


How to focus on external conflict rather than inner/interpersonal conflict?

Question: I love creating characters and my plots generally focus greatly on their inner conflicts and their relationships with other characters (my experience has almost exclusively been writing romance). There is very little external conflict, as the overarching plot is the development of the relationship and is driven by the characters themselves.
However I have a few ideas for fantasy/adventure novels with plots that are driven by an external conflict. While I have a general idea of the plot points, I am finding it difficult to sit down and iron out the details. For example, in a story about the children of the seven Demon Kings of Hell, I know that the children discover their heritage and eventually have to travel to the depths of Hell to fight Satan, but are betrayed by one of their own and must flee back to the land of the living. But I can't figure out how they get to Hell, or what happens in between which forces them to make the journey in the first place. When I try to take the time to develop the plot some more, I always get distracted by the characters and develop them instead. If I were to just sit down and start writing I would just write endless character interaction and nothing would ever happen. The characters are interesting, but I need them to "do" things. Rather than interacting with each other, I need to get them interacting with the external conflict.
I don't necessarily think I should give up and only ever write character-based plot, even if this is what comes naturally to me. Does anyone have any advice to give on how to focus my attention on the external conflict?
Answer: I would suggest that rather than thinking in terms of external conflict rather than internal conflict, you should think in terms of internal conflict caused by external conflict.
In a romance, the story tends to focus caused by the internal conflict between the desire for a romantic relationship and all of the other things each party wants from live. (One must give up their pride, another their prejudice.)
In an adventure there is still internal conflict but it is caused by external forces. Do I risk my life to fight the dragon or abandon my village to be destroyed by the dragon? The dragon is the source of the external conflict, but the conflict that makes the story interesting is the internal struggle between fight and flight. The actual fight with the dragon is just hacking and hewing. It is not interesting in itself. It is the hero's conquest of their fear of facing the dragon that is interesting, and it is in seeing the battle through to the end that the hero proves the transformation that has taken place in them that gave them the courage to face the dragon.
Comment: @sudowoodo I agree--"internal conflict caused by external conflict"--very valid technique, and so it the opposite--external conflict, caused more or less by internal struggle of a person; a conflicted person will react differently to external stimuli, then more mentally firm individual, often intensifying the external conflict. If the author creates a believable (or suspendable) environment, whether it's a wizard's castle or a powdered sugar desert wasteland, the characters will have to act physically to survive the story, thrown at them.
Answer: I am tempted to say that you are in an infinitely better situation than many adventure writers who have a great tally of the most exciting thing happening to their characters, but those characters are lacking personality and, well... character :-)
If developing your cast comes naturally to you, it is great. All you have to do is put them in a situation, where they have no choice than to act physically to overcome a challenge, thrown at them, and you are in the clear.
Creating those physical challenges is much easier than writing a believable person.
Build a wall they have to climb over. Send a squad of assassins after them. Injure them and make them keep going. Capture them and make them find a way to escape decapitation--none of those conflicts can be resolved by talking, crying and kissing where it hurts--and you are golden!
And if your characters manage to pull off some witty and meaningful banter while sawing off the head of the dragon--more power to you.
I would read that story.
Best of luck!
Answer: So, I have exactly the same problem with my writing. I'm much more "internally" focused than "externally", and I tend to imagine these intricate relationship twists between my characters (and themselves, and others). But unlike you, I'm primarily interested in Fantasy, so I've had to deal with the problem from the start.
As the other answers have focused on some of the conceptual solutions, let me give one tip that I've used to help me. When I start writing, I have several cool scenes in mind that I want to write - an opening dramatic scene, a fascinating ending etc. My problem is that I have no idea how to get from the opening to the end, and frankly, at first I think it's boring - who cares what adventures they have on the way, when it's only an excuse for the grand ending?
The solution I've found to this (which sometimes works) is to try and write the ending straight away. As you do this, you suddenly realize that the character that reaches this ending is probably not the same one that started the journey - they have grown, learned new skills (e.g., magic, swordfighting), and have scars from places they were hurt (e.g., lost loved ones etc). You know you want to rely on these changes they went through in your ending - it's what makes their choices make sense, and drives the internal, personal drama. So then you start to write the portions that led up to this ending. Suddenly, you will ask yourself questions about THOSE sections - where they took place, how they got there, and so on. Slowly you fill in the gaps.
In your case, for example, you ask "how they get to Hell". Well, it seems to me that entering Hell would not just be a simple thing, and it might cost them a serious personal cost (blood, soul, that sort of stuff). That cost will have internal projections, so in your case, you can address it in reverse: what personal cost do you want them to pay, or be at risk to pay, to make their character more interesting? Once you know that, you can construct the external world to impose that cost/threat.
Anyhow, hope your characters go to hell... ;)


Difference between String.length() and String.getBytes().length

Question: I am beginner and self-learning in Java programming.
So, I want to know about difference between String.length() and String.getBytes().length in Java.
What is more suitable to check the length of the string?
Comment: `string.length` will give the number of characters in a string, where as `string.getBytes().length` will give number of bytes used by the string to store the value. In normal circumstances each character can take 2 bytes each to store a unicode value
Comment: @ArunPJohny: No, `string.length` will return the number of "Unicode code units" in the string. For ASCII text, it will count characters. For arbitrary Unicode text, it's... complicated. See BeeOnRope's answer for the ugly details.
Comment: What did your experiments suggest?
Comment: Have you tried using it on a unicode String?
Answer: String.length()
String.length() is the number of 16-bit UTF-16 code units needed to represent the string.  That is, it is the number of char values that are used to represent the string and thus also equal to toCharArray().length.  For most characters used in western languages this is typically the same as the number of unicode characters (code points) in the string, but the number of code point will be less than the number of code units if any UTF-16 surrogate pairs are used. Such pairs are needed only to encode characters outside the BMP and are rarely used in most writing (emoji are a common exception).
String.getBytes().length
String.getBytes().length on the other hand is the number of bytes needed to represent your string in the platform's default encoding. For example, if the default encoding was UTF-16 (rare), it would be exactly 2x the value returned by String.length() (since each 16-bit code unit takes 2 bytes to represent).  More commonly, your platform encoding will be a multi-byte encoding like UTF-8.
This means the relationship between those two lengths are more complex.  For ASCII strings, the two calls will almost always produce the same result (outside of unusual default encodings that don't encode the ASCII subset in 1 byte). Outside of ASCII strings, String.getBytes().length is likely to be longer, as it counts bytes needed to represent the string, while length() counts 2-byte code units.
Which is more suitable?
Usually you'll use String.length() in concert with other string methods that take offsets into the string.  E.g., to get the last character, you'd use str.charAt(str.length()-1).  You'd only use the getBytes().length if for some reason you were dealing with the array-of-bytes encoding returned by getBytes.
Answer: The length() method returns the length of the string in characters.
Characters may take more than a single byte. The expression String.getBytes().length returns the length of the string in bytes, using the platform's default character set.
Comment: There's no such method `getLength()` I think you mean `String.getBytes().length`.
Answer: The String.length() method returns the quantity of symbols in string. While String.getBytes().length() returns number of bytes used to store those symbols.
Usually chars are stored in UTF-16 encoding. So it takes 2 bytes to store one char.
Check this SO answer out.
Answer: In short, String.length() returns the number of characters in the string while String.getBytes().length returns the number of bytes to represent the characters in the string with specified encoding.
In many cases, String.length() will have the same value as String.getBytes().length. But in cases like encoding UTF-8 and the character has value over 127, String.length() will not be the same as String.getBytes().length.
Here is an example which explains how characters in string is converted to bytes when calling String.getBytes(). This should give you a sense of the difference between String.length() and String.getBytes().length.


Why is a horizontal rod a full wavelength oriented radially to a broadcast antenna not the best receiving antenna

Question: I have always struggled to get a good physical understanding of Electromagnetic waves. I've done the whole Maxwell's equation approach, wrote boundary element solver tool but cannot rationalize that with a phenomenological understanding of E/M. The waves propagate radially from a broadcast antenna, so you have a time/distance varying electric field in a radial direction. A full-wave horizontal rod with feed taps at 1/4 and 3/4 of its length seems like it should be the best receiver. Help me get a better understanding, if I am wrong.
Comment: What is the effective aperture of your antenna in the orientation it is placed.
Answer: The waves are not only varying as they propagate radially, but, for a vertical transmit antenna, the EM field will vary vertically as well.
That's because a vertical antenna has finite height, thus the top and bottom are not radiating at the same phase (due to the speed of light of propagation from the bottom to the top of the antenna).  Thus the radiating EM field will be vertically polarized, and the highest gain will be with an antenna of that same polarization (thus accelerating receive electrons in the same orientation as the accelerating electrons generating the EM waves).
There will be some reception with a radially oriented antenna, that's the basic theory behind a long wire Beverage antenna.  But the gain will be lower because the pair of antennas will be trying to accelerate transmit and receive electrons orthogonally to one another; and the field propagating from the top and bottom of the transmit antenna will be seen out of phase and thus partially cancel at the receive location.
Comment: Thanks, @hotpaw2. This is helpful!
Answer: It is true that the variations in field strength propagate radially from the transmitter.
However, as your diagram shows, the fields themselves are vector fields, and the orientation of the vectors (both electric and magnetic) is at right angles to the direction of propagation. They have no effect on a conductor oriented radially.

In a comment, you mention:

Now, I'm thinking about the receiving antenna as a wave guide.

Yes, that's a good analogy. In fact, that's the principle behind the Beverage antenna alluded to by hotpaw2. It works only because it is physically close to the ground, which makes it part of a transmission line — a kind of wave guide. The propagating E field induces a voltage between the wire and the ground. This wave of voltage moves along the wire at roughly the same speed as the radio wave, reinforcing signals coming from the correct direction. Signals arriving from other angles interfere with themselves destructively.
Comment: Thanks, @Dave. Good thoughts to enlighten my mind. Now, I'm thinking about the receiving antenna as a wave guide.
Answer: First, because the broadcast tower sends out vertically polarized waves and your receiver antenna is horizontally polarized.
Second, because the directivity of a lambda dipole is an —8— with the dipole as its mirror plane.
Comment: Thanks, @Janka. I appreciate the thoughts. I understood directivity to express whether the antenna receives better in one (compass) direction than any other. In my flawed thinking I thought this antenna would be very directional - that is, that its orientation radial to the orientation of the broadcast tower would be a large maxima in reception.
Comment: Dave Tweed explained it very simple: In the radial direction, the antenna cannot pickup energy from the wave.


Why not use fire-retardant plastics everywhere?

Question: Some plastics will sustain a flame. Others won't. Not spreading a fire is obviously preferable in almost every circumstance. What advantages do combustible plastics have over non-combustible plastics, and in what circumstances?
Comment: cost versus function.
Comment: @SolarMike More details? Are combustible plastics always cheaper than noncombustible ones?
Comment: I don't have access to those details, but those were the first things I thought of when I read your question. It depends what uses you are considering as to the strength, durability etc of the plastic.
Answer: Fire retardant fillers are pretty cheap; often cheaper than the base plastic (Alumina Trihydrate for example). Like anything in engineering though, there are always exceptions and functional reasons why something is never the solution 100% of the time.
Here are some instances where I think fire retardant fillers would not be preferred:

Filler Capacity - A plastic can only accept so much filler. A fire retardant filler would take up this capacity that may be better used for a UV filler or other.
Elastic Modulus (resistance to deformation)- Fire retardant fillers typically make a plastic more rigid.
Transparency - Unless you have identical indexes of refraction, any filler will make the plastic opaque.
Weight - Fire retardant fillers are typically heavier than the plastic.
Disposal - Fillers may make it more difficult to recycle a plastic or burn it in municipal gassifier or boiler systems.

Also, just because a plastic doesn't sustain combustion by itself, it does not mean that it is safe in a fire. Often there is additional sources of energy that bring the plastic to its smoke point. Smoke inhalation kills as many or more people than direct fire does in situations like plane crashes.
Comment: You forgot toxicity. Many fire retardants are toxic on their own. Others decompose into toxic compounds
Answer: It depends on the plastic and its intended use.
Most, but not all plastics will burn, giving off noxious fumes.
To make them "flame retardant" increases the cost and in many cases reduces the physical performance properties of the material.
Many applications require flame retardant plastic materials, such as aircraft interior parts made of plastics.
Look at Underwriters Labs. 94-V ratings tests.