GoCardless Direct Debit integration for CiviCRM: will this extension handle 5 year memberships?

Question: CiviCRM 5.31.0 - Wordpress 5.5.3 - PHP 7.3.24
I help run an organisation (non-profits) where we have individual memberships, lasting for 1, 2 and 5 years and where subscriptions are being currently collected, mainly through PayPal.  We are looking to create a further contribution page(s) to accept direct debits and see this extension as a possible solution.  Before trialling it, does anyone know please whether it and GC would cope with memberships of more than 1 year, where of course the interval between DD's could be anything up to 5 years?
Comment: Could you sepcify what you mean by direct debit, e.g. Sepa Payments?!
Answer: I think thats perfectly possible within GoCardless. You would need to setup a plan for each of the differing membership collection periods you would like to collect for in order to use it as a traditional Direct Debit. FYI a Direct Debit is a UK equivelant of SEPA with some technical differences i.e. UK bank accounts only etc.


How to measure team productivity in Agile project environment?

Question: Are there any techniques other than velocity? What are pros and cons of using those from your experience?
Answer: No I don't think additional metrics are useful or accurate. Some stories require minimal code changes, but lots of time doing other things such as testing, talking to customers, gathering requirements, going to meetings with stakeholders, analyzing the problem, etc etc. Most of these tasks cannot be easily quantified or reduced to a simple metric.
Its still useful to represent these things as stories, because a story is really a piece of functionality from the customer's PoV. They don't care if it takes 1 line of code or 1000. But a good team will realize that the assigned story points are not simply a function of the code size, there's lots of other pieces of work that need to be done. The types of work are so varied and different that finding a uniform, quantitative way to measure them is pretty hopeless. That's why story points are used -- They are a qualitative estimate based on the team's experience with similar features in the past and what those cost in terms of story points.
Comment: I especially agree with the second paragraph.
Comment: In the end, what matters is if the project delivered what the customer wanted and that it was done on schedule, the ultimate qualitative metric. Of course, managers need quantitative measurements to justify hiring/firing, raises and such.
Comment: Thanks for your reply. Velocity indeed seems to be the best, but is it the only way?


What grains have been fermented?

Question: As i'm about to bottle my first batch.  After all the googling and reading I've done, what grains have been fermented into beer?
Comment: splitting this off into a grain by grain question.
Answer: Using this list as a base for grains, I will try to come up with list of grains that have been fermented into alcohol.  Everything in this list should be possible to ferment. The question is, has it?
brewed
Warm-season (C4) cereals

finger millet "The grain is made into a fermented drink (or beer) in Nepal and in
many parts of Africa"
white fonio The grains are used in porridge and couscous, for bread, and for beer
foxtail millet it's been brewed though i was looking for kodo millet at the time.
kodo millet potential answer .. though like foxtail millet, many cousins are fermented everywhere
japanese millet someone patented a process to brew it
maize (corn)  yeah, didn't even read the wiki for proof
pearl millet namibia has it brewed
proso millet yup, brewed.
sorghum 30 sub-species on this one, will need to check each sub-species... stay tuned.

Cool-season (C3) cereals

barley yeah....I'm a completionist. if you're reading this to see if it's been brewed do not invite me over to try your homebrew.
oats cook 'em first.
rice ever drink a light beer?
rye brewing a rye pale ale right now, from a kit.
teff gluten free beer, and amazing bread.
triticale wheat meets rye. of course alcohol.
wheat see rye.

Pseudocereal grains

buckwheat ever had buckwheat pancakes? yeah brew it.
amaranth 44 species. stay tuned
quinoa patent for brewing it, apparently.

Grain legumes or pulses

chickpeas Peruvian Chicha includes chickpeas
common beans more species, stay tuned.
common peas (garden peas) brewed
lentils brewed in 2012 by boreal brewer
mung beans patented
peanuts some evidence it's happened as a mistake, which i'll say they've been fermented by accident.
pigeon peas see peas above.
runner beans yup brewed

Aster family

safflower used in a yeast starter, kind of counts...
sunflower seed brewed.

Other families

hemp seed (Hemp family)not just for brownies anymore not my thing, but it's been brewed.
poppy seed (Poppy family) brewed

no proof yet
Warm-season (C4) cereals

black fonio ... will research further
Raishan ... will research further
Job's Tears turned into a liqour, though no specifications for beer.

Pseudocereal grains
Grain legumes or pulses

fava beans ... will research further
lima beans ... will research further
lupins ... will research further
soybeans forest through the trees again. fermented solids are everywhere, but in a brew? ... will research further

Mustard family

black mustard pretty much a spice and very oily. (ruins head, rots), in a wort?
India mustard oily, a spice, in a wort? not that I found
rapeseed (including canola) um.. used for canola oil, chainsaw and steam engine lubricant. no evidence it's been brewed.

Other families

flax seed (Flax family) yeah. oily.
Comment: +1 for the grains list.  Never would have thought to look for that.  Now I've got lots of new augments to try in the mash!  Mustard sounds interesting!!!!!  Great Answer!
Comment: This in no way answers the question, though.  Asking which grains haven't been fermented is like asking people in a room to raise their hand if they're not there.
Comment: @DennyConn agreed, proving a negative is impossible. Thinking of renaming the question to what Has been brewed.
Comment: And even then you still won't get a comprehensive list.  try to narrow it down a little more.
Comment: K.split it up grain by grain enough?  On my phone, making a wort and can't do it now:)

What grains have been fermented?


How to design test script in some cases?

Question: I have often faced difficulty in designing test script, because unlike coding, there is no clear cut plain and simple logic in designing test scripts, nor there is a universal standard way of doing the same. Even if there is, I assume there would be a context in which it will clearly just not work!
One specific problem I wanted to discuss was this one:-
Suppose I have to design a test script for a module, which itself is a long process consisting of multiple screens, in each screen in which you can provide input (or configure them, in other words) as to what will be the end result of that process. So, there are a lot of permutations and combinations in play here. You get output to test anything, only at the end of that process.
Now, in such a situation, how do I design the test script? It definitely makes sense to test all/maximum number of test cases in a single execution of this process. Since each input or configured screen, has its way of affecting the output, it is relatively easy to isolate the failing test cases, just by seeing the output, obviously only if there is some output to test - if it's a total failure, we may require to run the whole process many times to isolate the test case which is the cause of failure.
In the above case, how do I manage the test case numbering? I am giving inputs in different screens for different test cases, but I am getting the output - to be checked against the expected results, for all of them in a single final step. So here, it's not that I can isolate the pair of action (steps to be taken) and expected results, for each test case! Maybe the actions are different but expected results merge at one final step.
And then, how do I design it for the possibility that it might be giving no output for the above-mentioned test execution for many test cases simultaneously. I how do I isolate the failing test case in such a situation? If I simply refine it, the script and the execution time will become unnecessarily lengthy - since it will mean executing the entire process for each test case or each set of 3-5 test cases. How should I choose between simplicity of test script and the execution time/script length?
Comment: Your question consists of multiple problems, that's why your question was put on hold. I would attack each problem one by one. Some often I guess may even have answers here.
Comment: Oh ComeOnnn!!!! This is important for me, for God's sake! And there is no sense in isolating and attacking each problem one by one, as all of them are related. I
Comment: It is more convenient, easy and simple to discuss such related problems at one place, in one thread, in one discussion.
Answer: One (ptobably not the best and suitable not for every case) possibility is to use varibales during the test execution.
Simplified example
A test scenario consists of two input screens where I have to test the presence of certain elements (title, logo, some text etc. I run the test scenario until the end (output screen) and during execution I set suite variables (e.g. LogoVisible, TitleVisible)  to True or False depending on presence of the corresponding elements.
This was in a way the main test. After that there are subtests which consist only of evaluating of those variables: if LogoVisible isTrue then set test "Check Logo Visibility" to Passed, etc.
In this you have only one test execution but can test several isolated things.


Sometimes no sound in flash videos after boot?

Question: Sometimes after I boot up the machine, I get no sound in flash videos. First I didn't know why it was happening, but as I read a few articles here and there, I found out it was because of my USB webcam (logitech) - ALSA was messing something up and didn't know how to handle sound drivers well (so they say). So one of the suggestions I found was to force the (in my case) snd_hda_intel module load before snd_usb_audio module during the boot process. I thought it worked, but after a while the same problem appeared again. If I just unplug the webcam from my computer, sound works perfectly on each boot, but I don't want to get down and insart the cam everytime I need it... Anyone have any suggestions what I should try to fix this?
Comment: how do you force the intel module to load before the usb one? also although distro isn't the problem distro might matter because different distro's handle that stuff differently.
Comment: I use Arch and I put snd_hda_intel to be the first one in rc.conf (it's a basic conf file in Arch Linux and one of things you can do with rc.conf is that you can set additional modules to load through that)
Comment: do you use pulseaudio?
Answer: You might be able to fix it by creating a ~/.asoundrc see http://alsa.opensrc.org/.asoundrc
Specifically you want the opposite of the case here: http://alsa.opensrc.org/.asoundrc#Default_PCM_device
so aplay -L with out the usb audio in and and asoundrc like this might work:
pcm.!default front:Intel

If your card (Like mine) gets named Intel by alsa just putting that in ~/.asoundrc should work (if you want it to affect stuff that's not run as your UID then put it in /etc/asound.conf)
Oh also none of this really applies if you're using pulseaudio... you need to do different stuff in that case.


Problem loading Crystal Reports

Question: I had a local application in Visual Studio 2010 with Crystal Reports, after install the app in another computer when I want to show a report it throws the following message:
System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient, or the Crystal Reports runtime is not installed correctly. Please install the appropriate Crystal Reports redistributable (CRRedist.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required.  Please go to http://www.businessobjects.com/support for more information*
In my Setup I included all the Crystal Reports dll so I don't have idea what it presents this problem.
Thanks for the help.
Answer: See this blog post for details on how to install and deploy Crystal Reports in Visual Studio 2010.
The blog post also contains links (at the top of the blog) for details on the runtime and licensing options.
HTH

Problem loading Crystal Reports


Isolation transformer faulty or not?

Question: I have a new 240VAC isolation transformer connected to mains.  With the transformer switched off I measure 240AC from either output terminal to mains.  Is this a fault with the isolation tranformer or is this to be expected?
Comment: "Phantom voltage'.  It's a real voltage, but it VERY VERY weak.  Since your meter is nearly infinite input impedance (probably 10Meg or so), it doesn't load down this phantom voltage.   Put like 10k resistor across the terminals, I bet the voltage drops to zero.   https://appliantology.org/blogs/entry/1058-what-is-ghost-voltage/
Comment: thank you Kyle B, right on the money, when loaded with a 5k resistor the voltage drops to a few millivolts. Thought there must be some explanation for it. Thanks again...
Answer: "Phantom voltage'.
It's a real voltage, but it's VERY, VERY weak. Since your meter has nearly infinite input impedance (probably 10 MΩ or so), it doesn't load down this phantom voltage. Put like a 10 kΩ resistor across the terminals, I bet the voltage drops to zero.
https://appliantology.org/blogs/entry/1058-what-is-ghost-voltage
Answer: What you're doing is measuring the "open-circuit" voltage of a circuit with a high output resistance. When the isolation transformer is switched to its off state, it's equivalent output resistance goes high (open circuits are technically very high resistances). Since the input resistance of the multimeter is high and doesn't load your circuit, there is little to no current draw. Therefore the voltage you'll see is the 240V source from the original 240V mains across its transformer coupling with no voltage drop  from the output resistance, because current needs to flow in order for a voltage drop to occur.
This voltage source + output resistance model equivalence is known as a Thevenin equivalent circuit, which basically indicates how good a circuit is as a voltage source. (A circuit with a low output resistance is a good voltage source, as there is low voltage drop across the output, and the load uses most of this voltage due to the principle of voltage division for series connected resistances).
This can be demonstrated in simulation. The multimeter's been given an input resistance of 1GOhm.

It's the same reason why "dead" batteries seem to have a voltage across them, but once you add a load, it will drop to near zero. Measuring the open-circuit voltage is only half the information you require when looking to evaluate whether its sourcing any voltage or current. To gather the other half, you'll need to draw current by adding a load resistance and see the voltage drop across the load. Alternatively, you could measure its short circuit current (not recommended in practice unless you have some idea that you know the output resistance is high).

Isolation transformer faulty or not?


How do I get a Christmas tree in Clash of Clans?

Question: I've been hearing all about this Christmas tree thing, but I still don't know how to get one. I also heard that today is the last day that you can get one, so I was hoping that I can get one before the Christmas update ends.
Answer: Christmas trees are completely random spawn just like any other ground obstacle.  (Only spawning when you aren't playing )
From playing on two different accounts: I noticed that my lower level account spawned 4 Christmas trees while my high level account only spawned 2  during this seasonal theme.   In addition, the lower level account had much more room free to spawn which may have improved my chances for spawning them.
Comment: I thought you had to do something special to get them. Looks like it's based on luck. Thanks!
Answer: It is just rarity in the 2013 Christmas update. The lower your Town Hall is, the more will spawn.


Diagonalization of a "general" linear map.

Question: When we study diagonalization, we only deal with matrices associated to Endomorphisms $\phi:E\longrightarrow E$ where $E$  is a  finite dimensional $K$-vector space. My question is why don't we diagonalize matrices associated to a linear map $\phi: E\longrightarrow F$ where $E$ is an $n$-dimensional $K$-vector space and $F$ is an $m$-dimensional $K$-vector space? Thank you for your help!!
Comment: You might be looking for singular value decomposition : http://en.wikipedia.org/wiki/Singular_value_decomposition
Answer: You can choose bases $\mathfrak{E}$ of $E$ and $\mathfrak{F}$ of  $F$ so that the matrix of $\phi$ with respect to them is of the block form
$$
\begin{bmatrix}
I & 0\\
0 & 0
\end{bmatrix}
$$
where $I$ is an appropriate identity matrix.
In other words the matrix has all zeroes, except for a (possibly incomplete) diagonal of ones. This is of course as diagonal a matrix as they come.
This is very easy to see. Choose a basis of $\ker(\phi)$, and extend it to a basis of $E$; this is $\mathfrak{E}$. Now consider the non-zero images under $\phi$ of the vectors of this basis. They will form a basis for the image of $\phi$. Extend this to a basis of $F$; this is $\mathfrak{F}$.
PS I am addressing a question OP asked in a comment below. The reason we can do this is that we are assuming $E$ and $F$ to be two unrelated vector spaces, for which we can choose independently two bases. In the case of $\phi : E \to E$, the idea is to choose one basis for $E$ (that is, the same basis for the domain and the codomain) to obtain a matrix of a convenient form. This is of course more limiting than being able to choose different bases for the domain and the codomain.
Comment: Are you saying that when $dim(E)=dim(F)=n$ then we can always find basis $B_E$ of $E$ and $B_F$ of $F$ for which the matrix associated to the linear map $\phi:E\longrightarrow F$ is a square diagonal matrix?
Comment: @palio, please see the **PS** to my answer. But, yes, the answer to your question is yes.
Comment: Dear Andreas, your PS is exactly what i want to understand : If we know a process how to find a diagonal square matrix for any linear map $\phi:E\rightarrow F$ where $E$ and $F$ are vector spaces with same dimension, why do we extensively study the case of : 1) $E=F$ and 2) take the same basis for the domain and codomain?
Comment: @palio, there are many reasons, one of them is that choosing the same basis allows for composition, i.e. iteration. For instance, you can compute more easily the $1000$-th power of the matrix $\begin{bmatrix}0&1\\-2&3\\\end{bmatrix}$ by putting it into diagonal form $\begin{bmatrix}2&0\\0&1\\\end{bmatrix}$ first. If you choose two different bases, you may get a slightly nicer form, but composition fails.
Comment: I thought a linear map $f:E\rightarrow E$ does not depend on a choice of basis for the domain an codomain when an explicit formula for $f$ is given, i mean when for each element $x\in E$ the corresponding image $f(x)\in E$ is known and then composition is always defined, the choice of basis is relevant when we get from maps to matrices, in that case we have to choose the two basis to write the matrix, and in the setting of matrices composition is not defined since for the matrix $M^2$ the first $M$ correspond to a $f$ from basis $B_1$ to $B_2$ while the second $M$ from $B_2$ to $B_1$.


Locked out of my server

Question: I recently got my server and I did a major noob mistake. I forgot to allow my modified ssh port on ufw. Now I can't ssh into it. It's a remote dedicated server. So that means I have to ask the host to allow it?
Comment: yup!! you have to ask host. No other way around
Comment: Thank you. I hope the host doesn't have to do a complete reinstall?
Comment: Yes,  No need to.  You can request service desk or help desk
Comment: Some VPS hosts provide a web-based serial console, or some other way of accessing your server directly (even if you don't have something like SSH installed for remote access!). You might want to check to see if your host offers something like this.
Comment: As a safety precaution it can be a good practice to temporarily disable ufw auto-startup at boot (i.e. in Ubuntu 16 you would do `systemctl disable ufw`). That way if you lock yourself out when you cycle ufw (`ufw disable && ufw enable`), you can reboot the system and ufw will be offline. If following this suggestion, don't forget to re-enable ufw (`systemctl enable ufw`) once you've confirmed that access is ok after cycling ufw.
Answer: Ordinarally Raja would have the reason.
If it is on amazon cloud, you could set up another server, and attach the other server storage and change the config by hand.
You have to know the provider features. Perhaps there are ways. Many "dedicated servers" aren't trully that. Ask for your host support.
Or hire a whitehat pentester to try to do so if it is legal on your country. On my country is legal, as long as the servers is really yours.

Locked out of my server


Drupal Commerce assign role on account create on checkout

Question: When a checkout is completed by an anonymous user on a Drupal Commerce website, a Drupal account will be created. I would look to auto-assign a role like 'customer' to the newly created Commerce user. How can I do that programmatically? It has to be in Drupal 7 code so I can use it for my custom module.
Answer: <code>$account = new stdClass;
$account->is_new = TRUE; //indicate the account is new
$account->name = 'account_name';
$account->pass = user_hash_password('password'); // make a function to create random passwords
$account->mail = 'email';
$account->init = 'email';
$account->status = TRUE; //set the user to activated at creation
$account->roles = array(DRUPAL_AUTHENTICATED_RID => TRUE); //set user as authenticated user
$account->timezone = variable_get('date_default_timezone', '');
$new_user = user_save($account); //create user (user_save() returns a fully loaded $user object)

$role_name = 'ROLE_NAME'; // The name of the role to add.
if ($role = user_role_load_by_name($role_name)) {
  user_multiple_role_edit(array($new_user->uid), 'add_role', $role->rid);
}
</code>
You can use the hook: hook_user_insert.
And apply the last piece of code from above to update the role.
Comment: @dimitril Consider adding what you report in your first comment in the answer itself. The answer should not be searched in the comments.
Comment: I think I have been unclear. Drupal Commerce already creates an account when the checkout is completed. Somehow I have to jump in, for example with a commerce hook and fetch the newly added user and edit the role there.
Comment: You can use the hook: hook_user_insert.
http://api.drupal.org/api/drupal/modules%21user%21user.api.php/function/hook_user_insert/7

And apply the last piece of code from above to update the role.
Comment: Ah, yes. That sounds good. I'll let you know if it worked for me.
Comment: I made an error in my thinking: all new users should be assigned the customer role. So this was my final implementation:

    hook_user_presave(&$edit, $account, $category) {
          if (isset($account->is_new) && !empty($account->is_new)) {
            $user_roles = user_roles(TRUE);
            $default_role = avariable_get('debtor_settings_default_role');
            if (!isset($edit['roles'])) {
              $edit['roles'] = array();
            }
            $edit['roles'] = array($default_role => $user_roles[$default_role]);
          }
        }


Relativistic mass or rest mass

Question: If we have two particles having same rest mass say $m$ and equal velocity approaching $c$ and they do a head on collision and stick together, then the mass of both particles after collision should be equal to 2(relativistic mass) . My view is it should be 2(rest mass) because they are no longer in motion so their masses should be again equal to rest mass. But by energy conservation it should be equal to relativistic mass. What do actually happen here?
Comment: They lost all their kinetic energy in the form of EM waves
Answer: The reverse of this process happens in radioactive decay: a nucleus with some mass (and hence weight) decays to some number of products. The sum of the mass of those products is less than the original nucleus's mass. The difference makes up the kinetic energy of the products.
Now imagine it in reverse: the total energy, including kinetic, makes up the final mass.
Answer: When working with velocities close to c, one should be working with four vectors,
In special relativity mass is not a conserved quantity. It uniquely defines quantum mechanical particles by the length of the four vector describing them called the rest mass, or the invariant mass, characterizing each particle, invariant under Lorentz transformations.
The term relativistic mass and its algebra has fallen by the way side , exactly because it causes confusions as the one in the question. It connects Newtonian inertial mass concepts with the relativistic energy concepts and is useful only when thinking of spaceships and the fuel they will need to reach relativistic energies.It is not used in particle physics.
Suppose the two particles you are assuming are elementary particles of the standard model of particle physics.They cannot "stick together" inelastially, because energy would not be conserved as you state in the question. The experiment has been done several times, in e+e- scattering, and there is no channel where at the center of mass a single entity forms/sticks together, except within the Heisenberg uncertainty principle, resonances as seen here:

These are hadronic crossections, i.e. e+e- scattering into various hadrons.
Note the peaks as the energy of the beams increases, these are resonances, with the necessary mass for conservation of energy but decaying very fast into their constituent elementary particles, within the HUP.  For a Δ(t) they make up a new massive entity , which has to decay into standard model particles because  they are resonances. This is the experimental fact, and lorentz transormations describe it exactly.
Now in nuclear physics, if a stable state could be reached in the passing over the resonant part of the potential, it would be stable but not completely inelastic because there is no just "sticking" in quantum physics. There will be other particles taking away kinetic and binding energy ( the sticking part in quantum regime) as in this example of fusion in the sun. Proton proton fusion will always give a deuteron which has  a mass lower than two protons, and thus at least a positron and an electron neutrino leave the interaction region balancing the energy budget. Note that also quantum numbers have to be conserved, hence the positron electron neutrino pair.
In general , in the quantum regime, stability ( sticking) depends on stable energy levels  in nuclear matter otherwise it is just resonances within the HUP, and quantum number conservation has to be obeyed.
Comment: "which has to decay into standard model particles because they are resonances. This is the experimental fact, and lorentz transormations describe it exactly." You mean resonances within the HUP? Could you give a hint how the stable energy levels are calculated?
Answer: The relativistic mass after the inelastic collision is defined by the total energy of the particles via $$m_{rel}=\frac{E_{tot}}{c^2}$$ The total energy is just the sum of the energies of the two particles before collision $$E_{tot}=E_1+E_2=m_{1rel}c^2+m_{2rel}c^2$$ with $$m_{1rel}=m_{2rel}=\frac {m_0}{\sqrt{1-v^2/c^2}}$$ where $m_0$ is the rest mass of the particles. Thus the relativistic mass of the two particles after collision is just the sum of the relativistic masses of the two particles $$m_{rel}=m_{1rel}+m_{2rel}=\frac {2m_0}{\sqrt{1-v^2/c^2}}$$ The kinetic energies of the particles after the collision is zero and has converted into an equal amount of internal energy (e.g. heat). Thus the mass of the combined particles after collision is larger than the sum of their rest masses.
Comment: Well then the total weight on earth would be relativistic mass times g?
Comment: @HimanshuTyagi - Yes, the total gravitational force  of the combined particles after the inelastic collision would be $g m_{rel}$.
Answer: The energy of the system won't change. The energy of the particles alone might, so their relativistic mass might too. As was pointed out in a reply the particles might have emitted radiation that would balance out this difference in relativistic masses, though the emitted radiation would still be a part of the system, so the system's energy won't change. But if we say they didn't emit radiation we can still find places where the difference in mass was sunk in.
First there is heat energy. The kinetic energy of the "obvious" movement might have been converted to heat, which is a mixture of kinetic and potential energy. Which brings me to the second point - potential energy. Potential energy is a characteristic of the system, rather than the particles. So it is possible that part of the relativistic mass difference of the particles was transferred to potential energy in fields corresponding to the fundamental interactions that the particles can participate in.
Finally something that might be worth mentioning is that two particles cannot just stick together and stop moving. This would imply that their positions and momenta are perfectly defined, which violates the Heisenberg's uncertainty principle.
Comment: Thanks for answering but I was thinking if I take weight of both particles after collision what will it be?
Comment: Measuring rest masses would give the same result at the start and at the end, measuring the relativistic masses - wont, because the relativistic mass doesn't take in account potential energy. So it goes: mass of the whole system - unchanged; relativistic mass - reduced; rest mass - unchanged; mass stored in potential energy - increased by the amount that relativistic mass was reduced.

Relativistic mass or rest mass


Is 'If I die young' grammatical?

Question:
Is it a strictly grammatical clause, or an idiomatic but ungrammatical short for 'If I die when I am young'?
If it is grammatical, is 'young' used as adverb, or 'die' used as copula, or a valid case of 'verb+adjective'?
Is similar structure common in real life conversations? Can you give me some more examples?
Comment: I don't see any copula or adverb here.  *Young* is an adjective functioning as a depictive secondary predicate.  In fact, this is pretty much a textbook example.  Someone should make a canonical question about this stuff since it comes up so often, and people keep calling them adverbs.
Comment: Grammatical how? As a complete sentence? Or as a clause?
Comment: I see a complement in "young".
Comment: @snailboat Looked up [secondary predicate](http://en.wikipedia.org/wiki/Secondary_predicate). That also sounds like a reasonable interpretation. Is there any reason 'die' couldn't be acting as a copula, with 'young' as a secondary predicate? I'm really not that familiar with this grammatical structure in a formal sense.
Comment: @J.R. Good point. I don't really have trouble with sentence, clause, phrase or sentence fragment. Question updated.
Answer:
Yes, it is grammatical, and yes it means "if I die when I am young". "If I die young" is not a sentence by itself, but would normally be the dependent clause in a conditional statement.
Die is used as a copula in the sense that it is the primary verb linking the subject and predicate, but that's a pretty simplistic sense.
'Copula' usually refers to an existential 'linking' verb like 'be' rather than an active verb like 'die'. However, if you look at this answer, you'll see that although 'die' is not normally a copula, 'die' in "I die young" fulfills many of the criteria, particularly B and E. I'm not familiar enough with copulas to say for sure whether it is or isn't, but it looks close enough to me.
'Young' could be considered an adverb describing the way you would die, or as an adjective describing yourself at the time of death. I can see arguments both ways. 'Young' is normally an adjective, but [noun][verb][adverb] is the more common pattern. If I had to choose, I would call it a predicate adjective modifying 'I', as in the sentence "I am young" (where 'am' is a copula).
Yes.

"If I seem nice..."
"If I go loud..."
"If I run fast..."
"If I learn quick..."
"If I am fat..."
"If I die handsome..." (the person was handsome at death)
"If I die handsomely..." (the way in which the person died was handsome)
"If I [almost any verb phrase you want]"
Comment: How does this not pass copula criterion E: "It cannot be passivized". What would be the passive form of "If I die young"?
Comment: @JeremyNottingham Y'know what, you're right. I got my thinking turned around there. The phrase I'm considering in that section is "I die young". This would be equivalent to "They prefer small" in the other answer. Turning this around, you have "Young is died by me", corresponding to "small is preferred by them". This doesn't make sense, so it cannot be passivized, so it actually *passes* that criteria.
Comment: Good answer. And I am not downvoting. I am just being somewhat a tiny bit unorthodox (well not really in my mind): *If I die young* expresses a complete thought, which to some is what makes a sentence. *Joe, do ya wanna be cremated?* Joe: *If, I die young.* Yeah, you can talk about ellipsis, but still it's a sentence. Okay, that's all for today.
Comment: @pazzo I agree that in your example "If I die young" is a complete thought, but only because of the ellipsis you mentioned. Specifically, it's [answer ellipsis](http://en.wikipedia.org/wiki/Ellipsis_%28linguistics%29#Answer_ellipsis). That's because information from the question is added, and this extra information makes it a complete thought. Just by itself though, without anything else to add through ellipsis, there is not a complete thought, and therefore no sentence. If a random person walks up and says "If I die young", then what have they told you?
Answer: "young" in "to die young" is a normal adjective.The way someone can die can be peacefully or painfully, but the way of dying can't be young. "young" stands for "to die in young age" or "when someone is young". One does not think of the manner of dying but of the age of someone who died.
The school rule that after a verb follows an adverb is an oversimplification. There are a lot of verbs followed by an adjective where we clearly don't think of manner but of something else. But, of course, for beginners it is difficult to feel the difference and the grammar point verb + adjective is not a point in course books. It is advanced grammar.
Some examples

to buy sth cheap (at a cheap price, not in a cheap manner)
to break free - He tried to break free (to get free)
to fly high - (at a high level or to a high point)
to ring true (that rings like sth that is true)

Is 'If I die young' grammatical?


How would I extract odd-numbered pages from pdf using the command line on a mac

Question: The file is too big to do a manual extract using Preview.  It can be done manually in Chrome by pasting in 1,2,3... in the print dialog, but this is tedious.  Is there a command line tool to extract alternate pages (odd or even) from a pdf file?
Answer: You could use sejda-console (GNU Affero Public License 3.0 open source license):
<code>./bin/sejda-console extractpages -f /input/file.pdf --predefinedPages odd -o odd.pdf
</code>
I'm one of the developers in the project.
There's also a web interface: https://www.sejda.com/extract-pdf-pages
Comment: Many thanks for your help and efforts for this important project!  I was unable to get the command line interface to work. The documentation at https://github.com/torakiki/sejda/wiki/Getting-Started talks about a bin directory, but there was not one in either the top level of the extracted tar file, nor in the sejda-console subdirectory.  How do I proceed to install it on my mac?  The web interface works well, but is not as convenient for me as having a working command line interface.
Comment: I've updated the download link: http://sejda.org/ You should download a zip file, that when extracted contains a bin folder.


audio jumps to next frame rate - premiere pro

Question: I have the following problem: 2 video clips with two audio clips. I try to synchronize them with the option "show audio units" to make them perfectly alligned. The problem is, when I select both video and audio, the audio than jumps back to the next frame rate. I lose the exact setting I did when synchronising the files. I did a video to show the problem. Any help would be appreciated.
Answer: I think you should try aligning only the audio when you do this.  The video tracks have to be aligned to the nearest frame, because video is either showing frame 1 or frame 2 (assuming your sequence frame rate is the same as your footage frame rate).
Audio is sampled at a much higher rate than video.  e.g. your video could be 25 frames per second, but your audio could often be 48kHz, so sampled 48,000 times per second.
Your ears can detect very small variations in delay between audio files (of a few milliseconds), and your ear/brain/eye combo can detect very small discrepancies between audio and video lip sync (22ms according to this).


X muss auf das Ganze gehen - what does this mean

Question: The context concerns a certain component - for brevity let's call it X. Some believe this component is the name of a single part of a multi-part whole. Others believe it is the name of the multi-part whole itself. What does "X muss auf das Ganze gehen" mean? From the context I infer it means, effectively, "X is the whole." Am I correct? The word I care about most is this sentence is aufgehen. Dictionaries are not providing clear help. I see a common definition of aufgehen in dictionaries as "rise up from." That could possibly fit the context, but I suspect it is not correct. Despite the use of the accusative, which parallels my example, this idea does not seem to fit either: Auf den Sack gehen.
Answer: Unfortunately, your interpretation is wrong. The verb is not "aufgehen". One can tell this because the parts of a separable verb do not separate when it's in infinitive, so aufgehen is still aufgehen when combined with a modal verb like müssen.
Auf etwas gehen here means to aim at something or to go for something. So, the sentence literally means "X must go for the whole." A more idiomatic translation is probably "X has to go all in."
Comment: Fabulous, RHa! Thank you. In the back of my mind I wondered about aufgehen. I should have looked up gehen + auf. This now makes sense.


Effect of gaussian blur on FFTs

Question: I am trying to figure out the difference between the FFT of an image, say, cameraman.tif in MATLAB and the FFT of image when the image is Gaussian blurred. What is the effect of the averaging filter on the FFT computation?
Answer: Pardon me if I'm telling you anything here that you already know. Gaussian blurring is a form of lowpass filtering. This can be seen if you take the Fourier transform of a Gaussian, which gives another Gaussian with  a new standard deviation: $\sigma_f = 1/(2\pi \sigma)$. A fat Gaussian in the image domain gives a narrow one in the frequency domain, and vice-versa.
As Tim Wescott pointed out, in general you can see the effect of filtering in the frequency domain by taking the (zero-padded) FFTs of your image and filter, and multiplying them together point-wise. For Gaussian blurring you can see that this product will attenuate higher frequencies and preserve low ones. But the transition from low to high frequencies is gradual, since a Gaussian doesn't have a sharp cutoff frequency like an "ideal" lowpass filter (which has a "box" or "tophat" shape in the frequency domain).
Answer: If you took the "perfect" Fourier transform of a blurred image, then the result would be the Fourier transform of the image multiplied by the Fourier transform of the blurring filter.
This can apply to your case, but it depends on the details of how you take your FFT and how you apply the blurring filter.  In general, the results will be pretty close.
Where things can differ is that if you just take your image as a 2D matrix and take the FFT of it, the algorithm will treat the image as if the top row of pixels is contiguous with the bottom row, and the left column is contiguous with the right.  If you took such an FFT and multiplied it by the FFT of a Gaussian filter, then took the IFFT, then the image content on each edge would bleed into the content on the opposite edge (this is well known -- I couldn't tell you what search term to use, but it'll be treated out there in all sorts of different ways).
Answer: Gaussian filtering is one of the well-known low pass filtering techniques that focuses on the Gaussian noise models on the data. When you low pass filter the signal, you lose the higher frequency parts of the signals, such as edges on the image. The result is a blurred image.
Answer: When you perform FFT on input data with gaussian noise, its going to increase the noiseFloor when you plot the magnitudes vs freq (FFT) plot .  If you average/smooth out the gaussian added image data, that will reduce the noise. But it depends on how much averaging you are aaplying .. Too much averaging , you are going to loose the signal features.
Comment: Pretty sure the OP means [filtering the image with a Gaussian filter](https://en.wikipedia.org/wiki/Gaussian_blur), not adding Gaussian noise.

Effect of gaussian blur on FFTs


How can particles undergo length contraction if they're 0 dimensional?

Question: Take idea of relativistic magnetism, for example. How can a magnetic field be generated due to the electrons undergoing length contraction relative to the positive charges if the electrons moving through the wire themselves have no length?
Answer: Their three-dimensional fields get squished.
Comment: @Dutonic niels means the (classical) electromagnetic field, not the quantum electron field.
Comment: For physics undergrads unfamiliar with quantum field theory but competent in basic quantum mechanics, is there a slightly more intuitively satisfying way to explain that concept?
Comment: @Dutonic This is a classic relativity problem, and quantum mechanics is irrelevant. The entire problem can be understood by transforming the linear motions of charges. I posted it on PSE, but don;t know how to link to it. There are reams of wrongheaded explanations on the internet, yet no one just does Lorentz transform.
Answer: I assume your talking about a positive ion lattice with free electrons moving at $\beta$. This is one of the most misunderstood SR problems on the internet.
In the wire lattice frame, the proton and electron densities are the same:
$$\rho_+=-\rho_-$$
(by definition…it is stipulated in the problem that the wire is neutral in its rest frame). Hence, there is just a magnetic field $B$.
Now in a primed frame moving at $\beta$, so that the current electrons are at rest, the positive lattice is Lorentz contracted, and the density increases:
$$ \rho_+' = \gamma\rho_+$$
Moreover, they are moving at $-\beta$, so they create a current:
$$ I_+=-\beta\rho_+'$$
Fine. It's the electrons that confuse everyone.
They are not in a lattice. They are not one physical object. They are many independent objects that, when the current is turned on, accelerate with identical profiles in the initial rest frame of the wire. Again, this is stipulated b/c the wire remains neutral.
At this point, you need to master Bell's spaceship paradox, where each electron is a spaceship accelerating uniformly in the wire frame.
If you do not understand Bell's spaceship paradox, you will not understand this problem. Period.
It means in any electron's rest frame, the other electrons spread out and the charge density decreases to:
$$ \rho_-' = \rho_-/\gamma $$
With zero current from electrons:
$$ I'_- = 0 $$
Now use those charge and current densities to compute $B'$ and $E'$. You will find they are the exact transforms of $B$ and $E=0$, by $\beta$.
Everything works out just fine,as it always does.
In thinking about the problem: in the wire rest frame, the moving electrons pass the ions all simultaneously, so that in the electron restframe: they don't. That might clear up apparent contradictions.


Are matter and energy dependent on each other?

Question: If matter creates energy and energy creates matter can one exist without the other?
Comment: What you define energy as?
Answer: I suppose you're refering to the famous relationship of $E=mc^2$, which expresses the connection between rest mass (that is, mass of an object not moving in our inertial frame of reference) and the energy it possesses. However, how you describe their relationship is not exactly accurate, so let me try to give you a clearer picture.
First of all, there's not only one type of energy but a wide variety of expressions. For example, an object that is moving possesses a kinetic energy, that is, energy related to movement. The most familiar case is an object with mass $m$ that moves with a certain velocity $v$, which has an energy equal to:
$E=\frac{1}{2}mv^2$
At first glance, this may lead you to think only objects with mass can have kinetic energy. However, a photon, which is a particle without mass, can also have a kinetic energy which depends on its frequency $\nu$:
$E=h\nu$
In this case, you can have something with kinetic energy both either with and without mass. You haven't created or destroyed matter in both cases, but the object carries an energy related to its movement. In a similar fashion, you may find energy related to other interactions, such as gravitational potential energy, thermic energy, electromagnetic potential energy, etc.
In the broadest sense, energy is a property of an object that can be transformed and/or transferred to perform some work (i.e. you can convert kinetic energy to push something forward on a collision).
On the other hand, going back to the connection of $E=mc^2$, what this implies is that, given a particle with mass $m$ at rest, totally isolated from its surroundings and without any additional form of energy, if annihilated (say, by meeting its antiparticle) will produce an energy exactly equal to $E=mc^2$. In other words, if an object is annihilated, the mass doesn't simply disappear, but it's transformed into yet another type of energy (in a particle-antiparticle annihilation, this energy is carried by photons, which are massless, with kinetic energy $E=h\nu$). In other words, this means that matter AND energy must be conserved in any interaction (which is a generalization of the law of conservation of energy you may be familiar with).
In the same sense, you can take a massless photon with certain energy near a nucleus, and produce a particle-antiparticle pair. Now, before you didn't have mass, and after the interaction you have mass, so part of the energy of the photons must have been transformed into the mass of the particles by the same relationship of $E=mc^2$. This is the usefulness of this relationship*.
However, again, remember that this is just one type of energy, and there're several expressions of energy you can consider. It's not like they cannot exist without each other.
*Recall again that this equation only applies for particles in rest, there's a more general expression for moving particles but I didn't want to introduce it now as not to confuse you.
Answer: Energy can exist without mass: photons have energy but no mass, and the electromagnetic field has an energy density but is generally considered not to have mass.  However, mass cannot exist without energy. Mass is energy that is confined.
If a photon were confined in a massless box of perfect mirrors (not physically possible, but let's pretend!), then its energy would be confined and it would have a mass equal to $m$:    $m = E/c^2$.


Dataframe not populating when I am doing subset?

Question: I have a dataframe that has two columns. One column is the product type, and the other is characters. I essentially want to break that column 'product' into 12 different data frames for each level. So for the first level, I am running this code:
df = df %>% select('product','comments')
df['product'] = as.character(df['product'])
df['comments'] = as.character(df['comments'])

Now that the dataframe is in the structure I want it, I want to take a variety of subsets, and here is my first subset code:
df_boatstone = df[df$product == 'water',]
#df_boatstone <- subset(df, product == "boatstone", select = c('product','comments'))

I have tried both methods, and the dataframe is being created, but has nothing in it. Can anyone catch my mistake?
Answer: The as.character works on a vector, while df['product'] or df['comments'] are both data.frame with a single column
df[['product']] <- as.character(df[['product']])

Or better would be
library(tidyverse)
df %>%
    select(product, comments) %>%
    mutate_all(as.character) %>%
    filter(product == 'water')


Mass and frequency of photons

Question: Light is affected by gravity which means light has got mass. Quantum theory tells us that light consists of discrete quanta of energy, which we call photons. These photons have a rest mass of zero (as a consequence of special relativity), but a "moving photon" (I don't know whether that notion is stupid) has got some mass.
According to Planck, a photon travelling with a frequency ϑ will be associated with an energy
$$
E=hϑ.
$$
Since the same photon is travelling at the speed of light, it should hold valid for relativity also. In relativistic theory, the energy of a photon is given by
$$
E=pc
$$
for a photon $p=mc$ where $m$ is the relativistic mass of the photon.
Hence $E=mc^2$
Comparing both equations,
$$
hϑ=mc^2$$
or
$$m=hϑ/c^2$$
which means the mass of a photon is dependent on its frequency. This is the cause of redshift of light in a gravitational field. But how frequency account for mass?  Is it a direct evidence that light and matter are not distinct entities of the universe, but matter is nothing but condensed energy?
Answer: There is a great misunderstanding here. The photon is an elementary particle (the gamma in the table is the photon) of spin one and mass zero. This has been validated innumerable times in nuclear physics, atomic physics and particle experiments. There is no question about it.
Special relativity treats the four-vector of a particle. In this framework the masses of all particles are the four vector dot product, called the invariant mass  and does not change, hence the name.
In General Relativity the total four vector follows the geodesics of the four dimensional space time , it is the total four-vector that bends in space time , whether a massive particle or a massless one.
All the rest is misuse of formulas , due to fundamental misunderstanding of special relativity.
Answer: Light is a gravitational wave of bent space, it travels at the velocity of C, where time slows down. At that velocity (with time dilation) it makes a gravity wave into the photon.  Mass is nothing more than the potential energy of a gravity wave of relativistic bent space. because it is traveling relativistic-ally it is slowing time and bending space. So when the time dilation of a photon or a "micro-gravity wave" travels through a gravitational part of space, like the side of the planet, the planet's time dilation adds to the sin wave of the light's frequency of time dilation causing it to bend along the planet's time dilation gravity gradient.  Where ever mass is, there shall you Always find slower time.  I like this question it gets to the real facts fast!
Answer: I think the answer could be just as simple as that mass of any body i just a projection of that system vibrating. Consider a particle vibrating about a fixed position which starts gaining speed but first when it had zero speed or small vibration frequency its body vibrations were restricted to small particle area but when it start vibrating its projection disperses to a relatively bigger area and when it approaches "c" it completely vanishes. So i think you get the idea that what i am saying.

Mass and frequency of photons


Removing base slug from hierarchical custom post type

Question: I have a hierarchical custom post type called "state". My goal is to have a permalink structure like thus:
http://website.com/idaho/
http://website.com/idaho/sub-page
I'm close but haven't quite figured it out. Here's the code I'm using:
First, I remove the slug
public function remove_slugs( $permalink, $post, $leavename ) {

      $url_components = parse_url( $permalink );
      $post_path = $url_components['path'];
      $post_name = end( explode( '/', trim( $post_path, '/' ) ) );

      if( !empty( $post_name )) {

        switch($post->post_type) {

          case 'state':

            if( $post->post_parent ) {

                $parent = get_post( $post->post_parent );
                $parent = $parent->post_name;

                $permalink = str_replace( $post_path, '/' . $parent . '/' . $post_name . '/', $permalink );

            } else {

                $permalink = str_replace( $post_path, '/' . $post_name . '/', $permalink );
            }

            break;

        }

      }

      return $permalink;

    }

This is hooked into post_type_link.
Next, I reset the query variables so WordPress knows we're dealing with a CPT
    public function parse_custom_post_type( $query ) {

        if ( ! $query->is_main_query() ) return;
        if ( count( $query->query ) != 2 || ! isset( $query->query['page'] ) ) return;

        // Are we dealing with a page?
        if ( ! empty( $query->query['pagename'] ) && ! is_home() ) {

            // If the page doesn't exist, we must be dealing with a state
            if ( ! is_page( $query->query['pagename'] ) ) {
                $query->set( 'name', $query->query['pagename'] );
                $query->set( 'state', $query->query['pagename'] );
                $query->set( 'post_type', 'state' );
                $query->is_page = 0;
                $query->is_single = 1;
                unset( $query->query_vars['page'] );
                unset( $query->query_vars['pagename'] );
                unset( $query->query['page'] );
                unset( $query->query['pagename'] );
            }
        }

    }

This is hooked into it pre_get_posts.
So, the level one pages work, but not the subpages. The URLs resolve and then hit a 404.
What do I need to do to get this working?
Answer: Preface
Two things before I begin:

You really shouldn't do this. Having static anchors to rewrite rules is there for efficiency. Your best bet is to find a slug that you're happy with -- maybe instead of "state" use "activities" (or whatever your sub-pages are).
Most likely, your sub-pages are not actually states (since you wouldn't have /idaho/vermont/), so this data structure doesn't seem to make much sense. You might consider having "state" be one data structure and "sub-page" be another. If state is a classification, you could make it a taxonomy. If state is more than that, it could be a post type. Here are instructions for setting up rewrites for the former from a WordCamp talk that I gave in Portland, and here are instructions for the latter from another question on this site.

The Code
If you decide to move forward with this structure, here is a singleton class that should work out of the box for you if your post type has 'hierarchical' set to true and 'rewrite' set to false. Be sure to flush your rewrites after adding this to your theme's functions.php file or your plugin (go to Settings → Permalinks and click "Save Changes").
/**
 * Strip the slug out of a hierarchical custom post type
 */

if ( !class_exists( 'State_Rewrites' ) ) :

class State_Rewrites {

    private static $instance;

    public $rules;

    private function __construct() {
        /* Don't do anything, needs to be initialized via instance() method */
    }

    public static function instance() {
        if ( ! isset( self::$instance ) ) {
            self::$instance = new State_Rewrites;
            self::$instance->setup();
        }
        return self::$instance;
    }

    public function setup() {
        add_action( 'init',                array( $this, 'add_rewrites' ),            20 );
        add_filter( 'request',             array( $this, 'check_rewrite_conflicts' )     );
        add_filter( 'state_rewrite_rules', array( $this, 'strip_state_rules' )           );
        add_filter( 'rewrite_rules_array', array( $this, 'inject_state_rules' )          );
    }

    public function add_rewrites() {
        add_rewrite_tag( "%state%", '(.+?)', "state=" );
        add_permastruct( 'state', "%state%", array(
            'ep_mask' => EP_PERMALINK
        ) );
    }

    public function check_rewrite_conflicts( $qv ) {
        if ( isset( $qv['state'] ) ) {
            if ( get_page_by_path( $qv['state'] ) ) {
                $qv = array( 'pagename' => $qv['state'] );
            }
        }
        return $qv;
    }

    public function strip_state_rules( $rules ) {
        $this->rules = $rules;
        # We no longer need the attachment rules, so strip them out
        foreach ( $this->rules as $regex => $value ) {
            if ( strpos( $value, 'attachment' ) )
                unset( $this->rules[ $regex ] );
        }
        return array();
    }

    public function inject_state_rules( $rules ) {
        # This is the first 'page' rule
        $offset = array_search( '(.?.+?)/trackback/?$', array_keys( $rules ) );
        $page_rules = array_slice( $rules, $offset, null, true );
        $other_rules = array_slice( $rules, 0, $offset, true );
        return array_merge( $other_rules, $this->rules, $page_rules );
    }
}

State_Rewrites::instance();

endif;

I thought this topic was interesting and I wrote up a deep explanation of this on my blog. There, I included some slightly more complex code that wasn't as relevant to your specific question.
Comment: Matthew - Thank so much for your time and the detailed response! I implemented it and it worked beautifully..
Comment: @JonathanWold No problem! Just realized I left my post type setup in the code, which I added for testing. I'm going to edit the answer and remove that (so as not to confuse others who come across this). Just an FYI so you can update your copy.
Comment: I'm circling back to this because I discovered that this logic doesn't allow /blog/page/2/ to work (it breaks the query). Would you be up for helping me investigate it further? Also, I noticed that your updated code was missing `"add_permastruct( 'state', "%state%", array(
            'with_front' => false
        ) );"`
Comment: Curious... why does this need to be a singleton?


I don't know where my Ethereum went, or what wallet I created... how can i transfer it to a new wallet?

Question: Going back a few years I made a purchase that is visible in Etherscan. But I am clueless as to where it went, what I bought or where it is now? All I've realised is that I'm as naieve now as I was then. Would like to get this all back under control, so any help greatly appreciated.
I have 2 public adresses: One for Etherwallet and the other for Idex wallet. I think I had to purchase Ethereum to buy POLY. I've unlocked my IDEX wallet with my private key and there is no record at all.
Comment: Without more concrete information (your wallets addressses) there's nothing to reply to your question. Please elaborate more on your question and provide more information
Comment: Thank you for your reply. My public address for Etherwallet is: 0x3780f56e17803518ba66ec5e645a8Ea1Dabd2e89
Comment: And the Idex wallet address is: 0x4ad0fb0672cbb9ef788a134522b0caefaa9dbb7f, this is the address that Ethereum was sent to on 14/2/2018, does that help?
Comment: Are you in the control of `0x4ad0fb0672cbb9ef788a134522b0caefaa9dbb7f` ? Don't know about the first address you sent, but from the latter one there's a deposit to a DEX contract at `0x2a0c0DBEcC7E4D658f48E01e3fA353F44050c208` which you should be able to withdraw without a problem
Comment: Yes I am in control of that address but when I log in there is no record of any transaction, nothing shows at all, so I'm not seeing any record or history.
Answer: I checked your 0x3780f56e17803518ba66ec5e645a8Ea1Dabd2e89 wallet and while no transactions shows up on etherscan it says you have 197 poly or 91 dollars so import your 0x3780f56e17803518ba66ec5e645a8Ea1Dabd2e89 wallet into metamask and then click import token 2 after that import this token address as it is the poly address 0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec  and click add custom token and you should be ready to go
as for the other wallet address, it should be the same steps but it says you only have 3 cents worth of poly and when I call the contract function of Idex balanceOf and input 0x4ad0fb0672cbb9ef788a134522b0caefaa9dbb7f and input the poly token address it says you have 0 poly in their contract so I'm not really sure about that wallet hope this helps best of luck


Did Finwë have parents?

Question: Finwë, father of Fëanor, Fingolfin and Finarfin, and first High King of the Noldor - did he have parents, or was he the first of the Noldor?
Comment: I think he was one of the first elves, and simply woke up after being created by Eru Iluvatar
Answer: Finwë was one of the elves that "awoke" in Cuiviénen during the Years of the Trees. He led the Noldor into Valinor.
So he did not have parents.
Comment: Years of the Two Trees, though, were probably about 10 years of the Sun. That's plenty of time, even for Elves, to breed a new generation or two before sending any ambassadors.
Comment: An Elven "Adam" if you will.
Comment: It only seems obvious - Tolkien never said that
Comment: He didn't say he wasn't. You can only speculate he wasn't, whereas I believe it's implied he is one of the Unbegotten since Orome discovered them, told the other Valar of his discovery, and then returned to invite them to Valinor, choosing three of them (four) to herald them.
Comment: Also the timeline doesn't really make sense as to why Ingwe, Finwe and Elwe would be chosen as ambassadors if they were children. Orome first found the Elves in YTT1085 and it takes him a full 17 years in YTT1102 to choose the ambassadors, he stayed with them in this time. The elves awoke in YTT1050. As we know, Elves take a long time to reproduce and don't do it lightly, so the likelihood is that they were from the original 144.
Answer: Yes
Finwë was a direct descendent (through eldest sons) of Tata, one of the first generation of Elves.
Tolkien wavered a bit about exactly which generation Finwë was from (3rd, 6th or 25th), as he wanted him to be old enough to be chosen as an ambassador to Aman, but yet young enough to still be of marriageable age when they reached Aman.
It seems that Tolkien's final word on the matter was that Finwë was a 25th generation elf.

Oromë and Tulkas return to Valinor, bringing ambassadors or representatives of the Three Companies (young Quendi: Ingwë, Finwë, Elwë, grandsons of Imin, Tata, and Enel).
The Nature of Middle-earth - "Key Dates" c. Feb 1959 - draft

Oromë returns to Cuiviénen, with more mayar. (Melkor becomes suspicious, and guesses war is purposed against him, because of the Quendi. During Oromë's absence his emissaries were busy, and many lies circulate. The "heresy" awakes in new form: the Valar clearly do exist; but they have abandoned Endor: rightly as the appointed realm of the Quendi. Now they are becoming jealous, and wish to control the Quendi as vassals, and so re-possess themselves of Endor. Finwë, a gallant and adventurous young quende, direct descendant of Tata (therefore 25th gen.), is much taken by these ideas; less so his friend Elwë, descendant of Enel.)
The Nature of Middle-earth - "Key Dates" c. Feb 1959

Let Ingwë, Finwë, Elwë all be young 6th gen. Elves, but each a direct descendant (by eldest son) of Imin, Tata, and Enel [respectively]. (Divergence in dates of birth is due to intrusion of earlier-born
daughters.) ... Finwë must have been a later 6th-generation birth. Let Finwë be born in FA 772: 92 at the Finding, 298 at the March. He would have married about FA 1084. He already loved Míriel and postponed marriage till the end of the March.
The Nature of Middle-earth - "Generational Schemes" c. Aug 1959 - Scheme 2

Finwë and Elwë were friends, very adventurous. Olwë, born 2185, was 27 at the Embassy, 47 at the March (Elmo was born on the March). All three were direct descendants or heirs of the Three First Elves and regarded as chieftains.
Ingwë was 24th gen., his children therefore 25th. Finwë was gen. 25, Elwë gen. 25.
The Nature of Middle-earth - "Generational Schemes" c. Aug 1959 - Scheme 7
Answer: nobody knows.
Ingwë, king of the Vanyar and high king of all elves, had a kinswoman Indis, and so was at least a second generation elf.
Elwë (king Thingol Greycloak)  had a brother Olwë and so was at least a second generation elf.
So two of the three leaders fo the Great journey were at least second generation elves and had parents.
Nobody knows about Finwë, although there are probably several online discussions about that.
Comment: @b_jonas: Melkor and Manwe are described as such, as are Namo, Irmo, and Nienna. Nessa and Orome are also siblings. It's in the Valaquenta.
Comment: Eru could have created them as brothers and sisters, like he did some of the Valar.
Comment: My brain can process created siblings - maybe they woke in a shared bed or/and shared a lot of physical traits, but a created kin seems beyond my comprehension. Is it just a less close "created sibling"? Círdan is said to be a kin of Thingol. So who was older. Was Círdan Thingol's lost created sibling's son or vice versa.
Comment: Also the first three elves that awoke had assigned spouses by Eru. He arranged their marriages :S
Comment: @Shamshiel: were some of the Valar brothers and sisters?  Who specifically?  Do you have a reference?
Comment: @Shamshiel: Thanks, I'll look that up later.
Answer: While it's not ever explicitly confirmed, it's unlikely that Finwë was Unbegotten. His first wife was Míriel Serindë. Given that she had a mother-name, it would seem likely that she had a mother. All those who awoke at Cuiviénen awoke with their destined 'soulmates' by order of Eru. If Finwë married a woman who was not Unbegotten, it seems impossible that he himself was one of the First.
In older drafts it seems Finwë and his brothers were intended to be First, but this changed as the Tolkien corpus expanded.
Comment: Can you provide a source for Míriel's mother-name? I can't recall having seen it and have only ever seen the interpretation that Finwë was indeed First.
Comment: The name Míriel means "Jewel-daughter" in Quenya, from mír ("jewel") and -iel ("daughter"). Her **[epessë](http://tolkiengateway.net/wiki/Epess%C3%AB)** Þerindë, or Serindë in the Quenya of Tirion, means "the Broideress", referring to her great skill in embroidery for 'her chief talent was a marvelous dexterity of hand' (reference to The Peoples of Middle Earth; The Shibboleth of Feanor, Page 333) http://tolkiengateway.net/wiki/Míriel . Note that _amilessë_ = "mother name"'
Comment: In case it isn't obvious in my other (cut-and-paste) comment, _The Shibboleth of Feanor_ contradicts the assertion that Serindë is Míriel's mother-name. I don't know of another source that claims it is.

Did Finwë have parents?


How do you fix your tablet if Google Play Services is stopping

Question: How do you keep Google Play Services from stopping or get it to start back up? It has deleted all my apps and is now telling me every time I try to download that I don't have enough space. What do I do?
Comment: Errr...I don't think Google Play Services works on versions earlier than Froyo (2.2).
Answer: maybe you really out of space!
applications are installed in /data directory which is mostly 2gb try to move some of your apps to SD.
About your stopping go back to your Settings > Apps > Google play services, remove if they is any update and clear data and reboot, let the play update itself
Answer: I kept getting the message "Google whatever has quit working" in any of the Google Apps I tried to use.  Here is how I fixed this problem.
I went to Applications in Settings, then went to "all" then scrolled down until I saw the Google applications begin and I stopped them and disabled them and dumped the cache in them all and uninstalled any updates if there was that option available.
Then I turned my tablet off and back on again and it instantly said "Google has stopped" so I reset the tablet by sticking a straight pin in the reset hole on the back of the tablet. I counted to 10 and then turned it back on and immediately went to the play store and started reinstalling everything just like it wasn't in my tablet at all
before or I updated the apps one by one, whichever option was available.  That fixed the problem.
Maybe I went above and beyond but it was easier than trying to figure out exactly which app was causing the issue so that's how I fixed it.


Use of regression-trees to determine probabilities for a binary variable

Question: I have a binary variable (sold/not sold) and I have used the CART algorithm in R (rpart) to build a classification tree to predict if this product is getting sold or not.
Now I would like to add a probability to this. How can I do this?
Can I just take the same Test/Trainingsdata from before and just build a regression tree on it or is this not gonna work?
Can I somehow use the trees I got from the classification?
And how could I evaluate the solution?
Or is there a better approach to deal with this?
Thank you very, very much!
Answer: From predict.rpart "If the rpart object is a classification tree, then the default is to return prob predictions, a matrix whose columns are the probability of the first, second, etc. class", so all you need to do is apply your fitted model to test/new data: predict(model, newdata), where type = "prob" is the default. And if you are not getting that, check if it runs in classification mode (does summary(model) output classes or mean/MSE?) and if not convert your (already binary) response variable to factor <-as.factor(x)  This is almost identical for RF in randomForest.


Does word2vec fail for window size equal to sentence size

Question: Will word2vec fail if sentences contain only similar words, or in other words, if the window size is equal to the sentence size? I suppose this question boils down to whether word to vec considers words from other sentences as negative samples, or only words from the same sentence but outside of the window
Answer: After some testing, it seems that having window size equal to the sentence length does not cause any issues for the model. It must be using other sentences as negative examples.
Comment: Vanilla w2v does NOT produce any negative examples for you. Everything it sees are positive & infers "neural" from the rest.
Answer: You are mechanically fine using sentence size as your window size. All context/target word combinations will be treated as positive cases & things will seem to work.
Logically speaking you also want to make some fraction of negative context/target word pairs to yield better embeddings. You can use the popular negative sampling technique. Roughly, it probabilistically picks word pairs from your vocab that don't exist in your positive set. Like choosing grammatically impossible combinations: ("summer", "actively")
Also, since sentence word counts in natural text varies, using this as a dynamic window size might learn uneven word representations. Not sure if this is good or bad but maybe you could report back what you find?
Answer: Negative sampling aims at maximizing the similarity of the words in the same context and minimizing similarity if they occur in different sentences. However, instead of doing the minimization for all the words in the dictionary except for the context words, it randomly selects a handful of words depending on the training size and uses them to optimize the objective.
If you make context very large you need a lot of training data and training time to train the model to get to good results. So i think negative samples consider word which are out of context.


Why didn't Voldemort realise that he is still not the true owner of the Elder Wand after killing Snape?

Question: I mean, after killing Snape, shouldn't Voldemort have found that the wand in his hand still refused to show greater power for him? Try several random spells, the Dark Lord would find the wand works no better than when Snape is still alive, then he should realise there is something went wrong...
Comment: Voldemort's entire downfall was due to arrogance. I doubt he would have considered the possibility that he was wrong about the Elder Wand's allegiance *twice*. If he had tried several spells with the wand perhaps he would have noticed, but he had no reason - and not much time - to do that.
Comment: I'd be surprised if this wasn't a dupe.
Comment: Well, I believe, the Elder Wand was stronger than his regular wand, but it wasn't operating at full capacity due to him not being the true master, however, it was still stronger than his regular wand.
Answer: It doesn't seem like he did much after that.
All he seemed to do was magnify his voice, cast the killing and Cruciatus curses, and a couple of silencing charms, none of which can visibly be lacking in power.
He did fight in the Battle of Hogwarts, but like PMar said, he wouldn't have noticed.
He frequently was too confident in his own theories and ideas.
He's acted (to his downfall) like this before; leaving the diadem in a room that obviously had been previously explored , just because he didn't want to admit he wasn't invulnerable. Proud people often believe what they want to believe.
''Killing'' Harry might've erased any doubts.
When he accomplished something he frequently blamed his wands for not being able to do, he might've felt it really did work well for him.
Comment: You don't need edit headings as we can tell from the revision history. I also moved the point to what is likely the relevant section but feel free to roll my edit back if you want.
Comment: Actually, he did to a lot of stuff - the silencing charms kept breaking, as did the body bind curse on Neville. And he was duelling like he probably hadn't done in decades against hoardes of people in the great hall. I think there was plenty of time for him to realise the elder wand wasn't working, but he was to euphoric at _finally_ apparently killing Harry Potter and subsequently stopping hundreds of magical people killing him.
Comment: It may be that when Voldemort visited the room of requirement, he had in mind his need for a room that only he knew about, and so the other bric-a-brac wasn't there at the time.
Answer: Voldemort couldn't have noticed that he still didn't command the Elder Wand, because he didn't actually use the wand enough after killing Snape.  His first spell afterwards was the one to send his voice to everyone in the castle - and it would be very difficult for him to detect any weakness in that spell as he can see only one side of its effects.
After that spell, he is waiting for Harry in the Dark Forest, so the next spell he casts is the Avada Kadavra he used on Harry.  He didn't notice any weakness in his command then because (a) The spell also knocked him out (for reasons unrelated to his command of the wand); (b) Narcissa Malfoy lied and said Harry was dead.
The next time he uses the wand is during the Battle of Hogwarts, at which time he is too caught up in the battle to be able to notice the wand not really working for him.  He probably didn't notice until Harry himself pointed it out to him at the end [book, not movie].
Answer: I think the premise is wrong: First, the wand was working fine for him; second, he had no other theories as to possible owners; third, he had no idea what to expect from the wand anyway.
Other answers listed various spells he performed and any failures in those spells were not because of the wand, but because of Harry's sacrifice.  So up until the moment of Voldemort's duel with Harry, the wand was working fine.
Part of the confusion here is that no one really knows what is supposed to be special about the wand, or is even sure that this wand even really is the elder wand of legend.  Supposedly, the brother asked Death for a wand that was more powerful than any other, that made it's master unbeatable in a duel.  Yet we know that many wizards have indeed died while wielding the wand.  So clearly, it didn't work.  But at the moment, Voldemort wasn't in a position to do a scientific comparison of relative power across multiple wands.
Comment: I recall Dumbledore explaining harry that the main reason Voldemort looked for the wand was he believed it will enable him to kill Harry, and that seemed to work out well until he found otherwise at the last minute.
Comment: Emmm...I wonder, if Voldemort didn't except to get significant more power by being the owner of the Elder wand and satisfied at "it just works fine",  why bothering kill Snape? It should be something worthy for the lost of a very good servant.
Comment: In the books, he explains the elder wand doesn't work for him as well as it should.
Comment: @marcellothearcane ["The wand... resists me"](https://www.quotes.net/mquote/115861) You are right.  So should he have not felt this "resistance" change?  Perhaps my answer is wrong.  I would love to ask JK Rowling what this "resistance" felt like.
Comment: @MobyDisk The same weirdness Harry felt from the blackthorn, I should think. Like someone else's hand stitched onto your arm (or words to that effect).


How many series I savings bonds can you buy at 9.62%?

Question: I know the cap is $10,000 but it looks like you can put $10,000 in for each family member.  Can you also do it for an LLC or Trust fund?
Answer:
Can you also do it for an LLC or Trust fund?

Yes. However for disregarded SMLLC or revocable trust, it will still be on your SSN.
There's some contradictory statements about how the limits are enforced on the TreasuryDirect site. See here:

A given Social Security Number or Employer Identification Number can buy up to these amounts in savings bonds each calendar year:

$10,000 in electronic EE bonds
$10,000 in electronic I bonds
$5,000 in paper I bonds that you can buy when you file federal tax forms

However, the note below says:

If you have an individual account and an entity account in TreasuryDirect that use the same Social Security Number, you can purchase up to the limits in each of the 2 accounts.

This article and this article seem to reinforce the notion that the enforcement is actually per account/entity and not per SSN.
Answer: You can purchase up to $10,000 in Series I Savings Bonds at 9.62% per year. There is no limit on the number of family members that you can purchase bonds for, but each individual is limited to $10,000 in bonds. You can also purchase bonds for an LLC or Trust fund, but each entity is again limited to $10,000 in bonds.


Need help determining sample size for logistic regression

Question: I need help determining the sample size necessary for a logistic regression (binary DV) with two continuous predictors and also the sample size necessary if I use three continuous predictors.
Comment: Other duplicate:  https://stats.stackexchange.com/questions/162294/multiple-logistic-regression-power-analysis/396681#396681
Answer: tl;dr For a binary response model (e.g. logistic regression) you need about 15*(# of non-intercept parameters) successes or failures (whichever is less). Estimating a simple linear effect of a continuous predictor takes a single parameter. So in your case you need $\textrm{min}(\textrm{successes},\textrm{failures}) > 30$ (for 2 predictors) or $>45$ (for 3 predictors).
This is laid out clearly in F. Harrell's Regression Modeling Strategies (Springer), pp. 72-73 (you should buy or borrow the book and read the whole thing, but especially Chapter 4):

in many situations a fitted regression model is likely to be reliable when the number of predictors ... $p$ is less than $m/10$ or $m/20$, where $m$ is the "limiting sample size" given in Table 4.1

And here's Table 4.1 (Google Books screenshot)


SQL Server live database backup strategies

Question: I'm trying to come up with a backup strategy for SQL Server 2005. I am thinking of doing full backup once a week, differential backup once a day and transaction log backup every 15 minutes. The database is around 50gb in size. The thing is that the database is live every second of the day. Will the full backup disturb any operations? Do I need to do anything in particular to make backups go smooth without pausing any database operations?
Answer: Backups work perfectly. No interruption of the database. What you will see is higher IO load, obviously, as the backup io performance comes up on top of the disc IO.
In addition, memory requirements are higher than without backups - obviously.
Comment: You mean there's no locking of tables while the dump is made? for full backups I do think it's necessary to lock the tables. For any large table, the effect on a web application would be that "nothing happens"..
Comment: No locking. SQL Server is an enterprise database. It bbrings the db file into a consisstent state and suspends all write operations (hence higher memory load) during a backup, then makes the backup in the background. Locks are only held in memory. Naturally only if you use the backup API.
Comment: Correct, backups don't block, as long as you are using actual SQL backups (or a 3rd-party SQL backup product like Quest Litespeed) and not trying something like backing up the MDF and LDF files from the file system manually.
Answer: Along with what has already been stated, my suggestion is that you should determine what the business requirement is regarding the tolerance for data loss and down time. The fact that you're "thinking" about how to backup the database tells me that you're guessing at what is the appropriate method and timing for backing it up instead of knowing what's required in order to meet your business objective regarding data loss and down time.
Answer: I can only echo joeqwerty. For a serious line of business app where availability and downtime really matter, you have to start with "What is the business requirements around availability and data integrity" and work forwards from that.
Don't just think about backup, think about restore.
How long would it take to restore the DB to last known good state using your proposed scheme?
Do you know? Is that length of time acceptable to the business?
What can the business afford in this area and does that allow you to deliver what they require?
I know it might seem counter-intuitive to think about restore before you've worked out how to back things up, but in the event that something bad does happen then this approach will hurt much less in the long run.
Comment: Yes. Stil lwould take me a week - but I would have a replication system online and use mirroring ;) Failover in seconds, even if hardware burns. Backups should never be used (i.e. they are the last line of defense).
Comment: Not necessarily. Seriously. I run a database - 800gb once filled totally - that is regularly backed up. My restore scenario is one week off. Not SUCH a big problem. But loosing the data woult put me into hell ;)
Comment: Oh I see your point TomTom, but your  business is taking this into account presumably. If the CEO said "In the event of a disaster, this db **must** be online again within 24 hours" you'd change your backup plan to meet the requirements, right?
Answer: There wont be a 'pause' of database operations with a sql server backup, but that doesn't mean performance will not be impacted.  Best practice for this IMHO is to setup a seperate disk just for backup that's seperate to your data and log disk.


ActionScript 3 Object to name value string

Question: In a Flex application I am trying to turn an Object into a QueryString such as name1=value1&name2=value2...  But I am having trouble getting the names of the Objects children. How do I enumerate the names instead of the values?
Thanks
Answer: I'm guessing you're doing a for each(in) loop.  Just do a normal for(in) loop and you'll get the names instead of the values:
for(var name:String in obj) {
  var value:* = obj[name];
  // do whatever you need
}

Comment: If it's a concrete class instead of just an Object, see ObjectUtil.getClassInfo()
Comment: I believe `for(in)` still works on concrete classes, but it's generally more limited on what it returns.  It will only pick up what those classes have set up as visible using the `setPropertyIsEnumerable` method.
Answer: Ok, first off, if you need that query string to actually query a server, you don't really need to get it yourself as this code will query the server for you
protected function callSerivce():void
{
    var o:Object = new Object();
    o.action = "loadBogusData";
    o.val1 = "dsadasd";
    service.send(o);
}

<mx:HTTPService id="service" url="http://www.somewhere.com/file.php" method="GET" showBusyCursor="true"/>

Will make a call to the server like this: http://www.somewhere.com/file.php?action=loadBogusData&val1=dsadasd
But in case you really want to analyze the object by hand, try using ObjectUtil.getClassInfo, it returns a lot of information including all the fields (read more on LiveDocs).


Can a book stored in Kindle be saved as a file on my iMac. Would like to open in Calibre

Question: I bought a Kindle version of a reference book from Amazon. The Kindle reader for the iMac is not my favorite application and I would like to load the book in Calibre and possibly save as a PDF. Or just read it using Calibre. Does anyone know if this is possible?
Answer: In a word yes.
you can connect your Kindle to your Mac and browse through the filesystem and find the books folder and copy the files out.
I have found, however, that the files stored on the Kindle itself are kind of similar to a macOS package format. EG a folder full of files. Rather than deal with that I just logged onto my Amazon account, went to my Kindle purchases and selected a book I want to download. Books being rather small things as downloads go they come across quickly.
And then you have an ".azw" file which is got Amazon's DRM on it. Which means you can only read it on a Kindle signed in to your Amazon account or a Kindle app on another device that is signed in to your Amazon Account.
That can be bypassed, but is beyond the scope of what we can do on AskDifferent. But if you want a hint, google for something like remove DRM from azw files with Calibre. It's not simple but once set up you don't even have to think about it.
Comment: Thanks for your response but I guess I didn't make it clear. The file is on my iMac in the Kindle application.
Comment: I guess you missed my point, download the file from your Amazon account and use Calibre to strip the DRM from that file.
Comment: ok, I did misunderstand. its clear now. Thank you.


exercises for Euclid's Elements

Question: Can you suggest some books with exercises related to Euclid's Elements, or to Euclidean Geometry, as an aid to an undergraduate course on Euclidean Geometry and its history? I need exercises that involve not complicated proofs.
Comment: You can find some on archive.org. Just search "euclid exercises," or something related. Here's one example: https://archive.org/details/euclidbookwithn00euclgoog. Also you can just look for copies of the elements and sometimes they put exercises at the end of each book for schools back in the day. hope that helps, I'm looking for some good exercises as well
Answer: Perhaps you should refer " A sequel to Euclid's elements' first six books" by John Casey, for plane euclidean geometry.

exercises for Euclid's Elements


What happens to heat waste produced by energy generation?

Question: What happens to heat waste produced by energy generation on earth that must be there according to the laws of thermodynamics? So, it never dissipates and remains on earth?
Comment: Related: [the impact on global heat content of human uses of energy](http://physics.stackexchange.com/a/36400/4066)
Answer: Take for example a conventional coal fired power plant as used widely in most countries.
About 40% of the energy from burning the coal is converted to electricity, and the remaining 60% is lost as heat to the environment.
The 40% of the energy that gets converted to heat is used by us consumers and eventually gets converted to heat and is lost as heat to the environment.
So all the energy used by burning coal (or gas, or from nuclear energy) eventually ends up in the environment, where it heats up the air/rivers/seas/whatever. However the amount of heat lost to the environment is small compared to the amount received from the Sun and generated inside the Earth.
Comment: This is correct, but for completeness it's important to note that the Earth also gives off thermal radiation, so the waste heat doesn't exactly stay in the Earth system, but will eventually be lost to space in the form of infra-red light.
Comment: @elcojon Remember that if the atmosphere absorbs infrared light, it will also emit infrared light. When someone says "earth gives off thermal radiation" they generally think of the atmosphere as a part of earth.
Comment: Nathaniel, I would agree to your comment. But we know from astronomy that the atmosphere is absorbing most of the infrared light. So, from this starting point, I would say only a fraction of the thermal radiation of earth escapes to space. Which is very surprising to me.
Comment: **almost** all the energy ends up in the environment at **human** timescales: some of it (a pretty small proportion) gets embodied in chemical bonds and even gravitational potential
Comment: @elcojon Don't forget that if the Earth didn't radiate as much energy as it absorbs (and is released from stored chemical energy etc.), it would heat up. And no, I don't mean global warming, I mean like "boiling the oceans" heat up. So we know that all of the Earth's heat production *is* lost via radiation, on average. Even when radiation is absorbed by the atmosphere, it will be re-radiated shortly after in a random direction. Simplified, the atmosphere will average at an equilibrium temperature with heat production and atmospheric IR absorption (higher temperature -> more radiation).
Answer: The energy does not necessarily remain on earth. Earth maintains an energy balance with its surroundings. The sum of the energy reaching earth through radiation and the energy produced on earth must match the energy leaving earth through radiation. If the latter is too low, earth will warm up, thereby increasing its blackbody radiation and restoring the balance.
However, the energy production on earth (including the production in the core) is generally an extremely small term in this equation.
Answer: Ok so I have done a little reading and the thermosphere absorbs much of the heat coming in, however the mesosphere and thermosphere dont interact very much making it doubtful and of the heat produced on earth is emitted into space. Think of the earth as a closed room the heat we produce is absorbed by atoms closest to the source and dissipates the farther away you get. So you have a number of heat sources warming atoms and molecules the heat is absorbed and spread out till it reaches the average temp for a area, anything above this temp would be a heat source everything below would be a cooling source. Here is the issue in having if the earth is a enclosed space then everything that produces heat is warming the planet, the heat rises compressing the cold air above until it condensates and rains, but as of recently we have had less rain more heat, unusually less winds. The lack of air movement tells me that the air is hot all the way up during the summer time, what ends up happening os the rising heat warms the falling cold air to the point where they equalise stunting weather patterns diring the warm months, and the extra heat being produced during the winter rises rapidly resulting in more powerful storms.
Comment: And most of the incoming heat is absorbed by the thermosphere my theory is the mesospere
Answer: The heat generated by combustion of fossil fuels is slowly building in the environment. Contrary to atmospheric degradation theories. We have gone from a half a million camp fires to burning billions of gallons of oil.
Comment: Actually the heat from fossil fuel burning is not the problem at all.  The Earth absorbs way more energy from the Sun.  The issue is the buildup of CO2 and other greenhouse gases that cause the Earth to trap heat instead of radiating it out into space.


Episerver LinkItemCollection not visible to users

Question: We are using PageTypeBuilder to define our PageTypes, on one page we have a property which represents a Link item collection as below:
<code>[PageTypeProperty(Type = typeof(PropertyLinkCollection), HelpText = "Test links.", EditCaption = "Test links", SortOrder = 11)]
        public virtual LinkItemCollection PageLinks { get; set; }
</code>
We can populate this in CMS editor mode with links, save and publish without any errors. We then have a user control that inherits from EPiServer.UserControlBase and grabs the LinkItemCollection property using the below code and binds it to a repeater:
<code>var links = currentPage.Property["PageLinks"].Value as LinkItemCollection;
if (links != null)
{
    linkRepeater.DataSource = links;
    linkRepeater.DataBind();
}
</code>
If I view the page when logged in as a CMS editor this page works fine and the links parameter is populated correctly, however if I view the page as a normal user and not logged in the links variable is always null (although when I'm debugging I can see the currentPage.Property["PageLinks"] is present, and the type is LinkCollection, its just that the Value is null
Is there something I need to configure here, permissions on a specific page type?
Comment: What happends if you just put a  in your user control or template? Does it render a list of links?
Answer: The problem is most likely one of the pages in the LinkItemCollection not being accessible by outside visitors. Try accessing the links in the collection as an outside visitor and remove any of the links that are in fact locked from outside view.


Use a Switch or Router for PoE on VOIP system

Question: I have a question regarding if a switch or router is the way to go in my situation. We have a modem through Comcast that only has one available port on it right now and we are getting a VOIP system through RingCentral. We are receiving 5 phones that support PoE, most routers I am finding either don't support PoE or they only have 4 ports on them. Can I plug the Switch into the open port on the Modem and have all of them work like they should?
Comment: If the phones are to run on the same network as the other devices, this should be fine in theory.  However without knowing the design, devices (makes/models), or actual current setup, we can't really answer this definitively.
Answer: Switches are where you typically find PoE especially in enterprise-grade equipment.  You should have no issue extending your LAN with a switch on an available port on your cable modem, but you really should have a router/firewall function sitting between your LAN and the WAN from your modem to protect your network.
You can confirm that you are directly connecting your LAN to the modem by the presence of public IP addresses which is a good way to get hacked.  A firewall provides a baseline of protection that you seem to be lacking now.  Be aware that the firewall (on your router) will be providing a NAT function that doesn't always play nicely with SIP packets from your VoIP.  You may need a firewall capable of handling SIP properly or a VoIP system that can support STUN.


To what extent has the war on terror in the Somalia achieved its goals?

Question: Has it been at all effective in getting rid of Al-Shabaab? How has it affected the region?
Edit: I mean the US-led Operation Enduring Freedom - Horn of Africa.
Comment: I mean the US-led intervention which is still going on today
Comment: @sfxedit I've specified.
Comment: By "the war on terror in Somalia", do you mean the Ethiopia-led intervention of 2006-2009, in which the US took part?
Comment: @edelex just a friendly advice to a new user.  don't assume that you are understood just because you alluded to something.  people mostly read this site casually.  they don't try to put their heart and soul into analyzing every little detail you think is important.  a pedantic description will usually do better than an insightful description here.
Comment: One element to consider is what *not* having an anti-Shahaab mission could have resulted in.  I.e. a stalemate may look bad compared to a mission statement of removing Al-Shahaab.  But it compares rather favorably to having the entire country run by Al-Shahaab.  Religious terrorist-run states are a bummer for everyone, not least the locals.
Answer:
To what extent has the war on terror in the Somalia achieved its
goals?

Somalia has gone from anarchy and rule by warlords to a fragile national government with some semblance of peace and rule of law.
Likewise, Somalian piracy, which peaked from 2009-2011, has basically ended.
The fundamentalist Islamist group Al-Shabab's last notable effort killed more than 100 people in car bombings on October 29, 2022 in Mogadishu (a city it controlled until 2011), and it was pushed out of all major cities by mid-2015. But it isn't entirely gone.
Who gets credit for this?
It is hard to say.
As the eons old aphorism that John F. Kennedy repeated explains:

Victory has a thousand fathers, but defeat is an orphan.

The US-led Operation Enduring Freedom - Horn of Africa played some role, as did U.S. military intervention as far back as 1991.
But, the UN Security Council approved African Union peacekeeping force, AMISOM, with about 19,000 troops as of April 1, 2022, with whom the U.S. troops played a supporting role, from 2007-2022 (when it was replaced by the African Union Transition Mission in Somalia, ATMIS, which takes a secondary and supporting role to the Somalian military), as well as the newly recreated military of the Somalian government, starting around 2012, probably played the predominant role.